@pop-ui/core 0.0.41 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -148
- package/dist/core.css +1 -1
- package/dist/core.js +2082 -1164
- package/dist/core.umd.cjs +25 -23
- package/dist/types/index.d.ts +127 -28
- package/package.json +10 -5
- package/src/components/CalendarDatePicker/README.md +409 -0
- package/LICENSE.md +0 -21
package/dist/core.umd.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
(function(f,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("react"),require("@pop-ui/foundation"),require("@mantine/notifications"),require("@mantine/dates"),require("dayjs"),require("dayjs/locale/ko"),require("@mantine/dropzone")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","react","@pop-ui/foundation","@mantine/notifications","@mantine/dates","dayjs","dayjs/locale/ko","@mantine/dropzone"],a):(f=typeof globalThis<"u"?globalThis:f||self,a(f.Core={},f.jsxRuntime,f.MantineCore,f.React,f.foundation,f.notifications,f.dates,f.dayjs,null,f.dropzone))})(this,function(f,a,x,m,i,O,z,v,ot,R){"use strict";const me={primary:i.TextColorButtonTextPrimaryDefault,primaryLine:i.TextColorButtonTextPrimarylineDefault,basic:i.TextColorButtonTextBasicDefault,danger:i.TextColorButtonTextPrimaryDefault,setting:i.TextColorButtonTextPrimaryDefault,warning:i.TextColorButtonTextPrimaryDefault},ge={primary:{default:{backgroundColor:i.BgColorButtonBgPrimaryDefault,color:i.TextColorButtonTextPrimaryDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgPrimaryHover,color:i.TextColorButtonTextPrimaryHover},active:{backgroundColor:i.BgColorButtonBgPrimaryPressed,color:i.TextColorButtonTextPrimaryPressed},focus:{backgroundColor:i.BgColorButtonBgPrimaryFocused,color:i.TextColorButtonTextPrimaryFocused},disabled:{backgroundColor:i.BgColorButtonBgPrimaryDisabled,color:i.TextColorButtonTextPrimaryDisabled,cursor:"not-allowed"}},primaryLine:{default:{backgroundColor:i.BgColorButtonBgPrimarylineDefault,color:i.TextColorButtonTextPrimarylineDefault,border:`1px solid ${i.BorderColorButtonBorderPrimarylineDefault}`},hover:{backgroundColor:i.BgColorButtonBgPrimarylineHover,color:i.TextColorButtonTextPrimarylineHover,borderColor:i.BorderColorButtonBorderPrimarylineHover},active:{backgroundColor:i.BgColorButtonBgPrimarylinePressed,color:i.TextColorButtonTextPrimarylinePressed,borderColor:i.BorderColorButtonBorderPrimarylinePressed},focus:{backgroundColor:i.BgColorButtonBgPrimarylineFocused,color:i.TextColorButtonTextPrimarylineFocused,borderColor:i.BorderColorButtonBorderPrimarylineFocused},disabled:{backgroundColor:i.BgColorButtonBgPrimarylineDisabled,color:i.TextColorButtonTextPrimarylineDisabled,cursor:"not-allowed"}},basic:{default:{backgroundColor:i.BgColorButtonBgBasicDefault,color:i.TextColorButtonTextBasicDefault,border:`1px solid ${i.BorderColorButtonBorderBasicDefault}`},hover:{backgroundColor:i.BgColorButtonBgBasicHover,color:i.TextColorButtonTextBasicHover,borderColor:i.BorderColorButtonBorderBasicHover},active:{backgroundColor:i.BgColorButtonBgBasicPreseed,color:i.TextColorButtonTextBasicPressed,borderColor:i.BorderColorButtonBorderBasicPressed},focus:{backgroundColor:i.BgColorButtonBgBasicFocused,color:i.TextColorButtonTextBasicFocused,borderColor:i.BorderColorButtonBorderBasicFocused},disabled:{backgroundColor:i.BgColorButtonBgBasicDisabled,color:i.TextColorButtonTextBasicDisabled,cursor:"not-allowed"}},danger:{default:{backgroundColor:i.BgColorButtonBgWarningDefault,color:i.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgWarningHover,color:i.TextColorButtonTextWarningHover},active:{backgroundColor:i.BgColorButtonBgWarningPressed,color:i.TextColorButtonTextWarningPressed},focus:{backgroundColor:i.BgColorButtonBgWarningFocused,color:i.TextColorButtonTextWarningFocused},disabled:{backgroundColor:i.BgColorButtonBgWarningDisabled,color:i.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}},setting:{default:{backgroundColor:i.BgColorButtonBgSettingDefault,color:i.TextColorButtonTextSettingDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgSettingHover,color:i.TextColorButtonTextSettingHover},active:{backgroundColor:i.BgColorButtonBgSettingPressed,color:i.TextColorButtonTextSettingPressed},focus:{backgroundColor:i.BgColorButtonBgSettingFocused,color:i.TextColorButtonTextSettingFocused},disabled:{backgroundColor:i.BgColorButtonBgSettingDisabled,color:i.TextColorButtonTextSettingDisabled,cursor:"not-allowed"}},warning:{default:{backgroundColor:i.BgColorButtonBgWarningDefault,color:i.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgWarningHover,color:i.TextColorButtonTextWarningHover},active:{backgroundColor:i.BgColorButtonBgWarningPressed,color:i.TextColorButtonTextWarningPressed},focus:{backgroundColor:i.BgColorButtonBgWarningFocused,color:i.TextColorButtonTextWarningFocused},disabled:{backgroundColor:i.BgColorButtonBgWarningDisabled,color:i.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}}},he={lg:{height:"50px",padding:"0 20px",fontSize:"18px",fontWeight:700,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},md:{height:"40px",padding:"0 16px",fontSize:"16px",fontWeight:600,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},sm:{height:"30px",padding:"0 12px",fontSize:"14px",fontWeight:600,borderRadius:"4px",lineHeight:"130%",fontFamily:"Pretendard"}};function fe(t,s){const r=ge[t];return{root:{...he[s],...r.default,"&:hover:not(:disabled)":r.hover,"&:active:not(:disabled)":r.active,"&:focus:not(:disabled)":r.focus,"&:disabled":r.disabled}}}function ee({children:t,size:s="md",variant:r="primary",isLoading:e=!1,disabled:o=!1,...l}){const n=m.useMemo(()=>fe(r,s),[r,s]),c=me[r],d=m.useMemo(()=>{switch(s){case"lg":return 18;case"sm":return 14;case"md":default:return 16}},[s]);return a.jsx(x.Button,{type:"button",styles:n,disabled:o||e,...l,children:e?a.jsx(x.Loader,{color:c,size:d}):t})}const U={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},Ce=({size:t="md",...s})=>{let r=U["Checkbox--Medium"],e=24;return t==="sm"?(r=U["Checkbox--Small"],e=18):t==="lg"&&(r=U["Checkbox--Large"],e=32),a.jsx(x.Checkbox,{className:r,styles:{inner:{width:e,height:e}},...s})},P={datePickerWrapper:"styles-module__datePickerWrapper___8Bdcn",todayIndicator:"styles-module__todayIndicator___Zl0e4",day:"styles-module__day___DaYHh",calendarHeader:"styles-module__calendarHeader___9j1oi",calendarHeaderLevel:"styles-module__calendarHeaderLevel___wHs50",calendarHeaderControl:"styles-module__calendarHeaderControl___k317W",month:"styles-module__month___doF-A",monthRow:"styles-module__monthRow___ksziO",weekday:"styles-module__weekday___PVnxV"},xe=({excludedDays:t=[],excludedDates:s=[]})=>{const r=[],e=[];for(const n of s)typeof n=="string"?r.push(n):e.push(n);const o=r.map(n=>v(n)).filter(n=>n.isValid()).map(n=>n.format("YYYY-MM-DD")),l=e.map(([n,c])=>[v(n),v(c)]).filter(([n,c])=>n.isValid()&&c.isValid());return n=>{const c=v(n);if(!c.isValid())return!1;if(Array.isArray(t)&&t.includes(c.day())||o.includes(c.format("YYYY-MM-DD")))return!0;for(const[d,h]of l)if((c.isSame(d,"day")||c.isAfter(d,"day"))&&(c.isSame(h,"day")||c.isBefore(h,"day")))return!0;return!1}},ye=(t,s,r,e)=>{const o=v(t),l=v(s);for(const n of r)if(Array.isArray(n)){const c=v(n[0]),d=v(n[1]);if(!c.isValid()||!d.isValid())continue;if(!(l.isBefore(c,"day")||o.isAfter(d,"day")))return!0}for(const n of r)if(typeof n=="string"){const c=v(n);if(!c.isValid())continue;if((c.isSame(o,"day")||c.isAfter(o,"day"))&&(c.isSame(l,"day")||c.isBefore(l,"day")))return!0}if(e.length>0){let n=o;for(;n.isBefore(l,"day")||n.isSame(l,"day");){if(e.includes(n.day()))return!0;n=n.add(1,"day")}}return!1},A=(t="default")=>{switch(t){case"range":return[null,null];case"multiple":return[];default:return null}},te=(t="default",s)=>s==null?A(t):t==="range"?Array.isArray(s)?s:A("range"):t==="multiple"?Array.isArray(s)?s:A("multiple"):Array.isArray(s)?s[0]??null:s,Te=({type:t,externalValue:s,internalValue:r})=>s!==void 0?te(t,s):r!==void 0?te(t,r):A(t),Be=(t,s)=>{const r=(e,o)=>{const l=Object.keys(e).reduce((n,c)=>{const d=c,h=e[d],u=o[d],_=[h,u].filter(Boolean).join(" ");return _&&(n[d]=_),n},{});return Object.keys(o).forEach(n=>{const c=n,d=o[c];!(c in e)&&d&&(l[c]=d)}),l};return typeof s=="function"?(e,o,l)=>r(t,s(e,o,l)):typeof s=="object"&&s!==null&&!Array.isArray(s)?r(t,s):t},be={levelsGroup:P.datePickerWrapper,calendarHeader:P.calendarHeader,calendarHeaderLevel:P.calendarHeaderLevel,calendarHeaderControl:P.calendarHeaderControl,month:P.month,day:P.day,monthRow:P.monthRow,weekday:P.weekday},ke=({excludedDates:t=[],excludedDays:s=[],type:r="default",value:e,onChange:o,highlightToday:l=!1,...n})=>{const[c,d]=m.useState(()=>e??A(r)),h=m.useMemo(()=>xe({excludedDays:s,excludedDates:t}),[s,t]),u=T=>{if(r==="range"&&Array.isArray(T)&&T.length===2){const[B,S]=T;if(B&&S&&ye(B,S,t,s)){const L=A("range");d(L),o?.(L);return}}d(T),o?.(T)},_=Te({type:r,externalValue:e,internalValue:c}),g=m.useCallback(T=>{const B=v(T).date(),L=v(T).isSame(v(),"day")&&l;return a.jsxs(a.Fragment,{children:[B,L&&a.jsx("span",{className:P.todayIndicator,children:"오늘"})]})},[l]),{classNames:p,...C}=n,y=Be(be,p);return a.jsx(z.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:r,previousIcon:a.jsx(i.IconChevronLeft,{}),nextIcon:a.jsx(i.IconChevronRight,{}),...C,size:"lg",onChange:u,weekendDays:[0],highlightToday:l,classNames:y,value:_,excludeDate:h,renderDay:g})},Z={"DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM"},Me=({size:t="md",type:s="default",withTime:r,...e})=>{let o=Z["DatePicker--Medium"],l=18;return t==="sm"?(o=Z["DatePicker--Small"],l=14):t==="lg"&&(o=Z["DatePicker--Large"],l=24),r?a.jsx(z.DateTimePicker,{className:o,size:t,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:a.jsx(i.IconCalendar,{size:l}),...e}):a.jsx(z.DatePickerInput,{className:o,type:s,size:t,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD",rightSection:a.jsx(i.IconCalendar,{size:l}),...e})},w={"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"},Se=({label:t,labelPosition:s="top",size:r="md",required:e,tooltip:o,tooltipPosition:l="top",errorMsg:n,description:c,...d})=>{const[h,u]=m.useState(!1);let _=w["Dropdown__Label--Medium"],g=w["Dropdown--Medium"],p=w["Dropdown__Tooltip--Medium"],C=18;return r==="sm"?(_=w["Dropdown__Label--Small"],g=w["Dropdown--Small"],p=w["Dropdown__Tooltip--Small"],C=14):r==="lg"&&(_=w["Dropdown__Label--Large"],g=w["Dropdown--Large"],p=w["Dropdown__Tooltip--Large"],C=24),a.jsxs("div",{className:s==="top"?w["Dropdown--TopLabel"]:w["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[t&&a.jsx(x.Input.Label,{required:e,className:_,children:t}),o&&a.jsx(x.Tooltip,{label:o,position:l,children:a.jsx("div",{className:p,children:a.jsx(i.IconInfoCircle,{size:r==="sm"?14:r==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(x.Select,{...d,size:r,error:n,className:g,rightSection:h?a.jsx(i.IconChevronUp,{size:C}):a.jsx(i.IconChevronDown,{size:C}),onDropdownOpen:()=>u(!0),onDropdownClose:()=>u(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),c&&a.jsx(x.Input.Description,{className:w.Dropdown__Description,children:c}),n&&a.jsx(x.Input.Error,{className:w.Dropdown__ErrorMsg,children:n})]})]})},H={ImageUploader:"styles-module__ImageUploader___pO3AP",ImageUploader__Preview:"styles-module__ImageUploader__Preview___DI5K4",ImageUploader__Wrapper:"styles-module__ImageUploader__Wrapper___SpAGM",ImageUploader__FileClearButton:"styles-module__ImageUploader__FileClearButton___w1HyS"},we=({width:t,height:s,defaultMsg:r="이미지 업로드",file:e,onDrop:o,showClearButton:l,onClear:n,...c})=>{const[d,h]=m.useState(e),u=m.useCallback(()=>{h(void 0),n&&n()},[n]);return a.jsxs("div",{className:H.ImageUploader__Wrapper,children:[l&&d?a.jsx("div",{className:H.ImageUploader__FileClearButton,onClick:u,children:a.jsx(i.IconCloseCircle,{size:24})}):null,a.jsx(R.Dropzone,{...c,maxFiles:1,className:H.ImageUploader,accept:R.IMAGE_MIME_TYPE,onDrop:_=>{h(_[0]),o&&o(_)},style:{width:t,height:s},children:a.jsx(a.Fragment,{children:d?a.jsx("img",{className:H.ImageUploader__Preview,src:typeof d=="string"?d:URL.createObjectURL(d),alt:`파일명: ${typeof d=="string"?d:d.name}`,title:`파일명: ${typeof d=="string"?d:d.name}`}):a.jsxs("div",{children:[a.jsx(i.IconPhoto,{size:48}),a.jsx("span",{children:r})]})})})]})},ve=({size:t="md",width:s,withCloseButton:r=!1,...e})=>{let o=768;return t==="xs"?o=360:t==="sm"?o=544:t==="lg"?o=1e3:t==="xl"&&(o=1200),a.jsx(x.Modal,{size:s||o,withCloseButton:r,...e})},$={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"},Ie=({currentPageIdx:t,rowsPerPage:s,totalLength:r,paginationSize:e,onPageChange:o,...l})=>{const[n,c]=m.useState(t),d=s||50,h=r||1,u=e||5;m.useEffect(()=>{c(t)},[t]);const _=()=>{o&&o(n-(n%u+1)),c(p=>p-(p%u+1))},g=()=>{o&&o(n+u-n%u),c(p=>p+u-p%u)};return a.jsxs("div",{...l,className:$.Pagination,children:[n>=u?a.jsx("button",{className:$.Pagination__Arrow,onClick:_,children:a.jsx(i.IconChevronLeft,{size:20})}):null,new Array(u).fill(0).map((p,C)=>{const y=Math.floor(n/u)*u+C+1;if(!(y>Math.ceil(h/d)))return a.jsx("button",{className:n===y-1?$["Pagination__PageIndex--Active"]:$.Pagination__PageIndex,onClick:()=>{c(y-1),o&&o(y-1)},children:y},`pagination_${C}`)}),Math.floor(n/u)*u+u<Math.ceil(h/d)?a.jsx("button",{className:$.Pagination__Arrow,onClick:g,children:a.jsx(i.IconChevronRight,{size:20})}):null]})},Y={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Le=({size:t="md",...s})=>{let r=Y["Radio--Medium"];return t==="sm"?r=Y["Radio--Small"]:t==="lg"&&(r=Y["Radio--Large"]),a.jsx(x.Radio,{className:r,size:t,...s})},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"},Pe=({label:t,labelPosition:s="top",size:r="md",required:e,tooltip:o,tooltipPosition:l="top",errorMsg:n,description:c,onChange:d,onClear:h,...u})=>{const[_,g]=m.useState(0);let p=k["SearchBar__Label--Medium"],C=k["SearchBar--Medium"],y=k["SearchBar__Tooltip--Medium"];r==="sm"?(p=k["SearchBar__Label--Small"],C=k["SearchBar--Small"],y=k["SearchBar__Tooltip--Small"]):r==="lg"&&(p=k["SearchBar__Label--Large"],C=k["SearchBar--Large"],y=k["SearchBar__Tooltip--Large"]);const T=m.useCallback(B=>{d&&(g(B?.length),d(B))},[d]);return a.jsxs("div",{className:s==="top"?k["SearchBar--TopLabel"]:k["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[t&&a.jsx(x.Input.Label,{required:e,className:p,children:t}),o&&a.jsx(x.Tooltip,{label:o,position:l,children:a.jsx("div",{className:y,children:a.jsx(i.IconInfoCircle,{size:r==="sm"?14:r==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:k.SearchBar__Wrapper,children:a.jsx(x.Autocomplete,{...u,size:r,error:n,className:C,onChange:T,leftSection:a.jsx(i.IconSearch,{size:r==="sm"?16:r==="lg"?24:20}),rightSection:h&&_>0?a.jsx("div",{className:k.SearchBar__ClearButton,onClick:h,children:a.jsx(i.IconClose,{size:r==="sm"?16:r==="lg"?24:20})}):void 0})}),c&&a.jsx(x.Input.Description,{className:k.SearchBar__Description,children:c}),n&&a.jsx(x.Input.Error,{className:k.SearchBar__ErrorMsg,children:n})]})]})},V={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},De=({size:t="md",radius:s=6,...r})=>{let e=V["SegmentButton--Medium"];return t==="sm"?e=V["SegmentButton--Small"]:t==="lg"&&(e=V["SegmentButton--Large"]),a.jsx(x.SegmentedControl,{className:e,size:t,radius:s,styles:{control:{borderWidth:"0 !important"}},...r})},re={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},Fe=({tabList:t=[],containerPaddingTop:s,...r})=>a.jsxs(x.Tabs,{...r,children:[a.jsx(x.Tabs.List,{className:re.Tab__TitleList,children:t?.map((e,o)=>a.jsxs(x.Tabs.Tab,{value:e.value,leftSection:e.icon,children:[e.title,a.jsx("div",{className:re.Tab__BorderBottom})]},`tab_${o}`))}),t?.map((e,o)=>a.jsx(x.Tabs.Panel,{value:e.value,pt:s,children:e.body},`tab_panel_${o}`))]}),b={"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"},Ee=t=>{const{label:s,labelPosition:r="top",size:e="md",required:o,tooltip:l,tooltipPosition:n="top",errorMsg:c,description:d,textarea:h=!1,maxTextCount:u,onChange:_,onClear:g,...p}=t,C="minRows"in t?t.minRows:void 0,[y,T]=m.useState(0);let B=b["TextField__Label--Medium"],S=b["TextField--Medium"],L=b["TextField__Tooltip--Medium"];e==="sm"?(B=b["TextField__Label--Small"],S=b["TextField--Small"],L=b["TextField__Tooltip--Small"]):e==="lg"&&(B=b["TextField__Label--Large"],S=b["TextField--Large"],L=b["TextField__Tooltip--Large"]);const W=m.useCallback(E=>{if(u){if(E.currentTarget?.value?.length>u)return;T(E.currentTarget?.value?.length),_&&_(E)}_&&(T(E.currentTarget?.value?.length),_(E))},[u,_]);return a.jsxs("div",{className:r==="top"?b["TextField--TopLabel"]:b["TextField--LeftLabel"],children:[a.jsxs("div",{children:[s&&a.jsx(x.Input.Label,{required:o,className:B,children:s}),l&&a.jsx(x.Tooltip,{label:l,position:n,children:a.jsx("div",{className:L,children:a.jsx(i.IconInfoCircle,{size:e==="sm"?14:e==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:b.TextField__Wrapper,children:[h?a.jsx(x.Textarea,{className:b["TextField--Textarea"],size:e,minRows:C,error:c,onChange:W,disabled:p?.disabled,...p}):a.jsx(x.Input,{className:S,error:c,onChange:W,rightSection:g&&y>0?a.jsx("div",{className:b.TextField__ClearButton,onClick:g,children:a.jsx(i.IconClose,{size:e==="sm"?16:e==="lg"?24:20})}):void 0,...p}),u&&u>0&&a.jsx("span",{className:b.TextField__TextCounter,children:`${y}/${u}`})]}),d&&a.jsx(x.Input.Description,{className:b.TextField__Description,children:d}),c&&a.jsx(x.Input.Error,{className:b.TextField__ErrorMsg,children:c})]})]})},j={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},Ae=({size:t="md",...s})=>{const r=m.useRef(null);let e=j["TimePicker--Medium"],o=18;return t==="sm"?(e=j["TimePicker--Small"],o=14):t==="lg"&&(e=j["TimePicker--Large"],o=24),a.jsx(z.TimeInput,{ref:r,className:e,size:t,...s,rightSection:a.jsx(x.ActionIcon,{onClick:()=>{r&&r?.current?.showPicker()},children:a.jsx(i.IconClock,{size:o})})})},F={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"},N=t=>{const s=typeof t=="string"?{message:t}:t,{message:r,id:e,icon:o,autoClose:l}=s;O.notifications.show({id:e,message:a.jsx("div",{className:F.Toast__Message,children:r}),icon:o,autoClose:l,classNames:{root:F.Toast,body:F.Toast__Body,icon:F.Toast__Icon},withCloseButton:!1,withBorder:!1})};N.update=(t,s)=>{const r=typeof s=="string"?{message:s}:s,{message:e,icon:o,autoClose:l}=r;O.notifications.update({id:t,message:a.jsx("div",{className:F.Toast__Message,children:e}),icon:o,autoClose:l,classNames:{root:F.Toast,body:F.Toast__Body,icon:F.Toast__Icon},withCloseButton:!1,withBorder:!1})},N.hide=t=>{O.notifications.hide(t)},N.clean=()=>{O.notifications.clean()};const G={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},Ne=({size:t="md",labelPosition:s="right",disabled:r,onChange:e,...o})=>{const[l,n]=m.useState(o?.checked||!1);let c=G["Toggle--Medium"],d=50;t==="sm"?(c=G["Toggle--Small"],d=38):t==="lg"&&(c=G["Toggle--Large"],d=67);const h=m.useCallback(u=>{e&&e(u),n(u?.target?.checked)},[e]);return a.jsx(x.Switch,{className:c,size:t,labelPosition:s,disabled:r,onChange:h,styles:()=>({track:{backgroundColor:!r&&l?"#0fd3d8 !important":void 0,borderColor:!r&&l?"#0fd3d8 !important":void 0,width:d}}),...o})},q={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},Oe=({title:t,content:s,maw:r=280,multiline:e=!0,...o})=>a.jsx(x.Tooltip,{...o,maw:r,multiline:e,label:a.jsxs("div",{className:q.Tooltip__Body,children:[t&&a.jsx("span",{className:q.Tooltip__Title,children:t}),a.jsx("span",{className:q.Tooltip__Content,children:s})]})}),$e=t=>{const{name:s,icon:r}=t;return`
|
|
1
|
+
(function(C,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("react"),require("@mantine/notifications"),require("@pop-ui/foundation"),require("@mantine/dates"),require("dayjs"),require("dayjs/locale/ko"),require("dayjs/plugin/customParseFormat"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@mantine/dropzone"),require("react-easy-crop"),require("@dnd-kit/utilities"),require("lottie-react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","react","@mantine/notifications","@pop-ui/foundation","@mantine/dates","dayjs","dayjs/locale/ko","dayjs/plugin/customParseFormat","@dnd-kit/core","@dnd-kit/sortable","@mantine/dropzone","react-easy-crop","@dnd-kit/utilities","lottie-react"],a):(C=typeof globalThis<"u"?globalThis:C||self,a(C.Core={},C.jsxRuntime,C.MantineCore,C.React,C.notifications,C.foundation,C.dates,C.dayjs,null,C.customParseFormat,C.core$1,C.sortable,C.dropzone,C.Cropper,C.utilities,C.Lottie))})(this,function(C,a,P,f,le,D,me,z,pr,rt,ee,te,fe,nt,Le,ot){"use strict";const at={sm:14,md:16,lg:18},Z={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-"},he={inner:Z.Button__Inner,label:Z.Button__Label,section:Z.Button__Section,loader:Z.Button__Loader},st={sm:Z["Button--Small"],md:Z["Button--Medium"],lg:Z["Button--Large"]},lt={primary:Z["Button--Primary"],primaryLine:Z["Button--PrimaryLine"],basic:Z["Button--Basic"],danger:Z["Button--Danger"],setting:Z["Button--Setting"],warning:Z["Button--Warning"],ghost:Z["Button--Ghost"]},it=(...e)=>e.filter(Boolean).join(" ")||void 0,ct=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(he,e(n,t,o)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(he,e):he};function ie({children:e,size:r="md",variant:n="primary",isLoading:t=!1,hideLabelOnLoading:o=!1,disabled:l=!1,className:s,classNames:i,loaderProps:c,...m}){const d=at[r],_=t,u=l||_;return a.jsxs(P.Button,{type:"button",unstyled:!0,className:it(Z.Button,l?Z.Button__Disabled:"",st[r],lt[n],s),classNames:ct(i),...m,disabled:u,children:[_&&a.jsx(P.Loader,{color:"currentColor",size:d,...c}),a.jsx("span",{className:Z.Button__Label,children:_&&o?null:e})]})}const ge={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},_t={sm:ge["Checkbox--Small"],md:ge["Checkbox--Medium"],lg:ge["Checkbox--Large"]},dt={sm:18,md:24,lg:32},ut=({size:e="md",...r})=>{const n=_t[e],t=dt[e];return a.jsx(P.Checkbox,{className:n,size:e,styles:{inner:{width:t,height:t}},...r})},K={CalendarDatePicker__Wrapper:"styles-module__CalendarDatePicker__Wrapper___n4ux3",CalendarDatePicker__DayContent:"styles-module__CalendarDatePicker__DayContent___2xr8Q",CalendarDatePicker__DayLabel:"styles-module__CalendarDatePicker__DayLabel___-4E1W",CalendarDatePicker__TodayIndicator:"styles-module__CalendarDatePicker__TodayIndicator___ij6hs",CalendarDatePicker__Day:"styles-module__CalendarDatePicker__Day___eYyiw",CalendarDatePicker__Header:"styles-module__CalendarDatePicker__Header___hGYbK",CalendarDatePicker__HeaderLevel:"styles-module__CalendarDatePicker__HeaderLevel___yuhOQ",CalendarDatePicker__HeaderControl:"styles-module__CalendarDatePicker__HeaderControl___gz5tC",CalendarDatePicker__HeaderControlIcon:"styles-module__CalendarDatePicker__HeaderControlIcon___OVuQp",CalendarDatePicker__Month:"styles-module__CalendarDatePicker__Month___8-Nvy",CalendarDatePicker__MonthRow:"styles-module__CalendarDatePicker__MonthRow___PihZV",CalendarDatePicker__MonthCell:"styles-module__CalendarDatePicker__MonthCell___bEPui",CalendarDatePicker__WeekdaysRow:"styles-module__CalendarDatePicker__WeekdaysRow___lbdgy",CalendarDatePicker__Weekday:"styles-module__CalendarDatePicker__Weekday___-Seq9"},pt=({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=>z(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[z(s),z(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=z(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,m]of l)if((i.isSame(c,"day")||i.isAfter(c,"day"))&&(i.isSame(m,"day")||i.isBefore(m,"day")))return!0;return!1}},mt=(e,r,n,t)=>{const o=z(e),l=z(r);for(const s of n)if(Array.isArray(s)){const i=z(s[0]),c=z(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=z(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},ne=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},Be=(e="default",r)=>r==null?ne(e):e==="range"?Array.isArray(r)?r:ne("range"):e==="multiple"?Array.isArray(r)?r:ne("multiple"):Array.isArray(r)?r[0]??null:r,ve=({type:e,externalValue:r,internalValue:n})=>r!==void 0?Be(e,r):n!==void 0?Be(e,n):ne(e),ye=(e,r)=>{const n=(t,o)=>{const l=Object.keys(t).reduce((s,i)=>{const c=i,m=t[c],d=o[c],_=[m,d].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},ft=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 z(n).format("YYYY-MM-DD")}return null}return e instanceof Date?z(e).format("YYYY-MM-DD"):null},ht={levelsGroup:K.CalendarDatePicker__Wrapper,calendarHeader:K.CalendarDatePicker__Header,calendarHeaderLevel:K.CalendarDatePicker__HeaderLevel,calendarHeaderControl:K.CalendarDatePicker__HeaderControl,calendarHeaderControlIcon:K.CalendarDatePicker__HeaderControlIcon,month:K.CalendarDatePicker__Month,monthCell:K.CalendarDatePicker__MonthCell,day:K.CalendarDatePicker__Day,monthRow:K.CalendarDatePicker__MonthRow,weekdaysRow:K.CalendarDatePicker__WeekdaysRow,weekday:K.CalendarDatePicker__Weekday},Ee=({excludedDates:e=[],excludedDays:r=[],type:n="default",value:t,onChange:o,highlightToday:l=!1,...s})=>{const{classNames:i,date:c,defaultDate:m,onDateChange:d,getDayProps:_,...u}=s,[p,h]=f.useState(()=>t??ne(n)),[g,y]=f.useState(()=>c||m||(ft(t??ne(n))??new Date)),k=f.useMemo(()=>pt({excludedDays:r,excludedDates:e}),[r,e]),S=f.useCallback(x=>{c===void 0&&y(x),d?.(x)},[c,d]),I=x=>{if(n==="range"&&Array.isArray(x)&&x.length===2){const[v,O]=x;if(v&&O&&mt(v,O,e,r)){const w=ne("range");h(w),o?.(w);return}}h(x),o?.(x)},$=ve({type:n,externalValue:t,internalValue:p}),N=f.useCallback(x=>{const v=z(x).date(),w=z(x).isSame(z(),"day")&&l;return a.jsxs("span",{className:K.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:K.CalendarDatePicker__DayLabel,children:v}),w&&a.jsx("span",{className:K.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),U=ye(ht,i),H=c??g,B=z(H??new Date).format("YYYY-MM"),T=f.useCallback(x=>{const v=_?.(x)??{},O=z(x).format("YYYY-MM")!==B;return{...v,onClick:w=>{v.onClick?.(w),O&&S(x)}}},[B,_,S]);return a.jsx(me.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:n,previousIcon:a.jsx(D.IconChevronLeft,{}),nextIcon:a.jsx(D.IconChevronRight,{}),...u,size:"lg",onChange:I,weekendDays:[0],highlightToday:l,classNames:U,defaultDate:c===void 0?m:void 0,date:H,onDateChange:S,getDayProps:T,value:$,excludeDate:k,renderDay:N})},b={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"};z.extend(rt);const gt={wrapper:b.DatePicker__Wrapper,input:b.DatePicker__Input,section:b.DatePicker__Section,placeholder:b.DatePicker__Placeholder,datePickerRoot:b.DatePicker__Root,levelsGroup:b.DatePicker__LevelsGroup,calendarHeader:b.DatePicker__CalendarHeader,calendarHeaderLevel:b.DatePicker__CalendarHeaderLevel,calendarHeaderControl:b.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:b.DatePicker__CalendarHeaderControlIcon,month:b.DatePicker__Month,weekdaysRow:b.DatePicker__WeekdaysRow,weekday:b.DatePicker__Weekday,monthRow:b.DatePicker__MonthRow,monthCell:b.DatePicker__MonthCell,day:b.DatePicker__Day,timeWrapper:b.DatePicker__TimeWrapper,timeInput:b.DatePicker__TimeInput,submitButton:b.DatePicker__SubmitButton},yt={dropdown:b.DatePicker__Dropdown,arrow:b.DatePicker__DropdownArrow},Ae=(...e)=>e.filter(Boolean).join(" ")||void 0,_e=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},kt=({size:e="md",type:r="default",withTime:n,className:t,popoverProps:o,rightSection:l,rightSectionWidth:s,value:i,defaultValue:c,onChange:m,placeholder:d,disabled:_,minDate:u,maxDate:p,displayValueFormat:h="YYYY년 MM월 DD일",valueFormat:g,excludedDates:y,excludedDays:k,highlightToday:S})=>{const I=g??(n?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[$,N]=f.useState(!1),[U,H]=f.useState(()=>D.parseDateValue(i??c,r,I)??ne(r));let B=b["DatePicker--Medium"],T=18,x=42;e==="sm"?(B=b["DatePicker--Small"],T=14,x=34):e==="lg"&&(B=b["DatePicker--Large"],T=24,x=50);const v=ye(yt,o?.classNames),O=l??a.jsx("span",{"aria-hidden":"true",className:b.DatePicker__Icon,children:a.jsx(D.IconCalendar,{size:T})});if(n){const E=M=>{if(!M)return null;const F=z(M,I,!0);return F.isValid()?F.toDate():null},W=i!==void 0,q=W?E(i):null,L=E(c);return a.jsx(me.DateTimePicker,{className:Ae(b.DatePickerBase,b.DatePickerRoot,B,t),classNames:ye(gt,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:O,rightSectionWidth:s??x,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...o,classNames:v},value:W?q:void 0,defaultValue:W?void 0:L,onChange:M=>{m?.(M?z(M).format(I):null)},placeholder:d,disabled:_,minDate:u,maxDate:p})}const w=i!=null?D.parseDateValue(i,r,I):void 0,A=ve({type:r,externalValue:w,internalValue:U}),Y=D.formatDateDisplay(A,r,h),G=E=>{let W;if(r==="range"&&Array.isArray(E)){const q=E;W=[_e(q[0]??null),_e(q[1]??null)]}else r==="multiple"&&Array.isArray(E)?W=E.map(q=>_e(q)).filter(q=>q!==null):W=_e(E);H(W),m?.(D.toValueString(W,r,I)),r==="default"&&W!=null&&N(!1),r==="range"&&Array.isArray(W)&&W[0]&&W[1]&&N(!1)};return a.jsx("div",{className:Ae(b.DatePickerBase,b.DatePickerRoot,B,t),children:a.jsxs(P.Popover,{opened:$,onClose:()=>N(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...o,classNames:v,children:[a.jsx(P.Popover.Target,{children:a.jsx("div",{className:b.DatePicker__Wrapper,"data-expanded":$?!0:void 0,"data-disabled":_?!0:void 0,children:a.jsx(P.Input,{component:"button",type:"button",classNames:{input:b.DatePicker__Input,section:b.DatePicker__Section},onClick:()=>!_&&N(E=>!E),disabled:_,rightSection:O,rightSectionWidth:s??x,"data-expanded":$?!0:void 0,"data-disabled":_?!0:void 0,children:Y?a.jsx("span",{children:Y}):a.jsx("span",{className:b.DatePicker__Placeholder,children:d})})})}),a.jsx(P.Popover.Dropdown,{children:a.jsx(Ee,{type:r,value:A,onChange:G,excludedDates:y,excludedDays:k,highlightToday:S,minDate:u,maxDate:p})})]})})},J={"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"},Ct=({label:e,labelPosition:r="top",size:n="md",required:t,tooltip:o,tooltipPosition:l="top",errorMsg:s,description:i,...c})=>{const[m,d]=f.useState(!1);let _=J["Dropdown__Label--Medium"],u=J["Dropdown--Medium"],p=J["Dropdown__Tooltip--Medium"],h=18;return n==="sm"?(_=J["Dropdown__Label--Small"],u=J["Dropdown--Small"],p=J["Dropdown__Tooltip--Small"],h=14):n==="lg"&&(_=J["Dropdown__Label--Large"],u=J["Dropdown--Large"],p=J["Dropdown__Tooltip--Large"],h=24),a.jsxs("div",{className:r==="top"?J["Dropdown--TopLabel"]:J["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:_,children:e}),o&&a.jsx(P.Tooltip,{label:o,position:l,children:a.jsx("div",{className:p,children:a.jsx(D.IconInfoCircle,{size:n==="sm"?14:n==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(P.Select,{...c,size:n,error:s,className:u,rightSection:m?a.jsx(D.IconChevronUp,{size:h}):a.jsx(D.IconChevronDown,{size:h}),onDropdownOpen:()=>d(!0),onDropdownClose:()=>d(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),i&&a.jsx(P.Input.Description,{className:J.Dropdown__Description,children:i}),s&&a.jsx(P.Input.Error,{className:J.Dropdown__ErrorMsg,children:s})]})]})};function de(){return crypto.randomUUID()}function Dt(e,r,n){const t=[...e],[o]=t.splice(r,1);return t.splice(n,0,o),t}function Pt(e,r,n){return n!=null&&e.length>=n?0:r!=null&&e.length<r?r-e.length:1}function xt(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 St(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:de(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function Mt(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 Ne(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 Tt(e,r,n){return Ne(e,r,n)}function bt(e,r,n){const t={id:de(),file:r,url:URL.createObjectURL(r),position:n};return[...e,t]}function It(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}const Fe=({size:e="md",width:r,withCloseButton:n=!1,...t})=>{let o=768;return e==="xs"?o=360:e==="sm"?o=544:e==="lg"?o=1e3:e==="xl"&&(o=1200),a.jsx(P.Modal,{size:r||o,styles:{content:{borderRadius:"12px"},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:D.ColorGray900},header:{padding:"16px"},body:{paddingLeft:"0px",paddingRight:"0px"}},withCloseButton:n,closeButtonProps:{icon:a.jsx(D.IconX,{size:18,color:D.ColorGray600})},...t})};async function wt(e,r){const n=e.url??"";if(!n)return null;const t=await new Promise((i,c)=>{const m=new Image;m.crossOrigin="anonymous",m.onload=()=>i(m),m.onerror=c,m.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(m=>{m?i(new File([m],`cropped_${s}`,{type:"image/jpeg"})):c(new Error("Failed to create blob"))},"image/jpeg")})}function Lt({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),[m,d]=f.useState(null),[_,u]=f.useState(!1),p=async()=>{if(!(!m||!e)){u(!0);try{const h=await wt(e,m);h&&o(h)}finally{u(!1)}}};return a.jsx(Fe,{opened:r&&!!e,onClose:t,size:"md",title:"이미지 수정",withCloseButton:!0,children:a.jsxs(P.Stack,{children:[a.jsx("div",{style:{position:"relative",height:320,background:"#fff"},children:a.jsx(nt,{image:e?.url??"",crop:l,zoom:i,aspect:n,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:c,onCropComplete:(h,g)=>d(g),style:{containerStyle:{backgroundColor:"#ffffff"}}})}),a.jsxs(P.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(ie,{variant:"basic",onClick:t,children:"취소"}),a.jsx(ie,{variant:"primary",isLoading:_,onClick:p,children:"적용하기"})]})]})},e?.id)}const ae={Container:"styles-module__Container___ZyeJM",TileImage:"styles-module__TileImage___6aKmW",EditButton:"styles-module__EditButton___1Xyg9",PlaceholderText:"styles-module__PlaceholderText___nhLhy",PlaceholderTextError:"styles-module__PlaceholderTextError___jYZ8j"},Q={TileContainer:"styles-module__TileContainer___5-y01",DeleteButton:"styles-module__DeleteButton___0zsXm",Tile:"styles-module__Tile___3Cezo",LoadingOverlay:"styles-module__LoadingOverlay___4CyDQ",ActionBar:"styles-module__ActionBar___mJYpe",DragHandle:"styles-module__DragHandle___lzKhb",LinkButton:"styles-module__LinkButton___bISyz",DropzoneOuter:"styles-module__DropzoneOuter___BIO2N",Placeholder:"styles-module__Placeholder___q30Yw",PlaceholderError:"styles-module__PlaceholderError___fCOYe"};function ue({width:e,height:r,isError:n,isLoading:t,accept:o,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:Q.DropzoneOuter,children:a.jsx(fe.Dropzone,{onDrop:s,accept:o,multiple:l,disabled:t,className:n?Q.PlaceholderError:Q.Placeholder,style:{width:e,height:r},children:i})})}const Bt=e=>{const{isSorting:r,wasDragging:n}=e;return r||n?!1:te.defaultAnimateLayoutChanges(e)};function Oe({id:e,children:r}){const{setNodeRef:n,transform:t,transition:o,isOver:l}=te.useSortable({id:e,animateLayoutChanges:Bt});return a.jsx("div",{ref:n,style:{transform:Le.CSS.Transform.toString(t),transition:o,opacity:l?.7:1},children:r})}function $e({id:e,totalCount:r,width:n,height:t,readOnly:o,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:c,linkUrl:m,onLinkClick:d,onDelete:_,deleteAriaLabel:u="삭제",actionBarExtra:p,onTileClick:h,children:g}){const y=T=>{const{isSorting:x,wasDragging:v}=T;return x||v?!1:te.defaultAnimateLayoutChanges(T)},{attributes:k,listeners:S,setNodeRef:I,transform:$,transition:N,isDragging:U}=te.useSortable({id:e,disabled:o,animateLayoutChanges:y}),H=!o&&r>1||c&&!!m&&!!d||!!p,B=o||l||s||!h?"default":"pointer";return a.jsxs("div",{ref:I,className:Q.TileContainer,style:{transform:Le.CSS.Transform.toString($),transition:N,opacity:U?.4:1},children:[!o&&i&&!l&&a.jsx("button",{type:"button",className:Q.DeleteButton,onClick:_,"aria-label":u,children:a.jsx(D.IconXCircle,{size:24})}),a.jsxs("div",{className:Q.Tile,style:{width:n,height:t,cursor:B},onClick:()=>!o&&!l&&!s&&h?.(),children:[g,(l||s)&&a.jsx("div",{className:Q.LoadingOverlay,children:a.jsx(P.Loader,{size:n/6,color:D.ColorAqua500})})]}),H&&a.jsxs("div",{className:Q.ActionBar,children:[!o&&r>1&&a.jsx("button",{type:"button",className:Q.DragHandle,...k,...S,"aria-label":"드래그로 순서 변경",children:a.jsx(D.IconDragMenu,{size:20,color:"#808080"})}),c&&m&&d&&a.jsx("button",{type:"button",className:Q.LinkButton,onClick:d,children:"링크"}),p]})]})}function vt({items:e,onReorder:r}){return{sensors:ee.useSensors(ee.useSensor(ee.PointerSensor,{activationConstraint:{distance:8}}),ee.useSensor(ee.KeyboardSensor,{coordinateGetter:te.sortableKeyboardCoordinates})),handleDragEnd:o=>{const{active:l,over:s}=o;if(!s||l.id===s.id)return;const i=e.findIndex(m=>m.id===l.id),c=e.findIndex(m=>m.id===s.id);i!==-1&&c!==-1&&r(i,c)}}}const ke="__slot-";function ze({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:Pt(e,l,s),m=i?Array.from({length:s},(y,k)=>`${ke}${k}`):[],d=i?m:e.map(y=>y.id),{sensors:_,handleDragEnd:u}=vt({items:e,onReorder:(y,k)=>{const S=Dt(e,y,k),I=e[y];o?.(S,{action:"reorder",itemId:I.id,index:k,previousIndex:y,nextIndex:k})}});return{isPositionMode:i,resolvedMinLength:l,resolvedMaxLength:s,placeholderCount:c,slotIds:m,sortableItems:d,sensors:_,handleDragEnd:i?y=>{const{active:k,over:S}=y;if(!S||k.id===S.id)return;const I=Number(String(k.id).replace(ke,"")),$=Number(String(S.id).replace(ke,"")),N=e.find(H=>H.position===I);if(!N)return;const U=xt(e,I,$);o?.(U,{action:"reorder",itemId:N.id,index:$,previousIndex:I,nextIndex:$})}:u,getMetaIndex:y=>{const k=e.find(S=>S.id===y);return i&&k?k.position??0:e.findIndex(S=>S.id===y)}}}function Et(e){return e?e.join(","):"image/*"}function He({item:e,sortableId:r,index:n,totalCount:t,width:o,height:l,accept:s,canDelete:i,hasLink:c,hasEdit:m,readOnly:d,isLoading:_,onLinkClick:u,onDelete:p,onReplace:h,onEdit:g}){const y=f.useRef(null);return a.jsxs($e,{id:r??e.id,totalCount:t,width:o,height:l,readOnly:d,isLoading:_,itemIsLoading:e.isLoading,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:u?()=>u(e):void 0,onDelete:()=>p(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>y.current?.click(),actionBarExtra:!d&&m?a.jsx(ie,{variant:"basic",size:"sm","aria-label":"이미지 편집",className:ae.EditButton,onClick:()=>g(e),children:"편집"}):void 0,children:[a.jsx("input",{ref:y,type:"file",accept:Et(s),style:{display:"none"},onChange:k=>{const S=k.target.files?.[0];S&&h(e.id,S),k.target.value=""}}),a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${n+1}`,className:ae.TileImage})]})}const At=({value:e=[],onChange:r,accept:n,length:t,width:o=160,height:l=200,placeholder:s="이미지를 넣어주세요",hasIcon:i=!0,hasLink:c=!1,onLinkClick:m,hasEdit:d=!1,canDelete:_=!0,minLength:u,maxLength:p,errorMsg:h,isLoading:g,readOnly:y,gap:k=8})=>{process.env.NODE_ENV!=="production"&&t!=null&&(u!=null||p!=null)&&console.warn("ImageInput: length와 minLength/maxLength가 동시에 지정되었습니다. length가 우선 적용됩니다.");const{isPositionMode:S,resolvedMaxLength:I,placeholderCount:$,slotIds:N,sortableItems:U,sensors:H,handleDragEnd:B,getMetaIndex:T}=ze({value:e,length:t,minLength:u,maxLength:p,onChange:r}),x=!!h,[v,O]=f.useState(null),w=f.useRef(e);f.useEffect(()=>{w.current=e},[e]),f.useEffect(()=>()=>It(w.current),[]);const A=L=>{if(y)return;const M=e.length,F=St(e,L,I);F.length!==M&&r?.(F,{action:"create",itemId:F[M].id,index:M})},Y=(L,M)=>{if(y)return;const F=M[0];if(!F)return;const X=bt(e,F,L);r?.(X,{action:"create",itemId:X[X.length-1].id,index:L})},G=L=>{if(y)return;const M=T(L),F=Mt(e,L);r?.(F,{action:"delete",itemId:L,index:M})},E=(L,M)=>{if(y)return;const F=T(L),X=Ne(e,L,M);r?.(X,{action:"replace",itemId:L,index:F})},W=L=>{if(!v)return;const M=v.id,F=T(M),X=Tt(e,M,L);O(null),r?.(X,{action:"crop",itemId:M,index:F})},q=L=>{const M=typeof s=="function"?s(L):s;return typeof M!="string"?M:M.split(`
|
|
2
|
+
`).map((F,X)=>a.jsx("span",{children:F},X))};return a.jsxs("div",{children:[a.jsx(ee.DndContext,{sensors:H,collisionDetection:ee.closestCenter,onDragEnd:B,children:a.jsx(te.SortableContext,{items:U,strategy:te.rectSortingStrategy,children:a.jsx("div",{className:ae.Container,style:{gap:k},children:S?Array.from({length:I},(L,M)=>{const F=N[M],X=e.find(we=>we.position===M);return X?a.jsx(He,{item:X,sortableId:F,index:M,totalCount:I,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:d,readOnly:y??!1,isLoading:g,onLinkClick:m,onDelete:G,onReplace:E,onEdit:O},F):!y&&a.jsx(Oe,{id:F,children:a.jsxs(ue,{onDrop:we=>Y(M,we),accept:n??fe.IMAGE_MIME_TYPE,multiple:!1,isLoading:g,isError:x,width:o,height:l,children:[i&&a.jsx(D.IconPhoto,{size:36,color:x?"#e03131":"#07a3c6"}),s&&a.jsx("div",{className:`${ae.PlaceholderText}${x?` ${ae.PlaceholderTextError}`:""}`,children:q(M)})]})},F)}):a.jsxs(a.Fragment,{children:[e.map((L,M)=>a.jsx(He,{item:L,index:M,totalCount:e.length,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:d,readOnly:y??!1,isLoading:g,onLinkClick:m,onDelete:G,onReplace:E,onEdit:O},L.id)),!y&&Array.from({length:$},(L,M)=>a.jsxs(ue,{onDrop:A,accept:n??fe.IMAGE_MIME_TYPE,multiple:I!==1,isLoading:g,isError:x,width:o,height:l,children:[i&&a.jsx(D.IconPhoto,{size:36,color:x?"#e03131":"#07a3c6"}),s&&a.jsx("div",{className:`${ae.PlaceholderText}${x?` ${ae.PlaceholderTextError}`:""}`,children:q(M)})]},`placeholder-${M}`))]})})})}),x&&a.jsx(P.Input.Error,{mt:8,children:h}),d&&a.jsx(Lt,{item:v,isOpen:!!v,onClose:()=>O(null),onSubmit:W})]})};function Ye(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 Ce(e){return new Promise(r=>{const n=new FileReader;n.onload=t=>{try{const o=JSON.parse(t.target?.result);r(Ye(o)?o:null)}catch{r(null)}},n.onerror=()=>r(null),n.readAsText(e)})}function Nt(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:de(),file:i}));return[...e,...s]}function Ft(e,r){return e.filter(n=>n.id!==r)}function Ot(e,r,n){const t={id:de(),file:r,position:n};return[...e,t]}const se={Container:"styles-module__Container___cJqG-",Empty:"styles-module__Empty___gexrS",PlaceholderText:"styles-module__PlaceholderText___x2ya0",PlaceholderTextError:"styles-module__PlaceholderTextError___i8VXv"},pe={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"},We=e=>typeof e=="string"?{message:e}:e,Ze=(e,r)=>{const{autoClose:n,icon:t,message:o}=We(e);return{id:r,message:a.jsx("div",{className:pe.Toast__Message,children:o}),icon:t,autoClose:n,classNames:{root:pe.Toast,body:pe.Toast__Body,icon:pe.Toast__Icon},withCloseButton:!1,withBorder:!1}},oe=e=>{const r=We(e);le.notifications.show(Ze(e,r.id))};oe.update=(e,r)=>{le.notifications.update(Ze(r,e))},oe.hide=e=>{le.notifications.hide(e)},oe.clean=()=>{le.notifications.clean()};const Ve={"application/json":[".json"]};function Ue({item:e,sortableId:r,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,canDelete:i,hasLink:c,onLinkClick:m,onDelete:d}){const u=!e.animationData&&!!(e.file||e.url)?`${e.id}|${e.file?`${e.file.name}:${e.file.size}`:e.url??""}`:"",[p,h]=f.useState({key:"",data:null}),g=e.animationData??(p.key===u?p.data:null),y=!!u&&p.key!==u;return f.useEffect(()=>{if(!u)return;let k=!1;return(e.file?Ce(e.file):fetch(e.url).then(I=>I.json()).then(I=>Ye(I)?I:null)).then(I=>{k||h({key:u,data:I})}).catch(()=>{k||h({key:u,data:null})}),()=>{k=!0}},[u,e.file]),a.jsx($e,{id:r??e.id,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,itemIsLoading:e.isLoading||y,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:m?()=>m(e):void 0,onDelete:()=>d(e.id),deleteAriaLabel:"Lottie 삭제",children:g?a.jsx(ot,{animationData:g,loop:!0,autoplay:!0,style:{width:t,height:o,display:"block"}}):a.jsx("div",{className:se.Empty,style:{width:t,height:o}})})}const $t=({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:m,maxLength:d,errorMsg:_,isLoading:u,readOnly:p,gap:h=8,canDelete:g=!0})=>{process.env.NODE_ENV!=="production"&&c!=null&&(m!=null||d!=null)&&console.warn("LottieInput: length와 minLength/maxLength가 동시에 지정되었습니다. length가 우선 적용됩니다.");const{isPositionMode:y,resolvedMaxLength:k,placeholderCount:S,slotIds:I,sortableItems:$,sensors:N,handleDragEnd:U,getMetaIndex:H}=ze({value:e,length:c,minLength:m,maxLength:d,onChange:r}),B=!!_,T=async w=>{if(p)return;const A=[...w].sort((L,M)=>L.name.localeCompare(M.name)),Y=await Promise.all(A.map(Ce));let G=0;const E=A.filter((L,M)=>Y[M]!==null?!0:(G++,!1));if(G>0&&oe({id:"invalid-lottie-files",message:G===1?"유효하지 않은 Lottie JSON 파일입니다":`${G}개의 파일이 유효하지 않은 Lottie JSON입니다`}),E.length===0)return;const W=e.length,q=Nt(e,E,k);q.length!==W&&r?.(q,{action:"create",itemId:q[W].id,index:W})},x=async(w,A)=>{if(p)return;const Y=A[0];if(!Y)return;if(!await Ce(Y)){oe({id:"invalid-lottie-files",message:"유효하지 않은 Lottie JSON 파일입니다"});return}const E=Ot(e,Y,w);r?.(E,{action:"create",itemId:E[E.length-1].id,index:w})},v=w=>{if(p)return;const A=H(w),Y=Ft(e,w);r?.(Y,{action:"delete",itemId:w,index:A})},O=w=>{const A=typeof o=="function"?o(w):o;return typeof A!="string"?A:A.split(`
|
|
3
|
+
`).map((Y,G)=>a.jsx("span",{children:Y},G))};return a.jsxs("div",{children:[a.jsx(ee.DndContext,{sensors:N,collisionDetection:ee.closestCenter,onDragEnd:U,children:a.jsx(te.SortableContext,{items:$,strategy:te.rectSortingStrategy,children:a.jsx("div",{className:se.Container,style:{gap:h},children:y?Array.from({length:k},(w,A)=>{const Y=I[A],G=e.find(E=>E.position===A);return G?a.jsx(Ue,{item:G,sortableId:Y,totalCount:k,width:n,height:t,readOnly:p??!1,isLoading:u,canDelete:g,hasLink:s,onLinkClick:i,onDelete:v},Y):!p&&a.jsx(Oe,{id:Y,children:a.jsxs(ue,{onDrop:E=>x(A,E),accept:Ve,multiple:!1,isLoading:u,isError:B,width:n,height:t,children:[l&&a.jsx(D.IconPhoto,{size:36,color:B?"#e03131":"#07a3c6"}),o&&a.jsx("div",{className:`${se.PlaceholderText}${B?` ${se.PlaceholderTextError}`:""}`,children:O(A)})]})},Y)}):a.jsxs(a.Fragment,{children:[e.map(w=>a.jsx(Ue,{item:w,totalCount:e.length,width:n,height:t,readOnly:p??!1,isLoading:u,canDelete:g,hasLink:s,onLinkClick:i,onDelete:v},w.id)),!p&&Array.from({length:S},(w,A)=>a.jsxs(ue,{onDrop:T,accept:Ve,multiple:k!==1,isLoading:u,isError:B,width:n,height:t,children:[l&&a.jsx(D.IconPhoto,{size:36,color:B?"#e03131":"#07a3c6"}),o&&a.jsx("div",{className:`${se.PlaceholderText}${B?` ${se.PlaceholderTextError}`:""}`,children:O(A)})]},`placeholder-${A}`))]})})})}),B&&a.jsx(P.Input.Error,{mt:8,children:_})]})},ce={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"},zt=({currentPageIdx:e,rowsPerPage:r,totalLength:n,paginationSize:t,onPageChange:o,...l})=>{const[s,i]=f.useState(e),c=r||50,m=n||1,d=t||5;f.useEffect(()=>{i(e)},[e]);const _=()=>{o&&o(s-(s%d+1)),i(p=>p-(p%d+1))},u=()=>{o&&o(s+d-s%d),i(p=>p+d-p%d)};return a.jsxs("div",{...l,className:ce.Pagination,children:[s>=d?a.jsx("button",{className:ce.Pagination__Arrow,onClick:_,children:a.jsx(D.IconChevronLeft,{size:20})}):null,new Array(d).fill(0).map((p,h)=>{const g=Math.floor(s/d)*d+h+1;if(!(g>Math.ceil(m/c)))return a.jsx("button",{className:s===g-1?ce["Pagination__PageIndex--Active"]:ce.Pagination__PageIndex,onClick:()=>{i(g-1),o&&o(g-1)},children:g},`pagination_${h}`)}),Math.floor(s/d)*d+d<Math.ceil(m/c)?a.jsx("button",{className:ce.Pagination__Arrow,onClick:u,children:a.jsx(D.IconChevronRight,{size:20})}):null]})},De={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Ht={sm:De["Radio--Small"],md:De["Radio--Medium"],lg:De["Radio--Large"]},Yt={sm:18,md:24,lg:32},Wt=({size:e="md",...r})=>{const n=Ht[e],t=Yt[e];return a.jsx(P.Radio,{className:n,size:e,styles:{inner:{width:t,height:t}},...r})},j={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},Zt=({label:e,labelPosition:r="top",size:n="md",required:t,tooltip:o,tooltipPosition:l="top",errorMsg:s,description:i,onChange:c,onClear:m,...d})=>{const[_,u]=f.useState(0);let p=j["SearchBar__Label--Medium"],h=j["SearchBar--Medium"],g=j["SearchBar__Tooltip--Medium"];n==="sm"?(p=j["SearchBar__Label--Small"],h=j["SearchBar--Small"],g=j["SearchBar__Tooltip--Small"]):n==="lg"&&(p=j["SearchBar__Label--Large"],h=j["SearchBar--Large"],g=j["SearchBar__Tooltip--Large"]);const y=f.useCallback(k=>{c&&(u(k?.length),c(k))},[c]);return a.jsxs("div",{className:r==="top"?j["SearchBar--TopLabel"]:j["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:p,children:e}),o&&a.jsx(P.Tooltip,{label:o,position:l,children:a.jsx("div",{className:g,children:a.jsx(D.IconInfoCircle,{size:n==="sm"?14:n==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:j.SearchBar__Wrapper,children:a.jsx(P.Autocomplete,{...d,size:n,error:s,className:h,onChange:y,leftSection:a.jsx(D.IconSearch,{size:n==="sm"?16:n==="lg"?24:20}),rightSection:m&&_>0?a.jsx("div",{className:j.SearchBar__ClearButton,onClick:m,children:a.jsx(D.IconX,{size:n==="sm"?16:n==="lg"?24:20})}):void 0})}),i&&a.jsx(P.Input.Description,{className:j.SearchBar__Description,children:i}),s&&a.jsx(P.Input.Error,{className:j.SearchBar__ErrorMsg,children:s})]})]})},Pe={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},Vt=({size:e="md",radius:r=6,...n})=>{let t=Pe["SegmentButton--Medium"];return e==="sm"?t=Pe["SegmentButton--Small"]:e==="lg"&&(t=Pe["SegmentButton--Large"]),a.jsx(P.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"},Ut=({tabList:e=[],containerPaddingTop:r,...n})=>a.jsxs(P.Tabs,{...n,children:[a.jsx(P.Tabs.List,{className:je.Tab__TitleList,children:e?.map((t,o)=>a.jsxs(P.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(P.Tabs.Panel,{value:t.value,pt:r,children:t.body},`tab_panel_${o}`))]}),V={"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"},jt=e=>typeof e=="string"?e.length:typeof e=="number"?String(e).length:Array.isArray(e)?e.join("").length:0,Gt=e=>{const{label:r,labelPosition:n="top",size:t="md",required:o,tooltip:l,tooltipPosition:s="top",errorMsg:i,description:c,textarea:m=!1,maxTextCount:d,onChange:_,onClear:u,...p}=e,h="minRows"in e?e.minRows:void 0,{value:g,defaultValue:y,...k}=p,S=g!==void 0,[I,$]=f.useState(String(g??y??"")),N=S?g:I,U=jt(N);let H=V["TextField__Label--Medium"],B=V["TextField--Medium"],T=V["TextField__Tooltip--Medium"];t==="sm"?(H=V["TextField__Label--Small"],B=V["TextField--Small"],T=V["TextField__Tooltip--Small"]):t==="lg"&&(H=V["TextField__Label--Large"],B=V["TextField--Large"],T=V["TextField__Tooltip--Large"]);const x=f.useCallback(O=>{const w=O.currentTarget.value;d&&w.length>d||(S||$(w),_&&_(O))},[S,d,_]),v=f.useCallback(()=>{S||$(""),u?.()},[S,u]);return a.jsxs("div",{className:n==="top"?V["TextField--TopLabel"]:V["TextField--LeftLabel"],children:[a.jsxs("div",{children:[r&&a.jsx(P.Input.Label,{required:o,className:H,children:r}),l&&a.jsx(P.Tooltip,{label:l,position:s,children:a.jsx("div",{className:T,children:a.jsx(D.IconInfoCircle,{size:t==="sm"?14:t==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:V.TextField__Wrapper,children:[m?a.jsx(P.Textarea,{className:V["TextField--Textarea"],size:t,minRows:h,error:i,onChange:x,value:N,...k}):a.jsx(P.Input,{className:B,error:i,onChange:x,value:N,rightSection:u&&U>0?a.jsx("button",{type:"button",className:V.TextField__ClearButton,"aria-label":"입력 내용 지우기",onClick:v,children:a.jsx(D.IconX,{size:t==="sm"?16:t==="lg"?24:20})}):void 0,...k}),d&&d>0&&a.jsx("span",{className:V.TextField__TextCounter,children:`${U}/${d}`})]}),c&&a.jsx(P.Input.Description,{className:V.TextField__Description,children:c}),i&&a.jsx(P.Input.Error,{className:V.TextField__ErrorMsg,children:i})]})]})},xe={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},qt=({size:e="md",...r})=>{const n=f.useRef(null);let t=xe["TimePicker--Medium"],o=18;return e==="sm"?(t=xe["TimePicker--Small"],o=14):e==="lg"&&(t=xe["TimePicker--Large"],o=24),a.jsx(me.TimeInput,{ref:n,className:t,size:e,...r,rightSection:a.jsx(P.ActionIcon,{bg:"transparent",onClick:()=>{n.current?.showPicker?.()},children:a.jsx(D.IconClock,{size:o})})})},Se={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},Kt=({size:e="md",labelPosition:r="right",disabled:n,onChange:t,...o})=>{const[l,s]=f.useState(o?.checked||!1);let i=Se["Toggle--Medium"],c=50;e==="sm"?(i=Se["Toggle--Small"],c=38):e==="lg"&&(i=Se["Toggle--Large"],c=67);const m=f.useCallback(d=>{t&&t(d),s(d?.target?.checked)},[t]);return a.jsx(P.Switch,{className:i,size:e,labelPosition:r,disabled:n,onChange:m,styles:()=>({track:{backgroundColor:!n&&l?"#0fd3d8 !important":void 0,borderColor:!n&&l?"#0fd3d8 !important":void 0,width:c}}),...o})},Me={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},Jt=({title:e,content:r,maw:n=280,multiline:t=!0,...o})=>a.jsx(P.Tooltip,{...o,maw:n,multiline:t,label:a.jsxs("div",{className:Me.Tooltip__Body,children:[e&&a.jsx("span",{className:Me.Tooltip__Title,children:e}),a.jsx("span",{className:Me.Tooltip__Content,children:r})]})}),Xt=e=>{const{name:r,icon:n}=e;return`
|
|
2
4
|
<div class="pin-marker">
|
|
3
|
-
${
|
|
5
|
+
${n?`<img src="${n}" alt="${r}" width="40" height="40" />`:`
|
|
4
6
|
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
7
|
<g>
|
|
6
8
|
<path d="M18.7686 1.26235C11.6407 0.936128 5.75293 6.62941 5.75293 13.6913C5.75293 22.565 11.76 30.0415 15.1594 33.4869C16.8117 35.1766 19.5261 35.1761 21.1779 33.4854C24.318 30.2845 29.8102 23.653 30.5636 15.5539L30.5637 15.5531C31.2237 8.38935 26.1199 1.59187 18.7686 1.26235ZM18.7686 1.26235L18.7229 2.26131L18.7676 1.2623C18.768 1.26232 18.7683 1.26234 18.7686 1.26235Z" fill="#FF6C6C" stroke="white" stroke-width="2" stroke-miterlimit="10"/>
|
|
@@ -8,40 +10,40 @@
|
|
|
8
10
|
</g>
|
|
9
11
|
</svg>
|
|
10
12
|
`}
|
|
11
|
-
<div class="pin-marker-name">${
|
|
13
|
+
<div class="pin-marker-name">${r}</div>
|
|
12
14
|
</div>
|
|
13
|
-
`},
|
|
15
|
+
`},Qt=e=>{const{discountRate:r,price:n,originalPrice:t,category:o,active:l,title:s}=e;return`
|
|
14
16
|
<div class="popdeal-marker" active="${!!l}">
|
|
15
17
|
<div class="popdeal-marker-section">
|
|
16
18
|
<div class="popdeal-marker-section-header">
|
|
17
|
-
<span class="popdeal-marker-title">${
|
|
19
|
+
<span class="popdeal-marker-title">${s}</span>
|
|
18
20
|
${o?`<span class="popdeal-marker-category">${o}</span>`:""}
|
|
19
21
|
</div>
|
|
20
22
|
<div class="popdeal-marker-section-price">
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
<span class="popdeal-marker-discounted_price">${
|
|
23
|
+
${t?`<span class="popdeal-marker-original_price">${t.toLocaleString()}원</span>`:""}
|
|
24
|
+
${r?`<span class="popdeal-marker-discount_rate">${r}%</span>`:""}
|
|
25
|
+
<span class="popdeal-marker-discounted_price">${n.toLocaleString()}원</span>
|
|
24
26
|
</div>
|
|
25
27
|
</div>
|
|
26
28
|
</div>
|
|
27
|
-
`},
|
|
29
|
+
`},Rt=e=>{const{title:r,icon:n}=e;return`
|
|
28
30
|
<div class="pi-marker">
|
|
29
|
-
${
|
|
30
|
-
<span class="pi-marker-text">${
|
|
31
|
+
${n?`<img class="pi-marker-icon" src="${n}" alt="" width="32px" height="32px" />`:""}
|
|
32
|
+
<span class="pi-marker-text">${r}</span>
|
|
31
33
|
</div>
|
|
32
|
-
`},
|
|
34
|
+
`},er=e=>{const{title:r,icon:n,address:t}=e;return`
|
|
33
35
|
<div class="pi-expanded-marker">
|
|
34
|
-
${
|
|
36
|
+
${n?`<img class="pi-expanded-marker-icon" src="${n}" alt="" width="32px" height="32px" />`:""}
|
|
35
37
|
<div class="pi-expanded-marker-content">
|
|
36
|
-
<div class="pi-expanded-marker-title">${
|
|
37
|
-
${
|
|
38
|
+
<div class="pi-expanded-marker-title">${r}</div>
|
|
39
|
+
${t?`<div class="pi-expanded-marker-address">${t}</div>`:""}
|
|
38
40
|
</div>
|
|
39
41
|
</div>
|
|
40
|
-
`},
|
|
42
|
+
`},tr=e=>`
|
|
41
43
|
<div class="cluster-marker">
|
|
42
|
-
<span class="cluster-marker-text">${
|
|
44
|
+
<span class="cluster-marker-text">${e.count}</span>
|
|
43
45
|
</div>
|
|
44
|
-
`,
|
|
46
|
+
`,Te=e=>{switch(e.type){case"pin":return Xt(e);case"popdeal":return Qt(e);case"pi":return Rt(e);case"pi-expanded":return er(e);case"cluster":return tr(e);default:return""}},Ge=`
|
|
45
47
|
/* Common marker styles */
|
|
46
48
|
[class$="marker"] {
|
|
47
49
|
user-select: none;
|
|
@@ -316,13 +318,13 @@
|
|
|
316
318
|
background: #00C4C4;
|
|
317
319
|
transform: translate(-50%) rotate(45deg);
|
|
318
320
|
}
|
|
319
|
-
`,se=m.createContext(null),ne="naver-map-script",Ze=(t,s)=>new Promise((r,e)=>{if(typeof window<"u"&&window.naver?.maps){r();return}const o=document.getElementById(ne);if(o){o.addEventListener("load",()=>r()),o.addEventListener("error",()=>e(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=ne,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${t}&language=${s}`,l.async=!0,l.onload=()=>{r()},l.onerror=()=>{e(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),le=({clientId:t,language:s="ko",children:r})=>{const[e,o]=m.useState(null),[l,n]=m.useState({}),[c,d]=m.useState(null);m.useEffect(()=>{typeof window>"u"||Ze(t,s).then(()=>{window.naver&&o(window.naver)}).catch(u=>{console.error("Naver Map script loading failed:",u),d(u)})},[t,s]);const h=m.useCallback((u,_)=>{const g=e||(typeof window<"u"?window.naver:null);if(!g||(!e&&window.naver&&o(window.naver),!u.current))return null;const p=u.current;if(!p.isConnected)return null;try{const C={center:new g.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,..._},y=new g.maps.Map(p,C);return n(T=>{const B=p.getAttribute("id")||"default";return{...T,[B]:y}}),y}catch(C){return console.error("Map creation error:",C),null}},[e]);return c&&console.error("NaverMapProvider error:",c),a.jsx(se.Provider,{value:{naver:e,createMap:h,maps:l},children:r})},K=()=>{const t=m.useContext(se);if(!t)throw new Error("useNaverMap must be used within NaverMapProvider");return t};function ae(t){const s=function(e){this.DEFAULT_OPTIONS={map:null,markers:[],disableClickZoom:!0,minClusterSize:2,maxZoom:13,gridSize:100,icons:[],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:function(){}},this._clusters=[],this._mapRelations=null,this._markerRelations=[],this.setOptions(t.maps.Util.extend({},this.DEFAULT_OPTIONS,e),!0),this.setMap(e.map||null)};t.maps.Util.ClassExtend(s,t.maps.OverlayView,{onAdd:function(){const e=this.getMap();this._mapRelations=t.maps.Event.addListener(e,"idle",t.maps.Util.bind(this._onIdle,this)),this.getMarkers().length>0&&(this._createClusters(),this._updateClusters())},draw:t.maps.Util.noop,onRemove:function(){t.maps.Event.removeListener(this._mapRelation),this._clearClusters(),this._geoTree=null,this._mapRelation=null},setOptions:function(e){const o=this;if(typeof e=="string"){const l=e,n=arguments[1];o.set(l,n)}else{const l=arguments[1];t.maps.Util.forEach(e,function(n,c){c!=="map"&&o.set(c,n)}),e.map&&!l&&o.setMap(e.map)}},getOptions:function(e){const o=this,l={};return e!==void 0?o.get(e):(t.maps.Util.forEach(o.DEFAULT_OPTIONS,function(n,c){l[c]=o.get(c)}),l)},getMinClusterSize:function(){return this.getOptions("minClusterSize")},setMinClusterSize:function(e){this.setOptions("minClusterSize",e)},getMaxZoom:function(){return this.getOptions("maxZoom")},setMaxZoom:function(e){this.setOptions("maxZoom",e)},getGridSize:function(){return this.getOptions("gridSize")},setGridSize:function(e){this.setOptions("gridSize",e)},getIndexGenerator:function(){return this.getOptions("indexGenerator")},setIndexGenerator:function(e){this.setOptions("indexGenerator",e)},getMarkers:function(){return this.getOptions("markers")},setMarkers:function(e){this.setOptions("markers",e)},getIcons:function(){return this.getOptions("icons")},setIcons:function(e){this.setOptions("icons",e)},getStylingFunction:function(){return this.getOptions("stylingFunction")},setStylingFunction:function(e){this.setOptions("stylingFunction",e)},getDisableClickZoom:function(){return this.getOptions("disableClickZoom")},setDisableClickZoom:function(e){this.setOptions("disableClickZoom",e)},getAverageCenter:function(){return this.getOptions("averageCenter")},setAverageCenter:function(e){this.setOptions("averageCenter",e)},changed:function(e,o){if(this.getMap())switch(e){case"marker":case"minClusterSize":case"gridSize":case"averageCenter":this._redraw();break;case"indexGenerator":case"icons":this._clusters.forEach(function(n){n.updateIcon()});break;case"maxZoom":this._clusters.forEach(function(n){n.getCount()>1&&n.checkByZoomAndMinClusterSize()});break;case"stylingFunction":this._clusters.forEach(function(n){n.updateCount()});break;case"disableClickZoom":let l="enableClickZoom";o&&(l="disableClickZoom"),this._clusters.forEach(function(n){n[l]()});break}},_createClusters:function(){const e=this.getMap();if(!e)return;const o=e.getBounds(),l=this.getMarkers();for(let n=0,c=l.length;n<c;n++){const d=l[n],h=d.getPosition();if(!o.hasLatLng(h))continue;this._getClosestCluster(h).addMarker(d),this._markerRelations.push(t.maps.Event.addListener(d,"dragend",t.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const e=this._clusters;for(let o=0,l=e.length;o<l;o++)e[o].updateCluster()},_clearClusters:function(){const e=this._clusters;for(let o=0,l=e.length;o<l;o++)e[o].destroy();t.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(e){const o=this.getProjection(),l=this._clusters;let n=null,c=1/0;for(let d=0,h=l.length;d<h;d++){const u=l[d],_=u.getCenter();if(u.isInBounds(e)){const g=o.getDistance(_,e);g<c&&(c=g,n=u)}}return n||(n=new r(this),this._clusters.push(n)),n},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const r=function(e){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=e};return r.prototype={constructor:r,addMarker:function(e){if(!this._isMember(e)){if(!this._clusterCenter){const o=e.getPosition();this._clusterCenter=o,this._clusterBounds=this._calcBounds(o)}this._clusterMember.push(e)}},destroy:function(){t.maps.Event.removeListener(this._relation);const e=this._clusterMember;for(let o=0,l=e.length;o<l;o++)e[o].setMap(null);this._clusterMarker.setMap(null),this._clusterMarker=null,this._clusterCenter=null,this._clusterBounds=null,this._relation=null,this._clusterMember=[]},getCenter:function(){return this._clusterCenter},getBounds:function(){return this._clusterBounds},getCount:function(){return this._clusterMember.length},getClusterMember:function(){return this._clusterMember},isInBounds:function(e){return this._clusterBounds&&this._clusterBounds.hasLatLng(e)},enableClickZoom:function(){if(this._relation)return;const e=this._markerClusters.getMap();this._relation=t.maps.Event.addListener(this._clusterMarker,"click",t.maps.Util.bind(function(o){e.morph(o.coord,e.getZoom()+1)},this))},disableClickZoom:function(){this._relation&&(t.maps.Event.removeListener(this._relation),this._relation=null)},updateCluster:function(){if(!this._clusterMarker){let e;this._markerClusters.getAverageCenter()?e=this._calcAverageCenter(this._clusterMember):e=this._clusterCenter,this._clusterMarker=new t.maps.Marker({position:e,map:this._markerClusters.getMap()}),this._markerClusters.getDisableClickZoom()||this.enableClickZoom()}this.updateIcon(),this.updateCount(),this.checkByZoomAndMinClusterSize()},checkByZoomAndMinClusterSize:function(){const e=this._markerClusters,o=e.getMinClusterSize(),l=e.getMaxZoom(),n=e.getMap().getZoom();this.getCount()<o?this._showMember():(this._hideMember(),l<=n&&this._showMember())},updateCount:function(){const e=this._markerClusters.getStylingFunction();e&&e(this._clusterMarker,this.getCount())},updateIcon:function(){const e=this.getCount();let o=this._getIndex(e);const l=this._markerClusters.getIcons();o=Math.max(o,0),o=Math.min(o,l.length-1),this._clusterMarker.setIcon(l[o])},_showMember:function(){const e=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let n=0,c=l.length;n<c;n++)l[n].setMap(e);o&&o.setMap(null)},_hideMember:function(){const e=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let n=0,c=l.length;n<c;n++)l[n].setMap(null);o&&!o.getMap()&&o.setMap(e)},_calcBounds:function(e){const o=this._markerClusters.getMap(),l=new t.maps.LatLngBounds(e.clone(),e.clone()),n=o.getBounds(),c=o.getProjection(),d=c.fromCoordToOffset(n.getNE()),h=c.fromCoordToOffset(n.getSW()),u=c.fromCoordToOffset(l.getNE()),_=c.fromCoordToOffset(l.getSW()),g=this._markerClusters.getGridSize()/2;u.add(g,-g),_.add(-g,g);const p=Math.min(d.x,u.x),C=Math.max(d.y,u.y),y=Math.max(h.x,_.x),T=Math.min(h.y,_.y),B=c.fromOffsetToCoord(new t.maps.Point(p,C)),S=c.fromOffsetToCoord(new t.maps.Point(y,T));return new t.maps.LatLngBounds(S,B)},_getIndex:function(e){const o=this._markerClusters.getIndexGenerator();if(t.maps.Util.isFunction(o))return o(e);if(t.maps.Util.isArray(o)){let l=0;for(let n=0,c=o.length;n<c;n++){const d=o[n];if(e<d)break;l++}return l}return 0},_isMember:function(e){return this._clusterMember.indexOf(e)!==-1},_calcAverageCenter:function(e){const o=e.length,l=[0,0];for(let n=0;n<o;n++)l[0]+=e[n].position.x,l[1]+=e[n].position.y;return l[0]/=o,l[1]/=o,new t.maps.Point(l[0],l[1])}},s}const ie=t=>{const{naver:s}=K(),[r,e]=m.useState([]),o=m.useRef(new Map),l=m.useRef(null),n=m.useCallback(_=>{if(!t||!s)return null;const g=J(_),p=new s.maps.Marker({..._,position:new s.maps.LatLng(_.position.latitude,_.position.longitude),map:t,icon:{content:g}});return _.onClick&&s.maps.Event.addListener(p,"click",()=>{_.onClick(_.id)}),e(C=>[...C,p]),o.current.set(_.id,{marker:p,data:_}),p},[t,s]),c=m.useCallback((_,g)=>{const p=o.current.get(_);if(!p||!s)return;const{marker:C,data:y}=p,T={...y,...g},B=C.getElement();if(B){const S=B.querySelector(".popdeal-marker");S&&"active"in g&&S.setAttribute("active",String(!!g.active))}o.current.set(_,{marker:C,data:T})},[s]),d=m.useCallback(()=>{r.forEach(_=>{_&&_.setMap(null)}),e([]),o.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[r]),h=m.useCallback(_=>{!t||!s||t.panTo(new s.maps.LatLng(_.latitude,_.longitude))},[t,s]),u=m.useCallback(_=>{if(!t||!s||_.length===0)return;const g=new s.maps.LatLngBounds(new s.maps.LatLng(_[0].latitude,_[0].longitude),new s.maps.LatLng(_[0].latitude,_[0].longitude));_.forEach(p=>{g.extend(new s.maps.LatLng(p.latitude,p.longitude))}),t.fitBounds(g)},[t,s]);return m.useEffect(()=>{if(!s||!t||r.length===0)return;const _=ae(s),p={content:J({type:"cluster",count:0}),size:new s.maps.Size(96,96),anchor:new s.maps.Point(20,20)},C=new _({minClusterSize:2,maxZoom:17,map:t,markers:r,disableClickZoom:!1,gridSize:120,icons:[p],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(y,T)=>{if(y&&typeof y.getElement=="function"){const B=y.getElement().querySelector(".cluster-marker-text");B&&(B.textContent=String(T))}}});return l.current=C,()=>{C.setMap(null)}},[s,t,r]),{addMarker:n,updateMarker:c,clearMarkers:d,panTo:h,fitBounds:u}},Q=({options:t,onLoad:s})=>{const r=m.useRef(null),e=m.useRef(null),{createMap:o}=K(),[l,n]=m.useState(null),c=ie(l),{width:d="100%",height:h="100%",...u}=t||{},_=m.useMemo(()=>u,[JSON.stringify(u)]);return m.useEffect(()=>{if(typeof document>"u"||document.getElementById("pop-ui-map-marker-styles"))return;const p=document.createElement("style");return p.id="pop-ui-map-marker-styles",p.textContent=oe,document.head.appendChild(p),e.current=p,()=>{}},[]),m.useEffect(()=>{let g=null,p=null;if(l&&(l.destroy(),n(null)),r.current&&r.current.isConnected){const C=()=>r.current&&r.current.isConnected&&(g=o(r,_),g)?(n(g),!0):!1;if(!C()){let y=0;const T=50;p=setInterval(()=>{y++,(C()||y>=T)&&p&&(clearInterval(p),p=null)},100)}return()=>{p&&clearInterval(p),g&&(g.destroy(),g=null)}}return()=>{p&&clearInterval(p),g&&(g.destroy(),g=null)}},[o,_]),m.useEffect(()=>{l&&s&&s({map:l,...c})},[l,s,c]),a.jsx("div",{ref:r,style:{width:typeof d=="number"?`${d}px`:d,height:typeof h=="number"?`${h}px`:h}})};Q.displayName="Map";const Ye="위치 정보를 불러오는 데 실패했어요.",Ve="위치 서비스 권한과 네트워크 상태를 확인해주세요.",je=({isActive:t=!1,errorMessage:s=Ye,errorDescription:r=Ve})=>{const[e,o]=m.useState(!1),[l,n]=m.useState(!1),[c,d]=m.useState(null),h=m.useRef(!1);return m.useEffect(()=>{if(t&&typeof navigator<"u"&&"geolocation"in navigator){if(h.current)return;h.current=!0,requestAnimationFrame(()=>{o(!0)});const u={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(_=>{d({latitude:_.coords.latitude,longitude:_.coords.longitude}),o(!1),n(!1),h.current=!1},_=>{d(null),console.error("Geolocation error:",_),N({message:`${s} ${r}`}),o(!1),n(!0),h.current=!1},u)}},[t,s,r]),{position:c,isLoading:e,isError:l}},ce=(t="light")=>{const s=[];return Object.entries(i.colors).forEach(([r,e])=>{Object.entries(e).forEach(([o,l])=>{const n=i.getCSSVariableName(r,o);s.push(`${n}: ${l};`)})}),s.join(`
|
|
320
|
-
`)},
|
|
321
|
+
`,qe=f.createContext(null),Ke="naver-map-script",rr=(e,r)=>new Promise((n,t)=>{if(typeof window<"u"&&window.naver?.maps){n();return}const o=document.getElementById(Ke);if(o){o.addEventListener("load",()=>n()),o.addEventListener("error",()=>t(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=Ke,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${e}&language=${r}`,l.async=!0,l.onload=()=>{n()},l.onerror=()=>{t(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),Je=({clientId:e,language:r="ko",children:n})=>{const[t,o]=f.useState(null),[l,s]=f.useState({}),[i,c]=f.useState(null);f.useEffect(()=>{typeof window>"u"||rr(e,r).then(()=>{window.naver&&o(window.naver)}).catch(d=>{console.error("Naver Map script loading failed:",d),c(d)})},[e,r]);const m=f.useCallback((d,_)=>{const u=t||(typeof window<"u"?window.naver:null);if(!u||(!t&&window.naver&&o(window.naver),!d.current))return null;const p=d.current;if(!p.isConnected)return null;try{const h={center:new u.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,..._},g=new u.maps.Map(p,h);return s(y=>{const k=p.getAttribute("id")||"default";return{...y,[k]:g}}),g}catch(h){return console.error("Map creation error:",h),null}},[t]);return i&&console.error("NaverMapProvider error:",i),a.jsx(qe.Provider,{value:{naver:t,createMap:m,maps:l},children:n})},be=()=>{const e=f.useContext(qe);if(!e)throw new Error("useNaverMap must be used within NaverMapProvider");return e};function Xe(e){const r=function(t){this.DEFAULT_OPTIONS={map:null,markers:[],disableClickZoom:!0,minClusterSize:2,maxZoom:13,gridSize:100,icons:[],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:function(){}},this._clusters=[],this._mapRelations=null,this._markerRelations=[],this.setOptions(e.maps.Util.extend({},this.DEFAULT_OPTIONS,t),!0),this.setMap(t.map||null)};e.maps.Util.ClassExtend(r,e.maps.OverlayView,{onAdd:function(){const t=this.getMap();this._mapRelations=e.maps.Event.addListener(t,"idle",e.maps.Util.bind(this._onIdle,this)),this.getMarkers().length>0&&(this._createClusters(),this._updateClusters())},draw:e.maps.Util.noop,onRemove:function(){e.maps.Event.removeListener(this._mapRelation),this._clearClusters(),this._geoTree=null,this._mapRelation=null},setOptions:function(t){const o=this;if(typeof t=="string"){const l=t,s=arguments[1];o.set(l,s)}else{const l=arguments[1];e.maps.Util.forEach(t,function(s,i){i!=="map"&&o.set(i,s)}),t.map&&!l&&o.setMap(t.map)}},getOptions:function(t){const o=this,l={};return t!==void 0?o.get(t):(e.maps.Util.forEach(o.DEFAULT_OPTIONS,function(s,i){l[i]=o.get(i)}),l)},getMinClusterSize:function(){return this.getOptions("minClusterSize")},setMinClusterSize:function(t){this.setOptions("minClusterSize",t)},getMaxZoom:function(){return this.getOptions("maxZoom")},setMaxZoom:function(t){this.setOptions("maxZoom",t)},getGridSize:function(){return this.getOptions("gridSize")},setGridSize:function(t){this.setOptions("gridSize",t)},getIndexGenerator:function(){return this.getOptions("indexGenerator")},setIndexGenerator:function(t){this.setOptions("indexGenerator",t)},getMarkers:function(){return this.getOptions("markers")},setMarkers:function(t){this.setOptions("markers",t)},getIcons:function(){return this.getOptions("icons")},setIcons:function(t){this.setOptions("icons",t)},getStylingFunction:function(){return this.getOptions("stylingFunction")},setStylingFunction:function(t){this.setOptions("stylingFunction",t)},getDisableClickZoom:function(){return this.getOptions("disableClickZoom")},setDisableClickZoom:function(t){this.setOptions("disableClickZoom",t)},getAverageCenter:function(){return this.getOptions("averageCenter")},setAverageCenter:function(t){this.setOptions("averageCenter",t)},changed:function(t,o){if(this.getMap())switch(t){case"marker":case"minClusterSize":case"gridSize":case"averageCenter":this._redraw();break;case"indexGenerator":case"icons":this._clusters.forEach(function(s){s.updateIcon()});break;case"maxZoom":this._clusters.forEach(function(s){s.getCount()>1&&s.checkByZoomAndMinClusterSize()});break;case"stylingFunction":this._clusters.forEach(function(s){s.updateCount()});break;case"disableClickZoom":let l="enableClickZoom";o&&(l="disableClickZoom"),this._clusters.forEach(function(s){s[l]()});break}},_createClusters:function(){const t=this.getMap();if(!t)return;const o=t.getBounds(),l=this.getMarkers();for(let s=0,i=l.length;s<i;s++){const c=l[s],m=c.getPosition();if(!o.hasLatLng(m))continue;this._getClosestCluster(m).addMarker(c),this._markerRelations.push(e.maps.Event.addListener(c,"dragend",e.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const t=this._clusters;for(let o=0,l=t.length;o<l;o++)t[o].updateCluster()},_clearClusters:function(){const t=this._clusters;for(let o=0,l=t.length;o<l;o++)t[o].destroy();e.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(t){const o=this.getProjection(),l=this._clusters;let s=null,i=1/0;for(let c=0,m=l.length;c<m;c++){const d=l[c],_=d.getCenter();if(d.isInBounds(t)){const u=o.getDistance(_,t);u<i&&(i=u,s=d)}}return s||(s=new n(this),this._clusters.push(s)),s},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const n=function(t){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=t};return n.prototype={constructor:n,addMarker:function(t){if(!this._isMember(t)){if(!this._clusterCenter){const o=t.getPosition();this._clusterCenter=o,this._clusterBounds=this._calcBounds(o)}this._clusterMember.push(t)}},destroy:function(){e.maps.Event.removeListener(this._relation);const t=this._clusterMember;for(let o=0,l=t.length;o<l;o++)t[o].setMap(null);this._clusterMarker.setMap(null),this._clusterMarker=null,this._clusterCenter=null,this._clusterBounds=null,this._relation=null,this._clusterMember=[]},getCenter:function(){return this._clusterCenter},getBounds:function(){return this._clusterBounds},getCount:function(){return this._clusterMember.length},getClusterMember:function(){return this._clusterMember},isInBounds:function(t){return this._clusterBounds&&this._clusterBounds.hasLatLng(t)},enableClickZoom:function(){if(this._relation)return;const t=this._markerClusters.getMap();this._relation=e.maps.Event.addListener(this._clusterMarker,"click",e.maps.Util.bind(function(o){t.morph(o.coord,t.getZoom()+1)},this))},disableClickZoom:function(){this._relation&&(e.maps.Event.removeListener(this._relation),this._relation=null)},updateCluster:function(){if(!this._clusterMarker){let t;this._markerClusters.getAverageCenter()?t=this._calcAverageCenter(this._clusterMember):t=this._clusterCenter,this._clusterMarker=new e.maps.Marker({position:t,map:this._markerClusters.getMap()}),this._markerClusters.getDisableClickZoom()||this.enableClickZoom()}this.updateIcon(),this.updateCount(),this.checkByZoomAndMinClusterSize()},checkByZoomAndMinClusterSize:function(){const t=this._markerClusters,o=t.getMinClusterSize(),l=t.getMaxZoom(),s=t.getMap().getZoom();this.getCount()<o?this._showMember():(this._hideMember(),l<=s&&this._showMember())},updateCount:function(){const t=this._markerClusters.getStylingFunction();t&&t(this._clusterMarker,this.getCount())},updateIcon:function(){const t=this.getCount();let o=this._getIndex(t);const l=this._markerClusters.getIcons();o=Math.max(o,0),o=Math.min(o,l.length-1),this._clusterMarker.setIcon(l[o])},_showMember:function(){const t=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(t);o&&o.setMap(null)},_hideMember:function(){const t=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(null);o&&!o.getMap()&&o.setMap(t)},_calcBounds:function(t){const o=this._markerClusters.getMap(),l=new e.maps.LatLngBounds(t.clone(),t.clone()),s=o.getBounds(),i=o.getProjection(),c=i.fromCoordToOffset(s.getNE()),m=i.fromCoordToOffset(s.getSW()),d=i.fromCoordToOffset(l.getNE()),_=i.fromCoordToOffset(l.getSW()),u=this._markerClusters.getGridSize()/2;d.add(u,-u),_.add(-u,u);const p=Math.min(c.x,d.x),h=Math.max(c.y,d.y),g=Math.max(m.x,_.x),y=Math.min(m.y,_.y),k=i.fromOffsetToCoord(new e.maps.Point(p,h)),S=i.fromOffsetToCoord(new e.maps.Point(g,y));return new e.maps.LatLngBounds(S,k)},_getIndex:function(t){const o=this._markerClusters.getIndexGenerator();if(e.maps.Util.isFunction(o))return o(t);if(e.maps.Util.isArray(o)){let l=0;for(let s=0,i=o.length;s<i;s++){const c=o[s];if(t<c)break;l++}return l}return 0},_isMember:function(t){return this._clusterMember.indexOf(t)!==-1},_calcAverageCenter:function(t){const o=t.length,l=[0,0];for(let s=0;s<o;s++)l[0]+=t[s].position.x,l[1]+=t[s].position.y;return l[0]/=o,l[1]/=o,new e.maps.Point(l[0],l[1])}},r}const Qe=e=>{const{naver:r}=be(),[n,t]=f.useState([]),o=f.useRef(new Map),l=f.useRef(null),s=f.useCallback(_=>{if(!e||!r)return null;const u=Te(_),p=new r.maps.Marker({..._,position:new r.maps.LatLng(_.position.latitude,_.position.longitude),map:e,icon:{content:u}});return _.onClick&&r.maps.Event.addListener(p,"click",()=>{_.onClick(_.id)}),t(h=>[...h,p]),o.current.set(_.id,{marker:p,data:_}),p},[e,r]),i=f.useCallback((_,u)=>{const p=o.current.get(_);if(!p||!r)return;const{marker:h,data:g}=p,y={...g,...u},k=h.getElement();if(k){const S=k.querySelector(".popdeal-marker");S&&"active"in u&&S.setAttribute("active",String(!!u.active))}o.current.set(_,{marker:h,data:y})},[r]),c=f.useCallback(()=>{n.forEach(_=>{_&&_.setMap(null)}),t([]),o.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[n]),m=f.useCallback(_=>{!e||!r||e.panTo(new r.maps.LatLng(_.latitude,_.longitude))},[e,r]),d=f.useCallback(_=>{if(!e||!r||_.length===0)return;const u=new r.maps.LatLngBounds(new r.maps.LatLng(_[0].latitude,_[0].longitude),new r.maps.LatLng(_[0].latitude,_[0].longitude));_.forEach(p=>{u.extend(new r.maps.LatLng(p.latitude,p.longitude))}),e.fitBounds(u)},[e,r]);return f.useEffect(()=>{if(!r||!e||n.length===0)return;const _=Xe(r),p={content:Te({type:"cluster",count:0}),size:new r.maps.Size(96,96),anchor:new r.maps.Point(20,20)},h=new _({minClusterSize:2,maxZoom:17,map:e,markers:n,disableClickZoom:!1,gridSize:120,icons:[p],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(g,y)=>{if(g&&typeof g.getElement=="function"){const k=g.getElement().querySelector(".cluster-marker-text");k&&(k.textContent=String(y))}}});return l.current=h,()=>{h.setMap(null)}},[r,e,n]),{addMarker:s,updateMarker:i,clearMarkers:c,panTo:m,fitBounds:d}},Ie=({options:e,onLoad:r})=>{const n=f.useRef(null),t=f.useRef(null),{createMap:o}=be(),[l,s]=f.useState(null),i=Qe(l),{width:c="100%",height:m="100%",...d}=e||{},_=f.useMemo(()=>d,[JSON.stringify(d)]);return f.useEffect(()=>{if(typeof document>"u"||document.getElementById("pop-ui-map-marker-styles"))return;const p=document.createElement("style");return p.id="pop-ui-map-marker-styles",p.textContent=Ge,document.head.appendChild(p),t.current=p,()=>{}},[]),f.useEffect(()=>{let u=null,p=null;if(l&&(l.destroy(),s(null)),n.current&&n.current.isConnected){const h=()=>n.current&&n.current.isConnected&&(u=o(n,_),u)?(s(u),!0):!1;if(!h()){let g=0;const y=50;p=setInterval(()=>{g++,(h()||g>=y)&&p&&(clearInterval(p),p=null)},100)}return()=>{p&&clearInterval(p),u&&(u.destroy(),u=null)}}return()=>{p&&clearInterval(p),u&&(u.destroy(),u=null)}},[o,_]),f.useEffect(()=>{l&&r&&r({map:l,...i})},[l,r,i]),a.jsx("div",{ref:n,style:{width:typeof c=="number"?`${c}px`:c,height:typeof m=="number"?`${m}px`:m}})};Ie.displayName="Map";const nr="위치 정보를 불러오는 데 실패했어요.",or="위치 서비스 권한과 네트워크 상태를 확인해주세요.",ar=({isActive:e=!1,errorMessage:r=nr,errorDescription:n=or})=>{const[t,o]=f.useState(!1),[l,s]=f.useState(!1),[i,c]=f.useState(null),m=f.useRef(!1);return f.useEffect(()=>{if(e&&typeof navigator<"u"&&"geolocation"in navigator){if(m.current)return;m.current=!0,requestAnimationFrame(()=>{o(!0)});const d={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(_=>{c({latitude:_.coords.latitude,longitude:_.coords.longitude}),o(!1),s(!1),m.current=!1},_=>{c(null),console.error("Geolocation error:",_),oe({message:`${r} ${n}`}),o(!1),s(!0),m.current=!1},d)}},[e,r,n]),{position:i,isLoading:t,isError:l}},Re=(e="light")=>{const r=[];return Object.entries(D.colors).forEach(([n,t])=>{Object.entries(t).forEach(([o,l])=>{const s=D.getCSSVariableName(n,o);r.push(`${s}: ${l};`)})}),r.join(`
|
|
322
|
+
`)},sr=(e="light")=>{const r=document.getElementById("pop-ui-theme-vars");r&&r.remove();const n=document.createElement("style");n.id="pop-ui-theme-vars",n.textContent=`
|
|
321
323
|
:root {
|
|
322
|
-
${
|
|
324
|
+
${Re("light")}
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
[data-theme="dark"] {
|
|
326
|
-
${
|
|
328
|
+
${Re("dark")}
|
|
327
329
|
}
|
|
328
|
-
`,document.head.appendChild(
|
|
330
|
+
`,document.head.appendChild(n)},re=e=>{const r=D.colors[e],n=Object.keys(r).sort((o,l)=>Number(o)-Number(l));return[D.getCSSVariableRef(e,n[0]||n[n.length-1]),D.getCSSVariableRef(e,n[1]||n[n.length-1]),D.getCSSVariableRef(e,n[2]||n[n.length-1]),D.getCSSVariableRef(e,n[3]||n[n.length-1]),D.getCSSVariableRef(e,n[4]||n[n.length-1]),D.getCSSVariableRef(e,n[5]||n[n.length-1]),D.getCSSVariableRef(e,n[6]||n[n.length-1]),D.getCSSVariableRef(e,n[7]||n[n.length-1]),D.getCSSVariableRef(e,n[8]||n[n.length-1]),D.getCSSVariableRef(e,n[9]||n[n.length-1])]},lr=P.createTheme({colors:{gray:re("gray"),aqua:re("aqua"),red:re("red"),orange:re("orange"),yellow:re("yellow"),green:re("green"),blue:re("blue"),purple:re("purple"),grape:re("grape")},primaryColor:"aqua",primaryShade:5,fontFamily:'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),et=f.createContext(void 0),tt=f.createContext({}),ir=({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(()=>{sr(i),document.documentElement.setAttribute("data-theme",i)},[i]);const m=()=>{c(d=>d==="light"?"dark":"light")};return a.jsx(et.Provider,{value:{theme:i,setTheme:c,toggleTheme:m},children:a.jsx(tt.Provider,{value:{naverClientId:n},children:a.jsxs(P.MantineProvider,{theme:lr,children:[a.jsx(le.Notifications,{position:t,limit:o,autoClose:l,zIndex:s}),e]})})})},cr=()=>{const e=f.useContext(et);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e},_r=()=>f.useContext(tt),R={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"},dr=60,ur=({location:e,marker:r,direction:n,toast:t,naverClientId:o,onExpandRequest:l,onClick:s,height:i=200})=>{const c=_r(),m=o||c.naverClientId,{title:d,address:_,latitude:u,longitude:p}=e,h=n?.label??"길찾기",g=t?.addressCopied??"주소 복사 완료",[y,k]=f.useState(null),S=i-dr,I=f.useCallback(T=>{T&&T.map&&k(T)},[]),$=f.useCallback(()=>{l?.()},[l]),N=f.useCallback((T,x,v)=>{if(T&&T.map&&u&&p)try{T.addMarker(x),v?.()}catch(O){console.error("Error creating map marker:",O)}},[u,p]),U=f.useCallback((T,x)=>{T&&T.map&&u&&p&&(T.clearMarkers(),N(T,{id:`location-marker-${d}`,type:x,position:{latitude:u,longitude:p},title:d,icon:r?.imageUrl,address:_},()=>{T.panTo({latitude:u,longitude:p})}))},[u,p,d,r?.imageUrl,_,N]);f.useEffect(()=>{u&&p&&y&&U(y,"pi")},[y,u,p,U]),f.useEffect(()=>()=>{k(null)},[]);const H=f.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(_),oe(g))},[_,g]),B=f.useMemo(()=>n?.url?n.url:`https://map.naver.com/p/search/${encodeURIComponent(d)}`,[n?.url,d]);return m?a.jsxs("div",{className:R.MapInfo,style:{height:i},onClick:s,children:[a.jsx(Je,{clientId:m,children:a.jsxs("div",{className:R.MapInfo__Preview,onClick:$,children:[a.jsx(Ie,{onLoad:I,options:{width:"100%",height:`${S}px`,center:{lat:u,lng:p},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:R.MapInfo__ExpandButton,children:a.jsx(D.IconMap,{color:D.ColorGray800,size:18})})]})}),a.jsxs("div",{className:R.MapInfo__AddressBar,children:[a.jsxs("div",{className:R.MapInfo__AddressContent,children:[a.jsx(D.IconMapMarker,{color:D.ColorAqua500,size:24,variant:"filled"}),a.jsx("span",{className:R.MapInfo__Address,onClick:H,role:"button",tabIndex:0,onKeyDown:T=>T.key==="Enter"&&H(),children:_})]}),a.jsx("a",{className:R.MapInfo__DirectionLink,href:B,target:"_blank",rel:"noreferrer",children:a.jsx(ie,{variant:"basic",size:"sm",className:R.MapInfo__DirectionButton,children:h})})]})]}):a.jsx("div",{className:R.MapInfo,style:{height:i},children:a.jsx("div",{className:R.MapInfo__NoClientId,children:"naverClientId가 필요합니다. PopUIProvider 또는 props로 전달해주세요."})})};C.Button=ie,C.CalendarDatePicker=Ee,C.Checkbox=ut,C.DatePicker=kt,C.Dropdown=Ct,C.ImageInput=At,C.LottieInput=$t,C.Map=Ie,C.MapInfo=ur,C.Modal=Fe,C.NaverMapProvider=Je,C.Pagination=zt,C.PopUiProvider=ir,C.Radio=Wt,C.SearchBar=Zt,C.SegmentButton=Vt,C.Tab=Ut,C.TextField=Gt,C.TimePicker=qt,C.Toggle=Kt,C.Tooltip=Jt,C.getMarkerHTML=Te,C.makeMarkerClustering=Xe,C.markerStyles=Ge,C.toast=oe,C.useLocation=ar,C.useMap=Qe,C.useNaverMap=be,C.useTheme=cr,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { AutocompleteProps } from '@mantine/core';
|
|
2
2
|
import { ButtonProps } from '@mantine/core';
|
|
3
3
|
import { CheckboxProps } from '@mantine/core';
|
|
4
|
-
import { DatePickerInputProps } from '@mantine/dates';
|
|
5
4
|
import { DatePickerProps } from '@mantine/dates';
|
|
6
5
|
import { DateValue } from '@mantine/dates';
|
|
7
6
|
import { default as default_2 } from 'react';
|
|
8
|
-
import { DropzoneProps } from '@mantine/dropzone';
|
|
9
|
-
import { FileWithPath } from '@mantine/dropzone';
|
|
10
7
|
import { HTMLAttributes } from 'react';
|
|
11
8
|
import { InputProps } from '@mantine/core';
|
|
12
9
|
import { JSX } from 'react/jsx-runtime';
|
|
13
10
|
import { ModalProps } from '@mantine/core';
|
|
14
11
|
import { NotificationsProps } from '@mantine/notifications';
|
|
12
|
+
import { PopoverProps } from '@mantine/core';
|
|
15
13
|
import { RadioProps } from '@mantine/core';
|
|
16
14
|
import { ReactNode } from 'react';
|
|
17
15
|
import { SegmentedControlProps } from '@mantine/core';
|
|
18
16
|
import { SelectProps } from '@mantine/core';
|
|
19
17
|
import { SwitchProps } from '@mantine/core';
|
|
20
18
|
import { TabsProps } from '@mantine/core';
|
|
19
|
+
import { TDateDisplayType } from '@pop-ui/foundation';
|
|
21
20
|
import { TextareaProps } from '@mantine/core';
|
|
22
21
|
import { TimeInputProps } from '@mantine/dates';
|
|
23
22
|
import { TooltipProps } from '@mantine/core';
|
|
24
23
|
|
|
25
|
-
export declare function Button({ children, size, variant, isLoading, disabled, ...props }: IButtonProps): JSX.Element;
|
|
24
|
+
export declare function Button({ children, size, variant, isLoading, hideLabelOnLoading, disabled, className, classNames, loaderProps, ...props }: IButtonProps): JSX.Element;
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
27
|
* CalendarDatePicker
|
|
@@ -36,7 +35,7 @@ export declare const CalendarDatePicker: ({ excludedDates, excludedDays, type, v
|
|
|
36
35
|
|
|
37
36
|
export declare const Checkbox: ({ size, ...props }: ICheckboxProps) => JSX.Element;
|
|
38
37
|
|
|
39
|
-
export declare const DatePicker: ({ size, type, withTime,
|
|
38
|
+
export declare const DatePicker: ({ size, type, withTime, className, popoverProps, rightSection, rightSectionWidth, value, defaultValue, onChange, placeholder, disabled, minDate, maxDate, displayValueFormat, valueFormat, excludedDates, excludedDays, highlightToday, }: IDatePickerProps) => JSX.Element;
|
|
40
39
|
|
|
41
40
|
export declare const Dropdown: ({ label, labelPosition, size, required, tooltip, tooltipPosition, errorMsg, description, ...props }: IDropdownProps) => JSX.Element;
|
|
42
41
|
|
|
@@ -54,6 +53,7 @@ declare interface IButtonProps extends Omit<ButtonProps, 'variant' | 'styles'> {
|
|
|
54
53
|
size?: TButtonSize;
|
|
55
54
|
variant?: TButtonVariant;
|
|
56
55
|
isLoading?: boolean;
|
|
56
|
+
hideLabelOnLoading?: boolean;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -116,10 +116,30 @@ export declare interface ICoord {
|
|
|
116
116
|
longitude: number;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
declare interface IDatePickerProps
|
|
119
|
+
declare interface IDatePickerProps {
|
|
120
120
|
size?: 'sm' | 'md' | 'lg';
|
|
121
|
-
type?:
|
|
121
|
+
type?: TDateDisplayType;
|
|
122
122
|
withTime?: boolean;
|
|
123
|
+
value?: string | null | string[] | [string | null, string | null];
|
|
124
|
+
defaultValue?: string | null | string[] | [string | null, string | null];
|
|
125
|
+
onChange?: (value: string | null | string[] | [string | null, string | null]) => void;
|
|
126
|
+
placeholder?: string;
|
|
127
|
+
label?: React.ReactNode;
|
|
128
|
+
description?: React.ReactNode;
|
|
129
|
+
error?: React.ReactNode;
|
|
130
|
+
disabled?: boolean;
|
|
131
|
+
clearable?: boolean;
|
|
132
|
+
minDate?: Date;
|
|
133
|
+
maxDate?: Date;
|
|
134
|
+
displayValueFormat?: string;
|
|
135
|
+
valueFormat?: string;
|
|
136
|
+
excludedDates?: (string | [string, string])[];
|
|
137
|
+
excludedDays?: TDayOfWeek[];
|
|
138
|
+
highlightToday?: boolean;
|
|
139
|
+
className?: string;
|
|
140
|
+
popoverProps?: PopoverProps;
|
|
141
|
+
rightSection?: React.ReactNode;
|
|
142
|
+
rightSectionWidth?: number;
|
|
123
143
|
}
|
|
124
144
|
|
|
125
145
|
declare interface IDropdownProps extends SelectProps {
|
|
@@ -132,21 +152,53 @@ declare interface IDropdownProps extends SelectProps {
|
|
|
132
152
|
errorMsg?: string;
|
|
133
153
|
}
|
|
134
154
|
|
|
135
|
-
declare interface IImageUploaderProps extends DropzoneProps {
|
|
136
|
-
width?: number;
|
|
137
|
-
height?: number;
|
|
138
|
-
defaultMsg?: ReactNode;
|
|
139
|
-
file?: string | FileWithPath;
|
|
140
|
-
showClearButton?: boolean;
|
|
141
|
-
onClear?: () => void;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
155
|
export declare interface ILocation {
|
|
145
156
|
latitude?: number;
|
|
146
157
|
longitude?: number;
|
|
147
158
|
}
|
|
148
159
|
|
|
149
|
-
export declare const
|
|
160
|
+
export declare const ImageInput: ({ value, onChange, accept, length, width, height, placeholder, hasIcon, hasLink, onLinkClick, hasEdit, canDelete, minLength, maxLength, errorMsg, isLoading, readOnly, gap, }: ImageInputProps) => JSX.Element;
|
|
161
|
+
|
|
162
|
+
export declare type ImageInputAccept = TImageMimeType[];
|
|
163
|
+
|
|
164
|
+
export declare type ImageInputChangeAction = 'create' | 'replace' | 'delete' | 'reorder' | 'crop';
|
|
165
|
+
|
|
166
|
+
export declare interface ImageInputChangeMeta {
|
|
167
|
+
action: ImageInputChangeAction;
|
|
168
|
+
itemId: string;
|
|
169
|
+
index: number;
|
|
170
|
+
previousIndex?: number;
|
|
171
|
+
nextIndex?: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export declare interface ImageInputItem {
|
|
175
|
+
id: string;
|
|
176
|
+
url?: string;
|
|
177
|
+
file?: File;
|
|
178
|
+
isLoading?: boolean;
|
|
179
|
+
position?: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare interface ImageInputProps {
|
|
183
|
+
value: ImageInputItem[];
|
|
184
|
+
onChange?: (nextValue: ImageInputItem[], meta: ImageInputChangeMeta) => void;
|
|
185
|
+
accept?: ImageInputAccept;
|
|
186
|
+
length?: number;
|
|
187
|
+
width?: number;
|
|
188
|
+
height?: number;
|
|
189
|
+
placeholder?: TImageInputPlaceholder;
|
|
190
|
+
hasIcon?: boolean;
|
|
191
|
+
hasLink?: boolean;
|
|
192
|
+
onLinkClick?: (item: ImageInputItem) => void;
|
|
193
|
+
hasEdit?: boolean;
|
|
194
|
+
minLength?: number;
|
|
195
|
+
maxLength?: number;
|
|
196
|
+
errorMsg?: ReactNode;
|
|
197
|
+
isLoading?: boolean;
|
|
198
|
+
readOnly?: boolean;
|
|
199
|
+
gap?: number;
|
|
200
|
+
canDelete?: boolean;
|
|
201
|
+
}
|
|
150
202
|
|
|
151
203
|
/** Direction/navigation options */
|
|
152
204
|
export declare interface IMapDirection {
|
|
@@ -329,6 +381,13 @@ declare interface IToastOptions {
|
|
|
329
381
|
autoClose?: number | false;
|
|
330
382
|
}
|
|
331
383
|
|
|
384
|
+
declare interface IToastRuntime {
|
|
385
|
+
(input: TToastInput): void;
|
|
386
|
+
update: (id: string, input: TToastInput) => void;
|
|
387
|
+
hide: (id: string) => void;
|
|
388
|
+
clean: () => void;
|
|
389
|
+
}
|
|
390
|
+
|
|
332
391
|
declare interface IToggleProps extends SwitchProps {
|
|
333
392
|
size?: 'sm' | 'md' | 'lg';
|
|
334
393
|
labelPosition: 'left' | 'right';
|
|
@@ -347,6 +406,46 @@ export declare interface IUseLocationOptions {
|
|
|
347
406
|
errorDescription?: string;
|
|
348
407
|
}
|
|
349
408
|
|
|
409
|
+
export declare const LottieInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, length, minLength, maxLength, errorMsg, isLoading, readOnly, gap, canDelete, }: LottieInputProps) => JSX.Element;
|
|
410
|
+
|
|
411
|
+
export declare type LottieInputChangeAction = 'create' | 'delete' | 'reorder';
|
|
412
|
+
|
|
413
|
+
export declare interface LottieInputChangeMeta {
|
|
414
|
+
action: LottieInputChangeAction;
|
|
415
|
+
itemId: string;
|
|
416
|
+
index: number;
|
|
417
|
+
previousIndex?: number;
|
|
418
|
+
nextIndex?: number;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export declare interface LottieInputItem {
|
|
422
|
+
id: string;
|
|
423
|
+
url?: string;
|
|
424
|
+
file?: File;
|
|
425
|
+
animationData?: Record<string, unknown>;
|
|
426
|
+
isLoading?: boolean;
|
|
427
|
+
position?: number;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export declare interface LottieInputProps {
|
|
431
|
+
value: LottieInputItem[];
|
|
432
|
+
onChange?: (nextValue: LottieInputItem[], meta: LottieInputChangeMeta) => void;
|
|
433
|
+
width?: number;
|
|
434
|
+
height?: number;
|
|
435
|
+
placeholder?: ReactNode | ((index: number) => ReactNode);
|
|
436
|
+
hasIcon?: boolean;
|
|
437
|
+
hasLink?: boolean;
|
|
438
|
+
onLinkClick?: (item: LottieInputItem) => void;
|
|
439
|
+
length?: number;
|
|
440
|
+
minLength?: number;
|
|
441
|
+
maxLength?: number;
|
|
442
|
+
errorMsg?: ReactNode;
|
|
443
|
+
isLoading?: boolean;
|
|
444
|
+
readOnly?: boolean;
|
|
445
|
+
gap?: number;
|
|
446
|
+
canDelete?: boolean;
|
|
447
|
+
}
|
|
448
|
+
|
|
350
449
|
/**
|
|
351
450
|
* Naver Maps Marker Clustering utility
|
|
352
451
|
* Creates clustered markers when multiple markers are close together
|
|
@@ -382,14 +481,18 @@ export declare const SegmentButton: ({ size, radius, ...props }: ISegmentButtonP
|
|
|
382
481
|
|
|
383
482
|
export declare const Tab: ({ tabList, containerPaddingTop, ...props }: ITabProps) => JSX.Element;
|
|
384
483
|
|
|
385
|
-
declare type TButtonSize =
|
|
484
|
+
declare type TButtonSize = 'sm' | 'md' | 'lg';
|
|
386
485
|
|
|
387
|
-
declare type TButtonVariant =
|
|
486
|
+
declare type TButtonVariant = 'primary' | 'primaryLine' | 'basic' | 'danger' | 'setting' | 'warning' | 'ghost';
|
|
388
487
|
|
|
389
488
|
export declare type TDayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
390
489
|
|
|
391
490
|
export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
|
|
392
491
|
|
|
492
|
+
declare type TImageInputPlaceholder = ReactNode | ((index: number) => ReactNode);
|
|
493
|
+
|
|
494
|
+
declare type TImageMimeType = 'image/png' | 'image/gif' | 'image/jpeg' | 'image/svg+xml' | 'image/webp' | 'image/avif' | 'image/heic' | 'image/heif';
|
|
495
|
+
|
|
393
496
|
export declare const TimePicker: ({ size, ...props }: ITimePickerProps) => JSX.Element;
|
|
394
497
|
|
|
395
498
|
export declare type TMarkerData = IClusterMarkerData | IPopdealMarkerData | IPinMarkerData | IPiMarkerData;
|
|
@@ -416,18 +519,14 @@ export declare type TMarkerType = 'cluster' | 'popdeal' | 'pin' | 'pi' | 'pi-exp
|
|
|
416
519
|
* message: '저장 중...',
|
|
417
520
|
* });
|
|
418
521
|
*
|
|
419
|
-
* //
|
|
420
|
-
* toast({
|
|
421
|
-
* id: 'save-toast',
|
|
522
|
+
* // 업데이트는 toast.update(id, input)로 수행합니다
|
|
523
|
+
* toast.update('save-toast', {
|
|
422
524
|
* message: '저장 완료!',
|
|
423
525
|
* });
|
|
526
|
+
*
|
|
527
|
+
* // 런타임에서는 PopUiProvider가 Notifications 경계를 제공합니다
|
|
424
528
|
*/
|
|
425
|
-
export declare const toast:
|
|
426
|
-
(input: TToastInput): void;
|
|
427
|
-
update(id: string, input: TToastInput): void;
|
|
428
|
-
hide(id: string): void;
|
|
429
|
-
clean(): void;
|
|
430
|
-
};
|
|
529
|
+
export declare const toast: IToastRuntime;
|
|
431
530
|
|
|
432
531
|
export declare const Toggle: ({ size, labelPosition, disabled, onChange, ...props }: IToggleProps) => JSX.Element;
|
|
433
532
|
|