@vacano/ui 1.11.0 → 1.12.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 t=require("./media-BuwIclXE.cjs"),a=require("./X-BIgkmQPR.cjs"),be=require("@emotion/react"),u=require("react"),T=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 n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=no(u);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 n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Ct.apply(null,arguments)}const ao=be.css`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./media-BuwIclXE.cjs"),a=require("./X-BIgkmQPR.cjs"),oe=require("@emotion/react"),p=require("react"),T=require("./tooling-Dflq0Y98.cjs"),fe=require("react-dom");function so(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Le=so(p);function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},wt.apply(null,arguments)}const po=oe.css`
2
2
  *,
3
3
  *::before,
4
4
  *::after {
@@ -100,52 +100,52 @@
100
100
  :focus:not(:focus-visible) {
101
101
  outline: none;
102
102
  }
103
- `,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"},Nt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?po:uo},Tt=function(r,o,n){var i;if(o){var l=o.shouldForwardProp;i=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof i!="function"&&n&&(i=r.__emotion_forwardProp),i},ho=function(r){var o=r.cache,n=r.serialized,i=r.isStringTag;return a.registerStyles(o,n,i),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,n,i)}),null},bo=function e(r,o){var n=r.__emotion_real===r,i=n&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=Tt(r,o,n),p=d||Nt(i),b=!p("as");return function(){var h=arguments,f=n&&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 O=h[0];f.push(O[0]);for(var w=h.length,S=1;S<w;S++)f.push(h[S],O[S])}var x=be.withEmotionCache(function(C,$,y){var g=b&&C.as||i,L="",N=[],j=C;if(C.theme==null){j={};for(var Y in C)j[Y]=C[Y];j.theme=Re.useContext(be.ThemeContext)}typeof C.className=="string"?L=a.getRegisteredStyles($.registered,N,C.className):C.className!=null&&(L=C.className+" ");var P=a.serializeStyles(f.concat(N),$.registered,j);L+=$.key+"-"+P.name,c!==void 0&&(L+=" "+c);var _=b&&d===void 0?Nt(g):p,M={};for(var E in C)b&&E==="as"||_(E)&&(M[E]=C[E]);return M.className=L,y&&(M.ref=y),Re.createElement(Re.Fragment,null,Re.createElement(ho,{cache:$,serialized:P,isStringTag:typeof g=="string"}),Re.createElement(g,M))});return x.displayName=l!==void 0?l:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",x.defaultProps=r.defaultProps,x.__emotion_real=x,x.__emotion_base=i,x.__emotion_styles=f,x.__emotion_forwardProp=d,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(C,$){var y=e(C,Ct({},o,$,{shouldForwardProp:Tt(x,$,!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`
103
+ `,uo=()=>a.jsx(oe.Global,{styles:po});var ho=/^((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)-.*))$/,bo=a.memoize(function(e){return ho.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),go=bo,fo=function(r){return r!=="theme"},It=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?go:fo},At=function(r,o,n){var i;if(o){var l=o.shouldForwardProp;i=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof i!="function"&&n&&(i=r.__emotion_forwardProp),i},xo=function(r){var o=r.cache,n=r.serialized,i=r.isStringTag;return a.registerStyles(o,n,i),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,n,i)}),null},Oo=function e(r,o){var n=r.__emotion_real===r,i=n&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=At(r,o,n),u=d||It(i),h=!u("as");return function(){var b=arguments,f=n&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),b[0]==null||b[0].raw===void 0)f.push.apply(f,b);else{var O=b[0];f.push(O[0]);for(var m=b.length,S=1;S<m;S++)f.push(b[S],O[S])}var x=oe.withEmotionCache(function(y,$,C){var g=h&&y.as||i,k="",N=[],P=y;if(y.theme==null){P={};for(var Y in y)P[Y]=y[Y];P.theme=Le.useContext(oe.ThemeContext)}typeof y.className=="string"?k=a.getRegisteredStyles($.registered,N,y.className):y.className!=null&&(k=y.className+" ");var j=a.serializeStyles(f.concat(N),$.registered,P);k+=$.key+"-"+j.name,c!==void 0&&(k+=" "+c);var _=h&&d===void 0?It(g):u,M={};for(var E in y)h&&E==="as"||_(E)&&(M[E]=y[E]);return M.className=k,C&&(M.ref=C),Le.createElement(Le.Fragment,null,Le.createElement(xo,{cache:$,serialized:j,isStringTag:typeof g=="string"}),Le.createElement(g,M))});return x.displayName=l!==void 0?l:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",x.defaultProps=r.defaultProps,x.__emotion_real=x,x.__emotion_base=i,x.__emotion_styles=f,x.__emotion_forwardProp=d,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(y,$){var C=e(y,wt({},o,$,{shouldForwardProp:At(x,$,!0)}));return C.apply(void 0,f)},x}},So=["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=Oo.bind(null);So.forEach(function(e){s[e]=s(e)});const $o=s.span`
104
104
  font-size: 12px;
105
105
  font-weight: 500;
106
106
  color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
107
- `,xo=T.newClassNameGetter("field-label"),ie=({children:e,className:r,ref:o,required:n,variant:i="normal",...l})=>e?a.jsxs(fo,{...l,ref:o,className:xo("container",r),$variant:i,children:[e," ",n&&"*"]}):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`
107
+ `,yo=T.newClassNameGetter("field-label"),ne=({children:e,className:r,ref:o,required:n,variant:i="normal",...l})=>e?a.jsxs($o,{...l,ref:o,className:yo("container",r),$variant:i,children:[e," ",n&&"*"]}):null,it={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ae={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)}},Co=s.div`
108
108
  position: relative;
109
109
  display: grid;
110
110
  gap: 2px;
111
111
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
112
- `,So=s(ie)`
112
+ `,mo=s(ne)`
113
113
  margin-left: 6px;
114
- `,$o=s.div`
114
+ `,wo=s.div`
115
115
  position: relative;
116
116
  display: flex;
117
117
  align-items: center;
118
- `,yo=s.input`
118
+ `,vo=s.input`
119
119
  flex: 1;
120
120
  min-width: 0;
121
121
  width: 100%;
122
122
  outline: none;
123
123
  font-size: 14px;
124
124
  font-weight: 500;
125
- height: ${e=>ot[e.$size].height};
126
- padding: ${e=>ot[e.$size].padding};
125
+ height: ${e=>it[e.$size].height};
126
+ padding: ${e=>it[e.$size].padding};
127
127
  padding-right: 40px;
128
- border-radius: ${e=>ot[e.$size].radius};
128
+ border-radius: ${e=>it[e.$size].radius};
129
129
 
130
- color: ${e=>ne[e.$variant].color.static};
131
- border: 1px solid ${e=>ne[e.$variant].border.static};
132
- background-color: ${e=>ne[e.$variant].background.static};
130
+ color: ${e=>ae[e.$variant].color.static};
131
+ border: 1px solid ${e=>ae[e.$variant].border.static};
132
+ background-color: ${e=>ae[e.$variant].background.static};
133
133
 
134
134
  &::placeholder {
135
- color: ${e=>ne[e.$variant].placeholder.static};
135
+ color: ${e=>ae[e.$variant].placeholder.static};
136
136
  }
137
137
 
138
138
  &:disabled {
139
139
  cursor: not-allowed;
140
- color: ${e=>ne[e.$variant].color.disabled};
141
- background-color: ${e=>ne[e.$variant].background.disabled};
142
- border-color: ${e=>ne[e.$variant].border.disabled};
140
+ color: ${e=>ae[e.$variant].color.disabled};
141
+ background-color: ${e=>ae[e.$variant].background.disabled};
142
+ border-color: ${e=>ae[e.$variant].border.disabled};
143
143
 
144
144
  &::placeholder {
145
- color: ${e=>ne[e.$variant].placeholder.disabled};
145
+ color: ${e=>ae[e.$variant].placeholder.disabled};
146
146
  }
147
147
  }
148
- `,Co=s.div`
148
+ `,Ro=s.div`
149
149
  position: absolute;
150
150
  right: 12px;
151
151
  top: 50%;
@@ -153,7 +153,7 @@
153
153
  display: flex;
154
154
  align-items: center;
155
155
  justify-content: center;
156
- `,mo=s.div`
156
+ `,Lo=s.div`
157
157
  position: absolute;
158
158
  top: 100%;
159
159
  left: 0;
@@ -173,7 +173,7 @@
173
173
  opacity 0.15s ease,
174
174
  transform 0.15s ease,
175
175
  visibility 0.15s;
176
- `,wo=s.div`
176
+ `,ko=s.div`
177
177
  display: flex;
178
178
  align-items: center;
179
179
  gap: 10px;
@@ -199,43 +199,43 @@
199
199
  &:hover {
200
200
  background-color: ${t.alpha(t.COLORS.black,5)};
201
201
  }
202
- `,vo=s.img`
202
+ `,Eo=s.img`
203
203
  width: 24px;
204
204
  height: 24px;
205
205
  border-radius: 6px;
206
206
  object-fit: cover;
207
- `,Ro=s.span`
207
+ `,jo=s.span`
208
208
  flex: 1;
209
209
  overflow: hidden;
210
210
  text-overflow: ellipsis;
211
211
  white-space: nowrap;
212
- `,ko=s.div`
212
+ `,Po=s.div`
213
213
  padding: 12px 14px;
214
214
  font-size: 14px;
215
215
  color: ${t.alpha(t.COLORS.black,50)};
216
216
  text-align: center;
217
- `,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`
217
+ `,Dt={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=>Dt[e]??Dt.md,zo=oe.keyframes`
218
218
  0% {
219
219
  transform: rotate(0deg);
220
220
  }
221
221
  100% {
222
222
  transform: rotate(360deg);
223
223
  }
224
- `,Eo=s.div`
224
+ `,No=s.div`
225
225
  display: inline-block;
226
- width: ${e=>it(e.$size).size};
227
- height: ${e=>it(e.$size).size};
228
- border: ${e=>it(e.$size).borderWidth} solid ${At.track};
229
- border-top-color: ${At.indicator};
226
+ width: ${e=>nt(e.$size).size};
227
+ height: ${e=>nt(e.$size).size};
228
+ border: ${e=>nt(e.$size).borderWidth} solid ${_t.track};
229
+ border-top-color: ${_t.indicator};
230
230
  border-radius: 50%;
231
- animation: ${Lo} 0.8s linear infinite;
232
- `,Po=T.newClassNameGetter("spinner"),kt=({"aria-label":e="Loading",className:r,ref:o,size:n="md",...i})=>a.jsx(Eo,{...i,ref:o,className:Po("container",r),role:"status","aria-label":e,$size:n}),ke=T.newClassNameGetter("autocomplete"),jo=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,size:c="default",variant:d="normal",value:p,onChange:b,onSearch:h,debounceMs:f=300,minChars:O=1,noResultsMessage:w="No results found",...S})=>{const[x,C]=u.useState((p==null?void 0:p.value)??""),[$,y]=u.useState([]),[g,L]=u.useState(!1),[N,j]=u.useState(!1),[Y,P]=u.useState(!1),_=u.useRef(null),M=u.useRef(null);u.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&C(p.value)},[p==null?void 0:p.value]);const E=u.useCallback(async z=>{if(z.length<O){y([]),P(!1);return}L(!0),P(!0);try{const B=await h(z);y(B),j(!0)}catch{y([])}finally{L(!1)}},[h,O]),A=u.useCallback(z=>{const B=z.target.value;C(B),b==null||b({value:B,image_url:null}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{E(B)},f)},[b,E,f]),m=u.useCallback(z=>{C(z.value),y([]),j(!1),P(!1),b==null||b({value:z.value,image_url:z.image_url})},[b]),I=u.useCallback(()=>{setTimeout(()=>{j(!1)},150)},[]),R=u.useCallback(()=>{$.length>0&&j(!0)},[$.length]);return u.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),a.jsxs(Oo,{ref:_,className:ke("container",e),$fullWidth:!!n,children:[i&&a.jsx(So,{variant:d,className:ke("label",r==null?void 0:r.label),children:i}),a.jsxs($o,{children:[a.jsx(yo,{...S,ref:l,type:"text",value:x,onChange:A,onBlur:I,onFocus:R,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:N&&Y,className:ke("dropdown",r==null?void 0:r.dropdown),children:$.length>0?$.map(z=>a.jsxs(wo,{onClick:()=>m(z),className:ke("item",r==null?void 0:r.item),children:[z.image_url&&a.jsx(vo,{src:z.image_url,alt:z.value}),a.jsx(Ro,{children:z.value})]},z.id)):!g&&a.jsx(ko,{children:w})})]})},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},zo=e=>e?"auto":"fit-content",No=s.button`
231
+ animation: ${zo} 0.8s linear infinite;
232
+ `,To=T.newClassNameGetter("spinner"),Et=({"aria-label":e="Loading",className:r,ref:o,size:n="md",...i})=>a.jsx(No,{...i,ref:o,className:To("container",r),role:"status","aria-label":e,$size:n}),ke=T.newClassNameGetter("autocomplete"),Io=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,size:c="default",variant:d="normal",value:u,onChange:h,onSearch:b,debounceMs:f=300,minChars:O=1,noResultsMessage:m="No results found",...S})=>{const[x,y]=p.useState((u==null?void 0:u.value)??""),[$,C]=p.useState([]),[g,k]=p.useState(!1),[N,P]=p.useState(!1),[Y,j]=p.useState(!1),_=p.useRef(null),M=p.useRef(null);p.useEffect(()=>{(u==null?void 0:u.value)!==void 0&&y(u.value)},[u==null?void 0:u.value]);const E=p.useCallback(async z=>{if(z.length<O){C([]),j(!1);return}k(!0),j(!0);try{const B=await b(z);C(B),P(!0)}catch{C([])}finally{k(!1)}},[b,O]),A=p.useCallback(z=>{const B=z.target.value;y(B),h==null||h({value:B,image_url:null}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{E(B)},f)},[h,E,f]),w=p.useCallback(z=>{y(z.value),C([]),P(!1),j(!1),h==null||h({value:z.value,image_url:z.image_url})},[h]),I=p.useCallback(()=>{setTimeout(()=>{P(!1)},150)},[]),R=p.useCallback(()=>{$.length>0&&P(!0)},[$.length]);return p.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),a.jsxs(Co,{ref:_,className:ke("container",e),$fullWidth:!!n,children:[i&&a.jsx(mo,{variant:d,className:ke("label",r==null?void 0:r.label),children:i}),a.jsxs(wo,{children:[a.jsx(vo,{...S,ref:l,type:"text",value:x,onChange:A,onBlur:I,onFocus:R,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),g&&a.jsx(Ro,{children:a.jsx(Et,{size:"xs"})})]}),a.jsx(Lo,{$open:N&&Y,className:ke("dropdown",r==null?void 0:r.dropdown),children:$.length>0?$.map(z=>a.jsxs(ko,{onClick:()=>w(z),className:ke("item",r==null?void 0:r.item),children:[z.image_url&&a.jsx(Eo,{src:z.image_url,alt:z.value}),a.jsx(jo,{children:z.value})]},z.id)):!g&&a.jsx(Po,{children:m})})]})},Mt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Ft={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=Ft[e];return r||Ft.normal},re=e=>{const r=Mt[e];return r||Mt.default},Ao=e=>e?"auto":"fit-content",Do=s.button`
233
233
  display: flex;
234
234
  gap: 6px;
235
235
  text-decoration: none;
236
236
  align-items: center;
237
237
  justify-content: center;
238
- width: ${e=>e.$iconOnly?re(e.$size).height:zo(!!e.$fullWidth)};
238
+ width: ${e=>e.$iconOnly?re(e.$size).height:Ao(!!e.$fullWidth)};
239
239
  color: ${e=>J(e.$variant).color.static};
240
240
  background-color: ${e=>J(e.$variant).background.static};
241
241
  height: ${e=>re(e.$size).height};
@@ -261,7 +261,7 @@
261
261
  background-color: ${e=>J(e.$variant).background.disabled};
262
262
  border-color: ${e=>J(e.$variant).borderColor.disabled};
263
263
  }
264
- `,To=s.div`
264
+ `,_o=s.div`
265
265
  display: grid;
266
266
  place-items: center;
267
267
  width: ${e=>re(e.$size).iconSize};
@@ -271,19 +271,19 @@
271
271
  width: ${e=>re(e.$size).iconSize};
272
272
  height: ${e=>re(e.$size).iconSize};
273
273
  }
274
- `,Io=s.span`
274
+ `,Mo=s.span`
275
275
  font-weight: 600;
276
276
  overflow: hidden;
277
277
  white-space: nowrap;
278
278
  text-overflow: ellipsis;
279
- `,Ao=s(a.LoaderCircle)`
279
+ `,Fo=s(a.LoaderCircle)`
280
280
  width: ${e=>re(e.$size).iconSize};
281
281
  height: ${e=>re(e.$size).iconSize};
282
282
  animation: ${t.KEYFRAMES.rotate} 0.8s linear infinite;
283
- `,Do=s.div`
283
+ `,Bo=s.div`
284
284
  display: flex;
285
285
  gap: 3px;
286
- `,_o=s.span`
286
+ `,Yo=s.span`
287
287
  text-align: center;
288
288
  display: flex;
289
289
  justify-content: center;
@@ -296,24 +296,24 @@
296
296
  border-radius: 4px;
297
297
  width: fit-content;
298
298
  background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
299
- `,Mo=T.newClassNameGetter("key-symbol"),yr=({className:e,ref:r,symbol:o,variant:n="light",...i})=>o?a.jsx(_o,{...i,ref:r,className:Mo("container",e),$variant:n,children:o}):null,Mt=T.newClassNameGetter("key-bindings"),Cr=({className:e,classnames:r,keys:o,ref:n,variant:i,...l})=>{const c=u.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(Do,{...l,ref:n,className:Mt("container",e),children:c.map(d=>a.jsx(yr,{symbol:d,className:Mt("item",r==null?void 0:r.item),variant:i},d))})},Ft=T.newClassNameGetter("button"),De=({children:e,className:r,classnames:o,disabled:n,fullWidth:i,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:b=[],size:h="default",type:f="button",variant:O="normal",...w})=>{const S=u.useRef(null);u.useImperativeHandle(p,()=>S.current,[]),t.useKeyBinding(b,()=>{var C;(C=S.current)==null||C.click()});const x=u.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(No,{...w,onClick:d,ref:S,type:x,disabled:n,className:Ft("container",r),$variant:O,$size:h,$fullWidth:!!i,$iconOnly:!!l&&!(e||(b==null?void 0:b.length)>0),children:[c&&a.jsx(Ao,{$size:h}),l&&!c&&a.jsx(To,{$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:O==="system"?"light":"dark"})]})},Fo=s.div`
299
+ `,Vo=T.newClassNameGetter("key-symbol"),wr=({className:e,ref:r,symbol:o,variant:n="light",...i})=>o?a.jsx(Yo,{...i,ref:r,className:Vo("container",e),$variant:n,children:o}):null,Bt=T.newClassNameGetter("key-bindings"),vr=({className:e,classnames:r,keys:o,ref:n,variant:i,...l})=>{const c=p.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(Bo,{...l,ref:n,className:Bt("container",e),children:c.map(d=>a.jsx(wr,{symbol:d,className:Bt("item",r==null?void 0:r.item),variant:i},d))})},Yt=T.newClassNameGetter("button"),ge=({children:e,className:r,classnames:o,disabled:n,fullWidth:i,icon:l,loading:c,onClick:d,ref:u=null,keyBindings:h=[],size:b="default",type:f="button",variant:O="normal",...m})=>{const S=p.useRef(null);p.useImperativeHandle(u,()=>S.current,[]),t.useKeyBinding(h,()=>{var y;(y=S.current)==null||y.click()});const x=p.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(Do,{...m,onClick:d,ref:S,type:x,disabled:n,className:Yt("container",r),$variant:O,$size:b,$fullWidth:!!i,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(Fo,{$size:b}),l&&!c&&a.jsx(_o,{$size:b,children:l}),e&&a.jsx(Mo,{className:Yt("label",o==null?void 0:o.label),children:e}),a.jsx(vr,{keys:h,variant:O==="system"?"light":"dark"})]})},Ho=s.div`
300
300
  background-color: ${t.COLORS.white};
301
301
  border-radius: 16px;
302
302
  border: ${e=>e.$border?`1px solid ${t.alpha(t.COLORS["iron-grey"],15)}`:"none"};
303
303
  box-shadow: ${e=>e.$shadow?`0 2px 8px ${t.alpha(t.COLORS.black,10)}`:"none"};
304
- `,Bo=T.newClassNameGetter("card"),Yo=({children:e,className:r,ref:o,border:n=!1,shadow:i=!1,...l})=>a.jsx(Fo,{...l,ref:o,className:Bo("container",r),$border:n,$shadow:i,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`
304
+ `,Go=T.newClassNameGetter("card"),Wo=({children:e,className:r,ref:o,border:n=!1,shadow:i=!1,...l})=>a.jsx(Ho,{...l,ref:o,className:Go("container",r),$border:n,$shadow:i,children:e}),Vt={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}},Ce=e=>Vt[e]??Vt.normal,Ko=s.label`
305
305
  display: inline-flex;
306
306
  align-items: flex-start;
307
307
  gap: 8px;
308
308
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
309
309
  opacity: ${e=>e.$disabled?.5:1};
310
- `,Ho=s.input`
310
+ `,Uo=s.input`
311
311
  position: absolute;
312
312
  opacity: 0;
313
313
  width: 0;
314
314
  height: 0;
315
315
  pointer-events: none;
316
- `,Go=s.span`
316
+ `,Xo=s.span`
317
317
  display: inline-flex;
318
318
  align-items: center;
319
319
  justify-content: center;
@@ -322,17 +322,17 @@
322
322
  height: 18px;
323
323
  border-radius: 6px;
324
324
  border: 1.5px solid
325
- ${e=>e.$checked||e.$indeterminate?ye(e.$variant).box.borderChecked:ye(e.$variant).box.border};
326
- background-color: ${e=>e.$checked||e.$indeterminate?ye(e.$variant).box.backgroundChecked:ye(e.$variant).box.background};
325
+ ${e=>e.$checked||e.$indeterminate?Ce(e.$variant).box.borderChecked:Ce(e.$variant).box.border};
326
+ background-color: ${e=>e.$checked||e.$indeterminate?Ce(e.$variant).box.backgroundChecked:Ce(e.$variant).box.background};
327
327
  transition:
328
328
  border-color 0.15s ease,
329
329
  background-color 0.15s ease,
330
330
  box-shadow 0.15s ease;
331
- `,Wo=s.span`
331
+ `,qo=s.span`
332
332
  display: inline-flex;
333
333
  align-items: center;
334
334
  justify-content: center;
335
- color: ${e=>ye(e.$variant).icon};
335
+ color: ${e=>Ce(e.$variant).icon};
336
336
  opacity: ${e=>e.$visible?1:0};
337
337
  transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
338
338
  transition:
@@ -343,11 +343,11 @@
343
343
  width: 12px;
344
344
  height: 12px;
345
345
  }
346
- `,Ko=s.span`
346
+ `,Zo=s.span`
347
347
  font-size: 14px;
348
348
  font-weight: 500;
349
349
  line-height: 1.4;
350
- color: ${e=>ye(e.$variant).label};
350
+ color: ${e=>Ce(e.$variant).label};
351
351
  user-select: none;
352
352
 
353
353
  a {
@@ -359,15 +359,15 @@
359
359
  text-decoration: none;
360
360
  }
361
361
  }
362
- `,Le=T.newClassNameGetter("checkbox"),et=({checked:e,className:r,classnames:o,disabled:n,indeterminate:i=!1,label:l,onChange:c,ref:d,variant:p="normal",...b})=>a.jsxs(Vo,{className:Le("container",r),$disabled:!!n,$variant:p,children:[a.jsx(Ho,{...b,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:n,onChange:c}),a.jsx(Go,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:i,$variant:p,children:a.jsx(Wo,{className:Le("icon",o==null?void 0:o.icon),$visible:i||e,$variant:p,children:i?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Ko,{className:Le("label",o==null?void 0:o.label),$variant:p,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,Uo=s.label`
362
+ `,Ee=T.newClassNameGetter("checkbox"),tt=({checked:e,className:r,classnames:o,disabled:n,indeterminate:i=!1,label:l,onChange:c,ref:d,variant:u="normal",...h})=>a.jsxs(Ko,{className:Ee("container",r),$disabled:!!n,$variant:u,children:[a.jsx(Uo,{...h,ref:d,type:"checkbox",className:Ee("input",o==null?void 0:o.input),checked:e,disabled:n,onChange:c}),a.jsx(Xo,{className:Ee("box",o==null?void 0:o.box),$checked:e,$indeterminate:i,$variant:u,children:a.jsx(qo,{className:Ee("icon",o==null?void 0:o.icon),$visible:i||e,$variant:u,children:i?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Zo,{className:Ee("label",o==null?void 0:o.label),$variant:u,children:l})]}),Ht={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=>Ht[e]??Ht.normal,Jo=s.label`
363
363
  display: grid;
364
364
  grid-template-columns: auto 1fr;
365
365
  align-items: start;
366
366
  gap: 8px;
367
367
  padding: 12px;
368
- background-color: ${e=>{const r=ue(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
368
+ background-color: ${e=>{const r=he(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
369
369
  border: 1px solid
370
- ${e=>{const r=ue(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
370
+ ${e=>{const r=he(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
371
371
  border-radius: 12px;
372
372
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
373
373
  transition:
@@ -377,13 +377,13 @@
377
377
  min-width: 0;
378
378
 
379
379
  &:hover:not([data-disabled='true']) {
380
- border-color: ${e=>{const r=ue(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
380
+ border-color: ${e=>{const r=he(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
381
381
  }
382
382
 
383
383
  .vacano_checkbox_container {
384
384
  pointer-events: none;
385
385
  }
386
- `,Xo=s.input`
386
+ `,Qo=s.input`
387
387
  position: absolute;
388
388
  width: 1px;
389
389
  height: 1px;
@@ -393,44 +393,44 @@
393
393
  clip: rect(0, 0, 0, 0);
394
394
  white-space: nowrap;
395
395
  border: 0;
396
- `,qo=s.div`
396
+ `,ei=s.div`
397
397
  display: flex;
398
398
  flex-direction: column;
399
399
  gap: 2px;
400
400
  min-width: 0;
401
- `,Zo=s.span`
401
+ `,ti=s.span`
402
402
  font-size: 14px;
403
403
  font-weight: 500;
404
404
  line-height: 1.4;
405
- color: ${e=>ue(e.$variant).label.static};
405
+ color: ${e=>he(e.$variant).label.static};
406
406
 
407
407
  label[data-disabled='true'] & {
408
- color: ${e=>ue(e.$variant).label.disabled};
408
+ color: ${e=>he(e.$variant).label.disabled};
409
409
  }
410
- `,Jo=s.span`
410
+ `,ri=s.span`
411
411
  font-size: 12px;
412
412
  font-weight: 400;
413
413
  line-height: 1.4;
414
- color: ${e=>ue(e.$variant).description.static};
414
+ color: ${e=>he(e.$variant).description.static};
415
415
 
416
416
  label[data-disabled='true'] & {
417
- color: ${e=>ue(e.$variant).description.disabled};
417
+ color: ${e=>he(e.$variant).description.disabled};
418
418
  }
419
- `,Ye=T.newClassNameGetter("checkbox-card"),Qo=({checked:e,className:r,classnames:o,description:n,disabled:i,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:b="normal",...h})=>a.jsxs(Uo,{className:Ye("container",r),$checked:e,$disabled:!!i,$fullWidth:l,$variant:b,"data-disabled":i,children:[a.jsx(Xo,{...h,ref:p,type:"checkbox",checked:e,disabled:i,onChange:d}),a.jsx(et,{className:o==null?void 0:o.checkbox,checked:e,disabled:i,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(qo,{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}),n&&a.jsx(Jo,{className:Ye("description",o==null?void 0:o.description),$variant:b,children:n})]})]}),Vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ei=s.div`
419
+ `,Ye=T.newClassNameGetter("checkbox-card"),oi=({checked:e,className:r,classnames:o,description:n,disabled:i,fullWidth:l=!1,label:c,onChange:d,ref:u,variant:h="normal",...b})=>a.jsxs(Jo,{className:Ye("container",r),$checked:e,$disabled:!!i,$fullWidth:l,$variant:h,"data-disabled":i,children:[a.jsx(Qo,{...b,ref:u,type:"checkbox",checked:e,disabled:i,onChange:d}),a.jsx(tt,{className:o==null?void 0:o.checkbox,checked:e,disabled:i,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(ei,{className:Ye("content",o==null?void 0:o.content),children:[a.jsx(ti,{className:Ye("label",o==null?void 0:o.label),$variant:h,children:c}),n&&a.jsx(ri,{className:Ye("description",o==null?void 0:o.description),$variant:h,children:n})]})]}),Gt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ii=s.div`
420
420
  display: flex;
421
421
  flex-direction: column;
422
422
  gap: 8px;
423
- `,ti=s.span`
423
+ `,ni=s.span`
424
424
  font-size: 13px;
425
425
  font-weight: 500;
426
426
  line-height: 1.5;
427
- color: ${e=>e.$disabled?Vt.label.disabledColor:Vt.label.color};
427
+ color: ${e=>e.$disabled?Gt.label.disabledColor:Gt.label.color};
428
428
  margin-bottom: 4px;
429
- `,ri=s.div`
429
+ `,ai=s.div`
430
430
  display: flex;
431
431
  flex-direction: column;
432
432
  gap: 12px;
433
- `,nt=T.newClassNameGetter("checkbox-group"),oi=({className:e,classnames:r,disabled:o,label:n,onChange:i,options:l,ref:c,value:d,...p})=>{const b=(h,f)=>{i(f?[...d,h]:d.filter(O=>O!==h))};return a.jsxs(ei,{...p,ref:c,className:nt("container",e),children:[n&&a.jsx(ti,{className:nt("label",r==null?void 0:r.label),$disabled:o,children:n}),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`
433
+ `,at=T.newClassNameGetter("checkbox-group"),li=({className:e,classnames:r,disabled:o,label:n,onChange:i,options:l,ref:c,value:d,...u})=>{const h=(b,f)=>{i(f?[...d,b]:d.filter(O=>O!==b))};return a.jsxs(ii,{...u,ref:c,className:at("container",e),children:[n&&a.jsx(ni,{className:at("label",r==null?void 0:r.label),$disabled:o,children:n}),a.jsx(ai,{className:at("options",r==null?void 0:r.options),children:l.map(b=>a.jsx(tt,{className:r==null?void 0:r.checkbox,checked:d.includes(b.value),label:b.label,disabled:o,onChange:f=>h(b.value,f.target.checked)},b.value))})]})},Wt={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)}},vt=e=>Wt[e]??Wt.gray,di=s.span`
434
434
  display: inline-flex;
435
435
  align-items: center;
436
436
  gap: 4px;
@@ -440,9 +440,9 @@
440
440
  font-size: 12px;
441
441
  font-weight: 500;
442
442
  line-height: 1.5;
443
- background-color: ${e=>mt(e.$variant).background};
444
- color: ${e=>mt(e.$variant).color};
445
- `,ni=s.button`
443
+ background-color: ${e=>vt(e.$variant).background};
444
+ color: ${e=>vt(e.$variant).color};
445
+ `,ci=s.button`
446
446
  display: inline-flex;
447
447
  align-items: center;
448
448
  justify-content: center;
@@ -457,17 +457,17 @@
457
457
  transition: background-color 0.15s ease;
458
458
 
459
459
  &:hover {
460
- background-color: ${e=>mt(e.$variant).deleteHover};
460
+ background-color: ${e=>vt(e.$variant).deleteHover};
461
461
  }
462
462
 
463
463
  & svg {
464
464
  width: 14px;
465
465
  height: 14px;
466
466
  }
467
- `,ai=s.span`
467
+ `,si=s.span`
468
468
  flex: 1 0 auto;
469
469
  text-align: center;
470
- `,at=T.newClassNameGetter("chip"),Je=({children:e,className:r,classnames:o,deletable:n,onDelete:i,ref:l,variant:c="gray",...d})=>a.jsxs(ii,{...d,ref:l,className:at("container",r),$variant:c,$deletable:!!n,children:[a.jsx(ai,{className:at("label",o==null?void 0:o.label),children:e}),n&&a.jsx(ni,{type:"button",className:at("delete",o==null?void 0:o.delete),$variant:c,onClick:i,children:a.jsx(a.X,{})})]}),li="Confirm",di="Cancel",ci=be.keyframes`
470
+ `,lt=T.newClassNameGetter("chip"),Qe=({children:e,className:r,classnames:o,deletable:n,onDelete:i,ref:l,variant:c="gray",...d})=>a.jsxs(di,{...d,ref:l,className:lt("container",r),$variant:c,$deletable:!!n,children:[a.jsx(si,{className:lt("label",o==null?void 0:o.label),children:e}),n&&a.jsx(ci,{type:"button",className:lt("delete",o==null?void 0:o.delete),$variant:c,onClick:i,children:a.jsx(a.X,{})})]}),pi="Confirm",ui="Cancel",hi=oe.keyframes`
471
471
  from {
472
472
  opacity: 0;
473
473
  transform: translateX(-50%) translateY(100%);
@@ -476,7 +476,7 @@
476
476
  opacity: 1;
477
477
  transform: translateX(-50%) translateY(0);
478
478
  }
479
- `,si=be.keyframes`
479
+ `,bi=oe.keyframes`
480
480
  from {
481
481
  opacity: 1;
482
482
  transform: translateX(-50%) translateY(0);
@@ -485,7 +485,7 @@
485
485
  opacity: 0;
486
486
  transform: translateX(-50%) translateY(100%);
487
487
  }
488
- `,pi=s.div`
488
+ `,gi=s.div`
489
489
  position: fixed;
490
490
  bottom: 24px;
491
491
  left: 50%;
@@ -499,49 +499,49 @@
499
499
  box-shadow:
500
500
  0 4px 6px -1px rgba(0, 0, 0, 0.1),
501
501
  0 2px 4px -2px rgba(0, 0, 0, 0.1);
502
- animation: ${({$isExiting:e})=>e?si:ci} 0.2s ease-out forwards;
502
+ animation: ${({$isExiting:e})=>e?bi:hi} 0.2s ease-out forwards;
503
503
  z-index: 1000;
504
- `,ui=s.p`
504
+ `,fi=s.p`
505
505
  margin: 0;
506
506
  font-size: 14px;
507
507
  color: ${t.COLORS.black};
508
508
  white-space: nowrap;
509
- `,hi=s.div`
509
+ `,xi=s.div`
510
510
  display: flex;
511
511
  align-items: center;
512
512
  gap: 8px;
513
- `,bi=({confirmation:e,onDone:r})=>{const[o,n]=u.useState(!1),[i,l]=u.useState(!1),{message:c,onConfirm:d,onCancel:p,options:b}=e,h=b.confirmLabel||li,f=b.cancelLabel||di,O=u.useCallback(x=>{n(!0),setTimeout(()=>{x==null||x(),r()},200)},[r]),w=u.useCallback(async()=>{const x=d();if(x instanceof Promise){l(!0);try{await x}finally{l(!1)}}O()},[O,d]),S=u.useCallback(()=>{i||O(p)},[O,i,p]);return u.useEffect(()=>{const x=C=>{C.key==="Escape"&&!i&&S()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[S,i]),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:i,children:f}),a.jsx(De,{variant:"danger",size:"compact",onClick:w,loading:i,children:h})]})]})},mr=u.createContext(null),gi=()=>{},fi=({children:e})=>{const[r,o]=u.useState(null),n=u.useCallback((l,c,d,p)=>{o({open:!0,message:l,onConfirm:c,onCancel:d||gi,options:p||{}})},[]),i=u.useCallback(()=>{o(null)},[]);return a.jsxs(mr.Provider,{value:{show:n,hide:i},children:[e,r&&a.jsx(bi,{confirmation:r,onDone:i})]})},xi=()=>{const e=u.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`
513
+ `,Oi=({confirmation:e,onDone:r})=>{const[o,n]=p.useState(!1),[i,l]=p.useState(!1),{message:c,onConfirm:d,onCancel:u,options:h}=e,b=h.confirmLabel||pi,f=h.cancelLabel||ui,O=p.useCallback(x=>{n(!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)}}O()},[O,d]),S=p.useCallback(()=>{i||O(u)},[O,i,u]);return p.useEffect(()=>{const x=y=>{y.key==="Escape"&&!i&&S()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[S,i]),a.jsxs(gi,{$isExiting:o,children:[a.jsx(fi,{children:c}),a.jsxs(xi,{children:[a.jsx(ge,{variant:"system",size:"compact",onClick:S,disabled:i,children:f}),a.jsx(ge,{variant:"danger",size:"compact",onClick:m,loading:i,children:b})]})]})},Rr=p.createContext(null),Si=()=>{},$i=({children:e})=>{const[r,o]=p.useState(null),n=p.useCallback((l,c,d,u)=>{o({open:!0,message:l,onConfirm:c,onCancel:d||Si,options:u||{}})},[]),i=p.useCallback(()=>{o(null)},[]);return a.jsxs(Rr.Provider,{value:{show:n,hide:i},children:[e,r&&a.jsx(Oi,{confirmation:r,onDone:i})]})},yi=()=>{const e=p.useContext(Rr);if(!e)throw new Error("useConfirmation must be used within ConfirmationProvider");return e},je={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`},Ci=s.div`
514
514
  width: 100%;
515
515
 
516
516
  ${t.mediaUp("sm")} {
517
- max-width: ${Ee.sm};
517
+ max-width: ${je.sm};
518
518
  }
519
519
 
520
520
  ${t.mediaUp("md")} {
521
- max-width: ${Ee.md};
521
+ max-width: ${je.md};
522
522
  }
523
523
 
524
524
  ${t.mediaUp("lg")} {
525
- max-width: ${Ee.lg};
525
+ max-width: ${je.lg};
526
526
  }
527
527
 
528
528
  ${t.mediaUp("xl")} {
529
- max-width: ${Ee.xl};
529
+ max-width: ${je.xl};
530
530
  }
531
531
 
532
532
  ${t.mediaUp("2xl")} {
533
- max-width: ${Ee["2xl"]};
533
+ max-width: ${je["2xl"]};
534
534
  }
535
- `,Si=T.newClassNameGetter("container"),$i=({children:e,className:r,ref:o,...n})=>a.jsx(Oi,{...n,ref:o,className:Si("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,wr=(e,r,o="en")=>{const n=e.getFullYear(),i=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),b=c%12||12,h=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),O=new Intl.DateTimeFormat(o,{month:"short"}).format(e),w=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," "),$=L=>`\0${L}\0`,y=[["2006","YEARFOUR",n.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",w],["Jan","MONTHSHORT",O],["Mon","WEEKDAYSHORT",S],["06","YEARTWO",n.toString().slice(-2)],["01","MONTHPAD",x(i+1)],["_2","DAYSPACE",C(l)],["02","DAYPAD",x(l)],["15","HOURTWENTYFOUR",x(c)],["03","HOURTWELVEPAD",x(b)],["04","MINUTE",x(d)],["05","SECOND",x(p)],["PM","AMPMUP",h?"PM":"AM"],["pm","AMPMLOW",h?"pm":"am"],["1","MONTH",(i+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",b.toString()]];let g=r;for(const[L,N]of y)g=g.split(L).join($(N));for(const[,L,N]of y)g=g.split($(L)).join(N);return g},Ci=(e,r)=>new Date(e,r+1,0).getDate(),mi=(e,r)=>new Date(e,r,1).getDay(),wi=(e,r,o=1)=>{const n=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<=n;d++)c.push(d);for(;c.length<42;)c.push(null);return c},vi=(e,r=1)=>{const o=[];for(let n=0;n<7;n++){const i=(r+n)%7,l=new Date(2024,0,7+i);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},Ri=e=>{const r=[];for(let o=0;o<12;o++){const n=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(n))}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(),Kt=(e,r,o,n,i)=>{const l=new Date(e,r,o);if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l<c)return!0}if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l>c)return!0}return!1},Ut=(e,r,o,n)=>{if(o){const i=o.getFullYear(),l=o.getMonth();if(e<i||e===i&&r<l)return!0}if(n){const i=n.getFullYear(),l=n.getMonth();if(e>i||e===i&&r>l)return!0}return!1},Xt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),Li=(e,r=12)=>{const o=e-Math.floor(r/2),n=[];for(let i=0;i<r;i++)n.push(o+i);return n},Ei=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},Pi=s.div`
535
+ `,mi=T.newClassNameGetter("container"),wi=({children:e,className:r,ref:o,...n})=>a.jsx(Ci,{...n,ref:o,className:mi("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}},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)}},ie=36,rt=2,vi=12,Lr=(e,r,o="en")=>{const n=e.getFullYear(),i=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),u=e.getSeconds(),h=c%12||12,b=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),S=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),x=k=>k.toString().padStart(2,"0"),y=k=>k.toString().padStart(2," "),$=k=>`\0${k}\0`,C=[["2006","YEARFOUR",n.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",O],["Mon","WEEKDAYSHORT",S],["06","YEARTWO",n.toString().slice(-2)],["01","MONTHPAD",x(i+1)],["_2","DAYSPACE",y(l)],["02","DAYPAD",x(l)],["15","HOURTWENTYFOUR",x(c)],["03","HOURTWELVEPAD",x(h)],["04","MINUTE",x(d)],["05","SECOND",x(u)],["PM","AMPMUP",b?"PM":"AM"],["pm","AMPMLOW",b?"pm":"am"],["1","MONTH",(i+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",h.toString()]];let g=r;for(const[k,N]of C)g=g.split(k).join($(N));for(const[,k,N]of C)g=g.split($(k)).join(N);return g},Ri=(e,r)=>new Date(e,r+1,0).getDate(),Li=(e,r)=>new Date(e,r,1).getDay(),ki=(e,r,o=1)=>{const n=Ri(e,r);let l=Li(e,r)-o;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=n;d++)c.push(d);for(;c.length<42;)c.push(null);return c},Ei=(e,r=1)=>{const o=[];for(let n=0;n<7;n++){const i=(r+n)%7,l=new Date(2024,0,7+i);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},ji=e=>{const r=[];for(let o=0;o<12;o++){const n=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(n))}return r},Kt=(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(),Pi=(e,r)=>e.getFullYear()===r.getFullYear(),Xt=(e,r,o,n,i)=>{const l=new Date(e,r,o);if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l<c)return!0}if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l>c)return!0}return!1},qt=(e,r,o,n)=>{if(o){const i=o.getFullYear(),l=o.getMonth();if(e<i||e===i&&r<l)return!0}if(n){const i=n.getFullYear(),l=n.getMonth();if(e>i||e===i&&r>l)return!0}return!1},Zt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),zi=(e,r=12)=>{const o=e-Math.floor(r/2),n=[];for(let i=0;i<r;i++)n.push(o+i);return n},Ni=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},Ti=s.div`
536
536
  position: relative;
537
537
  display: inline-flex;
538
538
  flex-direction: column;
539
539
  gap: 2px;
540
540
  min-width: 180px;
541
541
  width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
542
- `,ji=s(ie)`
542
+ `,Ii=s(ne)`
543
543
  margin-left: 6px;
544
- `,zi=s.button`
544
+ `,Ai=s.button`
545
545
  display: flex;
546
546
  align-items: center;
547
547
  justify-content: space-between;
@@ -552,9 +552,9 @@
552
552
  font-size: 14px;
553
553
  font-weight: 500;
554
554
  text-align: left;
555
- height: ${({$size:e})=>Ze[e].height};
556
- padding: ${({$size:e})=>Ze[e].padding};
557
- border-radius: ${({$size:e})=>Ze[e].radius};
555
+ height: ${({$size:e})=>Je[e].height};
556
+ padding: ${({$size:e})=>Je[e].padding};
557
+ border-radius: ${({$size:e})=>Je[e].radius};
558
558
  color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?Pe[e].color[r?"disabled":"static"]:Pe[e].placeholder[r?"disabled":"static"]};
559
559
  border: 1px solid
560
560
  ${({$variant:e,$disabled:r})=>Pe[e].border[r?"disabled":"static"]};
@@ -563,53 +563,53 @@
563
563
  ${({$open:e,$variant:r})=>e&&`
564
564
  outline: 2px solid ${Pe[r].focus};
565
565
  `}
566
- `,Ni=s.span`
566
+ `,Di=s.span`
567
567
  flex: 1;
568
568
  overflow: hidden;
569
569
  text-overflow: ellipsis;
570
570
  white-space: nowrap;
571
- `,Ti=s.span`
571
+ `,_i=s.span`
572
572
  display: flex;
573
573
  align-items: center;
574
574
  justify-content: center;
575
575
  flex-shrink: 0;
576
576
  transition: transform 0.15s ease;
577
577
  transform: ${({$open:e})=>e?"rotate(180deg)":"rotate(0deg)"};
578
- `,vr=`
578
+ `,kr=`
579
579
  z-index: 100;
580
580
  background-color: ${t.COLORS.white};
581
581
  border: 1px solid ${t.alpha(t.COLORS.black,15)};
582
582
  border-radius: 12px;
583
583
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
584
- padding: ${yi}px;
585
- `,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ii=s.div`
584
+ padding: ${vi}px;
585
+ `,Er=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Mi=s.div`
586
586
  position: absolute;
587
587
  ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
588
588
  left: 0;
589
- ${vr}
589
+ ${kr}
590
590
  opacity: ${({$open:e})=>e?1:0};
591
591
  visibility: ${({$open:e})=>e?"visible":"hidden"};
592
- transform: ${({$open:e,$position:r})=>Rr(e,r)};
592
+ transform: ${({$open:e,$position:r})=>Er(e,r)};
593
593
  transition:
594
594
  opacity 0.15s ease,
595
595
  transform 0.15s ease,
596
596
  visibility 0.15s;
597
- `,Ai=s.div`
597
+ `,Fi=s.div`
598
598
  position: fixed;
599
- ${vr}
599
+ ${kr}
600
600
  opacity: ${({$open:e})=>e?1:0};
601
601
  visibility: ${({$open:e})=>e?"visible":"hidden"};
602
- transform: ${({$open:e,$position:r})=>Rr(e,r)};
602
+ transform: ${({$open:e,$position:r})=>Er(e,r)};
603
603
  transition:
604
604
  opacity 0.15s ease,
605
605
  transform 0.15s ease,
606
606
  visibility 0.15s;
607
- `,lt=s.div`
607
+ `,dt=s.div`
608
608
  display: flex;
609
609
  align-items: center;
610
610
  justify-content: space-between;
611
611
  margin-bottom: 8px;
612
- `,dt=s.button`
612
+ `,ct=s.button`
613
613
  display: flex;
614
614
  align-items: center;
615
615
  gap: 4px;
@@ -625,7 +625,7 @@
625
625
  &:hover {
626
626
  background-color: ${t.alpha(t.COLORS.black,5)};
627
627
  }
628
- `,Oe=s.button`
628
+ `,Se=s.button`
629
629
  display: flex;
630
630
  align-items: center;
631
631
  justify-content: center;
@@ -649,33 +649,33 @@
649
649
  background: transparent;
650
650
  }
651
651
  }
652
- `,ct=s.div`
652
+ `,st=s.div`
653
653
  display: flex;
654
654
  gap: 4px;
655
- `,Di=s.div`
655
+ `,Bi=s.div`
656
656
  display: grid;
657
- grid-template-columns: repeat(7, ${oe}px);
658
- gap: ${tt}px;
657
+ grid-template-columns: repeat(7, ${ie}px);
658
+ gap: ${rt}px;
659
659
  margin-bottom: 4px;
660
- `,_i=s.div`
660
+ `,Yi=s.div`
661
661
  display: flex;
662
662
  align-items: center;
663
663
  justify-content: center;
664
- height: ${oe}px;
664
+ height: ${ie}px;
665
665
  font-size: 12px;
666
666
  font-weight: 500;
667
667
  color: ${t.alpha(t.COLORS.black,50)};
668
668
  text-transform: uppercase;
669
- `,Mi=s.div`
669
+ `,Vi=s.div`
670
670
  display: grid;
671
- grid-template-columns: repeat(7, ${oe}px);
672
- gap: ${tt}px;
673
- `,Fi=s.button`
671
+ grid-template-columns: repeat(7, ${ie}px);
672
+ gap: ${rt}px;
673
+ `,Hi=s.button`
674
674
  display: flex;
675
675
  align-items: center;
676
676
  justify-content: center;
677
- width: ${oe}px;
678
- height: ${oe}px;
677
+ width: ${ie}px;
678
+ height: ${ie}px;
679
679
  border: none;
680
680
  border-radius: 8px;
681
681
  font-size: 13px;
@@ -695,12 +695,12 @@
695
695
  &:disabled {
696
696
  cursor: not-allowed;
697
697
  }
698
- `,Bi=s.div`
698
+ `,Gi=s.div`
699
699
  display: grid;
700
700
  grid-template-columns: repeat(3, 1fr);
701
701
  gap: 8px;
702
- width: ${7*oe+6*tt}px;
703
- `,Yi=s.button`
702
+ width: ${7*ie+6*rt}px;
703
+ `,Wi=s.button`
704
704
  display: flex;
705
705
  align-items: center;
706
706
  justify-content: center;
@@ -720,12 +720,12 @@
720
720
  &:hover:not(:disabled) {
721
721
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
722
722
  }
723
- `,Vi=s.div`
723
+ `,Ki=s.div`
724
724
  display: grid;
725
725
  grid-template-columns: repeat(3, 1fr);
726
726
  gap: 8px;
727
- width: ${7*oe+6*tt}px;
728
- `,Hi=s.button`
727
+ width: ${7*ie+6*rt}px;
728
+ `,Ui=s.button`
729
729
  display: flex;
730
730
  align-items: center;
731
731
  justify-content: center;
@@ -745,10 +745,25 @@
745
745
  &:hover:not(:disabled) {
746
746
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
747
747
  }
748
- `,Gi=s.div`
749
- width: ${oe}px;
750
- height: ${oe}px;
751
- `,q=T.newClassNameGetter("date-picker"),Ve=4,Wi=300,Ki=({value:e,onChange:r,mode:o="date",displayFormat:n,placeholder:i,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:b="default",variant:h="normal",disabled:f=!1,fullWidth:O=!1,label:w,portalRenderNode:S,open:x,onOpen:C,onClose:$,className:y,classnames:g,ref:L,...N})=>{const j=u.useMemo(()=>new Date,[]),[Y,P]=u.useState(!1),[_,M]=u.useState({top:0,left:0}),[E,A]=u.useState("bottom"),[m,I]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[R,z]=u.useState(()=>e??j),[B,F]=u.useState(()=>((e==null?void 0:e.getFullYear())??j.getFullYear())-6),H=u.useRef(null),k=u.useRef(null),D=u.useRef(null),U=x!==void 0,X=U?x:Y,fe=n??Ei(o),_e=u.useMemo(()=>vi(l,c),[l,c]),rt=u.useMemo(()=>Ri(l),[l]),Br=u.useMemo(()=>wi(R.getFullYear(),R.getMonth(),c),[R,c]),Me=u.useMemo(()=>Li(B+6,12),[B]),Et=u.useMemo(()=>e?wr(e,fe,l):null,[e,fe,l]),Yr=i??fe.replace(/2006|06|January|Jan|01|02/g,"__"),me=u.useCallback(()=>{var ve;if(!k.current)return;const v=k.current.getBoundingClientRect(),V=((ve=D.current)==null?void 0:ve.offsetHeight)??Wi,we=window.innerHeight-v.bottom-Ve,Fe=v.top-Ve,xe=we<V&&Fe>we?"top":"bottom";if(A(xe),S){const Be=xe==="bottom"?v.bottom+Ve:v.top-V-Ve;M({top:Be,left:v.left})}},[S]),Pt=u.useCallback(()=>{if(f)return;U||P(!0),C==null||C(),I(o==="year"?"years":o==="month"?"months":"days");const v=e??j;z(v),F(v.getFullYear()-6)},[f,U,C,o,e,j]),Z=u.useCallback(()=>{U||P(!1),$==null||$()},[U,$]),Vr=u.useCallback(()=>{X?Z():Pt()},[X,Z,Pt]),Hr=u.useCallback(v=>{const V=new Date(R.getFullYear(),R.getMonth(),v);r==null||r(V),Z()},[R,r,Z]),Gr=u.useCallback(v=>{if(o==="month"){const V=new Date(R.getFullYear(),v,1);r==null||r(V),Z()}else z(new Date(R.getFullYear(),v,1)),I("days")},[o,R,r,Z]),Wr=u.useCallback(v=>{if(o==="year"){const V=new Date(v,0,1);r==null||r(V),Z()}else o==="month"?(z(new Date(v,R.getMonth(),1)),I("months")):(z(new Date(v,R.getMonth(),1)),I("months"))},[o,R,r,Z]),Kr=u.useCallback(()=>{z(v=>new Date(v.getFullYear(),v.getMonth()-1,1))},[]),Ur=u.useCallback(()=>{z(v=>new Date(v.getFullYear(),v.getMonth()+1,1))},[]),Xr=u.useCallback(()=>{z(v=>new Date(v.getFullYear()-1,v.getMonth(),1))},[]),qr=u.useCallback(()=>{z(v=>new Date(v.getFullYear()+1,v.getMonth(),1))},[]),Zr=u.useCallback(()=>{F(v=>v-12)},[]),Jr=u.useCallback(()=>{F(v=>v+12)},[]),jt=u.useCallback(()=>{m==="days"?I("months"):m==="months"&&I("years")},[m]);u.useLayoutEffect(()=>{X&&me()},[X,me]),u.useEffect(()=>{const v=xe=>{const ve=xe.target,Be=H.current&&!H.current.contains(ve),io=D.current&&!D.current.contains(ve);S?Be&&io&&Z():Be&&Z()},V=xe=>{xe.key==="Escape"&&Z()},we=()=>{X&&S&&me()},Fe=()=>{X&&S&&me()};return X&&(document.addEventListener("mousedown",v),document.addEventListener("keydown",V),S&&(window.addEventListener("scroll",we,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",V),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Fe)}},[X,Z,S,me]);const Qr=Ze[b].iconSize,eo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:q("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:jt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(R)}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Kr,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{children:_e.map((v,V)=>a.jsx(_i,{children:v},V))}),a.jsx(Mi,{className:q("grid",g==null?void 0:g.grid),children:Br.map((v,V)=>v===null?a.jsx(Gi,{},V):a.jsx(Fi,{type:"button",className:q("cell",g==null?void 0:g.cell),$selected:e?Gt(e,new Date(R.getFullYear(),R.getMonth(),v)):!1,$today:Gt(j,new Date(R.getFullYear(),R.getMonth(),v)),$disabled:Kt(R.getFullYear(),R.getMonth(),v,d,p),disabled:Kt(R.getFullYear(),R.getMonth(),v,d,p),onClick:()=>Hr(v),children:v},V))})]}),to=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:q("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:jt,type:"button",children:R.getFullYear()}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Bi,{className:q("grid",g==null?void 0:g.grid),children:rt.map((v,V)=>a.jsx(Yi,{type:"button",className:q("cell",g==null?void 0:g.cell),$selected:e?Wt(e,new Date(R.getFullYear(),V,1)):!1,$current:Wt(j,new Date(R.getFullYear(),V,1)),$disabled:Ut(R.getFullYear(),V,d,p),disabled:Ut(R.getFullYear(),V,d,p),onClick:()=>Gr(V),children:v},V))})]}),ro=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:q("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:q("grid",g==null?void 0:g.grid),children:Me.map(v=>a.jsx(Hi,{type:"button",className:q("cell",g==null?void 0:g.cell),$selected:e?ki(e,new Date(v,0,1)):!1,$current:j.getFullYear()===v,$disabled:Xt(v,d,p),disabled:Xt(v,d,p),onClick:()=>Wr(v),children:v},v))})]}),zt=()=>{switch(m){case"days":return eo();case"months":return to();case"years":return ro()}},oo=S?ge.createPortal(a.jsx(Ai,{ref:D,$open:X,$position:E,className:q("calendar",g==null?void 0:g.calendar),style:{top:_.top,left:_.left},children:zt()}),S):a.jsx(Ii,{ref:D,$open:X,$position:E,className:q("calendar",g==null?void 0:g.calendar),children:zt()});return a.jsxs(Pi,{...N,ref:L??H,$fullWidth:O,className:q("container",y),children:[w&&a.jsx(ji,{children:w}),a.jsxs(zi,{ref:k,type:"button",onClick:Vr,disabled:f,$size:b,$variant:h,$disabled:f,$open:X,$hasValue:!!Et,className:q("trigger",g==null?void 0:g.trigger),children:[a.jsx(Ni,{children:Et??Yr}),a.jsx(Ti,{$open:X,children:a.jsx(a.ChevronDown,{size:Qr})})]}),oo]})},Ui={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Xi=(e,r)=>{switch(e){case"left":return`
748
+ `,Xi=s.div`
749
+ width: ${ie}px;
750
+ height: ${ie}px;
751
+ `,q=T.newClassNameGetter("date-picker"),Ve=4,qi=300,Zi=({value:e,onChange:r,mode:o="date",displayFormat:n,placeholder:i,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:u,size:h="default",variant:b="normal",disabled:f=!1,fullWidth:O=!1,label:m,portalRenderNode:S,open:x,onOpen:y,onClose:$,className:C,classnames:g,ref:k,...N})=>{const P=p.useMemo(()=>new Date,[]),[Y,j]=p.useState(!1),[_,M]=p.useState({top:0,left:0}),[E,A]=p.useState("bottom"),[w,I]=p.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[R,z]=p.useState(()=>e??P),[B,F]=p.useState(()=>((e==null?void 0:e.getFullYear())??P.getFullYear())-6),H=p.useRef(null),L=p.useRef(null),D=p.useRef(null),U=x!==void 0,X=U?x:Y,xe=n??Ni(o),_e=p.useMemo(()=>Ei(l,c),[l,c]),ot=p.useMemo(()=>ji(l),[l]),Gr=p.useMemo(()=>ki(R.getFullYear(),R.getMonth(),c),[R,c]),Me=p.useMemo(()=>zi(B+6,12),[B]),Pt=p.useMemo(()=>e?Lr(e,xe,l):null,[e,xe,l]),Wr=i??xe.replace(/2006|06|January|Jan|01|02/g,"__"),we=p.useCallback(()=>{var Re;if(!L.current)return;const v=L.current.getBoundingClientRect(),V=((Re=D.current)==null?void 0:Re.offsetHeight)??qi,ve=window.innerHeight-v.bottom-Ve,Fe=v.top-Ve,Oe=ve<V&&Fe>ve?"top":"bottom";if(A(Oe),S){const Be=Oe==="bottom"?v.bottom+Ve:v.top-V-Ve;M({top:Be,left:v.left})}},[S]),zt=p.useCallback(()=>{if(f)return;U||j(!0),y==null||y(),I(o==="year"?"years":o==="month"?"months":"days");const v=e??P;z(v),F(v.getFullYear()-6)},[f,U,y,o,e,P]),Z=p.useCallback(()=>{U||j(!1),$==null||$()},[U,$]),Kr=p.useCallback(()=>{X?Z():zt()},[X,Z,zt]),Ur=p.useCallback(v=>{const V=new Date(R.getFullYear(),R.getMonth(),v);r==null||r(V),Z()},[R,r,Z]),Xr=p.useCallback(v=>{if(o==="month"){const V=new Date(R.getFullYear(),v,1);r==null||r(V),Z()}else z(new Date(R.getFullYear(),v,1)),I("days")},[o,R,r,Z]),qr=p.useCallback(v=>{if(o==="year"){const V=new Date(v,0,1);r==null||r(V),Z()}else o==="month"?(z(new Date(v,R.getMonth(),1)),I("months")):(z(new Date(v,R.getMonth(),1)),I("months"))},[o,R,r,Z]),Zr=p.useCallback(()=>{z(v=>new Date(v.getFullYear(),v.getMonth()-1,1))},[]),Jr=p.useCallback(()=>{z(v=>new Date(v.getFullYear(),v.getMonth()+1,1))},[]),Qr=p.useCallback(()=>{z(v=>new Date(v.getFullYear()-1,v.getMonth(),1))},[]),eo=p.useCallback(()=>{z(v=>new Date(v.getFullYear()+1,v.getMonth(),1))},[]),to=p.useCallback(()=>{F(v=>v-12)},[]),ro=p.useCallback(()=>{F(v=>v+12)},[]),Nt=p.useCallback(()=>{w==="days"?I("months"):w==="months"&&I("years")},[w]);p.useLayoutEffect(()=>{X&&we()},[X,we]),p.useEffect(()=>{const v=Oe=>{const Re=Oe.target,Be=H.current&&!H.current.contains(Re),co=D.current&&!D.current.contains(Re);S?Be&&co&&Z():Be&&Z()},V=Oe=>{Oe.key==="Escape"&&Z()},ve=()=>{X&&S&&we()},Fe=()=>{X&&S&&we()};return X&&(document.addEventListener("mousedown",v),document.addEventListener("keydown",V),S&&(window.addEventListener("scroll",ve,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",V),window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",Fe)}},[X,Z,S,we]);const oo=Je[h].iconSize,io=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:q("header",g==null?void 0:g.header),children:[a.jsx(ct,{onClick:Nt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(R)}),a.jsxs(st,{children:[a.jsx(Se,{onClick:Zr,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Se,{onClick:Jr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Bi,{children:_e.map((v,V)=>a.jsx(Yi,{children:v},V))}),a.jsx(Vi,{className:q("grid",g==null?void 0:g.grid),children:Gr.map((v,V)=>v===null?a.jsx(Xi,{},V):a.jsx(Hi,{type:"button",className:q("cell",g==null?void 0:g.cell),$selected:e?Kt(e,new Date(R.getFullYear(),R.getMonth(),v)):!1,$today:Kt(P,new Date(R.getFullYear(),R.getMonth(),v)),$disabled:Xt(R.getFullYear(),R.getMonth(),v,d,u),disabled:Xt(R.getFullYear(),R.getMonth(),v,d,u),onClick:()=>Ur(v),children:v},V))})]}),no=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:q("header",g==null?void 0:g.header),children:[a.jsx(ct,{onClick:Nt,type:"button",children:R.getFullYear()}),a.jsxs(st,{children:[a.jsx(Se,{onClick:Qr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Se,{onClick:eo,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Gi,{className:q("grid",g==null?void 0:g.grid),children:ot.map((v,V)=>a.jsx(Wi,{type:"button",className:q("cell",g==null?void 0:g.cell),$selected:e?Ut(e,new Date(R.getFullYear(),V,1)):!1,$current:Ut(P,new Date(R.getFullYear(),V,1)),$disabled:qt(R.getFullYear(),V,d,u),disabled:qt(R.getFullYear(),V,d,u),onClick:()=>Xr(V),children:v},V))})]}),ao=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:q("header",g==null?void 0:g.header),children:[a.jsxs(ct,{type:"button",style:{cursor:"default"},children:[Me[0]," - ",Me[Me.length-1]]}),a.jsxs(st,{children:[a.jsx(Se,{onClick:to,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Se,{onClick:ro,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ki,{className:q("grid",g==null?void 0:g.grid),children:Me.map(v=>a.jsx(Ui,{type:"button",className:q("cell",g==null?void 0:g.cell),$selected:e?Pi(e,new Date(v,0,1)):!1,$current:P.getFullYear()===v,$disabled:Zt(v,d,u),disabled:Zt(v,d,u),onClick:()=>qr(v),children:v},v))})]}),Tt=()=>{switch(w){case"days":return io();case"months":return no();case"years":return ao()}},lo=S?fe.createPortal(a.jsx(Fi,{ref:D,$open:X,$position:E,className:q("calendar",g==null?void 0:g.calendar),style:{top:_.top,left:_.left},children:Tt()}),S):a.jsx(Mi,{ref:D,$open:X,$position:E,className:q("calendar",g==null?void 0:g.calendar),children:Tt()});return a.jsxs(Ti,{...N,ref:k??H,$fullWidth:O,className:q("container",C),children:[m&&a.jsx(Ii,{children:m}),a.jsxs(Ai,{ref:L,type:"button",onClick:Kr,disabled:f,$size:h,$variant:b,$disabled:f,$open:X,$hasValue:!!Pt,className:q("trigger",g==null?void 0:g.trigger),children:[a.jsx(Di,{children:Pt??Wr}),a.jsx(_i,{$open:X,children:a.jsx(a.ChevronDown,{size:oo})})]}),lo]})},Ji=s.div`
752
+ display: flex;
753
+ flex-direction: row;
754
+ align-items: center;
755
+ gap: 8px;
756
+ margin-top: ${e=>e.$spacing}px;
757
+ margin-bottom: ${e=>e.$spacing}px;
758
+ `,Jt=s.div`
759
+ flex: 1;
760
+ height: 1px;
761
+ background-color: ${t.COLORS.gray};
762
+ `,Qi=s.span`
763
+ font-size: 12px;
764
+ color: ${t.COLORS["iron-grey"]};
765
+ white-space: nowrap;
766
+ `,He=T.newClassNameGetter("divider"),en=({children:e,className:r,classnames:o,ref:n,spacing:i=8,...l})=>a.jsxs(Ji,{...l,ref:n,className:He("container",r),$spacing:i,children:[a.jsx(Jt,{className:He("line",o==null?void 0:o.line)}),e&&a.jsxs(a.Fragment,{children:[a.jsx(Qi,{className:He("label",o==null?void 0:o.label),children:e}),a.jsx(Jt,{className:He("line",o==null?void 0:o.line)})]})]}),tn={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},rn=(e,r)=>{switch(e){case"left":return`
752
767
  top: 0;
753
768
  left: 0;
754
769
  height: 100%;
@@ -768,19 +783,19 @@
768
783
  left: 0;
769
784
  width: 100%;
770
785
  height: ${r};
771
- `}},qi=s.div`
786
+ `}},on=s.div`
772
787
  position: fixed;
773
788
  z-index: 1001;
774
789
  background-color: ${t.COLORS.white};
775
790
  box-shadow: 0 4px 24px ${t.alpha(t.COLORS.black,20)};
776
- ${e=>Xi(e.$position,e.$size)}
777
- animation: ${e=>Ui[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
778
- `,Zi=T.newClassNameGetter("drawer"),Ji=({animated:e,children:r,className:o,open:n,position:i="right",ref:l,size:c="400px",...d})=>n?ge.createPortal(a.jsx(qi,{...d,ref:l,className:Zi("container",o),$animated:!!e,$position:i,$size:c,children:r}),document.body):null,Qi=s.div`
791
+ ${e=>rn(e.$position,e.$size)}
792
+ animation: ${e=>tn[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
793
+ `,nn=T.newClassNameGetter("drawer"),an=({animated:e,children:r,className:o,open:n,position:i="right",ref:l,size:c="400px",...d})=>n?fe.createPortal(a.jsx(on,{...d,ref:l,className:nn("container",o),$animated:!!e,$position:i,$size:c,children:r}),document.body):null,ln=s.div`
779
794
  position: relative;
780
795
  display: inline-block;
781
- `,en=s.div`
796
+ `,dn=s.div`
782
797
  cursor: pointer;
783
- `,kr=`
798
+ `,jr=`
784
799
  z-index: 100;
785
800
  min-width: 160px;
786
801
  padding: 8px;
@@ -788,33 +803,33 @@
788
803
  border: 1px solid ${t.COLORS.gray};
789
804
  border-radius: 8px;
790
805
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
791
- `,Lr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",tn=s.div`
806
+ `,Pr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",cn=s.div`
792
807
  position: absolute;
793
808
  ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
794
809
  ${({$align:e})=>e==="left"?"left: 0;":"right: 0;"}
795
- ${kr}
810
+ ${jr}
796
811
  opacity: ${({$open:e})=>e?1:0};
797
812
  visibility: ${({$open:e})=>e?"visible":"hidden"};
798
- transform: ${({$open:e,$position:r})=>Lr(e,r)};
813
+ transform: ${({$open:e,$position:r})=>Pr(e,r)};
799
814
  transition:
800
815
  opacity 0.15s ease,
801
816
  transform 0.15s ease,
802
817
  visibility 0.15s;
803
- `,rn=s.div`
818
+ `,sn=s.div`
804
819
  position: fixed;
805
- ${kr}
820
+ ${jr}
806
821
  opacity: ${({$open:e})=>e?1:0};
807
822
  visibility: ${({$open:e})=>e?"visible":"hidden"};
808
- transform: ${({$open:e,$position:r})=>Lr(e,r)};
823
+ transform: ${({$open:e,$position:r})=>Pr(e,r)};
809
824
  transition:
810
825
  opacity 0.15s ease,
811
826
  transform 0.15s ease,
812
827
  visibility 0.15s;
813
- `,He=T.newClassNameGetter("dropdown"),Ge=4,on=100,nn=({align:e="left",autoClose:r=!0,children:o,className:n,classnames:i,onClose:l,onOpen:c,open:d,portalRenderNode:p,ref:b,trigger:h,...f})=>{const[O,w]=u.useState(!1),[S,x]=u.useState({top:0,left:0}),[C,$]=u.useState("bottom"),y=u.useRef(null),g=u.useRef(null),L=u.useRef(null),N=d!==void 0,j=N?d:O,Y=u.useCallback(()=>{var F,H;if(!g.current)return;const A=g.current.getBoundingClientRect(),m=((F=L.current)==null?void 0:F.offsetHeight)??on,I=((H=L.current)==null?void 0:H.offsetWidth)??160,R=window.innerHeight-A.bottom-Ge,z=A.top-Ge,B=R<m&&z>R?"top":"bottom";if($(B),p){let k;e==="left"?k=A.left:k=A.right-I;const D=B==="bottom"?A.bottom+Ge:A.top-m-Ge;x({top:D,left:k})}},[e,p]),P=u.useCallback(()=>{N?j?l==null||l():c==null||c():w(A=>{const m=!A;return m?c==null||c():l==null||l(),m})},[N,j,l,c]),_=u.useCallback(()=>{N||w(!1),l==null||l()},[N,l]),M=u.useCallback(()=>{r&&_()},[r,_]);u.useLayoutEffect(()=>{j&&Y()},[j,Y]),u.useEffect(()=>{const A=z=>{const B=z.target,F=y.current&&!y.current.contains(B),H=L.current&&!L.current.contains(B);p?F&&H&&_():F&&_()},m=z=>{z.key==="Escape"&&_()},I=()=>{j&&p&&Y()},R=()=>{j&&p&&Y()};return j&&(document.addEventListener("mousedown",A),document.addEventListener("keydown",m),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",R))),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",m),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",R)}},[j,_,p,Y]);const E=p?ge.createPortal(a.jsx(rn,{ref:L,$open:j,$position:C,className:He("content",i==null?void 0:i.content),style:{top:S.top,left:S.left},onClick:M,children:o}),p):a.jsx(tn,{ref:L,$align:e,$open:j,$position:C,className:He("content",i==null?void 0:i.content),onClick:M,children:o});return a.jsxs(Qi,{...f,ref:b??y,className:He("container",n),children:[a.jsx(en,{ref:g,onClick:P,className:He("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),E]})},an=s.div`
828
+ `,Ge=T.newClassNameGetter("dropdown"),We=4,pn=100,un=({align:e="left",autoClose:r=!0,children:o,className:n,classnames:i,onClose:l,onOpen:c,open:d,portalRenderNode:u,ref:h,trigger:b,...f})=>{const[O,m]=p.useState(!1),[S,x]=p.useState({top:0,left:0}),[y,$]=p.useState("bottom"),C=p.useRef(null),g=p.useRef(null),k=p.useRef(null),N=d!==void 0,P=N?d:O,Y=p.useCallback(()=>{var F,H;if(!g.current)return;const A=g.current.getBoundingClientRect(),w=((F=k.current)==null?void 0:F.offsetHeight)??pn,I=((H=k.current)==null?void 0:H.offsetWidth)??160,R=window.innerHeight-A.bottom-We,z=A.top-We,B=R<w&&z>R?"top":"bottom";if($(B),u){let L;e==="left"?L=A.left:L=A.right-I;const D=B==="bottom"?A.bottom+We:A.top-w-We;x({top:D,left:L})}},[e,u]),j=p.useCallback(()=>{N?P?l==null||l():c==null||c():m(A=>{const w=!A;return w?c==null||c():l==null||l(),w})},[N,P,l,c]),_=p.useCallback(()=>{N||m(!1),l==null||l()},[N,l]),M=p.useCallback(()=>{r&&_()},[r,_]);p.useLayoutEffect(()=>{P&&Y()},[P,Y]),p.useEffect(()=>{const A=z=>{const B=z.target,F=C.current&&!C.current.contains(B),H=k.current&&!k.current.contains(B);u?F&&H&&_():F&&_()},w=z=>{z.key==="Escape"&&_()},I=()=>{P&&u&&Y()},R=()=>{P&&u&&Y()};return P&&(document.addEventListener("mousedown",A),document.addEventListener("keydown",w),u&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",R))),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",w),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",R)}},[P,_,u,Y]);const E=u?fe.createPortal(a.jsx(sn,{ref:k,$open:P,$position:y,className:Ge("content",i==null?void 0:i.content),style:{top:S.top,left:S.left},onClick:M,children:o}),u):a.jsx(cn,{ref:k,$align:e,$open:P,$position:y,className:Ge("content",i==null?void 0:i.content),onClick:M,children:o});return a.jsxs(ln,{...f,ref:h??C,className:Ge("container",n),children:[a.jsx(dn,{ref:g,onClick:j,className:Ge("trigger",i==null?void 0:i.trigger),children:p.cloneElement(b)}),E]})},hn=s.div`
814
829
  display: inline-flex;
815
830
  align-items: center;
816
831
  gap: 8px;
817
- `,ln=s.span`
832
+ `,bn=s.span`
818
833
  font-size: 14px;
819
834
  line-height: 1.4;
820
835
  color: ${({$isEmpty:e})=>e?t.COLORS["iron-grey"]:t.COLORS.black};
@@ -824,7 +839,7 @@
824
839
  &[contenteditable='true'] {
825
840
  cursor: text;
826
841
  }
827
- `,dn=s.button`
842
+ `,gn=s.button`
828
843
  display: inline-flex;
829
844
  align-items: center;
830
845
  justify-content: center;
@@ -841,17 +856,17 @@
841
856
  &:hover {
842
857
  opacity: ${({$disabled:e})=>e?.5:1};
843
858
  }
844
- `,cn=({value:e,onChange:r,disabled:o=!1,placeholder:n,className:i,classnames:l,"data-test-id":c})=>{const[d,p]=u.useState(!1),b=u.useRef(null),h=u.useRef(null),f=u.useCallback(()=>{var x;p(!1);const S=((x=h.current)==null?void 0:x.textContent)||"";S!==e&&r(S)},[r,e]);u.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]),u.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=()=>{o||p(!0)},w=S=>{S.key==="Enter"&&S.metaKey?(S.preventDefault(),f()):S.key==="Escape"&&(h.current&&(h.current.textContent=e),p(!1))};return a.jsxs(an,{ref:b,className:i,"data-test-id":c,children:[a.jsx(ln,{ref:h,className:l==null?void 0:l.text,contentEditable:d,suppressContentEditableWarning:!0,onKeyDown:w,$isEmpty:!e,children:e||n}),a.jsx(dn,{type:"button",className:l==null?void 0:l.button,$disabled:o&&!d,onClick:d?f:O,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`
859
+ `,fn=({value:e,onChange:r,disabled:o=!1,placeholder:n,className:i,classnames:l,"data-test-id":c})=>{const[d,u]=p.useState(!1),h=p.useRef(null),b=p.useRef(null),f=p.useCallback(()=>{var x;u(!1);const S=((x=b.current)==null?void 0:x.textContent)||"";S!==e&&r(S)},[r,e]);p.useEffect(()=>{if(d&&b.current){b.current.focus();const S=document.createRange(),x=window.getSelection();S.selectNodeContents(b.current),S.collapse(!1),x==null||x.removeAllRanges(),x==null||x.addRange(S)}},[d]),p.useEffect(()=>{if(!d)return;const S=x=>{h.current&&!h.current.contains(x.target)&&f()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[d,f]);const O=()=>{o||u(!0)},m=S=>{S.key==="Enter"&&S.metaKey?(S.preventDefault(),f()):S.key==="Escape"&&(b.current&&(b.current.textContent=e),u(!1))};return a.jsxs(hn,{ref:h,className:i,"data-test-id":c,children:[a.jsx(bn,{ref:b,className:l==null?void 0:l.text,contentEditable:d,suppressContentEditableWarning:!0,onKeyDown:m,$isEmpty:!e,children:e||n}),a.jsx(gn,{type:"button",className:l==null?void 0:l.button,$disabled:o&&!d,onClick:d?f:O,disabled:o&&!d,"aria-label":d?"Save":"Edit",children:d?a.jsx(a.Check,{size:16}):a.jsx(a.Pencil,{size:14})})]})},xn={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},On=s.span`
845
860
  display: block;
846
861
  font-size: 12px;
847
862
  font-weight: 500;
848
863
  line-height: 1.4;
849
- color: ${e=>sn[e.$variant]};
850
- `,un=T.newClassNameGetter("field-message"),hn=({children:e,className:r,ref:o,variant:n="normal",...i})=>e?a.jsx(pn,{...i,ref:o,className:un("container",r),$variant:n,children:e}):null,bn=s.div`
864
+ color: ${e=>xn[e.$variant]};
865
+ `,Sn=T.newClassNameGetter("field-message"),$n=({children:e,className:r,ref:o,variant:n="normal",...i})=>e?a.jsx(On,{...i,ref:o,className:Sn("container",r),$variant:n,children:e}):null,yn=s.div`
851
866
  display: flex;
852
867
  flex-direction: column;
853
868
  gap: 12px;
854
- `,gn=s.div`
869
+ `,Cn=s.div`
855
870
  width: ${({$size:e})=>e}px;
856
871
  height: ${({$size:e})=>e}px;
857
872
  border-radius: 8px;
@@ -867,10 +882,10 @@
867
882
  height: 100%;
868
883
  object-fit: cover;
869
884
  }
870
- `,fn=s.span`
885
+ `,mn=s.span`
871
886
  font-size: 12px;
872
887
  color: ${t.COLORS["iron-grey"]};
873
- `,xn=e=>`
888
+ `,wn=e=>`
874
889
  .${e} {
875
890
  padding: 7px 16px;
876
891
  font-size: 14px;
@@ -888,7 +903,7 @@
888
903
  .${e}:active {
889
904
  transform: translate(0, 1px);
890
905
  }
891
- `,On=e=>`
906
+ `,vn=e=>`
892
907
  .${e} {
893
908
  display: flex;
894
909
  flex: 1 1 auto;
@@ -912,7 +927,7 @@
912
927
  max-height: 70vh;
913
928
  }
914
929
  }
915
- `,Sn=e=>`
930
+ `,Rn=e=>`
916
931
  .${e} {
917
932
  padding: 7px 16px;
918
933
  font-size: 14px;
@@ -930,7 +945,7 @@
930
945
  .${e}:active {
931
946
  transform: translate(0, 1px);
932
947
  }
933
- `,$n=e=>`
948
+ `,Ln=e=>`
934
949
  .${e} {
935
950
  display: flex;
936
951
  flex-direction: column;
@@ -948,7 +963,7 @@
948
963
  border-radius: 8px;
949
964
  }
950
965
  }
951
- `,yn=e=>`
966
+ `,kn=e=>`
952
967
  .${e} {
953
968
  display: flex;
954
969
  justify-content: flex-end;
@@ -967,7 +982,7 @@
967
982
  gap: 8px;
968
983
  }
969
984
  }
970
- `,Cn=e=>`
985
+ `,En=e=>`
971
986
  .${e} {
972
987
  display: flex;
973
988
  justify-content: flex-start;
@@ -989,7 +1004,7 @@
989
1004
  font-size: 14px;
990
1005
  }
991
1006
  }
992
- `,mn=e=>`
1007
+ `,jn=e=>`
993
1008
  .${e} {
994
1009
  display: block;
995
1010
  z-index: 101;
@@ -1007,27 +1022,27 @@
1007
1022
  position: absolute;
1008
1023
  touch-action: none;
1009
1024
  }
1010
- `,wn=e=>`
1025
+ `,Pn=e=>`
1011
1026
  .${e} {
1012
1027
  position: absolute;
1013
1028
  z-index: 2;
1014
1029
  background-color: rgba(0, 0, 0, 0.6);
1015
1030
  touch-action: none;
1016
1031
  }
1017
- `,vn=e=>`
1032
+ `,zn=e=>`
1018
1033
  .${e} {
1019
1034
  position: absolute;
1020
1035
  z-index: 3;
1021
1036
  touch-action: none;
1022
1037
  }
1023
- `,Rn=e=>`
1038
+ `,Nn=e=>`
1024
1039
  .${e} {
1025
1040
  backface-visibility: hidden;
1026
1041
  perspective: 1000px;
1027
1042
  max-inline-size: unset !important;
1028
1043
  max-block-size: unset !important;
1029
1044
  }
1030
- `,kn=e=>`
1045
+ `,Tn=e=>`
1031
1046
  .${e} {
1032
1047
  position: absolute;
1033
1048
  z-index: 100;
@@ -1038,7 +1053,7 @@
1038
1053
  overflow: hidden;
1039
1054
  border-radius: 50%;
1040
1055
  }
1041
- `,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:n,v:i}=En[r];return`
1056
+ `,In={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},An={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},Ke=(e,r)=>{const o=In[r],{h:n,v:i}=An[r];return`
1042
1057
  .${e} {
1043
1058
  display: block;
1044
1059
  z-index: 102;
@@ -1064,7 +1079,7 @@
1064
1079
  ${i}: -12px;
1065
1080
  }
1066
1081
  }
1067
- `},Pn=e=>`
1082
+ `},Dn=e=>`
1068
1083
  .${e} {
1069
1084
  display: flex;
1070
1085
  align-items: center;
@@ -1090,7 +1105,7 @@
1090
1105
  padding-bottom: env(safe-area-inset-bottom, 8px);
1091
1106
  }
1092
1107
  }
1093
- `,jn=e=>`
1108
+ `,_n=e=>`
1094
1109
  .${e} {
1095
1110
  backface-visibility: hidden;
1096
1111
  user-select: none;
@@ -1103,25 +1118,25 @@
1103
1118
  position: absolute;
1104
1119
  z-index: 1;
1105
1120
  }
1106
- `,zn=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__${zn(e)}`,W=e=>e||[],K=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Nn=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=`
1107
- ${xn(r.applyButton[0])}
1108
- ${On(r.body[0])}
1109
- ${Sn(r.cancelButton[0])}
1110
- ${$n(r.container[0])}
1111
- ${yn(r.footer[0])}
1112
- ${Cn(r.header[0])}
1113
- ${mn(r.handlerMove[0])}
1114
- ${wn(r.portalArea[0])}
1115
- ${vn(r.portal[0])}
1116
- ${Rn(r.previewImage[0])}
1117
- ${kn(r.preview[0])}
1118
- ${We(r.handlerResizeBottomLeft[0],"bl")}
1119
- ${We(r.handlerResizeBottomRight[0],"br")}
1120
- ${We(r.handlerResizeTopLeft[0],"tl")}
1121
- ${We(r.handlerResizeTopRight[0],"tr")}
1122
- ${Pn(r.root[0])}
1123
- ${jn(r.sourceImage[0])}
1124
- `,n=document.createElement("style");return n.innerHTML=o,document.getElementsByTagName("head")[0].prepend(n),r};let Tn=0;const In=e=>{const r=new Map,o=new Proxy({...e},{set(n,i,l){return Reflect.set(n,i,l),(r.get(i)||[]).forEach(c=>c.action(l,n,i)),!0}});return{getState:()=>({...o}),setState:n=>{for(const i of Object.keys(n)){const l=n[i];l!==void 0&&(o[i]=l)}},subscribe:(n,i)=>{const l=String(++Tn),c=r.get(n)||[];return r.set(n,[...c,{action:i,id:l}]),l},unsubscribe:n=>{for(const[i,l]of r.entries()){const c=l.filter(d=>d.id!==n);if(c.length!==l.length){r.set(i,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"]}},An=(e={},r={})=>In({...wt,config:{...wt.config,...e},css:Nn(r)}),Dn=(e,r)=>{var O;const o=e(),n=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!n)return o.frame;const{width:i,height:l}=n.getBoundingClientRect(),c=i/l,d=r.width/r.height;let p,b,h=0,f=0;return c>d?(p=l*d,b=l,f=(i-p)/2):(p=i,b=i*(r.height/r.width),h=(l-b)/2),{width:p,height:b,left:f,top:h}},_n=(e,r,o)=>{const[n,i]=r,l=n+e>o.width?(o.width-e)/2:n,c=i+e>o.height?(o.height-e)/2:i;return[l,c]},Mn=(e,r)=>{const{config:o}=e(),n=Math.min(r.width,r.height)-o.framePadding*2,i=o.portalSize>n?n:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=_n(i,o.portalPosition,r);return{left:l,top:c,size:i}}return o.portalPosition==="center"?{size:i,left:(r.width-i)/2,top:(r.height-i)/2}:{left:0,top:0,size:i}};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 n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerMove),o.setAttribute("data-action",te.MOVE),o},Bn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},Yn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},Vn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Hn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Gn=e=>{var n;const r=e(),o=document.createElement("img");return K(o,(n=r.css)==null?void 0:n.previewImage),o},Wn=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.preview),o.appendChild(Gn(e)),o},Kn=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.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},Un=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.portalArea),o.appendChild(Kn(e)),o},Xn=e=>{var n;const r=e(),o=document.createElement("img");return K(o,(n=r.css)==null?void 0:n.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},qn=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.body),o.appendChild(Xn(e)),o.appendChild(Un(e)),o},Zn=(e,r)=>{var i;const o=e(),n=document.createElement("div");return K(n,(i=o.css)==null?void 0:i.applyButton),n.setAttribute("role","button"),n.innerText=o.config.applyButtonLabel,n.addEventListener("click",r),n},Jn=(e,r)=>{var i;const o=e(),n=document.createElement("div");return K(n,(i=o.css)==null?void 0:i.cancelButton),n.setAttribute("role","button"),n.innerText=o.config.cancelButtonLabel,n.addEventListener("click",r),n},Qn=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");return K(i,(l=n.css)==null?void 0:l.footer),i.appendChild(Jn(e,o)),i.appendChild(Zn(e,r)),i},ea=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.header),o},ta=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");return K(i,(l=n.css)==null?void 0:l.container),i.appendChild(ea(e)),i.appendChild(qn(e)),i.appendChild(Qn(e,r,o)),i},ra=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");K(i,(l=n.css)==null?void 0:l.root),i.appendChild(ta(e,r,o)),document.body.appendChild(i)},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]],n=document.querySelector(`.${o[0]}`);return Ie.set(e,n),n},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 n=pe("portalArea",r.css);n&&(n.style.height=`${r.frame.height}px`,n.style.width=`${r.frame.width}px`,n.style.left=`${r.frame.left}px`,n.style.top=`${r.frame.top}px`);const i=pe("portal",r.css);i&&(i.style.width=`${r.portal.size}px`,i.style.height=`${r.portal.size}px`,i.style.left=`${r.portal.left}px`,i.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 n=pe("previewImage",r.css);n&&(n.style.marginLeft=`-${e.left}px`,n.style.marginTop=`-${e.top}px`)},st=1,sa=e=>{var w,S;const r=e(),o=document.createElement("canvas"),n=r.frame.width||st,i=r.frame.height||st,l=r.sourceWidth/n,c=r.sourceHeight/i,d=r.portal.left*l,p=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(`.${(w=r.css)==null?void 0:w.sourceImage[0]}`);f&&((S=o.getContext("2d"))==null||S.drawImage(f,d,p,b,b,0,0,h,h));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((x,C)=>{try{o.toBlob($=>{if(o.remove(),!$){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.remove(),C($)}})},pa=(e,r,o)=>{const{emitted:n,portal:i,frame:l,config:c}=r();let d=n.left-n.X+e.clientX,p=n.top-n.Y+e.clientY;const b=c.framePadding,h=l.width-c.framePadding-i.size,f=c.framePadding,O=l.height-c.framePadding-i.size;d<b&&(d=b),d>h&&(d=h),p<f&&(p=f),p>O&&(p=O),o({portal:{...i,left:d,top:p}})},ua=(e,r,o)=>{const{action:n,emitted:i,portal:l,frame:c,config:d}=r(),p=e.pageX-i.X,b=e.pageY-i.Y;switch(n){case te.RESIZE_BR:{let h=i.size+Math.max(p,b);return h<d.minPortalSize&&(h=d.minPortalSize),i.top+h>c.height-d.framePadding&&(h=c.height-i.top-d.framePadding),i.left+h>c.width-d.framePadding&&(h=c.width-i.left-d.framePadding),o({portal:{...l,size:h}})}case te.RESIZE_TR:{let h=p+b>0?i.size+p:i.size-b,f=p+b>0?i.top-p:i.top+b;return h<d.minPortalSize&&(f=i.top+i.size-d.minPortalSize,h=d.minPortalSize),i.left+h>c.width-d.framePadding&&(h=c.width-i.left-d.framePadding,f=i.top-c.width+i.left+i.size),f<d.framePadding&&(h=i.top+i.size,f=d.framePadding),o({portal:{...l,top:f,size:h}})}case te.RESIZE_TL:{const h=Math.min(p,b);let f=i.size-h,O=i.left+h,w=i.top+h;if(f<d.minPortalSize){const S=i.size-d.minPortalSize;f=d.minPortalSize,O=i.left+S,w=i.top+S}if(w<d.framePadding){const S=d.framePadding-w;w=d.framePadding,O=O+S,f=f-S}if(O<d.framePadding){const S=d.framePadding-O;O=d.framePadding,w=w+S,f=f-S}return o({portal:{...l,top:w,left:O,size:f}})}case te.RESIZE_BL:{let h=p+b>0?i.size+b:i.size-p,f=p+b>0?i.left-b:i.left+p;return h<d.minPortalSize&&(f=i.left+i.size-d.minPortalSize,h=d.minPortalSize),h+i.top>c.height-d.framePadding&&(f=i.left-c.height+i.top+i.size,h=c.height-i.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,h=i.left+i.size-d.framePadding),o({portal:{...l,left:f,size:h}})}default:return}},qt=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 O,w,S;const o=e(),n=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),i=document.querySelector(`.${(w=o.css)==null?void 0:w.portalArea[0]}`),l=document.querySelector(`.${(S=o.css)==null?void 0:S.root[0]}`);let c=null,d=null;const p=x=>{x.preventDefault();const{portal:C}=e(),$=qt(x);if(x.target){const y=x.target.getAttribute("data-action"),g={X:$.pageX,Y:$.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=qt(x),c===null&&(c=requestAnimationFrame(h)))};return l&&(l.addEventListener("mouseup",b),l.addEventListener("touchend",b),l.addEventListener("touchcancel",b)),n&&(n.addEventListener("mousedown",p),n.addEventListener("touchstart",p,{passive:!1})),i&&(i.addEventListener("mousemove",f),i.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",b),l.removeEventListener("touchend",b),l.removeEventListener("touchcancel",b)),n&&(n.removeEventListener("mousedown",p),n.removeEventListener("touchstart",p)),i&&(i.removeEventListener("mousemove",f),i.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,n,i,l,c)=>{const d=$=>{c?c($):console.error(`HqCropper: ${$}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:b}=r(),h=ba(p,b);if(h){d(h),e.target.value="";return}const f=new FileReader;let O=null;const w=()=>{var g;const $=r(),y=document.querySelector(`.${(g=$.css)==null?void 0:g.root[0]}`);y&&(y.remove(),document.removeEventListener("keydown",S),O==null||O(),aa(),l(),o(wt))},S=$=>{$.key==="Escape"&&r().sourceBase64&&x($)},x=$=>{$.preventDefault(),w()},C=$=>{$.preventDefault();const y=r();sa(r).then(([g,L])=>{n(g,L,y),x($)}).catch(g=>{d(g instanceof Error?g.message:"Failed to crop image")})};f.onload=$=>{const y=new Image;if(!$.target||typeof $.target.result!="string"){d("Can't load result image");return}y.src=$.target.result,y.onerror=()=>{d("Failed to load image")},y.onload=()=>{var N;ra(r,C,x),na(),i("fileName",la),i("sourceBase64",da),i("portal",ca);const g=Dn(r,y),L=Mn(r,g);o({frame:g,portal:L,fileName:p.name,sourceBase64:(N=$.target)==null?void 0:N.result,sourceHeight:y.height,sourceWidth:y.width}),O=ha(r,o),document.addEventListener("keydown",S)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},fa=(e,r,o,n)=>{const{getState:i,setState:l,subscribe:c,unsubscribeAll:d}=An(r,o),p=oa(b=>ga(b,i,l,e,c,d,n));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"},Jt="vacano-image-cropper-styles",xa=`
1121
+ `,Mn=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__${Mn(e)}`,W=e=>e||[],K=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Fn=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=`
1122
+ ${wn(r.applyButton[0])}
1123
+ ${vn(r.body[0])}
1124
+ ${Rn(r.cancelButton[0])}
1125
+ ${Ln(r.container[0])}
1126
+ ${kn(r.footer[0])}
1127
+ ${En(r.header[0])}
1128
+ ${jn(r.handlerMove[0])}
1129
+ ${Pn(r.portalArea[0])}
1130
+ ${zn(r.portal[0])}
1131
+ ${Nn(r.previewImage[0])}
1132
+ ${Tn(r.preview[0])}
1133
+ ${Ke(r.handlerResizeBottomLeft[0],"bl")}
1134
+ ${Ke(r.handlerResizeBottomRight[0],"br")}
1135
+ ${Ke(r.handlerResizeTopLeft[0],"tl")}
1136
+ ${Ke(r.handlerResizeTopRight[0],"tr")}
1137
+ ${Dn(r.root[0])}
1138
+ ${_n(r.sourceImage[0])}
1139
+ `,n=document.createElement("style");return n.innerHTML=o,document.getElementsByTagName("head")[0].prepend(n),r};let Bn=0;const Yn=e=>{const r=new Map,o=new Proxy({...e},{set(n,i,l){return Reflect.set(n,i,l),(r.get(i)||[]).forEach(c=>c.action(l,n,i)),!0}});return{getState:()=>({...o}),setState:n=>{for(const i of Object.keys(n)){const l=n[i];l!==void 0&&(o[i]=l)}},subscribe:(n,i)=>{const l=String(++Bn),c=r.get(n)||[];return r.set(n,[...c,{action:i,id:l}]),l},unsubscribe:n=>{for(const[i,l]of r.entries()){const c=l.filter(d=>d.id!==n);if(c.length!==l.length){r.set(i,c);return}}},unsubscribeAll:()=>{r.clear()}}},Rt={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"]}},Vn=(e={},r={})=>Yn({...Rt,config:{...Rt.config,...e},css:Fn(r)}),Hn=(e,r)=>{var O;const o=e(),n=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!n)return o.frame;const{width:i,height:l}=n.getBoundingClientRect(),c=i/l,d=r.width/r.height;let u,h,b=0,f=0;return c>d?(u=l*d,h=l,f=(i-u)/2):(u=i,h=i*(r.height/r.width),b=(l-h)/2),{width:u,height:h,left:f,top:b}},Gn=(e,r,o)=>{const[n,i]=r,l=n+e>o.width?(o.width-e)/2:n,c=i+e>o.height?(o.height-e)/2:i;return[l,c]},Wn=(e,r)=>{const{config:o}=e(),n=Math.min(r.width,r.height)-o.framePadding*2,i=o.portalSize>n?n:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=Gn(i,o.portalPosition,r);return{left:l,top:c,size:i}}return o.portalPosition==="center"?{size:i,left:(r.width-i)/2,top:(r.height-i)/2}:{left:0,top:0,size:i}};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 Kn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerMove),o.setAttribute("data-action",te.MOVE),o},Un=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},Xn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},qn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Zn=e=>{var n;const r=e(),o=document.createElement("span");return K(o,(n=r.css)==null?void 0:n.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Jn=e=>{var n;const r=e(),o=document.createElement("img");return K(o,(n=r.css)==null?void 0:n.previewImage),o},Qn=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.preview),o.appendChild(Jn(e)),o},ea=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.portal),o.appendChild(Qn(e)),o.appendChild(Kn(e)),o.appendChild(qn(e)),o.appendChild(Zn(e)),o.appendChild(Un(e)),o.appendChild(Xn(e)),o},ta=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.portalArea),o.appendChild(ea(e)),o},ra=e=>{var n;const r=e(),o=document.createElement("img");return K(o,(n=r.css)==null?void 0:n.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},oa=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.body),o.appendChild(ra(e)),o.appendChild(ta(e)),o},ia=(e,r)=>{var i;const o=e(),n=document.createElement("div");return K(n,(i=o.css)==null?void 0:i.applyButton),n.setAttribute("role","button"),n.innerText=o.config.applyButtonLabel,n.addEventListener("click",r),n},na=(e,r)=>{var i;const o=e(),n=document.createElement("div");return K(n,(i=o.css)==null?void 0:i.cancelButton),n.setAttribute("role","button"),n.innerText=o.config.cancelButtonLabel,n.addEventListener("click",r),n},aa=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");return K(i,(l=n.css)==null?void 0:l.footer),i.appendChild(na(e,o)),i.appendChild(ia(e,r)),i},la=e=>{var n;const r=e(),o=document.createElement("div");return K(o,(n=r.css)==null?void 0:n.header),o},da=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");return K(i,(l=n.css)==null?void 0:l.container),i.appendChild(la(e)),i.appendChild(oa(e)),i.appendChild(aa(e,r,o)),i},ca=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");K(i,(l=n.css)==null?void 0:l.root),i.appendChild(da(e,r,o)),document.body.appendChild(i)},sa=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,pa={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},ue=(e,r)=>{if(Ae.has(e))return Ae.get(e);if(!r)return null;const o=r[pa[e]],n=document.querySelector(`.${o[0]}`);return Ae.set(e,n),n},ua=()=>{Ae.clear()},ha=()=>{Ae.clear()},ba=(e,r)=>{const o=ue("header",r.css);o&&(o.innerText=e)},ga=(e,r)=>{const o=ue("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 n=ue("portalArea",r.css);n&&(n.style.height=`${r.frame.height}px`,n.style.width=`${r.frame.width}px`,n.style.left=`${r.frame.left}px`,n.style.top=`${r.frame.top}px`);const i=ue("portal",r.css);i&&(i.style.width=`${r.portal.size}px`,i.style.height=`${r.portal.size}px`,i.style.left=`${r.portal.left}px`,i.style.top=`${r.portal.top}px`);const l=ue("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`)},fa=(e,r)=>{const o=ue("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 n=ue("previewImage",r.css);n&&(n.style.marginLeft=`-${e.left}px`,n.style.marginTop=`-${e.top}px`)},pt=1,xa=e=>{var m,S;const r=e(),o=document.createElement("canvas"),n=r.frame.width||pt,i=r.frame.height||pt,l=r.sourceWidth/n,c=r.sourceHeight/i,d=r.portal.left*l,u=r.portal.top*c,h=Math.max(r.portal.size*Math.min(l,c),pt),b=r.config.outputSize>0?r.config.outputSize:h;o.width=b,o.height=b;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((S=o.getContext("2d"))==null||S.drawImage(f,d,u,h,h,0,0,b,b));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((x,y)=>{try{o.toBlob($=>{if(o.remove(),!$){y(new Error(`Failed to create blob for type: image/${r.config.type}`));return}x([O,$])},`image/${r.config.type}`,r.config.compression)}catch($){o.remove(),y($)}})},Oa=(e,r,o)=>{const{emitted:n,portal:i,frame:l,config:c}=r();let d=n.left-n.X+e.clientX,u=n.top-n.Y+e.clientY;const h=c.framePadding,b=l.width-c.framePadding-i.size,f=c.framePadding,O=l.height-c.framePadding-i.size;d<h&&(d=h),d>b&&(d=b),u<f&&(u=f),u>O&&(u=O),o({portal:{...i,left:d,top:u}})},Sa=(e,r,o)=>{const{action:n,emitted:i,portal:l,frame:c,config:d}=r(),u=e.pageX-i.X,h=e.pageY-i.Y;switch(n){case te.RESIZE_BR:{let b=i.size+Math.max(u,h);return b<d.minPortalSize&&(b=d.minPortalSize),i.top+b>c.height-d.framePadding&&(b=c.height-i.top-d.framePadding),i.left+b>c.width-d.framePadding&&(b=c.width-i.left-d.framePadding),o({portal:{...l,size:b}})}case te.RESIZE_TR:{let b=u+h>0?i.size+u:i.size-h,f=u+h>0?i.top-u:i.top+h;return b<d.minPortalSize&&(f=i.top+i.size-d.minPortalSize,b=d.minPortalSize),i.left+b>c.width-d.framePadding&&(b=c.width-i.left-d.framePadding,f=i.top-c.width+i.left+i.size),f<d.framePadding&&(b=i.top+i.size,f=d.framePadding),o({portal:{...l,top:f,size:b}})}case te.RESIZE_TL:{const b=Math.min(u,h);let f=i.size-b,O=i.left+b,m=i.top+b;if(f<d.minPortalSize){const S=i.size-d.minPortalSize;f=d.minPortalSize,O=i.left+S,m=i.top+S}if(m<d.framePadding){const S=d.framePadding-m;m=d.framePadding,O=O+S,f=f-S}if(O<d.framePadding){const S=d.framePadding-O;O=d.framePadding,m=m+S,f=f-S}return o({portal:{...l,top:m,left:O,size:f}})}case te.RESIZE_BL:{let b=u+h>0?i.size+h:i.size-u,f=u+h>0?i.left-h:i.left+u;return b<d.minPortalSize&&(f=i.left+i.size-d.minPortalSize,b=d.minPortalSize),b+i.top>c.height-d.framePadding&&(f=i.left-c.height+i.top+i.size,b=c.height-i.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,b=i.left+i.size-d.framePadding),o({portal:{...l,left:f,size:b}})}default:return}},Qt=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}},$a=(e,r)=>{var O,m,S;const o=e(),n=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),i=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:y}=e(),$=Qt(x);if(x.target){const C=x.target.getAttribute("data-action"),g={X:$.pageX,Y:$.pageY,left:y.left,top:y.top,size:y.size};r({action:C,emitted:g})}},h=()=>{const{action:x}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,x&&r({action:null})},b=()=>{if(c=null,!d)return;const x=d;d=null;const{action:y}=e();if(y)switch(y){case te.MOVE:Oa(x,e,r);break;default:Sa(x,e,r)}},f=x=>{const{action:y}=e();y&&(x.preventDefault(),d=Qt(x),c===null&&(c=requestAnimationFrame(b)))};return l&&(l.addEventListener("mouseup",h),l.addEventListener("touchend",h),l.addEventListener("touchcancel",h)),n&&(n.addEventListener("mousedown",u),n.addEventListener("touchstart",u,{passive:!1})),i&&(i.addEventListener("mousemove",f),i.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",h),l.removeEventListener("touchend",h),l.removeEventListener("touchcancel",h)),n&&(n.removeEventListener("mousedown",u),n.removeEventListener("touchstart",u)),i&&(i.removeEventListener("mousemove",f),i.removeEventListener("touchmove",f))}},er=1024*1024,ya=(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/er).toFixed(2);return`File size (${(e.size/er).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},Ca=(e,r,o,n,i,l,c)=>{const d=$=>{c?c($):console.error(`HqCropper: ${$}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const u=e.target.files[0],{config:h}=r(),b=ya(u,h);if(b){d(b),e.target.value="";return}const f=new FileReader;let O=null;const m=()=>{var g;const $=r(),C=document.querySelector(`.${(g=$.css)==null?void 0:g.root[0]}`);C&&(C.remove(),document.removeEventListener("keydown",S),O==null||O(),ha(),l(),o(Rt))},S=$=>{$.key==="Escape"&&r().sourceBase64&&x($)},x=$=>{$.preventDefault(),m()},y=$=>{$.preventDefault();const C=r();xa(r).then(([g,k])=>{n(g,k,C),x($)}).catch(g=>{d(g instanceof Error?g.message:"Failed to crop image")})};f.onload=$=>{const C=new Image;if(!$.target||typeof $.target.result!="string"){d("Can't load result image");return}C.src=$.target.result,C.onerror=()=>{d("Failed to load image")},C.onload=()=>{var N;ca(r,y,x),ua(),i("fileName",ba),i("sourceBase64",ga),i("portal",fa);const g=Hn(r,C),k=Wn(r,g);o({frame:g,portal:k,fileName:u.name,sourceBase64:(N=$.target)==null?void 0:N.result,sourceHeight:C.height,sourceWidth:C.width}),O=$a(r,o),document.addEventListener("keydown",S)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(u),e.target.value=""},ma=(e,r,o,n)=>{const{getState:i,setState:l,subscribe:c,unsubscribeAll:d}=Vn(r,o),u=sa(h=>Ca(h,i,l,e,c,d,n));return{open:()=>u.click()}},le={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},tr="vacano-image-cropper-styles",wa=`
1125
1140
  .vacano-cropper-root {
1126
1141
  background-color: rgba(0, 0, 0, 0.5);
1127
1142
  backdrop-filter: blur(4px);
@@ -1169,42 +1184,42 @@
1169
1184
  .vacano-cropper-apply-button:hover {
1170
1185
  background-color: ${t.COLORS["iron-grey"]};
1171
1186
  }
1172
- `,Oa=()=>{if(typeof document>"u"||document.getElementById(Jt))return;const e=document.createElement("style");e.id=Jt,e.textContent=xa,document.head.appendChild(e)},Sa={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:n=ae.cancelLabel,compression:i=ae.compression,maxFileSize:l=ae.maxFileSize,onCrop:c,onError:d,outputSize:p=ae.outputSize,portalSize:b=ae.portalSize,type:h=ae.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(Oa(),f.current=fa((w,S,x)=>{S&&(c==null||c({base64:w,blob:S,state:x}))},{portalSize:b,outputSize:p,compression:i,type:h,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:n},Sa,w=>{d==null||d({code:"CROPPER_ERROR",message:w})})),f.current.open()},[r,o,n,i,l,c,d,p,b,h])}},pt=T.newClassNameGetter("image-cropper"),$a=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:n,className:i,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:b,outputSize:h,portalSize:f,previewSize:O=120,ref:w,type:S,value:x,...C})=>{const[$,y]=u.useState(x??null),{open:g}=Er({allowedTypes:e,applyLabel:r,cancelLabel:n,compression:c,maxFileSize:d,onCrop:L=>{y(L.base64),p==null||p(L)},onError:b,outputSize:h,portalSize:f,type:S});return a.jsxs(bn,{...C,ref:w,className:pt("container",i),children:[a.jsx(gn,{$size:O,className:pt("preview",l==null?void 0:l.preview),children:$?a.jsx("img",{src:$,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:O},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`
1187
+ `,va=()=>{if(typeof document>"u"||document.getElementById(tr))return;const e=document.createElement("style");e.id=tr,e.textContent=wa,document.head.appendChild(e)},Ra={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"]},zr=(e={})=>{const{allowedTypes:r=le.allowedTypes,applyLabel:o=le.applyLabel,cancelLabel:n=le.cancelLabel,compression:i=le.compression,maxFileSize:l=le.maxFileSize,onCrop:c,onError:d,outputSize:u=le.outputSize,portalSize:h=le.portalSize,type:b=le.type}=e,f=p.useRef(null);return{open:p.useCallback(()=>{f.current||(va(),f.current=ma((m,S,x)=>{S&&(c==null||c({base64:m,blob:S,state:x}))},{portalSize:h,outputSize:u,compression:i,type:b,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:n},Ra,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,n,i,l,c,d,u,h,b])}},ut=T.newClassNameGetter("image-cropper"),La=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:n,className:i,classnames:l,compression:c,maxFileSize:d,onCrop:u,onError:h,outputSize:b,portalSize:f,previewSize:O=120,ref:m,type:S,value:x,...y})=>{const[$,C]=p.useState(x??null),{open:g}=zr({allowedTypes:e,applyLabel:r,cancelLabel:n,compression:c,maxFileSize:d,onCrop:k=>{C(k.base64),u==null||u(k)},onError:h,outputSize:b,portalSize:f,type:S});return a.jsxs(yn,{...y,ref:m,className:ut("container",i),children:[a.jsx(Cn,{$size:O,className:ut("preview",l==null?void 0:l.preview),children:$?a.jsx("img",{src:$,alt:"Preview"}):a.jsx(mn,{children:"No image"})}),a.jsx(ge,{variant:"system",onClick:g,className:ut("button",l==null?void 0:l.button),style:{width:O},children:o})]})},rr={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},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,ht=e=>rr[e]??rr.default,ka=s.div`
1173
1188
  display: grid;
1174
1189
  flex-direction: column;
1175
1190
  gap: 2px;
1176
1191
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1177
- `,Ca=s(ie)`
1192
+ `,Ea=s(ne)`
1178
1193
  margin-left: 6px;
1179
- `,ma=s.input`
1194
+ `,ja=s.input`
1180
1195
  flex: 1;
1181
1196
  min-width: 0;
1182
1197
  outline: none;
1183
1198
  font-size: 14px;
1184
1199
  font-weight: 500;
1185
- height: ${e=>ut(e.$size).height};
1186
- padding: ${e=>ut(e.$size).padding};
1187
- border-radius: ${e=>ut(e.$size).radius};
1200
+ height: ${e=>ht(e.$size).height};
1201
+ padding: ${e=>ht(e.$size).padding};
1202
+ border-radius: ${e=>ht(e.$size).radius};
1188
1203
 
1189
- color: ${e=>le(e.$variant).color.static};
1190
- border: 1px solid ${e=>le(e.$variant).border.static};
1191
- background-color: ${e=>le(e.$variant).background.static};
1204
+ color: ${e=>de(e.$variant).color.static};
1205
+ border: 1px solid ${e=>de(e.$variant).border.static};
1206
+ background-color: ${e=>de(e.$variant).background.static};
1192
1207
 
1193
1208
  &::placeholder {
1194
- color: ${e=>le(e.$variant).placeholder.static};
1209
+ color: ${e=>de(e.$variant).placeholder.static};
1195
1210
  }
1196
1211
 
1197
1212
  &:disabled {
1198
1213
  cursor: not-allowed;
1199
- color: ${e=>le(e.$variant).color.disabled};
1200
- background-color: ${e=>le(e.$variant).background.disabled};
1201
- border-color: ${e=>le(e.$variant).border.disabled};
1214
+ color: ${e=>de(e.$variant).color.disabled};
1215
+ background-color: ${e=>de(e.$variant).background.disabled};
1216
+ border-color: ${e=>de(e.$variant).border.disabled};
1202
1217
 
1203
1218
  &::placeholder {
1204
- color: ${e=>le(e.$variant).placeholder.disabled};
1219
+ color: ${e=>de(e.$variant).placeholder.disabled};
1205
1220
  }
1206
1221
  }
1207
- `,ht=T.newClassNameGetter("input"),Pr=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(ya,{className:ht("container",e),$fullWidth:!!n,children:[a.jsx(Ca,{variant:d,className:ht("label",r==null?void 0:r.label),children:i}),a.jsx(ma,{...p,ref:l,disabled:o,$size:c,$variant:d,className:ht("input",r==null?void 0:r.input)})]}),wa=s.div`
1222
+ `,bt=T.newClassNameGetter("input"),Nr=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,size:c="default",variant:d="normal",...u})=>a.jsxs(ka,{className:bt("container",e),$fullWidth:!!n,children:[a.jsx(Ea,{variant:d,className:bt("label",r==null?void 0:r.label),children:i}),a.jsx(ja,{...u,ref:l,disabled:o,$size:c,$variant:d,className:bt("input",r==null?void 0:r.input)})]}),Pa=s.div`
1208
1223
  position: fixed;
1209
1224
  inset: 0;
1210
1225
  z-index: 1000;
@@ -1213,7 +1228,7 @@
1213
1228
  justify-content: center;
1214
1229
  background-color: ${t.alpha(t.COLORS.black,50)};
1215
1230
  animation: ${t.KEYFRAMES.fadeIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1216
- `,va=s.div`
1231
+ `,za=s.div`
1217
1232
  position: relative;
1218
1233
  z-index: 1001;
1219
1234
  width: ${e=>e.$width};
@@ -1224,21 +1239,21 @@
1224
1239
  border-radius: 16px;
1225
1240
  box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
1226
1241
  animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1227
- `,tr=T.newClassNameGetter("modal"),jr=({animated:e,children:r,className:o,classnames:n,open:i,ref:l,width:c="500px",...d})=>i?ge.createPortal(a.jsx(wa,{className:tr("overlay",n==null?void 0:n.overlay),$animated:!!e,children:a.jsx(va,{...d,ref:l,className:tr("content",o,n==null?void 0:n.content),$animated:!!e,$width:c,children:r})}),document.body):null,zr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ra=s.div`
1242
+ `,ir=T.newClassNameGetter("modal"),Tr=({animated:e,children:r,className:o,classnames:n,open:i,ref:l,width:c="500px",...d})=>i?fe.createPortal(a.jsx(Pa,{className:ir("overlay",n==null?void 0:n.overlay),$animated:!!e,children:a.jsx(za,{...d,ref:l,className:ir("content",o,n==null?void 0:n.content),$animated:!!e,$width:c,children:r})}),document.body):null,Ir={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Na=s.div`
1228
1243
  display: flex;
1229
1244
  flex-direction: column;
1230
1245
  gap: 4px;
1231
- `,ka=s(ie)`
1246
+ `,Ta=s(ne)`
1232
1247
  margin-left: 6px;
1233
- color: ${e=>zr[e.$variant].label};
1234
- `,La=s.button`
1248
+ color: ${e=>Ir[e.$variant].label};
1249
+ `,Ia=s.button`
1235
1250
  display: flex;
1236
1251
  flex-wrap: wrap;
1237
1252
  align-items: center;
1238
1253
  gap: 6px;
1239
1254
  min-height: 44px;
1240
1255
  padding: 8px 12px;
1241
- border: 1px dashed ${e=>zr[e.$variant].border};
1256
+ border: 1px dashed ${e=>Ir[e.$variant].border};
1242
1257
  border-radius: 8px;
1243
1258
  background: ${t.COLORS.white};
1244
1259
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
@@ -1249,31 +1264,31 @@
1249
1264
  &:hover:not(:disabled) {
1250
1265
  border-color: ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1251
1266
  }
1252
- `,Ea=s.span`
1267
+ `,Aa=s.span`
1253
1268
  color: ${t.COLORS["iron-grey"]};
1254
1269
  font-size: 14px;
1255
- `,Pa=s.div`
1270
+ `,Da=s.div`
1256
1271
  display: flex;
1257
1272
  flex-direction: column;
1258
1273
  padding: 20px;
1259
1274
  gap: 16px;
1260
- `,ja=s.div`
1275
+ `,_a=s.div`
1261
1276
  display: flex;
1262
1277
  align-items: center;
1263
1278
  justify-content: space-between;
1264
- `,za=s.h3`
1279
+ `,Ma=s.h3`
1265
1280
  margin: 0;
1266
1281
  font-size: 18px;
1267
1282
  font-weight: 600;
1268
1283
  color: ${t.COLORS.black};
1269
- `,Na=s.div`
1284
+ `,Fa=s.div`
1270
1285
  display: flex;
1271
1286
  flex-direction: column;
1272
1287
  gap: 4px;
1273
1288
  min-height: 200px;
1274
1289
  max-height: 300px;
1275
1290
  overflow-y: auto;
1276
- `,Ta=s.label`
1291
+ `,Ba=s.label`
1277
1292
  display: flex;
1278
1293
  align-items: center;
1279
1294
  gap: 10px;
@@ -1286,10 +1301,10 @@
1286
1301
  &:hover {
1287
1302
  background-color: ${e=>e.$disabled?"transparent":t.COLORS.gray};
1288
1303
  }
1289
- `,Ia=s.span`
1304
+ `,Ya=s.span`
1290
1305
  font-size: 14px;
1291
1306
  color: ${t.COLORS.black};
1292
- `,Aa=s.div`
1307
+ `,Va=s.div`
1293
1308
  display: flex;
1294
1309
  align-items: center;
1295
1310
  justify-content: center;
@@ -1297,31 +1312,31 @@
1297
1312
  color: ${t.COLORS["iron-grey"]};
1298
1313
  font-size: 14px;
1299
1314
  text-align: center;
1300
- `,Q=T.newClassNameGetter("multi-select"),Da=({className:e,classnames:r,disabled:o=!1,emptyMessage:n="No options found",label:i,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:b="Select...",ref:h,searchPlaceholder:f="Search...",value:O,variant:w="normal",...S})=>{const[x,C]=u.useState(!1),[$,y]=u.useState(""),g=u.useMemo(()=>p.filter(E=>O.includes(E.value)),[p,O]),L=u.useMemo(()=>{if(!$.trim())return p;const E=$.toLowerCase().trim();return p.filter(A=>A.label.toLowerCase().includes(E))},[p,$]),N=l===1/0?g:g.slice(0,l),j=g.length-N.length,Y=()=>{o||(C(!0),y(""))},P=()=>{C(!1),y("")},_=E=>{O.includes(E)?d(O.filter(A=>A!==E)):d([...O,E])},M=E=>{d(O.filter(A=>A!==E))};return a.jsxs(Ra,{...S,ref:h,className:Q("container",e),children:[i&&a.jsx(ka,{$variant:w,className:Q("label",r==null?void 0:r.trigger),children:i}),a.jsx(La,{type:"button",$variant:w,$disabled:o,disabled:o,onClick:Y,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:[N.map(E=>a.jsx(Je,{deletable:!0,onDelete:()=>M(E.value),onClick:A=>A.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:E.label},E.value)),j>0&&a.jsxs(Je,{variant:"gray",onClick:E=>E.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",j]})]})}),a.jsx(jr,{open:x,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Pa,{children:[a.jsxs(ja,{children:[a.jsx(za,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:P})]}),a.jsx(Pr,{type:"text",value:$,onChange:E=>y(E.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Na,{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:n}):L.map(E=>a.jsxs(Ta,{$disabled:!!E.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(et,{checked:O.includes(E.value),disabled:E.disabled,onChange:()=>_(E.value)}),a.jsx(Ia,{children:E.label})]},E.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}},Nr=u.createContext(null),or=e=>rr[e]??rr.default,Ma=s.div`
1315
+ `,Q=T.newClassNameGetter("multi-select"),Ha=({className:e,classnames:r,disabled:o=!1,emptyMessage:n="No options found",label:i,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:u,placeholder:h="Select...",ref:b,searchPlaceholder:f="Search...",value:O,variant:m="normal",...S})=>{const[x,y]=p.useState(!1),[$,C]=p.useState(""),g=p.useMemo(()=>u.filter(E=>O.includes(E.value)),[u,O]),k=p.useMemo(()=>{if(!$.trim())return u;const E=$.toLowerCase().trim();return u.filter(A=>A.label.toLowerCase().includes(E))},[u,$]),N=l===1/0?g:g.slice(0,l),P=g.length-N.length,Y=()=>{o||(y(!0),C(""))},j=()=>{y(!1),C("")},_=E=>{O.includes(E)?d(O.filter(A=>A!==E)):d([...O,E])},M=E=>{d(O.filter(A=>A!==E))};return a.jsxs(Na,{...S,ref:b,className:Q("container",e),children:[i&&a.jsx(Ta,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:i}),a.jsx(Ia,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:Y,className:Q("trigger",r==null?void 0:r.trigger),children:g.length===0?a.jsx(Aa,{className:Q("placeholder",r==null?void 0:r.placeholder),children:h}):a.jsxs(a.Fragment,{children:[N.map(E=>a.jsx(Qe,{deletable:!0,onDelete:()=>M(E.value),onClick:A=>A.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:E.label},E.value)),P>0&&a.jsxs(Qe,{variant:"gray",onClick:E=>E.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",P]})]})}),a.jsx(Tr,{open:x,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Da,{children:[a.jsxs(_a,{children:[a.jsx(Ma,{children:c}),a.jsx(ge,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:j})]}),a.jsx(Nr,{type:"text",value:$,onChange:E=>C(E.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Fa,{className:Q("options",r==null?void 0:r.options),children:k.length===0?a.jsx(Va,{className:Q("empty",r==null?void 0:r.empty),children:n}):k.map(E=>a.jsxs(Ba,{$disabled:!!E.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(tt,{checked:O.includes(E.value),disabled:E.disabled,onChange:()=>_(E.value)}),a.jsx(Ya,{children:E.label})]},E.value))})]})})]})},Ga=5e3,nr={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}},Ar=p.createContext(null),ar=e=>nr[e]??nr.default,Wa=s.div`
1301
1316
  position: fixed;
1302
1317
  top: 0;
1303
1318
  left: 0;
1304
1319
  right: 0;
1305
1320
  z-index: 9999;
1306
1321
  pointer-events: none;
1307
- `,Fa=s.div`
1322
+ `,Ka=s.div`
1308
1323
  display: flex;
1309
1324
  align-items: center;
1310
1325
  justify-content: center;
1311
1326
  gap: 12px;
1312
1327
  min-height: 44px;
1313
1328
  padding: 12px 48px;
1314
- background-color: ${({$variant:e})=>or(e).background};
1315
- color: ${({$variant:e})=>or(e).text};
1329
+ background-color: ${({$variant:e})=>ar(e).background};
1330
+ color: ${({$variant:e})=>ar(e).text};
1316
1331
  animation: ${({$isExiting:e})=>e?t.KEYFRAMES.slideOutTopFade:t.KEYFRAMES.slideInTopFade}
1317
1332
  0.3s ease-out forwards;
1318
1333
  pointer-events: auto;
1319
- `,Ba=s.span`
1334
+ `,Ua=s.span`
1320
1335
  font-size: 14px;
1321
1336
  font-weight: 500;
1322
1337
  line-height: 1.4;
1323
1338
  text-align: center;
1324
- `,Ya=s.button`
1339
+ `,Xa=s.button`
1325
1340
  position: absolute;
1326
1341
  right: 16px;
1327
1342
  top: 50%;
@@ -1342,92 +1357,147 @@
1342
1357
  &:hover {
1343
1358
  opacity: 1;
1344
1359
  }
1345
- `,Va=s.div`
1360
+ `,qa=s.div`
1346
1361
  position: relative;
1347
- `,Ha=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[n,i]=u.useState(!1),l=()=>{i(!0)},c=()=>{n&&(r(),o())};return u.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:n,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:[]},Ka=({children:e})=>{const[r,o]=u.useReducer(Ga,Wa),n=u.useCallback((d,p="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:p,duration:b}})},[]),i=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:n,hide:i},children:[e,a.jsx(Ma,{children:r.current&&a.jsx(Ha,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},Ua=()=>{const e=u.useContext(Nr);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)}},Te=e=>ir[e]??ir.default,Se=e=>nr[e]??nr.normal,Xa=s.div`
1362
+ `,Za=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[n,i]=p.useState(!1),l=()=>{i(!0)},c=()=>{n&&(r(),o())};return p.useEffect(()=>{const d=setTimeout(()=>{l()},e.duration);return()=>clearTimeout(d)},[e.duration,e.id]),a.jsx(qa,{children:a.jsxs(Ka,{$variant:e.variant,$isExiting:n,onAnimationEnd:c,children:[a.jsx(Ua,{children:e.message}),a.jsx(Xa,{onClick:l,children:a.jsx(a.X,{style:{width:18,height:18}})})]})})},Ja=(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}},Qa={current:null,queue:[]},el=({children:e})=>{const[r,o]=p.useReducer(Ja,Qa),n=p.useCallback((d,u="default",h=Ga)=>{const b=`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_NOTIFICATION",payload:{id:b,message:d,variant:u,duration:h}})},[]),i=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(Ar.Provider,{value:{show:n,hide:i},children:[e,a.jsx(Wa,{children:r.current&&a.jsx(Za,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},tl=()=>{const e=p.useContext(Ar);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},Dr=p.createContext(null),rl="Agree",ol="Discard",il=oe.keyframes`
1363
+ from {
1364
+ opacity: 0;
1365
+ transform: translateY(100%);
1366
+ }
1367
+ to {
1368
+ opacity: 1;
1369
+ transform: translateY(0);
1370
+ }
1371
+ `,nl=oe.keyframes`
1372
+ from {
1373
+ opacity: 1;
1374
+ transform: translateY(0);
1375
+ }
1376
+ to {
1377
+ opacity: 0;
1378
+ transform: translateY(100%);
1379
+ }
1380
+ `,al=s.div`
1381
+ position: fixed;
1382
+ bottom: 24px;
1383
+ right: 24px;
1384
+ display: flex;
1385
+ flex-direction: column;
1386
+ max-width: 400px;
1387
+ padding: 16px 16px 0 16px;
1388
+ background-color: ${t.COLORS.white};
1389
+ border: 1px dashed ${t.COLORS.gray};
1390
+ border-radius: 12px;
1391
+ overflow: hidden;
1392
+ box-shadow:
1393
+ 0 4px 6px -1px rgba(0, 0, 0, 0.1),
1394
+ 0 2px 4px -2px rgba(0, 0, 0, 0.1);
1395
+ animation: ${({$isExiting:e})=>e?nl:il} 0.2s ease-out forwards;
1396
+ z-index: 1000;
1397
+ `,ll=s.p`
1398
+ margin: 0;
1399
+ font-weight: 600;
1400
+ font-size: 14px;
1401
+ color: ${t.COLORS.black};
1402
+ text-align: left;
1403
+ `,dl=s.p`
1404
+ margin: 4px 0 0;
1405
+ font-size: 13px;
1406
+ color: ${t.COLORS["iron-grey"]};
1407
+ text-align: left;
1408
+ `,cl=s.div`
1409
+ display: flex;
1410
+ align-items: center;
1411
+ justify-content: flex-start;
1412
+ gap: 8px;
1413
+ margin: 12px -16px 0;
1414
+ padding: 12px 16px;
1415
+ border-top: 1px solid ${t.COLORS.gray};
1416
+ background-color: rgba(0, 0, 0, 0.01);
1417
+ `,sl=({confirmation:e,onDone:r})=>{const[o,n]=p.useState(!1),[i,l]=p.useState(!1),{label:c,description:d,onConfirm:u,onDiscard:h,options:b}=e,f=b.confirmLabel||rl,O=b.discardLabel||ol,m=p.useCallback(y=>{n(!0),setTimeout(()=>{y==null||y(),r()},200)},[r]),S=p.useCallback(async()=>{const y=u();if(y instanceof Promise){l(!0);try{await y}finally{l(!1)}}m()},[m,u]),x=p.useCallback(()=>{i||m(h)},[m,i,h]);return p.useEffect(()=>{const y=$=>{$.key==="Escape"&&!i&&x()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[x,i]),a.jsxs(al,{$isExiting:o,children:[a.jsx(ll,{children:c}),a.jsx(dl,{children:d}),a.jsxs(cl,{children:[a.jsx(ge,{variant:"transparent",size:"compact",onClick:x,disabled:i,children:O}),a.jsx(ge,{variant:"system",size:"compact",onClick:S,loading:i,children:f})]})]})},pl=()=>{},ul=({children:e})=>{const[r,o]=p.useState(null),n=p.useCallback((l,c,d,u,h)=>{o({open:!0,label:l,description:c,onConfirm:d,onDiscard:u||pl,options:h||{}})},[]),i=p.useCallback(()=>{o(null)},[]);return a.jsxs(Dr.Provider,{value:{show:n,hide:i},children:[e,r&&a.jsx(sl,{confirmation:r,onDone:i})]})},hl=()=>{const e=p.useContext(Dr);if(!e)throw new Error("useNotifyConfirmation must be used within NotifyConfirmationProvider");return e},lr={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},dr={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=>lr[e]??lr.default,$e=e=>dr[e]??dr.normal,bl=s.div`
1348
1418
  display: inline-flex;
1349
1419
  flex-direction: column;
1350
1420
  gap: 2px;
1351
- `,qa=s(ie)`
1421
+ `,gl=s(ne)`
1352
1422
  margin-left: 6px;
1353
- `,Za=s.div`
1354
- display: flex;
1355
- gap: ${e=>Te(e.$size).gap};
1356
- `,Ja=s.input`
1357
- width: ${e=>Te(e.$size).width};
1358
- height: ${e=>Te(e.$size).height};
1359
- border-radius: ${e=>Te(e.$size).radius};
1360
- font-size: ${e=>Te(e.$size).fontSize};
1423
+ `,fl=s.div`
1424
+ display: flex;
1425
+ gap: ${e=>Ie(e.$size).gap};
1426
+ `,xl=s.input`
1427
+ width: ${e=>Ie(e.$size).width};
1428
+ height: ${e=>Ie(e.$size).height};
1429
+ border-radius: ${e=>Ie(e.$size).radius};
1430
+ font-size: ${e=>Ie(e.$size).fontSize};
1361
1431
  font-weight: 600;
1362
1432
  text-align: center;
1363
1433
  outline: none;
1364
- border: 1px solid ${e=>Se(e.$variant).border.static};
1365
- background-color: ${e=>Se(e.$variant).background.static};
1366
- color: ${e=>Se(e.$variant).color.static};
1434
+ border: 1px solid ${e=>$e(e.$variant).border.static};
1435
+ background-color: ${e=>$e(e.$variant).background.static};
1436
+ color: ${e=>$e(e.$variant).color.static};
1367
1437
  transition:
1368
1438
  border-color 0.15s ease,
1369
1439
  box-shadow 0.15s ease;
1370
1440
 
1371
1441
  &:disabled {
1372
1442
  cursor: not-allowed;
1373
- color: ${e=>Se(e.$variant).color.disabled};
1374
- background-color: ${e=>Se(e.$variant).background.disabled};
1375
- border-color: ${e=>Se(e.$variant).border.disabled};
1443
+ color: ${e=>$e(e.$variant).color.disabled};
1444
+ background-color: ${e=>$e(e.$variant).background.disabled};
1445
+ border-color: ${e=>$e(e.$variant).border.disabled};
1376
1446
  }
1377
1447
 
1378
1448
  &::selection {
1379
1449
  background-color: transparent;
1380
1450
  }
1381
- `,bt=T.newClassNameGetter("otp-code"),Qa=({autoFocus:e,className:r,classnames:o,disabled:n,label:i,length:l=6,onChange:c,ref:d,size:p="default",value:b="",variant:h="normal",...f})=>{const O=u.useRef([]);u.useEffect(()=>{e&&O.current[0]&&O.current[0].focus()},[e]);const w=u.useCallback($=>{const y=O.current[$];y&&(y.focus(),y.select())},[]),S=u.useCallback(($,y)=>{const L=y.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const N=b.padEnd(l," ").split(""),j=N.findIndex(M=>M===" "||M===""),Y=j!==-1?j:$;N[Y]=L;const P=N.join("").replace(/ /g,"");c==null||c(P);const _=Y+1;_<l&&w(_)},[b,l,c,w]),x=u.useCallback(($,y)=>{if(y.key==="Backspace"){y.preventDefault();const g=b.split("");g[$]?(g[$]="",c==null||c(g.join(""))):$>0&&(g[$-1]="",c==null||c(g.join("")),w($-1))}else y.key==="ArrowLeft"&&$>0?(y.preventDefault(),w($-1)):y.key==="ArrowRight"&&$<l-1&&(y.preventDefault(),w($+1))},[b,l,c,w]),C=u.useCallback($=>{$.preventDefault();const y=$.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(y){c==null||c(y);const g=Math.min(y.length,l-1);w(g)}},[l,c,w]);return a.jsxs(Xa,{ref:d,className:bt("container",r),...f,children:[i&&a.jsx(qa,{variant:h,className:bt("label",o==null?void 0:o.label),children:i}),a.jsx(Za,{$size:p,children:Array.from({length:l}).map(($,y)=>a.jsx(Ja,{ref:g=>{O.current[y]=g},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:n,value:b[y]??"",onChange:g=>S(y,g),onKeyDown:g=>x(y,g),onPaste:C,onFocus:g=>g.target.select(),$size:p,$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`
1451
+ `,gt=T.newClassNameGetter("otp-code"),Ol=({autoFocus:e,className:r,classnames:o,disabled:n,label:i,length:l=6,onChange:c,ref:d,size:u="default",value:h="",variant:b="normal",...f})=>{const O=p.useRef([]);p.useEffect(()=>{e&&O.current[0]&&O.current[0].focus()},[e]);const m=p.useCallback($=>{const C=O.current[$];C&&(C.focus(),C.select())},[]),S=p.useCallback(($,C)=>{const k=C.target.value.replace(/\D/g,"").slice(-1);if(!k)return;const N=h.padEnd(l," ").split(""),P=N.findIndex(M=>M===" "||M===""),Y=P!==-1?P:$;N[Y]=k;const j=N.join("").replace(/ /g,"");c==null||c(j);const _=Y+1;_<l&&m(_)},[h,l,c,m]),x=p.useCallback(($,C)=>{if(C.key==="Backspace"){C.preventDefault();const g=h.split("");g[$]?(g[$]="",c==null||c(g.join(""))):$>0&&(g[$-1]="",c==null||c(g.join("")),m($-1))}else C.key==="ArrowLeft"&&$>0?(C.preventDefault(),m($-1)):C.key==="ArrowRight"&&$<l-1&&(C.preventDefault(),m($+1))},[h,l,c,m]),y=p.useCallback($=>{$.preventDefault();const C=$.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(C){c==null||c(C);const g=Math.min(C.length,l-1);m(g)}},[l,c,m]);return a.jsxs(bl,{ref:d,className:gt("container",r),...f,children:[i&&a.jsx(gl,{variant:b,className:gt("label",o==null?void 0:o.label),children:i}),a.jsx(fl,{$size:u,children:Array.from({length:l}).map(($,C)=>a.jsx(xl,{ref:g=>{O.current[C]=g},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:n,value:h[C]??"",onChange:g=>S(C,g),onKeyDown:g=>x(C,g),onPaste:y,onFocus:g=>g.target.select(),$size:u,$variant:b,className:gt("input",o==null?void 0:o.input)},C))})]})},cr={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=>cr[e]??cr.light,Sl=s.div`
1382
1452
  display: flex;
1383
1453
  flex-direction: column;
1384
1454
  gap: 16px;
1385
1455
  padding: 12px;
1386
- border: 1px dashed ${({$variant:e})=>Qe(e).border};
1456
+ border: 1px dashed ${({$variant:e})=>et(e).border};
1387
1457
  border-radius: 16px;
1388
- background-color: ${({$variant:e})=>Qe(e).background};
1389
- `,tl=s.div`
1458
+ background-color: ${({$variant:e})=>et(e).background};
1459
+ `,$l=s.div`
1390
1460
  display: flex;
1391
1461
  flex-direction: column;
1392
1462
  gap: 4px;
1393
- `,rl=s.div`
1463
+ `,yl=s.div`
1394
1464
  font-size: 18px;
1395
1465
  font-weight: 600;
1396
1466
  line-height: 1.4;
1397
- color: ${({$variant:e})=>Qe(e).title};
1398
- `,ol=s.div`
1467
+ color: ${({$variant:e})=>et(e).title};
1468
+ `,Cl=s.div`
1399
1469
  font-size: 14px;
1400
1470
  line-height: 1.5;
1401
- color: ${({$variant:e})=>Qe(e).description};
1402
- `,il=s.div`
1471
+ color: ${({$variant:e})=>et(e).description};
1472
+ `,ml=s.div`
1403
1473
  display: flex;
1404
1474
  flex-wrap: wrap;
1405
1475
  gap: 8px;
1406
- `,Ke=T.newClassNameGetter("panel"),nl=({children:e,className:r,classnames:o,description:n,ref:i,title:l,variant:c="light",...d})=>{const p=l||n;return a.jsxs(el,{...d,ref:i,className:Ke("container",r),$variant:c,children:[p&&a.jsxs(tl,{children:[l&&a.jsx(rl,{className:Ke("title",o==null?void 0:o.title),$variant:c,children:l}),n&&a.jsx(ol,{className:Ke("description",o==null?void 0:o.description),$variant:c,children:n})]}),a.jsx(il,{className:Ke("content",o==null?void 0:o.content),children:e})]})},vt={compact:{height:4,radius:2},default:{height:8,radius:4}},al=s.div`
1476
+ `,Ue=T.newClassNameGetter("panel"),wl=({children:e,className:r,classnames:o,description:n,ref:i,title:l,variant:c="light",...d})=>{const u=l||n;return a.jsxs(Sl,{...d,ref:i,className:Ue("container",r),$variant:c,children:[u&&a.jsxs($l,{children:[l&&a.jsx(yl,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),n&&a.jsx(Cl,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:n})]}),a.jsx(ml,{className:Ue("content",o==null?void 0:o.content),children:e})]})},Lt={compact:{height:4,radius:2},default:{height:8,radius:4}},vl=s.div`
1407
1477
  width: 100%;
1408
- height: ${({$size:e})=>vt[e].height}px;
1409
- border-radius: ${({$size:e})=>vt[e].radius}px;
1478
+ height: ${({$size:e})=>Lt[e].height}px;
1479
+ border-radius: ${({$size:e})=>Lt[e].radius}px;
1410
1480
  background-color: ${t.COLORS.gray};
1411
1481
  overflow: hidden;
1412
- `,ll=s.div`
1482
+ `,Rl=s.div`
1413
1483
  height: 100%;
1414
1484
  width: ${({$value:e})=>Math.min(100,Math.max(0,e))}%;
1415
- border-radius: ${({$size:e})=>vt[e].radius}px;
1485
+ border-radius: ${({$size:e})=>Lt[e].radius}px;
1416
1486
  background-color: ${t.COLORS.black};
1417
1487
  transition: width 0.2s ease;
1418
- `,lr=T.newClassNameGetter("progress"),dl=({value:e,size:r="default",className:o,classnames:n,ref:i,...l})=>a.jsx(al,{...l,ref:i,$size:r,className:lr("track",o,n==null?void 0:n.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(ll,{$size:r,$value:e,className:lr("bar",n==null?void 0:n.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`
1488
+ `,sr=T.newClassNameGetter("progress"),Ll=({value:e,size:r="default",className:o,classnames:n,ref:i,...l})=>a.jsx(vl,{...l,ref:i,$size:r,className:sr("track",o,n==null?void 0:n.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(Rl,{$size:r,$value:e,className:sr("bar",n==null?void 0:n.bar)})}),pr={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}},me=e=>pr[e]??pr.normal,kl=s.label`
1419
1489
  display: inline-flex;
1420
1490
  align-items: flex-start;
1421
1491
  gap: 8px;
1422
1492
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1423
1493
  opacity: ${e=>e.$disabled?.5:1};
1424
- `,sl=s.input`
1494
+ `,El=s.input`
1425
1495
  position: absolute;
1426
1496
  opacity: 0;
1427
1497
  width: 0;
1428
1498
  height: 0;
1429
1499
  pointer-events: none;
1430
- `,pl=s.span`
1500
+ `,jl=s.span`
1431
1501
  display: inline-flex;
1432
1502
  align-items: center;
1433
1503
  justify-content: center;
@@ -1436,27 +1506,27 @@
1436
1506
  height: 18px;
1437
1507
  border-radius: 50%;
1438
1508
  border: 1.5px solid
1439
- ${e=>e.$checked?Ce(e.$variant).box.borderChecked:Ce(e.$variant).box.border};
1440
- background-color: ${e=>e.$checked?Ce(e.$variant).box.backgroundChecked:Ce(e.$variant).box.background};
1509
+ ${e=>e.$checked?me(e.$variant).box.borderChecked:me(e.$variant).box.border};
1510
+ background-color: ${e=>e.$checked?me(e.$variant).box.backgroundChecked:me(e.$variant).box.background};
1441
1511
  transition:
1442
1512
  border-color 0.15s ease,
1443
1513
  background-color 0.15s ease,
1444
1514
  box-shadow 0.15s ease;
1445
- `,ul=s.span`
1515
+ `,Pl=s.span`
1446
1516
  width: 8px;
1447
1517
  height: 8px;
1448
1518
  border-radius: 50%;
1449
- background-color: ${e=>Ce(e.$variant).dot};
1519
+ background-color: ${e=>me(e.$variant).dot};
1450
1520
  opacity: ${e=>e.$visible?1:0};
1451
1521
  transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
1452
1522
  transition:
1453
1523
  opacity 0.15s ease,
1454
1524
  transform 0.15s ease;
1455
- `,hl=s.span`
1525
+ `,zl=s.span`
1456
1526
  font-size: 14px;
1457
1527
  font-weight: 500;
1458
1528
  line-height: 1.5;
1459
- color: ${e=>Ce(e.$variant).label};
1529
+ color: ${e=>me(e.$variant).label};
1460
1530
  user-select: none;
1461
1531
 
1462
1532
  a {
@@ -1468,15 +1538,15 @@
1468
1538
  text-decoration: none;
1469
1539
  }
1470
1540
  }
1471
- `,je=T.newClassNameGetter("radio"),Lt=({checked:e,className:r,classnames:o,disabled:n,label:i,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(cl,{className:je("container",r),$disabled:!!n,$variant:d,children:[a.jsx(sl,{...p,ref:c,type:"radio",className:je("input",o==null?void 0:o.input),checked:e,disabled:n,onChange:l}),a.jsx(pl,{className:je("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(ul,{className:je("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),i&&a.jsx(hl,{className:je("label",o==null?void 0:o.label),$variant:d,children:i})]}),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`
1541
+ `,ze=T.newClassNameGetter("radio"),jt=({checked:e,className:r,classnames:o,disabled:n,label:i,onChange:l,ref:c,variant:d="normal",...u})=>a.jsxs(kl,{className:ze("container",r),$disabled:!!n,$variant:d,children:[a.jsx(El,{...u,ref:c,type:"radio",className:ze("input",o==null?void 0:o.input),checked:e,disabled:n,onChange:l}),a.jsx(jl,{className:ze("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(Pl,{className:ze("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),i&&a.jsx(zl,{className:ze("label",o==null?void 0:o.label),$variant:d,children:i})]}),ur={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)}}},be=e=>ur[e]??ur.normal,Nl=s.label`
1472
1542
  display: grid;
1473
1543
  grid-template-columns: auto 1fr;
1474
1544
  align-items: start;
1475
1545
  gap: 8px;
1476
1546
  padding: 12px;
1477
- background-color: ${e=>{const r=he(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
1547
+ background-color: ${e=>{const r=be(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
1478
1548
  border: 1px solid
1479
- ${e=>{const r=he(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
1549
+ ${e=>{const r=be(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
1480
1550
  border-radius: 12px;
1481
1551
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1482
1552
  transition:
@@ -1486,13 +1556,13 @@
1486
1556
  min-width: 0;
1487
1557
 
1488
1558
  &:hover:not([data-disabled='true']) {
1489
- border-color: ${e=>{const r=he(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
1559
+ border-color: ${e=>{const r=be(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
1490
1560
  }
1491
1561
 
1492
1562
  .vacano_radio_container {
1493
1563
  pointer-events: none;
1494
1564
  }
1495
- `,gl=s.input`
1565
+ `,Tl=s.input`
1496
1566
  position: absolute;
1497
1567
  width: 1px;
1498
1568
  height: 1px;
@@ -1502,44 +1572,44 @@
1502
1572
  clip: rect(0, 0, 0, 0);
1503
1573
  white-space: nowrap;
1504
1574
  border: 0;
1505
- `,fl=s.div`
1575
+ `,Il=s.div`
1506
1576
  display: flex;
1507
1577
  flex-direction: column;
1508
1578
  gap: 2px;
1509
1579
  min-width: 0;
1510
- `,xl=s.span`
1580
+ `,Al=s.span`
1511
1581
  font-size: 14px;
1512
1582
  font-weight: 500;
1513
1583
  line-height: 1.4;
1514
- color: ${e=>he(e.$variant).label.static};
1584
+ color: ${e=>be(e.$variant).label.static};
1515
1585
 
1516
1586
  label[data-disabled='true'] & {
1517
- color: ${e=>he(e.$variant).label.disabled};
1587
+ color: ${e=>be(e.$variant).label.disabled};
1518
1588
  }
1519
- `,Ol=s.span`
1589
+ `,Dl=s.span`
1520
1590
  font-size: 12px;
1521
1591
  font-weight: 400;
1522
1592
  line-height: 1.4;
1523
- color: ${e=>he(e.$variant).description.static};
1593
+ color: ${e=>be(e.$variant).description.static};
1524
1594
 
1525
1595
  label[data-disabled='true'] & {
1526
- color: ${e=>he(e.$variant).description.disabled};
1596
+ color: ${e=>be(e.$variant).description.disabled};
1527
1597
  }
1528
- `,Ue=T.newClassNameGetter("radio-card"),Sl=({checked:e,className:r,classnames:o,description:n,disabled:i,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:b="normal",...h})=>a.jsxs(bl,{className:Ue("container",r),$checked:e,$disabled:!!i,$fullWidth:l,$variant:b,"data-disabled":i,children:[a.jsx(gl,{...h,ref:p,type:"radio",checked:e,disabled:i,onChange:d}),a.jsx(Lt,{className:o==null?void 0:o.radio,checked:e,disabled:i,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(fl,{className:Ue("content",o==null?void 0:o.content),children:[a.jsx(xl,{className:Ue("label",o==null?void 0:o.label),$variant:b,children:c}),n&&a.jsx(Ol,{className:Ue("description",o==null?void 0:o.description),$variant:b,children:n})]})]}),sr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},$l=s.div`
1598
+ `,Xe=T.newClassNameGetter("radio-card"),_l=({checked:e,className:r,classnames:o,description:n,disabled:i,fullWidth:l=!1,label:c,onChange:d,ref:u,variant:h="normal",...b})=>a.jsxs(Nl,{className:Xe("container",r),$checked:e,$disabled:!!i,$fullWidth:l,$variant:h,"data-disabled":i,children:[a.jsx(Tl,{...b,ref:u,type:"radio",checked:e,disabled:i,onChange:d}),a.jsx(jt,{className:o==null?void 0:o.radio,checked:e,disabled:i,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Il,{className:Xe("content",o==null?void 0:o.content),children:[a.jsx(Al,{className:Xe("label",o==null?void 0:o.label),$variant:h,children:c}),n&&a.jsx(Dl,{className:Xe("description",o==null?void 0:o.description),$variant:h,children:n})]})]}),hr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Ml=s.div`
1529
1599
  display: flex;
1530
1600
  flex-direction: column;
1531
1601
  gap: 8px;
1532
- `,yl=s.span`
1602
+ `,Fl=s.span`
1533
1603
  font-size: 13px;
1534
1604
  font-weight: 500;
1535
1605
  line-height: 1.5;
1536
- color: ${e=>e.$disabled?sr.label.disabledColor:sr.label.color};
1606
+ color: ${e=>e.$disabled?hr.label.disabledColor:hr.label.color};
1537
1607
  margin-bottom: 4px;
1538
- `,Cl=s.div`
1608
+ `,Bl=s.div`
1539
1609
  display: flex;
1540
1610
  flex-direction: column;
1541
1611
  gap: 12px;
1542
- `,gt=T.newClassNameGetter("radio-group"),ml=({className:e,classnames:r,disabled:o,label:n,name:i,onChange:l,options:c,ref:d,value:p,...b})=>a.jsxs($l,{...b,ref:d,className:gt("container",e),children:[n&&a.jsx(yl,{className:gt("label",r==null?void 0:r.label),$disabled:o,children:n}),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:i,checked:p===h.value,label:h.label,disabled:o,onChange:()=>l(h.value)},h.value))})]}),Tr=u.createContext(null),wl=s.div`
1612
+ `,ft=T.newClassNameGetter("radio-group"),Yl=({className:e,classnames:r,disabled:o,label:n,name:i,onChange:l,options:c,ref:d,value:u,...h})=>a.jsxs(Ml,{...h,ref:d,className:ft("container",e),children:[n&&a.jsx(Fl,{className:ft("label",r==null?void 0:r.label),$disabled:o,children:n}),a.jsx(Bl,{className:ft("options",r==null?void 0:r.options),children:c.map(b=>a.jsx(jt,{className:r==null?void 0:r.radio,name:i,checked:u===b.value,label:b.label,disabled:o,onChange:()=>l(b.value)},b.value))})]}),_r=p.createContext(null),Vl=s.div`
1543
1613
  position: fixed;
1544
1614
  bottom: 24px;
1545
1615
  right: 24px;
@@ -1554,19 +1624,19 @@
1554
1624
  animation: ${t.KEYFRAMES.fadeIn} 0.2s ease-out;
1555
1625
  pointer-events: none;
1556
1626
  color: ${t.COLORS.black};
1557
- `,vl=s.span`
1627
+ `,Hl=s.span`
1558
1628
  font-size: 14px;
1559
1629
  font-weight: 500;
1560
1630
  white-space: nowrap;
1561
- `,Rl=({children:e,defaultMessage:r="Saving"})=>{const[o,n]=u.useState(!1),[i,l]=u.useState(r),c=u.useCallback(b=>{l(b??r),n(!0)},[r]),d=u.useCallback(()=>{n(!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(wl,{children:[a.jsx(kt,{size:"sm"}),a.jsx(vl,{children:i})]})]})},kl=()=>{const e=u.useContext(Tr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},ft=40,ze=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`
1631
+ `,Gl=({children:e,defaultMessage:r="Saving"})=>{const[o,n]=p.useState(!1),[i,l]=p.useState(r),c=p.useCallback(h=>{l(h??r),n(!0)},[r]),d=p.useCallback(()=>{n(!1)},[]),u=p.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(_r.Provider,{value:u,children:[e,o&&a.jsxs(Vl,{children:[a.jsx(Et,{size:"sm"}),a.jsx(Hl,{children:i})]})]})},Wl=()=>{const e=p.useContext(_r);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},xt=40,Ot=2,Ne=4,br={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},gr={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)}},St=e=>br[e]??br.default,pe=e=>gr[e]??gr.normal,Kl=s.div`
1562
1632
  position: relative;
1563
1633
  display: grid;
1564
1634
  gap: 2px;
1565
1635
  min-width: 180px;
1566
1636
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1567
- `,El=s(ie)`
1637
+ `,Ul=s(ne)`
1568
1638
  margin-left: 6px;
1569
- `,Pl=s.button`
1639
+ `,Xl=s.button`
1570
1640
  display: flex;
1571
1641
  align-items: center;
1572
1642
  justify-content: space-between;
@@ -1577,43 +1647,45 @@
1577
1647
  font-weight: 500;
1578
1648
  text-align: left;
1579
1649
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1580
- height: ${e=>xt(e.$size).height};
1581
- padding: ${e=>xt(e.$size).padding};
1582
- border-radius: ${e=>xt(e.$size).radius};
1650
+ height: ${e=>St(e.$size).height};
1651
+ padding: ${e=>St(e.$size).padding};
1652
+ border-radius: ${e=>St(e.$size).radius};
1583
1653
 
1584
- color: ${e=>e.$hasValue?e.$disabled?se(e.$variant).color.disabled:se(e.$variant).color.static:se(e.$variant).placeholder};
1654
+ color: ${e=>e.$hasValue?e.$disabled?pe(e.$variant).color.disabled:pe(e.$variant).color.static:pe(e.$variant).placeholder};
1585
1655
  border: 1px solid
1586
- ${e=>e.$disabled?se(e.$variant).border.disabled:se(e.$variant).border.static};
1587
- background-color: ${e=>e.$disabled?se(e.$variant).background.disabled:se(e.$variant).background.static};
1588
- `,jl=s.span`
1656
+ ${e=>e.$disabled?pe(e.$variant).border.disabled:pe(e.$variant).border.static};
1657
+ background-color: ${e=>e.$disabled?pe(e.$variant).background.disabled:pe(e.$variant).background.static};
1658
+ `,ql=s.span`
1589
1659
  flex: 1;
1590
1660
  min-width: 0;
1591
1661
  overflow: hidden;
1592
1662
  text-overflow: ellipsis;
1593
1663
  white-space: nowrap;
1594
- `,zl=s.span`
1664
+ `,Zl=s.span`
1595
1665
  display: flex;
1596
1666
  align-items: center;
1597
1667
  justify-content: center;
1598
1668
  flex-shrink: 0;
1599
1669
  transition: transform 0.2s ease;
1600
1670
  transform: rotate(${e=>e.$open?"180deg":"0deg"});
1601
- `,Ir=`
1671
+ `,Mr=`
1672
+ display: grid;
1673
+ gap: 2px;
1602
1674
  padding: 4px;
1603
1675
  background: ${t.COLORS.white};
1604
1676
  border: 1px solid ${t.alpha(t.COLORS.black,10)};
1605
1677
  border-radius: 16px;
1606
1678
  box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
1607
1679
  z-index: 1000;
1608
- `,Nl=s.div`
1680
+ `,Jl=s.div`
1609
1681
  position: absolute;
1610
1682
  left: -4px;
1611
1683
  width: calc(100% + 8px);
1612
- ${Ir}
1613
- `,Tl=s.div`
1684
+ ${Mr}
1685
+ `,Ql=s.div`
1614
1686
  position: fixed;
1615
- ${Ir}
1616
- `,Il=s.button`
1687
+ ${Mr}
1688
+ `,ed=s.button`
1617
1689
  display: flex;
1618
1690
  align-items: center;
1619
1691
  justify-content: space-between;
@@ -1641,13 +1713,13 @@
1641
1713
  white-space: nowrap;
1642
1714
  min-width: 0;
1643
1715
  }
1644
- `,Al=s.span`
1716
+ `,td=s.span`
1645
1717
  display: flex;
1646
1718
  align-items: center;
1647
1719
  justify-content: center;
1648
1720
  flex-shrink: 0;
1649
1721
  color: ${t.COLORS.black};
1650
- `,$e=T.newClassNameGetter("select"),Dl=({className:e,classnames:r,disabled:o=!1,fullWidth:n=!1,label:i,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:b,size:h="default",value:f,variant:O="normal",...w})=>{const[S,x]=u.useState(!1),[C,$]=u.useState({top:0,left:0,width:0}),y=u.useRef(null),g=u.useRef(null),L=u.useRef(null),N=c.find(m=>m.value===f),j=Math.max(0,c.findIndex(m=>m.value===f)),Y=-(j*ft+ze),P=()=>{if(!g.current||!p)return;const m=g.current.getBoundingClientRect(),I=j*ft+ze;let R=m.top-I;const z=c.length*ft+ze*2,B=8,F=window.innerHeight-z-8;R<B&&(R=B),R>F&&(R=F),$({top:R,left:m.left-ze,width:m.width+ze*2})},_=m=>{var I;l==null||l(m),x(!1),(I=g.current)==null||I.focus()},M=m=>{o||c.length===0||(m.key==="Enter"||m.key===" "?(m.preventDefault(),x(I=>!I)):m.key==="Escape"&&S?(m.preventDefault(),x(!1)):m.key==="ArrowDown"&&!S&&(m.preventDefault(),x(!0)))};u.useLayoutEffect(()=>{S&&p&&P()},[S,p,j,c.length]),u.useEffect(()=>{if(!S)return;const m=z=>{const B=z.target,F=y.current&&!y.current.contains(B),H=L.current&&!L.current.contains(B);p?F&&H&&x(!1):F&&x(!1)},I=()=>{p&&P()},R=()=>{p&&P()};return document.addEventListener("mousedown",m),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",R)),()=>{document.removeEventListener("mousedown",m),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",R)}},[S,p]);const E=()=>c.map(m=>a.jsxs(Il,{type:"button",role:"option",$selected:m.value===f,$disabled:m.disabled??!1,disabled:m.disabled,"aria-selected":m.value===f,onClick:()=>_(m.value),className:$e("option",r==null?void 0:r.option),children:[a.jsx("span",{children:m.label}),m.value===f&&a.jsx(Al,{children:a.jsx(a.Check,{size:16})})]},m.value)),A=p?ge.createPortal(a.jsx(Tl,{ref:L,role:"listbox",style:{top:C.top,left:C.left,width:C.width},className:$e("dropdown",r==null?void 0:r.dropdown),children:E()}),p):a.jsx(Nl,{ref:L,role:"listbox",style:{top:Y},className:$e("dropdown",r==null?void 0:r.dropdown),children:E()});return a.jsxs(Ll,{...w,ref:m=>{y.current=m,typeof b=="function"?b(m):b&&(b.current=m)},$fullWidth:n,className:$e("container",e),children:[i&&a.jsx(El,{variant:O==="error"?"error":"normal",className:$e("label",r==null?void 0:r.label),children:i}),a.jsxs(Pl,{ref:g,type:"button",$size:h,$variant:O,$disabled:o,$hasValue:!!N,disabled:o,onClick:()=>!o&&c.length>0&&x(m=>!m),onKeyDown:M,"aria-haspopup":"listbox","aria-expanded":S,className:$e("trigger",r==null?void 0:r.trigger),children:[a.jsx(jl,{children:(N==null?void 0:N.label)??d}),a.jsx(zl,{$open:S,children:a.jsx(a.ChevronDown,{size:16})})]}),S&&A]})},hr={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},_l=e=>hr[e]??hr.neutral,Ml=s.div`
1722
+ `,ye=T.newClassNameGetter("select"),rd=({className:e,classnames:r,disabled:o=!1,fullWidth:n=!1,label:i,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:u,ref:h,size:b="default",value:f,variant:O="normal",...m})=>{const[S,x]=p.useState(!1),[y,$]=p.useState({top:0,left:0,width:0}),C=p.useRef(null),g=p.useRef(null),k=p.useRef(null),N=c.find(w=>w.value===f),P=Math.max(0,c.findIndex(w=>w.value===f)),Y=-(P*(xt+Ot)+Ne),j=()=>{if(!g.current||!u)return;const w=g.current.getBoundingClientRect(),I=P*(xt+Ot)+Ne;let R=w.top-I;const z=c.length*xt+(c.length-1)*Ot+Ne*2,B=8,F=window.innerHeight-z-8;R<B&&(R=B),R>F&&(R=F),$({top:R,left:w.left-Ne,width:w.width+Ne*2})},_=w=>{var I;l==null||l(w),x(!1),(I=g.current)==null||I.focus()},M=w=>{o||c.length===0||(w.key==="Enter"||w.key===" "?(w.preventDefault(),x(I=>!I)):w.key==="Escape"&&S?(w.preventDefault(),x(!1)):w.key==="ArrowDown"&&!S&&(w.preventDefault(),x(!0)))};p.useLayoutEffect(()=>{S&&u&&j()},[S,u,P,c.length]),p.useEffect(()=>{if(!S)return;const w=z=>{const B=z.target,F=C.current&&!C.current.contains(B),H=k.current&&!k.current.contains(B);u?F&&H&&x(!1):F&&x(!1)},I=()=>{u&&j()},R=()=>{u&&j()};return document.addEventListener("mousedown",w),u&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",R)),()=>{document.removeEventListener("mousedown",w),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",R)}},[S,u]);const E=()=>c.map(w=>a.jsxs(ed,{type:"button",role:"option",$selected:w.value===f,$disabled:w.disabled??!1,disabled:w.disabled,"aria-selected":w.value===f,onClick:()=>_(w.value),className:ye("option",r==null?void 0:r.option),children:[a.jsx("span",{children:w.label}),w.value===f&&a.jsx(td,{children:a.jsx(a.Check,{size:16})})]},w.value)),A=u?fe.createPortal(a.jsx(Ql,{ref:k,role:"listbox",style:{top:y.top,left:y.left,width:y.width},className:ye("dropdown",r==null?void 0:r.dropdown),children:E()}),u):a.jsx(Jl,{ref:k,role:"listbox",style:{top:Y},className:ye("dropdown",r==null?void 0:r.dropdown),children:E()});return a.jsxs(Kl,{...m,ref:w=>{C.current=w,typeof h=="function"?h(w):h&&(h.current=w)},$fullWidth:n,className:ye("container",e),children:[i&&a.jsx(Ul,{variant:O==="error"?"error":"normal",className:ye("label",r==null?void 0:r.label),children:i}),a.jsxs(Xl,{ref:g,type:"button",$size:b,$variant:O,$disabled:o,$hasValue:!!N,disabled:o,onClick:()=>!o&&c.length>0&&x(w=>!w),onKeyDown:M,"aria-haspopup":"listbox","aria-expanded":S,className:ye("trigger",r==null?void 0:r.trigger),children:[a.jsx(ql,{children:(N==null?void 0:N.label)??d}),a.jsx(Zl,{$open:S,children:a.jsx(a.ChevronDown,{size:16})})]}),S&&A]})},fr={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},od=e=>fr[e]??fr.neutral,id=s.div`
1651
1723
  display: flex;
1652
1724
  flex-direction: column;
1653
1725
  gap: 4px;
@@ -1656,16 +1728,16 @@
1656
1728
  border-radius: 16px;
1657
1729
  border: ${({$border:e})=>e?"1px solid #e5e7eb":"none"};
1658
1730
  box-shadow: ${({$shadow:e})=>e?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"none"};
1659
- `,Fl=s.div`
1731
+ `,nd=s.div`
1660
1732
  display: flex;
1661
1733
  align-items: center;
1662
1734
  justify-content: space-between;
1663
1735
  gap: 8px;
1664
- `,Bl=s.p`
1736
+ `,ad=s.p`
1665
1737
  margin: 0;
1666
1738
  font-size: 13px;
1667
1739
  color: ${t.COLORS["iron-grey"]};
1668
- `,Yl=s.div`
1740
+ `,ld=s.div`
1669
1741
  display: flex;
1670
1742
  align-items: center;
1671
1743
  justify-content: center;
@@ -1679,21 +1751,21 @@
1679
1751
  width: 18px;
1680
1752
  height: 18px;
1681
1753
  }
1682
- `,Vl=s.h3`
1754
+ `,dd=s.h3`
1683
1755
  margin: 0;
1684
1756
  font-size: 28px;
1685
1757
  font-weight: 600;
1686
1758
  line-height: 1.2;
1687
1759
  color: ${t.COLORS.black};
1688
- `,Hl=s.p`
1760
+ `,cd=s.p`
1689
1761
  margin: 0;
1690
1762
  font-size: 12px;
1691
- color: ${({$variant:e})=>_l(e)};
1692
- `,Xe=T.newClassNameGetter("status-card"),Gl=({border:e=!1,className:r,classnames:o,icon:n,label:i,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:b,...h})=>a.jsxs(Ml,{...h,ref:l,className:Xe("container",r),$border:e,$shadow:c,children:[a.jsxs(Fl,{children:[a.jsx(Bl,{className:Xe("label",o==null?void 0:o.label),children:i}),n&&a.jsx(Yl,{children:n})]}),a.jsx(Vl,{className:Xe("value",o==null?void 0:o.value),children:b}),d&&a.jsx(Hl,{className:Xe("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),Wl=s.div`
1763
+ color: ${({$variant:e})=>od(e)};
1764
+ `,qe=T.newClassNameGetter("status-card"),sd=({border:e=!1,className:r,classnames:o,icon:n,label:i,ref:l,shadow:c=!1,trend:d,trendVariant:u="neutral",value:h,...b})=>a.jsxs(id,{...b,ref:l,className:qe("container",r),$border:e,$shadow:c,children:[a.jsxs(nd,{children:[a.jsx(ad,{className:qe("label",o==null?void 0:o.label),children:i}),n&&a.jsx(ld,{children:n})]}),a.jsx(dd,{className:qe("value",o==null?void 0:o.value),children:h}),d&&a.jsx(cd,{className:qe("trend",o==null?void 0:o.trend),$variant:u,children:d})]}),pd=s.div`
1693
1765
  display: flex;
1694
1766
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1695
1767
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
1696
- `,Kl=s.div`
1768
+ `,ud=s.div`
1697
1769
  display: flex;
1698
1770
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1699
1771
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
@@ -1702,7 +1774,7 @@
1702
1774
  &:last-child {
1703
1775
  flex: 0;
1704
1776
  }
1705
- `,Ul=s.button`
1777
+ `,hd=s.button`
1706
1778
  display: flex;
1707
1779
  align-items: center;
1708
1780
  gap: 10px;
@@ -1711,7 +1783,7 @@
1711
1783
  background: transparent;
1712
1784
  cursor: ${e=>e.$clickable?"pointer":"default"};
1713
1785
  flex-shrink: 0;
1714
- `,Xl=s.div`
1786
+ `,bd=s.div`
1715
1787
  display: flex;
1716
1788
  align-items: center;
1717
1789
  justify-content: center;
@@ -1735,13 +1807,13 @@
1735
1807
  border: 2px solid ${t.COLORS.gray};
1736
1808
  color: ${t.COLORS["iron-grey"]};
1737
1809
  `}
1738
- `,ql=s.span`
1810
+ `,gd=s.span`
1739
1811
  font-size: 14px;
1740
1812
  font-weight: 500;
1741
1813
  white-space: nowrap;
1742
1814
  color: ${e=>e.$active||e.$completed?t.COLORS.black:t.COLORS["iron-grey"]};
1743
1815
  transition: color 0.2s ease;
1744
- `,Zl=s.div`
1816
+ `,fd=s.div`
1745
1817
  background-color: ${e=>e.$completed?t.COLORS.black:t.COLORS.gray};
1746
1818
  transition: background-color 0.2s ease;
1747
1819
 
@@ -1755,22 +1827,22 @@
1755
1827
  min-width: 16px;
1756
1828
  margin: 0 12px;
1757
1829
  `}
1758
- `,Ne=T.newClassNameGetter("stepper"),Jl=({className:e,classnames:r,onChange:o,orientation:n="horizontal",ref:i,steps:l,value:c,...d})=>{const p=u.useMemo(()=>l.findIndex(b=>b.value===c),[l,c]);return a.jsx(Wl,{...d,ref:i,$orientation:n,className:Ne("container",e),children:l.map((b,h)=>{const f=b.value===c,O=h<p,w=h===l.length-1;return a.jsxs(Kl,{$orientation:n,children:[a.jsxs(Ul,{type:"button",$active:f,$completed:O,$clickable:!!o,onClick:()=>o==null?void 0:o(b.value),className:Ne("step",r==null?void 0:r.step),children:[a.jsx(Xl,{$active:f,$completed:O,className:Ne("circle",r==null?void 0:r.circle),children:h+1}),a.jsx(ql,{$active:f,$completed:O,className:Ne("label",r==null?void 0:r.label),children:b.label})]}),!w&&a.jsx(Zl,{$completed:O,$orientation:n,className:Ne("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`
1830
+ `,Te=T.newClassNameGetter("stepper"),xd=({className:e,classnames:r,onChange:o,orientation:n="horizontal",ref:i,steps:l,value:c,...d})=>{const u=p.useMemo(()=>l.findIndex(h=>h.value===c),[l,c]);return a.jsx(pd,{...d,ref:i,$orientation:n,className:Te("container",e),children:l.map((h,b)=>{const f=h.value===c,O=b<u,m=b===l.length-1;return a.jsxs(ud,{$orientation:n,children:[a.jsxs(hd,{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(bd,{$active:f,$completed:O,className:Te("circle",r==null?void 0:r.circle),children:b+1}),a.jsx(gd,{$active:f,$completed:O,className:Te("label",r==null?void 0:r.label),children:h.label})]}),!m&&a.jsx(fd,{$completed:O,$orientation:n,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}},Od=s.div`
1759
1831
  position: relative;
1760
1832
  display: flex;
1761
1833
  flex-direction: column;
1762
1834
  gap: 4px;
1763
- `,ed=s(ie)`
1835
+ `,Sd=s(ne)`
1764
1836
  margin-left: 6px;
1765
- color: ${e=>Rt[e.$variant].label};
1766
- `,td=s.div`
1837
+ color: ${e=>kt[e.$variant].label};
1838
+ `,$d=s.div`
1767
1839
  display: flex;
1768
1840
  flex-wrap: wrap;
1769
1841
  align-items: center;
1770
1842
  gap: 6px;
1771
1843
  min-height: 44px;
1772
1844
  padding: 8px 12px;
1773
- border: 1px dashed ${e=>Rt[e.$variant].border};
1845
+ border: 1px dashed ${e=>kt[e.$variant].border};
1774
1846
  border-radius: 8px;
1775
1847
  background: ${t.COLORS.white};
1776
1848
  cursor: ${e=>e.$disabled?"not-allowed":"text"};
@@ -1778,14 +1850,14 @@
1778
1850
  transition: border-color 0.15s ease;
1779
1851
 
1780
1852
  &:hover {
1781
- border-color: ${e=>e.$disabled?Rt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1853
+ border-color: ${e=>e.$disabled?kt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1782
1854
  }
1783
1855
 
1784
1856
  ${e=>e.$focused&&`
1785
1857
  outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
1786
1858
  outline-offset: 2px;
1787
1859
  `}
1788
- `,rd=s.input`
1860
+ `,yd=s.input`
1789
1861
  flex: 1;
1790
1862
  min-width: 80px;
1791
1863
  border: none;
@@ -1802,7 +1874,7 @@
1802
1874
  &:disabled {
1803
1875
  cursor: not-allowed;
1804
1876
  }
1805
- `,Ar=`
1877
+ `,Fr=`
1806
1878
  z-index: 100;
1807
1879
  background-color: ${t.COLORS.white};
1808
1880
  border: 1px solid ${t.alpha(t.COLORS.black,15)};
@@ -1810,28 +1882,28 @@
1810
1882
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
1811
1883
  max-height: 200px;
1812
1884
  overflow-y: auto;
1813
- `,Dr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",_r=`
1885
+ `,Br=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Yr=`
1814
1886
  opacity 0.15s ease,
1815
1887
  transform 0.15s ease,
1816
1888
  visibility 0.15s;
1817
- `,od=s.div`
1889
+ `,Cd=s.div`
1818
1890
  position: absolute;
1819
1891
  left: 0;
1820
1892
  right: 0;
1821
1893
  ${e=>e.$position==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
1822
- ${Ar}
1894
+ ${Fr}
1823
1895
  opacity: ${e=>e.$open?1:0};
1824
1896
  visibility: ${e=>e.$open?"visible":"hidden"};
1825
- transform: ${e=>Dr(e.$open,e.$position)};
1826
- transition: ${_r};
1827
- `,id=s.div`
1897
+ transform: ${e=>Br(e.$open,e.$position)};
1898
+ transition: ${Yr};
1899
+ `,md=s.div`
1828
1900
  position: fixed;
1829
- ${Ar}
1901
+ ${Fr}
1830
1902
  opacity: ${e=>e.$open?1:0};
1831
1903
  visibility: ${e=>e.$open?"visible":"hidden"};
1832
- transform: ${e=>Dr(e.$open,e.$position)};
1833
- transition: ${_r};
1834
- `,br=s.button`
1904
+ transform: ${e=>Br(e.$open,e.$position)};
1905
+ transition: ${Yr};
1906
+ `,xr=s.button`
1835
1907
  display: flex;
1836
1908
  align-items: center;
1837
1909
  width: 100%;
@@ -1859,7 +1931,7 @@
1859
1931
  &:only-child {
1860
1932
  border-radius: 7px;
1861
1933
  }
1862
- `,gr=s.div`
1934
+ `,Or=s.div`
1863
1935
  display: flex;
1864
1936
  align-items: center;
1865
1937
  justify-content: center;
@@ -1867,11 +1939,11 @@
1867
1939
  color: ${t.COLORS["iron-grey"]};
1868
1940
  font-size: 14px;
1869
1941
  text-align: center;
1870
- `,ee=T.newClassNameGetter("tags"),qe=4,nd=({className:e,classnames:r,createKey:o="Tab",disabled:n=!1,emptyMessage:i="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:b="Add tag...",portalRenderNode:h,ref:f,value:O,variant:w="normal",...S})=>{const x=u.useRef(null),C=u.useRef(null),$=u.useRef(null),y=u.useRef(null),[g,L]=u.useState(""),[N,j]=u.useState(!1),[Y,P]=u.useState("bottom"),[_,M]=u.useState({top:0,left:0,width:0}),E=u.useMemo(()=>{const k=p.filter(U=>!O.includes(U.value));if(!g.trim())return k;const D=g.toLowerCase().trim();return k.filter(U=>U.label.toLowerCase().includes(D))},[p,O,g]),A=N&&p.length>0,m=u.useCallback(()=>{var _e;if(!C.current)return;const k=C.current.getBoundingClientRect(),D=((_e=$.current)==null?void 0:_e.offsetHeight)??200,U=window.innerHeight-k.bottom-qe,X=k.top-qe,fe=U<D&&X>U?"top":"bottom";if(P(fe),h){const rt=fe==="bottom"?k.bottom+qe:k.top-D-qe;M({top:rt,left:k.left,width:k.width})}},[h]);u.useEffect(()=>{if(N)return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[N,m]);const I=u.useCallback(k=>{const D=k.trim();return!D||O.includes(D)?!1:(d([...O,D]),L(""),!0)},[O,d]),R=k=>{if(k.key===o&&g.trim())if(k.preventDefault(),l)I(g);else{const D=E.find(U=>U.label.toLowerCase()===g.toLowerCase().trim());D&&I(D.value)}else k.key==="Backspace"&&!g&&O.length>0&&d(O.slice(0,-1))},z=k=>{var D;I(k),(D=y.current)==null||D.focus()},B=k=>{d(O.filter(D=>D!==k))},F=()=>{var k;n||(k=y.current)==null||k.focus()},H=k=>{const D=p.find(U=>U.value===k);return(D==null?void 0:D.label)??k};return a.jsxs(Ql,{...S,ref:f,className:ee("container",e),children:[c&&a.jsx(ed,{$variant:w,className:ee("label"),children:c}),a.jsxs("div",{ref:x,style:{position:"relative"},children:[a.jsxs(td,{ref:C,$variant:w,$disabled:n,$focused:N,onClick:F,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(k=>a.jsx(Je,{deletable:!n,onDelete:()=>B(k),className:ee("chip",r==null?void 0:r.chip),children:H(k)},k)),a.jsx(rd,{ref:y,type:"text",value:g,onChange:k=>L(k.target.value),onFocus:()=>j(!0),onBlur:()=>setTimeout(()=>j(!1),150),onKeyDown:R,placeholder:O.length===0?b:"",disabled:n,$disabled:n,className:ee("input",r==null?void 0:r.input)})]}),p.length>0&&(h?ge.createPortal(a.jsx(id,{ref:$,$open:A,$position:Y,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:E.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:i}):E.map(k=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>z(k.value),className:ee("option",r==null?void 0:r.option),children:k.label},k.value))}),h):a.jsx(od,{ref:$,$open:A,$position:Y,className:ee("dropdown",r==null?void 0:r.dropdown),children:E.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:i}):E.map(k=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>z(k.value),className:ee("option",r==null?void 0:r.option),children:k.label},k.value))}))]})]})},ad=s.div`
1942
+ `,ee=T.newClassNameGetter("tags"),Ze=4,wd=({className:e,classnames:r,createKey:o="Tab",disabled:n=!1,emptyMessage:i="No options",freeSolo:l=!0,label:c,onChange:d,options:u=[],placeholder:h="Add tag...",portalRenderNode:b,ref:f,value:O,variant:m="normal",...S})=>{const x=p.useRef(null),y=p.useRef(null),$=p.useRef(null),C=p.useRef(null),[g,k]=p.useState(""),[N,P]=p.useState(!1),[Y,j]=p.useState("bottom"),[_,M]=p.useState({top:0,left:0,width:0}),E=p.useMemo(()=>{const L=u.filter(U=>!O.includes(U.value));if(!g.trim())return L;const D=g.toLowerCase().trim();return L.filter(U=>U.label.toLowerCase().includes(D))},[u,O,g]),A=N&&u.length>0,w=p.useCallback(()=>{var _e;if(!y.current)return;const L=y.current.getBoundingClientRect(),D=((_e=$.current)==null?void 0:_e.offsetHeight)??200,U=window.innerHeight-L.bottom-Ze,X=L.top-Ze,xe=U<D&&X>U?"top":"bottom";if(j(xe),b){const ot=xe==="bottom"?L.bottom+Ze:L.top-D-Ze;M({top:ot,left:L.left,width:L.width})}},[b]);p.useEffect(()=>{if(N)return w(),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[N,w]);const I=p.useCallback(L=>{const D=L.trim();return!D||O.includes(D)?!1:(d([...O,D]),k(""),!0)},[O,d]),R=L=>{if(L.key===o&&g.trim())if(L.preventDefault(),l)I(g);else{const D=E.find(U=>U.label.toLowerCase()===g.toLowerCase().trim());D&&I(D.value)}else L.key==="Backspace"&&!g&&O.length>0&&d(O.slice(0,-1))},z=L=>{var D;I(L),(D=C.current)==null||D.focus()},B=L=>{d(O.filter(D=>D!==L))},F=()=>{var L;n||(L=C.current)==null||L.focus()},H=L=>{const D=u.find(U=>U.value===L);return(D==null?void 0:D.label)??L};return a.jsxs(Od,{...S,ref:f,className:ee("container",e),children:[c&&a.jsx(Sd,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:x,style:{position:"relative"},children:[a.jsxs($d,{ref:y,$variant:m,$disabled:n,$focused:N,onClick:F,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(L=>a.jsx(Qe,{deletable:!n,onDelete:()=>B(L),className:ee("chip",r==null?void 0:r.chip),children:H(L)},L)),a.jsx(yd,{ref:C,type:"text",value:g,onChange:L=>k(L.target.value),onFocus:()=>P(!0),onBlur:()=>setTimeout(()=>P(!1),150),onKeyDown:R,placeholder:O.length===0?h:"",disabled:n,$disabled:n,className:ee("input",r==null?void 0:r.input)})]}),u.length>0&&(b?fe.createPortal(a.jsx(md,{ref:$,$open:A,$position:Y,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:E.length===0?a.jsx(Or,{className:ee("empty",r==null?void 0:r.empty),children:i}):E.map(L=>a.jsx(xr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>z(L.value),className:ee("option",r==null?void 0:r.option),children:L.label},L.value))}),b):a.jsx(Cd,{ref:$,$open:A,$position:Y,className:ee("dropdown",r==null?void 0:r.dropdown),children:E.length===0?a.jsx(Or,{className:ee("empty",r==null?void 0:r.empty),children:i}):E.map(L=>a.jsx(xr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>z(L.value),className:ee("option",r==null?void 0:r.option),children:L.label},L.value))}))]})]})},vd=s.div`
1871
1943
  display: flex;
1872
1944
  align-items: center;
1873
1945
  gap: 6px;
1874
- `,ld=s.button`
1946
+ `,Rd=s.button`
1875
1947
  padding: 6px 16px;
1876
1948
  border: none;
1877
1949
  border-radius: 12px;
@@ -1889,14 +1961,14 @@
1889
1961
  &:hover:not(:disabled) {
1890
1962
  background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
1891
1963
  }
1892
- `,fr=T.newClassNameGetter("tabs"),dd=({className:e,classnames:r,onChange:o,ref:n,tabs:i,value:l,...c})=>a.jsx(ad,{...c,ref:n,className:fr("container",e),role:"tablist",children:i.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`
1964
+ `,Sr=T.newClassNameGetter("tabs"),Ld=({className:e,classnames:r,onChange:o,ref:n,tabs:i,value:l,...c})=>a.jsx(vd,{...c,ref:n,className:Sr("container",e),role:"tablist",children:i.map(d=>a.jsx(Rd,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:Sr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),$r={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)}},ce=e=>$r[e]??$r.normal,kd=s.div`
1893
1965
  display: grid;
1894
1966
  flex-direction: column;
1895
1967
  gap: 2px;
1896
1968
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1897
- `,sd=s(ie)`
1969
+ `,Ed=s(ne)`
1898
1970
  margin-left: 6px;
1899
- `,pd=s.textarea`
1971
+ `,jd=s.textarea`
1900
1972
  flex: 1;
1901
1973
  min-width: 0;
1902
1974
  outline: none;
@@ -1907,26 +1979,26 @@
1907
1979
  border-radius: 16px;
1908
1980
  resize: vertical;
1909
1981
 
1910
- color: ${e=>de(e.$variant).color.static};
1911
- border: 1px solid ${e=>de(e.$variant).border.static};
1912
- background-color: ${e=>de(e.$variant).background.static};
1982
+ color: ${e=>ce(e.$variant).color.static};
1983
+ border: 1px solid ${e=>ce(e.$variant).border.static};
1984
+ background-color: ${e=>ce(e.$variant).background.static};
1913
1985
 
1914
1986
  &::placeholder {
1915
- color: ${e=>de(e.$variant).placeholder.static};
1987
+ color: ${e=>ce(e.$variant).placeholder.static};
1916
1988
  }
1917
1989
 
1918
1990
  &:disabled {
1919
1991
  cursor: not-allowed;
1920
1992
  resize: none;
1921
- color: ${e=>de(e.$variant).color.disabled};
1922
- background-color: ${e=>de(e.$variant).background.disabled};
1923
- border-color: ${e=>de(e.$variant).border.disabled};
1993
+ color: ${e=>ce(e.$variant).color.disabled};
1994
+ background-color: ${e=>ce(e.$variant).background.disabled};
1995
+ border-color: ${e=>ce(e.$variant).border.disabled};
1924
1996
 
1925
1997
  &::placeholder {
1926
- color: ${e=>de(e.$variant).placeholder.disabled};
1998
+ color: ${e=>ce(e.$variant).placeholder.disabled};
1927
1999
  }
1928
2000
  }
1929
- `,Ot=T.newClassNameGetter("textarea"),ud=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,variant:c="normal",rows:d=4,...p})=>a.jsxs(cd,{className:Ot("container",e),$fullWidth:!!n,children:[i&&a.jsx(sd,{variant:c,className:Ot("label",r==null?void 0:r.label),children:i}),a.jsx(pd,{...p,ref:l,rows:d,disabled:o,$variant:c,className:Ot("textarea",r==null?void 0:r.textarea)})]}),Mr=u.createContext(null),St=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<St?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,n=e.toasts.filter(l=>l.id!==o),i=e.queue[0];return i&&n.length<St?{toasts:[...n,i],queue:e.queue.slice(1)}:{...e,toasts:n}}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}},bd={toasts:[],queue:[]},$t=e=>Or[e]??Or.default,gd=s.div`
2001
+ `,$t=T.newClassNameGetter("textarea"),Pd=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,variant:c="normal",rows:d=4,...u})=>a.jsxs(kd,{className:$t("container",e),$fullWidth:!!n,children:[i&&a.jsx(Ed,{variant:c,className:$t("label",r==null?void 0:r.label),children:i}),a.jsx(jd,{...u,ref:l,rows:d,disabled:o,$variant:c,className:$t("textarea",r==null?void 0:r.textarea)})]}),Vr=p.createContext(null),yt=3,yr={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}},zd=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<yt?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,n=e.toasts.filter(l=>l.id!==o),i=e.queue[0];return i&&n.length<yt?{toasts:[...n,i],queue:e.queue.slice(1)}:{...e,toasts:n}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=yt?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},Nd={toasts:[],queue:[]},Ct=e=>yr[e]??yr.default,Td=s.div`
1930
2002
  position: fixed;
1931
2003
  bottom: 24px;
1932
2004
  left: 24px;
@@ -1937,30 +2009,30 @@
1937
2009
  pointer-events: none;
1938
2010
  width: auto;
1939
2011
  max-width: 90vw;
1940
- `,fd=s.div`
2012
+ `,Id=s.div`
1941
2013
  display: flex;
1942
2014
  align-items: center;
1943
2015
  justify-content: space-between;
1944
2016
  gap: 12px;
1945
2017
  min-height: 32px;
1946
2018
  padding: 8px 8px 8px 16px;
1947
- background-color: ${({$variant:e})=>$t(e).background};
1948
- color: ${({$variant:e})=>$t(e).text};
1949
- border: 1px solid ${({$variant:e})=>$t(e).border};
2019
+ background-color: ${({$variant:e})=>Ct(e).background};
2020
+ color: ${({$variant:e})=>Ct(e).text};
2021
+ border: 1px solid ${({$variant:e})=>Ct(e).border};
1950
2022
  border-radius: 96px;
1951
2023
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1952
2024
  animation: ${({$isExiting:e})=>e?t.KEYFRAMES.slideOutBottomFade:t.KEYFRAMES.slideInBottomFade}
1953
2025
  0.3s ease-out;
1954
2026
  pointer-events: auto;
1955
2027
  max-width: 500px;
1956
- `,xd=s.span`
2028
+ `,Ad=s.span`
1957
2029
  font-size: 14px;
1958
2030
  font-weight: 500;
1959
2031
  line-height: 1.4;
1960
2032
  white-space: nowrap;
1961
2033
  overflow: hidden;
1962
2034
  text-overflow: ellipsis;
1963
- `,Od=s.button`
2035
+ `,Dd=s.button`
1964
2036
  display: flex;
1965
2037
  align-items: center;
1966
2038
  justify-content: center;
@@ -1978,13 +2050,13 @@
1978
2050
  &:hover {
1979
2051
  opacity: 1;
1980
2052
  }
1981
- `,Sd=s.div`
2053
+ `,_d=s.div`
1982
2054
  display: flex;
1983
2055
  align-items: center;
1984
2056
  justify-content: space-between;
1985
2057
  gap: 12px;
1986
2058
  width: 100%;
1987
- `,$d=s.div`
2059
+ `,Md=s.div`
1988
2060
  display: flex;
1989
2061
  align-items: center;
1990
2062
  justify-content: center;
@@ -1999,7 +2071,7 @@
1999
2071
  font-weight: 500;
2000
2072
  white-space: nowrap;
2001
2073
  margin-left: auto;
2002
- `,Sr=({toast:e,onHide:r})=>{const[o,n]=u.useState(!1),i=()=>{n(!0),setTimeout(()=>{r(e.id)},300)};return u.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{i()},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:i,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},yd=({toasts:e,queueCount:r,onHide:o})=>{if(e.length===0)return null;const n=e.length-1;return a.jsx(gd,{children:e.map((i,l)=>l===n&&r>0?a.jsxs(Sd,{children:[a.jsx(Sr,{toast:i,onHide:o}),a.jsxs($d,{children:["+",r]})]},i.id):a.jsx(Sr,{toast:i,onHide:o},i.id))})},Cd=({children:e})=>{const[r,o]=u.useReducer(hd,bd),n=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}})},[]),i=u.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Mr.Provider,{value:{show:n,hide:i},children:[e,a.jsx(yd,{toasts:r.toasts,queueCount:r.queue.length,onHide:i})]})},md=()=>{const e=u.useContext(Mr);if(!e)throw new Error("useToastr must be used within ToastProvider");return e},$r={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=>$r[e]??$r.dark,wd=(e,r)=>{const o=Ae(r).background;switch(e){case"top":return`
2074
+ `,Cr=({toast:e,onHide:r})=>{const[o,n]=p.useState(!1),i=()=>{n(!0),setTimeout(()=>{r(e.id)},300)};return p.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{i()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(Id,{$variant:e.variant,$isExiting:o,children:[a.jsx(Ad,{children:e.message}),a.jsx(Dd,{onClick:i,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},Fd=({toasts:e,queueCount:r,onHide:o})=>{if(e.length===0)return null;const n=e.length-1;return a.jsx(Td,{children:e.map((i,l)=>l===n&&r>0?a.jsxs(_d,{children:[a.jsx(Cr,{toast:i,onHide:o}),a.jsxs(Md,{children:["+",r]})]},i.id):a.jsx(Cr,{toast:i,onHide:o},i.id))})},Bd=({children:e})=>{const[r,o]=p.useReducer(zd,Nd),n=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}})},[]),i=p.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Vr.Provider,{value:{show:n,hide:i},children:[e,a.jsx(Fd,{toasts:r.toasts,queueCount:r.queue.length,onHide:i})]})},Yd=()=>{const e=p.useContext(Vr);if(!e)throw new Error("useToastr must be used within ToastProvider");return e},mr={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}},De=e=>mr[e]??mr.dark,Vd=(e,r)=>{const o=De(r).background;switch(e){case"top":return`
2003
2075
  bottom: -12px;
2004
2076
  left: 50%;
2005
2077
  margin-left: -6px;
@@ -2019,7 +2091,7 @@
2019
2091
  top: 50%;
2020
2092
  margin-top: -6px;
2021
2093
  border-right-color: ${o};
2022
- `;default:return""}},vd=(e,r)=>{if(r!=="light")return"";const o=Ae(r).border;switch(e){case"top":return`
2094
+ `;default:return""}},Hd=(e,r)=>{if(r!=="light")return"";const o=De(r).border;switch(e){case"top":return`
2023
2095
  &::after {
2024
2096
  bottom: -14px;
2025
2097
  left: 50%;
@@ -2047,11 +2119,11 @@
2047
2119
  margin-top: -7px;
2048
2120
  border-right-color: ${o};
2049
2121
  }
2050
- `;default:return""}},Fr=e=>`
2122
+ `;default:return""}},Hr=e=>`
2051
2123
  z-index: 1000;
2052
2124
  padding: 6px 12px;
2053
- background-color: ${Ae(e.$variant).background};
2054
- color: ${Ae(e.$variant).text};
2125
+ background-color: ${De(e.$variant).background};
2126
+ color: ${De(e.$variant).text};
2055
2127
  font-size: 13px;
2056
2128
  line-height: 1.4;
2057
2129
  border-radius: 6px;
@@ -2065,7 +2137,7 @@
2065
2137
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
2066
2138
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
2067
2139
 
2068
- ${e.$variant==="light"?`border: 1px solid ${Ae(e.$variant).border};`:""}
2140
+ ${e.$variant==="light"?`border: 1px solid ${De(e.$variant).border};`:""}
2069
2141
 
2070
2142
  &::before {
2071
2143
  content: '';
@@ -2073,7 +2145,7 @@
2073
2145
  width: 0;
2074
2146
  height: 0;
2075
2147
  border: 6px solid transparent;
2076
- ${wd(e.$placement,e.$variant)}
2148
+ ${Vd(e.$placement,e.$variant)}
2077
2149
  }
2078
2150
 
2079
2151
  ${e.$variant==="light"?`
@@ -2086,12 +2158,12 @@
2086
2158
  }
2087
2159
  `:""}
2088
2160
 
2089
- ${vd(e.$placement,e.$variant)}
2090
- `,Rd=s.div`
2161
+ ${Hd(e.$placement,e.$variant)}
2162
+ `,Gd=s.div`
2091
2163
  position: relative;
2092
2164
  display: inline-block;
2093
2165
  width: fit-content;
2094
- `,kd=e=>{switch(e){case"top":return`
2166
+ `,Wd=e=>{switch(e){case"top":return`
2095
2167
  bottom: calc(100% + 8px);
2096
2168
  left: 50%;
2097
2169
  transform: translateX(-50%);
@@ -2107,12 +2179,12 @@
2107
2179
  left: calc(100% + 8px);
2108
2180
  top: 50%;
2109
2181
  transform: translateY(-50%);
2110
- `;default:return""}},Ld=s.div`
2182
+ `;default:return""}},Kd=s.div`
2111
2183
  position: absolute;
2112
- ${e=>Fr(e)}
2113
- ${({$placement:e})=>kd(e)}
2114
- `,Ed=s.div`
2184
+ ${e=>Hr(e)}
2185
+ ${({$placement:e})=>Wd(e)}
2186
+ `,Ud=s.div`
2115
2187
  position: fixed;
2116
- ${e=>Fr(e)}
2117
- `,yt=T.newClassNameGetter("tooltip"),ce=8,Pd=({children:e,className:r,classnames:o,content:n,delay:i=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...b})=>{const[h,f]=u.useState(!1),[O,w]=u.useState(null),[S,x]=u.useState(l),[C,$]=u.useState({top:0,left:0}),y=u.useRef(null),g=u.useRef(null),L=u.useCallback(()=>{var z,B;if(!y.current)return;const P=y.current.getBoundingClientRect(),_=((z=g.current)==null?void 0:z.offsetWidth)??100,M=((B=g.current)==null?void 0:B.offsetHeight)??30,E=P.top-ce,A=window.innerHeight-P.bottom-ce,m=P.left-ce,I=window.innerWidth-P.right-ce;let R=l;if(l==="top"&&E<M&&A>E?R="bottom":l==="bottom"&&A<M&&E>A?R="top":l==="left"&&m<_&&I>m?R="right":l==="right"&&I<_&&m>I&&(R="left"),x(R),c){let F,H;switch(R){case"top":F=P.top-M-ce,H=P.left+P.width/2-_/2;break;case"bottom":F=P.bottom+ce,H=P.left+P.width/2-_/2;break;case"left":F=P.top+P.height/2-M/2,H=P.left-_-ce;break;case"right":F=P.top+P.height/2-M/2,H=P.right+ce;break;default:F=0,H=0}const k=8;H=Math.max(k,Math.min(H,window.innerWidth-_-k)),F=Math.max(k,Math.min(F,window.innerHeight-M-k)),$({top:F,left:H})}},[l,c]);u.useLayoutEffect(()=>{h&&L()},[h,L]);const N=()=>{const P=setTimeout(()=>{f(!0)},i);w(P)},j=()=>{O&&(clearTimeout(O),w(null)),f(!1)},Y=c?ge.createPortal(a.jsx(Ed,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:S,$variant:p,$visible:h,style:{top:C.top,left:C.left},children:n}),c):a.jsx(Ld,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:S,$variant:p,$visible:h,children:n});return a.jsxs(Rd,{...b,ref:P=>{y.current=P,typeof d=="function"?d(P):d&&(d.current=P)},className:yt("wrapper",r),onMouseEnter:N,onMouseLeave:j,children:[e,Y]})};exports.BREAKPOINTS=t.BREAKPOINTS;exports.COLORS=t.COLORS;exports.KEYFRAMES=t.KEYFRAMES;exports.KEY_SYMBOLS=t.KEY_SYMBOLS;exports.alpha=t.alpha;exports.getBrowser=t.getBrowser;exports.getKeySymbols=t.getKeySymbols;exports.getOperatingSystem=t.getOperatingSystem;exports.isValid=t.isValid;exports.mediaBetween=t.mediaBetween;exports.mediaDown=t.mediaDown;exports.mediaUp=t.mediaUp;exports.toHEX=t.toHEX;exports.useKeyBinding=t.useKeyBinding;exports.newClassNameGetter=T.newClassNameGetter;exports.Autocomplete=jo;exports.Button=De;exports.Card=Yo;exports.Checkbox=et;exports.CheckboxCard=Qo;exports.CheckboxGroup=oi;exports.Chip=Je;exports.ConfirmationProvider=fi;exports.Container=$i;exports.DatePicker=Ki;exports.Drawer=Ji;exports.Dropdown=nn;exports.EditableText=cn;exports.FieldLabel=ie;exports.FieldMessage=hn;exports.GlobalStyle=lo;exports.ImageCropper=$a;exports.Input=Pr;exports.KeySymbol=yr;exports.KeysBindings=Cr;exports.Modal=jr;exports.MultiSelect=Da;exports.NotificationProvider=Ka;exports.OtpCode=Qa;exports.Panel=nl;exports.Progress=dl;exports.Radio=Lt;exports.RadioCard=Sl;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=wr;exports.useConfirmation=xi;exports.useImageCropper=Er;exports.useNotification=Ua;exports.useSaveProgress=kl;exports.useToastr=md;
2188
+ ${e=>Hr(e)}
2189
+ `,mt=T.newClassNameGetter("tooltip"),se=8,Xd=({children:e,className:r,classnames:o,content:n,delay:i=200,placement:l="top",portalRenderNode:c,ref:d,variant:u="dark",...h})=>{const[b,f]=p.useState(!1),[O,m]=p.useState(null),[S,x]=p.useState(l),[y,$]=p.useState({top:0,left:0}),C=p.useRef(null),g=p.useRef(null),k=p.useCallback(()=>{var z,B;if(!C.current)return;const j=C.current.getBoundingClientRect(),_=((z=g.current)==null?void 0:z.offsetWidth)??100,M=((B=g.current)==null?void 0:B.offsetHeight)??30,E=j.top-se,A=window.innerHeight-j.bottom-se,w=j.left-se,I=window.innerWidth-j.right-se;let R=l;if(l==="top"&&E<M&&A>E?R="bottom":l==="bottom"&&A<M&&E>A?R="top":l==="left"&&w<_&&I>w?R="right":l==="right"&&I<_&&w>I&&(R="left"),x(R),c){let F,H;switch(R){case"top":F=j.top-M-se,H=j.left+j.width/2-_/2;break;case"bottom":F=j.bottom+se,H=j.left+j.width/2-_/2;break;case"left":F=j.top+j.height/2-M/2,H=j.left-_-se;break;case"right":F=j.top+j.height/2-M/2,H=j.right+se;break;default:F=0,H=0}const L=8;H=Math.max(L,Math.min(H,window.innerWidth-_-L)),F=Math.max(L,Math.min(F,window.innerHeight-M-L)),$({top:F,left:H})}},[l,c]);p.useLayoutEffect(()=>{b&&k()},[b,k]);const N=()=>{const j=setTimeout(()=>{f(!0)},i);m(j)},P=()=>{O&&(clearTimeout(O),m(null)),f(!1)},Y=c?fe.createPortal(a.jsx(Ud,{ref:g,className:mt("content",o==null?void 0:o.content),$placement:S,$variant:u,$visible:b,style:{top:y.top,left:y.left},children:n}),c):a.jsx(Kd,{ref:g,className:mt("content",o==null?void 0:o.content),$placement:S,$variant:u,$visible:b,children:n});return a.jsxs(Gd,{...h,ref:j=>{C.current=j,typeof d=="function"?d(j):d&&(d.current=j)},className:mt("wrapper",r),onMouseEnter:N,onMouseLeave:P,children:[e,Y]})};exports.BREAKPOINTS=t.BREAKPOINTS;exports.COLORS=t.COLORS;exports.KEYFRAMES=t.KEYFRAMES;exports.KEY_SYMBOLS=t.KEY_SYMBOLS;exports.alpha=t.alpha;exports.getBrowser=t.getBrowser;exports.getKeySymbols=t.getKeySymbols;exports.getOperatingSystem=t.getOperatingSystem;exports.isValid=t.isValid;exports.mediaBetween=t.mediaBetween;exports.mediaDown=t.mediaDown;exports.mediaUp=t.mediaUp;exports.toHEX=t.toHEX;exports.useKeyBinding=t.useKeyBinding;exports.newClassNameGetter=T.newClassNameGetter;exports.Autocomplete=Io;exports.Button=ge;exports.Card=Wo;exports.Checkbox=tt;exports.CheckboxCard=oi;exports.CheckboxGroup=li;exports.Chip=Qe;exports.ConfirmationProvider=$i;exports.Container=wi;exports.DatePicker=Zi;exports.Divider=en;exports.Drawer=an;exports.Dropdown=un;exports.EditableText=fn;exports.FieldLabel=ne;exports.FieldMessage=$n;exports.GlobalStyle=uo;exports.ImageCropper=La;exports.Input=Nr;exports.KeySymbol=wr;exports.KeysBindings=vr;exports.Modal=Tr;exports.MultiSelect=Ha;exports.NotificationProvider=el;exports.NotifyConfirmationProvider=ul;exports.OtpCode=Ol;exports.Panel=wl;exports.Progress=Ll;exports.Radio=jt;exports.RadioCard=_l;exports.RadioGroup=Yl;exports.SaveProgressProvider=Gl;exports.Select=rd;exports.Spinner=Et;exports.StatusCard=sd;exports.Stepper=xd;exports.Tabs=Ld;exports.Tags=wd;exports.Textarea=Pd;exports.ToastProvider=Bd;exports.Tooltip=Xd;exports.formatDateGo=Lr;exports.useConfirmation=yi;exports.useImageCropper=zr;exports.useNotification=tl;exports.useNotifyConfirmation=hl;exports.useSaveProgress=Wl;exports.useToastr=Yd;
2118
2190
  //# sourceMappingURL=index.cjs.map