@pop-ui/core 2.2.5 → 2.2.7
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/CHANGELOG.md +16 -0
- package/dist/assets/Montserrat-Bold.woff2 +0 -0
- package/dist/assets/Montserrat-Medium.woff2 +0 -0
- package/dist/assets/Montserrat-SemiBold.woff2 +0 -0
- package/dist/assets/NotoSansKR-Bold.woff2 +0 -0
- package/dist/assets/NotoSansKR-Medium.woff2 +0 -0
- package/dist/assets/NotoSansKR-Regular.woff2 +0 -0
- package/dist/assets/NotoSansKR-SemiBold.woff2 +0 -0
- package/dist/assets/OFL-Montserrat.txt +94 -0
- package/dist/assets/OFL-NotoSansKR.txt +93 -0
- package/dist/core.css +1 -1
- package/dist/core.umd.cjs +16 -16
- package/dist/esm/components/LottieInput/index.js +161 -150
- package/dist/esm/components/LottieInput/styles.module.scss.js +7 -5
- package/dist/types/index.d.ts +3 -1
- package/package.json +2 -2
package/dist/core.umd.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(D,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("@mantine/dates"),require("@pop-ui/foundation"),require("dayjs"),require("dayjs/locale/ko.js"),require("react"),require("dayjs/plugin/customParseFormat.js"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@mantine/dropzone"),require("react-easy-crop"),require("@dnd-kit/utilities"),require("@mantine/notifications")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","@mantine/dates","@pop-ui/foundation","dayjs","dayjs/locale/ko.js","react","dayjs/plugin/customParseFormat.js","@dnd-kit/core","@dnd-kit/sortable","@mantine/dropzone","react-easy-crop","@dnd-kit/utilities","@mantine/notifications"],a):(D=typeof globalThis<"u"?globalThis:D||self,a(D.Core={},D.jsxRuntime,D.MantineCore,D.dates,D.foundation,D.dayjs,null,D.React,D.customParseFormat,D.core$1,D.sortable,D.dropzone,D.Cropper,D.utilities,D.notifications))})(this,function(D,a,x,ye,h,Y,Dr,f,lt,ne,oe,Ce,it,Ae,de){"use strict";const ct={sm:14,md:16,lg:18},U={Button:"styles-module__Button___7ywU9",Button__Inner:"styles-module__Button__Inner___s7vuY",Button__Label:"styles-module__Button__Label___xnZNh",Button__Section:"styles-module__Button__Section___7GPRl",Button__Loader:"styles-module__Button__Loader___AZg1v","Button--Small":"styles-module__Button--Small___9VzCE","Button--Medium":"styles-module__Button--Medium___35lhd","Button--Large":"styles-module__Button--Large___fbUio","Button--Primary":"styles-module__Button--Primary___1ZKgs",Button__Disabled:"styles-module__Button__Disabled___NUWy8","Button--PrimaryLine":"styles-module__Button--PrimaryLine___76iyF","Button--Basic":"styles-module__Button--Basic___sWKzj","Button--Warning":"styles-module__Button--Warning___8gZ6-","Button--Setting":"styles-module__Button--Setting___KNjZA","Button--Danger":"styles-module__Button--Danger___m9tbm","Button--Ghost":"styles-module__Button--Ghost___-zzS-"},ke={inner:U.Button__Inner,label:U.Button__Label,section:U.Button__Section,loader:U.Button__Loader},_t={sm:U["Button--Small"],md:U["Button--Medium"],lg:U["Button--Large"]},dt={primary:U["Button--Primary"],primaryLine:U["Button--PrimaryLine"],basic:U["Button--Basic"],danger:U["Button--Danger"],setting:U["Button--Setting"],warning:U["Button--Warning"],ghost:U["Button--Ghost"]},ut=(...e)=>e.filter(Boolean).join(" ")||void 0,pt=e=>{const r=(n,t)=>{const o=Object.keys(n).reduce((l,s)=>{const i=s,c=[n[i],t[i]].filter(Boolean).join(" ");return c&&(l[i]=c),l},{});return Object.keys(t).forEach(l=>{const s=l;!(s in n)&&t[s]&&(o[s]=t[s])}),o};return typeof e=="function"?(n,t,o)=>r(ke,e(n,t,o)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(ke,e):ke};function ce({children:e,size:r="md",variant:n="primary",type:t="button",isLoading:o=!1,loading:l=!1,hideLabelOnLoading:s=!0,disabled:i=!1,className:c,classNames:p,loaderProps:m,..._}){const d=ct[r],u=o||l,g=i||u;return a.jsxs(x.Button,{type:t,unstyled:!0,className:ut(U.Button,i?U.Button__Disabled:"",_t[r],dt[n],c),classNames:pt(p),disabled:g,..._,children:[u&&a.jsx(x.Loader,{color:"currentColor",size:d,...m}),a.jsx("span",{className:U.Button__Label,children:u&&s?null:e})]})}const De={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},mt={sm:De["Checkbox--Small"],md:De["Checkbox--Medium"],lg:De["Checkbox--Large"]},ft={sm:18,md:24,lg:32},ht=({size:e="md",...r})=>{const n=mt[e],t=ft[e];return a.jsx(x.Checkbox,{className:n,size:e,styles:{inner:{width:t,height:t}},...r})},J={CalendarDatePicker__Wrapper:"styles-module__CalendarDatePicker__Wrapper___n4ux3",CalendarDatePicker__DayContent:"styles-module__CalendarDatePicker__DayContent___2xr8Q",CalendarDatePicker__DayLabel:"styles-module__CalendarDatePicker__DayLabel___-4E1W",CalendarDatePicker__TodayIndicator:"styles-module__CalendarDatePicker__TodayIndicator___ij6hs",CalendarDatePicker__Day:"styles-module__CalendarDatePicker__Day___eYyiw",CalendarDatePicker__Header:"styles-module__CalendarDatePicker__Header___hGYbK",CalendarDatePicker__HeaderLevel:"styles-module__CalendarDatePicker__HeaderLevel___yuhOQ",CalendarDatePicker__HeaderControl:"styles-module__CalendarDatePicker__HeaderControl___gz5tC",CalendarDatePicker__HeaderControlIcon:"styles-module__CalendarDatePicker__HeaderControlIcon___OVuQp",CalendarDatePicker__Month:"styles-module__CalendarDatePicker__Month___8-Nvy",CalendarDatePicker__MonthRow:"styles-module__CalendarDatePicker__MonthRow___PihZV",CalendarDatePicker__MonthCell:"styles-module__CalendarDatePicker__MonthCell___bEPui",CalendarDatePicker__WeekdaysRow:"styles-module__CalendarDatePicker__WeekdaysRow___lbdgy",CalendarDatePicker__Weekday:"styles-module__CalendarDatePicker__Weekday___-Seq9"},gt=({excludedDays:e=[],excludedDates:r=[]})=>{const n=[],t=[];for(const s of r)typeof s=="string"?n.push(s):t.push(s);const o=n.map(s=>Y(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[Y(s),Y(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=Y(s);if(!i.isValid())return!1;if(Array.isArray(e)&&e.includes(i.day())||o.includes(i.format("YYYY-MM-DD")))return!0;for(const[c,p]of l)if((i.isSame(c,"day")||i.isAfter(c,"day"))&&(i.isSame(p,"day")||i.isBefore(p,"day")))return!0;return!1}},yt=(e,r,n,t)=>{const o=Y(e),l=Y(r);for(const s of n)if(Array.isArray(s)){const i=Y(s[0]),c=Y(s[1]);if(!i.isValid()||!c.isValid())continue;if(!(l.isBefore(i,"day")||o.isAfter(c,"day")))return!0}for(const s of n)if(typeof s=="string"){const i=Y(s);if(!i.isValid())continue;if((i.isSame(o,"day")||i.isAfter(o,"day"))&&(i.isSame(l,"day")||i.isBefore(l,"day")))return!0}if(t.length>0){let s=o;for(;s.isBefore(l,"day")||s.isSame(l,"day");){if(t.includes(s.day()))return!0;s=s.add(1,"day")}}return!1},se=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},Ne=(e="default",r)=>r==null?se(e):e==="range"?Array.isArray(r)?r:se("range"):e==="multiple"?Array.isArray(r)?r:se("multiple"):Array.isArray(r)?r[0]??null:r,Oe=({type:e,externalValue:r,internalValue:n})=>r!==void 0?Ne(e,r):n!==void 0?Ne(e,n):se(e),Pe=(e,r)=>{const n=(t,o)=>{const l=Object.keys(t).reduce((s,i)=>{const c=i,p=t[c],m=o[c],_=[p,m].filter(Boolean).join(" ");return _&&(s[c]=_),s},{});return Object.keys(o).forEach(s=>{const i=s,c=o[i];!(i in t)&&c&&(l[i]=c)}),l};return typeof r=="function"?(t,o,l)=>n(e,r(t,o,l)):typeof r=="object"&&r!==null&&!Array.isArray(r)?n(e,r):e},Ct=e=>{if(e==null)return null;if(Array.isArray(e)){for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(n instanceof Date)return Y(n).format("YYYY-MM-DD")}return null}return e instanceof Date?Y(e).format("YYYY-MM-DD"):null},kt={levelsGroup:J.CalendarDatePicker__Wrapper,calendarHeader:J.CalendarDatePicker__Header,calendarHeaderLevel:J.CalendarDatePicker__HeaderLevel,calendarHeaderControl:J.CalendarDatePicker__HeaderControl,calendarHeaderControlIcon:J.CalendarDatePicker__HeaderControlIcon,month:J.CalendarDatePicker__Month,monthCell:J.CalendarDatePicker__MonthCell,day:J.CalendarDatePicker__Day,monthRow:J.CalendarDatePicker__MonthRow,weekdaysRow:J.CalendarDatePicker__WeekdaysRow,weekday:J.CalendarDatePicker__Weekday},Fe=({excludedDates:e=[],excludedDays:r=[],type:n="default",value:t,onChange:o,highlightToday:l=!1,...s})=>{const{classNames:i,date:c,defaultDate:p,onDateChange:m,getDayProps:_,...d}=s,[u,g]=f.useState(()=>t??se(n)),[y,C]=f.useState(()=>c||p||(Ct(t??se(n))??new Date)),k=f.useMemo(()=>gt({excludedDays:r,excludedDates:e}),[r,e]),M=f.useCallback(S=>{c===void 0&&C(S),m?.(S)},[c,m]),P=S=>{if(n==="range"&&Array.isArray(S)&&S.length===2){const[N,$]=S;if(N&&$&&yt(N,$,e,r)){const b=se("range");g(b),o?.(b);return}}g(S),o?.(S)},F=Oe({type:n,externalValue:t,internalValue:u}),H=f.useCallback(S=>{const N=Y(S).date(),b=Y(S).isSame(Y(),"day")&&l;return a.jsxs("span",{className:J.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:J.CalendarDatePicker__DayLabel,children:N}),b&&a.jsx("span",{className:J.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),G=Pe(kt,i),Z=c??y,E=Y(Z??new Date).format("YYYY-MM"),w=f.useCallback(S=>{const N=_?.(S)??{},$=Y(S).format("YYYY-MM")!==E;return{...N,onClick:b=>{N.onClick?.(b),$&&M(S)}}},[E,_,M]);return a.jsx(ye.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:n,previousIcon:a.jsx(h.IconChevronLeft,{}),nextIcon:a.jsx(h.IconChevronRight,{}),...d,size:"lg",onChange:P,weekendDays:[0],highlightToday:l,classNames:G,defaultDate:c===void 0?p:void 0,date:Z,onDateChange:M,getDayProps:w,value:F,excludeDate:k,renderDay:H})},T={DatePickerBase:"styles-module__DatePickerBase___yJlGe",DatePickerRoot:"styles-module__DatePickerRoot___HG6Zb","DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM",DatePicker__Wrapper:"styles-module__DatePicker__Wrapper___7X5ke",DatePicker__Input:"styles-module__DatePicker__Input___sTaqF",DatePicker__Placeholder:"styles-module__DatePicker__Placeholder___PZnzX",DatePicker__Section:"styles-module__DatePicker__Section___waCJM",DatePicker__Icon:"styles-module__DatePicker__Icon___fceRx",DatePicker__Dropdown:"styles-module__DatePicker__Dropdown___Iy9KE",DatePicker__DropdownArrow:"styles-module__DatePicker__DropdownArrow___zeIIm",DatePicker__Root:"styles-module__DatePicker__Root___2Q8qm",DatePicker__LevelsGroup:"styles-module__DatePicker__LevelsGroup___lrWsl",DatePicker__CalendarHeader:"styles-module__DatePicker__CalendarHeader___VI-Of",DatePicker__CalendarHeaderLevel:"styles-module__DatePicker__CalendarHeaderLevel___F4DtE",DatePicker__CalendarHeaderControl:"styles-module__DatePicker__CalendarHeaderControl___72yIl",DatePicker__CalendarHeaderControlIcon:"styles-module__DatePicker__CalendarHeaderControlIcon___CnQei",DatePicker__Month:"styles-module__DatePicker__Month___W7LuG",DatePicker__WeekdaysRow:"styles-module__DatePicker__WeekdaysRow___4NdYk",DatePicker__Weekday:"styles-module__DatePicker__Weekday___tL-rR",DatePicker__MonthRow:"styles-module__DatePicker__MonthRow___NSs67",DatePicker__MonthCell:"styles-module__DatePicker__MonthCell___iGYhy",DatePicker__Day:"styles-module__DatePicker__Day___7LDrl",DatePicker__TimeWrapper:"styles-module__DatePicker__TimeWrapper___BlHZZ",DatePicker__TimeInput:"styles-module__DatePicker__TimeInput___Acg-L",DatePicker__SubmitButton:"styles-module__DatePicker__SubmitButton___6DvfS"};Y.extend(lt);const Dt={wrapper:T.DatePicker__Wrapper,input:T.DatePicker__Input,section:T.DatePicker__Section,placeholder:T.DatePicker__Placeholder,datePickerRoot:T.DatePicker__Root,levelsGroup:T.DatePicker__LevelsGroup,calendarHeader:T.DatePicker__CalendarHeader,calendarHeaderLevel:T.DatePicker__CalendarHeaderLevel,calendarHeaderControl:T.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:T.DatePicker__CalendarHeaderControlIcon,month:T.DatePicker__Month,weekdaysRow:T.DatePicker__WeekdaysRow,weekday:T.DatePicker__Weekday,monthRow:T.DatePicker__MonthRow,monthCell:T.DatePicker__MonthCell,day:T.DatePicker__Day,timeWrapper:T.DatePicker__TimeWrapper,timeInput:T.DatePicker__TimeInput,submitButton:T.DatePicker__SubmitButton},Pt={dropdown:T.DatePicker__Dropdown,arrow:T.DatePicker__DropdownArrow},$e=(...e)=>e.filter(Boolean).join(" ")||void 0,me=e=>{if(e==null)return null;if(e instanceof Date)return e;if(typeof e=="string"&&e){const r=e.split("-").map(Number);if(r.length===3&&r[0]&&r[1]&&r[2])return new Date(r[0],r[1]-1,r[2])}return null},xt=({size:e="md",type:r="default",withTime:n,className:t,popoverProps:o,rightSection:l,rightSectionWidth:s,value:i,defaultValue:c,onChange:p,placeholder:m,disabled:_,minDate:d,maxDate:u,displayValueFormat:g="YYYY년 MM월 DD일",valueFormat:y,excludedDates:C,excludedDays:k,highlightToday:M})=>{const P=y??(n?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[F,H]=f.useState(!1),[G,Z]=f.useState(()=>h.parseDateValue(i??c,r,P)??se(r));let E=T["DatePicker--Medium"],w=18,S=42;e==="sm"?(E=T["DatePicker--Small"],w=14,S=34):e==="lg"&&(E=T["DatePicker--Large"],w=24,S=50);const N=Pe(Pt,o?.classNames),$=l??a.jsx("span",{"aria-hidden":"true",className:T.DatePicker__Icon,children:a.jsx(h.IconCalendar,{size:w})});if(n){const A=Q=>{if(!Q)return null;const pe=Y(Q,P,!0);return pe.isValid()?pe.toDate():null},W=i!==void 0,I=W?A(i):null,ee=A(c);return a.jsx(ye.DateTimePicker,{className:$e(T.DatePickerBase,T.DatePickerRoot,E,t),classNames:Pe(Dt,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:$,rightSectionWidth:s??S,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...o,classNames:N},value:W?I:void 0,defaultValue:W?void 0:ee,onChange:Q=>{p?.(Q?Y(Q).format(P):null)},placeholder:m,disabled:_,minDate:d,maxDate:u})}const b=i!=null?h.parseDateValue(i,r,P):void 0,v=Oe({type:r,externalValue:b,internalValue:G}),L=h.formatDateDisplay(v,r,g),V=A=>{let W;if(r==="range"&&Array.isArray(A)){const I=A;W=[me(I[0]??null),me(I[1]??null)]}else r==="multiple"&&Array.isArray(A)?W=A.map(I=>me(I)).filter(I=>I!==null):W=me(A);Z(W),p?.(h.toValueString(W,r,P)),r==="default"&&W!=null&&H(!1),r==="range"&&Array.isArray(W)&&W[0]&&W[1]&&H(!1)};return a.jsx("div",{className:$e(T.DatePickerBase,T.DatePickerRoot,E,t),children:a.jsxs(x.Popover,{opened:F,onClose:()=>H(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...o,classNames:N,children:[a.jsx(x.Popover.Target,{children:a.jsx("div",{className:T.DatePicker__Wrapper,"data-expanded":F?!0:void 0,"data-disabled":_?!0:void 0,children:a.jsx(x.Input,{component:"button",type:"button",classNames:{input:T.DatePicker__Input,section:T.DatePicker__Section},onClick:()=>!_&&H(A=>!A),disabled:_,rightSection:$,rightSectionWidth:s??S,"data-expanded":F?!0:void 0,"data-disabled":_?!0:void 0,children:L?a.jsx("span",{children:L}):a.jsx("span",{className:T.DatePicker__Placeholder,children:m})})})}),a.jsx(x.Popover.Dropdown,{children:a.jsx(Fe,{type:r,value:v,onChange:V,excludedDates:C,excludedDays:k,highlightToday:M,minDate:d,maxDate:u})})]})})},X={"Dropdown--LeftLabel":"styles-module__Dropdown--LeftLabel___SFObq","Dropdown--TopLabel":"styles-module__Dropdown--TopLabel___-lPhr","Dropdown__Label--Small":"styles-module__Dropdown__Label--Small___xbzOR","Dropdown__Label--Medium":"styles-module__Dropdown__Label--Medium___YtJ2-","Dropdown__Label--Large":"styles-module__Dropdown__Label--Large___sCiJv","Dropdown__Tooltip--Small":"styles-module__Dropdown__Tooltip--Small___rkmaO","Dropdown__Tooltip--Medium":"styles-module__Dropdown__Tooltip--Medium___JTfzy","Dropdown__Tooltip--Large":"styles-module__Dropdown__Tooltip--Large___W-sUq","Dropdown--Small":"styles-module__Dropdown--Small___dRIK7","Dropdown--Medium":"styles-module__Dropdown--Medium___-HZoU","Dropdown--Large":"styles-module__Dropdown--Large___BvV3M",Dropdown__Description:"styles-module__Dropdown__Description___OQ8bF",Dropdown__ErrorMsg:"styles-module__Dropdown__ErrorMsg___xTP0Y"},St=({label:e,labelPosition:r="top",size:n="md",required:t,tooltip:o,tooltipPosition:l="top",errorMsg:s,description:i,...c})=>{const[p,m]=f.useState(!1);let _=X["Dropdown__Label--Medium"],d=X["Dropdown--Medium"],u=X["Dropdown__Tooltip--Medium"],g=18;return n==="sm"?(_=X["Dropdown__Label--Small"],d=X["Dropdown--Small"],u=X["Dropdown__Tooltip--Small"],g=14):n==="lg"&&(_=X["Dropdown__Label--Large"],d=X["Dropdown--Large"],u=X["Dropdown__Tooltip--Large"],g=24),a.jsxs("div",{className:r==="top"?X["Dropdown--TopLabel"]:X["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(x.Input.Label,{required:t,className:_,children:e}),o&&a.jsx(x.Tooltip,{label:o,position:l,children:a.jsx("div",{className:u,children:a.jsx(h.IconInfoCircle,{size:n==="sm"?14:n==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(x.Select,{...c,size:n,error:s,className:d,rightSection:p?a.jsx(h.IconChevronUp,{size:g}):a.jsx(h.IconChevronDown,{size:g}),onDropdownOpen:()=>m(!0),onDropdownClose:()=>m(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:h.ColorGray100,color:h.ColorBlack}}}}}),i&&a.jsx(x.Input.Description,{className:X.Dropdown__Description,children:i}),s&&a.jsx(x.Input.Error,{className:X.Dropdown__ErrorMsg,children:s})]})]})},Mt=e=>({...e?{}:{content:{borderRadius:"12px"}},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:h.ColorGray900},header:{padding:"16px"},body:{paddingInline:0}}),bt=(e,r)=>{if(typeof e=="function")return e;const n=Mt(r),t={...n,...e};return Object.keys(n).forEach(o=>{t[o]={...n[o],...e?.[o]}}),t},xe=({size:e="md",width:r,withCloseButton:n=!1,fullScreen:t=!1,styles:o,...l})=>{let s=768;return e==="xs"?s=360:e==="sm"?s=544:e==="lg"?s=1e3:e==="xl"&&(s=1200),a.jsx(x.Modal,{size:r||s,fullScreen:t,styles:bt(o,t),withCloseButton:n,closeButtonProps:{icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},...l})};function fe(){return crypto.randomUUID()}function Tt(e,r,n){const t=[...e],[o]=t.splice(r,1);return t.splice(n,0,o),t}function wt(e,r,n){return n!=null&&e.length>=n?0:r!=null&&e.length<r?r-e.length:1}function It(e,r,n){return e.map(t=>{const o=t.position;return o==null?t:o===r?{...t,position:n}:r<n&&o>r&&o<=n?{...t,position:o-1}:r>n&&o>=n&&o<r?{...t,position:o+1}:t})}function vt(e,r,n){const t=[...r].sort((i,c)=>i.name.localeCompare(c.name)),o=n!=null?n-e.length:1/0,s=t.slice(0,o).map(i=>({id:fe(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function Bt(e,r){const n=e.find(t=>t.id===r);return n?.url?.startsWith("blob:")&&URL.revokeObjectURL(n.url),e.filter(t=>t.id!==r)}function ze(e,r,n){return e.map(t=>t.id!==r?t:(t.url?.startsWith("blob:")&&URL.revokeObjectURL(t.url),{...t,file:n,url:URL.createObjectURL(n)}))}function Lt(e,r,n){return ze(e,r,n)}function Et(e,r,n){const t={id:fe(),file:r,url:URL.createObjectURL(r),position:n};return[...e,t]}function At(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}async function Nt(e,r){const n=e.url??"";if(!n)return null;const t=await new Promise((i,c)=>{const p=new Image;p.crossOrigin="anonymous",p.onload=()=>i(p),p.onerror=c,p.src=n}),o=document.createElement("canvas");o.width=r.width,o.height=r.height;const l=o.getContext("2d");if(!l)return null;l.drawImage(t,r.x,r.y,r.width,r.height,0,0,r.width,r.height);const s=e.file?.name??e.url?.split("/").pop()??"image";return new Promise((i,c)=>{o.toBlob(p=>{p?i(new File([p],`cropped_${s}`,{type:"image/jpeg"})):c(new Error("Failed to create blob"))},"image/jpeg")})}function Ot({item:e,isOpen:r,aspect:n=1,onClose:t,onSubmit:o}){const[l,s]=f.useState({x:0,y:0}),[i,c]=f.useState(1),[p,m]=f.useState(null),[_,d]=f.useState(!1),u=async()=>{if(!(!p||!e)){d(!0);try{const g=await Nt(e,p);g&&o(g)}finally{d(!1)}}};return a.jsx(xe,{opened:r&&!!e,onClose:t,size:"md",title:"이미지 수정",withCloseButton:!0,children:a.jsxs(x.Stack,{children:[a.jsx("div",{style:{position:"relative",height:320,background:h.ColorWhite},children:a.jsx(it,{image:e?.url??"",crop:l,zoom:i,aspect:n,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:c,onCropComplete:(g,y)=>m(y),style:{containerStyle:{backgroundColor:h.ColorWhite}}})}),a.jsxs(x.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(ce,{variant:"basic",onClick:t,children:"취소"}),a.jsx(ce,{variant:"primary",isLoading:_,onClick:u,children:"적용하기"})]})]})},e?.id)}const q={Container:"styles-module__Container___ZyeJM",TileContent:"styles-module__TileContent___Ofq9-",TileImage:"styles-module__TileImage___6aKmW",OverlayButton:"styles-module__OverlayButton___AYBJ0",OverlayButtonLeft:"styles-module__OverlayButtonLeft___t8SaP",OverlayButtonRight:"styles-module__OverlayButtonRight___IOvjw",PreviewControls:"styles-module__PreviewControls___iu0Yk",PreviewContent:"styles-module__PreviewContent___8f8d2",PreviewViewport:"styles-module__PreviewViewport___7-I5L",PreviewOriginal:"styles-module__PreviewOriginal___PgXTM",PlaceholderText:"styles-module__PlaceholderText___nhLhy",PlaceholderTextError:"styles-module__PlaceholderTextError___jYZ8j"},R={TileContainer:"styles-module__TileContainer___5-y01",DeleteButton:"styles-module__DeleteButton___0zsXm",Tile:"styles-module__Tile___3Cezo",TileDragOver:"styles-module__TileDragOver___e7GXF",LoadingOverlay:"styles-module__LoadingOverlay___4CyDQ",ActionBar:"styles-module__ActionBar___mJYpe",DragHandle:"styles-module__DragHandle___lzKhb",DragHandleOverlay:"styles-module__DragHandleOverlay___0nlt3",LinkButton:"styles-module__LinkButton___bISyz",DropzoneOuter:"styles-module__DropzoneOuter___BIO2N",Placeholder:"styles-module__Placeholder___q30Yw",PlaceholderError:"styles-module__PlaceholderError___fCOYe"};function he({width:e,height:r,isError:n,isLoading:t,accept:o,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:R.DropzoneOuter,children:a.jsx(Ce.Dropzone,{onDrop:s,accept:o,multiple:l,disabled:t,className:n?R.PlaceholderError:R.Placeholder,style:{width:e,height:r},children:i})})}const Ft=e=>{const{isSorting:r,wasDragging:n}=e;return r||n?!1:oe.defaultAnimateLayoutChanges(e)};function He({id:e,children:r}){const{setNodeRef:n,transform:t,transition:o,isOver:l}=oe.useSortable({id:e,animateLayoutChanges:Ft});return a.jsx("div",{ref:n,style:{transform:Ae.CSS.Transform.toString(t),transition:o,opacity:l?.7:1},children:r})}function We({id:e,totalCount:r,width:n,height:t,readOnly:o,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:c,isDragHandleOverlay:p=!1,linkUrl:m,onLinkClick:_,onDelete:d,deleteAriaLabel:u="삭제",actionBarExtra:g,onTileClick:y,onFileDrop:C,children:k}){const[M,P]=f.useState(!1),F=I=>{!C||o||l||s||I.preventDefault()},H=I=>{!C||o||l||s||(I.preventDefault(),P(!0))},G=I=>{I.currentTarget.contains(I.relatedTarget)||P(!1)},Z=I=>{if(I.preventDefault(),P(!1),!C||o||l||s)return;const ee=I.dataTransfer.files[0];ee&&C(ee)},E=I=>{const{isSorting:ee,wasDragging:Q}=I;return ee||Q?!1:oe.defaultAnimateLayoutChanges(I)},{attributes:w,listeners:S,setActivatorNodeRef:N,setNodeRef:$,transform:b,transition:v,isDragging:L}=oe.useSortable({id:e,disabled:o,animateLayoutChanges:E}),V=!o&&r>1&&a.jsx("button",{type:"button",className:p?R.DragHandleOverlay:R.DragHandle,ref:N,...w,...S,"aria-label":"드래그로 순서 변경",disabled:p&&(!!l||!!s),onClick:p?I=>I.stopPropagation():void 0,children:a.jsx(h.IconDragMenu,{size:20,color:h.ColorGray600})}),A=!p&&!!V||c&&!!m&&!!_||!!g,W=o||l||s||!y?"default":"pointer";return a.jsxs("div",{ref:$,className:R.TileContainer,style:{transform:Ae.CSS.Transform.toString(b),transition:v,opacity:L?.4:1},children:[!o&&i&&!l&&a.jsx("button",{type:"button",className:R.DeleteButton,onClick:d,"aria-label":u,children:a.jsx(h.IconXCircle,{size:24})}),a.jsxs("div",{className:`${R.Tile}${M?` ${R.TileDragOver}`:""}`,style:{width:n,height:t,cursor:W},onClick:()=>!o&&!l&&!s&&y?.(),onDragOver:F,onDragEnter:H,onDragLeave:G,onDrop:Z,children:[k,p&&V,(l||s)&&a.jsx("div",{className:R.LoadingOverlay,children:a.jsx(x.Loader,{size:n/6,color:h.ColorAqua500})})]}),A&&a.jsxs("div",{className:R.ActionBar,children:[!p&&V,c&&m&&_&&a.jsx("button",{type:"button",className:R.LinkButton,onClick:_,children:"링크"}),g]})]})}function $t({items:e,onReorder:r}){return{sensors:ne.useSensors(ne.useSensor(ne.PointerSensor,{activationConstraint:{distance:8}}),ne.useSensor(ne.KeyboardSensor,{coordinateGetter:oe.sortableKeyboardCoordinates})),handleDragEnd:o=>{const{active:l,over:s}=o;if(!s||l.id===s.id)return;const i=e.findIndex(p=>p.id===l.id),c=e.findIndex(p=>p.id===s.id);i!==-1&&c!==-1&&r(i,c)}}}const Se="__slot-";function Ye({value:e,length:r,minLength:n,maxLength:t,onChange:o}){const l=r??n,s=r??t,i=l!=null&&s!=null&&l===s,c=i?0:wt(e,l,s),p=i?Array.from({length:s},(C,k)=>`${Se}${k}`):[],m=i?p:e.map(C=>C.id),{sensors:_,handleDragEnd:d}=$t({items:e,onReorder:(C,k)=>{const M=Tt(e,C,k),P=e[C];o?.(M,{action:"reorder",itemId:P.id,index:k,previousIndex:C,nextIndex:k})}});return{isPositionMode:i,resolvedMinLength:l,resolvedMaxLength:s,placeholderCount:c,slotIds:p,sortableItems:m,sensors:_,handleDragEnd:i?C=>{const{active:k,over:M}=C;if(!M||k.id===M.id)return;const P=Number(String(k.id).replace(Se,"")),F=Number(String(M.id).replace(Se,"")),H=e.find(Z=>Z.position===P);if(!H)return;const G=It(e,P,F);o?.(G,{action:"reorder",itemId:H.id,index:F,previousIndex:P,nextIndex:F})}:d,getMetaIndex:C=>{const k=e.find(M=>M.id===C);return i&&k?k.position??0:e.findIndex(M=>M.id===C)}}}function Ze(e){if(!e)return!1;try{const r=new URL(e).protocol;return r==="http:"||r==="https:"}catch{return!1}}function zt(e){Ze(e)&&window.open(e,"_blank","noopener,noreferrer")}function Ht(e){return e?e.join(","):"image/*"}function Ve({item:e,sortableId:r,index:n,totalCount:t,width:o,height:l,accept:s,canDelete:i,hasLink:c,hasEdit:p,readOnly:m,isLoading:_,onLinkClick:d,onDelete:u,onReplace:g,onEdit:y,onPreview:C}){const k=f.useRef(null),M=d?!!e.url:Ze(e.url);return a.jsxs(We,{id:r??e.id,totalCount:t,width:o,height:l,readOnly:m,isLoading:_,itemIsLoading:e.isLoading,canDelete:i,isDragHandleOverlay:!0,hasLink:c&&M,linkUrl:e.url,onLinkClick:c&&M?()=>d?d(e):e.url&&zt(e.url):void 0,onDelete:()=>u(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>k.current?.click(),onFileDrop:P=>{if(s){if(!s.includes(P.type))return}else if(!P.type.startsWith("image/"))return;g(e.id,P)},children:[a.jsx("input",{ref:k,type:"file",accept:Ht(s),style:{display:"none"},onChange:P=>{const F=P.target.files?.[0];F&&g(e.id,F),P.target.value=""}}),a.jsxs("div",{className:q.TileContent,children:[a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${n+1}`,className:q.TileImage}),p&&!m&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonLeft}`,"aria-label":"이미지 편집",title:"편집",disabled:_||e.isLoading,onClick:P=>{P.stopPropagation(),y(e)},children:a.jsx(h.IconEdit,{size:18})}),e.url&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonRight}`,"aria-label":"이미지 확대보기",title:"크게 보기",disabled:_||e.isLoading,onClick:P=>{P.stopPropagation(),C(e)},children:a.jsx(h.IconOpenInFull,{size:18,color:h.ColorGray900})})]})]})}const Wt=({value:e=[],onChange:r,accept:n,length:t,width:o=160,height:l=200,placeholder:s="이미지를 넣어주세요",hasIcon:i=!0,hasLink:c=!1,onLinkClick:p,hasEdit:m=!1,canDelete:_=!0,minLength:d,maxLength:u,errorMsg:g,isLoading:y,readOnly:C,gap:k=8})=>{const{isPositionMode:M,resolvedMaxLength:P,placeholderCount:F,slotIds:H,sortableItems:G,sensors:Z,handleDragEnd:E,getMetaIndex:w}=Ye({value:e,length:t,minLength:d,maxLength:u,onChange:r}),S=!!g,[N,$]=f.useState(null),[b,v]=f.useState(null),L=b?e.find(O=>O.id===b.id&&O.url===b.url)??null:null;b&&!L&&v(null);const V=f.useRef(e);f.useEffect(()=>{V.current=e},[e]),f.useEffect(()=>()=>At(V.current),[]);const A=O=>{if(C)return;const B=e.length,z=vt(e,O,P);z.length!==B&&r?.(z,{action:"create",itemId:z[B].id,index:B})},W=(O,B)=>{if(C)return;const z=B[0];if(!z)return;const te=Et(e,z,O);r?.(te,{action:"create",itemId:te[te.length-1].id,index:O})},I=O=>{if(C)return;const B=w(O),z=Bt(e,O);r?.(z,{action:"delete",itemId:O,index:B})},ee=(O,B)=>{if(C)return;const z=w(O),te=ze(e,O,B);r?.(te,{action:"replace",itemId:O,index:z})},Q=O=>{if(!N)return;const B=N.id,z=w(B),te=Lt(e,B,O);$(null),r?.(te,{action:"crop",itemId:B,index:z})},pe=O=>{const B=typeof s=="function"?s(O):s;return typeof B!="string"?B:B.split(`
|
|
2
|
-
`).map((z,te)=>a.jsx("span",{children:z},te))};return a.jsxs("div",{children:[a.jsx(
|
|
3
|
-
`).map((L,V)=>a.jsx("span",{children:L},V))};return a.jsxs("div",{children:[a.jsx(ne.DndContext,{sensors:H,collisionDetection:ne.closestCenter,onDragEnd:G,children:a.jsx(oe.SortableContext,{items:F,strategy:oe.rectSortingStrategy,children:a.jsx("div",{className:_e.Container,style:{gap:g},children:C?Array.from({length:k},(b,v)=>{const L=P[v],V=e.find(A=>A.position===v);return V?a.jsx(Ke,{item:V,sortableId:L,totalCount:k,width:n,height:t,readOnly:u??!1,isLoading:d,canDelete:y,hasLink:s,onLinkClick:i,onDelete:N},L):!u&&a.jsx(He,{id:L,children:a.jsxs(he,{onDrop:A=>S(v,A),accept:qe,multiple:!1,isLoading:d,isError:E,width:n,height:t,children:[l&&a.jsx(h.IconPhoto,{size:36,color:E?h.ColorRed700:h.ColorAqua700}),o&&a.jsx("div",{className:`${_e.PlaceholderText}${E?` ${_e.PlaceholderTextError}`:""}`,children:$(v)})]})},L)}):a.jsxs(a.Fragment,{children:[e.map(b=>a.jsx(Ke,{item:b,totalCount:e.length,width:n,height:t,readOnly:u??!1,isLoading:d,canDelete:y,hasLink:s,onLinkClick:i,onDelete:N},b.id)),!u&&Array.from({length:M},(b,v)=>a.jsxs(he,{onDrop:w,accept:qe,multiple:k!==1,isLoading:d,isError:E,width:n,height:t,children:[l&&a.jsx(h.IconPhoto,{size:36,color:E?h.ColorRed700:h.ColorAqua700}),o&&a.jsx("div",{className:`${_e.PlaceholderText}${E?` ${_e.PlaceholderTextError}`:""}`,children:$(v)})]},`placeholder-${v}`))]})})})}),E&&a.jsx(x.Input.Error,{mt:8,children:_})]})},ue={Pagination:"style-module__Pagination___xcR-Q",Pagination__PageIndex:"style-module__Pagination__PageIndex___50SZJ","Pagination__PageIndex--Active":"style-module__Pagination__PageIndex--Active___mSIwS",Pagination__Arrow:"style-module__Pagination__Arrow___74vp3"},qt=({currentPageIdx:e,rowsPerPage:r,totalLength:n,paginationSize:t,onPageChange:o,...l})=>{const[s,i]=f.useState(e),c=r||50,p=n||1,m=t||5;f.useEffect(()=>{i(e)},[e]);const _=()=>{o&&o(s-(s%m+1)),i(u=>u-(u%m+1))},d=()=>{o&&o(s+m-s%m),i(u=>u+m-u%m)};return a.jsxs("div",{...l,className:ue.Pagination,children:[s>=m?a.jsx("button",{className:ue.Pagination__Arrow,onClick:_,children:a.jsx(h.IconChevronLeft,{size:20})}):null,new Array(m).fill(0).map((u,g)=>{const y=Math.floor(s/m)*m+g+1;if(!(y>Math.ceil(p/c)))return a.jsx("button",{className:s===y-1?ue["Pagination__PageIndex--Active"]:ue.Pagination__PageIndex,onClick:()=>{i(y-1),o&&o(y-1)},children:y},`pagination_${g}`)}),Math.floor(s/m)*m+m<Math.ceil(p/c)?a.jsx("button",{className:ue.Pagination__Arrow,onClick:d,children:a.jsx(h.IconChevronRight,{size:20})}):null]})},be={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Kt={sm:be["Radio--Small"],md:be["Radio--Medium"],lg:be["Radio--Large"]},Jt={sm:18,md:24,lg:32},Xt=({size:e="md",...r})=>{const n=Kt[e],t=Jt[e];return a.jsx(x.Radio,{className:n,size:e,styles:{inner:{width:t,height:t}},...r})},K={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},Qt=({label:e,labelPosition:r="top",size:n="md",required:t,tooltip:o,tooltipPosition:l="top",errorMsg:s,description:i,onChange:c,onClear:p,...m})=>{const[_,d]=f.useState(0);let u=K["SearchBar__Label--Medium"],g=K["SearchBar--Medium"],y=K["SearchBar__Tooltip--Medium"];n==="sm"?(u=K["SearchBar__Label--Small"],g=K["SearchBar--Small"],y=K["SearchBar__Tooltip--Small"]):n==="lg"&&(u=K["SearchBar__Label--Large"],g=K["SearchBar--Large"],y=K["SearchBar__Tooltip--Large"]);const C=f.useCallback(k=>{c&&(d(k?.length),c(k))},[c]);return a.jsxs("div",{className:r==="top"?K["SearchBar--TopLabel"]:K["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(x.Input.Label,{required:t,className:u,children:e}),o&&a.jsx(x.Tooltip,{label:o,position:l,children:a.jsx("div",{className:y,children:a.jsx(h.IconInfoCircle,{size:n==="sm"?14:n==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:K.SearchBar__Wrapper,children:a.jsx(x.Autocomplete,{...m,size:n,error:s,className:g,onChange:C,leftSection:a.jsx(h.IconSearch,{size:n==="sm"?16:n==="lg"?24:20}),rightSection:p&&_>0?a.jsx("div",{className:K.SearchBar__ClearButton,onClick:p,children:a.jsx(h.IconX,{size:n==="sm"?16:n==="lg"?24:20})}):void 0})}),i&&a.jsx(x.Input.Description,{className:K.SearchBar__Description,children:i}),s&&a.jsx(x.Input.Error,{className:K.SearchBar__ErrorMsg,children:s})]})]})},Te={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},Rt=({size:e="md",radius:r=h.BorderRadius150,...n})=>{let t=Te["SegmentButton--Medium"];return e==="sm"?t=Te["SegmentButton--Small"]:e==="lg"&&(t=Te["SegmentButton--Large"]),a.jsx(x.SegmentedControl,{className:t,size:e,radius:r,withItemsBorders:!1,...n})},Je={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},er=({tabList:e=[],containerPaddingTop:r,...n})=>a.jsxs(x.Tabs,{...n,children:[a.jsx(x.Tabs.List,{className:Je.Tab__TitleList,children:e?.map((t,o)=>a.jsxs(x.Tabs.Tab,{value:t.value,leftSection:t.icon,children:[t.title,a.jsx("div",{className:Je.Tab__BorderBottom})]},`tab_${o}`))}),e?.map((t,o)=>a.jsx(x.Tabs.Panel,{value:t.value,pt:r,children:t.body},`tab_panel_${o}`))]}),j={"TextField--LeftLabel":"styles-module__TextField--LeftLabel___hiNn3","TextField--TopLabel":"styles-module__TextField--TopLabel___V2otc","TextField__Label--Small":"styles-module__TextField__Label--Small___NkKKA","TextField__Label--Medium":"styles-module__TextField__Label--Medium___IoJd-","TextField__Label--Large":"styles-module__TextField__Label--Large___GMy74","TextField__Tooltip--Small":"styles-module__TextField__Tooltip--Small___GmQHE","TextField__Tooltip--Medium":"styles-module__TextField__Tooltip--Medium___5P3nA","TextField__Tooltip--Large":"styles-module__TextField__Tooltip--Large___YSCfu",TextField__Wrapper:"styles-module__TextField__Wrapper___u6p5Z",TextField__TextCounter:"styles-module__TextField__TextCounter___u1jM5","TextField--Textarea":"styles-module__TextField--Textarea___C2DL5","TextField--Small":"styles-module__TextField--Small___iuH4t","TextField--Medium":"styles-module__TextField--Medium___snYod","TextField--Large":"styles-module__TextField--Large___JoSYk",TextField__Description:"styles-module__TextField__Description___J-kXP",TextField__ErrorMsg:"styles-module__TextField__ErrorMsg___fa6f6",TextField__ClearButton:"styles-module__TextField__ClearButton___bB5Ew"},tr=e=>typeof e=="string"?e.length:typeof e=="number"?String(e).length:Array.isArray(e)?e.join("").length:0,rr=e=>{const{label:r,labelPosition:n="top",size:t="md",required:o,tooltip:l,tooltipPosition:s="top",errorMsg:i,description:c,textarea:p=!1,maxTextCount:m,onChange:_,onClear:d,...u}=e,g="minRows"in e?e.minRows:void 0,{value:y,defaultValue:C,...k}=u,M=y!==void 0,[P,F]=f.useState(String(y??C??"")),H=M?y:P,G=tr(H);let Z=j["TextField__Label--Medium"],E=j["TextField--Medium"],w=j["TextField__Tooltip--Medium"];t==="sm"?(Z=j["TextField__Label--Small"],E=j["TextField--Small"],w=j["TextField__Tooltip--Small"]):t==="lg"&&(Z=j["TextField__Label--Large"],E=j["TextField--Large"],w=j["TextField__Tooltip--Large"]);const S=f.useCallback($=>{const b=$.currentTarget.value;m&&b.length>m||(M||F(b),_&&_($))},[M,m,_]),N=f.useCallback(()=>{M||F(""),d?.()},[M,d]);return a.jsxs("div",{className:n==="top"?j["TextField--TopLabel"]:j["TextField--LeftLabel"],children:[a.jsxs("div",{children:[r&&a.jsx(x.Input.Label,{required:o,className:Z,children:r}),l&&a.jsx(x.Tooltip,{label:l,position:s,children:a.jsx("div",{className:w,children:a.jsx(h.IconInfoCircle,{size:t==="sm"?14:t==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:j.TextField__Wrapper,children:[p?a.jsx(x.Textarea,{className:j["TextField--Textarea"],size:t,minRows:g,error:i,onChange:S,value:H,...k}):a.jsx(x.Input,{className:E,error:i,onChange:S,value:H,rightSection:d&&G>0?a.jsx("button",{type:"button",className:j.TextField__ClearButton,"aria-label":"입력 내용 지우기",onClick:N,children:a.jsx(h.IconX,{size:t==="sm"?16:t==="lg"?24:20})}):void 0,...k}),m&&m>0&&a.jsx("span",{className:j.TextField__TextCounter,children:`${G}/${m}`})]}),c&&a.jsx(x.Input.Description,{className:j.TextField__Description,children:c}),i&&a.jsx(x.Input.Error,{className:j.TextField__ErrorMsg,children:i})]})]})},we={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},nr=({size:e="md",...r})=>{const n=f.useRef(null);let t=we["TimePicker--Medium"],o=18;return e==="sm"?(t=we["TimePicker--Small"],o=14):e==="lg"&&(t=we["TimePicker--Large"],o=24),a.jsx(ye.TimeInput,{ref:n,className:t,size:e,...r,rightSection:a.jsx(x.ActionIcon,{bg:"transparent",onClick:()=>{n.current?.showPicker?.()},children:a.jsx(h.IconClock,{size:o})})})},Ie={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},or=({size:e="md",labelPosition:r="right",disabled:n,checked:t,defaultChecked:o,onChange:l,...s})=>{const i=t!==void 0,[c,p]=f.useState(o??!1),m=i?t:c;let _=Ie["Toggle--Medium"],d=50;e==="sm"?(_=Ie["Toggle--Small"],d=38):e==="lg"&&(_=Ie["Toggle--Large"],d=67);const u=f.useCallback(g=>{l&&l(g),i||p(g?.target?.checked)},[i,l]);return a.jsx(x.Switch,{className:_,size:e,labelPosition:r,disabled:n,checked:t,defaultChecked:o,onChange:u,styles:()=>({track:{backgroundColor:!n&&m?`${h.ColorAqua500} !important`:void 0,borderColor:!n&&m?`${h.ColorAqua500} !important`:void 0,width:d}}),...s})},ve={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},ar=({title:e,content:r,maw:n=280,multiline:t=!0,...o})=>a.jsx(x.Tooltip,{...o,maw:n,multiline:t,label:a.jsxs("div",{className:ve.Tooltip__Body,children:[e&&a.jsx("span",{className:ve.Tooltip__Title,children:e}),a.jsx("span",{className:ve.Tooltip__Content,children:r})]})}),sr=e=>{const{name:r,icon:n}=e;return`
|
|
1
|
+
(function(k,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("@mantine/dates"),require("@pop-ui/foundation"),require("dayjs"),require("dayjs/locale/ko.js"),require("react"),require("dayjs/plugin/customParseFormat.js"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@mantine/dropzone"),require("react-easy-crop"),require("@dnd-kit/utilities"),require("@mantine/notifications")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","@mantine/dates","@pop-ui/foundation","dayjs","dayjs/locale/ko.js","react","dayjs/plugin/customParseFormat.js","@dnd-kit/core","@dnd-kit/sortable","@mantine/dropzone","react-easy-crop","@dnd-kit/utilities","@mantine/notifications"],a):(k=typeof globalThis<"u"?globalThis:k||self,a(k.Core={},k.jsxRuntime,k.MantineCore,k.dates,k.foundation,k.dayjs,null,k.React,k.customParseFormat,k.core$1,k.sortable,k.dropzone,k.Cropper,k.utilities,k.notifications))})(this,function(k,a,x,ye,h,Y,Dr,f,lt,oe,ne,Ce,it,Ae,ue){"use strict";const ct={sm:14,md:16,lg:18},U={Button:"styles-module__Button___7ywU9",Button__Inner:"styles-module__Button__Inner___s7vuY",Button__Label:"styles-module__Button__Label___xnZNh",Button__Section:"styles-module__Button__Section___7GPRl",Button__Loader:"styles-module__Button__Loader___AZg1v","Button--Small":"styles-module__Button--Small___9VzCE","Button--Medium":"styles-module__Button--Medium___35lhd","Button--Large":"styles-module__Button--Large___fbUio","Button--Primary":"styles-module__Button--Primary___1ZKgs",Button__Disabled:"styles-module__Button__Disabled___NUWy8","Button--PrimaryLine":"styles-module__Button--PrimaryLine___76iyF","Button--Basic":"styles-module__Button--Basic___sWKzj","Button--Warning":"styles-module__Button--Warning___8gZ6-","Button--Setting":"styles-module__Button--Setting___KNjZA","Button--Danger":"styles-module__Button--Danger___m9tbm","Button--Ghost":"styles-module__Button--Ghost___-zzS-"},ke={inner:U.Button__Inner,label:U.Button__Label,section:U.Button__Section,loader:U.Button__Loader},_t={sm:U["Button--Small"],md:U["Button--Medium"],lg:U["Button--Large"]},dt={primary:U["Button--Primary"],primaryLine:U["Button--PrimaryLine"],basic:U["Button--Basic"],danger:U["Button--Danger"],setting:U["Button--Setting"],warning:U["Button--Warning"],ghost:U["Button--Ghost"]},ut=(...e)=>e.filter(Boolean).join(" ")||void 0,pt=e=>{const r=(o,t)=>{const n=Object.keys(o).reduce((l,s)=>{const i=s,_=[o[i],t[i]].filter(Boolean).join(" ");return _&&(l[i]=_),l},{});return Object.keys(t).forEach(l=>{const s=l;!(s in o)&&t[s]&&(n[s]=t[s])}),n};return typeof e=="function"?(o,t,n)=>r(ke,e(o,t,n)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(ke,e):ke};function de({children:e,size:r="md",variant:o="primary",type:t="button",isLoading:n=!1,loading:l=!1,hideLabelOnLoading:s=!0,disabled:i=!1,className:_,classNames:u,loaderProps:p,...c}){const m=ct[r],d=n||l,g=i||d;return a.jsxs(x.Button,{type:t,unstyled:!0,className:ut(U.Button,i?U.Button__Disabled:"",_t[r],dt[o],_),classNames:pt(u),disabled:g,...c,children:[d&&a.jsx(x.Loader,{color:"currentColor",size:m,...p}),a.jsx("span",{className:U.Button__Label,children:d&&s?null:e})]})}const De={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},mt={sm:De["Checkbox--Small"],md:De["Checkbox--Medium"],lg:De["Checkbox--Large"]},ft={sm:18,md:24,lg:32},ht=({size:e="md",...r})=>{const o=mt[e],t=ft[e];return a.jsx(x.Checkbox,{className:o,size:e,styles:{inner:{width:t,height:t}},...r})},K={CalendarDatePicker__Wrapper:"styles-module__CalendarDatePicker__Wrapper___n4ux3",CalendarDatePicker__DayContent:"styles-module__CalendarDatePicker__DayContent___2xr8Q",CalendarDatePicker__DayLabel:"styles-module__CalendarDatePicker__DayLabel___-4E1W",CalendarDatePicker__TodayIndicator:"styles-module__CalendarDatePicker__TodayIndicator___ij6hs",CalendarDatePicker__Day:"styles-module__CalendarDatePicker__Day___eYyiw",CalendarDatePicker__Header:"styles-module__CalendarDatePicker__Header___hGYbK",CalendarDatePicker__HeaderLevel:"styles-module__CalendarDatePicker__HeaderLevel___yuhOQ",CalendarDatePicker__HeaderControl:"styles-module__CalendarDatePicker__HeaderControl___gz5tC",CalendarDatePicker__HeaderControlIcon:"styles-module__CalendarDatePicker__HeaderControlIcon___OVuQp",CalendarDatePicker__Month:"styles-module__CalendarDatePicker__Month___8-Nvy",CalendarDatePicker__MonthRow:"styles-module__CalendarDatePicker__MonthRow___PihZV",CalendarDatePicker__MonthCell:"styles-module__CalendarDatePicker__MonthCell___bEPui",CalendarDatePicker__WeekdaysRow:"styles-module__CalendarDatePicker__WeekdaysRow___lbdgy",CalendarDatePicker__Weekday:"styles-module__CalendarDatePicker__Weekday___-Seq9"},gt=({excludedDays:e=[],excludedDates:r=[]})=>{const o=[],t=[];for(const s of r)typeof s=="string"?o.push(s):t.push(s);const n=o.map(s=>Y(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[Y(s),Y(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=Y(s);if(!i.isValid())return!1;if(Array.isArray(e)&&e.includes(i.day())||n.includes(i.format("YYYY-MM-DD")))return!0;for(const[_,u]of l)if((i.isSame(_,"day")||i.isAfter(_,"day"))&&(i.isSame(u,"day")||i.isBefore(u,"day")))return!0;return!1}},yt=(e,r,o,t)=>{const n=Y(e),l=Y(r);for(const s of o)if(Array.isArray(s)){const i=Y(s[0]),_=Y(s[1]);if(!i.isValid()||!_.isValid())continue;if(!(l.isBefore(i,"day")||n.isAfter(_,"day")))return!0}for(const s of o)if(typeof s=="string"){const i=Y(s);if(!i.isValid())continue;if((i.isSame(n,"day")||i.isAfter(n,"day"))&&(i.isSame(l,"day")||i.isBefore(l,"day")))return!0}if(t.length>0){let s=n;for(;s.isBefore(l,"day")||s.isSame(l,"day");){if(t.includes(s.day()))return!0;s=s.add(1,"day")}}return!1},le=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},Ne=(e="default",r)=>r==null?le(e):e==="range"?Array.isArray(r)?r:le("range"):e==="multiple"?Array.isArray(r)?r:le("multiple"):Array.isArray(r)?r[0]??null:r,Oe=({type:e,externalValue:r,internalValue:o})=>r!==void 0?Ne(e,r):o!==void 0?Ne(e,o):le(e),Pe=(e,r)=>{const o=(t,n)=>{const l=Object.keys(t).reduce((s,i)=>{const _=i,u=t[_],p=n[_],c=[u,p].filter(Boolean).join(" ");return c&&(s[_]=c),s},{});return Object.keys(n).forEach(s=>{const i=s,_=n[i];!(i in t)&&_&&(l[i]=_)}),l};return typeof r=="function"?(t,n,l)=>o(e,r(t,n,l)):typeof r=="object"&&r!==null&&!Array.isArray(r)?o(e,r):e},Ct=e=>{if(e==null)return null;if(Array.isArray(e)){for(let r=e.length-1;r>=0;r-=1){const o=e[r];if(o instanceof Date)return Y(o).format("YYYY-MM-DD")}return null}return e instanceof Date?Y(e).format("YYYY-MM-DD"):null},kt={levelsGroup:K.CalendarDatePicker__Wrapper,calendarHeader:K.CalendarDatePicker__Header,calendarHeaderLevel:K.CalendarDatePicker__HeaderLevel,calendarHeaderControl:K.CalendarDatePicker__HeaderControl,calendarHeaderControlIcon:K.CalendarDatePicker__HeaderControlIcon,month:K.CalendarDatePicker__Month,monthCell:K.CalendarDatePicker__MonthCell,day:K.CalendarDatePicker__Day,monthRow:K.CalendarDatePicker__MonthRow,weekdaysRow:K.CalendarDatePicker__WeekdaysRow,weekday:K.CalendarDatePicker__Weekday},Fe=({excludedDates:e=[],excludedDays:r=[],type:o="default",value:t,onChange:n,highlightToday:l=!1,...s})=>{const{classNames:i,date:_,defaultDate:u,onDateChange:p,getDayProps:c,...m}=s,[d,g]=f.useState(()=>t??le(o)),[C,y]=f.useState(()=>_||u||(Ct(t??le(o))??new Date)),D=f.useMemo(()=>gt({excludedDays:r,excludedDates:e}),[r,e]),P=f.useCallback(M=>{_===void 0&&y(M),p?.(M)},[_,p]),S=M=>{if(o==="range"&&Array.isArray(M)&&M.length===2){const[O,F]=M;if(O&&F&&yt(O,F,e,r)){const W=le("range");g(W),n?.(W);return}}g(M),n?.(M)},I=Oe({type:o,externalValue:t,internalValue:d}),H=f.useCallback(M=>{const O=Y(M).date(),W=Y(M).isSame(Y(),"day")&&l;return a.jsxs("span",{className:K.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:K.CalendarDatePicker__DayLabel,children:O}),W&&a.jsx("span",{className:K.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),G=Pe(kt,i),Z=_??C,V=Y(Z??new Date).format("YYYY-MM"),b=f.useCallback(M=>{const O=c?.(M)??{},F=Y(M).format("YYYY-MM")!==V;return{...O,onClick:W=>{O.onClick?.(W),F&&P(M)}}},[V,c,P]);return a.jsx(ye.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:o,previousIcon:a.jsx(h.IconChevronLeft,{}),nextIcon:a.jsx(h.IconChevronRight,{}),...m,size:"lg",onChange:S,weekendDays:[0],highlightToday:l,classNames:G,defaultDate:_===void 0?u:void 0,date:Z,onDateChange:P,getDayProps:b,value:I,excludeDate:D,renderDay:H})},T={DatePickerBase:"styles-module__DatePickerBase___yJlGe",DatePickerRoot:"styles-module__DatePickerRoot___HG6Zb","DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM",DatePicker__Wrapper:"styles-module__DatePicker__Wrapper___7X5ke",DatePicker__Input:"styles-module__DatePicker__Input___sTaqF",DatePicker__Placeholder:"styles-module__DatePicker__Placeholder___PZnzX",DatePicker__Section:"styles-module__DatePicker__Section___waCJM",DatePicker__Icon:"styles-module__DatePicker__Icon___fceRx",DatePicker__Dropdown:"styles-module__DatePicker__Dropdown___Iy9KE",DatePicker__DropdownArrow:"styles-module__DatePicker__DropdownArrow___zeIIm",DatePicker__Root:"styles-module__DatePicker__Root___2Q8qm",DatePicker__LevelsGroup:"styles-module__DatePicker__LevelsGroup___lrWsl",DatePicker__CalendarHeader:"styles-module__DatePicker__CalendarHeader___VI-Of",DatePicker__CalendarHeaderLevel:"styles-module__DatePicker__CalendarHeaderLevel___F4DtE",DatePicker__CalendarHeaderControl:"styles-module__DatePicker__CalendarHeaderControl___72yIl",DatePicker__CalendarHeaderControlIcon:"styles-module__DatePicker__CalendarHeaderControlIcon___CnQei",DatePicker__Month:"styles-module__DatePicker__Month___W7LuG",DatePicker__WeekdaysRow:"styles-module__DatePicker__WeekdaysRow___4NdYk",DatePicker__Weekday:"styles-module__DatePicker__Weekday___tL-rR",DatePicker__MonthRow:"styles-module__DatePicker__MonthRow___NSs67",DatePicker__MonthCell:"styles-module__DatePicker__MonthCell___iGYhy",DatePicker__Day:"styles-module__DatePicker__Day___7LDrl",DatePicker__TimeWrapper:"styles-module__DatePicker__TimeWrapper___BlHZZ",DatePicker__TimeInput:"styles-module__DatePicker__TimeInput___Acg-L",DatePicker__SubmitButton:"styles-module__DatePicker__SubmitButton___6DvfS"};Y.extend(lt);const Dt={wrapper:T.DatePicker__Wrapper,input:T.DatePicker__Input,section:T.DatePicker__Section,placeholder:T.DatePicker__Placeholder,datePickerRoot:T.DatePicker__Root,levelsGroup:T.DatePicker__LevelsGroup,calendarHeader:T.DatePicker__CalendarHeader,calendarHeaderLevel:T.DatePicker__CalendarHeaderLevel,calendarHeaderControl:T.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:T.DatePicker__CalendarHeaderControlIcon,month:T.DatePicker__Month,weekdaysRow:T.DatePicker__WeekdaysRow,weekday:T.DatePicker__Weekday,monthRow:T.DatePicker__MonthRow,monthCell:T.DatePicker__MonthCell,day:T.DatePicker__Day,timeWrapper:T.DatePicker__TimeWrapper,timeInput:T.DatePicker__TimeInput,submitButton:T.DatePicker__SubmitButton},Pt={dropdown:T.DatePicker__Dropdown,arrow:T.DatePicker__DropdownArrow},$e=(...e)=>e.filter(Boolean).join(" ")||void 0,me=e=>{if(e==null)return null;if(e instanceof Date)return e;if(typeof e=="string"&&e){const r=e.split("-").map(Number);if(r.length===3&&r[0]&&r[1]&&r[2])return new Date(r[0],r[1]-1,r[2])}return null},xt=({size:e="md",type:r="default",withTime:o,className:t,popoverProps:n,rightSection:l,rightSectionWidth:s,value:i,defaultValue:_,onChange:u,placeholder:p,disabled:c,minDate:m,maxDate:d,displayValueFormat:g="YYYY년 MM월 DD일",valueFormat:C,excludedDates:y,excludedDays:D,highlightToday:P})=>{const S=C??(o?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[I,H]=f.useState(!1),[G,Z]=f.useState(()=>h.parseDateValue(i??_,r,S)??le(r));let V=T["DatePicker--Medium"],b=18,M=42;e==="sm"?(V=T["DatePicker--Small"],b=14,M=34):e==="lg"&&(V=T["DatePicker--Large"],b=24,M=50);const O=Pe(Pt,n?.classNames),F=l??a.jsx("span",{"aria-hidden":"true",className:T.DatePicker__Icon,children:a.jsx(h.IconCalendar,{size:b})});if(o){const A=ee=>{if(!ee)return null;const se=Y(ee,S,!0);return se.isValid()?se.toDate():null},B=i!==void 0,v=B?A(i):null,Q=A(_);return a.jsx(ye.DateTimePicker,{className:$e(T.DatePickerBase,T.DatePickerRoot,V,t),classNames:Pe(Dt,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:F,rightSectionWidth:s??M,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:O},value:B?v:void 0,defaultValue:B?void 0:Q,onChange:ee=>{u?.(ee?Y(ee).format(S):null)},placeholder:p,disabled:c,minDate:m,maxDate:d})}const W=i!=null?h.parseDateValue(i,r,S):void 0,E=Oe({type:r,externalValue:W,internalValue:G}),w=h.formatDateDisplay(E,r,g),$=A=>{let B;if(r==="range"&&Array.isArray(A)){const v=A;B=[me(v[0]??null),me(v[1]??null)]}else r==="multiple"&&Array.isArray(A)?B=A.map(v=>me(v)).filter(v=>v!==null):B=me(A);Z(B),u?.(h.toValueString(B,r,S)),r==="default"&&B!=null&&H(!1),r==="range"&&Array.isArray(B)&&B[0]&&B[1]&&H(!1)};return a.jsx("div",{className:$e(T.DatePickerBase,T.DatePickerRoot,V,t),children:a.jsxs(x.Popover,{opened:I,onClose:()=>H(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:O,children:[a.jsx(x.Popover.Target,{children:a.jsx("div",{className:T.DatePicker__Wrapper,"data-expanded":I?!0:void 0,"data-disabled":c?!0:void 0,children:a.jsx(x.Input,{component:"button",type:"button",classNames:{input:T.DatePicker__Input,section:T.DatePicker__Section},onClick:()=>!c&&H(A=>!A),disabled:c,rightSection:F,rightSectionWidth:s??M,"data-expanded":I?!0:void 0,"data-disabled":c?!0:void 0,children:w?a.jsx("span",{children:w}):a.jsx("span",{className:T.DatePicker__Placeholder,children:p})})})}),a.jsx(x.Popover.Dropdown,{children:a.jsx(Fe,{type:r,value:E,onChange:$,excludedDates:y,excludedDays:D,highlightToday:P,minDate:m,maxDate:d})})]})})},X={"Dropdown--LeftLabel":"styles-module__Dropdown--LeftLabel___SFObq","Dropdown--TopLabel":"styles-module__Dropdown--TopLabel___-lPhr","Dropdown__Label--Small":"styles-module__Dropdown__Label--Small___xbzOR","Dropdown__Label--Medium":"styles-module__Dropdown__Label--Medium___YtJ2-","Dropdown__Label--Large":"styles-module__Dropdown__Label--Large___sCiJv","Dropdown__Tooltip--Small":"styles-module__Dropdown__Tooltip--Small___rkmaO","Dropdown__Tooltip--Medium":"styles-module__Dropdown__Tooltip--Medium___JTfzy","Dropdown__Tooltip--Large":"styles-module__Dropdown__Tooltip--Large___W-sUq","Dropdown--Small":"styles-module__Dropdown--Small___dRIK7","Dropdown--Medium":"styles-module__Dropdown--Medium___-HZoU","Dropdown--Large":"styles-module__Dropdown--Large___BvV3M",Dropdown__Description:"styles-module__Dropdown__Description___OQ8bF",Dropdown__ErrorMsg:"styles-module__Dropdown__ErrorMsg___xTP0Y"},St=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,..._})=>{const[u,p]=f.useState(!1);let c=X["Dropdown__Label--Medium"],m=X["Dropdown--Medium"],d=X["Dropdown__Tooltip--Medium"],g=18;return o==="sm"?(c=X["Dropdown__Label--Small"],m=X["Dropdown--Small"],d=X["Dropdown__Tooltip--Small"],g=14):o==="lg"&&(c=X["Dropdown__Label--Large"],m=X["Dropdown--Large"],d=X["Dropdown__Tooltip--Large"],g=24),a.jsxs("div",{className:r==="top"?X["Dropdown--TopLabel"]:X["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(x.Input.Label,{required:t,className:c,children:e}),n&&a.jsx(x.Tooltip,{label:n,position:l,children:a.jsx("div",{className:d,children:a.jsx(h.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(x.Select,{..._,size:o,error:s,className:m,rightSection:u?a.jsx(h.IconChevronUp,{size:g}):a.jsx(h.IconChevronDown,{size:g}),onDropdownOpen:()=>p(!0),onDropdownClose:()=>p(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:h.ColorGray100,color:h.ColorBlack}}}}}),i&&a.jsx(x.Input.Description,{className:X.Dropdown__Description,children:i}),s&&a.jsx(x.Input.Error,{className:X.Dropdown__ErrorMsg,children:s})]})]})},Mt=e=>({...e?{}:{content:{borderRadius:"12px"}},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:h.ColorGray900},header:{padding:"16px"},body:{paddingInline:0}}),bt=(e,r)=>{if(typeof e=="function")return e;const o=Mt(r),t={...o,...e};return Object.keys(o).forEach(n=>{t[n]={...o[n],...e?.[n]}}),t},xe=({size:e="md",width:r,withCloseButton:o=!1,fullScreen:t=!1,styles:n,...l})=>{let s=768;return e==="xs"?s=360:e==="sm"?s=544:e==="lg"?s=1e3:e==="xl"&&(s=1200),a.jsx(x.Modal,{size:r||s,fullScreen:t,styles:bt(n,t),withCloseButton:o,closeButtonProps:{icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},...l})};function fe(){return crypto.randomUUID()}function Tt(e,r,o){const t=[...e],[n]=t.splice(r,1);return t.splice(o,0,n),t}function wt(e,r,o){return o!=null&&e.length>=o?0:r!=null&&e.length<r?r-e.length:1}function It(e,r,o){return e.map(t=>{const n=t.position;return n==null?t:n===r?{...t,position:o}:r<o&&n>r&&n<=o?{...t,position:n-1}:r>o&&n>=o&&n<r?{...t,position:n+1}:t})}function vt(e,r,o){const t=[...r].sort((i,_)=>i.name.localeCompare(_.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:fe(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function Bt(e,r){const o=e.find(t=>t.id===r);return o?.url?.startsWith("blob:")&&URL.revokeObjectURL(o.url),e.filter(t=>t.id!==r)}function ze(e,r,o){return e.map(t=>t.id!==r?t:(t.url?.startsWith("blob:")&&URL.revokeObjectURL(t.url),{...t,file:o,url:URL.createObjectURL(o)}))}function Lt(e,r,o){return ze(e,r,o)}function Et(e,r,o){const t={id:fe(),file:r,url:URL.createObjectURL(r),position:o};return[...e,t]}function At(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}async function Nt(e,r){const o=e.url??"";if(!o)return null;const t=await new Promise((i,_)=>{const u=new Image;u.crossOrigin="anonymous",u.onload=()=>i(u),u.onerror=_,u.src=o}),n=document.createElement("canvas");n.width=r.width,n.height=r.height;const l=n.getContext("2d");if(!l)return null;l.drawImage(t,r.x,r.y,r.width,r.height,0,0,r.width,r.height);const s=e.file?.name??e.url?.split("/").pop()??"image";return new Promise((i,_)=>{n.toBlob(u=>{u?i(new File([u],`cropped_${s}`,{type:"image/jpeg"})):_(new Error("Failed to create blob"))},"image/jpeg")})}function Ot({item:e,isOpen:r,aspect:o=1,onClose:t,onSubmit:n}){const[l,s]=f.useState({x:0,y:0}),[i,_]=f.useState(1),[u,p]=f.useState(null),[c,m]=f.useState(!1),d=async()=>{if(!(!u||!e)){m(!0);try{const g=await Nt(e,u);g&&n(g)}finally{m(!1)}}};return a.jsx(xe,{opened:r&&!!e,onClose:t,size:"md",title:"이미지 수정",withCloseButton:!0,children:a.jsxs(x.Stack,{children:[a.jsx("div",{style:{position:"relative",height:320,background:h.ColorWhite},children:a.jsx(it,{image:e?.url??"",crop:l,zoom:i,aspect:o,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:_,onCropComplete:(g,C)=>p(C),style:{containerStyle:{backgroundColor:h.ColorWhite}}})}),a.jsxs(x.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(de,{variant:"basic",onClick:t,children:"취소"}),a.jsx(de,{variant:"primary",isLoading:c,onClick:d,children:"적용하기"})]})]})},e?.id)}const q={Container:"styles-module__Container___ZyeJM",TileContent:"styles-module__TileContent___Ofq9-",TileImage:"styles-module__TileImage___6aKmW",OverlayButton:"styles-module__OverlayButton___AYBJ0",OverlayButtonLeft:"styles-module__OverlayButtonLeft___t8SaP",OverlayButtonRight:"styles-module__OverlayButtonRight___IOvjw",PreviewControls:"styles-module__PreviewControls___iu0Yk",PreviewContent:"styles-module__PreviewContent___8f8d2",PreviewViewport:"styles-module__PreviewViewport___7-I5L",PreviewOriginal:"styles-module__PreviewOriginal___PgXTM",PlaceholderText:"styles-module__PlaceholderText___nhLhy",PlaceholderTextError:"styles-module__PlaceholderTextError___jYZ8j"},R={TileContainer:"styles-module__TileContainer___5-y01",DeleteButton:"styles-module__DeleteButton___0zsXm",Tile:"styles-module__Tile___3Cezo",TileDragOver:"styles-module__TileDragOver___e7GXF",LoadingOverlay:"styles-module__LoadingOverlay___4CyDQ",ActionBar:"styles-module__ActionBar___mJYpe",DragHandle:"styles-module__DragHandle___lzKhb",DragHandleOverlay:"styles-module__DragHandleOverlay___0nlt3",LinkButton:"styles-module__LinkButton___bISyz",DropzoneOuter:"styles-module__DropzoneOuter___BIO2N",Placeholder:"styles-module__Placeholder___q30Yw",PlaceholderError:"styles-module__PlaceholderError___fCOYe"};function he({width:e,height:r,isError:o,isLoading:t,accept:n,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:R.DropzoneOuter,children:a.jsx(Ce.Dropzone,{onDrop:s,accept:n,multiple:l,disabled:t,className:o?R.PlaceholderError:R.Placeholder,style:{width:e,height:r},children:i})})}const Ft=e=>{const{isSorting:r,wasDragging:o}=e;return r||o?!1:ne.defaultAnimateLayoutChanges(e)};function He({id:e,children:r}){const{setNodeRef:o,transform:t,transition:n,isOver:l}=ne.useSortable({id:e,animateLayoutChanges:Ft});return a.jsx("div",{ref:o,style:{transform:Ae.CSS.Transform.toString(t),transition:n,opacity:l?.7:1},children:r})}function We({id:e,totalCount:r,width:o,height:t,readOnly:n,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:_,isDragHandleOverlay:u=!1,linkUrl:p,onLinkClick:c,onDelete:m,deleteAriaLabel:d="삭제",actionBarExtra:g,onTileClick:C,onFileDrop:y,children:D}){const[P,S]=f.useState(!1),I=v=>{!y||n||l||s||v.preventDefault()},H=v=>{!y||n||l||s||(v.preventDefault(),S(!0))},G=v=>{v.currentTarget.contains(v.relatedTarget)||S(!1)},Z=v=>{if(v.preventDefault(),S(!1),!y||n||l||s)return;const Q=v.dataTransfer.files[0];Q&&y(Q)},V=v=>{const{isSorting:Q,wasDragging:ee}=v;return Q||ee?!1:ne.defaultAnimateLayoutChanges(v)},{attributes:b,listeners:M,setActivatorNodeRef:O,setNodeRef:F,transform:W,transition:E,isDragging:w}=ne.useSortable({id:e,disabled:n,animateLayoutChanges:V}),$=!n&&r>1&&a.jsx("button",{type:"button",className:u?R.DragHandleOverlay:R.DragHandle,ref:O,...b,...M,"aria-label":"드래그로 순서 변경",disabled:u&&(!!l||!!s),onClick:u?v=>v.stopPropagation():void 0,children:a.jsx(h.IconDragMenu,{size:20,color:h.ColorGray600})}),A=!u&&!!$||_&&!!p&&!!c||!!g,B=n||l||s||!C?"default":"pointer";return a.jsxs("div",{ref:F,className:R.TileContainer,style:{transform:Ae.CSS.Transform.toString(W),transition:E,opacity:w?.4:1},children:[!n&&i&&!l&&a.jsx("button",{type:"button",className:R.DeleteButton,onClick:m,"aria-label":d,children:a.jsx(h.IconXCircle,{size:24})}),a.jsxs("div",{className:`${R.Tile}${P?` ${R.TileDragOver}`:""}`,style:{width:o,height:t,cursor:B},onClick:()=>!n&&!l&&!s&&C?.(),onDragOver:I,onDragEnter:H,onDragLeave:G,onDrop:Z,children:[D,u&&$,(l||s)&&a.jsx("div",{className:R.LoadingOverlay,children:a.jsx(x.Loader,{size:o/6,color:h.ColorAqua500})})]}),A&&a.jsxs("div",{className:R.ActionBar,children:[!u&&$,_&&p&&c&&a.jsx("button",{type:"button",className:R.LinkButton,onClick:c,children:"링크"}),g]})]})}function $t({items:e,onReorder:r}){return{sensors:oe.useSensors(oe.useSensor(oe.PointerSensor,{activationConstraint:{distance:8}}),oe.useSensor(oe.KeyboardSensor,{coordinateGetter:ne.sortableKeyboardCoordinates})),handleDragEnd:n=>{const{active:l,over:s}=n;if(!s||l.id===s.id)return;const i=e.findIndex(u=>u.id===l.id),_=e.findIndex(u=>u.id===s.id);i!==-1&&_!==-1&&r(i,_)}}}const Se="__slot-";function Ye({value:e,length:r,minLength:o,maxLength:t,onChange:n}){const l=r??o,s=r??t,i=l!=null&&s!=null&&l===s,_=i?0:wt(e,l,s),u=i?Array.from({length:s},(y,D)=>`${Se}${D}`):[],p=i?u:e.map(y=>y.id),{sensors:c,handleDragEnd:m}=$t({items:e,onReorder:(y,D)=>{const P=Tt(e,y,D),S=e[y];n?.(P,{action:"reorder",itemId:S.id,index:D,previousIndex:y,nextIndex:D})}});return{isPositionMode:i,resolvedMinLength:l,resolvedMaxLength:s,placeholderCount:_,slotIds:u,sortableItems:p,sensors:c,handleDragEnd:i?y=>{const{active:D,over:P}=y;if(!P||D.id===P.id)return;const S=Number(String(D.id).replace(Se,"")),I=Number(String(P.id).replace(Se,"")),H=e.find(Z=>Z.position===S);if(!H)return;const G=It(e,S,I);n?.(G,{action:"reorder",itemId:H.id,index:I,previousIndex:S,nextIndex:I})}:m,getMetaIndex:y=>{const D=e.find(P=>P.id===y);return i&&D?D.position??0:e.findIndex(P=>P.id===y)}}}function Ze(e){if(!e)return!1;try{const r=new URL(e).protocol;return r==="http:"||r==="https:"}catch{return!1}}function zt(e){Ze(e)&&window.open(e,"_blank","noopener,noreferrer")}function Ht(e){return e?e.join(","):"image/*"}function Ve({item:e,sortableId:r,index:o,totalCount:t,width:n,height:l,accept:s,canDelete:i,hasLink:_,hasEdit:u,readOnly:p,isLoading:c,onLinkClick:m,onDelete:d,onReplace:g,onEdit:C,onPreview:y}){const D=f.useRef(null),P=m?!!e.url:Ze(e.url);return a.jsxs(We,{id:r??e.id,totalCount:t,width:n,height:l,readOnly:p,isLoading:c,itemIsLoading:e.isLoading,canDelete:i,isDragHandleOverlay:!0,hasLink:_&&P,linkUrl:e.url,onLinkClick:_&&P?()=>m?m(e):e.url&&zt(e.url):void 0,onDelete:()=>d(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>D.current?.click(),onFileDrop:S=>{if(s){if(!s.includes(S.type))return}else if(!S.type.startsWith("image/"))return;g(e.id,S)},children:[a.jsx("input",{ref:D,type:"file",accept:Ht(s),style:{display:"none"},onChange:S=>{const I=S.target.files?.[0];I&&g(e.id,I),S.target.value=""}}),a.jsxs("div",{className:q.TileContent,children:[a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${o+1}`,className:q.TileImage}),u&&!p&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonLeft}`,"aria-label":"이미지 편집",title:"편집",disabled:c||e.isLoading,onClick:S=>{S.stopPropagation(),C(e)},children:a.jsx(h.IconEdit,{size:18})}),e.url&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonRight}`,"aria-label":"이미지 확대보기",title:"크게 보기",disabled:c||e.isLoading,onClick:S=>{S.stopPropagation(),y(e)},children:a.jsx(h.IconOpenInFull,{size:18,color:h.ColorGray900})})]})]})}const Wt=({value:e=[],onChange:r,accept:o,length:t,width:n=160,height:l=200,placeholder:s="이미지를 넣어주세요",hasIcon:i=!0,hasLink:_=!1,onLinkClick:u,hasEdit:p=!1,canDelete:c=!0,minLength:m,maxLength:d,errorMsg:g,isLoading:C,readOnly:y,gap:D=8})=>{const{isPositionMode:P,resolvedMaxLength:S,placeholderCount:I,slotIds:H,sortableItems:G,sensors:Z,handleDragEnd:V,getMetaIndex:b}=Ye({value:e,length:t,minLength:m,maxLength:d,onChange:r}),M=!!g,[O,F]=f.useState(null),[W,E]=f.useState(null),w=W?e.find(N=>N.id===W.id&&N.url===W.url)??null:null;W&&!w&&E(null);const $=f.useRef(e);f.useEffect(()=>{$.current=e},[e]),f.useEffect(()=>()=>At($.current),[]);const A=N=>{if(y)return;const L=e.length,z=vt(e,N,S);z.length!==L&&r?.(z,{action:"create",itemId:z[L].id,index:L})},B=(N,L)=>{if(y)return;const z=L[0];if(!z)return;const te=Et(e,z,N);r?.(te,{action:"create",itemId:te[te.length-1].id,index:N})},v=N=>{if(y)return;const L=b(N),z=Bt(e,N);r?.(z,{action:"delete",itemId:N,index:L})},Q=(N,L)=>{if(y)return;const z=b(N),te=ze(e,N,L);r?.(te,{action:"replace",itemId:N,index:z})},ee=N=>{if(!O)return;const L=O.id,z=b(L),te=Lt(e,L,N);F(null),r?.(te,{action:"crop",itemId:L,index:z})},se=N=>{const L=typeof s=="function"?s(N):s;return typeof L!="string"?L:L.split(`
|
|
2
|
+
`).map((z,te)=>a.jsx("span",{children:z},te))};return a.jsxs("div",{children:[a.jsx(oe.DndContext,{sensors:Z,collisionDetection:oe.closestCenter,onDragEnd:V,children:a.jsx(ne.SortableContext,{items:G,strategy:ne.rectSortingStrategy,children:a.jsx("div",{className:q.Container,style:{gap:D},children:P?Array.from({length:S},(N,L)=>{const z=H[L],te=e.find(_e=>_e.position===L);return te?a.jsx(Ve,{item:te,sortableId:z,index:L,totalCount:S,width:n,height:l,accept:o,canDelete:c,hasLink:_,hasEdit:p,readOnly:y??!1,isLoading:C,onLinkClick:u,onDelete:v,onReplace:Q,onEdit:F,onPreview:_e=>{_e.url&&E({id:_e.id,url:_e.url})}},z):!y&&a.jsx(He,{id:z,children:a.jsxs(he,{onDrop:_e=>B(L,_e),accept:o??Ce.IMAGE_MIME_TYPE,multiple:!1,isLoading:C,isError:M,width:n,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:M?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${M?` ${q.PlaceholderTextError}`:""}`,children:se(L)})]})},z)}):a.jsxs(a.Fragment,{children:[e.map((N,L)=>a.jsx(Ve,{item:N,index:L,totalCount:e.length,width:n,height:l,accept:o,canDelete:c,hasLink:_,hasEdit:p,readOnly:y??!1,isLoading:C,onLinkClick:u,onDelete:v,onReplace:Q,onEdit:F,onPreview:z=>{z.url&&E({id:z.id,url:z.url})}},N.id)),!y&&Array.from({length:I},(N,L)=>a.jsxs(he,{onDrop:A,accept:o??Ce.IMAGE_MIME_TYPE,multiple:S!==1,isLoading:C,isError:M,width:n,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:M?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${M?` ${q.PlaceholderTextError}`:""}`,children:se(L)})]},`placeholder-${L}`))]})})})}),M&&a.jsx(x.Input.Error,{mt:8,children:g}),p&&a.jsx(Ot,{item:O,isOpen:!!O,onClose:()=>F(null),onSubmit:ee}),a.jsx(xe,{opened:!!w,onClose:()=>E(null),title:w?.file?.name??"이미지 미리보기",size:"xl",centered:!0,xOffset:16,yOffset:16,withCloseButton:!0,closeButtonProps:{"aria-label":"이미지 미리보기 닫기",icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},styles:{content:{flex:"0 1 auto",width:"fit-content",maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100dvh - 32px)"},body:{padding:"16px"}},children:w&&a.jsx(Yt,{item:w},`${w.id}:${w.url}`)})]})};function Yt({item:e}){const[r,o]=f.useState(!1);return a.jsxs("div",{className:q.PreviewContent,children:[a.jsxs("div",{className:q.PreviewControls,role:"group","aria-label":"이미지 크기 보기",children:[a.jsx(de,{variant:r?"basic":"primary",size:"sm","aria-label":"화면에 맞춤","aria-pressed":!r,onClick:()=>o(!1),children:"화면에 맞춤"}),a.jsx(de,{variant:r?"primary":"basic",size:"sm","aria-label":"원본 크기 (100%)","aria-pressed":r,onClick:()=>o(!0),children:"원본 크기 (100%)"})]}),a.jsx("div",{"data-size-mode":r?"original":"fit",className:`${q.PreviewViewport}${r?` ${q.PreviewOriginal}`:""}`,children:a.jsx("img",{src:e.url,alt:e.file?.name??"이미지 미리보기"})})]})}function Ue(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const r=e;return"v"in r&&"fr"in r&&"ip"in r&&"op"in r&&"w"in r&&"h"in r&&"layers"in r&&Array.isArray(r.layers)}function Me(e){return new Promise(r=>{const o=new FileReader;o.onload=t=>{try{const n=JSON.parse(t.target?.result);r(Ue(n)?n:null)}catch{r(null)}},o.onerror=()=>r(null),o.readAsText(e)})}function Zt(e,r,o){const t=[...r].sort((i,_)=>i.name.localeCompare(_.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:fe(),file:i}));return[...e,...s]}function Vt(e,r){return e.filter(o=>o.id!==r)}function Ut(e,r,o){const t={id:fe(),file:r,position:o};return[...e,t]}const ce={Container:"styles-module__Container___cJqG-",Stage:"styles-module__Stage___zAHL-",Empty:"styles-module__Empty___gexrS",PlaceholderText:"styles-module__PlaceholderText___x2ya0",PlaceholderTextError:"styles-module__PlaceholderTextError___i8VXv"},ge={Toast:"styles-module__Toast___ZqZzU",Toast__Icon:"styles-module__Toast__Icon___PWXSy",Toast__Body:"styles-module__Toast__Body___wezPs",Toast__Message:"styles-module__Toast__Message___NFsgm"},je=e=>typeof e=="string"?{message:e}:e,Ge=(e,r)=>{const{autoClose:o,icon:t,message:n}=je(e);return{id:r,message:a.jsx("div",{className:ge.Toast__Message,children:n}),icon:t,autoClose:o,classNames:{root:ge.Toast,body:ge.Toast__Body,icon:ge.Toast__Icon},withCloseButton:!1,withBorder:!1}},ie=e=>{const r=je(e);ue.notifications.show(Ge(e,r.id))};ie.update=(e,r)=>{ue.notifications.update(Ge(r,e))},ie.hide=e=>{ue.notifications.hide(e)},ie.clean=()=>{ue.notifications.clean()};const jt=f.lazy(()=>import("lottie-react").then(e=>{const r=e.default;return{default:typeof r=="function"?r:r.default}})),qe={"application/json":[".json"]};function Je({item:e,sortableId:r,totalCount:o,width:t,height:n,readOnly:l,isLoading:s,canDelete:i,hasLink:_,backgroundImage:u,onLinkClick:p,onDelete:c}){const d=!e.animationData&&!!(e.file||e.url)?`${e.id}|${e.file?`${e.file.name}:${e.file.size}`:e.url??""}`:"",[g,C]=f.useState({key:"",data:null}),y=e.animationData??(g.key===d?g.data:null),D=!!d&&g.key!==d;return f.useEffect(()=>{if(!d)return;let P=!1;return(e.file?Me(e.file):fetch(e.url).then(I=>I.json()).then(I=>Ue(I)?I:null)).then(I=>{P||C({key:d,data:I})}).catch(()=>{P||C({key:d,data:null})}),()=>{P=!0}},[d,e.file,e.url]),a.jsx(We,{id:r??e.id,totalCount:o,width:t,height:n,readOnly:l,isLoading:s,itemIsLoading:e.isLoading||D,canDelete:i,hasLink:_,linkUrl:e.url,onLinkClick:p?()=>p(e):void 0,onDelete:()=>c(e.id),deleteAriaLabel:"Lottie 삭제",children:a.jsx("div",{className:ce.Stage,style:u?{backgroundImage:`url(${JSON.stringify(u)})`}:void 0,children:y?a.jsx(f.Suspense,{fallback:a.jsx("div",{style:{width:t,height:n,display:"block"}}),children:a.jsx(jt,{animationData:y,loop:!0,autoplay:!0,style:{width:t,height:n,display:"block"}})}):a.jsx("div",{className:u?void 0:ce.Empty,style:{width:t,height:n}})})})}const Gt=({value:e=[],onChange:r,width:o=160,height:t=200,placeholder:n="Lottie JSON 파일을 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,length:_,minLength:u,maxLength:p,errorMsg:c,isLoading:m,readOnly:d,gap:g=8,canDelete:C=!0,backgroundImage:y})=>{const{isPositionMode:D,resolvedMaxLength:P,placeholderCount:S,slotIds:I,sortableItems:H,sensors:G,handleDragEnd:Z,getMetaIndex:V}=Ye({value:e,length:_,minLength:u,maxLength:p,onChange:r}),b=!!c,M=async E=>{if(d)return;const w=[...E].sort((ee,se)=>ee.name.localeCompare(se.name)),$=await Promise.all(w.map(Me));let A=0;const B=w.filter((ee,se)=>$[se]!==null?!0:(A++,!1));if(A>0&&ie({id:"invalid-lottie-files",message:A===1?"유효하지 않은 Lottie JSON 파일입니다":`${A}개의 파일이 유효하지 않은 Lottie JSON입니다`}),B.length===0)return;const v=e.length,Q=Zt(e,B,P);Q.length!==v&&r?.(Q,{action:"create",itemId:Q[v].id,index:v})},O=async(E,w)=>{if(d)return;const $=w[0];if(!$)return;if(!await Me($)){ie({id:"invalid-lottie-files",message:"유효하지 않은 Lottie JSON 파일입니다"});return}const B=Ut(e,$,E);r?.(B,{action:"create",itemId:B[B.length-1].id,index:E})},F=E=>{if(d)return;const w=V(E),$=Vt(e,E);r?.($,{action:"delete",itemId:E,index:w})},W=E=>{const w=typeof n=="function"?n(E):n;return typeof w!="string"?w:w.split(`
|
|
3
|
+
`).map(($,A)=>a.jsx("span",{children:$},A))};return a.jsxs("div",{children:[a.jsx(oe.DndContext,{sensors:G,collisionDetection:oe.closestCenter,onDragEnd:Z,children:a.jsx(ne.SortableContext,{items:H,strategy:ne.rectSortingStrategy,children:a.jsx("div",{className:ce.Container,style:{gap:g},children:D?Array.from({length:P},(E,w)=>{const $=I[w],A=e.find(B=>B.position===w);return A?a.jsx(Je,{item:A,sortableId:$,totalCount:P,width:o,height:t,readOnly:d??!1,isLoading:m,canDelete:C,hasLink:s,backgroundImage:y,onLinkClick:i,onDelete:F},$):!d&&a.jsx(He,{id:$,children:a.jsxs(he,{onDrop:B=>O(w,B),accept:qe,multiple:!1,isLoading:m,isError:b,width:o,height:t,children:[l&&a.jsx(h.IconPhoto,{size:36,color:b?h.ColorRed700:h.ColorAqua700}),n&&a.jsx("div",{className:`${ce.PlaceholderText}${b?` ${ce.PlaceholderTextError}`:""}`,children:W(w)})]})},$)}):a.jsxs(a.Fragment,{children:[e.map(E=>a.jsx(Je,{item:E,totalCount:e.length,width:o,height:t,readOnly:d??!1,isLoading:m,canDelete:C,hasLink:s,backgroundImage:y,onLinkClick:i,onDelete:F},E.id)),!d&&Array.from({length:S},(E,w)=>a.jsxs(he,{onDrop:M,accept:qe,multiple:P!==1,isLoading:m,isError:b,width:o,height:t,children:[l&&a.jsx(h.IconPhoto,{size:36,color:b?h.ColorRed700:h.ColorAqua700}),n&&a.jsx("div",{className:`${ce.PlaceholderText}${b?` ${ce.PlaceholderTextError}`:""}`,children:W(w)})]},`placeholder-${w}`))]})})})}),b&&a.jsx(x.Input.Error,{mt:8,children:c})]})},pe={Pagination:"style-module__Pagination___xcR-Q",Pagination__PageIndex:"style-module__Pagination__PageIndex___50SZJ","Pagination__PageIndex--Active":"style-module__Pagination__PageIndex--Active___mSIwS",Pagination__Arrow:"style-module__Pagination__Arrow___74vp3"},qt=({currentPageIdx:e,rowsPerPage:r,totalLength:o,paginationSize:t,onPageChange:n,...l})=>{const[s,i]=f.useState(e),_=r||50,u=o||1,p=t||5;f.useEffect(()=>{i(e)},[e]);const c=()=>{n&&n(s-(s%p+1)),i(d=>d-(d%p+1))},m=()=>{n&&n(s+p-s%p),i(d=>d+p-d%p)};return a.jsxs("div",{...l,className:pe.Pagination,children:[s>=p?a.jsx("button",{className:pe.Pagination__Arrow,onClick:c,children:a.jsx(h.IconChevronLeft,{size:20})}):null,new Array(p).fill(0).map((d,g)=>{const C=Math.floor(s/p)*p+g+1;if(!(C>Math.ceil(u/_)))return a.jsx("button",{className:s===C-1?pe["Pagination__PageIndex--Active"]:pe.Pagination__PageIndex,onClick:()=>{i(C-1),n&&n(C-1)},children:C},`pagination_${g}`)}),Math.floor(s/p)*p+p<Math.ceil(u/_)?a.jsx("button",{className:pe.Pagination__Arrow,onClick:m,children:a.jsx(h.IconChevronRight,{size:20})}):null]})},be={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Jt={sm:be["Radio--Small"],md:be["Radio--Medium"],lg:be["Radio--Large"]},Kt={sm:18,md:24,lg:32},Xt=({size:e="md",...r})=>{const o=Jt[e],t=Kt[e];return a.jsx(x.Radio,{className:o,size:e,styles:{inner:{width:t,height:t}},...r})},J={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},Qt=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,onChange:_,onClear:u,...p})=>{const[c,m]=f.useState(0);let d=J["SearchBar__Label--Medium"],g=J["SearchBar--Medium"],C=J["SearchBar__Tooltip--Medium"];o==="sm"?(d=J["SearchBar__Label--Small"],g=J["SearchBar--Small"],C=J["SearchBar__Tooltip--Small"]):o==="lg"&&(d=J["SearchBar__Label--Large"],g=J["SearchBar--Large"],C=J["SearchBar__Tooltip--Large"]);const y=f.useCallback(D=>{_&&(m(D?.length),_(D))},[_]);return a.jsxs("div",{className:r==="top"?J["SearchBar--TopLabel"]:J["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(x.Input.Label,{required:t,className:d,children:e}),n&&a.jsx(x.Tooltip,{label:n,position:l,children:a.jsx("div",{className:C,children:a.jsx(h.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:J.SearchBar__Wrapper,children:a.jsx(x.Autocomplete,{...p,size:o,error:s,className:g,onChange:y,leftSection:a.jsx(h.IconSearch,{size:o==="sm"?16:o==="lg"?24:20}),rightSection:u&&c>0?a.jsx("div",{className:J.SearchBar__ClearButton,onClick:u,children:a.jsx(h.IconX,{size:o==="sm"?16:o==="lg"?24:20})}):void 0})}),i&&a.jsx(x.Input.Description,{className:J.SearchBar__Description,children:i}),s&&a.jsx(x.Input.Error,{className:J.SearchBar__ErrorMsg,children:s})]})]})},Te={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},Rt=({size:e="md",radius:r=h.BorderRadius150,...o})=>{let t=Te["SegmentButton--Medium"];return e==="sm"?t=Te["SegmentButton--Small"]:e==="lg"&&(t=Te["SegmentButton--Large"]),a.jsx(x.SegmentedControl,{className:t,size:e,radius:r,withItemsBorders:!1,...o})},Ke={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},er=({tabList:e=[],containerPaddingTop:r,...o})=>a.jsxs(x.Tabs,{...o,children:[a.jsx(x.Tabs.List,{className:Ke.Tab__TitleList,children:e?.map((t,n)=>a.jsxs(x.Tabs.Tab,{value:t.value,leftSection:t.icon,children:[t.title,a.jsx("div",{className:Ke.Tab__BorderBottom})]},`tab_${n}`))}),e?.map((t,n)=>a.jsx(x.Tabs.Panel,{value:t.value,pt:r,children:t.body},`tab_panel_${n}`))]}),j={"TextField--LeftLabel":"styles-module__TextField--LeftLabel___hiNn3","TextField--TopLabel":"styles-module__TextField--TopLabel___V2otc","TextField__Label--Small":"styles-module__TextField__Label--Small___NkKKA","TextField__Label--Medium":"styles-module__TextField__Label--Medium___IoJd-","TextField__Label--Large":"styles-module__TextField__Label--Large___GMy74","TextField__Tooltip--Small":"styles-module__TextField__Tooltip--Small___GmQHE","TextField__Tooltip--Medium":"styles-module__TextField__Tooltip--Medium___5P3nA","TextField__Tooltip--Large":"styles-module__TextField__Tooltip--Large___YSCfu",TextField__Wrapper:"styles-module__TextField__Wrapper___u6p5Z",TextField__TextCounter:"styles-module__TextField__TextCounter___u1jM5","TextField--Textarea":"styles-module__TextField--Textarea___C2DL5","TextField--Small":"styles-module__TextField--Small___iuH4t","TextField--Medium":"styles-module__TextField--Medium___snYod","TextField--Large":"styles-module__TextField--Large___JoSYk",TextField__Description:"styles-module__TextField__Description___J-kXP",TextField__ErrorMsg:"styles-module__TextField__ErrorMsg___fa6f6",TextField__ClearButton:"styles-module__TextField__ClearButton___bB5Ew"},tr=e=>typeof e=="string"?e.length:typeof e=="number"?String(e).length:Array.isArray(e)?e.join("").length:0,rr=e=>{const{label:r,labelPosition:o="top",size:t="md",required:n,tooltip:l,tooltipPosition:s="top",errorMsg:i,description:_,textarea:u=!1,maxTextCount:p,onChange:c,onClear:m,...d}=e,g="minRows"in e?e.minRows:void 0,{value:C,defaultValue:y,...D}=d,P=C!==void 0,[S,I]=f.useState(String(C??y??"")),H=P?C:S,G=tr(H);let Z=j["TextField__Label--Medium"],V=j["TextField--Medium"],b=j["TextField__Tooltip--Medium"];t==="sm"?(Z=j["TextField__Label--Small"],V=j["TextField--Small"],b=j["TextField__Tooltip--Small"]):t==="lg"&&(Z=j["TextField__Label--Large"],V=j["TextField--Large"],b=j["TextField__Tooltip--Large"]);const M=f.useCallback(F=>{const W=F.currentTarget.value;p&&W.length>p||(P||I(W),c&&c(F))},[P,p,c]),O=f.useCallback(()=>{P||I(""),m?.()},[P,m]);return a.jsxs("div",{className:o==="top"?j["TextField--TopLabel"]:j["TextField--LeftLabel"],children:[a.jsxs("div",{children:[r&&a.jsx(x.Input.Label,{required:n,className:Z,children:r}),l&&a.jsx(x.Tooltip,{label:l,position:s,children:a.jsx("div",{className:b,children:a.jsx(h.IconInfoCircle,{size:t==="sm"?14:t==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:j.TextField__Wrapper,children:[u?a.jsx(x.Textarea,{className:j["TextField--Textarea"],size:t,minRows:g,error:i,onChange:M,value:H,...D}):a.jsx(x.Input,{className:V,error:i,onChange:M,value:H,rightSection:m&&G>0?a.jsx("button",{type:"button",className:j.TextField__ClearButton,"aria-label":"입력 내용 지우기",onClick:O,children:a.jsx(h.IconX,{size:t==="sm"?16:t==="lg"?24:20})}):void 0,...D}),p&&p>0&&a.jsx("span",{className:j.TextField__TextCounter,children:`${G}/${p}`})]}),_&&a.jsx(x.Input.Description,{className:j.TextField__Description,children:_}),i&&a.jsx(x.Input.Error,{className:j.TextField__ErrorMsg,children:i})]})]})},we={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},or=({size:e="md",...r})=>{const o=f.useRef(null);let t=we["TimePicker--Medium"],n=18;return e==="sm"?(t=we["TimePicker--Small"],n=14):e==="lg"&&(t=we["TimePicker--Large"],n=24),a.jsx(ye.TimeInput,{ref:o,className:t,size:e,...r,rightSection:a.jsx(x.ActionIcon,{bg:"transparent",onClick:()=>{o.current?.showPicker?.()},children:a.jsx(h.IconClock,{size:n})})})},Ie={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},nr=({size:e="md",labelPosition:r="right",disabled:o,checked:t,defaultChecked:n,onChange:l,...s})=>{const i=t!==void 0,[_,u]=f.useState(n??!1),p=i?t:_;let c=Ie["Toggle--Medium"],m=50;e==="sm"?(c=Ie["Toggle--Small"],m=38):e==="lg"&&(c=Ie["Toggle--Large"],m=67);const d=f.useCallback(g=>{l&&l(g),i||u(g?.target?.checked)},[i,l]);return a.jsx(x.Switch,{className:c,size:e,labelPosition:r,disabled:o,checked:t,defaultChecked:n,onChange:d,styles:()=>({track:{backgroundColor:!o&&p?`${h.ColorAqua500} !important`:void 0,borderColor:!o&&p?`${h.ColorAqua500} !important`:void 0,width:m}}),...s})},ve={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},ar=({title:e,content:r,maw:o=280,multiline:t=!0,...n})=>a.jsx(x.Tooltip,{...n,maw:o,multiline:t,label:a.jsxs("div",{className:ve.Tooltip__Body,children:[e&&a.jsx("span",{className:ve.Tooltip__Title,children:e}),a.jsx("span",{className:ve.Tooltip__Content,children:r})]})}),sr=e=>{const{name:r,icon:o}=e;return`
|
|
4
4
|
<div class="pin-marker">
|
|
5
|
-
${
|
|
5
|
+
${o?`<img src="${o}" alt="${r}" width="40" height="40" />`:`
|
|
6
6
|
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<g>
|
|
8
8
|
<path d="M18.7686 1.26235C11.6407 0.936128 5.75293 6.62941 5.75293 13.6913C5.75293 22.565 11.76 30.0415 15.1594 33.4869C16.8117 35.1766 19.5261 35.1761 21.1779 33.4854C24.318 30.2845 29.8102 23.653 30.5636 15.5539L30.5637 15.5531C31.2237 8.38935 26.1199 1.59187 18.7686 1.26235ZM18.7686 1.26235L18.7229 2.26131L18.7676 1.2623C18.768 1.26232 18.7683 1.26234 18.7686 1.26235Z" fill="#FF6C6C" stroke="white" stroke-width="2" stroke-miterlimit="10"/>
|
|
@@ -12,28 +12,28 @@
|
|
|
12
12
|
`}
|
|
13
13
|
<div class="pin-marker-name">${r}</div>
|
|
14
14
|
</div>
|
|
15
|
-
`},lr=e=>{const{discountRate:r,price:
|
|
15
|
+
`},lr=e=>{const{discountRate:r,price:o,originalPrice:t,category:n,active:l,title:s}=e;return`
|
|
16
16
|
<div class="popdeal-marker" active="${!!l}">
|
|
17
17
|
<div class="popdeal-marker-section">
|
|
18
18
|
<div class="popdeal-marker-section-header">
|
|
19
19
|
<span class="popdeal-marker-title">${s}</span>
|
|
20
|
-
${
|
|
20
|
+
${n?`<span class="popdeal-marker-category">${n}</span>`:""}
|
|
21
21
|
</div>
|
|
22
22
|
<div class="popdeal-marker-section-price">
|
|
23
23
|
${t?`<span class="popdeal-marker-original_price">${t.toLocaleString()}원</span>`:""}
|
|
24
24
|
${r?`<span class="popdeal-marker-discount_rate">${r}%</span>`:""}
|
|
25
|
-
<span class="popdeal-marker-discounted_price">${
|
|
25
|
+
<span class="popdeal-marker-discounted_price">${o.toLocaleString()}원</span>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
|
-
`},ir=e=>{const{title:r,icon:
|
|
29
|
+
`},ir=e=>{const{title:r,icon:o}=e;return`
|
|
30
30
|
<div class="pi-marker">
|
|
31
|
-
${
|
|
31
|
+
${o?`<img class="pi-marker-icon" src="${o}" alt="" width="32px" height="32px" />`:""}
|
|
32
32
|
<span class="pi-marker-text">${r}</span>
|
|
33
33
|
</div>
|
|
34
|
-
`},cr=e=>{const{title:r,icon:
|
|
34
|
+
`},cr=e=>{const{title:r,icon:o,address:t}=e;return`
|
|
35
35
|
<div class="pi-expanded-marker">
|
|
36
|
-
${
|
|
36
|
+
${o?`<img class="pi-expanded-marker-icon" src="${o}" alt="" width="32px" height="32px" />`:""}
|
|
37
37
|
<div class="pi-expanded-marker-content">
|
|
38
38
|
<div class="pi-expanded-marker-title">${r}</div>
|
|
39
39
|
${t?`<div class="pi-expanded-marker-address">${t}</div>`:""}
|
|
@@ -318,13 +318,13 @@
|
|
|
318
318
|
background: #00C4C4;
|
|
319
319
|
transform: translate(-50%) rotate(45deg);
|
|
320
320
|
}
|
|
321
|
-
`,Qe=f.createContext(null),Re="naver-map-script",dr=(e,r)=>new Promise((n,t)=>{if(typeof window<"u"&&window.naver?.maps){n();return}const o=document.getElementById(Re);if(o){o.addEventListener("load",()=>n()),o.addEventListener("error",()=>t(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=Re,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${e}&language=${r}`,l.async=!0,l.onload=()=>{n()},l.onerror=()=>{t(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),et=({clientId:e,language:r="ko",children:n})=>{const[t,o]=f.useState(null),[l,s]=f.useState({}),[i,c]=f.useState(null);f.useEffect(()=>{typeof window>"u"||dr(e,r).then(()=>{window.naver&&o(window.naver)}).catch(m=>{console.error("Naver Map script loading failed:",m),c(m)})},[e,r]);const p=f.useCallback((m,_)=>{const d=t||(typeof window<"u"?window.naver:null);if(!d||(!t&&window.naver&&o(window.naver),!m.current))return null;const u=m.current;if(!u.isConnected)return null;try{const g={center:new d.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,..._},y=new d.maps.Map(u,g);return s(C=>{const k=u.getAttribute("id")||"default";return{...C,[k]:y}}),y}catch(g){return console.error("Map creation error:",g),null}},[t]);return i&&console.error("NaverMapProvider error:",i),a.jsx(Qe.Provider,{value:{naver:t,createMap:p,maps:l},children:n})},Le=()=>{const e=f.useContext(Qe);if(!e)throw new Error("useNaverMap must be used within NaverMapProvider");return e};function tt(e){const r=function(t){this.DEFAULT_OPTIONS={map:null,markers:[],disableClickZoom:!0,minClusterSize:2,maxZoom:13,gridSize:100,icons:[],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:function(){}},this._clusters=[],this._mapRelations=null,this._markerRelations=[],this.setOptions(e.maps.Util.extend({},this.DEFAULT_OPTIONS,t),!0),this.setMap(t.map||null)};e.maps.Util.ClassExtend(r,e.maps.OverlayView,{onAdd:function(){const t=this.getMap();this._mapRelations=e.maps.Event.addListener(t,"idle",e.maps.Util.bind(this._onIdle,this)),this.getMarkers().length>0&&(this._createClusters(),this._updateClusters())},draw:e.maps.Util.noop,onRemove:function(){e.maps.Event.removeListener(this._mapRelation),this._clearClusters(),this._geoTree=null,this._mapRelation=null},setOptions:function(t){const o=this;if(typeof t=="string"){const l=t,s=arguments[1];o.set(l,s)}else{const l=arguments[1];e.maps.Util.forEach(t,function(s,i){i!=="map"&&o.set(i,s)}),t.map&&!l&&o.setMap(t.map)}},getOptions:function(t){const o=this,l={};return t!==void 0?o.get(t):(e.maps.Util.forEach(o.DEFAULT_OPTIONS,function(s,i){l[i]=o.get(i)}),l)},getMinClusterSize:function(){return this.getOptions("minClusterSize")},setMinClusterSize:function(t){this.setOptions("minClusterSize",t)},getMaxZoom:function(){return this.getOptions("maxZoom")},setMaxZoom:function(t){this.setOptions("maxZoom",t)},getGridSize:function(){return this.getOptions("gridSize")},setGridSize:function(t){this.setOptions("gridSize",t)},getIndexGenerator:function(){return this.getOptions("indexGenerator")},setIndexGenerator:function(t){this.setOptions("indexGenerator",t)},getMarkers:function(){return this.getOptions("markers")},setMarkers:function(t){this.setOptions("markers",t)},getIcons:function(){return this.getOptions("icons")},setIcons:function(t){this.setOptions("icons",t)},getStylingFunction:function(){return this.getOptions("stylingFunction")},setStylingFunction:function(t){this.setOptions("stylingFunction",t)},getDisableClickZoom:function(){return this.getOptions("disableClickZoom")},setDisableClickZoom:function(t){this.setOptions("disableClickZoom",t)},getAverageCenter:function(){return this.getOptions("averageCenter")},setAverageCenter:function(t){this.setOptions("averageCenter",t)},changed:function(t,o){if(this.getMap())switch(t){case"marker":case"minClusterSize":case"gridSize":case"averageCenter":this._redraw();break;case"indexGenerator":case"icons":this._clusters.forEach(function(s){s.updateIcon()});break;case"maxZoom":this._clusters.forEach(function(s){s.getCount()>1&&s.checkByZoomAndMinClusterSize()});break;case"stylingFunction":this._clusters.forEach(function(s){s.updateCount()});break;case"disableClickZoom":let l="enableClickZoom";o&&(l="disableClickZoom"),this._clusters.forEach(function(s){s[l]()});break}},_createClusters:function(){const t=this.getMap();if(!t)return;const o=t.getBounds(),l=this.getMarkers();for(let s=0,i=l.length;s<i;s++){const c=l[s],p=c.getPosition();if(!o.hasLatLng(p))continue;this._getClosestCluster(p).addMarker(c),this._markerRelations.push(e.maps.Event.addListener(c,"dragend",e.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const t=this._clusters;for(let o=0,l=t.length;o<l;o++)t[o].updateCluster()},_clearClusters:function(){const t=this._clusters;for(let o=0,l=t.length;o<l;o++)t[o].destroy();e.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(t){const o=this.getProjection(),l=this._clusters;let s=null,i=1/0;for(let c=0,p=l.length;c<p;c++){const m=l[c],_=m.getCenter();if(m.isInBounds(t)){const d=o.getDistance(_,t);d<i&&(i=d,s=m)}}return s||(s=new n(this),this._clusters.push(s)),s},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const n=function(t){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=t};return n.prototype={constructor:n,addMarker:function(t){if(!this._isMember(t)){if(!this._clusterCenter){const o=t.getPosition();this._clusterCenter=o,this._clusterBounds=this._calcBounds(o)}this._clusterMember.push(t)}},destroy:function(){e.maps.Event.removeListener(this._relation);const t=this._clusterMember;for(let o=0,l=t.length;o<l;o++)t[o].setMap(null);this._clusterMarker.setMap(null),this._clusterMarker=null,this._clusterCenter=null,this._clusterBounds=null,this._relation=null,this._clusterMember=[]},getCenter:function(){return this._clusterCenter},getBounds:function(){return this._clusterBounds},getCount:function(){return this._clusterMember.length},getClusterMember:function(){return this._clusterMember},isInBounds:function(t){return this._clusterBounds&&this._clusterBounds.hasLatLng(t)},enableClickZoom:function(){if(this._relation)return;const t=this._markerClusters.getMap();this._relation=e.maps.Event.addListener(this._clusterMarker,"click",e.maps.Util.bind(function(o){t.morph(o.coord,t.getZoom()+1)},this))},disableClickZoom:function(){this._relation&&(e.maps.Event.removeListener(this._relation),this._relation=null)},updateCluster:function(){if(!this._clusterMarker){let t;this._markerClusters.getAverageCenter()?t=this._calcAverageCenter(this._clusterMember):t=this._clusterCenter,this._clusterMarker=new e.maps.Marker({position:t,map:this._markerClusters.getMap()}),this._markerClusters.getDisableClickZoom()||this.enableClickZoom()}this.updateIcon(),this.updateCount(),this.checkByZoomAndMinClusterSize()},checkByZoomAndMinClusterSize:function(){const t=this._markerClusters,o=t.getMinClusterSize(),l=t.getMaxZoom(),s=t.getMap().getZoom();this.getCount()<o?this._showMember():(this._hideMember(),l<=s&&this._showMember())},updateCount:function(){const t=this._markerClusters.getStylingFunction();t&&t(this._clusterMarker,this.getCount())},updateIcon:function(){const t=this.getCount();let o=this._getIndex(t);const l=this._markerClusters.getIcons();o=Math.max(o,0),o=Math.min(o,l.length-1),this._clusterMarker.setIcon(l[o])},_showMember:function(){const t=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(t);o&&o.setMap(null)},_hideMember:function(){const t=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(null);o&&!o.getMap()&&o.setMap(t)},_calcBounds:function(t){const o=this._markerClusters.getMap(),l=new e.maps.LatLngBounds(t.clone(),t.clone()),s=o.getBounds(),i=o.getProjection(),c=i.fromCoordToOffset(s.getNE()),p=i.fromCoordToOffset(s.getSW()),m=i.fromCoordToOffset(l.getNE()),_=i.fromCoordToOffset(l.getSW()),d=this._markerClusters.getGridSize()/2;m.add(d,-d),_.add(-d,d);const u=Math.min(c.x,m.x),g=Math.max(c.y,m.y),y=Math.max(p.x,_.x),C=Math.min(p.y,_.y),k=i.fromOffsetToCoord(new e.maps.Point(u,g)),M=i.fromOffsetToCoord(new e.maps.Point(y,C));return new e.maps.LatLngBounds(M,k)},_getIndex:function(t){const o=this._markerClusters.getIndexGenerator();if(e.maps.Util.isFunction(o))return o(t);if(e.maps.Util.isArray(o)){let l=0;for(let s=0,i=o.length;s<i;s++){const c=o[s];if(t<c)break;l++}return l}return 0},_isMember:function(t){return this._clusterMember.indexOf(t)!==-1},_calcAverageCenter:function(t){const o=t.length,l=[0,0];for(let s=0;s<o;s++)l[0]+=t[s].position.x,l[1]+=t[s].position.y;return l[0]/=o,l[1]/=o,new e.maps.Point(l[0],l[1])}},r}const rt=e=>{const{naver:r}=Le(),[n,t]=f.useState([]),o=f.useRef(new Map),l=f.useRef(null),s=f.useCallback(_=>{if(!e||!r)return null;const d=Be(_),u=new r.maps.Marker({..._,position:new r.maps.LatLng(_.position.latitude,_.position.longitude),map:e,icon:{content:d}});return _.onClick&&r.maps.Event.addListener(u,"click",()=>{_.onClick(_.id)}),t(g=>[...g,u]),o.current.set(_.id,{marker:u,data:_}),u},[e,r]),i=f.useCallback((_,d)=>{const u=o.current.get(_);if(!u||!r)return;const{marker:g,data:y}=u,C={...y,...d},k=g.getElement();if(k){const M=k.querySelector(".popdeal-marker");M&&"active"in d&&M.setAttribute("active",String(!!d.active))}o.current.set(_,{marker:g,data:C})},[r]),c=f.useCallback(()=>{n.forEach(_=>{_&&_.setMap(null)}),t([]),o.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[n]),p=f.useCallback(_=>{!e||!r||e.panTo(new r.maps.LatLng(_.latitude,_.longitude))},[e,r]),m=f.useCallback(_=>{if(!e||!r||_.length===0)return;const d=new r.maps.LatLngBounds(new r.maps.LatLng(_[0].latitude,_[0].longitude),new r.maps.LatLng(_[0].latitude,_[0].longitude));_.forEach(u=>{d.extend(new r.maps.LatLng(u.latitude,u.longitude))}),e.fitBounds(d)},[e,r]);return f.useEffect(()=>{if(!r||!e||n.length===0)return;const _=tt(r),u={content:Be({type:"cluster",count:0}),size:new r.maps.Size(96,96),anchor:new r.maps.Point(20,20)},g=new _({minClusterSize:2,maxZoom:17,map:e,markers:n,disableClickZoom:!1,gridSize:120,icons:[u],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(y,C)=>{if(y&&typeof y.getElement=="function"){const k=y.getElement().querySelector(".cluster-marker-text");k&&(k.textContent=String(C))}}});return l.current=g,()=>{g.setMap(null)}},[r,e,n]),{addMarker:s,updateMarker:i,clearMarkers:c,panTo:p,fitBounds:m}},Ee=({options:e,onLoad:r})=>{const n=f.useRef(null),t=f.useRef(null),{createMap:o}=Le(),[l,s]=f.useState(null),i=rt(l),{width:c="100%",height:p="100%",...m}=e||{},_=f.useMemo(()=>m,[JSON.stringify(m)]);return f.useEffect(()=>{if(typeof document>"u"||document.getElementById("pop-ui-map-marker-styles"))return;const u=document.createElement("style");return u.id="pop-ui-map-marker-styles",u.textContent=Xe,document.head.appendChild(u),t.current=u,()=>{}},[]),f.useEffect(()=>{let d=null,u=null;if(l&&(l.destroy(),s(null)),n.current&&n.current.isConnected){const g=()=>n.current&&n.current.isConnected&&(d=o(n,_),d)?(s(d),!0):!1;if(!g()){let y=0;const C=50;u=setInterval(()=>{y++,(g()||y>=C)&&u&&(clearInterval(u),u=null)},100)}return()=>{u&&clearInterval(u),d&&(d.destroy(),d=null)}}return()=>{u&&clearInterval(u),d&&(d.destroy(),d=null)}},[o,_]),f.useEffect(()=>{l&&r&&r({map:l,...i})},[l,r,i]),a.jsx("div",{ref:n,style:{width:typeof c=="number"?`${c}px`:c,height:typeof p=="number"?`${p}px`:p}})};Ee.displayName="Map";const ur="위치 정보를 불러오는 데 실패했어요.",pr="위치 서비스 권한과 네트워크 상태를 확인해주세요.",mr=({isActive:e=!1,errorMessage:r=ur,errorDescription:n=pr})=>{const[t,o]=f.useState(!1),[l,s]=f.useState(!1),[i,c]=f.useState(null),p=f.useRef(!1);return f.useEffect(()=>{if(e&&typeof navigator<"u"&&"geolocation"in navigator){if(p.current)return;p.current=!0,requestAnimationFrame(()=>{o(!0)});const m={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(_=>{c({latitude:_.coords.latitude,longitude:_.coords.longitude}),o(!1),s(!1),p.current=!1},_=>{c(null),console.error("Geolocation error:",_),le({message:`${r} ${n}`}),o(!1),s(!0),p.current=!1},m)}},[e,r,n]),{position:i,isLoading:t,isError:l}},nt=(e="light")=>{const r=[];return Object.entries(h.colors).forEach(([n,t])=>{Object.entries(t).forEach(([o,l])=>{const s=h.getCSSVariableName(n,o);r.push(`${s}: ${l};`)})}),r.join(`
|
|
322
|
-
`)},fr=(e="light")=>{const r=document.getElementById("pop-ui-theme-vars");r&&r.remove();const
|
|
321
|
+
`,Qe=f.createContext(null),Re="naver-map-script",dr=(e,r)=>new Promise((o,t)=>{if(typeof window<"u"&&window.naver?.maps){o();return}const n=document.getElementById(Re);if(n){n.addEventListener("load",()=>o()),n.addEventListener("error",()=>t(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=Re,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${e}&language=${r}`,l.async=!0,l.onload=()=>{o()},l.onerror=()=>{t(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),et=({clientId:e,language:r="ko",children:o})=>{const[t,n]=f.useState(null),[l,s]=f.useState({}),[i,_]=f.useState(null);f.useEffect(()=>{typeof window>"u"||dr(e,r).then(()=>{window.naver&&n(window.naver)}).catch(p=>{console.error("Naver Map script loading failed:",p),_(p)})},[e,r]);const u=f.useCallback((p,c)=>{const m=t||(typeof window<"u"?window.naver:null);if(!m||(!t&&window.naver&&n(window.naver),!p.current))return null;const d=p.current;if(!d.isConnected)return null;try{const g={center:new m.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,...c},C=new m.maps.Map(d,g);return s(y=>{const D=d.getAttribute("id")||"default";return{...y,[D]:C}}),C}catch(g){return console.error("Map creation error:",g),null}},[t]);return i&&console.error("NaverMapProvider error:",i),a.jsx(Qe.Provider,{value:{naver:t,createMap:u,maps:l},children:o})},Le=()=>{const e=f.useContext(Qe);if(!e)throw new Error("useNaverMap must be used within NaverMapProvider");return e};function tt(e){const r=function(t){this.DEFAULT_OPTIONS={map:null,markers:[],disableClickZoom:!0,minClusterSize:2,maxZoom:13,gridSize:100,icons:[],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:function(){}},this._clusters=[],this._mapRelations=null,this._markerRelations=[],this.setOptions(e.maps.Util.extend({},this.DEFAULT_OPTIONS,t),!0),this.setMap(t.map||null)};e.maps.Util.ClassExtend(r,e.maps.OverlayView,{onAdd:function(){const t=this.getMap();this._mapRelations=e.maps.Event.addListener(t,"idle",e.maps.Util.bind(this._onIdle,this)),this.getMarkers().length>0&&(this._createClusters(),this._updateClusters())},draw:e.maps.Util.noop,onRemove:function(){e.maps.Event.removeListener(this._mapRelation),this._clearClusters(),this._geoTree=null,this._mapRelation=null},setOptions:function(t){const n=this;if(typeof t=="string"){const l=t,s=arguments[1];n.set(l,s)}else{const l=arguments[1];e.maps.Util.forEach(t,function(s,i){i!=="map"&&n.set(i,s)}),t.map&&!l&&n.setMap(t.map)}},getOptions:function(t){const n=this,l={};return t!==void 0?n.get(t):(e.maps.Util.forEach(n.DEFAULT_OPTIONS,function(s,i){l[i]=n.get(i)}),l)},getMinClusterSize:function(){return this.getOptions("minClusterSize")},setMinClusterSize:function(t){this.setOptions("minClusterSize",t)},getMaxZoom:function(){return this.getOptions("maxZoom")},setMaxZoom:function(t){this.setOptions("maxZoom",t)},getGridSize:function(){return this.getOptions("gridSize")},setGridSize:function(t){this.setOptions("gridSize",t)},getIndexGenerator:function(){return this.getOptions("indexGenerator")},setIndexGenerator:function(t){this.setOptions("indexGenerator",t)},getMarkers:function(){return this.getOptions("markers")},setMarkers:function(t){this.setOptions("markers",t)},getIcons:function(){return this.getOptions("icons")},setIcons:function(t){this.setOptions("icons",t)},getStylingFunction:function(){return this.getOptions("stylingFunction")},setStylingFunction:function(t){this.setOptions("stylingFunction",t)},getDisableClickZoom:function(){return this.getOptions("disableClickZoom")},setDisableClickZoom:function(t){this.setOptions("disableClickZoom",t)},getAverageCenter:function(){return this.getOptions("averageCenter")},setAverageCenter:function(t){this.setOptions("averageCenter",t)},changed:function(t,n){if(this.getMap())switch(t){case"marker":case"minClusterSize":case"gridSize":case"averageCenter":this._redraw();break;case"indexGenerator":case"icons":this._clusters.forEach(function(s){s.updateIcon()});break;case"maxZoom":this._clusters.forEach(function(s){s.getCount()>1&&s.checkByZoomAndMinClusterSize()});break;case"stylingFunction":this._clusters.forEach(function(s){s.updateCount()});break;case"disableClickZoom":let l="enableClickZoom";n&&(l="disableClickZoom"),this._clusters.forEach(function(s){s[l]()});break}},_createClusters:function(){const t=this.getMap();if(!t)return;const n=t.getBounds(),l=this.getMarkers();for(let s=0,i=l.length;s<i;s++){const _=l[s],u=_.getPosition();if(!n.hasLatLng(u))continue;this._getClosestCluster(u).addMarker(_),this._markerRelations.push(e.maps.Event.addListener(_,"dragend",e.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const t=this._clusters;for(let n=0,l=t.length;n<l;n++)t[n].updateCluster()},_clearClusters:function(){const t=this._clusters;for(let n=0,l=t.length;n<l;n++)t[n].destroy();e.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(t){const n=this.getProjection(),l=this._clusters;let s=null,i=1/0;for(let _=0,u=l.length;_<u;_++){const p=l[_],c=p.getCenter();if(p.isInBounds(t)){const m=n.getDistance(c,t);m<i&&(i=m,s=p)}}return s||(s=new o(this),this._clusters.push(s)),s},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const o=function(t){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=t};return o.prototype={constructor:o,addMarker:function(t){if(!this._isMember(t)){if(!this._clusterCenter){const n=t.getPosition();this._clusterCenter=n,this._clusterBounds=this._calcBounds(n)}this._clusterMember.push(t)}},destroy:function(){e.maps.Event.removeListener(this._relation);const t=this._clusterMember;for(let n=0,l=t.length;n<l;n++)t[n].setMap(null);this._clusterMarker.setMap(null),this._clusterMarker=null,this._clusterCenter=null,this._clusterBounds=null,this._relation=null,this._clusterMember=[]},getCenter:function(){return this._clusterCenter},getBounds:function(){return this._clusterBounds},getCount:function(){return this._clusterMember.length},getClusterMember:function(){return this._clusterMember},isInBounds:function(t){return this._clusterBounds&&this._clusterBounds.hasLatLng(t)},enableClickZoom:function(){if(this._relation)return;const t=this._markerClusters.getMap();this._relation=e.maps.Event.addListener(this._clusterMarker,"click",e.maps.Util.bind(function(n){t.morph(n.coord,t.getZoom()+1)},this))},disableClickZoom:function(){this._relation&&(e.maps.Event.removeListener(this._relation),this._relation=null)},updateCluster:function(){if(!this._clusterMarker){let t;this._markerClusters.getAverageCenter()?t=this._calcAverageCenter(this._clusterMember):t=this._clusterCenter,this._clusterMarker=new e.maps.Marker({position:t,map:this._markerClusters.getMap()}),this._markerClusters.getDisableClickZoom()||this.enableClickZoom()}this.updateIcon(),this.updateCount(),this.checkByZoomAndMinClusterSize()},checkByZoomAndMinClusterSize:function(){const t=this._markerClusters,n=t.getMinClusterSize(),l=t.getMaxZoom(),s=t.getMap().getZoom();this.getCount()<n?this._showMember():(this._hideMember(),l<=s&&this._showMember())},updateCount:function(){const t=this._markerClusters.getStylingFunction();t&&t(this._clusterMarker,this.getCount())},updateIcon:function(){const t=this.getCount();let n=this._getIndex(t);const l=this._markerClusters.getIcons();n=Math.max(n,0),n=Math.min(n,l.length-1),this._clusterMarker.setIcon(l[n])},_showMember:function(){const t=this._markerClusters.getMap(),n=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(t);n&&n.setMap(null)},_hideMember:function(){const t=this._markerClusters.getMap(),n=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(null);n&&!n.getMap()&&n.setMap(t)},_calcBounds:function(t){const n=this._markerClusters.getMap(),l=new e.maps.LatLngBounds(t.clone(),t.clone()),s=n.getBounds(),i=n.getProjection(),_=i.fromCoordToOffset(s.getNE()),u=i.fromCoordToOffset(s.getSW()),p=i.fromCoordToOffset(l.getNE()),c=i.fromCoordToOffset(l.getSW()),m=this._markerClusters.getGridSize()/2;p.add(m,-m),c.add(-m,m);const d=Math.min(_.x,p.x),g=Math.max(_.y,p.y),C=Math.max(u.x,c.x),y=Math.min(u.y,c.y),D=i.fromOffsetToCoord(new e.maps.Point(d,g)),P=i.fromOffsetToCoord(new e.maps.Point(C,y));return new e.maps.LatLngBounds(P,D)},_getIndex:function(t){const n=this._markerClusters.getIndexGenerator();if(e.maps.Util.isFunction(n))return n(t);if(e.maps.Util.isArray(n)){let l=0;for(let s=0,i=n.length;s<i;s++){const _=n[s];if(t<_)break;l++}return l}return 0},_isMember:function(t){return this._clusterMember.indexOf(t)!==-1},_calcAverageCenter:function(t){const n=t.length,l=[0,0];for(let s=0;s<n;s++)l[0]+=t[s].position.x,l[1]+=t[s].position.y;return l[0]/=n,l[1]/=n,new e.maps.Point(l[0],l[1])}},r}const rt=e=>{const{naver:r}=Le(),[o,t]=f.useState([]),n=f.useRef(new Map),l=f.useRef(null),s=f.useCallback(c=>{if(!e||!r)return null;const m=Be(c),d=new r.maps.Marker({...c,position:new r.maps.LatLng(c.position.latitude,c.position.longitude),map:e,icon:{content:m}});return c.onClick&&r.maps.Event.addListener(d,"click",()=>{c.onClick(c.id)}),t(g=>[...g,d]),n.current.set(c.id,{marker:d,data:c}),d},[e,r]),i=f.useCallback((c,m)=>{const d=n.current.get(c);if(!d||!r)return;const{marker:g,data:C}=d,y={...C,...m},D=g.getElement();if(D){const P=D.querySelector(".popdeal-marker");P&&"active"in m&&P.setAttribute("active",String(!!m.active))}n.current.set(c,{marker:g,data:y})},[r]),_=f.useCallback(()=>{o.forEach(c=>{c&&c.setMap(null)}),t([]),n.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[o]),u=f.useCallback(c=>{!e||!r||e.panTo(new r.maps.LatLng(c.latitude,c.longitude))},[e,r]),p=f.useCallback(c=>{if(!e||!r||c.length===0)return;const m=new r.maps.LatLngBounds(new r.maps.LatLng(c[0].latitude,c[0].longitude),new r.maps.LatLng(c[0].latitude,c[0].longitude));c.forEach(d=>{m.extend(new r.maps.LatLng(d.latitude,d.longitude))}),e.fitBounds(m)},[e,r]);return f.useEffect(()=>{if(!r||!e||o.length===0)return;const c=tt(r),d={content:Be({type:"cluster",count:0}),size:new r.maps.Size(96,96),anchor:new r.maps.Point(20,20)},g=new c({minClusterSize:2,maxZoom:17,map:e,markers:o,disableClickZoom:!1,gridSize:120,icons:[d],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(C,y)=>{if(C&&typeof C.getElement=="function"){const D=C.getElement().querySelector(".cluster-marker-text");D&&(D.textContent=String(y))}}});return l.current=g,()=>{g.setMap(null)}},[r,e,o]),{addMarker:s,updateMarker:i,clearMarkers:_,panTo:u,fitBounds:p}},Ee=({options:e,onLoad:r})=>{const o=f.useRef(null),t=f.useRef(null),{createMap:n}=Le(),[l,s]=f.useState(null),i=rt(l),{width:_="100%",height:u="100%",...p}=e||{},c=f.useMemo(()=>p,[JSON.stringify(p)]);return f.useEffect(()=>{if(typeof document>"u"||document.getElementById("pop-ui-map-marker-styles"))return;const d=document.createElement("style");return d.id="pop-ui-map-marker-styles",d.textContent=Xe,document.head.appendChild(d),t.current=d,()=>{}},[]),f.useEffect(()=>{let m=null,d=null;if(l&&(l.destroy(),s(null)),o.current&&o.current.isConnected){const g=()=>o.current&&o.current.isConnected&&(m=n(o,c),m)?(s(m),!0):!1;if(!g()){let C=0;const y=50;d=setInterval(()=>{C++,(g()||C>=y)&&d&&(clearInterval(d),d=null)},100)}return()=>{d&&clearInterval(d),m&&(m.destroy(),m=null)}}return()=>{d&&clearInterval(d),m&&(m.destroy(),m=null)}},[n,c]),f.useEffect(()=>{l&&r&&r({map:l,...i})},[l,r,i]),a.jsx("div",{ref:o,style:{width:typeof _=="number"?`${_}px`:_,height:typeof u=="number"?`${u}px`:u}})};Ee.displayName="Map";const ur="위치 정보를 불러오는 데 실패했어요.",pr="위치 서비스 권한과 네트워크 상태를 확인해주세요.",mr=({isActive:e=!1,errorMessage:r=ur,errorDescription:o=pr})=>{const[t,n]=f.useState(!1),[l,s]=f.useState(!1),[i,_]=f.useState(null),u=f.useRef(!1);return f.useEffect(()=>{if(e&&typeof navigator<"u"&&"geolocation"in navigator){if(u.current)return;u.current=!0,requestAnimationFrame(()=>{n(!0)});const p={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(c=>{_({latitude:c.coords.latitude,longitude:c.coords.longitude}),n(!1),s(!1),u.current=!1},c=>{_(null),console.error("Geolocation error:",c),ie({message:`${r} ${o}`}),n(!1),s(!0),u.current=!1},p)}},[e,r,o]),{position:i,isLoading:t,isError:l}},ot=(e="light")=>{const r=[];return Object.entries(h.colors).forEach(([o,t])=>{Object.entries(t).forEach(([n,l])=>{const s=h.getCSSVariableName(o,n);r.push(`${s}: ${l};`)})}),r.join(`
|
|
322
|
+
`)},fr=(e="light")=>{const r=document.getElementById("pop-ui-theme-vars");r&&r.remove();const o=document.createElement("style");o.id="pop-ui-theme-vars",o.textContent=`
|
|
323
323
|
:root {
|
|
324
|
-
${
|
|
324
|
+
${ot("light")}
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
[data-theme="dark"] {
|
|
328
|
-
${
|
|
328
|
+
${ot("dark")}
|
|
329
329
|
}
|
|
330
|
-
`,document.head.appendChild(
|
|
330
|
+
`,document.head.appendChild(o)},ae=e=>{const r=h.colors[e],o=Object.keys(r).sort((n,l)=>Number(n)-Number(l));return[h.getCSSVariableRef(e,o[0]||o[o.length-1]),h.getCSSVariableRef(e,o[1]||o[o.length-1]),h.getCSSVariableRef(e,o[2]||o[o.length-1]),h.getCSSVariableRef(e,o[3]||o[o.length-1]),h.getCSSVariableRef(e,o[4]||o[o.length-1]),h.getCSSVariableRef(e,o[5]||o[o.length-1]),h.getCSSVariableRef(e,o[6]||o[o.length-1]),h.getCSSVariableRef(e,o[7]||o[o.length-1]),h.getCSSVariableRef(e,o[8]||o[o.length-1]),h.getCSSVariableRef(e,o[9]||o[o.length-1])]},hr=x.createTheme({colors:{gray:ae("gray"),aqua:ae("aqua"),red:ae("red"),orange:ae("orange"),yellow:ae("yellow"),green:ae("green"),blue:ae("blue"),purple:ae("purple"),grape:ae("grape")},primaryColor:"aqua",primaryShade:5,fontFamily:'var(--pop-ui-font-family, Pretendard), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),nt=f.createContext(void 0),at=f.createContext({}),gr=({children:e,defaultTheme:r="light",naverClientId:o,notificationPosition:t="bottom-center",notificationLimit:n=5,notificationAutoClose:l,notificationZIndex:s})=>{const[i,_]=f.useState(r);f.useEffect(()=>{fr(i),document.documentElement.setAttribute("data-theme",i)},[i]);const u=()=>{_(p=>p==="light"?"dark":"light")};return a.jsx(nt.Provider,{value:{theme:i,setTheme:_,toggleTheme:u},children:a.jsx(at.Provider,{value:{naverClientId:o},children:a.jsxs(x.MantineProvider,{theme:hr,children:[a.jsx(ue.Notifications,{position:t,limit:n,autoClose:l,zIndex:s}),e]})})})},yr=()=>{const e=f.useContext(nt);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e},st=()=>f.useContext(at),re={MapInfo:"styles-module__MapInfo___scB-5",MapInfo__NoClientId:"styles-module__MapInfo__NoClientId___YBM4o",MapInfo__Preview:"styles-module__MapInfo__Preview___FJbQN",MapInfo__ExpandButton:"styles-module__MapInfo__ExpandButton___8KySg",MapInfo__AddressBar:"styles-module__MapInfo__AddressBar___mKkK6",MapInfo__AddressContent:"styles-module__MapInfo__AddressContent___XG1Uz",MapInfo__Address:"styles-module__MapInfo__Address___iXO6N",MapInfo__DirectionLink:"styles-module__MapInfo__DirectionLink___eGnf-",MapInfo__DirectionButton:"styles-module__MapInfo__DirectionButton___gTWpj"},Cr=60,kr=({location:e,marker:r,direction:o,toast:t,naverClientId:n,onExpandRequest:l,onClick:s,height:i=200})=>{const _=st(),u=n||_.naverClientId,{title:p,address:c,latitude:m,longitude:d}=e,g=o?.label??"길찾기",C=t?.addressCopied??"주소 복사 완료",[y,D]=f.useState(null),P=i-Cr,S=f.useCallback(b=>{b&&b.map&&D(b)},[]),I=f.useCallback(()=>{l?.()},[l]),H=f.useCallback((b,M,O)=>{if(b&&b.map&&m&&d)try{b.addMarker(M),O?.()}catch(F){console.error("Error creating map marker:",F)}},[m,d]),G=f.useCallback((b,M)=>{b&&b.map&&m&&d&&(b.clearMarkers(),H(b,{id:`location-marker-${p}`,type:M,position:{latitude:m,longitude:d},title:p,icon:r?.imageUrl,address:c},()=>{b.panTo({latitude:m,longitude:d})}))},[m,d,p,r?.imageUrl,c,H]);f.useEffect(()=>{m&&d&&y&&G(y,"pi")},[y,m,d,G]),f.useEffect(()=>()=>{D(null)},[]);const Z=f.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(c),ie(C))},[c,C]),V=f.useMemo(()=>o?.url?o.url:`https://map.naver.com/p/search/${encodeURIComponent(p)}`,[o?.url,p]);return u?a.jsxs("div",{className:re.MapInfo,style:{height:i},onClick:s,children:[a.jsx(et,{clientId:u,children:a.jsxs("div",{className:re.MapInfo__Preview,onClick:I,children:[a.jsx(Ee,{onLoad:S,options:{width:"100%",height:`${P}px`,center:{lat:m,lng:d},zoom:15,minZoom:15,maxZoom:15,draggable:!1,keyboardShortcuts:!1,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1}}),l&&a.jsx("div",{className:re.MapInfo__ExpandButton,children:a.jsx(h.IconMap,{color:h.ColorGray800,size:18})})]})}),a.jsxs("div",{className:re.MapInfo__AddressBar,children:[a.jsxs("div",{className:re.MapInfo__AddressContent,children:[a.jsx(h.IconMapMarker,{color:h.ColorAqua500,size:24,variant:"filled"}),a.jsx("span",{className:re.MapInfo__Address,onClick:Z,role:"button",tabIndex:0,onKeyDown:b=>b.key==="Enter"&&Z(),children:c})]}),a.jsx("a",{className:re.MapInfo__DirectionLink,href:V,target:"_blank",rel:"noreferrer",children:a.jsx(de,{variant:"basic",size:"sm",className:re.MapInfo__DirectionButton,children:g})})]})]}):a.jsx("div",{className:re.MapInfo,style:{height:i},children:a.jsx("div",{className:re.MapInfo__NoClientId,children:"naverClientId가 필요합니다. PopUIProvider 또는 props로 전달해주세요."})})};k.Button=de,k.CalendarDatePicker=Fe,k.Checkbox=ht,k.DatePicker=xt,k.Dropdown=St,k.ImageInput=Wt,k.LottieInput=Gt,k.Map=Ee,k.MapInfo=kr,k.Modal=xe,k.NaverMapProvider=et,k.Pagination=qt,k.PopUiProvider=gr,k.Radio=Xt,k.SearchBar=Qt,k.SegmentButton=Rt,k.Tab=er,k.TextField=rr,k.TimePicker=or,k.Toggle=nr,k.Tooltip=ar,k.getMarkerHTML=Be,k.makeMarkerClustering=tt,k.markerStyles=Xe,k.toast=ie,k.useLocation=mr,k.useMap=rt,k.useNaverMap=Le,k.usePopUIConfig=st,k.useTheme=yr,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|