@vacano/ui 1.4.3 → 1.4.5

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