@vincentt-xr/sdk 2.0.0-alpha.3 → 2.0.0-alpha.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.
- package/GROUNDING.md +33 -0
- package/dist/{DebuggerUI-xp4bg3gH.js → DebuggerUI-DhKTXTY2.js} +1 -1
- package/dist/{DebuggerUI-B45_Gb9d.cjs → DebuggerUI-bnGHSSOb.cjs} +1 -1
- package/dist/{FaceMeshRenderer-CALA4k49.js → FaceMeshRenderer-B2i2NW71.js} +3 -3
- package/dist/{FaceMeshRenderer-D4PFqsb3.cjs → FaceMeshRenderer-BSOq1OnG.cjs} +1 -1
- package/dist/{FaceRetouch-DF5UsOsZ.js → FaceRetouch-Bg-OBU4n.js} +4 -4
- package/dist/{FaceRetouch-Bq2rtPlV.cjs → FaceRetouch-TZeBGIqW.cjs} +1 -1
- package/dist/{contexts-D5TQcwmv.js → contexts-B2_NsTnk.js} +3 -3
- package/dist/{contexts-Dv1SA0bS.cjs → contexts-BgWfyxre.cjs} +1 -1
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +10 -10
- package/dist/entries/low-level.d.ts +2 -0
- package/dist/face-effects.cjs +1 -1
- package/dist/face-effects.js +4 -4
- package/dist/{getFaceInfo-Cjcgcc4w.js → getFaceInfo-4DhcPZDJ.js} +1 -1
- package/dist/{getFaceInfo-oQcP40Ha.cjs → getFaceInfo-QOQ_dc-W.cjs} +1 -1
- package/dist/hooks/selectors.d.ts +2 -4
- package/dist/hooks/useXRSession/reason.d.ts +19 -0
- package/dist/hooks/useXRSession/store.d.ts +12 -4
- package/dist/{index-N7C6fNah.js → index-72Wb15Ca.js} +1 -1
- package/dist/{index-JygePOwo.js → index-BMeBJ0dV.js} +322 -299
- package/dist/{index-UU5ODHGU.cjs → index-C9yQVzAh.cjs} +1 -1
- package/dist/{index-DdWBnI7A.cjs → index-CNGzE49z.cjs} +1 -1
- package/dist/{index-DpVIEBHw.js → index-Cj3fGDtZ.js} +8 -8
- package/dist/{index-YMUaJU7U.js → index-D1kj6uc-.js} +1 -1
- package/dist/{index-D4bLzBr6.cjs → index-Da7uycur.cjs} +1 -1
- package/dist/{index-Be-S7uSm.cjs → index-WPPnlFO1.cjs} +1 -1
- package/dist/{index-DqhqBi7O.cjs → index-ZaDEzDtR.cjs} +1 -1
- package/dist/{index-HxT9XEuh.js → index-g250Tqme.js} +1 -1
- package/dist/{internal-D7NxAsc6.js → internal-34pb7djs.js} +3 -3
- package/dist/{internal-i2JkM85N.cjs → internal-Dtvo4WYo.cjs} +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +11 -11
- package/dist/main.cjs +1 -1
- package/dist/main.js +12 -12
- package/dist/{renderGroups-JEXqSACh.js → renderGroups-CPWUX6z9.js} +1 -1
- package/dist/{renderGroups-uXXsFpvw.cjs → renderGroups-jSUOY1Oq.cjs} +1 -1
- package/dist/{renderPasses-CdGZeHHL.js → renderPasses-CLlYRdMk.js} +4 -4
- package/dist/{renderPasses-CVWt0t8m.cjs → renderPasses-KUJUSevp.cjs} +1 -1
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/{selectors-twqYByYZ.js → selectors-DLxL8Q66.js} +1 -1
- package/dist/{selectors-2QvO5RYY.cjs → selectors-S8g25ke9.cjs} +1 -1
- package/dist/{session-C1StwN0f.js → session-CbtvwiaD.js} +1 -1
- package/dist/{session-BChR4TgK.cjs → session-DP8AF7Rg.cjs} +1 -1
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +9 -9
- package/dist/{useFaceInfo-DSUmuzzO.cjs → useFaceInfo-BvZeUBsL.cjs} +1 -1
- package/dist/{useFaceInfo-DOJCGlDG.js → useFaceInfo-C06EyScd.js} +3 -3
- package/dist/{useFaceResults-CBmhT5E8.js → useFaceResults-C1Ppc8rS.js} +1 -1
- package/dist/{useFaceResults-B1BSGUAW.cjs → useFaceResults-CCNiH7VZ.cjs} +1 -1
- package/package.json +2 -1
package/dist/debug-ui.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const De=require("./session-BChR4TgK.cjs"),On=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),u=require("react"),We=require("./renderGroups-uXXsFpvw.cjs"),$=require("./renderPasses-CVWt0t8m.cjs"),pe=require("react-dom"),$n=require("three"),X=require("./FaceMeshRenderer-D4PFqsb3.cjs"),Z=require("./FaceRetouch-Bq2rtPlV.cjs"),An=require("./index-UU5ODHGU.cjs"),Dn=require("./index-Be-S7uSm.cjs"),At=require("@react-three/drei"),Bn=require("@react-three/fiber"),Dt=require("./index-DdWBnI7A.cjs"),Pn=require("./contexts-Dv1SA0bS.cjs"),Vn=require("./selectors-2QvO5RYY.cjs"),Hn={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Kn={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},_n=306,Gn=()=>({x:typeof window>"u"?14:window.innerWidth-(_n+20),y:30}),Un={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Xn={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},Zn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},Yn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},qn={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},Jn={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Qn={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},es={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},ts={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},ns=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),ss={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},ls={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},is=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),os=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),rs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),as=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),ds=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),cs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),ps=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)},ut=({children:t,copyConfig:n,initialPosition:l,layer:s="Default Layer",objectId:a,objectName:d,onObjectNameChange:o,onPositionChange:r,onVisibleChange:y,position:p,title:x,visible:c})=>{const[g,h]=u.useState(l??Gn),i=p??g,[b,j]=u.useState(!1),[k,C]=u.useState(!0),L=d??x??a??"Scene Object",[S,w]=u.useState(!1),[O,T]=u.useState(L),B=u.useRef(null);u.useEffect(()=>{S||T(L)},[L,S]),u.useEffect(()=>{const M=ye=>{if(!B.current)return;const N={x:Math.max(8,ye.clientX-B.current.x),y:Math.max(8,ye.clientY-B.current.y)};h(N),r==null||r(N)},I=()=>{B.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",M),window.addEventListener("pointerup",I),()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",I)}},[r]);const _=M=>{const I=M.currentTarget.getBoundingClientRect();B.current={x:M.clientX-I.left,y:M.clientY-I.top},document.body.classList.add("select-none"),M.currentTarget.setPointerCapture(M.pointerId)},he=async()=>{try{await ps(JSON.stringify(n,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},te=()=>{const M=O.trim();if(w(!1),!o||!M||M===L){T(L);return}o(M)},xe=()=>{T(L),w(!1)};return typeof document>"u"?null:pe.createPortal(e.jsx("div",{style:{...Hn,left:i.x,top:i.y},children:e.jsxs("div",{style:Kn,children:[e.jsxs("div",{style:Un,children:[e.jsxs("div",{style:Xn,children:[e.jsx("div",{onPointerDown:_,style:Jn,children:e.jsx(is,{})}),e.jsx("span",{style:qn,children:e.jsx(os,{})}),S?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:Yn,value:O,onBlur:te,onChange:M=>T(M.currentTarget.value),onKeyDown:M=>{M.key==="Enter"&&te(),M.key==="Escape"&&xe()}}):e.jsx("button",{type:"button",style:{...Zn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&w(!0)},children:L}),e.jsx("button",{type:"button","aria-label":k?"Fold Inspector":"Expand Inspector",title:k?"Fold Inspector":"Expand Inspector",style:ss,onClick:()=>C(M=>!M),children:k?e.jsx(ds,{}):e.jsx(cs,{})})]}),k?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:ls,children:s}),e.jsxs("div",{style:es,children:[e.jsx("button",{type:"button",style:ts,onClick:he,children:b?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:ns(c),onClick:()=>y(!c),children:c?e.jsx(rs,{}):e.jsx(as,{})})]})]}):null]}),k?e.jsx("div",{style:Qn,children:t}):null]})}),document.body)},hs={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},xs=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],ys=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],us={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},gs=()=>({color:"#000000",opacity:1,width:30}),zt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),hn=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),xn=()=>({preset:"arc",strength:100}),bs=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],fs=(t,n)=>{const l=hs[n],s=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:n,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:s,shadowLayers:a}}},yn=(t,n)=>({enabled:(n==null?void 0:n.enabled)??t.enabled,showGuides:(n==null?void 0:n.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(n==null?void 0:n.position)??t.position,size:(n==null?void 0:n.size)??t.size,rotation:(n==null?void 0:n.rotation)??t.rotation,scale2D:n==null?void 0:n.scale2D,referencePixelsPerUnit:n==null?void 0:n.referencePixelsPerUnit,pivot:(n==null?void 0:n.pivot)??t.pivot,renderOrder:(n==null?void 0:n.renderOrder)??t.renderOrder,overlay:(n==null?void 0:n.overlay)??t.overlay,visible:(n==null?void 0:n.visible)??t.visible}),js=(t,n)=>({...n,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),un=(t,n)=>({...$.DEFAULT_SCREEN_TRANSFORM_2D,...n,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(n==null?void 0:n.scale2D)??$.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(n==null?void 0:n.referencePixelsPerUnit)??$.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ms={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Ss={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},ws={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ks={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},vs={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Cs=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Rs={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},R={display:"flex",flexDirection:"column",gap:4},q={...R,gridColumn:"1 / -1"},Es={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},Is={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},zs={display:"flex",alignItems:"center",gap:6,minWidth:0},Ts={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},m={fontSize:9,color:"rgba(226,232,240,0.72)"},Wt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ms={...Wt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Wt,padding:2,cursor:"pointer"},de={...Wt,appearance:"none"},Ws={opacity:.45,cursor:"not-allowed"},ce={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},it={width:16,height:16},Fs={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},He=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),yt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Ls({label:t,icon:n,open:l,onToggle:s,children:a}){return e.jsxs("div",{style:Ss,children:[e.jsxs("div",{style:ws,children:[e.jsx("button",{type:"button",onClick:s,style:vs,children:e.jsx("div",{style:Cs(l)})}),e.jsxs("div",{style:ks,children:[e.jsx("span",{style:ms,children:n}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Rs,children:a}):null]})}const Bt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),Pt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Ns=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Os=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function $s({value:t,onChange:n}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Text"}),e.jsx("textarea",{style:Ms,value:t.content.text,onChange:l=>n(s=>({...s,content:{...s.content,text:l.target.value}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Text Art"}),e.jsx("select",{style:de,value:t.textArtPreset,onChange:l=>n(s=>fs(s,l.target.value)),children:ys.map(l=>e.jsx("option",{value:l,children:us[l]},l))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Font"}),e.jsx("select",{style:de,value:t.style.fontFamily,onChange:l=>n(s=>({...s,style:{...s.style,fontFamily:l.target.value}})),children:xs.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const As={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},Ds=t=>/^-?\d*(\.\d*)?$/.test(t),F=({value:t,onChange:n,step:l=1,min:s,max:a,disabled:d=!1})=>{const[o,r]=u.useState(String(t));u.useEffect(()=>r(String(t)),[t]);const y=p=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof s=="number"?s:-1/0,p));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...As,...d?{cursor:"not-allowed",opacity:.45}:{}},value:o,disabled:d,onChange:p=>{if(d)return;const x=p.target.value;if(!Ds(x)||(r(x),["","-",".","-."].includes(x)))return;const c=Number(x);Number.isNaN(c)||n(y(c))},onBlur:()=>{if(d)return;const p=Number(o);if(Number.isNaN(p))return r(String(t));const x=y(p);r(String(x)),n(x)},onKeyDown:p=>{if(d||p.key!=="ArrowUp"&&p.key!=="ArrowDown")return;p.preventDefault();const x=p.shiftKey?l*10:p.altKey?l/10:l,c=p.key==="ArrowUp"?t+x:t-x;n(y(Number.isInteger(c)?c:Number(c.toFixed(6))))}})};function Bs({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Fill Mode"}),e.jsxs("select",{style:de,value:t.fillMode,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Fill Area"}),e.jsxs("select",{style:de,value:t.fit,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,s)=>e.jsxs("label",{style:R,children:[e.jsxs("span",{style:m,children:["Gradient ",s+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>n(d=>{const o=[...d.style.background.gradientStops];return o[s]={...o[s],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:o}}}})}),e.jsx(F,{value:l.position,min:0,max:1,step:.05,onChange:a=>n(d=>{const o=[...d.style.background.gradientStops];return o[s]={...o[s],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:o}}}})})]})]},s))}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Background Opacity"}),e.jsx(F,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Corner Radius"}),e.jsx(F,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderRadius:l}}}))})]})]})}function Ps({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:it,checked:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Width"}),e.jsx(F,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,width:l}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Height"}),e.jsx(F,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,height:l}}}))})]})]})}function Vs({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:it,checked:t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&s.style.background.borderColor==="transparent"?"#ffffff":s.style.background.borderColor,borderWidth:l.target.checked?Math.max(s.style.background.borderWidth,2):s.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Ws},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Stroke Width"}),e.jsx(F,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderWidth:l}}}))})]})]})}const gn={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function ot({checked:t,label:n,onChange:l}){return e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:n}),e.jsx("input",{type:"checkbox",style:it,checked:t,onChange:s=>l(s.target.checked)})]})})}function Be({children:t,label:n,open:l,setOpen:s}){return e.jsxs("div",{style:Es,children:[e.jsxs("button",{type:"button",style:Is,onClick:()=>s(a=>!a),children:[e.jsxs("span",{style:zs,children:[e.jsx(Os,{}),e.jsx("span",{children:n})]}),e.jsx("span",{style:Ts,children:l?"−":"+"})]}),l?t:null]})}function Hs({value:t,onChange:n,open:l,setOpen:s}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:it,checked:a.enabled,onChange:d=>n(o=>({...o,style:{...o.style,background:{...o.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Be,{label:"Background Settings",open:l,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsx(Bs,{background:a,onChange:n}),e.jsx(Vs,{background:a,onChange:n}),e.jsx(Ps,{background:a,onChange:n})]})}):null]})}function Ks({bend:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,bend:{...r.style.bend??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,bendEnabled:o,bend:r.style.bend??xn()}}))}),a.style.bendEnabled===!0?e.jsx(Be,{label:"Bend",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Bend Preset"}),e.jsx("select",{style:de,value:t.preset,onChange:o=>d({preset:o.target.value}),children:bs.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Bend Strength"}),e.jsx(F,{value:t.strength,min:-100,max:100,step:1,onChange:o=>d({strength:o})})]})]})}):null]})}function _s({glow:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,glow:{...r.style.glow??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,glowEnabled:o,glow:r.style.glow??hn()}}))}),a.style.glowEnabled===!0?e.jsx(Be,{label:"Glow",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:o=>d({color:o.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Style"}),e.jsxs("select",{style:de,value:t.style,onChange:o=>d({style:o.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Intensity"}),e.jsx(F,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:o=>d({intensity:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Range"}),e.jsx(F,{value:t.range??.5,min:0,max:1,step:.05,onChange:o=>d({range:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Horizontal Angle"}),e.jsx(F,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:o=>d({horizontalAngle:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Vertical Angle"}),e.jsx(F,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:o=>d({verticalAngle:o})})]})]})}):null]})}const Gs={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function Us({innerShadow:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,innerShadow:{...r.style.innerShadow??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,innerShadowEnabled:o,innerShadow:r.style.innerShadow??Gs}}))}),a.style.innerShadowEnabled===!0?e.jsx(Be,{label:"Inner Shadow",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:o=>d({color:o.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Opacity"}),e.jsx(F,{value:t.opacity??1,min:0,max:1,step:.05,onChange:o=>d({opacity:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Offset"}),e.jsx(F,{value:t.offset??10,min:0,max:100,step:1,onChange:o=>d({offset:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Angle"}),e.jsx(F,{value:t.angle??-45,min:-180,max:180,step:1,onChange:o=>d({angle:o})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Shadow Feather"}),e.jsx(F,{value:t.feather??0,min:0,max:1,step:.05,onChange:o=>d({feather:o})})]})]})}):null]})}function Xs({layers:t,open:n,onChange:l,setOpen:s,value:a}){const d=(o,r)=>l(y=>{const p=[...y.style.strokeLayers??[]];return p[o]={...p[o],...r},{...y,style:{...y.style,strokeLayers:p}}});return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:o=>l(r=>({...r,style:{...r.style,outlineEnabled:o}}))}),a.style.outlineEnabled!==!1?e.jsx(Be,{label:"Outline Editor",open:n,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ce,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:m,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(o=>({...o,style:{...o.style,strokeLayers:[...o.style.strokeLayers??[],gs()]}})),children:"+"})]}),t.length>0?t.map((o,r)=>e.jsxs("div",{style:gn,children:[e.jsxs("div",{style:ce,children:[e.jsxs("span",{style:m,children:["Outline ",r+1]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(y=>({...y,style:{...y.style,strokeLayers:(y.style.strokeLayers??[]).filter((p,x)=>x!==r)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:o.color,onChange:y=>d(r,{color:y.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Outline Opacity"}),e.jsx(F,{value:o.opacity??1,min:0,max:1,step:.05,onChange:y=>d(r,{opacity:y})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Outline Size"}),e.jsx(F,{value:o.width,min:0,max:100,step:1,onChange:y=>d(r,{width:y})})]})]})]},r)):e.jsx("div",{style:{...m,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function Zs({layers:t,open:n,onChange:l,setOpen:s,value:a}){const d=(o,r)=>l(y=>{const p=[...y.style.shadowLayers??[]];return p[o]={...p[o],...r},{...y,style:{...y.style,shadowLayers:p}}});return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:o=>l(r=>{var y;return{...r,style:{...r.style,shadowEnabled:o,shadowLayers:o&&(((y=r.style.shadowLayers)==null?void 0:y.length)??0)===0?[zt()]:r.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Be,{label:"Shadow Editor",open:n,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ce,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:m,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(o=>({...o,style:{...o.style,shadowLayers:[...o.style.shadowLayers??[],zt()]}})),children:"+"})]}),t.length>0?t.map((o,r)=>e.jsxs("div",{style:gn,children:[e.jsxs("div",{style:ce,children:[e.jsxs("span",{style:m,children:["Shadow ",r+1]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(y=>({...y,style:{...y.style,shadowLayers:(y.style.shadowLayers??[]).filter((p,x)=>x!==r)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:o.color,onChange:y=>d(r,{color:y.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Opacity"}),e.jsx(F,{value:o.opacity??1,min:0,max:1,step:.05,onChange:y=>d(r,{opacity:y})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Offset"}),e.jsx(F,{value:o.offset??10,min:0,max:100,step:1,onChange:y=>d(r,{offset:y})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Angle"}),e.jsx(F,{value:o.angle??-45,min:-180,max:180,step:1,onChange:y=>d(r,{angle:y})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Shadow Feather"}),e.jsx(F,{value:o.feather??0,min:0,max:1,step:.05,onChange:y=>d(r,{feather:y})})]})]})]},r)):e.jsx("div",{style:{...m,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function Ys({backgroundSettingsOpen:t,bend:n,bendSettingsOpen:l,glow:s,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:o,onChange:r,outlineLayers:y,outlineSettingsOpen:p,setBackgroundSettingsOpen:x,setBendSettingsOpen:c,setGlowSettingsOpen:g,setInnerShadowSettingsOpen:h,setOutlineSettingsOpen:i,setShadowSettingsOpen:b,shadowLayers:j,shadowSettingsOpen:k,value:C}){return e.jsxs("div",{style:me,children:[e.jsx(Xs,{value:C,onChange:r,layers:y,open:p,setOpen:i}),e.jsx(Zs,{value:C,onChange:r,layers:j,open:k,setOpen:b}),e.jsx(Us,{value:C,onChange:r,innerShadow:d,open:a,setOpen:g}),e.jsx(_s,{value:C,onChange:r,glow:s,open:o,setOpen:h}),e.jsx(Ks,{value:C,onChange:r,bend:n,open:l,setOpen:c}),e.jsx(Hs,{value:C,onChange:r,open:t,setOpen:x})]})}function qs({value:t,onChange:n}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:s=>n(a=>({...a,style:{...a.style,color:s.target.value}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Font Size"}),e.jsx(F,{value:t.style.fontSize,min:16,max:180,step:4,onChange:s=>n(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??s,s)},style:{...a.style,fontSize:s}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Letter Spacing"}),e.jsx(F,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:s=>n(a=>({...a,style:{...a.style,letterSpacing:s}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Line Spacing"}),e.jsx(F,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:s=>n(a=>({...a,style:{...a.style,lineSpacing:s}}))})]}),e.jsxs("div",{style:q,children:[e.jsx("span",{style:m,children:"Text Style"}),e.jsxs("div",{style:Fs,children:[e.jsx("button",{type:"button",style:He(!l),onClick:()=>n(s=>({...s,style:{...s.style,bold:!1,fontWeight:s.style.fontWeight==="bold"?"normal":s.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:He(t.style.bold===!0),onClick:()=>n(s=>({...s,style:{...s.style,bold:s.style.bold!==!0,fontWeight:s.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:He(t.style.fontStyle==="italic"),onClick:()=>n(s=>({...s,style:{...s.style,fontStyle:s.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:He(t.style.underline===!0),onClick:()=>n(s=>({...s,style:{...s.style,underline:s.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:He(t.style.strikethrough===!0),onClick:()=>n(s=>({...s,style:{...s.style,strikethrough:s.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Horizontal Alignment"}),e.jsxs("select",{style:de,value:t.layout.textAlign??"center",onChange:s=>n(a=>({...a,layout:{...a.layout,textAlign:s.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Vertical Alignment"}),e.jsxs("select",{style:de,value:t.layout.verticalAlign??"center",onChange:s=>n(a=>({...a,layout:{...a.layout,verticalAlign:s.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Overflow"}),e.jsxs("select",{style:de,value:t.layout.overflow,onChange:s=>n(a=>({...a,layout:{...a.layout,overflow:s.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:it,checked:t.layout.resizeToFit===!0,onChange:s=>n(a=>({...a,layout:{...a.layout,resizeToFit:s.target.checked}}))})]})})]})}const Js={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},le={display:"flex",flexDirection:"column",gap:4},bt={...le,gridColumn:"1 / -1"},G={fontSize:9,color:"rgba(226,232,240,0.72)"},Qs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},el={...Qs,fontVariantNumeric:"tabular-nums"},tl={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},nl={width:16,height:16},sl=t=>/^-?\d*(\.\d*)?$/.test(t),Q=({value:t,onChange:n,step:l=1,min:s,max:a,disabled:d=!1})=>{const[o,r]=u.useState(String(t));u.useEffect(()=>r(String(t)),[t]);const y=p=>{let x=p;return typeof s=="number"&&(x=Math.max(s,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:el,value:o,disabled:d,onChange:p=>{const x=p.target.value;if(!sl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||n(y(c))},onBlur:()=>{const p=Number(o);if(Number.isNaN(p)){r(String(t));return}const x=y(p);r(String(x)),n(x)},onKeyDown:p=>{if(p.key!=="ArrowUp"&&p.key!=="ArrowDown")return;p.preventDefault();const x=p.shiftKey?l*10:p.altKey?l/10:l,c=p.key==="ArrowUp"?t+x:t-x;n(y(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},Ft=({value:t,onChange:n,guideLabel:l,showRenderOrder:s=!0})=>{var a,d;return e.jsxs("div",{style:Js,children:[e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Position X"}),e.jsx(Q,{value:t.position.x,min:-4096,max:4096,step:1,onChange:o=>n({...t,position:{...t.position,x:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Position Y"}),e.jsx(Q,{value:t.position.y,min:-4096,max:4096,step:1,onChange:o=>n({...t,position:{...t.position,y:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Size X"}),e.jsx(Q,{value:t.size.width,min:0,max:8192,step:1,onChange:o=>n({...t,size:{...t.size,width:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Size Y"}),e.jsx(Q,{value:t.size.height,min:0,max:8192,step:1,onChange:o=>n({...t,size:{...t.size,height:o}})})]}),e.jsxs("label",{style:bt,children:[e.jsx("span",{style:G,children:"Rotation"}),e.jsx(Q,{value:t.rotation,min:-360,max:360,step:1,onChange:o=>n({...t,rotation:o})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Scale 2D X"}),e.jsx(Q,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:o=>{var r;return n({...t,scale2D:{x:o,y:((r=t.scale2D)==null?void 0:r.y)??1}})}})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Scale 2D Y"}),e.jsx(Q,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:o=>{var r;return n({...t,scale2D:{x:((r=t.scale2D)==null?void 0:r.x)??1,y:o}})}})]}),e.jsxs("label",{style:bt,children:[e.jsx("span",{style:G,children:"Reference Pixels Per Unit"}),e.jsx(Q,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:o=>n({...t,referencePixelsPerUnit:o})})]}),s?e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Render Order"}),e.jsx(Q,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:o=>n({...t,renderOrder:o})})]}):null,e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Pivot X"}),e.jsx(Q,{value:t.pivot[0],min:0,max:1,step:.01,onChange:o=>n({...t,pivot:[o,t.pivot[1]]})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Pivot Y"}),e.jsx(Q,{value:t.pivot[1],min:0,max:1,step:.01,onChange:o=>n({...t,pivot:[t.pivot[0],o]})})]}),e.jsx("label",{style:bt,children:e.jsxs("div",{style:tl,children:[e.jsx("span",{style:G,children:l}),e.jsx("input",{type:"checkbox",style:nl,checked:t.showGuides,onChange:o=>n({...t,showGuides:o.target.checked})})]})})]})};function ll({value:t,onChange:n}){return e.jsx(Ft,{value:yn(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>n(s=>({...s,transformation:js(l,s.transformation),screenTransform:un(l,s.screenTransform)}))})}const il=({value:t,onChange:n,copyLabel:l,inspector:s})=>{var ye;const[a,d]=u.useState(()=>$.createSceneObject({name:l??"Screen Text",renderGroupId:We.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=u.useState(()=>{const N=a.id,f=$.createDefaultComponent("ScreenTransform",N),v=$.createDefaultComponent("ScreenText",N),A=$.createDefaultComponent("Material",N),z=$.createDefaultComponent("Texture",N);return{screenTransform:f,screenText:v,material:A,texture:z}}),[r,y]=u.useState(!0),[p,x]=u.useState(!0),[c,g]=u.useState(!0),[h,i]=u.useState(!0),[b,j]=u.useState(!0),[k,C]=u.useState(!0),[L,S]=u.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),w=yn(t.screenText.transformation,t.screenText.screenTransform),O={object:{...a,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??un(w)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},T=N=>{n({...t,screenText:N(t.screenText)})},B=t.screenText.style.strokeLayers??[],_=t.screenText.style.shadowEnabled!==!1&&(((ye=t.screenText.style.shadowLayers)==null?void 0:ye.length)??0)===0?[zt()]:t.screenText.style.shadowLayers??[],he=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},te=t.screenText.style.glow??hn(),xe=t.screenText.style.bend??xn(),M=N=>S(f=>({...f,[N]:!f[N]})),I=(N,f,v,A)=>e.jsx(Ls,{label:f,icon:v,open:L[N],onToggle:()=>M(N),children:A},N);return e.jsxs(ut,{objectId:(s==null?void 0:s.objectId)??a.id,objectName:(s==null?void 0:s.objectName)??a.name,onObjectNameChange:(s==null?void 0:s.onObjectNameChange)??(N=>d(f=>({...f,name:N}))),layer:(s==null?void 0:s.layer)??"Default Layer",visible:(s==null?void 0:s.visible)??t.screenText.enabled,onVisibleChange:(s==null?void 0:s.onVisibleChange)??(N=>T(f=>({...f,enabled:N}))),copyConfig:(s==null?void 0:s.copyConfig)??O,initialPosition:s==null?void 0:s.initialPosition,position:s==null?void 0:s.position,onPositionChange:s==null?void 0:s.onPositionChange,title:s==null?void 0:s.title,children:[I("transformation","Transformation",e.jsx(Ns,{}),e.jsx(ll,{value:t.screenText,onChange:T})),I("text2d","2D Text",e.jsx(Bt,{}),e.jsxs(e.Fragment,{children:[I("content","Content",e.jsx(Bt,{}),e.jsx($s,{value:t.screenText,onChange:T})),I("style","Style",e.jsx(Pt,{}),e.jsx(qs,{value:t.screenText,onChange:T})),I("textEffect","Text Effect",e.jsx(Pt,{}),e.jsx(Ys,{value:t.screenText,onChange:T,outlineLayers:B,shadowLayers:_,innerShadow:he,glow:te,bend:xe,outlineSettingsOpen:r,setOutlineSettingsOpen:y,shadowSettingsOpen:p,setShadowSettingsOpen:x,innerShadowSettingsOpen:c,setInnerShadowSettingsOpen:g,glowSettingsOpen:h,setGlowSettingsOpen:i,bendSettingsOpen:b,setBendSettingsOpen:j,backgroundSettingsOpen:k,setBackgroundSettingsOpen:C}))]}))]})},ol="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",rl={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},al=Object.entries(rl).map(([t,n])=>({value:t,label:n})),dl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:ol,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},cl=(t,n)=>{const l=dl[n];return{...t,preset:n,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},pl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},et={display:"flex",flexDirection:"column",gap:4},hl={...et,gridColumn:"1 / -1"},Ke={fontSize:9,color:"rgba(226,232,240,0.72)"},Lt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Vt={...Lt,appearance:"none"},xl={...Lt,fontVariantNumeric:"tabular-nums"},yl={...Lt,padding:2,cursor:"pointer"},ul=t=>/^-?\d*(\.\d*)?$/.test(t),Ht=({value:t,onChange:n,step:l=1,min:s,max:a})=>{const[d,o]=u.useState(String(t));u.useEffect(()=>o(String(t)),[t]);const r=y=>{let p=y;return typeof s=="number"&&(p=Math.max(s,p)),typeof a=="number"&&(p=Math.min(a,p)),p};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:xl,value:d,onChange:y=>{const p=y.target.value;if(!ul(p)||(o(p),p===""||p==="-"||p==="."||p==="-."))return;const x=Number(p);Number.isNaN(x)||n(r(x))},onBlur:()=>{const y=Number(d);if(Number.isNaN(y)){o(String(t));return}const p=r(y);o(String(p)),n(p)},onKeyDown:y=>{if(y.key!=="ArrowUp"&&y.key!=="ArrowDown")return;y.preventDefault();const p=y.shiftKey?l*10:y.altKey?l/10:l,x=y.key==="ArrowUp"?t+p:t-p;n(r(Number.isInteger(x)?x:Number(x.toFixed(6))))}})},gl=({value:t,onChange:n})=>e.jsxs("div",{style:pl,children:[e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Material Type"}),e.jsxs("select",{style:Vt,value:t.materialType,onChange:l=>n({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Blend Mode"}),e.jsxs("select",{style:Vt,value:t.blendMode,onChange:l=>n({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Opacity"}),e.jsx(Ht,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>n({...t,opacity:l})})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Tint"}),e.jsx("input",{type:"color",style:yl,value:t.color,onChange:l=>n({...t,color:l.target.value})})]}),e.jsxs("label",{style:hl,children:[e.jsx("span",{style:Ke,children:"Alpha Test"}),e.jsx(Ht,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>n({...t,alphaTest:l})})]})]}),bl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},fl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},jl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ml={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Sl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},wl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),kl={display:"grid",gap:7,padding:"0 7px 7px"},vl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},tt={display:"flex",flexDirection:"column",gap:4},ft={...tt,gridColumn:"1 / -1"},Se={fontSize:9,color:"rgba(226,232,240,0.72)"},bn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},jt={...bn,appearance:"none"},mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},St={width:16,height:16},Cl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Rl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),El=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),Il=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),Kt=(t,n)=>({enabled:(n==null?void 0:n.enabled)??t.enabled,showGuides:(n==null?void 0:n.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(n==null?void 0:n.position)??t.position,size:(n==null?void 0:n.size)??t.size,rotation:(n==null?void 0:n.rotation)??t.rotation,scale2D:n==null?void 0:n.scale2D,referencePixelsPerUnit:n==null?void 0:n.referencePixelsPerUnit,pivot:(n==null?void 0:n.pivot)??t.pivot,renderOrder:(n==null?void 0:n.renderOrder)??t.renderOrder,overlay:(n==null?void 0:n.overlay)??t.overlay,visible:(n==null?void 0:n.visible)??t.visible}),zl=(t,n)=>({...n,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),_t=(t,n)=>({...$.DEFAULT_SCREEN_TRANSFORM_2D,...n,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(n==null?void 0:n.scale2D)??$.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(n==null?void 0:n.referencePixelsPerUnit)??$.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Tl=({value:t,onChange:n,copyLabel:l,inspector:s})=>{const[a,d]=u.useState(()=>$.createSceneObject({name:l??"Screen Image",renderGroupId:We.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=u.useState(()=>{const h=a.id,i=$.createDefaultComponent("ScreenTransform",h),b=$.createDefaultComponent("ScreenImage",h),j=$.createDefaultComponent("Material",h),k=$.createDefaultComponent("Texture",h);return{screenTransform:i,screenImage:b,material:j,texture:k}}),[r,y]=u.useState({transformation:!0,image:!0,material:!0}),p=Kt(t.screenImage.transformation,t.screenImage.screenTransform),x={object:{...a,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??_t(p)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},c=h=>{n({...t,screenImage:h(t.screenImage)})},g=(h,i,b,j)=>e.jsxs("div",{style:fl,children:[e.jsxs("div",{style:jl,children:[e.jsx("button",{type:"button",onClick:()=>y(k=>({...k,[h]:!k[h]})),style:Sl,children:e.jsx("div",{style:wl(r[h])})}),e.jsxs("div",{style:ml,children:[e.jsx("span",{style:bl,children:b}),e.jsx("span",{children:i})]})]}),r[h]?e.jsx("div",{style:kl,children:j}):null]},h);return e.jsxs(ut,{objectId:(s==null?void 0:s.objectId)??a.id,objectName:(s==null?void 0:s.objectName)??a.name,onObjectNameChange:(s==null?void 0:s.onObjectNameChange)??(h=>d(i=>({...i,name:h}))),layer:(s==null?void 0:s.layer)??"Default Layer",visible:(s==null?void 0:s.visible)??t.screenImage.enabled,onVisibleChange:(s==null?void 0:s.onVisibleChange)??(h=>c(i=>({...i,enabled:h}))),copyConfig:(s==null?void 0:s.copyConfig)??x,initialPosition:s==null?void 0:s.initialPosition,position:s==null?void 0:s.position,onPositionChange:s==null?void 0:s.onPositionChange,title:s==null?void 0:s.title,children:[g("transformation","Transformation",e.jsx(El,{}),e.jsx(Ft,{value:Kt(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:h=>c(i=>({...i,transformation:zl(h,i.transformation),screenTransform:_t(h,i.screenTransform)}))})),g("image","Image",e.jsx(Rl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Preset"}),e.jsx("select",{style:jt,value:t.screenImage.preset,onChange:h=>c(i=>cl(i,h.target.value)),children:al.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))})]}),e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Source Kind"}),e.jsx("select",{style:jt,value:t.screenImage.image.sourceKind,onChange:h=>c(i=>({...i,image:{...i.image,sourceKind:h.target.value}})),children:Cl.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Source URL"}),e.jsx("input",{style:bn,value:t.screenImage.image.src,onChange:h=>c(i=>({...i,image:{...i.image,src:h.target.value}}))})]}):null,e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Stretch Mode"}),e.jsxs("select",{style:jt,value:t.screenImage.image.stretchMode,onChange:h=>c(i=>({...i,image:{...i.image,stretchMode:h.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.flipX,onChange:h=>c(i=>({...i,image:{...i.image,flipX:h.target.checked}}))})]})}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.flipY,onChange:h=>c(i=>({...i,image:{...i.image,flipY:h.target.checked}}))})]})})]})),g("material","Material",e.jsx(Il,{}),e.jsxs("div",{style:vl,children:[e.jsx(gl,{value:t.screenImage.image,onChange:h=>c(i=>({...i,image:{...i.image,materialType:h.materialType,blendMode:h.blendMode,opacity:h.opacity,color:h.color,alphaTest:h.alphaTest}}))}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.transparent,onChange:h=>c(i=>({...i,image:{...i.image,transparent:h.target.checked}}))})]})})]}))]})},$e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},Me={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Ml=({onChange:t,value:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[n.map((l,s)=>e.jsxs("div",{style:$e,children:[e.jsx("input",{"aria-label":`Gradient stop ${s+1} color`,type:"color",style:{...Me,padding:2},value:l.color,onChange:a=>t(n.map((d,o)=>o===s?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${s+1} position`,type:"number",min:0,max:1,step:.05,style:Me,value:l.offset,onChange:a=>t(n.map((d,o)=>o===s?{...d,offset:Number(a.currentTarget.value)}:d))}),n.length>2?e.jsx("button",{type:"button",onClick:()=>t(n.filter((a,d)=>d!==s)),children:"−"}):null]})]},`${s}-${l.color}`)),n.length<X.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...n,{offset:.5,color:((l=n[n.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),fn=({onChange:t,value:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:Me,value:n.type,onChange:l=>t({...n,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Ml,{value:n.stops,onChange:l=>t({...n,stops:l})}),n.type!=="radial"?e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:Me,step:5,value:n.angle,onChange:l=>t({...n,angle:Number(l.currentTarget.value)})})]}):null,n.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:Me,min:0,max:1,step:.05,value:n.center.x,onChange:l=>t({...n,center:{...n.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:Me,min:0,max:1,step:.05,value:n.center.y,onChange:l=>t({...n,center:{...n.center,y:Number(l.currentTarget.value)}})})]})]}):null,n.type==="radial"?e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:Me,min:.01,step:.05,value:n.radius,onChange:l=>t({...n,radius:Number(l.currentTarget.value)})})]}):null]}),Gt={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},Ut={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},jn=({value:t,onChange:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:Gt,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...Ut,padding:2},value:t.tint,onChange:l=>n({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:Gt,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:Ut,min:0,max:1,step:.05,value:t[l],onChange:s=>n({...t,[l]:Number(s.currentTarget.value)})})]},l))]}),Wl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ae={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},nt={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ne=({label:t,onValue:n,...l})=>e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:nt,onChange:s=>n(Number(s.currentTarget.value))})]}),mn=({value:t,onChange:n})=>e.jsxs("section",{style:Wl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:nt,value:t.kind,onChange:l=>n({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:nt,value:t.fillMode,onChange:l=>n({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(fn,{value:t.gradient,onChange:l=>n({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(jn,{value:t.glass,onChange:l=>n({...t,glass:l})}):e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...nt,padding:2},value:t.fillColor,onChange:l=>n({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ne,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>n({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...nt,padding:2},value:t.strokeColor,onChange:l=>n({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ne,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>n({...t,strokeWidth:l})}),e.jsx(ne,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>n({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>n({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ne,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>n({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ne,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>n({...t,sides:l})}):null,t.kind==="star"?e.jsx(ne,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>n({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ne,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>n({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ne,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>n({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ne,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>n({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ne,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>n({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Fl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Ll={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Sn={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Nl={...Sn,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Ol={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},$l={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Al={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},Xt={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Dl={display:"grid",gap:6,padding:7},Bl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Pl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Vl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Hl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Kl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),_l={display:"grid",gap:7,padding:"0 7px 7px"},Gl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Te={display:"flex",flexDirection:"column",gap:4},_e={...Te,gridColumn:"1 / -1"},ee={fontSize:9,color:"rgba(226,232,240,0.72)"},Le={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ge={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ue={width:16,height:16},Zt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Ul=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),Xl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Zl=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Yl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),ql=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:14,y:104}),[o,r]=u.useState(typeof window>"u"?0:window.innerHeight),[y,p]=u.useState({overlay:!0,visibility:!1}),x=u.useRef(null),c=Math.max(240,o-a.y-16);u.useEffect(()=>{const i=j=>{x.current&&d({x:Math.max(8,j.clientX-x.current.x),y:Math.max(8,j.clientY-x.current.y)})},b=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",b)}},[]),u.useEffect(()=>{const i=()=>r(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const g=i=>{const b=i.currentTarget.getBoundingClientRect();x.current={x:i.clientX-b.left,y:i.clientY-b.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},h=(i,b,j,k)=>e.jsxs("div",{style:Bl,children:[e.jsxs("div",{style:Pl,children:[e.jsx("button",{type:"button",onClick:()=>p(C=>({...C,[i]:!C[i]})),style:Hl,children:e.jsx("div",{style:Kl(y[i])})}),e.jsxs("div",{style:Vl,children:[e.jsx("span",{style:Xt,children:j}),e.jsx("span",{children:b})]})]}),y[i]?e.jsx("div",{style:_l,children:k}):null]},i);return typeof document>"u"?null:pe.createPortal(e.jsxs("div",{style:{...Ll,left:a.x,top:a.y},children:[e.jsx("style",{children:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const De=require("./session-DP8AF7Rg.cjs"),On=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),u=require("react"),We=require("./renderGroups-jSUOY1Oq.cjs"),$=require("./renderPasses-KUJUSevp.cjs"),pe=require("react-dom"),$n=require("three"),X=require("./FaceMeshRenderer-BSOq1OnG.cjs"),Z=require("./FaceRetouch-TZeBGIqW.cjs"),An=require("./index-C9yQVzAh.cjs"),Dn=require("./index-WPPnlFO1.cjs"),At=require("@react-three/drei"),Bn=require("@react-three/fiber"),Dt=require("./index-CNGzE49z.cjs"),Pn=require("./contexts-BgWfyxre.cjs"),Vn=require("./selectors-S8g25ke9.cjs"),Hn={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Kn={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},_n=306,Gn=()=>({x:typeof window>"u"?14:window.innerWidth-(_n+20),y:30}),Un={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Xn={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},Zn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},Yn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},qn={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},Jn={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Qn={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},es={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},ts={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},ns=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),ss={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},ls={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},is=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),os=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),rs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),as=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),ds=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),cs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),ps=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)},ut=({children:t,copyConfig:n,initialPosition:l,layer:s="Default Layer",objectId:a,objectName:d,onObjectNameChange:o,onPositionChange:r,onVisibleChange:y,position:p,title:x,visible:c})=>{const[g,h]=u.useState(l??Gn),i=p??g,[b,j]=u.useState(!1),[k,C]=u.useState(!0),L=d??x??a??"Scene Object",[S,w]=u.useState(!1),[O,T]=u.useState(L),B=u.useRef(null);u.useEffect(()=>{S||T(L)},[L,S]),u.useEffect(()=>{const M=ye=>{if(!B.current)return;const N={x:Math.max(8,ye.clientX-B.current.x),y:Math.max(8,ye.clientY-B.current.y)};h(N),r==null||r(N)},I=()=>{B.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",M),window.addEventListener("pointerup",I),()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",I)}},[r]);const _=M=>{const I=M.currentTarget.getBoundingClientRect();B.current={x:M.clientX-I.left,y:M.clientY-I.top},document.body.classList.add("select-none"),M.currentTarget.setPointerCapture(M.pointerId)},he=async()=>{try{await ps(JSON.stringify(n,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},te=()=>{const M=O.trim();if(w(!1),!o||!M||M===L){T(L);return}o(M)},xe=()=>{T(L),w(!1)};return typeof document>"u"?null:pe.createPortal(e.jsx("div",{style:{...Hn,left:i.x,top:i.y},children:e.jsxs("div",{style:Kn,children:[e.jsxs("div",{style:Un,children:[e.jsxs("div",{style:Xn,children:[e.jsx("div",{onPointerDown:_,style:Jn,children:e.jsx(is,{})}),e.jsx("span",{style:qn,children:e.jsx(os,{})}),S?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:Yn,value:O,onBlur:te,onChange:M=>T(M.currentTarget.value),onKeyDown:M=>{M.key==="Enter"&&te(),M.key==="Escape"&&xe()}}):e.jsx("button",{type:"button",style:{...Zn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&w(!0)},children:L}),e.jsx("button",{type:"button","aria-label":k?"Fold Inspector":"Expand Inspector",title:k?"Fold Inspector":"Expand Inspector",style:ss,onClick:()=>C(M=>!M),children:k?e.jsx(ds,{}):e.jsx(cs,{})})]}),k?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:ls,children:s}),e.jsxs("div",{style:es,children:[e.jsx("button",{type:"button",style:ts,onClick:he,children:b?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:ns(c),onClick:()=>y(!c),children:c?e.jsx(rs,{}):e.jsx(as,{})})]})]}):null]}),k?e.jsx("div",{style:Qn,children:t}):null]})}),document.body)},hs={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},xs=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],ys=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],us={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},gs=()=>({color:"#000000",opacity:1,width:30}),zt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),hn=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),xn=()=>({preset:"arc",strength:100}),bs=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],fs=(t,n)=>{const l=hs[n],s=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:n,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:s,shadowLayers:a}}},yn=(t,n)=>({enabled:(n==null?void 0:n.enabled)??t.enabled,showGuides:(n==null?void 0:n.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(n==null?void 0:n.position)??t.position,size:(n==null?void 0:n.size)??t.size,rotation:(n==null?void 0:n.rotation)??t.rotation,scale2D:n==null?void 0:n.scale2D,referencePixelsPerUnit:n==null?void 0:n.referencePixelsPerUnit,pivot:(n==null?void 0:n.pivot)??t.pivot,renderOrder:(n==null?void 0:n.renderOrder)??t.renderOrder,overlay:(n==null?void 0:n.overlay)??t.overlay,visible:(n==null?void 0:n.visible)??t.visible}),js=(t,n)=>({...n,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),un=(t,n)=>({...$.DEFAULT_SCREEN_TRANSFORM_2D,...n,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(n==null?void 0:n.scale2D)??$.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(n==null?void 0:n.referencePixelsPerUnit)??$.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ms={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Ss={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},ws={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ks={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},vs={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Cs=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Rs={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},R={display:"flex",flexDirection:"column",gap:4},q={...R,gridColumn:"1 / -1"},Es={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},Is={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},zs={display:"flex",alignItems:"center",gap:6,minWidth:0},Ts={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},m={fontSize:9,color:"rgba(226,232,240,0.72)"},Wt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ms={...Wt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Wt,padding:2,cursor:"pointer"},de={...Wt,appearance:"none"},Ws={opacity:.45,cursor:"not-allowed"},ce={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},it={width:16,height:16},Fs={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},He=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),yt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Ls({label:t,icon:n,open:l,onToggle:s,children:a}){return e.jsxs("div",{style:Ss,children:[e.jsxs("div",{style:ws,children:[e.jsx("button",{type:"button",onClick:s,style:vs,children:e.jsx("div",{style:Cs(l)})}),e.jsxs("div",{style:ks,children:[e.jsx("span",{style:ms,children:n}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Rs,children:a}):null]})}const Bt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),Pt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Ns=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Os=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function $s({value:t,onChange:n}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Text"}),e.jsx("textarea",{style:Ms,value:t.content.text,onChange:l=>n(s=>({...s,content:{...s.content,text:l.target.value}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Text Art"}),e.jsx("select",{style:de,value:t.textArtPreset,onChange:l=>n(s=>fs(s,l.target.value)),children:ys.map(l=>e.jsx("option",{value:l,children:us[l]},l))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Font"}),e.jsx("select",{style:de,value:t.style.fontFamily,onChange:l=>n(s=>({...s,style:{...s.style,fontFamily:l.target.value}})),children:xs.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const As={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},Ds=t=>/^-?\d*(\.\d*)?$/.test(t),F=({value:t,onChange:n,step:l=1,min:s,max:a,disabled:d=!1})=>{const[o,r]=u.useState(String(t));u.useEffect(()=>r(String(t)),[t]);const y=p=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof s=="number"?s:-1/0,p));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...As,...d?{cursor:"not-allowed",opacity:.45}:{}},value:o,disabled:d,onChange:p=>{if(d)return;const x=p.target.value;if(!Ds(x)||(r(x),["","-",".","-."].includes(x)))return;const c=Number(x);Number.isNaN(c)||n(y(c))},onBlur:()=>{if(d)return;const p=Number(o);if(Number.isNaN(p))return r(String(t));const x=y(p);r(String(x)),n(x)},onKeyDown:p=>{if(d||p.key!=="ArrowUp"&&p.key!=="ArrowDown")return;p.preventDefault();const x=p.shiftKey?l*10:p.altKey?l/10:l,c=p.key==="ArrowUp"?t+x:t-x;n(y(Number.isInteger(c)?c:Number(c.toFixed(6))))}})};function Bs({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Fill Mode"}),e.jsxs("select",{style:de,value:t.fillMode,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Fill Area"}),e.jsxs("select",{style:de,value:t.fit,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,s)=>e.jsxs("label",{style:R,children:[e.jsxs("span",{style:m,children:["Gradient ",s+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>n(d=>{const o=[...d.style.background.gradientStops];return o[s]={...o[s],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:o}}}})}),e.jsx(F,{value:l.position,min:0,max:1,step:.05,onChange:a=>n(d=>{const o=[...d.style.background.gradientStops];return o[s]={...o[s],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:o}}}})})]})]},s))}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Background Opacity"}),e.jsx(F,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Corner Radius"}),e.jsx(F,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderRadius:l}}}))})]})]})}function Ps({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:it,checked:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Width"}),e.jsx(F,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,width:l}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Height"}),e.jsx(F,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,height:l}}}))})]})]})}function Vs({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:it,checked:t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&s.style.background.borderColor==="transparent"?"#ffffff":s.style.background.borderColor,borderWidth:l.target.checked?Math.max(s.style.background.borderWidth,2):s.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Ws},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Stroke Width"}),e.jsx(F,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderWidth:l}}}))})]})]})}const gn={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function ot({checked:t,label:n,onChange:l}){return e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:n}),e.jsx("input",{type:"checkbox",style:it,checked:t,onChange:s=>l(s.target.checked)})]})})}function Be({children:t,label:n,open:l,setOpen:s}){return e.jsxs("div",{style:Es,children:[e.jsxs("button",{type:"button",style:Is,onClick:()=>s(a=>!a),children:[e.jsxs("span",{style:zs,children:[e.jsx(Os,{}),e.jsx("span",{children:n})]}),e.jsx("span",{style:Ts,children:l?"−":"+"})]}),l?t:null]})}function Hs({value:t,onChange:n,open:l,setOpen:s}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:it,checked:a.enabled,onChange:d=>n(o=>({...o,style:{...o.style,background:{...o.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Be,{label:"Background Settings",open:l,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsx(Bs,{background:a,onChange:n}),e.jsx(Vs,{background:a,onChange:n}),e.jsx(Ps,{background:a,onChange:n})]})}):null]})}function Ks({bend:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,bend:{...r.style.bend??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,bendEnabled:o,bend:r.style.bend??xn()}}))}),a.style.bendEnabled===!0?e.jsx(Be,{label:"Bend",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Bend Preset"}),e.jsx("select",{style:de,value:t.preset,onChange:o=>d({preset:o.target.value}),children:bs.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Bend Strength"}),e.jsx(F,{value:t.strength,min:-100,max:100,step:1,onChange:o=>d({strength:o})})]})]})}):null]})}function _s({glow:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,glow:{...r.style.glow??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,glowEnabled:o,glow:r.style.glow??hn()}}))}),a.style.glowEnabled===!0?e.jsx(Be,{label:"Glow",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:o=>d({color:o.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Style"}),e.jsxs("select",{style:de,value:t.style,onChange:o=>d({style:o.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Intensity"}),e.jsx(F,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:o=>d({intensity:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Range"}),e.jsx(F,{value:t.range??.5,min:0,max:1,step:.05,onChange:o=>d({range:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Horizontal Angle"}),e.jsx(F,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:o=>d({horizontalAngle:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Vertical Angle"}),e.jsx(F,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:o=>d({verticalAngle:o})})]})]})}):null]})}const Gs={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function Us({innerShadow:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,innerShadow:{...r.style.innerShadow??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,innerShadowEnabled:o,innerShadow:r.style.innerShadow??Gs}}))}),a.style.innerShadowEnabled===!0?e.jsx(Be,{label:"Inner Shadow",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:o=>d({color:o.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Opacity"}),e.jsx(F,{value:t.opacity??1,min:0,max:1,step:.05,onChange:o=>d({opacity:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Offset"}),e.jsx(F,{value:t.offset??10,min:0,max:100,step:1,onChange:o=>d({offset:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Angle"}),e.jsx(F,{value:t.angle??-45,min:-180,max:180,step:1,onChange:o=>d({angle:o})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Shadow Feather"}),e.jsx(F,{value:t.feather??0,min:0,max:1,step:.05,onChange:o=>d({feather:o})})]})]})}):null]})}function Xs({layers:t,open:n,onChange:l,setOpen:s,value:a}){const d=(o,r)=>l(y=>{const p=[...y.style.strokeLayers??[]];return p[o]={...p[o],...r},{...y,style:{...y.style,strokeLayers:p}}});return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:o=>l(r=>({...r,style:{...r.style,outlineEnabled:o}}))}),a.style.outlineEnabled!==!1?e.jsx(Be,{label:"Outline Editor",open:n,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ce,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:m,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(o=>({...o,style:{...o.style,strokeLayers:[...o.style.strokeLayers??[],gs()]}})),children:"+"})]}),t.length>0?t.map((o,r)=>e.jsxs("div",{style:gn,children:[e.jsxs("div",{style:ce,children:[e.jsxs("span",{style:m,children:["Outline ",r+1]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(y=>({...y,style:{...y.style,strokeLayers:(y.style.strokeLayers??[]).filter((p,x)=>x!==r)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:o.color,onChange:y=>d(r,{color:y.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Outline Opacity"}),e.jsx(F,{value:o.opacity??1,min:0,max:1,step:.05,onChange:y=>d(r,{opacity:y})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Outline Size"}),e.jsx(F,{value:o.width,min:0,max:100,step:1,onChange:y=>d(r,{width:y})})]})]})]},r)):e.jsx("div",{style:{...m,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function Zs({layers:t,open:n,onChange:l,setOpen:s,value:a}){const d=(o,r)=>l(y=>{const p=[...y.style.shadowLayers??[]];return p[o]={...p[o],...r},{...y,style:{...y.style,shadowLayers:p}}});return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:o=>l(r=>{var y;return{...r,style:{...r.style,shadowEnabled:o,shadowLayers:o&&(((y=r.style.shadowLayers)==null?void 0:y.length)??0)===0?[zt()]:r.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Be,{label:"Shadow Editor",open:n,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ce,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:m,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(o=>({...o,style:{...o.style,shadowLayers:[...o.style.shadowLayers??[],zt()]}})),children:"+"})]}),t.length>0?t.map((o,r)=>e.jsxs("div",{style:gn,children:[e.jsxs("div",{style:ce,children:[e.jsxs("span",{style:m,children:["Shadow ",r+1]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(y=>({...y,style:{...y.style,shadowLayers:(y.style.shadowLayers??[]).filter((p,x)=>x!==r)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:o.color,onChange:y=>d(r,{color:y.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Opacity"}),e.jsx(F,{value:o.opacity??1,min:0,max:1,step:.05,onChange:y=>d(r,{opacity:y})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Offset"}),e.jsx(F,{value:o.offset??10,min:0,max:100,step:1,onChange:y=>d(r,{offset:y})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Angle"}),e.jsx(F,{value:o.angle??-45,min:-180,max:180,step:1,onChange:y=>d(r,{angle:y})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Shadow Feather"}),e.jsx(F,{value:o.feather??0,min:0,max:1,step:.05,onChange:y=>d(r,{feather:y})})]})]})]},r)):e.jsx("div",{style:{...m,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function Ys({backgroundSettingsOpen:t,bend:n,bendSettingsOpen:l,glow:s,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:o,onChange:r,outlineLayers:y,outlineSettingsOpen:p,setBackgroundSettingsOpen:x,setBendSettingsOpen:c,setGlowSettingsOpen:g,setInnerShadowSettingsOpen:h,setOutlineSettingsOpen:i,setShadowSettingsOpen:b,shadowLayers:j,shadowSettingsOpen:k,value:C}){return e.jsxs("div",{style:me,children:[e.jsx(Xs,{value:C,onChange:r,layers:y,open:p,setOpen:i}),e.jsx(Zs,{value:C,onChange:r,layers:j,open:k,setOpen:b}),e.jsx(Us,{value:C,onChange:r,innerShadow:d,open:a,setOpen:g}),e.jsx(_s,{value:C,onChange:r,glow:s,open:o,setOpen:h}),e.jsx(Ks,{value:C,onChange:r,bend:n,open:l,setOpen:c}),e.jsx(Hs,{value:C,onChange:r,open:t,setOpen:x})]})}function qs({value:t,onChange:n}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:s=>n(a=>({...a,style:{...a.style,color:s.target.value}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Font Size"}),e.jsx(F,{value:t.style.fontSize,min:16,max:180,step:4,onChange:s=>n(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??s,s)},style:{...a.style,fontSize:s}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Letter Spacing"}),e.jsx(F,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:s=>n(a=>({...a,style:{...a.style,letterSpacing:s}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Line Spacing"}),e.jsx(F,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:s=>n(a=>({...a,style:{...a.style,lineSpacing:s}}))})]}),e.jsxs("div",{style:q,children:[e.jsx("span",{style:m,children:"Text Style"}),e.jsxs("div",{style:Fs,children:[e.jsx("button",{type:"button",style:He(!l),onClick:()=>n(s=>({...s,style:{...s.style,bold:!1,fontWeight:s.style.fontWeight==="bold"?"normal":s.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:He(t.style.bold===!0),onClick:()=>n(s=>({...s,style:{...s.style,bold:s.style.bold!==!0,fontWeight:s.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:He(t.style.fontStyle==="italic"),onClick:()=>n(s=>({...s,style:{...s.style,fontStyle:s.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:He(t.style.underline===!0),onClick:()=>n(s=>({...s,style:{...s.style,underline:s.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:He(t.style.strikethrough===!0),onClick:()=>n(s=>({...s,style:{...s.style,strikethrough:s.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Horizontal Alignment"}),e.jsxs("select",{style:de,value:t.layout.textAlign??"center",onChange:s=>n(a=>({...a,layout:{...a.layout,textAlign:s.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Vertical Alignment"}),e.jsxs("select",{style:de,value:t.layout.verticalAlign??"center",onChange:s=>n(a=>({...a,layout:{...a.layout,verticalAlign:s.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Overflow"}),e.jsxs("select",{style:de,value:t.layout.overflow,onChange:s=>n(a=>({...a,layout:{...a.layout,overflow:s.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:it,checked:t.layout.resizeToFit===!0,onChange:s=>n(a=>({...a,layout:{...a.layout,resizeToFit:s.target.checked}}))})]})})]})}const Js={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},le={display:"flex",flexDirection:"column",gap:4},bt={...le,gridColumn:"1 / -1"},G={fontSize:9,color:"rgba(226,232,240,0.72)"},Qs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},el={...Qs,fontVariantNumeric:"tabular-nums"},tl={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},nl={width:16,height:16},sl=t=>/^-?\d*(\.\d*)?$/.test(t),Q=({value:t,onChange:n,step:l=1,min:s,max:a,disabled:d=!1})=>{const[o,r]=u.useState(String(t));u.useEffect(()=>r(String(t)),[t]);const y=p=>{let x=p;return typeof s=="number"&&(x=Math.max(s,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:el,value:o,disabled:d,onChange:p=>{const x=p.target.value;if(!sl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||n(y(c))},onBlur:()=>{const p=Number(o);if(Number.isNaN(p)){r(String(t));return}const x=y(p);r(String(x)),n(x)},onKeyDown:p=>{if(p.key!=="ArrowUp"&&p.key!=="ArrowDown")return;p.preventDefault();const x=p.shiftKey?l*10:p.altKey?l/10:l,c=p.key==="ArrowUp"?t+x:t-x;n(y(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},Ft=({value:t,onChange:n,guideLabel:l,showRenderOrder:s=!0})=>{var a,d;return e.jsxs("div",{style:Js,children:[e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Position X"}),e.jsx(Q,{value:t.position.x,min:-4096,max:4096,step:1,onChange:o=>n({...t,position:{...t.position,x:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Position Y"}),e.jsx(Q,{value:t.position.y,min:-4096,max:4096,step:1,onChange:o=>n({...t,position:{...t.position,y:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Size X"}),e.jsx(Q,{value:t.size.width,min:0,max:8192,step:1,onChange:o=>n({...t,size:{...t.size,width:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Size Y"}),e.jsx(Q,{value:t.size.height,min:0,max:8192,step:1,onChange:o=>n({...t,size:{...t.size,height:o}})})]}),e.jsxs("label",{style:bt,children:[e.jsx("span",{style:G,children:"Rotation"}),e.jsx(Q,{value:t.rotation,min:-360,max:360,step:1,onChange:o=>n({...t,rotation:o})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Scale 2D X"}),e.jsx(Q,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:o=>{var r;return n({...t,scale2D:{x:o,y:((r=t.scale2D)==null?void 0:r.y)??1}})}})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Scale 2D Y"}),e.jsx(Q,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:o=>{var r;return n({...t,scale2D:{x:((r=t.scale2D)==null?void 0:r.x)??1,y:o}})}})]}),e.jsxs("label",{style:bt,children:[e.jsx("span",{style:G,children:"Reference Pixels Per Unit"}),e.jsx(Q,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:o=>n({...t,referencePixelsPerUnit:o})})]}),s?e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Render Order"}),e.jsx(Q,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:o=>n({...t,renderOrder:o})})]}):null,e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Pivot X"}),e.jsx(Q,{value:t.pivot[0],min:0,max:1,step:.01,onChange:o=>n({...t,pivot:[o,t.pivot[1]]})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Pivot Y"}),e.jsx(Q,{value:t.pivot[1],min:0,max:1,step:.01,onChange:o=>n({...t,pivot:[t.pivot[0],o]})})]}),e.jsx("label",{style:bt,children:e.jsxs("div",{style:tl,children:[e.jsx("span",{style:G,children:l}),e.jsx("input",{type:"checkbox",style:nl,checked:t.showGuides,onChange:o=>n({...t,showGuides:o.target.checked})})]})})]})};function ll({value:t,onChange:n}){return e.jsx(Ft,{value:yn(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>n(s=>({...s,transformation:js(l,s.transformation),screenTransform:un(l,s.screenTransform)}))})}const il=({value:t,onChange:n,copyLabel:l,inspector:s})=>{var ye;const[a,d]=u.useState(()=>$.createSceneObject({name:l??"Screen Text",renderGroupId:We.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=u.useState(()=>{const N=a.id,f=$.createDefaultComponent("ScreenTransform",N),v=$.createDefaultComponent("ScreenText",N),A=$.createDefaultComponent("Material",N),z=$.createDefaultComponent("Texture",N);return{screenTransform:f,screenText:v,material:A,texture:z}}),[r,y]=u.useState(!0),[p,x]=u.useState(!0),[c,g]=u.useState(!0),[h,i]=u.useState(!0),[b,j]=u.useState(!0),[k,C]=u.useState(!0),[L,S]=u.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),w=yn(t.screenText.transformation,t.screenText.screenTransform),O={object:{...a,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??un(w)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},T=N=>{n({...t,screenText:N(t.screenText)})},B=t.screenText.style.strokeLayers??[],_=t.screenText.style.shadowEnabled!==!1&&(((ye=t.screenText.style.shadowLayers)==null?void 0:ye.length)??0)===0?[zt()]:t.screenText.style.shadowLayers??[],he=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},te=t.screenText.style.glow??hn(),xe=t.screenText.style.bend??xn(),M=N=>S(f=>({...f,[N]:!f[N]})),I=(N,f,v,A)=>e.jsx(Ls,{label:f,icon:v,open:L[N],onToggle:()=>M(N),children:A},N);return e.jsxs(ut,{objectId:(s==null?void 0:s.objectId)??a.id,objectName:(s==null?void 0:s.objectName)??a.name,onObjectNameChange:(s==null?void 0:s.onObjectNameChange)??(N=>d(f=>({...f,name:N}))),layer:(s==null?void 0:s.layer)??"Default Layer",visible:(s==null?void 0:s.visible)??t.screenText.enabled,onVisibleChange:(s==null?void 0:s.onVisibleChange)??(N=>T(f=>({...f,enabled:N}))),copyConfig:(s==null?void 0:s.copyConfig)??O,initialPosition:s==null?void 0:s.initialPosition,position:s==null?void 0:s.position,onPositionChange:s==null?void 0:s.onPositionChange,title:s==null?void 0:s.title,children:[I("transformation","Transformation",e.jsx(Ns,{}),e.jsx(ll,{value:t.screenText,onChange:T})),I("text2d","2D Text",e.jsx(Bt,{}),e.jsxs(e.Fragment,{children:[I("content","Content",e.jsx(Bt,{}),e.jsx($s,{value:t.screenText,onChange:T})),I("style","Style",e.jsx(Pt,{}),e.jsx(qs,{value:t.screenText,onChange:T})),I("textEffect","Text Effect",e.jsx(Pt,{}),e.jsx(Ys,{value:t.screenText,onChange:T,outlineLayers:B,shadowLayers:_,innerShadow:he,glow:te,bend:xe,outlineSettingsOpen:r,setOutlineSettingsOpen:y,shadowSettingsOpen:p,setShadowSettingsOpen:x,innerShadowSettingsOpen:c,setInnerShadowSettingsOpen:g,glowSettingsOpen:h,setGlowSettingsOpen:i,bendSettingsOpen:b,setBendSettingsOpen:j,backgroundSettingsOpen:k,setBackgroundSettingsOpen:C}))]}))]})},ol="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",rl={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},al=Object.entries(rl).map(([t,n])=>({value:t,label:n})),dl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:ol,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},cl=(t,n)=>{const l=dl[n];return{...t,preset:n,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},pl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},et={display:"flex",flexDirection:"column",gap:4},hl={...et,gridColumn:"1 / -1"},Ke={fontSize:9,color:"rgba(226,232,240,0.72)"},Lt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Vt={...Lt,appearance:"none"},xl={...Lt,fontVariantNumeric:"tabular-nums"},yl={...Lt,padding:2,cursor:"pointer"},ul=t=>/^-?\d*(\.\d*)?$/.test(t),Ht=({value:t,onChange:n,step:l=1,min:s,max:a})=>{const[d,o]=u.useState(String(t));u.useEffect(()=>o(String(t)),[t]);const r=y=>{let p=y;return typeof s=="number"&&(p=Math.max(s,p)),typeof a=="number"&&(p=Math.min(a,p)),p};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:xl,value:d,onChange:y=>{const p=y.target.value;if(!ul(p)||(o(p),p===""||p==="-"||p==="."||p==="-."))return;const x=Number(p);Number.isNaN(x)||n(r(x))},onBlur:()=>{const y=Number(d);if(Number.isNaN(y)){o(String(t));return}const p=r(y);o(String(p)),n(p)},onKeyDown:y=>{if(y.key!=="ArrowUp"&&y.key!=="ArrowDown")return;y.preventDefault();const p=y.shiftKey?l*10:y.altKey?l/10:l,x=y.key==="ArrowUp"?t+p:t-p;n(r(Number.isInteger(x)?x:Number(x.toFixed(6))))}})},gl=({value:t,onChange:n})=>e.jsxs("div",{style:pl,children:[e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Material Type"}),e.jsxs("select",{style:Vt,value:t.materialType,onChange:l=>n({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Blend Mode"}),e.jsxs("select",{style:Vt,value:t.blendMode,onChange:l=>n({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Opacity"}),e.jsx(Ht,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>n({...t,opacity:l})})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Tint"}),e.jsx("input",{type:"color",style:yl,value:t.color,onChange:l=>n({...t,color:l.target.value})})]}),e.jsxs("label",{style:hl,children:[e.jsx("span",{style:Ke,children:"Alpha Test"}),e.jsx(Ht,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>n({...t,alphaTest:l})})]})]}),bl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},fl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},jl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ml={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Sl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},wl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),kl={display:"grid",gap:7,padding:"0 7px 7px"},vl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},tt={display:"flex",flexDirection:"column",gap:4},ft={...tt,gridColumn:"1 / -1"},Se={fontSize:9,color:"rgba(226,232,240,0.72)"},bn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},jt={...bn,appearance:"none"},mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},St={width:16,height:16},Cl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Rl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),El=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),Il=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),Kt=(t,n)=>({enabled:(n==null?void 0:n.enabled)??t.enabled,showGuides:(n==null?void 0:n.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(n==null?void 0:n.position)??t.position,size:(n==null?void 0:n.size)??t.size,rotation:(n==null?void 0:n.rotation)??t.rotation,scale2D:n==null?void 0:n.scale2D,referencePixelsPerUnit:n==null?void 0:n.referencePixelsPerUnit,pivot:(n==null?void 0:n.pivot)??t.pivot,renderOrder:(n==null?void 0:n.renderOrder)??t.renderOrder,overlay:(n==null?void 0:n.overlay)??t.overlay,visible:(n==null?void 0:n.visible)??t.visible}),zl=(t,n)=>({...n,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),_t=(t,n)=>({...$.DEFAULT_SCREEN_TRANSFORM_2D,...n,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(n==null?void 0:n.scale2D)??$.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(n==null?void 0:n.referencePixelsPerUnit)??$.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Tl=({value:t,onChange:n,copyLabel:l,inspector:s})=>{const[a,d]=u.useState(()=>$.createSceneObject({name:l??"Screen Image",renderGroupId:We.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=u.useState(()=>{const h=a.id,i=$.createDefaultComponent("ScreenTransform",h),b=$.createDefaultComponent("ScreenImage",h),j=$.createDefaultComponent("Material",h),k=$.createDefaultComponent("Texture",h);return{screenTransform:i,screenImage:b,material:j,texture:k}}),[r,y]=u.useState({transformation:!0,image:!0,material:!0}),p=Kt(t.screenImage.transformation,t.screenImage.screenTransform),x={object:{...a,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??_t(p)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},c=h=>{n({...t,screenImage:h(t.screenImage)})},g=(h,i,b,j)=>e.jsxs("div",{style:fl,children:[e.jsxs("div",{style:jl,children:[e.jsx("button",{type:"button",onClick:()=>y(k=>({...k,[h]:!k[h]})),style:Sl,children:e.jsx("div",{style:wl(r[h])})}),e.jsxs("div",{style:ml,children:[e.jsx("span",{style:bl,children:b}),e.jsx("span",{children:i})]})]}),r[h]?e.jsx("div",{style:kl,children:j}):null]},h);return e.jsxs(ut,{objectId:(s==null?void 0:s.objectId)??a.id,objectName:(s==null?void 0:s.objectName)??a.name,onObjectNameChange:(s==null?void 0:s.onObjectNameChange)??(h=>d(i=>({...i,name:h}))),layer:(s==null?void 0:s.layer)??"Default Layer",visible:(s==null?void 0:s.visible)??t.screenImage.enabled,onVisibleChange:(s==null?void 0:s.onVisibleChange)??(h=>c(i=>({...i,enabled:h}))),copyConfig:(s==null?void 0:s.copyConfig)??x,initialPosition:s==null?void 0:s.initialPosition,position:s==null?void 0:s.position,onPositionChange:s==null?void 0:s.onPositionChange,title:s==null?void 0:s.title,children:[g("transformation","Transformation",e.jsx(El,{}),e.jsx(Ft,{value:Kt(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:h=>c(i=>({...i,transformation:zl(h,i.transformation),screenTransform:_t(h,i.screenTransform)}))})),g("image","Image",e.jsx(Rl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Preset"}),e.jsx("select",{style:jt,value:t.screenImage.preset,onChange:h=>c(i=>cl(i,h.target.value)),children:al.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))})]}),e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Source Kind"}),e.jsx("select",{style:jt,value:t.screenImage.image.sourceKind,onChange:h=>c(i=>({...i,image:{...i.image,sourceKind:h.target.value}})),children:Cl.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Source URL"}),e.jsx("input",{style:bn,value:t.screenImage.image.src,onChange:h=>c(i=>({...i,image:{...i.image,src:h.target.value}}))})]}):null,e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Stretch Mode"}),e.jsxs("select",{style:jt,value:t.screenImage.image.stretchMode,onChange:h=>c(i=>({...i,image:{...i.image,stretchMode:h.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.flipX,onChange:h=>c(i=>({...i,image:{...i.image,flipX:h.target.checked}}))})]})}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.flipY,onChange:h=>c(i=>({...i,image:{...i.image,flipY:h.target.checked}}))})]})})]})),g("material","Material",e.jsx(Il,{}),e.jsxs("div",{style:vl,children:[e.jsx(gl,{value:t.screenImage.image,onChange:h=>c(i=>({...i,image:{...i.image,materialType:h.materialType,blendMode:h.blendMode,opacity:h.opacity,color:h.color,alphaTest:h.alphaTest}}))}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.transparent,onChange:h=>c(i=>({...i,image:{...i.image,transparent:h.target.checked}}))})]})})]}))]})},$e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},Me={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Ml=({onChange:t,value:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[n.map((l,s)=>e.jsxs("div",{style:$e,children:[e.jsx("input",{"aria-label":`Gradient stop ${s+1} color`,type:"color",style:{...Me,padding:2},value:l.color,onChange:a=>t(n.map((d,o)=>o===s?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${s+1} position`,type:"number",min:0,max:1,step:.05,style:Me,value:l.offset,onChange:a=>t(n.map((d,o)=>o===s?{...d,offset:Number(a.currentTarget.value)}:d))}),n.length>2?e.jsx("button",{type:"button",onClick:()=>t(n.filter((a,d)=>d!==s)),children:"−"}):null]})]},`${s}-${l.color}`)),n.length<X.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...n,{offset:.5,color:((l=n[n.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),fn=({onChange:t,value:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:Me,value:n.type,onChange:l=>t({...n,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Ml,{value:n.stops,onChange:l=>t({...n,stops:l})}),n.type!=="radial"?e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:Me,step:5,value:n.angle,onChange:l=>t({...n,angle:Number(l.currentTarget.value)})})]}):null,n.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:Me,min:0,max:1,step:.05,value:n.center.x,onChange:l=>t({...n,center:{...n.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:Me,min:0,max:1,step:.05,value:n.center.y,onChange:l=>t({...n,center:{...n.center,y:Number(l.currentTarget.value)}})})]})]}):null,n.type==="radial"?e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:Me,min:.01,step:.05,value:n.radius,onChange:l=>t({...n,radius:Number(l.currentTarget.value)})})]}):null]}),Gt={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},Ut={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},jn=({value:t,onChange:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:Gt,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...Ut,padding:2},value:t.tint,onChange:l=>n({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:Gt,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:Ut,min:0,max:1,step:.05,value:t[l],onChange:s=>n({...t,[l]:Number(s.currentTarget.value)})})]},l))]}),Wl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ae={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},nt={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ne=({label:t,onValue:n,...l})=>e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:nt,onChange:s=>n(Number(s.currentTarget.value))})]}),mn=({value:t,onChange:n})=>e.jsxs("section",{style:Wl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:nt,value:t.kind,onChange:l=>n({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:nt,value:t.fillMode,onChange:l=>n({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(fn,{value:t.gradient,onChange:l=>n({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(jn,{value:t.glass,onChange:l=>n({...t,glass:l})}):e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...nt,padding:2},value:t.fillColor,onChange:l=>n({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ne,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>n({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...nt,padding:2},value:t.strokeColor,onChange:l=>n({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ne,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>n({...t,strokeWidth:l})}),e.jsx(ne,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>n({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>n({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ne,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>n({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ne,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>n({...t,sides:l})}):null,t.kind==="star"?e.jsx(ne,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>n({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ne,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>n({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ne,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>n({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ne,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>n({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ne,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>n({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Fl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Ll={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Sn={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Nl={...Sn,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Ol={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},$l={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Al={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},Xt={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Dl={display:"grid",gap:6,padding:7},Bl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Pl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Vl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Hl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Kl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),_l={display:"grid",gap:7,padding:"0 7px 7px"},Gl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Te={display:"flex",flexDirection:"column",gap:4},_e={...Te,gridColumn:"1 / -1"},ee={fontSize:9,color:"rgba(226,232,240,0.72)"},Le={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ge={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ue={width:16,height:16},Zt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Ul=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),Xl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Zl=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Yl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),ql=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:14,y:104}),[o,r]=u.useState(typeof window>"u"?0:window.innerHeight),[y,p]=u.useState({overlay:!0,visibility:!1}),x=u.useRef(null),c=Math.max(240,o-a.y-16);u.useEffect(()=>{const i=j=>{x.current&&d({x:Math.max(8,j.clientX-x.current.x),y:Math.max(8,j.clientY-x.current.y)})},b=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",b)}},[]),u.useEffect(()=>{const i=()=>r(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const g=i=>{const b=i.currentTarget.getBoundingClientRect();x.current={x:i.clientX-b.left,y:i.clientY-b.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},h=(i,b,j,k)=>e.jsxs("div",{style:Bl,children:[e.jsxs("div",{style:Pl,children:[e.jsx("button",{type:"button",onClick:()=>p(C=>({...C,[i]:!C[i]})),style:Hl,children:e.jsx("div",{style:Kl(y[i])})}),e.jsxs("div",{style:Vl,children:[e.jsx("span",{style:Xt,children:j}),e.jsx("span",{children:b})]})]}),y[i]?e.jsx("div",{style:_l,children:k}):null]},i);return typeof document>"u"?null:pe.createPortal(e.jsxs("div",{style:{...Ll,left:a.x,top:a.y},children:[e.jsx("style",{children:`
|
|
2
2
|
.xr-hand-tracking-2d-scroll::-webkit-scrollbar { width: 10px; }
|
|
3
3
|
.xr-hand-tracking-2d-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
|
|
4
4
|
.xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
|
package/dist/debug-ui.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { M as Ws, d as Ms, s as Ls, a as Fs, u as Ns, b as $s } from "./session-
|
|
1
|
+
import { M as Ws, d as Ms, s as Ls, a as Fs, u as Ns, b as $s } from "./session-CbtvwiaD.js";
|
|
2
2
|
import { DefaultSettingPanel as Bs } from "./debug-ui/default-setting.js";
|
|
3
3
|
import { jsx as e, jsxs as l, Fragment as K } from "react/jsx-runtime";
|
|
4
4
|
import { useState as x, useRef as te, useEffect as O, useContext as $n, createContext as On, useMemo as gn } from "react";
|
|
5
|
-
import { D as bn, a as At, r as Bn, b as An, c as Dn } from "./renderGroups-
|
|
6
|
-
import { V as Ve, o as un, b as me, A as Vn, z as fn, s as Dt } from "./renderPasses-
|
|
5
|
+
import { D as bn, a as At, r as Bn, b as An, c as Dn } from "./renderGroups-CPWUX6z9.js";
|
|
6
|
+
import { V as Ve, o as un, b as me, A as Vn, z as fn, s as Dt } from "./renderPasses-CLlYRdMk.js";
|
|
7
7
|
import Kn, { createPortal as we } from "react-dom";
|
|
8
8
|
import { DoubleSide as Hn } from "three";
|
|
9
|
-
import { B as Pn, s as jn, k as Gn, g as Vt, h as _n, j as ft, E as Xn, G as Un, t as Zn } from "./FaceMeshRenderer-
|
|
10
|
-
import { D as Yn, r as Jn, e as qn, p as Qn, t as Kt, g as el, m as tl, s as nl, a as ll, b as il, c as ol } from "./FaceRetouch-
|
|
11
|
-
import { n as rl } from "./index-
|
|
12
|
-
import { F as al } from "./index-
|
|
9
|
+
import { B as Pn, s as jn, k as Gn, g as Vt, h as _n, j as ft, E as Xn, G as Un, t as Zn } from "./FaceMeshRenderer-B2i2NW71.js";
|
|
10
|
+
import { D as Yn, r as Jn, e as qn, p as Qn, t as Kt, g as el, m as tl, s as nl, a as ll, b as il, c as ol } from "./FaceRetouch-Bg-OBU4n.js";
|
|
11
|
+
import { n as rl } from "./index-72Wb15Ca.js";
|
|
12
|
+
import { F as al } from "./index-g250Tqme.js";
|
|
13
13
|
import { PerspectiveCamera as sl, OrbitControls as dl } from "@react-three/drei";
|
|
14
14
|
import { useThree as cl } from "@react-three/fiber";
|
|
15
|
-
import { e as pl, f as hl } from "./index-
|
|
16
|
-
import { X as yl } from "./contexts-
|
|
17
|
-
import { u as gl } from "./selectors-
|
|
15
|
+
import { e as pl, f as hl } from "./index-Cj3fGDtZ.js";
|
|
16
|
+
import { X as yl } from "./contexts-B2_NsTnk.js";
|
|
17
|
+
import { u as gl } from "./selectors-DLxL8Q66.js";
|
|
18
18
|
const bl = {
|
|
19
19
|
position: "fixed",
|
|
20
20
|
left: 14,
|
|
@@ -13,6 +13,8 @@ export { useXRModel } from '../hooks/useXRModel';
|
|
|
13
13
|
export type { UseXRModelResult } from '../hooks/useXRModel';
|
|
14
14
|
export type { XRModelNodeSegmentation, XRModelNodeBodyTracking, XRModelNodeHandTracking, XRModelNodeGestureTracking, XRModelNodeFaceTracking, } from '../types/nodes';
|
|
15
15
|
export { useXRReady, useXRError, useXRCameraTexture, useXRRenderSize, useXRModelNode, useXRPipelineSnapshot, } from '../hooks/selectors';
|
|
16
|
+
export type { XRSessionError } from '../hooks/useXRSession/store';
|
|
17
|
+
export type { XRErrorReason } from '../hooks/useXRSession/reason';
|
|
16
18
|
export type { GestureName } from '../hooks/useGestureEdge';
|
|
17
19
|
export { useFaceBoundingBox } from '../hooks/useFaceBoundingBox';
|
|
18
20
|
export { computeLandmarkBounds } from '../utils/landmarkBounds';
|