@epic-web/workshop-app 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{_-D0Tgngwe.js → _-ZHCWB__B.js} +2 -2
- package/build/client/assets/{_-D0Tgngwe.js.map → _-ZHCWB__B.js.map} +1 -1
- package/build/client/assets/_exerciseNumber-BFTlBdr4.js +2 -0
- package/build/client/assets/_exerciseNumber-BFTlBdr4.js.map +1 -0
- package/build/client/assets/{_exerciseNumber_._stepNumber-7kSd_6hH.js → _exerciseNumber_._stepNumber-_687iGFh.js} +2 -2
- package/build/client/assets/{_exerciseNumber_._stepNumber-7kSd_6hH.js.map → _exerciseNumber_._stepNumber-_687iGFh.js.map} +1 -1
- package/build/client/assets/_exerciseNumber_.finished-BEfn-nJi.js +2 -0
- package/build/client/assets/_exerciseNumber_.finished-BEfn-nJi.js.map +1 -0
- package/build/client/assets/{_layout-BwzhY4NI.js → _layout-BLJr2x2F.js} +2 -2
- package/build/client/assets/{_layout-BwzhY4NI.js.map → _layout-BLJr2x2F.js.map} +1 -1
- package/build/client/assets/_layout-BriOqd2R.js +2 -0
- package/build/client/assets/_layout-BriOqd2R.js.map +1 -0
- package/build/client/assets/{_layout-BUs3av-e.js → _layout-Cfbi6StB.js} +2 -2
- package/build/client/assets/{_layout-BUs3av-e.js.map → _layout-Cfbi6StB.js.map} +1 -1
- package/build/client/assets/_layout-frPHZWgR.js +6 -0
- package/build/client/assets/_layout-frPHZWgR.js.map +1 -0
- package/build/client/assets/{accordion-OfO-5m5D.js → accordion-DuE9VejZ.js} +2 -2
- package/build/client/assets/{accordion-OfO-5m5D.js.map → accordion-DuE9VejZ.js.map} +1 -1
- package/build/client/assets/{account-BatJhmSV.js → account-DDuV9rZX.js} +2 -2
- package/build/client/assets/{account-BatJhmSV.js.map → account-DDuV9rZX.js.map} +1 -1
- package/build/client/assets/app-wbMCZEiv.js +2 -0
- package/build/client/assets/{app-CJ9ElQg6.js.map → app-wbMCZEiv.js.map} +1 -1
- package/build/client/assets/{button-EE0aPg10.js → button-CMkJ8p0a.js} +2 -2
- package/build/client/assets/{button-EE0aPg10.js.map → button-CMkJ8p0a.js.map} +1 -1
- package/build/client/assets/{components-CME-nGId.js → components-DZ8XIeZ3.js} +2 -2
- package/build/client/assets/{components-CME-nGId.js.map → components-DZ8XIeZ3.js.map} +1 -1
- package/build/client/assets/diff-B6thd_Sf.js +2 -0
- package/build/client/assets/diff-B6thd_Sf.js.map +1 -0
- package/build/client/assets/diff-BEk79KPK.js +2 -0
- package/build/client/assets/{diff-Cvtc-qzL.js.map → diff-BEk79KPK.js.map} +1 -1
- package/build/client/assets/{discord-BRTW4Rnh.js → discord-C9bVfiZ6.js} +2 -2
- package/build/client/assets/{discord-BRTW4Rnh.js.map → discord-C9bVfiZ6.js.map} +1 -1
- package/build/client/assets/discord-DYeU0QX6.js +2 -0
- package/build/client/assets/discord-DYeU0QX6.js.map +1 -0
- package/build/client/assets/{entry.client-3M2p-8I3.js → entry.client-CW5CUf_W.js} +2 -2
- package/build/client/assets/{entry.client-3M2p-8I3.js.map → entry.client-CW5CUf_W.js.map} +1 -1
- package/build/client/assets/{epic-video-yrWoJVFy.js → epic-video-bs7WmhbC.js} +2 -2
- package/build/client/assets/{epic-video-yrWoJVFy.js.map → epic-video-bs7WmhbC.js.map} +1 -1
- package/build/client/assets/{error-boundary-COkPRBOZ.js → error-boundary-BcGxKpte.js} +2 -2
- package/build/client/assets/{error-boundary-COkPRBOZ.js.map → error-boundary-BcGxKpte.js.map} +1 -1
- package/build/client/assets/finished-C2dgX1d-.js +2 -0
- package/build/client/assets/finished-C2dgX1d-.js.map +1 -0
- package/build/client/assets/{index-BwhlO_gF.js → index-BczhSZ3e.js} +2 -2
- package/build/client/assets/{index-BwhlO_gF.js.map → index-BczhSZ3e.js.map} +1 -1
- package/build/client/assets/{index-CXyf3Reb.js → index-BjNhezSK.js} +2 -2
- package/build/client/assets/{index-CXyf3Reb.js.map → index-BjNhezSK.js.map} +1 -1
- package/build/client/assets/{index-YNIH4TH8.js → index-BvihEwfB.js} +2 -2
- package/build/client/assets/{index-YNIH4TH8.js.map → index-BvihEwfB.js.map} +1 -1
- package/build/client/assets/index-C2yr7Uiu.js +2 -0
- package/build/client/assets/index-C2yr7Uiu.js.map +1 -0
- package/build/client/assets/{index-R-sUGQfT.js → index-CuV1bRbu.js} +2 -2
- package/build/client/assets/{index-R-sUGQfT.js.map → index-CuV1bRbu.js.map} +1 -1
- package/build/client/assets/{index-Dx5GmdYq.js → index-DBrRQJxF.js} +2 -2
- package/build/client/assets/{index-Dx5GmdYq.js.map → index-DBrRQJxF.js.map} +1 -1
- package/build/client/assets/{index-1cKOJFpX.js → index-DF_XBInP.js} +2 -2
- package/build/client/assets/{index-1cKOJFpX.js.map → index-DF_XBInP.js.map} +1 -1
- package/build/client/assets/{index-B-hHvmeV.js → index-YtpQLUzj.js} +2 -2
- package/build/client/assets/{index-B-hHvmeV.js.map → index-YtpQLUzj.js.map} +1 -1
- package/build/client/assets/{loading-sXkYDMsx.js → loading-Br41_Pbf.js} +2 -2
- package/build/client/assets/{loading-sXkYDMsx.js.map → loading-Br41_Pbf.js.map} +1 -1
- package/build/client/assets/{login-Cc73KLYm.js → login-kjV7hrVt.js} +2 -2
- package/build/client/assets/{login-Cc73KLYm.js.map → login-kjV7hrVt.js.map} +1 -1
- package/build/client/assets/manifest-32ad9742.js +1 -0
- package/build/client/assets/{mdx-CpyquP9i.js → mdx-CRxPouxB.js} +2 -2
- package/build/client/assets/{mdx-CpyquP9i.js.map → mdx-CRxPouxB.js.map} +1 -1
- package/build/client/assets/{misc-CxCgA-_O.js → misc-BE75ioh8.js} +2 -2
- package/build/client/assets/{misc-CxCgA-_O.js.map → misc-BE75ioh8.js.map} +1 -1
- package/build/client/assets/{nav-chevrons-g-C0ilNz.js → nav-chevrons-DYiI8EMU.js} +2 -2
- package/build/client/assets/{nav-chevrons-g-C0ilNz.js.map → nav-chevrons-DYiI8EMU.js.map} +1 -1
- package/build/client/assets/{onboarding-B7TLVi2l.js → onboarding-B4Z_yevk.js} +2 -2
- package/build/client/assets/{onboarding-B7TLVi2l.js.map → onboarding-B4Z_yevk.js.map} +1 -1
- package/build/client/assets/{pe-CUZaIcdt.js → pe-CvPIToj6.js} +2 -2
- package/build/client/assets/{pe-CUZaIcdt.js.map → pe-CvPIToj6.js.map} +1 -1
- package/build/client/assets/{presence-Cr--lRCr.js → presence-Dd98AJ_5.js} +2 -2
- package/build/client/assets/{presence-Cr--lRCr.js.map → presence-Dd98AJ_5.js.map} +1 -1
- package/build/client/assets/{preview-C7dtR2VR.js → preview-DZcdG4kw.js} +2 -2
- package/build/client/assets/{preview-C7dtR2VR.js.map → preview-DZcdG4kw.js.map} +1 -1
- package/build/client/assets/{product-BAWG1Vut.js → product-mjsTrqXs.js} +2 -2
- package/build/client/assets/{product-BAWG1Vut.js.map → product-mjsTrqXs.js.map} +1 -1
- package/build/client/assets/{progress-BFm2U-l5.js → progress-Co-59mG2.js} +2 -2
- package/build/client/assets/{progress-BFm2U-l5.js.map → progress-Co-59mG2.js.map} +1 -1
- package/build/client/assets/{progress-bar-D3kudPcr.js → progress-bar-F8_2mvYp.js} +2 -2
- package/build/client/assets/{progress-bar-D3kudPcr.js.map → progress-bar-F8_2mvYp.js.map} +1 -1
- package/build/client/assets/{request-info-CEhUGODY.js → request-info-DGnmXtfj.js} +2 -2
- package/build/client/assets/{request-info-CEhUGODY.js.map → request-info-DGnmXtfj.js.map} +1 -1
- package/build/client/assets/revalidation-ws-DcvYvzyj.js +2 -0
- package/build/client/assets/revalidation-ws-DcvYvzyj.js.map +1 -0
- package/build/client/assets/root-Cl86OUog.js +11 -0
- package/build/client/assets/root-Cl86OUog.js.map +1 -0
- package/build/client/assets/{set-playground-DW0yVaNn.js → set-playground-pMKmtPtz.js} +2 -2
- package/build/client/assets/{set-playground-DW0yVaNn.js.map → set-playground-pMKmtPtz.js.map} +1 -1
- package/build/client/assets/{support-hcqGIpir.js → support-B0E_F4Zh.js} +2 -2
- package/build/client/assets/{support-hcqGIpir.js.map → support-B0E_F4Zh.js.map} +1 -1
- package/build/client/assets/test-B6zIK2V6.js +2 -0
- package/build/client/assets/{test-DbZkv25C.js.map → test-B6zIK2V6.js.map} +1 -1
- package/build/client/assets/{tests-BR7RFlr5.js → tests-BeAEgPAw.js} +2 -2
- package/build/client/assets/{tests-BR7RFlr5.js.map → tests-BeAEgPAw.js.map} +1 -1
- package/build/client/assets/{tooltip-kD4kSf1i.js → tooltip-6-WS-Xux.js} +2 -2
- package/build/client/assets/{tooltip-kD4kSf1i.js.map → tooltip-6-WS-Xux.js.map} +1 -1
- package/build/client/assets/{use-event-source-A_0lEOPX.js → use-event-source-CCGBLG92.js} +2 -2
- package/build/client/assets/{use-event-source-A_0lEOPX.js.map → use-event-source-CCGBLG92.js.map} +1 -1
- package/build/client/assets/{user-DvujSs-t.js → user-Boua6jiU.js} +2 -2
- package/build/client/assets/{user-DvujSs-t.js.map → user-Boua6jiU.js.map} +1 -1
- package/build/client/assets/{workshop-config-CL4F08kr.js → workshop-config-Ce9sSc3I.js} +2 -2
- package/build/client/assets/{workshop-config-CL4F08kr.js.map → workshop-config-Ce9sSc3I.js.map} +1 -1
- package/build/server/index.js +768 -692
- package/build/server/index.js.map +1 -1
- package/dist/server/index.js +83 -34
- package/package.json +4 -4
- package/build/client/assets/_exerciseNumber-1JworToC.js +0 -2
- package/build/client/assets/_exerciseNumber-1JworToC.js.map +0 -1
- package/build/client/assets/_exerciseNumber_.finished-B4D2ZAmj.js +0 -2
- package/build/client/assets/_exerciseNumber_.finished-B4D2ZAmj.js.map +0 -1
- package/build/client/assets/_layout-BPwIOXxN.js +0 -6
- package/build/client/assets/_layout-BPwIOXxN.js.map +0 -1
- package/build/client/assets/_layout-CKnDy_9Z.js +0 -2
- package/build/client/assets/_layout-CKnDy_9Z.js.map +0 -1
- package/build/client/assets/app-CJ9ElQg6.js +0 -2
- package/build/client/assets/diff-Cvtc-qzL.js +0 -2
- package/build/client/assets/diff-jgZ_RGra.js +0 -2
- package/build/client/assets/diff-jgZ_RGra.js.map +0 -1
- package/build/client/assets/discord-BhzUjmbI.js +0 -2
- package/build/client/assets/discord-BhzUjmbI.js.map +0 -1
- package/build/client/assets/finished-Ct6I1SZV.js +0 -2
- package/build/client/assets/finished-Ct6I1SZV.js.map +0 -1
- package/build/client/assets/index-Ccssehd9.js +0 -2
- package/build/client/assets/index-Ccssehd9.js.map +0 -1
- package/build/client/assets/manifest-f5f44d87.js +0 -1
- package/build/client/assets/root-9wVBEzOq.js +0 -68
- package/build/client/assets/root-9wVBEzOq.js.map +0 -1
- package/build/client/assets/test-DbZkv25C.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Qt=Object.defineProperty;var Lt=n=>{throw TypeError(n)};var te=(n,e,i)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var O=(n,e,i)=>te(n,typeof e!="symbol"?e+"":e,i),xt=(n,e,i)=>e.has(n)||Lt("Cannot "+i);var t=(n,e,i)=>(xt(n,e,"read from private field"),i?i.call(n):e.get(n)),m=(n,e,i)=>e.has(n)?Lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),f=(n,e,i,s)=>(xt(n,e,"write to private field"),s?s.call(n,i):e.set(n,i),i),u=(n,e,i)=>(xt(n,e,"access private method"),i);var mt=(n,e,i,s)=>({set _(o){f(n,e,o,i)},get _(){return t(n,e,s)}});import{j as g,r as at}from"./index-1cKOJFpX.js";import{c as St,I as ee,a as ie,H as ht,A as se}from"./misc-CxCgA-_O.js";import{e as ne,L as Ht,a as re,r as oe,u as ae}from"./components-CME-nGId.js";import{V as he,D as le}from"./epic-video-yrWoJVFy.js";import{s as ce}from"./progress-bar-D3kudPcr.js";import{u as ue}from"./pe-CUZaIcdt.js";import{u as fe}from"./request-info-CEhUGODY.js";function de(){const n=ne("root");if(!n)throw new Error("useApps requires a data object from the root loader");return n.apps}function Ut(n){const e=re();return at.useEffect(()=>{e.state==="idle"&&e.data!=null&&(n==null||n("fetcher-done"))},[e,n]),e}function pe({file:n,appFile:e,appName:i,syncTo:s,line:o,column:r,children:a,onUpdate:h}){var _;const c=Ut(h),b=ue(),v=typeof e=="string"?[e]:e,w=n?"file":e?"appFile":"",L=s!=null&&s.file?"file":s!=null&&s.appFile?"appFile":"";return g.jsxs(c.Form,{action:"/launch-editor",method:"POST",className:"flex items-center",children:[b,ce,g.jsx("input",{type:"hidden",name:"line",value:o}),g.jsx("input",{type:"hidden",name:"column",value:r}),g.jsx("input",{type:"hidden",name:"type",value:w}),g.jsx("input",{type:"hidden",name:"file",value:n}),g.jsx("input",{type:"hidden",name:"appName",value:i}),v==null?void 0:v.map(j=>g.jsx("input",{type:"hidden",name:"appFile",value:j},j)),s?g.jsxs(g.Fragment,{children:[g.jsx("input",{type:"hidden",name:"syncTo.type",value:L}),g.jsx("input",{type:"hidden",name:"syncTo.file",value:s.file}),g.jsx("input",{type:"hidden",name:"syncTo.appName",value:s.appName}),g.jsx("input",{type:"hidden",name:"syncTo.appFile",value:s.appFile})]}):null,g.jsx("button",{type:"submit",className:St("launch_button",c.state==="idle"?null:"cursor-progress",((_=c.data)==null?void 0:_.status)==="error"?"cursor-not-allowed":null),children:a})]})}function ge({file:n,appFile:e,appName:i,line:s,children:o}){const r=de(),a=fe();if(Array.isArray(e))return g.jsx("div",{children:"Cannot open more than one file"});if(n){const b=v=>v.replace(/\\/g,"/");return g.jsx("a",{className:"launch_button !no-underline",href:b(n).replace(b(ENV.EPICSHOP_CONTEXT_CWD),ENV.EPICSHOP_GITHUB_ROOT)+(s?`#L${s}`:""),rel:"noreferrer",target:"_blank",children:o})}const h=r.find(b=>b.name===i),c=[...(h==null?void 0:h.relativePath.split(a.separator))??[],e+(s?`#L${s}`:"")].join("/");return g.jsx("a",{className:"launch_button !no-underline",href:`${ENV.EPICSHOP_GITHUB_ROOT}/${c}`,rel:"noreferrer",target:"_blank",children:o})}function We({appFile:n="README.mdx",appName:e,file:i,relativePath:s}){const o=Ut(),r=h=>{if(!h.altKey||ENV.EPICSHOP_DEPLOYED)return;h.preventDefault();const c=new FormData,b=i?"file":"appFile";c.append(b,i??n),c.append("type",b),e&&c.append("appName",e),o.submit(c,{method:"POST",action:"/launch-editor"})},a=ENV.EPICSHOP_GITHUB_ROOT.replace(/\/tree\/|\/blob\//,"/edit/");return g.jsxs(Ht,{className:"self-center font-mono text-sm",onClick:r,target:"_blank",to:`${a}/${s}/${n}`.replace(/\\/g,"/"),children:[g.jsx("span",{className:"block md:hidden",children:"Edit on GitHub"}),g.jsx("span",{className:"hidden md:block",children:"Edit this page on GitHub"})]})}const Vt=ENV.EPICSHOP_DEPLOYED?ge:pe,lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bt=new Set,At=typeof process=="object"&&process?process:{},$t=(n,e,i,s)=>{typeof At.emitWarning=="function"?At.emitWarning(n,e,i,s):console.error(`[${i}] ${e}: ${n}`)};let yt=globalThis.AbortController,It=globalThis.AbortSignal;var Mt;if(typeof yt>"u"){It=class{constructor(){O(this,"onabort");O(this,"_onabort",[]);O(this,"reason");O(this,"aborted",!1)}addEventListener(s,o){this._onabort.push(o)}},yt=class{constructor(){O(this,"signal",new It);e()}abort(s){var o,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const a of this.signal._onabort)a(s);(r=(o=this.signal).onabort)==null||r.call(o,s)}}};let n=((Mt=At.env)==null?void 0:Mt.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,$t("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const me=n=>!Bt.has(n),Q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),qt=n=>Q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?bt:null:null;class bt extends Array{constructor(e){super(e),this.fill(0)}}var ct;const nt=class nt{constructor(e,i){O(this,"heap");O(this,"length");if(!t(nt,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){const i=qt(e);if(!i)return[];f(nt,ct,!0);const s=new nt(e,i);return f(nt,ct,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ct=new WeakMap,m(nt,ct,!1);let Ft=nt;var Gt,kt,U,I,V,B,ut,F,$,A,E,p,R,M,P,T,q,D,X,Y,G,K,it,N,l,Ct,rt,Z,pt,k,Xt,ot,ft,gt,tt,et,Tt,wt,_t,S,Dt,dt;const Rt=class Rt{constructor(e){m(this,l);m(this,U);m(this,I);m(this,V);m(this,B);m(this,ut);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");m(this,F);m(this,$);m(this,A);m(this,E);m(this,p);m(this,R);m(this,M);m(this,P);m(this,T);m(this,q);m(this,D);m(this,X);m(this,Y);m(this,G);m(this,K);m(this,it);m(this,N);m(this,rt,()=>{});m(this,Z,()=>{});m(this,pt,()=>{});m(this,k,()=>!1);m(this,ot,e=>{});m(this,ft,(e,i,s)=>{});m(this,gt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,Gt,"LRUCache");const{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:c,dispose:b,disposeAfter:v,noDisposeOnSet:w,noUpdateTTL:L,maxSize:_=0,maxEntrySize:j=0,sizeCalculation:x,fetchMethod:C,noDeleteOnFetchRejection:d,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:z,ignoreFetchAbort:H}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");const st=i?qt(i):Array;if(!st)throw new Error("invalid max value: "+i);if(f(this,U,i),f(this,I,_),this.maxEntrySize=j||t(this,I),this.sizeCalculation=x,this.sizeCalculation){if(!t(this,I)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ut,C),f(this,it,!!C),f(this,A,new Map),f(this,E,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new st(i)),f(this,M,new st(i)),f(this,P,0),f(this,T,0),f(this,q,Ft.create(i)),f(this,F,0),f(this,$,0),typeof b=="function"&&f(this,V,b),typeof v=="function"?(f(this,B,v),f(this,D,[])):(f(this,B,void 0),f(this,D,void 0)),f(this,K,!!t(this,V)),f(this,N,!!t(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!d,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,I)!==0&&!Q(t(this,I)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");u(this,l,Xt).call(this)}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=Q(o)||o===0?o:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");u(this,l,Ct).call(this)}if(t(this,U)===0&&this.ttl===0&&t(this,I)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,U)&&!t(this,I)){const J="LRU_CACHE_UNBOUNDED";me(J)&&(Bt.add(J),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Rt))}}static unsafeExposeInternals(e){return{starts:t(e,Y),ttls:t(e,G),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,E),valList:t(e,p),next:t(e,R),prev:t(e,M),get head(){return t(e,P)},get tail(){return t(e,T)},free:t(e,q),isBackgroundFetch:i=>{var s;return u(s=e,l,S).call(s,i)},backgroundFetch:(i,s,o,r)=>{var a;return u(a=e,l,_t).call(a,i,s,o,r)},moveToTail:i=>{var s;return u(s=e,l,dt).call(s,i)},indexes:i=>{var s;return u(s=e,l,tt).call(s,i)},rindexes:i=>{var s;return u(s=e,l,et).call(s,i)},isStale:i=>{var s;return t(s=e,k).call(s,i)}}}get max(){return t(this,U)}get maxSize(){return t(this,I)}get calculatedSize(){return t(this,$)}get size(){return t(this,F)}get fetchMethod(){return t(this,ut)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*rentries(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*keys(){for(const e of u(this,l,tt).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*rkeys(){for(const e of u(this,l,et).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*values(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}*rvalues(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}[(kt=Symbol.iterator,Gt=Symbol.toStringTag,kt)](){return this.entries()}find(e,i={}){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r!==void 0&&e(r,t(this,E)[s],this))return this.get(t(this,E)[s],i)}}forEach(e,i=this){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}rforEach(e,i=this){for(const s of u(this,l,et).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}purgeStale(){let e=!1;for(const i of u(this,l,et).call(this,{allowStale:!0}))t(this,k).call(this,i)&&(this.delete(t(this,E)[i]),e=!0);return e}info(e){const i=t(this,A).get(e);if(i===void 0)return;const s=t(this,p)[i],o=u(this,l,S).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;const r={value:o};if(t(this,G)&&t(this,Y)){const a=t(this,G)[i],h=t(this,Y)[i];if(a&&h){const c=a-(lt.now()-h);r.ttl=c,r.start=Date.now()}}return t(this,X)&&(r.size=t(this,X)[i]),r}dump(){const e=[];for(const i of u(this,l,tt).call(this,{allowStale:!0})){const s=t(this,E)[i],o=t(this,p)[i],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r===void 0||s===void 0)continue;const a={value:r};if(t(this,G)&&t(this,Y)){a.ttl=t(this,G)[i];const h=lt.now()-t(this,Y)[i];a.start=Math.floor(Date.now()-h)}t(this,X)&&(a.size=t(this,X)[i]),e.unshift([s,a])}return e}load(e){this.clear();for(const[i,s]of e){if(s.start){const o=Date.now()-s.start;s.start=lt.now()-o}this.set(i,s.value,s)}}set(e,i,s={}){var L,_,j,x,C;if(i===void 0)return this.delete(e),this;const{ttl:o=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s;let{noUpdateTTL:b=this.noUpdateTTL}=s;const v=t(this,gt).call(this,e,i,s.size||0,h);if(this.maxEntrySize&&v>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let w=t(this,F)===0?void 0:t(this,A).get(e);if(w===void 0)w=t(this,F)===0?t(this,T):t(this,q).length!==0?t(this,q).pop():t(this,F)===t(this,U)?u(this,l,wt).call(this,!1):t(this,F),t(this,E)[w]=e,t(this,p)[w]=i,t(this,A).set(e,w),t(this,R)[t(this,T)]=w,t(this,M)[w]=t(this,T),f(this,T,w),mt(this,F)._++,t(this,ft).call(this,w,v,c),c&&(c.set="add"),b=!1;else{u(this,l,dt).call(this,w);const d=t(this,p)[w];if(i!==d){if(t(this,it)&&u(this,l,S).call(this,d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=d;y!==void 0&&!a&&(t(this,K)&&((L=t(this,V))==null||L.call(this,y,e,"set")),t(this,N)&&((_=t(this,D))==null||_.push([y,e,"set"])))}else a||(t(this,K)&&((j=t(this,V))==null||j.call(this,d,e,"set")),t(this,N)&&((x=t(this,D))==null||x.push([d,e,"set"])));if(t(this,ot).call(this,w),t(this,ft).call(this,w,v,c),t(this,p)[w]=i,c){c.set="replace";const y=d&&u(this,l,S).call(this,d)?d.__staleWhileFetching:d;y!==void 0&&(c.oldValue=y)}}else c&&(c.set="update")}if(o!==0&&!t(this,G)&&u(this,l,Ct).call(this),t(this,G)&&(b||t(this,pt).call(this,w,o,r),c&&t(this,Z).call(this,c,w)),!a&&t(this,N)&&t(this,D)){const d=t(this,D);let y;for(;y=d==null?void 0:d.shift();)(C=t(this,B))==null||C.call(this,...y)}return this}pop(){var e;try{for(;t(this,F);){const i=t(this,p)[t(this,P)];if(u(this,l,wt).call(this,!0),u(this,l,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,N)&&t(this,D)){const i=t(this,D);let s;for(;s=i==null?void 0:i.shift();)(e=t(this,B))==null||e.call(this,...s)}}}has(e,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,r=t(this,A).get(e);if(r!==void 0){const a=t(this,p)[r];if(u(this,l,S).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(t(this,k).call(this,r))o&&(o.has="stale",t(this,Z).call(this,o,r));else return s&&t(this,rt).call(this,r),o&&(o.has="hit",t(this,Z).call(this,o,r)),!0}else o&&(o.has="miss");return!1}peek(e,i={}){const{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,k).call(this,o))return;const r=t(this,p)[o];return u(this,l,S).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:b=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:j=this.allowStaleOnFetchAbort,context:x,forceRefresh:C=!1,status:d,signal:y}=i;if(!t(this,it))return d&&(d.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,status:d});const W={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:h,size:c,sizeCalculation:b,noUpdateTTL:v,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:j,ignoreFetchAbort:_,status:d,signal:y};let z=t(this,A).get(e);if(z===void 0){d&&(d.fetch="miss");const H=u(this,l,_t).call(this,e,z,W,x);return H.__returned=H}else{const H=t(this,p)[z];if(u(this,l,S).call(this,H)){const Wt=s&&H.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",Wt&&(d.returnedStale=!0)),Wt?H.__staleWhileFetching:H.__returned=H}const st=t(this,k).call(this,z);if(!C&&!st)return d&&(d.fetch="hit"),u(this,l,dt).call(this,z),o&&t(this,rt).call(this,z),d&&t(this,Z).call(this,d,z),H;const J=u(this,l,_t).call(this,e,z,W,x),Nt=J.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=st?"stale":"refresh",Nt&&st&&(d.returnedStale=!0)),Nt?J.__staleWhileFetching:J.__returned=J}}get(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=i,h=t(this,A).get(e);if(h!==void 0){const c=t(this,p)[h],b=u(this,l,S).call(this,c);return a&&t(this,Z).call(this,a,h),t(this,k).call(this,h)?(a&&(a.get="stale"),b?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?c.__staleWhileFetching:void 0):(r||this.delete(e),a&&s&&(a.returnedStale=!0),s?c:void 0)):(a&&(a.get="hit"),b?c.__staleWhileFetching:(u(this,l,dt).call(this,h),o&&t(this,rt).call(this,h),c))}else a&&(a.get="miss")}delete(e){var s,o,r,a;let i=!1;if(t(this,F)!==0){const h=t(this,A).get(e);if(h!==void 0)if(i=!0,t(this,F)===1)this.clear();else{t(this,ot).call(this,h);const c=t(this,p)[h];if(u(this,l,S).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,K)||t(this,N))&&(t(this,K)&&((s=t(this,V))==null||s.call(this,c,e,"delete")),t(this,N)&&((o=t(this,D))==null||o.push([c,e,"delete"]))),t(this,A).delete(e),t(this,E)[h]=void 0,t(this,p)[h]=void 0,h===t(this,T))f(this,T,t(this,M)[h]);else if(h===t(this,P))f(this,P,t(this,R)[h]);else{const b=t(this,M)[h];t(this,R)[b]=t(this,R)[h];const v=t(this,R)[h];t(this,M)[v]=t(this,M)[h]}mt(this,F)._--,t(this,q).push(h)}}if(t(this,N)&&((r=t(this,D))!=null&&r.length)){const h=t(this,D);let c;for(;c=h==null?void 0:h.shift();)(a=t(this,B))==null||a.call(this,...c)}return i}clear(){var e,i,s;for(const o of u(this,l,et).call(this,{allowStale:!0})){const r=t(this,p)[o];if(u(this,l,S).call(this,r))r.__abortController.abort(new Error("deleted"));else{const a=t(this,E)[o];t(this,K)&&((e=t(this,V))==null||e.call(this,r,a,"delete")),t(this,N)&&((i=t(this,D))==null||i.push([r,a,"delete"]))}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,E).fill(void 0),t(this,G)&&t(this,Y)&&(t(this,G).fill(0),t(this,Y).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,P,0),f(this,T,0),t(this,q).length=0,f(this,$,0),f(this,F,0),t(this,N)&&t(this,D)){const o=t(this,D);let r;for(;r=o==null?void 0:o.shift();)(s=t(this,B))==null||s.call(this,...r)}}};U=new WeakMap,I=new WeakMap,V=new WeakMap,B=new WeakMap,ut=new WeakMap,F=new WeakMap,$=new WeakMap,A=new WeakMap,E=new WeakMap,p=new WeakMap,R=new WeakMap,M=new WeakMap,P=new WeakMap,T=new WeakMap,q=new WeakMap,D=new WeakMap,X=new WeakMap,Y=new WeakMap,G=new WeakMap,K=new WeakMap,it=new WeakMap,N=new WeakMap,l=new WeakSet,Ct=function(){const e=new bt(t(this,U)),i=new bt(t(this,U));f(this,G,e),f(this,Y,i),f(this,pt,(r,a,h=lt.now())=>{if(i[r]=a!==0?h:0,e[r]=a,a!==0&&this.ttlAutopurge){const c=setTimeout(()=>{t(this,k).call(this,r)&&this.delete(t(this,E)[r])},a+1);c.unref&&c.unref()}}),f(this,rt,r=>{i[r]=e[r]!==0?lt.now():0}),f(this,Z,(r,a)=>{if(e[a]){const h=e[a],c=i[a];if(!h||!c)return;r.ttl=h,r.start=c,r.now=s||o();const b=r.now-c;r.remainingTTL=h-b}});let s=0;const o=()=>{const r=lt.now();if(this.ttlResolution>0){s=r;const a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return r};this.getRemainingTTL=r=>{const a=t(this,A).get(r);if(a===void 0)return 0;const h=e[a],c=i[a];if(!h||!c)return 1/0;const b=(s||o())-c;return h-b},f(this,k,r=>{const a=i[r],h=e[r];return!!h&&!!a&&(s||o())-a>h})},rt=new WeakMap,Z=new WeakMap,pt=new WeakMap,k=new WeakMap,Xt=function(){const e=new bt(t(this,U));f(this,$,0),f(this,X,e),f(this,ot,i=>{f(this,$,t(this,$)-e[i]),e[i]=0}),f(this,gt,(i,s,o,r)=>{if(u(this,l,S).call(this,s))return 0;if(!Q(o))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(o=r(s,i),!Q(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),f(this,ft,(i,s,o)=>{if(e[i]=s,t(this,I)){const r=t(this,I)-e[i];for(;t(this,$)>r;)u(this,l,wt).call(this,!0)}f(this,$,t(this,$)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,$))})},ot=new WeakMap,ft=new WeakMap,gt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,P)));)i=t(this,M)[i]},et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,P);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,R)[i]},Tt=function(e){return e!==void 0&&t(this,A).get(t(this,E)[e])===e},wt=function(e){var r,a;const i=t(this,P),s=t(this,E)[i],o=t(this,p)[i];return t(this,it)&&u(this,l,S).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,K)||t(this,N))&&(t(this,K)&&((r=t(this,V))==null||r.call(this,o,s,"evict")),t(this,N)&&((a=t(this,D))==null||a.push([o,s,"evict"]))),t(this,ot).call(this,i),e&&(t(this,E)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,F)===1?(f(this,P,f(this,T,0)),t(this,q).length=0):f(this,P,t(this,R)[i]),t(this,A).delete(s),mt(this,F)._--,i},_t=function(e,i,s,o){const r=i===void 0?void 0:t(this,p)[i];if(u(this,l,S).call(this,r))return r;const a=new yt,{signal:h}=s;h==null||h.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});const c={signal:a.signal,options:s,context:o},b=(x,C=!1)=>{const{aborted:d}=a.signal,y=s.ignoreFetchAbort&&x!==void 0;if(s.status&&(d&&!C?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!y&&!C)return w(a.signal.reason);const W=_;return t(this,p)[i]===_&&(x===void 0?W.__staleWhileFetching?t(this,p)[i]=W.__staleWhileFetching:this.delete(e):(s.status&&(s.status.fetchUpdated=!0),this.set(e,x,c.options))),x},v=x=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=x),w(x)),w=x=>{const{aborted:C}=a.signal,d=C&&s.allowStaleOnFetchAbort,y=d||s.allowStaleOnFetchRejection,W=y||s.noDeleteOnFetchRejection,z=_;if(t(this,p)[i]===_&&(!W||z.__staleWhileFetching===void 0?this.delete(e):d||(t(this,p)[i]=z.__staleWhileFetching)),y)return s.status&&z.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},L=(x,C)=>{var y;const d=(y=t(this,ut))==null?void 0:y.call(this,e,r,c);d&&d instanceof Promise&&d.then(W=>x(W===void 0?void 0:W),C),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(x(void 0),s.allowStaleOnFetchAbort&&(x=W=>b(W,!0)))})};s.status&&(s.status.fetchDispatched=!0);const _=new Promise(L).then(b,v),j=Object.assign(_,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,j,{...c.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=j,j},S=function(e){if(!t(this,it))return!1;const i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof yt},Dt=function(e,i){t(this,M)[i]=e,t(this,R)[e]=i},dt=function(e){e!==t(this,T)&&(e===t(this,P)?f(this,P,t(this,R)[e]):u(this,l,Dt).call(this,t(this,M)[e],t(this,R)[e]),u(this,l,Dt).call(this,t(this,T),e),f(this,T,e))};let jt=Rt;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.getMDXComponent=ye;Et.getMDXExport=Kt;var be=Pt(at),we=Pt(g),_e=Pt(oe);function Yt(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,i=new WeakMap;return(Yt=function(s){return s?i:e})(n)}function Pt(n,e){if(n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=Yt(e);if(i&&i.has(n))return i.get(n);var s={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in n)if(r!=="default"&&{}.hasOwnProperty.call(n,r)){var a=o?Object.getOwnPropertyDescriptor(n,r):null;a&&(a.get||a.set)?Object.defineProperty(s,r,a):s[r]=n[r]}return s.default=n,i&&i.set(n,s),s}function ye(n,e){return Kt(n,e).default}function Kt(n,e){const i={React:be,ReactDOM:_e,_jsx_runtime:we,...e};return new Function(...Object.keys(i),n)(...Object.values(i))}var Se=Et;const Ot=n=>n.replace(/\\/g,"/");function Zt(n,e,i){const[,s]=n.replace(/\\|\//g,e).split(`${i==="playground"?"example":"exercises"}${e}`);return s}const zt="border-border bg-[var(--shiki-background)] hover:bg-foreground/20 active:bg-foreground/30 box-content block rounded border-2 px-2 py-0.5 font-mono text-xs font-semibold outline-none transition duration-300 ease-in-out";function Ee({"data-buttons":n,"data-filename":e,"data-fullpath":i,"data-sep":s="/","data-start":o,"data-type":r}){var L;const a=ae();if(r==="other"||!n||!e||!i)return null;const h=Ot(((L=a[a.type])==null?void 0:L.fullPath)??""),c=!i.startsWith(h),b=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],v=n.split(","),w=b.filter(_=>v.includes(_));return g.jsx(g.Fragment,{children:w.map(_=>{var d;const j=a[_];if(_==="playground"){const y=a.playground&&a.playground.appName!==((d=a.problem)==null?void 0:d.name);if(!j||y||c)return g.jsxs("button",{className:St(zt,"cursor-not-allowed"),title:y?"Playground is not set to the right app":c?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]},_)}if(!j||!j.fullPath)return null;const x=[Ot(j.fullPath),Ot(e)].join(s),C=Zt(x,s,_);return g.jsx(Vt,{file:x,line:Number(o??1),children:g.jsxs("span",{title:C,className:zt,children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]})},_)})})}function xe(){const[n,e]=at.useState(!1);return at.useEffect(()=>{if(n){const i=setTimeout(()=>e(!1),1500);return()=>clearTimeout(i)}},[n]),g.jsx("button",{className:ie(zt,"w-12 uppercase"),onClick:i=>{var r,a,h;e(!0);const o=((h=(a=(r=i.currentTarget.parentElement)==null?void 0:r.parentElement)==null?void 0:a.querySelector("pre"))==null?void 0:h.textContent)||"";navigator.clipboard.writeText(o)},children:n?"copied":"copy"})}function Oe({children:n,...e}){const{"data-buttons":i,"data-filename":s,"data-fullpath":o,"data-nocopy":r,"data-sep":a}=e,h=r===void 0;function c(){if(o&&a)return!s||s.includes("..")?{"data-filename":Zt(o,a)}:{"data-filename":s.replace(/\//g,a)}}return g.jsxs("div",{className:"group relative",children:[g.jsxs("div",{className:"absolute right-0 top-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out focus-within:opacity-100 group-hover:opacity-100",children:[i?g.jsx(Ee,{...e}):null,h?g.jsx(xe,{}):null]}),g.jsx("pre",{...e,className:St("scrollbar-thin scrollbar-thumb-scrollbar",e.className??""),...c(),children:n})]})}const ve={h1:n=>g.jsx(ht,{...n,as:"h1"}),h2:n=>g.jsx(ht,{...n,as:"h2"}),h3:n=>g.jsx(ht,{...n,as:"h3"}),h4:n=>g.jsx(ht,{...n,as:"h4"}),h5:n=>g.jsx(ht,{...n,as:"h5"}),h6:n=>g.jsx(ht,{...n,as:"h6"}),a:se,p:n=>g.jsx("div",{...n}),pre:n=>g.jsx("pre",{...n,className:St("scrollbar-thin scrollbar-thumb-scrollbar",n.className??"")}),LaunchEditor:Vt,VideoEmbed:he,EpicVideo:le};function Ae(n){const e=Se.getMDXComponent(n);function i({components:s,...o}){const r=at.useMemo(()=>({...ve,...s}),[s]);return g.jsx(e,{components:r,...o})}return i}const vt=new jt({max:1e3});function Fe(n){return at.useMemo(()=>{if(vt.has(n))return vt.get(n);const e=Ae(n);return vt.set(n,e),e},[n])}function Me({code:n,components:e}){const i=Fe(n),s=at.useMemo(()=>({Icon:ee,pre:Oe,Link:Ht,...e}),[e]);return g.jsx(i,{components:s})}export{We as E,Vt as L,Me as M};
|
|
2
|
-
//# sourceMappingURL=mdx-
|
|
1
|
+
var Qt=Object.defineProperty;var Lt=n=>{throw TypeError(n)};var te=(n,e,i)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var O=(n,e,i)=>te(n,typeof e!="symbol"?e+"":e,i),xt=(n,e,i)=>e.has(n)||Lt("Cannot "+i);var t=(n,e,i)=>(xt(n,e,"read from private field"),i?i.call(n):e.get(n)),m=(n,e,i)=>e.has(n)?Lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),f=(n,e,i,s)=>(xt(n,e,"write to private field"),s?s.call(n,i):e.set(n,i),i),u=(n,e,i)=>(xt(n,e,"access private method"),i);var mt=(n,e,i,s)=>({set _(o){f(n,e,o,i)},get _(){return t(n,e,s)}});import{j as g,r as at}from"./index-DF_XBInP.js";import{c as St,I as ee,a as ie,H as ht,A as se}from"./misc-BE75ioh8.js";import{e as ne,L as Ht,a as re,r as oe,u as ae}from"./components-DZ8XIeZ3.js";import{V as he,D as le}from"./epic-video-bs7WmhbC.js";import{s as ce}from"./progress-bar-F8_2mvYp.js";import{u as ue}from"./pe-CvPIToj6.js";import{u as fe}from"./request-info-DGnmXtfj.js";function de(){const n=ne("root");if(!n)throw new Error("useApps requires a data object from the root loader");return n.apps}function Ut(n){const e=re();return at.useEffect(()=>{e.state==="idle"&&e.data!=null&&(n==null||n("fetcher-done"))},[e,n]),e}function pe({file:n,appFile:e,appName:i,syncTo:s,line:o,column:r,children:a,onUpdate:h}){var _;const c=Ut(h),b=ue(),v=typeof e=="string"?[e]:e,w=n?"file":e?"appFile":"",L=s!=null&&s.file?"file":s!=null&&s.appFile?"appFile":"";return g.jsxs(c.Form,{action:"/launch-editor",method:"POST",className:"flex items-center",children:[b,ce,g.jsx("input",{type:"hidden",name:"line",value:o}),g.jsx("input",{type:"hidden",name:"column",value:r}),g.jsx("input",{type:"hidden",name:"type",value:w}),g.jsx("input",{type:"hidden",name:"file",value:n}),g.jsx("input",{type:"hidden",name:"appName",value:i}),v==null?void 0:v.map(j=>g.jsx("input",{type:"hidden",name:"appFile",value:j},j)),s?g.jsxs(g.Fragment,{children:[g.jsx("input",{type:"hidden",name:"syncTo.type",value:L}),g.jsx("input",{type:"hidden",name:"syncTo.file",value:s.file}),g.jsx("input",{type:"hidden",name:"syncTo.appName",value:s.appName}),g.jsx("input",{type:"hidden",name:"syncTo.appFile",value:s.appFile})]}):null,g.jsx("button",{type:"submit",className:St("launch_button",c.state==="idle"?null:"cursor-progress",((_=c.data)==null?void 0:_.status)==="error"?"cursor-not-allowed":null),children:a})]})}function ge({file:n,appFile:e,appName:i,line:s,children:o}){const r=de(),a=fe();if(Array.isArray(e))return g.jsx("div",{children:"Cannot open more than one file"});if(n){const b=v=>v.replace(/\\/g,"/");return g.jsx("a",{className:"launch_button !no-underline",href:b(n).replace(b(ENV.EPICSHOP_CONTEXT_CWD),ENV.EPICSHOP_GITHUB_ROOT)+(s?`#L${s}`:""),rel:"noreferrer",target:"_blank",children:o})}const h=r.find(b=>b.name===i),c=[...(h==null?void 0:h.relativePath.split(a.separator))??[],e+(s?`#L${s}`:"")].join("/");return g.jsx("a",{className:"launch_button !no-underline",href:`${ENV.EPICSHOP_GITHUB_ROOT}/${c}`,rel:"noreferrer",target:"_blank",children:o})}function We({appFile:n="README.mdx",appName:e,file:i,relativePath:s}){const o=Ut(),r=h=>{if(!h.altKey||ENV.EPICSHOP_DEPLOYED)return;h.preventDefault();const c=new FormData,b=i?"file":"appFile";c.append(b,i??n),c.append("type",b),e&&c.append("appName",e),o.submit(c,{method:"POST",action:"/launch-editor"})},a=ENV.EPICSHOP_GITHUB_ROOT.replace(/\/tree\/|\/blob\//,"/edit/");return g.jsxs(Ht,{className:"self-center font-mono text-sm",onClick:r,target:"_blank",to:`${a}/${s}/${n}`.replace(/\\/g,"/"),children:[g.jsx("span",{className:"block md:hidden",children:"Edit on GitHub"}),g.jsx("span",{className:"hidden md:block",children:"Edit this page on GitHub"})]})}const Vt=ENV.EPICSHOP_DEPLOYED?ge:pe,lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bt=new Set,At=typeof process=="object"&&process?process:{},$t=(n,e,i,s)=>{typeof At.emitWarning=="function"?At.emitWarning(n,e,i,s):console.error(`[${i}] ${e}: ${n}`)};let yt=globalThis.AbortController,It=globalThis.AbortSignal;var Mt;if(typeof yt>"u"){It=class{constructor(){O(this,"onabort");O(this,"_onabort",[]);O(this,"reason");O(this,"aborted",!1)}addEventListener(s,o){this._onabort.push(o)}},yt=class{constructor(){O(this,"signal",new It);e()}abort(s){var o,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const a of this.signal._onabort)a(s);(r=(o=this.signal).onabort)==null||r.call(o,s)}}};let n=((Mt=At.env)==null?void 0:Mt.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,$t("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const me=n=>!Bt.has(n),Q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),qt=n=>Q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?bt:null:null;class bt extends Array{constructor(e){super(e),this.fill(0)}}var ct;const nt=class nt{constructor(e,i){O(this,"heap");O(this,"length");if(!t(nt,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){const i=qt(e);if(!i)return[];f(nt,ct,!0);const s=new nt(e,i);return f(nt,ct,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ct=new WeakMap,m(nt,ct,!1);let Ft=nt;var Gt,kt,U,I,V,B,ut,F,$,A,E,p,R,M,P,T,q,D,X,Y,G,K,it,N,l,Ct,rt,Z,pt,k,Xt,ot,ft,gt,tt,et,Tt,wt,_t,S,Dt,dt;const Rt=class Rt{constructor(e){m(this,l);m(this,U);m(this,I);m(this,V);m(this,B);m(this,ut);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");m(this,F);m(this,$);m(this,A);m(this,E);m(this,p);m(this,R);m(this,M);m(this,P);m(this,T);m(this,q);m(this,D);m(this,X);m(this,Y);m(this,G);m(this,K);m(this,it);m(this,N);m(this,rt,()=>{});m(this,Z,()=>{});m(this,pt,()=>{});m(this,k,()=>!1);m(this,ot,e=>{});m(this,ft,(e,i,s)=>{});m(this,gt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,Gt,"LRUCache");const{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:c,dispose:b,disposeAfter:v,noDisposeOnSet:w,noUpdateTTL:L,maxSize:_=0,maxEntrySize:j=0,sizeCalculation:x,fetchMethod:C,noDeleteOnFetchRejection:d,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:z,ignoreFetchAbort:H}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");const st=i?qt(i):Array;if(!st)throw new Error("invalid max value: "+i);if(f(this,U,i),f(this,I,_),this.maxEntrySize=j||t(this,I),this.sizeCalculation=x,this.sizeCalculation){if(!t(this,I)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ut,C),f(this,it,!!C),f(this,A,new Map),f(this,E,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new st(i)),f(this,M,new st(i)),f(this,P,0),f(this,T,0),f(this,q,Ft.create(i)),f(this,F,0),f(this,$,0),typeof b=="function"&&f(this,V,b),typeof v=="function"?(f(this,B,v),f(this,D,[])):(f(this,B,void 0),f(this,D,void 0)),f(this,K,!!t(this,V)),f(this,N,!!t(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!d,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,I)!==0&&!Q(t(this,I)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");u(this,l,Xt).call(this)}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=Q(o)||o===0?o:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");u(this,l,Ct).call(this)}if(t(this,U)===0&&this.ttl===0&&t(this,I)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,U)&&!t(this,I)){const J="LRU_CACHE_UNBOUNDED";me(J)&&(Bt.add(J),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Rt))}}static unsafeExposeInternals(e){return{starts:t(e,Y),ttls:t(e,G),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,E),valList:t(e,p),next:t(e,R),prev:t(e,M),get head(){return t(e,P)},get tail(){return t(e,T)},free:t(e,q),isBackgroundFetch:i=>{var s;return u(s=e,l,S).call(s,i)},backgroundFetch:(i,s,o,r)=>{var a;return u(a=e,l,_t).call(a,i,s,o,r)},moveToTail:i=>{var s;return u(s=e,l,dt).call(s,i)},indexes:i=>{var s;return u(s=e,l,tt).call(s,i)},rindexes:i=>{var s;return u(s=e,l,et).call(s,i)},isStale:i=>{var s;return t(s=e,k).call(s,i)}}}get max(){return t(this,U)}get maxSize(){return t(this,I)}get calculatedSize(){return t(this,$)}get size(){return t(this,F)}get fetchMethod(){return t(this,ut)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*rentries(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*keys(){for(const e of u(this,l,tt).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*rkeys(){for(const e of u(this,l,et).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*values(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}*rvalues(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}[(kt=Symbol.iterator,Gt=Symbol.toStringTag,kt)](){return this.entries()}find(e,i={}){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r!==void 0&&e(r,t(this,E)[s],this))return this.get(t(this,E)[s],i)}}forEach(e,i=this){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}rforEach(e,i=this){for(const s of u(this,l,et).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}purgeStale(){let e=!1;for(const i of u(this,l,et).call(this,{allowStale:!0}))t(this,k).call(this,i)&&(this.delete(t(this,E)[i]),e=!0);return e}info(e){const i=t(this,A).get(e);if(i===void 0)return;const s=t(this,p)[i],o=u(this,l,S).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;const r={value:o};if(t(this,G)&&t(this,Y)){const a=t(this,G)[i],h=t(this,Y)[i];if(a&&h){const c=a-(lt.now()-h);r.ttl=c,r.start=Date.now()}}return t(this,X)&&(r.size=t(this,X)[i]),r}dump(){const e=[];for(const i of u(this,l,tt).call(this,{allowStale:!0})){const s=t(this,E)[i],o=t(this,p)[i],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r===void 0||s===void 0)continue;const a={value:r};if(t(this,G)&&t(this,Y)){a.ttl=t(this,G)[i];const h=lt.now()-t(this,Y)[i];a.start=Math.floor(Date.now()-h)}t(this,X)&&(a.size=t(this,X)[i]),e.unshift([s,a])}return e}load(e){this.clear();for(const[i,s]of e){if(s.start){const o=Date.now()-s.start;s.start=lt.now()-o}this.set(i,s.value,s)}}set(e,i,s={}){var L,_,j,x,C;if(i===void 0)return this.delete(e),this;const{ttl:o=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s;let{noUpdateTTL:b=this.noUpdateTTL}=s;const v=t(this,gt).call(this,e,i,s.size||0,h);if(this.maxEntrySize&&v>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let w=t(this,F)===0?void 0:t(this,A).get(e);if(w===void 0)w=t(this,F)===0?t(this,T):t(this,q).length!==0?t(this,q).pop():t(this,F)===t(this,U)?u(this,l,wt).call(this,!1):t(this,F),t(this,E)[w]=e,t(this,p)[w]=i,t(this,A).set(e,w),t(this,R)[t(this,T)]=w,t(this,M)[w]=t(this,T),f(this,T,w),mt(this,F)._++,t(this,ft).call(this,w,v,c),c&&(c.set="add"),b=!1;else{u(this,l,dt).call(this,w);const d=t(this,p)[w];if(i!==d){if(t(this,it)&&u(this,l,S).call(this,d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=d;y!==void 0&&!a&&(t(this,K)&&((L=t(this,V))==null||L.call(this,y,e,"set")),t(this,N)&&((_=t(this,D))==null||_.push([y,e,"set"])))}else a||(t(this,K)&&((j=t(this,V))==null||j.call(this,d,e,"set")),t(this,N)&&((x=t(this,D))==null||x.push([d,e,"set"])));if(t(this,ot).call(this,w),t(this,ft).call(this,w,v,c),t(this,p)[w]=i,c){c.set="replace";const y=d&&u(this,l,S).call(this,d)?d.__staleWhileFetching:d;y!==void 0&&(c.oldValue=y)}}else c&&(c.set="update")}if(o!==0&&!t(this,G)&&u(this,l,Ct).call(this),t(this,G)&&(b||t(this,pt).call(this,w,o,r),c&&t(this,Z).call(this,c,w)),!a&&t(this,N)&&t(this,D)){const d=t(this,D);let y;for(;y=d==null?void 0:d.shift();)(C=t(this,B))==null||C.call(this,...y)}return this}pop(){var e;try{for(;t(this,F);){const i=t(this,p)[t(this,P)];if(u(this,l,wt).call(this,!0),u(this,l,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,N)&&t(this,D)){const i=t(this,D);let s;for(;s=i==null?void 0:i.shift();)(e=t(this,B))==null||e.call(this,...s)}}}has(e,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,r=t(this,A).get(e);if(r!==void 0){const a=t(this,p)[r];if(u(this,l,S).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(t(this,k).call(this,r))o&&(o.has="stale",t(this,Z).call(this,o,r));else return s&&t(this,rt).call(this,r),o&&(o.has="hit",t(this,Z).call(this,o,r)),!0}else o&&(o.has="miss");return!1}peek(e,i={}){const{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,k).call(this,o))return;const r=t(this,p)[o];return u(this,l,S).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:b=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:j=this.allowStaleOnFetchAbort,context:x,forceRefresh:C=!1,status:d,signal:y}=i;if(!t(this,it))return d&&(d.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,status:d});const W={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:h,size:c,sizeCalculation:b,noUpdateTTL:v,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:j,ignoreFetchAbort:_,status:d,signal:y};let z=t(this,A).get(e);if(z===void 0){d&&(d.fetch="miss");const H=u(this,l,_t).call(this,e,z,W,x);return H.__returned=H}else{const H=t(this,p)[z];if(u(this,l,S).call(this,H)){const Wt=s&&H.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",Wt&&(d.returnedStale=!0)),Wt?H.__staleWhileFetching:H.__returned=H}const st=t(this,k).call(this,z);if(!C&&!st)return d&&(d.fetch="hit"),u(this,l,dt).call(this,z),o&&t(this,rt).call(this,z),d&&t(this,Z).call(this,d,z),H;const J=u(this,l,_t).call(this,e,z,W,x),Nt=J.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=st?"stale":"refresh",Nt&&st&&(d.returnedStale=!0)),Nt?J.__staleWhileFetching:J.__returned=J}}get(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=i,h=t(this,A).get(e);if(h!==void 0){const c=t(this,p)[h],b=u(this,l,S).call(this,c);return a&&t(this,Z).call(this,a,h),t(this,k).call(this,h)?(a&&(a.get="stale"),b?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?c.__staleWhileFetching:void 0):(r||this.delete(e),a&&s&&(a.returnedStale=!0),s?c:void 0)):(a&&(a.get="hit"),b?c.__staleWhileFetching:(u(this,l,dt).call(this,h),o&&t(this,rt).call(this,h),c))}else a&&(a.get="miss")}delete(e){var s,o,r,a;let i=!1;if(t(this,F)!==0){const h=t(this,A).get(e);if(h!==void 0)if(i=!0,t(this,F)===1)this.clear();else{t(this,ot).call(this,h);const c=t(this,p)[h];if(u(this,l,S).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,K)||t(this,N))&&(t(this,K)&&((s=t(this,V))==null||s.call(this,c,e,"delete")),t(this,N)&&((o=t(this,D))==null||o.push([c,e,"delete"]))),t(this,A).delete(e),t(this,E)[h]=void 0,t(this,p)[h]=void 0,h===t(this,T))f(this,T,t(this,M)[h]);else if(h===t(this,P))f(this,P,t(this,R)[h]);else{const b=t(this,M)[h];t(this,R)[b]=t(this,R)[h];const v=t(this,R)[h];t(this,M)[v]=t(this,M)[h]}mt(this,F)._--,t(this,q).push(h)}}if(t(this,N)&&((r=t(this,D))!=null&&r.length)){const h=t(this,D);let c;for(;c=h==null?void 0:h.shift();)(a=t(this,B))==null||a.call(this,...c)}return i}clear(){var e,i,s;for(const o of u(this,l,et).call(this,{allowStale:!0})){const r=t(this,p)[o];if(u(this,l,S).call(this,r))r.__abortController.abort(new Error("deleted"));else{const a=t(this,E)[o];t(this,K)&&((e=t(this,V))==null||e.call(this,r,a,"delete")),t(this,N)&&((i=t(this,D))==null||i.push([r,a,"delete"]))}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,E).fill(void 0),t(this,G)&&t(this,Y)&&(t(this,G).fill(0),t(this,Y).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,P,0),f(this,T,0),t(this,q).length=0,f(this,$,0),f(this,F,0),t(this,N)&&t(this,D)){const o=t(this,D);let r;for(;r=o==null?void 0:o.shift();)(s=t(this,B))==null||s.call(this,...r)}}};U=new WeakMap,I=new WeakMap,V=new WeakMap,B=new WeakMap,ut=new WeakMap,F=new WeakMap,$=new WeakMap,A=new WeakMap,E=new WeakMap,p=new WeakMap,R=new WeakMap,M=new WeakMap,P=new WeakMap,T=new WeakMap,q=new WeakMap,D=new WeakMap,X=new WeakMap,Y=new WeakMap,G=new WeakMap,K=new WeakMap,it=new WeakMap,N=new WeakMap,l=new WeakSet,Ct=function(){const e=new bt(t(this,U)),i=new bt(t(this,U));f(this,G,e),f(this,Y,i),f(this,pt,(r,a,h=lt.now())=>{if(i[r]=a!==0?h:0,e[r]=a,a!==0&&this.ttlAutopurge){const c=setTimeout(()=>{t(this,k).call(this,r)&&this.delete(t(this,E)[r])},a+1);c.unref&&c.unref()}}),f(this,rt,r=>{i[r]=e[r]!==0?lt.now():0}),f(this,Z,(r,a)=>{if(e[a]){const h=e[a],c=i[a];if(!h||!c)return;r.ttl=h,r.start=c,r.now=s||o();const b=r.now-c;r.remainingTTL=h-b}});let s=0;const o=()=>{const r=lt.now();if(this.ttlResolution>0){s=r;const a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return r};this.getRemainingTTL=r=>{const a=t(this,A).get(r);if(a===void 0)return 0;const h=e[a],c=i[a];if(!h||!c)return 1/0;const b=(s||o())-c;return h-b},f(this,k,r=>{const a=i[r],h=e[r];return!!h&&!!a&&(s||o())-a>h})},rt=new WeakMap,Z=new WeakMap,pt=new WeakMap,k=new WeakMap,Xt=function(){const e=new bt(t(this,U));f(this,$,0),f(this,X,e),f(this,ot,i=>{f(this,$,t(this,$)-e[i]),e[i]=0}),f(this,gt,(i,s,o,r)=>{if(u(this,l,S).call(this,s))return 0;if(!Q(o))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(o=r(s,i),!Q(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),f(this,ft,(i,s,o)=>{if(e[i]=s,t(this,I)){const r=t(this,I)-e[i];for(;t(this,$)>r;)u(this,l,wt).call(this,!0)}f(this,$,t(this,$)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,$))})},ot=new WeakMap,ft=new WeakMap,gt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,P)));)i=t(this,M)[i]},et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,P);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,R)[i]},Tt=function(e){return e!==void 0&&t(this,A).get(t(this,E)[e])===e},wt=function(e){var r,a;const i=t(this,P),s=t(this,E)[i],o=t(this,p)[i];return t(this,it)&&u(this,l,S).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,K)||t(this,N))&&(t(this,K)&&((r=t(this,V))==null||r.call(this,o,s,"evict")),t(this,N)&&((a=t(this,D))==null||a.push([o,s,"evict"]))),t(this,ot).call(this,i),e&&(t(this,E)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,F)===1?(f(this,P,f(this,T,0)),t(this,q).length=0):f(this,P,t(this,R)[i]),t(this,A).delete(s),mt(this,F)._--,i},_t=function(e,i,s,o){const r=i===void 0?void 0:t(this,p)[i];if(u(this,l,S).call(this,r))return r;const a=new yt,{signal:h}=s;h==null||h.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});const c={signal:a.signal,options:s,context:o},b=(x,C=!1)=>{const{aborted:d}=a.signal,y=s.ignoreFetchAbort&&x!==void 0;if(s.status&&(d&&!C?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!y&&!C)return w(a.signal.reason);const W=_;return t(this,p)[i]===_&&(x===void 0?W.__staleWhileFetching?t(this,p)[i]=W.__staleWhileFetching:this.delete(e):(s.status&&(s.status.fetchUpdated=!0),this.set(e,x,c.options))),x},v=x=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=x),w(x)),w=x=>{const{aborted:C}=a.signal,d=C&&s.allowStaleOnFetchAbort,y=d||s.allowStaleOnFetchRejection,W=y||s.noDeleteOnFetchRejection,z=_;if(t(this,p)[i]===_&&(!W||z.__staleWhileFetching===void 0?this.delete(e):d||(t(this,p)[i]=z.__staleWhileFetching)),y)return s.status&&z.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},L=(x,C)=>{var y;const d=(y=t(this,ut))==null?void 0:y.call(this,e,r,c);d&&d instanceof Promise&&d.then(W=>x(W===void 0?void 0:W),C),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(x(void 0),s.allowStaleOnFetchAbort&&(x=W=>b(W,!0)))})};s.status&&(s.status.fetchDispatched=!0);const _=new Promise(L).then(b,v),j=Object.assign(_,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,j,{...c.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=j,j},S=function(e){if(!t(this,it))return!1;const i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof yt},Dt=function(e,i){t(this,M)[i]=e,t(this,R)[e]=i},dt=function(e){e!==t(this,T)&&(e===t(this,P)?f(this,P,t(this,R)[e]):u(this,l,Dt).call(this,t(this,M)[e],t(this,R)[e]),u(this,l,Dt).call(this,t(this,T),e),f(this,T,e))};let jt=Rt;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.getMDXComponent=ye;Et.getMDXExport=Kt;var be=Pt(at),we=Pt(g),_e=Pt(oe);function Yt(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,i=new WeakMap;return(Yt=function(s){return s?i:e})(n)}function Pt(n,e){if(n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=Yt(e);if(i&&i.has(n))return i.get(n);var s={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in n)if(r!=="default"&&{}.hasOwnProperty.call(n,r)){var a=o?Object.getOwnPropertyDescriptor(n,r):null;a&&(a.get||a.set)?Object.defineProperty(s,r,a):s[r]=n[r]}return s.default=n,i&&i.set(n,s),s}function ye(n,e){return Kt(n,e).default}function Kt(n,e){const i={React:be,ReactDOM:_e,_jsx_runtime:we,...e};return new Function(...Object.keys(i),n)(...Object.values(i))}var Se=Et;const Ot=n=>n.replace(/\\/g,"/");function Zt(n,e,i){const[,s]=n.replace(/\\|\//g,e).split(`${i==="playground"?"example":"exercises"}${e}`);return s}const zt="border-border bg-[var(--shiki-background)] hover:bg-foreground/20 active:bg-foreground/30 box-content block rounded border-2 px-2 py-0.5 font-mono text-xs font-semibold outline-none transition duration-300 ease-in-out";function Ee({"data-buttons":n,"data-filename":e,"data-fullpath":i,"data-sep":s="/","data-start":o,"data-type":r}){var L;const a=ae();if(r==="other"||!n||!e||!i)return null;const h=Ot(((L=a[a.type])==null?void 0:L.fullPath)??""),c=!i.startsWith(h),b=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],v=n.split(","),w=b.filter(_=>v.includes(_));return g.jsx(g.Fragment,{children:w.map(_=>{var d;const j=a[_];if(_==="playground"){const y=a.playground&&a.playground.appName!==((d=a.problem)==null?void 0:d.name);if(!j||y||c)return g.jsxs("button",{className:St(zt,"cursor-not-allowed"),title:y?"Playground is not set to the right app":c?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]},_)}if(!j||!j.fullPath)return null;const x=[Ot(j.fullPath),Ot(e)].join(s),C=Zt(x,s,_);return g.jsx(Vt,{file:x,line:Number(o??1),children:g.jsxs("span",{title:C,className:zt,children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]})},_)})})}function xe(){const[n,e]=at.useState(!1);return at.useEffect(()=>{if(n){const i=setTimeout(()=>e(!1),1500);return()=>clearTimeout(i)}},[n]),g.jsx("button",{className:ie(zt,"w-12 uppercase"),onClick:i=>{var r,a,h;e(!0);const o=((h=(a=(r=i.currentTarget.parentElement)==null?void 0:r.parentElement)==null?void 0:a.querySelector("pre"))==null?void 0:h.textContent)||"";navigator.clipboard.writeText(o)},children:n?"copied":"copy"})}function Oe({children:n,...e}){const{"data-buttons":i,"data-filename":s,"data-fullpath":o,"data-nocopy":r,"data-sep":a}=e,h=r===void 0;function c(){if(o&&a)return!s||s.includes("..")?{"data-filename":Zt(o,a)}:{"data-filename":s.replace(/\//g,a)}}return g.jsxs("div",{className:"group relative",children:[g.jsxs("div",{className:"absolute right-0 top-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out focus-within:opacity-100 group-hover:opacity-100",children:[i?g.jsx(Ee,{...e}):null,h?g.jsx(xe,{}):null]}),g.jsx("pre",{...e,className:St("scrollbar-thin scrollbar-thumb-scrollbar",e.className??""),...c(),children:n})]})}const ve={h1:n=>g.jsx(ht,{...n,as:"h1"}),h2:n=>g.jsx(ht,{...n,as:"h2"}),h3:n=>g.jsx(ht,{...n,as:"h3"}),h4:n=>g.jsx(ht,{...n,as:"h4"}),h5:n=>g.jsx(ht,{...n,as:"h5"}),h6:n=>g.jsx(ht,{...n,as:"h6"}),a:se,p:n=>g.jsx("div",{...n}),pre:n=>g.jsx("pre",{...n,className:St("scrollbar-thin scrollbar-thumb-scrollbar",n.className??"")}),LaunchEditor:Vt,VideoEmbed:he,EpicVideo:le};function Ae(n){const e=Se.getMDXComponent(n);function i({components:s,...o}){const r=at.useMemo(()=>({...ve,...s}),[s]);return g.jsx(e,{components:r,...o})}return i}const vt=new jt({max:1e3});function Fe(n){return at.useMemo(()=>{if(vt.has(n))return vt.get(n);const e=Ae(n);return vt.set(n,e),e},[n])}function Me({code:n,components:e}){const i=Fe(n),s=at.useMemo(()=>({Icon:ee,pre:Oe,Link:Ht,...e}),[e]);return g.jsx(i,{components:s})}export{We as E,Vt as L,Me as M,de as u};
|
|
2
|
+
//# sourceMappingURL=mdx-CRxPouxB.js.map
|