@m1kapp/kit 0.0.9 → 0.0.11

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/index.d.mts CHANGED
@@ -623,12 +623,12 @@ declare function svgIcon(text: string, options?: {
623
623
  fontSize?: number;
624
624
  }): string;
625
625
  /**
626
- * Generates a Next.js web app manifest (app/manifest.ts).
626
+ * Generates a Next.js web app manifest function (app/manifest.ts).
627
627
  * Icons are auto-generated as inline SVGs — no image files needed.
628
628
  *
629
629
  * Usage:
630
630
  * // app/manifest.ts
631
- * import { createManifest } from "@m1kapp/kit";
631
+ * import { createManifest } from "@m1kapp/kit/pwa";
632
632
  * export default createManifest({
633
633
  * name: "m1k",
634
634
  * shortName: "m1k",
@@ -650,7 +650,7 @@ declare function createManifest(options: {
650
650
  color?: string;
651
651
  radius?: number;
652
652
  };
653
- }): MetadataRoute.Manifest;
653
+ }): () => MetadataRoute.Manifest;
654
654
 
655
655
  declare class ApiError extends Error {
656
656
  readonly status: number;
package/dist/index.d.ts CHANGED
@@ -623,12 +623,12 @@ declare function svgIcon(text: string, options?: {
623
623
  fontSize?: number;
624
624
  }): string;
625
625
  /**
626
- * Generates a Next.js web app manifest (app/manifest.ts).
626
+ * Generates a Next.js web app manifest function (app/manifest.ts).
627
627
  * Icons are auto-generated as inline SVGs — no image files needed.
628
628
  *
629
629
  * Usage:
630
630
  * // app/manifest.ts
631
- * import { createManifest } from "@m1kapp/kit";
631
+ * import { createManifest } from "@m1kapp/kit/pwa";
632
632
  * export default createManifest({
633
633
  * name: "m1k",
634
634
  * shortName: "m1k",
@@ -650,7 +650,7 @@ declare function createManifest(options: {
650
650
  color?: string;
651
651
  radius?: number;
652
652
  };
653
- }): MetadataRoute.Manifest;
653
+ }): () => MetadataRoute.Manifest;
654
654
 
655
655
  declare class ApiError extends Error {
656
656
  readonly status: number;
package/dist/index.js CHANGED
@@ -9,4 +9,4 @@ html { height: 100dvh; }
9
9
  0% { opacity: 0; transform: translateY(4px); }
10
10
  100% { opacity: 1; transform: translateY(0); }
11
11
  }
12
- `})]})}var le=require("react"),Je=require("react-dom"),B=require("react/jsx-runtime"),Ke=[{label:"\uC790\uC8FC \uC4F0\uB294",emojis:["\u{1F3E0}","\u{1F50D}","\u{1F464}","\u2B50","\u2764\uFE0F","\u{1F525}","\u2705","\u{1F4CC}","\u{1F3AF}","\u{1F4A1}","\u{1F680}","\u{1F4AC}","\u{1F44D}","\u{1F64C}","\u{1F4AA}","\u{1F389}","\u{1F4E2}","\u{1F511}","\u26A1","\u{1F31F}","\u{1F380}","\u{1F9E1}","\u{1FAF6}","\u{1F947}"]},{label:"\uAC10\uC815",emojis:["\u{1F600}","\u{1F604}","\u{1F606}","\u{1F60E}","\u{1F979}","\u{1F60D}","\u{1F929}","\u{1F605}","\u{1F602}","\u{1F972}","\u{1F62D}","\u{1F624}","\u{1F914}","\u{1F607}","\u{1FAF6}","\u{1F917}","\u{1F634}","\u{1F92F}","\u{1F973}","\u{1F62C}","\u{1FAE0}","\u{1F92B}","\u{1F636}","\u{1FAE1}"]},{label:"\uB3D9\uBB3C",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F438}","\u{1F435}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F986}","\u{1F989}","\u{1F98B}","\u{1F422}","\u{1F42C}","\u{1F433}"]},{label:"\uC0AC\uBB3C",emojis:["\u{1F4F1}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F4F7}","\u{1F3B5}","\u{1F3AE}","\u{1F4DA}","\u{1F4B0}","\u{1F381}","\u{1F514}","\u{1F4CA}","\u{1F5D3}\uFE0F","\u26A1","\u{1F527}","\u{1F48A}","\u{1F9EA}","\u{1F52D}","\u{1F399}\uFE0F","\u{1F58B}\uFE0F","\u{1F4E6}","\u{1F6CD}\uFE0F","\u{1F4B3}","\u{1F510}"]},{label:"\uC790\uC5F0",emojis:["\u{1F308}","\u{1F338}","\u{1F33F}","\u{1F340}","\u{1F319}","\u2600\uFE0F","\u2B50","\u{1F30A}","\u{1F34E}","\u{1F33A}","\u2744\uFE0F","\u{1F334}","\u{1F335}","\u{1F344}","\u{1F33B}","\u{1F30D}","\u26C5","\u{1F32A}\uFE0F","\u{1F305}","\u{1F341}","\u{1F33E}","\u{1FAB8}","\u{1FAE7}","\u2604\uFE0F"]},{label:"\uD65C\uB3D9",emojis:["\u{1F3C3}","\u{1F9D8}","\u{1F3A8}","\u{1F373}","\u2708\uFE0F","\u{1F3D5}\uFE0F","\u{1F3A4}","\u{1F3CB}\uFE0F","\u{1F938}","\u{1F9E9}","\u{1F3AD}","\u{1F6D2}","\u{1F6B4}","\u{1F3CA}","\u26F7\uFE0F","\u{1F3B8}","\u{1F3B9}","\u{1F4F8}","\u{1F9D7}","\u{1F93F}","\u{1F3B2}","\u{1F3C6}","\u{1F3AF}","\u{1FA84}"]}];function Ze({emoji:e,onClick:t,className:r=""}){return(0,B.jsx)("button",{onClick:t,className:`w-9 h-9 rounded-full flex items-center justify-center text-lg bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-all hover:scale-110 active:scale-90 ${r}`,title:"Pick emoji",children:e})}function Xe({open:e,onClose:t,current:r,onSelect:a}){let[o,n]=(0,le.useState)(0);if((0,le.useEffect)(()=>{if(!e)return;let s=l=>{l.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;let{emojis:i}=Ke[o];return(0,Je.createPortal)((0,B.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end justify-center",onClick:t,children:[(0,B.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,B.jsxs)("div",{className:"relative z-10 w-full max-w-101.5 mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:s=>s.stopPropagation(),children:[(0,B.jsx)("div",{className:"px-4 pt-4 pb-3",children:(0,B.jsx)("p",{className:"text-sm font-bold text-zinc-900 dark:text-white",children:"\uC774\uBAA8\uC9C0"})}),(0,B.jsx)("div",{className:"flex gap-1 px-4 pb-3 overflow-x-auto scrollbar-hide",children:Ke.map((s,l)=>(0,B.jsx)("button",{onClick:()=>n(l),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-semibold transition-colors ${o===l?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s.label},s.label))}),(0,B.jsx)("div",{className:"px-4 pb-3 grid grid-cols-6 gap-2",children:i.map(s=>(0,B.jsx)("button",{onClick:()=>{a(s),t()},className:`h-11 rounded-xl flex items-center justify-center text-2xl transition-all hover:scale-110 active:scale-90 ${r===s?"bg-zinc-900 dark:bg-white":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s},s))}),(0,B.jsx)("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:(0,B.jsx)("button",{onClick:t,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})})]})]}),document.body)}var Qe=require("react"),et=require("react-dom"),q=require("react/jsx-runtime");function tt({label:e,children:t,placement:r="top"}){let[a,o]=(0,Qe.useState)(null),n=d=>{o(d.currentTarget.getBoundingClientRect())},i=()=>o(null),s=a?r==="top"?a.top+window.scrollY-36:a.bottom+window.scrollY+8:0,l=a?a.left+window.scrollX+a.width/2:0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("span",{className:"inline-flex",onMouseEnter:n,onMouseLeave:i,onFocus:n,onBlur:i,children:t}),a&&(0,et.createPortal)((0,q.jsx)("div",{className:"fixed z-[9999] pointer-events-none",style:{top:s,left:l,transform:"translateX(-50%)"},children:(0,q.jsx)("div",{className:"px-3 py-1.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-xs font-semibold whitespace-nowrap shadow-lg animate-in fade-in zoom-in-95 duration-100",children:e})}),document.body)]})}var G=require("react"),v=require("react/jsx-runtime");function Yt(e){let[,t,r]=e.split("-");return`${parseInt(t)}\uC6D4 ${parseInt(r)}\uC77C`}function rt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var te=13,Kt=3,K=te+Kt,Jt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zt=["","Mon","","Wed","","Fri",""];function Xt(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function ot(e,t,r,a){if(e===0)return r?"rgb(39, 39, 42)":"rgb(244, 244, 245)";let o=e/t,[n,i,s]=Xt(a);if(r){let u=[.25,.4,.6,.9],p=o>.75?u[3]:o>.5?u[2]:o>.25?u[1]:u[0];return`rgba(${n}, ${i}, ${s}, ${p})`}let l=[.8,.6,.4,.15],d=o>.75?l[3]:o>.5?l[2]:o>.25?l[1]:l[0];return`rgb(${Math.round(n+(255-n)*d)}, ${Math.round(i+(255-i)*d)}, ${Math.round(s+(255-s)*d)})`}function at({data:e,accent:t,isDark:r=!1,unit:a=""}){let[o,n]=(0,G.useState)(null),i=(0,G.useRef)(null),s=(0,G.useMemo)(()=>{let g=new Set,k=new Date().getFullYear();g.add(k);for(let $ of e)g.add(new Date($.date).getFullYear());return Array.from(g).sort(($,X)=>X-$)},[e]),[l,d]=(0,G.useState)(new Date().getFullYear()),u=(0,G.useMemo)(()=>new Map(e.map(g=>[g.date,g.count])),[e]),p=e.length>0?e[0].date:null,f=p?new Date(p).toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"}):null,b=new Date,x=rt(b),P=new Date(l,0,1),z=new Date(l,11,31),R=new Date(P);R.setDate(R.getDate()-R.getDay());let E=[],A=Math.ceil((z.getTime()-R.getTime())/(1e3*60*60*24))+1;for(let g=0;g<A;g++){let k=new Date(R);if(k.setDate(k.getDate()+g),k>z)break;let $=rt(k),X=Math.floor(g/7),ne=g%7,ie=k<P,ge=k>b;E.push({date:$,count:u.get($)||0,col:X,row:ne,isOutOfRange:ie,isFuture:ge})}let I=Math.max(...E.map(g=>g.count),1),M=E.length>0?Math.max(...E.map(g=>g.col))+1:1,h=[],w=-1;for(let g of E){if(g.row!==0||g.isOutOfRange)continue;let k=new Date(g.date).getMonth();k!==w&&(h.push({label:Jt[k],col:g.col}),w=k)}let S=36,_=22,Rt=S+M*K,Mt=_+7*K;return(0,v.jsxs)("div",{ref:i,className:"relative space-y-4",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[(0,v.jsx)("div",{className:"flex items-center gap-1.5",children:s.map(g=>(0,v.jsx)("button",{onClick:()=>d(g),className:`px-3 py-1 rounded-lg text-xs font-medium transition-colors ${l===g?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-400 dark:text-zinc-500 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:g},g))}),f&&(0,v.jsxs)("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:["\uCCAB \uAE30\uB85D ",(0,v.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:f})]})]}),(0,v.jsx)("div",{className:"overflow-x-auto",children:(0,v.jsxs)("svg",{width:Rt,height:Mt,className:"block mx-auto",onMouseLeave:()=>n(null),children:[h.map((g,k)=>(0,v.jsx)("text",{x:S+g.col*K,y:13,className:"fill-zinc-400",fontFamily:"system-ui, sans-serif",fontSize:10,children:g.label},`${g.label}-${k}`)),Zt.map((g,k)=>g?(0,v.jsx)("text",{x:0,y:_+k*K+te-2,className:"fill-zinc-300",fontFamily:"system-ui, sans-serif",fontSize:9,children:g},k):null),E.map(g=>{let k=g.date===x,$=g.date===p,X=g.isOutOfRange?"transparent":g.isFuture?r?"rgb(24, 24, 27)":"rgb(250, 250, 250)":$?t:ot(g.count,I,r,t),ne=S+g.col*K,ie=_+g.row*K;return(0,v.jsx)("rect",{x:ne,y:ie,width:te,height:te,rx:3,fill:X,stroke:$?t:"none",strokeWidth:$?1.5:0,style:{cursor:g.isOutOfRange?"default":"pointer"},onMouseEnter:ge=>{if(g.isOutOfRange)return;let ze=ge.currentTarget.ownerSVGElement.getBoundingClientRect(),Se=i.current.getBoundingClientRect();n({x:ne+ze.left-Se.left+te/2,y:ie+ze.top-Se.top,date:g.date,count:g.count,isFirst:$,isToday:k,isFuture:g.isFuture})}},g.date)})]})}),o&&(0,v.jsxs)("div",{className:"pointer-events-none absolute z-30 -translate-x-1/2 -translate-y-full",style:{left:o.x,top:o.y-6},children:[(0,v.jsxs)("div",{className:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-[11px] rounded-lg px-2.5 py-1.5 shadow-lg whitespace-nowrap",children:[(0,v.jsx)("span",{className:"font-medium",children:Yt(o.date)}),!o.isFuture&&(0,v.jsx)("span",{className:"ml-1.5 tabular-nums",children:o.count>0?`${o.count.toLocaleString()}${a}`:"\uAE30\uB85D \uC5C6\uC74C"}),o.isFirst&&(0,v.jsx)("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\u{1F331} \uCCAB \uAE30\uB85D"}),o.isToday&&!o.isFirst&&(0,v.jsx)("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\uC624\uB298"})]}),(0,v.jsx)("div",{className:"mx-auto w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-zinc-900 dark:border-t-zinc-100"})]}),(0,v.jsxs)("div",{className:"flex items-center justify-end gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[(0,v.jsx)("span",{children:"Less"}),[0,.15,.35,.6,.85].map((g,k)=>(0,v.jsx)("div",{className:"w-3 h-3 rounded-xs",style:{backgroundColor:g===0?r?"rgb(39, 39, 42)":"rgb(244, 244, 245)":ot(Math.ceil(g*10),10,r,t)}},k)),(0,v.jsx)("span",{children:"More"}),(0,v.jsx)("div",{className:"ml-2 w-3 h-3 rounded-xs",style:{backgroundColor:t,opacity:.6}}),(0,v.jsx)("span",{children:"1st"})]})]})}var nt=require("react"),we=require("react/jsx-runtime"),Qt={xs:{box:"w-6 h-6",text:"text-[9px]",px:24},sm:{box:"w-8 h-8",text:"text-[11px]",px:32},md:{box:"w-10 h-10",text:"text-sm",px:40},lg:{box:"w-14 h-14",text:"text-lg",px:56},xl:{box:"w-20 h-20",text:"text-2xl",px:80}};function it({src:e,fallback:t,size:r="md",shape:a="circle",color:o="#3f3f46",className:n=""}){let{box:i,text:s}=Qt[r],l=a==="circle"?"rounded-full":"rounded-xl",[d,u]=(0,nt.useState)(!1);if(e&&!d)return(0,we.jsx)("img",{src:e,alt:t,onError:()=>u(!0),className:`${i} ${l} object-cover flex-shrink-0 ${n}`});let p=t.trim().slice(0,2).toUpperCase();return(0,we.jsx)("div",{className:`${i} ${l} flex items-center justify-center flex-shrink-0 font-bold select-none ${s} ${n}`,style:{backgroundColor:o,color:"#ffffff"},"aria-label":t,children:p})}var ct=require("react/jsx-runtime"),er={default:"bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400",green:"bg-green-100 dark:bg-green-950 text-green-700 dark:text-green-400",red:"bg-red-100 dark:bg-red-950 text-red-700 dark:text-red-400",yellow:"bg-yellow-100 dark:bg-yellow-950 text-yellow-700 dark:text-yellow-400",blue:"bg-blue-100 dark:bg-blue-950 text-blue-700 dark:text-blue-400",purple:"bg-purple-100 dark:bg-purple-950 text-purple-700 dark:text-purple-400",orange:"bg-orange-100 dark:bg-orange-950 text-orange-700 dark:text-orange-400"},tr={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-0.5"};function st({children:e,variant:t="default",size:r="md",className:a=""}){return(0,ct.jsx)("span",{className:`inline-flex items-center font-semibold rounded-full leading-none ${er[t]} ${tr[r]} ${a}`,children:e})}var de=require("react"),N=require("react/jsx-runtime");function ve(e){let[t,r]=(0,de.useState)(!1),a=typeof navigator<"u"&&typeof navigator.share=="function";return{share:(0,de.useCallback)(async n=>{let i={...e,...n},s=i.url??(typeof window<"u"?window.location.href:"");if(a)try{await navigator.share({title:i.title,text:i.text,url:s});return}catch(l){if(l.name==="AbortError")return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},[a]),copied:t,canNativeShare:a}}function lt({url:e,title:t,text:r,label:a="\uACF5\uC720",copiedLabel:o="\uB9C1\uD06C \uBCF5\uC0AC\uB428",className:n=""}){let{share:i,copied:s}=ve({url:e,title:t,text:r});return(0,N.jsx)("button",{onClick:()=>i(),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-sm font-semibold bg-zinc-100 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 active:scale-95 transition-all ${n}`,children:s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(or,{}),o]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(rr,{}),a]})})}function rr(){return(0,N.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,N.jsx)("circle",{cx:"18",cy:"5",r:"3"}),(0,N.jsx)("circle",{cx:"6",cy:"12",r:"3"}),(0,N.jsx)("circle",{cx:"18",cy:"19",r:"3"}),(0,N.jsx)("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),(0,N.jsx)("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}function or(){return(0,N.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,N.jsx)("polyline",{points:"20 6 9 17 4 12"})})}var L=require("react"),J=require("react/jsx-runtime"),dt=(0,L.createContext)(null);function pt({children:e}){let[t,r]=(0,L.useState)([]),a=(0,L.useCallback)((o,n)=>{let i=Math.random().toString(36).slice(2,9),s=n?.duration??2500;r(l=>[...l,{id:i,message:o,variant:n?.variant??"default",duration:s}]),setTimeout(()=>{r(l=>l.filter(d=>d.id!==i))},s)},[]);return(0,J.jsxs)(dt.Provider,{value:a,children:[e,(0,J.jsx)("div",{"aria-live":"polite","aria-atomic":"false",className:"fixed bottom-24 inset-x-0 z-[9999] flex flex-col items-center gap-2 px-4 pointer-events-none",children:t.map(o=>(0,J.jsx)(nr,{item:o},o.id))})]})}var ar={default:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900",success:"bg-green-600 text-white",error:"bg-red-600 text-white",info:"bg-blue-600 text-white"};function nr({item:e}){let[t,r]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{let a=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(a)},[]),(0,J.jsx)("div",{role:"status",className:`pointer-events-auto w-full max-w-[390px] px-4 py-3 rounded-2xl text-sm font-semibold shadow-xl text-center transition-all duration-300 ${ar[e.variant]} ${t?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,children:e.message})}function ut(){let e=(0,L.useContext)(dt);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}var re=require("react");function gt(e,t){let[r,a]=(0,re.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i!==null?JSON.parse(i):t}catch{return t}}),o=(0,re.useCallback)(i=>{a(s=>{let l=typeof i=="function"?i(s):i;try{window.localStorage.setItem(e,JSON.stringify(l))}catch{}return l})},[e]),n=(0,re.useCallback)(()=>{try{window.localStorage.removeItem(e)}catch{}a(t)},[e]);return[r,o,n]}var pe=require("react");function ft(e,t){let[r,a]=(0,pe.useState)(e);return(0,pe.useEffect)(()=>{let o=setTimeout(()=>a(e),t);return()=>clearTimeout(o)},[e,t]),r}var O=require("react");function mt(e,t={}){let[r,a]=(0,O.useState)(!1),[o,n]=(0,O.useState)(null),[i,s]=(0,O.useState)(void 0),l=(0,O.useRef)(e),d=(0,O.useRef)(t);l.current=e,d.current=t;let u=(0,O.useCallback)(async f=>{a(!0),n(null);try{let b=await l.current(f);s(b),d.current.onSuccess?.(b)}catch(b){let x=b instanceof Error?b:new Error(String(b));n(x),d.current.onError?.(x)}finally{a(!1)}},[]),p=(0,O.useCallback)(()=>{n(null),s(void 0)},[]);return{submit:u,loading:r,error:o,data:i,reset:p}}var Z=require("react");function ht(e={}){let{threshold:t=0,rootMargin:r="0px",once:a=!1}=e,[o,n]=(0,Z.useState)(!1),i=(0,Z.useRef)(null);return{ref:(0,Z.useCallback)(l=>{i.current?.disconnect(),i.current=null,l&&(i.current=new IntersectionObserver(([d])=>{n(d.isIntersecting),d.isIntersecting&&a&&i.current?.disconnect()},{threshold:t,rootMargin:r}),i.current.observe(l))},[t,r,a]),inView:o}}var wt=require("react/jsx-runtime"),ir={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl",full:"rounded-full"};function bt({className:e="",rounded:t="md"}){return(0,wt.jsx)("div",{className:`animate-pulse bg-zinc-200 dark:bg-zinc-800 ${ir[t]} ${e}`,"aria-hidden":"true"})}var W=require("react"),vt=require("react-dom"),F=require("react/jsx-runtime"),sr={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"};function xt({open:e,onClose:t,title:r,size:a="sm",children:o,persistent:n=!1,className:i=""}){let[s,l]=(0,W.useState)(!1),[d,u]=(0,W.useState)(!1),p=(0,W.useRef)(null);return(0,W.useEffect)(()=>{if(e)l(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>u(!0)));else{u(!1);let f=setTimeout(()=>l(!1),200);return()=>clearTimeout(f)}},[e]),(0,W.useEffect)(()=>{if(!e||n)return;let f=b=>{b.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,t,n]),(0,W.useEffect)(()=>{if(e){let f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}}},[e]),!s||typeof document>"u"?null:(0,vt.createPortal)((0,F.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?"dialog-title":void 0,className:"fixed inset-0 z-[200] flex items-end sm:items-center justify-center p-4",children:[(0,F.jsx)("div",{className:`absolute inset-0 bg-black/50 transition-opacity duration-200 ${d?"opacity-100":"opacity-0"}`,onClick:n?void 0:t}),(0,F.jsxs)("div",{ref:p,className:`relative w-full ${sr[a]} bg-white dark:bg-zinc-900 rounded-3xl shadow-2xl p-6 transition-all duration-200 ${d?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95"} ${i}`,children:[!n&&(0,F.jsx)("button",{onClick:t,className:"absolute top-4 right-4 p-1.5 rounded-full text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"\uB2EB\uAE30",children:(0,F.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,F.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),r&&(0,F.jsx)("h2",{id:"dialog-title",className:"text-lg font-bold text-zinc-900 dark:text-white mb-4 pr-6",children:r}),o]})]}),document.body)}var oe=require("react");function ue(){let[e,t]=(0,oe.useState)(null),[r,a]=(0,oe.useState)(!1);(0,oe.useEffect)(()=>{if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0){a(!0);return}let s=d=>{d.preventDefault(),t(d)},l=()=>a(!0);return window.addEventListener("beforeinstallprompt",s),window.addEventListener("appinstalled",l),()=>{window.removeEventListener("beforeinstallprompt",s),window.removeEventListener("appinstalled",l)}},[]);let o=r?"installed":e?"android-ready":cr()?"ios-safari":"unsupported";async function n(){if(!e)return;await e.prompt();let{outcome:i}=await e.userChoice;i==="accepted"&&a(!0),t(null)}return{state:o,install:n}}function cr(){if(typeof navigator>"u")return!1;let e=navigator.userAgent;return/iphone|ipad|ipod/i.test(e)&&!/CriOS|FxiOS|OPiOS|EdgiOS/i.test(e)}var kt=require("react");var c=require("react/jsx-runtime");function yt({appName:e="\uC571",iconSrc:t,label:r="\uC571\uC73C\uB85C \uC124\uCE58",installedLabel:a,className:o}){let{state:n,install:i}=ue(),[s,l]=(0,kt.useState)(!1);if(n==="installed")return a?(0,c.jsxs)("div",{className:`flex items-center gap-2 text-sm text-zinc-400 ${o??""}`,children:[(0,c.jsx)(dr,{}),(0,c.jsx)("span",{children:a})]}):null;if(n==="unsupported")return null;function d(){n==="android-ready"?i():n==="ios-safari"&&l(!0)}return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("button",{onClick:d,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-sm font-semibold transition-all active:scale-95 ${o??""}`,children:[(0,c.jsx)(zt,{}),(0,c.jsx)("span",{children:r}),n==="ios-safari"&&(0,c.jsx)(lr,{})]}),n==="ios-safari"&&(0,c.jsx)(xe,{open:s,onClose:()=>l(!1),appName:e,iconSrc:t})]})}function xe({open:e,onClose:t,appName:r,iconSrc:a}){return e?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:t}),(0,c.jsxs)("div",{className:"fixed bottom-0 left-1/2 -translate-x-1/2 z-[9999] w-full max-w-[430px] rounded-t-2xl bg-white dark:bg-zinc-900 shadow-2xl",children:[(0,c.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,c.jsx)("div",{className:"w-9 h-1 rounded-full bg-zinc-200 dark:bg-zinc-700"})}),(0,c.jsxs)("div",{className:"px-5 pb-8 pt-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[a?(0,c.jsx)("img",{src:a,alt:r,className:"w-12 h-12 rounded-xl shadow"}):(0,c.jsx)("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:(0,c.jsx)(zt,{size:22,className:"text-zinc-400"})}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{className:"font-bold text-zinc-900 dark:text-white text-base",children:[r," \uC124\uCE58\uD558\uAE30"]}),(0,c.jsx)("p",{className:"text-xs text-zinc-400 mt-0.5",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00\uD558\uBA74 \uC571\uCC98\uB7FC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5B4\uC694"})]})]}),(0,c.jsx)("div",{className:"space-y-3",children:[{icon:(0,c.jsx)(pr,{}),text:(0,c.jsxs)(c.Fragment,{children:["\uD558\uB2E8 \uD234\uBC14\uC758 ",(0,c.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uACF5\uC720"})," \uBC84\uD2BC\uC744 \uD0ED\uD558\uC138\uC694"]})},{icon:(0,c.jsx)(ur,{}),text:(0,c.jsxs)(c.Fragment,{children:["\uC2A4\uD06C\uB864\uD574\uC11C"," ",(0,c.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uC138\uC694"]})},{icon:(0,c.jsx)(gr,{}),text:(0,c.jsxs)(c.Fragment,{children:["\uC6B0\uCE21 \uC0C1\uB2E8 ",(0,c.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uBA74 \uC644\uB8CC!"]})}].map((n,i)=>(0,c.jsxs)("div",{className:"flex items-start gap-3",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-500 dark:text-zinc-400",children:n.icon}),(0,c.jsx)("div",{className:"flex-1 pt-1",children:(0,c.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[(0,c.jsx)("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-zinc-200 dark:bg-zinc-700 text-[9px] font-bold text-zinc-500 dark:text-zinc-400 mr-1.5 flex-shrink-0",children:i+1}),n.text]})})]},i))}),(0,c.jsxs)("div",{className:"mt-5 flex items-center gap-2 px-3 py-2.5 rounded-xl bg-zinc-50 dark:bg-zinc-800",children:[(0,c.jsx)(fr,{}),(0,c.jsx)("p",{className:"text-xs text-zinc-400",children:"Safari \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB9CC \uD648 \uD654\uBA74 \uCD94\uAC00\uAC00 \uAC00\uB2A5\uD574\uC694"})]}),(0,c.jsx)("button",{onClick:t,className:"mt-3 w-full py-3 rounded-xl text-sm font-semibold text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})]})]})]}):null}function zt({size:e=16,className:t=""}){return(0,c.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[(0,c.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,c.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,c.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function lr(){return(0,c.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70",children:(0,c.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function dr(){return(0,c.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,c.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function pr(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,c.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,c.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function ur(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),(0,c.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function gr(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("polyline",{points:"9 11 12 14 22 4"}),(0,c.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function fr(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 flex-shrink-0",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]})}var mr={width:"device-width",initialScale:1,maximumScale:1,userScalable:!1,viewportFit:"cover"};function ke(e,t={}){let{size:r=192,bg:a="#000000",color:o="#ffffff",radius:n=.25,fontSize:i=.375}=t,s=Math.round(r*n),l=Math.round(r*i),d=a.replace("#","%23"),u=o.replace("#","%23");return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${r} ${r}'><rect width='${r}' height='${r}' rx='${s}' fill='${d}'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-family='system-ui,sans-serif' font-size='${l}' font-weight='900' fill='${u}'>${e}</text></svg>`}function hr(e){let{name:t,shortName:r=t,description:a,startUrl:o="/",backgroundColor:n="#ffffff",themeColor:i="#000000",icon:s}=e,l=s?[{src:ke(s.text,{size:192,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"192x192",type:"image/svg+xml"},{src:ke(s.text,{size:512,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"512x512",type:"image/svg+xml"}]:[];return{name:t,short_name:r,...a&&{description:a},start_url:o,display:"standalone",orientation:"portrait",background_color:n,theme_color:i,icons:l}}var U=class extends Error{constructor(r,a,o,n,i){super(`${r} ${a}${n?` [${i??"GET"} ${n}]`:""}`);this.status=r;this.statusText=a;this.body=o;this.url=n;this.method=i;this.name="ApiError"}};async function ae(e){return(e.headers.get("content-type")??"").includes("application/json")?e.json():e.text()}function St(e,t={}){let r=e.replace(/\/$/,"");async function a(o,n,i,s={}){let l=n.startsWith("http")?n:`${r}/${n.replace(/^\//,"")}`,d={...t.headers,...s.headers};i!==void 0&&s.contentType!==null&&(d["Content-Type"]=s.contentType??"application/json");let u={method:o,headers:d,signal:s.signal};i!==void 0&&(u.body=i instanceof FormData?i:JSON.stringify(i));let p=new Request(l,u);t.onRequest&&(p=t.onRequest(p)??p);let f=await fetch(p);if(!f.ok){let b=await ae(f).catch(()=>null),x=new U(f.status,f.statusText,b,l,o);throw t.onError?.(x),x}if(!(f.status===204||f.headers.get("content-length")==="0"))return ae(f)}return{get:(o,n)=>a("GET",o,void 0,n),post:(o,n,i)=>a("POST",o,n,i),put:(o,n,i)=>a("PUT",o,n,i),patch:(o,n,i)=>a("PATCH",o,n,i),delete:(o,n)=>a("DELETE",o,void 0,n)}}var C=require("react");var br=500,V=new Map,ye=new Map;function Tt(e){e?V.delete(e):V.clear()}function wr(e,t){V.size>=br&&V.delete(V.keys().next().value),V.set(e,t)}async function vr(e){let t=await fetch(e);if(!t.ok){let r=await ae(t).catch(()=>null);throw new U(t.status,t.statusText,r,e,"GET")}return ae(t)}async function xr(e,t,r){let a;for(let o=0;o<=t;o++)try{return await e()}catch(n){if(a=n,n instanceof U)throw n;o<t&&await new Promise(i=>setTimeout(i,r*2**o))}throw a}function Nt(e,t={}){let{enabled:r=!0,staleTime:a=0,retry:o=2,retryDelay:n=1e3,revalidateOnFocus:i=!0,fetcher:s=vr,onSuccess:l,onError:d}=t,[u,p]=(0,C.useState)(()=>{if(!e||a===0)return;let h=V.get(e);if(h&&Date.now()-h.ts<a)return h.data}),[f,b]=(0,C.useState)(()=>{if(!e||!r)return"idle";if(a>0){let h=V.get(e);if(h&&Date.now()-h.ts<a)return"success"}return"loading"}),[x,P]=(0,C.useState)(void 0),z=(0,C.useRef)(!0),R=(0,C.useRef)(s),E=(0,C.useRef)(l),A=(0,C.useRef)(d);R.current=s,E.current=l,A.current=d;let I=(0,C.useCallback)(async(h=!1)=>{if(!e||!r){b(w=>w==="idle"?w:"idle");return}if(!h&&a>0){let w=V.get(e);if(w&&Date.now()-w.ts<a){p(w.data),b("success");return}}b("loading"),P(void 0);try{let w=ye.get(e);w||(w=xr(()=>R.current(e),o,n),ye.set(e,w),w.finally(()=>ye.delete(e)));let S=await w;if(!z.current)return;wr(e,{data:S,ts:Date.now()}),p(S),b("success"),E.current?.(S)}catch(w){if(!z.current)return;let S=w;P(S),b("error"),A.current?.(S)}},[e,r,a,o,n]),M=(0,C.useCallback)(()=>I(!0),[I]);return(0,C.useEffect)(()=>(z.current=!0,I(),()=>{z.current=!1}),[I]),(0,C.useEffect)(()=>{if(!i)return;let h=()=>{document.visibilityState==="visible"&&I()};return document.addEventListener("visibilitychange",h),window.addEventListener("focus",h),()=>{document.removeEventListener("visibilitychange",h),window.removeEventListener("focus",h)}},[I,i]),{data:u,loading:f==="loading",error:x,status:f,refetch:M}}var y=require("react");function Pt(e,t={}){let{interval:r=5e3,enabled:a=!0,pauseOnHidden:o=!0,onSuccess:n,onError:i}=t,[s,l]=(0,y.useState)(void 0),[d,u]=(0,y.useState)(!1),[p,f]=(0,y.useState)(void 0),[b,x]=(0,y.useState)(a),P=(0,y.useRef)(!0),z=(0,y.useRef)(null),R=(0,y.useRef)(r),E=(0,y.useRef)(e),A=(0,y.useRef)(n),I=(0,y.useRef)(i);R.current=r,E.current=e,A.current=n,I.current=i,(0,y.useEffect)(()=>(P.current=!0,()=>{P.current=!1}),[]);let M=(0,y.useCallback)(async()=>{if(P.current){u(!0);try{let S=await E.current();if(!P.current)return;l(S),f(void 0),A.current?.(S)}catch(S){if(!P.current)return;let _=S;f(_),I.current?.(_)}finally{P.current&&u(!1)}}},[]),h=(0,y.useCallback)(()=>{z.current&&(clearInterval(z.current),z.current=null)},[]),w=(0,y.useCallback)(()=>{h(),z.current=setInterval(M,R.current)},[M,h]);return(0,y.useEffect)(()=>{if(!b){h();return}return M(),w(),h},[b,M,w,h]),(0,y.useEffect)(()=>{if(b)return h(),z.current=setInterval(M,R.current),h},[r]),(0,y.useEffect)(()=>{if(!o)return;let S=()=>{b&&(document.visibilityState==="hidden"?h():(M(),w()))};return document.addEventListener("visibilitychange",S),()=>document.removeEventListener("visibilitychange",S)},[b,o,M,w,h]),{data:s,loading:d,error:p,isRunning:b,stop:()=>x(!1),start:()=>x(!0),refetch:M}}var Et=require("clsx"),Ct=require("tailwind-merge");function kr(e){let t=new Date(e),r=Date.now()-t.getTime(),a=Math.floor(r/1e3);return a<60?"\uBC29\uAE08 \uC804":a<3600?`${Math.floor(a/60)}\uBD84 \uC804`:a<86400?`${Math.floor(a/3600)}\uC2DC\uAC04 \uC804`:a<86400*2?"\uC5B4\uC81C":a<86400*7?`${Math.floor(a/86400)}\uC77C \uC804`:a<86400*30?`${Math.floor(a/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function yr(e){let t=Math.abs(e),r=e<0?"-":"";return t>=1e8?`${r}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${r}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${r}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:e.toLocaleString("ko-KR")}function zr(e,t="KRW",r="ko-KR"){return new Intl.NumberFormat(r,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(e)}function Sr(...e){return(0,Ct.twMerge)((0,Et.clsx)(e))}0&&(module.exports={ApiError,AppShell,AppShellContent,AppShellHeader,Avatar,Badge,Button,Dialog,Divider,EmojiButton,EmojiPicker,EmptyState,GrassMap,IOSInstallSheet,PWAInstallButton,Section,SectionHeader,ShareButton,Skeleton,StatChip,THEME_SCRIPT,Tab,TabBar,ThemeButton,ThemeDialog,ToastProvider,Tooltip,Typewriter,Watermark,clearFetchCache,cn,colors,createApiClient,createManifest,fontFamily,fonts,formatNumber,formatPrice,mobileViewport,relativeTime,svgIcon,useDebounce,useFetch,useFormSubmit,useInView,useLocalStorage,usePWAInstall,usePolling,useShare,useToast});
12
+ `})]})}var le=require("react"),Je=require("react-dom"),B=require("react/jsx-runtime"),Ke=[{label:"\uC790\uC8FC \uC4F0\uB294",emojis:["\u{1F3E0}","\u{1F50D}","\u{1F464}","\u2B50","\u2764\uFE0F","\u{1F525}","\u2705","\u{1F4CC}","\u{1F3AF}","\u{1F4A1}","\u{1F680}","\u{1F4AC}","\u{1F44D}","\u{1F64C}","\u{1F4AA}","\u{1F389}","\u{1F4E2}","\u{1F511}","\u26A1","\u{1F31F}","\u{1F380}","\u{1F9E1}","\u{1FAF6}","\u{1F947}"]},{label:"\uAC10\uC815",emojis:["\u{1F600}","\u{1F604}","\u{1F606}","\u{1F60E}","\u{1F979}","\u{1F60D}","\u{1F929}","\u{1F605}","\u{1F602}","\u{1F972}","\u{1F62D}","\u{1F624}","\u{1F914}","\u{1F607}","\u{1FAF6}","\u{1F917}","\u{1F634}","\u{1F92F}","\u{1F973}","\u{1F62C}","\u{1FAE0}","\u{1F92B}","\u{1F636}","\u{1FAE1}"]},{label:"\uB3D9\uBB3C",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F438}","\u{1F435}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F986}","\u{1F989}","\u{1F98B}","\u{1F422}","\u{1F42C}","\u{1F433}"]},{label:"\uC0AC\uBB3C",emojis:["\u{1F4F1}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F4F7}","\u{1F3B5}","\u{1F3AE}","\u{1F4DA}","\u{1F4B0}","\u{1F381}","\u{1F514}","\u{1F4CA}","\u{1F5D3}\uFE0F","\u26A1","\u{1F527}","\u{1F48A}","\u{1F9EA}","\u{1F52D}","\u{1F399}\uFE0F","\u{1F58B}\uFE0F","\u{1F4E6}","\u{1F6CD}\uFE0F","\u{1F4B3}","\u{1F510}"]},{label:"\uC790\uC5F0",emojis:["\u{1F308}","\u{1F338}","\u{1F33F}","\u{1F340}","\u{1F319}","\u2600\uFE0F","\u2B50","\u{1F30A}","\u{1F34E}","\u{1F33A}","\u2744\uFE0F","\u{1F334}","\u{1F335}","\u{1F344}","\u{1F33B}","\u{1F30D}","\u26C5","\u{1F32A}\uFE0F","\u{1F305}","\u{1F341}","\u{1F33E}","\u{1FAB8}","\u{1FAE7}","\u2604\uFE0F"]},{label:"\uD65C\uB3D9",emojis:["\u{1F3C3}","\u{1F9D8}","\u{1F3A8}","\u{1F373}","\u2708\uFE0F","\u{1F3D5}\uFE0F","\u{1F3A4}","\u{1F3CB}\uFE0F","\u{1F938}","\u{1F9E9}","\u{1F3AD}","\u{1F6D2}","\u{1F6B4}","\u{1F3CA}","\u26F7\uFE0F","\u{1F3B8}","\u{1F3B9}","\u{1F4F8}","\u{1F9D7}","\u{1F93F}","\u{1F3B2}","\u{1F3C6}","\u{1F3AF}","\u{1FA84}"]}];function Ze({emoji:e,onClick:t,className:r=""}){return(0,B.jsx)("button",{onClick:t,className:`w-9 h-9 rounded-full flex items-center justify-center text-lg bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-all hover:scale-110 active:scale-90 ${r}`,title:"Pick emoji",children:e})}function Xe({open:e,onClose:t,current:r,onSelect:a}){let[o,n]=(0,le.useState)(0);if((0,le.useEffect)(()=>{if(!e)return;let s=l=>{l.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;let{emojis:i}=Ke[o];return(0,Je.createPortal)((0,B.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end justify-center",onClick:t,children:[(0,B.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,B.jsxs)("div",{className:"relative z-10 w-full max-w-101.5 mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:s=>s.stopPropagation(),children:[(0,B.jsx)("div",{className:"px-4 pt-4 pb-3",children:(0,B.jsx)("p",{className:"text-sm font-bold text-zinc-900 dark:text-white",children:"\uC774\uBAA8\uC9C0"})}),(0,B.jsx)("div",{className:"flex gap-1 px-4 pb-3 overflow-x-auto scrollbar-hide",children:Ke.map((s,l)=>(0,B.jsx)("button",{onClick:()=>n(l),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-semibold transition-colors ${o===l?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s.label},s.label))}),(0,B.jsx)("div",{className:"px-4 pb-3 grid grid-cols-6 gap-2",children:i.map(s=>(0,B.jsx)("button",{onClick:()=>{a(s),t()},className:`h-11 rounded-xl flex items-center justify-center text-2xl transition-all hover:scale-110 active:scale-90 ${r===s?"bg-zinc-900 dark:bg-white":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s},s))}),(0,B.jsx)("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:(0,B.jsx)("button",{onClick:t,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})})]})]}),document.body)}var Qe=require("react"),et=require("react-dom"),q=require("react/jsx-runtime");function tt({label:e,children:t,placement:r="top"}){let[a,o]=(0,Qe.useState)(null),n=d=>{o(d.currentTarget.getBoundingClientRect())},i=()=>o(null),s=a?r==="top"?a.top+window.scrollY-36:a.bottom+window.scrollY+8:0,l=a?a.left+window.scrollX+a.width/2:0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("span",{className:"inline-flex",onMouseEnter:n,onMouseLeave:i,onFocus:n,onBlur:i,children:t}),a&&(0,et.createPortal)((0,q.jsx)("div",{className:"fixed z-[9999] pointer-events-none",style:{top:s,left:l,transform:"translateX(-50%)"},children:(0,q.jsx)("div",{className:"px-3 py-1.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-xs font-semibold whitespace-nowrap shadow-lg animate-in fade-in zoom-in-95 duration-100",children:e})}),document.body)]})}var G=require("react"),v=require("react/jsx-runtime");function Yt(e){let[,t,r]=e.split("-");return`${parseInt(t)}\uC6D4 ${parseInt(r)}\uC77C`}function rt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var te=13,Kt=3,K=te+Kt,Jt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zt=["","Mon","","Wed","","Fri",""];function Xt(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function ot(e,t,r,a){if(e===0)return r?"rgb(39, 39, 42)":"rgb(244, 244, 245)";let o=e/t,[n,i,s]=Xt(a);if(r){let u=[.25,.4,.6,.9],p=o>.75?u[3]:o>.5?u[2]:o>.25?u[1]:u[0];return`rgba(${n}, ${i}, ${s}, ${p})`}let l=[.8,.6,.4,.15],d=o>.75?l[3]:o>.5?l[2]:o>.25?l[1]:l[0];return`rgb(${Math.round(n+(255-n)*d)}, ${Math.round(i+(255-i)*d)}, ${Math.round(s+(255-s)*d)})`}function at({data:e,accent:t,isDark:r=!1,unit:a=""}){let[o,n]=(0,G.useState)(null),i=(0,G.useRef)(null),s=(0,G.useMemo)(()=>{let g=new Set,k=new Date().getFullYear();g.add(k);for(let $ of e)g.add(new Date($.date).getFullYear());return Array.from(g).sort(($,X)=>X-$)},[e]),[l,d]=(0,G.useState)(new Date().getFullYear()),u=(0,G.useMemo)(()=>new Map(e.map(g=>[g.date,g.count])),[e]),p=e.length>0?e[0].date:null,f=p?new Date(p).toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"}):null,b=new Date,x=rt(b),P=new Date(l,0,1),z=new Date(l,11,31),R=new Date(P);R.setDate(R.getDate()-R.getDay());let E=[],A=Math.ceil((z.getTime()-R.getTime())/(1e3*60*60*24))+1;for(let g=0;g<A;g++){let k=new Date(R);if(k.setDate(k.getDate()+g),k>z)break;let $=rt(k),X=Math.floor(g/7),ne=g%7,ie=k<P,ge=k>b;E.push({date:$,count:u.get($)||0,col:X,row:ne,isOutOfRange:ie,isFuture:ge})}let I=Math.max(...E.map(g=>g.count),1),M=E.length>0?Math.max(...E.map(g=>g.col))+1:1,h=[],w=-1;for(let g of E){if(g.row!==0||g.isOutOfRange)continue;let k=new Date(g.date).getMonth();k!==w&&(h.push({label:Jt[k],col:g.col}),w=k)}let S=36,_=22,Rt=S+M*K,Mt=_+7*K;return(0,v.jsxs)("div",{ref:i,className:"relative space-y-4",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[(0,v.jsx)("div",{className:"flex items-center gap-1.5",children:s.map(g=>(0,v.jsx)("button",{onClick:()=>d(g),className:`px-3 py-1 rounded-lg text-xs font-medium transition-colors ${l===g?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-400 dark:text-zinc-500 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:g},g))}),f&&(0,v.jsxs)("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:["\uCCAB \uAE30\uB85D ",(0,v.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:f})]})]}),(0,v.jsx)("div",{className:"overflow-x-auto",children:(0,v.jsxs)("svg",{width:Rt,height:Mt,className:"block mx-auto",onMouseLeave:()=>n(null),children:[h.map((g,k)=>(0,v.jsx)("text",{x:S+g.col*K,y:13,className:"fill-zinc-400",fontFamily:"system-ui, sans-serif",fontSize:10,children:g.label},`${g.label}-${k}`)),Zt.map((g,k)=>g?(0,v.jsx)("text",{x:0,y:_+k*K+te-2,className:"fill-zinc-300",fontFamily:"system-ui, sans-serif",fontSize:9,children:g},k):null),E.map(g=>{let k=g.date===x,$=g.date===p,X=g.isOutOfRange?"transparent":g.isFuture?r?"rgb(24, 24, 27)":"rgb(250, 250, 250)":$?t:ot(g.count,I,r,t),ne=S+g.col*K,ie=_+g.row*K;return(0,v.jsx)("rect",{x:ne,y:ie,width:te,height:te,rx:3,fill:X,stroke:$?t:"none",strokeWidth:$?1.5:0,style:{cursor:g.isOutOfRange?"default":"pointer"},onMouseEnter:ge=>{if(g.isOutOfRange)return;let ze=ge.currentTarget.ownerSVGElement.getBoundingClientRect(),Se=i.current.getBoundingClientRect();n({x:ne+ze.left-Se.left+te/2,y:ie+ze.top-Se.top,date:g.date,count:g.count,isFirst:$,isToday:k,isFuture:g.isFuture})}},g.date)})]})}),o&&(0,v.jsxs)("div",{className:"pointer-events-none absolute z-30 -translate-x-1/2 -translate-y-full",style:{left:o.x,top:o.y-6},children:[(0,v.jsxs)("div",{className:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-[11px] rounded-lg px-2.5 py-1.5 shadow-lg whitespace-nowrap",children:[(0,v.jsx)("span",{className:"font-medium",children:Yt(o.date)}),!o.isFuture&&(0,v.jsx)("span",{className:"ml-1.5 tabular-nums",children:o.count>0?`${o.count.toLocaleString()}${a}`:"\uAE30\uB85D \uC5C6\uC74C"}),o.isFirst&&(0,v.jsx)("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\u{1F331} \uCCAB \uAE30\uB85D"}),o.isToday&&!o.isFirst&&(0,v.jsx)("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\uC624\uB298"})]}),(0,v.jsx)("div",{className:"mx-auto w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-zinc-900 dark:border-t-zinc-100"})]}),(0,v.jsxs)("div",{className:"flex items-center justify-end gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[(0,v.jsx)("span",{children:"Less"}),[0,.15,.35,.6,.85].map((g,k)=>(0,v.jsx)("div",{className:"w-3 h-3 rounded-xs",style:{backgroundColor:g===0?r?"rgb(39, 39, 42)":"rgb(244, 244, 245)":ot(Math.ceil(g*10),10,r,t)}},k)),(0,v.jsx)("span",{children:"More"}),(0,v.jsx)("div",{className:"ml-2 w-3 h-3 rounded-xs",style:{backgroundColor:t,opacity:.6}}),(0,v.jsx)("span",{children:"1st"})]})]})}var nt=require("react"),we=require("react/jsx-runtime"),Qt={xs:{box:"w-6 h-6",text:"text-[9px]",px:24},sm:{box:"w-8 h-8",text:"text-[11px]",px:32},md:{box:"w-10 h-10",text:"text-sm",px:40},lg:{box:"w-14 h-14",text:"text-lg",px:56},xl:{box:"w-20 h-20",text:"text-2xl",px:80}};function it({src:e,fallback:t,size:r="md",shape:a="circle",color:o="#3f3f46",className:n=""}){let{box:i,text:s}=Qt[r],l=a==="circle"?"rounded-full":"rounded-xl",[d,u]=(0,nt.useState)(!1);if(e&&!d)return(0,we.jsx)("img",{src:e,alt:t,onError:()=>u(!0),className:`${i} ${l} object-cover flex-shrink-0 ${n}`});let p=t.trim().slice(0,2).toUpperCase();return(0,we.jsx)("div",{className:`${i} ${l} flex items-center justify-center flex-shrink-0 font-bold select-none ${s} ${n}`,style:{backgroundColor:o,color:"#ffffff"},"aria-label":t,children:p})}var ct=require("react/jsx-runtime"),er={default:"bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400",green:"bg-green-100 dark:bg-green-950 text-green-700 dark:text-green-400",red:"bg-red-100 dark:bg-red-950 text-red-700 dark:text-red-400",yellow:"bg-yellow-100 dark:bg-yellow-950 text-yellow-700 dark:text-yellow-400",blue:"bg-blue-100 dark:bg-blue-950 text-blue-700 dark:text-blue-400",purple:"bg-purple-100 dark:bg-purple-950 text-purple-700 dark:text-purple-400",orange:"bg-orange-100 dark:bg-orange-950 text-orange-700 dark:text-orange-400"},tr={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-0.5"};function st({children:e,variant:t="default",size:r="md",className:a=""}){return(0,ct.jsx)("span",{className:`inline-flex items-center font-semibold rounded-full leading-none ${er[t]} ${tr[r]} ${a}`,children:e})}var de=require("react"),N=require("react/jsx-runtime");function ve(e){let[t,r]=(0,de.useState)(!1),a=typeof navigator<"u"&&typeof navigator.share=="function";return{share:(0,de.useCallback)(async n=>{let i={...e,...n},s=i.url??(typeof window<"u"?window.location.href:"");if(a)try{await navigator.share({title:i.title,text:i.text,url:s});return}catch(l){if(l.name==="AbortError")return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},[a]),copied:t,canNativeShare:a}}function lt({url:e,title:t,text:r,label:a="\uACF5\uC720",copiedLabel:o="\uB9C1\uD06C \uBCF5\uC0AC\uB428",className:n=""}){let{share:i,copied:s}=ve({url:e,title:t,text:r});return(0,N.jsx)("button",{onClick:()=>i(),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-sm font-semibold bg-zinc-100 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 active:scale-95 transition-all ${n}`,children:s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(or,{}),o]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(rr,{}),a]})})}function rr(){return(0,N.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,N.jsx)("circle",{cx:"18",cy:"5",r:"3"}),(0,N.jsx)("circle",{cx:"6",cy:"12",r:"3"}),(0,N.jsx)("circle",{cx:"18",cy:"19",r:"3"}),(0,N.jsx)("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),(0,N.jsx)("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}function or(){return(0,N.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,N.jsx)("polyline",{points:"20 6 9 17 4 12"})})}var L=require("react"),J=require("react/jsx-runtime"),dt=(0,L.createContext)(null);function pt({children:e}){let[t,r]=(0,L.useState)([]),a=(0,L.useCallback)((o,n)=>{let i=Math.random().toString(36).slice(2,9),s=n?.duration??2500;r(l=>[...l,{id:i,message:o,variant:n?.variant??"default",duration:s}]),setTimeout(()=>{r(l=>l.filter(d=>d.id!==i))},s)},[]);return(0,J.jsxs)(dt.Provider,{value:a,children:[e,(0,J.jsx)("div",{"aria-live":"polite","aria-atomic":"false",className:"fixed bottom-24 inset-x-0 z-[9999] flex flex-col items-center gap-2 px-4 pointer-events-none",children:t.map(o=>(0,J.jsx)(nr,{item:o},o.id))})]})}var ar={default:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900",success:"bg-green-600 text-white",error:"bg-red-600 text-white",info:"bg-blue-600 text-white"};function nr({item:e}){let[t,r]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{let a=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(a)},[]),(0,J.jsx)("div",{role:"status",className:`pointer-events-auto w-full max-w-[390px] px-4 py-3 rounded-2xl text-sm font-semibold shadow-xl text-center transition-all duration-300 ${ar[e.variant]} ${t?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,children:e.message})}function ut(){let e=(0,L.useContext)(dt);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}var re=require("react");function gt(e,t){let[r,a]=(0,re.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i!==null?JSON.parse(i):t}catch{return t}}),o=(0,re.useCallback)(i=>{a(s=>{let l=typeof i=="function"?i(s):i;try{window.localStorage.setItem(e,JSON.stringify(l))}catch{}return l})},[e]),n=(0,re.useCallback)(()=>{try{window.localStorage.removeItem(e)}catch{}a(t)},[e]);return[r,o,n]}var pe=require("react");function ft(e,t){let[r,a]=(0,pe.useState)(e);return(0,pe.useEffect)(()=>{let o=setTimeout(()=>a(e),t);return()=>clearTimeout(o)},[e,t]),r}var O=require("react");function mt(e,t={}){let[r,a]=(0,O.useState)(!1),[o,n]=(0,O.useState)(null),[i,s]=(0,O.useState)(void 0),l=(0,O.useRef)(e),d=(0,O.useRef)(t);l.current=e,d.current=t;let u=(0,O.useCallback)(async f=>{a(!0),n(null);try{let b=await l.current(f);s(b),d.current.onSuccess?.(b)}catch(b){let x=b instanceof Error?b:new Error(String(b));n(x),d.current.onError?.(x)}finally{a(!1)}},[]),p=(0,O.useCallback)(()=>{n(null),s(void 0)},[]);return{submit:u,loading:r,error:o,data:i,reset:p}}var Z=require("react");function ht(e={}){let{threshold:t=0,rootMargin:r="0px",once:a=!1}=e,[o,n]=(0,Z.useState)(!1),i=(0,Z.useRef)(null);return{ref:(0,Z.useCallback)(l=>{i.current?.disconnect(),i.current=null,l&&(i.current=new IntersectionObserver(([d])=>{n(d.isIntersecting),d.isIntersecting&&a&&i.current?.disconnect()},{threshold:t,rootMargin:r}),i.current.observe(l))},[t,r,a]),inView:o}}var wt=require("react/jsx-runtime"),ir={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl",full:"rounded-full"};function bt({className:e="",rounded:t="md"}){return(0,wt.jsx)("div",{className:`animate-pulse bg-zinc-200 dark:bg-zinc-800 ${ir[t]} ${e}`,"aria-hidden":"true"})}var W=require("react"),vt=require("react-dom"),F=require("react/jsx-runtime"),sr={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"};function xt({open:e,onClose:t,title:r,size:a="sm",children:o,persistent:n=!1,className:i=""}){let[s,l]=(0,W.useState)(!1),[d,u]=(0,W.useState)(!1),p=(0,W.useRef)(null);return(0,W.useEffect)(()=>{if(e)l(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>u(!0)));else{u(!1);let f=setTimeout(()=>l(!1),200);return()=>clearTimeout(f)}},[e]),(0,W.useEffect)(()=>{if(!e||n)return;let f=b=>{b.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,t,n]),(0,W.useEffect)(()=>{if(e){let f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}}},[e]),!s||typeof document>"u"?null:(0,vt.createPortal)((0,F.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?"dialog-title":void 0,className:"fixed inset-0 z-[200] flex items-end sm:items-center justify-center p-4",children:[(0,F.jsx)("div",{className:`absolute inset-0 bg-black/50 transition-opacity duration-200 ${d?"opacity-100":"opacity-0"}`,onClick:n?void 0:t}),(0,F.jsxs)("div",{ref:p,className:`relative w-full ${sr[a]} bg-white dark:bg-zinc-900 rounded-3xl shadow-2xl p-6 transition-all duration-200 ${d?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95"} ${i}`,children:[!n&&(0,F.jsx)("button",{onClick:t,className:"absolute top-4 right-4 p-1.5 rounded-full text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"\uB2EB\uAE30",children:(0,F.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,F.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),r&&(0,F.jsx)("h2",{id:"dialog-title",className:"text-lg font-bold text-zinc-900 dark:text-white mb-4 pr-6",children:r}),o]})]}),document.body)}var oe=require("react");function ue(){let[e,t]=(0,oe.useState)(null),[r,a]=(0,oe.useState)(!1);(0,oe.useEffect)(()=>{if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0){a(!0);return}let s=d=>{d.preventDefault(),t(d)},l=()=>a(!0);return window.addEventListener("beforeinstallprompt",s),window.addEventListener("appinstalled",l),()=>{window.removeEventListener("beforeinstallprompt",s),window.removeEventListener("appinstalled",l)}},[]);let o=r?"installed":e?"android-ready":cr()?"ios-safari":"unsupported";async function n(){if(!e)return;await e.prompt();let{outcome:i}=await e.userChoice;i==="accepted"&&a(!0),t(null)}return{state:o,install:n}}function cr(){if(typeof navigator>"u")return!1;let e=navigator.userAgent;return/iphone|ipad|ipod/i.test(e)&&!/CriOS|FxiOS|OPiOS|EdgiOS/i.test(e)}var kt=require("react");var c=require("react/jsx-runtime");function yt({appName:e="\uC571",iconSrc:t,label:r="\uC571\uC73C\uB85C \uC124\uCE58",installedLabel:a,className:o}){let{state:n,install:i}=ue(),[s,l]=(0,kt.useState)(!1);if(n==="installed")return a?(0,c.jsxs)("div",{className:`flex items-center gap-2 text-sm text-zinc-400 ${o??""}`,children:[(0,c.jsx)(dr,{}),(0,c.jsx)("span",{children:a})]}):null;if(n==="unsupported")return null;function d(){n==="android-ready"?i():n==="ios-safari"&&l(!0)}return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("button",{onClick:d,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-sm font-semibold transition-all active:scale-95 ${o??""}`,children:[(0,c.jsx)(zt,{}),(0,c.jsx)("span",{children:r}),n==="ios-safari"&&(0,c.jsx)(lr,{})]}),n==="ios-safari"&&(0,c.jsx)(xe,{open:s,onClose:()=>l(!1),appName:e,iconSrc:t})]})}function xe({open:e,onClose:t,appName:r,iconSrc:a}){return e?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:t}),(0,c.jsxs)("div",{className:"fixed bottom-0 left-1/2 -translate-x-1/2 z-[9999] w-full max-w-[430px] rounded-t-2xl bg-white dark:bg-zinc-900 shadow-2xl",children:[(0,c.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,c.jsx)("div",{className:"w-9 h-1 rounded-full bg-zinc-200 dark:bg-zinc-700"})}),(0,c.jsxs)("div",{className:"px-5 pb-8 pt-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[a?(0,c.jsx)("img",{src:a,alt:r,className:"w-12 h-12 rounded-xl shadow"}):(0,c.jsx)("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:(0,c.jsx)(zt,{size:22,className:"text-zinc-400"})}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{className:"font-bold text-zinc-900 dark:text-white text-base",children:[r," \uC124\uCE58\uD558\uAE30"]}),(0,c.jsx)("p",{className:"text-xs text-zinc-400 mt-0.5",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00\uD558\uBA74 \uC571\uCC98\uB7FC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5B4\uC694"})]})]}),(0,c.jsx)("div",{className:"space-y-3",children:[{icon:(0,c.jsx)(pr,{}),text:(0,c.jsxs)(c.Fragment,{children:["\uD558\uB2E8 \uD234\uBC14\uC758 ",(0,c.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uACF5\uC720"})," \uBC84\uD2BC\uC744 \uD0ED\uD558\uC138\uC694"]})},{icon:(0,c.jsx)(ur,{}),text:(0,c.jsxs)(c.Fragment,{children:["\uC2A4\uD06C\uB864\uD574\uC11C"," ",(0,c.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uC138\uC694"]})},{icon:(0,c.jsx)(gr,{}),text:(0,c.jsxs)(c.Fragment,{children:["\uC6B0\uCE21 \uC0C1\uB2E8 ",(0,c.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uBA74 \uC644\uB8CC!"]})}].map((n,i)=>(0,c.jsxs)("div",{className:"flex items-start gap-3",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-500 dark:text-zinc-400",children:n.icon}),(0,c.jsx)("div",{className:"flex-1 pt-1",children:(0,c.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[(0,c.jsx)("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-zinc-200 dark:bg-zinc-700 text-[9px] font-bold text-zinc-500 dark:text-zinc-400 mr-1.5 flex-shrink-0",children:i+1}),n.text]})})]},i))}),(0,c.jsxs)("div",{className:"mt-5 flex items-center gap-2 px-3 py-2.5 rounded-xl bg-zinc-50 dark:bg-zinc-800",children:[(0,c.jsx)(fr,{}),(0,c.jsx)("p",{className:"text-xs text-zinc-400",children:"Safari \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB9CC \uD648 \uD654\uBA74 \uCD94\uAC00\uAC00 \uAC00\uB2A5\uD574\uC694"})]}),(0,c.jsx)("button",{onClick:t,className:"mt-3 w-full py-3 rounded-xl text-sm font-semibold text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})]})]})]}):null}function zt({size:e=16,className:t=""}){return(0,c.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[(0,c.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,c.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,c.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function lr(){return(0,c.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70",children:(0,c.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function dr(){return(0,c.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,c.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function pr(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,c.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,c.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function ur(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),(0,c.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function gr(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("polyline",{points:"9 11 12 14 22 4"}),(0,c.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function fr(){return(0,c.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 flex-shrink-0",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]})}var mr={width:"device-width",initialScale:1,maximumScale:1,userScalable:!1,viewportFit:"cover"};function ke(e,t={}){let{size:r=192,bg:a="#000000",color:o="#ffffff",radius:n=.25,fontSize:i=.375}=t,s=Math.round(r*n),l=Math.round(r*i),d=a.replace("#","%23"),u=o.replace("#","%23");return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${r} ${r}'><rect width='${r}' height='${r}' rx='${s}' fill='${d}'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-family='system-ui,sans-serif' font-size='${l}' font-weight='900' fill='${u}'>${e}</text></svg>`}function hr(e){let{name:t,shortName:r=t,description:a,startUrl:o="/",backgroundColor:n="#ffffff",themeColor:i="#000000",icon:s}=e,l=s?[{src:ke(s.text,{size:192,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"192x192",type:"image/svg+xml"},{src:ke(s.text,{size:512,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"512x512",type:"image/svg+xml"}]:[],d={name:t,short_name:r,...a&&{description:a},start_url:o,display:"standalone",orientation:"portrait",background_color:n,theme_color:i,icons:l};return()=>d}var U=class extends Error{constructor(r,a,o,n,i){super(`${r} ${a}${n?` [${i??"GET"} ${n}]`:""}`);this.status=r;this.statusText=a;this.body=o;this.url=n;this.method=i;this.name="ApiError"}};async function ae(e){return(e.headers.get("content-type")??"").includes("application/json")?e.json():e.text()}function St(e,t={}){let r=e.replace(/\/$/,"");async function a(o,n,i,s={}){let l=n.startsWith("http")?n:`${r}/${n.replace(/^\//,"")}`,d={...t.headers,...s.headers};i!==void 0&&s.contentType!==null&&(d["Content-Type"]=s.contentType??"application/json");let u={method:o,headers:d,signal:s.signal};i!==void 0&&(u.body=i instanceof FormData?i:JSON.stringify(i));let p=new Request(l,u);t.onRequest&&(p=t.onRequest(p)??p);let f=await fetch(p);if(!f.ok){let b=await ae(f).catch(()=>null),x=new U(f.status,f.statusText,b,l,o);throw t.onError?.(x),x}if(!(f.status===204||f.headers.get("content-length")==="0"))return ae(f)}return{get:(o,n)=>a("GET",o,void 0,n),post:(o,n,i)=>a("POST",o,n,i),put:(o,n,i)=>a("PUT",o,n,i),patch:(o,n,i)=>a("PATCH",o,n,i),delete:(o,n)=>a("DELETE",o,void 0,n)}}var C=require("react");var br=500,V=new Map,ye=new Map;function Tt(e){e?V.delete(e):V.clear()}function wr(e,t){V.size>=br&&V.delete(V.keys().next().value),V.set(e,t)}async function vr(e){let t=await fetch(e);if(!t.ok){let r=await ae(t).catch(()=>null);throw new U(t.status,t.statusText,r,e,"GET")}return ae(t)}async function xr(e,t,r){let a;for(let o=0;o<=t;o++)try{return await e()}catch(n){if(a=n,n instanceof U)throw n;o<t&&await new Promise(i=>setTimeout(i,r*2**o))}throw a}function Nt(e,t={}){let{enabled:r=!0,staleTime:a=0,retry:o=2,retryDelay:n=1e3,revalidateOnFocus:i=!0,fetcher:s=vr,onSuccess:l,onError:d}=t,[u,p]=(0,C.useState)(()=>{if(!e||a===0)return;let h=V.get(e);if(h&&Date.now()-h.ts<a)return h.data}),[f,b]=(0,C.useState)(()=>{if(!e||!r)return"idle";if(a>0){let h=V.get(e);if(h&&Date.now()-h.ts<a)return"success"}return"loading"}),[x,P]=(0,C.useState)(void 0),z=(0,C.useRef)(!0),R=(0,C.useRef)(s),E=(0,C.useRef)(l),A=(0,C.useRef)(d);R.current=s,E.current=l,A.current=d;let I=(0,C.useCallback)(async(h=!1)=>{if(!e||!r){b(w=>w==="idle"?w:"idle");return}if(!h&&a>0){let w=V.get(e);if(w&&Date.now()-w.ts<a){p(w.data),b("success");return}}b("loading"),P(void 0);try{let w=ye.get(e);w||(w=xr(()=>R.current(e),o,n),ye.set(e,w),w.finally(()=>ye.delete(e)));let S=await w;if(!z.current)return;wr(e,{data:S,ts:Date.now()}),p(S),b("success"),E.current?.(S)}catch(w){if(!z.current)return;let S=w;P(S),b("error"),A.current?.(S)}},[e,r,a,o,n]),M=(0,C.useCallback)(()=>I(!0),[I]);return(0,C.useEffect)(()=>(z.current=!0,I(),()=>{z.current=!1}),[I]),(0,C.useEffect)(()=>{if(!i)return;let h=()=>{document.visibilityState==="visible"&&I()};return document.addEventListener("visibilitychange",h),window.addEventListener("focus",h),()=>{document.removeEventListener("visibilitychange",h),window.removeEventListener("focus",h)}},[I,i]),{data:u,loading:f==="loading",error:x,status:f,refetch:M}}var y=require("react");function Pt(e,t={}){let{interval:r=5e3,enabled:a=!0,pauseOnHidden:o=!0,onSuccess:n,onError:i}=t,[s,l]=(0,y.useState)(void 0),[d,u]=(0,y.useState)(!1),[p,f]=(0,y.useState)(void 0),[b,x]=(0,y.useState)(a),P=(0,y.useRef)(!0),z=(0,y.useRef)(null),R=(0,y.useRef)(r),E=(0,y.useRef)(e),A=(0,y.useRef)(n),I=(0,y.useRef)(i);R.current=r,E.current=e,A.current=n,I.current=i,(0,y.useEffect)(()=>(P.current=!0,()=>{P.current=!1}),[]);let M=(0,y.useCallback)(async()=>{if(P.current){u(!0);try{let S=await E.current();if(!P.current)return;l(S),f(void 0),A.current?.(S)}catch(S){if(!P.current)return;let _=S;f(_),I.current?.(_)}finally{P.current&&u(!1)}}},[]),h=(0,y.useCallback)(()=>{z.current&&(clearInterval(z.current),z.current=null)},[]),w=(0,y.useCallback)(()=>{h(),z.current=setInterval(M,R.current)},[M,h]);return(0,y.useEffect)(()=>{if(!b){h();return}return M(),w(),h},[b,M,w,h]),(0,y.useEffect)(()=>{if(b)return h(),z.current=setInterval(M,R.current),h},[r]),(0,y.useEffect)(()=>{if(!o)return;let S=()=>{b&&(document.visibilityState==="hidden"?h():(M(),w()))};return document.addEventListener("visibilitychange",S),()=>document.removeEventListener("visibilitychange",S)},[b,o,M,w,h]),{data:s,loading:d,error:p,isRunning:b,stop:()=>x(!1),start:()=>x(!0),refetch:M}}var Et=require("clsx"),Ct=require("tailwind-merge");function kr(e){let t=new Date(e),r=Date.now()-t.getTime(),a=Math.floor(r/1e3);return a<60?"\uBC29\uAE08 \uC804":a<3600?`${Math.floor(a/60)}\uBD84 \uC804`:a<86400?`${Math.floor(a/3600)}\uC2DC\uAC04 \uC804`:a<86400*2?"\uC5B4\uC81C":a<86400*7?`${Math.floor(a/86400)}\uC77C \uC804`:a<86400*30?`${Math.floor(a/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function yr(e){let t=Math.abs(e),r=e<0?"-":"";return t>=1e8?`${r}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${r}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${r}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:e.toLocaleString("ko-KR")}function zr(e,t="KRW",r="ko-KR"){return new Intl.NumberFormat(r,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(e)}function Sr(...e){return(0,Ct.twMerge)((0,Et.clsx)(e))}0&&(module.exports={ApiError,AppShell,AppShellContent,AppShellHeader,Avatar,Badge,Button,Dialog,Divider,EmojiButton,EmojiPicker,EmptyState,GrassMap,IOSInstallSheet,PWAInstallButton,Section,SectionHeader,ShareButton,Skeleton,StatChip,THEME_SCRIPT,Tab,TabBar,ThemeButton,ThemeDialog,ToastProvider,Tooltip,Typewriter,Watermark,clearFetchCache,cn,colors,createApiClient,createManifest,fontFamily,fonts,formatNumber,formatPrice,mobileViewport,relativeTime,svgIcon,useDebounce,useFetch,useFormSubmit,useInView,useLocalStorage,usePWAInstall,usePolling,useShare,useToast});
package/dist/index.mjs CHANGED
@@ -9,4 +9,4 @@ html { height: 100dvh; }
9
9
  0% { opacity: 0; transform: translateY(4px); }
10
10
  100% { opacity: 1; transform: translateY(0); }
11
11
  }
12
- `})]})}import{useEffect as $t,useState as Lt}from"react";import{createPortal as Ot}from"react-dom";import{jsx as I,jsxs as Re}from"react/jsx-runtime";var Ce=[{label:"\uC790\uC8FC \uC4F0\uB294",emojis:["\u{1F3E0}","\u{1F50D}","\u{1F464}","\u2B50","\u2764\uFE0F","\u{1F525}","\u2705","\u{1F4CC}","\u{1F3AF}","\u{1F4A1}","\u{1F680}","\u{1F4AC}","\u{1F44D}","\u{1F64C}","\u{1F4AA}","\u{1F389}","\u{1F4E2}","\u{1F511}","\u26A1","\u{1F31F}","\u{1F380}","\u{1F9E1}","\u{1FAF6}","\u{1F947}"]},{label:"\uAC10\uC815",emojis:["\u{1F600}","\u{1F604}","\u{1F606}","\u{1F60E}","\u{1F979}","\u{1F60D}","\u{1F929}","\u{1F605}","\u{1F602}","\u{1F972}","\u{1F62D}","\u{1F624}","\u{1F914}","\u{1F607}","\u{1FAF6}","\u{1F917}","\u{1F634}","\u{1F92F}","\u{1F973}","\u{1F62C}","\u{1FAE0}","\u{1F92B}","\u{1F636}","\u{1FAE1}"]},{label:"\uB3D9\uBB3C",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F438}","\u{1F435}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F986}","\u{1F989}","\u{1F98B}","\u{1F422}","\u{1F42C}","\u{1F433}"]},{label:"\uC0AC\uBB3C",emojis:["\u{1F4F1}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F4F7}","\u{1F3B5}","\u{1F3AE}","\u{1F4DA}","\u{1F4B0}","\u{1F381}","\u{1F514}","\u{1F4CA}","\u{1F5D3}\uFE0F","\u26A1","\u{1F527}","\u{1F48A}","\u{1F9EA}","\u{1F52D}","\u{1F399}\uFE0F","\u{1F58B}\uFE0F","\u{1F4E6}","\u{1F6CD}\uFE0F","\u{1F4B3}","\u{1F510}"]},{label:"\uC790\uC5F0",emojis:["\u{1F308}","\u{1F338}","\u{1F33F}","\u{1F340}","\u{1F319}","\u2600\uFE0F","\u2B50","\u{1F30A}","\u{1F34E}","\u{1F33A}","\u2744\uFE0F","\u{1F334}","\u{1F335}","\u{1F344}","\u{1F33B}","\u{1F30D}","\u26C5","\u{1F32A}\uFE0F","\u{1F305}","\u{1F341}","\u{1F33E}","\u{1FAB8}","\u{1FAE7}","\u2604\uFE0F"]},{label:"\uD65C\uB3D9",emojis:["\u{1F3C3}","\u{1F9D8}","\u{1F3A8}","\u{1F373}","\u2708\uFE0F","\u{1F3D5}\uFE0F","\u{1F3A4}","\u{1F3CB}\uFE0F","\u{1F938}","\u{1F9E9}","\u{1F3AD}","\u{1F6D2}","\u{1F6B4}","\u{1F3CA}","\u26F7\uFE0F","\u{1F3B8}","\u{1F3B9}","\u{1F4F8}","\u{1F9D7}","\u{1F93F}","\u{1F3B2}","\u{1F3C6}","\u{1F3AF}","\u{1FA84}"]}];function Ft({emoji:e,onClick:t,className:r=""}){return I("button",{onClick:t,className:`w-9 h-9 rounded-full flex items-center justify-center text-lg bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-all hover:scale-110 active:scale-90 ${r}`,title:"Pick emoji",children:e})}function Dt({open:e,onClose:t,current:r,onSelect:a}){let[o,n]=Lt(0);if($t(()=>{if(!e)return;let s=c=>{c.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;let{emojis:i}=Ce[o];return Ot(Re("div",{className:"fixed inset-0 z-50 flex items-end justify-center",onClick:t,children:[I("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),Re("div",{className:"relative z-10 w-full max-w-101.5 mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:s=>s.stopPropagation(),children:[I("div",{className:"px-4 pt-4 pb-3",children:I("p",{className:"text-sm font-bold text-zinc-900 dark:text-white",children:"\uC774\uBAA8\uC9C0"})}),I("div",{className:"flex gap-1 px-4 pb-3 overflow-x-auto scrollbar-hide",children:Ce.map((s,c)=>I("button",{onClick:()=>n(c),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-semibold transition-colors ${o===c?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s.label},s.label))}),I("div",{className:"px-4 pb-3 grid grid-cols-6 gap-2",children:i.map(s=>I("button",{onClick:()=>{a(s),t()},className:`h-11 rounded-xl flex items-center justify-center text-2xl transition-all hover:scale-110 active:scale-90 ${r===s?"bg-zinc-900 dark:bg-white":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s},s))}),I("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:I("button",{onClick:t,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})})]})]}),document.body)}import{useState as jt}from"react";import{createPortal as Wt}from"react-dom";import{Fragment as Vt,jsx as ie,jsxs as _t}from"react/jsx-runtime";function Ut({label:e,children:t,placement:r="top"}){let[a,o]=jt(null),n=l=>{o(l.currentTarget.getBoundingClientRect())},i=()=>o(null),s=a?r==="top"?a.top+window.scrollY-36:a.bottom+window.scrollY+8:0,c=a?a.left+window.scrollX+a.width/2:0;return _t(Vt,{children:[ie("span",{className:"inline-flex",onMouseEnter:n,onMouseLeave:i,onFocus:n,onBlur:i,children:t}),a&&Wt(ie("div",{className:"fixed z-[9999] pointer-events-none",style:{top:s,left:c,transform:"translateX(-50%)"},children:ie("div",{className:"px-3 py-1.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-xs font-semibold whitespace-nowrap shadow-lg animate-in fade-in zoom-in-95 duration-100",children:e})}),document.body)]})}import{useState as Me,useMemo as Be,useRef as Ht}from"react";import{jsx as S,jsxs as D}from"react/jsx-runtime";function qt(e){let[,t,r]=e.split("-");return`${parseInt(t)}\uC6D4 ${parseInt(r)}\uC77C`}function Ie(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var _=13,Gt=3,j=_+Gt,Yt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Kt=["","Mon","","Wed","","Fri",""];function Jt(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function Ae(e,t,r,a){if(e===0)return r?"rgb(39, 39, 42)":"rgb(244, 244, 245)";let o=e/t,[n,i,s]=Jt(a);if(r){let p=[.25,.4,.6,.9],d=o>.75?p[3]:o>.5?p[2]:o>.25?p[1]:p[0];return`rgba(${n}, ${i}, ${s}, ${d})`}let c=[.8,.6,.4,.15],l=o>.75?c[3]:o>.5?c[2]:o>.25?c[1]:c[0];return`rgb(${Math.round(n+(255-n)*l)}, ${Math.round(i+(255-i)*l)}, ${Math.round(s+(255-s)*l)})`}function Zt({data:e,accent:t,isDark:r=!1,unit:a=""}){let[o,n]=Me(null),i=Ht(null),s=Be(()=>{let u=new Set,x=new Date().getFullYear();u.add(x);for(let B of e)u.add(new Date(B.date).getFullYear());return Array.from(u).sort((B,U)=>U-B)},[e]),[c,l]=Me(new Date().getFullYear()),p=Be(()=>new Map(e.map(u=>[u.date,u.count])),[e]),d=e.length>0?e[0].date:null,g=d?new Date(d).toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"}):null,h=new Date,v=Ie(h),T=new Date(c,0,1),k=new Date(c,11,31),P=new Date(T);P.setDate(P.getDate()-P.getDay());let N=[],M=Math.ceil((k.getTime()-P.getTime())/(1e3*60*60*24))+1;for(let u=0;u<M;u++){let x=new Date(P);if(x.setDate(x.getDate()+u),x>k)break;let B=Ie(x),U=Math.floor(u/7),Y=u%7,K=x<T,ee=x>h;N.push({date:B,count:p.get(B)||0,col:U,row:Y,isOutOfRange:K,isFuture:ee})}let C=Math.max(...N.map(u=>u.count),1),E=N.length>0?Math.max(...N.map(u=>u.col))+1:1,m=[],b=-1;for(let u of N){if(u.row!==0||u.isOutOfRange)continue;let x=new Date(u.date).getMonth();x!==b&&(m.push({label:Yt[x],col:u.col}),b=x)}let y=36,L=22,Je=y+E*j,Ze=L+7*j;return D("div",{ref:i,className:"relative space-y-4",children:[D("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[S("div",{className:"flex items-center gap-1.5",children:s.map(u=>S("button",{onClick:()=>l(u),className:`px-3 py-1 rounded-lg text-xs font-medium transition-colors ${c===u?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-400 dark:text-zinc-500 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:u},u))}),g&&D("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:["\uCCAB \uAE30\uB85D ",S("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:g})]})]}),S("div",{className:"overflow-x-auto",children:D("svg",{width:Je,height:Ze,className:"block mx-auto",onMouseLeave:()=>n(null),children:[m.map((u,x)=>S("text",{x:y+u.col*j,y:13,className:"fill-zinc-400",fontFamily:"system-ui, sans-serif",fontSize:10,children:u.label},`${u.label}-${x}`)),Kt.map((u,x)=>u?S("text",{x:0,y:L+x*j+_-2,className:"fill-zinc-300",fontFamily:"system-ui, sans-serif",fontSize:9,children:u},x):null),N.map(u=>{let x=u.date===v,B=u.date===d,U=u.isOutOfRange?"transparent":u.isFuture?r?"rgb(24, 24, 27)":"rgb(250, 250, 250)":B?t:Ae(u.count,C,r,t),Y=y+u.col*j,K=L+u.row*j;return S("rect",{x:Y,y:K,width:_,height:_,rx:3,fill:U,stroke:B?t:"none",strokeWidth:B?1.5:0,style:{cursor:u.isOutOfRange?"default":"pointer"},onMouseEnter:ee=>{if(u.isOutOfRange)return;let he=ee.currentTarget.ownerSVGElement.getBoundingClientRect(),be=i.current.getBoundingClientRect();n({x:Y+he.left-be.left+_/2,y:K+he.top-be.top,date:u.date,count:u.count,isFirst:B,isToday:x,isFuture:u.isFuture})}},u.date)})]})}),o&&D("div",{className:"pointer-events-none absolute z-30 -translate-x-1/2 -translate-y-full",style:{left:o.x,top:o.y-6},children:[D("div",{className:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-[11px] rounded-lg px-2.5 py-1.5 shadow-lg whitespace-nowrap",children:[S("span",{className:"font-medium",children:qt(o.date)}),!o.isFuture&&S("span",{className:"ml-1.5 tabular-nums",children:o.count>0?`${o.count.toLocaleString()}${a}`:"\uAE30\uB85D \uC5C6\uC74C"}),o.isFirst&&S("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\u{1F331} \uCCAB \uAE30\uB85D"}),o.isToday&&!o.isFirst&&S("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\uC624\uB298"})]}),S("div",{className:"mx-auto w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-zinc-900 dark:border-t-zinc-100"})]}),D("div",{className:"flex items-center justify-end gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[S("span",{children:"Less"}),[0,.15,.35,.6,.85].map((u,x)=>S("div",{className:"w-3 h-3 rounded-xs",style:{backgroundColor:u===0?r?"rgb(39, 39, 42)":"rgb(244, 244, 245)":Ae(Math.ceil(u*10),10,r,t)}},x)),S("span",{children:"More"}),S("div",{className:"ml-2 w-3 h-3 rounded-xs",style:{backgroundColor:t,opacity:.6}}),S("span",{children:"1st"})]})]})}import{useState as Xt}from"react";import{jsx as $e}from"react/jsx-runtime";var Qt={xs:{box:"w-6 h-6",text:"text-[9px]",px:24},sm:{box:"w-8 h-8",text:"text-[11px]",px:32},md:{box:"w-10 h-10",text:"text-sm",px:40},lg:{box:"w-14 h-14",text:"text-lg",px:56},xl:{box:"w-20 h-20",text:"text-2xl",px:80}};function er({src:e,fallback:t,size:r="md",shape:a="circle",color:o="#3f3f46",className:n=""}){let{box:i,text:s}=Qt[r],c=a==="circle"?"rounded-full":"rounded-xl",[l,p]=Xt(!1);if(e&&!l)return $e("img",{src:e,alt:t,onError:()=>p(!0),className:`${i} ${c} object-cover flex-shrink-0 ${n}`});let d=t.trim().slice(0,2).toUpperCase();return $e("div",{className:`${i} ${c} flex items-center justify-center flex-shrink-0 font-bold select-none ${s} ${n}`,style:{backgroundColor:o,color:"#ffffff"},"aria-label":t,children:d})}import{jsx as ar}from"react/jsx-runtime";var tr={default:"bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400",green:"bg-green-100 dark:bg-green-950 text-green-700 dark:text-green-400",red:"bg-red-100 dark:bg-red-950 text-red-700 dark:text-red-400",yellow:"bg-yellow-100 dark:bg-yellow-950 text-yellow-700 dark:text-yellow-400",blue:"bg-blue-100 dark:bg-blue-950 text-blue-700 dark:text-blue-400",purple:"bg-purple-100 dark:bg-purple-950 text-purple-700 dark:text-purple-400",orange:"bg-orange-100 dark:bg-orange-950 text-orange-700 dark:text-orange-400"},rr={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-0.5"};function or({children:e,variant:t="default",size:r="md",className:a=""}){return ar("span",{className:`inline-flex items-center font-semibold rounded-full leading-none ${tr[t]} ${rr[r]} ${a}`,children:e})}import{useCallback as nr,useState as ir}from"react";import{Fragment as Le,jsx as A,jsxs as se}from"react/jsx-runtime";function Oe(e){let[t,r]=ir(!1),a=typeof navigator<"u"&&typeof navigator.share=="function";return{share:nr(async n=>{let i={...e,...n},s=i.url??(typeof window<"u"?window.location.href:"");if(a)try{await navigator.share({title:i.title,text:i.text,url:s});return}catch(c){if(c.name==="AbortError")return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},[a]),copied:t,canNativeShare:a}}function sr({url:e,title:t,text:r,label:a="\uACF5\uC720",copiedLabel:o="\uB9C1\uD06C \uBCF5\uC0AC\uB428",className:n=""}){let{share:i,copied:s}=Oe({url:e,title:t,text:r});return A("button",{onClick:()=>i(),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-sm font-semibold bg-zinc-100 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 active:scale-95 transition-all ${n}`,children:s?se(Le,{children:[A(lr,{}),o]}):se(Le,{children:[A(cr,{}),a]})})}function cr(){return se("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A("circle",{cx:"18",cy:"5",r:"3"}),A("circle",{cx:"6",cy:"12",r:"3"}),A("circle",{cx:"18",cy:"19",r:"3"}),A("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),A("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}function lr(){return A("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:A("polyline",{points:"20 6 9 17 4 12"})})}import{createContext as dr,useContext as pr,useState as Fe,useCallback as ur,useEffect as gr}from"react";import{jsx as ce,jsxs as wr}from"react/jsx-runtime";var De=dr(null);function fr({children:e}){let[t,r]=Fe([]),a=ur((o,n)=>{let i=Math.random().toString(36).slice(2,9),s=n?.duration??2500;r(c=>[...c,{id:i,message:o,variant:n?.variant??"default",duration:s}]),setTimeout(()=>{r(c=>c.filter(l=>l.id!==i))},s)},[]);return wr(De.Provider,{value:a,children:[e,ce("div",{"aria-live":"polite","aria-atomic":"false",className:"fixed bottom-24 inset-x-0 z-[9999] flex flex-col items-center gap-2 px-4 pointer-events-none",children:t.map(o=>ce(hr,{item:o},o.id))})]})}var mr={default:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900",success:"bg-green-600 text-white",error:"bg-red-600 text-white",info:"bg-blue-600 text-white"};function hr({item:e}){let[t,r]=Fe(!1);return gr(()=>{let a=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(a)},[]),ce("div",{role:"status",className:`pointer-events-auto w-full max-w-[390px] px-4 py-3 rounded-2xl text-sm font-semibold shadow-xl text-center transition-all duration-300 ${mr[e.variant]} ${t?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,children:e.message})}function br(){let e=pr(De);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}import{useState as vr,useCallback as je}from"react";function xr(e,t){let[r,a]=vr(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i!==null?JSON.parse(i):t}catch{return t}}),o=je(i=>{a(s=>{let c=typeof i=="function"?i(s):i;try{window.localStorage.setItem(e,JSON.stringify(c))}catch{}return c})},[e]),n=je(()=>{try{window.localStorage.removeItem(e)}catch{}a(t)},[e]);return[r,o,n]}import{useState as kr,useEffect as yr}from"react";function zr(e,t){let[r,a]=kr(e);return yr(()=>{let o=setTimeout(()=>a(e),t);return()=>clearTimeout(o)},[e,t]),r}import{useState as le,useCallback as We,useRef as Ue}from"react";function Sr(e,t={}){let[r,a]=le(!1),[o,n]=le(null),[i,s]=le(void 0),c=Ue(e),l=Ue(t);c.current=e,l.current=t;let p=We(async g=>{a(!0),n(null);try{let h=await c.current(g);s(h),l.current.onSuccess?.(h)}catch(h){let v=h instanceof Error?h:new Error(String(h));n(v),l.current.onError?.(v)}finally{a(!1)}},[]),d=We(()=>{n(null),s(void 0)},[]);return{submit:p,loading:r,error:o,data:i,reset:d}}import{useState as Tr,useCallback as Nr,useRef as Pr}from"react";function Er(e={}){let{threshold:t=0,rootMargin:r="0px",once:a=!1}=e,[o,n]=Tr(!1),i=Pr(null);return{ref:Nr(c=>{i.current?.disconnect(),i.current=null,c&&(i.current=new IntersectionObserver(([l])=>{n(l.isIntersecting),l.isIntersecting&&a&&i.current?.disconnect()},{threshold:t,rootMargin:r}),i.current.observe(c))},[t,r,a]),inView:o}}import{jsx as Mr}from"react/jsx-runtime";var Cr={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl",full:"rounded-full"};function Rr({className:e="",rounded:t="md"}){return Mr("div",{className:`animate-pulse bg-zinc-200 dark:bg-zinc-800 ${Cr[t]} ${e}`,"aria-hidden":"true"})}import{useEffect as de,useRef as Br,useState as Ve}from"react";import{createPortal as Ir}from"react-dom";import{jsx as H,jsxs as pe}from"react/jsx-runtime";var Ar={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"};function $r({open:e,onClose:t,title:r,size:a="sm",children:o,persistent:n=!1,className:i=""}){let[s,c]=Ve(!1),[l,p]=Ve(!1),d=Br(null);return de(()=>{if(e)c(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>p(!0)));else{p(!1);let g=setTimeout(()=>c(!1),200);return()=>clearTimeout(g)}},[e]),de(()=>{if(!e||n)return;let g=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t,n]),de(()=>{if(e){let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}}},[e]),!s||typeof document>"u"?null:Ir(pe("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?"dialog-title":void 0,className:"fixed inset-0 z-[200] flex items-end sm:items-center justify-center p-4",children:[H("div",{className:`absolute inset-0 bg-black/50 transition-opacity duration-200 ${l?"opacity-100":"opacity-0"}`,onClick:n?void 0:t}),pe("div",{ref:d,className:`relative w-full ${Ar[a]} bg-white dark:bg-zinc-900 rounded-3xl shadow-2xl p-6 transition-all duration-200 ${l?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95"} ${i}`,children:[!n&&H("button",{onClick:t,className:"absolute top-4 right-4 p-1.5 rounded-full text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"\uB2EB\uAE30",children:pe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[H("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),r&&H("h2",{id:"dialog-title",className:"text-lg font-bold text-zinc-900 dark:text-white mb-4 pr-6",children:r}),o]})]}),document.body)}import{useState as _e,useEffect as Lr}from"react";function ue(){let[e,t]=_e(null),[r,a]=_e(!1);Lr(()=>{if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0){a(!0);return}let s=l=>{l.preventDefault(),t(l)},c=()=>a(!0);return window.addEventListener("beforeinstallprompt",s),window.addEventListener("appinstalled",c),()=>{window.removeEventListener("beforeinstallprompt",s),window.removeEventListener("appinstalled",c)}},[]);let o=r?"installed":e?"android-ready":Or()?"ios-safari":"unsupported";async function n(){if(!e)return;await e.prompt();let{outcome:i}=await e.userChoice;i==="accepted"&&a(!0),t(null)}return{state:o,install:n}}function Or(){if(typeof navigator>"u")return!1;let e=navigator.userAgent;return/iphone|ipad|ipod/i.test(e)&&!/CriOS|FxiOS|OPiOS|EdgiOS/i.test(e)}import{useState as Fr}from"react";import{Fragment as q,jsx as f,jsxs as z}from"react/jsx-runtime";function Dr({appName:e="\uC571",iconSrc:t,label:r="\uC571\uC73C\uB85C \uC124\uCE58",installedLabel:a,className:o}){let{state:n,install:i}=ue(),[s,c]=Fr(!1);if(n==="installed")return a?z("div",{className:`flex items-center gap-2 text-sm text-zinc-400 ${o??""}`,children:[f(Wr,{}),f("span",{children:a})]}):null;if(n==="unsupported")return null;function l(){n==="android-ready"?i():n==="ios-safari"&&c(!0)}return z(q,{children:[z("button",{onClick:l,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-sm font-semibold transition-all active:scale-95 ${o??""}`,children:[f(qe,{}),f("span",{children:r}),n==="ios-safari"&&f(jr,{})]}),n==="ios-safari"&&f(He,{open:s,onClose:()=>c(!1),appName:e,iconSrc:t})]})}function He({open:e,onClose:t,appName:r,iconSrc:a}){return e?z(q,{children:[f("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:t}),z("div",{className:"fixed bottom-0 left-1/2 -translate-x-1/2 z-[9999] w-full max-w-[430px] rounded-t-2xl bg-white dark:bg-zinc-900 shadow-2xl",children:[f("div",{className:"flex justify-center pt-3 pb-1",children:f("div",{className:"w-9 h-1 rounded-full bg-zinc-200 dark:bg-zinc-700"})}),z("div",{className:"px-5 pb-8 pt-3",children:[z("div",{className:"flex items-center gap-3 mb-5",children:[a?f("img",{src:a,alt:r,className:"w-12 h-12 rounded-xl shadow"}):f("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:f(qe,{size:22,className:"text-zinc-400"})}),z("div",{children:[z("p",{className:"font-bold text-zinc-900 dark:text-white text-base",children:[r," \uC124\uCE58\uD558\uAE30"]}),f("p",{className:"text-xs text-zinc-400 mt-0.5",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00\uD558\uBA74 \uC571\uCC98\uB7FC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5B4\uC694"})]})]}),f("div",{className:"space-y-3",children:[{icon:f(Ur,{}),text:z(q,{children:["\uD558\uB2E8 \uD234\uBC14\uC758 ",f("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uACF5\uC720"})," \uBC84\uD2BC\uC744 \uD0ED\uD558\uC138\uC694"]})},{icon:f(Vr,{}),text:z(q,{children:["\uC2A4\uD06C\uB864\uD574\uC11C"," ",f("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uC138\uC694"]})},{icon:f(_r,{}),text:z(q,{children:["\uC6B0\uCE21 \uC0C1\uB2E8 ",f("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uBA74 \uC644\uB8CC!"]})}].map((n,i)=>z("div",{className:"flex items-start gap-3",children:[f("div",{className:"w-8 h-8 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-500 dark:text-zinc-400",children:n.icon}),f("div",{className:"flex-1 pt-1",children:z("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[f("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-zinc-200 dark:bg-zinc-700 text-[9px] font-bold text-zinc-500 dark:text-zinc-400 mr-1.5 flex-shrink-0",children:i+1}),n.text]})})]},i))}),z("div",{className:"mt-5 flex items-center gap-2 px-3 py-2.5 rounded-xl bg-zinc-50 dark:bg-zinc-800",children:[f(Hr,{}),f("p",{className:"text-xs text-zinc-400",children:"Safari \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB9CC \uD648 \uD654\uBA74 \uCD94\uAC00\uAC00 \uAC00\uB2A5\uD574\uC694"})]}),f("button",{onClick:t,className:"mt-3 w-full py-3 rounded-xl text-sm font-semibold text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})]})]})]}):null}function qe({size:e=16,className:t=""}){return z("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function jr(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70",children:f("polyline",{points:"9 18 15 12 9 6"})})}function Wr(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:f("polyline",{points:"20 6 9 17 4 12"})})}function Ur(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),f("polyline",{points:"16 6 12 2 8 6"}),f("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function Vr(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),f("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),f("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function _r(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("polyline",{points:"9 11 12 14 22 4"}),f("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function Hr(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 flex-shrink-0",children:[f("circle",{cx:"12",cy:"12",r:"10"}),f("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]})}var tn={width:"device-width",initialScale:1,maximumScale:1,userScalable:!1,viewportFit:"cover"};function Ge(e,t={}){let{size:r=192,bg:a="#000000",color:o="#ffffff",radius:n=.25,fontSize:i=.375}=t,s=Math.round(r*n),c=Math.round(r*i),l=a.replace("#","%23"),p=o.replace("#","%23");return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${r} ${r}'><rect width='${r}' height='${r}' rx='${s}' fill='${l}'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-family='system-ui,sans-serif' font-size='${c}' font-weight='900' fill='${p}'>${e}</text></svg>`}function rn(e){let{name:t,shortName:r=t,description:a,startUrl:o="/",backgroundColor:n="#ffffff",themeColor:i="#000000",icon:s}=e,c=s?[{src:Ge(s.text,{size:192,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"192x192",type:"image/svg+xml"},{src:Ge(s.text,{size:512,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"512x512",type:"image/svg+xml"}]:[];return{name:t,short_name:r,...a&&{description:a},start_url:o,display:"standalone",orientation:"portrait",background_color:n,theme_color:i,icons:c}}var F=class extends Error{constructor(r,a,o,n,i){super(`${r} ${a}${n?` [${i??"GET"} ${n}]`:""}`);this.status=r;this.statusText=a;this.body=o;this.url=n;this.method=i;this.name="ApiError"}};async function G(e){return(e.headers.get("content-type")??"").includes("application/json")?e.json():e.text()}function qr(e,t={}){let r=e.replace(/\/$/,"");async function a(o,n,i,s={}){let c=n.startsWith("http")?n:`${r}/${n.replace(/^\//,"")}`,l={...t.headers,...s.headers};i!==void 0&&s.contentType!==null&&(l["Content-Type"]=s.contentType??"application/json");let p={method:o,headers:l,signal:s.signal};i!==void 0&&(p.body=i instanceof FormData?i:JSON.stringify(i));let d=new Request(c,p);t.onRequest&&(d=t.onRequest(d)??d);let g=await fetch(d);if(!g.ok){let h=await G(g).catch(()=>null),v=new F(g.status,g.statusText,h,c,o);throw t.onError?.(v),v}if(!(g.status===204||g.headers.get("content-length")==="0"))return G(g)}return{get:(o,n)=>a("GET",o,void 0,n),post:(o,n,i)=>a("POST",o,n,i),put:(o,n,i)=>a("PUT",o,n,i),patch:(o,n,i)=>a("PATCH",o,n,i),delete:(o,n)=>a("DELETE",o,void 0,n)}}import{useState as ge,useEffect as Ye,useCallback as Ke,useRef as Z}from"react";var Gr=500,$=new Map,fe=new Map;function Yr(e){e?$.delete(e):$.clear()}function Kr(e,t){$.size>=Gr&&$.delete($.keys().next().value),$.set(e,t)}async function Jr(e){let t=await fetch(e);if(!t.ok){let r=await G(t).catch(()=>null);throw new F(t.status,t.statusText,r,e,"GET")}return G(t)}async function Zr(e,t,r){let a;for(let o=0;o<=t;o++)try{return await e()}catch(n){if(a=n,n instanceof F)throw n;o<t&&await new Promise(i=>setTimeout(i,r*2**o))}throw a}function Xr(e,t={}){let{enabled:r=!0,staleTime:a=0,retry:o=2,retryDelay:n=1e3,revalidateOnFocus:i=!0,fetcher:s=Jr,onSuccess:c,onError:l}=t,[p,d]=ge(()=>{if(!e||a===0)return;let m=$.get(e);if(m&&Date.now()-m.ts<a)return m.data}),[g,h]=ge(()=>{if(!e||!r)return"idle";if(a>0){let m=$.get(e);if(m&&Date.now()-m.ts<a)return"success"}return"loading"}),[v,T]=ge(void 0),k=Z(!0),P=Z(s),N=Z(c),M=Z(l);P.current=s,N.current=c,M.current=l;let C=Ke(async(m=!1)=>{if(!e||!r){h(b=>b==="idle"?b:"idle");return}if(!m&&a>0){let b=$.get(e);if(b&&Date.now()-b.ts<a){d(b.data),h("success");return}}h("loading"),T(void 0);try{let b=fe.get(e);b||(b=Zr(()=>P.current(e),o,n),fe.set(e,b),b.finally(()=>fe.delete(e)));let y=await b;if(!k.current)return;Kr(e,{data:y,ts:Date.now()}),d(y),h("success"),N.current?.(y)}catch(b){if(!k.current)return;let y=b;T(y),h("error"),M.current?.(y)}},[e,r,a,o,n]),E=Ke(()=>C(!0),[C]);return Ye(()=>(k.current=!0,C(),()=>{k.current=!1}),[C]),Ye(()=>{if(!i)return;let m=()=>{document.visibilityState==="visible"&&C()};return document.addEventListener("visibilitychange",m),window.addEventListener("focus",m),()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("focus",m)}},[C,i]),{data:p,loading:g==="loading",error:v,status:g,refetch:E}}import{useState as X,useEffect as Q,useRef as W,useCallback as me}from"react";function Qr(e,t={}){let{interval:r=5e3,enabled:a=!0,pauseOnHidden:o=!0,onSuccess:n,onError:i}=t,[s,c]=X(void 0),[l,p]=X(!1),[d,g]=X(void 0),[h,v]=X(a),T=W(!0),k=W(null),P=W(r),N=W(e),M=W(n),C=W(i);P.current=r,N.current=e,M.current=n,C.current=i,Q(()=>(T.current=!0,()=>{T.current=!1}),[]);let E=me(async()=>{if(T.current){p(!0);try{let y=await N.current();if(!T.current)return;c(y),g(void 0),M.current?.(y)}catch(y){if(!T.current)return;let L=y;g(L),C.current?.(L)}finally{T.current&&p(!1)}}},[]),m=me(()=>{k.current&&(clearInterval(k.current),k.current=null)},[]),b=me(()=>{m(),k.current=setInterval(E,P.current)},[E,m]);return Q(()=>{if(!h){m();return}return E(),b(),m},[h,E,b,m]),Q(()=>{if(h)return m(),k.current=setInterval(E,P.current),m},[r]),Q(()=>{if(!o)return;let y=()=>{h&&(document.visibilityState==="hidden"?m():(E(),b()))};return document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[h,o,E,b,m]),{data:s,loading:l,error:d,isRunning:h,stop:()=>v(!1),start:()=>v(!0),refetch:E}}import{clsx as eo}from"clsx";import{twMerge as to}from"tailwind-merge";function kn(e){let t=new Date(e),r=Date.now()-t.getTime(),a=Math.floor(r/1e3);return a<60?"\uBC29\uAE08 \uC804":a<3600?`${Math.floor(a/60)}\uBD84 \uC804`:a<86400?`${Math.floor(a/3600)}\uC2DC\uAC04 \uC804`:a<86400*2?"\uC5B4\uC81C":a<86400*7?`${Math.floor(a/86400)}\uC77C \uC804`:a<86400*30?`${Math.floor(a/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function yn(e){let t=Math.abs(e),r=e<0?"-":"";return t>=1e8?`${r}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${r}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${r}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:e.toLocaleString("ko-KR")}function zn(e,t="KRW",r="ko-KR"){return new Intl.NumberFormat(r,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(e)}function Nn(...e){return to(eo(e))}export{F as ApiError,rt as AppShell,at as AppShellContent,ot as AppShellHeader,er as Avatar,or as Badge,tt as Button,$r as Dialog,dt as Divider,Ft as EmojiButton,Dt as EmojiPicker,ft as EmptyState,Zt as GrassMap,He as IOSInstallSheet,Dr as PWAInstallButton,ct as Section,lt as SectionHeader,sr as ShareButton,Rr as Skeleton,ut as StatChip,St as THEME_SCRIPT,it as Tab,nt as TabBar,Ct as ThemeButton,Rt as ThemeDialog,fr as ToastProvider,Ut as Tooltip,It as Typewriter,vt as Watermark,Yr as clearFetchCache,Nn as cn,ae as colors,qr as createApiClient,rn as createManifest,Bt as fontFamily,Mt as fonts,yn as formatNumber,zn as formatPrice,tn as mobileViewport,kn as relativeTime,Ge as svgIcon,zr as useDebounce,Xr as useFetch,Sr as useFormSubmit,Er as useInView,xr as useLocalStorage,ue as usePWAInstall,Qr as usePolling,Oe as useShare,br as useToast};
12
+ `})]})}import{useEffect as $t,useState as Lt}from"react";import{createPortal as Ot}from"react-dom";import{jsx as I,jsxs as Re}from"react/jsx-runtime";var Ce=[{label:"\uC790\uC8FC \uC4F0\uB294",emojis:["\u{1F3E0}","\u{1F50D}","\u{1F464}","\u2B50","\u2764\uFE0F","\u{1F525}","\u2705","\u{1F4CC}","\u{1F3AF}","\u{1F4A1}","\u{1F680}","\u{1F4AC}","\u{1F44D}","\u{1F64C}","\u{1F4AA}","\u{1F389}","\u{1F4E2}","\u{1F511}","\u26A1","\u{1F31F}","\u{1F380}","\u{1F9E1}","\u{1FAF6}","\u{1F947}"]},{label:"\uAC10\uC815",emojis:["\u{1F600}","\u{1F604}","\u{1F606}","\u{1F60E}","\u{1F979}","\u{1F60D}","\u{1F929}","\u{1F605}","\u{1F602}","\u{1F972}","\u{1F62D}","\u{1F624}","\u{1F914}","\u{1F607}","\u{1FAF6}","\u{1F917}","\u{1F634}","\u{1F92F}","\u{1F973}","\u{1F62C}","\u{1FAE0}","\u{1F92B}","\u{1F636}","\u{1FAE1}"]},{label:"\uB3D9\uBB3C",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F438}","\u{1F435}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F986}","\u{1F989}","\u{1F98B}","\u{1F422}","\u{1F42C}","\u{1F433}"]},{label:"\uC0AC\uBB3C",emojis:["\u{1F4F1}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F4F7}","\u{1F3B5}","\u{1F3AE}","\u{1F4DA}","\u{1F4B0}","\u{1F381}","\u{1F514}","\u{1F4CA}","\u{1F5D3}\uFE0F","\u26A1","\u{1F527}","\u{1F48A}","\u{1F9EA}","\u{1F52D}","\u{1F399}\uFE0F","\u{1F58B}\uFE0F","\u{1F4E6}","\u{1F6CD}\uFE0F","\u{1F4B3}","\u{1F510}"]},{label:"\uC790\uC5F0",emojis:["\u{1F308}","\u{1F338}","\u{1F33F}","\u{1F340}","\u{1F319}","\u2600\uFE0F","\u2B50","\u{1F30A}","\u{1F34E}","\u{1F33A}","\u2744\uFE0F","\u{1F334}","\u{1F335}","\u{1F344}","\u{1F33B}","\u{1F30D}","\u26C5","\u{1F32A}\uFE0F","\u{1F305}","\u{1F341}","\u{1F33E}","\u{1FAB8}","\u{1FAE7}","\u2604\uFE0F"]},{label:"\uD65C\uB3D9",emojis:["\u{1F3C3}","\u{1F9D8}","\u{1F3A8}","\u{1F373}","\u2708\uFE0F","\u{1F3D5}\uFE0F","\u{1F3A4}","\u{1F3CB}\uFE0F","\u{1F938}","\u{1F9E9}","\u{1F3AD}","\u{1F6D2}","\u{1F6B4}","\u{1F3CA}","\u26F7\uFE0F","\u{1F3B8}","\u{1F3B9}","\u{1F4F8}","\u{1F9D7}","\u{1F93F}","\u{1F3B2}","\u{1F3C6}","\u{1F3AF}","\u{1FA84}"]}];function Ft({emoji:e,onClick:t,className:r=""}){return I("button",{onClick:t,className:`w-9 h-9 rounded-full flex items-center justify-center text-lg bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-all hover:scale-110 active:scale-90 ${r}`,title:"Pick emoji",children:e})}function Dt({open:e,onClose:t,current:r,onSelect:a}){let[o,n]=Lt(0);if($t(()=>{if(!e)return;let s=c=>{c.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;let{emojis:i}=Ce[o];return Ot(Re("div",{className:"fixed inset-0 z-50 flex items-end justify-center",onClick:t,children:[I("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),Re("div",{className:"relative z-10 w-full max-w-101.5 mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:s=>s.stopPropagation(),children:[I("div",{className:"px-4 pt-4 pb-3",children:I("p",{className:"text-sm font-bold text-zinc-900 dark:text-white",children:"\uC774\uBAA8\uC9C0"})}),I("div",{className:"flex gap-1 px-4 pb-3 overflow-x-auto scrollbar-hide",children:Ce.map((s,c)=>I("button",{onClick:()=>n(c),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-semibold transition-colors ${o===c?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s.label},s.label))}),I("div",{className:"px-4 pb-3 grid grid-cols-6 gap-2",children:i.map(s=>I("button",{onClick:()=>{a(s),t()},className:`h-11 rounded-xl flex items-center justify-center text-2xl transition-all hover:scale-110 active:scale-90 ${r===s?"bg-zinc-900 dark:bg-white":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:s},s))}),I("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:I("button",{onClick:t,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})})]})]}),document.body)}import{useState as jt}from"react";import{createPortal as Wt}from"react-dom";import{Fragment as Vt,jsx as ie,jsxs as _t}from"react/jsx-runtime";function Ut({label:e,children:t,placement:r="top"}){let[a,o]=jt(null),n=l=>{o(l.currentTarget.getBoundingClientRect())},i=()=>o(null),s=a?r==="top"?a.top+window.scrollY-36:a.bottom+window.scrollY+8:0,c=a?a.left+window.scrollX+a.width/2:0;return _t(Vt,{children:[ie("span",{className:"inline-flex",onMouseEnter:n,onMouseLeave:i,onFocus:n,onBlur:i,children:t}),a&&Wt(ie("div",{className:"fixed z-[9999] pointer-events-none",style:{top:s,left:c,transform:"translateX(-50%)"},children:ie("div",{className:"px-3 py-1.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-xs font-semibold whitespace-nowrap shadow-lg animate-in fade-in zoom-in-95 duration-100",children:e})}),document.body)]})}import{useState as Me,useMemo as Be,useRef as Ht}from"react";import{jsx as S,jsxs as D}from"react/jsx-runtime";function qt(e){let[,t,r]=e.split("-");return`${parseInt(t)}\uC6D4 ${parseInt(r)}\uC77C`}function Ie(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var _=13,Gt=3,j=_+Gt,Yt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Kt=["","Mon","","Wed","","Fri",""];function Jt(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function Ae(e,t,r,a){if(e===0)return r?"rgb(39, 39, 42)":"rgb(244, 244, 245)";let o=e/t,[n,i,s]=Jt(a);if(r){let p=[.25,.4,.6,.9],d=o>.75?p[3]:o>.5?p[2]:o>.25?p[1]:p[0];return`rgba(${n}, ${i}, ${s}, ${d})`}let c=[.8,.6,.4,.15],l=o>.75?c[3]:o>.5?c[2]:o>.25?c[1]:c[0];return`rgb(${Math.round(n+(255-n)*l)}, ${Math.round(i+(255-i)*l)}, ${Math.round(s+(255-s)*l)})`}function Zt({data:e,accent:t,isDark:r=!1,unit:a=""}){let[o,n]=Me(null),i=Ht(null),s=Be(()=>{let u=new Set,x=new Date().getFullYear();u.add(x);for(let B of e)u.add(new Date(B.date).getFullYear());return Array.from(u).sort((B,U)=>U-B)},[e]),[c,l]=Me(new Date().getFullYear()),p=Be(()=>new Map(e.map(u=>[u.date,u.count])),[e]),d=e.length>0?e[0].date:null,g=d?new Date(d).toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"}):null,h=new Date,v=Ie(h),T=new Date(c,0,1),k=new Date(c,11,31),P=new Date(T);P.setDate(P.getDate()-P.getDay());let N=[],M=Math.ceil((k.getTime()-P.getTime())/(1e3*60*60*24))+1;for(let u=0;u<M;u++){let x=new Date(P);if(x.setDate(x.getDate()+u),x>k)break;let B=Ie(x),U=Math.floor(u/7),Y=u%7,K=x<T,ee=x>h;N.push({date:B,count:p.get(B)||0,col:U,row:Y,isOutOfRange:K,isFuture:ee})}let C=Math.max(...N.map(u=>u.count),1),E=N.length>0?Math.max(...N.map(u=>u.col))+1:1,m=[],b=-1;for(let u of N){if(u.row!==0||u.isOutOfRange)continue;let x=new Date(u.date).getMonth();x!==b&&(m.push({label:Yt[x],col:u.col}),b=x)}let y=36,L=22,Je=y+E*j,Ze=L+7*j;return D("div",{ref:i,className:"relative space-y-4",children:[D("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[S("div",{className:"flex items-center gap-1.5",children:s.map(u=>S("button",{onClick:()=>l(u),className:`px-3 py-1 rounded-lg text-xs font-medium transition-colors ${c===u?"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900":"bg-zinc-100 dark:bg-zinc-800 text-zinc-400 dark:text-zinc-500 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:u},u))}),g&&D("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:["\uCCAB \uAE30\uB85D ",S("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:g})]})]}),S("div",{className:"overflow-x-auto",children:D("svg",{width:Je,height:Ze,className:"block mx-auto",onMouseLeave:()=>n(null),children:[m.map((u,x)=>S("text",{x:y+u.col*j,y:13,className:"fill-zinc-400",fontFamily:"system-ui, sans-serif",fontSize:10,children:u.label},`${u.label}-${x}`)),Kt.map((u,x)=>u?S("text",{x:0,y:L+x*j+_-2,className:"fill-zinc-300",fontFamily:"system-ui, sans-serif",fontSize:9,children:u},x):null),N.map(u=>{let x=u.date===v,B=u.date===d,U=u.isOutOfRange?"transparent":u.isFuture?r?"rgb(24, 24, 27)":"rgb(250, 250, 250)":B?t:Ae(u.count,C,r,t),Y=y+u.col*j,K=L+u.row*j;return S("rect",{x:Y,y:K,width:_,height:_,rx:3,fill:U,stroke:B?t:"none",strokeWidth:B?1.5:0,style:{cursor:u.isOutOfRange?"default":"pointer"},onMouseEnter:ee=>{if(u.isOutOfRange)return;let he=ee.currentTarget.ownerSVGElement.getBoundingClientRect(),be=i.current.getBoundingClientRect();n({x:Y+he.left-be.left+_/2,y:K+he.top-be.top,date:u.date,count:u.count,isFirst:B,isToday:x,isFuture:u.isFuture})}},u.date)})]})}),o&&D("div",{className:"pointer-events-none absolute z-30 -translate-x-1/2 -translate-y-full",style:{left:o.x,top:o.y-6},children:[D("div",{className:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-[11px] rounded-lg px-2.5 py-1.5 shadow-lg whitespace-nowrap",children:[S("span",{className:"font-medium",children:qt(o.date)}),!o.isFuture&&S("span",{className:"ml-1.5 tabular-nums",children:o.count>0?`${o.count.toLocaleString()}${a}`:"\uAE30\uB85D \uC5C6\uC74C"}),o.isFirst&&S("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\u{1F331} \uCCAB \uAE30\uB85D"}),o.isToday&&!o.isFirst&&S("span",{className:"ml-1.5 text-[10px] opacity-70",children:"\uC624\uB298"})]}),S("div",{className:"mx-auto w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-zinc-900 dark:border-t-zinc-100"})]}),D("div",{className:"flex items-center justify-end gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[S("span",{children:"Less"}),[0,.15,.35,.6,.85].map((u,x)=>S("div",{className:"w-3 h-3 rounded-xs",style:{backgroundColor:u===0?r?"rgb(39, 39, 42)":"rgb(244, 244, 245)":Ae(Math.ceil(u*10),10,r,t)}},x)),S("span",{children:"More"}),S("div",{className:"ml-2 w-3 h-3 rounded-xs",style:{backgroundColor:t,opacity:.6}}),S("span",{children:"1st"})]})]})}import{useState as Xt}from"react";import{jsx as $e}from"react/jsx-runtime";var Qt={xs:{box:"w-6 h-6",text:"text-[9px]",px:24},sm:{box:"w-8 h-8",text:"text-[11px]",px:32},md:{box:"w-10 h-10",text:"text-sm",px:40},lg:{box:"w-14 h-14",text:"text-lg",px:56},xl:{box:"w-20 h-20",text:"text-2xl",px:80}};function er({src:e,fallback:t,size:r="md",shape:a="circle",color:o="#3f3f46",className:n=""}){let{box:i,text:s}=Qt[r],c=a==="circle"?"rounded-full":"rounded-xl",[l,p]=Xt(!1);if(e&&!l)return $e("img",{src:e,alt:t,onError:()=>p(!0),className:`${i} ${c} object-cover flex-shrink-0 ${n}`});let d=t.trim().slice(0,2).toUpperCase();return $e("div",{className:`${i} ${c} flex items-center justify-center flex-shrink-0 font-bold select-none ${s} ${n}`,style:{backgroundColor:o,color:"#ffffff"},"aria-label":t,children:d})}import{jsx as ar}from"react/jsx-runtime";var tr={default:"bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400",green:"bg-green-100 dark:bg-green-950 text-green-700 dark:text-green-400",red:"bg-red-100 dark:bg-red-950 text-red-700 dark:text-red-400",yellow:"bg-yellow-100 dark:bg-yellow-950 text-yellow-700 dark:text-yellow-400",blue:"bg-blue-100 dark:bg-blue-950 text-blue-700 dark:text-blue-400",purple:"bg-purple-100 dark:bg-purple-950 text-purple-700 dark:text-purple-400",orange:"bg-orange-100 dark:bg-orange-950 text-orange-700 dark:text-orange-400"},rr={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-0.5"};function or({children:e,variant:t="default",size:r="md",className:a=""}){return ar("span",{className:`inline-flex items-center font-semibold rounded-full leading-none ${tr[t]} ${rr[r]} ${a}`,children:e})}import{useCallback as nr,useState as ir}from"react";import{Fragment as Le,jsx as A,jsxs as se}from"react/jsx-runtime";function Oe(e){let[t,r]=ir(!1),a=typeof navigator<"u"&&typeof navigator.share=="function";return{share:nr(async n=>{let i={...e,...n},s=i.url??(typeof window<"u"?window.location.href:"");if(a)try{await navigator.share({title:i.title,text:i.text,url:s});return}catch(c){if(c.name==="AbortError")return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},[a]),copied:t,canNativeShare:a}}function sr({url:e,title:t,text:r,label:a="\uACF5\uC720",copiedLabel:o="\uB9C1\uD06C \uBCF5\uC0AC\uB428",className:n=""}){let{share:i,copied:s}=Oe({url:e,title:t,text:r});return A("button",{onClick:()=>i(),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-sm font-semibold bg-zinc-100 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 active:scale-95 transition-all ${n}`,children:s?se(Le,{children:[A(lr,{}),o]}):se(Le,{children:[A(cr,{}),a]})})}function cr(){return se("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A("circle",{cx:"18",cy:"5",r:"3"}),A("circle",{cx:"6",cy:"12",r:"3"}),A("circle",{cx:"18",cy:"19",r:"3"}),A("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),A("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}function lr(){return A("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:A("polyline",{points:"20 6 9 17 4 12"})})}import{createContext as dr,useContext as pr,useState as Fe,useCallback as ur,useEffect as gr}from"react";import{jsx as ce,jsxs as wr}from"react/jsx-runtime";var De=dr(null);function fr({children:e}){let[t,r]=Fe([]),a=ur((o,n)=>{let i=Math.random().toString(36).slice(2,9),s=n?.duration??2500;r(c=>[...c,{id:i,message:o,variant:n?.variant??"default",duration:s}]),setTimeout(()=>{r(c=>c.filter(l=>l.id!==i))},s)},[]);return wr(De.Provider,{value:a,children:[e,ce("div",{"aria-live":"polite","aria-atomic":"false",className:"fixed bottom-24 inset-x-0 z-[9999] flex flex-col items-center gap-2 px-4 pointer-events-none",children:t.map(o=>ce(hr,{item:o},o.id))})]})}var mr={default:"bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900",success:"bg-green-600 text-white",error:"bg-red-600 text-white",info:"bg-blue-600 text-white"};function hr({item:e}){let[t,r]=Fe(!1);return gr(()=>{let a=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(a)},[]),ce("div",{role:"status",className:`pointer-events-auto w-full max-w-[390px] px-4 py-3 rounded-2xl text-sm font-semibold shadow-xl text-center transition-all duration-300 ${mr[e.variant]} ${t?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,children:e.message})}function br(){let e=pr(De);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}import{useState as vr,useCallback as je}from"react";function xr(e,t){let[r,a]=vr(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i!==null?JSON.parse(i):t}catch{return t}}),o=je(i=>{a(s=>{let c=typeof i=="function"?i(s):i;try{window.localStorage.setItem(e,JSON.stringify(c))}catch{}return c})},[e]),n=je(()=>{try{window.localStorage.removeItem(e)}catch{}a(t)},[e]);return[r,o,n]}import{useState as kr,useEffect as yr}from"react";function zr(e,t){let[r,a]=kr(e);return yr(()=>{let o=setTimeout(()=>a(e),t);return()=>clearTimeout(o)},[e,t]),r}import{useState as le,useCallback as We,useRef as Ue}from"react";function Sr(e,t={}){let[r,a]=le(!1),[o,n]=le(null),[i,s]=le(void 0),c=Ue(e),l=Ue(t);c.current=e,l.current=t;let p=We(async g=>{a(!0),n(null);try{let h=await c.current(g);s(h),l.current.onSuccess?.(h)}catch(h){let v=h instanceof Error?h:new Error(String(h));n(v),l.current.onError?.(v)}finally{a(!1)}},[]),d=We(()=>{n(null),s(void 0)},[]);return{submit:p,loading:r,error:o,data:i,reset:d}}import{useState as Tr,useCallback as Nr,useRef as Pr}from"react";function Er(e={}){let{threshold:t=0,rootMargin:r="0px",once:a=!1}=e,[o,n]=Tr(!1),i=Pr(null);return{ref:Nr(c=>{i.current?.disconnect(),i.current=null,c&&(i.current=new IntersectionObserver(([l])=>{n(l.isIntersecting),l.isIntersecting&&a&&i.current?.disconnect()},{threshold:t,rootMargin:r}),i.current.observe(c))},[t,r,a]),inView:o}}import{jsx as Mr}from"react/jsx-runtime";var Cr={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl",full:"rounded-full"};function Rr({className:e="",rounded:t="md"}){return Mr("div",{className:`animate-pulse bg-zinc-200 dark:bg-zinc-800 ${Cr[t]} ${e}`,"aria-hidden":"true"})}import{useEffect as de,useRef as Br,useState as Ve}from"react";import{createPortal as Ir}from"react-dom";import{jsx as H,jsxs as pe}from"react/jsx-runtime";var Ar={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"};function $r({open:e,onClose:t,title:r,size:a="sm",children:o,persistent:n=!1,className:i=""}){let[s,c]=Ve(!1),[l,p]=Ve(!1),d=Br(null);return de(()=>{if(e)c(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>p(!0)));else{p(!1);let g=setTimeout(()=>c(!1),200);return()=>clearTimeout(g)}},[e]),de(()=>{if(!e||n)return;let g=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t,n]),de(()=>{if(e){let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}}},[e]),!s||typeof document>"u"?null:Ir(pe("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?"dialog-title":void 0,className:"fixed inset-0 z-[200] flex items-end sm:items-center justify-center p-4",children:[H("div",{className:`absolute inset-0 bg-black/50 transition-opacity duration-200 ${l?"opacity-100":"opacity-0"}`,onClick:n?void 0:t}),pe("div",{ref:d,className:`relative w-full ${Ar[a]} bg-white dark:bg-zinc-900 rounded-3xl shadow-2xl p-6 transition-all duration-200 ${l?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95"} ${i}`,children:[!n&&H("button",{onClick:t,className:"absolute top-4 right-4 p-1.5 rounded-full text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"\uB2EB\uAE30",children:pe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[H("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),r&&H("h2",{id:"dialog-title",className:"text-lg font-bold text-zinc-900 dark:text-white mb-4 pr-6",children:r}),o]})]}),document.body)}import{useState as _e,useEffect as Lr}from"react";function ue(){let[e,t]=_e(null),[r,a]=_e(!1);Lr(()=>{if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0){a(!0);return}let s=l=>{l.preventDefault(),t(l)},c=()=>a(!0);return window.addEventListener("beforeinstallprompt",s),window.addEventListener("appinstalled",c),()=>{window.removeEventListener("beforeinstallprompt",s),window.removeEventListener("appinstalled",c)}},[]);let o=r?"installed":e?"android-ready":Or()?"ios-safari":"unsupported";async function n(){if(!e)return;await e.prompt();let{outcome:i}=await e.userChoice;i==="accepted"&&a(!0),t(null)}return{state:o,install:n}}function Or(){if(typeof navigator>"u")return!1;let e=navigator.userAgent;return/iphone|ipad|ipod/i.test(e)&&!/CriOS|FxiOS|OPiOS|EdgiOS/i.test(e)}import{useState as Fr}from"react";import{Fragment as q,jsx as f,jsxs as z}from"react/jsx-runtime";function Dr({appName:e="\uC571",iconSrc:t,label:r="\uC571\uC73C\uB85C \uC124\uCE58",installedLabel:a,className:o}){let{state:n,install:i}=ue(),[s,c]=Fr(!1);if(n==="installed")return a?z("div",{className:`flex items-center gap-2 text-sm text-zinc-400 ${o??""}`,children:[f(Wr,{}),f("span",{children:a})]}):null;if(n==="unsupported")return null;function l(){n==="android-ready"?i():n==="ios-safari"&&c(!0)}return z(q,{children:[z("button",{onClick:l,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-sm font-semibold transition-all active:scale-95 ${o??""}`,children:[f(qe,{}),f("span",{children:r}),n==="ios-safari"&&f(jr,{})]}),n==="ios-safari"&&f(He,{open:s,onClose:()=>c(!1),appName:e,iconSrc:t})]})}function He({open:e,onClose:t,appName:r,iconSrc:a}){return e?z(q,{children:[f("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:t}),z("div",{className:"fixed bottom-0 left-1/2 -translate-x-1/2 z-[9999] w-full max-w-[430px] rounded-t-2xl bg-white dark:bg-zinc-900 shadow-2xl",children:[f("div",{className:"flex justify-center pt-3 pb-1",children:f("div",{className:"w-9 h-1 rounded-full bg-zinc-200 dark:bg-zinc-700"})}),z("div",{className:"px-5 pb-8 pt-3",children:[z("div",{className:"flex items-center gap-3 mb-5",children:[a?f("img",{src:a,alt:r,className:"w-12 h-12 rounded-xl shadow"}):f("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:f(qe,{size:22,className:"text-zinc-400"})}),z("div",{children:[z("p",{className:"font-bold text-zinc-900 dark:text-white text-base",children:[r," \uC124\uCE58\uD558\uAE30"]}),f("p",{className:"text-xs text-zinc-400 mt-0.5",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00\uD558\uBA74 \uC571\uCC98\uB7FC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5B4\uC694"})]})]}),f("div",{className:"space-y-3",children:[{icon:f(Ur,{}),text:z(q,{children:["\uD558\uB2E8 \uD234\uBC14\uC758 ",f("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uACF5\uC720"})," \uBC84\uD2BC\uC744 \uD0ED\uD558\uC138\uC694"]})},{icon:f(Vr,{}),text:z(q,{children:["\uC2A4\uD06C\uB864\uD574\uC11C"," ",f("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uC138\uC694"]})},{icon:f(_r,{}),text:z(q,{children:["\uC6B0\uCE21 \uC0C1\uB2E8 ",f("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uBA74 \uC644\uB8CC!"]})}].map((n,i)=>z("div",{className:"flex items-start gap-3",children:[f("div",{className:"w-8 h-8 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-500 dark:text-zinc-400",children:n.icon}),f("div",{className:"flex-1 pt-1",children:z("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[f("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-zinc-200 dark:bg-zinc-700 text-[9px] font-bold text-zinc-500 dark:text-zinc-400 mr-1.5 flex-shrink-0",children:i+1}),n.text]})})]},i))}),z("div",{className:"mt-5 flex items-center gap-2 px-3 py-2.5 rounded-xl bg-zinc-50 dark:bg-zinc-800",children:[f(Hr,{}),f("p",{className:"text-xs text-zinc-400",children:"Safari \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB9CC \uD648 \uD654\uBA74 \uCD94\uAC00\uAC00 \uAC00\uB2A5\uD574\uC694"})]}),f("button",{onClick:t,className:"mt-3 w-full py-3 rounded-xl text-sm font-semibold text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})]})]})]}):null}function qe({size:e=16,className:t=""}){return z("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function jr(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70",children:f("polyline",{points:"9 18 15 12 9 6"})})}function Wr(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:f("polyline",{points:"20 6 9 17 4 12"})})}function Ur(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),f("polyline",{points:"16 6 12 2 8 6"}),f("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function Vr(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),f("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),f("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function _r(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("polyline",{points:"9 11 12 14 22 4"}),f("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function Hr(){return z("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 flex-shrink-0",children:[f("circle",{cx:"12",cy:"12",r:"10"}),f("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]})}var tn={width:"device-width",initialScale:1,maximumScale:1,userScalable:!1,viewportFit:"cover"};function Ge(e,t={}){let{size:r=192,bg:a="#000000",color:o="#ffffff",radius:n=.25,fontSize:i=.375}=t,s=Math.round(r*n),c=Math.round(r*i),l=a.replace("#","%23"),p=o.replace("#","%23");return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${r} ${r}'><rect width='${r}' height='${r}' rx='${s}' fill='${l}'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-family='system-ui,sans-serif' font-size='${c}' font-weight='900' fill='${p}'>${e}</text></svg>`}function rn(e){let{name:t,shortName:r=t,description:a,startUrl:o="/",backgroundColor:n="#ffffff",themeColor:i="#000000",icon:s}=e,c=s?[{src:Ge(s.text,{size:192,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"192x192",type:"image/svg+xml"},{src:Ge(s.text,{size:512,bg:s.bg??i,color:s.color,radius:s.radius}),sizes:"512x512",type:"image/svg+xml"}]:[],l={name:t,short_name:r,...a&&{description:a},start_url:o,display:"standalone",orientation:"portrait",background_color:n,theme_color:i,icons:c};return()=>l}var F=class extends Error{constructor(r,a,o,n,i){super(`${r} ${a}${n?` [${i??"GET"} ${n}]`:""}`);this.status=r;this.statusText=a;this.body=o;this.url=n;this.method=i;this.name="ApiError"}};async function G(e){return(e.headers.get("content-type")??"").includes("application/json")?e.json():e.text()}function qr(e,t={}){let r=e.replace(/\/$/,"");async function a(o,n,i,s={}){let c=n.startsWith("http")?n:`${r}/${n.replace(/^\//,"")}`,l={...t.headers,...s.headers};i!==void 0&&s.contentType!==null&&(l["Content-Type"]=s.contentType??"application/json");let p={method:o,headers:l,signal:s.signal};i!==void 0&&(p.body=i instanceof FormData?i:JSON.stringify(i));let d=new Request(c,p);t.onRequest&&(d=t.onRequest(d)??d);let g=await fetch(d);if(!g.ok){let h=await G(g).catch(()=>null),v=new F(g.status,g.statusText,h,c,o);throw t.onError?.(v),v}if(!(g.status===204||g.headers.get("content-length")==="0"))return G(g)}return{get:(o,n)=>a("GET",o,void 0,n),post:(o,n,i)=>a("POST",o,n,i),put:(o,n,i)=>a("PUT",o,n,i),patch:(o,n,i)=>a("PATCH",o,n,i),delete:(o,n)=>a("DELETE",o,void 0,n)}}import{useState as ge,useEffect as Ye,useCallback as Ke,useRef as Z}from"react";var Gr=500,$=new Map,fe=new Map;function Yr(e){e?$.delete(e):$.clear()}function Kr(e,t){$.size>=Gr&&$.delete($.keys().next().value),$.set(e,t)}async function Jr(e){let t=await fetch(e);if(!t.ok){let r=await G(t).catch(()=>null);throw new F(t.status,t.statusText,r,e,"GET")}return G(t)}async function Zr(e,t,r){let a;for(let o=0;o<=t;o++)try{return await e()}catch(n){if(a=n,n instanceof F)throw n;o<t&&await new Promise(i=>setTimeout(i,r*2**o))}throw a}function Xr(e,t={}){let{enabled:r=!0,staleTime:a=0,retry:o=2,retryDelay:n=1e3,revalidateOnFocus:i=!0,fetcher:s=Jr,onSuccess:c,onError:l}=t,[p,d]=ge(()=>{if(!e||a===0)return;let m=$.get(e);if(m&&Date.now()-m.ts<a)return m.data}),[g,h]=ge(()=>{if(!e||!r)return"idle";if(a>0){let m=$.get(e);if(m&&Date.now()-m.ts<a)return"success"}return"loading"}),[v,T]=ge(void 0),k=Z(!0),P=Z(s),N=Z(c),M=Z(l);P.current=s,N.current=c,M.current=l;let C=Ke(async(m=!1)=>{if(!e||!r){h(b=>b==="idle"?b:"idle");return}if(!m&&a>0){let b=$.get(e);if(b&&Date.now()-b.ts<a){d(b.data),h("success");return}}h("loading"),T(void 0);try{let b=fe.get(e);b||(b=Zr(()=>P.current(e),o,n),fe.set(e,b),b.finally(()=>fe.delete(e)));let y=await b;if(!k.current)return;Kr(e,{data:y,ts:Date.now()}),d(y),h("success"),N.current?.(y)}catch(b){if(!k.current)return;let y=b;T(y),h("error"),M.current?.(y)}},[e,r,a,o,n]),E=Ke(()=>C(!0),[C]);return Ye(()=>(k.current=!0,C(),()=>{k.current=!1}),[C]),Ye(()=>{if(!i)return;let m=()=>{document.visibilityState==="visible"&&C()};return document.addEventListener("visibilitychange",m),window.addEventListener("focus",m),()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("focus",m)}},[C,i]),{data:p,loading:g==="loading",error:v,status:g,refetch:E}}import{useState as X,useEffect as Q,useRef as W,useCallback as me}from"react";function Qr(e,t={}){let{interval:r=5e3,enabled:a=!0,pauseOnHidden:o=!0,onSuccess:n,onError:i}=t,[s,c]=X(void 0),[l,p]=X(!1),[d,g]=X(void 0),[h,v]=X(a),T=W(!0),k=W(null),P=W(r),N=W(e),M=W(n),C=W(i);P.current=r,N.current=e,M.current=n,C.current=i,Q(()=>(T.current=!0,()=>{T.current=!1}),[]);let E=me(async()=>{if(T.current){p(!0);try{let y=await N.current();if(!T.current)return;c(y),g(void 0),M.current?.(y)}catch(y){if(!T.current)return;let L=y;g(L),C.current?.(L)}finally{T.current&&p(!1)}}},[]),m=me(()=>{k.current&&(clearInterval(k.current),k.current=null)},[]),b=me(()=>{m(),k.current=setInterval(E,P.current)},[E,m]);return Q(()=>{if(!h){m();return}return E(),b(),m},[h,E,b,m]),Q(()=>{if(h)return m(),k.current=setInterval(E,P.current),m},[r]),Q(()=>{if(!o)return;let y=()=>{h&&(document.visibilityState==="hidden"?m():(E(),b()))};return document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[h,o,E,b,m]),{data:s,loading:l,error:d,isRunning:h,stop:()=>v(!1),start:()=>v(!0),refetch:E}}import{clsx as eo}from"clsx";import{twMerge as to}from"tailwind-merge";function kn(e){let t=new Date(e),r=Date.now()-t.getTime(),a=Math.floor(r/1e3);return a<60?"\uBC29\uAE08 \uC804":a<3600?`${Math.floor(a/60)}\uBD84 \uC804`:a<86400?`${Math.floor(a/3600)}\uC2DC\uAC04 \uC804`:a<86400*2?"\uC5B4\uC81C":a<86400*7?`${Math.floor(a/86400)}\uC77C \uC804`:a<86400*30?`${Math.floor(a/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function yn(e){let t=Math.abs(e),r=e<0?"-":"";return t>=1e8?`${r}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${r}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${r}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:e.toLocaleString("ko-KR")}function zn(e,t="KRW",r="ko-KR"){return new Intl.NumberFormat(r,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(e)}function Nn(...e){return to(eo(e))}export{F as ApiError,rt as AppShell,at as AppShellContent,ot as AppShellHeader,er as Avatar,or as Badge,tt as Button,$r as Dialog,dt as Divider,Ft as EmojiButton,Dt as EmojiPicker,ft as EmptyState,Zt as GrassMap,He as IOSInstallSheet,Dr as PWAInstallButton,ct as Section,lt as SectionHeader,sr as ShareButton,Rr as Skeleton,ut as StatChip,St as THEME_SCRIPT,it as Tab,nt as TabBar,Ct as ThemeButton,Rt as ThemeDialog,fr as ToastProvider,Ut as Tooltip,It as Typewriter,vt as Watermark,Yr as clearFetchCache,Nn as cn,ae as colors,qr as createApiClient,rn as createManifest,Bt as fontFamily,Mt as fonts,yn as formatNumber,zn as formatPrice,tn as mobileViewport,kn as relativeTime,Ge as svgIcon,zr as useDebounce,Xr as useFetch,Sr as useFormSubmit,Er as useInView,xr as useLocalStorage,ue as usePWAInstall,Qr as usePolling,Oe as useShare,br as useToast};
package/dist/pwa.d.mts ADDED
@@ -0,0 +1,102 @@
1
+ import { MetadataRoute, Viewport } from 'next';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+
4
+ type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
5
+ interface UsePWAInstallReturn {
6
+ state: PWAInstallState;
7
+ /** Android only — triggers the native install dialog */
8
+ install(): Promise<void>;
9
+ }
10
+ declare function usePWAInstall(): UsePWAInstallReturn;
11
+
12
+ interface PWAInstallButtonProps {
13
+ /** App name shown in iOS guide sheet */
14
+ appName?: string;
15
+ /** App icon src shown in iOS guide (optional) */
16
+ iconSrc?: string;
17
+ /** Label for the install button. Default: "앱으로 설치" */
18
+ label?: string;
19
+ /** Label shown when already installed. Default: undefined — button hidden */
20
+ installedLabel?: string;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * PWA install button that handles both Android and iOS.
25
+ *
26
+ * - Android (Chrome): triggers the native install dialog
27
+ * - iOS (Safari): opens a step-by-step "Add to Home Screen" guide sheet
28
+ * - Already installed: hidden by default (show with installedLabel)
29
+ * - Unsupported: hidden
30
+ *
31
+ * Usage:
32
+ * <PWAInstallButton appName="My App" iconSrc="/icon.png" />
33
+ */
34
+ declare function PWAInstallButton({ appName, iconSrc, label, installedLabel, className, }: PWAInstallButtonProps): react_jsx_runtime.JSX.Element | null;
35
+ interface IOSInstallSheetProps {
36
+ open: boolean;
37
+ onClose(): void;
38
+ appName: string;
39
+ iconSrc?: string;
40
+ }
41
+ /**
42
+ * Bottom-sheet guide for iOS "Add to Home Screen".
43
+ * Can also be used standalone if you need custom trigger UI.
44
+ */
45
+ declare function IOSInstallSheet({ open, onClose, appName, iconSrc }: IOSInstallSheetProps): react_jsx_runtime.JSX.Element | null;
46
+
47
+ /**
48
+ * Standard mobile viewport config for Next.js.
49
+ * - Disables pinch zoom via maximumScale (Android, older iOS)
50
+ * - Prevents input auto-zoom on iOS via the CSS in @m1kapp/kit (font-size: max(16px, 1em))
51
+ * - touch-action: pan-x pan-y in CSS handles iOS 10+ pinch zoom
52
+ *
53
+ * Usage: export const viewport = mobileViewport;
54
+ */
55
+ declare const mobileViewport: Viewport;
56
+ /**
57
+ * Generates an SVG icon as a data URI — no image files needed.
58
+ *
59
+ * Usage:
60
+ * svgIcon("m1k", { size: 192, bg: "#0f172a" })
61
+ * svgIcon("WP", { size: 512, bg: "#18181b", radius: 0.25 })
62
+ */
63
+ declare function svgIcon(text: string, options?: {
64
+ size?: number;
65
+ bg?: string;
66
+ color?: string;
67
+ /** Corner radius as a fraction of size. Default: 0.25 (25%) */
68
+ radius?: number;
69
+ /** Font size as a fraction of size. Default: 0.375 */
70
+ fontSize?: number;
71
+ }): string;
72
+ /**
73
+ * Generates a Next.js web app manifest function (app/manifest.ts).
74
+ * Icons are auto-generated as inline SVGs — no image files needed.
75
+ *
76
+ * Usage:
77
+ * // app/manifest.ts
78
+ * import { createManifest } from "@m1kapp/kit/pwa";
79
+ * export default createManifest({
80
+ * name: "m1k",
81
+ * shortName: "m1k",
82
+ * themeColor: "#0f172a",
83
+ * icon: { text: "m1k" },
84
+ * });
85
+ */
86
+ declare function createManifest(options: {
87
+ name: string;
88
+ shortName?: string;
89
+ description?: string;
90
+ startUrl?: string;
91
+ backgroundColor?: string;
92
+ themeColor?: string;
93
+ /** Text-based icon config — generates SVG icons automatically */
94
+ icon?: {
95
+ text: string;
96
+ bg?: string;
97
+ color?: string;
98
+ radius?: number;
99
+ };
100
+ }): () => MetadataRoute.Manifest;
101
+
102
+ export { IOSInstallSheet, PWAInstallButton, type PWAInstallState, type UsePWAInstallReturn, createManifest, mobileViewport, svgIcon, usePWAInstall };
package/dist/pwa.d.ts ADDED
@@ -0,0 +1,102 @@
1
+ import { MetadataRoute, Viewport } from 'next';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+
4
+ type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
5
+ interface UsePWAInstallReturn {
6
+ state: PWAInstallState;
7
+ /** Android only — triggers the native install dialog */
8
+ install(): Promise<void>;
9
+ }
10
+ declare function usePWAInstall(): UsePWAInstallReturn;
11
+
12
+ interface PWAInstallButtonProps {
13
+ /** App name shown in iOS guide sheet */
14
+ appName?: string;
15
+ /** App icon src shown in iOS guide (optional) */
16
+ iconSrc?: string;
17
+ /** Label for the install button. Default: "앱으로 설치" */
18
+ label?: string;
19
+ /** Label shown when already installed. Default: undefined — button hidden */
20
+ installedLabel?: string;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * PWA install button that handles both Android and iOS.
25
+ *
26
+ * - Android (Chrome): triggers the native install dialog
27
+ * - iOS (Safari): opens a step-by-step "Add to Home Screen" guide sheet
28
+ * - Already installed: hidden by default (show with installedLabel)
29
+ * - Unsupported: hidden
30
+ *
31
+ * Usage:
32
+ * <PWAInstallButton appName="My App" iconSrc="/icon.png" />
33
+ */
34
+ declare function PWAInstallButton({ appName, iconSrc, label, installedLabel, className, }: PWAInstallButtonProps): react_jsx_runtime.JSX.Element | null;
35
+ interface IOSInstallSheetProps {
36
+ open: boolean;
37
+ onClose(): void;
38
+ appName: string;
39
+ iconSrc?: string;
40
+ }
41
+ /**
42
+ * Bottom-sheet guide for iOS "Add to Home Screen".
43
+ * Can also be used standalone if you need custom trigger UI.
44
+ */
45
+ declare function IOSInstallSheet({ open, onClose, appName, iconSrc }: IOSInstallSheetProps): react_jsx_runtime.JSX.Element | null;
46
+
47
+ /**
48
+ * Standard mobile viewport config for Next.js.
49
+ * - Disables pinch zoom via maximumScale (Android, older iOS)
50
+ * - Prevents input auto-zoom on iOS via the CSS in @m1kapp/kit (font-size: max(16px, 1em))
51
+ * - touch-action: pan-x pan-y in CSS handles iOS 10+ pinch zoom
52
+ *
53
+ * Usage: export const viewport = mobileViewport;
54
+ */
55
+ declare const mobileViewport: Viewport;
56
+ /**
57
+ * Generates an SVG icon as a data URI — no image files needed.
58
+ *
59
+ * Usage:
60
+ * svgIcon("m1k", { size: 192, bg: "#0f172a" })
61
+ * svgIcon("WP", { size: 512, bg: "#18181b", radius: 0.25 })
62
+ */
63
+ declare function svgIcon(text: string, options?: {
64
+ size?: number;
65
+ bg?: string;
66
+ color?: string;
67
+ /** Corner radius as a fraction of size. Default: 0.25 (25%) */
68
+ radius?: number;
69
+ /** Font size as a fraction of size. Default: 0.375 */
70
+ fontSize?: number;
71
+ }): string;
72
+ /**
73
+ * Generates a Next.js web app manifest function (app/manifest.ts).
74
+ * Icons are auto-generated as inline SVGs — no image files needed.
75
+ *
76
+ * Usage:
77
+ * // app/manifest.ts
78
+ * import { createManifest } from "@m1kapp/kit/pwa";
79
+ * export default createManifest({
80
+ * name: "m1k",
81
+ * shortName: "m1k",
82
+ * themeColor: "#0f172a",
83
+ * icon: { text: "m1k" },
84
+ * });
85
+ */
86
+ declare function createManifest(options: {
87
+ name: string;
88
+ shortName?: string;
89
+ description?: string;
90
+ startUrl?: string;
91
+ backgroundColor?: string;
92
+ themeColor?: string;
93
+ /** Text-based icon config — generates SVG icons automatically */
94
+ icon?: {
95
+ text: string;
96
+ bg?: string;
97
+ color?: string;
98
+ radius?: number;
99
+ };
100
+ }): () => MetadataRoute.Manifest;
101
+
102
+ export { IOSInstallSheet, PWAInstallButton, type PWAInstallState, type UsePWAInstallReturn, createManifest, mobileViewport, svgIcon, usePWAInstall };
package/dist/pwa.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var f=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var y=(e,n)=>{for(var i in n)f(e,i,{get:n[i],enumerable:!0})},I=(e,n,i,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of w(n))!z.call(e,o)&&o!==i&&f(e,o,{get:()=>n[o],enumerable:!(s=b(n,o))||s.enumerable});return e};var S=e=>I(f({},"__esModule",{value:!0}),e);var E={};y(E,{IOSInstallSheet:()=>m,PWAInstallButton:()=>v,createManifest:()=>O,mobileViewport:()=>M,svgIcon:()=>x,usePWAInstall:()=>p});module.exports=S(E);var u=require("react");function p(){let[e,n]=(0,u.useState)(null),[i,s]=(0,u.useState)(!1);(0,u.useEffect)(()=>{if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0){s(!0);return}let r=d=>{d.preventDefault(),n(d)},c=()=>s(!0);return window.addEventListener("beforeinstallprompt",r),window.addEventListener("appinstalled",c),()=>{window.removeEventListener("beforeinstallprompt",r),window.removeEventListener("appinstalled",c)}},[]);let o=i?"installed":e?"android-ready":N()?"ios-safari":"unsupported";async function a(){if(!e)return;await e.prompt();let{outcome:l}=await e.userChoice;l==="accepted"&&s(!0),n(null)}return{state:o,install:a}}function N(){if(typeof navigator>"u")return!1;let e=navigator.userAgent;return/iphone|ipad|ipod/i.test(e)&&!/CriOS|FxiOS|OPiOS|EdgiOS/i.test(e)}var g=require("react");var t=require("react/jsx-runtime");function v({appName:e="\uC571",iconSrc:n,label:i="\uC571\uC73C\uB85C \uC124\uCE58",installedLabel:s,className:o}){let{state:a,install:l}=p(),[r,c]=(0,g.useState)(!1);if(a==="installed")return s?(0,t.jsxs)("div",{className:`flex items-center gap-2 text-sm text-zinc-400 ${o??""}`,children:[(0,t.jsx)(C,{}),(0,t.jsx)("span",{children:s})]}):null;if(a==="unsupported")return null;function d(){a==="android-ready"?l():a==="ios-safari"&&c(!0)}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:d,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-sm font-semibold transition-all active:scale-95 ${o??""}`,children:[(0,t.jsx)(h,{}),(0,t.jsx)("span",{children:i}),a==="ios-safari"&&(0,t.jsx)(P,{})]}),a==="ios-safari"&&(0,t.jsx)(m,{open:r,onClose:()=>c(!1),appName:e,iconSrc:n})]})}function m({open:e,onClose:n,appName:i,iconSrc:s}){return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:n}),(0,t.jsxs)("div",{className:"fixed bottom-0 left-1/2 -translate-x-1/2 z-[9999] w-full max-w-[430px] rounded-t-2xl bg-white dark:bg-zinc-900 shadow-2xl",children:[(0,t.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,t.jsx)("div",{className:"w-9 h-1 rounded-full bg-zinc-200 dark:bg-zinc-700"})}),(0,t.jsxs)("div",{className:"px-5 pb-8 pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[s?(0,t.jsx)("img",{src:s,alt:i,className:"w-12 h-12 rounded-xl shadow"}):(0,t.jsx)("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:(0,t.jsx)(h,{size:22,className:"text-zinc-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"font-bold text-zinc-900 dark:text-white text-base",children:[i," \uC124\uCE58\uD558\uAE30"]}),(0,t.jsx)("p",{className:"text-xs text-zinc-400 mt-0.5",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00\uD558\uBA74 \uC571\uCC98\uB7FC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5B4\uC694"})]})]}),(0,t.jsx)("div",{className:"space-y-3",children:[{icon:(0,t.jsx)(W,{}),text:(0,t.jsxs)(t.Fragment,{children:["\uD558\uB2E8 \uD234\uBC14\uC758 ",(0,t.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uACF5\uC720"})," \uBC84\uD2BC\uC744 \uD0ED\uD558\uC138\uC694"]})},{icon:(0,t.jsx)(B,{}),text:(0,t.jsxs)(t.Fragment,{children:["\uC2A4\uD06C\uB864\uD574\uC11C"," ",(0,t.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uC138\uC694"]})},{icon:(0,t.jsx)(L,{}),text:(0,t.jsxs)(t.Fragment,{children:["\uC6B0\uCE21 \uC0C1\uB2E8 ",(0,t.jsx)("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uBA74 \uC644\uB8CC!"]})}].map((a,l)=>(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-500 dark:text-zinc-400",children:a.icon}),(0,t.jsx)("div",{className:"flex-1 pt-1",children:(0,t.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[(0,t.jsx)("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-zinc-200 dark:bg-zinc-700 text-[9px] font-bold text-zinc-500 dark:text-zinc-400 mr-1.5 flex-shrink-0",children:l+1}),a.text]})})]},l))}),(0,t.jsxs)("div",{className:"mt-5 flex items-center gap-2 px-3 py-2.5 rounded-xl bg-zinc-50 dark:bg-zinc-800",children:[(0,t.jsx)(A,{}),(0,t.jsx)("p",{className:"text-xs text-zinc-400",children:"Safari \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB9CC \uD648 \uD654\uBA74 \uCD94\uAC00\uAC00 \uAC00\uB2A5\uD574\uC694"})]}),(0,t.jsx)("button",{onClick:n,className:"mt-3 w-full py-3 rounded-xl text-sm font-semibold text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})]})]})]}):null}function h({size:e=16,className:n=""}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:n,children:[(0,t.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,t.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,t.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function P(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70",children:(0,t.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function C(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function W(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,t.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,t.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function B(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),(0,t.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function L(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("polyline",{points:"9 11 12 14 22 4"}),(0,t.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function A(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 flex-shrink-0",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]})}var M={width:"device-width",initialScale:1,maximumScale:1,userScalable:!1,viewportFit:"cover"};function x(e,n={}){let{size:i=192,bg:s="#000000",color:o="#ffffff",radius:a=.25,fontSize:l=.375}=n,r=Math.round(i*a),c=Math.round(i*l),d=s.replace("#","%23"),k=o.replace("#","%23");return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${i} ${i}'><rect width='${i}' height='${i}' rx='${r}' fill='${d}'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-family='system-ui,sans-serif' font-size='${c}' font-weight='900' fill='${k}'>${e}</text></svg>`}function O(e){let{name:n,shortName:i=n,description:s,startUrl:o="/",backgroundColor:a="#ffffff",themeColor:l="#000000",icon:r}=e,c=r?[{src:x(r.text,{size:192,bg:r.bg??l,color:r.color,radius:r.radius}),sizes:"192x192",type:"image/svg+xml"},{src:x(r.text,{size:512,bg:r.bg??l,color:r.color,radius:r.radius}),sizes:"512x512",type:"image/svg+xml"}]:[],d={name:n,short_name:i,...s&&{description:s},start_url:o,display:"standalone",orientation:"portrait",background_color:a,theme_color:l,icons:c};return()=>d}0&&(module.exports={IOSInstallSheet,PWAInstallButton,createManifest,mobileViewport,svgIcon,usePWAInstall});
package/dist/pwa.mjs ADDED
@@ -0,0 +1 @@
1
+ import{useState as m,useEffect as k}from"react";function f(){let[n,r]=m(null),[i,a]=m(!1);k(()=>{if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0){a(!0);return}let s=u=>{u.preventDefault(),r(u)},d=()=>a(!0);return window.addEventListener("beforeinstallprompt",s),window.addEventListener("appinstalled",d),()=>{window.removeEventListener("beforeinstallprompt",s),window.removeEventListener("appinstalled",d)}},[]);let c=i?"installed":n?"android-ready":b()?"ios-safari":"unsupported";async function o(){if(!n)return;await n.prompt();let{outcome:l}=await n.userChoice;l==="accepted"&&a(!0),r(null)}return{state:c,install:o}}function b(){if(typeof navigator>"u")return!1;let n=navigator.userAgent;return/iphone|ipad|ipod/i.test(n)&&!/CriOS|FxiOS|OPiOS|EdgiOS/i.test(n)}import{useState as w}from"react";import{Fragment as p,jsx as t,jsxs as e}from"react/jsx-runtime";function z({appName:n="\uC571",iconSrc:r,label:i="\uC571\uC73C\uB85C \uC124\uCE58",installedLabel:a,className:c}){let{state:o,install:l}=f(),[s,d]=w(!1);if(o==="installed")return a?e("div",{className:`flex items-center gap-2 text-sm text-zinc-400 ${c??""}`,children:[t(I,{}),t("span",{children:a})]}):null;if(o==="unsupported")return null;function u(){o==="android-ready"?l():o==="ios-safari"&&d(!0)}return e(p,{children:[e("button",{onClick:u,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 text-sm font-semibold transition-all active:scale-95 ${c??""}`,children:[t(g,{}),t("span",{children:i}),o==="ios-safari"&&t(y,{})]}),o==="ios-safari"&&t(x,{open:s,onClose:()=>d(!1),appName:n,iconSrc:r})]})}function x({open:n,onClose:r,appName:i,iconSrc:a}){return n?e(p,{children:[t("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:r}),e("div",{className:"fixed bottom-0 left-1/2 -translate-x-1/2 z-[9999] w-full max-w-[430px] rounded-t-2xl bg-white dark:bg-zinc-900 shadow-2xl",children:[t("div",{className:"flex justify-center pt-3 pb-1",children:t("div",{className:"w-9 h-1 rounded-full bg-zinc-200 dark:bg-zinc-700"})}),e("div",{className:"px-5 pb-8 pt-3",children:[e("div",{className:"flex items-center gap-3 mb-5",children:[a?t("img",{src:a,alt:i,className:"w-12 h-12 rounded-xl shadow"}):t("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:t(g,{size:22,className:"text-zinc-400"})}),e("div",{children:[e("p",{className:"font-bold text-zinc-900 dark:text-white text-base",children:[i," \uC124\uCE58\uD558\uAE30"]}),t("p",{className:"text-xs text-zinc-400 mt-0.5",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00\uD558\uBA74 \uC571\uCC98\uB7FC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5B4\uC694"})]})]}),t("div",{className:"space-y-3",children:[{icon:t(S,{}),text:e(p,{children:["\uD558\uB2E8 \uD234\uBC14\uC758 ",t("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uACF5\uC720"})," \uBC84\uD2BC\uC744 \uD0ED\uD558\uC138\uC694"]})},{icon:t(N,{}),text:e(p,{children:["\uC2A4\uD06C\uB864\uD574\uC11C"," ",t("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uC138\uC694"]})},{icon:t(P,{}),text:e(p,{children:["\uC6B0\uCE21 \uC0C1\uB2E8 ",t("strong",{className:"text-zinc-900 dark:text-zinc-100",children:"\uCD94\uAC00"}),"\uB97C \uD0ED\uD558\uBA74 \uC644\uB8CC!"]})}].map((o,l)=>e("div",{className:"flex items-start gap-3",children:[t("div",{className:"w-8 h-8 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-500 dark:text-zinc-400",children:o.icon}),t("div",{className:"flex-1 pt-1",children:e("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[t("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-zinc-200 dark:bg-zinc-700 text-[9px] font-bold text-zinc-500 dark:text-zinc-400 mr-1.5 flex-shrink-0",children:l+1}),o.text]})})]},l))}),e("div",{className:"mt-5 flex items-center gap-2 px-3 py-2.5 rounded-xl bg-zinc-50 dark:bg-zinc-800",children:[t(C,{}),t("p",{className:"text-xs text-zinc-400",children:"Safari \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB9CC \uD648 \uD654\uBA74 \uCD94\uAC00\uAC00 \uAC00\uB2A5\uD574\uC694"})]}),t("button",{onClick:r,className:"mt-3 w-full py-3 rounded-xl text-sm font-semibold text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"\uB2EB\uAE30"})]})]})]}):null}function g({size:n=16,className:r=""}){return e("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,children:[t("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t("polyline",{points:"7 10 12 15 17 10"}),t("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function y(){return t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70",children:t("polyline",{points:"9 18 15 12 9 6"})})}function I(){return t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:t("polyline",{points:"20 6 9 17 4 12"})})}function S(){return e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),t("polyline",{points:"16 6 12 2 8 6"}),t("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function N(){return e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),t("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function P(){return e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("polyline",{points:"9 11 12 14 22 4"}),t("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function C(){return e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 flex-shrink-0",children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]})}var E={width:"device-width",initialScale:1,maximumScale:1,userScalable:!1,viewportFit:"cover"};function v(n,r={}){let{size:i=192,bg:a="#000000",color:c="#ffffff",radius:o=.25,fontSize:l=.375}=r,s=Math.round(i*o),d=Math.round(i*l),u=a.replace("#","%23"),h=c.replace("#","%23");return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${i} ${i}'><rect width='${i}' height='${i}' rx='${s}' fill='${u}'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-family='system-ui,sans-serif' font-size='${d}' font-weight='900' fill='${h}'>${n}</text></svg>`}function $(n){let{name:r,shortName:i=r,description:a,startUrl:c="/",backgroundColor:o="#ffffff",themeColor:l="#000000",icon:s}=n,d=s?[{src:v(s.text,{size:192,bg:s.bg??l,color:s.color,radius:s.radius}),sizes:"192x192",type:"image/svg+xml"},{src:v(s.text,{size:512,bg:s.bg??l,color:s.color,radius:s.radius}),sizes:"512x512",type:"image/svg+xml"}]:[],u={name:r,short_name:i,...a&&{description:a},start_url:c,display:"standalone",orientation:"portrait",background_color:o,theme_color:l,icons:d};return()=>u}export{x as IOSInstallSheet,z as PWAInstallButton,$ as createManifest,E as mobileViewport,v as svgIcon,f as usePWAInstall};
@@ -0,0 +1,9 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function relativeTime(date: Date | string | number): string;
4
+ declare function formatNumber(n: number): string;
5
+ declare function formatPrice(amount: number, currency?: string, locale?: string): string;
6
+
7
+ declare function cn(...inputs: ClassValue[]): string;
8
+
9
+ export { cn, formatNumber, formatPrice, relativeTime };
@@ -0,0 +1,9 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function relativeTime(date: Date | string | number): string;
4
+ declare function formatNumber(n: number): string;
5
+ declare function formatPrice(amount: number, currency?: string, locale?: string): string;
6
+
7
+ declare function cn(...inputs: ClassValue[]): string;
8
+
9
+ export { cn, formatNumber, formatPrice, relativeTime };
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var m=(t,r)=>{for(var n in r)i(t,n,{get:r[n],enumerable:!0})},l=(t,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of s(r))!c.call(t,o)&&o!==n&&i(t,o,{get:()=>r[o],enumerable:!(e=f(r,o))||e.enumerable});return t};var _=t=>l(i({},"__esModule",{value:!0}),t);var b={};m(b,{cn:()=>x,formatNumber:()=>g,formatPrice:()=>p,relativeTime:()=>$});module.exports=_(b);var a=require("clsx"),u=require("tailwind-merge");function $(t){let r=new Date(t),n=Date.now()-r.getTime(),e=Math.floor(n/1e3);return e<60?"\uBC29\uAE08 \uC804":e<3600?`${Math.floor(e/60)}\uBD84 \uC804`:e<86400?`${Math.floor(e/3600)}\uC2DC\uAC04 \uC804`:e<86400*2?"\uC5B4\uC81C":e<86400*7?`${Math.floor(e/86400)}\uC77C \uC804`:e<86400*30?`${Math.floor(e/(86400*7))}\uC8FC \uC804`:r.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function g(t){let r=Math.abs(t),n=t<0?"-":"";return r>=1e8?`${n}${(r/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:r>=1e4?`${n}${(r/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:r>=1e3?`${n}${(r/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:t.toLocaleString("ko-KR")}function p(t,r="KRW",n="ko-KR"){return new Intl.NumberFormat(n,{style:"currency",currency:r,maximumFractionDigits:r==="KRW"?0:2}).format(t)}function x(...t){return(0,u.twMerge)((0,a.clsx)(t))}0&&(module.exports={cn,formatNumber,formatPrice,relativeTime});
package/dist/utils.mjs ADDED
@@ -0,0 +1 @@
1
+ import{clsx as o}from"clsx";import{twMerge as i}from"tailwind-merge";function a(e){let r=new Date(e),n=Date.now()-r.getTime(),t=Math.floor(n/1e3);return t<60?"\uBC29\uAE08 \uC804":t<3600?`${Math.floor(t/60)}\uBD84 \uC804`:t<86400?`${Math.floor(t/3600)}\uC2DC\uAC04 \uC804`:t<86400*2?"\uC5B4\uC81C":t<86400*7?`${Math.floor(t/86400)}\uC77C \uC804`:t<86400*30?`${Math.floor(t/(86400*7))}\uC8FC \uC804`:r.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function u(e){let r=Math.abs(e),n=e<0?"-":"";return r>=1e8?`${n}${(r/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:r>=1e4?`${n}${(r/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:r>=1e3?`${n}${(r/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:e.toLocaleString("ko-KR")}function f(e,r="KRW",n="ko-KR"){return new Intl.NumberFormat(n,{style:"currency",currency:r,maximumFractionDigits:r==="KRW"?0:2}).format(e)}function m(...e){return i(o(e))}export{m as cn,u as formatNumber,f as formatPrice,a as relativeTime};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kapp/kit",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "UI, SEO, and PWA utilities for side projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -20,6 +20,16 @@
20
20
  "types": "./dist/ogimage.d.ts",
21
21
  "import": "./dist/ogimage.mjs",
22
22
  "require": "./dist/ogimage.js"
23
+ },
24
+ "./pwa": {
25
+ "types": "./dist/pwa.d.ts",
26
+ "import": "./dist/pwa.mjs",
27
+ "require": "./dist/pwa.js"
28
+ },
29
+ "./utils": {
30
+ "types": "./dist/utils.d.ts",
31
+ "import": "./dist/utils.mjs",
32
+ "require": "./dist/utils.js"
23
33
  }
24
34
  },
25
35
  "bin": {