@pop-ui/core 2.2.3 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/core.css +1 -1
  3. package/dist/core.js +58 -3110
  4. package/dist/core.umd.cjs +3 -3
  5. package/dist/esm/components/Button/index.js +75 -0
  6. package/dist/esm/components/Button/style.js +9 -0
  7. package/dist/esm/components/Button/styles.module.scss.js +28 -0
  8. package/dist/esm/components/CalendarDatePicker/index.js +119 -0
  9. package/dist/esm/components/CalendarDatePicker/styles.module.scss.js +34 -0
  10. package/dist/esm/components/CalendarDatePicker/utils.js +82 -0
  11. package/dist/esm/components/Checkbox/index.js +32 -0
  12. package/dist/esm/components/Checkbox/styles.module.scss.js +9 -0
  13. package/dist/esm/components/DatePicker/index.js +203 -0
  14. package/dist/esm/components/DatePicker/styles.module.scss.js +57 -0
  15. package/dist/esm/components/Dropdown/index.js +61 -0
  16. package/dist/esm/components/Dropdown/styles.module.scss.js +21 -0
  17. package/dist/esm/components/ImageInput/ImageInputCropModal.js +91 -0
  18. package/dist/esm/components/ImageInput/helpers.js +46 -0
  19. package/dist/esm/components/ImageInput/index.js +379 -0
  20. package/dist/esm/components/ImageInput/styles.module.scss.js +30 -0
  21. package/dist/esm/components/LottieInput/helpers.js +48 -0
  22. package/dist/esm/components/LottieInput/index.js +233 -0
  23. package/dist/esm/components/LottieInput/styles.module.scss.js +14 -0
  24. package/dist/esm/components/Map/Map.js +48 -0
  25. package/dist/esm/components/Map/NaverMapContext.js +78 -0
  26. package/dist/esm/components/Map/markerClustering.js +305 -0
  27. package/dist/esm/components/Map/markerStyles.js +351 -0
  28. package/dist/esm/components/Map/useLocation.js +40 -0
  29. package/dist/esm/components/Map/useMap.js +95 -0
  30. package/dist/esm/components/MapInfo/index.js +120 -0
  31. package/dist/esm/components/MapInfo/styles.module.scss.js +24 -0
  32. package/dist/esm/components/Modal/index.js +52 -0
  33. package/dist/esm/components/Pagination/index.js +45 -0
  34. package/dist/esm/components/Pagination/style.module.scss.js +13 -0
  35. package/dist/esm/components/Radio/index.js +29 -0
  36. package/dist/esm/components/Radio/styles.module.scss.js +9 -0
  37. package/dist/esm/components/SearchBar/index.js +60 -0
  38. package/dist/esm/components/SearchBar/styles.module.scss.js +25 -0
  39. package/dist/esm/components/SegmentButton/index.js +25 -0
  40. package/dist/esm/components/SegmentButton/styles.module.scss.js +9 -0
  41. package/dist/esm/components/Tab/index.js +14 -0
  42. package/dist/esm/components/Tab/styles.module.scss.js +10 -0
  43. package/dist/esm/components/TextField/index.js +99 -0
  44. package/dist/esm/components/TextField/styles.module.scss.js +28 -0
  45. package/dist/esm/components/TimePicker/index.js +33 -0
  46. package/dist/esm/components/TimePicker/styles.module.scss.js +9 -0
  47. package/dist/esm/components/Toast/index.js +35 -0
  48. package/dist/esm/components/Toast/styles.module.scss.js +14 -0
  49. package/dist/esm/components/Toggle/index.js +48 -0
  50. package/dist/esm/components/Toggle/styles.module.scss.js +9 -0
  51. package/dist/esm/components/Tooltip/index.js +25 -0
  52. package/dist/esm/components/Tooltip/styles.module.scss.js +12 -0
  53. package/dist/esm/components/shared/MultiItemInput/Dropzone.js +30 -0
  54. package/dist/esm/components/shared/MultiItemInput/SortableEmptySlot.js +29 -0
  55. package/dist/esm/components/shared/MultiItemInput/TileShell.js +113 -0
  56. package/dist/esm/components/shared/MultiItemInput/helpers.js +23 -0
  57. package/dist/esm/components/shared/MultiItemInput/styles.module.scss.js +30 -0
  58. package/dist/esm/components/shared/MultiItemInput/usePositionGrid.js +49 -0
  59. package/dist/esm/components/shared/MultiItemInput/useSortableGrid.js +20 -0
  60. package/dist/esm/theme/ThemeProvider.js +46 -0
  61. package/dist/esm/theme/cssVariables.js +29 -0
  62. package/dist/esm/theme/mantineTheme.js +36 -0
  63. package/package.json +2 -2
package/dist/core.umd.cjs CHANGED
@@ -1,5 +1,5 @@
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("lottie-react"),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","lottie-react","@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.Lottie,D.notifications))})(this,function(D,a,x,ye,h,Y,Dr,f,lt,ne,oe,Ce,it,Ae,ct,de){"use strict";const _t={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},dt={sm:U["Button--Small"],md:U["Button--Medium"],lg:U["Button--Large"]},ut={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"]},pt=(...e)=>e.filter(Boolean).join(" ")||void 0,mt=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=_t[r],u=o||l,g=i||u;return a.jsxs(x.Button,{type:t,unstyled:!0,className:pt(U.Button,i?U.Button__Disabled:"",dt[r],ut[n],c),classNames:mt(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"},ft={sm:De["Checkbox--Small"],md:De["Checkbox--Medium"],lg:De["Checkbox--Large"]},ht={sm:18,md:24,lg:32},gt=({size:e="md",...r})=>{const n=ft[e],t=ht[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"},yt=({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}},Ct=(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},kt=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},Dt={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||(kt(t??se(n))??new Date)),k=f.useMemo(()=>yt({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&&$&&Ct(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(Dt,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 Pt={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},xt={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},St=({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(xt,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(Pt,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"},Mt=({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})]})]})},bt=e=>({...e?{}:{content:{borderRadius:"12px"}},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:h.ColorGray900},header:{padding:"16px"},body:{paddingInline:0}}),Tt=(e,r)=>{if(typeof e=="function")return e;const n=bt(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:Tt(o,t),withCloseButton:n,closeButtonProps:{icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},...l})};function fe(){return crypto.randomUUID()}function wt(e,r,n){const t=[...e],[o]=t.splice(r,1);return t.splice(n,0,o),t}function It(e,r,n){return n!=null&&e.length>=n?0:r!=null&&e.length<r?r-e.length:1}function vt(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 Bt(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 Lt(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 Et(e,r,n){return ze(e,r,n)}function At(e,r,n){const t={id:fe(),file:r,url:URL.createObjectURL(r),position:n};return[...e,t]}function Nt(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}async function Ot(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 Ft({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 Ot(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 $t=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:$t});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 zt({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:It(e,l,s),p=i?Array.from({length:s},(C,k)=>`${Se}${k}`):[],m=i?p:e.map(C=>C.id),{sensors:_,handleDragEnd:d}=zt({items:e,onReorder:(C,k)=>{const M=wt(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=vt(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 Ht(e){Ze(e)&&window.open(e,"_blank","noopener,noreferrer")}function Wt(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&&Ht(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:Wt(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 Yt=({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(()=>()=>Nt(V.current),[]);const A=O=>{if(C)return;const B=e.length,z=Bt(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=At(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=Lt(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=Et(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(ne.DndContext,{sensors:Z,collisionDetection:ne.closestCenter,onDragEnd:E,children:a.jsx(oe.SortableContext,{items:G,strategy:oe.rectSortingStrategy,children:a.jsx("div",{className:q.Container,style:{gap:k},children:M?Array.from({length:P},(O,B)=>{const z=H[B],te=e.find(ie=>ie.position===B);return te?a.jsx(Ve,{item:te,sortableId:z,index:B,totalCount:P,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:m,readOnly:C??!1,isLoading:y,onLinkClick:p,onDelete:I,onReplace:ee,onEdit:$,onPreview:ie=>{ie.url&&v({id:ie.id,url:ie.url})}},z):!C&&a.jsx(He,{id:z,children:a.jsxs(he,{onDrop:ie=>W(B,ie),accept:n??Ce.IMAGE_MIME_TYPE,multiple:!1,isLoading:y,isError:S,width:o,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:S?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${S?` ${q.PlaceholderTextError}`:""}`,children:pe(B)})]})},z)}):a.jsxs(a.Fragment,{children:[e.map((O,B)=>a.jsx(Ve,{item:O,index:B,totalCount:e.length,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:m,readOnly:C??!1,isLoading:y,onLinkClick:p,onDelete:I,onReplace:ee,onEdit:$,onPreview:z=>{z.url&&v({id:z.id,url:z.url})}},O.id)),!C&&Array.from({length:F},(O,B)=>a.jsxs(he,{onDrop:A,accept:n??Ce.IMAGE_MIME_TYPE,multiple:P!==1,isLoading:y,isError:S,width:o,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:S?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${S?` ${q.PlaceholderTextError}`:""}`,children:pe(B)})]},`placeholder-${B}`))]})})})}),S&&a.jsx(x.Input.Error,{mt:8,children:g}),m&&a.jsx(Ft,{item:N,isOpen:!!N,onClose:()=>$(null),onSubmit:Q}),a.jsx(xe,{opened:!!L,onClose:()=>v(null),title:L?.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:L&&a.jsx(Zt,{item:L},`${L.id}:${L.url}`)})]})};function Zt({item:e}){const[r,n]=f.useState(!1);return a.jsxs("div",{className:q.PreviewContent,children:[a.jsxs("div",{className:q.PreviewControls,role:"group","aria-label":"이미지 크기 보기",children:[a.jsx(ce,{variant:r?"basic":"primary",size:"sm","aria-label":"화면에 맞춤","aria-pressed":!r,onClick:()=>n(!1),children:"화면에 맞춤"}),a.jsx(ce,{variant:r?"primary":"basic",size:"sm","aria-label":"원본 크기 (100%)","aria-pressed":r,onClick:()=>n(!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 n=new FileReader;n.onload=t=>{try{const o=JSON.parse(t.target?.result);r(Ue(o)?o:null)}catch{r(null)}},n.onerror=()=>r(null),n.readAsText(e)})}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}));return[...e,...s]}function Ut(e,r){return e.filter(n=>n.id!==r)}function jt(e,r,n){const t={id:fe(),file:r,position:n};return[...e,t]}const _e={Container:"styles-module__Container___cJqG-",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:n,icon:t,message:o}=je(e);return{id:r,message:a.jsx("div",{className:ge.Toast__Message,children:o}),icon:t,autoClose:n,classNames:{root:ge.Toast,body:ge.Toast__Body,icon:ge.Toast__Icon},withCloseButton:!1,withBorder:!1}},le=e=>{const r=je(e);de.notifications.show(Ge(e,r.id))};le.update=(e,r)=>{de.notifications.update(Ge(r,e))},le.hide=e=>{de.notifications.hide(e)},le.clean=()=>{de.notifications.clean()};const qe={"application/json":[".json"]};function Ke({item:e,sortableId:r,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,canDelete:i,hasLink:c,onLinkClick:p,onDelete:m}){const d=!e.animationData&&!!(e.file||e.url)?`${e.id}|${e.file?`${e.file.name}:${e.file.size}`:e.url??""}`:"",[u,g]=f.useState({key:"",data:null}),y=e.animationData??(u.key===d?u.data:null),C=!!d&&u.key!==d;return f.useEffect(()=>{if(!d)return;let k=!1;return(e.file?Me(e.file):fetch(e.url).then(P=>P.json()).then(P=>Ue(P)?P:null)).then(P=>{k||g({key:d,data:P})}).catch(()=>{k||g({key:d,data:null})}),()=>{k=!0}},[d,e.file,e.url]),a.jsx(We,{id:r??e.id,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,itemIsLoading:e.isLoading||C,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:p?()=>p(e):void 0,onDelete:()=>m(e.id),deleteAriaLabel:"Lottie 삭제",children:y?a.jsx(ct,{animationData:y,loop:!0,autoplay:!0,style:{width:t,height:o,display:"block"}}):a.jsx("div",{className:_e.Empty,style:{width:t,height:o}})})}const Gt=({value:e=[],onChange:r,width:n=160,height:t=200,placeholder:o="Lottie JSON 파일을 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,length:c,minLength:p,maxLength:m,errorMsg:_,isLoading:d,readOnly:u,gap:g=8,canDelete:y=!0})=>{const{isPositionMode:C,resolvedMaxLength:k,placeholderCount:M,slotIds:P,sortableItems:F,sensors:H,handleDragEnd:G,getMetaIndex:Z}=Ye({value:e,length:c,minLength:p,maxLength:m,onChange:r}),E=!!_,w=async b=>{if(u)return;const v=[...b].sort((ee,Q)=>ee.name.localeCompare(Q.name)),L=await Promise.all(v.map(Me));let V=0;const A=v.filter((ee,Q)=>L[Q]!==null?!0:(V++,!1));if(V>0&&le({id:"invalid-lottie-files",message:V===1?"유효하지 않은 Lottie JSON 파일입니다":`${V}개의 파일이 유효하지 않은 Lottie JSON입니다`}),A.length===0)return;const W=e.length,I=Vt(e,A,k);I.length!==W&&r?.(I,{action:"create",itemId:I[W].id,index:W})},S=async(b,v)=>{if(u)return;const L=v[0];if(!L)return;if(!await Me(L)){le({id:"invalid-lottie-files",message:"유효하지 않은 Lottie JSON 파일입니다"});return}const A=jt(e,L,b);r?.(A,{action:"create",itemId:A[A.length-1].id,index:b})},N=b=>{if(u)return;const v=Z(b),L=Ut(e,b);r?.(L,{action:"delete",itemId:b,index:v})},$=b=>{const v=typeof o=="function"?o(b):o;return typeof v!="string"?v:v.split(`
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(ne.DndContext,{sensors:Z,collisionDetection:ne.closestCenter,onDragEnd:E,children:a.jsx(oe.SortableContext,{items:G,strategy:oe.rectSortingStrategy,children:a.jsx("div",{className:q.Container,style:{gap:k},children:M?Array.from({length:P},(O,B)=>{const z=H[B],te=e.find(ie=>ie.position===B);return te?a.jsx(Ve,{item:te,sortableId:z,index:B,totalCount:P,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:m,readOnly:C??!1,isLoading:y,onLinkClick:p,onDelete:I,onReplace:ee,onEdit:$,onPreview:ie=>{ie.url&&v({id:ie.id,url:ie.url})}},z):!C&&a.jsx(He,{id:z,children:a.jsxs(he,{onDrop:ie=>W(B,ie),accept:n??Ce.IMAGE_MIME_TYPE,multiple:!1,isLoading:y,isError:S,width:o,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:S?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${S?` ${q.PlaceholderTextError}`:""}`,children:pe(B)})]})},z)}):a.jsxs(a.Fragment,{children:[e.map((O,B)=>a.jsx(Ve,{item:O,index:B,totalCount:e.length,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:m,readOnly:C??!1,isLoading:y,onLinkClick:p,onDelete:I,onReplace:ee,onEdit:$,onPreview:z=>{z.url&&v({id:z.id,url:z.url})}},O.id)),!C&&Array.from({length:F},(O,B)=>a.jsxs(he,{onDrop:A,accept:n??Ce.IMAGE_MIME_TYPE,multiple:P!==1,isLoading:y,isError:S,width:o,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:S?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${S?` ${q.PlaceholderTextError}`:""}`,children:pe(B)})]},`placeholder-${B}`))]})})})}),S&&a.jsx(x.Input.Error,{mt:8,children:g}),m&&a.jsx(Ot,{item:N,isOpen:!!N,onClose:()=>$(null),onSubmit:Q}),a.jsx(xe,{opened:!!L,onClose:()=>v(null),title:L?.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:L&&a.jsx(Yt,{item:L},`${L.id}:${L.url}`)})]})};function Yt({item:e}){const[r,n]=f.useState(!1);return a.jsxs("div",{className:q.PreviewContent,children:[a.jsxs("div",{className:q.PreviewControls,role:"group","aria-label":"이미지 크기 보기",children:[a.jsx(ce,{variant:r?"basic":"primary",size:"sm","aria-label":"화면에 맞춤","aria-pressed":!r,onClick:()=>n(!1),children:"화면에 맞춤"}),a.jsx(ce,{variant:r?"primary":"basic",size:"sm","aria-label":"원본 크기 (100%)","aria-pressed":r,onClick:()=>n(!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 n=new FileReader;n.onload=t=>{try{const o=JSON.parse(t.target?.result);r(Ue(o)?o:null)}catch{r(null)}},n.onerror=()=>r(null),n.readAsText(e)})}function Zt(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}));return[...e,...s]}function Vt(e,r){return e.filter(n=>n.id!==r)}function Ut(e,r,n){const t={id:fe(),file:r,position:n};return[...e,t]}const _e={Container:"styles-module__Container___cJqG-",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:n,icon:t,message:o}=je(e);return{id:r,message:a.jsx("div",{className:ge.Toast__Message,children:o}),icon:t,autoClose:n,classNames:{root:ge.Toast,body:ge.Toast__Body,icon:ge.Toast__Icon},withCloseButton:!1,withBorder:!1}},le=e=>{const r=je(e);de.notifications.show(Ge(e,r.id))};le.update=(e,r)=>{de.notifications.update(Ge(r,e))},le.hide=e=>{de.notifications.hide(e)},le.clean=()=>{de.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 Ke({item:e,sortableId:r,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,canDelete:i,hasLink:c,onLinkClick:p,onDelete:m}){const d=!e.animationData&&!!(e.file||e.url)?`${e.id}|${e.file?`${e.file.name}:${e.file.size}`:e.url??""}`:"",[u,g]=f.useState({key:"",data:null}),y=e.animationData??(u.key===d?u.data:null),C=!!d&&u.key!==d;return f.useEffect(()=>{if(!d)return;let k=!1;return(e.file?Me(e.file):fetch(e.url).then(P=>P.json()).then(P=>Ue(P)?P:null)).then(P=>{k||g({key:d,data:P})}).catch(()=>{k||g({key:d,data:null})}),()=>{k=!0}},[d,e.file,e.url]),a.jsx(We,{id:r??e.id,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,itemIsLoading:e.isLoading||C,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:p?()=>p(e):void 0,onDelete:()=>m(e.id),deleteAriaLabel:"Lottie 삭제",children:y?a.jsx(f.Suspense,{fallback:a.jsx("div",{style:{width:t,height:o,display:"block"}}),children:a.jsx(jt,{animationData:y,loop:!0,autoplay:!0,style:{width:t,height:o,display:"block"}})}):a.jsx("div",{className:_e.Empty,style:{width:t,height:o}})})}const Gt=({value:e=[],onChange:r,width:n=160,height:t=200,placeholder:o="Lottie JSON 파일을 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,length:c,minLength:p,maxLength:m,errorMsg:_,isLoading:d,readOnly:u,gap:g=8,canDelete:y=!0})=>{const{isPositionMode:C,resolvedMaxLength:k,placeholderCount:M,slotIds:P,sortableItems:F,sensors:H,handleDragEnd:G,getMetaIndex:Z}=Ye({value:e,length:c,minLength:p,maxLength:m,onChange:r}),E=!!_,w=async b=>{if(u)return;const v=[...b].sort((ee,Q)=>ee.name.localeCompare(Q.name)),L=await Promise.all(v.map(Me));let V=0;const A=v.filter((ee,Q)=>L[Q]!==null?!0:(V++,!1));if(V>0&&le({id:"invalid-lottie-files",message:V===1?"유효하지 않은 Lottie JSON 파일입니다":`${V}개의 파일이 유효하지 않은 Lottie JSON입니다`}),A.length===0)return;const W=e.length,I=Zt(e,A,k);I.length!==W&&r?.(I,{action:"create",itemId:I[W].id,index:W})},S=async(b,v)=>{if(u)return;const L=v[0];if(!L)return;if(!await Me(L)){le({id:"invalid-lottie-files",message:"유효하지 않은 Lottie JSON 파일입니다"});return}const A=Ut(e,L,b);r?.(A,{action:"create",itemId:A[A.length-1].id,index:b})},N=b=>{if(u)return;const v=Z(b),L=Vt(e,b);r?.(L,{action:"delete",itemId:b,index:v})},$=b=>{const v=typeof o=="function"?o(b):o;return typeof v!="string"?v:v.split(`
3
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`
4
4
  <div class="pin-marker">
5
5
  ${n?`<img src="${n}" alt="${r}" width="40" height="40" />`:`
@@ -327,4 +327,4 @@
327
327
  [data-theme="dark"] {
328
328
  ${nt("dark")}
329
329
  }
330
- `,document.head.appendChild(n)},ae=e=>{const r=h.colors[e],n=Object.keys(r).sort((o,l)=>Number(o)-Number(l));return[h.getCSSVariableRef(e,n[0]||n[n.length-1]),h.getCSSVariableRef(e,n[1]||n[n.length-1]),h.getCSSVariableRef(e,n[2]||n[n.length-1]),h.getCSSVariableRef(e,n[3]||n[n.length-1]),h.getCSSVariableRef(e,n[4]||n[n.length-1]),h.getCSSVariableRef(e,n[5]||n[n.length-1]),h.getCSSVariableRef(e,n[6]||n[n.length-1]),h.getCSSVariableRef(e,n[7]||n[n.length-1]),h.getCSSVariableRef(e,n[8]||n[n.length-1]),h.getCSSVariableRef(e,n[9]||n[n.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:'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),ot=f.createContext(void 0),at=f.createContext({}),gr=({children:e,defaultTheme:r="light",naverClientId:n,notificationPosition:t="bottom-center",notificationLimit:o=5,notificationAutoClose:l,notificationZIndex:s})=>{const[i,c]=f.useState(r);f.useEffect(()=>{fr(i),document.documentElement.setAttribute("data-theme",i)},[i]);const p=()=>{c(m=>m==="light"?"dark":"light")};return a.jsx(ot.Provider,{value:{theme:i,setTheme:c,toggleTheme:p},children:a.jsx(at.Provider,{value:{naverClientId:n},children:a.jsxs(x.MantineProvider,{theme:hr,children:[a.jsx(de.Notifications,{position:t,limit:o,autoClose:l,zIndex:s}),e]})})})},yr=()=>{const e=f.useContext(ot);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:n,toast:t,naverClientId:o,onExpandRequest:l,onClick:s,height:i=200})=>{const c=st(),p=o||c.naverClientId,{title:m,address:_,latitude:d,longitude:u}=e,g=n?.label??"길찾기",y=t?.addressCopied??"주소 복사 완료",[C,k]=f.useState(null),M=i-Cr,P=f.useCallback(w=>{w&&w.map&&k(w)},[]),F=f.useCallback(()=>{l?.()},[l]),H=f.useCallback((w,S,N)=>{if(w&&w.map&&d&&u)try{w.addMarker(S),N?.()}catch($){console.error("Error creating map marker:",$)}},[d,u]),G=f.useCallback((w,S)=>{w&&w.map&&d&&u&&(w.clearMarkers(),H(w,{id:`location-marker-${m}`,type:S,position:{latitude:d,longitude:u},title:m,icon:r?.imageUrl,address:_},()=>{w.panTo({latitude:d,longitude:u})}))},[d,u,m,r?.imageUrl,_,H]);f.useEffect(()=>{d&&u&&C&&G(C,"pi")},[C,d,u,G]),f.useEffect(()=>()=>{k(null)},[]);const Z=f.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(_),le(y))},[_,y]),E=f.useMemo(()=>n?.url?n.url:`https://map.naver.com/p/search/${encodeURIComponent(m)}`,[n?.url,m]);return p?a.jsxs("div",{className:re.MapInfo,style:{height:i},onClick:s,children:[a.jsx(et,{clientId:p,children:a.jsxs("div",{className:re.MapInfo__Preview,onClick:F,children:[a.jsx(Ee,{onLoad:P,options:{width:"100%",height:`${M}px`,center:{lat:d,lng:u},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:w=>w.key==="Enter"&&Z(),children:_})]}),a.jsx("a",{className:re.MapInfo__DirectionLink,href:E,target:"_blank",rel:"noreferrer",children:a.jsx(ce,{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로 전달해주세요."})})};D.Button=ce,D.CalendarDatePicker=Fe,D.Checkbox=gt,D.DatePicker=St,D.Dropdown=Mt,D.ImageInput=Yt,D.LottieInput=Gt,D.Map=Ee,D.MapInfo=kr,D.Modal=xe,D.NaverMapProvider=et,D.Pagination=qt,D.PopUiProvider=gr,D.Radio=Xt,D.SearchBar=Qt,D.SegmentButton=Rt,D.Tab=er,D.TextField=rr,D.TimePicker=nr,D.Toggle=or,D.Tooltip=ar,D.getMarkerHTML=Be,D.makeMarkerClustering=tt,D.markerStyles=Xe,D.toast=le,D.useLocation=mr,D.useMap=rt,D.useNaverMap=Le,D.usePopUIConfig=st,D.useTheme=yr,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
330
+ `,document.head.appendChild(n)},ae=e=>{const r=h.colors[e],n=Object.keys(r).sort((o,l)=>Number(o)-Number(l));return[h.getCSSVariableRef(e,n[0]||n[n.length-1]),h.getCSSVariableRef(e,n[1]||n[n.length-1]),h.getCSSVariableRef(e,n[2]||n[n.length-1]),h.getCSSVariableRef(e,n[3]||n[n.length-1]),h.getCSSVariableRef(e,n[4]||n[n.length-1]),h.getCSSVariableRef(e,n[5]||n[n.length-1]),h.getCSSVariableRef(e,n[6]||n[n.length-1]),h.getCSSVariableRef(e,n[7]||n[n.length-1]),h.getCSSVariableRef(e,n[8]||n[n.length-1]),h.getCSSVariableRef(e,n[9]||n[n.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'}),ot=f.createContext(void 0),at=f.createContext({}),gr=({children:e,defaultTheme:r="light",naverClientId:n,notificationPosition:t="bottom-center",notificationLimit:o=5,notificationAutoClose:l,notificationZIndex:s})=>{const[i,c]=f.useState(r);f.useEffect(()=>{fr(i),document.documentElement.setAttribute("data-theme",i)},[i]);const p=()=>{c(m=>m==="light"?"dark":"light")};return a.jsx(ot.Provider,{value:{theme:i,setTheme:c,toggleTheme:p},children:a.jsx(at.Provider,{value:{naverClientId:n},children:a.jsxs(x.MantineProvider,{theme:hr,children:[a.jsx(de.Notifications,{position:t,limit:o,autoClose:l,zIndex:s}),e]})})})},yr=()=>{const e=f.useContext(ot);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:n,toast:t,naverClientId:o,onExpandRequest:l,onClick:s,height:i=200})=>{const c=st(),p=o||c.naverClientId,{title:m,address:_,latitude:d,longitude:u}=e,g=n?.label??"길찾기",y=t?.addressCopied??"주소 복사 완료",[C,k]=f.useState(null),M=i-Cr,P=f.useCallback(w=>{w&&w.map&&k(w)},[]),F=f.useCallback(()=>{l?.()},[l]),H=f.useCallback((w,S,N)=>{if(w&&w.map&&d&&u)try{w.addMarker(S),N?.()}catch($){console.error("Error creating map marker:",$)}},[d,u]),G=f.useCallback((w,S)=>{w&&w.map&&d&&u&&(w.clearMarkers(),H(w,{id:`location-marker-${m}`,type:S,position:{latitude:d,longitude:u},title:m,icon:r?.imageUrl,address:_},()=>{w.panTo({latitude:d,longitude:u})}))},[d,u,m,r?.imageUrl,_,H]);f.useEffect(()=>{d&&u&&C&&G(C,"pi")},[C,d,u,G]),f.useEffect(()=>()=>{k(null)},[]);const Z=f.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(_),le(y))},[_,y]),E=f.useMemo(()=>n?.url?n.url:`https://map.naver.com/p/search/${encodeURIComponent(m)}`,[n?.url,m]);return p?a.jsxs("div",{className:re.MapInfo,style:{height:i},onClick:s,children:[a.jsx(et,{clientId:p,children:a.jsxs("div",{className:re.MapInfo__Preview,onClick:F,children:[a.jsx(Ee,{onLoad:P,options:{width:"100%",height:`${M}px`,center:{lat:d,lng:u},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:w=>w.key==="Enter"&&Z(),children:_})]}),a.jsx("a",{className:re.MapInfo__DirectionLink,href:E,target:"_blank",rel:"noreferrer",children:a.jsx(ce,{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로 전달해주세요."})})};D.Button=ce,D.CalendarDatePicker=Fe,D.Checkbox=ht,D.DatePicker=xt,D.Dropdown=St,D.ImageInput=Wt,D.LottieInput=Gt,D.Map=Ee,D.MapInfo=kr,D.Modal=xe,D.NaverMapProvider=et,D.Pagination=qt,D.PopUiProvider=gr,D.Radio=Xt,D.SearchBar=Qt,D.SegmentButton=Rt,D.Tab=er,D.TextField=rr,D.TimePicker=nr,D.Toggle=or,D.Tooltip=ar,D.getMarkerHTML=Be,D.makeMarkerClustering=tt,D.markerStyles=Xe,D.toast=le,D.useLocation=mr,D.useMap=rt,D.useNaverMap=Le,D.usePopUIConfig=st,D.useTheme=yr,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { jsxs as g, jsx as _ } from "react/jsx-runtime";
3
+ import { Button as p, Loader as L } from "@mantine/core";
4
+ import { BUTTON_LOADER_SIZES as A } from "./style.js";
5
+ import t from "./styles.module.scss.js";
6
+ const c = {
7
+ inner: t.Button__Inner,
8
+ label: t.Button__Label,
9
+ section: t.Button__Section,
10
+ loader: t.Button__Loader
11
+ }, b = {
12
+ sm: t["Button--Small"],
13
+ md: t["Button--Medium"],
14
+ lg: t["Button--Large"]
15
+ }, j = {
16
+ primary: t["Button--Primary"],
17
+ primaryLine: t["Button--PrimaryLine"],
18
+ basic: t["Button--Basic"],
19
+ danger: t["Button--Danger"],
20
+ setting: t["Button--Setting"],
21
+ warning: t["Button--Warning"],
22
+ ghost: t["Button--Ghost"]
23
+ }, E = (...n) => n.filter(Boolean).join(" ") || void 0, N = (n) => {
24
+ const a = (r, o) => {
25
+ const i = Object.keys(r).reduce((s, e) => {
26
+ const u = e, l = [r[u], o[u]].filter(Boolean).join(" ");
27
+ return l && (s[u] = l), s;
28
+ }, {});
29
+ return Object.keys(o).forEach((s) => {
30
+ const e = s;
31
+ !(e in r) && o[e] && (i[e] = o[e]);
32
+ }), i;
33
+ };
34
+ return typeof n == "function" ? (r, o, i) => a(c, n(r, o, i)) : typeof n == "object" && n !== null && !Array.isArray(n) ? a(c, n) : c;
35
+ };
36
+ function D({
37
+ children: n,
38
+ size: a = "md",
39
+ variant: r = "primary",
40
+ type: o = "button",
41
+ isLoading: i = !1,
42
+ loading: s = !1,
43
+ hideLabelOnLoading: e = !0,
44
+ disabled: u = !1,
45
+ className: l,
46
+ classNames: m,
47
+ loaderProps: d,
48
+ ...f
49
+ }) {
50
+ const y = A[a], B = i || s, S = u || B;
51
+ return /* @__PURE__ */ g(
52
+ p,
53
+ {
54
+ type: o,
55
+ unstyled: !0,
56
+ className: E(
57
+ t.Button,
58
+ u ? t.Button__Disabled : "",
59
+ b[a],
60
+ j[r],
61
+ l
62
+ ),
63
+ classNames: N(m),
64
+ disabled: S,
65
+ ...f,
66
+ children: [
67
+ B && /* @__PURE__ */ _(L, { color: "currentColor", size: y, ...d }),
68
+ /* @__PURE__ */ _("span", { className: t.Button__Label, children: B && e ? null : n })
69
+ ]
70
+ }
71
+ );
72
+ }
73
+ export {
74
+ D as Button
75
+ };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ const e = {
3
+ sm: 14,
4
+ md: 16,
5
+ lg: 18
6
+ };
7
+ export {
8
+ e as BUTTON_LOADER_SIZES
9
+ };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ const t = "styles-module__Button___7ywU9", _ = "styles-module__Button__Inner___s7vuY", o = "styles-module__Button__Label___xnZNh", n = "styles-module__Button__Section___7GPRl", e = "styles-module__Button__Loader___AZg1v", u = "styles-module__Button__Disabled___NUWy8", s = {
3
+ Button: t,
4
+ Button__Inner: _,
5
+ Button__Label: o,
6
+ Button__Section: n,
7
+ Button__Loader: e,
8
+ "Button--Small": "styles-module__Button--Small___9VzCE",
9
+ "Button--Medium": "styles-module__Button--Medium___35lhd",
10
+ "Button--Large": "styles-module__Button--Large___fbUio",
11
+ "Button--Primary": "styles-module__Button--Primary___1ZKgs",
12
+ Button__Disabled: u,
13
+ "Button--PrimaryLine": "styles-module__Button--PrimaryLine___76iyF",
14
+ "Button--Basic": "styles-module__Button--Basic___sWKzj",
15
+ "Button--Warning": "styles-module__Button--Warning___8gZ6-",
16
+ "Button--Setting": "styles-module__Button--Setting___KNjZA",
17
+ "Button--Danger": "styles-module__Button--Danger___m9tbm",
18
+ "Button--Ghost": "styles-module__Button--Ghost___-zzS-"
19
+ };
20
+ export {
21
+ t as Button,
22
+ u as Button__Disabled,
23
+ _ as Button__Inner,
24
+ o as Button__Label,
25
+ e as Button__Loader,
26
+ n as Button__Section,
27
+ s as default
28
+ };
@@ -0,0 +1,119 @@
1
+ "use client";
2
+ import { jsxs as V, jsx as d } from "react/jsx-runtime";
3
+ import { DatePicker as W } from "@mantine/dates";
4
+ import { IconChevronRight as b, IconChevronLeft as j } from "@pop-ui/foundation";
5
+ import s from "dayjs";
6
+ import "dayjs/locale/ko.js";
7
+ import { useState as M, useMemo as F, useCallback as _ } from "react";
8
+ import a from "./styles.module.scss.js";
9
+ import { getEmptyValueForType as k, createExcludedDateChecker as T, resolveDatePickerValue as O, mergeClassNamesWithDefault as z, hasExcludedDateInRange as G } from "./utils.js";
10
+ const K = (r) => {
11
+ if (r == null)
12
+ return null;
13
+ if (Array.isArray(r)) {
14
+ for (let n = r.length - 1; n >= 0; n -= 1) {
15
+ const t = r[n];
16
+ if (t instanceof Date)
17
+ return s(t).format("YYYY-MM-DD");
18
+ }
19
+ return null;
20
+ }
21
+ return r instanceof Date ? s(r).format("YYYY-MM-DD") : null;
22
+ }, U = {
23
+ levelsGroup: a.CalendarDatePicker__Wrapper,
24
+ calendarHeader: a.CalendarDatePicker__Header,
25
+ calendarHeaderLevel: a.CalendarDatePicker__HeaderLevel,
26
+ calendarHeaderControl: a.CalendarDatePicker__HeaderControl,
27
+ calendarHeaderControlIcon: a.CalendarDatePicker__HeaderControlIcon,
28
+ month: a.CalendarDatePicker__Month,
29
+ monthCell: a.CalendarDatePicker__MonthCell,
30
+ day: a.CalendarDatePicker__Day,
31
+ monthRow: a.CalendarDatePicker__MonthRow,
32
+ weekdaysRow: a.CalendarDatePicker__WeekdaysRow,
33
+ weekday: a.CalendarDatePicker__Weekday
34
+ }, ae = ({
35
+ excludedDates: r = [],
36
+ excludedDays: n = [],
37
+ type: t = "default",
38
+ value: D,
39
+ onChange: u,
40
+ highlightToday: m = !1,
41
+ ...I
42
+ }) => {
43
+ const { classNames: g, date: l, defaultDate: C, onDateChange: y, getDayProps: h, ...L } = I, [H, p] = M(
44
+ () => D ?? k(t)
45
+ ), [N, v] = M(() => l || C || (K(D ?? k(t)) ?? /* @__PURE__ */ new Date())), A = F(
46
+ () => T({
47
+ excludedDays: n,
48
+ excludedDates: r
49
+ }),
50
+ [n, r]
51
+ ), f = _(
52
+ (e) => {
53
+ l === void 0 && v(e), y?.(e);
54
+ },
55
+ [l, y]
56
+ ), w = (e) => {
57
+ if (t === "range" && Array.isArray(e) && e.length === 2) {
58
+ const [o, i] = e;
59
+ if (o && i && G(o, i, r, n)) {
60
+ const c = k("range");
61
+ p(c), u?.(c);
62
+ return;
63
+ }
64
+ }
65
+ p(e), u?.(e);
66
+ }, x = O({
67
+ type: t,
68
+ externalValue: D,
69
+ internalValue: H
70
+ }), E = _(
71
+ (e) => {
72
+ const o = s(e).date(), c = s(e).isSame(s(), "day") && m;
73
+ return /* @__PURE__ */ V("span", { className: a.CalendarDatePicker__DayContent, children: [
74
+ /* @__PURE__ */ d("span", { className: a.CalendarDatePicker__DayLabel, children: o }),
75
+ c && /* @__PURE__ */ d("span", { className: a.CalendarDatePicker__TodayIndicator, children: "오늘" })
76
+ ] });
77
+ },
78
+ [m]
79
+ ), R = z(U, g), P = l ?? N, Y = s(P ?? /* @__PURE__ */ new Date()).format("YYYY-MM"), S = _(
80
+ (e) => {
81
+ const o = h?.(e) ?? {}, i = s(e).format("YYYY-MM") !== Y;
82
+ return {
83
+ ...o,
84
+ onClick: (c) => {
85
+ o.onClick?.(c), i && f(e);
86
+ }
87
+ };
88
+ },
89
+ [Y, h, f]
90
+ );
91
+ return /* @__PURE__ */ d(
92
+ W,
93
+ {
94
+ locale: "ko",
95
+ firstDayOfWeek: 0,
96
+ monthLabelFormat: "YYYY년 M월",
97
+ maxLevel: "month",
98
+ type: t,
99
+ previousIcon: /* @__PURE__ */ d(j, {}),
100
+ nextIcon: /* @__PURE__ */ d(b, {}),
101
+ ...L,
102
+ size: "lg",
103
+ onChange: w,
104
+ weekendDays: [0],
105
+ highlightToday: m,
106
+ classNames: R,
107
+ defaultDate: l === void 0 ? C : void 0,
108
+ date: P,
109
+ onDateChange: f,
110
+ getDayProps: S,
111
+ value: x,
112
+ excludeDate: A,
113
+ renderDay: E
114
+ }
115
+ );
116
+ };
117
+ export {
118
+ ae as CalendarDatePicker
119
+ };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ const e = "styles-module__CalendarDatePicker__Wrapper___n4ux3", a = "styles-module__CalendarDatePicker__DayContent___2xr8Q", _ = "styles-module__CalendarDatePicker__DayLabel___-4E1W", r = "styles-module__CalendarDatePicker__TodayIndicator___ij6hs", t = "styles-module__CalendarDatePicker__Day___eYyiw", l = "styles-module__CalendarDatePicker__Header___hGYbK", n = "styles-module__CalendarDatePicker__HeaderLevel___yuhOQ", d = "styles-module__CalendarDatePicker__HeaderControl___gz5tC", o = "styles-module__CalendarDatePicker__HeaderControlIcon___OVuQp", c = "styles-module__CalendarDatePicker__Month___8-Nvy", C = "styles-module__CalendarDatePicker__MonthRow___PihZV", s = "styles-module__CalendarDatePicker__MonthCell___bEPui", D = "styles-module__CalendarDatePicker__WeekdaysRow___lbdgy", i = "styles-module__CalendarDatePicker__Weekday___-Seq9", k = {
3
+ CalendarDatePicker__Wrapper: e,
4
+ CalendarDatePicker__DayContent: a,
5
+ CalendarDatePicker__DayLabel: _,
6
+ CalendarDatePicker__TodayIndicator: r,
7
+ CalendarDatePicker__Day: t,
8
+ CalendarDatePicker__Header: l,
9
+ CalendarDatePicker__HeaderLevel: n,
10
+ CalendarDatePicker__HeaderControl: d,
11
+ CalendarDatePicker__HeaderControlIcon: o,
12
+ CalendarDatePicker__Month: c,
13
+ CalendarDatePicker__MonthRow: C,
14
+ CalendarDatePicker__MonthCell: s,
15
+ CalendarDatePicker__WeekdaysRow: D,
16
+ CalendarDatePicker__Weekday: i
17
+ };
18
+ export {
19
+ t as CalendarDatePicker__Day,
20
+ a as CalendarDatePicker__DayContent,
21
+ _ as CalendarDatePicker__DayLabel,
22
+ l as CalendarDatePicker__Header,
23
+ d as CalendarDatePicker__HeaderControl,
24
+ o as CalendarDatePicker__HeaderControlIcon,
25
+ n as CalendarDatePicker__HeaderLevel,
26
+ c as CalendarDatePicker__Month,
27
+ s as CalendarDatePicker__MonthCell,
28
+ C as CalendarDatePicker__MonthRow,
29
+ r as CalendarDatePicker__TodayIndicator,
30
+ i as CalendarDatePicker__Weekday,
31
+ D as CalendarDatePicker__WeekdaysRow,
32
+ e as CalendarDatePicker__Wrapper,
33
+ k as default
34
+ };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import u from "dayjs";
3
+ const A = ({
4
+ excludedDays: n = [],
5
+ excludedDates: t = []
6
+ }) => {
7
+ const f = [], a = [];
8
+ for (const r of t)
9
+ typeof r == "string" ? f.push(r) : a.push(r);
10
+ const i = f.map((r) => u(r)).filter((r) => r.isValid()).map((r) => r.format("YYYY-MM-DD")), o = a.map(([r, e]) => [u(r), u(e)]).filter(([r, e]) => r.isValid() && e.isValid());
11
+ return (r) => {
12
+ const e = u(r);
13
+ if (!e.isValid()) return !1;
14
+ if (Array.isArray(n) && n.includes(e.day()) || i.includes(e.format("YYYY-MM-DD")))
15
+ return !0;
16
+ for (const [s, d] of o)
17
+ if ((e.isSame(s, "day") || e.isAfter(s, "day")) && (e.isSame(d, "day") || e.isBefore(d, "day")))
18
+ return !0;
19
+ return !1;
20
+ };
21
+ }, m = (n, t, f, a) => {
22
+ const i = u(n), o = u(t);
23
+ for (const r of f)
24
+ if (Array.isArray(r)) {
25
+ const e = u(r[0]), s = u(r[1]);
26
+ if (!e.isValid() || !s.isValid()) continue;
27
+ if (!(o.isBefore(e, "day") || i.isAfter(s, "day")))
28
+ return !0;
29
+ }
30
+ for (const r of f)
31
+ if (typeof r == "string") {
32
+ const e = u(r);
33
+ if (!e.isValid()) continue;
34
+ if ((e.isSame(i, "day") || e.isAfter(i, "day")) && (e.isSame(o, "day") || e.isBefore(o, "day")))
35
+ return !0;
36
+ }
37
+ if (a.length > 0) {
38
+ let r = i;
39
+ for (; r.isBefore(o, "day") || r.isSame(o, "day"); ) {
40
+ if (a.includes(r.day()))
41
+ return !0;
42
+ r = r.add(1, "day");
43
+ }
44
+ }
45
+ return !1;
46
+ }, c = (n = "default") => {
47
+ switch (n) {
48
+ case "range":
49
+ return [null, null];
50
+ case "multiple":
51
+ return [];
52
+ default:
53
+ return null;
54
+ }
55
+ }, l = (n = "default", t) => t == null ? c(n) : n === "range" ? Array.isArray(t) ? t : c("range") : n === "multiple" ? Array.isArray(t) ? t : c("multiple") : Array.isArray(t) ? t[0] ?? null : t, D = ({
56
+ type: n,
57
+ externalValue: t,
58
+ internalValue: f
59
+ }) => t !== void 0 ? l(n, t) : f !== void 0 ? l(n, f) : c(n), h = (n, t) => {
60
+ const f = (a, i) => {
61
+ const o = Object.keys(a).reduce(
62
+ (r, e) => {
63
+ const s = e, d = a[s], p = i[s], y = [d, p].filter(Boolean).join(" ");
64
+ return y && (r[s] = y), r;
65
+ },
66
+ {}
67
+ );
68
+ return Object.keys(i).forEach((r) => {
69
+ const e = r, s = i[e];
70
+ !(e in a) && s && (o[e] = s);
71
+ }), o;
72
+ };
73
+ return typeof t == "function" ? (a, i, o) => f(n, t(a, i, o)) : typeof t == "object" && t !== null && !Array.isArray(t) ? f(n, t) : n;
74
+ };
75
+ export {
76
+ A as createExcludedDateChecker,
77
+ c as getEmptyValueForType,
78
+ m as hasExcludedDateInRange,
79
+ h as mergeClassNamesWithDefault,
80
+ l as normalizeValueForType,
81
+ D as resolveDatePickerValue
82
+ };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx as c } from "react/jsx-runtime";
3
+ import { Checkbox as r } from "@mantine/core";
4
+ import o from "./styles.module.scss.js";
5
+ const C = {
6
+ sm: o["Checkbox--Small"],
7
+ md: o["Checkbox--Medium"],
8
+ lg: o["Checkbox--Large"]
9
+ }, h = {
10
+ sm: 18,
11
+ md: 24,
12
+ lg: 32
13
+ }, x = ({ size: e = "md", ...m }) => {
14
+ const t = C[e], s = h[e];
15
+ return /* @__PURE__ */ c(
16
+ r,
17
+ {
18
+ className: t,
19
+ size: e,
20
+ styles: {
21
+ inner: {
22
+ width: s,
23
+ height: s
24
+ }
25
+ },
26
+ ...m
27
+ }
28
+ );
29
+ };
30
+ export {
31
+ x as Checkbox
32
+ };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ const e = {
3
+ "Checkbox--Small": "styles-module__Checkbox--Small___VZGlw",
4
+ "Checkbox--Medium": "styles-module__Checkbox--Medium___Vwpa3",
5
+ "Checkbox--Large": "styles-module__Checkbox--Large___ybTGE"
6
+ };
7
+ export {
8
+ e as default
9
+ };