gaesup-world 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blueprints-editor.cjs +1 -1
- package/dist/blueprints-editor.js +2 -2
- package/dist/core/interactions/components/Clicker/index.d.ts +1 -4
- package/dist/editor.js +2 -2
- package/dist/{index-Drmv86ws.js → index-3WAK67Ha.js} +1 -1
- package/dist/{index-DShLht0Q.js → index-B0oz8u47.js} +1 -1
- package/dist/index-Cpso39Zs.cjs +1 -0
- package/dist/{index-BUQXtHf3.js → index-DGifA0e6.js} +5 -4
- package/dist/{index-D0Rz5_-J.js → index-DRLvJF_k.js} +5 -4
- package/dist/index-DXZjZF_s.js +320 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +11 -11
- package/dist/network.cjs +1 -1
- package/dist/network.js +2 -2
- package/dist/{plugin-BEJHB06f.js → plugin-BFzSydfr.js} +35 -34
- package/dist/runtime.js +5 -5
- package/package.json +1 -1
- package/dist/index-CHoKlv0U.cjs +0 -1
- package/dist/index-HxpKt5rO.js +0 -320
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("reflect-metadata");const Te=require("./index-D1hpjfAw.cjs"),_=require("./index-CJj-Z7Jr.cjs"),L=require("./index-DHZJyO9k.cjs"),Y=require("./runtimeFilter-W6iMw1pL.cjs"),b=require("./plugin-CS2nMv9n.cjs"),ce=require("./index-syAx2qzT.cjs"),V=require("./index-CHoKlv0U.cjs"),xn=require("three"),O=require("./gaesupStore-2zKBYTYo.cjs"),i=require("react/jsx-runtime"),p=require("react"),nt=require("./index-BhSman4a.cjs"),te=require("./index-co-QAQz9.cjs"),D=require("./timeStore-CDN035t4.cjs"),h=require("./eventsStore-Cipkf938.cjs"),N=require("./plugins.cjs"),H=require("zustand"),Q=require("@react-three/fiber"),se=require("./authority-BOPCXUrV.cjs"),T=require("./loader-D7cEHkCq.cjs"),G=require("./weatherStore-1unmwIen.cjs"),fe=require("./assetStore-DVPge_2j.cjs"),rt=require("./index-DCa_lUwq.cjs"),vn=require("./api-B58jaq5T.cjs"),st=require("./serverHost-C_bhbyiP.cjs");function In(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const v=In(xn),J=H.create((e,n)=>({entries:new Map,current:null,register:t=>{const r=new Map(n().entries);r.set(t.id,t),e({entries:r})},unregister:t=>{const r=n().entries;if(!r.has(t))return;const s=new Map(r);s.delete(t),e({entries:s})},updatePosition:(t,r)=>{const s=n().entries.get(t);s&&s.position.copy(r)},getAll:()=>Array.from(n().entries.values()),setCurrent:t=>{const r=n().current;r!==t&&(r&&t&&r.id===t.id&&Math.abs(r.distance-t.distance)<.05||e({current:t}))},activateCurrent:()=>{const t=n().current;if(!t)return;const r=n().entries.get(t.id);r&&r.onActivate()}})),Le=new v.Vector3;function De(){return J(e=>e.current)}function ot(e=!0){const n=De(),t=J(o=>o.activateCurrent),r=_.useInputBackend(),s=p.useRef(!1);p.useEffect(()=>{if(s.current=!1,!e||!n)return;const o=u=>{u&&!s.current&&t(),s.current=u},a=En(n.key);if(a&&r.subscribe)return o(!!r.getKeyboard()[a]),r.subscribe(({keyboard:u})=>{o(!!u[a])});const l=u=>{const c=u.target?.tagName?.toLowerCase();c==="input"||c==="textarea"||u.key.toLowerCase()===n.key.toLowerCase()&&t()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n,e,t,r])}function En(e){switch(e.toLowerCase()){case"w":return"forward";case"a":return"leftward";case"s":return"backward";case"d":return"rightward";case"shift":return"shift";case" ":case"space":return"space";case"z":return"keyZ";case"r":return"keyR";case"f":return"keyF";case"e":return"keyE";case"escape":return"escape";default:return null}}function wn({throttleMs:e=80}={}){const{position:n}=V.usePlayerPosition({updateInterval:16}),t=J(o=>o.entries),r=J(o=>o.setCurrent),s=p.useRef(0);return Q.useFrame((o,a)=>{if(s.current+=a*1e3,s.current<e)return;s.current=0;let l=null,u=1/0,c="",f="e";for(const d of t.values()){Le.copy(d.position).sub(n);const m=Le.lengthSq(),y=d.range*d.range;m>y||m<u&&(u=m,l=d.id,c=d.label,f=d.key)}if(!l){r(null);return}r({id:l,label:c,key:f,distance:Math.sqrt(u)})}),null}function Cn({advanceKey:e="e",closeKey:n="Escape"}){const t=T.useDialogStore(u=>u.node),r=T.useDialogStore(u=>u.runner),s=T.useDialogStore(u=>u.advance),o=T.useDialogStore(u=>u.choose),a=T.useDialogStore(u=>u.close),l=r?.visibleChoices()??[];return p.useEffect(()=>{if(!t)return;const u=c=>{if(c.key===n){a();return}if(l.length===0&&c.key.toLowerCase()===e.toLowerCase()){s();return}const f=parseInt(c.key,10);!Number.isNaN(f)&&f>=1&&f<=l.length&&o(f-1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,l.length,s,o,a,e,n]),t?i.jsxs("div",{style:{position:"fixed",left:"50%",bottom:110,transform:"translateX(-50%)",width:"min(720px, 92vw)",zIndex:120,background:"rgba(18,20,28,0.62)",color:"#f3f4f8",borderRadius:14,border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:14,padding:14},children:[t.speaker&&i.jsx("div",{style:{display:"inline-block",padding:"3px 8px",background:"#ffd84a",color:"#1a1a1a",borderRadius:6,fontWeight:700,fontSize:12,marginBottom:6},children:t.speaker}),i.jsx("div",{style:{lineHeight:1.55,whiteSpace:"pre-wrap"},children:t.text}),l.length===0?i.jsxs("div",{style:{marginTop:10,fontSize:12,opacity:.65,textAlign:"right"},children:["[",e.toUpperCase(),"] 다음"]}):i.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:l.map((u,c)=>i.jsxs("button",{onClick:()=>o(c),style:{textAlign:"left",padding:"9px 12px",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500},children:[i.jsxs("span",{style:{display:"inline-block",width:18,color:"#ffd84a",marginRight:6},children:[c+1,"."]}),u.text]},c))})]}):null}const kn="gaesup.events",Tn="events",Pn="events.store";function it(){return h.useEventsStore.getState().serialize()}function at(e){h.useEventsStore.getState().hydrate(e)}function lt(e={}){return N.createStoreDomainPlugin({id:e.id??kn,name:"GaeSup Events",saveExtensionId:e.saveExtensionId??Tn,storeServiceId:e.storeServiceId??Pn,store:h.useEventsStore,readyEvent:"events:ready",capabilities:["events"],serialize:it,hydrate:at})}const Rn=lt();function _n(e=!0,n={}){p.useEffect(()=>{if(!e)return;const t=()=>{const s=D.useTimeStore.getState().time,{started:o,ended:a}=h.useEventsStore.getState().refresh(s);o.length&&n.onStarted&&n.onStarted(o),a.length&&n.onEnded&&n.onEnded(a)};return t(),D.useTimeStore.subscribe((s,o)=>{(s.time.day!==o.time.day||s.time.month!==o.time.month||s.time.season!==o.time.season||s.time.weekday!==o.time.weekday)&&t()})},[e,n.onStarted,n.onEnded])}function jn({position:e="top-left",excludeIds:n=[]}){const t=h.useEventsStore(a=>a.active),r=h.getEventRegistry(),s=t.filter(a=>!n.includes(a));if(s.length===0)return null;const o=e==="top-right"?{top:88,right:12}:{top:88,left:12};return i.jsx("div",{style:{position:"fixed",zIndex:90,display:"flex",flexDirection:"column",gap:4,pointerEvents:"none",userSelect:"none",...o},children:s.map(a=>{const l=r.get(a);if(!l)return null;const u=l.tags?.some(c=>c==="festival"||c==="tourney");return i.jsxs("div",{style:{padding:"4px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,borderRadius:999,boxShadow:`inset 0 0 0 1px ${u?"#ffd84a55":"#7adf9055"}`,display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:u?"#ffd84a":"#7adf90"}}),i.jsx("span",{children:l.name})]},a)})})}const Dn=[{id:"season.spring",name:"봄",summary:"꽃이 피고 벌레가 깨어납니다.",triggers:[{kind:"season",seasons:["spring"]}],tags:["season:spring","fish:bass","bug:butterfly"]},{id:"season.summer",name:"여름",summary:"낚시와 곤충채집의 계절.",triggers:[{kind:"season",seasons:["summer"]}],tags:["season:summer","fish:tuna","bug:beetle","bug:stag"]},{id:"season.autumn",name:"가을",summary:"단풍이 들고 낚시 보너스.",triggers:[{kind:"season",seasons:["autumn"]}],tags:["season:autumn","fish:koi","bug:butterfly"]},{id:"season.winter",name:"겨울",summary:"눈이 내리고 곤충은 사라집니다.",triggers:[{kind:"season",seasons:["winter"]}],tags:["season:winter","fish:bass"]},{id:"event.cherryblossom",name:"벚꽃 축제",summary:"봄 한정 — 벚꽃 잎이 흩날립니다.",triggers:[{kind:"monthRange",month:4,fromDay:1,toDay:10}],tags:["festival","visual:sakura"]},{id:"event.fishing-tourney",name:"낚시 대회",summary:"주말 한정 낚시 대회 — 보너스 종 출현.",triggers:[{kind:"weekday",weekdays:["sat","sun"]}],tags:["tourney","fish:koi","fish:tuna"]}];let Oe=!1;function Mn(){Oe||(Oe=!0,h.getEventRegistry().registerAll(Dn))}const An="gaesup.inventory",Ln="inventory",On="inventory.store";function ct(){return h.useInventoryStore.getState().serialize()}function ut(e){h.useInventoryStore.getState().hydrate(e)}function dt(e={}){return N.createStoreDomainPlugin({id:e.id??An,name:"GaeSup Inventory",saveExtensionId:e.saveExtensionId??Ln,storeServiceId:e.storeServiceId??On,store:h.useInventoryStore,readyEvent:"inventory:ready",capabilities:["inventory"],serialize:ct,hydrate:ut})}const Nn=dt();function Fn(){return h.useInventoryStore(e=>({slots:e.slots,add:e.add,remove:e.remove,removeById:e.removeById,move:e.move,countOf:e.countOf,has:e.has}))}function zn(){return h.useInventoryStore(e=>{const n=e.hotbar[e.equippedHotbar];return n==null?null:e.slots[n]??null})}function ft(){const e=h.useInventoryStore(s=>s.hotbar),n=h.useInventoryStore(s=>s.slots),t=h.useInventoryStore(s=>s.equippedHotbar),r=h.useInventoryStore(s=>s.setEquippedHotbar);return{hotbar:e,slots:e.map(s=>n[s]??null),equipped:t,setEquipped:r}}function Un(e=!0){const n=h.useInventoryStore(s=>s.setEquippedHotbar),t=h.useInventoryStore(s=>s.equippedHotbar),r=h.useInventoryStore(s=>s.hotbar);p.useEffect(()=>{if(!e)return;const s=o=>{const a=o.target?.tagName?.toLowerCase();if(a==="input"||a==="textarea")return;const l=Number(o.key);if(Number.isInteger(l)&&l>=1&&l<=r.length){n(l-1);return}(o.key==="q"||o.key==="Q")&&n(t-1),(o.key==="e"||o.key==="E")&&n(t+1)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,n,t,r.length])}function Bn(){const{slots:e,equipped:n,setEquipped:t}=ft(),r=h.getItemRegistry();return i.jsx("div",{style:{position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:95,display:"flex",gap:6,padding:8,background:"rgba(18,20,28,0.55)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:14,boxShadow:"0 8px 28px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)"},children:e.map((s,o)=>{const a=s?r.get(s.itemId):void 0,l=o===n;return i.jsxs("button",{onClick:()=>t(o),title:a?.name??"",style:{width:54,height:54,borderRadius:10,border:l?"1.5px solid #ffd84a":"1px solid rgba(255,255,255,0.14)",background:l?"rgba(255,216,74,0.10)":"rgba(255,255,255,0.04)",color:"#f3f4f8",position:"relative",cursor:"pointer",padding:0,fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,boxShadow:l?"0 0 16px rgba(255,216,74,0.45)":"none",transition:"background 0.18s ease, border-color 0.18s ease"},children:[i.jsx("div",{style:{position:"absolute",top:4,left:4,width:14,height:14,borderRadius:3,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,opacity:.85},children:o+1}),s&&a?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:14,borderRadius:6,background:a.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),a.stackable&&s.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:s.count})]}):null]},o)})})}function Gn({toggleKey:e="i",initiallyOpen:n=!1}){const[t,r]=p.useState(n),s=h.useInventoryStore(c=>c.slots),o=h.useInventoryStore(c=>c.move),a=h.getItemRegistry(),[l,u]=p.useState(null);return p.useEffect(()=>{const c=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||f.key.toLowerCase()===e.toLowerCase()&&r(m=>!m)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]),t?i.jsx("div",{style:{position:"fixed",inset:0,zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:()=>r(!1),children:i.jsxs("div",{onClick:c=>c.stopPropagation(),style:{background:"rgba(20,20,20,0.95)",borderRadius:12,padding:16,minWidth:460,color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",boxShadow:"0 12px 32px rgba(0,0,0,0.6)"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("div",{style:{fontSize:14,opacity:.9},children:"Inventory"}),i.jsx("button",{onClick:()=>r(!1),style:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",fontSize:14},children:"×"})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 64px)",gap:6},children:s.map((c,f)=>{const d=c?a.get(c.itemId):void 0;return i.jsx("div",{draggable:!!c,onDragStart:()=>u(f),onDragOver:m=>{m.preventDefault()},onDrop:()=>{l!==null&&l!==f&&o(l,f),u(null)},title:d?.name??"",style:{width:64,height:64,borderRadius:6,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(0,0,0,0.5)",position:"relative",cursor:c?"grab":"default",fontSize:11},children:c&&d?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:8,borderRadius:6,background:d.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),d.stackable&&c.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:c.count})]}):null},f)})}),i.jsx("div",{style:{marginTop:12,opacity:.6,fontSize:11},children:`[${e.toUpperCase()}] 닫기 / 드래그로 이동`})]})}):null}const Vn="gaesup.quests",Wn="quests",$n="quests.store";function mt(){return T.useQuestStore.getState().serialize()}function pt(e){T.useQuestStore.getState().hydrate(e)}function gt(e={}){return N.createStoreDomainPlugin({id:e.id??Vn,name:"GaeSup Quests",saveExtensionId:e.saveExtensionId??Wn,storeServiceId:e.storeServiceId??$n,store:T.useQuestStore,readyEvent:"quests:ready",capabilities:["quests"],serialize:mt,hydrate:pt})}const qn=gt();function Hn({toggleKey:e="j"}){const[n,t]=p.useState(!1),r=T.useQuestStore(c=>c.state),s=T.useQuestStore(c=>c.complete),o=T.useQuestStore(c=>c.isObjectiveComplete),a=T.useQuestStore(c=>c.isAllObjectivesComplete);if(p.useEffect(()=>{const c=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||(f.key.toLowerCase()===e.toLowerCase()&&t(m=>!m),f.key==="Escape"&&t(!1))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]),!n)return null;const l=Object.values(r).filter(c=>c.status==="active"),u=Object.values(r).filter(c=>c.status==="completed");return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:c=>c.stopPropagation(),style:{width:560,maxHeight:"76vh",overflow:"hidden",display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(122,166,255,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:"Quest Log"}),i.jsxs("button",{onClick:()=>t(!1),style:yt(),children:["Close [",e.toUpperCase(),"]"]})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[i.jsx(Ne,{title:`Active (${l.length})`,children:l.length===0?i.jsx(Xn,{children:"No active quests."}):l.map(c=>i.jsx(Fe,{progress:c,renderObjective:f=>o(T.getQuestRegistry().require(c.questId),c,f),...a(c.questId)?{onComplete:()=>{s(c.questId)}}:{}},c.questId))}),u.length>0&&i.jsx(Ne,{title:`Completed (${u.length})`,children:u.map(c=>i.jsx(Fe,{progress:c,renderObjective:()=>!0,muted:!0},c.questId))})]})]})})}function Ne({title:e,children:n}){return i.jsxs("div",{style:{marginBottom:10},children:[i.jsx("div",{style:{padding:"6px 6px 4px",color:"#7aa6ff",fontSize:12},children:e}),n]})}function Xn({children:e}){return i.jsx("div",{style:{padding:"8px 10px",opacity:.6},children:e})}function Fe({progress:e,renderObjective:n,onComplete:t,muted:r}){const s=T.getQuestRegistry().get(e.questId);return s?i.jsxs("div",{style:{padding:10,marginBottom:6,background:"#222",borderRadius:8,opacity:r?.6:1},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[i.jsx("strong",{children:s.name}),t&&i.jsx("button",{onClick:t,style:yt(!0),children:"Report Complete"})]}),i.jsx("div",{style:{opacity:.75,marginBottom:6},children:s.summary}),i.jsx("ul",{style:{margin:0,padding:"0 0 0 16px"},children:s.objectives.map(o=>{const a=n(o),l=e.progress[o.id]??0,u=o.type==="collect"||o.type==="deliver"?o.count:1,c=o.type==="collect"?Math.min(h.useInventoryStore.getState().countOf(o.itemId),u):l,f=o.type==="collect"||o.type==="deliver"?h.getItemRegistry().get(o.itemId)?.name??o.itemId:"";return i.jsxs("li",{style:{color:a?"#7adf90":"#ddd",listStyle:"square"},children:[o.description??Yn(o,f)," ",u>1?`(${c}/${u})`:""]},o.id)})}),i.jsxs("div",{style:{marginTop:6,fontSize:11,color:"#ffd84a"},children:["Rewards: ",s.rewards.map(o=>Kn(o)).join(", ")]})]}):null}function Yn(e,n){switch(e.type){case"collect":return`Collect ${n??e.itemId}`;case"deliver":return`Deliver ${n??e.itemId} to ${e.npcId}`;case"talk":return`Talk to ${e.npcId}`;case"visit":return`Visit ${e.tag}`;case"flag":return"Meet the required condition";default:return""}}function Kn(e){switch(e.type){case"item":return`${e.itemId} x${e.count??1}`;case"bells":return`${e.amount} B`;case"friendship":return`Friendship +${e.amount}`;default:return""}}function yt(e){return{padding:"4px 10px",background:e?"#7aa6ff":"#444",color:e?"#0d1424":"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}function Qn(e=!0){p.useEffect(()=>e?h.useInventoryStore.subscribe((t,r)=>{if(t.slots===r.slots)return;const s=T.useQuestStore.getState().active();for(const o of s)T.useQuestStore.getState().recheck(o.questId)}):void 0,[e])}const Zn=5,Jn=.5,er=20,tr=200,nr=e=>{const{activeState:n}=_.useStateSystem(),t=_.useBuildingStore(g=>g.tileGroups),r=p.useRef(new Map),s=p.useRef(te.MinimapSystem.getInstance()),{scale:o=Zn,blockRotate:a=!1,updateInterval:l=33}=e,u=p.useRef(null),[c,f]=p.useState(o),d=!!(n.position&&e);p.useEffect(()=>{const g=u.current;return g&&s.current.setCanvas(g),()=>{s.current.setCanvas(null)}},[]);const m=p.useCallback(()=>{e.blockScale||f(g=>Math.min(er,g+.1))},[e.blockScale]),y=p.useCallback(()=>{e.blockScale||f(g=>Math.max(Jn,g-.1))},[e.blockScale]),x=p.useCallback(g=>{e.blockScale||(g.preventDefault(),g.deltaY<0?m():y())},[e.blockScale,m,y]),C=p.useCallback(()=>{const g=u.current;if(!g)return;const E=w=>{e.blockScale||(w.preventDefault(),w.deltaY<0?m():y())};return g.addEventListener("wheel",E,{passive:!1}),()=>{g.removeEventListener("wheel",E)}},[e.blockScale,m,y]),I=p.useCallback(()=>{const{position:g,euler:E}=n;!g||!E||s.current.render({size:tr,scale:c,position:g,rotation:E.y,blockRotate:a,tileGroups:t,sceneObjects:r.current})},[n,c,a,t]);return p.useEffect(()=>{if(!d)return;const g=setInterval(()=>{const{position:E,euler:w}=n;E&&w&&(s.current.checkForUpdates(E,w.y),I())},l);return()=>{clearInterval(g)}},[I,l,d,n]),p.useEffect(()=>{I()},[c,I]),{canvasRef:u,scale:c,upscale:m,downscale:y,handleWheel:x,setupWheelListener:C,updateCanvas:I,isReady:d}},ze=200;function rr({scale:e=5,minScale:n=.5,maxScale:t=20,blockScale:r=!1,blockScaleControl:s=!1,blockRotate:o=!1,angle:a=0,minimapStyle:l,scaleStyle:u,plusMinusStyle:c,position:f="top-right",showZoom:d=!0,showCompass:m=!0,markers:y=[]}){const{canvasRef:x,scale:C,upscale:I,downscale:g,handleWheel:E}=nr({blockScale:r,blockRotate:o}),w=f?`minimap--${f}`:"";return i.jsxs("div",{className:`minimap ${w}`,style:l,children:[i.jsx("canvas",{ref:x,className:"minimap__canvas",width:ze,height:ze,onWheel:E}),m&&i.jsx("div",{className:"minimap__compass",children:i.jsx("div",{style:{transform:`rotate(${a}deg)`},children:"N"})}),y.map((k,P)=>i.jsx("div",{className:`minimap__marker minimap__marker--${k.type||"normal"}`,style:{left:`${k.x}%`,top:`${k.y}%`},children:k.label&&i.jsx("div",{className:"minimap__marker-label",children:k.label})},k.id||P)),d&&!s&&i.jsx("div",{className:"minimap__controls",style:u,children:i.jsxs("div",{className:"minimap__zoom-controls",children:[i.jsx("button",{className:"minimap__control-button",onClick:I,disabled:C>=t,style:c,children:"+"}),i.jsx("button",{className:"minimap__control-button",onClick:g,disabled:C<=n,style:c,children:"-"})]})})]})}function sr({id:e,position:n,size:t=[2,2,2],text:r="",type:s="normal",children:o}){return p.useEffect(()=>{const a=te.MinimapSystem.getInstance(),l=Array.isArray(n)?n:[n.x,n.y,n.z],u=Array.isArray(t)?t:[t.x,t.y,t.z];return a.addMarker(e,s,r||"",new v.Vector3(l[0],l[1],l[2]),new v.Vector3(u[0],u[1],u[2])),()=>{a.removeMarker(e)}},[e,n,t,s,r]),i.jsx(i.Fragment,{children:o})}function or({id:e,position:n,size:t,label:r,children:s}){return i.jsx(sr,{id:e,position:n,size:t,text:r,type:"ground",children:s})}const ir={info:{bg:"rgba(20,30,50,0.55)",ring:"#7aa6ff",icon:"i"},success:{bg:"rgba(20,40,30,0.55)",ring:"#7adf90",icon:"+"},warn:{bg:"rgba(50,40,20,0.55)",ring:"#ffd84a",icon:"!"},error:{bg:"rgba(50,20,20,0.55)",ring:"#ff7a7a",icon:"x"},reward:{bg:"rgba(40,30,10,0.55)",ring:"#ffc24a",icon:"*"},mail:{bg:"rgba(30,20,40,0.55)",ring:"#cf9aff",icon:"M"}};function ar({position:e="top-right",max:n=5}){const t=h.useToastStore(a=>a.toasts),r=h.useToastStore(a=>a.dismiss);p.useEffect(()=>{if(!t.length)return;const a=t.map(l=>window.setTimeout(()=>r(l.id),Math.max(500,l.durationMs)));return()=>{a.forEach(l=>window.clearTimeout(l))}},[t,r]);const s=e==="top-center"?{top:64,left:"50%",transform:"translateX(-50%)"}:{top:64,right:12},o=t.slice(-n);return i.jsxs("div",{style:{position:"fixed",zIndex:110,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",...s},children:[o.map(a=>{const l=ir[a.kind];return i.jsxs("div",{style:{minWidth:220,maxWidth:360,padding:"9px 14px",borderRadius:12,background:l.bg,color:"#f3f4f8",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500,display:"flex",alignItems:"center",gap:10,border:`1px solid ${l.ring}55`,boxShadow:"0 8px 22px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(18px) saturate(140%)",WebkitBackdropFilter:"blur(18px) saturate(140%)",animation:"gaesup-toast-in 220ms ease-out both"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:6,background:l.ring,color:"#1a1a1a",fontWeight:700},children:a.icon??l.icon}),i.jsx("span",{children:a.text})]},a.id)}),i.jsx("style",{children:`@keyframes gaesup-toast-in {
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("reflect-metadata");const Te=require("./index-D1hpjfAw.cjs"),_=require("./index-CJj-Z7Jr.cjs"),L=require("./index-DHZJyO9k.cjs"),Y=require("./runtimeFilter-W6iMw1pL.cjs"),b=require("./plugin-CS2nMv9n.cjs"),ce=require("./index-syAx2qzT.cjs"),V=require("./index-Cpso39Zs.cjs"),xn=require("three"),O=require("./gaesupStore-2zKBYTYo.cjs"),i=require("react/jsx-runtime"),p=require("react"),nt=require("./index-BhSman4a.cjs"),te=require("./index-co-QAQz9.cjs"),D=require("./timeStore-CDN035t4.cjs"),h=require("./eventsStore-Cipkf938.cjs"),N=require("./plugins.cjs"),H=require("zustand"),Q=require("@react-three/fiber"),se=require("./authority-BOPCXUrV.cjs"),T=require("./loader-D7cEHkCq.cjs"),G=require("./weatherStore-1unmwIen.cjs"),fe=require("./assetStore-DVPge_2j.cjs"),rt=require("./index-DCa_lUwq.cjs"),vn=require("./api-B58jaq5T.cjs"),st=require("./serverHost-C_bhbyiP.cjs");function In(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const v=In(xn),J=H.create((e,n)=>({entries:new Map,current:null,register:t=>{const r=new Map(n().entries);r.set(t.id,t),e({entries:r})},unregister:t=>{const r=n().entries;if(!r.has(t))return;const s=new Map(r);s.delete(t),e({entries:s})},updatePosition:(t,r)=>{const s=n().entries.get(t);s&&s.position.copy(r)},getAll:()=>Array.from(n().entries.values()),setCurrent:t=>{const r=n().current;r!==t&&(r&&t&&r.id===t.id&&Math.abs(r.distance-t.distance)<.05||e({current:t}))},activateCurrent:()=>{const t=n().current;if(!t)return;const r=n().entries.get(t.id);r&&r.onActivate()}})),Le=new v.Vector3;function De(){return J(e=>e.current)}function ot(e=!0){const n=De(),t=J(o=>o.activateCurrent),r=_.useInputBackend(),s=p.useRef(!1);p.useEffect(()=>{if(s.current=!1,!e||!n)return;const o=u=>{u&&!s.current&&t(),s.current=u},a=En(n.key);if(a&&r.subscribe)return o(!!r.getKeyboard()[a]),r.subscribe(({keyboard:u})=>{o(!!u[a])});const l=u=>{const c=u.target?.tagName?.toLowerCase();c==="input"||c==="textarea"||u.key.toLowerCase()===n.key.toLowerCase()&&t()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n,e,t,r])}function En(e){switch(e.toLowerCase()){case"w":return"forward";case"a":return"leftward";case"s":return"backward";case"d":return"rightward";case"shift":return"shift";case" ":case"space":return"space";case"z":return"keyZ";case"r":return"keyR";case"f":return"keyF";case"e":return"keyE";case"escape":return"escape";default:return null}}function wn({throttleMs:e=80}={}){const{position:n}=V.usePlayerPosition({updateInterval:16}),t=J(o=>o.entries),r=J(o=>o.setCurrent),s=p.useRef(0);return Q.useFrame((o,a)=>{if(s.current+=a*1e3,s.current<e)return;s.current=0;let l=null,u=1/0,c="",f="e";for(const d of t.values()){Le.copy(d.position).sub(n);const m=Le.lengthSq(),y=d.range*d.range;m>y||m<u&&(u=m,l=d.id,c=d.label,f=d.key)}if(!l){r(null);return}r({id:l,label:c,key:f,distance:Math.sqrt(u)})}),null}function Cn({advanceKey:e="e",closeKey:n="Escape"}){const t=T.useDialogStore(u=>u.node),r=T.useDialogStore(u=>u.runner),s=T.useDialogStore(u=>u.advance),o=T.useDialogStore(u=>u.choose),a=T.useDialogStore(u=>u.close),l=r?.visibleChoices()??[];return p.useEffect(()=>{if(!t)return;const u=c=>{if(c.key===n){a();return}if(l.length===0&&c.key.toLowerCase()===e.toLowerCase()){s();return}const f=parseInt(c.key,10);!Number.isNaN(f)&&f>=1&&f<=l.length&&o(f-1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,l.length,s,o,a,e,n]),t?i.jsxs("div",{style:{position:"fixed",left:"50%",bottom:110,transform:"translateX(-50%)",width:"min(720px, 92vw)",zIndex:120,background:"rgba(18,20,28,0.62)",color:"#f3f4f8",borderRadius:14,border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:14,padding:14},children:[t.speaker&&i.jsx("div",{style:{display:"inline-block",padding:"3px 8px",background:"#ffd84a",color:"#1a1a1a",borderRadius:6,fontWeight:700,fontSize:12,marginBottom:6},children:t.speaker}),i.jsx("div",{style:{lineHeight:1.55,whiteSpace:"pre-wrap"},children:t.text}),l.length===0?i.jsxs("div",{style:{marginTop:10,fontSize:12,opacity:.65,textAlign:"right"},children:["[",e.toUpperCase(),"] 다음"]}):i.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:l.map((u,c)=>i.jsxs("button",{onClick:()=>o(c),style:{textAlign:"left",padding:"9px 12px",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500},children:[i.jsxs("span",{style:{display:"inline-block",width:18,color:"#ffd84a",marginRight:6},children:[c+1,"."]}),u.text]},c))})]}):null}const kn="gaesup.events",Tn="events",Pn="events.store";function it(){return h.useEventsStore.getState().serialize()}function at(e){h.useEventsStore.getState().hydrate(e)}function lt(e={}){return N.createStoreDomainPlugin({id:e.id??kn,name:"GaeSup Events",saveExtensionId:e.saveExtensionId??Tn,storeServiceId:e.storeServiceId??Pn,store:h.useEventsStore,readyEvent:"events:ready",capabilities:["events"],serialize:it,hydrate:at})}const Rn=lt();function _n(e=!0,n={}){p.useEffect(()=>{if(!e)return;const t=()=>{const s=D.useTimeStore.getState().time,{started:o,ended:a}=h.useEventsStore.getState().refresh(s);o.length&&n.onStarted&&n.onStarted(o),a.length&&n.onEnded&&n.onEnded(a)};return t(),D.useTimeStore.subscribe((s,o)=>{(s.time.day!==o.time.day||s.time.month!==o.time.month||s.time.season!==o.time.season||s.time.weekday!==o.time.weekday)&&t()})},[e,n.onStarted,n.onEnded])}function jn({position:e="top-left",excludeIds:n=[]}){const t=h.useEventsStore(a=>a.active),r=h.getEventRegistry(),s=t.filter(a=>!n.includes(a));if(s.length===0)return null;const o=e==="top-right"?{top:88,right:12}:{top:88,left:12};return i.jsx("div",{style:{position:"fixed",zIndex:90,display:"flex",flexDirection:"column",gap:4,pointerEvents:"none",userSelect:"none",...o},children:s.map(a=>{const l=r.get(a);if(!l)return null;const u=l.tags?.some(c=>c==="festival"||c==="tourney");return i.jsxs("div",{style:{padding:"4px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,borderRadius:999,boxShadow:`inset 0 0 0 1px ${u?"#ffd84a55":"#7adf9055"}`,display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:u?"#ffd84a":"#7adf90"}}),i.jsx("span",{children:l.name})]},a)})})}const Dn=[{id:"season.spring",name:"봄",summary:"꽃이 피고 벌레가 깨어납니다.",triggers:[{kind:"season",seasons:["spring"]}],tags:["season:spring","fish:bass","bug:butterfly"]},{id:"season.summer",name:"여름",summary:"낚시와 곤충채집의 계절.",triggers:[{kind:"season",seasons:["summer"]}],tags:["season:summer","fish:tuna","bug:beetle","bug:stag"]},{id:"season.autumn",name:"가을",summary:"단풍이 들고 낚시 보너스.",triggers:[{kind:"season",seasons:["autumn"]}],tags:["season:autumn","fish:koi","bug:butterfly"]},{id:"season.winter",name:"겨울",summary:"눈이 내리고 곤충은 사라집니다.",triggers:[{kind:"season",seasons:["winter"]}],tags:["season:winter","fish:bass"]},{id:"event.cherryblossom",name:"벚꽃 축제",summary:"봄 한정 — 벚꽃 잎이 흩날립니다.",triggers:[{kind:"monthRange",month:4,fromDay:1,toDay:10}],tags:["festival","visual:sakura"]},{id:"event.fishing-tourney",name:"낚시 대회",summary:"주말 한정 낚시 대회 — 보너스 종 출현.",triggers:[{kind:"weekday",weekdays:["sat","sun"]}],tags:["tourney","fish:koi","fish:tuna"]}];let Oe=!1;function Mn(){Oe||(Oe=!0,h.getEventRegistry().registerAll(Dn))}const An="gaesup.inventory",Ln="inventory",On="inventory.store";function ct(){return h.useInventoryStore.getState().serialize()}function ut(e){h.useInventoryStore.getState().hydrate(e)}function dt(e={}){return N.createStoreDomainPlugin({id:e.id??An,name:"GaeSup Inventory",saveExtensionId:e.saveExtensionId??Ln,storeServiceId:e.storeServiceId??On,store:h.useInventoryStore,readyEvent:"inventory:ready",capabilities:["inventory"],serialize:ct,hydrate:ut})}const Nn=dt();function Fn(){return h.useInventoryStore(e=>({slots:e.slots,add:e.add,remove:e.remove,removeById:e.removeById,move:e.move,countOf:e.countOf,has:e.has}))}function zn(){return h.useInventoryStore(e=>{const n=e.hotbar[e.equippedHotbar];return n==null?null:e.slots[n]??null})}function ft(){const e=h.useInventoryStore(s=>s.hotbar),n=h.useInventoryStore(s=>s.slots),t=h.useInventoryStore(s=>s.equippedHotbar),r=h.useInventoryStore(s=>s.setEquippedHotbar);return{hotbar:e,slots:e.map(s=>n[s]??null),equipped:t,setEquipped:r}}function Un(e=!0){const n=h.useInventoryStore(s=>s.setEquippedHotbar),t=h.useInventoryStore(s=>s.equippedHotbar),r=h.useInventoryStore(s=>s.hotbar);p.useEffect(()=>{if(!e)return;const s=o=>{const a=o.target?.tagName?.toLowerCase();if(a==="input"||a==="textarea")return;const l=Number(o.key);if(Number.isInteger(l)&&l>=1&&l<=r.length){n(l-1);return}(o.key==="q"||o.key==="Q")&&n(t-1),(o.key==="e"||o.key==="E")&&n(t+1)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,n,t,r.length])}function Bn(){const{slots:e,equipped:n,setEquipped:t}=ft(),r=h.getItemRegistry();return i.jsx("div",{style:{position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:95,display:"flex",gap:6,padding:8,background:"rgba(18,20,28,0.55)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:14,boxShadow:"0 8px 28px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)"},children:e.map((s,o)=>{const a=s?r.get(s.itemId):void 0,l=o===n;return i.jsxs("button",{onClick:()=>t(o),title:a?.name??"",style:{width:54,height:54,borderRadius:10,border:l?"1.5px solid #ffd84a":"1px solid rgba(255,255,255,0.14)",background:l?"rgba(255,216,74,0.10)":"rgba(255,255,255,0.04)",color:"#f3f4f8",position:"relative",cursor:"pointer",padding:0,fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,boxShadow:l?"0 0 16px rgba(255,216,74,0.45)":"none",transition:"background 0.18s ease, border-color 0.18s ease"},children:[i.jsx("div",{style:{position:"absolute",top:4,left:4,width:14,height:14,borderRadius:3,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,opacity:.85},children:o+1}),s&&a?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:14,borderRadius:6,background:a.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),a.stackable&&s.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:s.count})]}):null]},o)})})}function Gn({toggleKey:e="i",initiallyOpen:n=!1}){const[t,r]=p.useState(n),s=h.useInventoryStore(c=>c.slots),o=h.useInventoryStore(c=>c.move),a=h.getItemRegistry(),[l,u]=p.useState(null);return p.useEffect(()=>{const c=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||f.key.toLowerCase()===e.toLowerCase()&&r(m=>!m)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]),t?i.jsx("div",{style:{position:"fixed",inset:0,zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:()=>r(!1),children:i.jsxs("div",{onClick:c=>c.stopPropagation(),style:{background:"rgba(20,20,20,0.95)",borderRadius:12,padding:16,minWidth:460,color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",boxShadow:"0 12px 32px rgba(0,0,0,0.6)"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("div",{style:{fontSize:14,opacity:.9},children:"Inventory"}),i.jsx("button",{onClick:()=>r(!1),style:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",fontSize:14},children:"×"})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 64px)",gap:6},children:s.map((c,f)=>{const d=c?a.get(c.itemId):void 0;return i.jsx("div",{draggable:!!c,onDragStart:()=>u(f),onDragOver:m=>{m.preventDefault()},onDrop:()=>{l!==null&&l!==f&&o(l,f),u(null)},title:d?.name??"",style:{width:64,height:64,borderRadius:6,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(0,0,0,0.5)",position:"relative",cursor:c?"grab":"default",fontSize:11},children:c&&d?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:8,borderRadius:6,background:d.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),d.stackable&&c.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:c.count})]}):null},f)})}),i.jsx("div",{style:{marginTop:12,opacity:.6,fontSize:11},children:`[${e.toUpperCase()}] 닫기 / 드래그로 이동`})]})}):null}const Vn="gaesup.quests",Wn="quests",$n="quests.store";function mt(){return T.useQuestStore.getState().serialize()}function pt(e){T.useQuestStore.getState().hydrate(e)}function gt(e={}){return N.createStoreDomainPlugin({id:e.id??Vn,name:"GaeSup Quests",saveExtensionId:e.saveExtensionId??Wn,storeServiceId:e.storeServiceId??$n,store:T.useQuestStore,readyEvent:"quests:ready",capabilities:["quests"],serialize:mt,hydrate:pt})}const qn=gt();function Hn({toggleKey:e="j"}){const[n,t]=p.useState(!1),r=T.useQuestStore(c=>c.state),s=T.useQuestStore(c=>c.complete),o=T.useQuestStore(c=>c.isObjectiveComplete),a=T.useQuestStore(c=>c.isAllObjectivesComplete);if(p.useEffect(()=>{const c=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||(f.key.toLowerCase()===e.toLowerCase()&&t(m=>!m),f.key==="Escape"&&t(!1))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]),!n)return null;const l=Object.values(r).filter(c=>c.status==="active"),u=Object.values(r).filter(c=>c.status==="completed");return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:c=>c.stopPropagation(),style:{width:560,maxHeight:"76vh",overflow:"hidden",display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(122,166,255,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:"Quest Log"}),i.jsxs("button",{onClick:()=>t(!1),style:yt(),children:["Close [",e.toUpperCase(),"]"]})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[i.jsx(Ne,{title:`Active (${l.length})`,children:l.length===0?i.jsx(Xn,{children:"No active quests."}):l.map(c=>i.jsx(Fe,{progress:c,renderObjective:f=>o(T.getQuestRegistry().require(c.questId),c,f),...a(c.questId)?{onComplete:()=>{s(c.questId)}}:{}},c.questId))}),u.length>0&&i.jsx(Ne,{title:`Completed (${u.length})`,children:u.map(c=>i.jsx(Fe,{progress:c,renderObjective:()=>!0,muted:!0},c.questId))})]})]})})}function Ne({title:e,children:n}){return i.jsxs("div",{style:{marginBottom:10},children:[i.jsx("div",{style:{padding:"6px 6px 4px",color:"#7aa6ff",fontSize:12},children:e}),n]})}function Xn({children:e}){return i.jsx("div",{style:{padding:"8px 10px",opacity:.6},children:e})}function Fe({progress:e,renderObjective:n,onComplete:t,muted:r}){const s=T.getQuestRegistry().get(e.questId);return s?i.jsxs("div",{style:{padding:10,marginBottom:6,background:"#222",borderRadius:8,opacity:r?.6:1},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[i.jsx("strong",{children:s.name}),t&&i.jsx("button",{onClick:t,style:yt(!0),children:"Report Complete"})]}),i.jsx("div",{style:{opacity:.75,marginBottom:6},children:s.summary}),i.jsx("ul",{style:{margin:0,padding:"0 0 0 16px"},children:s.objectives.map(o=>{const a=n(o),l=e.progress[o.id]??0,u=o.type==="collect"||o.type==="deliver"?o.count:1,c=o.type==="collect"?Math.min(h.useInventoryStore.getState().countOf(o.itemId),u):l,f=o.type==="collect"||o.type==="deliver"?h.getItemRegistry().get(o.itemId)?.name??o.itemId:"";return i.jsxs("li",{style:{color:a?"#7adf90":"#ddd",listStyle:"square"},children:[o.description??Yn(o,f)," ",u>1?`(${c}/${u})`:""]},o.id)})}),i.jsxs("div",{style:{marginTop:6,fontSize:11,color:"#ffd84a"},children:["Rewards: ",s.rewards.map(o=>Kn(o)).join(", ")]})]}):null}function Yn(e,n){switch(e.type){case"collect":return`Collect ${n??e.itemId}`;case"deliver":return`Deliver ${n??e.itemId} to ${e.npcId}`;case"talk":return`Talk to ${e.npcId}`;case"visit":return`Visit ${e.tag}`;case"flag":return"Meet the required condition";default:return""}}function Kn(e){switch(e.type){case"item":return`${e.itemId} x${e.count??1}`;case"bells":return`${e.amount} B`;case"friendship":return`Friendship +${e.amount}`;default:return""}}function yt(e){return{padding:"4px 10px",background:e?"#7aa6ff":"#444",color:e?"#0d1424":"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}function Qn(e=!0){p.useEffect(()=>e?h.useInventoryStore.subscribe((t,r)=>{if(t.slots===r.slots)return;const s=T.useQuestStore.getState().active();for(const o of s)T.useQuestStore.getState().recheck(o.questId)}):void 0,[e])}const Zn=5,Jn=.5,er=20,tr=200,nr=e=>{const{activeState:n}=_.useStateSystem(),t=_.useBuildingStore(g=>g.tileGroups),r=p.useRef(new Map),s=p.useRef(te.MinimapSystem.getInstance()),{scale:o=Zn,blockRotate:a=!1,updateInterval:l=33}=e,u=p.useRef(null),[c,f]=p.useState(o),d=!!(n.position&&e);p.useEffect(()=>{const g=u.current;return g&&s.current.setCanvas(g),()=>{s.current.setCanvas(null)}},[]);const m=p.useCallback(()=>{e.blockScale||f(g=>Math.min(er,g+.1))},[e.blockScale]),y=p.useCallback(()=>{e.blockScale||f(g=>Math.max(Jn,g-.1))},[e.blockScale]),x=p.useCallback(g=>{e.blockScale||(g.preventDefault(),g.deltaY<0?m():y())},[e.blockScale,m,y]),C=p.useCallback(()=>{const g=u.current;if(!g)return;const E=w=>{e.blockScale||(w.preventDefault(),w.deltaY<0?m():y())};return g.addEventListener("wheel",E,{passive:!1}),()=>{g.removeEventListener("wheel",E)}},[e.blockScale,m,y]),I=p.useCallback(()=>{const{position:g,euler:E}=n;!g||!E||s.current.render({size:tr,scale:c,position:g,rotation:E.y,blockRotate:a,tileGroups:t,sceneObjects:r.current})},[n,c,a,t]);return p.useEffect(()=>{if(!d)return;const g=setInterval(()=>{const{position:E,euler:w}=n;E&&w&&(s.current.checkForUpdates(E,w.y),I())},l);return()=>{clearInterval(g)}},[I,l,d,n]),p.useEffect(()=>{I()},[c,I]),{canvasRef:u,scale:c,upscale:m,downscale:y,handleWheel:x,setupWheelListener:C,updateCanvas:I,isReady:d}},ze=200;function rr({scale:e=5,minScale:n=.5,maxScale:t=20,blockScale:r=!1,blockScaleControl:s=!1,blockRotate:o=!1,angle:a=0,minimapStyle:l,scaleStyle:u,plusMinusStyle:c,position:f="top-right",showZoom:d=!0,showCompass:m=!0,markers:y=[]}){const{canvasRef:x,scale:C,upscale:I,downscale:g,handleWheel:E}=nr({blockScale:r,blockRotate:o}),w=f?`minimap--${f}`:"";return i.jsxs("div",{className:`minimap ${w}`,style:l,children:[i.jsx("canvas",{ref:x,className:"minimap__canvas",width:ze,height:ze,onWheel:E}),m&&i.jsx("div",{className:"minimap__compass",children:i.jsx("div",{style:{transform:`rotate(${a}deg)`},children:"N"})}),y.map((k,P)=>i.jsx("div",{className:`minimap__marker minimap__marker--${k.type||"normal"}`,style:{left:`${k.x}%`,top:`${k.y}%`},children:k.label&&i.jsx("div",{className:"minimap__marker-label",children:k.label})},k.id||P)),d&&!s&&i.jsx("div",{className:"minimap__controls",style:u,children:i.jsxs("div",{className:"minimap__zoom-controls",children:[i.jsx("button",{className:"minimap__control-button",onClick:I,disabled:C>=t,style:c,children:"+"}),i.jsx("button",{className:"minimap__control-button",onClick:g,disabled:C<=n,style:c,children:"-"})]})})]})}function sr({id:e,position:n,size:t=[2,2,2],text:r="",type:s="normal",children:o}){return p.useEffect(()=>{const a=te.MinimapSystem.getInstance(),l=Array.isArray(n)?n:[n.x,n.y,n.z],u=Array.isArray(t)?t:[t.x,t.y,t.z];return a.addMarker(e,s,r||"",new v.Vector3(l[0],l[1],l[2]),new v.Vector3(u[0],u[1],u[2])),()=>{a.removeMarker(e)}},[e,n,t,s,r]),i.jsx(i.Fragment,{children:o})}function or({id:e,position:n,size:t,label:r,children:s}){return i.jsx(sr,{id:e,position:n,size:t,text:r,type:"ground",children:s})}const ir={info:{bg:"rgba(20,30,50,0.55)",ring:"#7aa6ff",icon:"i"},success:{bg:"rgba(20,40,30,0.55)",ring:"#7adf90",icon:"+"},warn:{bg:"rgba(50,40,20,0.55)",ring:"#ffd84a",icon:"!"},error:{bg:"rgba(50,20,20,0.55)",ring:"#ff7a7a",icon:"x"},reward:{bg:"rgba(40,30,10,0.55)",ring:"#ffc24a",icon:"*"},mail:{bg:"rgba(30,20,40,0.55)",ring:"#cf9aff",icon:"M"}};function ar({position:e="top-right",max:n=5}){const t=h.useToastStore(a=>a.toasts),r=h.useToastStore(a=>a.dismiss);p.useEffect(()=>{if(!t.length)return;const a=t.map(l=>window.setTimeout(()=>r(l.id),Math.max(500,l.durationMs)));return()=>{a.forEach(l=>window.clearTimeout(l))}},[t,r]);const s=e==="top-center"?{top:64,left:"50%",transform:"translateX(-50%)"}:{top:64,right:12},o=t.slice(-n);return i.jsxs("div",{style:{position:"fixed",zIndex:110,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",...s},children:[o.map(a=>{const l=ir[a.kind];return i.jsxs("div",{style:{minWidth:220,maxWidth:360,padding:"9px 14px",borderRadius:12,background:l.bg,color:"#f3f4f8",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500,display:"flex",alignItems:"center",gap:10,border:`1px solid ${l.ring}55`,boxShadow:"0 8px 22px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(18px) saturate(140%)",WebkitBackdropFilter:"blur(18px) saturate(140%)",animation:"gaesup-toast-in 220ms ease-out both"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:6,background:l.ring,color:"#1a1a1a",fontWeight:700},children:a.icon??l.icon}),i.jsx("span",{children:a.text})]},a.id)}),i.jsx("style",{children:`@keyframes gaesup-toast-in {
|
|
2
2
|
0% { opacity: 0; transform: translateY(-6px); }
|
|
3
3
|
100% { opacity: 1; transform: translateY(0); }
|
|
4
4
|
}`})]})}function ht(e){return`${e.phase==="serialize"?"저장":"불러오기"} 실패: ${e.key} - ${e.errorMessage}`}function lr({enabled:e=!0,includeExisting:n=!1,durationMs:t=6500,kind:r="error",icon:s,formatMessage:o=ht}){const a=_.useGaesupRuntime(),l=_.useGaesupRuntimeRevision();return p.useEffect(()=>{if(!e||!a)return;const u=new Set,c=d=>{if(u.has(d.id))return;u.add(d.id);const m=Ue(r,d),y=s?Ue(s,d):void 0;h.notify(m,o(d),{durationMs:t,...y?{icon:y}:{}})},f=a.saveDiagnostics.getDiagnostics();return n?f.forEach(c):f.forEach(d=>u.add(d.id)),a.saveDiagnostics.subscribe(c)},[t,e,o,s,n,r,l,a]),null}function Ue(e,n){return typeof e=="function"?e(n):e}function cr(e,n,t){return n===t?!0:n<t?e>=n&&e<t:e>=n||e<t}function ur(e,n){return e.weekdays&&e.weekdays.length>0&&!e.weekdays.includes(n.weekday)||e.seasons&&e.seasons.length>0&&!e.seasons.includes(n.season)?!1:cr(n.hour,e.startHour,e.endHour)}function St(e,n){for(const r of e.entries)if(ur(r,n))return{position:r.position,activity:r.activity??"idle",...r.rotationY!==void 0?{rotationY:r.rotationY}:{},...r.dialogTreeId?{dialogTreeId:r.dialogTreeId}:{},source:r};const t=e.defaultEntry;return{position:t?.position??[0,0,0],activity:t?.activity??"idle",...t?.rotationY!==void 0?{rotationY:t.rotationY}:{},...t?.dialogTreeId?{dialogTreeId:t.dialogTreeId}:{},source:null}}class dr{map=new Map;register(n){this.map.set(n.npcId,n)}unregister(n){this.map.delete(n)}get(n){return this.map.get(n)}resolve(n,t){const r=this.map.get(n);return r?St(r,t):null}all(){return Array.from(this.map.values())}clear(){this.map.clear()}}let Se=null;function Pe(){return Se||(Se=new dr),Se}const fr="gaesup.npc",mr="npc",pr="npc.store";function B(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}function bt(){const e=b.useNPCStore.getState();return{version:1,templates:Array.from(e.templates.values(),B),instances:Array.from(e.instances.values(),B),categories:Array.from(e.categories.values(),B),clothingSets:Array.from(e.clothingSets.values(),B),clothingCategories:Array.from(e.clothingCategories.values(),B),animations:Array.from(e.animations.values(),B),brainBlueprints:Array.from(e.brainBlueprints.values(),B),editMode:e.editMode}}function xt(e){if(!e)return;const n=Array.isArray(e)?e:e.instances;b.useNPCStore.setState(t=>{Array.isArray(e)||(e.templates&&(t.templates=new Map(e.templates.map(r=>[r.id,B(r)]))),e.categories&&(t.categories=new Map(e.categories.map(r=>[r.id,B(r)]))),e.clothingSets&&(t.clothingSets=new Map(e.clothingSets.map(r=>[r.id,B(r)]))),e.clothingCategories&&(t.clothingCategories=new Map(e.clothingCategories.map(r=>[r.id,B(r)]))),e.animations&&(t.animations=new Map(e.animations.map(r=>[r.id,B(r)]))),e.brainBlueprints&&(t.brainBlueprints=new Map(e.brainBlueprints.map(r=>[r.id,B(r)]))),typeof e.editMode=="boolean"&&(t.editMode=e.editMode)),n&&(t.instances=new Map(n.map(r=>[r.id,B(r)])))})}function vt(e={}){const n=e.id??fr,t=e.saveExtensionId??mr,r=e.storeServiceId??pr;return{id:n,name:"GaeSup NPC",version:"0.1.0",runtime:"client",capabilities:["npc"],setup(s){s.save.register(t,{key:t,serialize:bt,hydrate:xt},n),s.services.register(r,{useStore:b.useNPCStore,getState:b.useNPCStore.getState,setState:b.useNPCStore.setState},n),s.events.emit("npc:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const gr=vt();function yr(e){const[n,t]=p.useState(()=>{const r=D.useTimeStore.getState();return Pe().resolve(e,r.time)});return p.useEffect(()=>{let r=-1;const s=()=>{const a=D.useTimeStore.getState();if(a.time.hour===r)return;r=a.time.hour;const l=Pe().resolve(e,a.time);t(l)};return s(),D.useTimeStore.subscribe((a,l)=>{(a.time.hour!==l.time.hour||a.time.day!==l.time.day||a.time.weekday!==l.time.weekday)&&s()})},[e]),n}const hr="gaesup.camera",It="camera.system",Et="camera",wt="camera.store",Sr=new Set(["offset","target","position","focusTarget","fixedPosition"]);function Re(e){if(e instanceof v.Vector3)return{x:e.x,y:e.y,z:e.z};if(e instanceof v.Euler)return{x:e.x,y:e.y,z:e.z,order:e.order};if(Array.isArray(e))return e.map(Re);if(e&&typeof e=="object")return Object.fromEntries(Object.entries(e).map(([n,t])=>[n,Re(t)]));if(e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Ct(e){if(!e||typeof e!="object")return!1;const n=e;return typeof n.x=="number"&&typeof n.y=="number"&&typeof n.z=="number"}function br(e){return Ct(e)?typeof e.order=="string":!1}function xr(e){const n={};for(const[t,r]of Object.entries(e)){if(Sr.has(t)&&Ct(r)){Object.assign(n,{[t]:new v.Vector3(r.x,r.y,r.z)});continue}if(t==="rotation"&&br(r)){Object.assign(n,{rotation:new v.Euler(r.x,r.y,r.z,r.order)});continue}Object.assign(n,{[t]:r})}return n}function Be(){const e=O.useGaesupStore.getState();return{mode:{...e.mode},cameraOption:Re(e.cameraOption)}}function vr(e){if(!e||typeof e!="object")return;const n=O.useGaesupStore.getState();e.mode&&typeof e.mode=="object"&&n.setMode(e.mode),e.cameraOption&&typeof e.cameraOption=="object"&&n.setCameraOption(xr(e.cameraOption))}function kt(e={}){const n=e.id??hr,t=e.systemExtensionId??It,r=e.saveExtensionId??Et,s=e.storeServiceId??wt;return{id:n,name:"GaeSup Camera",version:"0.1.0",runtime:"client",capabilities:["camera"],setup(o){o.systems.register(t,{System:Te.CameraSystem,create:a=>new Te.CameraSystem(a)},n),o.save.register(r,{key:r,serialize:Be,hydrate:vr},n),o.services.register(s,{useStore:O.useGaesupStore,getState:Be,setMode:a=>O.useGaesupStore.getState().setMode(a),setCameraOption:a=>O.useGaesupStore.getState().setCameraOption(a)},n),o.events.emit("camera:ready",{pluginId:n,systemExtensionId:t,saveExtensionId:r,storeServiceId:s})},dispose(o){o.systems.remove(t),o.save.remove(r),o.services.remove(s)}}}const Ir=kt();function Er(){const{activeState:e,gameStates:n}=_.useStateSystem(),t=O.useGaesupStore(a=>a.mode),r=O.useGaesupStore(a=>a.controllerOptions),s=O.useGaesupStore.getState();return{state:e||null,mode:t,states:n,control:r,context:{mode:t,states:n,control:r},controller:s}}function Me(){const{activeState:e,updateActiveState:n}=_.useStateSystem(),t=!!e;return{teleport:p.useCallback((s,o)=>{if(!e){console.warn("[useTeleport]: Cannot teleport - activeState not available");return}n({position:s.clone(),euler:o||e.euler})},[e,n]),canTeleport:t}}function wr({value:e,name:n,gamePadButtonStyle:t}){const[r,s]=p.useState(!1),{pushKey:o}=V.useKeyboard(),a=()=>{o(e,!0),s(!0)},l=()=>{o(e,!1),s(!1)};return i.jsx("button",{className:`pad-button ${r?"is-clicked":""}`,onMouseDown:a,onMouseUp:l,onMouseLeave:l,onContextMenu:u=>{u.preventDefault(),l()},onPointerDown:a,onPointerUp:l,style:t,children:n})}function Cr(e){const{gamePadStyle:n,gamePadButtonStyle:t,label:r}=e,s=O.useGaesupStore(l=>l.interaction?.keyboard),{mode:o}=O.useGaesupStore();V.useKeyboard();const a=Object.keys(s||{}).map(l=>{const u=r?.[l]||l;return l==="forward"||l==="backward"||l==="leftward"||l==="rightward"?{key:l,name:u,type:"direction",active:s?.[l]||!1}:{key:l,name:u,type:"action",active:s?.[l]||!1}}).filter(Boolean);return i.jsx("div",{className:"gamepad-container",style:{...n,display:o?.controller==="gamepad"?"flex":"none"},children:a.map(l=>i.jsx(wr,{value:l.key,name:l.name,gamePadButtonStyle:t},l.key))})}function kr(){const{cameraOption:e,setCameraOption:n}=O.useGaesupStore.getState();e?.focus&&n({focus:!1})}const Tt=p.forwardRef(({children:e,position:n,focusDistance:t=10,focusDuration:r=1,onFocus:s,onBlur:o,...a},l)=>{const u=O.useGaesupStore(x=>x.setCameraOption),c=O.useGaesupStore(x=>x.cameraOption),f=x=>{if(x.stopPropagation(),!c?.enableFocus)return;if(c.focus){kr(),o&&o(x);return}const C=x.object.getWorldPosition(new v.Vector3);u({focusTarget:C,focusDuration:r,focusDistance:t,focus:!0}),s&&s(x)},d=()=>{c?.enableFocus&&(document.body.style.cursor="pointer")},m=x=>{document.body.style.cursor="default",o&&!c?.focus&&o(x)},y={...a,...n?{position:n}:{}};return i.jsx("group",{ref:l,onClick:f,onPointerOver:d,onPointerOut:m,...y,children:e})});Tt.displayName="FocusableObject";function Tr({id:e,kind:n="misc",label:t,range:r=2.2,activationKey:s="e",data:o,onActivate:a,position:l,children:u}){const c=p.useId(),f=e??c,d=J(I=>I.register),m=J(I=>I.unregister),y=J(I=>I.updatePosition),x=p.useRef(null),C=p.useMemo(()=>new v.Vector3(...l),[l]);return p.useEffect(()=>(d({id:f,kind:n,label:t,position:C.clone(),range:r,key:s,...o?{data:o}:{},onActivate:a}),()=>m(f)),[f,n,t,r,s,o,a,d,m,C]),p.useEffect(()=>{y(f,C)},[f,C,y]),i.jsx("group",{ref:x,position:l,children:u})}function Pr({enabled:e=!0}){const n=De();return ot(e),!e||!n?null:i.jsxs("div",{style:{position:"fixed",bottom:96,left:"50%",transform:"translateX(-50%)",zIndex:96,padding:"8px 14px",background:"rgba(18,20,28,0.55)",color:"#f3f4f8",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500,borderRadius:999,border:"1px solid rgba(255,255,255,0.12)",display:"flex",alignItems:"center",gap:10,boxShadow:"0 8px 22px rgba(0,0,0,0.32)",backdropFilter:"blur(18px) saturate(140%)",WebkitBackdropFilter:"blur(18px) saturate(140%)",pointerEvents:"none",userSelect:"none"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:22,height:22,padding:"0 6px",borderRadius:6,background:"#ffd84a",color:"#222",fontWeight:700},children:n.key.toUpperCase()}),i.jsx("span",{children:n.label}),i.jsxs("span",{style:{opacity:.5,fontSize:11},children:[n.distance.toFixed(1),"m"]})]})}function Rr({showController:e=!0,showDebugPanel:n=!0,controllerProps:t={},debugPanelProps:r={}}){return i.jsxs(i.Fragment,{children:[e&&i.jsx(b.MotionController,{position:"bottom-left",showLabels:!0,compact:!1,...t}),n&&i.jsx(b.MotionDebugPanel,{position:"top-right",updateInterval:100,precision:2,compact:!1,...r})]})}function _r({text:e,position:n,teleportStyle:t}){const{teleport:r,canTeleport:s}=Me(),o=()=>{r(n)};return i.jsxs("div",{className:`teleport ${s?"":"teleport--disabled"}`,onClick:o,style:t,title:s?"Click to teleport":"Teleport not available",children:[e||"Teleport",!s&&i.jsx("span",{className:"teleport__cooldown",children:"⏱️"})]})}const jr="gaesup.time",Dr="time",Mr="time.store";function Pt(){return D.useTimeStore.getState().serialize()}function Rt(e){D.useTimeStore.getState().hydrate(e)}function _t(e={}){const n=e.id??jr,t=e.saveExtensionId??Dr,r=e.storeServiceId??Mr;return{id:n,name:"GaeSup Time",version:"0.1.0",runtime:"client",capabilities:["time"],setup(s){s.save.register(t,{key:t,serialize:Pt,hydrate:Rt},n),s.services.register(r,{useStore:D.useTimeStore,getState:D.useTimeStore.getState,setState:D.useTimeStore.setState},n),s.events.emit("time:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const Ar=_t();function jt(){return D.useTimeStore(e=>e.time)}function Lr(){return D.useTimeStore(e=>({hour:e.time.hour,minute:e.time.minute}))}function Or(e=!0){const n=D.useTimeStore(r=>r.tick),t=p.useRef(0);p.useEffect(()=>{if(!e)return;let r=0,s=!0;const o=a=>{if(!s)return;const l=t.current||a,u=a-l;t.current=a,n(u),r=requestAnimationFrame(o)};return r=requestAnimationFrame(o),()=>{s=!1,cancelAnimationFrame(r)}},[e,n])}function Nr(e){const n=D.useTimeStore(t=>t.addListener);p.useEffect(()=>n(t=>{t.kind==="newDay"&&e(t.time)}),[n,e])}function Fr(e){const n=D.useTimeStore(t=>t.addListener);p.useEffect(()=>n(t=>{t.kind==="newHour"&&e(t.time)}),[n,e])}const zr={spring:"#ffb6c1",summer:"#9bd97a",autumn:"#e0a060",winter:"#cfe2ff"},Ur={sun:"일",mon:"월",tue:"화",wed:"수",thu:"목",fri:"금",sat:"토"};function Br(){const e=jt(),n=String(e.hour).padStart(2,"0"),t=String(e.minute).padStart(2,"0");return i.jsx("div",{style:{position:"fixed",top:10,left:10,zIndex:90,padding:"6px 10px",background:"rgba(0,0,0,0.55)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,borderRadius:6,userSelect:"none",pointerEvents:"none",backdropFilter:"blur(4px)"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:zr[e.season]??"#fff"}}),i.jsxs("span",{children:["Y",e.year," M",String(e.month).padStart(2,"0")," D",String(e.day).padStart(2,"0")," ","(",Ur[e.weekday],")"]}),i.jsxs("span",{style:{opacity:.85},children:[n,":",t]})]})})}const Dt=[{id:"apple",name:"사과",icon:"apple",category:"food",stackable:!0,maxStack:99,buyPrice:100,sellPrice:50,color:"#e54b4b",rarity:"common",description:"아삭한 사과. 그냥 먹어도, 팔아도 좋다."},{id:"wood",name:"목재",icon:"wood",category:"material",stackable:!0,maxStack:99,sellPrice:30,color:"#a07a4a",rarity:"common",description:"나무를 베면 얻을 수 있는 기본 재료."},{id:"stone",name:"돌",icon:"stone",category:"material",stackable:!0,maxStack:99,sellPrice:25,color:"#7a7a7a",rarity:"common"},{id:"flower-pink",name:"분홍 꽃",icon:"flower",category:"material",stackable:!0,maxStack:99,sellPrice:40,color:"#ff8fb1"},{id:"axe",name:"도끼",icon:"axe",category:"tool",stackable:!1,maxStack:1,buyPrice:800,color:"#9b6b3a",toolKind:"axe",durability:60,description:"나무를 벨 수 있다."},{id:"shovel",name:"삽",icon:"shovel",category:"tool",stackable:!1,maxStack:1,buyPrice:600,color:"#777777",toolKind:"shovel",durability:80,description:"땅을 팔 수 있다."},{id:"water-can",name:"물뿌리개",icon:"water-can",category:"tool",stackable:!1,maxStack:1,buyPrice:500,color:"#4aa8ff",toolKind:"water",durability:100,description:"꽃에 물을 줄 수 있다."},{id:"net",name:"곤충채집망",icon:"net",category:"tool",stackable:!1,maxStack:1,buyPrice:700,color:"#d8d8d8",toolKind:"net",durability:50},{id:"rod",name:"낚싯대",icon:"rod",category:"tool",stackable:!1,maxStack:1,buyPrice:900,color:"#5a3a2a",toolKind:"rod",durability:50},{id:"shell",name:"조개",icon:"shell",category:"material",stackable:!0,maxStack:99,sellPrice:60,color:"#ffd9c2"},{id:"fish-bass",name:"배스",icon:"fish",category:"fish",stackable:!0,maxStack:99,sellPrice:200,color:"#5a8a8a",rarity:"common"},{id:"fish-tuna",name:"참다랑어",icon:"fish",category:"fish",stackable:!0,maxStack:99,sellPrice:700,color:"#3a5a8a",rarity:"rare"},{id:"fish-koi",name:"비단잉어",icon:"fish",category:"fish",stackable:!0,maxStack:99,sellPrice:1200,color:"#ff8a4a",rarity:"epic"},{id:"bug-butterfly",name:"나비",icon:"bug",category:"bug",stackable:!0,maxStack:99,sellPrice:160,color:"#ffd0e0",rarity:"common"},{id:"bug-beetle",name:"풍뎅이",icon:"bug",category:"bug",stackable:!0,maxStack:99,sellPrice:400,color:"#3a3a8a",rarity:"uncommon"},{id:"bug-stag",name:"사슴벌레",icon:"bug",category:"bug",stackable:!0,maxStack:99,sellPrice:900,color:"#5a2a1a",rarity:"rare"},{id:"seed-turnip",name:"순무 씨앗",icon:"seed",category:"material",stackable:!0,maxStack:99,buyPrice:80,sellPrice:20,color:"#cfeeb6",toolKind:"seed"},{id:"seed-tomato",name:"토마토 씨앗",icon:"seed",category:"material",stackable:!0,maxStack:99,buyPrice:120,sellPrice:30,color:"#9adf90",toolKind:"seed"},{id:"turnip",name:"순무",icon:"turnip",category:"food",stackable:!0,maxStack:99,sellPrice:220,color:"#ffeeaa",rarity:"common"},{id:"tomato",name:"토마토",icon:"tomato",category:"food",stackable:!0,maxStack:99,sellPrice:360,color:"#e54b4b",rarity:"uncommon"}];function Gr(){h.getItemRegistry().registerAll(Dt)}const Vr=["axe","shovel","water-can","net","rod","apple"];function Wr(e,n,t){const r=e.slice();for(let s=r.length-1;s>0;s--){const o=Math.floor(t()*(s+1));[r[s],r[o]]=[r[o],r[s]]}return r.slice(0,Math.min(n,r.length))}function $r(e){let n=e|0||1;return()=>(n=n*1664525+1013904223|0,(n>>>0)/4294967295)}const X=H.create((e,n)=>({catalog:Vr,dailyStock:[],lastRolledDay:-1,setCatalog:t=>e({catalog:t.slice()}),rollDailyStock:(t,r=4)=>{const s=n();if(s.lastRolledDay===t&&s.dailyStock.length>0)return;const o=$r(t*9301+49297),l=Wr(s.catalog,r,o).map(u=>{const c=h.getItemRegistry().get(u),f=c?.stackable?5+Math.floor(o()*6):1;return{itemId:u,price:c?.buyPrice??100,stock:f}});e({dailyStock:l,lastRolledDay:t})},buy:(t,r=1)=>{if(r<=0)return{ok:!1,reason:"invalid count"};const s=n(),o=s.dailyStock.findIndex(m=>m.itemId===t);if(o<0)return{ok:!1,reason:"not in stock"};const a=s.dailyStock[o],l=a.stock??0;if(l<r)return{ok:!1,reason:"insufficient stock"};const u=(a.price??n().priceOf(t))*r,c=T.useWalletStore.getState();if(c.bells<u)return{ok:!1,reason:"insufficient bells"};if(!c.spend(u))return{ok:!1,reason:"spend failed"};if(h.useInventoryStore.getState().add(t,r)>0)return c.add(u),{ok:!1,reason:"inventory full"};const d=s.dailyStock.slice();return d[o]={...a,stock:l-r},e({dailyStock:d}),{ok:!0}},sell:(t,r=1)=>{if(r<=0)return{ok:!1,reason:"invalid count"};if(h.useInventoryStore.getState().countOf(t)<r)return{ok:!1,reason:"not enough items"};const o=h.useInventoryStore.getState().removeById(t,r);if(o<r)return{ok:!1,reason:"remove failed"};const a=n().sellPriceOf(t)*o;return a>0&&T.useWalletStore.getState().add(a),{ok:!0}},priceOf:t=>{const s=n().dailyStock.find(o=>o.itemId===t);return s?.price!=null?s.price:h.getItemRegistry().get(t)?.buyPrice??0},sellPriceOf:t=>h.getItemRegistry().get(t)?.sellPrice??0,serialize:()=>{const t=n();return{version:1,lastRolledDay:t.lastRolledDay,dailyStock:t.dailyStock.map(r=>({...r}))}},hydrate:t=>{t&&e({lastRolledDay:typeof t.lastRolledDay=="number"?t.lastRolledDay:-1,dailyStock:Array.isArray(t.dailyStock)?t.dailyStock.map(r=>({...r})):[]})}})),qr="gaesup.economy",Hr="wallet",Xr="shop",Yr="wallet.store",Kr="shop.store";function Mt(){return T.useWalletStore.getState().serialize()}function At(e){T.useWalletStore.getState().hydrate(e)}function Lt(){return X.getState().serialize()}function Ot(e){X.getState().hydrate(e)}function Nt(e={}){const n=e.id??qr,t=e.walletSaveExtensionId??Hr,r=e.shopSaveExtensionId??Xr,s=e.walletStoreServiceId??Yr,o=e.shopStoreServiceId??Kr;return{id:n,name:"GaeSup Economy",version:"0.1.0",runtime:"client",capabilities:["economy","wallet","shop"],setup(a){a.save.register(t,{key:t,serialize:Mt,hydrate:At},n),a.save.register(r,{key:r,serialize:Lt,hydrate:Ot},n),a.services.register(s,{useStore:T.useWalletStore,getState:T.useWalletStore.getState,setState:T.useWalletStore.setState},n),a.services.register(o,{useStore:X,getState:X.getState,setState:X.setState},n),a.events.emit("economy:ready",{pluginId:n,walletSaveExtensionId:t,shopSaveExtensionId:r,walletStoreServiceId:s,shopStoreServiceId:o})},dispose(a){a.save.remove(t),a.save.remove(r),a.services.remove(s),a.services.remove(o)}}}const Qr=Nt();function Zr({position:e="top-center"}){const n=T.useWalletStore(r=>r.bells),t=e==="bottom-right"?{bottom:96,right:12}:{top:10,left:"50%",transform:"translateX(-50%)"};return i.jsxs("div",{style:{position:"fixed",zIndex:90,padding:"6px 12px",background:"rgba(40,30,10,0.85)",color:"#ffd84a",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,borderRadius:999,display:"flex",alignItems:"center",gap:8,boxShadow:"inset 0 0 0 1px rgba(255,216,74,0.4)",pointerEvents:"none",userSelect:"none",...t},children:[i.jsx("span",{style:{width:16,height:16,borderRadius:"50%",background:"#ffd84a",color:"#3a2a08",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:11},children:"B"}),i.jsx("span",{style:{fontWeight:700},children:n.toLocaleString()})]})}function Jr({open:e,onClose:n,title:t="Shop"}){const[r,s]=p.useState("buy"),o=X(m=>m.dailyStock),a=X(m=>m.buy),l=X(m=>m.sell),u=X(m=>m.sellPriceOf),c=T.useWalletStore(m=>m.bells),f=h.useInventoryStore(m=>m.slots);if(!e)return null;const d=(()=>{const m=new Map;for(const y of f)y&&m.set(y.itemId,(m.get(y.itemId)??0)+y.count);return Array.from(m.entries()).filter(([y])=>u(y)>0)})();return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.55)"},onClick:n,children:i.jsxs("div",{onClick:m=>m.stopPropagation(),style:{width:520,maxHeight:"70vh",overflow:"hidden",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,216,74,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #333"},children:[i.jsx("strong",{style:{fontSize:15},children:t}),i.jsxs("span",{style:{color:"#ffd84a"},children:[c.toLocaleString()," B"]}),i.jsx("button",{onClick:n,style:Ft(),children:"닫기"})]}),i.jsxs("div",{style:{display:"flex",borderBottom:"1px solid #333"},children:[i.jsx(Ge,{active:r==="buy",onClick:()=>s("buy"),children:"구매"}),i.jsx(Ge,{active:r==="sell",onClick:()=>s("sell"),children:"판매"})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[r==="buy"&&(o.length===0?i.jsx("div",{style:{opacity:.7,padding:12},children:"오늘 상품이 없습니다."}):o.map(m=>{const y=h.getItemRegistry().get(m.itemId),x=m.price??y?.buyPrice??0,C=m.stock??0;return i.jsx(Ve,{...y?.color?{color:y.color}:{},name:y?.name??m.itemId,sub:`재고 ${C}`,price:x,disabled:C<=0||c<x,actionLabel:"구매",onAction:()=>{const I=a(m.itemId,1);I.ok?h.notify("success",`${y?.name??m.itemId} 구매`):h.notify("warn",`구매 실패: ${I.reason??""}`)}},m.itemId)})),r==="sell"&&(d.length===0?i.jsx("div",{style:{opacity:.7,padding:12},children:"판매할 아이템이 없습니다."}):d.map(([m,y])=>{const x=h.getItemRegistry().get(m),C=u(m);return i.jsx(Ve,{...x?.color?{color:x.color}:{},name:x?.name??m,sub:`보유 ${y}`,price:C,actionLabel:"판매",onAction:()=>{const I=l(m,1);I.ok?h.notify("reward",`${x?.name??m} 판매 +${C} B`):h.notify("warn",`판매 실패: ${I.reason??""}`)}},m)}))]})]})})}function Ge({active:e,onClick:n,children:t}){return i.jsx("button",{onClick:n,style:{flex:1,padding:"8px 10px",background:e?"#262626":"transparent",color:e?"#ffd84a":"#ddd",border:"none",cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:t})}function Ve({color:e,name:n,sub:t,price:r,actionLabel:s,onAction:o,disabled:a}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 6px",borderBottom:"1px solid #2a2a2a"},children:[i.jsx("span",{style:{width:22,height:22,borderRadius:6,background:e??"#888"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{children:n}),t&&i.jsx("div",{style:{fontSize:11,opacity:.7},children:t})]}),i.jsxs("div",{style:{color:"#ffd84a",minWidth:64,textAlign:"right"},children:[r.toLocaleString()," B"]}),i.jsx("button",{onClick:o,disabled:a,style:Ft(a),children:s})]})}function Ft(e){return{padding:"6px 10px",background:e?"#333":"#444",color:e?"#777":"#fff",border:"none",borderRadius:6,cursor:e?"not-allowed":"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12}}function es({useKey:e="f",range:n=2.4,cooldownMs:t=350}={}){const{position:r,rotation:s}=V.usePlayerPosition({updateInterval:16}),o=p.useRef(0);return p.useEffect(()=>{const a=`Key${e.toUpperCase()}`,l=e.toLowerCase(),u=c=>{const f=c.target?.tagName?.toLowerCase();if(f==="input"||f==="textarea"||c.code!==a&&c.key.toLowerCase()!==l)return;const d=performance.now();if(d-o.current<t)return;const m=h.useInventoryStore.getState().getEquipped();if(!m)return;const y=h.getItemRegistry().get(m.itemId);if(!y?.toolKind)return;const x=y.toolKind,C=s?.y??0,I=new v.Vector3(Math.sin(C),0,Math.cos(C)).normalize();o.current=d,L.getToolEvents().emit({kind:x,origin:[r.x,r.y,r.z],direction:[I.x,I.y,I.z],range:n,timestamp:d})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,t,n,r,s]),null}const ts="gaesup.relations",ns="relations",rs="relations.store";function zt(){return T.useFriendshipStore.getState().serialize()}function Ut(e){T.useFriendshipStore.getState().hydrate(e)}function Bt(e={}){return N.createStoreDomainPlugin({id:e.id??ts,name:"GaeSup Relations",saveExtensionId:e.saveExtensionId??ns,storeServiceId:e.storeServiceId??rs,store:T.useFriendshipStore,readyEvent:"relations:ready",capabilities:["relations"],serialize:zt,hydrate:Ut})}const ss=Bt();let os=0;function is(){return`mail_${Date.now().toString(36)}_${(++os).toString(36)}`}function as(e){return e.itemId!==void 0}const Z=H.create((e,n)=>({messages:[],send:t=>{const r=t.id??is(),s={id:r,from:t.from,subject:t.subject,body:t.body,sentDay:t.sentDay,...t.attachments?{attachments:t.attachments}:{},read:!1,claimed:!t.attachments||t.attachments.length===0};return e({messages:[...n().messages,s]}),h.notify("mail",`새 우편: ${t.subject}`),r},markRead:t=>{e({messages:n().messages.map(r=>r.id===t?{...r,read:!0}:r)})},markAllRead:()=>{e({messages:n().messages.map(t=>({...t,read:!0}))})},claim:t=>{const r=n().messages.find(o=>o.id===t);if(!r||r.claimed||!r.attachments)return!1;let s=!0;for(const o of r.attachments)if(as(o)){if(h.useInventoryStore.getState().add(o.itemId,o.count??1)>0){s=!1,h.notify("warn","인벤토리 부족, 일부 우편물 미수령");break}}else T.useWalletStore.getState().add(o.bells);return s&&(e({messages:n().messages.map(o=>o.id===t?{...o,claimed:!0,read:!0}:o)}),h.notify("reward","우편 첨부물 수령")),s},delete:t=>{e({messages:n().messages.filter(r=>r.id!==t)})},unreadCount:()=>n().messages.reduce((t,r)=>t+(r.read?0:1),0),hasUnclaimedAttachments:()=>n().messages.some(t=>!t.claimed&&(t.attachments?.length??0)>0),serialize:()=>({version:1,messages:n().messages.map(t=>({...t,...t.attachments?{attachments:t.attachments.map(r=>({...r}))}:{}}))}),hydrate:t=>{!t||!Array.isArray(t.messages)||e({messages:t.messages.map(r=>({...r}))})}})),ls="gaesup.mail",cs="mail",us="mail.store";function Gt(){return Z.getState().serialize()}function Vt(e){Z.getState().hydrate(e)}function Wt(e={}){return N.createStoreDomainPlugin({id:e.id??ls,name:"GaeSup Mail",saveExtensionId:e.saveExtensionId??cs,storeServiceId:e.storeServiceId??us,store:Z,readyEvent:"mail:ready",capabilities:["mail"],serialize:Gt,hydrate:Vt})}const ds=Wt();function fs({toggleKey:e="m"}){const[n,t]=p.useState(!1),[r,s]=p.useState(null),o=Z(d=>d.messages),a=Z(d=>d.markRead),l=Z(d=>d.claim),u=Z(d=>d.delete);if(p.useEffect(()=>{const d=m=>{const y=m.target?.tagName?.toLowerCase();y==="input"||y==="textarea"||(m.key.toLowerCase()===e.toLowerCase()&&t(x=>!x),m.key==="Escape"&&t(!1))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e]),!n)return null;const c=o.slice().sort((d,m)=>m.sentDay-d.sentDay),f=r?c.find(d=>d.id===r)??null:null;return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:d=>d.stopPropagation(),style:{width:720,height:460,display:"flex",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(207,154,255,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,overflow:"hidden"},children:[i.jsxs("div",{style:{width:260,borderRight:"1px solid #333",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{children:"우편함"}),i.jsx("span",{style:{fontSize:12,opacity:.7},children:c.length})]}),i.jsx("div",{style:{flex:1,overflowY:"auto"},children:c.length===0?i.jsx(ps,{children:"우편이 없습니다."}):c.map(d=>i.jsxs("div",{onClick:()=>{s(d.id),d.read||a(d.id)},style:{padding:"8px 12px",cursor:"pointer",background:r===d.id?"#262626":"transparent",borderBottom:"1px solid #2a2a2a",opacity:d.read?.7:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[!d.read&&i.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#cf9aff"}}),i.jsx("strong",{style:{fontSize:13},children:d.subject})]}),i.jsxs("div",{style:{fontSize:11,opacity:.6},children:[d.from," · day ",d.sentDay]}),d.attachments&&d.attachments.length>0&&!d.claimed&&i.jsx("div",{style:{fontSize:11,color:"#ffd84a"},children:"* 첨부물"})]},d.id))})]}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("span",{children:f?f.subject:"메시지를 선택하세요"}),i.jsxs("button",{onClick:()=>t(!1),style:_e(),children:["닫기 [",e.toUpperCase(),"]"]})]}),i.jsx("div",{style:{flex:1,padding:12,overflowY:"auto"},children:f?i.jsx(ms,{msg:f,onClaim:()=>l(f.id),onDelete:()=>{u(f.id),s(null)}}):i.jsx("div",{style:{opacity:.6},children:"왼쪽에서 메시지를 선택하세요."})})]})]})})}function ms({msg:e,onClaim:n,onDelete:t}){return i.jsxs("div",{children:[i.jsxs("div",{style:{marginBottom:6,opacity:.75},children:["From. ",e.from]}),i.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:1.6,marginBottom:12},children:e.body}),e.attachments&&e.attachments.length>0&&i.jsxs("div",{style:{padding:10,background:"#222",borderRadius:8,marginBottom:8},children:[i.jsx("div",{style:{marginBottom:6,color:"#ffd84a",fontSize:12},children:"첨부물"}),i.jsx("ul",{style:{margin:0,paddingLeft:18},children:e.attachments.map((r,s)=>{if("itemId"in r){const o=h.getItemRegistry().get(r.itemId);return i.jsxs("li",{children:[o?.name??r.itemId," x",r.count??1]},s)}return i.jsxs("li",{children:[r.bells," B"]},s)})}),i.jsx("div",{style:{marginTop:8,display:"flex",gap:6,justifyContent:"flex-end"},children:e.claimed?i.jsx("span",{style:{fontSize:12,opacity:.6},children:"수령 완료"}):i.jsx("button",{onClick:n,style:_e(!0),children:"받기"})})]}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:i.jsx("button",{onClick:t,style:_e(),children:"삭제"})})]})}function ps({children:e}){return i.jsx("div",{style:{padding:14,opacity:.6},children:e})}function _e(e){return{padding:"6px 10px",background:e?"#cf9aff":"#444",color:e?"#1a0d24":"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}const je=["fish","bug","food","material","furniture","tool","misc"],ae=H.create((e,n)=>({entries:{},record:(t,r,s)=>{if(r<=0)return;const o=n().entries[t],a=o?{...o,totalCollected:o.totalCollected+r}:{itemId:t,firstSeenDay:s,totalCollected:r};e({entries:{...n().entries,[t]:a}})},has:t=>!!n().entries[t],get:t=>n().entries[t],size:()=>Object.keys(n().entries).length,serialize:()=>({version:1,entries:Object.fromEntries(Object.entries(n().entries).map(([t,r])=>[t,{...r}]))}),hydrate:t=>{if(!t||typeof t!="object")return;const r={};if(t.entries&&typeof t.entries=="object")for(const[s,o]of Object.entries(t.entries))!o||typeof o!="object"||(r[s]={itemId:s,firstSeenDay:typeof o.firstSeenDay=="number"?o.firstSeenDay:0,totalCollected:typeof o.totalCollected=="number"?o.totalCollected:0});e({entries:r})}})),gs="gaesup.catalog",ys="catalog",hs="catalog.store";function $t(){return ae.getState().serialize()}function qt(e){ae.getState().hydrate(e)}function Ht(e={}){return N.createStoreDomainPlugin({id:e.id??gs,name:"GaeSup Catalog",saveExtensionId:e.saveExtensionId??ys,storeServiceId:e.storeServiceId??hs,store:ae,readyEvent:"catalog:ready",capabilities:["catalog"],serialize:$t,hydrate:qt})}const Ss=Ht();function bs(e=!0){p.useEffect(()=>e?h.useInventoryStore.subscribe((t,r)=>{if(t.slots===r.slots)return;const s=Math.floor(D.useTimeStore.getState().totalMinutes/(60*24)),o=new Map;for(const l of r.slots)l&&o.set(l.itemId,(o.get(l.itemId)??0)+l.count);const a=new Map;for(const l of t.slots)l&&a.set(l.itemId,(a.get(l.itemId)??0)+l.count);for(const[l,u]of a.entries()){const c=u-(o.get(l)??0);c>0&&ae.getState().record(l,c,s)}}):void 0,[e])}function xs({toggleKey:e="k"}){const[n,t]=p.useState(!1),[r,s]=p.useState("fish"),o=ae(f=>f.entries);p.useEffect(()=>{const f=d=>{const m=d.target?.tagName?.toLowerCase();m==="input"||m==="textarea"||(d.key.toLowerCase()===e.toLowerCase()&&t(y=>!y),d.key==="Escape"&&t(!1))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e]);const a=p.useMemo(()=>h.getItemRegistry().all(),[]),l=p.useMemo(()=>{const f=new Map;for(const d of je)f.set(d,[]);for(const d of a){const m=f.get(d.category);m&&m.push(d)}return f},[a]);if(!n)return null;const u=l.get(r)??[],c=u.filter(f=>o[f.id]).length;return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:f=>f.stopPropagation(),style:{width:760,height:520,display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(122,223,144,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:"도감"}),i.jsxs("button",{onClick:()=>t(!1),style:vs(),children:["닫기 [",e.toUpperCase(),"]"]})]}),i.jsx("div",{style:{display:"flex",borderBottom:"1px solid #333"},children:je.map(f=>{const d=l.get(f)??[];if(d.length===0)return null;const m=d.filter(y=>o[y.id]).length;return i.jsxs("button",{onClick:()=>s(f),style:{flex:1,padding:"8px 4px",background:r===f?"#262626":"transparent",color:r===f?"#7adf90":"#ddd",border:"none",cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12},children:[We(f)," (",m,"/",d.length,")"]},f)})}),i.jsxs("div",{style:{padding:"6px 14px",fontSize:12,opacity:.7},children:[We(r)," — ",c,"/",u.length," 수집"]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:10,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:8},children:[u.map(f=>{const d=o[f.id],m=!!d;return i.jsxs("div",{style:{padding:10,borderRadius:8,background:m?"#222":"#181818",border:m?"1px solid #2e3":"1px solid #2a2a2a",opacity:m?1:.4},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[i.jsx("span",{style:{width:16,height:16,borderRadius:4,background:f.color??"#888"}}),i.jsx("strong",{style:{fontSize:13},children:m?f.name:"???"})]}),m&&i.jsxs("div",{style:{fontSize:11,opacity:.7},children:["수집 ",d.totalCollected," · day ",d.firstSeenDay]})]},f.id)}),u.length===0&&i.jsx("div",{style:{opacity:.6},children:"이 카테고리에는 항목이 없습니다."})]})]})})}function We(e){switch(e){case"fish":return"물고기";case"bug":return"곤충";case"food":return"음식";case"material":return"재료";case"furniture":return"가구";case"tool":return"도구";case"misc":return"기타"}}function vs(){return{padding:"4px 10px",background:"#444",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12}}class Is{defs=new Map;register(n){this.defs.has(n.id)||this.defs.set(n.id,n)}registerAll(n){for(const t of n)this.register(t)}get(n){return this.defs.get(n)}require(n){const t=this.defs.get(n);if(!t)throw new Error(`Unknown RecipeId: ${n}`);return t}all(){return Array.from(this.defs.values())}has(n){return this.defs.has(n)}clear(){this.defs.clear()}}let be=null;function ie(){return be||(be=new Is),be}const re=H.create((e,n)=>({unlocked:new Set,unlock:t=>{const r=ie().get(t);if(!r||n().unlocked.has(t))return;const s=new Set(n().unlocked);s.add(t),e({unlocked:s}),h.notify("info",`레시피 해금: ${r.name}`)},isUnlocked:t=>{const r=ie().get(t);return r?r.unlockedByDefault?!0:n().unlocked.has(t):!1},canCraft:t=>{const r=ie().get(t);if(!r)return{ok:!1,reason:"unknown recipe"};if(!n().isUnlocked(t))return{ok:!1,reason:"locked"};const s=h.useInventoryStore.getState();for(const o of r.ingredients)if(s.countOf(o.itemId)<o.count)return{ok:!1,reason:"missing ingredients"};return r.requireBells&&T.useWalletStore.getState().bells<r.requireBells?{ok:!1,reason:"insufficient bells"}:{ok:!0}},craft:t=>{const r=n().canCraft(t);if(!r.ok)return r;const s=ie().require(t),o=h.useInventoryStore.getState();for(const l of s.ingredients)if(o.removeById(l.itemId,l.count)<l.count)return{ok:!1,reason:"remove failed"};return s.requireBells&&!T.useWalletStore.getState().spend(s.requireBells)?{ok:!1,reason:"spend failed"}:(o.add(s.output.itemId,s.output.count)>0?h.notify("warn","인벤토리 부족, 일부 결과물 폐기"):h.notify("reward",`제작 완료: ${s.name}`),{ok:!0})},serialize:()=>({version:1,unlocked:Array.from(n().unlocked)}),hydrate:t=>{!t||!Array.isArray(t.unlocked)||e({unlocked:new Set(t.unlocked)})}})),Es="gaesup.crafting",ws="crafting",Cs="crafting.store";function Xt(){return re.getState().serialize()}function Yt(e){re.getState().hydrate(e)}function Kt(e={}){return N.createStoreDomainPlugin({id:e.id??Es,name:"GaeSup Crafting",saveExtensionId:e.saveExtensionId??ws,storeServiceId:e.storeServiceId??Cs,store:re,readyEvent:"crafting:ready",capabilities:["crafting"],serialize:Xt,hydrate:Yt})}const ks=Kt();function Ts({toggleKey:e="c",title:n="제작대",open:t,onClose:r}){const[s,o]=p.useState(!1),a=t!==void 0,l=a?t:s,u=()=>{a?r?.():o(!1)},c=()=>{a?l&&r?.():o(g=>!g)},f=re(g=>g.isUnlocked),d=re(g=>g.canCraft),m=re(g=>g.craft),y=h.useInventoryStore(g=>g.slots),x=T.useWalletStore(g=>g.bells);if(p.useEffect(()=>{const g=E=>{const w=E.target?.tagName?.toLowerCase();w==="input"||w==="textarea"||(E.key.toLowerCase()===e.toLowerCase()&&c(),E.key==="Escape"&&u())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e,a,l]),!l)return null;const C=ie().all(),I=(()=>{const g=new Map;for(const E of y)E&&g.set(E.itemId,(g.get(E.itemId)??0)+E.count);return g})();return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:u,children:i.jsxs("div",{onClick:g=>g.stopPropagation(),style:{width:600,maxHeight:"76vh",overflow:"hidden",display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,200,120,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:n}),i.jsxs("span",{style:{color:"#ffd84a"},children:[x.toLocaleString()," B"]}),i.jsxs("button",{onClick:u,style:$e(),children:["닫기 [",e.toUpperCase(),"]"]})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[C.length===0&&i.jsx(Ps,{children:"레시피가 없습니다."}),C.map(g=>{const E=f(g.id),w=d(g.id),k=h.getItemRegistry().get(g.output.itemId);return i.jsxs("div",{style:{padding:10,marginBottom:6,background:"#222",borderRadius:8,opacity:E?1:.45},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:16,height:16,borderRadius:4,background:k?.color??"#888"}}),i.jsx("strong",{children:E?g.name:"???"}),g.output.count>1&&i.jsxs("span",{style:{opacity:.7},children:["x",g.output.count]})]}),i.jsx("button",{onClick:()=>m(g.id),disabled:!w.ok,style:$e(w.ok),children:"제작"})]}),E&&i.jsxs("div",{style:{fontSize:12,opacity:.85},children:["재료: ",g.ingredients.map(P=>{const A=I.get(P.itemId)??0,S=A>=P.count,j=h.getItemRegistry().get(P.itemId);return i.jsxs("span",{style:{marginRight:8,color:S?"#7adf90":"#ff8a8a"},children:[j?.name??P.itemId," ",A,"/",P.count]},P.itemId)}),g.requireBells?i.jsxs("span",{style:{color:"#ffd84a"},children:["· ",g.requireBells," B"]}):null]})]},g.id)})]})]})})}function Ps({children:e}){return i.jsx("div",{style:{padding:14,opacity:.6},children:e})}function $e(e){return{padding:"5px 10px",background:e?"#ffc878":"#333",color:e?"#1a1a1a":"#777",border:"none",borderRadius:6,cursor:e?"pointer":"not-allowed",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}class Rs{defs=new Map;register(n){this.defs.has(n.id)||this.defs.set(n.id,n)}registerAll(n){for(const t of n)this.register(t)}get(n){return this.defs.get(n)}require(n){const t=this.defs.get(n);if(!t)throw new Error(`Unknown CropId: ${n}`);return t}bySeedItemId(n){for(const t of this.defs.values())if(t.seedItemId===n)return t}all(){return Array.from(this.defs.values())}has(n){return this.defs.has(n)}clear(){this.defs.clear()}}let xe=null;function ee(){return xe||(xe=new Rs),xe}function qe(e,n){return{id:e,position:n,state:"empty",stageIndex:0}}function _s(e,n){if(e.state!=="planted"&&e.state!=="mature")return e.stageIndex;const t=e.cropId?ee().get(e.cropId):void 0;if(!t||e.plantedAt===void 0)return e.stageIndex;let r=n-e.plantedAt;for(let s=0;s<t.stages.length;s++){const o=t.stages[s];if(o.durationMinutes<=0||r<o.durationMinutes)return s;r-=o.durationMinutes}return t.stages.length-1}const U=H.create((e,n)=>({plots:{},registerPlot:t=>{if(n().plots[t.id])return;const s={...qe(t.id,t.position),...t};e({plots:{...n().plots,[t.id]:s}})},unregisterPlot:t=>{if(!n().plots[t])return;const r={...n().plots};delete r[t],e({plots:r})},till:t=>{const r=n().plots[t];return!r||r.state!=="empty"?!1:(e({plots:{...n().plots,[t]:{...r,state:"tilled",stageIndex:0}}}),!0)},plant:(t,r,s)=>{const o=n().plots[t],a=ee().get(r);if(!o||!a||o.state!=="tilled")return!1;const l=h.useInventoryStore.getState();return l.countOf(a.seedItemId)<1?(h.notify("warn",`${a.name} 씨앗 부족`),!1):(l.removeById(a.seedItemId,1),e({plots:{...n().plots,[t]:{...o,state:"planted",cropId:r,plantedAt:s,lastWateredAt:s,stageIndex:0}}}),h.notify("success",`${a.name} 심음`),!0)},water:(t,r)=>{const s=n().plots[t];if(!s||s.state!=="planted"&&s.state!=="dried")return!1;let o={...s,lastWateredAt:r};return s.state==="dried"&&(o={...o,state:"planted"}),e({plots:{...n().plots,[t]:o}}),!0},harvest:t=>{const r=n().plots[t];if(!r||r.state!=="mature"||!r.cropId)return!1;const s=ee().get(r.cropId);return s?h.useInventoryStore.getState().add(s.yieldItemId,s.yieldCount)>0?(h.notify("warn","인벤토리가 가득 찼습니다"),!1):(h.notify("reward",`${s.name} +${s.yieldCount}`),e({plots:{...n().plots,[t]:{...qe(r.id,r.position),state:"tilled"}}}),!0):!1},tick:t=>{const r=n().plots,s={};let o=!1;for(const[a,l]of Object.entries(r)){let u=l;if(u.state==="planted"||u.state==="mature"){const c=u.cropId?ee().get(u.cropId):void 0;if(c&&u.plantedAt!==void 0){const f=u.lastWateredAt??u.plantedAt;if(t-f>=c.driedOutMinutes)u={...u,state:"dried"},o=!0;else{const d=_s(u,t),m=c.stages.length-1,y=d>=m?"mature":"planted";(d!==u.stageIndex||y!==u.state)&&(u={...u,stageIndex:d,state:y},o=!0)}}}s[a]=u}o&&e({plots:s})},near:(t,r,s)=>{const o=s*s;let a=null,l=1/0;for(const u of Object.values(n().plots)){const c=u.position[0]-t,f=u.position[2]-r,d=c*c+f*f;d<o&&d<l&&(l=d,a=u)}return a},serialize:()=>({version:1,plots:Object.values(n().plots).map(t=>({...t}))}),hydrate:t=>{if(!t||!Array.isArray(t.plots))return;const r={};for(const s of t.plots)s?.id&&(r[s.id]={...s});e({plots:r})}})),js="gaesup.farming",Ds="farming",Ms="farming.store";function Qt(){return U.getState().serialize()}function Zt(e){U.getState().hydrate(e)}function Jt(e={}){return N.createStoreDomainPlugin({id:e.id??js,name:"GaeSup Farming",saveExtensionId:e.saveExtensionId??Ds,storeServiceId:e.storeServiceId??Ms,store:U,readyEvent:"farming:ready",capabilities:["farming"],serialize:Qt,hydrate:Zt})}const As=Jt();function ve(e,n,t){const r=n.origin[0]-e.position[0],s=n.origin[2]-e.position[2];return r*r+s*s<=t*t}function Ls({id:e,position:n,size:t=1.4,hitRange:r=1.6}){const s=U(w=>w.registerPlot),o=U(w=>w.unregisterPlot),a=U(w=>w.plots[e]),l=U(w=>w.till),u=U(w=>w.plant),c=U(w=>w.water),f=U(w=>w.harvest),d=U(w=>w.tick);p.useEffect(()=>(s({id:e,position:n}),()=>o(e)),[e,n,s,o]),p.useEffect(()=>{let w=0;const k=D.useTimeStore.subscribe(P=>{P.totalMinutes!==w&&(w=P.totalMinutes,d(P.totalMinutes))});return d(D.useTimeStore.getState().totalMinutes),k},[d]);const m=p.useCallback(w=>{const k=U.getState().plots[e];if(!(!k||!ve(k,w,r))){if(k.state==="mature")return f(e)?!0:void 0;if(k.state==="empty"){const P=l(e);return P&&h.notify("info","땅을 갈았다"),P?!0:void 0}}},[e,r,l,f]),y=p.useCallback(w=>{const k=U.getState().plots[e];if(!k||!ve(k,w,r)||k.state!=="tilled")return;const P=h.useInventoryStore.getState().getEquipped();if(!P)return;const A=ee().bySeedItemId(P.itemId);if(!A)return;const S=D.useTimeStore.getState().totalMinutes;return u(e,A.id,S)?!0:void 0},[e,r,u]),x=p.useCallback(w=>{const k=U.getState().plots[e];if(!k||!ve(k,w,r)||k.state!=="planted"&&k.state!=="dried")return;const P=D.useTimeStore.getState().totalMinutes,A=c(e,P);return A&&h.notify("info","물을 줬다"),A?!0:void 0},[e,r,c]);L.useToolUse("shovel",m),L.useToolUse("seed",y),L.useToolUse("water",x);const C=a?.cropId?ee().get(a.cropId):void 0,I=C?C.stages[a.stageIndex]:void 0,g=p.useMemo(()=>!a||a.state==="empty"?"#5a3f24":a.state==="tilled"?"#4a2f18":a.state==="dried"?"#6b5230":"#3a2810",[a]),E=p.useRef(null);return Q.useFrame(({clock:w})=>{const k=E.current;if(!k)return;const P=w.elapsedTime;k.rotation.y=Math.sin(P*.4)*.05,k.position.y=(I?.scale??.3)*.5+Math.sin(P*1.2)*.01}),i.jsxs("group",{position:n,children:[i.jsxs("mesh",{receiveShadow:!0,rotation:[-Math.PI/2,0,0],position:[0,.005,0],children:[i.jsx("planeGeometry",{args:[t,t]}),i.jsx("meshToonMaterial",{color:g})]}),a&&(a.state==="planted"||a.state==="mature"||a.state==="dried")&&C&&I&&i.jsxs("mesh",{ref:E,castShadow:!0,position:[0,I.scale*.5,0],children:[i.jsx("coneGeometry",{args:[Math.max(.08,I.scale*.35),Math.max(.16,I.scale*.9),10]}),i.jsx("meshToonMaterial",{color:a.state==="dried"?"#7a6a4a":I.color??"#9adf90"})]}),a?.state==="mature"&&i.jsxs("mesh",{position:[0,1,0],children:[i.jsx("ringGeometry",{args:[.18,.24,16]}),i.jsx("meshBasicMaterial",{color:"#ffd84a",transparent:!0,opacity:.85,depthWrite:!1})]})]})}const Os=[{id:"crop.turnip",name:"순무",seedItemId:"seed-turnip",yieldItemId:"turnip",yieldCount:2,waterIntervalMinutes:60*8,driedOutMinutes:60*16,stages:[{durationMinutes:60*6,scale:.3,color:"#8acf8a"},{durationMinutes:60*8,scale:.6,color:"#a8df9c",needsWater:!0},{durationMinutes:60*10,scale:.9,color:"#cfeeb6",needsWater:!0},{durationMinutes:0,scale:1,color:"#ffeeaa"}]},{id:"crop.tomato",name:"토마토",seedItemId:"seed-tomato",yieldItemId:"tomato",yieldCount:3,waterIntervalMinutes:60*6,driedOutMinutes:60*12,stages:[{durationMinutes:60*8,scale:.3,color:"#7adf90"},{durationMinutes:60*12,scale:.6,color:"#9adf90",needsWater:!0},{durationMinutes:60*12,scale:.9,color:"#cfdf90",needsWater:!0},{durationMinutes:0,scale:1.1,color:"#e54b4b"}]}];let He=!1;function Ns(){He||(He=!0,ee().registerAll(Os))}const Fs="gaesup.weather",zs="weather",Us="weather.store";function en(){return G.useWeatherStore.getState().serialize()}function tn(e){G.useWeatherStore.getState().hydrate(e)}function nn(e={}){const n=e.id??Fs,t=e.saveExtensionId??zs,r=e.storeServiceId??Us;return{id:n,name:"GaeSup Weather",version:"0.1.0",runtime:"client",capabilities:["weather"],setup(s){s.save.register(t,{key:t,serialize:en,hydrate:tn},n),s.services.register(r,{useStore:G.useWeatherStore,getState:G.useWeatherStore.getState,setState:G.useWeatherStore.setState},n),s.events.emit("weather:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const Bs=nn(),Gs={sunny:{sym:"O",color:"#ffd84a",label:"맑음"},cloudy:{sym:"c",color:"#aab2bc",label:"흐림"},rain:{sym:"r",color:"#4aa8ff",label:"비"},snow:{sym:"*",color:"#dff0ff",label:"눈"},storm:{sym:"!",color:"#7f7fff",label:"폭풍"}};function Vs({position:e="top-left"}){const n=G.useWeatherStore(s=>s.current);if(!n)return null;const t=Gs[n.kind],r=e==="top-right"?{top:50,right:12}:{top:50,left:12};return i.jsxs("div",{style:{position:"fixed",zIndex:90,padding:"4px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,borderRadius:999,display:"flex",alignItems:"center",gap:8,boxShadow:`inset 0 0 0 1px ${t.color}55`,pointerEvents:"none",userSelect:"none",...r},children:[i.jsx("span",{style:{width:18,height:18,borderRadius:"50%",background:t.color,color:"#1a1a1a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:11},children:t.sym}),i.jsx("span",{children:t.label})]})}function Ws(e=!0){p.useEffect(()=>{if(!e)return;const n=()=>{const r=D.useTimeStore.getState(),s=Math.floor(r.totalMinutes/(60*24)),o=G.useWeatherStore.getState().current;(!o||o.day!==s)&&G.useWeatherStore.getState().rollForDay(s,r.time.season)};return n(),D.useTimeStore.subscribe((r,s)=>{const o=Math.floor(r.totalMinutes/1440),a=Math.floor(s.totalMinutes/(60*24));o!==a&&n()})},[e])}function Xe(e,n){return{id:e,position:n,size:[4,4],state:"empty"}}const W=H.create((e,n)=>({houses:{},residents:{},decorationScore:0,registerHouse:t=>{if(n().houses[t.id])return;const s={...Xe(t.id,t.position),...t};e({houses:{...n().houses,[t.id]:s}})},unregisterHouse:t=>{const r={...n().houses};r[t]&&(delete r[t],e({houses:r}))},registerResident:t=>{n().residents[t.id]||e({residents:{...n().residents,[t.id]:t}})},removeResident:t=>{const r={...n().residents};if(r[t]){delete r[t],e({residents:r});for(const s of Object.values(n().houses))s.residentId===t&&n().moveOut(s.id),s.reservedFor===t&&n().cancelReservation(s.id)}},reserveHouse:(t,r,s)=>{const o=n().houses[t];return!o||o.state!=="empty"?!1:(e({houses:{...n().houses,[t]:{...o,state:"reserved",reservedFor:r,...s!==void 0?{reservedUntilDay:s}:{}}}}),!0)},cancelReservation:t=>{const r=n().houses[t];if(!r||r.state!=="reserved")return;const s={...r,state:"empty"};delete s.reservedFor,delete s.reservedUntilDay,e({houses:{...n().houses,[t]:s}})},moveIn:(t,r,s)=>{const o=n().houses[t],a=n().residents[r];return!o||!a||o.state==="occupied"?!1:(e({houses:{...n().houses,[t]:{...o,state:"occupied",residentId:r}},residents:{...n().residents,[r]:{...a,movedInDay:s}}}),h.notify("reward",`${a.name}이(가) 이사 왔다!`),!0)},moveOut:t=>{const r=n().houses[t];if(!r||r.state!=="occupied")return!1;const s=r.residentId?n().residents[r.residentId]:null;return e({houses:{...n().houses,[t]:Xe(t,r.position)}}),s&&h.notify("info",`${s.name}이(가) 떠났다`),!0},setDecorationScore:t=>e({decorationScore:Math.max(0,Math.floor(t))}),stats:()=>{const t=Object.values(n().houses),r=t.filter(s=>s.state==="occupied").length;return{decorationScore:n().decorationScore,residentCount:Object.keys(n().residents).length,occupiedHouses:r,totalHouses:t.length}},serialize:()=>({version:1,houses:Object.values(n().houses).map(t=>({...t})),residents:Object.values(n().residents).map(t=>({...t}))}),hydrate:t=>{if(!t)return;const r={},s={};if(Array.isArray(t.houses))for(const o of t.houses)o?.id&&(r[o.id]={...o});if(Array.isArray(t.residents))for(const o of t.residents)o?.id&&(s[o.id]={...o});e({houses:r,residents:s})}})),$s="gaesup.town",qs="town",Hs="town.store";function rn(){return W.getState().serialize()}function sn(e){W.getState().hydrate(e)}function on(e={}){return N.createStoreDomainPlugin({id:e.id??$s,name:"GaeSup Town",saveExtensionId:e.saveExtensionId??qs,storeServiceId:e.storeServiceId??Hs,store:W,readyEvent:"town:ready",capabilities:["town"],serialize:rn,hydrate:sn})}const Xs=on(),Ys={tile:2,wall:1,placedObject:5,base:0};function Ks(e=!0,n={}){p.useEffect(()=>{if(!e)return;const t={...Ys,...n},r=o=>{let a=0,l=0;const u=o.objects.length;for(const f of o.tileGroups.values())a+=f.tiles.length;for(const f of o.wallGroups.values())l+=f.walls.length;const c=t.base+a*t.tile+l*t.wall+u*t.placedObject;W.getState().setDecorationScore(c)};return r(_.useBuildingStore.getState()),_.useBuildingStore.subscribe(o=>r(o))},[e,n.tile,n.wall,n.placedObject,n.base])}function Qs({id:e,position:n,size:t=[4,4],emptyColor:r="#705038",reservedColor:s="#c8a85a",occupiedColor:o="#5a8acf"}){const a=W(y=>y.registerHouse),l=W(y=>y.unregisterHouse),u=W(y=>y.houses[e]),c=W(y=>y.residents);p.useEffect(()=>(a({id:e,position:n,size:t}),()=>l(e)),[e,n,t,a,l]);const f=u?u.state==="occupied"?o:u.state==="reserved"?s:r:r,d=u?.residentId?c[u.residentId]:null,m=p.useMemo(()=>new v.PlaneGeometry(t[0],t[1]),[t[0],t[1]]);return i.jsxs("group",{position:n,children:[i.jsx("mesh",{geometry:m,rotation:[-Math.PI/2,0,0],position:[0,.005,0],children:i.jsx("meshToonMaterial",{color:f,transparent:!0,opacity:.7})}),u?.state==="occupied"&&d&&i.jsxs(i.Fragment,{children:[i.jsxs("mesh",{position:[0,.6,0],castShadow:!0,children:[i.jsx("boxGeometry",{args:[Math.max(1.4,t[0]*.6),1.2,Math.max(1.4,t[1]*.6)]}),i.jsx("meshToonMaterial",{color:d.bodyColor??"#e8d8b8"})]}),i.jsxs("mesh",{position:[0,1.5,0],castShadow:!0,children:[i.jsx("coneGeometry",{args:[Math.max(1,t[0]*.45),.7,4]}),i.jsx("meshToonMaterial",{color:d.hatColor??"#a85a5a"})]})]}),u?.state==="reserved"&&i.jsxs("mesh",{position:[0,.5,0],children:[i.jsx("boxGeometry",{args:[.4,1,.4]}),i.jsx("meshToonMaterial",{color:s})]})]})}function Zs({position:e="top-right",offset:n}){const t=W(f=>f.decorationScore),r=W(f=>f.houses),s=W(f=>f.residents),o=Object.keys(r).length,a=Object.values(r).filter(f=>f.state==="occupied").length,l=Object.keys(s).length,c={...e==="bottom-right"?{bottom:12,right:100}:e==="top-left"?{top:160,left:12}:e==="bottom-left"?{bottom:12,left:240}:{top:50,right:12},...n??{}};return i.jsxs("div",{style:{position:"fixed",zIndex:90,padding:"6px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,borderRadius:8,display:"flex",flexDirection:"column",gap:2,pointerEvents:"none",userSelect:"none",...c},children:[i.jsxs("div",{children:["마을 점수 ",i.jsx("span",{style:{color:"#ffd84a",fontWeight:700},children:t})]}),i.jsxs("div",{children:["주민 ",a,"/",o," (등록 ",l,")"]})]})}class Js{ctx=null;masterGain=null;bgmGain=null;sfxGain=null;bgmInterval=null;bgmStep=0;currentBgm=null;bufferCache=new Map;ensure(){if(this.ctx)return!0;if(typeof window>"u"||typeof window.AudioContext>"u")return!1;try{return this.ctx=new window.AudioContext,this.masterGain=this.ctx.createGain(),this.masterGain.connect(this.ctx.destination),this.bgmGain=this.ctx.createGain(),this.sfxGain=this.ctx.createGain(),this.bgmGain.connect(this.masterGain),this.sfxGain.connect(this.masterGain),!0}catch{return!1}}resume(){this.ctx?.state==="suspended"&&this.ctx.resume()}setMasterVolume(n){!this.ensure()||!this.masterGain||(this.masterGain.gain.value=Math.max(0,Math.min(1,n)))}setBgmVolume(n){!this.ensure()||!this.bgmGain||(this.bgmGain.gain.value=Math.max(0,Math.min(1,n)))}setSfxVolume(n){!this.ensure()||!this.sfxGain||(this.sfxGain.gain.value=Math.max(0,Math.min(1,n)))}playSfx(n){if(!this.ensure()||!this.ctx||!this.sfxGain)return;if(n.url){this.playFromUrl(n.url,this.sfxGain,n.volume??1);return}const t=this.ctx.createOscillator(),r=this.ctx.createGain();t.type=n.type??"sine",t.frequency.value=n.freq??440;const s=n.duration??.12,o=this.ctx.currentTime;r.gain.setValueAtTime(0,o),r.gain.linearRampToValueAtTime((n.volume??1)*.3,o+.005),r.gain.exponentialRampToValueAtTime(1e-4,o+s),t.connect(r),r.connect(this.sfxGain),t.start(o),t.stop(o+s+.05)}playBgm(n){if(!this.ensure()||!this.ctx||!this.bgmGain||(this.stopBgm(),!n))return;if(this.currentBgm=n,n.url){this.playFromUrl(n.url,this.bgmGain,n.volume??1,!0);return}const t=n.pattern??[0,4,7,4],r=n.intervalMs??800,s=n.baseFreq??220;this.bgmStep=0;const o=()=>{if(!this.ctx||!this.bgmGain)return;const a=t[this.bgmStep%t.length]??0,l=s*Math.pow(2,a/12),u=this.ctx.createOscillator(),c=this.ctx.createGain();u.type="triangle",u.frequency.value=l;const f=this.ctx.currentTime;c.gain.setValueAtTime(0,f),c.gain.linearRampToValueAtTime((n.volume??1)*.18,f+.04),c.gain.exponentialRampToValueAtTime(1e-4,f+r/1e3*.95),u.connect(c),c.connect(this.bgmGain),u.start(f),u.stop(f+r/1e3+.05),this.bgmStep+=1};o(),this.bgmInterval=window.setInterval(o,r)}stopBgm(){this.bgmInterval!==null&&(window.clearInterval(this.bgmInterval),this.bgmInterval=null),this.currentBgm=null}getCurrentBgmId(){return this.currentBgm?.id??null}async playFromUrl(n,t,r,s=!1){if(this.ctx)try{let o=this.bufferCache.get(n);if(!o){const c=await(await fetch(n)).arrayBuffer();o=await this.ctx.decodeAudioData(c),this.bufferCache.set(n,o)}const a=this.ctx.createBufferSource();a.buffer=o,a.loop=s;const l=this.ctx.createGain();l.gain.value=r,a.connect(l),l.connect(t),a.start()}catch{}}}let Ie=null;function ne(){return Ie||(Ie=new Js),Ie}const z=H.create((e,n)=>({masterMuted:!1,bgmMuted:!1,sfxMuted:!1,masterVolume:.6,bgmVolume:.4,sfxVolume:.7,currentBgmId:null,setMaster:t=>{e({masterVolume:Math.max(0,Math.min(1,t))}),n().apply()},setBgm:t=>{e({bgmVolume:Math.max(0,Math.min(1,t))}),n().apply()},setSfx:t=>{e({sfxVolume:Math.max(0,Math.min(1,t))}),n().apply()},toggleMaster:()=>{e({masterMuted:!n().masterMuted}),n().apply()},toggleBgm:()=>{e({bgmMuted:!n().bgmMuted}),n().apply()},toggleSfx:()=>{e({sfxMuted:!n().sfxMuted}),n().apply()},playSfx:t=>{const r=n();r.masterMuted||r.sfxMuted||(ne().resume(),ne().playSfx(t))},playBgm:t=>{ne().resume(),ne().playBgm(t),e({currentBgmId:t?.id??null}),n().apply()},stopBgm:()=>{ne().stopBgm(),e({currentBgmId:null})},apply:()=>{const t=n(),r=ne();r.setMasterVolume(t.masterMuted?0:t.masterVolume),r.setBgmVolume(t.bgmMuted?0:t.bgmVolume),r.setSfxVolume(t.sfxMuted?0:t.sfxVolume)},serialize:()=>{const t=n();return{version:1,masterMuted:t.masterMuted,bgmMuted:t.bgmMuted,sfxMuted:t.sfxMuted,masterVolume:t.masterVolume,bgmVolume:t.bgmVolume,sfxVolume:t.sfxVolume}},hydrate:t=>{t&&(e({masterMuted:!!t.masterMuted,bgmMuted:!!t.bgmMuted,sfxMuted:!!t.sfxMuted,masterVolume:typeof t.masterVolume=="number"?t.masterVolume:.6,bgmVolume:typeof t.bgmVolume=="number"?t.bgmVolume:.4,sfxVolume:typeof t.sfxVolume=="number"?t.sfxVolume:.7}),n().apply())}})),eo="gaesup.audio",to="audio",no="audio.store";function an(){return z.getState().serialize()}function ln(e){z.getState().hydrate(e)}function cn(e={}){const n=e.id??eo,t=e.saveExtensionId??to,r=e.storeServiceId??no;return{id:n,name:"GaeSup Audio",version:"0.1.0",runtime:"client",capabilities:["audio"],setup(s){s.save.register(t,{key:t,serialize:an,hydrate:ln},n),s.services.register(r,{useStore:z,getState:z.getState,setState:z.setState},n),s.events.emit("audio:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const ro=cn(),so=[0,2,4,5,7,9,11],oo=[0,2,3,5,7,8,10];function io(e){return e==="rain"||e==="storm"||e==="snow"?oo:so}function ao(e){return e<6?"night":e<10?"dawn":e<18?"day":e<22?"dusk":"night"}function lo(e,n){const t=ao(e),r=io(n),s=t==="night"?174.6:t==="dawn"?220:t==="dusk"?196:261.6,o=t==="day"?700:950,a=[r[0],r[2],r[4],r[2],r[0],r[3],r[1],r[4]];return{id:`bgm.${t}.${n??"unknown"}`,baseFreq:s,intervalMs:o,pattern:a,volume:n==="storm"?.6:1}}function co(e=!0){p.useEffect(()=>{if(!e)return;const n=()=>{const s=D.useTimeStore.getState(),o=G.useWeatherStore.getState().current,a=lo(s.time.hour,o?.kind);z.getState().currentBgmId!==a.id&&z.getState().playBgm(a)},t=D.useTimeStore.subscribe((s,o)=>{s.time.hour!==o.time.hour&&n()}),r=G.useWeatherStore.subscribe((s,o)=>{s.current?.kind!==o.current?.kind&&n()});return n(),()=>{t(),r(),z.getState().stopBgm()}},[e])}function uo({position:e="bottom-right",offset:n}){const t=z(d=>d.masterMuted),r=z(d=>d.bgmMuted),s=z(d=>d.sfxMuted),o=z(d=>d.toggleMaster),a=z(d=>d.toggleBgm),l=z(d=>d.toggleSfx),c={...e==="top-right"?{top:50,right:200}:e==="bottom-left"?{bottom:12,left:240}:e==="top-left"?{top:220,left:12}:{bottom:12,right:110},...n??{}},f=(d,m,y)=>i.jsxs("button",{onClick:y,style:{padding:"4px 8px",background:m?"rgba(80,30,30,0.85)":"rgba(20,20,28,0.85)",color:m?"#ff8a8a":"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,border:"1px solid rgba(255,255,255,0.18)",borderRadius:6,cursor:"pointer"},children:[d,m?" OFF":""]});return i.jsxs("div",{style:{position:"fixed",zIndex:95,display:"flex",gap:4,pointerEvents:"auto",...c},children:[f("M",t,o),f("Bgm",r,a),f("Sfx",s,l)]})}const fo={grass:{freq:320,duration:.07,type:"triangle",volume:.18},sand:{freq:220,duration:.1,type:"sine",volume:.2},snow:{freq:380,duration:.1,type:"triangle",volume:.22},wood:{freq:540,duration:.06,type:"square",volume:.14},stone:{freq:760,duration:.05,type:"square",volume:.16},water:{freq:180,duration:.13,type:"sine",volume:.24}};function mo(e,n){const t=_.TILE_CONSTANTS.GRID_CELL_SIZE,r=_.useBuildingStore.getState().tileGroups;for(const s of r.values())for(const o of s.tiles){const a=(o.size||1)*t/2;if(!(Math.abs(o.position.x-e)>a)&&!(Math.abs(o.position.z-n)>a)){switch(o.objectType){case"water":return"water";case"sand":return"sand";case"snowfield":return"snow";case"grass":return"grass"}return o.shape==="stairs"||o.shape==="ramp"?"wood":"stone"}}return"grass"}function po({strideMeters:e=.65,maxStepsPerSecond:n=6,volume:t=1,resolveSurface:r=mo,enabled:s=!0}={}){const{position:o,isGrounded:a,isMoving:l,speed:u}=V.usePlayerPosition({updateInterval:32}),c=p.useRef({x:o.x,z:o.z}),f=p.useRef(0),d=p.useRef(0);return p.useEffect(()=>{c.current.x=o.x,c.current.z=o.z},[]),Q.useFrame(()=>{if(!s)return;const m=performance.now(),y=o.x-c.current.x,x=o.z-c.current.z;if(c.current.x=o.x,c.current.z=o.z,!a||!l){f.current=0;return}const C=Math.hypot(y,x);if(C<=0||(f.current+=C,f.current<e)||m-d.current<1e3/n)return;f.current=0,d.current=m;const I=r(o.x,o.z),g=fo[I],E=Math.min(1.4,.7+u*.06);z.getState().playSfx({id:`footstep-${I}`,type:g.type??"sine",freq:g.freq??320,duration:g.duration??.08,volume:(g.volume??.2)*t*E})}),null}const go="gaesup.character",yo="character",ho="character.store";function un(){return b.useCharacterStore.getState().serialize()}function dn(e){b.useCharacterStore.getState().hydrate(e)}function fn(e={}){return N.createStoreDomainPlugin({id:e.id??go,name:"GaeSup Character",saveExtensionId:e.saveExtensionId??yo,storeServiceId:e.storeServiceId??ho,store:b.useCharacterStore,readyEvent:"character:ready",capabilities:["character"],serialize:un,hydrate:dn})}const So=fn(),bo=[{key:"body",label:"피부"},{key:"hair",label:"머리"},{key:"hat",label:"모자"},{key:"top",label:"상의"},{key:"bottom",label:"하의"},{key:"shoes",label:"신발"}],xo=["short","long","cap","bun","spiky"],vo=["default","smile","wink","sleepy","surprised"],Ye=["hat","top","bottom","shoes","face","weapon","accessory"],Io=(e,n)=>n==="weapon"?e.kind==="weapon"||e.slot==="weapon":e.slot===n&&(e.kind==="characterPart"||e.kind==="weapon");function Eo({toggleKey:e,open:n,onClose:t}={}){const r=typeof n=="boolean",[s,o]=p.useState(!1),a=r?n:s,l=b.useCharacterStore(S=>S.appearance),u=b.useCharacterStore(S=>S.outfits),c=b.useCharacterStore(S=>S.setName),f=b.useCharacterStore(S=>S.setColor),d=b.useCharacterStore(S=>S.setHair),m=b.useCharacterStore(S=>S.setFace),y=b.useCharacterStore(S=>S.equipOutfit),x=b.useCharacterStore(S=>S.resetAppearance),C=fe.useAssetStore(S=>S.ids),I=fe.useAssetStore(S=>S.records),[g,E]=p.useState(""),[w,k]=p.useState(!1),P=p.useMemo(()=>{const S=g.trim().toLowerCase();return Ye.reduce((j,F)=>(j[F]=C.map(R=>I[R]).filter(R=>!!R).filter(R=>Io(R,F)).filter(R=>S?R.tags?.some(M=>M.toLowerCase().includes(S))??!1:!0).filter(R=>!w||R.metadata?.owned!==!1),j),{})},[C,I,w,g]);if(p.useEffect(()=>{if(!e||r)return;const S=j=>{const F=j.target?.tagName?.toLowerCase();if(F==="input"||F==="textarea")return;const R=e.toLowerCase(),M=`Key${e.toUpperCase()}`;j.code!==M&&j.key.toLowerCase()!==R||o(oe=>!oe)};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,r]),!a)return null;const A=()=>{r?t?.():o(!1)};return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.32)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},onClick:A,children:i.jsxs("div",{onClick:S=>S.stopPropagation(),style:{width:"min(760px, 92vw)",maxHeight:"88vh",overflowY:"auto",background:"rgba(18,20,28,0.62)",color:"#f3f4f8",borderRadius:14,border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,padding:18},children:[i.jsxs("header",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsx("h2",{style:{margin:0,fontSize:16,fontWeight:600,flex:1},children:"캐릭터 만들기"}),i.jsx("button",{onClick:x,style:Ee,children:"기본값"}),i.jsx("button",{onClick:A,style:Ee,children:"닫기"})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:le,children:"이름"}),i.jsx("input",{value:l.name,onChange:S=>c(S.target.value),maxLength:16,style:{width:"100%",padding:"8px 10px",borderRadius:8,border:"1px solid rgba(255,255,255,0.14)",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",fontFamily:"inherit",fontSize:13}})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:le,children:"색상"}),i.jsx("div",{style:Ke,children:bo.map(({key:S,label:j})=>i.jsxs("div",{style:wo,children:[i.jsx("span",{style:{flex:1},children:j}),i.jsx("input",{type:"color",value:l.colors[S],onChange:F=>f(S,F.target.value),style:{width:36,height:28,border:"1px solid rgba(255,255,255,0.14)",borderRadius:6,background:"transparent",cursor:"pointer"}})]},S))})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:le,children:"헤어"}),i.jsx("div",{style:Qe,children:xo.map(S=>i.jsx("button",{onClick:()=>d(S),style:Ze(l.hair===S),children:b.HAIR_STYLE_LABEL[S]},S))})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:le,children:"표정"}),i.jsx("div",{style:Qe,children:vo.map(S=>i.jsx("button",{onClick:()=>m(S),style:Ze(l.face===S),children:b.FACE_STYLE_LABEL[S]},S))})]}),i.jsxs("section",{children:[i.jsxs("div",{style:Co,children:[i.jsx("label",{style:{...le,marginBottom:0},children:"장착 슬롯"}),i.jsx("input",{value:g,onChange:S=>E(S.target.value),placeholder:"태그 검색",style:ko}),i.jsxs("label",{style:To,children:[i.jsx("input",{type:"checkbox",checked:w,onChange:S=>k(S.target.checked)}),"보유만"]})]}),i.jsx("div",{style:Ke,children:Ye.map(S=>i.jsxs("div",{style:Po,children:[i.jsxs("div",{style:Ro,children:[i.jsx("span",{children:b.OUTFIT_SLOT_LABEL[S]}),i.jsx("span",{style:{color:u[S]?"#7adf90":"rgba(243,244,248,0.45)"},children:u[S]??"비어있음"}),i.jsx("button",{onClick:()=>y(S,null),style:Ee,children:"비우기"})]}),i.jsxs("div",{style:_o,children:[P[S].map(j=>i.jsxs("button",{onClick:()=>y(S,j.id),style:jo(u[S]===j.id),children:[i.jsx(rt.AssetPreviewCanvas,{asset:j,size:58}),i.jsx("span",{style:Do,children:j.name})]},j.id)),P[S].length===0&&i.jsx("span",{style:Mo,children:"사용 가능한 에셋 없음"})]})]},S))})]})]})})}const le={display:"block",marginBottom:6,fontSize:11.5,fontWeight:600,letterSpacing:.4,textTransform:"uppercase",color:"rgba(243,244,248,0.62)"},Ke={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},wo={display:"flex",alignItems:"center",gap:8,padding:"6px 10px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:8},Qe={display:"flex",flexWrap:"wrap",gap:6},Ze=e=>({padding:"6px 12px",borderRadius:999,border:e?"1px solid #ffd84a":"1px solid rgba(255,255,255,0.14)",background:e?"rgba(255,216,74,0.12)":"rgba(255,255,255,0.04)",color:"#f3f4f8",cursor:"pointer",fontFamily:"inherit",fontSize:12,fontWeight:500}),Ee={padding:"6px 12px",borderRadius:8,border:"1px solid rgba(255,255,255,0.14)",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",cursor:"pointer",fontFamily:"inherit",fontSize:12,fontWeight:500},Co={display:"flex",alignItems:"center",gap:8,marginBottom:8},ko={flex:1,minWidth:120,padding:"6px 9px",borderRadius:8,border:"1px solid rgba(255,255,255,0.14)",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",fontFamily:"inherit",fontSize:12},To={display:"inline-flex",alignItems:"center",gap:5,color:"rgba(243,244,248,0.72)",fontSize:12},Po={padding:8,background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:10},Ro={display:"flex",alignItems:"center",gap:8,marginBottom:8},_o={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},jo=e=>({display:"grid",gridTemplateColumns:"58px minmax(0, 1fr)",alignItems:"center",gap:8,minHeight:70,padding:6,borderRadius:10,border:e?"1px solid #7bd3a7":"1px solid rgba(255,255,255,0.10)",background:e?"rgba(123,211,167,0.14)":"rgba(255,255,255,0.035)",color:"#f3f4f8",cursor:"pointer",fontFamily:"inherit",textAlign:"left"}),Do={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:600},Mo={gridColumn:"1 / -1",padding:"10px 8px",color:"rgba(243,244,248,0.45)",fontSize:12};function Ao(e){return p.useMemo(()=>{switch(e){case"long":return{geometry:new v.SphereGeometry(.28,12,10,0,Math.PI*2,0,Math.PI*.65),position:[0,-.05,0],scale:[1.05,1.55,1.05]};case"cap":return{geometry:new v.CylinderGeometry(.32,.34,.18,16),position:[0,.1,0],scale:[1,1,1]};case"bun":return{geometry:new v.SphereGeometry(.22,12,10),position:[0,.18,-.05],scale:[1,1,1]};case"spiky":return{geometry:new v.ConeGeometry(.32,.36,8),position:[0,.15,0],scale:[1,1,1]};case"short":default:return{geometry:new v.SphereGeometry(.3,12,10,0,Math.PI*2,0,Math.PI*.5),position:[0,.05,0],scale:[1,1,1]}}},[e])}function Lo({headHeight:e=1.55,enabled:n=!0,opacity:t=1}={}){const r=p.useRef(null),s=b.useCharacterStore(d=>d.appearance),o=b.useCharacterStore(d=>d.outfits),{position:a,rotation:l}=V.usePlayerPosition({updateInterval:16}),u=Ao(s.hair);if(Q.useFrame(()=>{const d=r.current;d&&(d.position.set(a.x,a.y+e,a.z),d.rotation.set(0,l.y,0))}),!n)return null;const c=!!o.hat,f=v.MathUtils.clamp(t,0,1);return i.jsxs("group",{ref:r,dispose:null,children:[!c&&i.jsxs("mesh",{position:u.position,scale:u.scale,castShadow:!0,children:[i.jsx("primitive",{object:u.geometry,attach:"geometry"}),i.jsx("meshStandardMaterial",{color:s.colors.hair,roughness:.85,metalness:.05,transparent:f<1,opacity:f})]}),c&&i.jsxs("group",{position:[0,.1,0],children:[i.jsxs("mesh",{castShadow:!0,children:[i.jsx("cylinderGeometry",{args:[.34,.34,.22,18]}),i.jsx("meshStandardMaterial",{color:s.colors.hat,roughness:.7,metalness:.05,transparent:f<1,opacity:f})]}),i.jsxs("mesh",{position:[0,-.1,0],children:[i.jsx("cylinderGeometry",{args:[.5,.5,.04,24]}),i.jsx("meshStandardMaterial",{color:s.colors.hat,roughness:.7,metalness:.05,transparent:f<1,opacity:f})]})]}),i.jsx(Oo,{style:s.face,opacity:f})]})}function Oo({style:e,opacity:n}){const t=p.useMemo(()=>{switch(e){case"smile":return"#ff8aa0";case"wink":return"#ffb04a";case"sleepy":return"#7d8ec8";case"surprised":return"#ffe066";default:return"#ffb6a8"}},[e]);return i.jsxs("group",{position:[0,-.18,.32],children:[i.jsxs("mesh",{position:[-.13,0,0],children:[i.jsx("sphereGeometry",{args:[.045,8,8]}),i.jsx("meshBasicMaterial",{color:t,transparent:!0,opacity:n*.6})]}),i.jsxs("mesh",{position:[.13,0,0],children:[i.jsx("sphereGeometry",{args:[.045,8,8]}),i.jsx("meshBasicMaterial",{color:t,transparent:!0,opacity:n*.6})]})]})}const No=e=>e?.url?e.kind==="characterPart"||e.kind==="weapon":!1,Fo=e=>({id:e.id,...e.slot?{slot:e.slot}:{},url:e.url,...e.colors?.primary?{color:e.colors.primary}:{}});function zo({baseParts:e=[],outfits:n,assets:t}){const r=Object.values(n).map(a=>a?t[a]:void 0).filter(No).map(Fo);if(r.length===0)return e.map(a=>({...a}));const s=new Set(r.map(a=>a.slot).filter(Boolean)),o=e.filter(a=>!a.slot||!s.has(a.slot)).map(a=>({...a}));for(const a of r)o.some(l=>l.url===a.url&&l.slot===a.slot)||o.push(a);return o}function Uo({capacity:e=64,step:n=.55,lifetime:t=9,size:r=.34,y:s=.02,color:o="#1a1612"}={}){const a=p.useRef(null),{position:l,isMoving:u,isGrounded:c}=V.usePlayerPosition({updateInterval:32}),f=p.useMemo(()=>new v.Color(o),[o]),d=p.useMemo(()=>Array.from({length:e},()=>({x:0,z:0,bornAt:-1/0,side:1})),[e]),m=p.useRef(null),y=p.useRef(0),x=p.useRef(1),C=p.useMemo(()=>{const w=new v.PlaneGeometry(1,1);return w.rotateX(-Math.PI/2),w},[]),I=p.useMemo(()=>new v.MeshBasicMaterial({color:f,transparent:!0,opacity:.42,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1}),[f]);p.useEffect(()=>()=>{C.dispose(),I.dispose()},[C,I]);const g=p.useMemo(()=>new v.Object3D,[]),E=p.useMemo(()=>new v.Color,[]);return Q.useFrame(w=>{const k=a.current;if(!k)return;const P=w.clock.elapsedTime;if(c&&u){const S=m.current,j=l.x-(S?.x??l.x),F=l.z-(S?.z??l.z),R=Math.hypot(j,F);if(!S||R>=n){const M=d[y.current];M&&(M.x=l.x,M.z=l.z,M.bornAt=P,M.side=x.current,x.current=x.current===1?-1:1,y.current=(y.current+1)%e,m.current={x:l.x,z:l.z})}}let A=0;for(let S=0;S<e;S++){const j=d[S];if(!j)continue;const F=P-j.bornAt;if(F<0||F>t)continue;const R=1-F/t;g.position.set(j.x+j.side*.07,s,j.z),g.rotation.set(0,0,0),g.scale.set(r,1,r*1.4),g.updateMatrix(),k.setMatrixAt(A,g.matrix),E.copy(f).multiplyScalar(.6+R*.4),k.setColorAt(A,E),A++}k.count=A,k.instanceMatrix.needsUpdate=!0,k.instanceColor&&(k.instanceColor.needsUpdate=!0)}),i.jsx("instancedMesh",{ref:a,args:[C,I,e],frustumCulled:!1,renderOrder:1})}const Bo={ko:"한국어",en:"English",ja:"日本語"},de="ko";function Go(){if(typeof navigator>"u")return de;const e=(navigator.language||de).slice(0,2).toLowerCase();return e==="ko"||e==="en"||e==="ja"?e:de}function we(e,n){return n?e.replace(/\{(\w+)\}/g,(t,r)=>{const s=n[r];return s==null?`{${r}}`:String(s)}):e}const K=H.create((e,n)=>({locale:Go(),bundle:{ko:{},en:{},ja:{}},setLocale:t=>e({locale:t}),registerMessages:(t,r)=>{const s=n().bundle;e({bundle:{...s,[t]:{...s[t],...r}}})},registerBundle:t=>{const r=n().bundle,s={...r};Object.keys(t).forEach(o=>{const a=t[o];a&&(s[o]={...r[o],...a})}),e({bundle:s})},t:(t,r)=>{const{locale:s,bundle:o}=n(),a=o[s]?.[t];if(a!==void 0)return we(a,r);const l=o[de]?.[t];return we(l!==void 0?l:t,r)},serialize:()=>({version:1,locale:n().locale}),hydrate:t=>{!t||t.version!==1||e({locale:t.locale})}}));function Vo(e,n){return K.getState().t(e,n)}const Wo="gaesup.i18n",$o="i18n",qo="i18n.store";function mn(){return K.getState().serialize()}function pn(e){K.getState().hydrate(e)}function gn(e={}){return N.createStoreDomainPlugin({id:e.id??Wo,name:"GaeSup i18n",saveExtensionId:e.saveExtensionId??$o,storeServiceId:e.storeServiceId??qo,store:K,readyEvent:"i18n:ready",capabilities:["i18n"],serialize:mn,hydrate:pn})}const Ho=gn();function Xo(){const e=K(t=>t.locale),n=K(t=>t.bundle);return p.useCallback((t,r)=>{const s=n[e]?.[t];if(s!==void 0)return Ce(s,r);const o=n.ko?.[t];return Ce(o!==void 0?o:t,r)},[e,n])}function Yo(){const e=K(t=>t.locale),n=K(t=>t.setLocale);return{locale:e,setLocale:n}}function Ce(e,n){return n?e.replace(/\{(\w+)\}/g,(t,r)=>{const s=n[r];return s==null?`{${r}}`:String(s)}):e}const Ko=[{id:"jump",label:"점프",key:" "},{id:"use",label:"사용",key:"F"}];function Qo(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches}function Je(e,n){if(typeof window>"u")return;const t=/^[a-zA-Z]$/.test(n)?`Key${n.toUpperCase()}`:n===" "?"Space":n,r=new KeyboardEvent(e,{key:n===" "?" ":n.toLowerCase(),code:t,bubbles:!0});window.dispatchEvent(r)}function Zo({forceVisible:e=!1,radius:n=60,deadzone:t=.18,runThreshold:r=.8,actions:s=Ko}={}){const[o,a]=p.useState(!1),l=_.useInputBackend(),u=p.useRef(null),c=p.useRef(null),f=p.useRef({pointerId:-1,cx:0,cy:0,forward:!1,backward:!1,leftward:!1,rightward:!1,run:!1});return p.useEffect(()=>{a(e||Qo())},[e]),p.useEffect(()=>{if(!o)return;const d=u.current,m=c.current;if(!d||!m)return;const y=()=>{const g=f.current,E={};g.forward&&(E.forward=!1),g.backward&&(E.backward=!1),g.leftward&&(E.leftward=!1),g.rightward&&(E.rightward=!1),g.run&&(E.shift=!1),g.forward=g.backward=g.leftward=g.rightward=g.run=!1,Object.keys(E).length>0&&l.updateKeyboard(E),m.style.transform="translate(-50%, -50%)",f.current.pointerId=-1},x=g=>{g.preventDefault();const E=d.getBoundingClientRect();f.current.cx=E.left+E.width/2,f.current.cy=E.top+E.height/2,f.current.pointerId=g.pointerId,d.setPointerCapture(g.pointerId),C(g)},C=g=>{if(g.pointerId!==f.current.pointerId)return;const E=g.clientX-f.current.cx,w=g.clientY-f.current.cy,k=Math.hypot(E,w),P=Math.min(k,n),A=Math.atan2(w,E),S=Math.cos(A)*P,j=Math.sin(A)*P;m.style.transform=`translate(calc(-50% + ${S}px), calc(-50% + ${j}px))`;const F=P/n,R=f.current,M={};if(F<t)R.forward&&(M.forward=!1,R.forward=!1),R.backward&&(M.backward=!1,R.backward=!1),R.leftward&&(M.leftward=!1,R.leftward=!1),R.rightward&&(M.rightward=!1,R.rightward=!1),R.run&&(M.shift=!1,R.run=!1);else{const oe=Math.cos(A),Ae=Math.sin(A),me=Ae<-.35,pe=Ae>.35,ge=oe<-.35,ye=oe>.35,he=F>=r;R.forward!==me&&(M.forward=me,R.forward=me),R.backward!==pe&&(M.backward=pe,R.backward=pe),R.leftward!==ge&&(M.leftward=ge,R.leftward=ge),R.rightward!==ye&&(M.rightward=ye,R.rightward=ye),R.run!==he&&(M.shift=he,R.run=he)}Object.keys(M).length>0&&l.updateKeyboard(M)},I=g=>{g.pointerId===f.current.pointerId&&y()};return d.addEventListener("pointerdown",x),d.addEventListener("pointermove",C),d.addEventListener("pointerup",I),d.addEventListener("pointercancel",I),d.addEventListener("pointerleave",I),()=>{d.removeEventListener("pointerdown",x),d.removeEventListener("pointermove",C),d.removeEventListener("pointerup",I),d.removeEventListener("pointercancel",I),d.removeEventListener("pointerleave",I),y()}},[o,n,t,r,l]),o?i.jsxs("div",{style:{position:"fixed",inset:0,zIndex:90,pointerEvents:"none",fontFamily:"'Pretendard', system-ui, sans-serif"},children:[i.jsx("div",{ref:u,style:{position:"absolute",left:24,bottom:24,width:n*2,height:n*2,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(20,22,30,0.32)",backdropFilter:"blur(14px) saturate(140%)",WebkitBackdropFilter:"blur(14px) saturate(140%)",touchAction:"none",pointerEvents:"auto"},children:i.jsx("div",{ref:c,style:{position:"absolute",left:"50%",top:"50%",width:n*.85,height:n*.85,borderRadius:"50%",background:"rgba(255,255,255,0.55)",boxShadow:"0 4px 12px rgba(0,0,0,0.28)",transform:"translate(-50%, -50%)",transition:"transform 0.04s linear",pointerEvents:"none"}})}),i.jsx("div",{style:{position:"absolute",right:20,bottom:32,display:"grid",gridTemplateColumns:"repeat(2, auto)",gap:12,pointerEvents:"auto"},children:s.map(d=>i.jsx(Jo,{action:d},d.id))})]}):null}function Jo({action:e}){const[n,t]=p.useState(!1),r=()=>{t(!0),e.key&&Je("keydown",e.key),e.onPress?.()},s=()=>{t(!1),e.key&&Je("keyup",e.key),e.onRelease?.()};return i.jsx("button",{type:"button",onPointerDown:o=>{o.preventDefault(),r()},onPointerUp:o=>{o.preventDefault(),s()},onPointerCancel:s,onPointerLeave:()=>{n&&s()},style:{width:64,height:64,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.22)",background:n?"rgba(255,216,74,0.32)":"rgba(20,22,30,0.42)",color:"#f3f4f8",backdropFilter:"blur(14px) saturate(140%)",WebkitBackdropFilter:"blur(14px) saturate(140%)",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:"pointer",touchAction:"none",userSelect:"none"},children:e.label})}const ue="outdoor",ke=e=>new Promise(n=>setTimeout(n,e)),ei=220,ti=80,ni=240,$=H.create((e,n)=>({current:ue,pending:null,scenes:{[ue]:{id:ue,name:"Outdoor",interior:!1}},transition:{progress:0,color:"#000000",active:!1},lastReturnPoint:null,registerScene:t=>e(r=>r.scenes[t.id]?r:{scenes:{...r.scenes,[t.id]:t}}),unregisterScene:t=>e(r=>{if(t===ue||!r.scenes[t])return r;const s={...r.scenes};return delete s[t],{scenes:s}}),setTransition:t=>e(r=>({transition:{...r.transition,...t}})),setReturnPoint:t=>e({lastReturnPoint:t}),goTo:async(t,r)=>{const s=n();if(s.pending||t===s.current&&!r?.entry)return;const o=s.scenes[t];if(!o){console.warn(`[scene] Unknown scene "${t}". Did you forget to register it?`);return}const l=o.interior??!1?"#0d0d10":"#f5f5f5";e({pending:t,transition:{active:!0,color:l,progress:0}});const u=performance.now();for(;;){const f=Math.min(1,(performance.now()-u)/ei);if(n().setTransition({progress:f}),f>=1)break;await ke(16)}r?.saveReturn&&e({lastReturnPoint:r.saveReturn}),e({current:t}),await ke(ti);const c=performance.now();for(;;){const f=Math.min(1,(performance.now()-c)/ni);if(n().setTransition({progress:1-f}),f>=1)break;await ke(16)}e({pending:null,transition:{active:!1,color:l,progress:0}})},serialize:()=>({version:1,current:n().current}),hydrate:t=>{!t||t.version!==1||n().scenes[t.current]&&e({current:t.current,pending:null})}})),ri="gaesup.scene",si="scene",oi="scene.store";function yn(){return $.getState().serialize()}function hn(e){$.getState().hydrate(e)}function Sn(e={}){return N.createStoreDomainPlugin({id:e.id??ri,name:"GaeSup Scene",saveExtensionId:e.saveExtensionId??si,storeServiceId:e.storeServiceId??oi,store:$,readyEvent:"scene:ready",capabilities:["scene"],serialize:yn,hydrate:hn})}const ii=Sn();function ai(e,n){if(e===n)return!0;if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}const q=H.create(e=>({rooms:new Map,portals:new Map,currentRoomId:null,visibleRoomIds:new Set,initializedSceneId:null,registerRoom:n=>e(t=>{const r=new Map(t.rooms);return r.set(n.id,n),{rooms:r}}),unregisterRoom:n=>e(t=>{if(!t.rooms.has(n))return t;const r=new Map(t.rooms);return r.delete(n),{rooms:r,currentRoomId:t.currentRoomId===n?null:t.currentRoomId}}),registerPortal:n=>e(t=>{const r=new Map(t.portals);return r.set(n.id,n),{portals:r}}),unregisterPortal:n=>e(t=>{if(!t.portals.has(n))return t;const r=new Map(t.portals);return r.delete(n),{portals:r}}),setVisibleRooms:(n,t,r)=>e(s=>s.initializedSceneId===n&&s.currentRoomId===t&&ai(s.visibleRoomIds,r)?s:{initializedSceneId:n,currentRoomId:t,visibleRoomIds:r}),reset:()=>e({currentRoomId:null,visibleRoomIds:new Set,initializedSceneId:null})}));function li({zIndex:e=9999}={}){const n=$(t=>t.transition);return!n.active&&n.progress<=.001?null:i.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,background:n.color,opacity:n.progress,pointerEvents:n.progress>.5?"auto":"none",zIndex:e,transition:"background-color 80ms linear"}})}function ci({scene:e,children:n}){const t=$(o=>o.registerScene),r=$(o=>o.unregisterScene),s=$(o=>o.current);return p.useEffect(()=>(t(e),()=>r(e.id)),[e,t,r]),s!==e.id?null:i.jsx(i.Fragment,{children:n})}function ui({position:e,sceneId:n,entry:t,exitOverride:r,radius:s=1.4,cooldownMs:o=800,color:a="#5a8acf",label:l}){const u=$(C=>C.goTo),c=$(C=>C.current),{teleport:f}=Me(),{position:d}=V.usePlayerPosition({updateInterval:50}),m=p.useRef(0),y=p.useMemo(()=>new v.CylinderGeometry(s,s,.08,28),[s]);p.useEffect(()=>()=>y.dispose(),[y]),Q.useFrame(()=>{const C=performance.now();if(C-m.current<o)return;const I=d.x-e[0],g=d.z-e[2];I*I+g*g>s*s||(m.current=C,c!==n&&x())});async function x(){const C=r??{position:[e[0],e[1],e[2]]};await u(n,{entry:t,saveReturn:C});const I=new v.Vector3(t.position[0],t.position[1],t.position[2]);f(I)}return i.jsxs("group",{position:e,children:[i.jsx("mesh",{rotation:[0,0,0],geometry:y,children:i.jsx("meshStandardMaterial",{color:a,emissive:a,emissiveIntensity:.35,transparent:!0,opacity:.6})}),l&&i.jsxs("mesh",{position:[0,1.3,0],children:[i.jsx("boxGeometry",{args:[.04,.6,.04]}),i.jsx("meshStandardMaterial",{color:a,emissive:a,emissiveIntensity:.4})]})]})}function di({sceneId:e,roomId:n,bounds:t,children:r}){const s=$(c=>c.current),o=q(c=>c.registerRoom),a=q(c=>c.unregisterRoom),l=q(c=>c.initializedSceneId),u=q(c=>c.visibleRoomIds);return p.useEffect(()=>(o({id:n,sceneId:e,bounds:t}),()=>a(n)),[n,e,t,o,a]),s!==e?null:l!==e?i.jsx(i.Fragment,{children:r}):u.has(n)?i.jsx(i.Fragment,{children:r}):null}function fi({id:e,sceneId:n,fromRoomId:t,toRoomId:r,position:s,radius:o,revealDistance:a}){const l=q(c=>c.registerPortal),u=q(c=>c.unregisterPortal);return p.useEffect(()=>(l({id:e,sceneId:n,fromRoomId:t,toRoomId:r,position:s,...o!==void 0?{radius:o}:{},...a!==void 0?{revealDistance:a}:{}}),()=>u(e)),[e,n,t,r,s,o,a,l,u]),null}const mi=.12;function pi(e,n){return e.x>=n.min[0]&&e.x<=n.max[0]&&e.y>=n.min[1]&&e.y<=n.max[1]&&e.z>=n.min[2]&&e.z<=n.max[2]}function bn(e,n,t){for(const r of n)if(r.sceneId===e&&pi(t,r.bounds))return r.id;return null}function gi(e){const n=e.rooms.filter(o=>o.sceneId===e.sceneId);if(n.length===0)return new Set;const t=bn(e.sceneId,n,e.position);if(!t)return new Set(n.map(o=>o.id));const r=new Set([t]),s=e.portals.filter(o=>o.sceneId===e.sceneId);for(const o of s){const a=o.revealDistance??3.8,l=e.position.x-o.position[0],u=e.position.y-o.position[1],c=e.position.z-o.position[2];l*l+u*u+c*c>a*a||(o.fromRoomId===t?r.add(o.toRoomId):o.toRoomId===t&&r.add(o.fromRoomId))}return r}function yi(){const e=$(l=>l.current),n=q(l=>l.rooms),t=q(l=>l.portals),r=q(l=>l.setVisibleRooms),s=q(l=>l.reset),{position:o}=V.usePlayerPosition({updateInterval:50}),a=p.useRef(0);return p.useEffect(()=>s,[s]),Q.useFrame((l,u)=>{if(a.current+=Math.max(0,u),a.current<mi)return;a.current=0;const c=Array.from(n.values()),f=Array.from(t.values()),d=bn(e,c,o),m=gi({sceneId:e,rooms:c,portals:f,position:o});r(e,d,m)}),null}const hi=new v.Color("#0a1430"),Si=new v.Color("#ffb377"),bi=new v.Color("#ff7a52"),xi=new v.Color("#5b6975"),vi=new v.Color("#dde7f0"),Ii=new v.Color("#3b4452");function Ei(e,n){const t=e+n/60;return t<5?{t:0,phase:"night"}:t<7?{t:(t-5)/2,phase:"dawn"}:t<17?{t:1,phase:"day"}:t<19?{t:1-(t-17)/2,phase:"dusk"}:{t:0,phase:"night"}}function wi({color:e="#cfd8e3",near:n=35,far:t=220,enabled:r=!0}={}){const s=Q.useThree(c=>c.scene),o=D.useTimeStore(c=>c.time.hour),a=D.useTimeStore(c=>c.time.minute),l=G.useWeatherStore(c=>c.current),u=p.useRef(void 0);return p.useEffect(()=>{if(u.current===void 0&&(u.current=s.fog instanceof v.Fog?s.fog.clone():null),!r){s.fog=u.current?u.current.clone():null;return}const c=new v.Color(e),f=Ei(o,a),d=c.clone();f.phase==="night"?d.lerp(hi,.25):f.phase==="dawn"?d.lerp(Si,.18*(1-f.t)):f.phase==="dusk"&&d.lerp(bi,.18*(1-f.t));let m=n,y=t;if(f.phase==="night"?(m=n*.45,y=t*.55):(f.phase==="dawn"||f.phase==="dusk")&&(m=n*(.55+.45*f.t),y=t*(.7+.3*f.t)),l){const x=Math.max(0,Math.min(1,l.intensity));l.kind==="rain"?(d.lerp(xi,.12+x*.1),m*=.7-x*.2,y*=.65-x*.2):l.kind==="storm"?(d.lerp(Ii,.16+x*.12),m*=.55-x*.2,y*=.5-x*.2):l.kind==="snow"&&(d.lerp(vi,.12+x*.08),m*=.75,y*=.7)}m=Math.max(2,m),y=Math.max(m+5,y),s.fog instanceof v.Fog?(s.fog.color.copy(d),s.fog.near=m,s.fog.far=y):s.fog=new v.Fog(d.getHex(),m,y)},[s,e,n,t,r,o,a,l?.kind,l?.intensity]),p.useEffect(()=>()=>{s.fog=u.current?u.current.clone():null},[s]),null}const Ci=[{hour:0,sunColor:"#1f2a48",ambientColor:"#1a1f2e",sunIntensity:.05,ambientIntensity:.18,azimuth:-Math.PI/2,elevation:-.3},{hour:5,sunColor:"#3b3a5a",ambientColor:"#28304a",sunIntensity:.15,ambientIntensity:.22,azimuth:-Math.PI/3,elevation:-.05},{hour:7,sunColor:"#ffb27a",ambientColor:"#7a8aa6",sunIntensity:.55,ambientIntensity:.3,azimuth:-Math.PI/4,elevation:.25},{hour:10,sunColor:"#fff1c8",ambientColor:"#aab4c8",sunIntensity:.85,ambientIntensity:.34,azimuth:-Math.PI/8,elevation:.7},{hour:13,sunColor:"#ffffff",ambientColor:"#b6c2d8",sunIntensity:1.05,ambientIntensity:.38,azimuth:0,elevation:1.05},{hour:16,sunColor:"#ffe0a8",ambientColor:"#a8b4cc",sunIntensity:.85,ambientIntensity:.34,azimuth:Math.PI/6,elevation:.65},{hour:18,sunColor:"#ff9a5a",ambientColor:"#806a8a",sunIntensity:.55,ambientIntensity:.28,azimuth:Math.PI/3,elevation:.18},{hour:20,sunColor:"#5a3f6a",ambientColor:"#34304a",sunIntensity:.18,ambientIntensity:.22,azimuth:Math.PI/2,elevation:-.05},{hour:24,sunColor:"#1f2a48",ambientColor:"#1a1f2e",sunIntensity:.05,ambientIntensity:.18,azimuth:3*Math.PI/4,elevation:-.3}],et={spring:new v.Color("#fff0f5"),summer:new v.Color("#fff5d8"),autumn:new v.Color("#ffd9b0"),winter:new v.Color("#dfe8f5")},tt={sunny:{sun:1,ambient:1,tint:new v.Color("#ffffff")},cloudy:{sun:.55,ambient:.95,tint:new v.Color("#cfd6e2")},rain:{sun:.3,ambient:.85,tint:new v.Color("#90a0b8")},snow:{sun:.65,ambient:1.1,tint:new v.Color("#dfeaf5")},storm:{sun:.2,ambient:.75,tint:new v.Color("#5a6a82")}};function ki(e,n){const t=e,r=(n%24+24)%24;let s=t[0],o=t[t.length-1];for(let u=0;u<t.length-1;u+=1){const c=t[u],f=t[u+1];if(r>=c.hour&&r<=f.hour){s=c,o=f;break}}const a=Math.max(1e-4,o.hour-s.hour),l=v.MathUtils.clamp((r-s.hour)/a,0,1);return{hour:r,sunColor:s.sunColor,ambientColor:s.ambientColor,sunIntensity:v.MathUtils.lerp(s.sunIntensity,o.sunIntensity,l),ambientIntensity:v.MathUtils.lerp(s.ambientIntensity,o.ambientIntensity,l),azimuth:v.MathUtils.lerp(s.azimuth,o.azimuth,l),elevation:v.MathUtils.lerp(s.elevation,o.elevation,l)}}function Ti({rigDistance:e=60,castShadow:n=!0,shadowMapSize:t=1024,keyframes:r,damping:s=.12}={}){const o=p.useRef(null),a=p.useRef(null),l=p.useMemo(()=>(r??Ci).slice().sort((y,x)=>y.hour-x.hour),[r]),u=p.useMemo(()=>new v.Color,[]),c=p.useMemo(()=>new v.Color,[]),f=p.useMemo(()=>new v.Color,[]),d=p.useMemo(()=>new v.Color,[]);return Q.useFrame(()=>{const m=o.current,y=a.current;if(!m||!y)return;const x=D.useTimeStore.getState().time,C=G.useWeatherStore.getState().current,I=C?.kind??"sunny",g=v.MathUtils.clamp(C?.intensity??.5,0,1),E=tt[I]??tt.sunny,w=et[x.season]??et.spring,k=ki(l,x.hour+x.minute/60);f.set(k.sunColor).lerp(w,.18).lerp(E.tint,.35+.25*g),d.set(k.ambientColor).lerp(w,.2).lerp(E.tint,.3+.3*g);const P=v.MathUtils.clamp(s,.01,1);u.copy(m.color).lerp(f,P),c.copy(y.color).lerp(d,P),m.color.copy(u),y.color.copy(c);const A=v.MathUtils.lerp(1,E.sun,.5+.5*g),S=v.MathUtils.lerp(1,E.ambient,.5+.5*g);m.intensity=v.MathUtils.lerp(m.intensity,k.sunIntensity*A,P),y.intensity=v.MathUtils.lerp(y.intensity,k.ambientIntensity*S,P);const j=Math.cos(k.elevation),F=Math.sin(k.elevation),R=Math.cos(k.azimuth)*j*e,M=Math.sin(k.azimuth)*j*e,oe=Math.max(2,F*e);m.position.set(R,oe,M),m.target.position.set(0,0,0),m.target.updateMatrixWorld()}),i.jsxs(i.Fragment,{children:[i.jsx("ambientLight",{ref:a,intensity:.3,color:"#b6c2d8"}),i.jsx("directionalLight",{ref:o,castShadow:n,"shadow-mapSize":[t,t],"shadow-normalBias":.06,"shadow-camera-near":1,"shadow-camera-far":Math.max(120,e*2),"shadow-camera-top":90,"shadow-camera-right":90,"shadow-camera-bottom":-90,"shadow-camera-left":-90,intensity:.8,color:"#ffffff",position:[20,30,10]})]})}exports.Camera=Te.Camera;exports.DEFAULT_MOTIONS_INPUT_EXTENSION_ID=_.DEFAULT_MOTIONS_INPUT_EXTENSION_ID;exports.DEFAULT_MOTIONS_PHYSICS_EXTENSION_ID=_.DEFAULT_MOTIONS_PHYSICS_EXTENSION_ID;exports.DEFAULT_MOTIONS_RUNTIME_SERVICE_ID=_.DEFAULT_MOTIONS_RUNTIME_SERVICE_ID;exports.GaesupRuntimeProvider=_.GaesupRuntimeProvider;exports.MOTIONS_TELEPORT_EVENT=_.MOTIONS_TELEPORT_EVENT;exports.applyToonToScene=_.applyToonToScene;exports.createMotionsPlugin=_.createMotionsPlugin;exports.createMotionsRuntime=_.createMotionsRuntime;exports.createToonMaterial=_.createToonMaterial;exports.disposeToonGradients=_.disposeToonGradients;exports.getDefaultToonMode=_.getDefaultToonMode;exports.getToonGradient=_.getToonGradient;exports.motionsPlugin=_.motionsPlugin;exports.requestMotionsTeleport=_.requestMotionsTeleport;exports.resolveRuntimeInputBackend=_.resolveRuntimeInputBackend;exports.setDefaultToonMode=_.setDefaultToonMode;exports.useBuildingStore=_.useBuildingStore;exports.useGaesupRuntime=_.useGaesupRuntime;exports.useGaesupRuntimeRevision=_.useGaesupRuntimeRevision;exports.useInputBackend=_.useInputBackend;exports.useStateSystem=_.useStateSystem;exports.BugSpot=L.BugSpot;exports.DEFAULT_RUNTIME_SAVE_DIAGNOSTICS_SERVICE_ID=L.DEFAULT_RUNTIME_SAVE_DIAGNOSTICS_SERVICE_ID;exports.DEFAULT_WORLD_SAVE_ENVIRONMENT=L.DEFAULT_WORLD_SAVE_ENVIRONMENT;exports.FishSpot=L.FishSpot;exports.RUNTIME_SAVE_DIAGNOSTIC_EVENT=L.RUNTIME_SAVE_DIAGNOSTIC_EVENT;exports.TreeObject=L.TreeObject;exports.createCameraSaveDataFromDomain=L.createCameraSaveDataFromDomain;exports.createGaesupRuntime=L.createGaesupRuntime;exports.createRuntimeSaveDiagnostics=L.createRuntimeSaveDiagnostics;exports.createSaveDataFromSaveSystem=L.createSaveDataFromSaveSystem;exports.createWorldDataFromSaveDomains=L.createWorldDataFromSaveDomains;exports.formatRuntimeSaveDiagnostic=L.formatRuntimeSaveDiagnostic;exports.getToolEvents=L.getToolEvents;exports.useAutoSave=L.useAutoSave;exports.useEquippedToolKind=L.useEquippedToolKind;exports.useLoadOnMount=L.useLoadOnMount;exports.useToolUse=L.useToolUse;exports.DuplicateExtensionError=Y.DuplicateExtensionError;exports.DuplicatePluginError=Y.DuplicatePluginError;exports.InMemoryExtensionRegistry=Y.InMemoryExtensionRegistry;exports.MissingExtensionError=Y.MissingExtensionError;exports.MissingPluginDependencyError=Y.MissingPluginDependencyError;exports.PluginManifestValidationError=Y.PluginManifestValidationError;exports.PluginRegistry=Y.PluginRegistry;exports.PluginVersionMismatchError=Y.PluginVersionMismatchError;exports.createPluginRegistry=Y.createPluginRegistry;exports.shouldSetupPluginForRuntime=Y.shouldSetupPluginForRuntime;exports.AnimationPanel=b.AnimationPanel;exports.BuildingController=b.BuildingController;exports.BuildingPanel=b.BuildingPanel;exports.BuildingSystem=b.BuildingSystem;exports.BuildingUI=b.BuildingUI;exports.CameraPanel=b.CameraPanel;exports.CameraPresets=b.CameraPresets;exports.DEFAULT_BUILDING_GRID_EXTENSION_ID=b.DEFAULT_BUILDING_GRID_EXTENSION_ID;exports.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID=b.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID;exports.DEFAULT_BUILDING_SAVE_EXTENSION_ID=b.DEFAULT_BUILDING_SAVE_EXTENSION_ID;exports.DEFAULT_BUILDING_STORE_SERVICE_ID=b.DEFAULT_BUILDING_STORE_SERVICE_ID;exports.EDITOR_PANEL_COMPONENT_KIND=b.EDITOR_PANEL_COMPONENT_KIND;exports.Editor=b.Editor;exports.EditorLayout=b.EditorLayout;exports.GameplayEventPanel=b.GameplayEventPanel;exports.GridHelper=b.GridHelper;exports.MotionController=b.MotionController;exports.MotionPanel=b.MotionPanel;exports.NPCInstance=b.NPCInstance;exports.NPCSystem=b.NPCSystem;exports.PerformancePanel=b.PerformancePanel;exports.ResizablePanel=b.ResizablePanel;exports.StudioPanel=b.StudioPanel;exports.TileSystem=b.TileSystem;exports.VehiclePanel=b.VehiclePanel;exports.WallSystem=b.WallSystem;exports.WeatherEffect=b.WeatherEffect;exports.autoDetectProfile=b.autoDetectProfile;exports.buildingPlugin=b.buildingPlugin;exports.classifyTier=b.classifyTier;exports.compileNPCBrainBlueprint=b.compileNPCBrainBlueprint;exports.createBuildingPlugin=b.createBuildingPlugin;exports.createEditorCommandStack=b.createEditorCommandStack;exports.createEditorShell=b.createEditorShell;exports.createEditorSlice=b.createEditorSlice;exports.createNPCObservation=b.createNPCObservation;exports.detectCapabilities=b.detectCapabilities;exports.editorSlice=b.editorSlice;exports.isEditorPanelComponentExtension=b.isEditorPanelComponentExtension;exports.profileForTier=b.profileForTier;exports.registerNPCBrainAdapter=b.registerNPCBrainAdapter;exports.registerNPCBrainBlueprint=b.registerNPCBrainBlueprint;exports.resolveEditorPanelComponentExtensions=b.resolveEditorPanelComponentExtensions;exports.resolveNPCBrainDecision=b.resolveNPCBrainDecision;exports.useBuildingEditor=b.useBuildingEditor;exports.useCharacterStore=b.useCharacterStore;exports.useEditor=b.useEditor;exports.useEditorStore=b.useEditorStore;exports.useNPCStore=b.useNPCStore;exports.usePerfStore=b.usePerfStore;exports.GaesupWorld=ce.WorldContainer;exports.GaesupWorldContent=ce.GaesupWorldContent;exports.World=ce.WorldContainer;exports.WorldConfigProvider=ce.WorldConfigProvider;exports.WorldContainer=ce.WorldContainer;exports.Clicker=V.Clicker;exports.GaesupController=V.ControllerWrapper;exports.GroundClicker=V.GroundClicker;exports.usePlayerPosition=V.usePlayerPosition;exports.DEFAULT_INTERACTION_INPUT_EXTENSION_ID=O.DEFAULT_INTERACTION_INPUT_EXTENSION_ID;exports.V3=O.V3;exports.V30=O.V30;exports.V31=O.V31;exports.createInteractionInputAdapter=O.createInteractionInputAdapter;exports.createInteractionSystemInputBackend=O.createInteractionSystemInputBackend;exports.createMemoryInputBackend=O.createMemoryInputBackend;exports.useGaesupStore=O.useGaesupStore;exports.SpeechBalloon=nt.SpeechBalloon;exports.useUIConfigStore=nt.useUIConfigStore;exports.GaeSupProps=te.WorldProps;exports.IndexedDBAdapter=te.IndexedDBAdapter;exports.LocalStorageAdapter=te.LocalStorageAdapter;exports.SaveSystem=te.SaveSystem;exports.createDefaultSaveSystem=te.createDefaultSaveSystem;exports.getSaveSystem=te.getSaveSystem;exports.useTimeStore=D.useTimeStore;exports.getEventRegistry=h.getEventRegistry;exports.getItemRegistry=h.getItemRegistry;exports.isEventActive=h.isEventActive;exports.notify=h.notify;exports.useEventsStore=h.useEventsStore;exports.useInventoryStore=h.useInventoryStore;exports.useToastStore=h.useToastStore;exports.PluginValidationAssertionError=N.PluginValidationAssertionError;exports.assertValidGaesupPlugin=N.assertValidGaesupPlugin;exports.createCozyLifeSamplePlugin=N.createCozyLifeSamplePlugin;exports.createHighGraphicsSamplePlugin=N.createHighGraphicsSamplePlugin;exports.createShooterKitSamplePlugin=N.createShooterKitSamplePlugin;exports.defineGaesupPlugin=N.defineGaesupPlugin;exports.validateGaesupPlugin=N.validateGaesupPlugin;exports.createCommandAcceptedResult=se.createCommandAcceptedResult;exports.createCommandAuthorityRouter=se.createCommandAuthorityRouter;exports.createCommandRejectedResult=se.createCommandRejectedResult;exports.createGameCommand=se.createGameCommand;exports.createServerEvent=se.createServerEvent;exports.createSnapshotAck=se.createSnapshotAck;exports.createStateDelta=se.createStateDelta;exports.CONTENT_SCHEMA_VERSION=T.CONTENT_SCHEMA_VERSION;exports.DAILY_FRIENDSHIP_CAP=T.DAILY_FRIENDSHIP_CAP;exports.DialogRunner=T.DialogRunner;exports.FRIENDSHIP_LEVELS=T.FRIENDSHIP_LEVELS;exports.HttpContentBundleSource=T.HttpContentBundleSource;exports.createContentBundleFromSaveSystem=T.createContentBundleFromSaveSystem;exports.getDialogRegistry=T.getDialogRegistry;exports.getQuestRegistry=T.getQuestRegistry;exports.loadContentBundleFromManifest=T.loadContentBundleFromManifest;exports.useDialogStore=T.useDialogStore;exports.useFriendshipStore=T.useFriendshipStore;exports.useQuestStore=T.useQuestStore;exports.useWalletStore=T.useWalletStore;exports.validateContentBundle=T.validateContentBundle;exports.validateContentBundleManifest=T.validateContentBundleManifest;exports.useWeatherStore=G.useWeatherStore;exports.SEED_ASSETS=fe.SEED_ASSETS;exports.useAssetStore=fe.useAssetStore;exports.AssetPreviewCanvas=rt.AssetPreviewCanvas;exports.HttpAssetSource=vn.HttpAssetSource;exports.DEFAULT_SERVER_COMMAND_AUTHORITY_SERVICE_ID=st.DEFAULT_SERVER_COMMAND_AUTHORITY_SERVICE_ID;exports.createServerPluginHost=st.createServerPluginHost;exports.AudioControls=uo;exports.CATALOG_CATEGORIES=je;exports.CatalogUI=xs;exports.CharacterCreator=Eo;exports.CraftingUI=Ts;exports.CropPlot=Ls;exports.DEFAULT_CAMERA_SAVE_EXTENSION_ID=Et;exports.DEFAULT_CAMERA_STORE_SERVICE_ID=wt;exports.DEFAULT_CAMERA_SYSTEM_EXTENSION_ID=It;exports.DialogBox=Cn;exports.DynamicFog=wi;exports.DynamicSky=Ti;exports.EventsHUD=jn;exports.FocusableObject=Tt;exports.Footprints=Uo;exports.Footsteps=po;exports.Gamepad=Cr;exports.HotbarUI=Bn;exports.HouseDoor=ui;exports.HousePlot=Qs;exports.Interactable=Tr;exports.InteractionPrompt=Pr;exports.InteractionTracker=wn;exports.InventoryUI=Gn;exports.LOCALE_LABEL=Bo;exports.MailboxUI=fs;exports.MiniMap=rr;exports.MinimapPlatform=or;exports.MotionUI=Rr;exports.OutfitAvatar=Lo;exports.QuestLogUI=Hn;exports.RoomPortal=fi;exports.RoomRoot=di;exports.RoomVisibilityDriver=yi;exports.RuntimeSaveDiagnosticsToaster=lr;exports.SEED_ITEMS=Dt;exports.SceneFader=li;exports.SceneRoot=ci;exports.ShopUI=Jr;exports.Teleport=_r;exports.TimeHUD=Br;exports.ToastHost=ar;exports.ToolUseController=es;exports.TouchControls=Zo;exports.TownHUD=Zs;exports.WalletHUD=Zr;exports.WeatherHUD=Vs;exports.audioPlugin=ro;exports.cameraPlugin=Ir;exports.catalogPlugin=Ss;exports.characterPlugin=So;exports.craftingPlugin=ks;exports.createAudioPlugin=cn;exports.createCameraPlugin=kt;exports.createCatalogPlugin=Ht;exports.createCharacterPlugin=fn;exports.createCraftingPlugin=Kt;exports.createEconomyPlugin=Nt;exports.createEventsPlugin=lt;exports.createFarmingPlugin=Jt;exports.createI18nPlugin=gn;exports.createInventoryPlugin=dt;exports.createMailPlugin=Wt;exports.createNPCPlugin=vt;exports.createQuestsPlugin=gt;exports.createRelationsPlugin=Bt;exports.createScenePlugin=Sn;exports.createTimePlugin=_t;exports.createTownPlugin=on;exports.createWeatherPlugin=nn;exports.economyPlugin=Qr;exports.eventsPlugin=Rn;exports.farmingPlugin=As;exports.formatRuntimeSaveDiagnosticToastMessage=ht;exports.getAudioEngine=ne;exports.getCropRegistry=ee;exports.getNPCScheduler=Pe;exports.getRecipeRegistry=ie;exports.hydrateAudioState=ln;exports.hydrateCatalogState=qt;exports.hydrateCharacterState=dn;exports.hydrateCraftingState=Yt;exports.hydrateEventsState=at;exports.hydrateFarmingState=Zt;exports.hydrateI18nState=pn;exports.hydrateInventoryState=ut;exports.hydrateMailState=Vt;exports.hydrateNPCState=xt;exports.hydrateQuestsState=pt;exports.hydrateRelationsState=Ut;exports.hydrateSceneState=hn;exports.hydrateShopState=Ot;exports.hydrateTimeState=Rt;exports.hydrateTownState=sn;exports.hydrateWalletState=At;exports.hydrateWeatherState=tn;exports.i18nPlugin=Ho;exports.inventoryPlugin=Nn;exports.mailPlugin=ds;exports.npcPlugin=gr;exports.questsPlugin=qn;exports.registerSeedCrops=Ns;exports.registerSeedEvents=Mn;exports.registerSeedItems=Gr;exports.relationsPlugin=ss;exports.resolveCharacterParts=zo;exports.resolveSchedule=St;exports.scenePlugin=ii;exports.serializeAudioState=an;exports.serializeCatalogState=$t;exports.serializeCharacterState=un;exports.serializeCraftingState=Xt;exports.serializeEventsState=it;exports.serializeFarmingState=Qt;exports.serializeI18nState=mn;exports.serializeInventoryState=ct;exports.serializeMailState=Gt;exports.serializeNPCState=bt;exports.serializeQuestsState=mt;exports.serializeRelationsState=zt;exports.serializeSceneState=yn;exports.serializeShopState=Lt;exports.serializeTimeState=Pt;exports.serializeTownState=rn;exports.serializeWalletState=Mt;exports.serializeWeatherState=en;exports.t=Vo;exports.timePlugin=Ar;exports.townPlugin=Xs;exports.useAmbientBgm=co;exports.useAudioStore=z;exports.useCatalogStore=ae;exports.useCatalogTracker=bs;exports.useCraftingStore=re;exports.useCurrentInteraction=De;exports.useDayChange=Nr;exports.useDecorationScore=Ks;exports.useEquippedItem=zn;exports.useEventsTicker=_n;exports.useGaesupController=Er;exports.useGameClock=Or;exports.useGameTime=jt;exports.useHotbar=ft;exports.useHotbarKeyboard=Un;exports.useHourChange=Fr;exports.useI18nStore=K;exports.useInteractablesStore=J;exports.useInteractionKey=ot;exports.useInventory=Fn;exports.useLocale=Yo;exports.useMailStore=Z;exports.useNpcSchedule=yr;exports.usePlotStore=U;exports.useQuestObjectiveTracker=Qn;exports.useRoomVisibilityStore=q;exports.useSceneStore=$;exports.useShopStore=X;exports.useTeleport=Me;exports.useTimeOfDay=Lr;exports.useTownStore=W;exports.useTranslate=Xo;exports.useWeatherTicker=Ws;exports.weatherPlugin=Bs;
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { a as Ue } from "./index-
|
|
3
|
-
import { C as ba } from "./index-
|
|
2
|
+
import { a as Ue } from "./index-DRLvJF_k.js";
|
|
3
|
+
import { C as ba } from "./index-DRLvJF_k.js";
|
|
4
4
|
import { W as dt, V as ze, G as be, a6 as It, a7 as wt, a9 as Et } from "./index-C5agFfBe.js";
|
|
5
5
|
import { ac as va, ad as xa, ae as Ia, T as wa, af as Ea, an as ka, aa as Ca, ab as _a, ai as Ta, am as Ma, al as Ra, aj as Da, ag as Pa, ah as Aa, ao as La, ak as Oa } from "./index-C5agFfBe.js";
|
|
6
|
-
import { j as kt, k as Ee } from "./index-
|
|
7
|
-
import { B as Fa, d as Na, D as Ua, F as Ba, R as Ga, T as Va, g as $a, b as Wa, e as ja, a as qa, c as Ha, f as Xa, u as Ya, l as Ka, i as Qa } from "./index-
|
|
6
|
+
import { j as kt, k as Ee } from "./index-B0oz8u47.js";
|
|
7
|
+
import { B as Fa, d as Na, D as Ua, F as Ba, R as Ga, T as Va, g as $a, b as Wa, e as ja, a as qa, c as Ha, f as Xa, u as Ya, l as Ka, i as Qa } from "./index-B0oz8u47.js";
|
|
8
8
|
import { D as Ja, b as ec, I as tc, M as nc, d as rc, P as oc, e as sc, g as ic, a as ac, s as cc } from "./runtimeFilter-CS35UPHd.js";
|
|
9
|
-
import { aG as pe, aH as Ct, aI as _t, aJ as V, aK as Tt, aL as Mt, aM as Rt } from "./plugin-
|
|
10
|
-
import { A as uc, w as dc, B as fc, v as pc, U as mc, C as gc, aT as hc, _ as yc, $ as bc, a0 as Sc, a1 as vc, E as xc, a as Ic, b as wc, G as Ec, N as kc, M as Cc, aN as _c, aU as Tc, P as Mc, R as Rc, S as Dc, T as Pc, V as Ac, W as Lc, aV as Oc, aY as zc, a3 as Fc, a_ as Nc, aO as Uc, a2 as Bc, c as Gc, d as Vc, h as $c, aP as Wc, aX as jc, e as qc, i as Hc, aZ as Xc, aQ as Yc, aR as Kc, r as Qc, aS as Zc, aF as Jc, u as el, f as tl, aW as nl } from "./plugin-
|
|
11
|
-
import { W as ol, G as sl, W as il, a as al, W as cl } from "./index-
|
|
12
|
-
import { b as ie, u as ft } from "./index-
|
|
13
|
-
import { a as ul, C as dl, G as fl } from "./index-
|
|
9
|
+
import { aG as pe, aH as Ct, aI as _t, aJ as V, aK as Tt, aL as Mt, aM as Rt } from "./plugin-BFzSydfr.js";
|
|
10
|
+
import { A as uc, w as dc, B as fc, v as pc, U as mc, C as gc, aT as hc, _ as yc, $ as bc, a0 as Sc, a1 as vc, E as xc, a as Ic, b as wc, G as Ec, N as kc, M as Cc, aN as _c, aU as Tc, P as Mc, R as Rc, S as Dc, T as Pc, V as Ac, W as Lc, aV as Oc, aY as zc, a3 as Fc, a_ as Nc, aO as Uc, a2 as Bc, c as Gc, d as Vc, h as $c, aP as Wc, aX as jc, e as qc, i as Hc, aZ as Xc, aQ as Yc, aR as Kc, r as Qc, aS as Zc, aF as Jc, u as el, f as tl, aW as nl } from "./plugin-BFzSydfr.js";
|
|
11
|
+
import { W as ol, G as sl, W as il, a as al, W as cl } from "./index-3WAK67Ha.js";
|
|
12
|
+
import { b as ie, u as ft } from "./index-DXZjZF_s.js";
|
|
13
|
+
import { a as ul, C as dl, G as fl } from "./index-DXZjZF_s.js";
|
|
14
14
|
import * as S from "three";
|
|
15
15
|
import { u as $ } from "./gaesupStore-DTu0tYBp.js";
|
|
16
16
|
import { e as ml, V as gl, f as hl, h as yl, c as bl, i as Sl, j as vl } from "./gaesupStore-DTu0tYBp.js";
|
|
17
17
|
import { jsxs as m, jsx as d, Fragment as ee } from "react/jsx-runtime";
|
|
18
18
|
import { useRef as D, useEffect as k, useState as F, useCallback as K, forwardRef as Dt, useId as Pt, useMemo as L } from "react";
|
|
19
19
|
import { S as Il, u as wl } from "./index-CUYKx17r.js";
|
|
20
|
-
import { M as pt } from "./index-
|
|
21
|
-
import { W as kl, I as Cl, L as _l, S as Tl, c as Ml, g as Rl } from "./index-
|
|
20
|
+
import { M as pt } from "./index-DGifA0e6.js";
|
|
21
|
+
import { W as kl, I as Cl, L as _l, S as Tl, c as Ml, g as Rl } from "./index-DGifA0e6.js";
|
|
22
22
|
import { u as R } from "./timeStore-BRw0mdde.js";
|
|
23
23
|
import { a as me, b as mt, u as M, g as G, c as Be, n as O } from "./eventsStore-DqmXNVEb.js";
|
|
24
24
|
import { i as Pl } from "./eventsStore-DqmXNVEb.js";
|