@vacano/ui 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),be=require("@emotion/react"),u=require("react"),t=require("./media-BuwIclXE.cjs"),A=require("./tooling-Dflq0Y98.cjs"),ge=require("react-dom");function no(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=no(u);function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var i in o)({}).hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},vt.apply(null,arguments)}const ao=be.css`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-BIgkmQPR.cjs"),be=require("@emotion/react"),p=require("react"),t=require("./media-BuwIclXE.cjs"),A=require("./tooling-Dflq0Y98.cjs"),ge=require("react-dom");function no(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=no(p);function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var i in o)({}).hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},Ct.apply(null,arguments)}const ao=be.css`
2
2
  *,
3
3
  *::before,
4
4
  *::after {
@@ -141,11 +141,11 @@
141
141
  :focus:not(:focus-visible) {
142
142
  outline: none;
143
143
  }
144
- `,lo=()=>a.jsx(be.Global,{styles:ao});var co=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,so=a.memoize(function(e){return co.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),po=so,uo=function(r){return r!=="theme"},Tt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?po:uo},It=function(r,o,i){var n;if(o){var l=o.shouldForwardProp;n=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=r.__emotion_forwardProp),n},ho=function(r){var o=r.cache,i=r.serialized,n=r.isStringTag;return a.registerStyles(o,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,i,n)}),null},bo=function e(r,o){var i=r.__emotion_real===r,n=i&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=It(r,o,i),p=d||Tt(n),h=!p("as");return function(){var g=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),g[0]==null||g[0].raw===void 0)f.push.apply(f,g);else{var O=g[0];f.push(O[0]);for(var m=g.length,y=1;y<m;y++)f.push(g[y],O[y])}var S=be.withEmotionCache(function(C,x,$){var b=h&&C.as||n,L="",E=[],T=C;if(C.theme==null){T={};for(var V in C)T[V]=C[V];T.theme=Re.useContext(be.ThemeContext)}typeof C.className=="string"?L=a.getRegisteredStyles(x.registered,E,C.className):C.className!=null&&(L=C.className+" ");var z=a.serializeStyles(f.concat(E),x.registered,T);L+=x.key+"-"+z.name,c!==void 0&&(L+=" "+c);var D=h&&d===void 0?Tt(b):p,j={};for(var w in C)h&&w==="as"||D(w)&&(j[w]=C[w]);return j.className=L,$&&(j.ref=$),Re.createElement(Re.Fragment,null,Re.createElement(ho,{cache:x,serialized:z,isStringTag:typeof b=="string"}),Re.createElement(b,j))});return S.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",S.defaultProps=r.defaultProps,S.__emotion_real=S,S.__emotion_base=n,S.__emotion_styles=f,S.__emotion_forwardProp=d,Object.defineProperty(S,"toString",{value:function(){return"."+c}}),S.withComponent=function(C,x){var $=e(C,vt({},o,x,{shouldForwardProp:It(S,x,!0)}));return $.apply(void 0,f)},S}},go=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],s=bo.bind(null);go.forEach(function(e){s[e]=s(e)});const fo=s.span`
144
+ `,lo=()=>a.jsx(be.Global,{styles:ao});var co=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,so=a.memoize(function(e){return co.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),po=so,uo=function(r){return r!=="theme"},Tt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?po:uo},Nt=function(r,o,i){var n;if(o){var l=o.shouldForwardProp;n=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=r.__emotion_forwardProp),n},ho=function(r){var o=r.cache,i=r.serialized,n=r.isStringTag;return a.registerStyles(o,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,i,n)}),null},bo=function e(r,o){var i=r.__emotion_real===r,n=i&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=Nt(r,o,i),u=d||Tt(n),b=!u("as");return function(){var h=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),h[0]==null||h[0].raw===void 0)f.push.apply(f,h);else{var $=h[0];f.push($[0]);for(var m=h.length,S=1;S<m;S++)f.push(h[S],$[S])}var x=be.withEmotionCache(function(C,O,y){var g=b&&C.as||n,L="",z=[],N=C;if(C.theme==null){N={};for(var V in C)N[V]=C[V];N.theme=Re.useContext(be.ThemeContext)}typeof C.className=="string"?L=a.getRegisteredStyles(O.registered,z,C.className):C.className!=null&&(L=C.className+" ");var P=a.serializeStyles(f.concat(z),O.registered,N);L+=O.key+"-"+P.name,c!==void 0&&(L+=" "+c);var _=b&&d===void 0?Tt(g):u,j={};for(var w in C)b&&w==="as"||_(w)&&(j[w]=C[w]);return j.className=L,y&&(j.ref=y),Re.createElement(Re.Fragment,null,Re.createElement(ho,{cache:O,serialized:P,isStringTag:typeof g=="string"}),Re.createElement(g,j))});return x.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",x.defaultProps=r.defaultProps,x.__emotion_real=x,x.__emotion_base=n,x.__emotion_styles=f,x.__emotion_forwardProp=d,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(C,O){var y=e(C,Ct({},o,O,{shouldForwardProp:Nt(x,O,!0)}));return y.apply(void 0,f)},x}},go=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],s=bo.bind(null);go.forEach(function(e){s[e]=s(e)});const fo=s.span`
145
145
  font-size: 12px;
146
146
  font-weight: 500;
147
147
  color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
148
- `,xo=A.newClassNameGetter("field-label"),ie=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(fo,{...l,ref:o,className:xo("container",r),$variant:n,children:[e," ",i&&"*"]}):null,it={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ne={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Oo=s.div`
148
+ `,xo=A.newClassNameGetter("field-label"),ie=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(fo,{...l,ref:o,className:xo("container",r),$variant:n,children:[e," ",i&&"*"]}):null,ot={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ne={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Oo=s.div`
149
149
  position: relative;
150
150
  display: grid;
151
151
  gap: 2px;
@@ -163,10 +163,10 @@
163
163
  outline: none;
164
164
  font-size: 14px;
165
165
  font-weight: 500;
166
- height: ${e=>it[e.$size].height};
167
- padding: ${e=>it[e.$size].padding};
166
+ height: ${e=>ot[e.$size].height};
167
+ padding: ${e=>ot[e.$size].padding};
168
168
  padding-right: 40px;
169
- border-radius: ${e=>it[e.$size].radius};
169
+ border-radius: ${e=>ot[e.$size].radius};
170
170
 
171
171
  color: ${e=>ne[e.$variant].color.static};
172
172
  border: 1px solid ${e=>ne[e.$variant].border.static};
@@ -194,7 +194,7 @@
194
194
  display: flex;
195
195
  align-items: center;
196
196
  justify-content: center;
197
- `,vo=s.div`
197
+ `,mo=s.div`
198
198
  position: absolute;
199
199
  top: 100%;
200
200
  left: 0;
@@ -214,7 +214,7 @@
214
214
  opacity 0.15s ease,
215
215
  transform 0.15s ease,
216
216
  visibility 0.15s;
217
- `,mo=s.div`
217
+ `,vo=s.div`
218
218
  display: flex;
219
219
  align-items: center;
220
220
  gap: 10px;
@@ -255,22 +255,22 @@
255
255
  font-size: 14px;
256
256
  color: ${t.alpha(t.COLORS.black,50)};
257
257
  text-align: center;
258
- `,At={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},_t={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},nt=e=>At[e]??At.md,Lo=be.keyframes`
258
+ `,It={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},At={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},it=e=>It[e]??It.md,Lo=be.keyframes`
259
259
  0% {
260
260
  transform: rotate(0deg);
261
261
  }
262
262
  100% {
263
263
  transform: rotate(360deg);
264
264
  }
265
- `,Po=s.div`
265
+ `,Eo=s.div`
266
266
  display: inline-block;
267
- width: ${e=>nt(e.$size).size};
268
- height: ${e=>nt(e.$size).size};
269
- border: ${e=>nt(e.$size).borderWidth} solid ${_t.track};
270
- border-top-color: ${_t.indicator};
267
+ width: ${e=>it(e.$size).size};
268
+ height: ${e=>it(e.$size).size};
269
+ border: ${e=>it(e.$size).borderWidth} solid ${At.track};
270
+ border-top-color: ${At.indicator};
271
271
  border-radius: 50%;
272
272
  animation: ${Lo} 0.8s linear infinite;
273
- `,zo=A.newClassNameGetter("spinner"),Lt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(Po,{...n,ref:o,className:zo("container",r),role:"status","aria-label":e,$size:i}),ke=A.newClassNameGetter("autocomplete"),Eo=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",value:p,onChange:h,onSearch:g,debounceMs:f=300,minChars:O=1,noResultsMessage:m="No results found",...y})=>{const[S,C]=u.useState((p==null?void 0:p.value)??""),[x,$]=u.useState([]),[b,L]=u.useState(!1),[E,T]=u.useState(!1),[V,z]=u.useState(!1),D=u.useRef(null),j=u.useRef(null);u.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&C(p.value)},[p==null?void 0:p.value]);const w=u.useCallback(async N=>{if(N.length<O){$([]),z(!1);return}L(!0),z(!0);try{const F=await g(N);$(F),T(!0)}catch{$([])}finally{L(!1)}},[g,O]),M=u.useCallback(N=>{const F=N.target.value;C(F),h==null||h({value:F,image_url:null}),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{w(F)},f)},[h,w,f]),v=u.useCallback(N=>{C(N.value),$([]),T(!1),z(!1),h==null||h({value:N.value,image_url:N.image_url})},[h]),I=u.useCallback(()=>{setTimeout(()=>{T(!1)},150)},[]),k=u.useCallback(()=>{x.length>0&&T(!0)},[x.length]);return u.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),a.jsxs(Oo,{ref:D,className:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx($o,{variant:d,className:ke("label",r==null?void 0:r.label),children:n}),a.jsxs(So,{children:[a.jsx(yo,{...y,ref:l,type:"text",value:S,onChange:M,onBlur:I,onFocus:k,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),b&&a.jsx(Co,{children:a.jsx(Lt,{size:"xs"})})]}),a.jsx(vo,{$open:E&&V,className:ke("dropdown",r==null?void 0:r.dropdown),children:x.length>0?x.map(N=>a.jsxs(mo,{onClick:()=>v(N),className:ke("item",r==null?void 0:r.item),children:[N.image_url&&a.jsx(wo,{src:N.image_url,alt:N.value}),a.jsx(Ro,{children:N.value})]},N.id)):!b&&a.jsx(ko,{children:m})})]})},Dt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Mt={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}}},J=e=>{const r=Mt[e];return r||Mt.normal},re=e=>{const r=Dt[e];return r||Dt.default},jo=e=>e?"auto":"fit-content",No=s.button`
273
+ `,Po=A.newClassNameGetter("spinner"),kt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(Eo,{...n,ref:o,className:Po("container",r),role:"status","aria-label":e,$size:i}),ke=A.newClassNameGetter("autocomplete"),zo=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",value:u,onChange:b,onSearch:h,debounceMs:f=300,minChars:$=1,noResultsMessage:m="No results found",...S})=>{const[x,C]=p.useState((u==null?void 0:u.value)??""),[O,y]=p.useState([]),[g,L]=p.useState(!1),[z,N]=p.useState(!1),[V,P]=p.useState(!1),_=p.useRef(null),j=p.useRef(null);p.useEffect(()=>{(u==null?void 0:u.value)!==void 0&&C(u.value)},[u==null?void 0:u.value]);const w=p.useCallback(async T=>{if(T.length<$){y([]),P(!1);return}L(!0),P(!0);try{const F=await h(T);y(F),N(!0)}catch{y([])}finally{L(!1)}},[h,$]),M=p.useCallback(T=>{const F=T.target.value;C(F),b==null||b({value:F,image_url:null}),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{w(F)},f)},[b,w,f]),v=p.useCallback(T=>{C(T.value),y([]),N(!1),P(!1),b==null||b({value:T.value,image_url:T.image_url})},[b]),I=p.useCallback(()=>{setTimeout(()=>{N(!1)},150)},[]),k=p.useCallback(()=>{O.length>0&&N(!0)},[O.length]);return p.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),a.jsxs(Oo,{ref:_,className:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx($o,{variant:d,className:ke("label",r==null?void 0:r.label),children:n}),a.jsxs(So,{children:[a.jsx(yo,{...S,ref:l,type:"text",value:x,onChange:M,onBlur:I,onFocus:k,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),g&&a.jsx(Co,{children:a.jsx(kt,{size:"xs"})})]}),a.jsx(mo,{$open:z&&V,className:ke("dropdown",r==null?void 0:r.dropdown),children:O.length>0?O.map(T=>a.jsxs(vo,{onClick:()=>v(T),className:ke("item",r==null?void 0:r.item),children:[T.image_url&&a.jsx(wo,{src:T.image_url,alt:T.value}),a.jsx(Ro,{children:T.value})]},T.id)):!g&&a.jsx(ko,{children:m})})]})},Dt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},_t={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}}},J=e=>{const r=_t[e];return r||_t.normal},re=e=>{const r=Dt[e];return r||Dt.default},jo=e=>e?"auto":"fit-content",To=s.button`
274
274
  display: flex;
275
275
  gap: 6px;
276
276
  text-decoration: none;
@@ -302,7 +302,7 @@
302
302
  background-color: ${e=>J(e.$variant).background.disabled};
303
303
  border-color: ${e=>J(e.$variant).borderColor.disabled};
304
304
  }
305
- `,To=s.div`
305
+ `,No=s.div`
306
306
  display: grid;
307
307
  place-items: center;
308
308
  width: ${e=>re(e.$size).iconSize};
@@ -321,10 +321,10 @@
321
321
  width: ${e=>re(e.$size).iconSize};
322
322
  height: ${e=>re(e.$size).iconSize};
323
323
  animation: ${t.KEYFRAMES.rotate} 0.8s linear infinite;
324
- `,_o=s.div`
324
+ `,Do=s.div`
325
325
  display: flex;
326
326
  gap: 3px;
327
- `,Do=s.span`
327
+ `,_o=s.span`
328
328
  text-align: center;
329
329
  display: flex;
330
330
  justify-content: center;
@@ -337,12 +337,12 @@
337
337
  border-radius: 4px;
338
338
  width: fit-content;
339
339
  background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
340
- `,Mo=A.newClassNameGetter("key-symbol"),Cr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(Do,{...n,ref:r,className:Mo("container",e),$variant:i,children:o}):null,Ft=A.newClassNameGetter("key-bindings"),vr=({className:e,classnames:r,keys:o,ref:i,variant:n,...l})=>{const c=u.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(_o,{...l,ref:i,className:Ft("container",e),children:c.map(d=>a.jsx(Cr,{symbol:d,className:Ft("item",r==null?void 0:r.item),variant:n},d))})},Bt=A.newClassNameGetter("button"),De=({children:e,className:r,classnames:o,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:h=[],size:g="default",type:f="button",variant:O="normal",...m})=>{const y=u.useRef(null);u.useImperativeHandle(p,()=>y.current,[]),t.useKeyBinding(h,()=>{var C;(C=y.current)==null||C.click()});const S=u.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(No,{...m,onClick:d,ref:y,type:S,disabled:i,className:Bt("container",r),$variant:O,$size:g,$fullWidth:!!n,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(Ao,{$size:g}),l&&!c&&a.jsx(To,{$size:g,children:l}),e&&a.jsx(Io,{className:Bt("label",o==null?void 0:o.label),children:e}),a.jsx(vr,{keys:h,variant:O==="system"?"light":"dark"})]})},Fo=s.div`
340
+ `,Mo=A.newClassNameGetter("key-symbol"),yr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(_o,{...n,ref:r,className:Mo("container",e),$variant:i,children:o}):null,Mt=A.newClassNameGetter("key-bindings"),Cr=({className:e,classnames:r,keys:o,ref:i,variant:n,...l})=>{const c=p.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(Do,{...l,ref:i,className:Mt("container",e),children:c.map(d=>a.jsx(yr,{symbol:d,className:Mt("item",r==null?void 0:r.item),variant:n},d))})},Ft=A.newClassNameGetter("button"),De=({children:e,className:r,classnames:o,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:u=null,keyBindings:b=[],size:h="default",type:f="button",variant:$="normal",...m})=>{const S=p.useRef(null);p.useImperativeHandle(u,()=>S.current,[]),t.useKeyBinding(b,()=>{var C;(C=S.current)==null||C.click()});const x=p.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(To,{...m,onClick:d,ref:S,type:x,disabled:i,className:Ft("container",r),$variant:$,$size:h,$fullWidth:!!n,$iconOnly:!!l&&!(e||(b==null?void 0:b.length)>0),children:[c&&a.jsx(Ao,{$size:h}),l&&!c&&a.jsx(No,{$size:h,children:l}),e&&a.jsx(Io,{className:Ft("label",o==null?void 0:o.label),children:e}),a.jsx(Cr,{keys:b,variant:$==="system"?"light":"dark"})]})},Fo=s.div`
341
341
  background-color: ${t.COLORS.white};
342
342
  border-radius: 16px;
343
343
  border: ${e=>e.$border?`1px solid ${t.alpha(t.COLORS["iron-grey"],15)}`:"none"};
344
344
  box-shadow: ${e=>e.$shadow?`0 2px 8px ${t.alpha(t.COLORS.black,10)}`:"none"};
345
- `,Bo=A.newClassNameGetter("card"),Yo=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(Fo,{...l,ref:o,className:Bo("container",r),$border:i,$shadow:n,children:e}),Yt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.black,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},label:t.COLORS.black,icon:t.COLORS.white},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.red,focusShadow:t.alpha(t.COLORS.red,30)},label:t.COLORS.red,icon:t.COLORS.white}},ye=e=>Yt[e]??Yt.normal,Vo=s.label`
345
+ `,Bo=A.newClassNameGetter("card"),Yo=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(Fo,{...l,ref:o,className:Bo("container",r),$border:i,$shadow:n,children:e}),Bt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.black,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},label:t.COLORS.black,icon:t.COLORS.white},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.red,focusShadow:t.alpha(t.COLORS.red,30)},label:t.COLORS.red,icon:t.COLORS.white}},ye=e=>Bt[e]??Bt.normal,Vo=s.label`
346
346
  display: inline-flex;
347
347
  align-items: flex-start;
348
348
  gap: 8px;
@@ -400,7 +400,7 @@
400
400
  text-decoration: none;
401
401
  }
402
402
  }
403
- `,Le=A.newClassNameGetter("checkbox"),tt=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:p="normal",...h})=>a.jsxs(Vo,{className:Le("container",r),$disabled:!!i,$variant:p,children:[a.jsx(Ho,{...h,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Go,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(Wo,{className:Le("icon",o==null?void 0:o.icon),$visible:n||e,$variant:p,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Uo,{className:Le("label",o==null?void 0:o.label),$variant:p,children:l})]}),Vt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},ue=e=>Vt[e]??Vt.normal,Xo=s.label`
403
+ `,Le=A.newClassNameGetter("checkbox"),et=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:u="normal",...b})=>a.jsxs(Vo,{className:Le("container",r),$disabled:!!i,$variant:u,children:[a.jsx(Ho,{...b,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Go,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:u,children:a.jsx(Wo,{className:Le("icon",o==null?void 0:o.icon),$visible:n||e,$variant:u,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Uo,{className:Le("label",o==null?void 0:o.label),$variant:u,children:l})]}),Yt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},ue=e=>Yt[e]??Yt.normal,Xo=s.label`
404
404
  display: grid;
405
405
  grid-template-columns: auto 1fr;
406
406
  align-items: start;
@@ -457,7 +457,7 @@
457
457
  label[data-disabled='true'] & {
458
458
  color: ${e=>ue(e.$variant).description.disabled};
459
459
  }
460
- `,Ve=A.newClassNameGetter("checkbox-card"),Qo=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(Xo,{className:Ve("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(qo,{...g,ref:p,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(tt,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Ko,{className:Ve("content",o==null?void 0:o.content),children:[a.jsx(Zo,{className:Ve("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(Jo,{className:Ve("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),Ht={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ei=s.div`
460
+ `,Ye=A.newClassNameGetter("checkbox-card"),Qo=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:u,variant:b="normal",...h})=>a.jsxs(Xo,{className:Ye("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:b,"data-disabled":n,children:[a.jsx(qo,{...h,ref:u,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(et,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Ko,{className:Ye("content",o==null?void 0:o.content),children:[a.jsx(Zo,{className:Ye("label",o==null?void 0:o.label),$variant:b,children:c}),i&&a.jsx(Jo,{className:Ye("description",o==null?void 0:o.description),$variant:b,children:i})]})]}),Vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ei=s.div`
461
461
  display: flex;
462
462
  flex-direction: column;
463
463
  gap: 8px;
@@ -465,13 +465,13 @@
465
465
  font-size: 13px;
466
466
  font-weight: 500;
467
467
  line-height: 1.5;
468
- color: ${e=>e.$disabled?Ht.label.disabledColor:Ht.label.color};
468
+ color: ${e=>e.$disabled?Vt.label.disabledColor:Vt.label.color};
469
469
  margin-bottom: 4px;
470
470
  `,ri=s.div`
471
471
  display: flex;
472
472
  flex-direction: column;
473
473
  gap: 12px;
474
- `,at=A.newClassNameGetter("checkbox-group"),oi=({className:e,classnames:r,disabled:o,label:i,onChange:n,options:l,ref:c,value:d,...p})=>{const h=(g,f)=>{n(f?[...d,g]:d.filter(O=>O!==g))};return a.jsxs(ei,{...p,ref:c,className:at("container",e),children:[i&&a.jsx(ti,{className:at("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(ri,{className:at("options",r==null?void 0:r.options),children:l.map(g=>a.jsx(tt,{className:r==null?void 0:r.checkbox,checked:d.includes(g.value),label:g.label,disabled:o,onChange:f=>h(g.value,f.target.checked)},g.value))})]})},Gt={gray:{background:t.alpha(t.COLORS["iron-grey"],10),color:t.COLORS["iron-grey"],deleteHover:t.alpha(t.COLORS["iron-grey"],20)},red:{background:t.alpha(t.COLORS.red,10),color:t.COLORS.red,deleteHover:t.alpha(t.COLORS.red,20)},blue:{background:t.alpha(t.COLORS["steel-blue"],10),color:t.COLORS["steel-blue"],deleteHover:t.alpha(t.COLORS["steel-blue"],20)},black:{background:t.COLORS.black,color:t.COLORS.white,deleteHover:t.alpha(t.COLORS.white,20)}},mt=e=>Gt[e]??Gt.gray,ii=s.span`
474
+ `,nt=A.newClassNameGetter("checkbox-group"),oi=({className:e,classnames:r,disabled:o,label:i,onChange:n,options:l,ref:c,value:d,...u})=>{const b=(h,f)=>{n(f?[...d,h]:d.filter($=>$!==h))};return a.jsxs(ei,{...u,ref:c,className:nt("container",e),children:[i&&a.jsx(ti,{className:nt("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(ri,{className:nt("options",r==null?void 0:r.options),children:l.map(h=>a.jsx(et,{className:r==null?void 0:r.checkbox,checked:d.includes(h.value),label:h.label,disabled:o,onChange:f=>b(h.value,f.target.checked)},h.value))})]})},Ht={gray:{background:t.alpha(t.COLORS["iron-grey"],10),color:t.COLORS["iron-grey"],deleteHover:t.alpha(t.COLORS["iron-grey"],20)},red:{background:t.alpha(t.COLORS.red,10),color:t.COLORS.red,deleteHover:t.alpha(t.COLORS.red,20)},blue:{background:t.alpha(t.COLORS["steel-blue"],10),color:t.COLORS["steel-blue"],deleteHover:t.alpha(t.COLORS["steel-blue"],20)},black:{background:t.COLORS.black,color:t.COLORS.white,deleteHover:t.alpha(t.COLORS.white,20)}},mt=e=>Ht[e]??Ht.gray,ii=s.span`
475
475
  display: inline-flex;
476
476
  align-items: center;
477
477
  gap: 4px;
@@ -508,7 +508,7 @@
508
508
  `,ai=s.span`
509
509
  flex: 1 0 auto;
510
510
  text-align: center;
511
- `,lt=A.newClassNameGetter("chip"),Qe=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(ii,{...d,ref:l,className:lt("container",r),$variant:c,$deletable:!!i,children:[a.jsx(ai,{className:lt("label",o==null?void 0:o.label),children:e}),i&&a.jsx(ni,{type:"button",className:lt("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),li="Confirm",di="Cancel",ci=be.keyframes`
511
+ `,at=A.newClassNameGetter("chip"),Je=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(ii,{...d,ref:l,className:at("container",r),$variant:c,$deletable:!!i,children:[a.jsx(ai,{className:at("label",o==null?void 0:o.label),children:e}),i&&a.jsx(ni,{type:"button",className:at("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),li="Confirm",di="Cancel",ci=be.keyframes`
512
512
  from {
513
513
  opacity: 0;
514
514
  transform: translateX(-50%) translateY(100%);
@@ -530,7 +530,6 @@
530
530
  position: fixed;
531
531
  bottom: 24px;
532
532
  left: 50%;
533
- transform: translateX(-50%);
534
533
  display: flex;
535
534
  align-items: center;
536
535
  gap: 16px;
@@ -541,7 +540,7 @@
541
540
  box-shadow:
542
541
  0 4px 6px -1px rgba(0, 0, 0, 0.1),
543
542
  0 2px 4px -2px rgba(0, 0, 0, 0.1);
544
- animation: ${({$open:e})=>e?ci:si} 0.2s ease-out forwards;
543
+ animation: ${({$isExiting:e})=>e?si:ci} 0.2s ease-out forwards;
545
544
  z-index: 1000;
546
545
  `,ui=s.p`
547
546
  margin: 0;
@@ -552,38 +551,38 @@
552
551
  display: flex;
553
552
  align-items: center;
554
553
  gap: 8px;
555
- `,Pe=A.newClassNameGetter("confirmation"),bi=({cancelBindings:e,cancelLabel:r=di,className:o,classnames:i,confirmLabel:n=li,loading:l=!1,message:c,onCancel:d,onConfirm:p,open:h=!0,ref:g,submitBindings:f,...O})=>h?a.jsxs(pi,{...O,ref:g,className:Pe("container",o),$open:h,children:[a.jsx(ui,{className:Pe("message",i==null?void 0:i.message),children:c}),a.jsxs(hi,{className:Pe("actions",i==null?void 0:i.actions),children:[a.jsx(De,{variant:"system",size:"compact",onClick:d,keyBindings:e,className:Pe("cancel-button",i==null?void 0:i.cancelButton),children:r}),a.jsx(De,{variant:"danger",size:"compact",onClick:p,loading:l,keyBindings:f,className:Pe("confirm-button",i==null?void 0:i.confirmButton),children:n})]})]}):null,ze={sm:`${t.BREAKPOINTS.sm}px`,md:`${t.BREAKPOINTS.md}px`,lg:`${t.BREAKPOINTS.lg}px`,xl:`${t.BREAKPOINTS.xl}px`,"2xl":`${t.BREAKPOINTS["2xl"]}px`},gi=s.div`
554
+ `,bi=({confirmation:e,onDone:r})=>{const[o,i]=p.useState(!1),[n,l]=p.useState(!1),{message:c,onConfirm:d,onCancel:u,options:b}=e,h=b.confirmLabel||li,f=b.cancelLabel||di,$=p.useCallback(x=>{i(!0),setTimeout(()=>{x==null||x(),r()},200)},[r]),m=p.useCallback(async()=>{const x=d();if(x instanceof Promise){l(!0);try{await x}finally{l(!1)}}$()},[$,d]),S=p.useCallback(()=>{n||$(u)},[$,n,u]);return p.useEffect(()=>{const x=C=>{C.key==="Escape"&&!n&&S()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[S,n]),a.jsxs(pi,{$isExiting:o,children:[a.jsx(ui,{children:c}),a.jsxs(hi,{children:[a.jsx(De,{variant:"system",size:"compact",onClick:S,disabled:n,children:f}),a.jsx(De,{variant:"danger",size:"compact",onClick:m,loading:n,children:h})]})]})},mr=p.createContext(null),gi=()=>{},fi=({children:e})=>{const[r,o]=p.useState(null),i=p.useCallback((l,c,d,u)=>{o({open:!0,message:l,onConfirm:c,onCancel:d||gi,options:u||{}})},[]),n=p.useCallback(()=>{o(null)},[]);return a.jsxs(mr.Provider,{value:{show:i,hide:n},children:[e,r&&a.jsx(bi,{confirmation:r,onDone:n})]})},xi=()=>{const e=p.useContext(mr);if(!e)throw new Error("useConfirmation must be used within ConfirmationProvider");return e},Ee={sm:`${t.BREAKPOINTS.sm}px`,md:`${t.BREAKPOINTS.md}px`,lg:`${t.BREAKPOINTS.lg}px`,xl:`${t.BREAKPOINTS.xl}px`,"2xl":`${t.BREAKPOINTS["2xl"]}px`},Oi=s.div`
556
555
  width: 100%;
557
556
 
558
557
  ${t.mediaUp("sm")} {
559
- max-width: ${ze.sm};
558
+ max-width: ${Ee.sm};
560
559
  }
561
560
 
562
561
  ${t.mediaUp("md")} {
563
- max-width: ${ze.md};
562
+ max-width: ${Ee.md};
564
563
  }
565
564
 
566
565
  ${t.mediaUp("lg")} {
567
- max-width: ${ze.lg};
566
+ max-width: ${Ee.lg};
568
567
  }
569
568
 
570
569
  ${t.mediaUp("xl")} {
571
- max-width: ${ze.xl};
570
+ max-width: ${Ee.xl};
572
571
  }
573
572
 
574
573
  ${t.mediaUp("2xl")} {
575
- max-width: ${ze["2xl"]};
574
+ max-width: ${Ee["2xl"]};
576
575
  }
577
- `,fi=A.newClassNameGetter("container"),xi=({children:e,className:r,ref:o,...i})=>a.jsx(gi,{...i,ref:o,className:fi("container",r),children:e}),Je={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Ee={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},oe=36,rt=2,Oi=12,mr=(e,r,o="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),h=c%12||12,g=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),O=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),y=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),S=L=>L.toString().padStart(2,"0"),C=L=>L.toString().padStart(2," "),x=L=>`\0${L}\0`,$=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",O],["Mon","WEEKDAYSHORT",y],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",S(n+1)],["_2","DAYSPACE",C(l)],["02","DAYPAD",S(l)],["15","HOURTWENTYFOUR",S(c)],["03","HOURTWELVEPAD",S(h)],["04","MINUTE",S(d)],["05","SECOND",S(p)],["PM","AMPMUP",g?"PM":"AM"],["pm","AMPMLOW",g?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",h.toString()]];let b=r;for(const[L,E]of $)b=b.split(L).join(x(E));for(const[,L,E]of $)b=b.split(x(L)).join(E);return b},$i=(e,r)=>new Date(e,r+1,0).getDate(),Si=(e,r)=>new Date(e,r,1).getDay(),yi=(e,r,o=1)=>{const i=$i(e,r);let l=Si(e,r)-o;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=i;d++)c.push(d);for(;c.length<42;)c.push(null);return c},Ci=(e,r=1)=>{const o=[];for(let i=0;i<7;i++){const n=(r+i)%7,l=new Date(2024,0,7+n);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},vi=e=>{const r=[];for(let o=0;o<12;o++){const i=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return r},Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Ut=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),mi=(e,r)=>e.getFullYear()===r.getFullYear(),Xt=(e,r,o,i,n)=>{const l=new Date(e,r,o);if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l<c)return!0}if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l>c)return!0}return!1},qt=(e,r,o,i)=>{if(o){const n=o.getFullYear(),l=o.getMonth();if(e<n||e===n&&r<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&r>l)return!0}return!1},Kt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),wi=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Ri=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},ki=s.div`
576
+ `,$i=A.newClassNameGetter("container"),Si=({children:e,className:r,ref:o,...i})=>a.jsx(Oi,{...i,ref:o,className:$i("container",r),children:e}),Ze={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Pe={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},oe=36,tt=2,yi=12,vr=(e,r,o="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),u=e.getSeconds(),b=c%12||12,h=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),$=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),S=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),x=L=>L.toString().padStart(2,"0"),C=L=>L.toString().padStart(2," "),O=L=>`\0${L}\0`,y=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",$],["Mon","WEEKDAYSHORT",S],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",x(n+1)],["_2","DAYSPACE",C(l)],["02","DAYPAD",x(l)],["15","HOURTWENTYFOUR",x(c)],["03","HOURTWELVEPAD",x(b)],["04","MINUTE",x(d)],["05","SECOND",x(u)],["PM","AMPMUP",h?"PM":"AM"],["pm","AMPMLOW",h?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",b.toString()]];let g=r;for(const[L,z]of y)g=g.split(L).join(O(z));for(const[,L,z]of y)g=g.split(O(L)).join(z);return g},Ci=(e,r)=>new Date(e,r+1,0).getDate(),mi=(e,r)=>new Date(e,r,1).getDay(),vi=(e,r,o=1)=>{const i=Ci(e,r);let l=mi(e,r)-o;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=i;d++)c.push(d);for(;c.length<42;)c.push(null);return c},wi=(e,r=1)=>{const o=[];for(let i=0;i<7;i++){const n=(r+i)%7,l=new Date(2024,0,7+n);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},Ri=e=>{const r=[];for(let o=0;o<12;o++){const i=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return r},Gt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),ki=(e,r)=>e.getFullYear()===r.getFullYear(),Ut=(e,r,o,i,n)=>{const l=new Date(e,r,o);if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l<c)return!0}if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l>c)return!0}return!1},Xt=(e,r,o,i)=>{if(o){const n=o.getFullYear(),l=o.getMonth();if(e<n||e===n&&r<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&r>l)return!0}return!1},qt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),Li=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Ei=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},Pi=s.div`
578
577
  position: relative;
579
578
  display: inline-flex;
580
579
  flex-direction: column;
581
580
  gap: 2px;
582
581
  min-width: 180px;
583
582
  width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
584
- `,Li=s(ie)`
583
+ `,zi=s(ie)`
585
584
  margin-left: 6px;
586
- `,Pi=s.button`
585
+ `,ji=s.button`
587
586
  display: flex;
588
587
  align-items: center;
589
588
  justify-content: space-between;
@@ -594,23 +593,23 @@
594
593
  font-size: 14px;
595
594
  font-weight: 500;
596
595
  text-align: left;
597
- height: ${({$size:e})=>Je[e].height};
598
- padding: ${({$size:e})=>Je[e].padding};
599
- border-radius: ${({$size:e})=>Je[e].radius};
600
- color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?Ee[e].color[r?"disabled":"static"]:Ee[e].placeholder[r?"disabled":"static"]};
596
+ height: ${({$size:e})=>Ze[e].height};
597
+ padding: ${({$size:e})=>Ze[e].padding};
598
+ border-radius: ${({$size:e})=>Ze[e].radius};
599
+ color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?Pe[e].color[r?"disabled":"static"]:Pe[e].placeholder[r?"disabled":"static"]};
601
600
  border: 1px solid
602
- ${({$variant:e,$disabled:r})=>Ee[e].border[r?"disabled":"static"]};
603
- background-color: ${({$variant:e,$disabled:r})=>Ee[e].background[r?"disabled":"static"]};
601
+ ${({$variant:e,$disabled:r})=>Pe[e].border[r?"disabled":"static"]};
602
+ background-color: ${({$variant:e,$disabled:r})=>Pe[e].background[r?"disabled":"static"]};
604
603
 
605
604
  ${({$open:e,$variant:r})=>e&&`
606
- outline: 2px solid ${Ee[r].focus};
605
+ outline: 2px solid ${Pe[r].focus};
607
606
  `}
608
- `,zi=s.span`
607
+ `,Ti=s.span`
609
608
  flex: 1;
610
609
  overflow: hidden;
611
610
  text-overflow: ellipsis;
612
611
  white-space: nowrap;
613
- `,Ei=s.span`
612
+ `,Ni=s.span`
614
613
  display: flex;
615
614
  align-items: center;
616
615
  justify-content: center;
@@ -623,8 +622,8 @@
623
622
  border: 1px solid ${t.alpha(t.COLORS.black,15)};
624
623
  border-radius: 12px;
625
624
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
626
- padding: ${Oi}px;
627
- `,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",ji=s.div`
625
+ padding: ${yi}px;
626
+ `,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ii=s.div`
628
627
  position: absolute;
629
628
  ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
630
629
  left: 0;
@@ -636,7 +635,7 @@
636
635
  opacity 0.15s ease,
637
636
  transform 0.15s ease,
638
637
  visibility 0.15s;
639
- `,Ni=s.div`
638
+ `,Ai=s.div`
640
639
  position: fixed;
641
640
  ${wr}
642
641
  opacity: ${({$open:e})=>e?1:0};
@@ -646,12 +645,12 @@
646
645
  opacity 0.15s ease,
647
646
  transform 0.15s ease,
648
647
  visibility 0.15s;
649
- `,dt=s.div`
648
+ `,lt=s.div`
650
649
  display: flex;
651
650
  align-items: center;
652
651
  justify-content: space-between;
653
652
  margin-bottom: 8px;
654
- `,ct=s.button`
653
+ `,dt=s.button`
655
654
  display: flex;
656
655
  align-items: center;
657
656
  gap: 4px;
@@ -691,15 +690,15 @@
691
690
  background: transparent;
692
691
  }
693
692
  }
694
- `,st=s.div`
693
+ `,ct=s.div`
695
694
  display: flex;
696
695
  gap: 4px;
697
- `,Ti=s.div`
696
+ `,Di=s.div`
698
697
  display: grid;
699
698
  grid-template-columns: repeat(7, ${oe}px);
700
- gap: ${rt}px;
699
+ gap: ${tt}px;
701
700
  margin-bottom: 4px;
702
- `,Ii=s.div`
701
+ `,_i=s.div`
703
702
  display: flex;
704
703
  align-items: center;
705
704
  justify-content: center;
@@ -708,11 +707,11 @@
708
707
  font-weight: 500;
709
708
  color: ${t.alpha(t.COLORS.black,50)};
710
709
  text-transform: uppercase;
711
- `,Ai=s.div`
710
+ `,Mi=s.div`
712
711
  display: grid;
713
712
  grid-template-columns: repeat(7, ${oe}px);
714
- gap: ${rt}px;
715
- `,_i=s.button`
713
+ gap: ${tt}px;
714
+ `,Fi=s.button`
716
715
  display: flex;
717
716
  align-items: center;
718
717
  justify-content: center;
@@ -737,12 +736,12 @@
737
736
  &:disabled {
738
737
  cursor: not-allowed;
739
738
  }
740
- `,Di=s.div`
739
+ `,Bi=s.div`
741
740
  display: grid;
742
741
  grid-template-columns: repeat(3, 1fr);
743
742
  gap: 8px;
744
- width: ${7*oe+6*rt}px;
745
- `,Mi=s.button`
743
+ width: ${7*oe+6*tt}px;
744
+ `,Yi=s.button`
746
745
  display: flex;
747
746
  align-items: center;
748
747
  justify-content: center;
@@ -762,12 +761,12 @@
762
761
  &:hover:not(:disabled) {
763
762
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
764
763
  }
765
- `,Fi=s.div`
764
+ `,Vi=s.div`
766
765
  display: grid;
767
766
  grid-template-columns: repeat(3, 1fr);
768
767
  gap: 8px;
769
- width: ${7*oe+6*rt}px;
770
- `,Bi=s.button`
768
+ width: ${7*oe+6*tt}px;
769
+ `,Hi=s.button`
771
770
  display: flex;
772
771
  align-items: center;
773
772
  justify-content: center;
@@ -787,10 +786,10 @@
787
786
  &:hover:not(:disabled) {
788
787
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
789
788
  }
790
- `,Yi=s.div`
789
+ `,Gi=s.div`
791
790
  width: ${oe}px;
792
791
  height: ${oe}px;
793
- `,K=A.newClassNameGetter("date-picker"),He=4,Vi=300,Hi=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:h="default",variant:g="normal",disabled:f=!1,fullWidth:O=!1,label:m,portalRenderNode:y,open:S,onOpen:C,onClose:x,className:$,classnames:b,ref:L,...E})=>{const T=u.useMemo(()=>new Date,[]),[V,z]=u.useState(!1),[D,j]=u.useState({top:0,left:0}),[w,M]=u.useState("bottom"),[v,I]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,N]=u.useState(()=>e??T),[F,B]=u.useState(()=>((e==null?void 0:e.getFullYear())??T.getFullYear())-6),H=u.useRef(null),P=u.useRef(null),_=u.useRef(null),X=S!==void 0,q=X?S:V,fe=i??Ri(o),Me=u.useMemo(()=>Ci(l,c),[l,c]),ot=u.useMemo(()=>vi(l),[l]),Br=u.useMemo(()=>yi(k.getFullYear(),k.getMonth(),c),[k,c]),Fe=u.useMemo(()=>wi(F+6,12),[F]),zt=u.useMemo(()=>e?mr(e,fe,l):null,[e,fe,l]),Yr=n??fe.replace(/2006|06|January|Jan|01|02/g,"__"),ve=u.useCallback(()=>{var we;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((we=_.current)==null?void 0:we.offsetHeight)??Vi,me=window.innerHeight-R.bottom-He,Be=R.top-He,xe=me<Y&&Be>me?"top":"bottom";if(M(xe),y){const Ye=xe==="bottom"?R.bottom+He:R.top-Y-He;j({top:Ye,left:R.left})}},[y]),Et=u.useCallback(()=>{if(f)return;X||z(!0),C==null||C(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??T;N(R),B(R.getFullYear()-6)},[f,X,C,o,e,T]),Z=u.useCallback(()=>{X||z(!1),x==null||x()},[X,x]),Vr=u.useCallback(()=>{q?Z():Et()},[q,Z,Et]),Hr=u.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Gr=u.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else N(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Wr=u.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(N(new Date(R,k.getMonth(),1)),I("months")):(N(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Ur=u.useCallback(()=>{N(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Xr=u.useCallback(()=>{N(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),qr=u.useCallback(()=>{N(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Kr=u.useCallback(()=>{N(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Zr=u.useCallback(()=>{B(R=>R-12)},[]),Jr=u.useCallback(()=>{B(R=>R+12)},[]),jt=u.useCallback(()=>{v==="days"?I("months"):v==="months"&&I("years")},[v]);u.useLayoutEffect(()=>{q&&ve()},[q,ve]),u.useEffect(()=>{const R=xe=>{const we=xe.target,Ye=H.current&&!H.current.contains(we),io=_.current&&!_.current.contains(we);y?Ye&&io&&Z():Ye&&Z()},Y=xe=>{xe.key==="Escape"&&Z()},me=()=>{q&&y&&ve()},Be=()=>{q&&y&&ve()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),y&&(window.addEventListener("scroll",me,!0),window.addEventListener("resize",Be))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",me,!0),window.removeEventListener("resize",Be)}},[q,Z,y,ve]);const Qr=Je[h].iconSize,eo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:jt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ti,{children:Me.map((R,Y)=>a.jsx(Ii,{children:R},Y))}),a.jsx(Ai,{className:K("grid",b==null?void 0:b.grid),children:Br.map((R,Y)=>R===null?a.jsx(Yi,{},Y):a.jsx(_i,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Wt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Wt(T,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Xt(k.getFullYear(),k.getMonth(),R,d,p),disabled:Xt(k.getFullYear(),k.getMonth(),R,d,p),onClick:()=>Hr(R),children:R},Y))})]}),to=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:jt,type:"button",children:k.getFullYear()}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Kr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{className:K("grid",b==null?void 0:b.grid),children:ot.map((R,Y)=>a.jsx(Mi,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Ut(e,new Date(k.getFullYear(),Y,1)):!1,$current:Ut(T,new Date(k.getFullYear(),Y,1)),$disabled:qt(k.getFullYear(),Y,d,p),disabled:qt(k.getFullYear(),Y,d,p),onClick:()=>Gr(Y),children:R},Y))})]}),ro=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(ct,{type:"button",style:{cursor:"default"},children:[Fe[0]," - ",Fe[Fe.length-1]]}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Zr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Jr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Fi,{className:K("grid",b==null?void 0:b.grid),children:Fe.map(R=>a.jsx(Bi,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?mi(e,new Date(R,0,1)):!1,$current:T.getFullYear()===R,$disabled:Kt(R,d,p),disabled:Kt(R,d,p),onClick:()=>Wr(R),children:R},R))})]}),Nt=()=>{switch(v){case"days":return eo();case"months":return to();case"years":return ro()}},oo=y?ge.createPortal(a.jsx(Ni,{ref:_,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),style:{top:D.top,left:D.left},children:Nt()}),y):a.jsx(ji,{ref:_,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),children:Nt()});return a.jsxs(ki,{...E,ref:L??H,$fullWidth:O,className:K("container",$),children:[m&&a.jsx(Li,{children:m}),a.jsxs(Pi,{ref:P,type:"button",onClick:Vr,disabled:f,$size:h,$variant:g,$disabled:f,$open:q,$hasValue:!!zt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(zi,{children:zt??Yr}),a.jsx(Ei,{$open:q,children:a.jsx(a.ChevronDown,{size:Qr})})]}),oo]})},Gi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Wi=(e,r)=>{switch(e){case"left":return`
792
+ `,K=A.newClassNameGetter("date-picker"),Ve=4,Wi=300,Ui=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:u,size:b="default",variant:h="normal",disabled:f=!1,fullWidth:$=!1,label:m,portalRenderNode:S,open:x,onOpen:C,onClose:O,className:y,classnames:g,ref:L,...z})=>{const N=p.useMemo(()=>new Date,[]),[V,P]=p.useState(!1),[_,j]=p.useState({top:0,left:0}),[w,M]=p.useState("bottom"),[v,I]=p.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,T]=p.useState(()=>e??N),[F,B]=p.useState(()=>((e==null?void 0:e.getFullYear())??N.getFullYear())-6),H=p.useRef(null),E=p.useRef(null),D=p.useRef(null),X=x!==void 0,q=X?x:V,fe=i??Ei(o),_e=p.useMemo(()=>wi(l,c),[l,c]),rt=p.useMemo(()=>Ri(l),[l]),Br=p.useMemo(()=>vi(k.getFullYear(),k.getMonth(),c),[k,c]),Me=p.useMemo(()=>Li(F+6,12),[F]),Et=p.useMemo(()=>e?vr(e,fe,l):null,[e,fe,l]),Yr=n??fe.replace(/2006|06|January|Jan|01|02/g,"__"),me=p.useCallback(()=>{var we;if(!E.current)return;const R=E.current.getBoundingClientRect(),Y=((we=D.current)==null?void 0:we.offsetHeight)??Wi,ve=window.innerHeight-R.bottom-Ve,Fe=R.top-Ve,xe=ve<Y&&Fe>ve?"top":"bottom";if(M(xe),S){const Be=xe==="bottom"?R.bottom+Ve:R.top-Y-Ve;j({top:Be,left:R.left})}},[S]),Pt=p.useCallback(()=>{if(f)return;X||P(!0),C==null||C(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??N;T(R),B(R.getFullYear()-6)},[f,X,C,o,e,N]),Z=p.useCallback(()=>{X||P(!1),O==null||O()},[X,O]),Vr=p.useCallback(()=>{q?Z():Pt()},[q,Z,Pt]),Hr=p.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Gr=p.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else T(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Wr=p.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(T(new Date(R,k.getMonth(),1)),I("months")):(T(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Ur=p.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Xr=p.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),qr=p.useCallback(()=>{T(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Kr=p.useCallback(()=>{T(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Zr=p.useCallback(()=>{B(R=>R-12)},[]),Jr=p.useCallback(()=>{B(R=>R+12)},[]),zt=p.useCallback(()=>{v==="days"?I("months"):v==="months"&&I("years")},[v]);p.useLayoutEffect(()=>{q&&me()},[q,me]),p.useEffect(()=>{const R=xe=>{const we=xe.target,Be=H.current&&!H.current.contains(we),io=D.current&&!D.current.contains(we);S?Be&&io&&Z():Be&&Z()},Y=xe=>{xe.key==="Escape"&&Z()},ve=()=>{q&&S&&me()},Fe=()=>{q&&S&&me()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),S&&(window.addEventListener("scroll",ve,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",Fe)}},[q,Z,S,me]);const Qr=Ze[b].iconSize,eo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{children:_e.map((R,Y)=>a.jsx(_i,{children:R},Y))}),a.jsx(Mi,{className:K("grid",g==null?void 0:g.grid),children:Br.map((R,Y)=>R===null?a.jsx(Gi,{},Y):a.jsx(Fi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?Gt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Gt(N,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Ut(k.getFullYear(),k.getMonth(),R,d,u),disabled:Ut(k.getFullYear(),k.getMonth(),R,d,u),onClick:()=>Hr(R),children:R},Y))})]}),to=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:k.getFullYear()}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Kr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Bi,{className:K("grid",g==null?void 0:g.grid),children:rt.map((R,Y)=>a.jsx(Yi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?Wt(e,new Date(k.getFullYear(),Y,1)):!1,$current:Wt(N,new Date(k.getFullYear(),Y,1)),$disabled:Xt(k.getFullYear(),Y,d,u),disabled:Xt(k.getFullYear(),Y,d,u),onClick:()=>Gr(Y),children:R},Y))})]}),ro=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsxs(dt,{type:"button",style:{cursor:"default"},children:[Me[0]," - ",Me[Me.length-1]]}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Zr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Jr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Vi,{className:K("grid",g==null?void 0:g.grid),children:Me.map(R=>a.jsx(Hi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?ki(e,new Date(R,0,1)):!1,$current:N.getFullYear()===R,$disabled:qt(R,d,u),disabled:qt(R,d,u),onClick:()=>Wr(R),children:R},R))})]}),jt=()=>{switch(v){case"days":return eo();case"months":return to();case"years":return ro()}},oo=S?ge.createPortal(a.jsx(Ai,{ref:D,$open:q,$position:w,className:K("calendar",g==null?void 0:g.calendar),style:{top:_.top,left:_.left},children:jt()}),S):a.jsx(Ii,{ref:D,$open:q,$position:w,className:K("calendar",g==null?void 0:g.calendar),children:jt()});return a.jsxs(Pi,{...z,ref:L??H,$fullWidth:$,className:K("container",y),children:[m&&a.jsx(zi,{children:m}),a.jsxs(ji,{ref:E,type:"button",onClick:Vr,disabled:f,$size:b,$variant:h,$disabled:f,$open:q,$hasValue:!!Et,className:K("trigger",g==null?void 0:g.trigger),children:[a.jsx(Ti,{children:Et??Yr}),a.jsx(Ni,{$open:q,children:a.jsx(a.ChevronDown,{size:Qr})})]}),oo]})},Xi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},qi=(e,r)=>{switch(e){case"left":return`
794
793
  top: 0;
795
794
  left: 0;
796
795
  height: 100%;
@@ -810,17 +809,17 @@
810
809
  left: 0;
811
810
  width: 100%;
812
811
  height: ${r};
813
- `}},Ui=s.div`
812
+ `}},Ki=s.div`
814
813
  position: fixed;
815
814
  z-index: 1001;
816
815
  background-color: ${t.COLORS.white};
817
816
  box-shadow: 0 4px 24px ${t.alpha(t.COLORS.black,20)};
818
- ${e=>Wi(e.$position,e.$size)}
819
- animation: ${e=>Gi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
820
- `,Xi=A.newClassNameGetter("drawer"),qi=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?ge.createPortal(a.jsx(Ui,{...d,ref:l,className:Xi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Ki=s.div`
817
+ ${e=>qi(e.$position,e.$size)}
818
+ animation: ${e=>Xi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
819
+ `,Zi=A.newClassNameGetter("drawer"),Ji=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?ge.createPortal(a.jsx(Ki,{...d,ref:l,className:Zi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Qi=s.div`
821
820
  position: relative;
822
821
  display: inline-block;
823
- `,Zi=s.div`
822
+ `,en=s.div`
824
823
  cursor: pointer;
825
824
  `,kr=`
826
825
  z-index: 100;
@@ -830,7 +829,7 @@
830
829
  border: 1px solid ${t.COLORS.gray};
831
830
  border-radius: 8px;
832
831
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
833
- `,Lr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ji=s.div`
832
+ `,Lr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",tn=s.div`
834
833
  position: absolute;
835
834
  ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
836
835
  ${({$align:e})=>e==="left"?"left: 0;":"right: 0;"}
@@ -842,7 +841,7 @@
842
841
  opacity 0.15s ease,
843
842
  transform 0.15s ease,
844
843
  visibility 0.15s;
845
- `,Qi=s.div`
844
+ `,rn=s.div`
846
845
  position: fixed;
847
846
  ${kr}
848
847
  opacity: ${({$open:e})=>e?1:0};
@@ -852,17 +851,48 @@
852
851
  opacity 0.15s ease,
853
852
  transform 0.15s ease,
854
853
  visibility 0.15s;
855
- `,Ge=A.newClassNameGetter("dropdown"),We=4,en=100,tn=({align:e="left",children:r,className:o,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:p,trigger:h,...g})=>{const[f,O]=u.useState(!1),[m,y]=u.useState({top:0,left:0}),[S,C]=u.useState("bottom"),x=u.useRef(null),$=u.useRef(null),b=u.useRef(null),L=c!==void 0,E=L?c:f,T=u.useCallback(()=>{var N,F;if(!$.current)return;const j=$.current.getBoundingClientRect(),w=((N=b.current)==null?void 0:N.offsetHeight)??en,M=((F=b.current)==null?void 0:F.offsetWidth)??160,v=window.innerHeight-j.bottom-We,I=j.top-We,k=v<w&&I>v?"top":"bottom";if(C(k),d){let B;e==="left"?B=j.left:B=j.right-M;const H=k==="bottom"?j.bottom+We:j.top-w-We;y({top:H,left:B})}},[e,d]),V=u.useCallback(()=>{L?E?n==null||n():l==null||l():O(j=>{const w=!j;return w?l==null||l():n==null||n(),w})},[L,E,n,l]),z=u.useCallback(()=>{L||O(!1),n==null||n()},[L,n]);u.useLayoutEffect(()=>{E&&T()},[E,T]),u.useEffect(()=>{const j=I=>{const k=I.target,N=x.current&&!x.current.contains(k),F=b.current&&!b.current.contains(k);d?N&&F&&z():N&&z()},w=I=>{I.key==="Escape"&&z()},M=()=>{E&&d&&T()},v=()=>{E&&d&&T()};return E&&(document.addEventListener("mousedown",j),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",v))),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",v)}},[E,z,d,T]);const D=d?ge.createPortal(a.jsx(Qi,{ref:b,$open:E,$position:S,className:Ge("content",i==null?void 0:i.content),style:{top:m.top,left:m.left},children:r}),d):a.jsx(Ji,{ref:b,$align:e,$open:E,$position:S,className:Ge("content",i==null?void 0:i.content),children:r});return a.jsxs(Ki,{...g,ref:p??x,className:Ge("container",o),children:[a.jsx(Zi,{ref:$,onClick:V,className:Ge("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),D]})},rn={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},on=s.span`
854
+ `,He=A.newClassNameGetter("dropdown"),Ge=4,on=100,nn=({align:e="left",children:r,className:o,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:u,trigger:b,...h})=>{const[f,$]=p.useState(!1),[m,S]=p.useState({top:0,left:0}),[x,C]=p.useState("bottom"),O=p.useRef(null),y=p.useRef(null),g=p.useRef(null),L=c!==void 0,z=L?c:f,N=p.useCallback(()=>{var T,F;if(!y.current)return;const j=y.current.getBoundingClientRect(),w=((T=g.current)==null?void 0:T.offsetHeight)??on,M=((F=g.current)==null?void 0:F.offsetWidth)??160,v=window.innerHeight-j.bottom-Ge,I=j.top-Ge,k=v<w&&I>v?"top":"bottom";if(C(k),d){let B;e==="left"?B=j.left:B=j.right-M;const H=k==="bottom"?j.bottom+Ge:j.top-w-Ge;S({top:H,left:B})}},[e,d]),V=p.useCallback(()=>{L?z?n==null||n():l==null||l():$(j=>{const w=!j;return w?l==null||l():n==null||n(),w})},[L,z,n,l]),P=p.useCallback(()=>{L||$(!1),n==null||n()},[L,n]);p.useLayoutEffect(()=>{z&&N()},[z,N]),p.useEffect(()=>{const j=I=>{const k=I.target,T=O.current&&!O.current.contains(k),F=g.current&&!g.current.contains(k);d?T&&F&&P():T&&P()},w=I=>{I.key==="Escape"&&P()},M=()=>{z&&d&&N()},v=()=>{z&&d&&N()};return z&&(document.addEventListener("mousedown",j),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",v))),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",v)}},[z,P,d,N]);const _=d?ge.createPortal(a.jsx(rn,{ref:g,$open:z,$position:x,className:He("content",i==null?void 0:i.content),style:{top:m.top,left:m.left},children:r}),d):a.jsx(tn,{ref:g,$align:e,$open:z,$position:x,className:He("content",i==null?void 0:i.content),children:r});return a.jsxs(Qi,{...h,ref:u??O,className:He("container",o),children:[a.jsx(en,{ref:y,onClick:V,className:He("trigger",i==null?void 0:i.trigger),children:p.cloneElement(b)}),_]})},an=s.div`
855
+ display: inline-flex;
856
+ align-items: center;
857
+ gap: 8px;
858
+ `,ln=s.span`
859
+ font-size: 14px;
860
+ line-height: 1.4;
861
+ color: ${({$isEmpty:e})=>e?t.COLORS["iron-grey"]:t.COLORS.black};
862
+ opacity: ${({$isEmpty:e})=>e?.6:1};
863
+ outline: none;
864
+
865
+ &[contenteditable='true'] {
866
+ cursor: text;
867
+ }
868
+ `,dn=s.button`
869
+ display: inline-flex;
870
+ align-items: center;
871
+ justify-content: center;
872
+ width: 16px;
873
+ height: 16px;
874
+ padding: 0;
875
+ background: transparent;
876
+ border: none;
877
+ cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
878
+ color: ${({$disabled:e})=>e?t.COLORS.gray:t.COLORS["iron-grey"]};
879
+ opacity: ${({$disabled:e})=>e?.5:.7};
880
+ transition: opacity 0.2s ease-in-out;
881
+
882
+ &:hover {
883
+ opacity: ${({$disabled:e})=>e?.5:1};
884
+ }
885
+ `,cn=({value:e,onChange:r,disabled:o=!1,placeholder:i,className:n,classnames:l,"data-test-id":c})=>{const[d,u]=p.useState(!1),b=p.useRef(null),h=p.useRef(null),f=p.useCallback(()=>{var x;u(!1);const S=((x=h.current)==null?void 0:x.textContent)||"";S!==e&&r(S)},[r,e]);p.useEffect(()=>{if(d&&h.current){h.current.focus();const S=document.createRange(),x=window.getSelection();S.selectNodeContents(h.current),S.collapse(!1),x==null||x.removeAllRanges(),x==null||x.addRange(S)}},[d]),p.useEffect(()=>{if(!d)return;const S=x=>{b.current&&!b.current.contains(x.target)&&f()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[d,f]);const $=()=>{o||u(!0)},m=S=>{S.key==="Enter"&&S.metaKey?(S.preventDefault(),f()):S.key==="Escape"&&(h.current&&(h.current.textContent=e),u(!1))};return a.jsxs(an,{ref:b,className:n,"data-test-id":c,children:[a.jsx(ln,{ref:h,className:l==null?void 0:l.text,contentEditable:d,suppressContentEditableWarning:!0,onKeyDown:m,$isEmpty:!e,children:e||i}),a.jsx(dn,{type:"button",className:l==null?void 0:l.button,$disabled:o&&!d,onClick:d?f:$,disabled:o&&!d,"aria-label":d?"Save":"Edit",children:d?a.jsx(a.Check,{size:16}):a.jsx(a.Pencil,{size:14})})]})},sn={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},pn=s.span`
856
886
  display: block;
857
887
  font-size: 12px;
858
888
  font-weight: 500;
859
889
  line-height: 1.4;
860
- color: ${e=>rn[e.$variant]};
861
- `,nn=A.newClassNameGetter("field-message"),an=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(on,{...n,ref:o,className:nn("container",r),$variant:i,children:e}):null,ln=s.div`
890
+ color: ${e=>sn[e.$variant]};
891
+ `,un=A.newClassNameGetter("field-message"),hn=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(pn,{...n,ref:o,className:un("container",r),$variant:i,children:e}):null,bn=s.div`
862
892
  display: flex;
863
893
  flex-direction: column;
864
894
  gap: 12px;
865
- `,dn=s.div`
895
+ `,gn=s.div`
866
896
  width: ${({$size:e})=>e}px;
867
897
  height: ${({$size:e})=>e}px;
868
898
  border-radius: 8px;
@@ -878,10 +908,10 @@
878
908
  height: 100%;
879
909
  object-fit: cover;
880
910
  }
881
- `,cn=s.span`
911
+ `,fn=s.span`
882
912
  font-size: 12px;
883
913
  color: ${t.COLORS["iron-grey"]};
884
- `,sn=e=>`
914
+ `,xn=e=>`
885
915
  .${e} {
886
916
  padding: 7px 16px;
887
917
  font-size: 14px;
@@ -899,7 +929,7 @@
899
929
  .${e}:active {
900
930
  transform: translate(0, 1px);
901
931
  }
902
- `,pn=e=>`
932
+ `,On=e=>`
903
933
  .${e} {
904
934
  display: flex;
905
935
  flex: 1 1 auto;
@@ -923,7 +953,7 @@
923
953
  max-height: 70vh;
924
954
  }
925
955
  }
926
- `,un=e=>`
956
+ `,$n=e=>`
927
957
  .${e} {
928
958
  padding: 7px 16px;
929
959
  font-size: 14px;
@@ -941,7 +971,7 @@
941
971
  .${e}:active {
942
972
  transform: translate(0, 1px);
943
973
  }
944
- `,hn=e=>`
974
+ `,Sn=e=>`
945
975
  .${e} {
946
976
  display: flex;
947
977
  flex-direction: column;
@@ -959,7 +989,7 @@
959
989
  border-radius: 8px;
960
990
  }
961
991
  }
962
- `,bn=e=>`
992
+ `,yn=e=>`
963
993
  .${e} {
964
994
  display: flex;
965
995
  justify-content: flex-end;
@@ -978,7 +1008,7 @@
978
1008
  gap: 8px;
979
1009
  }
980
1010
  }
981
- `,gn=e=>`
1011
+ `,Cn=e=>`
982
1012
  .${e} {
983
1013
  display: flex;
984
1014
  justify-content: flex-start;
@@ -1000,7 +1030,7 @@
1000
1030
  font-size: 14px;
1001
1031
  }
1002
1032
  }
1003
- `,fn=e=>`
1033
+ `,mn=e=>`
1004
1034
  .${e} {
1005
1035
  display: block;
1006
1036
  z-index: 101;
@@ -1018,27 +1048,27 @@
1018
1048
  position: absolute;
1019
1049
  touch-action: none;
1020
1050
  }
1021
- `,xn=e=>`
1051
+ `,vn=e=>`
1022
1052
  .${e} {
1023
1053
  position: absolute;
1024
1054
  z-index: 2;
1025
1055
  background-color: rgba(0, 0, 0, 0.6);
1026
1056
  touch-action: none;
1027
1057
  }
1028
- `,On=e=>`
1058
+ `,wn=e=>`
1029
1059
  .${e} {
1030
1060
  position: absolute;
1031
1061
  z-index: 3;
1032
1062
  touch-action: none;
1033
1063
  }
1034
- `,$n=e=>`
1064
+ `,Rn=e=>`
1035
1065
  .${e} {
1036
1066
  backface-visibility: hidden;
1037
1067
  perspective: 1000px;
1038
1068
  max-inline-size: unset !important;
1039
1069
  max-block-size: unset !important;
1040
1070
  }
1041
- `,Sn=e=>`
1071
+ `,kn=e=>`
1042
1072
  .${e} {
1043
1073
  position: absolute;
1044
1074
  z-index: 100;
@@ -1049,7 +1079,7 @@
1049
1079
  overflow: hidden;
1050
1080
  border-radius: 50%;
1051
1081
  }
1052
- `,yn={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},Cn={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},Ue=(e,r)=>{const o=yn[r],{h:i,v:n}=Cn[r];return`
1082
+ `,Ln={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},En={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},We=(e,r)=>{const o=Ln[r],{h:i,v:n}=En[r];return`
1053
1083
  .${e} {
1054
1084
  display: block;
1055
1085
  z-index: 102;
@@ -1075,7 +1105,7 @@
1075
1105
  ${n}: -12px;
1076
1106
  }
1077
1107
  }
1078
- `},vn=e=>`
1108
+ `},Pn=e=>`
1079
1109
  .${e} {
1080
1110
  display: flex;
1081
1111
  align-items: center;
@@ -1101,7 +1131,7 @@
1101
1131
  padding-bottom: env(safe-area-inset-bottom, 8px);
1102
1132
  }
1103
1133
  }
1104
- `,mn=e=>`
1134
+ `,zn=e=>`
1105
1135
  .${e} {
1106
1136
  backface-visibility: hidden;
1107
1137
  user-select: none;
@@ -1114,25 +1144,25 @@
1114
1144
  position: absolute;
1115
1145
  z-index: 1;
1116
1146
  }
1117
- `,wn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${wn(e)}`,W=e=>e||[],U=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Rn=e=>{const r={applyButton:[G("applyButton"),...W(e.applyButton)],cancelButton:[G("cancelButton"),...W(e.cancelButton)],container:[G("container"),...W(e.container)],handlerMove:[G("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[G("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[G("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[G("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[G("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[G("sourceImage"),...W(e.sourceImage)],portalArea:[G("portalArea"),...W(e.portalArea)],previewImage:[G("previewImage"),...W(e.previewImage)],body:[G("body"),...W(e.body)],header:[G("header"),...W(e.header)],footer:[G("footer"),...W(e.footer)],portal:[G("portal"),...W(e.portal)],preview:[G("preview"),...W(e.preview)],root:[G("root"),...W(e.root)]},o=`
1118
- ${sn(r.applyButton[0])}
1119
- ${pn(r.body[0])}
1120
- ${un(r.cancelButton[0])}
1121
- ${hn(r.container[0])}
1122
- ${bn(r.footer[0])}
1123
- ${gn(r.header[0])}
1124
- ${fn(r.handlerMove[0])}
1125
- ${xn(r.portalArea[0])}
1126
- ${On(r.portal[0])}
1127
- ${$n(r.previewImage[0])}
1128
- ${Sn(r.preview[0])}
1129
- ${Ue(r.handlerResizeBottomLeft[0],"bl")}
1130
- ${Ue(r.handlerResizeBottomRight[0],"br")}
1131
- ${Ue(r.handlerResizeTopLeft[0],"tl")}
1132
- ${Ue(r.handlerResizeTopRight[0],"tr")}
1133
- ${vn(r.root[0])}
1134
- ${mn(r.sourceImage[0])}
1135
- `,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let kn=0;const Ln=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++kn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},wt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},Pn=(e={},r={})=>Ln({...wt,config:{...wt.config,...e},css:Rn(r)}),zn=(e,r)=>{var O;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let p,h,g=0,f=0;return c>d?(p=l*d,h=l,f=(n-p)/2):(p=n,h=n*(r.height/r.width),g=(l-h)/2),{width:p,height:h,left:f,top:g}},En=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},jn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=En(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.height-n)/2}:{left:0,top:0,size:n}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const Nn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},Tn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},In=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},An=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},_n=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Dn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.previewImage),o},Mn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.preview),o.appendChild(Dn(e)),o},Fn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portal),o.appendChild(Mn(e)),o.appendChild(Nn(e)),o.appendChild(An(e)),o.appendChild(_n(e)),o.appendChild(Tn(e)),o.appendChild(In(e)),o},Bn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Fn(e)),o},Yn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Vn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.body),o.appendChild(Yn(e)),o.appendChild(Bn(e)),o},Hn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Gn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Wn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Gn(e,o)),n.appendChild(Hn(e,r)),n},Un=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.header),o},Xn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.container),n.appendChild(Un(e)),n.appendChild(Vn(e)),n.appendChild(Wn(e,r,o)),n},qn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");U(n,(l=i.css)==null?void 0:l.root),n.appendChild(Xn(e,r,o)),document.body.appendChild(n)},Kn=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ae=new Map,Zn={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},pe=(e,r)=>{if(Ae.has(e))return Ae.get(e);if(!r)return null;const o=r[Zn[e]],i=document.querySelector(`.${o[0]}`);return Ae.set(e,i),i},Jn=()=>{Ae.clear()},Qn=()=>{Ae.clear()},ea=(e,r)=>{const o=pe("header",r.css);o&&(o.innerText=e)},ta=(e,r)=>{const o=pe("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=pe("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=pe("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=pe("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},ra=(e,r)=>{const o=pe("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=pe("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},pt=1,oa=e=>{var m,y;const r=e(),o=document.createElement("canvas"),i=r.frame.width||pt,n=r.frame.height||pt,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,p=r.portal.top*c,h=Math.max(r.portal.size*Math.min(l,c),pt),g=r.config.outputSize>0?r.config.outputSize:h;o.width=g,o.height=g;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((y=o.getContext("2d"))==null||y.drawImage(f,d,p,h,h,0,0,g,g));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((S,C)=>{try{o.toBlob(x=>{if(o.remove(),!x){C(new Error(`Failed to create blob for type: image/${r.config.type}`));return}S([O,x])},`image/${r.config.type}`,r.config.compression)}catch(x){o.remove(),C(x)}})},ia=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,p=i.top-i.Y+e.clientY;const h=c.framePadding,g=l.width-c.framePadding-n.size,f=c.framePadding,O=l.height-c.framePadding-n.size;d<h&&(d=h),d>g&&(d=g),p<f&&(p=f),p>O&&(p=O),o({portal:{...n,left:d,top:p}})},na=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),p=e.pageX-n.X,h=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let g=n.size+Math.max(p,h);return g<d.minPortalSize&&(g=d.minPortalSize),n.top+g>c.height-d.framePadding&&(g=c.height-n.top-d.framePadding),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding),o({portal:{...l,size:g}})}case te.RESIZE_TR:{let g=p+h>0?n.size+p:n.size-h,f=p+h>0?n.top-p:n.top+h;return g<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,g=d.minPortalSize),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(g=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:g}})}case te.RESIZE_TL:{const g=Math.min(p,h);let f=n.size-g,O=n.left+g,m=n.top+g;if(f<d.minPortalSize){const y=n.size-d.minPortalSize;f=d.minPortalSize,O=n.left+y,m=n.top+y}if(m<d.framePadding){const y=d.framePadding-m;m=d.framePadding,O=O+y,f=f-y}if(O<d.framePadding){const y=d.framePadding-O;O=d.framePadding,m=m+y,f=f-y}return o({portal:{...l,top:m,left:O,size:f}})}case te.RESIZE_BL:{let g=p+h>0?n.size+h:n.size-p,f=p+h>0?n.left-h:n.left+p;return g<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,g=d.minPortalSize),g+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,g=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,g=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:g}})}default:return}},Zt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},aa=(e,r)=>{var O,m,y;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),n=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(y=o.css)==null?void 0:y.root[0]}`);let c=null,d=null;const p=S=>{S.preventDefault();const{portal:C}=e(),x=Zt(S);if(S.target){const $=S.target.getAttribute("data-action"),b={X:x.pageX,Y:x.pageY,left:C.left,top:C.top,size:C.size};r({action:$,emitted:b})}},h=()=>{const{action:S}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,S&&r({action:null})},g=()=>{if(c=null,!d)return;const S=d;d=null;const{action:C}=e();if(C)switch(C){case te.MOVE:ia(S,e,r);break;default:na(S,e,r)}},f=S=>{const{action:C}=e();C&&(S.preventDefault(),d=Zt(S),c===null&&(c=requestAnimationFrame(g)))};return l&&(l.addEventListener("mouseup",h),l.addEventListener("touchend",h),l.addEventListener("touchcancel",h)),i&&(i.addEventListener("mousedown",p),i.addEventListener("touchstart",p,{passive:!1})),n&&(n.addEventListener("mousemove",f),n.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",h),l.removeEventListener("touchend",h),l.removeEventListener("touchcancel",h)),i&&(i.removeEventListener("mousedown",p),i.removeEventListener("touchstart",p)),n&&(n.removeEventListener("mousemove",f),n.removeEventListener("touchmove",f))}},Jt=1024*1024,la=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Jt).toFixed(2);return`File size (${(e.size/Jt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},da=(e,r,o,i,n,l,c)=>{const d=x=>{c?c(x):console.error(`HqCropper: ${x}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:h}=r(),g=la(p,h);if(g){d(g),e.target.value="";return}const f=new FileReader;let O=null;const m=()=>{var b;const x=r(),$=document.querySelector(`.${(b=x.css)==null?void 0:b.root[0]}`);$&&($.remove(),document.removeEventListener("keydown",y),O==null||O(),Qn(),l(),o(wt))},y=x=>{x.key==="Escape"&&r().sourceBase64&&S(x)},S=x=>{x.preventDefault(),m()},C=x=>{x.preventDefault();const $=r();oa(r).then(([b,L])=>{i(b,L,$),S(x)}).catch(b=>{d(b instanceof Error?b.message:"Failed to crop image")})};f.onload=x=>{const $=new Image;if(!x.target||typeof x.target.result!="string"){d("Can't load result image");return}$.src=x.target.result,$.onerror=()=>{d("Failed to load image")},$.onload=()=>{var E;qn(r,C,S),Jn(),n("fileName",ea),n("sourceBase64",ta),n("portal",ra);const b=zn(r,$),L=jn(r,b);o({frame:b,portal:L,fileName:p.name,sourceBase64:(E=x.target)==null?void 0:E.result,sourceHeight:$.height,sourceWidth:$.width}),O=aa(r,o),document.addEventListener("keydown",y)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},ca=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=Pn(r,o),p=Kn(h=>da(h,n,l,e,c,d,i));return{open:()=>p.click()}},ae={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Qt="vacano-image-cropper-styles",sa=`
1147
+ `,jn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${jn(e)}`,W=e=>e||[],U=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Tn=e=>{const r={applyButton:[G("applyButton"),...W(e.applyButton)],cancelButton:[G("cancelButton"),...W(e.cancelButton)],container:[G("container"),...W(e.container)],handlerMove:[G("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[G("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[G("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[G("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[G("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[G("sourceImage"),...W(e.sourceImage)],portalArea:[G("portalArea"),...W(e.portalArea)],previewImage:[G("previewImage"),...W(e.previewImage)],body:[G("body"),...W(e.body)],header:[G("header"),...W(e.header)],footer:[G("footer"),...W(e.footer)],portal:[G("portal"),...W(e.portal)],preview:[G("preview"),...W(e.preview)],root:[G("root"),...W(e.root)]},o=`
1148
+ ${xn(r.applyButton[0])}
1149
+ ${On(r.body[0])}
1150
+ ${$n(r.cancelButton[0])}
1151
+ ${Sn(r.container[0])}
1152
+ ${yn(r.footer[0])}
1153
+ ${Cn(r.header[0])}
1154
+ ${mn(r.handlerMove[0])}
1155
+ ${vn(r.portalArea[0])}
1156
+ ${wn(r.portal[0])}
1157
+ ${Rn(r.previewImage[0])}
1158
+ ${kn(r.preview[0])}
1159
+ ${We(r.handlerResizeBottomLeft[0],"bl")}
1160
+ ${We(r.handlerResizeBottomRight[0],"br")}
1161
+ ${We(r.handlerResizeTopLeft[0],"tl")}
1162
+ ${We(r.handlerResizeTopRight[0],"tr")}
1163
+ ${Pn(r.root[0])}
1164
+ ${zn(r.sourceImage[0])}
1165
+ `,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let Nn=0;const In=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++Nn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},vt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},An=(e={},r={})=>In({...vt,config:{...vt.config,...e},css:Tn(r)}),Dn=(e,r)=>{var $;const o=e(),i=document.querySelector(`.${($=o.css)==null?void 0:$.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let u,b,h=0,f=0;return c>d?(u=l*d,b=l,f=(n-u)/2):(u=n,b=n*(r.height/r.width),h=(l-b)/2),{width:u,height:b,left:f,top:h}},_n=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},Mn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=_n(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.height-n)/2}:{left:0,top:0,size:n}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const Fn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},Bn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},Yn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},Vn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Hn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Gn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.previewImage),o},Wn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.preview),o.appendChild(Gn(e)),o},Un=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portal),o.appendChild(Wn(e)),o.appendChild(Fn(e)),o.appendChild(Vn(e)),o.appendChild(Hn(e)),o.appendChild(Bn(e)),o.appendChild(Yn(e)),o},Xn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Un(e)),o},qn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Kn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.body),o.appendChild(qn(e)),o.appendChild(Xn(e)),o},Zn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Jn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Qn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Jn(e,o)),n.appendChild(Zn(e,r)),n},ea=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.header),o},ta=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.container),n.appendChild(ea(e)),n.appendChild(Kn(e)),n.appendChild(Qn(e,r,o)),n},ra=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");U(n,(l=i.css)==null?void 0:l.root),n.appendChild(ta(e,r,o)),document.body.appendChild(n)},oa=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ie=new Map,ia={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},pe=(e,r)=>{if(Ie.has(e))return Ie.get(e);if(!r)return null;const o=r[ia[e]],i=document.querySelector(`.${o[0]}`);return Ie.set(e,i),i},na=()=>{Ie.clear()},aa=()=>{Ie.clear()},la=(e,r)=>{const o=pe("header",r.css);o&&(o.innerText=e)},da=(e,r)=>{const o=pe("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=pe("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=pe("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=pe("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},ca=(e,r)=>{const o=pe("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=pe("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},st=1,sa=e=>{var m,S;const r=e(),o=document.createElement("canvas"),i=r.frame.width||st,n=r.frame.height||st,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,u=r.portal.top*c,b=Math.max(r.portal.size*Math.min(l,c),st),h=r.config.outputSize>0?r.config.outputSize:b;o.width=h,o.height=h;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((S=o.getContext("2d"))==null||S.drawImage(f,d,u,b,b,0,0,h,h));const $=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((x,C)=>{try{o.toBlob(O=>{if(o.remove(),!O){C(new Error(`Failed to create blob for type: image/${r.config.type}`));return}x([$,O])},`image/${r.config.type}`,r.config.compression)}catch(O){o.remove(),C(O)}})},pa=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,u=i.top-i.Y+e.clientY;const b=c.framePadding,h=l.width-c.framePadding-n.size,f=c.framePadding,$=l.height-c.framePadding-n.size;d<b&&(d=b),d>h&&(d=h),u<f&&(u=f),u>$&&(u=$),o({portal:{...n,left:d,top:u}})},ua=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),u=e.pageX-n.X,b=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let h=n.size+Math.max(u,b);return h<d.minPortalSize&&(h=d.minPortalSize),n.top+h>c.height-d.framePadding&&(h=c.height-n.top-d.framePadding),n.left+h>c.width-d.framePadding&&(h=c.width-n.left-d.framePadding),o({portal:{...l,size:h}})}case te.RESIZE_TR:{let h=u+b>0?n.size+u:n.size-b,f=u+b>0?n.top-u:n.top+b;return h<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,h=d.minPortalSize),n.left+h>c.width-d.framePadding&&(h=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(h=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:h}})}case te.RESIZE_TL:{const h=Math.min(u,b);let f=n.size-h,$=n.left+h,m=n.top+h;if(f<d.minPortalSize){const S=n.size-d.minPortalSize;f=d.minPortalSize,$=n.left+S,m=n.top+S}if(m<d.framePadding){const S=d.framePadding-m;m=d.framePadding,$=$+S,f=f-S}if($<d.framePadding){const S=d.framePadding-$;$=d.framePadding,m=m+S,f=f-S}return o({portal:{...l,top:m,left:$,size:f}})}case te.RESIZE_BL:{let h=u+b>0?n.size+b:n.size-u,f=u+b>0?n.left-b:n.left+u;return h<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,h=d.minPortalSize),h+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,h=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,h=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:h}})}default:return}},Kt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},ha=(e,r)=>{var $,m,S;const o=e(),i=document.querySelector(`.${($=o.css)==null?void 0:$.portal[0]}`),n=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(S=o.css)==null?void 0:S.root[0]}`);let c=null,d=null;const u=x=>{x.preventDefault();const{portal:C}=e(),O=Kt(x);if(x.target){const y=x.target.getAttribute("data-action"),g={X:O.pageX,Y:O.pageY,left:C.left,top:C.top,size:C.size};r({action:y,emitted:g})}},b=()=>{const{action:x}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,x&&r({action:null})},h=()=>{if(c=null,!d)return;const x=d;d=null;const{action:C}=e();if(C)switch(C){case te.MOVE:pa(x,e,r);break;default:ua(x,e,r)}},f=x=>{const{action:C}=e();C&&(x.preventDefault(),d=Kt(x),c===null&&(c=requestAnimationFrame(h)))};return l&&(l.addEventListener("mouseup",b),l.addEventListener("touchend",b),l.addEventListener("touchcancel",b)),i&&(i.addEventListener("mousedown",u),i.addEventListener("touchstart",u,{passive:!1})),n&&(n.addEventListener("mousemove",f),n.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",b),l.removeEventListener("touchend",b),l.removeEventListener("touchcancel",b)),i&&(i.removeEventListener("mousedown",u),i.removeEventListener("touchstart",u)),n&&(n.removeEventListener("mousemove",f),n.removeEventListener("touchmove",f))}},Zt=1024*1024,ba=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Zt).toFixed(2);return`File size (${(e.size/Zt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},ga=(e,r,o,i,n,l,c)=>{const d=O=>{c?c(O):console.error(`HqCropper: ${O}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const u=e.target.files[0],{config:b}=r(),h=ba(u,b);if(h){d(h),e.target.value="";return}const f=new FileReader;let $=null;const m=()=>{var g;const O=r(),y=document.querySelector(`.${(g=O.css)==null?void 0:g.root[0]}`);y&&(y.remove(),document.removeEventListener("keydown",S),$==null||$(),aa(),l(),o(vt))},S=O=>{O.key==="Escape"&&r().sourceBase64&&x(O)},x=O=>{O.preventDefault(),m()},C=O=>{O.preventDefault();const y=r();sa(r).then(([g,L])=>{i(g,L,y),x(O)}).catch(g=>{d(g instanceof Error?g.message:"Failed to crop image")})};f.onload=O=>{const y=new Image;if(!O.target||typeof O.target.result!="string"){d("Can't load result image");return}y.src=O.target.result,y.onerror=()=>{d("Failed to load image")},y.onload=()=>{var z;ra(r,C,x),na(),n("fileName",la),n("sourceBase64",da),n("portal",ca);const g=Dn(r,y),L=Mn(r,g);o({frame:g,portal:L,fileName:u.name,sourceBase64:(z=O.target)==null?void 0:z.result,sourceHeight:y.height,sourceWidth:y.width}),$=ha(r,o),document.addEventListener("keydown",S)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(u),e.target.value=""},fa=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=An(r,o),u=oa(b=>ga(b,n,l,e,c,d,i));return{open:()=>u.click()}},ae={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Jt="vacano-image-cropper-styles",xa=`
1136
1166
  .vacano-cropper-root {
1137
1167
  background-color: rgba(0, 0, 0, 0.5);
1138
1168
  backdrop-filter: blur(4px);
@@ -1180,22 +1210,22 @@
1180
1210
  .vacano-cropper-apply-button:hover {
1181
1211
  background-color: ${t.COLORS["iron-grey"]};
1182
1212
  }
1183
- `,pa=()=>{if(typeof document>"u"||document.getElementById(Qt))return;const e=document.createElement("style");e.id=Qt,e.textContent=sa,document.head.appendChild(e)},ua={root:["vacano-cropper-root"],container:["vacano-cropper-container"],header:["vacano-cropper-header"],body:["vacano-cropper-body"],footer:["vacano-cropper-footer"],cancelButton:["vacano-cropper-cancel-button"],applyButton:["vacano-cropper-apply-button"],portal:["vacano-cropper-portal"]},Pr=(e={})=>{const{allowedTypes:r=ae.allowedTypes,applyLabel:o=ae.applyLabel,cancelLabel:i=ae.cancelLabel,compression:n=ae.compression,maxFileSize:l=ae.maxFileSize,onCrop:c,onError:d,outputSize:p=ae.outputSize,portalSize:h=ae.portalSize,type:g=ae.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(pa(),f.current=ca((m,y,S)=>{y&&(c==null||c({base64:m,blob:y,state:S}))},{portalSize:h,outputSize:p,compression:n,type:g,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},ua,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,i,n,l,c,d,p,h,g])}},ut=A.newClassNameGetter("image-cropper"),ha=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:h,outputSize:g,portalSize:f,previewSize:O=120,ref:m,type:y,value:S,...C})=>{const[x,$]=u.useState(S??null),{open:b}=Pr({allowedTypes:e,applyLabel:r,cancelLabel:i,compression:c,maxFileSize:d,onCrop:L=>{$(L.base64),p==null||p(L)},onError:h,outputSize:g,portalSize:f,type:y});return a.jsxs(ln,{...C,ref:m,className:ut("container",n),children:[a.jsx(dn,{$size:O,className:ut("preview",l==null?void 0:l.preview),children:x?a.jsx("img",{src:x,alt:"Preview"}):a.jsx(cn,{children:"No image"})}),a.jsx(De,{variant:"system",onClick:b,className:ut("button",l==null?void 0:l.button),style:{width:O},children:o})]})},er={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},tr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},le=e=>tr[e]??tr.normal,ht=e=>er[e]??er.default,ba=s.div`
1213
+ `,Oa=()=>{if(typeof document>"u"||document.getElementById(Jt))return;const e=document.createElement("style");e.id=Jt,e.textContent=xa,document.head.appendChild(e)},$a={root:["vacano-cropper-root"],container:["vacano-cropper-container"],header:["vacano-cropper-header"],body:["vacano-cropper-body"],footer:["vacano-cropper-footer"],cancelButton:["vacano-cropper-cancel-button"],applyButton:["vacano-cropper-apply-button"],portal:["vacano-cropper-portal"]},Er=(e={})=>{const{allowedTypes:r=ae.allowedTypes,applyLabel:o=ae.applyLabel,cancelLabel:i=ae.cancelLabel,compression:n=ae.compression,maxFileSize:l=ae.maxFileSize,onCrop:c,onError:d,outputSize:u=ae.outputSize,portalSize:b=ae.portalSize,type:h=ae.type}=e,f=p.useRef(null);return{open:p.useCallback(()=>{f.current||(Oa(),f.current=fa((m,S,x)=>{S&&(c==null||c({base64:m,blob:S,state:x}))},{portalSize:b,outputSize:u,compression:n,type:h,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},$a,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,i,n,l,c,d,u,b,h])}},pt=A.newClassNameGetter("image-cropper"),Sa=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:u,onError:b,outputSize:h,portalSize:f,previewSize:$=120,ref:m,type:S,value:x,...C})=>{const[O,y]=p.useState(x??null),{open:g}=Er({allowedTypes:e,applyLabel:r,cancelLabel:i,compression:c,maxFileSize:d,onCrop:L=>{y(L.base64),u==null||u(L)},onError:b,outputSize:h,portalSize:f,type:S});return a.jsxs(bn,{...C,ref:m,className:pt("container",n),children:[a.jsx(gn,{$size:$,className:pt("preview",l==null?void 0:l.preview),children:O?a.jsx("img",{src:O,alt:"Preview"}):a.jsx(fn,{children:"No image"})}),a.jsx(De,{variant:"system",onClick:g,className:pt("button",l==null?void 0:l.button),style:{width:$},children:o})]})},Qt={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},er={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},le=e=>er[e]??er.normal,ut=e=>Qt[e]??Qt.default,ya=s.div`
1184
1214
  display: grid;
1185
1215
  flex-direction: column;
1186
1216
  gap: 2px;
1187
1217
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1188
- `,ga=s(ie)`
1218
+ `,Ca=s(ie)`
1189
1219
  margin-left: 6px;
1190
- `,fa=s.input`
1220
+ `,ma=s.input`
1191
1221
  flex: 1;
1192
1222
  min-width: 0;
1193
1223
  outline: none;
1194
1224
  font-size: 14px;
1195
1225
  font-weight: 500;
1196
- height: ${e=>ht(e.$size).height};
1197
- padding: ${e=>ht(e.$size).padding};
1198
- border-radius: ${e=>ht(e.$size).radius};
1226
+ height: ${e=>ut(e.$size).height};
1227
+ padding: ${e=>ut(e.$size).padding};
1228
+ border-radius: ${e=>ut(e.$size).radius};
1199
1229
 
1200
1230
  color: ${e=>le(e.$variant).color.static};
1201
1231
  border: 1px solid ${e=>le(e.$variant).border.static};
@@ -1215,7 +1245,7 @@
1215
1245
  color: ${e=>le(e.$variant).placeholder.disabled};
1216
1246
  }
1217
1247
  }
1218
- `,bt=A.newClassNameGetter("input"),zr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(ba,{className:bt("container",e),$fullWidth:!!i,children:[a.jsx(ga,{variant:d,className:bt("label",r==null?void 0:r.label),children:n}),a.jsx(fa,{...p,ref:l,disabled:o,$size:c,$variant:d,className:bt("input",r==null?void 0:r.input)})]}),xa=s.div`
1248
+ `,ht=A.newClassNameGetter("input"),Pr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...u})=>a.jsxs(ya,{className:ht("container",e),$fullWidth:!!i,children:[a.jsx(Ca,{variant:d,className:ht("label",r==null?void 0:r.label),children:n}),a.jsx(ma,{...u,ref:l,disabled:o,$size:c,$variant:d,className:ht("input",r==null?void 0:r.input)})]}),va=s.div`
1219
1249
  position: fixed;
1220
1250
  inset: 0;
1221
1251
  z-index: 1000;
@@ -1224,7 +1254,7 @@
1224
1254
  justify-content: center;
1225
1255
  background-color: ${t.alpha(t.COLORS.black,50)};
1226
1256
  animation: ${t.KEYFRAMES.fadeIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1227
- `,Oa=s.div`
1257
+ `,wa=s.div`
1228
1258
  position: relative;
1229
1259
  z-index: 1001;
1230
1260
  width: ${e=>e.$width};
@@ -1235,14 +1265,14 @@
1235
1265
  border-radius: 16px;
1236
1266
  box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
1237
1267
  animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1238
- `,rr=A.newClassNameGetter("modal"),Er=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?ge.createPortal(a.jsx(xa,{className:rr("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(Oa,{...d,ref:l,className:rr("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,jr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},$a=s.div`
1268
+ `,tr=A.newClassNameGetter("modal"),zr=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?ge.createPortal(a.jsx(va,{className:tr("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(wa,{...d,ref:l,className:tr("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,jr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ra=s.div`
1239
1269
  display: flex;
1240
1270
  flex-direction: column;
1241
1271
  gap: 4px;
1242
- `,Sa=s(ie)`
1272
+ `,ka=s(ie)`
1243
1273
  margin-left: 6px;
1244
1274
  color: ${e=>jr[e.$variant].label};
1245
- `,ya=s.button`
1275
+ `,La=s.button`
1246
1276
  display: flex;
1247
1277
  flex-wrap: wrap;
1248
1278
  align-items: center;
@@ -1260,31 +1290,31 @@
1260
1290
  &:hover:not(:disabled) {
1261
1291
  border-color: ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1262
1292
  }
1263
- `,Ca=s.span`
1293
+ `,Ea=s.span`
1264
1294
  color: ${t.COLORS["iron-grey"]};
1265
1295
  font-size: 14px;
1266
- `,va=s.div`
1296
+ `,Pa=s.div`
1267
1297
  display: flex;
1268
1298
  flex-direction: column;
1269
1299
  padding: 20px;
1270
1300
  gap: 16px;
1271
- `,ma=s.div`
1301
+ `,za=s.div`
1272
1302
  display: flex;
1273
1303
  align-items: center;
1274
1304
  justify-content: space-between;
1275
- `,wa=s.h3`
1305
+ `,ja=s.h3`
1276
1306
  margin: 0;
1277
1307
  font-size: 18px;
1278
1308
  font-weight: 600;
1279
1309
  color: ${t.COLORS.black};
1280
- `,Ra=s.div`
1310
+ `,Ta=s.div`
1281
1311
  display: flex;
1282
1312
  flex-direction: column;
1283
1313
  gap: 4px;
1284
1314
  min-height: 200px;
1285
1315
  max-height: 300px;
1286
1316
  overflow-y: auto;
1287
- `,ka=s.label`
1317
+ `,Na=s.label`
1288
1318
  display: flex;
1289
1319
  align-items: center;
1290
1320
  gap: 10px;
@@ -1297,10 +1327,10 @@
1297
1327
  &:hover {
1298
1328
  background-color: ${e=>e.$disabled?"transparent":t.COLORS.gray};
1299
1329
  }
1300
- `,La=s.span`
1330
+ `,Ia=s.span`
1301
1331
  font-size: 14px;
1302
1332
  color: ${t.COLORS.black};
1303
- `,Pa=s.div`
1333
+ `,Aa=s.div`
1304
1334
  display: flex;
1305
1335
  align-items: center;
1306
1336
  justify-content: center;
@@ -1308,31 +1338,31 @@
1308
1338
  color: ${t.COLORS["iron-grey"]};
1309
1339
  font-size: 14px;
1310
1340
  text-align: center;
1311
- `,Q=A.newClassNameGetter("multi-select"),za=({className:e,classnames:r,disabled:o=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:h="Select...",ref:g,searchPlaceholder:f="Search...",value:O,variant:m="normal",...y})=>{const[S,C]=u.useState(!1),[x,$]=u.useState(""),b=u.useMemo(()=>p.filter(w=>O.includes(w.value)),[p,O]),L=u.useMemo(()=>{if(!x.trim())return p;const w=x.toLowerCase().trim();return p.filter(M=>M.label.toLowerCase().includes(w))},[p,x]),E=l===1/0?b:b.slice(0,l),T=b.length-E.length,V=()=>{o||(C(!0),$(""))},z=()=>{C(!1),$("")},D=w=>{O.includes(w)?d(O.filter(M=>M!==w)):d([...O,w])},j=w=>{d(O.filter(M=>M!==w))};return a.jsxs($a,{...y,ref:g,className:Q("container",e),children:[n&&a.jsx(Sa,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(ya,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:V,className:Q("trigger",r==null?void 0:r.trigger),children:b.length===0?a.jsx(Ca,{className:Q("placeholder",r==null?void 0:r.placeholder),children:h}):a.jsxs(a.Fragment,{children:[E.map(w=>a.jsx(Qe,{deletable:!0,onDelete:()=>j(w.value),onClick:M=>M.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:w.label},w.value)),T>0&&a.jsxs(Qe,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",T]})]})}),a.jsx(Er,{open:S,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(va,{children:[a.jsxs(ma,{children:[a.jsx(wa,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:z})]}),a.jsx(zr,{type:"text",value:x,onChange:w=>$(w.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ra,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Pa,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(ka,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(tt,{checked:O.includes(w.value),disabled:w.disabled,onChange:()=>D(w.value)}),a.jsx(La,{children:w.label})]},w.value))})]})})]})},Ea=5e3,or={default:{background:"#374151",text:t.COLORS.white},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white},info:{background:t.COLORS["steel-blue"],text:t.COLORS.white}},Nr=u.createContext(null),ir=e=>or[e]??or.default,ja=s.div`
1341
+ `,Q=A.newClassNameGetter("multi-select"),Da=({className:e,classnames:r,disabled:o=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:u,placeholder:b="Select...",ref:h,searchPlaceholder:f="Search...",value:$,variant:m="normal",...S})=>{const[x,C]=p.useState(!1),[O,y]=p.useState(""),g=p.useMemo(()=>u.filter(w=>$.includes(w.value)),[u,$]),L=p.useMemo(()=>{if(!O.trim())return u;const w=O.toLowerCase().trim();return u.filter(M=>M.label.toLowerCase().includes(w))},[u,O]),z=l===1/0?g:g.slice(0,l),N=g.length-z.length,V=()=>{o||(C(!0),y(""))},P=()=>{C(!1),y("")},_=w=>{$.includes(w)?d($.filter(M=>M!==w)):d([...$,w])},j=w=>{d($.filter(M=>M!==w))};return a.jsxs(Ra,{...S,ref:h,className:Q("container",e),children:[n&&a.jsx(ka,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(La,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:V,className:Q("trigger",r==null?void 0:r.trigger),children:g.length===0?a.jsx(Ea,{className:Q("placeholder",r==null?void 0:r.placeholder),children:b}):a.jsxs(a.Fragment,{children:[z.map(w=>a.jsx(Je,{deletable:!0,onDelete:()=>j(w.value),onClick:M=>M.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:w.label},w.value)),N>0&&a.jsxs(Je,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",N]})]})}),a.jsx(zr,{open:x,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Pa,{children:[a.jsxs(za,{children:[a.jsx(ja,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:P})]}),a.jsx(Pr,{type:"text",value:O,onChange:w=>y(w.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ta,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Aa,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(Na,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(et,{checked:$.includes(w.value),disabled:w.disabled,onChange:()=>_(w.value)}),a.jsx(Ia,{children:w.label})]},w.value))})]})})]})},_a=5e3,rr={default:{background:"#374151",text:t.COLORS.white},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white},info:{background:t.COLORS["steel-blue"],text:t.COLORS.white}},Tr=p.createContext(null),or=e=>rr[e]??rr.default,Ma=s.div`
1312
1342
  position: fixed;
1313
1343
  top: 0;
1314
1344
  left: 0;
1315
1345
  right: 0;
1316
1346
  z-index: 9999;
1317
1347
  pointer-events: none;
1318
- `,Na=s.div`
1348
+ `,Fa=s.div`
1319
1349
  display: flex;
1320
1350
  align-items: center;
1321
1351
  justify-content: center;
1322
1352
  gap: 12px;
1323
1353
  min-height: 44px;
1324
1354
  padding: 12px 48px;
1325
- background-color: ${({$variant:e})=>ir(e).background};
1326
- color: ${({$variant:e})=>ir(e).text};
1355
+ background-color: ${({$variant:e})=>or(e).background};
1356
+ color: ${({$variant:e})=>or(e).text};
1327
1357
  animation: ${({$isExiting:e})=>e?t.KEYFRAMES.slideOutTopFade:t.KEYFRAMES.slideInTopFade}
1328
1358
  0.3s ease-out forwards;
1329
1359
  pointer-events: auto;
1330
- `,Ta=s.span`
1360
+ `,Ba=s.span`
1331
1361
  font-size: 14px;
1332
1362
  font-weight: 500;
1333
1363
  line-height: 1.4;
1334
1364
  text-align: center;
1335
- `,Ia=s.button`
1365
+ `,Ya=s.button`
1336
1366
  position: absolute;
1337
1367
  right: 16px;
1338
1368
  top: 50%;
@@ -1353,22 +1383,22 @@
1353
1383
  &:hover {
1354
1384
  opacity: 1;
1355
1385
  }
1356
- `,Aa=s.div`
1386
+ `,Va=s.div`
1357
1387
  position: relative;
1358
- `,_a=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[i,n]=u.useState(!1),l=()=>{n(!0)},c=()=>{i&&(r(),o())};return u.useEffect(()=>{const d=setTimeout(()=>{l()},e.duration);return()=>clearTimeout(d)},[e.duration,e.id]),a.jsx(Aa,{children:a.jsxs(Na,{$variant:e.variant,$isExiting:i,onAnimationEnd:c,children:[a.jsx(Ta,{children:e.message}),a.jsx(Ia,{onClick:l,children:a.jsx(a.X,{style:{width:18,height:18}})})]})})},Da=(e,r)=>{switch(r.type){case"ADD_NOTIFICATION":{const o=r.payload;return e.current?{...e,queue:[...e.queue,o]}:{...e,current:o}}case"REMOVE_CURRENT":return{...e,current:null};case"SHOW_NEXT":{const o=e.queue[0];return o?{current:o,queue:e.queue.slice(1)}:e}default:return e}},Ma={current:null,queue:[]},Fa=({children:e})=>{const[r,o]=u.useReducer(Da,Ma),i=u.useCallback((d,p="default",h=Ea)=>{const g=`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_NOTIFICATION",payload:{id:g,message:d,variant:p,duration:h}})},[]),n=u.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),l=u.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),c=u.useCallback(()=>{setTimeout(()=>{o({type:"SHOW_NEXT"})},100)},[]);return a.jsxs(Nr.Provider,{value:{show:i,hide:n},children:[e,a.jsx(ja,{children:r.current&&a.jsx(_a,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},Ba=()=>{const e=u.useContext(Nr);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},nr={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},ar={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Ie=e=>nr[e]??nr.default,$e=e=>ar[e]??ar.normal,Ya=s.div`
1388
+ `,Ha=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[i,n]=p.useState(!1),l=()=>{n(!0)},c=()=>{i&&(r(),o())};return p.useEffect(()=>{const d=setTimeout(()=>{l()},e.duration);return()=>clearTimeout(d)},[e.duration,e.id]),a.jsx(Va,{children:a.jsxs(Fa,{$variant:e.variant,$isExiting:i,onAnimationEnd:c,children:[a.jsx(Ba,{children:e.message}),a.jsx(Ya,{onClick:l,children:a.jsx(a.X,{style:{width:18,height:18}})})]})})},Ga=(e,r)=>{switch(r.type){case"ADD_NOTIFICATION":{const o=r.payload;return e.current?{...e,queue:[...e.queue,o]}:{...e,current:o}}case"REMOVE_CURRENT":return{...e,current:null};case"SHOW_NEXT":{const o=e.queue[0];return o?{current:o,queue:e.queue.slice(1)}:e}default:return e}},Wa={current:null,queue:[]},Ua=({children:e})=>{const[r,o]=p.useReducer(Ga,Wa),i=p.useCallback((d,u="default",b=_a)=>{const h=`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_NOTIFICATION",payload:{id:h,message:d,variant:u,duration:b}})},[]),n=p.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),l=p.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),c=p.useCallback(()=>{setTimeout(()=>{o({type:"SHOW_NEXT"})},100)},[]);return a.jsxs(Tr.Provider,{value:{show:i,hide:n},children:[e,a.jsx(Ma,{children:r.current&&a.jsx(Ha,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},Xa=()=>{const e=p.useContext(Tr);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},ir={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},nr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Ne=e=>ir[e]??ir.default,$e=e=>nr[e]??nr.normal,qa=s.div`
1359
1389
  display: inline-flex;
1360
1390
  flex-direction: column;
1361
1391
  gap: 2px;
1362
- `,Va=s(ie)`
1392
+ `,Ka=s(ie)`
1363
1393
  margin-left: 6px;
1364
- `,Ha=s.div`
1394
+ `,Za=s.div`
1365
1395
  display: flex;
1366
- gap: ${e=>Ie(e.$size).gap};
1367
- `,Ga=s.input`
1368
- width: ${e=>Ie(e.$size).width};
1369
- height: ${e=>Ie(e.$size).height};
1370
- border-radius: ${e=>Ie(e.$size).radius};
1371
- font-size: ${e=>Ie(e.$size).fontSize};
1396
+ gap: ${e=>Ne(e.$size).gap};
1397
+ `,Ja=s.input`
1398
+ width: ${e=>Ne(e.$size).width};
1399
+ height: ${e=>Ne(e.$size).height};
1400
+ border-radius: ${e=>Ne(e.$size).radius};
1401
+ font-size: ${e=>Ne(e.$size).fontSize};
1372
1402
  font-weight: 600;
1373
1403
  text-align: center;
1374
1404
  outline: none;
@@ -1389,56 +1419,56 @@
1389
1419
  &::selection {
1390
1420
  background-color: transparent;
1391
1421
  }
1392
- `,gt=A.newClassNameGetter("otp-code"),Wa=({autoFocus:e,className:r,classnames:o,disabled:i,label:n,length:l=6,onChange:c,ref:d,size:p="default",value:h="",variant:g="normal",...f})=>{const O=u.useRef([]);u.useEffect(()=>{e&&O.current[0]&&O.current[0].focus()},[e]);const m=u.useCallback(x=>{const $=O.current[x];$&&($.focus(),$.select())},[]),y=u.useCallback((x,$)=>{const L=$.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const E=h.padEnd(l," ").split(""),T=E.findIndex(j=>j===" "||j===""),V=T!==-1?T:x;E[V]=L;const z=E.join("").replace(/ /g,"");c==null||c(z);const D=V+1;D<l&&m(D)},[h,l,c,m]),S=u.useCallback((x,$)=>{if($.key==="Backspace"){$.preventDefault();const b=h.split("");b[x]?(b[x]="",c==null||c(b.join(""))):x>0&&(b[x-1]="",c==null||c(b.join("")),m(x-1))}else $.key==="ArrowLeft"&&x>0?($.preventDefault(),m(x-1)):$.key==="ArrowRight"&&x<l-1&&($.preventDefault(),m(x+1))},[h,l,c,m]),C=u.useCallback(x=>{x.preventDefault();const $=x.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if($){c==null||c($);const b=Math.min($.length,l-1);m(b)}},[l,c,m]);return a.jsxs(Ya,{ref:d,className:gt("container",r),...f,children:[n&&a.jsx(Va,{variant:g,className:gt("label",o==null?void 0:o.label),children:n}),a.jsx(Ha,{$size:p,children:Array.from({length:l}).map((x,$)=>a.jsx(Ga,{ref:b=>{O.current[$]=b},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:i,value:h[$]??"",onChange:b=>y($,b),onKeyDown:b=>S($,b),onPaste:C,onFocus:b=>b.target.select(),$size:p,$variant:g,className:gt("input",o==null?void 0:o.input)},$))})]})},lr={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},et=e=>lr[e]??lr.light,Ua=s.div`
1422
+ `,bt=A.newClassNameGetter("otp-code"),Qa=({autoFocus:e,className:r,classnames:o,disabled:i,label:n,length:l=6,onChange:c,ref:d,size:u="default",value:b="",variant:h="normal",...f})=>{const $=p.useRef([]);p.useEffect(()=>{e&&$.current[0]&&$.current[0].focus()},[e]);const m=p.useCallback(O=>{const y=$.current[O];y&&(y.focus(),y.select())},[]),S=p.useCallback((O,y)=>{const L=y.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const z=b.padEnd(l," ").split(""),N=z.findIndex(j=>j===" "||j===""),V=N!==-1?N:O;z[V]=L;const P=z.join("").replace(/ /g,"");c==null||c(P);const _=V+1;_<l&&m(_)},[b,l,c,m]),x=p.useCallback((O,y)=>{if(y.key==="Backspace"){y.preventDefault();const g=b.split("");g[O]?(g[O]="",c==null||c(g.join(""))):O>0&&(g[O-1]="",c==null||c(g.join("")),m(O-1))}else y.key==="ArrowLeft"&&O>0?(y.preventDefault(),m(O-1)):y.key==="ArrowRight"&&O<l-1&&(y.preventDefault(),m(O+1))},[b,l,c,m]),C=p.useCallback(O=>{O.preventDefault();const y=O.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(y){c==null||c(y);const g=Math.min(y.length,l-1);m(g)}},[l,c,m]);return a.jsxs(qa,{ref:d,className:bt("container",r),...f,children:[n&&a.jsx(Ka,{variant:h,className:bt("label",o==null?void 0:o.label),children:n}),a.jsx(Za,{$size:u,children:Array.from({length:l}).map((O,y)=>a.jsx(Ja,{ref:g=>{$.current[y]=g},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:i,value:b[y]??"",onChange:g=>S(y,g),onKeyDown:g=>x(y,g),onPaste:C,onFocus:g=>g.target.select(),$size:u,$variant:h,className:bt("input",o==null?void 0:o.input)},y))})]})},ar={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},Qe=e=>ar[e]??ar.light,el=s.div`
1393
1423
  display: flex;
1394
1424
  flex-direction: column;
1395
1425
  gap: 16px;
1396
1426
  padding: 12px;
1397
- border: 1px dashed ${({$variant:e})=>et(e).border};
1427
+ border: 1px dashed ${({$variant:e})=>Qe(e).border};
1398
1428
  border-radius: 16px;
1399
- background-color: ${({$variant:e})=>et(e).background};
1400
- `,Xa=s.div`
1429
+ background-color: ${({$variant:e})=>Qe(e).background};
1430
+ `,tl=s.div`
1401
1431
  display: flex;
1402
1432
  flex-direction: column;
1403
1433
  gap: 4px;
1404
- `,qa=s.div`
1434
+ `,rl=s.div`
1405
1435
  font-size: 18px;
1406
1436
  font-weight: 600;
1407
1437
  line-height: 1.4;
1408
- color: ${({$variant:e})=>et(e).title};
1409
- `,Ka=s.div`
1438
+ color: ${({$variant:e})=>Qe(e).title};
1439
+ `,ol=s.div`
1410
1440
  font-size: 14px;
1411
1441
  line-height: 1.5;
1412
- color: ${({$variant:e})=>et(e).description};
1413
- `,Za=s.div`
1442
+ color: ${({$variant:e})=>Qe(e).description};
1443
+ `,il=s.div`
1414
1444
  display: flex;
1415
1445
  flex-wrap: wrap;
1416
1446
  gap: 8px;
1417
- `,Xe=A.newClassNameGetter("panel"),Ja=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const p=l||i;return a.jsxs(Ua,{...d,ref:n,className:Xe("container",r),$variant:c,children:[p&&a.jsxs(Xa,{children:[l&&a.jsx(qa,{className:Xe("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(Ka,{className:Xe("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(Za,{className:Xe("content",o==null?void 0:o.content),children:e})]})},Rt={compact:{height:4,radius:2},default:{height:8,radius:4}},Qa=s.div`
1447
+ `,Ue=A.newClassNameGetter("panel"),nl=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const u=l||i;return a.jsxs(el,{...d,ref:n,className:Ue("container",r),$variant:c,children:[u&&a.jsxs(tl,{children:[l&&a.jsx(rl,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(ol,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(il,{className:Ue("content",o==null?void 0:o.content),children:e})]})},wt={compact:{height:4,radius:2},default:{height:8,radius:4}},al=s.div`
1418
1448
  width: 100%;
1419
- height: ${({$size:e})=>Rt[e].height}px;
1420
- border-radius: ${({$size:e})=>Rt[e].radius}px;
1449
+ height: ${({$size:e})=>wt[e].height}px;
1450
+ border-radius: ${({$size:e})=>wt[e].radius}px;
1421
1451
  background-color: ${t.COLORS.gray};
1422
1452
  overflow: hidden;
1423
- `,el=s.div`
1453
+ `,ll=s.div`
1424
1454
  height: 100%;
1425
1455
  width: ${({$value:e})=>Math.min(100,Math.max(0,e))}%;
1426
- border-radius: ${({$size:e})=>Rt[e].radius}px;
1456
+ border-radius: ${({$size:e})=>wt[e].radius}px;
1427
1457
  background-color: ${t.COLORS.black};
1428
1458
  transition: width 0.2s ease;
1429
- `,dr=A.newClassNameGetter("progress"),tl=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(Qa,{...l,ref:n,$size:r,className:dr("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(el,{$size:r,$value:e,className:dr("bar",i==null?void 0:i.bar)})}),cr={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},dot:t.COLORS.black,label:t.COLORS.black},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS.red,30)},dot:t.COLORS.red,label:t.COLORS.red}},Ce=e=>cr[e]??cr.normal,rl=s.label`
1459
+ `,lr=A.newClassNameGetter("progress"),dl=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(al,{...l,ref:n,$size:r,className:lr("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(ll,{$size:r,$value:e,className:lr("bar",i==null?void 0:i.bar)})}),dr={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},dot:t.COLORS.black,label:t.COLORS.black},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS.red,30)},dot:t.COLORS.red,label:t.COLORS.red}},Ce=e=>dr[e]??dr.normal,cl=s.label`
1430
1460
  display: inline-flex;
1431
1461
  align-items: flex-start;
1432
1462
  gap: 8px;
1433
1463
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1434
1464
  opacity: ${e=>e.$disabled?.5:1};
1435
- `,ol=s.input`
1465
+ `,sl=s.input`
1436
1466
  position: absolute;
1437
1467
  opacity: 0;
1438
1468
  width: 0;
1439
1469
  height: 0;
1440
1470
  pointer-events: none;
1441
- `,il=s.span`
1471
+ `,pl=s.span`
1442
1472
  display: inline-flex;
1443
1473
  align-items: center;
1444
1474
  justify-content: center;
@@ -1453,7 +1483,7 @@
1453
1483
  border-color 0.15s ease,
1454
1484
  background-color 0.15s ease,
1455
1485
  box-shadow 0.15s ease;
1456
- `,nl=s.span`
1486
+ `,ul=s.span`
1457
1487
  width: 8px;
1458
1488
  height: 8px;
1459
1489
  border-radius: 50%;
@@ -1463,7 +1493,7 @@
1463
1493
  transition:
1464
1494
  opacity 0.15s ease,
1465
1495
  transform 0.15s ease;
1466
- `,al=s.span`
1496
+ `,hl=s.span`
1467
1497
  font-size: 14px;
1468
1498
  font-weight: 500;
1469
1499
  line-height: 1.5;
@@ -1479,7 +1509,7 @@
1479
1509
  text-decoration: none;
1480
1510
  }
1481
1511
  }
1482
- `,je=A.newClassNameGetter("radio"),Pt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(rl,{className:je("container",r),$disabled:!!i,$variant:d,children:[a.jsx(ol,{...p,ref:c,type:"radio",className:je("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(il,{className:je("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(nl,{className:je("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(al,{className:je("label",o==null?void 0:o.label),$variant:d,children:n})]}),sr={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},he=e=>sr[e]??sr.normal,ll=s.label`
1512
+ `,ze=A.newClassNameGetter("radio"),Lt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...u})=>a.jsxs(cl,{className:ze("container",r),$disabled:!!i,$variant:d,children:[a.jsx(sl,{...u,ref:c,type:"radio",className:ze("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(pl,{className:ze("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(ul,{className:ze("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(hl,{className:ze("label",o==null?void 0:o.label),$variant:d,children:n})]}),cr={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},he=e=>cr[e]??cr.normal,bl=s.label`
1483
1513
  display: grid;
1484
1514
  grid-template-columns: auto 1fr;
1485
1515
  align-items: start;
@@ -1503,7 +1533,7 @@
1503
1533
  .vacano_radio_container {
1504
1534
  pointer-events: none;
1505
1535
  }
1506
- `,dl=s.input`
1536
+ `,gl=s.input`
1507
1537
  position: absolute;
1508
1538
  width: 1px;
1509
1539
  height: 1px;
@@ -1513,12 +1543,12 @@
1513
1543
  clip: rect(0, 0, 0, 0);
1514
1544
  white-space: nowrap;
1515
1545
  border: 0;
1516
- `,cl=s.div`
1546
+ `,fl=s.div`
1517
1547
  display: flex;
1518
1548
  flex-direction: column;
1519
1549
  gap: 2px;
1520
1550
  min-width: 0;
1521
- `,sl=s.span`
1551
+ `,xl=s.span`
1522
1552
  font-size: 14px;
1523
1553
  font-weight: 500;
1524
1554
  line-height: 1.4;
@@ -1527,7 +1557,7 @@
1527
1557
  label[data-disabled='true'] & {
1528
1558
  color: ${e=>he(e.$variant).label.disabled};
1529
1559
  }
1530
- `,pl=s.span`
1560
+ `,Ol=s.span`
1531
1561
  font-size: 12px;
1532
1562
  font-weight: 400;
1533
1563
  line-height: 1.4;
@@ -1536,21 +1566,21 @@
1536
1566
  label[data-disabled='true'] & {
1537
1567
  color: ${e=>he(e.$variant).description.disabled};
1538
1568
  }
1539
- `,qe=A.newClassNameGetter("radio-card"),ul=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(ll,{className:qe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(dl,{...g,ref:p,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(Pt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(cl,{className:qe("content",o==null?void 0:o.content),children:[a.jsx(sl,{className:qe("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(pl,{className:qe("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),pr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},hl=s.div`
1569
+ `,Xe=A.newClassNameGetter("radio-card"),$l=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:u,variant:b="normal",...h})=>a.jsxs(bl,{className:Xe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:b,"data-disabled":n,children:[a.jsx(gl,{...h,ref:u,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(Lt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(fl,{className:Xe("content",o==null?void 0:o.content),children:[a.jsx(xl,{className:Xe("label",o==null?void 0:o.label),$variant:b,children:c}),i&&a.jsx(Ol,{className:Xe("description",o==null?void 0:o.description),$variant:b,children:i})]})]}),sr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Sl=s.div`
1540
1570
  display: flex;
1541
1571
  flex-direction: column;
1542
1572
  gap: 8px;
1543
- `,bl=s.span`
1573
+ `,yl=s.span`
1544
1574
  font-size: 13px;
1545
1575
  font-weight: 500;
1546
1576
  line-height: 1.5;
1547
- color: ${e=>e.$disabled?pr.label.disabledColor:pr.label.color};
1577
+ color: ${e=>e.$disabled?sr.label.disabledColor:sr.label.color};
1548
1578
  margin-bottom: 4px;
1549
- `,gl=s.div`
1579
+ `,Cl=s.div`
1550
1580
  display: flex;
1551
1581
  flex-direction: column;
1552
1582
  gap: 12px;
1553
- `,ft=A.newClassNameGetter("radio-group"),fl=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:p,...h})=>a.jsxs(hl,{...h,ref:d,className:ft("container",e),children:[i&&a.jsx(bl,{className:ft("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(gl,{className:ft("options",r==null?void 0:r.options),children:c.map(g=>a.jsx(Pt,{className:r==null?void 0:r.radio,name:n,checked:p===g.value,label:g.label,disabled:o,onChange:()=>l(g.value)},g.value))})]}),Tr=u.createContext(null),xl=s.div`
1583
+ `,gt=A.newClassNameGetter("radio-group"),ml=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:u,...b})=>a.jsxs(Sl,{...b,ref:d,className:gt("container",e),children:[i&&a.jsx(yl,{className:gt("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(Cl,{className:gt("options",r==null?void 0:r.options),children:c.map(h=>a.jsx(Lt,{className:r==null?void 0:r.radio,name:n,checked:u===h.value,label:h.label,disabled:o,onChange:()=>l(h.value)},h.value))})]}),Nr=p.createContext(null),vl=s.div`
1554
1584
  position: fixed;
1555
1585
  bottom: 24px;
1556
1586
  right: 24px;
@@ -1565,19 +1595,19 @@
1565
1595
  animation: ${t.KEYFRAMES.fadeIn} 0.2s ease-out;
1566
1596
  pointer-events: none;
1567
1597
  color: ${t.COLORS.black};
1568
- `,Ol=s.span`
1598
+ `,wl=s.span`
1569
1599
  font-size: 14px;
1570
1600
  font-weight: 500;
1571
1601
  white-space: nowrap;
1572
- `,$l=({children:e,defaultMessage:r="Saving"})=>{const[o,i]=u.useState(!1),[n,l]=u.useState(r),c=u.useCallback(h=>{l(h??r),i(!0)},[r]),d=u.useCallback(()=>{i(!1)},[]),p=u.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(Tr.Provider,{value:p,children:[e,o&&a.jsxs(xl,{children:[a.jsx(Lt,{size:"sm"}),a.jsx(Ol,{children:n})]})]})},Sl=()=>{const e=u.useContext(Tr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},xt=40,Ne=4,ur={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},hr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:t.alpha(t.COLORS.black,40),focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:t.alpha(t.COLORS.red,40),focus:t.alpha(t.COLORS.red,30)}},Ot=e=>ur[e]??ur.default,se=e=>hr[e]??hr.normal,yl=s.div`
1602
+ `,Rl=({children:e,defaultMessage:r="Saving"})=>{const[o,i]=p.useState(!1),[n,l]=p.useState(r),c=p.useCallback(b=>{l(b??r),i(!0)},[r]),d=p.useCallback(()=>{i(!1)},[]),u=p.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(Nr.Provider,{value:u,children:[e,o&&a.jsxs(vl,{children:[a.jsx(kt,{size:"sm"}),a.jsx(wl,{children:n})]})]})},kl=()=>{const e=p.useContext(Nr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},ft=40,je=4,pr={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ur={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:t.alpha(t.COLORS.black,40),focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:t.alpha(t.COLORS.red,40),focus:t.alpha(t.COLORS.red,30)}},xt=e=>pr[e]??pr.default,se=e=>ur[e]??ur.normal,Ll=s.div`
1573
1603
  position: relative;
1574
1604
  display: grid;
1575
1605
  gap: 2px;
1576
1606
  min-width: 180px;
1577
1607
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1578
- `,Cl=s(ie)`
1608
+ `,El=s(ie)`
1579
1609
  margin-left: 6px;
1580
- `,vl=s.button`
1610
+ `,Pl=s.button`
1581
1611
  display: flex;
1582
1612
  align-items: center;
1583
1613
  justify-content: space-between;
@@ -1588,21 +1618,21 @@
1588
1618
  font-weight: 500;
1589
1619
  text-align: left;
1590
1620
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1591
- height: ${e=>Ot(e.$size).height};
1592
- padding: ${e=>Ot(e.$size).padding};
1593
- border-radius: ${e=>Ot(e.$size).radius};
1621
+ height: ${e=>xt(e.$size).height};
1622
+ padding: ${e=>xt(e.$size).padding};
1623
+ border-radius: ${e=>xt(e.$size).radius};
1594
1624
 
1595
1625
  color: ${e=>e.$hasValue?e.$disabled?se(e.$variant).color.disabled:se(e.$variant).color.static:se(e.$variant).placeholder};
1596
1626
  border: 1px solid
1597
1627
  ${e=>e.$disabled?se(e.$variant).border.disabled:se(e.$variant).border.static};
1598
1628
  background-color: ${e=>e.$disabled?se(e.$variant).background.disabled:se(e.$variant).background.static};
1599
- `,ml=s.span`
1629
+ `,zl=s.span`
1600
1630
  flex: 1;
1601
1631
  min-width: 0;
1602
1632
  overflow: hidden;
1603
1633
  text-overflow: ellipsis;
1604
1634
  white-space: nowrap;
1605
- `,wl=s.span`
1635
+ `,jl=s.span`
1606
1636
  display: flex;
1607
1637
  align-items: center;
1608
1638
  justify-content: center;
@@ -1616,15 +1646,15 @@
1616
1646
  border-radius: 16px;
1617
1647
  box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
1618
1648
  z-index: 1000;
1619
- `,Rl=s.div`
1649
+ `,Tl=s.div`
1620
1650
  position: absolute;
1621
1651
  left: -4px;
1622
1652
  width: calc(100% + 8px);
1623
1653
  ${Ir}
1624
- `,kl=s.div`
1654
+ `,Nl=s.div`
1625
1655
  position: fixed;
1626
1656
  ${Ir}
1627
- `,Ll=s.button`
1657
+ `,Il=s.button`
1628
1658
  display: flex;
1629
1659
  align-items: center;
1630
1660
  justify-content: space-between;
@@ -1645,13 +1675,13 @@
1645
1675
  &:hover:not(:disabled) {
1646
1676
  background: ${t.alpha(t.COLORS.black,8)};
1647
1677
  }
1648
- `,Pl=s.span`
1678
+ `,Al=s.span`
1649
1679
  display: flex;
1650
1680
  align-items: center;
1651
1681
  justify-content: center;
1652
1682
  flex-shrink: 0;
1653
1683
  color: ${t.COLORS.black};
1654
- `,Se=A.newClassNameGetter("select"),zl=({className:e,classnames:r,disabled:o=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:h,size:g="default",value:f,variant:O="normal",...m})=>{const[y,S]=u.useState(!1),[C,x]=u.useState({top:0,left:0,width:0}),$=u.useRef(null),b=u.useRef(null),L=u.useRef(null),E=c.find(v=>v.value===f),T=Math.max(0,c.findIndex(v=>v.value===f)),V=-(T*xt+Ne),z=()=>{if(!b.current||!p)return;const v=b.current.getBoundingClientRect(),I=T*xt+Ne;let k=v.top-I;const N=c.length*xt+Ne*2,F=8,B=window.innerHeight-N-8;k<F&&(k=F),k>B&&(k=B),x({top:k,left:v.left-Ne,width:v.width+Ne*2})},D=v=>{var I;l==null||l(v),S(!1),(I=b.current)==null||I.focus()},j=v=>{o||(v.key==="Enter"||v.key===" "?(v.preventDefault(),S(I=>!I)):v.key==="Escape"&&y?(v.preventDefault(),S(!1)):v.key==="ArrowDown"&&!y&&(v.preventDefault(),S(!0)))};u.useLayoutEffect(()=>{y&&p&&z()},[y,p,T,c.length]),u.useEffect(()=>{if(!y)return;const v=N=>{const F=N.target,B=$.current&&!$.current.contains(F),H=L.current&&!L.current.contains(F);p?B&&H&&S(!1):B&&S(!1)},I=()=>{p&&z()},k=()=>{p&&z()};return document.addEventListener("mousedown",v),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",v),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[y,p]);const w=()=>c.map(v=>a.jsxs(Ll,{type:"button",role:"option",$selected:v.value===f,$disabled:v.disabled??!1,disabled:v.disabled,"aria-selected":v.value===f,onClick:()=>D(v.value),className:Se("option",r==null?void 0:r.option),children:[a.jsx("span",{children:v.label}),v.value===f&&a.jsx(Pl,{children:a.jsx(a.Check,{size:16})})]},v.value)),M=p?ge.createPortal(a.jsx(kl,{ref:L,role:"listbox",style:{top:C.top,left:C.left,width:C.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()}),p):a.jsx(Rl,{ref:L,role:"listbox",style:{top:V},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(yl,{...m,ref:v=>{$.current=v,typeof h=="function"?h(v):h&&(h.current=v)},$fullWidth:i,className:Se("container",e),children:[n&&a.jsx(Cl,{className:Se("label",r==null?void 0:r.label),children:n}),a.jsxs(vl,{ref:b,type:"button",$size:g,$variant:O,$disabled:o,$hasValue:!!E,disabled:o,onClick:()=>!o&&S(v=>!v),onKeyDown:j,"aria-haspopup":"listbox","aria-expanded":y,className:Se("trigger",r==null?void 0:r.trigger),children:[a.jsx(ml,{children:(E==null?void 0:E.label)??d}),a.jsx(wl,{$open:y,children:a.jsx(a.ChevronDown,{size:16})})]}),y&&M]})},br={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},El=e=>br[e]??br.neutral,jl=s.div`
1684
+ `,Se=A.newClassNameGetter("select"),Dl=({className:e,classnames:r,disabled:o=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:u,ref:b,size:h="default",value:f,variant:$="normal",...m})=>{const[S,x]=p.useState(!1),[C,O]=p.useState({top:0,left:0,width:0}),y=p.useRef(null),g=p.useRef(null),L=p.useRef(null),z=c.find(v=>v.value===f),N=Math.max(0,c.findIndex(v=>v.value===f)),V=-(N*ft+je),P=()=>{if(!g.current||!u)return;const v=g.current.getBoundingClientRect(),I=N*ft+je;let k=v.top-I;const T=c.length*ft+je*2,F=8,B=window.innerHeight-T-8;k<F&&(k=F),k>B&&(k=B),O({top:k,left:v.left-je,width:v.width+je*2})},_=v=>{var I;l==null||l(v),x(!1),(I=g.current)==null||I.focus()},j=v=>{o||(v.key==="Enter"||v.key===" "?(v.preventDefault(),x(I=>!I)):v.key==="Escape"&&S?(v.preventDefault(),x(!1)):v.key==="ArrowDown"&&!S&&(v.preventDefault(),x(!0)))};p.useLayoutEffect(()=>{S&&u&&P()},[S,u,N,c.length]),p.useEffect(()=>{if(!S)return;const v=T=>{const F=T.target,B=y.current&&!y.current.contains(F),H=L.current&&!L.current.contains(F);u?B&&H&&x(!1):B&&x(!1)},I=()=>{u&&P()},k=()=>{u&&P()};return document.addEventListener("mousedown",v),u&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",v),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[S,u]);const w=()=>c.map(v=>a.jsxs(Il,{type:"button",role:"option",$selected:v.value===f,$disabled:v.disabled??!1,disabled:v.disabled,"aria-selected":v.value===f,onClick:()=>_(v.value),className:Se("option",r==null?void 0:r.option),children:[a.jsx("span",{children:v.label}),v.value===f&&a.jsx(Al,{children:a.jsx(a.Check,{size:16})})]},v.value)),M=u?ge.createPortal(a.jsx(Nl,{ref:L,role:"listbox",style:{top:C.top,left:C.left,width:C.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()}),u):a.jsx(Tl,{ref:L,role:"listbox",style:{top:V},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(Ll,{...m,ref:v=>{y.current=v,typeof b=="function"?b(v):b&&(b.current=v)},$fullWidth:i,className:Se("container",e),children:[n&&a.jsx(El,{className:Se("label",r==null?void 0:r.label),children:n}),a.jsxs(Pl,{ref:g,type:"button",$size:h,$variant:$,$disabled:o,$hasValue:!!z,disabled:o,onClick:()=>!o&&x(v=>!v),onKeyDown:j,"aria-haspopup":"listbox","aria-expanded":S,className:Se("trigger",r==null?void 0:r.trigger),children:[a.jsx(zl,{children:(z==null?void 0:z.label)??d}),a.jsx(jl,{$open:S,children:a.jsx(a.ChevronDown,{size:16})})]}),S&&M]})},hr={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},_l=e=>hr[e]??hr.neutral,Ml=s.div`
1655
1685
  display: flex;
1656
1686
  flex-direction: column;
1657
1687
  gap: 4px;
@@ -1660,16 +1690,16 @@
1660
1690
  border-radius: 16px;
1661
1691
  border: ${({$border:e})=>e?"1px solid #e5e7eb":"none"};
1662
1692
  box-shadow: ${({$shadow:e})=>e?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"none"};
1663
- `,Nl=s.div`
1693
+ `,Fl=s.div`
1664
1694
  display: flex;
1665
1695
  align-items: center;
1666
1696
  justify-content: space-between;
1667
1697
  gap: 8px;
1668
- `,Tl=s.p`
1698
+ `,Bl=s.p`
1669
1699
  margin: 0;
1670
1700
  font-size: 13px;
1671
1701
  color: ${t.COLORS["iron-grey"]};
1672
- `,Il=s.div`
1702
+ `,Yl=s.div`
1673
1703
  display: flex;
1674
1704
  align-items: center;
1675
1705
  justify-content: center;
@@ -1683,21 +1713,21 @@
1683
1713
  width: 18px;
1684
1714
  height: 18px;
1685
1715
  }
1686
- `,Al=s.h3`
1716
+ `,Vl=s.h3`
1687
1717
  margin: 0;
1688
1718
  font-size: 28px;
1689
1719
  font-weight: 600;
1690
1720
  line-height: 1.2;
1691
1721
  color: ${t.COLORS.black};
1692
- `,_l=s.p`
1722
+ `,Hl=s.p`
1693
1723
  margin: 0;
1694
1724
  font-size: 12px;
1695
- color: ${({$variant:e})=>El(e)};
1696
- `,Ke=A.newClassNameGetter("status-card"),Dl=({border:e=!1,className:r,classnames:o,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:h,...g})=>a.jsxs(jl,{...g,ref:l,className:Ke("container",r),$border:e,$shadow:c,children:[a.jsxs(Nl,{children:[a.jsx(Tl,{className:Ke("label",o==null?void 0:o.label),children:n}),i&&a.jsx(Il,{children:i})]}),a.jsx(Al,{className:Ke("value",o==null?void 0:o.value),children:h}),d&&a.jsx(_l,{className:Ke("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),Ml=s.div`
1725
+ color: ${({$variant:e})=>_l(e)};
1726
+ `,qe=A.newClassNameGetter("status-card"),Gl=({border:e=!1,className:r,classnames:o,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:u="neutral",value:b,...h})=>a.jsxs(Ml,{...h,ref:l,className:qe("container",r),$border:e,$shadow:c,children:[a.jsxs(Fl,{children:[a.jsx(Bl,{className:qe("label",o==null?void 0:o.label),children:n}),i&&a.jsx(Yl,{children:i})]}),a.jsx(Vl,{className:qe("value",o==null?void 0:o.value),children:b}),d&&a.jsx(Hl,{className:qe("trend",o==null?void 0:o.trend),$variant:u,children:d})]}),Wl=s.div`
1697
1727
  display: flex;
1698
1728
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1699
1729
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
1700
- `,Fl=s.div`
1730
+ `,Ul=s.div`
1701
1731
  display: flex;
1702
1732
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1703
1733
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
@@ -1706,7 +1736,7 @@
1706
1736
  &:last-child {
1707
1737
  flex: 0;
1708
1738
  }
1709
- `,Bl=s.button`
1739
+ `,Xl=s.button`
1710
1740
  display: flex;
1711
1741
  align-items: center;
1712
1742
  gap: 10px;
@@ -1715,7 +1745,7 @@
1715
1745
  background: transparent;
1716
1746
  cursor: ${e=>e.$clickable?"pointer":"default"};
1717
1747
  flex-shrink: 0;
1718
- `,Yl=s.div`
1748
+ `,ql=s.div`
1719
1749
  display: flex;
1720
1750
  align-items: center;
1721
1751
  justify-content: center;
@@ -1739,13 +1769,13 @@
1739
1769
  border: 2px solid ${t.COLORS.gray};
1740
1770
  color: ${t.COLORS["iron-grey"]};
1741
1771
  `}
1742
- `,Vl=s.span`
1772
+ `,Kl=s.span`
1743
1773
  font-size: 14px;
1744
1774
  font-weight: 500;
1745
1775
  white-space: nowrap;
1746
1776
  color: ${e=>e.$active||e.$completed?t.COLORS.black:t.COLORS["iron-grey"]};
1747
1777
  transition: color 0.2s ease;
1748
- `,Hl=s.div`
1778
+ `,Zl=s.div`
1749
1779
  background-color: ${e=>e.$completed?t.COLORS.black:t.COLORS.gray};
1750
1780
  transition: background-color 0.2s ease;
1751
1781
 
@@ -1759,22 +1789,22 @@
1759
1789
  min-width: 16px;
1760
1790
  margin: 0 12px;
1761
1791
  `}
1762
- `,Te=A.newClassNameGetter("stepper"),Gl=({className:e,classnames:r,onChange:o,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const p=u.useMemo(()=>l.findIndex(h=>h.value===c),[l,c]);return a.jsx(Ml,{...d,ref:n,$orientation:i,className:Te("container",e),children:l.map((h,g)=>{const f=h.value===c,O=g<p,m=g===l.length-1;return a.jsxs(Fl,{$orientation:i,children:[a.jsxs(Bl,{type:"button",$active:f,$completed:O,$clickable:!!o,onClick:()=>o==null?void 0:o(h.value),className:Te("step",r==null?void 0:r.step),children:[a.jsx(Yl,{$active:f,$completed:O,className:Te("circle",r==null?void 0:r.circle),children:g+1}),a.jsx(Vl,{$active:f,$completed:O,className:Te("label",r==null?void 0:r.label),children:h.label})]}),!m&&a.jsx(Hl,{$completed:O,$orientation:i,className:Te("line",r==null?void 0:r.line)})]},h.value)})})},kt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Wl=s.div`
1792
+ `,Te=A.newClassNameGetter("stepper"),Jl=({className:e,classnames:r,onChange:o,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const u=p.useMemo(()=>l.findIndex(b=>b.value===c),[l,c]);return a.jsx(Wl,{...d,ref:n,$orientation:i,className:Te("container",e),children:l.map((b,h)=>{const f=b.value===c,$=h<u,m=h===l.length-1;return a.jsxs(Ul,{$orientation:i,children:[a.jsxs(Xl,{type:"button",$active:f,$completed:$,$clickable:!!o,onClick:()=>o==null?void 0:o(b.value),className:Te("step",r==null?void 0:r.step),children:[a.jsx(ql,{$active:f,$completed:$,className:Te("circle",r==null?void 0:r.circle),children:h+1}),a.jsx(Kl,{$active:f,$completed:$,className:Te("label",r==null?void 0:r.label),children:b.label})]}),!m&&a.jsx(Zl,{$completed:$,$orientation:i,className:Te("line",r==null?void 0:r.line)})]},b.value)})})},Rt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ql=s.div`
1763
1793
  position: relative;
1764
1794
  display: flex;
1765
1795
  flex-direction: column;
1766
1796
  gap: 4px;
1767
- `,Ul=s(ie)`
1797
+ `,ed=s(ie)`
1768
1798
  margin-left: 6px;
1769
- color: ${e=>kt[e.$variant].label};
1770
- `,Xl=s.div`
1799
+ color: ${e=>Rt[e.$variant].label};
1800
+ `,td=s.div`
1771
1801
  display: flex;
1772
1802
  flex-wrap: wrap;
1773
1803
  align-items: center;
1774
1804
  gap: 6px;
1775
1805
  min-height: 44px;
1776
1806
  padding: 8px 12px;
1777
- border: 1px dashed ${e=>kt[e.$variant].border};
1807
+ border: 1px dashed ${e=>Rt[e.$variant].border};
1778
1808
  border-radius: 8px;
1779
1809
  background: ${t.COLORS.white};
1780
1810
  cursor: ${e=>e.$disabled?"not-allowed":"text"};
@@ -1782,14 +1812,14 @@
1782
1812
  transition: border-color 0.15s ease;
1783
1813
 
1784
1814
  &:hover {
1785
- border-color: ${e=>e.$disabled?kt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1815
+ border-color: ${e=>e.$disabled?Rt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1786
1816
  }
1787
1817
 
1788
1818
  ${e=>e.$focused&&`
1789
1819
  outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
1790
1820
  outline-offset: 2px;
1791
1821
  `}
1792
- `,ql=s.input`
1822
+ `,rd=s.input`
1793
1823
  flex: 1;
1794
1824
  min-width: 80px;
1795
1825
  border: none;
@@ -1814,11 +1844,11 @@
1814
1844
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
1815
1845
  max-height: 200px;
1816
1846
  overflow-y: auto;
1817
- `,_r=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Dr=`
1847
+ `,Dr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",_r=`
1818
1848
  opacity 0.15s ease,
1819
1849
  transform 0.15s ease,
1820
1850
  visibility 0.15s;
1821
- `,Kl=s.div`
1851
+ `,od=s.div`
1822
1852
  position: absolute;
1823
1853
  left: 0;
1824
1854
  right: 0;
@@ -1826,16 +1856,16 @@
1826
1856
  ${Ar}
1827
1857
  opacity: ${e=>e.$open?1:0};
1828
1858
  visibility: ${e=>e.$open?"visible":"hidden"};
1829
- transform: ${e=>_r(e.$open,e.$position)};
1830
- transition: ${Dr};
1831
- `,Zl=s.div`
1859
+ transform: ${e=>Dr(e.$open,e.$position)};
1860
+ transition: ${_r};
1861
+ `,id=s.div`
1832
1862
  position: fixed;
1833
1863
  ${Ar}
1834
1864
  opacity: ${e=>e.$open?1:0};
1835
1865
  visibility: ${e=>e.$open?"visible":"hidden"};
1836
- transform: ${e=>_r(e.$open,e.$position)};
1837
- transition: ${Dr};
1838
- `,gr=s.button`
1866
+ transform: ${e=>Dr(e.$open,e.$position)};
1867
+ transition: ${_r};
1868
+ `,br=s.button`
1839
1869
  display: flex;
1840
1870
  align-items: center;
1841
1871
  width: 100%;
@@ -1863,7 +1893,7 @@
1863
1893
  &:only-child {
1864
1894
  border-radius: 7px;
1865
1895
  }
1866
- `,fr=s.div`
1896
+ `,gr=s.div`
1867
1897
  display: flex;
1868
1898
  align-items: center;
1869
1899
  justify-content: center;
@@ -1871,11 +1901,11 @@
1871
1901
  color: ${t.COLORS["iron-grey"]};
1872
1902
  font-size: 14px;
1873
1903
  text-align: center;
1874
- `,ee=A.newClassNameGetter("tags"),Ze=4,Jl=({className:e,classnames:r,createKey:o="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:h="Add tag...",portalRenderNode:g,ref:f,value:O,variant:m="normal",...y})=>{const S=u.useRef(null),C=u.useRef(null),x=u.useRef(null),$=u.useRef(null),[b,L]=u.useState(""),[E,T]=u.useState(!1),[V,z]=u.useState("bottom"),[D,j]=u.useState({top:0,left:0,width:0}),w=u.useMemo(()=>{const P=p.filter(X=>!O.includes(X.value));if(!b.trim())return P;const _=b.toLowerCase().trim();return P.filter(X=>X.label.toLowerCase().includes(_))},[p,O,b]),M=E&&p.length>0,v=u.useCallback(()=>{var Me;if(!C.current)return;const P=C.current.getBoundingClientRect(),_=((Me=x.current)==null?void 0:Me.offsetHeight)??200,X=window.innerHeight-P.bottom-Ze,q=P.top-Ze,fe=X<_&&q>X?"top":"bottom";if(z(fe),g){const ot=fe==="bottom"?P.bottom+Ze:P.top-_-Ze;j({top:ot,left:P.left,width:P.width})}},[g]);u.useEffect(()=>{if(E)return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[E,v]);const I=u.useCallback(P=>{const _=P.trim();return!_||O.includes(_)?!1:(d([...O,_]),L(""),!0)},[O,d]),k=P=>{if(P.key===o&&b.trim())if(P.preventDefault(),l)I(b);else{const _=w.find(X=>X.label.toLowerCase()===b.toLowerCase().trim());_&&I(_.value)}else P.key==="Backspace"&&!b&&O.length>0&&d(O.slice(0,-1))},N=P=>{var _;I(P),(_=$.current)==null||_.focus()},F=P=>{d(O.filter(_=>_!==P))},B=()=>{var P;i||(P=$.current)==null||P.focus()},H=P=>{const _=p.find(X=>X.value===P);return(_==null?void 0:_.label)??P};return a.jsxs(Wl,{...y,ref:f,className:ee("container",e),children:[c&&a.jsx(Ul,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:S,style:{position:"relative"},children:[a.jsxs(Xl,{ref:C,$variant:m,$disabled:i,$focused:E,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(P=>a.jsx(Qe,{deletable:!i,onDelete:()=>F(P),className:ee("chip",r==null?void 0:r.chip),children:H(P)},P)),a.jsx(ql,{ref:$,type:"text",value:b,onChange:P=>L(P.target.value),onFocus:()=>T(!0),onBlur:()=>setTimeout(()=>T(!1),150),onKeyDown:k,placeholder:O.length===0?h:"",disabled:i,$disabled:i,className:ee("input",r==null?void 0:r.input)})]}),p.length>0&&(g?ge.createPortal(a.jsx(Zl,{ref:x,$open:M,$position:V,style:{top:D.top,left:D.left,width:D.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(fr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(gr,{type:"button",onMouseDown:_=>_.preventDefault(),onClick:()=>N(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}),g):a.jsx(Kl,{ref:x,$open:M,$position:V,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(fr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(gr,{type:"button",onMouseDown:_=>_.preventDefault(),onClick:()=>N(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}))]})]})},Ql=s.div`
1904
+ `,ee=A.newClassNameGetter("tags"),Ke=4,nd=({className:e,classnames:r,createKey:o="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:u=[],placeholder:b="Add tag...",portalRenderNode:h,ref:f,value:$,variant:m="normal",...S})=>{const x=p.useRef(null),C=p.useRef(null),O=p.useRef(null),y=p.useRef(null),[g,L]=p.useState(""),[z,N]=p.useState(!1),[V,P]=p.useState("bottom"),[_,j]=p.useState({top:0,left:0,width:0}),w=p.useMemo(()=>{const E=u.filter(X=>!$.includes(X.value));if(!g.trim())return E;const D=g.toLowerCase().trim();return E.filter(X=>X.label.toLowerCase().includes(D))},[u,$,g]),M=z&&u.length>0,v=p.useCallback(()=>{var _e;if(!C.current)return;const E=C.current.getBoundingClientRect(),D=((_e=O.current)==null?void 0:_e.offsetHeight)??200,X=window.innerHeight-E.bottom-Ke,q=E.top-Ke,fe=X<D&&q>X?"top":"bottom";if(P(fe),h){const rt=fe==="bottom"?E.bottom+Ke:E.top-D-Ke;j({top:rt,left:E.left,width:E.width})}},[h]);p.useEffect(()=>{if(z)return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[z,v]);const I=p.useCallback(E=>{const D=E.trim();return!D||$.includes(D)?!1:(d([...$,D]),L(""),!0)},[$,d]),k=E=>{if(E.key===o&&g.trim())if(E.preventDefault(),l)I(g);else{const D=w.find(X=>X.label.toLowerCase()===g.toLowerCase().trim());D&&I(D.value)}else E.key==="Backspace"&&!g&&$.length>0&&d($.slice(0,-1))},T=E=>{var D;I(E),(D=y.current)==null||D.focus()},F=E=>{d($.filter(D=>D!==E))},B=()=>{var E;i||(E=y.current)==null||E.focus()},H=E=>{const D=u.find(X=>X.value===E);return(D==null?void 0:D.label)??E};return a.jsxs(Ql,{...S,ref:f,className:ee("container",e),children:[c&&a.jsx(ed,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:x,style:{position:"relative"},children:[a.jsxs(td,{ref:C,$variant:m,$disabled:i,$focused:z,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[$.map(E=>a.jsx(Je,{deletable:!i,onDelete:()=>F(E),className:ee("chip",r==null?void 0:r.chip),children:H(E)},E)),a.jsx(rd,{ref:y,type:"text",value:g,onChange:E=>L(E.target.value),onFocus:()=>N(!0),onBlur:()=>setTimeout(()=>N(!1),150),onKeyDown:k,placeholder:$.length===0?b:"",disabled:i,$disabled:i,className:ee("input",r==null?void 0:r.input)})]}),u.length>0&&(h?ge.createPortal(a.jsx(id,{ref:O,$open:M,$position:V,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(E=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(E.value),className:ee("option",r==null?void 0:r.option),children:E.label},E.value))}),h):a.jsx(od,{ref:O,$open:M,$position:V,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(E=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(E.value),className:ee("option",r==null?void 0:r.option),children:E.label},E.value))}))]})]})},ad=s.div`
1875
1905
  display: flex;
1876
1906
  align-items: center;
1877
1907
  gap: 6px;
1878
- `,ed=s.button`
1908
+ `,ld=s.button`
1879
1909
  padding: 6px 16px;
1880
1910
  border: none;
1881
1911
  border-radius: 12px;
@@ -1893,14 +1923,14 @@
1893
1923
  &:hover:not(:disabled) {
1894
1924
  background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
1895
1925
  }
1896
- `,xr=A.newClassNameGetter("tabs"),td=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(Ql,{...c,ref:i,className:xr("container",e),role:"tablist",children:n.map(d=>a.jsx(ed,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:xr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),Or={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},de=e=>Or[e]??Or.normal,rd=s.div`
1926
+ `,fr=A.newClassNameGetter("tabs"),dd=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(ad,{...c,ref:i,className:fr("container",e),role:"tablist",children:n.map(d=>a.jsx(ld,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:fr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),xr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},de=e=>xr[e]??xr.normal,cd=s.div`
1897
1927
  display: grid;
1898
1928
  flex-direction: column;
1899
1929
  gap: 2px;
1900
1930
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1901
- `,od=s(ie)`
1931
+ `,sd=s(ie)`
1902
1932
  margin-left: 6px;
1903
- `,id=s.textarea`
1933
+ `,pd=s.textarea`
1904
1934
  flex: 1;
1905
1935
  min-width: 0;
1906
1936
  outline: none;
@@ -1930,7 +1960,7 @@
1930
1960
  color: ${e=>de(e.$variant).placeholder.disabled};
1931
1961
  }
1932
1962
  }
1933
- `,$t=A.newClassNameGetter("textarea"),nd=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,variant:c="normal",rows:d=4,...p})=>a.jsxs(rd,{className:$t("container",e),$fullWidth:!!i,children:[n&&a.jsx(od,{variant:c,className:$t("label",r==null?void 0:r.label),children:n}),a.jsx(id,{...p,ref:l,rows:d,disabled:o,$variant:c,className:$t("textarea",r==null?void 0:r.textarea)})]}),Mr=u.createContext(null),St=3,$r={default:{background:"#374151",text:t.COLORS.white,border:"#374151"},success:{background:t.COLORS.green,text:t.COLORS.white,border:t.COLORS.green},warning:{background:t.COLORS.yellow,text:t.COLORS.white,border:t.COLORS.yellow},danger:{background:t.COLORS.red,text:t.COLORS.white,border:t.COLORS.red}},ad=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<St?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,i=e.toasts.filter(l=>l.id!==o),n=e.queue[0];return n&&i.length<St?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=St?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},ld={toasts:[],queue:[]},yt=e=>$r[e]??$r.default,dd=s.div`
1963
+ `,Ot=A.newClassNameGetter("textarea"),ud=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,variant:c="normal",rows:d=4,...u})=>a.jsxs(cd,{className:Ot("container",e),$fullWidth:!!i,children:[n&&a.jsx(sd,{variant:c,className:Ot("label",r==null?void 0:r.label),children:n}),a.jsx(pd,{...u,ref:l,rows:d,disabled:o,$variant:c,className:Ot("textarea",r==null?void 0:r.textarea)})]}),Mr=p.createContext(null),$t=3,Or={default:{background:"#374151",text:t.COLORS.white,border:"#374151"},success:{background:t.COLORS.green,text:t.COLORS.white,border:t.COLORS.green},warning:{background:t.COLORS.yellow,text:t.COLORS.white,border:t.COLORS.yellow},danger:{background:t.COLORS.red,text:t.COLORS.white,border:t.COLORS.red}},hd=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<$t?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,i=e.toasts.filter(l=>l.id!==o),n=e.queue[0];return n&&i.length<$t?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=$t?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},bd={toasts:[],queue:[]},St=e=>Or[e]??Or.default,gd=s.div`
1934
1964
  position: fixed;
1935
1965
  bottom: 24px;
1936
1966
  left: 24px;
@@ -1941,30 +1971,30 @@
1941
1971
  pointer-events: none;
1942
1972
  width: auto;
1943
1973
  max-width: 90vw;
1944
- `,cd=s.div`
1974
+ `,fd=s.div`
1945
1975
  display: flex;
1946
1976
  align-items: center;
1947
1977
  justify-content: space-between;
1948
1978
  gap: 12px;
1949
1979
  min-height: 32px;
1950
1980
  padding: 8px 8px 8px 16px;
1951
- background-color: ${({$variant:e})=>yt(e).background};
1952
- color: ${({$variant:e})=>yt(e).text};
1953
- border: 1px solid ${({$variant:e})=>yt(e).border};
1981
+ background-color: ${({$variant:e})=>St(e).background};
1982
+ color: ${({$variant:e})=>St(e).text};
1983
+ border: 1px solid ${({$variant:e})=>St(e).border};
1954
1984
  border-radius: 96px;
1955
1985
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1956
1986
  animation: ${({$isExiting:e})=>e?t.KEYFRAMES.slideOutBottomFade:t.KEYFRAMES.slideInBottomFade}
1957
1987
  0.3s ease-out;
1958
1988
  pointer-events: auto;
1959
1989
  max-width: 500px;
1960
- `,sd=s.span`
1990
+ `,xd=s.span`
1961
1991
  font-size: 14px;
1962
1992
  font-weight: 500;
1963
1993
  line-height: 1.4;
1964
1994
  white-space: nowrap;
1965
1995
  overflow: hidden;
1966
1996
  text-overflow: ellipsis;
1967
- `,pd=s.button`
1997
+ `,Od=s.button`
1968
1998
  display: flex;
1969
1999
  align-items: center;
1970
2000
  justify-content: center;
@@ -1982,13 +2012,13 @@
1982
2012
  &:hover {
1983
2013
  opacity: 1;
1984
2014
  }
1985
- `,ud=s.div`
2015
+ `,$d=s.div`
1986
2016
  display: flex;
1987
2017
  align-items: center;
1988
2018
  justify-content: space-between;
1989
2019
  gap: 12px;
1990
2020
  width: 100%;
1991
- `,hd=s.div`
2021
+ `,Sd=s.div`
1992
2022
  display: flex;
1993
2023
  align-items: center;
1994
2024
  justify-content: center;
@@ -2003,7 +2033,7 @@
2003
2033
  font-weight: 500;
2004
2034
  white-space: nowrap;
2005
2035
  margin-left: auto;
2006
- `,Sr=({toast:e,onRemove:r})=>{const[o,i]=u.useState(!1),n=()=>{i(!0),setTimeout(()=>{r(e.id)},300)};return u.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(cd,{$variant:e.variant,$isExiting:o,children:[a.jsx(sd,{children:e.message}),a.jsx(pd,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},bd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(dd,{children:e.map((n,l)=>l===i&&r>0?a.jsxs(ud,{children:[a.jsx(Sr,{toast:n,onRemove:o}),a.jsxs(hd,{children:["+",r]})]},n.id):a.jsx(Sr,{toast:n,onRemove:o},n.id))})},gd=({children:e})=>{const[r,o]=u.useReducer(ad,ld),i=u.useCallback((l,c="default",d)=>{const p=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:p,message:l,variant:c,duration:d}})},[]),n=u.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Mr.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(bd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},fd=()=>{const e=u.useContext(Mr);if(!e)throw new Error("useToast must be used within ToastProvider");return e},yr={dark:{background:t.COLORS.black,text:t.COLORS.white},light:{background:t.COLORS.white,text:t.COLORS.black,border:t.COLORS.gray},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white}},_e=e=>yr[e]??yr.dark,xd=(e,r)=>{const o=_e(r).background;switch(e){case"top":return`
2036
+ `,$r=({toast:e,onRemove:r})=>{const[o,i]=p.useState(!1),n=()=>{i(!0),setTimeout(()=>{r(e.id)},300)};return p.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(fd,{$variant:e.variant,$isExiting:o,children:[a.jsx(xd,{children:e.message}),a.jsx(Od,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},yd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(gd,{children:e.map((n,l)=>l===i&&r>0?a.jsxs($d,{children:[a.jsx($r,{toast:n,onRemove:o}),a.jsxs(Sd,{children:["+",r]})]},n.id):a.jsx($r,{toast:n,onRemove:o},n.id))})},Cd=({children:e})=>{const[r,o]=p.useReducer(hd,bd),i=p.useCallback((l,c="default",d)=>{const u=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:u,message:l,variant:c,duration:d}})},[]),n=p.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Mr.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(yd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},md=()=>{const e=p.useContext(Mr);if(!e)throw new Error("useToast must be used within ToastProvider");return e},Sr={dark:{background:t.COLORS.black,text:t.COLORS.white},light:{background:t.COLORS.white,text:t.COLORS.black,border:t.COLORS.gray},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white}},Ae=e=>Sr[e]??Sr.dark,vd=(e,r)=>{const o=Ae(r).background;switch(e){case"top":return`
2007
2037
  bottom: -12px;
2008
2038
  left: 50%;
2009
2039
  margin-left: -6px;
@@ -2023,7 +2053,7 @@
2023
2053
  top: 50%;
2024
2054
  margin-top: -6px;
2025
2055
  border-right-color: ${o};
2026
- `;default:return""}},Od=(e,r)=>{if(r!=="light")return"";const o=_e(r).border;switch(e){case"top":return`
2056
+ `;default:return""}},wd=(e,r)=>{if(r!=="light")return"";const o=Ae(r).border;switch(e){case"top":return`
2027
2057
  &::after {
2028
2058
  bottom: -14px;
2029
2059
  left: 50%;
@@ -2054,8 +2084,8 @@
2054
2084
  `;default:return""}},Fr=e=>`
2055
2085
  z-index: 1000;
2056
2086
  padding: 6px 12px;
2057
- background-color: ${_e(e.$variant).background};
2058
- color: ${_e(e.$variant).text};
2087
+ background-color: ${Ae(e.$variant).background};
2088
+ color: ${Ae(e.$variant).text};
2059
2089
  font-size: 13px;
2060
2090
  line-height: 1.4;
2061
2091
  border-radius: 6px;
@@ -2069,7 +2099,7 @@
2069
2099
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
2070
2100
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
2071
2101
 
2072
- ${e.$variant==="light"?`border: 1px solid ${_e(e.$variant).border};`:""}
2102
+ ${e.$variant==="light"?`border: 1px solid ${Ae(e.$variant).border};`:""}
2073
2103
 
2074
2104
  &::before {
2075
2105
  content: '';
@@ -2077,7 +2107,7 @@
2077
2107
  width: 0;
2078
2108
  height: 0;
2079
2109
  border: 6px solid transparent;
2080
- ${xd(e.$placement,e.$variant)}
2110
+ ${vd(e.$placement,e.$variant)}
2081
2111
  }
2082
2112
 
2083
2113
  ${e.$variant==="light"?`
@@ -2090,11 +2120,11 @@
2090
2120
  }
2091
2121
  `:""}
2092
2122
 
2093
- ${Od(e.$placement,e.$variant)}
2094
- `,$d=s.div`
2123
+ ${wd(e.$placement,e.$variant)}
2124
+ `,Rd=s.div`
2095
2125
  position: relative;
2096
2126
  display: inline-block;
2097
- `,Sd=e=>{switch(e){case"top":return`
2127
+ `,kd=e=>{switch(e){case"top":return`
2098
2128
  bottom: calc(100% + 8px);
2099
2129
  left: 50%;
2100
2130
  transform: translateX(-50%);
@@ -2110,12 +2140,12 @@
2110
2140
  left: calc(100% + 8px);
2111
2141
  top: 50%;
2112
2142
  transform: translateY(-50%);
2113
- `;default:return""}},yd=s.div`
2143
+ `;default:return""}},Ld=s.div`
2114
2144
  position: absolute;
2115
2145
  ${e=>Fr(e)}
2116
- ${({$placement:e})=>Sd(e)}
2117
- `,Cd=s.div`
2146
+ ${({$placement:e})=>kd(e)}
2147
+ `,Ed=s.div`
2118
2148
  position: fixed;
2119
2149
  ${e=>Fr(e)}
2120
- `,Ct=A.newClassNameGetter("tooltip"),ce=8,vd=({children:e,className:r,classnames:o,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...h})=>{const[g,f]=u.useState(!1),[O,m]=u.useState(null),[y,S]=u.useState(l),[C,x]=u.useState({top:0,left:0}),$=u.useRef(null),b=u.useRef(null),L=u.useCallback(()=>{var N,F;if(!$.current)return;const z=$.current.getBoundingClientRect(),D=((N=b.current)==null?void 0:N.offsetWidth)??100,j=((F=b.current)==null?void 0:F.offsetHeight)??30,w=z.top-ce,M=window.innerHeight-z.bottom-ce,v=z.left-ce,I=window.innerWidth-z.right-ce;let k=l;if(l==="top"&&w<j&&M>w?k="bottom":l==="bottom"&&M<j&&w>M?k="top":l==="left"&&v<D&&I>v?k="right":l==="right"&&I<D&&v>I&&(k="left"),S(k),c){let B,H;switch(k){case"top":B=z.top-j-ce,H=z.left+z.width/2-D/2;break;case"bottom":B=z.bottom+ce,H=z.left+z.width/2-D/2;break;case"left":B=z.top+z.height/2-j/2,H=z.left-D-ce;break;case"right":B=z.top+z.height/2-j/2,H=z.right+ce;break;default:B=0,H=0}const P=8;H=Math.max(P,Math.min(H,window.innerWidth-D-P)),B=Math.max(P,Math.min(B,window.innerHeight-j-P)),x({top:B,left:H})}},[l,c]);u.useLayoutEffect(()=>{g&&L()},[g,L]);const E=()=>{const z=setTimeout(()=>{f(!0)},n);m(z)},T=()=>{O&&(clearTimeout(O),m(null)),f(!1)},V=c?ge.createPortal(a.jsx(Cd,{ref:b,className:Ct("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,style:{top:C.top,left:C.left},children:i}),c):a.jsx(yd,{ref:b,className:Ct("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,children:i});return a.jsxs($d,{...h,ref:z=>{$.current=z,typeof d=="function"?d(z):d&&(d.current=z)},className:Ct("wrapper",r),onMouseEnter:E,onMouseLeave:T,children:[e,V]})};exports.Autocomplete=Eo;exports.Button=De;exports.Card=Yo;exports.Checkbox=tt;exports.CheckboxCard=Qo;exports.CheckboxGroup=oi;exports.Chip=Qe;exports.Confirmation=bi;exports.Container=xi;exports.DatePicker=Hi;exports.Drawer=qi;exports.Dropdown=tn;exports.FieldLabel=ie;exports.FieldMessage=an;exports.GlobalStyle=lo;exports.ImageCropper=ha;exports.Input=zr;exports.KeySymbol=Cr;exports.KeysBindings=vr;exports.Modal=Er;exports.MultiSelect=za;exports.NotificationProvider=Fa;exports.OtpCode=Wa;exports.Panel=Ja;exports.Progress=tl;exports.Radio=Pt;exports.RadioCard=ul;exports.RadioGroup=fl;exports.SaveProgressProvider=$l;exports.Select=zl;exports.Spinner=Lt;exports.StatusCard=Dl;exports.Stepper=Gl;exports.Tabs=td;exports.Tags=Jl;exports.Textarea=nd;exports.ToastProvider=gd;exports.Tooltip=vd;exports.formatDateGo=mr;exports.useImageCropper=Pr;exports.useNotification=Ba;exports.useSaveProgress=Sl;exports.useToast=fd;
2150
+ `,yt=A.newClassNameGetter("tooltip"),ce=8,Pd=({children:e,className:r,classnames:o,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:u="dark",...b})=>{const[h,f]=p.useState(!1),[$,m]=p.useState(null),[S,x]=p.useState(l),[C,O]=p.useState({top:0,left:0}),y=p.useRef(null),g=p.useRef(null),L=p.useCallback(()=>{var T,F;if(!y.current)return;const P=y.current.getBoundingClientRect(),_=((T=g.current)==null?void 0:T.offsetWidth)??100,j=((F=g.current)==null?void 0:F.offsetHeight)??30,w=P.top-ce,M=window.innerHeight-P.bottom-ce,v=P.left-ce,I=window.innerWidth-P.right-ce;let k=l;if(l==="top"&&w<j&&M>w?k="bottom":l==="bottom"&&M<j&&w>M?k="top":l==="left"&&v<_&&I>v?k="right":l==="right"&&I<_&&v>I&&(k="left"),x(k),c){let B,H;switch(k){case"top":B=P.top-j-ce,H=P.left+P.width/2-_/2;break;case"bottom":B=P.bottom+ce,H=P.left+P.width/2-_/2;break;case"left":B=P.top+P.height/2-j/2,H=P.left-_-ce;break;case"right":B=P.top+P.height/2-j/2,H=P.right+ce;break;default:B=0,H=0}const E=8;H=Math.max(E,Math.min(H,window.innerWidth-_-E)),B=Math.max(E,Math.min(B,window.innerHeight-j-E)),O({top:B,left:H})}},[l,c]);p.useLayoutEffect(()=>{h&&L()},[h,L]);const z=()=>{const P=setTimeout(()=>{f(!0)},n);m(P)},N=()=>{$&&(clearTimeout($),m(null)),f(!1)},V=c?ge.createPortal(a.jsx(Ed,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:S,$variant:u,$visible:h,style:{top:C.top,left:C.left},children:i}),c):a.jsx(Ld,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:S,$variant:u,$visible:h,children:i});return a.jsxs(Rd,{...b,ref:P=>{y.current=P,typeof d=="function"?d(P):d&&(d.current=P)},className:yt("wrapper",r),onMouseEnter:z,onMouseLeave:N,children:[e,V]})};exports.Autocomplete=zo;exports.Button=De;exports.Card=Yo;exports.Checkbox=et;exports.CheckboxCard=Qo;exports.CheckboxGroup=oi;exports.Chip=Je;exports.ConfirmationProvider=fi;exports.Container=Si;exports.DatePicker=Ui;exports.Drawer=Ji;exports.Dropdown=nn;exports.EditableText=cn;exports.FieldLabel=ie;exports.FieldMessage=hn;exports.GlobalStyle=lo;exports.ImageCropper=Sa;exports.Input=Pr;exports.KeySymbol=yr;exports.KeysBindings=Cr;exports.Modal=zr;exports.MultiSelect=Da;exports.NotificationProvider=Ua;exports.OtpCode=Qa;exports.Panel=nl;exports.Progress=dl;exports.Radio=Lt;exports.RadioCard=$l;exports.RadioGroup=ml;exports.SaveProgressProvider=Rl;exports.Select=Dl;exports.Spinner=kt;exports.StatusCard=Gl;exports.Stepper=Jl;exports.Tabs=dd;exports.Tags=nd;exports.Textarea=ud;exports.ToastProvider=Cd;exports.Tooltip=Pd;exports.formatDateGo=vr;exports.useConfirmation=xi;exports.useImageCropper=Er;exports.useNotification=Xa;exports.useSaveProgress=kl;exports.useToast=md;
2121
2151
  //# sourceMappingURL=index.cjs.map