lecodes-cli 2.0.2 → 2.0.4

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.
Files changed (39) hide show
  1. package/dist/index.js +1013 -127
  2. package/package.json +13 -12
  3. package/runtime/sdk-types.json +1 -1
  4. package/runtime/web/VERSION.json +3 -3
  5. package/runtime/web/assets/{inspect-C7x78PNs.js → inspect-DdJ50Kun.js} +2 -2
  6. package/runtime/web/player.js +18 -18
  7. package/runtime/web-lite/assets/canvas-C6G_Pb2Q.js +1 -0
  8. package/runtime/web-lite/assets/pager-O712dZv9.js +1 -0
  9. package/runtime/web-lite/assets/roboto-cyrillic-DVBNKCCH.woff2 +0 -0
  10. package/runtime/web-lite/assets/roboto-cyrillic-ext-1gPz9dK9.woff2 +0 -0
  11. package/runtime/web-lite/assets/roboto-greek-DVLYEgdx.woff2 +0 -0
  12. package/runtime/web-lite/assets/roboto-greek-ext-D98D44EL.woff2 +0 -0
  13. package/runtime/web-lite/assets/roboto-latin-cAJwcdBQ.woff2 +0 -0
  14. package/runtime/web-lite/assets/roboto-latin-ext-t610Sqxq.woff2 +0 -0
  15. package/runtime/web-lite/assets/roboto-rest-C7JkyNHT.woff2 +0 -0
  16. package/runtime/web-lite/assets/roboto-vietnamese-w-p-nKZZ.woff2 +0 -0
  17. package/runtime/web-lite/assets/tween-t_XDy3Nd.js +1 -0
  18. package/runtime/web-lite/assets/vlist-gEB8Sn0S.js +1 -0
  19. package/runtime/web-lite/features.json +51 -0
  20. package/runtime/web-lite/index.html +23 -0
  21. package/runtime/web-lite/lite.js +249 -0
  22. package/src/commands/design/comments.ts +1 -1
  23. package/src/commands/design/context.ts +1 -1
  24. package/src/commands/design/index.ts +1 -1
  25. package/src/commands/dev.ts +17 -53
  26. package/src/commands/index.ts +2 -0
  27. package/src/commands/test.ts +55 -6
  28. package/src/commands/update/index.ts +8 -5
  29. package/src/commands/web.ts +171 -0
  30. package/src/compile/fonts.ts +5 -2
  31. package/src/dev/devServer.ts +20 -1
  32. package/src/dev/watchProject.ts +53 -0
  33. package/src/dev/webRunner.ts +10 -0
  34. package/src/hosts/archives.ts +66 -0
  35. package/src/hosts/liteBrowser.mjs +86 -0
  36. package/src/hosts/liteRunner.ts +386 -0
  37. package/src/hosts/peerInstall.ts +12 -8
  38. package/src/web/build.ts +194 -0
  39. package/src/web/preview.ts +50 -0
@@ -0,0 +1,249 @@
1
+ var Rn=Object.defineProperty;var Cn=(e,t,n)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ve=(e,t,n)=>Cn(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const $n=e=>{if(typeof e=="string")return e;if(e instanceof Error)return e.stack?`${String(e)}
2
+ ${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},An=(e,t)=>{const n=o=>{fetch(`${e}/log`,{method:"POST",body:JSON.stringify(o),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let r=-1;const i=async()=>{try{const{v:o}=await(await fetch(`${e}/version`,{cache:"no-store"})).json();typeof o=="number"&&t(o)}catch{}setTimeout(i,2500)};setTimeout(i,2500);const s=()=>{let o;try{o=new WebSocket(e.replace(/^http/,"ws")+"/ws")}catch{return}o.onopen=()=>o.send(JSON.stringify({type:"hello",v:r})),o.onmessage=a=>{let d={};try{d=JSON.parse(String(a.data))}catch{return}d.type==="reload"&&typeof d.v=="number"&&t(d.v)},o.onclose=()=>{setTimeout(s,2e3)}};return s(),{bundleUrl:o=>`${e}/bundle.js?t=web&v=${o}`,versionOf(o,a){const d=Number(o.headers.get("x-lecodes-v"));return o.headers.has("x-lecodes-v")&&Number.isFinite(d)?d:a},ran(o){r=o},log:(o,a)=>n({type:"log",level:o,text:a.map($n).join(" ")}),error:o=>n({type:"error",text:o})}},On=(e,t)=>{try{const n=new URL(e,t);return n.origin===new URL(t).origin&&(n.protocol==="http:"||n.protocol==="https:")?n.href:null}catch{return null}},pt="2.0.4",We=e=>{const t=e==null?void 0:e.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},Un=(e,t)=>We(e)!==null&&We(e)===We(t),Fn=(e,t="woff2")=>{const n=/^\/\/ fonts: (.+)$/m.exec(e);if(!n)return[];const r=[];for(const i of n[1].split(";")){const s=i.indexOf("=");if(s===-1)continue;const o=/^(.+)@(\d+)(i?)$/.exec(i.slice(0,s));o&&r.push({family:o[1],weight:parseInt(o[2],10),italic:o[3]==="i",url:i.slice(s+1).replace("{fmt}",t)})}return r},Nn=async(e,t,n=2e3)=>{const r=t??(typeof document>"u"?void 0:document);if(!(r!=null&&r.fonts)||e.length===0)return;const i=[];for(const s of e)try{const o=new FontFace(s.family,`url("${s.url}")`,{weight:String(s.weight),style:s.italic?"italic":"normal"});r.fonts.add(o),i.push(o.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(i),new Promise(s=>setTimeout(s,n))])},Mn=e=>{var d,f,y,E;const t=e.slice(0,2e3),n=new Set,r=t.match(/\/\/ preload: (.+)/);if(r)for(const h of r[1].split(";"))n.add(h);const i=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",s=((d=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:d[1])??null,o=((y=(f=t.match(/^\/\/ name: (.+)$/m))==null?void 0:f[1])==null?void 0:y.trim())??null,a=new Set((((E=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:E[1])??"").split(";").map(h=>h.trim()).filter(Boolean));return{sdk:s,name:o,preloads:n,gl:i,is2d:t.includes("// 2d: enable"),plugins:a,bootFonts:Fn(t)}},Dn=1,In=2,Pn=3,Bn=4,zn=5,Vn=6,mt=7,Wn=8,ht=9,Gn=10,Hn=11,jn=12,Kn=13,Yn=14,qn=15,Xn=16,gt=17,Jn=18,Qn=19,_e=20,qs=21,Xs=22,Js=23,Qs=24,Zn=26,er=27,tr=30,bt=31,nr=32,rr=33,yt=34,Et=35,Oe=1,or=2,sr=4,oe=8,ir=16,Ge=32,cr=64,He=128,ar=256,lr=512,ur=1024,fr=2048,dr=4096,vt=8192,Zs=16384,pr=32768,mr=1<<18,hr=255,wt=256,St=512,gr=1024,j=0,br=1,yr=2,Er=3,Me=4,Ue=255,en=e=>{const t=e.clientWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1},kt={text:{type:"text"},password:{type:"password"},search:{type:"search"},tel:{type:"tel"},email:{type:"email"},url:{type:"url"},number:{type:"text",mode:"numeric"},decimal:{type:"text",mode:"decimal"},date:{type:"date"},time:{type:"time"}},Tt=(e,t)=>e==null?t:e===!0||e==="true"||e==="1"||typeof e=="number"&&e>.5,J=(e,t,n)=>{n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)},vr=(e,t)=>{if(e.type!=="input"&&e.type!=="textarea")return;const n=e.el,r=t("placeholder");if(J(n,"placeholder",r==null?null:String(r)),e.type==="input"){const a=kt[String(t("type")??"text")]??kt.text,d=n;d.type!==a.type&&(d.type=a.type),J(n,"inputmode",a.mode??null);const f=t("enterKey");J(n,"enterkeyhint",f==null?null:String(f))}const i=t("autocapitalize");J(n,"autocapitalize",i==null?null:String(i));const s=t("autocorrect");s==null?(J(n,"autocorrect",null),J(n,"spellcheck",null)):(J(n,"autocorrect",Tt(s,!0)?"on":"off"),J(n,"spellcheck",Tt(s,!0)?"true":"false"));const o=Number(t("maxLength")??0);J(n,"maxlength",o>0?String(Math.round(o)):null)},De={width:"layout",height:"layout",minWidth:"layout",minHeight:"layout",maxWidth:"layout",maxHeight:"layout",flexBasis:"layout",flexGrow:"layout",flexShrink:"layout",aspectRatio:"layout",gap:"layout",rowGap:"layout",columnGap:"layout",padding:"layout",paddingTop:"layout",paddingRight:"layout",paddingBottom:"layout",paddingLeft:"layout",paddingHorizontal:"layout",paddingVertical:"layout",paddingStart:"layout",paddingEnd:"layout",margin:"layout",marginTop:"layout",marginRight:"layout",marginBottom:"layout",marginLeft:"layout",marginHorizontal:"layout",marginVertical:"layout",marginStart:"layout",marginEnd:"layout",left:"layout",right:"layout",top:"layout",bottom:"layout",start:"layout",end:"layout",inset:"layout",flexDirection:"enum",justifyContent:"enum",alignItems:"enum",alignSelf:"enum",position:"enum",flexWrap:"enum",boxSizing:"enum",display:"enum",overflow:"enum",scrollDirection:"enum",borderWidth:"len",borderTopWidth:"len",borderRightWidth:"len",borderBottomWidth:"len",borderLeftWidth:"len",borderHorizontalWidth:"len",borderVerticalWidth:"len",borderStartWidth:"len",borderEndWidth:"len",color:"color",backgroundColor:"color",borderColor:"color",borderTopColor:"color",borderRightColor:"color",borderBottomColor:"color",borderLeftColor:"color",placeholderColor:"color",refreshControlColor:"color",tintColor:"color",rippleColor:"color",overlayColor:"color",backgroundImage:"str",backgroundSize:"enum",backgroundGradient:"str",borderRadius:"len",borderTopLeftRadius:"len",borderTopRightRadius:"len",borderBottomRightRadius:"len",borderBottomLeftRadius:"len",opacity:"num",transform:"str",transformOrigin:"str",pointerEvents:"enum",fontSize:"len",fontWeight:"num",fontStyle:"enum",fontFamily:"str",lineHeight:"len",letterSpacing:"len",textAlign:"enum",textDecoration:"enum",lineClamp:"num",textOverflow:"enum",objectFit:"enum",placeholder:"str",type:"enum",enterKey:"enum",autocapitalize:"enum",autocorrect:"num",maxLength:"num",keyboardShrink:"num",keyboardDismiss:"num",showScrollbar:"num",overscrollMode:"enum",keyboardDismissMode:"enum",snap:"enum",sheetDetents:"str",sheetDetent:"num",sheetDismissible:"num",dim:"num"},wr={p:"padding",pt:"paddingTop",pr:"paddingRight",pb:"paddingBottom",pl:"paddingLeft",px:"paddingHorizontal",py:"paddingVertical",m:"margin",mt:"marginTop",mr:"marginRight",mb:"marginBottom",ml:"marginLeft",mx:"marginHorizontal",my:"marginVertical",bgColor:"backgroundColor",bgImage:"backgroundImage",bgSize:"backgroundSize",bgGradient:"backgroundGradient"},Sr=["placeholderColor","refreshControlColor","tintColor","rippleColor","overlayColor","backgroundGradient"],kr={display:"flex",overflow:"visible",scrollDirection:"vertical",borderWidth:0,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftWidth:0,borderHorizontalWidth:0,borderVerticalWidth:0,borderStartWidth:0,borderEndWidth:0,backgroundColor:0,borderColor:0,borderTopColor:0,borderRightColor:0,borderBottomColor:0,borderLeftColor:0,backgroundImage:"",backgroundSize:"cover",borderRadius:0,borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomRightRadius:0,borderBottomLeftRadius:0,opacity:1,transform:"identity",transformOrigin:"50% 50%",pointerEvents:"all",fontSize:14,fontWeight:400,fontStyle:"normal",lineHeight:"normal",letterSpacing:0,textAlign:"start",textDecoration:"none",lineClamp:0,textOverflow:"ellipsis",objectFit:"cover",placeholder:"",type:"text",enterKey:"done",autocapitalize:"sentences",autocorrect:1,maxLength:0,keyboardShrink:1,keyboardDismiss:1,showScrollbar:1,overscrollMode:"default",keyboardDismissMode:"interactive",snap:"none",sheetDetents:"",sheetDetent:0,sheetDismissible:1,dim:0},Tr=["duration","delay","layer","commit","loop","loopMode","name"],Lr=/\b(?:calc|min|max|clamp)\(/,_r=e=>{if(!Lr.test(e))return e;let t="";for(let n=0;n<e.length;n++){if(e.startsWith("var(",n)){let i=0;const s=n;for(;n<e.length;n++)if(e[n]==="(")i++;else if(e[n]===")"&&--i===0)break;t+=e.slice(s,Math.min(n+1,e.length));continue}const r=e[n];if(r==="+"||r==="-"){const i=t[t.length-1]??"";if(!(r==="-"&&(i==="e"&&"btlr".includes(e[n+1]??"")||e.slice(Math.max(0,n-7),n)==="comfort"))&&/[\w%.)]/.test(i)){for(t=t.trimEnd()+" "+r+" ";e[n+1]===" ";)n++;continue}}t+=r}return t.replace(/\d*\.\d+|\d+/g,(n,r,i)=>{const s=i.slice(0,r).trimEnd(),o=i.slice(r+n.length).trimStart();return/[\w.%]$/.test(s)||/^[\w.%]/.test(o)||/[*/]$/.test(s)||/^[*/]/.test(o)?n:n+"px"})},xr={top:"12px",bottom:"4px",left:"16px",right:"16px"},tn=e=>`max(var(--safe-${e}, 0px), calc(var(--safe-${e}-bar, 0px) + var(--comfort-${e}, ${xr[e]})))`,Rr={vw:"cqw",vh:"cqh",vmin:"cqmin",vmax:"cqmax"},Ee=e=>_r(e).replace(new RegExp("(?<![-\\w])comfort-(top|bottom|left|right)\\b","g"),(t,n)=>tn(n)).replace(new RegExp("(?<![-\\w])safe-(top|bottom|left|right)\\b","g"),(t,n)=>`var(--safe-${n}, 0px)`).replace(/(\d)(vmin|vmax|vw|vh)\b/g,(t,n,r)=>n+Rr[r]),at=/^-?\d*\.?\d+$/,Q=e=>{if(typeof e=="number")return e+"px";const t=String(e).trim();return at.test(t)?t+"px":Ee(t)},ve=e=>{if(typeof e=="number")return"#"+(e>>>0).toString(16).padStart(e<=16777215?6:8,"0");const t=String(e);return t==="clear"?"transparent":t},Cr=/^(rotate|skew)/,$r=/^translate/,Ar=e=>{const t=String(e).trim();return t===""||t==="identity"?"none":t.replace(/([a-zA-Z0-9]+)\s*\(([^)]*)\)/g,(n,r,i)=>{const s=$r.test(r)?"px":Cr.test(r)?"deg":null;return s===null?n:`${r}(${i.split(",").map(o=>{const a=o.trim();return at.test(a)?a+s:Ee(a)}).join(", ")})`})},nn=e=>typeof e=="number"?e+"px":String(e).trim().split(/\s+/).map(t=>at.test(t)?t+"px":Ee(t)).join(" "),q=0,X=1,he=2,Fe=["top","right","bottom","left"],Or=(e,t)=>e==="safe-all"?`var(--safe-${t}, 0px)`:e==="comfort-all"||e==="comfort-x"||e==="comfort-y"?tn(t):Q(e),tt=(e,t)=>{const n=(i,s)=>({rank:s,to:o=>i.map(a=>[t(a),Or(o,a)])}),r=i=>({rank:X,to:s=>[[t(i),Q(s)]]});return{[e]:n(Fe,q),[`${e}Horizontal`]:n(["left","right"],X),[`${e}Vertical`]:n(["top","bottom"],X),[`${e}Start`]:r("inline-start"),[`${e}End`]:r("inline-end"),[`${e}Top`]:n(["top"],he),[`${e}Right`]:n(["right"],he),[`${e}Bottom`]:n(["bottom"],he),[`${e}Left`]:n(["left"],he)}},Ur=()=>{const e=tt("border",n=>`border-${n}-width`),t={};for(const n of Object.keys(e))t[`${n}Width`]=e[n];return t},lt=e=>{const t=[];let n=0,r="";for(const i of e.trim()){if(i==="("&&n++,i===")"&&n--,/\s/.test(i)&&n===0){r&&t.push(r),r="";continue}r+=i}return r&&t.push(r),t},Fr=new Set(["none","solid","dashed","dotted","double","hidden"]),Nr=/^-?\d*\.?\d+([a-z%]*)$|^(calc|min|max|clamp)\(/,pe=(e,t)=>({rank:t,to:n=>{let r=null,i=null,s=null;if(typeof n=="number")r=n+"px";else for(const a of lt(String(n)))Fr.has(a)?s=a:Nr.test(a)?r=Q(a):i=ve(a);const o=[];for(const a of e)o.push([`border-${a}-width`,r??(i?"1px":"0px")]),o.push([`border-${a}-color`,i??"transparent"]),s&&o.push([`border-${a}-style`,s]);return o}}),Mr=e=>{const t=String(e).trim(),n=(s,o,a)=>[["flex-grow",s],["flex-shrink",o],["flex-basis",a]];if(t==="none")return n("0","0","auto");if(t==="auto")return n("1","1","auto");if(t==="initial")return n("0","1","auto");const r=lt(t),i=s=>s!==void 0&&/^-?\d*\.?\d+$/.test(s);return i(r[0])?r.length===1?n(r[0],"1","0%"):i(r[1])?n(r[0],r[1],r[2]!==void 0?Q(r[2]):"0%"):n(r[0],"1",Q(r[1])):n("1","1",Q(r[0]??"auto"))},rn=e=>{var t;return typeof e=="object"&&e!==null&&"_h"in e&&typeof((t=e._h)==null?void 0:t.id)=="number"},on=(e,t)=>{if(rn(e))return`url("${t.bufferUrl(e._h.id)}")`;const n=String(e??"");return n===""?"none":n.startsWith("id:")?`url("${t.bufferUrl(Number(n.slice(3)))}")`:`url("${n.replace(/["\\\n]/g,r=>"\\"+r)}")`},Dr=/^\s*(repeating-)?(linear|radial|conic)-gradient\(/,sn=e=>{const t=String(e??"").trim();return t===""?"none":Ee(t)},Ir=(e,t)=>{const n=typeof e=="string"&&Dr.test(e),r=rn(e)||typeof e=="string"&&/^(id:|https?:|data:|blob:|\.{0,2}\/)/.test(e);return[["--lc-bg-grad",n?sn(e):"none"],["--lc-bg-img",r?on(e,t):"none"],["background-color",n||r?"transparent":ve(e)]]},Pr=e=>{const t=typeof e=="number"?[e+"px"]:lt(String(e)).map(o=>nn(o)),[n,r=n,i=n,s=r]=t;return[["border-top-left-radius",n??"0px"],["border-top-right-radius",r??"0px"],["border-bottom-right-radius",i??"0px"],["border-bottom-left-radius",s??"0px"]]},Br=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-monospace","ui-sans-serif","ui-serif","inherit"]),zr=e=>{const t=String(e).trim();return t==="monospaced"?"monospace":t.startsWith("var(")||t.includes(",")||/^["']/.test(t)||Br.has(t)?t:`"${t.replace(/"/g,'\\"')}"`},Vr=e=>e===!0||e==="true"||typeof e=="number"&&e>.5||e==="1",Wr=e=>t=>e[String(t)]??String(t),we={width:{css:"width",as:"len"},height:{css:"height",as:"len"},minWidth:{css:"min-width",as:"len"},minHeight:{css:"min-height",as:"len"},maxWidth:{css:"max-width",as:"len"},maxHeight:{css:"max-height",as:"len"},flexBasis:{css:"flex-basis",as:"len"},flexGrow:{css:"flex-grow",as:"num"},flexShrink:{css:"flex-shrink",as:"num"},aspectRatio:{css:"aspect-ratio",as:"num"},gap:{css:["row-gap","column-gap"],as:"len",rank:q},rowGap:{css:"row-gap",as:"len"},columnGap:{css:"column-gap",as:"len"},...tt("padding",e=>`padding-${e}`),...tt("margin",e=>`margin-${e}`),inset:{css:Fe,as:"len",rank:q},top:{css:"top",as:"len"},right:{css:"right",as:"len"},bottom:{css:"bottom",as:"len"},left:{css:"left",as:"len"},start:{css:"inset-inline-start",as:"len",rank:X},end:{css:"inset-inline-end",as:"len",rank:X},flexDirection:{css:"flex-direction",as:"raw"},justifyContent:{css:"justify-content",as:"raw"},alignItems:{css:"align-items",as:"raw"},alignSelf:{css:"align-self",as:"raw"},position:{css:"position",as:"raw"},flexWrap:{css:"flex-wrap",as:"raw"},boxSizing:{css:"box-sizing",as:"raw"},display:{css:"display",as:"raw"},overflow:{rank:q,to:e=>{const t=e==="scroll"?"auto":String(e);return[["overflow-x",t],["overflow-y",t]]}},scrollDirection:{to:e=>e==="horizontal"?[["overflow-x","auto"],["overflow-y","hidden"],["flex-direction","row"]]:e==="all"?[["overflow-x","auto"],["overflow-y","auto"]]:[["overflow-x","hidden"],["overflow-y","auto"],["flex-direction","column"]],rank:X},...Ur(),color:{css:"color"},backgroundColor:{css:"background-color"},borderColor:{css:Fe.map(e=>`border-${e}-color`),rank:q},borderTopColor:{css:"border-top-color"},borderRightColor:{css:"border-right-color"},borderBottomColor:{css:"border-bottom-color"},borderLeftColor:{css:"border-left-color"},placeholderColor:{css:"--lc-placeholder"},refreshControlColor:{css:"--lc-refresh"},tintColor:{css:"--lc-tint"},overlayColor:{css:"--lc-overlay"},rippleColor:{none:"a browser has no ripple: the press feedback of a page is `$pressed`"},backgroundImage:{to:(e,t)=>[["--lc-bg-img",on(e,t)]]},backgroundGradient:{to:e=>[["--lc-bg-grad",sn(e)]]},backgroundSize:{to:e=>e==="tile"?[["background-size","auto"],["background-repeat","repeat"]]:[["background-size",e==="fill"?"100% 100%":String(e)],["background-repeat","no-repeat"]]},borderRadius:{to:Pr,rank:q},borderTopLeftRadius:{css:"border-top-left-radius"},borderTopRightRadius:{css:"border-top-right-radius"},borderBottomRightRadius:{css:"border-bottom-right-radius"},borderBottomLeftRadius:{css:"border-bottom-left-radius"},opacity:{css:"opacity"},transform:{to:e=>[["transform",Ar(e)]]},transformOrigin:{css:"transform-origin",as:"lens"},pointerEvents:{to:e=>[["pointer-events",e==="none"?"none":"auto"]]},dim:{css:"--lc-dim"},fontSize:{css:"font-size"},fontWeight:{css:"font-weight",as:"raw"},fontStyle:{to:e=>[["font-style",e===2?"italic":e===0?"normal":String(e)]]},fontFamily:{to:e=>[["font-family",zr(e)]]},lineHeight:{to:e=>[["line-height",e==="normal"?"1.2":Q(e)]]},letterSpacing:{css:"letter-spacing"},textAlign:{css:"text-align"},textDecoration:{css:"text-decoration-line"},lineClamp:{rank:q,to:e=>Number(e)>0?[["display","-webkit-box"],["-webkit-box-orient","vertical"],["-webkit-line-clamp",String(Math.round(Number(e)))],["overflow-x","hidden"],["overflow-y","hidden"]]:[["-webkit-line-clamp","none"]]},textOverflow:{css:"text-overflow"},objectFit:{to:e=>[["object-fit",String(e)],["--lc-fit",e==="fill"?"100% 100%":String(e)]]},placeholder:{attr:!0},type:{attr:!0},enterKey:{attr:!0},autocapitalize:{attr:!0},autocorrect:{attr:!0},maxLength:{attr:!0},keyboardShrink:{attr:!0},keyboardDismiss:{attr:!0},showScrollbar:{to:e=>[["scrollbar-width",Vr(e)?"thin":"none"]]},overscrollMode:{to:e=>[["overscroll-behavior",Wr({default:"auto",none:"none",absorb:"contain"})(e)]]},keyboardDismissMode:{attr:!0},snap:{to:e=>e==="none"?[["scroll-snap-type","none"],["--lc-snap","none"]]:[["scroll-snap-type","both mandatory"],["--lc-snap",String(e)]]},sheetDetents:{attr:!0},sheetDetent:{attr:!0},sheetDismissible:{attr:!0},background:{to:Ir,rank:q},border:pe(Fe,q),borderTop:pe(["top"],X),borderRight:pe(["right"],X),borderBottom:pe(["bottom"],X),borderLeft:pe(["left"],X),flex:{to:Mr,rank:q}},je=e=>wr[e]??e,Gr=e=>e in we,cn=e=>{const t=we[e];return!!t&&"attr"in t},Hr={overflow:"overflow-x",pointerEvents:"pointer-events",fontFamily:"font-family",fontStyle:"font-style",lineHeight:"line-height",objectFit:"object-fit",transform:"transform",borderRadius:"border-top-left-radius",borderWidth:"border-top-width",borderColor:"border-top-color",backgroundImage:"--lc-bg-img",backgroundGradient:"--lc-bg-grad",backgroundSize:"background-size",showScrollbar:"scrollbar-width",overscrollMode:"overscroll-behavior",snap:"--lc-snap",lineClamp:"-webkit-line-clamp",borderTopWidth:"border-top-width",borderRightWidth:"border-right-width",borderBottomWidth:"border-bottom-width",borderLeftWidth:"border-left-width",borderHorizontalWidth:"border-left-width",borderVerticalWidth:"border-top-width",borderStartWidth:"border-inline-start-width",borderEndWidth:"border-inline-end-width"},jr=e=>{const t=we[e];return t&&"css"in t&&typeof t.css=="string"?t.css:Hr[e]??null},Kr={len:Q,lens:nn,num:e=>String(e),raw:e=>String(e),color:ve},Yr={color:"color",len:"len",enum:"raw",num:"num",str:"raw",layout:"raw"},Lt=e=>{const t=we[e];return t&&"rank"in t&&t.rank!==void 0?t.rank:he},Ke=(e,t,n)=>{const r=[...e].filter(([,s])=>s!=null);r.sort((s,o)=>Lt(s[0])-Lt(o[0]));const i=new Map;for(const[s,o]of r){const a=we[s];if(!a){n==null||n(s);continue}if("attr"in a||"none"in a)continue;if("to"in a){for(const[y,E]of a.to(o,t))i.set(y,E);continue}const d=Kr[a.as??Yr[De[s]??"layout"]],f=d(o);if(typeof a.css=="string")i.set(a.css,f);else for(const y of a.css)i.set(y,f)}return i},_t=e=>[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}:${n}`).join(";"),an=0,ln=1,be=2,ye=3,un=4,ce=65,Ie=1.70158,xe=Ie*1.525,xt=Ie+1,Rt=2*Math.PI/3,Ct=2*Math.PI/4.5,Re=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,nt=[["linear",e=>e],["inSine",e=>1-Math.cos(e*Math.PI/2)],["outSine",e=>Math.sin(e*Math.PI/2)],["inOutSine",e=>-(Math.cos(Math.PI*e)-1)/2],["inQuad",e=>e*e],["outQuad",e=>1-(1-e)*(1-e)],["inOutQuad",e=>e<.5?2*e*e:1-(-2*e+2)**2/2],["inCubic",e=>e*e*e],["outCubic",e=>1-(1-e)**3],["inOutCubic",e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2],["inQuart",e=>e**4],["outQuart",e=>1-(1-e)**4],["inOutQuart",e=>e<.5?8*e**4:1-(-2*e+2)**4/2],["inExpo",e=>e===0?0:2**(10*e-10)],["outExpo",e=>e===1?1:1-2**(-10*e)],["inOutExpo",e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2],["inCirc",e=>1-Math.sqrt(1-e*e)],["outCirc",e=>Math.sqrt(1-(e-1)**2)],["inOutCirc",e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2],["inBack",e=>xt*e*e*e-Ie*e*e],["outBack",e=>1+xt*(e-1)**3+Ie*(e-1)**2],["inOutBack",e=>e<.5?(2*e)**2*((xe+1)*2*e-xe)/2:((2*e-2)**2*((xe+1)*(e*2-2)+xe)+2)/2],["inElastic",e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Rt)],["outElastic",e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Rt)+1],["inOutElastic",e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Ct))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Ct)/2+1],["inBounce",e=>1-Re(1-e)],["outBounce",Re],["inOutBounce",e=>e<.5?(1-Re(1-2*e))/2:(1+Re(2*e-1))/2],["smoothstep",e=>e*e*(3-2*e)]],qr={in:"inQuad",out:"outQuad",inOut:"inOutQuad",easeIn:"inQuad",easeOut:"outQuad",easeInOut:"inOutQuad","ease-in":"inQuad","ease-out":"outQuad","ease-in-out":"inOutQuad"},Xr=e=>{const t=qr[e]??e;for(let n=0;n<nt.length;n++)if(nt[n][0]===t)return n;return-1},Jr=[.25,.1,.25,1],Ce={kind:an,p:[0,0,0,0]},Qr=e=>{const t=new Float32Array(ce);for(let n=0;n<ce;n++)t[n]=e(n/(ce-1));return t[0]=0,t[ce-1]=1,t},Zr=e=>{if(e===void 0)return Ce;if(typeof e=="function")return{kind:un,p:[0,0,0,0],table:Qr(e)};if(Array.isArray(e)){const[i,s,o,a]=e;return{kind:be,p:[i,s,o,a]}}const t=e.trim();if(t==="linear")return Ce;if(t==="ease")return{kind:be,p:Jr};if(t==="steps")return{kind:ye,p:[1,0,0,0]};let n=/^steps\(\s*(\d+)\s*(?:,\s*(start|end|jump-start|jump-end)\s*)?\)$/.exec(t);if(n)return{kind:ye,p:[Math.max(1,parseInt(n[1],10)),n[2]==="start"||n[2]==="jump-start"?1:0,0,0]};if(n=/^cubic-bezier\(\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*\)$/.exec(t),n)return{kind:be,p:[parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[4])]};const r=Xr(t);return r===0?Ce:r>0?{kind:ln,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Ce)},eo=(e,t,n,r,i)=>{const s=1-3*r+3*t,o=3*r-6*t,a=3*t,d=1-3*i+3*n,f=3*i-6*n,y=3*n;let E=e;for(let h=0;h<8;h++){const p=((s*E+o)*E+a)*E-e,l=(3*s*E+2*o)*E+a;if(Math.abs(p)<1e-6||Math.abs(l)<1e-6)break;E-=p/l}return E=Math.min(1,Math.max(0,E)),((d*E+f)*E+y)*E},to=(e,t)=>{if(t<=0)return e.kind===ye&&e.p[1]===1?1/e.p[0]:0;if(t>=1)return 1;switch(e.kind){case ln:return nt[e.p[0]][1](t);case be:return eo(t,e.p[0],e.p[1],e.p[2],e.p[3]);case ye:{const n=e.p[0];return e.p[1]===1?Math.min(1,Math.ceil(t*n)/n):Math.floor(t*n)/n}case un:{const n=e.table,r=t*(ce-1),i=Math.floor(r),s=n[i],o=n[Math.min(i+1,ce-1)];return s+(o-s)*(r-i)}default:return t}},$t=24,At=e=>String(Math.round(e*1e4)/1e4),no="cubic-bezier(0.3333, 0, 0.6667, 1)",ro=e=>{switch(e.kind){case an:return"linear";case be:return`cubic-bezier(${e.p.map(At).join(", ")})`;case ye:return`steps(${e.p[0]}, ${e.p[1]===1?"jump-start":"jump-end"})`}const t=[];for(let n=0;n<=$t;n++)t.push(At(to(e,n/$t)));return`linear(${t.join(", ")})`},oo=e=>e===void 0||e==="smoothstep"?no:ro(Zr(e)),fn=["lc-base","lc-bag","lc-own","lc-orient","lc-class","lc-hover","lc-press","lc-focus"],so=["--lc-bg-grad","--lc-bg-img","--lc-tint","--lc-overlay","--lc-refresh","--lc-fit","--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"],dn="lc-app",io=`
3
+ @layer ${fn.join(", ")};
4
+
5
+ @layer lc-base {
6
+ .lc-root {
7
+ position: relative;
8
+ overflow: hidden;
9
+ container-type: size;
10
+ container-name: ${dn};
11
+ color: var(--color, #fff);
12
+ font-family: var(--fontFamily, "Roboto"), system-ui, sans-serif;
13
+ font-size: 14px;
14
+ font-weight: 400;
15
+ line-height: 1.2;
16
+ text-align: start;
17
+ user-select: none;
18
+ -webkit-user-select: none;
19
+ -webkit-tap-highlight-color: transparent;
20
+ -webkit-text-size-adjust: 100%;
21
+ }
22
+
23
+ .lc {
24
+ display: flex;
25
+ flex-direction: column;
26
+ flex: 0 0 auto;
27
+ align-items: stretch;
28
+ align-content: flex-start;
29
+ position: relative;
30
+ box-sizing: border-box;
31
+ min-width: 0;
32
+ min-height: 0;
33
+ margin: 0;
34
+ padding: 0;
35
+ border: 0 solid transparent;
36
+ background-image: var(--lc-bg-grad, none), var(--lc-bg-img, none);
37
+ background-repeat: no-repeat;
38
+ background-position: center;
39
+ background-size: cover;
40
+ }
41
+
42
+ /* A destination fills the app. It lets a touch through to what is under it (a scene) except
43
+ where something of its own takes touches. */
44
+ .lc-screen {
45
+ position: absolute;
46
+ inset: 0;
47
+ overflow: hidden;
48
+ pointer-events: none;
49
+ /* (every screen sets it: a screen inside a screen does not take the outer one's) */
50
+ --lc-dim: 0;
51
+ }
52
+ .lc-screen::after {
53
+ content: "";
54
+ position: absolute;
55
+ inset: 0;
56
+ z-index: 2147483647;
57
+ background: #000;
58
+ opacity: var(--lc-dim, 0);
59
+ pointer-events: none;
60
+ }
61
+ /* A screen the router covered keeps its subtree, its layout and its state. */
62
+ .lc-covered { visibility: hidden !important; pointer-events: none !important; }
63
+
64
+ /* ---- a pager (../pager.ts): the tabs are the track's scroll, snapped */
65
+ .lc-pager { overflow: hidden; }
66
+ .lc-pager-track {
67
+ position: absolute;
68
+ inset: 0;
69
+ display: flex;
70
+ flex-direction: row;
71
+ overflow-x: auto;
72
+ overflow-y: hidden;
73
+ scroll-snap-type: x mandatory;
74
+ overscroll-behavior-x: contain;
75
+ scrollbar-width: none;
76
+ pointer-events: auto;
77
+ }
78
+ .lc-pager-track::-webkit-scrollbar { display: none; }
79
+ .lc-pager-track.lc-drilled { overflow-x: hidden; }
80
+ .lc-pager-cell {
81
+ position: relative;
82
+ flex: 0 0 100%;
83
+ overflow: hidden;
84
+ scroll-snap-align: start;
85
+ scroll-snap-stop: always;
86
+ }
87
+ .lc-pager-cell > .lc-above, .lc-root > .lc-above { z-index: 1; }
88
+
89
+ .lc-i, .lc-scrollable, .lc-vlist, input.lc, textarea.lc { pointer-events: auto; }
90
+
91
+ /* The core measures a text against the width its parent has: it wraps there even where
92
+ nothing shrinks it. */
93
+ .lc-text {
94
+ display: block;
95
+ max-width: 100%;
96
+ white-space: pre-wrap;
97
+ overflow-wrap: break-word;
98
+ }
99
+
100
+ button.lc {
101
+ appearance: none;
102
+ background-color: transparent;
103
+ color: inherit;
104
+ font: inherit;
105
+ letter-spacing: inherit;
106
+ text-align: inherit;
107
+ cursor: pointer;
108
+ }
109
+ button.lc:focus:not(:focus-visible) { outline: none; }
110
+
111
+ img.lc, canvas.lc {
112
+ display: block;
113
+ object-fit: cover;
114
+ -webkit-user-drag: none;
115
+ }
116
+ /* A drawing (a canvas of the app's): its size is the drawing's in the app's px, not its pixels'. */
117
+ .lc.lc-image-canvas {
118
+ width: var(--lc-iw, auto);
119
+ aspect-ratio: var(--lc-ir, auto);
120
+ }
121
+ /* An svg with a tint: its alpha is the mask, the tint the fill — the style's, else the one the
122
+ source came with. A div has no size of its own: the source's is given to it (--lc-iw /
123
+ --lc-ir), under any style of the app. */
124
+ .lc.lc-image-mask {
125
+ width: var(--lc-iw, auto);
126
+ aspect-ratio: var(--lc-ir, auto);
127
+ background-image: none;
128
+ background-color: var(--lc-tint, var(--lc-src-tint, currentColor));
129
+ -webkit-mask: var(--lc-src) center / var(--lc-fit, cover) no-repeat;
130
+ mask: var(--lc-src) center / var(--lc-fit, cover) no-repeat;
131
+ }
132
+ /* A part of an atlas (sourceRect): the atlas is the background, scaled so the part fills the box. */
133
+ .lc.lc-image-crop {
134
+ width: var(--lc-iw, auto);
135
+ height: var(--lc-ih, auto);
136
+ background-image: var(--lc-src);
137
+ background-size: var(--lc-crop-size, auto);
138
+ background-position: var(--lc-crop-pos, 0 0);
139
+ }
140
+
141
+ input.lc, textarea.lc {
142
+ display: block;
143
+ appearance: none;
144
+ background-color: transparent;
145
+ color: inherit;
146
+ font: inherit;
147
+ letter-spacing: inherit;
148
+ text-align: inherit;
149
+ outline: none;
150
+ resize: none;
151
+ user-select: text;
152
+ -webkit-user-select: text;
153
+ }
154
+ textarea.lc { field-sizing: content; }
155
+ input.lc::placeholder, textarea.lc::placeholder { color: var(--lc-placeholder, #aaa); opacity: 1; }
156
+
157
+ .lc-scrollable {
158
+ overflow-x: hidden;
159
+ overflow-y: auto;
160
+ scrollbar-width: thin;
161
+ --lc-snap: none;
162
+ }
163
+ .lc-scrollable > .lc { scroll-snap-align: var(--lc-snap, none); }
164
+
165
+ /* ---- a virtualized list (../vlist): the scroll is the browser's, where it stands is the
166
+ window's — the browser's own anchoring would compensate a second time */
167
+ .lc-vlist {
168
+ overflow-x: hidden;
169
+ overflow-y: auto;
170
+ scrollbar-width: thin;
171
+ overflow-anchor: none;
172
+ }
173
+ .lc-vlist-content {
174
+ display: flex;
175
+ flex-direction: column;
176
+ flex: 0 0 auto;
177
+ align-items: stretch;
178
+ box-sizing: border-box;
179
+ min-width: 0;
180
+ }
181
+
182
+ /* ---- the spinner of a pull to refresh (../refresh.ts) */
183
+ .lc-refresh {
184
+ position: absolute;
185
+ left: 50%;
186
+ top: -36px;
187
+ z-index: 5;
188
+ width: 28px;
189
+ height: 28px;
190
+ margin-left: -14px;
191
+ border-radius: 50%;
192
+ box-sizing: border-box;
193
+ border: 3px solid color-mix(in srgb, var(--lc-refresh-color, #8e8e93) 25%, transparent);
194
+ border-top-color: var(--lc-refresh-color, #8e8e93);
195
+ pointer-events: none;
196
+ will-change: translate, transform;
197
+ }
198
+ .lc-refresh.lc-settling { transition: translate 0.2s ease, transform 0.2s ease; }
199
+ .lc-refresh.lc-spinning { animation: lc-spin 0.8s linear infinite; }
200
+ @keyframes lc-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
201
+
202
+ /* ---- widgets (../widgets.ts) */
203
+ .lc-widget-frame {
204
+ position: absolute;
205
+ inset: 0;
206
+ z-index: 10;
207
+ display: flex;
208
+ justify-content: center;
209
+ align-items: center;
210
+ overflow: hidden;
211
+ pointer-events: none;
212
+ }
213
+ .lc-scrim { position: absolute; inset: 0; pointer-events: auto; }
214
+ /* A widget lets a touch through where nothing of it takes one (a HUD over a scene) — but
215
+ behind a scrim there is nothing a touch could be meant for: the widget's box takes it. */
216
+ .lc-widget { pointer-events: none; }
217
+ .lc-widget-frame.lc-scrimmed .lc-widget { pointer-events: auto; }
218
+ .lc-sheet { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
219
+ .lc-toasts {
220
+ position: absolute;
221
+ left: 0; right: 0;
222
+ bottom: calc(var(--safe-bottom, 0px) + 24px);
223
+ z-index: 20;
224
+ display: flex;
225
+ flex-direction: column;
226
+ align-items: center;
227
+ gap: 8px;
228
+ pointer-events: none;
229
+ }
230
+ .lc-toast {
231
+ max-width: 80%;
232
+ padding: 10px 16px;
233
+ border-radius: 20px;
234
+ background: rgba(40, 40, 44, 0.94);
235
+ color: #fff;
236
+ font-size: 14px;
237
+ line-height: 1.3;
238
+ text-align: center;
239
+ opacity: 0;
240
+ transform: translateY(8px);
241
+ transition: opacity 0.18s ease, transform 0.18s ease;
242
+ }
243
+ .lc-toast.lc-on { opacity: 1; transform: none; }
244
+ }
245
+ `,co=e=>{const t=e.defaultView??window;try{t.CSS.registerProperty({name:"--lc-dim",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}for(const d of so)try{t.CSS.registerProperty({name:d,syntax:"*",inherits:!1})}catch{}const n=e.createElement("style");n.setAttribute("data-lecodes-lite",""),n.textContent=io,e.head.appendChild(n);const r=n.sheet,i=(d,f)=>{const y=d.insertRule(f,d.cssRules.length);return d.cssRules[y]},s=(d,f)=>{const y=d.cssRules;for(let E=y.length-1;E>=0;E--)if(y[E]===f){d.deleteRule(E);return}},o=new Map,a=(d,f)=>{const y=f===void 0?d:`${d}.${f}`;let E=o.get(y);return E||(E=f===void 0?i(r,`@layer ${d} {}`):i(a(d),`@layer ${f} {}`),o.set(y,E)),E};for(const d of fn)d!=="lc-base"&&a(d);return{insert(d,f,y){const E=a(d,y),h=i(E,f);return{remove:()=>s(E,h)}},own(d){const f=a("lc-own"),y=i(f,`${d} {}`);return{set:(E,h)=>y.style.setProperty(E,h),unset:E=>{y.style.removeProperty(E)},remove:()=>s(f,y)}},destroy(){n.remove()}}},rt="lc-i";let ao=1;const Ye=new Map,pn=e=>{let t=Ye.get(e);return t||Ye.set(e,t=`lc-c${Ye.size+1}`),t},lo=(e,t)=>{const n=`{${t.text}}`,r=i=>`${i} .${e}, .${e}${i}`;switch(t.name){case"pressed":return{layer:"lc-press",text:`${r(`.${rt}:active`)} ${n}`};case"hovered":return{layer:"lc-hover",text:`@media (hover: hover) { ${r(`.${rt}:hover`)} ${n} }`};case"focused":return{layer:"lc-focus",text:`${r(".lc:focus-visible")} ${n}`};case"landscape":case"portrait":return{layer:"lc-orient",text:`@container ${dn} (orientation: ${t.name}) { .${e} ${n} }`};default:{const i=pn(t.name);return{layer:"lc-class",sub:i,text:`${r(`.${i}`)} ${n}`}}}},uo=e=>e.base+""+e.transition+e.blocks.map(t=>`${t.name}${t.text}`).join(""),fo=256,po=e=>{const t=new Map,n=new Set,r=()=>{let i=n.size>>1;for(const s of n){if(i--<=0)break;for(const o of s.rules)o.remove();n.delete(s),t.delete(s.key)}};return{acquire(i){const s=uo(i);let o=t.get(s);if(o)return o.refs===0&&n.delete(o),o.refs++,o;const a=`lc-s${ao++}`,d=[],f=i.transition?`${i.base?";":""}transition:${i.transition}`:"";d.push(e.insert("lc-bag",`.${a} {${i.base}${f}}`));for(const y of i.blocks){const E=lo(a,y);d.push(e.insert(E.layer,E.text,E.sub))}return t.set(s,o={name:a,key:s,refs:1,rules:d}),o},release(i){--i.refs>0||(n.add(i),n.size>fo&&r())},count:()=>({live:t.size-n.size,idle:n.size})}},mo=()=>({base:new Map,own:new Map,blocks:new Map,cls:null,rule:null,applied:new Map,dirty:!1}),Ot=new Set([...Tr,"easing"]),ho=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("_h"in e),go=(e,t,n,r)=>{const i=new Set;let s=!1;const o=new Set,a=b=>{o.has(b)||(o.add(b),r(`style: "${b}" is not a style property — ignored`))};let d=null,f=null;const y=b=>{b.style.dirty=!0,i.add(b),!s&&(s=!0,queueMicrotask(l))},E=b=>{const m=b.style,T=Ke(m.own,n,a);if(!(T.size===0&&!m.rule)){m.rule||(m.rule=e.own(`.lc-n${b.id}`),b.el.classList.add(`lc-n${b.id}`));for(const C of m.applied.keys())T.has(C)||m.rule.unset(C);for(const[C,R]of T)m.applied.get(C)!==R&&m.rule.set(C,R);m.applied=T}},h=(b,m)=>{const T=new Map;for(const[C,R]of b){if(!(R.duration>0))continue;const A=`${R.duration}ms ${oo(R.easing)} ${R.delay}ms`;for(const F of m.get(C).keys())F.startsWith("--")||T.set(F,`${F} ${A}`)}return[...T.values()].join(", ")},p=b=>{const m=b.style;m.dirty=!1;const T=_t(Ke(m.base,n,a)),C=new Map,R=[];for(const[F,P]of m.blocks){const v=Ke(P.props,n,a);C.set(F,v),v.size>0&&R.push({name:F,text:_t(v)})}const A=m.cls;T===""&&R.length===0?m.cls=null:m.cls=t.acquire({base:T,blocks:R,transition:h(m.blocks,C)}),A!==m.cls&&(A&&b.el.classList.remove(A.name),m.cls&&b.el.classList.add(m.cls.name)),A&&t.release(A),d==null||d(b)};function l(){if(s=!1,i.size===0)return;const b=[...i];i.clear();for(const m of b)m.style.dirty&&p(m)}const g=(b,m,T)=>{if(T==null){b.blocks.delete(m);return}if(!ho(T))return;let C=b.blocks.get(m);C||b.blocks.set(m,C={props:new Map,duration:0,delay:0,easing:void 0});for(const R of Object.keys(T)){const A=T[R];if(R==="duration"){C.duration=Number(A)||0;continue}if(R==="delay"){C.delay=Number(A)||0;continue}if(R==="easing"){C.easing=A;continue}if(Ot.has(R)||R[0]==="$")continue;const F=je(R);C.props.delete(F),A!=null&&C.props.set(F,A)}};return{flush:l,set onChange(b){d=b},set onWrite(b){f=b},merge(b,m){const T=b.style;let C=!1;for(const R of Object.keys(m)){const A=m[R];if(R[0]==="$"){g(T,R.slice(1),A);continue}if(Ot.has(R))continue;const F=je(R);T.base.delete(F),A!=null&&T.base.set(F,A),T.own.delete(F)&&(C=!0),f==null||f(b,F)}C&&E(b),y(b)},set(b,m,T){const C=b.style;if(m[0]==="$"){g(C,m.slice(1),T),y(b);return}const R=je(m);if(!Gr(R)){a(R);return}f==null||f(b,R),T==null?(C.own.delete(R),C.base.delete(R)&&y(b)):C.own.set(R,T),E(b),(cn(R)||R==="tintColor")&&(d==null||d(b))},setClass(b,m,T){b.el.classList.toggle(pn(m),T)},value(b,m){const T=b.style;return T.own.has(m)?T.own.get(m):T.base.get(m)},owns(b,m){return b.style.own.has(m)||b.style.base.has(m)},names(b,m){const T=b.style;if(T.own.has(m)||T.base.has(m))return!0;for(const C of T.blocks.values())if(C.props.has(m))return!0;return!1},drop(b){const m=b.style;i.delete(b),m.cls&&(t.release(m.cls),m.cls=null),m.rule&&(m.rule.remove(),m.rule=null)}}},bo={button:"button",input:"input",textarea:"textarea",image:"img"},yo=(e,t)=>{const n=e.createElement(bo[t]??"div");if(n.className=`lc lc-${t}`,t==="button"&&(n.type="button"),t==="image"){const r=n;r.alt="",r.decoding="async",r.draggable=!1}return n},Eo=(e,t,n)=>({id:t,type:n,el:yo(e,n),parent:null,flags:0,held:!0,rooted:!1,token:{},style:mo(),strings:new Map}),mn=Symbol("lecodes.node"),ae=e=>e==null?void 0:e[mn],hn=e=>{e.el[mn]=e,e.el.setAttribute("data-node",String(e.id))},Ne=e=>{const t=[];for(let n=e.el.firstElementChild;n;n=n.nextElementSibling){const r=ae(n);r&&r.parent===e&&t.push(r)}return t},qe=(e,t=",")=>{const n=[];let r=0,i="";for(const s of e){if(s==="("&&r++,s===")"&&r--,s===t&&r===0){n.push(i.trim()),i="";continue}i+=s}return i.trim()!==""&&n.push(i.trim()),n},Ut={"to top":0,"to right":90,"to bottom":180,"to left":270,"to top right":45,"to right top":45,"to bottom right":135,"to right bottom":135,"to bottom left":225,"to left bottom":225,"to top left":315,"to left top":315},vo=e=>{if(e in Ut)return Ut[e];const t=/^(-?[\d.]+)(deg|rad|turn|grad)$/.exec(e);if(!t)return null;const n=parseFloat(t[1]);return t[2]==="deg"?n:t[2]==="rad"?n*180/Math.PI:t[2]==="turn"?n*360:n*.9},wo=(e,t)=>{const n=[];for(const r of qe(e.trim())){const i=/^(?:repeating-)?(linear|radial)-gradient\((.*)\)$/s.exec(r);if(!i)return null;const s=i[1],o=qe(i[2]);let a=s==="linear"?180:0;if(o.length>0){const f=o[0],y=s==="linear"?vo(f):null;y!==null?(a=y,o.shift()):s==="radial"&&/\b(circle|ellipse|at|closest|farthest)\b/.test(f)&&o.shift()}const d=[];for(const f of o){const y=qe(f," "),E=y[y.length-1],h=y.length>1&&/^-?[\d.]+%$/.test(E),p=h?y.slice(0,-1).join(" "):f;d.push({color:t(p)??"#00000000",position:h?parseFloat(E)/100:null})}if(d.length===0)return null;d[0].position===null&&(d[0].position=0),d[d.length-1].position===null&&(d[d.length-1].position=1);for(let f=1;f<d.length-1;f++){if(d[f].position!==null)continue;let y=f;for(;d[y].position===null;)y++;const E=d[f-1].position,h=d[y].position;for(let p=f;p<y;p++)d[p].position=E+(h-E)*(p-f+1)/(y-f+1);f=y}n.push({type:s,angle:a,stops:d.map(f=>({color:f.color,position:f.position}))})}return n.length>0?n:null},So=Object.keys(De).filter(e=>De[e]!=="layout"),te=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),Ft=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const r=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return`#${te(+t[1])}${te(+t[2])}${te(+t[3])}${te(r*255)}`}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?`#${te(+n[1]*255)}${te(+n[2]*255)}${te(+n[3]*255)}${te((n[4]===void 0?1:+n[4])*255)}`:null},ko=e=>{if(e==="none")return[1,0,0,0,1,0,0,0,1];const t=/^matrix\(([^)]+)\)$/.exec(e);if(!t)return null;const[n,r,i,s,o,a]=t[1].split(",").map(d=>parseFloat(d));return[n,r,0,i,s,0,o,a,1]},Nt={pointerEvents:{auto:"all"},overflow:{auto:"scroll"},display:{"-webkit-box":"flex",block:"flex"},showScrollbar:{none:"0",thin:"1",auto:"1"},overscrollMode:{auto:"default",contain:"absorb"},textAlign:{"-webkit-auto":"start"}},To=e=>{const t=e.root.ownerDocument,n=t.defaultView??window;let r=null;const i=f=>{r||(r=t.createElement("span"),r.style.cssText="position:absolute;visibility:hidden;pointer-events:none"),r.isConnected||e.root.appendChild(r),r.style.color="",r.style.color=f;const y=r.style.color===""?null:Ft(n.getComputedStyle(r).color);return r.remove(),y},s=(f,y,E,h)=>{var g,b;if(cn(y)){const m=e.value(f,y);return m==null?null:E==="num"?Number(m===!0?1:m===!1?0:m):String(m)}const p=jr(y);if(p===null)return null;const l=h.getPropertyValue(p).trim();if(l===""&&!f.el.isConnected)return o(f,y,E);if(l==="")return null;switch(E){case"color":return p.startsWith("--")?i(l):Ft(l);case"len":{const m=parseFloat(l);return Number.isFinite(m)?m:y==="lineHeight"?parseFloat(h.fontSize)*1.2:null}case"num":{if(y==="lineClamp")return l==="none"?0:parseFloat(l)||0;const m=parseFloat(((g=Nt[y])==null?void 0:g[l])??l);return Number.isFinite(m)?m:null}case"enum":return((b=Nt[y])==null?void 0:b[l])??l;default:return y==="backgroundGradient"?l==="none"?null:wo(l,i):y==="transform"?ko(l):y==="transformOrigin"?null:y==="fontFamily"?l.split(",")[0].trim().replace(/^["']|["']$/g,""):y==="backgroundImage"&&l==="none"?"":l}},o=(f,y,E)=>{const h=e.value(f,y)??kr[y];if(h==null)return null;if(y==="transform")return h==="identity"||h==="none"?[1,0,0,0,1,0,0,0,1]:null;if(E==="color")return typeof h=="number"?`#${(h>>>0).toString(16).padStart(8,"0")}`:i(String(h));if(E==="len"||E==="num"){const p=typeof h=="number"?h:parseFloat(String(h));return Number.isFinite(p)?p:null}return String(h)},a=f=>{const y=n.getComputedStyle(f.el),E=[],h=[],p={};for(const l of So){const g=e.owns(f,l);g&&E.push(l);const b=s(f,l,De[l],y);if(Sr.includes(l)&&!g&&(b===null||b==="none")){p[l]=null;continue}h.push(l),p[l]=b}return{present:h,dirty:[],own:E,...p}},d=f=>{const y=f.el,E={id:f.id,type:f.type},h=f.strings.get("name");h&&(E.name=h);const p=f.strings.get("text");return f.type==="text"&&p&&(E.text=p),(f.type==="input"||f.type==="textarea")&&(E.value=y.value),E.flags=f.flags,E.layout=[y.offsetLeft,y.offsetTop,y.offsetWidth,y.offsetHeight],E.paint=a(f),e.extend(f,E,d),E.children=e.held(f)?[]:Ne(f).map(d),E};return{dump(){return e.flush(),JSON.stringify({roots:e.roots().map(f=>({kind:f.kind,node:d(f.node)}))})},paint(f){return f?(e.flush(),JSON.stringify(a(f))):"null"}}},Mt=10,Lo=500,_o=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,i=r.defaultView??window,s=_=>{const k=t.getBoundingClientRect(),N=en(t)||1;return[(_.clientX-k.left)/N,(_.clientY-k.top)/N]},o=(_,k)=>{for(let N=_ instanceof Element?_:null;N&&N!==t;N=N.parentElement){if(e.boundary(N))return null;const x=ae(N);if(x&&(x.flags&k)!==0)return x}return null},a=new Map;let d=!1,f=null;const y=(_,k)=>{const N=typeof k=="number"?k:0;(N&wt)!==0&&(_.tracked=!0,_.wantsMove=(N&St)!==0,_.claim=N&hr)},E=_=>{i.clearTimeout(_.timer),a.delete(_.pointerId)},h=_=>{if(_.pointerType==="mouse"&&_.button!==0)return;const k=o(_.target,Oe),[N,x]=s(_);f=[N,x],d=!1;const $={pointerId:_.pointerId,node:k,startX:N,startY:x,moved:!1,tracked:!1,wantsMove:!1,claim:0,handled:!1,timer:0};a.set(_.pointerId,$),k&&(y($,n(k.id,In,_.pointerId,N,x)),(k.flags&sr)!==0&&($.timer=i.setTimeout(()=>{if(a.get($.pointerId)!==$||$.moved)return;const I=n(k.id,Bn,$.pointerId,$.startX,$.startY),B=typeof I=="number"?I:0;(B&gr)!==0&&($.handled=!0),y($,B)},Lo)))},p=_=>{const k=a.get(_.pointerId);if(k){const[N,x]=s(_);!k.moved&&Math.hypot(N-k.startX,x-k.startY)>Mt&&(k.moved=!0,i.clearTimeout(k.timer)),k.tracked&&k.wantsMove&&n(0,zn,_.pointerId,N,x,N-k.startX,x-k.startY)}_.pointerType==="mouse"&&P(_)},l=_=>{const k=a.get(_.pointerId);if(!k)return;const[N,x]=s(_);k.tracked&&n(0,Vn,_.pointerId,N,x,N-k.startX,x-k.startY),(k.moved||k.handled)&&(d=!0),E(k)},g=_=>{const k=a.get(_.pointerId);k&&(k.tracked&&n(0,mt,_.pointerId),d=!0,E(k))},b=_=>{if(_.cancelable){for(const k of a.values())if(k.tracked&&k.claim!==0){_.preventDefault();return}}},m=_=>{if(d){d=!1;return}const k=o(_.target,Oe);if(!k||(k.flags&or)===0)return;let N,x;if(_.detail===0&&_.clientX===0&&_.clientY===0){const $=k.el.getBoundingClientRect();[N,x]=s({clientX:$.left+$.width/2,clientY:$.top+$.height/2})}else if([N,x]=s(_),f&&Math.hypot(N-f[0],x-f[1])>Mt)return;n(k.id,Pn,_.pointerId??0,N,x)};let T=null,C=!1,R=!1,A=[0,0];const F=(_,k)=>{T&&C&&(_===Et?n(0,_):n(0,_,k[0],k[1],k[0]-A[0],k[1]-A[1])),T=null,C=!1,R=!1};function P(_){const k=s(_),N=t.contains(_.target)?o(_.target,Oe):null;if(N!==T){if(F(yt,k),T=N,N&&(N.flags&mr)!==0){A=k;const x=n(N.id,nr,k[0],k[1]),$=typeof x=="number"?x:0;C=($&wt)!==0,R=($&St)!==0}return}T&&C&&R&&n(0,rr,k[0],k[1],k[0]-A[0],k[1]-A[1])}const v=_=>{_.pointerType==="mouse"&&F(yt,s(_))},S=_=>{const k=ae(_ instanceof Element?_:null);return k&&(k.type==="input"||k.type==="textarea")?k:null},O=_=>{const k=S(_.target);k&&(k.flags&ar)!==0&&n(k.id,jn,k.el.value)},D=_=>{const k=S(_.target);k&&(k.flags&lr)!==0&&n(k.id,Kn)},U=_=>{const k=S(_.target);k&&(k.flags&ur)!==0&&n(k.id,Yn)},M=_=>{if(_.key!=="Enter"||_.isComposing)return;const k=S(_.target);if(!k||k.type!=="input")return;_.preventDefault();const N=k.el;(k.flags&fr)!==0&&n(k.id,qn,N.value),e.value(k,"enterKey")!=="next"&&r.activeElement===N&&N.blur()},z=_=>{const k=i.getComputedStyle(_);return k.overflowX!=="hidden"&&k.overflowY==="hidden"},W=_=>{const k=ae(_.target instanceof Element?_.target:null);!k||(k.flags&ir)===0||n(k.id,Wn,z(k.el)?k.el.scrollLeft:k.el.scrollTop)},H=_=>{const k=ae(_.target instanceof Element?_.target:null);k&&(k.flags&cr)!==0&&n(k.id,Gn)};return t.addEventListener("pointerdown",h),t.addEventListener("click",m),t.addEventListener("pointerleave",v),t.addEventListener("touchmove",b,{passive:!1}),t.addEventListener("input",O),t.addEventListener("focusin",D),t.addEventListener("focusout",U),t.addEventListener("keydown",M),t.addEventListener("scroll",W,!0),t.addEventListener("scrollend",H,!0),r.addEventListener("pointermove",p),r.addEventListener("pointerup",l),r.addEventListener("pointercancel",g),{isPressed(_){for(const k of a.values())if(k.node===_)return!0;return!1},isHovered:_=>T===_,forget(_){for(const k of[...a.values()])k.node===_&&(k.tracked&&n(0,mt,k.pointerId),E(k));T===_&&F(Et,[0,0])},destroy(){for(const _ of a.values())i.clearTimeout(_.timer);a.clear(),t.removeEventListener("pointerdown",h),t.removeEventListener("click",m),t.removeEventListener("pointerleave",v),t.removeEventListener("touchmove",b),t.removeEventListener("input",O),t.removeEventListener("focusin",D),t.removeEventListener("focusout",U),t.removeEventListener("keydown",M),t.removeEventListener("scroll",W,!0),t.removeEventListener("scrollend",H,!0),r.removeEventListener("pointermove",p),r.removeEventListener("pointerup",l),r.removeEventListener("pointercancel",g)}}};function xo(e){let t=e.trim();/\sxmlns\s*=/.test(t)||(t=t.replace(/<svg\b/,'<svg xmlns="http://www.w3.org/2000/svg"'));const n=new TextEncoder().encode(t);let r="";for(const i of n)r+=String.fromCharCode(i);return`data:image/svg+xml;base64,${btoa(r)}`}function Ro(e){const t=e.match(/viewBox\s*=\s*["']([^"']+)["']/);return t?t[1]:null}const Co=e=>`url("${e.replace(/["\\\n]/g,t=>"\\"+t)}")`,$o=e=>{const t=p=>p.image??(p.image={src:"",srcTint:null,rect:null,form:"img",probe:0}),n=p=>p.src.startsWith("svg:")?p.src.slice(4):null,r=new Map,i=(p,l)=>{const g=r.get(l);g!=null&&g.delete(p)&&g.size===0&&r.delete(l)},s=p=>{const l=p.src,g=n(p);return g!==null?xo(g):l.startsWith("id:")?e.bufferUrl(Number(l.slice(3))):l.startsWith("canvas:")||l.startsWith("scene2d:")?"":l},o=(p,l)=>l.src.startsWith("canvas:")?"canvas":l.rect?"crop":n(l)!==null&&(l.srcTint!==null||e.hasTint(p))?"mask":"img",a=(p,l)=>{const g=p.el;if(g.tagName.toLowerCase()===l)return;const b=e.doc.createElement(l);if(b.className=g.className,l==="img"){const T=b;T.alt="",T.decoding="async",T.draggable=!1}const m=g.getAttribute("data-name");m!==null&&b.setAttribute("data-name",m),p.el=b,hn(p),g.replaceWith(b),e.swapped(p,g)},d=p=>{for(const l of["--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"])p.style.removeProperty(l)},f=(p,l,g)=>{const[b,m,T,C]=l,[R,A]=g;p.style.setProperty("--lc-crop-size",`${R/T*100}% ${A/C*100}%`),p.style.setProperty("--lc-crop-pos",`${R===T?0:b/(R-T)*100}% ${A===C?0:m/(A-C)*100}%`)},y=new WeakMap,E=(p,l)=>{const g=p.el,b=e.drawable(l);if(!b){g.width=0,g.height=0;return}g.width!==b.pixelWidth&&(g.width=b.pixelWidth),g.height!==b.pixelHeight&&(g.height=b.pixelHeight);const m=g.getContext("2d");m&&(m.clearRect(0,0,g.width,g.height),g.width>0&&g.height>0&&m.drawImage(b.image,0,0),g.style.setProperty("--lc-iw",`${b.width}px`),b.height>0&&g.style.setProperty("--lc-ir",`${b.width} / ${b.height}`))},h=p=>{var F;const l=t(p),g=o(p,l);l.form=g,a(p,g==="img"?"img":g==="canvas"?"canvas":"div");const b=p.el;if(b.classList.toggle("lc-image-mask",g==="mask"),b.classList.toggle("lc-image-crop",g==="crop"),b.classList.toggle("lc-image-canvas",g==="canvas"),d(b),g==="canvas"){E(p,l.src);return}const m=s(l);if(g==="img"){const P=b;m===""?P.removeAttribute("src"):P.getAttribute("src")!==m&&(P.src=m);return}if(b.style.setProperty("--lc-src",m===""?"none":Co(m)),g==="mask"){l.srcTint!==null&&b.style.setProperty("--lc-src-tint",ve(l.srcTint));const P=(F=Ro(n(l)??""))==null?void 0:F.trim().split(/[\s,]+/).map(Number),v=P==null?void 0:P[2],S=P==null?void 0:P[3];v&&S&&(b.style.setProperty("--lc-iw",`${v}px`),b.style.setProperty("--lc-ir",`${v} / ${S}`));return}const T=l.rect;b.style.setProperty("--lc-iw",`${T[2]}px`),b.style.setProperty("--lc-ih",`${T[3]}px`);const C=y.get(p);if(C&&C.url===m){f(b,T,C.size);return}if(m==="")return;const R=++l.probe,A=new Image;A.addEventListener("load",()=>{if(l.probe!==R||!l.rect)return;const P=[A.naturalWidth,A.naturalHeight];y.set(p,{url:m,size:P}),f(p.el,l.rect,P)},{once:!0}),A.src=m};return{setSrc(p,l){const g=t(p);if(g.src.startsWith("canvas:")&&i(p,g.src),g.src=l??"",g.srcTint=null,g.src.startsWith("canvas:")){let b=r.get(g.src);b||r.set(g.src,b=new Set),b.add(p)}h(p)},setSrcTint(p,l){t(p).srcTint=l,h(p)},setSourceRect(p,l){const g=t(p),b=l==null?void 0:l.trim().split(/\s+/).map(Number),m=b&&b.length===4&&b.every(R=>Number.isFinite(R))&&b[2]>0&&b[3]>0?b:null,T=!!g.rect&&!!m&&g.form==="crop"&&g.rect[2]===m[2]&&g.rect[3]===m[3];g.rect=m;const C=y.get(p);if(T&&C){f(p.el,m,C.size);return}h(p)},sourceChanged(p){var l;for(const g of r.get(p)??[])((l=g.image)==null?void 0:l.form)==="canvas"&&E(g,p)},forget(p){var l;(l=p.image)!=null&&l.src.startsWith("canvas:")&&i(p,p.image.src)},restyle(p){const l=p.image;l&&o(p,l)!==l.form&&h(p)}}},Ao=.5,Oo=64,Dt=48,Uo=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,i=r.defaultView??window,s=new Map;let o=null;const a=l=>{let g=s.get(l);if(!g||!g.isConnected){g=r.createElement("div"),g.className="lc-refresh",g.style.setProperty("--lc-refresh-color",i.getComputedStyle(l.el).getPropertyValue("--lc-refresh").trim()||"#8e8e93");const b=l.el.parentElement;b&&(b.appendChild(g),g.style.top=`${l.el.offsetTop-36}px`,g.style.left=`${l.el.offsetLeft+l.el.offsetWidth/2}px`),s.set(l,g)}return g},d=(l,g,b)=>{const m=a(l);m.classList.toggle("lc-settling",b),m.style.translate=`0 ${g}px`,m.style.transform=`rotate(${g*3}deg)`,m.style.opacity=String(Math.min(1,g/Dt))},f=l=>{const g=s.get(l);g&&(g.classList.remove("lc-spinning"),d(l,0,!0),i.setTimeout(()=>{s.get(l)===g&&(g.remove(),s.delete(l))},220))},y=l=>{for(let g=l instanceof Element?l:null;g&&g!==t;g=g.parentElement){const b=ae(g);if(b&&(b.flags&(He|Ge))!==0)return b}return null},E=l=>{if(o||l.touches.length!==1)return;const g=y(l.target);if(!g)return;const b=l.changedTouches[0];o={node:g,touch:b.identifier,startY:b.clientY,pulling:!1,distance:0}},h=l=>{if(!o)return;const g=[...l.changedTouches].find(m=>m.identifier===o.touch);if(!g)return;const b=g.clientY-o.startY;if(!o.pulling){if(o.node.el.scrollTop>0||b<=0){(b<0||o.node.el.scrollTop>0)&&(o.startY=g.clientY);return}o.pulling=!0}l.cancelable&&l.preventDefault(),o.distance=Math.max(0,b*Ao),(o.node.flags&Ge)!==0&&n(o.node.id,ht,o.distance),(o.node.flags&He)!==0&&d(o.node,o.distance,!1)},p=l=>{if(!o||![...l.changedTouches].some(C=>C.identifier===o.touch))return;const{node:g,pulling:b,distance:m}=o;if(o=null,!b||((g.flags&Ge)!==0&&n(g.id,ht,0),(g.flags&He)===0))return;if(m<Oo||l.type==="touchcancel"){f(g);return}d(g,Dt,!0),a(g).classList.add("lc-spinning");const T=n(g.id,Hn);Promise.resolve(T).then(()=>f(g),()=>f(g))};return t.addEventListener("touchstart",E,{passive:!0}),t.addEventListener("touchmove",h,{passive:!1}),t.addEventListener("touchend",p),t.addEventListener("touchcancel",p),{forget(l){var g;(o==null?void 0:o.node)===l&&(o=null),(g=s.get(l))==null||g.remove(),s.delete(l)},destroy(){t.removeEventListener("touchstart",E),t.removeEventListener("touchmove",h),t.removeEventListener("touchend",p),t.removeEventListener("touchcancel",p);for(const l of s.values())l.remove();s.clear(),o=null}}},It=".lc-scrollable, .lc-vlist, .lc-pager-track, textarea.lc, input.lc",Pe=new WeakMap,ut=e=>{if(!e.isConnected)return;const t=[],n=r=>{(r.scrollLeft!==0||r.scrollTop!==0)&&t.push({el:r,left:r.scrollLeft,top:r.scrollTop})};e.matches(It)&&n(e);for(const r of e.querySelectorAll(It))n(r);t.length>0?Pe.set(e,t):Pe.delete(e)},gn=e=>{const t=Pe.get(e);if(t){Pe.delete(e);for(const{el:n,left:r,top:i}of t)!n.isConnected||!e.contains(n)||(n.scrollLeft=r,n.scrollTop=i)}},ot=e=>{ut(e),e.remove()},bn=(e,t,n=null)=>{t.parentElement===e&&(n===null||t.nextElementSibling===n)||(t.isConnected&&ut(t),e.insertBefore(t,n),gn(t))},me=0,ie=-1,yn={run:(e,t,n,r)=>r(),settle:()=>{},enterOnTop:()=>!0,holds:()=>!1},Fo={[br]:"a 3D scene",[yr]:"a 2D scene",[Er]:"a native view",[Me]:"a video"},No=e=>{const t=e.transitions??yn;let n=null,r=[],i=[];const s=new Map,o=(v,S)=>`${v}:${S}`,a=new Set,d=v=>r.includes(v),f=v=>r.some(S=>S.node===v),y=v=>v&&v.kind===j?v.node:null,E=(v,S)=>{e.emit(v.kind===j||v.kind===Me?v.id:0,S,v.kind,v.id)},h=(v,S,O,D)=>{let U=null;return(v===j||v===Me)&&(U=e.node(S)??null,!U||v===j&&U.type!=="screen")?(e.warn(`navigation: ${S} is not a live ${v===j?"screen":"video"} node`),null):{kind:v,id:S,node:U,viewName:O,paramsJson:D||"{}",back:me,retired:!1}},p=(v,S)=>{const O=y(v);if(!O){a.has(v.kind)||(a.add(v.kind),e.warn(`${Fo[v.kind]??"this destination"} as a destination is not built yet (docs/plans/web-lite-plan.md) — nothing is shown for it`));return}e.rootOwned(O,!0),O.el.classList.remove("lc-covered"),O.el.classList.toggle("lc-above",S),bn(e.root,O.el)},l=v=>{const S=y(v);!S||v===n||n&&n.node===S||(S.el.classList.remove("lc-above"),f(S)?S.el.classList.add("lc-covered"):ot(S.el))},g=v=>{const S=y(v);S&&(n&&n.node===S||f(S)||(S.el.classList.remove("lc-above"),ot(S.el),e.rootOwned(S,!1),e.emit(S.id,tr)))},b=()=>{const v=i;i=[];for(const S of v)S.node&&t.holds(S.node)?i.push(S):g(S)},m=v=>{!v||v.retired||(v.retired=!0,i.push(v),e.post(b))},T=(v,S,O)=>{const D=O===ie?me:O,U=y(v),M=y(S);U&&M&&M.el.classList.toggle("lc-above",!U.el.classList.contains("lc-above")),t.run(U,M,D,()=>{U==null||U.el.classList.remove("lc-above"),M==null||M.el.classList.remove("lc-above"),S&&l(S),i.length>0&&e.post(b)})},C=v=>{var S;v.kind===j&&v.node&&((S=e.active)==null||S.call(e,v.node,!1)),E(v,Qn)},R=(v,S)=>{var U,M;const O=n;if(!v||O===v)return;t.settle(),O&&C(O),n=v;const D=!!y(v)&&!!y(O);p(v,!!y(v)&&(!D||t.enterOnTop(S))),E(v,Jn),v.kind===j&&v.node&&((U=e.active)==null||U.call(e,v.node,!0)),O&&!d(O)&&m(O),T(v,O,S),(M=e.changed)==null||M.call(e)},A=v=>{var O;t.settle();const S=n;S&&(C(S),n=null,d(S)||m(S),T(null,S,v),(O=e.changed)==null||O.call(e))},F=(v,S)=>{R(v,S),e.emit(0,er,v.kind,v.id)},P=v=>{const S=r.length;return v===-1?S-2:v<-1?Math.max(S-1+v,0):v===0?0:Math.min(v,S-1)};return{current:()=>n,stack:()=>r,setUrl(v,S,O){var U;O===null||O===""?s.delete(o(v,S)):s.set(o(v,S),O.startsWith("/")?O:`/${O}`),(n&&n.kind===v&&n.id===S||r.some(M=>M.kind===v&&M.id===S))&&((U=e.changed)==null||U.call(e))},address(){if(n){const S=s.get(o(n.kind,n.id));if(S!==void 0)return S}const v=n?r.lastIndexOf(n):r.length-1;for(let S=v<0?r.length-1:v;S>=0;S--){const O=s.get(o(r[S].kind,r[S].id));if(O!==void 0)return O}return null},forgetUrl(v,S){s.delete(o(v,S))},open(v,S,O,D,U){R(h(v,S,O,D),U)},close(v,S,O){!n||n.kind!==v||n.id!==S||A(O)},routerOpen(v,S,O,D){const U=h(v,S,O,D);if(!U)return;const M=r;r=[U];for(const z of M)z!==n&&m(z);R(U,me)},routerPush(v,S,O,D,U,M){const z=h(v,S,O,D);z&&(z.back=M===ie?me:M,r.push(z),F(z,U))},routerReplace(v,S,O,D,U,M){const z=h(v,S,O,D);if(!z)return;const W=r[r.length-1];if(!W){z.back=M===ie?me:M,r.push(z),F(z,U);return}z.back=M===ie?W.back:M,r[r.length-1]=z,F(z,U),m(W)},routerPop(v,S){if(r.length<=1)return!1;const O=P(v);if(O<0||O>=r.length)return!1;const D=S===ie?r[r.length-1].back:S,U=r.splice(O+1);F(r[r.length-1],D);for(const M of U)m(M);return U.length>0},routerHide(v){A(v)},routerRestore(v){const S=r[r.length-1];S&&R(S,v)},reset(){var v;t.settle();for(const S of[n,...r,...i])(v=S==null?void 0:S.node)==null||v.el.remove();n=null,r=[],i=[],s.clear()}}},Mo=250,Do="cubic-bezier(0.2, 0.8, 0.2, 1)",Io=6,Po=e=>{const{root:t}=e,n=t.ownerDocument,r=n.defaultView??window,i=new Map,s=h=>{var l;const p=e.value(h.node,"overlayColor");if(p==null){(l=h.scrim)==null||l.remove(),h.scrim=null,h.frame.classList.remove("lc-scrimmed");return}h.scrim||(h.scrim=n.createElement("div"),h.scrim.className="lc-scrim",h.scrim.addEventListener("click",()=>{(h.node.flags&dr)!==0&&e.emit(h.node.id,Xn)}),h.frame.insertBefore(h.scrim,h.frame.firstChild),h.frame.classList.add("lc-scrimmed")),h.scrim.style.backgroundColor=ve(p)},o=h=>{const p=e.value(h,"sheetDetents");if(p==null||p==="")return null;const l=String(p).split(",").map(Number).filter(g=>Number.isFinite(g)&&g>0).sort((g,b)=>g-b);return l.length>0?l:null},a=(h,p)=>{const l=h.sheet,g=h.node.el.offsetHeight;if(p<0)return g;const b=l.detents[l.detents.length-1],m=l.detents[Math.max(0,Math.min(p,l.detents.length-1))];return g*(1-m/b)},d=(h,p,l)=>{const g=h.sheet.holder;g.style.transition=l?`transform ${Mo}ms ${Do}`:"none",g.style.transform=`translateY(${Math.max(0,p)}px)`},f=(h,p)=>{const l=o(h.node);if(!l||!h.sheet)return;const g=h.sheet;g.detents=l;const b=e.value(h.node,"sheetDismissible");g.dismissible=b==null||Number(b)>.5||b===!0;const m=Number(e.value(h.node,"sheetDetent")??0);if(p){d(h,a(h,-1),!1),g.holder.offsetHeight,g.detent=m,d(h,a(h,m),!0);return}m!==g.detent&&(g.detent=m,d(h,a(h,m),!0))},y=h=>{const p=h.node.el;p.addEventListener("pointerdown",l=>{const g=h.sheet;if(!g||l.pointerType==="mouse"&&l.button!==0)return;for(let A=l.target instanceof Element?l.target:null;A&&A!==p;A=A.parentElement)if(A.scrollTop>0)return;const b=a(h,g.detent);let m=!1,T=b;const C=A=>{if(A.pointerId!==l.pointerId)return;const F=A.clientY-l.clientY;if(!m){if(Math.abs(F)<Io||Math.abs(F)<Math.abs(A.clientX-l.clientX))return;m=!0}T=Math.max(0,b+F),d(h,T,!1)},R=A=>{if(A.pointerId!==l.pointerId||(n.removeEventListener("pointermove",C),n.removeEventListener("pointerup",R),n.removeEventListener("pointercancel",R),!m||!h.sheet))return;let F=0,P=1/0;for(let D=0;D<g.detents.length;D++){const U=Math.abs(a(h,D)-T);U<P&&(P=U,F=D)}const v=a(h,0),S=p.offsetHeight;if(g.dismissible&&T>v+(S-v)/2){d(h,S,!0),(h.node.flags&vt)!==0&&e.emit(h.node.id,gt,-1);return}g.detent=F,d(h,a(h,F),!0),(h.node.flags&vt)!==0&&e.emit(h.node.id,gt,F)};n.addEventListener("pointermove",C),n.addEventListener("pointerup",R),n.addEventListener("pointercancel",R)})};let E=null;return{show(h,p,l){if(i.has(h))return;e.flush();const g=n.createElement("div");g.className="lc-widget-frame";const b={node:h,frame:g,scrim:null,sheet:null};if(o(h)){const T=n.createElement("div");T.className="lc-sheet",T.appendChild(h.el),g.appendChild(T),b.sheet={holder:T,detents:[1],detent:-1,dismissible:!0},y(b)}else g.appendChild(h.el);i.set(h,b),e.rootOwned(h,!0),s(b);const m=p===j?e.node(l):void 0;(p!==Ue&&m?m.el:t).appendChild(g),gn(h.el),b.sheet&&f(b,!0)},hide(h){const p=i.get(h);p&&(i.delete(h),ut(h.el),h.el.remove(),p.frame.remove(),e.rootOwned(h,!1))},scrim:h=>{var p;return((p=i.get(h))==null?void 0:p.scrim)??null},restyle(h){const p=i.get(h);p&&(s(p),p.sheet&&f(p,!1))},forget(h){const p=i.get(h);p&&(i.delete(h),p.frame.remove())},shown:()=>[...i.keys()],backTargets:()=>[...i.keys()].reverse().filter(h=>(h.flags&pr)!==0),isFrame:h=>h.classList.contains("lc-widget-frame"),toast(h,p){(!E||!E.isConnected)&&(E=n.createElement("div"),E.className="lc-toasts",t.appendChild(E));const l=n.createElement("div");l.className="lc-toast",l.setAttribute("role","status"),l.textContent=h,E.appendChild(l),l.offsetHeight,l.classList.add("lc-on"),r.setTimeout(()=>{l.classList.remove("lc-on"),r.setTimeout(()=>l.remove(),200)},Math.max(500,p))},destroy(){for(const h of i.values())h.frame.remove();i.clear(),E==null||E.remove(),E=null}}},Bo={isViewSupported:"phase 2",viewVersion:"phase 2",viewCall:"phase 2"},Pt={pager:["pagerSetContent","pagerSelect","pagerPush","pagerPop","pagerPopToRoot","pagerReplace"],vlist:["vlistInit","vlistSetKeys","vlistInsertKeys","vlistRemoveKeys","vlistInvalidate","vlistMount","vlistScrollTo","vlistScrollToKey","vlistScrollToEnd"],tween:["tweenCreate","tweenControl","tweenSeek","tweenSetRate","tweenGetTime","tweenGetElapsed","registerTweenEvent","defineTransition"]},zo=e=>{const t=e.root,n=t.ownerDocument,r=n.defaultView??window,i=new Set,s=c=>console.warn(`[web-lite] ${c}`),o=c=>{if(i.has(c))return;i.add(c);const u=Bo[c]??"";s(/^(step|phase)/.test(u)?`${c} is not built yet (docs/plans/web-lite-plan.md, ${u})`:`${c}: ${u}`)},a=[],d=c=>{var u;for(const w of a){const L=(u=w.ownerOf)==null?void 0:u.call(w,c);if(L)return L}return null},f=c=>{var u;for(const w of a){const L=(u=w.roots)==null?void 0:u.call(w,c);if(L)return L}return null},y=(c,u)=>{var w;for(const L of a)(w=L.rootActive)==null||w.call(L,c,u)},E=c=>{var u;for(const w of a)(u=w.subtreeMoved)==null||u.call(w,c)},h=()=>{for(const c of a)if(c.stage)return c.stage();return yn};let p=null;const l=()=>p??(p=e.transitions??h()),g={run:(c,u,w,L)=>l().run(c,u,w,L),settle:()=>l().settle(),enterOnTop:c=>l().enterOnTop(c),holds:c=>l().holds(c)};let b=[],m=!1;const T=c=>{b.push(c),!m&&(m=!0,queueMicrotask(()=>{m=!1;const u=b;b=[];for(const w of u)w()}))};let C=null;const R=(c,u,...w)=>{if(C)try{return C(c,u,...w)}catch(L){r.setTimeout(()=>{throw L},0);return}},A=(c,u,...w)=>T(()=>{R(c,u,...w)});t.classList.add("lc-root");const F=e.sink??co(n),P=po(F),v=go(F,P,{bufferUrl:e.bufferUrl},s),S=new Map;let O=1;const D=new ResizeObserver(c=>{for(const u of c){const w=u.target,L=S.get(Number(w.getAttribute("data-node")));!L||L.el!==w||!(L.flags&oe)||R(L.id,Dn,w.offsetLeft,w.offsetTop,w.offsetWidth,w.offsetHeight)}}),U=$o({doc:n,bufferUrl:e.bufferUrl,drawable:c=>{var u;for(const w of a){const L=(u=w.drawable)==null?void 0:u.call(w,c);if(L)return L}return null},hasTint:c=>v.names(c,"tintColor"),swapped:(c,u)=>{D.unobserve(u),c.flags&oe&&D.observe(c.el)},warn:s});v.onChange=c=>{const u=c;vr(u,w=>v.value(u,w)),u.type==="image"&&U.restyle(u),u.type==="widget"&&I.restyle(u)};const M=_o({root:t,emit:R,value:(c,u)=>v.value(c,u),boundary:c=>I.isFrame(c)||a.some(u=>{var w;return((w=u.boundary)==null?void 0:w.call(u,c))===!0})}),z=Uo({root:t,emit:R}),W=new ResizeObserver(()=>{R(0,Zn,t.clientWidth,t.clientHeight)});W.observe(t),v.onWrite=(c,u)=>{var w;for(const L of a)(w=L.styled)==null||w.call(L,c,u)};const H=c=>c.parent===null&&!c.rooted,_=(c,u,w=!0)=>{var L;for(const V of a)(L=V.forget)==null||L.call(V,c);for(const V of Ne(c))_(V,u,!1);w||u.push(c.id),M.forget(c),z.forget(c),U.forget(c),$.forgetUrl(j,c.id),I.forget(c),v.drop(c),D.unobserve(c.el),N.unregister(c.token),S.delete(c.id),c.parent=null,c.held=!1,w&&c.el.remove()},k=c=>{if(!S.has(c.id)||c.held||!H(c))return;const u=[];_(c,u),u.length>0&&R(0,bt,u)},N=new FinalizationRegistry(c=>{const u=S.get(c);u&&(u.held=!1,H(u)&&T(()=>k(u)))}),x=c=>{c.held||T(()=>k(c))},$=No({root:t,emit:A,post:T,warn:s,node:c=>S.get(c),rootOwned:(c,u)=>{c.rooted=u,u||x(c)},changed:e.onNavigation,active:y,transitions:g}),I=Po({root:t,emit:R,node:c=>S.get(c),value:(c,u)=>v.value(c,u),rootOwned:(c,u)=>{c.rooted=u,u||x(c)},flush:()=>v.flush()}),B=()=>{var u;for(const w of I.backTargets())if(R(w.id,_e,Ue,0)===!0)return"widget";const c=$.current();if(c){const w=c.kind===j||c.kind===Me?c.id:0;if(R(w,_e,c.kind,c.id)===!0)return"destination"}for(const w of a)if(((u=w.back)==null?void 0:u.call(w))===!0)return"feature";return $.routerPop(-1,ie)?"router":R(0,_e,Ue,0)===!0?"app":"none"},Z=c=>{if(!(c.key!=="Escape"||c.defaultPrevented)){for(const u of I.backTargets())if(R(u.id,_e,Ue,0)===!0){c.preventDefault();return}}};n.addEventListener("keydown",Z);const ee=To({root:t,roots:()=>{const c=$.current();return[...c!=null&&c.node&&c.kind===j?[{kind:"screen",node:c.node}]:[],...I.shown().map(w=>({kind:"widget",node:w}))]},held:c=>f(c),extend:(c,u,w)=>{var L;for(const V of a)(L=V.dump)==null||L.call(V,c,u,w)},value:(c,u)=>v.value(c,u),owns:(c,u)=>v.owns(c,u),flush:()=>v.flush()}),re=c=>{if(!c.isConnected)return null;v.flush();const u=en(t)||1,w=t.getBoundingClientRect(),L=c.getBoundingClientRect();return L.width===0&&L.height===0&&c.offsetParent===null?null:[(L.left-w.left)/u,(L.top-w.top)/u,L.width/u,L.height/u]},ue=()=>{const c={};for(const u of Object.keys(Pt))for(const w of Pt[u])c[w]=()=>(i.has(w)||(i.add(w),s(`${w}: this tree was made without the "${u}" feature`)),w==="tweenCreate"?null:0);return c},ze={create(c){const u=Eo(n,O++,c);hn(u),S.set(u.id,u);const w={id:u.id};return N.register(w,u.id,u.token),w},destroy(c){const u=S.get(c);if(!u)return;if(!H(u)){console.error(`[web-lite] destroy: node ${c} is attached — remove / hide / close it first`);return}u.held=!1;const w=[];_(u,w),w.length>0&&R(0,bt,w)},insert(c,u,w){var dt;const L=S.get(c),V=S.get(u);if(!L||!V||V===L)return;if(f(L)){s(`insert() on a ${L.type} — what it holds goes through its own calls`);return}if(!H(V)){s(`insert: node ${u} is not a root — remove it from where it is first`);return}const de=Ne(L),Le=Math.max(0,Math.min(w,de.length));V.parent=L,bn(L.el,V.el,((dt=de[Le])==null?void 0:dt.el)??null),E(V)},remove(c,u){const w=S.get(c),L=S.get(u);!w||!L||L.parent!==w||(L.parent=null,ot(L.el),E(L),x(L))},parent(c){var w,L;const u=S.get(c);return u?((w=u.parent)==null?void 0:w.id)??((L=d(u))==null?void 0:L.id)??0:0},children(c){const u=S.get(c);return u?(f(u)??Ne(u)).map(w=>w.id):[]},setString(c,u,w){const L=S.get(c);if(L)switch(w===null?L.strings.delete(u):L.strings.set(u,w),u){case"text":L.type==="text"&&(L.el.textContent=w??"");return;case"name":w===null?L.el.removeAttribute("data-name"):L.el.setAttribute("data-name",w);return;case"src":L.type==="image"&&U.setSrc(L,w);return;case"srcTintColor":L.type==="image"&&U.setSrcTint(L,w);return;case"sourceRect":L.type==="image"&&U.setSourceRect(L,w);return;case"value":if(L.type==="input"||L.type==="textarea"){const V=L.el;V.value!==(w??"")&&(V.value=w??"")}return;case"focus":w==="1"?L.el.focus({preventScroll:!0}):L.el.blur();return}},setInt(c,u,w){var L;(L=S.get(c))==null||L.strings.set(u,String(w))},setFlags(c,u){const w=S.get(c);if(!w)return;const L=w.flags;w.flags=u,w.el.classList.toggle(rt,(u&Oe)!==0),u&oe&&!(L&oe)?D.observe(w.el):!(u&oe)&&L&oe&&D.unobserve(w.el)},getTextValue(c){const u=S.get(c);return u&&(u.type==="input"||u.type==="textarea")?u.el.value:""},setStyle(c,u,w){const L=S.get(c);L&&v.set(L,u,w)},mergeStyle(c,u){const w=S.get(c);w&&v.merge(w,u)},setClass(c,u,w){const L=S.get(c);L&&v.setClass(L,u,w)},setTheme(c){for(const u of Object.keys(c)){const w=c[u];w==null?t.style.removeProperty(`--${u}`):t.style.setProperty(`--${u}`,typeof w=="number"?Q(w):Ee(w))}},open:$.open,close:$.close,routerOpen:(c,u,w,L)=>$.routerOpen(c,u,w,L),routerPush:$.routerPush,routerReplace:$.routerReplace,routerPop:(c,u)=>{$.routerPop(c,u)},routerHide:$.routerHide,routerRestore:$.routerRestore,setDestUrl:$.setUrl,isViewSupported:()=>(o("isViewSupported"),!1),viewVersion:()=>0,viewCall:(c,u,w,L,V)=>{o("viewCall"),V("native views are not built yet")},showWidget(c,u,w){const L=S.get(c);!L||I.shown().includes(L)||(I.show(L,u,w),y(L,!0))},hideWidget(c){const u=S.get(c);!u||!I.shown().includes(u)||(y(u,!1),I.hide(u))},registerFont(c,u,w,L,V,de){try{const Le=new r.FontFace(c,`url("${u}")`,{weight:String(w),style:L===2?"italic":"normal"});n.fonts.add(Le),Le.load().then(()=>V(),()=>de())}catch{de()}},fontFormat:"woff2",toast:(c,u)=>I.toast(c,u),isButtonPressed(c){const u=S.get(c);return!!u&&M.isPressed(u)},isHovered(c){const u=S.get(c);return!!u&&M.isHovered(u)},getBoundingClientRect(c){const u=S.get(c);return u?re(u.el):null},getDisplaySize:()=>[t.clientWidth,t.clientHeight],debugDump:()=>ee.dump(),debugPaint:c=>ee.paint(S.get(c)),setEmitter(c){C=c}},fe={...ue(),...ze},Te={root:t,emit:R,emitLater:A,post:T,warn:s,node:c=>S.get(c),rootOwned:(c,u)=>{c.rooted=u,u||x(c)},flush:()=>v.flush(),value:(c,u)=>v.value(c,u),setStyle:(c,u,w)=>v.set(c,u,w),setString:(c,u,w)=>fe.setString(c,u,w),style:{bufferUrl:e.bufferUrl},shown:c=>{var u;return((u=$.current())==null?void 0:u.node)===c||I.shown().includes(c)},scrim:c=>I.scrim(c),stage:h,sourceChanged:c=>U.sourceChanged(c)},G={};for(const c of e.features??[]){const u=c.install(Te);a.push(u),Object.assign(fe,u.bridge),Object.assign(G,u.globals)}return{bridge:fe,globals:G,presentation:$,back:B,setSafeArea(c,u=[]){for(const w of["top","right","bottom","left"])t.style.setProperty(`--safe-${w}`,`${c[w]}px`),u.includes(w)?t.style.setProperty(`--safe-${w}-bar`,`${c[w]}px`):t.style.removeProperty(`--safe-${w}-bar`)},flush:()=>v.flush(),stats:()=>Object.assign({nodes:S.size,classes:P.count(),tweens:0},...a.map(c=>{var u;return((u=c.stats)==null?void 0:u.call(c))??{}})),destroy(){var c;C=null,$.reset();for(const u of a)(c=u.destroy)==null||c.call(u);I.destroy(),n.removeEventListener("keydown",Z),M.destroy(),z.destroy(),W.disconnect(),D.disconnect();for(const u of S.values())N.unregister(u.token),u.el.remove();S.clear(),e.sink||F.destroy(),t.classList.remove("lc-root");for(const u of Array.from(t.style))u.startsWith("--")&&t.style.removeProperty(u)}}},Vo="modulepreload",Wo=function(e,t){return new URL(e,t).href},Bt={},$e=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(y){return Promise.all(y.map(E=>Promise.resolve(E).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const a=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));i=o(n.map(y=>{if(y=Wo(y,r),y in Bt)return;Bt[y]=!0;const E=y.endsWith(".css"),h=E?'[rel="stylesheet"]':"";if(!!r)for(let g=a.length-1;g>=0;g--){const b=a[g];if(b.href===y&&(!E||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${h}`))return;const l=document.createElement("link");if(l.rel=E?"stylesheet":Vo,E||(l.as="script"),l.crossOrigin="",l.href=y,f&&l.setAttribute("nonce",f),document.head.appendChild(l),E)return new Promise((g,b)=>{l.addEventListener("load",g),l.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${y}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},zt={pager:["pagerSetContent"],vlist:["vlistInit"],tween:["tweenCreate","defineTransition"],canvas:["_creatorCanvas."]},Go={pager:()=>$e(()=>import("./assets/pager-O712dZv9.js"),[],import.meta.url).then(e=>e.pager),vlist:()=>$e(()=>import("./assets/vlist-gEB8Sn0S.js"),[],import.meta.url).then(e=>e.vlist),tween:()=>$e(()=>import("./assets/tween-t_XDy3Nd.js"),[],import.meta.url).then(e=>e.tween),canvas:()=>$e(()=>import("./assets/canvas-C6G_Pb2Q.js"),[],import.meta.url).then(e=>e.canvas)},En=Object.keys(zt).map(e=>({name:e,uses:zt[e],load:Go[e]})),Ho=e=>En.filter(t=>t.uses.some(n=>e.includes(n))).map(t=>t.name),jo=async e=>{const t=Ho(e);return(await Promise.all(En.filter(r=>t.includes(r.name)).map(r=>r.load().catch(i=>(console.warn(`[web-lite] the "${r.name}" feature did not load: ${i instanceof Error?i.message:i}`),null))))).filter(r=>r!==null)},ne=[null],ft=new TextDecoder("utf-8"),Ko=e=>JSON.parse(ft.decode(Se(e))),vn=e=>ft.decode(Se(e)),Yo=e=>new Uint8Array(Se(e)).slice(),qo=(e,t,n)=>ft.decode(Se(e).slice(t,n)),Xo=e=>{const t=new Blob([ne[e]]);return URL.createObjectURL(t)},wn=e=>new Blob([ne[e]]),Se=e=>ne[e],Vt=e=>{ne[e]=null},st=e=>(ne.push(e),ne.length-1),Jo=new Map,Wt=new Map,Qo=e=>{const t=Wt.get(e);if(t!==void 0)return t;const n=Jo.get(e);if(!n)return-1;ne.push(n);const r=ne.length-1;return Wt.set(e,r),r},Zo=e=>{let t=null,n=null;const r=(d,f)=>{t==null||t(d,f)},i=()=>r(document.hidden?"pause":"resume"),s=()=>r("online"),o=()=>r("offline");return document.addEventListener("visibilitychange",i),window.addEventListener("online",s),window.addEventListener("offline",o),{bridge:{run(d,f,y,E){let h;try{h=vn(d)}catch{f("run: no such buffer");return}e.rerun(h,E,f)},restart(d){e.rerun(void 0,d)},quit(){},launchUrl:()=>e.launchUrl(),registerEvent(d){t=d},setFreedEmitter(d){n=d},ownedStats:()=>e.stats(),state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(d){window.open(d,"_blank","noopener")},setOrientation(d){var E,h,p,l;const f=d==="landscape"||d==="portrait"?d:"auto";if(e.onOrientation){e.onOrientation(f);return}const y=typeof screen<"u"?screen.orientation:void 0;if(y)try{f==="auto"?(E=y.unlock)==null||E.call(y):(l=(p=(h=y.lock)==null?void 0:h.call(y,f))==null?void 0:p.catch)==null||l.call(p,()=>{})}catch{}}},emit:r,freed:(d,f)=>{n==null||n(d,f)},dispose(){t=null,n=null,document.removeEventListener("visibilitychange",i),window.removeEventListener("online",s),window.removeEventListener("offline",o)}}},es=(e,t,n,r)=>{try{const i=document.createElement("input");i.type="file",i.multiple=n,r&&(i.accept=r),i.onchange=async()=>{const{files:s}=i;if(n){const o=[];if(!s)return e([]);for(let a of s)o.push([st(await a.arrayBuffer()),a.name,a.size]);e(o)}else{if(!s||s.length===0)return e(null);e([[st(await s[0].arrayBuffer()),s[0].name,s[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files.length===0)&&e(n?[]:null)},300)},{once:!0}),i.click()}catch(i){t(i)}},ts=e=>({get platform(){return"web"},get language(){return e()},get pixelRatio(){return window.devicePixelRatio||1},vibrate(){var t;try{(t=navigator.vibrate)==null||t.call(navigator,30)}catch{}},clipboardWrite(t){var n;(n=navigator.clipboard)==null||n.writeText(t).catch(()=>{})},clipboardRead(t,n){const r=navigator.clipboard;if(!(r!=null&&r.readText)){n("Clipboard is not available");return}r.readText().then(t,i=>n(i instanceof Error?i.message:"Clipboard read failed"))},share(t,n){var a;const r=wn(t),i=new File([r],"image.png",{type:"image/png"});if((a=navigator.canShare)!=null&&a.call(navigator,{files:[i]})){navigator.share({files:[i],text:n}).catch(()=>{});return}const s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=i.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(s)},openFilePicker:(t,n,r,i)=>es(t,n,r,i??void 0),requestCamera(t){t()}}),ns=e=>{const t=e==null?void 0:e._h;return typeof e=="object"&&e!==null&&typeof(t==null?void 0:t.id)=="number"?t.id:null},rs=e=>{if(e==null)return;if(typeof e=="string")return e;const t=e._entries;if(!Array.isArray(t))throw new Error("fetch: the body is a string or a FormData");const n=new FormData;for(const[r,i,s]of t){const o=ns(i);o!==null?n.append(r,wn(o),s):n.append(r,String(i))}return n},os=()=>{const e=new Set,t=new FinalizationRegistry(s=>{e.delete(s)&&Vt(s)}),n=s=>{const o={id:s};return e.add(s),t.register(o,s),o};let r=!1;return{bridge:{fetch(s,o,a,d,f){const y=typeof(o==null?void 0:o.onProgress)=="function"?o.onProgress:f;if(s.startsWith("id:")){const E=Number(s.slice(3));a({id:E},Se(E)?200:404);return}(async()=>{var E;try{const h=await fetch(s,{method:o==null?void 0:o.method,headers:o==null?void 0:o.headers,body:rs(o==null?void 0:o.body),mode:"cors",credentials:"omit"}),p=y?(E=h.body)==null?void 0:E.getReader():void 0;let l;if(!p)l=await h.arrayBuffer();else{const g=Number(h.headers.get("content-length"))||void 0,b=[];let m=0;for(;;){const{done:R,value:A}=await p.read();if(R)break;A&&(b.push(A),m+=A.length,r||y({loaded:m,total:g}))}const T=new Uint8Array(m);let C=0;for(const R of b)T.set(R,C),C+=R.length;l=T.buffer}if(r)return;a(n(st(l)),h.status)}catch(h){r||d(h instanceof Error?h:String(h))}})()},local:s=>Qo(s),toJson:s=>Ko(s),slice:(s,o,a)=>qo(s,o,a),toText:s=>vn(s),toBytes:s=>Yo(s)},live:()=>e.size,dispose(){r=!0;for(const s of e)Vt(s);e.clear()}}},Gt=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],Xe=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],Ae=4,Je=16,Ht=16,ss=.5,is=e=>{const t=new Set;let n=null;const r=(x,$,I=-1,B=0)=>{n==null||n(x,$,I,B)},i=x=>{if(!x.code)return;const $=t.has(x.code);t.add(x.code),r(0,x.code,-1,$||x.repeat?1:0)},s=x=>{x.code&&t.delete(x.code)&&r(1,x.code)},o=()=>{for(const x of[...t])x.startsWith("Gamepad")||(t.delete(x),r(1,x))},{root:a}=e;let d=0,f=0,y=0,E=0,h=0,p=0,l=0,g=0,b=0,m=0;const T=x=>{if(x.pointerType&&x.pointerType!=="mouse")return;const $=a.getBoundingClientRect();d=x.clientX-$.left,f=x.clientY-$.top,y+=x.movementX||0,E+=x.movementY||0},C=x=>{const $=Gt[x.button];$&&(t.add($),r(0,$))},R=x=>{const $=Gt[x.button];$&&t.delete($)&&r(1,$)},A=x=>{const $=x.deltaMode===0?.01:1;h+=x.deltaX*$,p+=x.deltaY*$},F=x=>{document.pointerLockElement===a&&x.preventDefault()},P=[],v=[],S=[],O=()=>{var $,I;const x=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let B=0;B<Ae;B++){const Z=x[B]??null,ee=!!Z&&Z.connected;if(ee!==!!P[B]){if(P[B]=ee,!ee){for(const G of Xe)t.delete(G+"@"+B)&&(r(1,G,B),D(G));S[B]=[],v[B]=[0,0,0,0,0,0]}r(ee?2:3,"",B)}if(!Z||!ee)continue;const re=Z.axes,ue=Z.buttons,ze=(($=ue[6])==null?void 0:$.value)??0,fe=((I=ue[7])==null?void 0:I.value)??0;v[B]=[re[0]??0,re[1]??0,re[2]??0,re[3]??0,ze,fe];const Te=S[B]??(S[B]=[]);for(let G=0;G<Xe.length;G++){const c=ue[G],u=!!c&&(c.pressed||c.value>ss);if(u===!!Te[G])continue;Te[G]=u;const w=Xe[G];u?t.add(w+"@"+B):t.delete(w+"@"+B),D(w),r(u?0:1,w,B)}}},D=x=>{let $=!1;for(let I=0;I<Ae&&!$;I++)t.has(x+"@"+I)&&($=!0);$?t.add(x):t.delete(x)};let U=0;const M=()=>{l=y,g=E,b=h,m=p,y=E=h=p=0,O(),U=requestAnimationFrame(M)},z=e.windows.filter((x,$,I)=>x&&I.indexOf(x)===$);for(const x of z)e.keyboard!==!1&&(x.addEventListener("keydown",i),x.addEventListener("keyup",s)),x.addEventListener("blur",o);return a.addEventListener("pointermove",T,!0),a.addEventListener("mousedown",C,!0),window.addEventListener("mouseup",R,!0),a.addEventListener("wheel",A,{passive:!0,capture:!0}),a.addEventListener("contextmenu",F,!0),typeof requestAnimationFrame=="function"&&(U=requestAnimationFrame(M)),{inputKey:(x,$)=>$>=0&&x.startsWith("Gamepad")?t.has(x+"@"+$):t.has(x),inputRead:x=>{var $;switch(x){case 0:return d;case 1:return f;case 2:return l;case 3:return g;case 4:return b;case 5:return m;case 6:return document.pointerLockElement===a?1:0;case 7:{let I=0;for(let B=0;B<Ae;B++)P[B]&&I++;return I}}if(x>=Je){const I=Math.floor((x-Je)/Ht),B=(x-Je)%Ht;return I>=Ae||!P[I]?0:B===0?1:(($=v[I])==null?void 0:$[B-1])??0}return 0},inputSetPointerLock:x=>{if(!x)return document.pointerLockElement===a&&document.exitPointerLock(),!0;if(document.pointerLockElement===a)return!0;if(typeof a.requestPointerLock!="function")return!1;try{const $=a.requestPointerLock({unadjustedMovement:!0});return $&&typeof $.catch=="function"&&$.catch(()=>{try{a.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:x=>{n=x},dispose:()=>{for(const x of z)x.removeEventListener("keydown",i),x.removeEventListener("keyup",s),x.removeEventListener("blur",o);a.removeEventListener("pointermove",T,!0),a.removeEventListener("mousedown",C,!0),window.removeEventListener("mouseup",R,!0),a.removeEventListener("wheel",A,!0),a.removeEventListener("contextmenu",F,!0),U&&cancelAnimationFrame(U),document.pointerLockElement===a&&document.exitPointerLock(),t.clear(),n=null}}},cs=e=>{const t=e.ownerDocument.defaultView??window,n=is({windows:[t],root:e}),r=t.visualViewport,i=()=>r?Math.max(0,Math.round(t.innerHeight-r.height-r.offsetTop)):0;let s=null,o=0;const a=()=>{const f=i();f!==o&&(o=f,s==null||s(f,0))};return r==null||r.addEventListener("resize",a),{bridge:{key:n.inputKey,read:n.inputRead,setPointerLock:n.inputSetPointerLock,registerEvent(f){n.registerInputEvent(f)},keyboardHeight:i,registerKeyboardEvent(f){s=f}},dispose(){s=null,r==null||r.removeEventListener("resize",a),n.dispose()}}},Y=[null],ke=[!1],Sn=(e,t,n)=>{e.addEventListener("ended",()=>{n(),ke[t]&&(e.currentTime=0,e.play())})},as=(e,t)=>{const n=document.createElement("video");document.body.appendChild(n),n.crossOrigin="anonymous",n.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",n.src=e,n.playsInline=!0,n.controls=!1;const r=Y.length;return Y.push(n),ke.push(!1),Sn(n,r,t),r},ls=(e,t)=>{const n=document.createElement("audio");document.body.appendChild(n),n.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",n.src=e;const r=Y.length;return Y.push(n),ke.push(!1),Sn(n,r,t),r},us=(e,t)=>{const n=Y[e];n&&(t===0?n.muted=!0:(n.muted&&(n.muted=!1),n.volume=t))},fs=(e,t)=>{const n=Y[e];n&&(t?n.play():n.pause())},ds=(e,t)=>{ke[e]=t},ps=e=>{var t;return((t=Y[e])==null?void 0:t.currentTime)??0},ms=(e,t)=>{const n=Y[e];n&&(n.currentTime=t)},hs=e=>{var n;const t=((n=Y[e])==null?void 0:n.duration)??0;return isNaN(t)?0:t},gs=e=>{e.pause(),e.removeAttribute("src"),e.load(),e.remove()},bs=e=>{const t=Y[e];t&&(gs(t),Y[e]=null,ke[e]=!1)},ys=()=>{const e=new Map;let t=null;const n=o=>{e.delete(o)&&bs(o)},r=new FinalizationRegistry(o=>{const a=e.get(o);a&&(a.held=!1,a.playing||n(o))}),i=(o,a)=>{let d=-1;if(d=o(a,()=>{const E=e.get(d);E&&(t==null||t(d),!E.loop&&(E.playing=!1,E.held||n(d)))}),d<0)return null;e.set(d,{held:!0,playing:!1,loop:!1});const y={id:d};return r.register(y,d),y};return{bridge:{createAudio:o=>i(ls,o),createVideo:o=>i(as,o),setVolume:us,setLoop(o,a){const d=e.get(o);d&&(d.loop=a),ds(o,a)},setPlaying(o,a){const d=e.get(o);d&&(d.playing=a,fs(o,a),!a&&!d.held&&n(o))},time:ps,setTime:ms,duration:hs,setEmitter(o){t=o}},live:()=>e.size,dispose(){t=null;for(const o of[...e.keys()])n(o)}}},Es=()=>{const e=[];return{bridge:{open(n,r){const i=e.length;let s;try{s=new WebSocket(n)}catch{return e.push(null),queueMicrotask(()=>r("error")),i}return s.addEventListener("open",()=>r("open")),s.addEventListener("message",o=>r("message",o.data)),s.addEventListener("close",o=>{e[i]=null,r("close",o.code)}),s.addEventListener("error",()=>r("error")),e.push(s),i},send(n,r){const i=e[n];i&&i.readyState===WebSocket.OPEN&&i.send(r)},close(n){var r;(r=e[n])==null||r.close()}},dispose(){for(const n of e)n==null||n.close();e.length=0}}},vs=e=>{let t="default",n=null,r=!1;const i=()=>`lecodes:${e}:${t}`,s=()=>{if(n)return n;n={};try{const f=window.localStorage.getItem(i()),y=f?JSON.parse(f):null;if(y&&typeof y=="object")for(const[E,h]of Object.entries(y))typeof h=="string"&&(n[E]=h)}catch{}return n},o=()=>{if(r=!1,!!n)try{window.localStorage.setItem(i(),JSON.stringify(n))}catch{}},a=()=>{r||(r=!0,queueMicrotask(o))};return{bridge:{get:f=>s()[f]??null,set(f,y){s()[f]=String(y),a()},remove(f){delete s()[f],a()},select(f){r&&o(),t=f,n=null}},dispose(){r&&o()}}},jt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn={};for(let e=0;e<jt.length;e++)kn[jt[e]]=e;const ws=e=>{const t=[];let n=0,r=0;for(const i of e){const s=kn[i];if(s===void 0)break;const o=s&32;if(r+=(s&31)<<n,o)n+=5;else{const a=r&1;r>>=1,t.push(a?-r:r),r=0,n=0}}return t};class Ss{constructor(t){Ve(this,"sources");Ve(this,"lines");this.sources=t.sources,this.lines=[];let n=0,r=0,i=0;for(const s of t.mappings.split(";")){const o=[];let a=0;if(s)for(const d of s.split(",")){const f=ws(d);f.length!==0&&(a+=f[0],f.length>=4&&(n+=f[1],r+=f[2],i+=f[3],o.push([a,n,r,i])))}this.lines.push(o)}}originalPositionFor(t,n){const r=this.lines[t-1];if(!r||r.length===0)return null;let i=null;for(const o of r)if(o[0]<=n)i=o;else break;i??(i=r[0]);const s=this.sources[i[1]];return s===void 0?null:{source:s,line:i[2]+1,column:i[3]}}}const ks=e=>{const t=e.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{const n=typeof atob=="function"?atob(t[1]):Buffer.from(t[1],"base64").toString("utf8");return new Ss(JSON.parse(n))}catch{return null}};let se=null;const Ts=()=>{if(se!==null)return se;try{new Function("throw new Error('chisel-calibrate')")()}catch(e){const n=(e.stack??"").match(/<anonymous>:(\d+):\d+/);return se=n?parseInt(n[1],10)-1:2,se}return se=2,se},Kt=(e,t)=>{const n=(e instanceof Error?e.stack:"")??"",r=Ts(),i=[];for(const s of n.split(`
246
+ `)){const o=s.match(/<anonymous>:(\d+):(\d+)/);if(!o)continue;const a=parseInt(o[1],10)-r,d=parseInt(o[2],10)-1;if(a<1)continue;const f=t.originalPositionFor(a,d<0?0:d);if(!f)continue;const y=s.match(/at\s+([^\s(]+)\s*\(/);i.push({fn:y?y[1]:null,source:f.source,line:f.line,column:f.column})}return i},Ls=e=>{const t=[],n=(o,a,d)=>{var E;const f=a instanceof Error?a.message:String(a),y=d[0];console.error(y?`[lecodes] ${f}
247
+ at ${y.source}:${y.line}:${y.column}${y.fn?` (${y.fn})`:""}`:`[lecodes] ${f}`),(E=o.onError)==null||E.call(o,{message:f,frames:d,stack:a instanceof Error?a.stack:void 0})},r=o=>{for(let a=t.length-1;a>=0;a--){const d=t[a];if(!d.sourceMap)continue;const f=Kt(o,d.sourceMap);if(f.length>0)return n(d,o,f),!0}return!1},i=o=>{r(o.error??o.message)},s=o=>{r(o.reason)};return e.addEventListener("error",i),e.addEventListener("unhandledrejection",s),{track(o,a){const d={sourceMap:ks(o),onError:a};return t.push(d),{thrown(f){n(d,f,d.sourceMap?Kt(f,d.sourceMap):[])},drop(){const f=t.indexOf(d);f>=0&&t.splice(f,1)}}},dispose(){e.removeEventListener("error",i),e.removeEventListener("unhandledrejection",s),t.length=0}}},_s=""+new URL("assets/roboto-cyrillic-ext-1gPz9dK9.woff2",import.meta.url).href,xs=""+new URL("assets/roboto-cyrillic-DVBNKCCH.woff2",import.meta.url).href,Rs=""+new URL("assets/roboto-greek-ext-D98D44EL.woff2",import.meta.url).href,Cs=""+new URL("assets/roboto-greek-DVLYEgdx.woff2",import.meta.url).href,$s=""+new URL("assets/roboto-latin-ext-t610Sqxq.woff2",import.meta.url).href,As=""+new URL("assets/roboto-latin-cAJwcdBQ.woff2",import.meta.url).href,Os=""+new URL("assets/roboto-rest-C7JkyNHT.woff2",import.meta.url).href,Us=""+new URL("assets/roboto-vietnamese-w-p-nKZZ.woff2",import.meta.url).href,Fs="Roboto",Ns="100 900",Ms=[{name:"rest",file:"roboto-rest.woff2",range:"U+02D8-02D9, U+02DB, U+030F, U+2070, U+2074-208E, U+20C1, U+2105, U+2126, U+212E, U+215B-215E, U+2202, U+2206, U+220F, U+2211, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25A0, U+25CA-25CB, U+25CF, U+EE01-EE02, U+F6C3, U+FB01-FB04, U+FFFC",bytes:13324},{name:"cyrillic-ext",file:"roboto-cyrillic-ext.woff2",range:"U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",bytes:36720},{name:"cyrillic",file:"roboto-cyrillic.woff2",range:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",bytes:23696},{name:"greek-ext",file:"roboto-greek-ext.woff2",range:"U+1F00-1FFF",bytes:4380},{name:"greek",file:"roboto-greek.woff2",range:"U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF",bytes:17588},{name:"vietnamese",file:"roboto-vietnamese.woff2",range:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB",bytes:14340},{name:"latin-ext",file:"roboto-latin-ext.woff2",range:"U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",bytes:26388},{name:"latin",file:"roboto-latin.woff2",range:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",bytes:36600}],Qe={family:Fs,weight:Ns,parts:Ms},Ds=Object.assign({"./assets/fonts/roboto-cyrillic-ext.woff2":_s,"./assets/fonts/roboto-cyrillic.woff2":xs,"./assets/fonts/roboto-greek-ext.woff2":Rs,"./assets/fonts/roboto-greek.woff2":Cs,"./assets/fonts/roboto-latin-ext.woff2":$s,"./assets/fonts/roboto-latin.woff2":As,"./assets/fonts/roboto-rest.woff2":Os,"./assets/fonts/roboto-vietnamese.woff2":Us}),Yt="data-lecodes-lite-fonts",Is=1500,Ps=e=>{if(e.head.querySelector(`style[${Yt}]`))return;const t=Qe.parts.map(r=>{const i=Ds[`./assets/fonts/${r.file}`];if(!i)return"";const s=new URL(i,e.baseURI).href;return`@font-face{font-family:"${Qe.family}";src:url("${s}") format("woff2");font-weight:${Qe.weight};font-style:normal;font-display:swap;unicode-range:${r.range}}`}),n=e.createElement("style");n.setAttribute(Yt,""),n.textContent=t.join(`
248
+ `),e.head.appendChild(n)},Bs=(e,t=[],n=Is)=>{const r=e.defaultView??window,i=e.fonts?e.fonts.ready.then(()=>{},()=>{}):Promise.resolve();return new Promise(s=>{const o=r.setTimeout(s,n);Promise.all([i,...t.map(a=>a.then(()=>{},()=>{}))]).then(()=>{r.clearTimeout(o),s()})})},qt=e=>typeof e=="object"&&e!==null&&e.lecodes===!0&&typeof e.level=="number",it=(e,t={})=>{let n;if((t.mode??"hash")==="hash")n=e.hash.replace(/^#/,"");else{const r=t.base??"/";n=(e.pathname.startsWith(r)?e.pathname.slice(r.length-1):e.pathname).replace(/\/index\.html$/,"/")+e.search}return n===""||n==="/"?null:n.startsWith("/")?n:`/${n}`},zs=(e,t,n={})=>{if((n.mode??"hash")==="hash")return`${t.pathname}${t.search}${e===null?"":`#${e}`}`;const r=n.base??"/";return e===null?r:r.replace(/\/$/,"")+e},Vs=(e,t,n={})=>{const r=e.history,i=e.location;let s=0,o=!1,a=0,d=!1;const f=(p,l)=>{const g={lecodes:!0,level:l},b=zs(t.address(),i,n);p==="push"?r.pushState(g,"",b):r.replaceState(g,"",b)},y=p=>{p!==0&&(a++,r.go(p))},E=()=>{if(a>0){d=!0;return}const p=t.level();if(o){s=p,f("replace",p);return}if(p>s){for(let l=s+1;l<=p;l++)f("push",l);s=p}else if(p<s){const l=p-s;s=p,y(l)}else f("replace",p)},h=p=>{if(a>0){if(a--,a>0)return;d?(d=!1,E()):f("replace",s);return}const l=p.state;if(!qt(l)){const T=it(i,n);r.replaceState({lecodes:!0,level:s},"",i.href),T!==null&&t.link(T);return}const g=l.level,b=s;o=!0;try{if(g<b)for(;t.level()>g;){const T=t.level();if(t.back(),t.level()>=T)break}else if(g>b){const T=it(i,n);T!==null&&t.link(T)}}finally{o=!1}const m=Math.max(0,t.level());if(s=g,m===g){f("replace",g);return}if(g>b&&m>b){s=m,f("replace",m);return}s=m,y(m-g)};return e.addEventListener("popstate",h),qt(r.state)?s=r.state.level:r.replaceState({lecodes:!0,level:0},"",i.href),{sync:E,reset(){const p=-s;s=0,y(p)},destroy(){e.removeEventListener("popstate",h)}}},Ws=.1,Gs=e=>{const t=new Set,n=new Set,r=new Map;let i=1,s=0,o=0;const a=d=>{s=0;const f=Math.min(Ws,Math.max(0,(d-o)/1e3));o=d;for(const y of[...r.values()])y(f);r.size>0&&(s=e.requestAnimationFrame(a))};return{globals:{setTimeout(d,f,...y){const E=e.setTimeout(()=>{t.delete(E),d(...y)},f);return t.add(E),E},clearTimeout(d){t.delete(d),e.clearTimeout(d)},setInterval(d,f,...y){const E=e.setInterval(()=>d(...y),f);return n.add(E),E},clearInterval(d){n.delete(d),e.clearInterval(d)},setLoop(d){const f=i++;return r.set(f,d),s===0&&(o=e.performance.now(),s=e.requestAnimationFrame(a)),f},clearLoop(d){r.delete(d)}},dispose(){for(const d of t)e.clearTimeout(d);for(const d of n)e.clearInterval(d);t.clear(),n.clear(),r.clear(),s!==0&&e.cancelAnimationFrame(s),s=0}}},Hs=["_creator","_creator2d","_creatorNav","_creatorNet","_creatorAudio","_creatorCanvas","_creatorFiles","_creatorService"],Xt=new Map,js=e=>{let t=Xt.get(e);return t||Xt.set(e,t=Xo(e)),t},Ks=(e,t={})=>{const n=e.ownerDocument,r=n.defaultView??window,i=Ls(r),s=t.language??(()=>(navigator.language||"en").slice(0,2));let o=null,a=t.launchRoute!==void 0?t.launchRoute:t.history?it(r.location,t.history):null,d=t.safeArea??null,f=0;const y=n.createElement("div");y.style.cssText="position:absolute;visibility:hidden;pointer-events:none;width:0;height:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);";const E=()=>{y.isConnected||n.body.appendChild(y);const m=r.getComputedStyle(y),T=C=>Math.round(parseFloat(C)||0);return{top:T(m.paddingTop),right:T(m.paddingRight),bottom:T(m.paddingBottom),left:T(m.paddingLeft)}},h=()=>{const m=d??E();o==null||o.tree.setSafeArea(m,m.bars??[])};r.addEventListener("resize",h);const p=t.history?Vs(r,{level:()=>Math.max(0,((o==null?void 0:o.tree.presentation.stack().length)??0)-1),address:()=>(o==null?void 0:o.tree.presentation.address())??null,back:()=>{o==null||o.tree.back()},link:m=>{a=m,o==null||o.emitApp("url",m)}},t.history):null,l=()=>{o==null||o.dispose(),o=null},g=(m,T,C)=>{const R=zo({root:e,bufferUrl:js,features:C,onNavigation:()=>{var W;p==null||p.sync(),(W=t.onNavigation)==null||W.call(t,R)}}),A=Gs(r),F=os(),P=vs(t.project??"app"),v=Es(),S=cs(e),O=ys(),D=i.track(m,T.onError),U=Zo({launchUrl:()=>a,rerun:(W,H,_)=>{H!==void 0&&(a=H);const k=W??m;r.setTimeout(()=>{b(k,T).catch(N=>_==null?void 0:_(N instanceof Error?N.message:String(N)))},0)},stats:()=>JSON.stringify({live:{tree:R.stats().nodes,fetch:F.live(),media:O.live(),tween:R.stats().tweens},pending:0}),onOrientation:t.onOrientation}),M={_creatorTree:R.bridge,_creatorApp:U.bridge,_creatorDevice:ts(s),_creatorFetch:F.bridge,_creatorStorage:P.bridge,_creatorSocket:v.bridge,_creatorInput:S.bridge,_creatorMedia:O.bridge,...A.globals};for(const W of Hs)M[W]=void 0;Object.assign(M,R.globals),o={code:m,tree:R,emitApp:U.emit,dispose(){D.drop(),A.dispose(),v.dispose(),O.dispose(),S.dispose(),P.dispose(),F.dispose(),U.dispose(),R.destroy()}},h();const z=Object.keys(M);try{new Function(...z,m)(...z.map(W=>M[W]))}catch(W){D.thrown(W)}};async function b(m,T={}){const C=Mn(m);if(!Un(C.sdk,pt))throw new Error(`This app was built with LeCodes SDK ${C.sdk??"older than 2.0"}; this host runs SDK ${pt}. It needs a new build.`);(C.gl==="on"||C.is2d)&&console.warn(`[web-lite] this app uses ${C.is2d?"2D":"3D"} scenes, which Web Lite does not show yet (docs/plans/web-lite-plan.md): its UI runs, a scene's calls fail`);const R=++f;o&&(p==null||p.reset()),l(),t.defaultFont!=="system"&&Ps(n);const A=Nn(C.bootFonts,n),F=await jo(m);if(R===f){e.style.visibility="hidden";try{g(m,T,F),o==null||o.tree.flush(),e.offsetHeight,await Bs(n,[A])}finally{R===f&&(e.style.visibility="")}}}return{run:b,restart(m){return o?(m!==void 0&&(a=m),b(o.code)):Promise.resolve()},tree:()=>(o==null?void 0:o.tree)??null,setSafeArea(m){d=m,h()},openRoute(m){a=m,o==null||o.emitApp("url",m)},emitAppEvent(m,T){o==null||o.emitApp(m,T)},destroy(){f++,l(),r.removeEventListener("resize",h),p==null||p.destroy(),y.remove(),i.dispose()}}},ge=document.getElementById("app"),Jt=document.getElementById("error"),le=new URLSearchParams(location.search),Tn=e=>{Jt&&(Jt.textContent=e)},Qt=le.has("dev")?new URL(le.get("dev")||"..",location.href).href.replace(/\/$/,""):null,Zt=e=>{const t=e.frames[0];return t?`${e.message}
249
+ at ${t.source}:${t.line}:${t.column}${t.fn?` (${t.fn})`:""}`:e.message},Ln=e=>{Tn(Zt(e)),K==null||K.error(Zt(e))},_n=e=>Ln({message:e instanceof Error?e.message:String(e),frames:[]}),xn=Ks(ge,{history:{mode:ge.dataset.urls==="path"?"path":"hash",base:ge.dataset.base??"/"},project:le.get("project")??location.pathname,defaultFont:ge.dataset.font==="system"?"system":"roboto"});le.has("test")&&(window.lecodesTest={ready:!1,dump:()=>{var e;return((e=xn.tree())==null?void 0:e.bridge.debugDump())??'{"roots":[]}'},rect:e=>{const t=document.querySelector(`[data-node="${e}"]`);if(!t)return null;const n=t.getBoundingClientRect();return[n.left,n.top,n.width,n.height]}});let Ze=!1,et=null,ct=-1;const Be=async e=>{if(Ze){et=e;return}Ze=!0,Tn("");try{const t=await fetch(e.src,{cache:"no-store"});if(!t.ok)throw new Error(t.status===503?"No successful compile yet — check the terminal.":`${e.src} → HTTP ${t.status}`);const n=await t.text();await xn.run(n,{onError:Ln});const r=window.lecodesTest;r&&(r.ready=!0),K&&e.version!==void 0&&(ct=K.versionOf(t,e.version),K.ran(ct))}catch(t){_n(t)}finally{Ze=!1;const t=et;et=null,t&&Be(t)}},K=Qt?An(Qt,e=>{e!==ct&&Be({src:K.bundleUrl(e),version:e})}):null;if(K)for(const e of["log","info","warn","error"]){const t=console[e].bind(console);console[e]=(...n)=>{t(...n),K.log(e,n)}}if(K)Be({src:K.bundleUrl(0),version:0});else{const e=On(le.get("src")??ge.dataset.src??"app.js",document.baseURI);e?Be({src:e}):_n(`The page runs bundles of its own origin only: ${le.get("src")}`)}export{ce as E,Xs as T,me as a,ie as b,Zs as c,tr as d,j as e,qs as f,Qn as g,Jn as h,Qs as i,Js as j,to as k,un as l,ro as m,je as n,ve as o,bn as p,Ke as q,st as r,xo as s,ot as t,wn as u};
@@ -278,7 +278,7 @@ export const startCommentSync = (ctx: DesignContext, designServer: DesignServer)
278
278
  // An older lecodes-design has no mirror to drive. The board still works off the files, so losing
279
279
  // the sync is not a reason to refuse to serve.
280
280
  if (typeof designServer.mirrorThreads !== "function") {
281
- note("Comment sync needs a newer lecodes-design (npm install -g lecodes-design@latest) — serving without it.")
281
+ note("Comment sync needs a newer lecodes-design (run: lecodes update) — serving without it.")
282
282
  return null
283
283
  }
284
284
  let failures = 0
@@ -67,7 +67,7 @@ export const loadDesignServer = async (ctx: DesignContext, needs: (keyof DesignS
67
67
  const missing = needs.filter((name) => typeof mod[name] !== "function")
68
68
  if (missing.length) {
69
69
  throw new CliError(
70
- `This needs a newer lecodes-design — the installed one has no \`${missing[0]}\`. Run: npm install -g lecodes-design@latest`)
70
+ `This needs a newer lecodes-design — the installed one has no \`${missing[0]}\`. Run: lecodes update`)
71
71
  }
72
72
  return mod
73
73
  }
@@ -104,7 +104,7 @@ const serve = async (flags: FlagValues<typeof serveFlags>): Promise<void> => {
104
104
 
105
105
  log(`${c.bold("LeCodes Design")} — ${ctx.name}`)
106
106
  log(`Canvas: ${c.bold(server.url)}`)
107
- log(`MCP: ${c.bold(server.url + "/mcp")}${renderer ? "" : c.dim(" (render_screen off — npm install -g lecodes-headless)")}`)
107
+ log(`MCP: ${c.bold(server.url + "/mcp")}${renderer ? "" : c.dim(" (render_screen off — lecodes-headless is not installed: `lecodes render` installs it)")}`)
108
108
  log(`Watching: ${ctx.dirName}/ (screens hot-reload on save; Ctrl+C to stop)`)
109
109
  if (sync) log(`Comments: ${c.dim("in sync with the platform — replies and resolves go back automatically")}`)
110
110
  if (!flags["no-open"]) openBrowser(server.url)