import{k as a}from"./D46VGJgj.js";function f(){let e=new Date().getTime(),o=typeof performance{let t=Math.random()*16;return e>0?(t=(e+t)%16|0,e=Math.floor(e/16)):(t=(o+t)%16|0,o=Math.floor(o/16)),(n=="x"?t:t&7|8).toString(16)})}function m(e,o,...n){e.code==="Enter"&&o(e,...n)}function h(e){return`${a(e)}-${f().split("-").slice(0,2).join("")}`}async function p(e){const o=await fetch(e),n=await o.json();if(o.ok)return n;throw new Error(n)}function u(e,o,n,t=[]){for(let s=0;so===i.id));if(c&&c.comment!==null){const i={comment:c.comment,color:r.color,id:r.id,name:r.name};t.push(i)}}u(r.children,o,n,t)}return t}function d(e){if(e.version)return e;{const o=["layers","templates"],n={...e,matrixCommentMode:!1,version:"1"};for(const t of o){const s=Object.values(e[t]).reduce((x,r)=>{const c=r.techniques.map(i=>typeof i=="string"?{id:i,comment:""}:i);return x[r.id]={...r,techniques:c},x},{});n[t]=s}return n}}function y(e){const o=[void 0,"1"];let n=e;for(const t of o)t===(e==null?void 0:e.version)?n=d(n):t===e.version&&(n=n);return n}export{p as a,y as b,h as c,m as f,u as p};