@dcl-regenesislabs/web-editor 0.3.22-41448824468.commit-0318d9f → 0.3.22
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/editor.js +1 -1
- package/package.json +2 -3
package/editor.js
CHANGED
|
@@ -38052,4 +38052,4 @@ ${n}
|
|
|
38052
38052
|
${r}`));return"w"+Array.from(new Uint8Array(a).slice(0,16),s=>s.toString(16).padStart(2,"0")).join("")}function gAr(t){return`${t.file===void 0?"":`${t.file}:${t.line??1}:${t.column??0}: `}${t.severity==="error"?"ERROR":"WARNING"}: ${t.message}`}function yAr(t){return t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")} and ${t.length-3} more`}function vAr(t,n){const r=D0(t.get("package.json"));for(const a of[r==null?void 0:r.devDependencies,r==null?void 0:r.dependencies]){const s=typeof a=="object"&&a!==null?a["@dcl/sdk"]:void 0;if(typeof s=="string"&&s!==n)return`⚠ This project asks for @dcl/sdk ${s}; the editor builds it with ${n}.`}return null}function bAr(t){const{emit:n,log:r}=t;let a=null,s=!1,l=null,f=Promise.resolve();const m=k=>{const N=f.then(k,k);return f=N.catch(()=>{}),N};async function _(){if(s)throw new Error("The editor was closed");a===null&&(l=null);const k=a??zTr(t.urls);a=k;try{const N=await k.ready;return{builder:k,sdkVersion:N.sdkVersion,info:N}}catch(N){throw k.dispose(),a===k&&(a=null),N}}async function x(k,N,L){const{builder:B,info:H}=await _();let X=!1;const Y=await mAr(N,t.packages,H.snapshot,pe=>{t.onPackages(k,pe),L&&!X&&r("Downloading packages from npm…"),X=!0});Y.lockFile!==void 0&&(N.set(zR,Y.lockFile),await t.saveLock(k,Y.lockFile));const te=Y.lock===null?"":Qqt(Y.lock);if(te!==l)try{await B.setPackages(Y.lock,t.packages),l=te}catch(pe){L&&r(`⚠ ${HPt(pe)}`),await B.setPackages(null),l=""}if(t.onPackages(k,Y.status),!(!L||Y.status===null)){if(Y.status.state==="error")r(`✖ ${Y.status.message??"The packages could not be installed"}`);else if(Y.downloaded>0){const pe=Object.entries(Y.status.installed).map(([fe,Z])=>`${fe} ${Z}`);r(`✔ Packages frozen into the scene: ${pe.join(", ")} (${Y.status.total} in all)`)}for(const pe of Y.status.warnings)r(`⚠ ${pe}`)}}function T(k,N,L=k){const B=gqe(t.pageDir,L),H=new Set;let X=null,Y=null,te=!0,pe=!1,fe=!1,Z=null;const me=yt=>(n({type:"failed",message:yt}),r(`✖ Build failed: ${yt.split(`
|
|
38053
38053
|
`)[0]}`),!1);async function Oe(yt){const lt=performance.now();n({type:"buildStarted",changed:yt}),r(yt.length===0?"Building the scene…":`Rebuilding: ${yAr(yt)}`);try{const{builder:wt,sdkVersion:gt}=await _(),Ue=yt.length===0?vAr(N,gt):null;Ue!==null&&r(Ue);const Vt=yt.length===0||yt.includes("package.json")||yt.includes(zR),{snapshot:We,result:Me}=await m(async()=>{(Vt||l!==Z)&&(await x(k,N,!0),Z=l);const St=new Map(N);return{snapshot:St,result:await wt.build(St)}});if(fe)return!1;const $t=Me.diagnostics.filter(St=>St.severity==="error"||St.file===void 0||We.has(St.file));n({type:"diagnostics",diagnostics:$t.map(({severity:St,message:dt,file:Nt,line:Ht,column:Ut})=>({severity:St,message:dt,file:Nt,line:Ht,column:Ut}))});for(const St of $t)r(gAr(St));if(!Me.ok){const St=Me.events.find(dt=>dt.type==="failed");return me((St==null?void 0:St.type)==="failed"?St.message:"The build produced no bundle")}const bt=D0(We.get("scene.json"));return bt===null?me("scene.json is missing or is not valid JSON"):(await Zkr({realmUrl:B,projectId:L,files:We,buildOutputs:Me.outputs,sceneJson:bt,sdkVersion:gt,machineId:await t.machineId(L)}),fe?!1:(n({type:"bundleSaved"}),r(`✔ Built in ${Math.round(performance.now()-lt)} ms`),!0))}catch(wt){return fe?!1:me(HPt(wt))}}function $e(){return fe?Promise.resolve(!1):(Y!==null||(Y=(async()=>{for(;(te||H.size>0)&&!fe;){const yt=te?[]:[...H];te=!1,H.clear(),pe=await Oe(yt)}return pe&&!fe})().finally(()=>{Y=null})),Y)}return{id:k,files:N,start:$e,flush(){return X!==null&&clearTimeout(X),X=null,$e()},async published(){const yt=await(await caches.open(awe)).match(yqe(B)),lt=await(yt==null?void 0:yt.json().catch(()=>{})),wt=lt==null?void 0:lt.entity;return(wt==null?void 0:wt.id)===FZe(L,await t.machineId(L))},changed(yt){fe||(H.add(yt),X!==null&&clearTimeout(X),X=setTimeout(()=>{X=null,$e()},hAr))},stop(){fe=!0,X!==null&&clearTimeout(X)}}}return{realmUrl:k=>gqe(t.pageDir,k),open:T,async build(k,N,L){const{builder:B,sdkVersion:H}=await _();return m(async()=>(await x(k,N,!1),{...await B.build(N,L),sdkVersion:H}))},install:(k,N)=>m(()=>x(k,N,!1)),dispose(){s=!0,a==null||a.dispose(),a=null}}}const JPt=64*1024*1024,xAr=4*1024*1024;function wAr(t,n){return t.length>8192?!1:n==="POST"?t==="/content/entities/active":n!=="GET"&&n!=="HEAD"?!1:t==="/about"||t==="/scene.json"||/^\/content\/contents\/(?:b64-[A-Za-z0-9+/=]+|[A-Za-z0-9]+)$/.test(decodeURIComponent(t))}function SAr(t,n,r){const a=t===null?null:new URL(t).origin;let s="",l=null,f="",m="",_=new AbortController,x=0,T=0;const k=(B,H=[])=>{l!==null&&a!==null&&l.postMessage({...B,session:n,instance:s},a,H)},N=async B=>{var me;if(typeof B.requestId!="string"||B.requestId.length>128||typeof B.path!="string")return;const H=B.requestId;if(x>=64){k({type:"realm-response",requestId:H,error:"Too many preview resource requests"});return}const X=_,Y=l,te=new AbortController,pe=setTimeout(()=>te.abort(new Error("Preview resource timed out")),3e4);let fe=0,Z;x++;try{const Oe=new URL(f+B.path);if(!Oe.href.startsWith(f+"/")||!wAr(B.path,B.method))throw new Error("Invalid preview resource");if(B.body!==void 0&&(!(B.body instanceof ArrayBuffer)||B.body.byteLength>1024*1024))throw new Error("Invalid preview request body");const $e=await fetch(Oe,{method:String(B.method),credentials:"omit",redirect:"error",signal:AbortSignal.any([X.signal,te.signal]),headers:{"Content-Type":"application/json"},body:B.method==="POST"?B.body:void 0}),yt=$e.headers.get("Content-Type")??"application/octet-stream",lt=yt.includes("application/json")?xAr:JPt;if(Z=(me=$e.body)==null?void 0:me.getReader(),Number($e.headers.get("Content-Length"))>lt)throw new Error("Preview resource exceeds the memory limit");const wt=[];if(Z!==void 0)for(;;){const{done:We,value:Me}=await Z.read();if(We)break;if(fe+=Me.byteLength,T+=Me.byteLength,fe>lt||T>JPt)throw new Error("Preview resource exceeds the memory limit");wt.push(Me)}const gt=new Uint8Array(fe);let Ue=0;for(const We of wt)gt.set(We,Ue),Ue+=We.byteLength;wt.length=0;let Vt=gt.buffer;if(B.method!=="HEAD"&&Vt.byteLength>0&&yt.includes("application/json")){const We=JSON.parse(new TextDecoder().decode(Vt)),Me=$t=>typeof $t=="string"?$t.startsWith(f+"/")||$t===f?m+$t.slice(f.length):$t:Array.isArray($t)?$t.map(Me):pc($t)?Object.fromEntries(Object.entries($t).map(([bt,St])=>[bt,Me(St)])):$t;Vt=new TextEncoder().encode(JSON.stringify(Me(We))).buffer}!X.signal.aborted&&Y===l&&k({type:"realm-response",requestId:H,status:$e.status,headers:{"Content-Type":yt},body:Vt},[Vt])}catch(Oe){!X.signal.aborted&&Y===l&&k({type:"realm-response",requestId:H,error:Oe instanceof Error?Oe.message:String(Oe)})}finally{clearTimeout(pe),te.abort(),Z!==void 0&&Z.cancel().catch(Oe=>{Oe instanceof Error&&Oe.name==="AbortError"||console.warn("Preview stream cleanup:",Oe)}),T-=fe,x--}},L=B=>{const H=B.data;B.origin!==a||!pc(H)||H.session!==n||H.instance!==s||s===""||(H.type==="connect"&&l===null&&B.source!==null&&"postMessage"in B.source&&(l=B.source),!(B.source!==l||l===null)&&(H.type==="realm-request"?N(H):r(H)))};return window.addEventListener("message",L),{send:k,reset:(B="",H="",X="")=>{_.abort(),_=new AbortController,l=null,s=B,f=H,m=X},dispose:()=>{_.abort(),window.removeEventListener("message",L)}}}const QPt=["localhost","127.0.0.1","[::1]"];function TAr(t,n,r=""){if(QPt.includes(new URL(t).hostname)){const a=new URLSearchParams(r).get("editor-mobile");return`${a!==null&&URL.canParse(a)&&QPt.includes(new URL(a).hostname)?new URL(a).origin:"http://127.0.0.1:8788"}/mobile-preview/index.html`}return n===null?null:new URL("mobile-preview/index.html",n.replace(/\/$/,"")+"/").href}function kAr(t){if(t===null)return null;const n=new URL(t).hostname;return n==="decentraland.zone"||n.endsWith(".decentraland.zone")?"zone":null}function EAr(t,n,r,a=null){const s=crypto.randomUUID(),l=SAr(t,s,fe=>pe(fe)),f=new Set,m=new Map;let _={mode:"closed",url:null,ready:!1},x=null,T="",k="",N=0,L=null,B=!1,H=null;const X=fe=>{_=fe;for(const Z of f)Z()},Y=()=>{k!==""&&l.send({type:"stop",session:s,instance:k}),l.reset(),H==null||H.close(),H=null,k="";for(const fe of m.values())fe.reject(new Error("The mobile preview was closed."));m.clear(),X({mode:"closed",url:null,ready:!1})},te=()=>{N++,x=null,Y()};window.addEventListener("pagehide",te);const pe=fe=>{if(!pc(fe)||fe.session!==s||fe.instance!==k||(fe.type==="ready"&&(X({..._,ready:!0}),l.send({type:"visibility",session:s,instance:k,visible:_.mode!=="minimized"})),fe.type==="closed"&&te(),fe.type!=="capture"||typeof fe.requestId!="string"))return;const Z=m.get(fe.requestId);Z!==void 0&&(typeof fe.error=="string"?Z.reject(new Error(fe.error)):typeof fe.image=="string"&&fe.image.length<=4e6&&typeof fe.width=="number"&&fe.width>0&&fe.width<=1024&&typeof fe.height=="number"&&fe.height>0&&fe.height<=1024?Z.resolve({mimeType:"image/jpeg",image:fe.image,width:fe.width,height:fe.height}):Z.reject(new Error("The mobile preview sent an invalid picture.")))};return{state:()=>_,status:()=>({mode:_.mode,ready:_.ready}),subscribe:fe=>(f.add(fe),()=>f.delete(fe)),open:async(fe,Z,me="embedded")=>{if(B||t===null)return{ok:!1,reason:"unavailable"};const Oe=fe.replace(/\/$/,"");if(_.mode===me&&x===Oe)return N++,{ok:!0};if((me==="embedded"||me==="minimized")&&(_.mode==="embedded"||_.mode==="minimized")&&x===Oe){if(N++,X({..._,mode:me}),l.send({type:"visibility",session:s,instance:k,visible:me!=="minimized"}),me==="minimized")for(const Vt of m.values())Vt.reject(new Error("Restore the mobile preview before taking a picture."));return{ok:!0}}if(me==="minimized")return{ok:!1,reason:"unavailable"};const $e=me==="tab"?window.open("about:blank",`dcl-phone-preview-${crypto.randomUUID()}`):null;if(me==="tab"&&$e===null)return{ok:!1,reason:"unavailable"};const yt=++N;if(!await fetch(t,{method:"HEAD",signal:AbortSignal.timeout(5e3)}).then(Vt=>Vt.ok,()=>!1)||yt!==N||B||$e!=null&&$e.closed)return $e==null||$e.close(),{ok:!1,reason:"unavailable"};if(Y(),await new Promise(Vt=>setTimeout(Vt,100)),yt!==N||B||$e!=null&&$e.closed)return $e==null||$e.close(),{ok:!1,reason:"unavailable"};k=crypto.randomUUID();const wt=new URL(t);wt.searchParams.set("previewSession",s),wt.searchParams.set("previewInstance",k),wt.searchParams.set("editorOrigin",window.location.origin),me==="tab"&&wt.searchParams.set("previewDetached","1"),wt.searchParams.set("maxpixels",String(1600*720)),T=new URL(`realm/${s}/${k}`,t).href,l.reset(k,Oe,T);const gt=new URL("decentraland://open");gt.searchParams.set("preview",T),gt.searchParams.set("position",Z);const Ue=["--local-editor-preview","--skip-lobby","--guest-profile","--fake-deeplink",gt.href];return a!==null&&Ue.push("--dclenv",a),wt.searchParams.set("args",Ue.join(" ")),x=Oe,X({mode:me,url:wt.href,ready:!1}),H=$e,$e!==null&&AAr($e,wt.href),{ok:!0}},close:te,capture:async fe=>{if(fe.throwIfAborted(),_.mode==="closed"||!_.ready)throw new Error("Open the mobile preview and wait for it to load before taking a picture.");_.mode==="minimized"&&(L=N,X({..._,mode:"embedded"}),l.send({type:"visibility",session:s,instance:k,visible:!0}));const Z=crypto.randomUUID();try{return await new Promise((me,Oe)=>{const $e=()=>{clearTimeout(lt),fe.removeEventListener("abort",yt),m.delete(Z)},yt=()=>{$e(),Oe(fe.reason)},lt=setTimeout(()=>{$e(),Oe(new Error("The mobile preview did not answer. Bring its tab to the foreground and retry."))},1e4);m.set(Z,{resolve:wt=>{$e(),me(wt)},reject:wt=>{$e(),Oe(wt)}}),fe.addEventListener("abort",yt,{once:!0}),l.send({type:"capture",session:s,instance:k,requestId:Z})})}finally{m.size===0&&(L===N&&_.mode==="embedded"&&(X({..._,mode:"minimized"}),l.send({type:"visibility",session:s,instance:k,visible:!1})),L=null)}},built:async fe=>{if(x===null)return;const Z=x,me=await n(fe),Oe=FZe(me,await r(me));!B&&Z===x&&l.send({type:"scene-updated",session:s,instance:k,realm:T,entityId:Oe})},dispose:()=>{te(),B=!0,window.removeEventListener("pagehide",te),l.dispose(),f.clear()}}}function AAr(t,n){const r=t.document;r.title="Mobile scene preview",r.body.style.cssText="margin:0;background:#19191c;overflow:hidden";const a=r.createElement("iframe");a.title="Mobile scene preview",a.allow="autoplay; fullscreen; gamepad; cross-origin-isolated",a.style.cssText="width:100vw;height:100vh;border:0;display:block",a.src=n,r.body.replaceChildren(a)}const CAr=200,OAr=2e3,PAr=/^\((?:no logs|\+\d+ older entries not retained)\)$/;function IAr(t,n){for(let r=Math.min(t.length,n.length);r>0;r--){const a=t.length-r;if(n.slice(0,r).every((s,l)=>s===t[a+l]))return n.slice(r)}return[...n]}function NAr(t,n){let r=[],a=!1,s;const l=async()=>{try{const f=await t(`scene_logs ${CAr} --server`);if(a)return;const m=f.split(`
|
|
38054
38054
|
`).filter(_=>_.trim()!==""&&!PAr.test(_.trim()));for(const _ of IAr(r,m))n(_);r=m}catch{}a||(s=setTimeout(()=>void l(),OAr))};return l(),()=>{a=!0,clearTimeout(s)}}function DAr(t,n,r){r.throwIfAborted();const a=tt.scene,s=[...t].sort().join(";");return new Promise((l,f)=>{const m=()=>{clearTimeout(N),T(),r.removeEventListener("abort",k)},_=L=>{m(),f(L)},x=()=>{var B;tt.scene===a||tt.status!=="ready"||!tt.frozen||((B=tt.scene)==null?void 0:B.parcels.map(H=>`${H.x},${H.y}`).sort().join(";"))!==s||(m(),l())},T=Rqe(x),k=()=>_(r.reason),N=setTimeout(()=>_(new Error("The preview has not loaded the new parcels. Retry sceneSettings before building outside the current layout.")),9e4);r.addEventListener("abort",k,{once:!0});try{n(),x()}catch(L){_(L)}})}const RAr=new Set(["node_modules",".git","bin","dist"]),MAr=300*1024,LAr=56,FAr=5;function jAr(t){const n=t.origin,r=typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null;return r!==null&&(r.source==="import"||r.source==="github")?r:{...r??{},source:"user"}}function BAr(t,n){const r=new Map;let a=new Map;function s(m,_){if(_.size>MAr)return t.blob(m,_.hash);let x=r.get(_.hash);return x===void 0&&(x=t.blob(m,_.hash),r.set(_.hash,x),x.catch(()=>r.delete(_.hash))),x}const l={async folders(){const m=await t.list();return a=new Map(m.map(x=>[x.name,x])),(await Promise.all(m.map(async x=>{const T=x.files["data.json"];if(T===void 0)return null;const k=await s(x.name,T).then(L=>new TextDecoder().decode(L),()=>null);if(k===null)return null;const N=Object.fromEntries(Object.entries(x.files).map(([L,B])=>[L,B.size]));return{name:x.name,data:k,files:N}}))).filter(x=>x!==null)},async read(m,_){var T;const x=(T=a.get(m.name))==null?void 0:T.files[_];if(x===void 0)throw new Error(`${m.name}/${_} is not in your library`);return s(m.name,x)}};async function f(m,_){const x={},T=new Map;for(const[N,L]of _){const B=await n(L);x[N]={hash:B,size:L.length},T.set(B,L)}const k=[...T].map(([N,L])=>({hash:N,size:L.length}));for(const N of await t.uploads(m,k)){const L=T.get(N.hash);L!==void 0&&await t.putBlob(N,L)}await t.put(m,x)}return{tree:l,async copyOut(m,_){const[x,T,k]=_.split("/");if(x!=="custom"||T===void 0||k!==void 0||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(T))throw new Error(`not a prefab folder: ${_}`);const N=`${_}/`,L=new Map;for(const[Z,me]of m.files()){const Oe=Z.slice(N.length);Z.startsWith(N)&&!Oe.split("/").some($e=>RAr.has($e))&&L.set(Oe,me)}const B=L.get("data.json"),H=B===void 0?null:Xq(new TextDecoder().decode(B));if(H===null)throw new Error(`${_} has no readable data.json`);const X={...H,id:typeof H.id=="string"?H.id:crypto.randomUUID(),origin:jAr(H)},Y=`${JSON.stringify(X,null,2)}
|
|
38055
|
-
`;L.set("data.json",new TextEncoder().encode(Y));const te=Oqe(SHt(H,T)).slice(0,LAr).replace(/_+$/,"")||"prefab",pe=new Set((await t.list()).map(Z=>Z.name));let fe=1;for(let Z=0;Z<FAr;Z++){let me=te;for(;pe.has(me);)me=`${te}_${++fe}`;try{return await f(me,L),{ref:`user:${me}`,scope:"user",data:Y}}catch(Oe){if(!(Oe instanceof dHt))throw Oe;pe.add(me)}}throw new Error("could not find a free name in your library — try again")},remove:m=>t.remove(m)}}const YPt=new WeakMap;function UAr(t){let n=YPt.get(t);return n===void 0&&(n=crypto.subtle.digest("SHA-256",new Uint8Array(t)).then(r=>[...new Uint8Array(r)].map(a=>a.toString(16).padStart(2,"0")).join("")),YPt.set(t,n)),n}async function $Ar(t){const n=t.get(".dclignore"),r=BZe(t.keys(),n===void 0?void 0:new TextDecoder().decode(n)).filter(l=>l!==zR),a=new Map;let s=0;for(const l of r){const f=t.get(l);f!==void 0&&(a.set(await UAr(f),f.byteLength),s++)}return{bytes:[...a.values()].reduce((l,f)=>l+f,0),files:s}}const XPt=4e3,zAr=4e6,VAr=pIt*24*60*60*1e3,WAr="assets/images",qAr=3e3,HAr=100,GAr="Sign in to keep prefabs in your own library. The built-in prefabs work without it.",JAr=t=>t instanceof Error?t.message:String(t);function B9e(t,n){var r,a,s;return{realm:n.replace(/\/$/,""),systemScene:"",position:((r=t.scene)==null?void 0:r.base)??((s=(a=t.scene)==null?void 0:a.parcels)==null?void 0:s[0])??"0,0",spawn:p2r(t),spawnPoints:JSON.stringify(Array.isArray(t.spawnPoints)?t.spawnPoints:[])}}const QAr=({host:t,sceneCompiler:n})=>{const r=new K2r(G2r()),a=zS(t),s=a===null||a.services.projects===null?null:uHt(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),l=()=>{const{address:Xn,isGuest:Fr}=t.identity();return Fr||Xn===null?null:Xn.toLowerCase()},f=[],m=[],_=[],x=[],T=[],k=Xn=>{f.push(Xn),f.length>XPt&&f.splice(0,f.length-XPt);for(const Fr of m)Fr(Xn)},N=EAr(TAr(t.pageDir,(a==null?void 0:a.services.projects)??null,location.search),me,async Xn=>GPt(await X,l()??"guest",Xn),kAr((a==null?void 0:a.services.worldsContent)??null)),L=Xn=>{for(const Fr of _)Fr(Xn);Xn.type==="bundleSaved"&&pe!==null&&N.built(pe.id).catch(Fr=>console.error("[editor] mobile preview reload failed",Fr))},B=new Map,H=new Set,X=l4t.then(_Ar),Y=bAr({pageDir:t.pageDir,urls:n,machineId:async Xn=>GPt(await X,l()??"guest",Xn),emit:L,log:k,packages:r.packages,saveLock:async(Xn,Fr)=>{await r.write(Xn,zR,Fr),St.touched(Xn,zR),(pe==null?void 0:pe.id)===Xn&&pe.files.set(zR,Fr)},onPackages:(Xn,Fr)=>{if(Fr===null){B.delete(Xn);return}B.set(Xn,Fr);for(const oi of H)oi(Xn,Fr)}});let te=null,pe=null,fe=null,Z=null;async function me(Xn){var Ya;const Fr=(Ya=(await r.list()).find(Za=>Za.id===Xn))==null?void 0:Ya.previewId;if(Fr!==void 0)return Fr;const oi="p"+Array.from(crypto.getRandomValues(new Uint8Array(16)),Za=>Za.toString(16).padStart(2,"0")).join("");return await r.patch(Xn,{previewId:oi}),oi}async function Oe(Xn){const Fr=new URL("preview/",t.pageDir).href,oi=await caches.open(awe);for(const Ya of await oi.keys())Ya.url.startsWith(Fr)&&(Xn===null||!Ya.url.startsWith(Xn))&&await oi.delete(Ya)}let $e=0,yt=Promise.resolve(),lt=Promise.resolve();const wt=n2r({service:(a==null?void 0:a.services.projects)??null,fetch:(Xn,Fr)=>a===null?Promise.reject(new Error("The assistant service is not configured.")):a.signedFetch(Xn,Fr),wallet:l,mobilePreview:N.status,memory:{read:async(Xn,Fr)=>{const oi=await r.assistantMemory(Xn,Fr);return pc(oi)&&typeof oi.id=="string"&&typeof oi.key=="string"?{id:oi.id,key:oi.key}:null},write:(Xn,Fr,oi)=>r.setAssistantMemory(Xn,Fr,oi)},project:()=>{const Xn=Tt();return{id:Xn.id,tools:{files:()=>Xn.files,write:(Fr,oi,Ya,Za)=>Vt(Xn.id,Fr,oi,{expected:Ya,signal:Za}),assets:Vzt({files:()=>Xn.files}),scene:(Fr,oi)=>FTe(Fr,oi,async Ya=>{var ri,yl,Ba;const Za=ss=>{var gs,qs;return JSON.stringify([(gs=ss==null?void 0:ss.scene)==null?void 0:gs.parcels,(qs=ss==null?void 0:ss.scene)==null?void 0:qs.base])};await Ik();const tl=Za(D0(await Ue(Xn.id,"scene.json")));await Kt(Xn.id,ss=>g2r(ss,Ya));const uu=D0(await Ue(Xn.id,"scene.json")),lr=Za(uu)!==tl,Pl=((ri=uu==null?void 0:uu.scene)==null?void 0:ri.parcels)??[],fm=(yl=tt.scene)==null?void 0:yl.parcels.map(ss=>`${ss.x},${ss.y}`).sort().join(";");if(lr||fm!==[...Pl].sort().join(";")){if(!await Xn.flush())throw new Error("The scene did not build. Fix the code and retry sceneSettings to load the new parcels.");oi.throwIfAborted();const ss=await me(Xn.id);te=B9e(uu??{},Y.realmUrl(ss)),await DAr(Pl,()=>{for(const gs of x)gs(te)},oi)}else if(te!==null){const ss=B9e(uu??{},te.realm);(ss.spawn!==te.spawn||ss.spawnPoints!==te.spawnPoints)&&(te={...te,spawn:ss.spawn,spawnPoints:ss.spawnPoints},qfr(ss.spawn,ss.spawnPoints))}return{requiredPermissions:(uu==null?void 0:uu.requiredPermissions)??[],spawnPoints:(uu==null?void 0:uu.spawnPoints)??[],parcels:Pl,base:((Ba=uu==null?void 0:uu.scene)==null?void 0:Ba.base)??null,previewReady:!0}}),written:Gzt,view:(Fr,oi)=>wse(Fr,oi),playtest:mZe,uiLayout:WWe,turnEnded:GVt,build:xEr({saveScene:$zt,fileWrites:()=>lt,vendorRuntime:zae,compile:()=>Y.build(Xn.id,new Map(Xn.files)),run:zzt,mobilePreview:N.status})}}}});function gt(){wt.reset(),Z==null||Z(),Z=null,pe!==null&&(pe.stop(),r.close(pe.id),St.flush(pe.id),pe=null,fe=null)}async function Ue(Xn,Fr){return(pe==null?void 0:pe.id)===Xn?pe.files.get(Fr):r.read(Xn,Fr).catch(oi=>{if(!vI(oi))throw oi})}function Vt(Xn,Fr,oi,Ya){const Za=lt.then(async()=>{if(Ya==null||Ya.signal.throwIfAborted(),Ya!==void 0&&((pe==null?void 0:pe.id)!==Xn||!Qzt(pe.files.get(Fr),Ya.expected)))throw new Error("This file changed. Read it again before writing.");await r.write(Xn,Fr,oi),St.touched(Xn,Fr),(pe==null?void 0:pe.id)===Xn&&(pe.files.set(Fr,oi),pe.changed(Fr))});return lt=Za.catch(tl=>console.error("[editor] file write failed",tl)),Za}function We(Xn,Fr){const oi=lt.then(async()=>{const Ya=await r.remove(Xn,Fr);return Ya&&St.touched(Xn,Fr),Ya&&(pe==null?void 0:pe.id)===Xn&&pe.files.delete(Fr)&&pe.changed(Fr),Ya});return lt=oi.catch(Ya=>console.error("[editor] file removal failed",Ya)),oi}function Me(Xn){const Fr=Tt();if(Fr.id!==Xn)throw new Error("that scene is not the one open");return{files:()=>Fr.files,write:(oi,Ya)=>Vt(Xn,oi,Ya),remove:async oi=>{await We(Xn,oi)}}}async function $t(Xn){var Ya;const Fr=D0(await Ue(Xn,"scene.json").catch(()=>{})),oi=(((Ya=Fr==null?void 0:Fr.display)==null?void 0:Ya.title)??"").replace(/[\x00-\x1f\x7f]/g,"").replace(new RegExp(lHt.source,"g"),"").trim().slice(0,HAr);return oi===""?Xn:oi}async function bt(Xn,Fr){const oi=(await r.list()).find(Za=>Za.id===Xn);if(oi===void 0)return null;const Ya=await r.duplicate(Xn,`${oi.name} ${Fr}`,St.remoteIds());return await Kt(Ya.id,Za=>{var tl;return{...Za,display:{...Za.display??{},title:`${((tl=Za.display)==null?void 0:tl.title)||oi.name} ${Fr}`}}}),Ya.id}const St=sEr({store:r,session:()=>{const Xn=l();return s===null||Xn===null?null:{api:s,wallet:Xn}},account:()=>s===null?"unavailable":l()===null?"guest":"on",hash:nwe,title:$t,duplicate:async Xn=>{const Fr=await bt(Xn,fIt(new Date));if(Fr===null)throw new Error("The scene is no longer on this device");return Fr}});let dt=!1,Nt=0;async function Ht(){const Xn=++Nt,Fr=l()!==null&&(await wt.shell.aiProviders()).some(oi=>oi.available);Xn!==Nt||Fr===dt||(dt=Fr,Yb())}Ht();let Ut=l();const Re=setInterval(()=>{const Xn=l();Xn!==Ut&&(Ut=Xn,wt.reset(),Yb(),Ht(),St.refresh(!0),Oe(fe).catch(Fr=>console.warn("[editor] could not clear the previews",Fr)))},qAr),Ge=()=>{document.visibilityState==="hidden"&&St.flush()};document.addEventListener("visibilitychange",Ge);const ct=new Set;async function Kt(Xn,Fr){const oi=D0(await Ue(Xn,"scene.json"));if(oi===null)throw new Error("scene.json is missing or is not valid JSON");await Vt(Xn,"scene.json",_Pt(Fr(oi)))}async function An(Xn,Fr){if(Fr==null||Fr==="")return null;const oi=await Ue(Xn,Fr).catch(()=>{});return oi===void 0||oi.length>zAr?null:gPt(Fr,oi)}async function un(Xn,Fr=St.status().projects){var Ya,Za,tl,uu;const oi=D0(await Ue(Xn.id,"scene.json").catch(()=>{}));return{sync:Fr[Xn.id],path:Xn.id,name:Xn.name,title:((Ya=oi==null?void 0:oi.display)==null?void 0:Ya.title)||Xn.name,world:((Za=oi==null?void 0:oi.worldConfiguration)==null?void 0:Za.name)||null,parcels:Array.isArray((tl=oi==null?void 0:oi.scene)==null?void 0:tl.parcels)?oi.scene.parcels.length:0,thumbnail:await An(Xn.id,(uu=oi==null?void 0:oi.display)==null?void 0:uu.navmapThumbnail),favourite:Xn.favourite,lastOpened:Xn.lastOpened,published:Xn.published,deletedAt:Xn.deletedAt??void 0}}async function Tn(Xn,Fr){var Ya,Za;gt(),f.length=0,L({type:"sessionStarted"});const oi=tl=>{if(gt(),Fr===$e){k(`✖ ${tl}`);for(const uu of T)uu(tl)}};try{if(await St.prepareOpen(Xn,(ri,yl)=>k(`Downloading from your account… ${ri}/${yl}`)),Fr!==$e)return;if(!await r.open(Xn)){oi("This scene is open in another tab. Close it there to edit it here.");return}const tl=await r.readAll(Xn).then(async ri=>{for(const[yl,Ba]of GTr(ri))await Vt(Xn,yl,Ba),ri.set(yl,Ba);return ri}).catch(ri=>{throw r.close(Xn),ri});if(Fr!==$e){r.close(Xn);return}const uu=await me(Xn);if(Fr!==$e){r.close(Xn);return}const lr=Y.open(Xn,tl,uu);pe=lr;const Pl=Y.realmUrl(uu);if(fe=Pl,k(`▶ Opening ${((Za=(Ya=D0(lr.files.get("scene.json")))==null?void 0:Ya.display)==null?void 0:Za.title)||Xn}`),!await lr.start()&&!await lr.published()){if(Fr!==$e)return;k("✖ The scene did not build.");for(const ri of T)ri("The scene did not build.");return}if(await r.patch(Xn,{lastOpened:Date.now()}),Fr!==$e){gt();return}const fm=D0(lr.files.get("scene.json"))??{};te=B9e(fm,Pl),Z=NAr(ri=>t.engineConsole(ri),k);for(const ri of x)ri(te)}catch(tl){oi(JAr(tl))}}function pi(Xn){N.close(),te=null;const Fr=++$e,oi=wt.reset(),Ya=yt.then(async()=>{await oi,await lt,Fr===$e&&await Xn(Fr)});return yt=Ya.catch(Za=>console.error("[editor] project transition failed",Za)),Ya}function Tt(){if(pe===null)throw new Error("no project is open");return pe}const Wi={saveFile:async({path:Xn,content:Fr})=>Vt(Tt().id,Xn,Fr),getFile:async({path:Xn})=>{const Fr=Tt().files.get(Xn)??nAr(Xn);if(Fr===void 0)throw new Error(`no such file: ${Xn}`);return{content:Fr}},removeFiles:async({filePaths:Xn})=>{const Fr=Tt(),oi=[],Ya=[];for(const Za of Xn)(await We(Fr.id,Za).catch(()=>!1)?oi:Ya).push(Za);return{success:oi,failed:Ya}},getFilesSizes:async({path:Xn,ignore:Fr})=>{const oi=Xn===""?"":`${Xn.replace(/\/+$/,"")}/`;return{files:[...Tt().files.keys()].filter(Za=>Za.startsWith(oi)&&!Za.split("/").some(tl=>Fr.includes(tl))).sort().map(Za=>({path:Za}))}}},Er={async find(Xn){return(await r.list()).some(Fr=>Fr.id===Xn)?!0:(await St.refresh(!0),St.remoteOnly().some(Fr=>Fr.id===Xn))},files:async Xn=>(pe==null?void 0:pe.id)===Xn?new Map(pe.files):r.readAll(Xn),manifest:Xn=>St.manifest(Xn),build:async(Xn,Fr)=>Y.build(Xn,await Er.files(Xn),Fr),dependencies:async Xn=>sHt(await Ue(Xn,"package.json")),onImported:Xn=>(ct.add(Xn),()=>ct.delete(Xn))},to=a===null?null:H2r({host:a,setWorld:async(Xn,Fr)=>{var Ya,Za;((Za=(Ya=D0(await Ue(Xn,"scene.json")))==null?void 0:Ya.worldConfiguration)==null?void 0:Za.name)!==Fr&&await Kt(Xn,tl=>({...tl,worldConfiguration:{...tl.worldConfiguration??{},name:Fr}}))},files:Xn=>Er.files(Xn),build:(Xn,Fr)=>Y.build(Xn,Fr,{production:!0}),published:(Xn,Fr)=>r.patch(Xn,{published:Fr})}),ja=(a==null?void 0:a.services.projects)==null?null:BAr(nEr(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),nwe);Pmr(s2r(t.editorBase)),o2r(t.editorBase),Yzt({material:c2r,sound:l2r}),ohr(async()=>$Ar(await Er.files(Tt().id)));const Vo=dAr({builtin:wEr(t.editorBase,PB("prefabs/catalog.json"),qTe),user:()=>ja!==null&&l()!==null?ja.tree:null}),el={...(a==null?void 0:a.services.projects)==null?{}:{...wt.shell,aiOffered:()=>dt,aiTranscript:()=>{const Xn=Ut;if(Xn===null||pe===null)return null;const Fr=pe.id;return{owner:`${Fr}@${Xn.toLowerCase()}`,load:()=>r.transcript(Fr,Xn),save:oi=>r.setTranscript(Fr,Xn,oi)}}},pickProject:async()=>{},openProject:Xn=>pi(Fr=>Tn(Xn,Fr)),relaunchProject:Xn=>pi(Fr=>Tn(Xn,Fr)),closeProject:()=>pi(async()=>{gt(),L({type:"sessionStarted"}),k("■ Scene closed"),await Oe(null).catch(Xn=>console.warn("[editor] could not clear the previews",Xn))}),getState:async()=>{const Xn=await r.list(),Fr=St.status().projects,oi=St.remoteOnly().map(Ya=>({path:Ya.id,name:Ya.name,title:Ya.name,world:null,parcels:0,thumbnail:null,remoteOnly:!0}));return{recentProjects:[...Xn].sort((Ya,Za)=>Za.lastOpened-Ya.lastOpened).map(Ya=>Ya.id),projects:[...await Promise.all(Xn.map(Ya=>un(Ya,Fr))),...oi],logs:[...f],bevyWebDir:"",editorSceneDir:"",webPort:0,scenePort:0,editorScenePort:0,favourites:Xn.filter(Ya=>Ya.favourite).map(Ya=>Ya.id)}},onStackLog:Xn=>{m.push(Xn)},onBuildEvent:Xn=>{_.push(Xn)},onServersReady:Xn=>{x.push(Xn)},requestReady:async()=>te,phonePreview:async Xn=>te===null?{ok:!1,reason:"no-scene"}:N.open(te.realm,te.position,Xn),phonePreviewState:N.state,onPhonePreviewState:N.subscribe,closePhonePreview:N.close,capturePhonePreview:N.capture,onServersError:Xn=>{T.push(Xn)},toggleFavourite:async Xn=>{const Fr=(await r.list()).find(oi=>oi.id===Xn);Fr!==void 0&&await r.patch(Xn,{favourite:!Fr.favourite})},deleteProject:async Xn=>{const Fr=await r.trash(Xn);return Fr&&St.trashed(Xn),Fr},trashedProjects:async()=>Promise.all((await r.trashed()).map(Xn=>un(Xn))),restoreProject:async Xn=>{const Fr=await r.restore(Xn);return Fr&&St.restored(Xn),Fr},syncStatus:async()=>(St.refresh(),St.status()),onSyncStatus:Xn=>St.subscribe(Xn),resolveSyncConflict:(Xn,Fr)=>St.resolve(Xn,Fr),exportProject:async Xn=>yEr(await $t(Xn),await Er.files(Xn)),importProject:async Xn=>{const Fr=await bEr(Xn,async(oi,Ya)=>{const Za=await r.create(oi,Ya,{taken:St.remoteIds()});return St.touched(Za.id,"scene.json"),Za.id});if((Fr==null?void 0:Fr.ok)===!0){const{id:oi,needsPackages:Ya}=Fr.report;Object.keys(Ya).length>0&&r.readAll(oi).then(Za=>Y.install(oi,Za)).catch(Za=>console.warn("[editor] could not install the packages of",oi,Za));for(const Za of ct)Za(Fr.report)}return Fr},projectPackages:async Xn=>B.get(Xn)??null,onProjectPackages:Xn=>(H.add(Xn),()=>H.delete(Xn)),...to===null||a===null?{}:{publishScene:(Xn,Fr,oi)=>to.publish(Xn,Fr,oi),...to.publishShared===void 0?{}:{publishShared:to.publishShared},publishStop:async()=>to.stop(),publishWorlds:async()=>W2r(l(),a.services.worldsContent)},canImportFolder:gEr(),renameProject:(Xn,Fr)=>Kt(Xn,oi=>({...oi,display:{...oi.display??{},title:Fr.trim()}})),duplicateProject:Xn=>bt(Xn,"copy"),sceneTemplates:async()=>KEr(),createScene:async(Xn,Fr,oi)=>{const Ya=xHt(oi),Za=D0(Ya.get("scene.json"));if(Za===null)throw new Error(`template not found: ${oi}`);Ya.set("scene.json",_Pt({...Za,display:{...Za.display??{},title:Fr.trim()}}));const tl=await r.create(Fr,Ya,{taken:St.remoteIds()});return St.touched(tl.id,"scene.json"),tl.id},openExternal:async Xn=>{/^https?:$/.test(new URL(Xn).protocol)&&window.open(Xn,"_blank","noopener,noreferrer")},compositeEntityIds:async Xn=>{for(const Fr of m2r){const oi=await Ue(Xn,Fr);if(oi!==void 0)return h2r(new TextDecoder().decode(oi))}return[]},sceneSettings:async Xn=>{const Fr=D0(await Ue(Xn,"scene.json"));if(Fr===null)throw new Error("scene.json is missing or is not valid JSON");const oi=u2r(Fr);return{...oi,thumbnail:await An(Xn,oi.thumbnailPath)}},saveSceneSettings:async(Xn,Fr)=>{const oi=d2r(Fr);return oi!==null?oi:(await Kt(Xn,Ya=>f2r(Ya,Fr)),null)},pickSceneThumbnail:async Xn=>{const Fr=await bHt(Object.values(bqe).join(","));if(Fr===null)return null;const oi=iHt(Fr.name);if(bqe[oi]===void 0)throw new Error("not a supported image (png, jpg, gif, webp)");const Ya=`${WAr}/scene-thumbnail${oi}`,Za=new Uint8Array(await Fr.arrayBuffer());return await Vt(Xn,Ya,Za),{path:Ya,dataUrl:gPt(Ya,Za)}},appVersion:async()=>Kkr,prefabLibraryList:()=>Vo.list(),prefabLibraryCopyIn:async(Xn,Fr)=>Vo.copyIn(Xn,Me(Fr)),prefabLibraryUpdateCopy:async(Xn,Fr)=>Vo.updateCopy(Xn,Me(Fr)),prefabUserLibrary:()=>ja===null?"unavailable":l()===null?"guest":"on",...ja===null?{}:{prefabLibraryCopyOut:async(Xn,Fr)=>{if(l()===null)throw new Error(GAr);return ja.copyOut(Me(Xn),Fr)},prefabLibraryDelete:async Xn=>{const Fr=wHt(Xn);return(Fr==null?void 0:Fr.scope)==="user"&&l()!==null?ja.remove(Fr.name):!1}}};async function Gl(){const Xn=new Set;for(const Fr of[...await r.list(),...await r.trashed()]){const oi=Jqt(await Ue(Fr.id,zR).catch(()=>{}));for(const Ya of Object.keys((oi==null?void 0:oi.packages)??{}))Xn.add(Ya);for(const[Ya,Za]of Object.entries((oi==null?void 0:oi.dependencies)??{}))Xn.add(i7(Ya,Za))}for(const Fr of await r.packages.keys())Xn.has(Fr)||await r.packages.remove(Fr)}return r.purge(Date.now()-VAr).then(async Xn=>{const Fr=await caches.open(awe),oi=Xn.map(({id:Za,previewId:tl})=>Y.realmUrl(tl??Za));for(const Za of await Fr.keys())oi.some(tl=>Za.url.startsWith(tl))&&await Fr.delete(Za);const Ya=await caches.open(Xkr);for(const Za of oi)await Ya.delete(`${Za}__storage`);Xn.length>0&&await Gl()}).catch(Xn=>console.warn("[editor] could not empty the trash",Xn)),{shell:el,projects:Er,dataLayer:Wi,dispose:()=>{N.dispose(),wt.dispose(),$e++,gt(),Y.dispose(),clearInterval(Re),document.removeEventListener("visibilitychange",Ge),St.flush().finally(()=>St.dispose())}}};let a7=null,RH=null,gre=null,ZPt=!1;function YAr(){if(a7!==null)return a7;const t=window.__dclEditorHost;if(t===void 0||t.version!==0&&t.version!==1)return console.error("[editor] window.__dclEditorHost (contract v0 or v1) is missing: nothing to mount into"),null;console.log("[editor] web build 2026-11-02T12:58:56.968Z"),_It(t),tDt(a=>t.engineConsole(a)),v4t(()=>t.identity()),QJn.needed=!1;const n=QAr({host:t,sceneCompiler:a2r(t.editorBase)});window.editorShell=XAr(n.shell,t),IRt(n.dataLayer??null),EGe();const r=document.createElement("link");return r.rel="stylesheet",r.href=new URL("editor.css",t.editorBase).href,r.integrity=PB("editor.css"),r.crossOrigin="anonymous",r.onerror=()=>console.error("[editor] editor.css did not load or does not match the hash this editor was published with: its fonts are not applied"),document.head.appendChild(r),G1.project=null,G1.notice=null,a7={host:t,web:n,fonts:r},a7}function lwe(){const t=RH;RH=null,t==null||t.unmount()}function XAr(t,n){const{createScene:r,importProject:a,duplicateProject:s}=t;return{...t,...r===void 0?{}:{createScene:async(l,f,m)=>{const _=await r(l,f,m);return _!==null&&tw("project_created",{project_id:_,source:"template",template:m}),_}},...a===void 0?{}:{importProject:async l=>{const f=await a(l);return(f==null?void 0:f.ok)===!0&&tw("project_created",{project_id:f.report.id,source:"import",import_kind:l}),f}},...s===void 0?{}:{duplicateProject:async l=>{const f=await s(l);return f!==null&&tw("project_created",{project_id:f,source:"duplicate",from_project_id:l}),f}},openProject:async l=>{const f=RH;lwe(),f==null||f.api.close(),gre??(gre=g7t(n.container,C.jsx(PTr,{}))),n.setMode("edit"),G1.project=l,G1.opens++,await t.openProject(l),tw("project_opened")}}}function ZAr(t,n){var m;const r=YAr();if(r===null)return()=>{};lwe();const a=document.createElement("div");a.style.cssText="position:relative;width:100%;height:100%",OJn(a),t.appendChild(a);const s=g7t(a,C.jsx(NJn,{}),"eui-create-root"),l={api:n,unmount:()=>{s(),a.remove()}};RH=l;const f=ZPt?null:((m=zS(r.host))==null?void 0:m.openProject)??null;return ZPt=!0,tw("editor_opened",{deep_link:f!==null}),f!==null&&r.web.projects.find(f).catch(()=>!1).then(_=>{var x;RH===l&&(_?(x=window.editorShell)==null||x.openProject(f):G1.notice=`“${f}” is not on this device or on your account. Here are your scenes.`)}),()=>{RH===l&&lwe()}}function KAr(){lwe();const t=a7;if(t===null)return;a7=null;const n=Ik();gre==null||gre(),gre=null,t.fonts.remove(),G1.project=null,delete window.editorShell,v4t(null),tDt(null),_It(null),t.host.setMode("off"),n.finally(()=>{var r,a;(a=(r=t.web).dispose)==null||a.call(r),a7===null&&IRt(null)})}window.__dclEditor={mountHome:ZAr,unmount:KAr};
|
|
38055
|
+
`;L.set("data.json",new TextEncoder().encode(Y));const te=Oqe(SHt(H,T)).slice(0,LAr).replace(/_+$/,"")||"prefab",pe=new Set((await t.list()).map(Z=>Z.name));let fe=1;for(let Z=0;Z<FAr;Z++){let me=te;for(;pe.has(me);)me=`${te}_${++fe}`;try{return await f(me,L),{ref:`user:${me}`,scope:"user",data:Y}}catch(Oe){if(!(Oe instanceof dHt))throw Oe;pe.add(me)}}throw new Error("could not find a free name in your library — try again")},remove:m=>t.remove(m)}}const YPt=new WeakMap;function UAr(t){let n=YPt.get(t);return n===void 0&&(n=crypto.subtle.digest("SHA-256",new Uint8Array(t)).then(r=>[...new Uint8Array(r)].map(a=>a.toString(16).padStart(2,"0")).join("")),YPt.set(t,n)),n}async function $Ar(t){const n=t.get(".dclignore"),r=BZe(t.keys(),n===void 0?void 0:new TextDecoder().decode(n)).filter(l=>l!==zR),a=new Map;let s=0;for(const l of r){const f=t.get(l);f!==void 0&&(a.set(await UAr(f),f.byteLength),s++)}return{bytes:[...a.values()].reduce((l,f)=>l+f,0),files:s}}const XPt=4e3,zAr=4e6,VAr=pIt*24*60*60*1e3,WAr="assets/images",qAr=3e3,HAr=100,GAr="Sign in to keep prefabs in your own library. The built-in prefabs work without it.",JAr=t=>t instanceof Error?t.message:String(t);function B9e(t,n){var r,a,s;return{realm:n.replace(/\/$/,""),systemScene:"",position:((r=t.scene)==null?void 0:r.base)??((s=(a=t.scene)==null?void 0:a.parcels)==null?void 0:s[0])??"0,0",spawn:p2r(t),spawnPoints:JSON.stringify(Array.isArray(t.spawnPoints)?t.spawnPoints:[])}}const QAr=({host:t,sceneCompiler:n})=>{const r=new K2r(G2r()),a=zS(t),s=a===null||a.services.projects===null?null:uHt(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),l=()=>{const{address:Xn,isGuest:Fr}=t.identity();return Fr||Xn===null?null:Xn.toLowerCase()},f=[],m=[],_=[],x=[],T=[],k=Xn=>{f.push(Xn),f.length>XPt&&f.splice(0,f.length-XPt);for(const Fr of m)Fr(Xn)},N=EAr(TAr(t.pageDir,(a==null?void 0:a.services.projects)??null,location.search),me,async Xn=>GPt(await X,l()??"guest",Xn),kAr((a==null?void 0:a.services.worldsContent)??null)),L=Xn=>{for(const Fr of _)Fr(Xn);Xn.type==="bundleSaved"&&pe!==null&&N.built(pe.id).catch(Fr=>console.error("[editor] mobile preview reload failed",Fr))},B=new Map,H=new Set,X=l4t.then(_Ar),Y=bAr({pageDir:t.pageDir,urls:n,machineId:async Xn=>GPt(await X,l()??"guest",Xn),emit:L,log:k,packages:r.packages,saveLock:async(Xn,Fr)=>{await r.write(Xn,zR,Fr),St.touched(Xn,zR),(pe==null?void 0:pe.id)===Xn&&pe.files.set(zR,Fr)},onPackages:(Xn,Fr)=>{if(Fr===null){B.delete(Xn);return}B.set(Xn,Fr);for(const oi of H)oi(Xn,Fr)}});let te=null,pe=null,fe=null,Z=null;async function me(Xn){var Ya;const Fr=(Ya=(await r.list()).find(Za=>Za.id===Xn))==null?void 0:Ya.previewId;if(Fr!==void 0)return Fr;const oi="p"+Array.from(crypto.getRandomValues(new Uint8Array(16)),Za=>Za.toString(16).padStart(2,"0")).join("");return await r.patch(Xn,{previewId:oi}),oi}async function Oe(Xn){const Fr=new URL("preview/",t.pageDir).href,oi=await caches.open(awe);for(const Ya of await oi.keys())Ya.url.startsWith(Fr)&&(Xn===null||!Ya.url.startsWith(Xn))&&await oi.delete(Ya)}let $e=0,yt=Promise.resolve(),lt=Promise.resolve();const wt=n2r({service:(a==null?void 0:a.services.projects)??null,fetch:(Xn,Fr)=>a===null?Promise.reject(new Error("The assistant service is not configured.")):a.signedFetch(Xn,Fr),wallet:l,mobilePreview:N.status,memory:{read:async(Xn,Fr)=>{const oi=await r.assistantMemory(Xn,Fr);return pc(oi)&&typeof oi.id=="string"&&typeof oi.key=="string"?{id:oi.id,key:oi.key}:null},write:(Xn,Fr,oi)=>r.setAssistantMemory(Xn,Fr,oi)},project:()=>{const Xn=Tt();return{id:Xn.id,tools:{files:()=>Xn.files,write:(Fr,oi,Ya,Za)=>Vt(Xn.id,Fr,oi,{expected:Ya,signal:Za}),assets:Vzt({files:()=>Xn.files}),scene:(Fr,oi)=>FTe(Fr,oi,async Ya=>{var ri,yl,Ba;const Za=ss=>{var gs,qs;return JSON.stringify([(gs=ss==null?void 0:ss.scene)==null?void 0:gs.parcels,(qs=ss==null?void 0:ss.scene)==null?void 0:qs.base])};await Ik();const tl=Za(D0(await Ue(Xn.id,"scene.json")));await Kt(Xn.id,ss=>g2r(ss,Ya));const uu=D0(await Ue(Xn.id,"scene.json")),lr=Za(uu)!==tl,Pl=((ri=uu==null?void 0:uu.scene)==null?void 0:ri.parcels)??[],fm=(yl=tt.scene)==null?void 0:yl.parcels.map(ss=>`${ss.x},${ss.y}`).sort().join(";");if(lr||fm!==[...Pl].sort().join(";")){if(!await Xn.flush())throw new Error("The scene did not build. Fix the code and retry sceneSettings to load the new parcels.");oi.throwIfAborted();const ss=await me(Xn.id);te=B9e(uu??{},Y.realmUrl(ss)),await DAr(Pl,()=>{for(const gs of x)gs(te)},oi)}else if(te!==null){const ss=B9e(uu??{},te.realm);(ss.spawn!==te.spawn||ss.spawnPoints!==te.spawnPoints)&&(te={...te,spawn:ss.spawn,spawnPoints:ss.spawnPoints},qfr(ss.spawn,ss.spawnPoints))}return{requiredPermissions:(uu==null?void 0:uu.requiredPermissions)??[],spawnPoints:(uu==null?void 0:uu.spawnPoints)??[],parcels:Pl,base:((Ba=uu==null?void 0:uu.scene)==null?void 0:Ba.base)??null,previewReady:!0}}),written:Gzt,view:(Fr,oi)=>wse(Fr,oi),playtest:mZe,uiLayout:WWe,turnEnded:GVt,build:xEr({saveScene:$zt,fileWrites:()=>lt,vendorRuntime:zae,compile:()=>Y.build(Xn.id,new Map(Xn.files)),run:zzt,mobilePreview:N.status})}}}});function gt(){wt.reset(),Z==null||Z(),Z=null,pe!==null&&(pe.stop(),r.close(pe.id),St.flush(pe.id),pe=null,fe=null)}async function Ue(Xn,Fr){return(pe==null?void 0:pe.id)===Xn?pe.files.get(Fr):r.read(Xn,Fr).catch(oi=>{if(!vI(oi))throw oi})}function Vt(Xn,Fr,oi,Ya){const Za=lt.then(async()=>{if(Ya==null||Ya.signal.throwIfAborted(),Ya!==void 0&&((pe==null?void 0:pe.id)!==Xn||!Qzt(pe.files.get(Fr),Ya.expected)))throw new Error("This file changed. Read it again before writing.");await r.write(Xn,Fr,oi),St.touched(Xn,Fr),(pe==null?void 0:pe.id)===Xn&&(pe.files.set(Fr,oi),pe.changed(Fr))});return lt=Za.catch(tl=>console.error("[editor] file write failed",tl)),Za}function We(Xn,Fr){const oi=lt.then(async()=>{const Ya=await r.remove(Xn,Fr);return Ya&&St.touched(Xn,Fr),Ya&&(pe==null?void 0:pe.id)===Xn&&pe.files.delete(Fr)&&pe.changed(Fr),Ya});return lt=oi.catch(Ya=>console.error("[editor] file removal failed",Ya)),oi}function Me(Xn){const Fr=Tt();if(Fr.id!==Xn)throw new Error("that scene is not the one open");return{files:()=>Fr.files,write:(oi,Ya)=>Vt(Xn,oi,Ya),remove:async oi=>{await We(Xn,oi)}}}async function $t(Xn){var Ya;const Fr=D0(await Ue(Xn,"scene.json").catch(()=>{})),oi=(((Ya=Fr==null?void 0:Fr.display)==null?void 0:Ya.title)??"").replace(/[\x00-\x1f\x7f]/g,"").replace(new RegExp(lHt.source,"g"),"").trim().slice(0,HAr);return oi===""?Xn:oi}async function bt(Xn,Fr){const oi=(await r.list()).find(Za=>Za.id===Xn);if(oi===void 0)return null;const Ya=await r.duplicate(Xn,`${oi.name} ${Fr}`,St.remoteIds());return await Kt(Ya.id,Za=>{var tl;return{...Za,display:{...Za.display??{},title:`${((tl=Za.display)==null?void 0:tl.title)||oi.name} ${Fr}`}}}),Ya.id}const St=sEr({store:r,session:()=>{const Xn=l();return s===null||Xn===null?null:{api:s,wallet:Xn}},account:()=>s===null?"unavailable":l()===null?"guest":"on",hash:nwe,title:$t,duplicate:async Xn=>{const Fr=await bt(Xn,fIt(new Date));if(Fr===null)throw new Error("The scene is no longer on this device");return Fr}});let dt=!1,Nt=0;async function Ht(){const Xn=++Nt,Fr=l()!==null&&(await wt.shell.aiProviders()).some(oi=>oi.available);Xn!==Nt||Fr===dt||(dt=Fr,Yb())}Ht();let Ut=l();const Re=setInterval(()=>{const Xn=l();Xn!==Ut&&(Ut=Xn,wt.reset(),Yb(),Ht(),St.refresh(!0),Oe(fe).catch(Fr=>console.warn("[editor] could not clear the previews",Fr)))},qAr),Ge=()=>{document.visibilityState==="hidden"&&St.flush()};document.addEventListener("visibilitychange",Ge);const ct=new Set;async function Kt(Xn,Fr){const oi=D0(await Ue(Xn,"scene.json"));if(oi===null)throw new Error("scene.json is missing or is not valid JSON");await Vt(Xn,"scene.json",_Pt(Fr(oi)))}async function An(Xn,Fr){if(Fr==null||Fr==="")return null;const oi=await Ue(Xn,Fr).catch(()=>{});return oi===void 0||oi.length>zAr?null:gPt(Fr,oi)}async function un(Xn,Fr=St.status().projects){var Ya,Za,tl,uu;const oi=D0(await Ue(Xn.id,"scene.json").catch(()=>{}));return{sync:Fr[Xn.id],path:Xn.id,name:Xn.name,title:((Ya=oi==null?void 0:oi.display)==null?void 0:Ya.title)||Xn.name,world:((Za=oi==null?void 0:oi.worldConfiguration)==null?void 0:Za.name)||null,parcels:Array.isArray((tl=oi==null?void 0:oi.scene)==null?void 0:tl.parcels)?oi.scene.parcels.length:0,thumbnail:await An(Xn.id,(uu=oi==null?void 0:oi.display)==null?void 0:uu.navmapThumbnail),favourite:Xn.favourite,lastOpened:Xn.lastOpened,published:Xn.published,deletedAt:Xn.deletedAt??void 0}}async function Tn(Xn,Fr){var Ya,Za;gt(),f.length=0,L({type:"sessionStarted"});const oi=tl=>{if(gt(),Fr===$e){k(`✖ ${tl}`);for(const uu of T)uu(tl)}};try{if(await St.prepareOpen(Xn,(ri,yl)=>k(`Downloading from your account… ${ri}/${yl}`)),Fr!==$e)return;if(!await r.open(Xn)){oi("This scene is open in another tab. Close it there to edit it here.");return}const tl=await r.readAll(Xn).then(async ri=>{for(const[yl,Ba]of GTr(ri))await Vt(Xn,yl,Ba),ri.set(yl,Ba);return ri}).catch(ri=>{throw r.close(Xn),ri});if(Fr!==$e){r.close(Xn);return}const uu=await me(Xn);if(Fr!==$e){r.close(Xn);return}const lr=Y.open(Xn,tl,uu);pe=lr;const Pl=Y.realmUrl(uu);if(fe=Pl,k(`▶ Opening ${((Za=(Ya=D0(lr.files.get("scene.json")))==null?void 0:Ya.display)==null?void 0:Za.title)||Xn}`),!await lr.start()&&!await lr.published()){if(Fr!==$e)return;k("✖ The scene did not build.");for(const ri of T)ri("The scene did not build.");return}if(await r.patch(Xn,{lastOpened:Date.now()}),Fr!==$e){gt();return}const fm=D0(lr.files.get("scene.json"))??{};te=B9e(fm,Pl),Z=NAr(ri=>t.engineConsole(ri),k);for(const ri of x)ri(te)}catch(tl){oi(JAr(tl))}}function pi(Xn){N.close(),te=null;const Fr=++$e,oi=wt.reset(),Ya=yt.then(async()=>{await oi,await lt,Fr===$e&&await Xn(Fr)});return yt=Ya.catch(Za=>console.error("[editor] project transition failed",Za)),Ya}function Tt(){if(pe===null)throw new Error("no project is open");return pe}const Wi={saveFile:async({path:Xn,content:Fr})=>Vt(Tt().id,Xn,Fr),getFile:async({path:Xn})=>{const Fr=Tt().files.get(Xn)??nAr(Xn);if(Fr===void 0)throw new Error(`no such file: ${Xn}`);return{content:Fr}},removeFiles:async({filePaths:Xn})=>{const Fr=Tt(),oi=[],Ya=[];for(const Za of Xn)(await We(Fr.id,Za).catch(()=>!1)?oi:Ya).push(Za);return{success:oi,failed:Ya}},getFilesSizes:async({path:Xn,ignore:Fr})=>{const oi=Xn===""?"":`${Xn.replace(/\/+$/,"")}/`;return{files:[...Tt().files.keys()].filter(Za=>Za.startsWith(oi)&&!Za.split("/").some(tl=>Fr.includes(tl))).sort().map(Za=>({path:Za}))}}},Er={async find(Xn){return(await r.list()).some(Fr=>Fr.id===Xn)?!0:(await St.refresh(!0),St.remoteOnly().some(Fr=>Fr.id===Xn))},files:async Xn=>(pe==null?void 0:pe.id)===Xn?new Map(pe.files):r.readAll(Xn),manifest:Xn=>St.manifest(Xn),build:async(Xn,Fr)=>Y.build(Xn,await Er.files(Xn),Fr),dependencies:async Xn=>sHt(await Ue(Xn,"package.json")),onImported:Xn=>(ct.add(Xn),()=>ct.delete(Xn))},to=a===null?null:H2r({host:a,setWorld:async(Xn,Fr)=>{var Ya,Za;((Za=(Ya=D0(await Ue(Xn,"scene.json")))==null?void 0:Ya.worldConfiguration)==null?void 0:Za.name)!==Fr&&await Kt(Xn,tl=>({...tl,worldConfiguration:{...tl.worldConfiguration??{},name:Fr}}))},files:Xn=>Er.files(Xn),build:(Xn,Fr)=>Y.build(Xn,Fr,{production:!0}),published:(Xn,Fr)=>r.patch(Xn,{published:Fr})}),ja=(a==null?void 0:a.services.projects)==null?null:BAr(nEr(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),nwe);Pmr(s2r(t.editorBase)),o2r(t.editorBase),Yzt({material:c2r,sound:l2r}),ohr(async()=>$Ar(await Er.files(Tt().id)));const Vo=dAr({builtin:wEr(t.editorBase,PB("prefabs/catalog.json"),qTe),user:()=>ja!==null&&l()!==null?ja.tree:null}),el={...(a==null?void 0:a.services.projects)==null?{}:{...wt.shell,aiOffered:()=>dt,aiTranscript:()=>{const Xn=Ut;if(Xn===null||pe===null)return null;const Fr=pe.id;return{owner:`${Fr}@${Xn.toLowerCase()}`,load:()=>r.transcript(Fr,Xn),save:oi=>r.setTranscript(Fr,Xn,oi)}}},pickProject:async()=>{},openProject:Xn=>pi(Fr=>Tn(Xn,Fr)),relaunchProject:Xn=>pi(Fr=>Tn(Xn,Fr)),closeProject:()=>pi(async()=>{gt(),L({type:"sessionStarted"}),k("■ Scene closed"),await Oe(null).catch(Xn=>console.warn("[editor] could not clear the previews",Xn))}),getState:async()=>{const Xn=await r.list(),Fr=St.status().projects,oi=St.remoteOnly().map(Ya=>({path:Ya.id,name:Ya.name,title:Ya.name,world:null,parcels:0,thumbnail:null,remoteOnly:!0}));return{recentProjects:[...Xn].sort((Ya,Za)=>Za.lastOpened-Ya.lastOpened).map(Ya=>Ya.id),projects:[...await Promise.all(Xn.map(Ya=>un(Ya,Fr))),...oi],logs:[...f],bevyWebDir:"",editorSceneDir:"",webPort:0,scenePort:0,editorScenePort:0,favourites:Xn.filter(Ya=>Ya.favourite).map(Ya=>Ya.id)}},onStackLog:Xn=>{m.push(Xn)},onBuildEvent:Xn=>{_.push(Xn)},onServersReady:Xn=>{x.push(Xn)},requestReady:async()=>te,phonePreview:async Xn=>te===null?{ok:!1,reason:"no-scene"}:N.open(te.realm,te.position,Xn),phonePreviewState:N.state,onPhonePreviewState:N.subscribe,closePhonePreview:N.close,capturePhonePreview:N.capture,onServersError:Xn=>{T.push(Xn)},toggleFavourite:async Xn=>{const Fr=(await r.list()).find(oi=>oi.id===Xn);Fr!==void 0&&await r.patch(Xn,{favourite:!Fr.favourite})},deleteProject:async Xn=>{const Fr=await r.trash(Xn);return Fr&&St.trashed(Xn),Fr},trashedProjects:async()=>Promise.all((await r.trashed()).map(Xn=>un(Xn))),restoreProject:async Xn=>{const Fr=await r.restore(Xn);return Fr&&St.restored(Xn),Fr},syncStatus:async()=>(St.refresh(),St.status()),onSyncStatus:Xn=>St.subscribe(Xn),resolveSyncConflict:(Xn,Fr)=>St.resolve(Xn,Fr),exportProject:async Xn=>yEr(await $t(Xn),await Er.files(Xn)),importProject:async Xn=>{const Fr=await bEr(Xn,async(oi,Ya)=>{const Za=await r.create(oi,Ya,{taken:St.remoteIds()});return St.touched(Za.id,"scene.json"),Za.id});if((Fr==null?void 0:Fr.ok)===!0){const{id:oi,needsPackages:Ya}=Fr.report;Object.keys(Ya).length>0&&r.readAll(oi).then(Za=>Y.install(oi,Za)).catch(Za=>console.warn("[editor] could not install the packages of",oi,Za));for(const Za of ct)Za(Fr.report)}return Fr},projectPackages:async Xn=>B.get(Xn)??null,onProjectPackages:Xn=>(H.add(Xn),()=>H.delete(Xn)),...to===null||a===null?{}:{publishScene:(Xn,Fr,oi)=>to.publish(Xn,Fr,oi),...to.publishShared===void 0?{}:{publishShared:to.publishShared},publishStop:async()=>to.stop(),publishWorlds:async()=>W2r(l(),a.services.worldsContent)},canImportFolder:gEr(),renameProject:(Xn,Fr)=>Kt(Xn,oi=>({...oi,display:{...oi.display??{},title:Fr.trim()}})),duplicateProject:Xn=>bt(Xn,"copy"),sceneTemplates:async()=>KEr(),createScene:async(Xn,Fr,oi)=>{const Ya=xHt(oi),Za=D0(Ya.get("scene.json"));if(Za===null)throw new Error(`template not found: ${oi}`);Ya.set("scene.json",_Pt({...Za,display:{...Za.display??{},title:Fr.trim()}}));const tl=await r.create(Fr,Ya,{taken:St.remoteIds()});return St.touched(tl.id,"scene.json"),tl.id},openExternal:async Xn=>{/^https?:$/.test(new URL(Xn).protocol)&&window.open(Xn,"_blank","noopener,noreferrer")},compositeEntityIds:async Xn=>{for(const Fr of m2r){const oi=await Ue(Xn,Fr);if(oi!==void 0)return h2r(new TextDecoder().decode(oi))}return[]},sceneSettings:async Xn=>{const Fr=D0(await Ue(Xn,"scene.json"));if(Fr===null)throw new Error("scene.json is missing or is not valid JSON");const oi=u2r(Fr);return{...oi,thumbnail:await An(Xn,oi.thumbnailPath)}},saveSceneSettings:async(Xn,Fr)=>{const oi=d2r(Fr);return oi!==null?oi:(await Kt(Xn,Ya=>f2r(Ya,Fr)),null)},pickSceneThumbnail:async Xn=>{const Fr=await bHt(Object.values(bqe).join(","));if(Fr===null)return null;const oi=iHt(Fr.name);if(bqe[oi]===void 0)throw new Error("not a supported image (png, jpg, gif, webp)");const Ya=`${WAr}/scene-thumbnail${oi}`,Za=new Uint8Array(await Fr.arrayBuffer());return await Vt(Xn,Ya,Za),{path:Ya,dataUrl:gPt(Ya,Za)}},appVersion:async()=>Kkr,prefabLibraryList:()=>Vo.list(),prefabLibraryCopyIn:async(Xn,Fr)=>Vo.copyIn(Xn,Me(Fr)),prefabLibraryUpdateCopy:async(Xn,Fr)=>Vo.updateCopy(Xn,Me(Fr)),prefabUserLibrary:()=>ja===null?"unavailable":l()===null?"guest":"on",...ja===null?{}:{prefabLibraryCopyOut:async(Xn,Fr)=>{if(l()===null)throw new Error(GAr);return ja.copyOut(Me(Xn),Fr)},prefabLibraryDelete:async Xn=>{const Fr=wHt(Xn);return(Fr==null?void 0:Fr.scope)==="user"&&l()!==null?ja.remove(Fr.name):!1}}};async function Gl(){const Xn=new Set;for(const Fr of[...await r.list(),...await r.trashed()]){const oi=Jqt(await Ue(Fr.id,zR).catch(()=>{}));for(const Ya of Object.keys((oi==null?void 0:oi.packages)??{}))Xn.add(Ya);for(const[Ya,Za]of Object.entries((oi==null?void 0:oi.dependencies)??{}))Xn.add(i7(Ya,Za))}for(const Fr of await r.packages.keys())Xn.has(Fr)||await r.packages.remove(Fr)}return r.purge(Date.now()-VAr).then(async Xn=>{const Fr=await caches.open(awe),oi=Xn.map(({id:Za,previewId:tl})=>Y.realmUrl(tl??Za));for(const Za of await Fr.keys())oi.some(tl=>Za.url.startsWith(tl))&&await Fr.delete(Za);const Ya=await caches.open(Xkr);for(const Za of oi)await Ya.delete(`${Za}__storage`);Xn.length>0&&await Gl()}).catch(Xn=>console.warn("[editor] could not empty the trash",Xn)),{shell:el,projects:Er,dataLayer:Wi,dispose:()=>{N.dispose(),wt.dispose(),$e++,gt(),Y.dispose(),clearInterval(Re),document.removeEventListener("visibilitychange",Ge),St.flush().finally(()=>St.dispose())}}};let a7=null,RH=null,gre=null,ZPt=!1;function YAr(){if(a7!==null)return a7;const t=window.__dclEditorHost;if(t===void 0||t.version!==0&&t.version!==1)return console.error("[editor] window.__dclEditorHost (contract v0 or v1) is missing: nothing to mount into"),null;console.log("[editor] web build 2026-11-02T13:10:27.324Z"),_It(t),tDt(a=>t.engineConsole(a)),v4t(()=>t.identity()),QJn.needed=!1;const n=QAr({host:t,sceneCompiler:a2r(t.editorBase)});window.editorShell=XAr(n.shell,t),IRt(n.dataLayer??null),EGe();const r=document.createElement("link");return r.rel="stylesheet",r.href=new URL("editor.css",t.editorBase).href,r.integrity=PB("editor.css"),r.crossOrigin="anonymous",r.onerror=()=>console.error("[editor] editor.css did not load or does not match the hash this editor was published with: its fonts are not applied"),document.head.appendChild(r),G1.project=null,G1.notice=null,a7={host:t,web:n,fonts:r},a7}function lwe(){const t=RH;RH=null,t==null||t.unmount()}function XAr(t,n){const{createScene:r,importProject:a,duplicateProject:s}=t;return{...t,...r===void 0?{}:{createScene:async(l,f,m)=>{const _=await r(l,f,m);return _!==null&&tw("project_created",{project_id:_,source:"template",template:m}),_}},...a===void 0?{}:{importProject:async l=>{const f=await a(l);return(f==null?void 0:f.ok)===!0&&tw("project_created",{project_id:f.report.id,source:"import",import_kind:l}),f}},...s===void 0?{}:{duplicateProject:async l=>{const f=await s(l);return f!==null&&tw("project_created",{project_id:f,source:"duplicate",from_project_id:l}),f}},openProject:async l=>{const f=RH;lwe(),f==null||f.api.close(),gre??(gre=g7t(n.container,C.jsx(PTr,{}))),n.setMode("edit"),G1.project=l,G1.opens++,await t.openProject(l),tw("project_opened")}}}function ZAr(t,n){var m;const r=YAr();if(r===null)return()=>{};lwe();const a=document.createElement("div");a.style.cssText="position:relative;width:100%;height:100%",OJn(a),t.appendChild(a);const s=g7t(a,C.jsx(NJn,{}),"eui-create-root"),l={api:n,unmount:()=>{s(),a.remove()}};RH=l;const f=ZPt?null:((m=zS(r.host))==null?void 0:m.openProject)??null;return ZPt=!0,tw("editor_opened",{deep_link:f!==null}),f!==null&&r.web.projects.find(f).catch(()=>!1).then(_=>{var x;RH===l&&(_?(x=window.editorShell)==null||x.openProject(f):G1.notice=`“${f}” is not on this device or on your account. Here are your scenes.`)}),()=>{RH===l&&lwe()}}function KAr(){lwe();const t=a7;if(t===null)return;a7=null;const n=Ik();gre==null||gre(),gre=null,t.fonts.remove(),G1.project=null,delete window.editorShell,v4t(null),tDt(null),_It(null),t.host.setMode("off"),n.finally(()=>{var r,a;(a=(r=t.web).dispose)==null||a.call(r),a7===null&&IRt(null)})}window.__dclEditor={mountHome:ZAr,unmount:KAr};
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl-regenesislabs/web-editor",
|
|
3
|
-
"version": "0.3.22
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "The Decentraland scene editor for the web explorer: editor.js plus the files it loads beside it. Served by version, not installed.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/dcl-regenesislabs/web-editor.git",
|
|
9
9
|
"directory": "packages/web"
|
|
10
|
-
}
|
|
11
|
-
"commit": "0318d9f308ca02906b77eb18953850304d512743"
|
|
10
|
+
}
|
|
12
11
|
}
|