-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-GDPO7DUK.js
2 lines (2 loc) · 4.64 KB
/
chunk-GDPO7DUK.js
1
2
import{a as u}from"./chunk-QYZVNRX4.js";import{a as P}from"./chunk-ZCBIOHGO.js";import{a as w,c as m}from"./chunk-OJEOMSFO.js";import{r as s}from"./chunk-Q4G5UL72.js";var k=["UR","DR","DL","UL"],b=["U","R","D","L","ALL"],R=k.concat(b);function d(){let e=0;function r(){let n=u(12);return n!==0&&e++,n<=6?`${n}+`:`${12-n}-`}let t=[];function o(n){for(let i of n)t.push(`${i}${r()}`)}if(o(R),t.push("y2"),o(b),e<2)return d();for(let n of k)u(2)===0&&t.push(n);return t.join(" ")}var O="node:w-orker-_threa-ds",U=()=>O.replace(/-/g,""),E=typeof globalThis.Worker>"u"&&typeof globalThis.WorkerNavigator>"u";async function T(e,r){let{Worker:t}=await import(U()),o=new t(e,r);return o.unref(),w(o)}async function h(e,r){let t;if(E)return T(e,{eval:r?.eval});if(r?.eval){let o=new Blob([e],{type:"application/javascript"});e=URL.createObjectURL(o)}return t=new globalThis.Worker(e,{type:r?r.type:void 0}),t}async function I(){return import.meta.resolve("./search-worker-entry.js")}function W(){return new URL("./search-worker-entry.js",import.meta.url)}async function y(){return P.expose=!1,(await import("./search-worker-entry-4Q2YFULO.js")).WORKER_ENTRY_FILE_URL}function v(){return new Worker(new URL("./search-worker-entry.js",import.meta.url),{type:"module"})}function M(e){try{let r=globalThis.location?.origin,t=e.origin;return!!r&&!!t&&r!==t}catch{return!1}}async function f(e){let r=new URL(e,import.meta.url),t=M(r);try{return S(r,t)}catch{return S(r,!t)}}async function S(e,r){return new Promise(async(t,o)=>{try{e||o(new Error("Could not get worker entry file URL."));let n=e;if(r){let a=`import ${JSON.stringify(e.toString())};`,x=new Blob([a],{type:"text/javascript"});n=new URL(URL.createObjectURL(x))}let i=await h(n,{type:"module"});i.unref?.();let A=a=>{o(a)},g=a=>{a==="comlink-exposed"?t(L(i)):o(new Error(`wrong module instantiation message ${a}`))};i.nodeWorker?i.nodeWorker.once("message",g):(i.addEventListener("error",A,{once:!0}),i.addEventListener("message",a=>g(a.data),{once:!0}))}catch(n){o(n)}})}async function F(){return new Promise(async(e,r)=>{try{let t=v(),o=i=>{r(i)},n=i=>{i==="comlink-exposed"?e(L(t)):r(new Error(`wrong module instantiation message ${i}`))};t.addEventListener("error",o,{once:!0}),t.addEventListener("message",i=>n(i.data),{once:!0})}catch(t){r(t)}})}function L(e){let r=m(e),t=e.terminate.bind(e);return{insideAPI:r,outsideAPI:{terminate:t}}}var N=[];async function p(){let e=D();N.push(e);let{insideAPI:r}=await e;return r.setDebugMeasurePerf(c.logPerf),r.setScramblePrefetchLevel(c.scramblePrefetchLevel),e}async function D(){globalThis.location?.protocol==="file:"&&console.warn("This current web page is loaded from the local filesystem (a URL that starts with `file://`). In this situation, `cubing.js` may be unable to generate scrambles or perform searches in some browsers. See: https://js.cubing.net/cubing/scramble/#file-server-required");function e(t){return`Module worker instantiation${t?` ${t}`:""} failed`}let r=[[async()=>f(await I()),"using `import.meta.resolve(\u2026)",null],[F,"using inline `new URL(\u2026, import.meta.url)`","may"],[async()=>f(W()),"using `new URL(\u2026, import.meta.url)`","will"],[async()=>f(await y()),"using the `esbuild` workaround","will"]];for(let[t,o,n]of r)try{let i=await t();return n&&c.showWorkerInstantiationWarnings&&console.warn(`Module worker instantiation required ${o}. \`cubing.js\` ${n} not support this fallback in the future.`),i}catch{c.showWorkerInstantiationWarnings&&console.warn(`${e(o)}, falling back.`)}throw new Error(`${e()}. There are no more fallbacks available. If you are using Firefox, please update to version 114 or later.`)}var $;function l(){return $??=p()}async function K(e){switch(e){case"clock":return s.fromString(await d())}let t=await _(e);return s.fromString(t)}async function _(e){return c.forceNewWorkerForEveryScramble,(c.forceNewWorkerForEveryScramble?await p():await l()).insideAPI.randomScrambleStringForEvent(e)}async function ne(e){let r=await l();return s.fromString(await r.insideAPI.solve333ToString(e.patternData))}async function oe(e){let r=await l();return s.fromString(await r.insideAPI.solve222ToString(e.patternData))}async function ie(e){let r=await l();return s.fromString(await r.insideAPI.solveSkewbToString(e.patternData))}async function ae(e){let r=await l();return s.fromString(await r.insideAPI.solvePyraminxToString(e.patternData))}async function se(e){let r=await l();return s.fromString(await r.insideAPI.solveMegaminxToString(e.patternData))}var c={logPerf:!0,scramblePrefetchLevel:"auto",disableStringWorker:!1,forceNewWorkerForEveryScramble:!1,showWorkerInstantiationWarnings:!0};export{K as a,ne as b,oe as c,ie as d,ae as e,se as f};
//# sourceMappingURL=chunk-GDPO7DUK.js.map