aha-components 1.7.3 → 1.7.4
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/Popover.esm.js +1 -1
- package/dist/Popover.esm.js.map +1 -1
- package/dist/Popover.js +1 -1
- package/dist/Popover.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o,{createContext as r,useMemo as i,useContext as a,useState as l,useEffect as d,useCallback as s,forwardRef as c,useRef as u,useImperativeHandle as p}from"react";import{createPortal as f}from"react-dom";var h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},h(e,t)};var g=function(){return g=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},g.apply(this,arguments)};function v(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function x(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function l(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}d((o=o.apply(e,t||[])).next())})}function m(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(d){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,d])}}}function y(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var b={primaryColor:"#FB6011"},w=r(b),C=function(t){var n=t.theme,o=t.children,r=i(function(){return g(g({},b),n)},[n]);return e(w.Provider,{value:r,children:o})},F=function(){var e=a(w);return e||b},k={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},D=function(o){var r=o.size,i=o.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},S=function(n){var o,r=n.children,i=n.type,a=void 0===i?"default":i,d=n.size,s=void 0===d?"medium":d,c=n.disabled,u=void 0!==c&&c,p=n.loading,f=void 0!==p&&p,h=n.onClick,x=n.htmlType,m=void 0===x?"button":x,y=n.className,b=void 0===y?"":y,w=n.style,C=n.icon,S=n.iconPosition,E=void 0===S?"left":S,M=v(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),A=F().primaryColor,L=void 0===A?"#FB6011":A,z=l(!1),B=z[0],T=z[1],W=l(!1),N=W[0],I=W[1],R=k[s],j=u||f,H=function(){if(f){var t="primary"===a?"#FFFFFF":"#101828",n=parseInt(R.iconSize.replace("px",""));return e(D,{size:n,color:t})}return C?e("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:R.iconSize,height:R.iconSize,flexShrink:0},children:C}):null},Y=(o=g({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:R.gap,height:R.height,paddingLeft:R.paddingLeft,paddingRight:R.paddingRight,fontSize:R.fontSize,lineHeight:R.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:j?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},w),"primary"===a?(o.color="#FFFFFF",o.backgroundColor=L,u?(o.opacity=.4,o.cursor="not-allowed"):f?o.backgroundColor=L:N?o.backgroundColor="#EC470A":B&&(o.backgroundColor="#FD843A")):u?(o.backgroundColor="#FAFAF9",o.color="#D6D3D1",o.border="1px solid #E7E5E4"):f?(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):N?(o.backgroundColor="#F5F5F4",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(o.backgroundColor="#FAFAF9",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),o);return t("button",g({type:m,className:"aha-button aha-button--".concat(a," aha-button--").concat(s," ").concat(j?"aha-button--disabled":""," ").concat(f?"aha-button--loading":""," ").concat(b),disabled:j,onClick:function(e){j?e.preventDefault():null==h||h(e)},onMouseEnter:function(){return!j&&T(!0)},onMouseLeave:function(){T(!1),I(!1)},onMouseDown:function(){return!j&&I(!0)},onMouseUp:function(){return I(!1)},style:Y},M,{children:[f&&H(),!f&&"left"===E&&H(),r&&e("span",{style:{display:"inline-block"},children:r}),!f&&"right"===E&&H()]}))};S.displayName="Button";var E={success:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},M=e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),A=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,d=n.title,s=n.description,c=n.icon,u=void 0===c?E[a]:c,p=n.showIcon,f=void 0===p||p,h=n.closeable,g=void 0!==h&&h,v=n.action,x=n.children,m=n.onClose,y=l(!0),b=y[0],w=y[1],C=function(){w(!1),null==m||m()},F=v||g;return b?t("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[f&&u,t("div",{className:"flex flex-col gap-1 ".concat(F?"flex-1 min-w-0":""),children:[d&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:d}),s&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),x&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:x})]}),F&&t("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[v,g&&e("div",{className:"cursor-pointer relative top-[-12px]",onClick:C,onKeyDown:function(e){return"Enter"===e.key&&C()},role:"button",tabIndex:0,"aria-label":"关闭",children:M})]})]}):null},L={success:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},z=function(t){var n=t.className;return e("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},B=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return y([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),T=new B,W=function(){var o=l([]),r=o[0],i=o[1];d(function(){console.log("Toast: ToastContainer 组件已挂载");var e=T.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=T.subscribe(function(){var e=T.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=r.filter(function(e){return"top-left"===e.props.position}),s=r.filter(function(e){return"top-right"===e.props.position}),c=r.filter(function(e){return"bottom-left"===e.props.position}),u=r.filter(function(e){return"bottom-right"===e.props.position});return t(n,{children:[e("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e(N,g({},t),t.id)})}),e("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e(N,g({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e(N,g({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:u.map(function(t){return e(N,g({},t),t.id)})})]})},N=function(n){var o=n.id,r=n.props,i=l(!1),a=i[0],c=i[1],u=l(!1),p=u[0],f=u[1],h=r.message,g=r.type,v=void 0===g?"info":g,x=r.duration,m=void 0===x?3e3:x,y=r.icon,b=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var D=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:L.success};case"error":return{bgColor:"#E7000B",defaultIcon:L.error};case"question":return{bgColor:"#1C1917",defaultIcon:L.question};default:return{bgColor:"#1447E6",defaultIcon:L.info}}}(v);d(function(){var e=setTimeout(function(){c(!0)},10);return function(){return clearTimeout(e)}},[]),d(function(){if(m>0){var e=setTimeout(function(){S()},m);return function(){return clearTimeout(e)}}},[m,o]);var S=s(function(){f(!0),setTimeout(function(){T.removeToast(o),null==F||F()},300)},[o,F]),E=s(function(){null==k||k()},[k]);return e("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!p?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!p?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:E,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:D.bgColor,color:"white"},children:[e("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:y||D.defaultIcon}),t("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:h}),b&&e("div",{style:{marginTop:"12px"},children:b})]}),C&&e("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e(z,{})})]})})},I=function(t){return e(N,{id:"direct",props:t})},R=function(e){return console.log("Toast: 调用 toast 函数",e),_(),setTimeout(function(){var t=T.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},j=function(e){T.removeToast(e)},H=function(){T.clearAll()},Y=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",T.getToasts()),console.log("容器根节点:",Z),console.log("是否正在初始化:",K),console.log("====================")},O=function(e,t){return _(),R(g(g({},t),{message:e,type:"success"}))},V=function(e,t){return _(),R(g(g({},t),{message:e,type:"error"}))},P=function(e,t){return _(),R(g(g({},t),{message:e,type:"info"}))},q=function(e,t){return _(),R(g(g({},t),{message:e,type:"question"}))},X=null,Z=null,K=!1,_=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(K)console.log("Toast: 容器正在初始化中,跳过");else if(X)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),K=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),X=t,void(K=!1);console.log("Toast: 创建容器元素"),(X=document.createElement("div")).id="aha-toast-container",document.body.appendChild(X),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),Z=n(X),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(W,{})),console.log("Toast: 容器渲染完成"),K=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),Z=n(X),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(W,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}K=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),K=!1})}}catch(e){console.error("Toast: 创建容器失败",e),K=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},G=function(o){var r=o.children,i=l(!1),a=i[0],s=i[1];return d(function(){s(!0)},[]),t(n,{children:[r,a&&f(e(W,{}),document.body)]})},J={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},U={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},Q=function(n){var r=n.children,i=n.color,a=n.variant,l=void 0===a?"light":a,d=n.size,s=void 0===d?"large":d,c=n.stroke,u=void 0!==c&&c,p=n.icon,f=n.iconPosition,h=void 0===f?"none":f,x=n.className,m=void 0===x?"":x,y=n.onClick,b=v(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=F().primaryColor,C=function(e,t){if("string"==typeof e&&e in J){var n=J[e];return"Orange"===e&&t?g(g({},n),{fill:g(g({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),r=parseInt(o.substr(0,2),16),i=parseInt(o.substr(2,2),16),a=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return J.Green}(i,w),k=U[s],D={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===s?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===s?"1.375":"1",transition:"all 0.2s",fontSize:"large"===s?"14px":"12px",height:"small"===s?"20px":"24px"};"light"===l&&(D.backgroundColor=C.light.bg,D.color=C.light.text,u&&(D.outline="1px solid",D.outlineOffset="-1px",D.outlineColor=function(e){if("string"==typeof e&&e in J)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(r,", 0.3)")}return"#A4F4CF"}(i))),y&&(D.cursor="pointer",D.opacity="1");var S=["rounded-md","inline-flex","justify-start","items-center",k.padding,k.gap,"font-medium","font-dm-sans","large"===s?"leading-snug":"leading-none","transition-colors","duration-200","small"===s?"h-5":"h-6"].filter(Boolean);"fill"===l&&(D.backgroundColor=C.fill.bg,D.color=C.fill.text),y&&S.push("cursor-pointer","hover:opacity-80"),m&&S.push(m);var E=S.join(" "),M=function(){if(!p)return null;var t=function(e,t){if("string"==typeof e&&e in J)switch(e){case"Green":default:return"#009966";case"Red":return"#E7000B";case"Orange":return t||"#E17100";case"Blue":return"#155DFC";case"Yellow":return"#EC470A";case"Cyan":return"#0092B8";case"Violet":return"#7F22FE";case"Pink":return"#E60076";case"Gray":return"#57534D"}return"string"==typeof e&&e.startsWith("#")?e:"#009966"}(i,w),n="small"===s?"14px":"16px";return e("div",{className:"flex items-center justify-center",style:{width:n,height:n},children:"svg"===p.type?o.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",g({className:E,style:D,onClick:y},b,{children:["leading"===h&&M(),e("div",{className:"px-1 flex justify-center items-center",children:e("div",{className:"justify-center ".concat(k.textSize," font-medium font-dm-sans ").concat("large"===s?"leading-snug":"leading-none"),children:r})}),"after"===h&&M()]}))},$=c(function(r,i){var a=r.size,l=void 0===a?"medium":a,s=r.disabled,c=void 0!==s&&s,p=r.error,f=void 0!==p&&p,h=r.readOnly,x=void 0!==h&&h,m=r.prefix,y=r.suffix,b=r.allowClear,w=void 0!==b&&b,C=r.onClear,k=r.className,D=void 0===k?"":k,S=r.style,E=r.type,M=void 0===E?"text":E,A=r.placeholder,L=r.value,z=r.defaultValue,B=r.onChange,T=r.onFocus,W=r.onBlur,N=r.onPressEnter,I=v(r,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),R=F().primaryColor,j=void 0===R?"#FB6011":R,H=u(null),Y=o.useState(z||L||""),O=Y[0],V=Y[1],P=o.useState(!1),q=P[0],X=P[1];d(function(){"function"==typeof i?i(H.current):i&&(i.current=H.current)},[i]);var Z=void 0!==L,K=Z?L:O,_=function(e){var t;e.stopPropagation(),Z||V("");null==B||B({target:{value:""},currentTarget:{value:""}}),null==C||C(),null===(t=H.current)||void 0===t||t.focus()},G=w&&K&&!c,J={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},U=y||G?"40px":"12px",Q=g({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":q?j:"#D7D3D0"),backgroundColor:c||x?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:m?"40px":"12px",paddingRight:U,paddingTop:J[l].paddingTop,paddingBottom:J[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},S);return t(n,{children:[e("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n /* 移除数字输入框的上下箭头 */\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] {\n -moz-appearance: textfield;\n }\n '}),t("div",{className:"aha-input-wrapper ".concat(D),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[m&&e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:m}),e("input",g({ref:H,type:M,value:K,placeholder:A,disabled:c,readOnly:x,onChange:function(e){Z||V(e.target.value),null==B||B(e)},onFocus:function(e){X(!0),null==T||T(e)},onBlur:function(e){X(!1),null==W||W(e)},onKeyDown:function(e){var t;"Enter"===e.key&&N&&N(e),null===(t=I.onKeyDown)||void 0===t||t.call(I,e)},style:Q,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(y||G)&&t("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[G&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:_,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),y&&e("span",{style:{pointerEvents:"none"},children:y})]})]})]})});$.displayName="Input";var ee=function(r){var a,c=r.value,p=r.defaultValue,h=r.options,v=void 0===h?[]:h,x=r.mode,m=r.disabled,b=void 0!==m&&m,w=r.error,C=void 0!==w&&w,k=r.placeholder,D=void 0===k?"Please select":k,S=r.size,E=void 0===S?"medium":S,M=r.showSearch,A=void 0!==M&&M,L=r.filterOption,z=void 0===L||L,B=r.allowClear,T=void 0!==B&&B,W=r.onChange,N=r.onSelect,I=r.onDeselect,R=r.onSearch,j=r.onFocus,H=r.onBlur,Y=r.onDropdownVisibleChange,O=r.className,V=void 0===O?"":O,P=r.style,q=r.dropdownClassName,X=void 0===q?"":q,Z=r.dropdownStyle,K=r.defaultOpen,_=void 0!==K&&K,G=r.open,J=r.maxTagCount,U=r.tagRender,Q=r.optionRender,$=F().primaryColor,ee=void 0===$?"#FB6011":$,te=l(void 0!==p?p:x?[]:void 0),ne=te[0],oe=te[1],re=l(_),ie=re[0],ae=re[1],le=l(""),de=le[0],se=le[1],ce=l(-1),ue=ce[0],pe=ce[1],fe=u(null),he=u(null),ge=u(null),ve=l(null),xe=ve[0],me=ve[1],ye=void 0!==c,be=void 0!==G,we=ye?c:ne,Ce=be?G:ie,Fe="multiple"===x||"tags"===x,ke=s(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(t){return e.includes(t.value)})},[we,v]),De=s(function(){return A&&de?!1===z?v:"function"==typeof z?v.filter(function(e){return z(de,e)}):v.filter(function(e){var t=String(e.label||"").toLowerCase(),n=de.toLowerCase();return t.includes(n)}):v},[v,de,A,z]),Se=i(function(){return De()},[De]);d(function(){if(Ce&&fe.current){var e=function(){var e,t;if(fe.current){var n=fe.current.getBoundingClientRect(),o=null!==(t=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*Se.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;me({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Ce,Se.length]),d(function(){var e=function(e){var t=e.target;fe.current&&!fe.current.contains(t)&&ge.current&&!ge.current.contains(t)&&(be||ae(!1),null==Y||Y(!1),se(""))};if(Ce)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Ce,be,Y]),d(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Se.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var n=Se[ue];n&&!n.disabled&&Ee(n)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!1),null==Y||Y(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,Se,ue,be,Y]),d(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Ee=s(function(e){var t;if(!e.disabled)if(Fe){var n,o=Array.isArray(we)?we:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==I||I(e.value,e)):(n=y(y([],o,!0),[e.value],!1),null==N||N(e.value,e)),ye||oe(n);var r=v.filter(function(e){return n.includes(e.value)});null==W||W(n,r)}else ye||oe(e.value),null==W||W(e.value,e),null==N||N(e.value,e),be||ae(!1),null==Y||Y(!1),se(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,v,W,N,I,Y]),Me=s(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),o=v.find(function(e){return e.value===t});ye||oe(n),null==W||W(n,ke()),null==I||I(t,o)}},[Fe,we,ye,v,W,I,ke]),Ae=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||oe(t),null==W||W(t,[]),se("")},Le={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},ze=i(function(){return ke()},[ke]),Be=i(function(){return T&&we&&!b},[T,we,b]),Te=i(function(){return Fe?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Fe,we]),We=i(function(){if(!Fe||!Array.isArray(we)||0===we.length)return null;var n="responsive"===J?ze.slice(0,2):J?ze.slice(0,J):ze,r=J&&ze.length>n.length?ze.length-n.length:0;return t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var r={label:n.label,value:n.value,closable:!b,onClose:function(){return Me({},n.value)}};return U?e(o.Fragment,{children:U(r)},n.value):t("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!b&&e("span",{onClick:function(e){return Me(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),r>0&&t("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",r]})]})},[Fe,we,ze,J,b,U]);return t(n,{children:[e("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),t("div",{ref:fe,className:"aha-select ".concat(V),style:g({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(C?"#F04438":Ce?ee:"#D7D3D0"),backgroundColor:b?"#FAFAF9":"#FFFFFF",cursor:b?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Le[E].paddingTop,paddingBottom:Le[E].paddingBottom,fontSize:Le[E].fontSize,lineHeight:Le[E].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},P),onClick:function(){if(!b){var e=!Ce;be||ae(e),null==Y||Y(e),e&&A?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==j||j(e)},onBlur:function(e){null==H||H(e)},onTouchStart:function(e){b||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:b?-1:0,children:[e("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Fe?We||e("span",D?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:D}:{style:{flex:1,minHeight:"24px"}}):A&&Ce?e("input",{ref:he,type:"text",value:de,onChange:function(e){var t=e.target.value;se(t),null==R||R(t),pe(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:b?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Te?void 0:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Te?b?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Te?(null===(a=ze[0])||void 0===a?void 0:a.label)||we:D||" "})}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Be&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ae,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Ce})]})]}),Ce&&xe&&f(e("div",{ref:ge,className:"aha-select-dropdown ".concat(X),style:g({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===xe.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===xe.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},Z),children:0===Se.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Se.map(function(n,o){var r=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,i=o===ue;return Q?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Ee(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Q(n,{selected:r,focused:i,disabled:n.disabled||!1})},n.value):t("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return Ee(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e("span",{children:n.label}),r&&e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:e("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};ee.displayName="Select";var te=function(t){var n=t.className,o=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ne=function(t){var n=t.className,o=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},oe=function(t){var n=t.className,o=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},re=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ie=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ae=function(t){var n=t.className,o=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},le=function(t){var n=t.className,o=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},de=function(n){var o=n.className,r=n.style;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("g",{clipPath:"url(#clip0_54_1653)",children:e("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e("defs",{children:e("clipPath",{id:"clip0_54_1653",children:e("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},se=function(o){var r=o.current,a=o.defaultCurrent,s=void 0===a?1:a,c=o.total,u=void 0===c?0:c,p=o.pageSize,f=o.defaultPageSize,h=void 0===f?10:f,v=o.showSizeChanger,x=void 0!==v&&v,m=o.pageSizeOptions,y=void 0===m?["10","20","50","100"]:m,b=o.showQuickJumper,w=void 0!==b&&b,C=o.showTotal,k=o.onChange,D=o.onShowSizeChange,E=o.simple,M=void 0!==E&&E,A=o.disabled,L=void 0!==A&&A,z=o.hideOnSinglePage,B=void 0!==z&&z,T=o.className,W=void 0===T?"":T,N=o.style,I=o.size,R=void 0===I?"default":I,j=o.responsive,H=void 0!==j&&j;o.showLessItems;var Y=o.itemRender,O=F().primaryColor,V=void 0===O?"#FB6011":O,P=l(s),q=P[0],X=P[1],Z=l(h),K=Z[0],_=Z[1],G=l(""),J=G[0],U=G[1],Q=null!=r?r:q,te=null!=p?p:K,ne=i(function(){return Math.ceil(u/te)},[u,te]);d(function(){void 0!==r&&X(r)},[r]),d(function(){void 0!==p&&_(p)},[p]);var oe=function(e){e<1||e>ne||e===Q||L||(void 0===r&&X(e),null==k||k(e,te))},re=function(){var e=parseInt(J,10);e>=1&&e<=ne&&(oe(e),U(""))};if(B&&ne<=1)return null;if(M)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(W),style:N,children:[e(S,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ae,{})}),t("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ne]}),e(S,{onClick:function(){return oe(Q+1)},disabled:L||Q===ne,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(le,{})})]});var ie=(Q-1)*te+1,de=Math.min(Q*te,u);return t("div",{className:"aha-pagination w-full ".concat(W),style:g({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:H?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},N),children:[C&&e("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(u,[ie,de])}),t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[u>0&&e(n,{children:Y?Y(Q-1,"prev",e(S,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ae,{})})):e(S,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ae,{})})}),e("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ne<=7)return Array.from({length:ne},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ne)}else if(Q>=ne-3){e.push(1),e.push("jump-prev");for(t=ne-4;t<=ne;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ne)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e(S,{onClick:function(){return oe(t)},disabled:L,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",o):o}if("jump-prev"===t)return o=e(S,{onClick:function(){return oe(Math.max(1,Q-5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e(S,{onClick:function(){return oe(Math.min(ne,Q+5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(Q+5,"jump-next",o):o;return null}(t)})}),u>0&&e(n,{children:Y?Y(Q+1,"next",e(S,{onClick:function(){return oe(Q+1)},disabled:L||Q===ne,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(le,{})})):e(S,{onClick:function(){return oe(Q+1)},disabled:L||Q===ne,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(le,{})})}),x&&e(ee,{value:te,options:y.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(u/t),o=Q>n?n:Q,void 0===p&&_(t),void 0===r&&X(o),null==D||D(o,t),void(null==k||k(o,t));var t,n,o},disabled:L,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),w&&t("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e($,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:re,disabled:L,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof w&&w.goButton?e(S,{onClick:re,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:w.goButton}):e(S,{onClick:re,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},ce=function(n){var o=n.checked,r=void 0!==o&&o,i=n.indeterminate,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.className,u=void 0===c?"":c,p=n.style,f=n.children,h=F().primaryColor,v=r||a,x=d?"#FAFAF9":v?h:"white",m=d?"#FAFAF9":v?h:"#D7D3D0";return t("div",{className:"aha-checkbox ".concat(u),style:g({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},p),onClick:function(e){d||(null==s||s({target:{checked:!r},currentTarget:{checked:!r}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:v?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:e(a?ne:te,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),e("input",{type:"checkbox",checked:r,ref:function(e){e&&(e.indeterminate=a)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};ce.displayName="Checkbox";var ue=function(o){var r=o.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},pe=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e(ue,{color:o}):n;return e("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},fe=function(e,t){return"string"==typeof t?null==e?void 0:e[t]:t.reduce(function(e,t){return null==e?void 0:e[t]},e)},he=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=fe(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},ge=function(t){var n=t.order,o=F().primaryColor;return"ascend"===n?e(ie,{style:{color:o}}):"descend"===n?e(re,{style:{color:o}}):e(oe,{})},ve=function(n){var r,a,c,p,f=n.columns,h=void 0===f?[]:f,x=n.dataSource,m=void 0===x?[]:x,b=n.rowKey,w=void 0===b?"key":b,C=n.rowSelection,k=n.pagination,D=void 0!==k&&k,S=n.size,E=void 0===S?"middle":S,M=n.bordered,A=void 0!==M&&M,L=n.loading,z=void 0!==L&&L,B=n.locale,T=n.showHeader,W=void 0===T||T,N=n.title,I=n.footer,R=n.summary,j=n.scroll,H=n.tableLayout,Y=void 0===H?"auto":H,O=n.onChange,V=n.onSorterChange,P=n.onPaginationChange,q=n.onRow,X=n.className,Z=void 0===X?"":X,K=n.innerClassName,_=void 0===K?"":K,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=v(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=F().primaryColor||"#FB6011",te=l((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];d(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&oe(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var re=l(new Map),ie=re[0],ae=re[1],le=l((null==J?void 0:J.defaultExpandedRowKeys)||[]),de=le[0],ue=le[1],ve=l(D&&"object"==typeof D&&(D.current||D.defaultCurrent)||1),xe=ve[0],me=ve[1],ye=l(D&&"object"==typeof D&&(D.pageSize||D.defaultPageSize)||10),be=ye[0],we=ye[1];d(function(){D&&"object"==typeof D&&(void 0!==D.current&&me(D.current),void 0!==D.pageSize&&we(D.pageSize))},[D]);var Ce=l(null),Fe=Ce[0],ke=Ce[1],De=l(null),Se=De[0],Ee=De[1],Me=l(!1),Ae=Me[0],Le=Me[1],ze=u(null),Be=u(null);d(function(){var e=function(){Le(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Te=s(function(e,t){var n,o,r,i=null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e);if(!(null==i?void 0:i.disabled)){var a,l=he(e,w);a="radio"===(null==C?void 0:C.type)?t?[l]:[]:t?y(y([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var d=m.filter(function(e){return a.includes(he(e,w))});null===(o=null==C?void 0:C.onChange)||void 0===o||o.call(C,a,d),null===(r=null==C?void 0:C.onSelect)||void 0===r||r.call(C,e,t,d,new Event("select"))}},[ne,w,C,m]),We=s(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}).map(function(e){return he(e,w)}),i=e?r:[];oe(i);var a=m.filter(function(e){return i.includes(he(e,w))}),l=e?t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}):[];null===(n=null==C?void 0:C.onChange)||void 0===n||n.call(C,i,a),null===(o=null==C?void 0:C.onSelectAll)||void 0===o||o.call(C,e,a,l)},[w,C,m]),Ne=s(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),V&&V(1===r.length?r[0]:r),O&&O({current:xe,pageSize:be},{},1===r.length?r[0]:r,{currentDataSource:m,action:"sort"})}},[ie,O,V,xe,be,m,h]);s(function(e,t){var n,o,r,i=he(e,w);r=t?y(y([],de,!0),[i],!1):de.filter(function(e){return e!==i}),ue(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[de,w,J]);var Ie,Re=s(function(){var e=y([],m,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=fe(e,r.dataIndex||n),l=fe(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[m,ie,h]),je=Re(),He=Boolean(D&&"object"==typeof D&&void 0!==D.total),Ye=i(function(){if(!1===D||!D)return je;if(He)return je;var e=(xe-1)*be,t=e+be;return je.slice(e,t)},[je,xe,be,D,He]),Oe=s(function(e,t){var n,o,r=null!=t?t:be;if(me(e),t&&we(t),P&&P(e,r),D&&"object"==typeof D&&(null===(n=D.onChange)||void 0===n||n.call(D,e,t),t&&(null===(o=D.onShowSizeChange)||void 0===o||o.call(D,e,t))),O){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});O({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:je,action:"paginate"})}},[D,P,O,be,ie,h,je]),Ve=s(function(e,t,n){var o=fe(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Pe=s(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(C&&("left"===C.fixed||!0===C.fixed))r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=h[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<h.length;i++){var a;if("right"===(a=h[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(C&&"right"===C.fixed)r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return r}}},[h,C]),qe=s(function(){if(!W)return null;var n,o,r,i,a=h.map(function(n,o){var r,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||o,a=ie.get(i)||null,l=Pe(o,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e("th",g({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:d,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:d||void 0,maxWidth:d,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(r=n.onHeaderCell)||void 0===r?void 0:r.call(n,n))||{},{children:t("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:a,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){Ne(n,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e(ge,{order:a||void 0})})]})}),i)});if(C){var l="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",d=e("th",{style:{width:l,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!C.hideSelectAll&&"radio"!==C.type&&(n=Ye.filter(function(e){var t;return!(null===(t=C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}),o=n.map(function(e){return he(e,w)}),r=n.length>0&&o.every(function(e){return ne.includes(e)}),i=o.some(function(e){return ne.includes(e)}),e(ce,{checked:r,indeterminate:i&&!r,onChange:function(e){return We(e.target.checked,Ye)}})),C.columnTitle&&e("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");a.unshift(d)}var s=null==Q?void 0:Q(h,0);return e("thead",{ref:Be,children:e("tr",g({},s||{},{children:a}))})},[h,W,ie,C,ne,Ye,w,Ne,We,B,Q,Pe]),Xe=s(function(e){ke(e)},[]),Ze=s(function(e,t){e.preventDefault(),Ee(t)},[]),Ke=s(function(e,t){if(e.preventDefault(),null===Fe||Fe===t)return ke(null),void Ee(null);var n=y([],Ye,!0),o=n[Fe];n.splice(Fe,1),n.splice(t,0,o),ke(null),Ee(null)},[Fe,Ye]),_e=s(function(){ke(null),Ee(null)},[]),Ge=s(function(){var t=null==B?void 0:B.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=h.length+(C?1:0);return e("tr",{className:"aha-table-placeholder",children:e("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==B?void 0:B.emptyText,h.length,C]),Je=s(function(){return 0===Ye.length?Ge():Ye.map(function(n,r){var i,a=he(n,w),l=ne.includes(a),d=de.includes(a),s=(null==q?void 0:q(n,r))||{},c=r===Ye.length-1;return t(o.Fragment,{children:[t("tr",g({className:"".concat("function"==typeof U?U(n,r):U||""," ").concat(Fe===r?"dragging":""," ").concat(Se===r?"drag-over":""),draggable:!0,onDragStart:function(){return Xe(r)},onDragOver:function(e){return Ze(e,r)},onDrop:function(e){return Ke(e,r)},onDragEnd:_e,style:g({cursor:"move",opacity:Fe===r?.5:1,backgroundColor:Se===r?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){Fe!==r&&Se!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){Fe!==r&&Se!==r&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[C&&e("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(ce,{checked:l,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,n).disabled})})}),h.map(function(t,o){var i,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||o,l=(null===(i=t.onCell)||void 0===i?void 0:i.call(t,n,r))||{},d=Pe(o,t.fixed,!1),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e("td",g({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:g({width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},l.style),colSpan:t.colSpan,rowSpan:t.rowSpan},l,{children:Ve(t,n,r)}),a)})]})),(null==J?void 0:J.expandedRowRender)&&d&&e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:J.expandedRowRender(n,r,0,!0)})})]},a)})},[Ye,w,ne,de,C,h,q,U,Te,Ve,J,Fe,Se,Xe,Ze,Ke,_e,Pe,Ge]),Ue=function(){var t;if(!1===D||!D)return null;var n=null!==(t=D.total)&&void 0!==t?t:je.length,o=D.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e(se,{current:xe,total:n,pageSize:be,showSizeChanger:D.showSizeChanger,pageSizeOptions:D.pageSizeOptions,showQuickJumper:D.showQuickJumper,showTotal:D.showTotal,onChange:Oe,onShowSizeChange:Oe,simple:D.simple,responsive:D.responsive,size:"small"===E?"small":"default"})})},Qe=i(function(){return h.some(function(e){return e.fixed})||C&&C.fixed},[h,C]),$e=i(function(){return h.every(function(e){return e.width})&&(!C||C.columnWidth)},[h,C]),et=i(function(){if(null==j?void 0:j.x){if("number"==typeof j.x)return j.x;if(!0===j.x)return h.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Qe)return h.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[h,null==j?void 0:j.x,C,Qe]),tt=i(function(){return"fixed"===Y||Qe||$e||h.some(function(e){return e.width})?"fixed":Y},[Y,Qe,$e,h]),nt=g(g({width:"100%",minWidth:et?"".concat(et,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:tt,backgroundColor:"white"},A&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),ot=g({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==j?void 0:j.y)?"".concat(j.y,"px"):void 0,borderRadius:"8px"},G);if(Ae)return t("div",g({ref:ze,className:"aha-table aha-table-mobile-wrapper ".concat(Z),style:ot,"aria-busy":!!z||void 0},$,{children:[N&&e("div",{style:{marginBottom:"16px"},children:N(je)}),D&&"object"==typeof D&&(null===(r=D.position)||void 0===r?void 0:r.startsWith("top"))&&Ue(),(Ie="function"==typeof(null==B?void 0:B.emptyText)?B.emptyText():void 0!==(null==B?void 0:B.emptyText)?B.emptyText:"No data",0===Ye.length?e("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ie}):e("div",{className:"aha-table-mobile",children:Ye.map(function(n,o){var r,i=he(n,w),a=ne.includes(i);return t("div",{className:"aha-table-mobile-row ".concat(a?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:a?"#e6f7ff":"white"},children:[C&&e("div",{style:{marginBottom:"8px"},children:e(ce,{checked:a,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,n).disabled})}),h.map(function(r){var i=r.key||(Array.isArray(r.dataIndex)?r.dataIndex.join("."):r.dataIndex),a=fe(n,r.dataIndex||""),l=r.render?r.render(a,n,o):a;return t("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[t("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof r.title?r.title({}):r.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})})),I&&e("div",{style:{marginTop:"16px"},children:I(je)}),D&&("object"!=typeof D||!(null===(a=D.position)||void 0===a?void 0:a.startsWith("top")))&&Ue(),e(pe,{loading:z,spinColor:ee})]}));var rt={position:"relative",overflowX:(null==j?void 0:j.x)||Qe?"auto":"visible",overflowY:(null==j?void 0:j.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==j?void 0:j.x)?"100%":"number"==typeof(null==j?void 0:j.x)?"".concat(j.x,"px"):void 0,maxHeight:"number"==typeof(null==j?void 0:j.y)?"".concat(j.y,"px"):void 0,borderRadius:"8px"};return t("div",g({ref:ze,className:"aha-table ".concat(Z),style:ot,"aria-busy":!!z||void 0},$,{children:[N&&e("div",{style:{marginBottom:"16px"},children:N(je)}),D&&"object"==typeof D&&(null===(c=D.position)||void 0===c?void 0:c.startsWith("top"))&&Ue(),e("div",{style:rt,children:e("div",{style:{width:"100%",minWidth:et?"".concat(et,"px"):"100%",display:"block"},children:t("table",{style:nt,className:_,children:[qe(),e("tbody",{children:Je()}),R&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:R(je)})})})]})})}),I&&e("div",{style:{marginTop:"16px"},children:I(je)}),D&&("object"!=typeof D||!(null===(p=D.position)||void 0===p?void 0:p.startsWith("top")))&&Ue(),e(pe,{loading:z,spinColor:ee})]}))},xe=function(n){var o=n.checked,r=void 0!==o&&o,i=n.disabled,a=void 0!==i&&i,l=n.onChange,d=n.className,s=void 0===d?"":d,c=n.style,u=n.children,p=n.value,f=n.name,h=F().primaryColor,v=void 0===h?"#FB6011":h,x=a?"#FAFAF9":r?v:"white",m=a?"#FAFAF9":r?v:"#D7D3D0";return t("div",{className:"aha-radio ".concat(s),style:g({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},c),onClick:function(e){a||(null==l||l({target:{checked:!r,value:p},currentTarget:{checked:!r,value:p}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:r?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),u&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:r,onChange:l,disabled:a,value:p,name:f,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};xe.displayName="Radio";var me=function(n){var r=n.items,a=void 0===r?[]:r,c=n.variant,p=void 0===c?"underline":c,f=n.layout,h=void 0===f?"equal":f,x=n.defaultValue,m=n.value,y=n.onChange,b=n.className,w=void 0===b?"":b,C=n.mode,k=void 0===C?"children":C,D=n.scrollable,S=void 0!==D&&D,E=v(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),M=F().primaryColor;if(!a||0===a.length)return null;var A=i(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),L=void 0!==m,z=A.length>0?A[0].key:"",B=function(e){if(void 0===e)return z;var t=A.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:z},T=l(function(){var e,t=null!==(e=null!=m?m:x)&&void 0!==e?e:z;return B(t)}),W=T[0],N=T[1],I=L?void 0!==m?B(m):z:W;d(function(){console.log("[Tab Debug] currentValue:",I,"type:",typeof I),console.log("[Tab Debug] normalizedItems:",A.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",m,"isControlled:",L)},[I,A,m,L]);var R=s(function(e,t){if(!t){L||N(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),S&&"underline"===p){var o=Y.current[O(e)],r=q.current;if(o&&r){K.current=!0;var i,l=function(){if(r&&V.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),K.current=!1,r.removeEventListener("scroll",d)},150)};r.addEventListener("scroll",d,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[L,y,a,S,p]),j=A.find(function(e){if(e.key===I)return!0;if(String(e.key)===String(I))return!0;var t=Number(e.key),n=Number(I);return!isNaN(t)&&!isNaN(n)&&t===n}),H=M||"#FB6011",Y=u({}),O=function(e){return String(e)},V=u(null),P=u(null),q=u(null),X=u(null),Z=u("");u(new Set);var K=u(!1),_=l({width:0,left:0,opacity:0}),G=_[0],J=_[1],U=l({width:0,left:0,opacity:0}),Q=U[0],$=U[1],ee=s(function(){"underline"===p&&q.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(V.current&&q.current){var e=Y.current[O(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=q.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=q.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),d="".concat(a,"px");J(function(e){return e.left===l&&e.width===d&&1===e.opacity?e:{width:d,left:l,opacity:1}})}}}})})},[p,I,A]),te=s(function(){"background"===p&&X.current&&P.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&X.current){var e=Y.current[O(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=X.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");$(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[p,I,A]);d(function(){I?Z.current!==I&&(Z.current=I,"underline"===p&&q.current&&!K.current&&ee(),"background"===p&&X.current&&P.current&&te()):Z.current=""},[I,p,A.length,L,ee,te]),d(function(){if(I){var e=setTimeout(function(){if("underline"===p)(e=Y.current[O(I)])&&q.current&&V.current&&(ee(),S&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=Y.current[O(I)])&&X.current&&P.current){var t=X.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");$({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),d(function(){if(S&&"underline"===p&&I&&!K.current){var e=setTimeout(function(){var e=Y.current[O(I)],t=q.current;if(e&&t){K.current=!0;var n,o=function(){if(t&&V.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),K.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[I,S,p]);var ne;return t("div",{className:"aha-tab-container",children:["underline"===p?(ne={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},S&&(ne.overflowX="auto",ne.overflowY="hidden",ne.scrollBehavior="smooth",ne.scrollbarWidth="none",ne.WebkitOverflowScrolling="touch"),t("div",g({ref:q,className:"aha-tab aha-tab--underline ".concat(S?"aha-tab--scrollable":""," ").concat(w),style:ne},E,{children:[e("div",{ref:V,style:g({position:"absolute",bottom:"0px",height:"2px",backgroundColor:H,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},G)}),A.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p}),t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:S?0:void 0,whiteSpace:S?"nowrap":void 0},children:[n.icon&&function(){var t,i=typeof n.icon,a=o.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:i,isReactElement:a,iconValue:n.icon}),o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:20,height:20,style:g(g({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?H:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:20,height:20,style:{color:r?H:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?H:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:r?"#FFF6ED":"#FAFAF9",border:r?"1px solid #FFD1A9":"1px solid #E7E5E4",color:r?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===h?"100%":"fit-content",t("div",g({ref:X,className:"aha-tab aha-tab--background aha-tab--".concat(h," ").concat(w),style:n},E,{children:[e("div",{ref:P,style:g({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},Q)}),A.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===h?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:i,children:[n.icon&&function(){var t;return o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:16,height:16,style:g(g({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:16,height:16,style:{color:r?"#44403C":"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:r?"#FFF6ED":"#FAFAF9",border:r?"1px solid #FFD1A9":"1px solid #E7E5E4",color:r?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),S&&"underline"===p&&e("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===k&&(null==j?void 0:j.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:j.children})]})},ye=function(o){var r=o.percent,i=void 0===r?0:r,a=o.type,s=void 0===a?"circle":a,c=o.width,p=void 0===c?120:c,f=o.title,h=o.titlePosition,x=o.showPercent,m=void 0===x||x,y=o.animated,b=void 0!==y&&y,w=o.status,C=void 0===w?"normal":w,k=o.className,D=void 0===k?"":k,S=o.style,E=o.strokeColor,M=o.trailColor,A=void 0===M?"#F5F5F4":M,L=v(o,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),z=F().primaryColor,B=Math.min(100,Math.max(0,i)),T=u(!0),W=l(!1),N=W[0],I=W[1],R=l(0),j=R[0],H=R[1];d(function(){if(b&&T.current&&B>0){T.current=!1,H(0),I(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){H(B)})});var e=setTimeout(function(){I(!1),H(B)},300);return function(){return clearTimeout(e)}}T.current?(T.current=!1,I(!1),H(B)):H(B)},[b,B]);var Y=E||z||"#FB6011";"success"===C?Y="#00BC7D":"exception"===C&&(Y="#FB2C36");var O=h||"inside",V=Math.max(4,Math.round(.06*p)),P=(p-V)/2,q="semicircle"===s?p/2:p,X="14px",Z="12px",K=function(){var o=f&&"outside"===O?p+4+18+4:p,r=2*Math.PI*P,i=r-(N?j:B)/100*r;return t("div",{style:{position:"relative",width:p,height:o,display:"flex",alignItems:"center",justifyContent:"center"},children:[t("svg",{width:p,height:p,style:{position:"absolute",top:0,left:0},children:[e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:i,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:X,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]})},_=g({display:"inline-flex",flexDirection:"column",alignItems:"center",width:p},S);return e("div",g({className:"aha-progress aha-progress--".concat(s," ").concat(D),style:_},L,{children:function(){switch(s){case"circle":return K();case"semicircle":return r=V/2,i=p-V/2,a=(o=q+V)-V/2,l=q/2+V/2+V/2,d=f&&"outside"===O?o+4+18+4:o,c=Math.PI*P,u=c-(N?j:B)/100*c,t("div",{style:{position:"relative",width:p,height:d,overflow:"hidden"},children:[t("svg",{width:p,height:o,viewBox:"0 0 ".concat(p," ").concat(o),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(r," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("path",{d:"M ".concat(r," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(o,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),K()}var o,r,i,a,l,d,c,u}()}))},be=c(function(r,i){var a=r.disabled,l=void 0!==a&&a,s=r.error,c=void 0!==s&&s,p=r.readOnly,f=void 0!==p&&p,h=r.showCount,x=void 0!==h&&h,m=r.maxLength,y=r.className,b=void 0===y?"":y,w=r.style,C=r.placeholder,k=r.value,D=r.defaultValue,S=r.rows,E=void 0===S?3:S,M=r.autoSize,A=void 0!==M&&M,L=r.onChange,z=r.onFocus,B=r.onBlur,T=v(r,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),W=F().primaryColor,N=void 0===W?"#FB6011":W,I=u(null),R=o.useState(D||k||""),j=R[0],H=R[1],Y=o.useState(!1),O=Y[0],V=Y[1],P=o.useState(void 0),q=P[0],X=P[1];d(function(){"function"==typeof i?i(I.current):i&&(i.current=I.current)},[i]);var Z=void 0!==k,K=Z?k:j,_=String(K||"").length;d(function(){if(A&&I.current){var e=I.current,t="object"==typeof A&&A.minRows||1,n="object"==typeof A?A.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),X(l)}},[K,A]);var G=g(g({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":O?N:"#D7D3D0"),backgroundColor:l||f?"#FAFAF9":"#FFFFFF",color:l?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:A?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==q&&A?{height:"".concat(q,"px")}:{}),w);return t(n,{children:[e("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n "}),t("div",{className:"aha-textarea-wrapper ".concat(b),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e("textarea",g({ref:I,value:K,placeholder:C,disabled:l,readOnly:f,rows:A?void 0:E,maxLength:m,onChange:function(e){Z||H(e.target.value),null==L||L(e)},onFocus:function(e){V(!0),null==z||z(e)},onBlur:function(e){V(!1),null==B||B(e)},style:G,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(x||m)&&e("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:m?t("span",{children:[_," / ",m]}):e("span",{children:_})})]})]})});be.displayName="Textarea";var we=function(n){var r=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.onClick,u=n.checkedChildren,p=n.unCheckedChildren,f=n.size,h=void 0===f?"default":f,v=n.loading,x=void 0!==v&&v,m=n.className,y=void 0===m?"":m,b=n.style,w=F().primaryColor,C=void 0===w?"#FB6011":w,k=o.useState(a),D=k[0],S=k[1],E=void 0!==r,M=E?r:D,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[h],L=M||x,z=d?"#E7E5E4":L?C:"#F5F5F4",B=L?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":M,disabled:d||x,onClick:function(e){if(!d&&!x){var t=!M;E||S(t),null==s||s(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(y),style:g({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:L?"flex-end":"flex-start",width:A.width,height:A.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===h?"10px":"12px",backgroundColor:z,cursor:d||x?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(u||p)&&e("span",{style:{position:"absolute",left:L?"6px":"auto",right:L?"auto":"6px",fontSize:A.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:d?.5:1,zIndex:1,pointerEvents:"none"},children:L?u:p}),e("span",{style:{position:"absolute",left:B,top:"50%",transform:"translateY(-50%)",width:A.thumbSize,height:A.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:x&&t("svg",{width:"small"===h?"8":"10",height:"small"===h?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};we.displayName="Switch";var Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fe=["January","February","March","April","May","June","July","August","September","October","November","December"],ke=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),Fe[o]).replace(new RegExp("","g"),Ce[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},De=function(e,t){return new Date(e,t+1,0).getDate()},Se=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Ee=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},Me=function(o){var r=o.mode,a=void 0===r?"date":r,c=o.disabled,p=void 0!==c&&c,h=o.error,v=void 0!==h&&h,x=o.placeholder,m=void 0===x?"Select date":x,y=o.startPlaceholder,b=void 0===y?"Start date":y,w=o.endPlaceholder,C=void 0===w?"End date":w,k=o.size,D=void 0===k?"medium":k,S=o.allowClear,E=void 0!==S&&S,M=o.format,A=void 0===M?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":M,L=o.onFocus,z=o.onBlur,B=o.onOpenChange,T=o.className,W=void 0===T?"":T,N=o.style,I=o.dropdownClassName,R=void 0===I?"":I,j=o.dropdownStyle,H=o.defaultOpen,Y=void 0!==H&&H,O=o.open,V=o.minDate,P=o.maxDate,q=o.separator,X=void 0===q?" - ":q,Z=o.presetRanges,K=void 0!==Z&&Z,_=o.calendarCount,G=void 0===_?1:_,J=o.showApplyCancel,U=void 0!==J&&J,Q=o.applyText,$=void 0===Q?"Apply":Q,ee=o.cancelText,te=void 0===ee?"Cancel":ee,ne=o.onApply,oe=o.onCancel,re=o.showSelectedRange,ie=void 0!==re&&re,ae=o.startSelectedRangeText,le=void 0===ae?"Select dates":ae,de=o.endSelectedRangeText,se=void 0===de?"Select dates":de,ce=o.rangeDisplayMode,ue=void 0===ce?"range":ce,pe=F().primaryColor,fe=void 0===pe?"#FB6011":pe,he="range"===a,ge=l(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),ve=ge[0],xe=ge[1],me=l(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),ye=me[0],be=me[1],we=l(Y),Ce=we[0],Me=we[1],Ae=l(!0),Le=Ae[0],ze=Ae[1],Be=l(null),Te=Be[0],We=Be[1],Ne=l(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ie=Ne[0],Re=Ne[1],je=l(function(){if(2===G&&he){var e=new Date(Ie.year,Ie.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),He=je[0],Ye=je[1];d(function(){if(2===G&&he){var e=new Date(Ie.year,Ie.month+1,1);Ye({year:e.getFullYear(),month:e.getMonth()})}else Ye(null)},[Ie,G,he]);var Oe=u(null),Ve=u(null),Pe=u(null),qe=u(null),Xe=u(null),Ze=l(null),Ke=Ze[0],_e=Ze[1],Ge=u(!1),Je=u(!1),Ue=u(null),Qe="value"in o&&void 0!==o.value,$e=void 0!==O,et=he?null:Qe&&"date"===a&&"value"in o?o.value:ve,tt=he?Qe&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:ye:{startDate:null,endDate:null},nt=$e?O:Ce;d(function(){if(nt&&!Ge.current){if(he){var e=tt.startDate||tt.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Re({year:t,month:n})}else{var o=new Date;Re({year:o.getFullYear(),month:o.getMonth()})}}else if(et){t=et.getFullYear(),n=et.getMonth();Re({year:t,month:n})}else{o=new Date;Re({year:o.getFullYear(),month:o.getMonth()})}Ge.current=!0}else nt||(Ge.current=!1)},[nt,et,tt,he]),d(function(){if(nt&&Oe.current){Je.current=!1,Ue.current=null;var e=function(){if(Oe.current){var e=Oe.current.getBoundingClientRect();if(Je.current&&null!==Ue.current){var t,n=Ue.current;if(Xe.current){var o=Xe.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void _e({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";_e({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(Xe.current){var t=Xe.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),Je.current=!0,Ue.current=i}_e({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}_e(null),Je.current=!1,Ue.current=null},[nt]),d(function(){var e=function(e){var t=e.target;Oe.current&&!Oe.current.contains(t)&&Xe.current&&!Xe.current.contains(t)&&($e||Me(!1),null==B||B(!1))};if(nt)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[nt,$e,B]);var ot,rt,it,at,lt=s(function(e){var t;Ee(e,V,P)&&(Qe||xe(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),$e||Me(!1),null==B||B(!1))},[Qe,$e,a,o,B,V,P]),dt=s(function(e){var t;if(Ee(e,V,P)){var n,r=U&&Te?Te:tt;r.startDate&&r.endDate?(n={startDate:e,endDate:null},ze(!1)):Le?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},ze(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(ze(!0),U||($e||Me(!1),null==B||B(!1))):ze(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},ze(!1)):(n={startDate:r.startDate,endDate:e},ze(!0),U||($e||Me(!1),null==B||B(!1))),U?We(n):(Qe||be(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[Le,tt,Te,U,Qe,$e,a,o,B,V,P]),st=function(e){var t,n;if(e.stopPropagation(),he){var r={startDate:null,endDate:null};Qe||be(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),ze(!0)}else Qe||xe(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!nt){var i=new Date;Re({year:i.getFullYear(),month:i.getMonth()})}},ct=function(){if(!p){var e=!nt;if($e||Me(e),null==B||B(e),e){if(he){if(ze(!tt.startDate),U&&We(tt),!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else if(!et){t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else!e&&U&&We(null)}},ut=i(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),pt=i(function(){return Array.isArray(K)?K:!0===K?ut:[]},[K,ut]),ft=pt.length>0,ht=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Re({year:n,month:r})}U?We(e):(Qe||be(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),$e||Me(!1),null==B||B(!1))},gt=function(){Re(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},vt=function(){Re(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},xt=s(function(e,t){for(var n=De(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),mt=i(function(){return xt(Ie.year,Ie.month)},[Ie,xt]),yt=i(function(){return 2===G&&he&&He?xt(He.year,He.month):null},[G,he,He,xt]),bt=function(){He&&Ye(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},wt=function(){He&&Ye(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},Ct={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Ft=E&&!p&&(he?tt.startDate||tt.endDate:et),kt=et?ke(et,A):"",Dt=tt.startDate?ke(tt.startDate,A):"",St=tt.endDate?ke(tt.endDate,A):"",Et=i(function(){if(!he||"text"!==ue)return"";if(tt.startDate&&tt.endDate){var e=ke(tt.startDate,"MMM D, YYYY"),t=ke(tt.endDate,"MMM D, YYYY");return"".concat(e," ").concat(X," ").concat(t)}return tt.startDate?ke(tt.startDate,"MMM D, YYYY"):tt.endDate?ke(tt.endDate,"MMM D, YYYY"):""},[he,ue,tt,X]),Mt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return t(n,{children:[e("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),t("div",{ref:Oe,className:"aha-date-picker ".concat(W),style:g({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(v?"#F04438":nt?fe:"#D7D3D0"),backgroundColor:p?"#FAFAF9":"#FFFFFF",cursor:p?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:Ft?"30px":"12px",paddingTop:Ct[D].paddingTop,paddingBottom:Ct[D].paddingBottom,fontSize:Ct[D].fontSize,lineHeight:Ct[D].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:ct,onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},tabIndex:p?-1:0,children:[e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:p?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),he?"text"===ue?e("input",{ref:Ve,type:"text",value:Et,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate||tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):t("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e("input",{ref:Pe,type:"text",value:Dt,readOnly:!0,placeholder:b,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!0),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e("span",{style:{color:p?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:X}),e("input",{ref:qe,type:"text",value:St,readOnly:!0,placeholder:C,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!1),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e("input",{ref:Ve,type:"text",value:kt,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":et?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),Ft&&e("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:st,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),nt&&Ke&&f(e("div",{ref:Xe,className:"aha-date-picker-dropdown ".concat(R),style:g({position:"absolute",top:"".concat(Ke.top,"px"),left:"".concat(Ke.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Ke.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Ke.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},j),children:t("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:he&&ft&&1===G?"column":"row"},children:[he&&ft&&2===G&&e("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:U?"0":"8px"},children:pt.map(function(t,n){var o=Te?Se(t.range.startDate,Te.startDate)&&Se(t.range.endDate,Te.endDate):Se(t.range.startDate,tt.startDate)&&Se(t.range.endDate,tt.endDate);return e("div",{onClick:function(){return ht(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?fe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),t("div",{children:[e("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===G?"row":"column",gap:2===G?"24px":"0"},children:(at=function(n,o,r,i,a){return void 0===a&&(a=0),t("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:2===G&&he?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===G&&he&&1===a)&&e("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",left:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[Fe[n.month]," ",n.year]}),!(2===G&&he&&0===a)&&e("button",{type:"button",onClick:i,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",right:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),he&&ie&&1===G&&0===a&&(l=U&&Te?Te:tt,d=l.startDate?ke(l.startDate,"MMM D, YYYY"):le,s=l.endDate?ke(l.endDate,"MMM D, YYYY"):se,t("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.startDate?"text-[#44403C]":"text-[#79716B]"),children:d}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),he&&ft&&1===G&&e("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:pt.map(function(t,n){var o=Te?Se(t.range.startDate,Te.startDate)&&Se(t.range.endDate,Te.endDate):Se(t.range.startDate,tt.startDate)&&Se(t.range.endDate,tt.endDate);return e("button",{type:"button",onClick:function(){return ht(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?fe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Mt.map(function(t){return e("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var r,i,a=(r=n.year,i=n.month,new Date(r,i,1).getDay()),l=(0===a?7:a)-1,d=[],s=0;s<l;s++)d.push(e("div",{},"empty-".concat(s)));return o.forEach(function(o,r){if(o){var i=l+r,a=o.getMonth()===n.month,s=Se(o,new Date),c=!Ee(o,V,P);if(he){var u=U&&Te?Te:tt,p=Se(o,u.startDate),f=Se(o,u.endDate),h=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(o,u.startDate,u.endDate),g=i%7==0,v=i%7==6,x=p,m=f,y={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(x||m)y.background=fe,y.borderRadius="50%",y.color="#FFFFFF",y.fontWeight=500;else if(h){y.background="#F5F5F4",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;var b=1===o.getDate(),w=De(n.year,n.month),C=o.getDate()===w,F=g||b,k=v||C;F&&k?y.borderRadius="18px":F?(y.borderTopLeftRadius="18px",y.borderBottomLeftRadius="18px",y.borderTopRightRadius="0",y.borderBottomRightRadius="0"):k?(y.borderTopRightRadius="18px",y.borderBottomRightRadius="18px",y.borderTopLeftRadius="0",y.borderBottomLeftRadius="0"):y.borderRadius="0"}else y.background="transparent",y.borderRadius="50%",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;d.push(t("button",{type:"button",disabled:c,onClick:function(){return dt(o)},style:y,onMouseEnter:function(e){c||x||m||(e.currentTarget.style.backgroundColor=h?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){x||m||(e.currentTarget.style.backgroundColor=h?"#F5F5F4":"transparent")},children:[o.getDate(),s&&e("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:x||m?"#FFFFFF":fe}})]},"date-".concat(r)))}else{var D=Se(o,et);d.push(t("button",{type:"button",disabled:c,onClick:function(){return lt(o)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:D?fe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:D?500:400,color:D?"#FFFFFF":a?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||D||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){D||(e.currentTarget.style.backgroundColor="transparent")},children:[o.getDate(),s&&!D&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:fe}})]},"date-".concat(r)))}}}),d}()})]},a);var l,d,s},t(n,{children:[at(Ie,mt,gt,vt,0),2===G&&he&&He&&yt&&at(He,yt,bt,wt,1)]}))}),he&&ie&&2===G&&!U&&(ot=tt,rt=ot.startDate?ke(ot.startDate,"MMM D, YYYY"):le,it=ot.endDate?ke(ot.endDate,"MMM D, YYYY"):se,e("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(ot.startDate?"text-[#44403C]":"text-[#79716B]"),children:rt}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(ot.endDate?"text-[#44403C]":"text-[#79716B]"),children:it})]})})),he&&U&&t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[ie&&2===G&&function(){var n=Te||tt,o=n.startDate?ke(n.startDate,"MMM D, YYYY"):le,r=n.endDate?ke(n.endDate,"MMM D, YYYY"):se;return t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.startDate?"text-[#44403C]":"text-[#79716B]"),children:o}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.endDate?"text-[#44403C]":"text-[#79716B]"),children:r})]})}(),t("div",{className:"".concat(2===G?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e("button",{type:"button",onClick:function(){We(null),null==oe||oe(),$e||Me(!1),null==B||B(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:te}),e("button",{type:"button",onClick:function(){var e;Te&&(Qe||be(Te),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Te)),null==ne||ne(Te),$e||Me(!1),null==B||B(!1),We(null))},disabled:!Te||!Te.startDate||!Te.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Te&&Te.startDate&&Te.endDate?fe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Te&&Te.startDate&&Te.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor=fe)},children:$})]})]})]})]})}),document.body)]})};Me.displayName="DatePicker";var Ae=r(null),Le=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),ze=o.forwardRef(function(t,n){var o=t.initialValues,r=void 0===o?{}:o,a=t.onValuesChange,c=t.onFinish,f=t.onFinishFailed,h=t.labelWidth,v=void 0===h?"120px":h,y=t.labelAlign,b=void 0===y?"right":y,w=t.layout,C=void 0===w?"horizontal":w;t.size;var F=t.className,k=void 0===F?"":F,D=t.style,S=t.children,E=l(function(){var e={};return Object.keys(r).forEach(function(t){e[t]={value:r[t],error:void 0,touched:!1,validating:!1}}),e}),M=E[0],A=E[1],L=u(M);d(function(){L.current=M},[M]);var z=u({}),B=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.value},[]),T=s(function(e,t){A(function(n){var o=g({},n);if(o[e]?o[e]=g(g({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},L.current[e]?L.current[e]=g(g({},L.current[e]),{value:t}):L.current[e]={value:t,error:void 0,touched:!1,validating:!1},a){var r={};r[e]=t;var i={};Object.keys(o).forEach(function(e){i[e]=o[e].value}),a(r,i)}return o})},[a]),W=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.error},[]),N=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{error:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),I=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.touched)||!1},[]),R=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{touched:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),j=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.validating)||!1},[]),H=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{validating:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),Y=u();Y.current=function(e,t){A(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var d=o[l],s=i[l];if((null==d?void 0:d.required)!==(null==s?void 0:s.required)||(null==d?void 0:d.message)!==(null==s?void 0:s.message)||(null==d?void 0:d.type)!==(null==s?void 0:s.type)||(null==d?void 0:d.pattern)!==(null==s?void 0:s.pattern)||(null==d?void 0:d.min)!==(null==s?void 0:s.min)||(null==d?void 0:d.max)!==(null==s?void 0:s.max)||(null==d?void 0:d.len)!==(null==s?void 0:s.len)||(null==d?void 0:d.whitespace)!==(null==s?void 0:s.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var c=g({},n);return c[e]?c[e]=g(g({},c[e]),{rules:t.rules,required:t.required}):c[e]={value:r[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},c})};var O=s(function(e,t){var n;null===(n=Y.current)||void 0===n||n.call(Y,e,t)},[]),V=s(function(e){delete z.current[e],A(function(t){var n=g({},t);return delete n[e],n}),delete L.current[e]},[]),P=s(function(e){return x(void 0,void 0,void 0,function(){var t,n,o,r,i,a,l,d,s;return m(this,function(c){switch(c.label){case 0:if(!(t=L.current[e]))return[2,void 0];H(e,!0),n=t.rules||[],r=0,i=n,c.label=1;case 1:if(!(r<i.length))return[3,6];if(a=i[r],l=t.value,a.required&&(null==l||""===l))return o=a.message||"".concat(e," is required"),[3,6];if(a.type&&null!=l&&""!==l&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[a.type])&&!d(l))return o=a.message||"".concat(e," must be a valid ").concat(a.type),[3,6];if(a.pattern&&null!=l&&""!==l&&!a.pattern.test(String(l)))return o=a.message||"".concat(e," format is invalid"),[3,6];if(void 0!==a.min&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))<a.min)return o=a.message||"".concat(e," must be at least ").concat(a.min),[3,6];if(void 0!==a.max&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))>a.max)return o=a.message||"".concat(e," must be at most ").concat(a.max),[3,6];if(void 0!==a.len&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))!==a.len)return o=a.message||"".concat(e," must be exactly ").concat(a.len),[3,6];if(a.whitespace&&"string"==typeof l&&l.trim()!==l)return o=a.message||"".concat(e," cannot be whitespace"),[3,6];if(!a.validator)return[3,5];c.label=2;case 2:return c.trys.push([2,4,,5]),[4,a.validator(a,l)];case 3:return c.sent(),[3,5];case 4:return s=c.sent(),o=(null==s?void 0:s.message)||a.message||"".concat(e," validation failed"),[3,6];case 5:return r++,[3,1];case 6:return L.current[e]?L.current[e]=g(g({},L.current[e]),{error:o,validating:!1,touched:!0}):L.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},A(function(n){var r=g({},n);return r[e]?r[e]=g(g({},r[e]),{error:o,validating:!1,touched:!0}):r[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},r}),[2,o]}})})},[]),q=s(function(e){var t=L.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),X=s(function(e){return x(void 0,void 0,void 0,function(){var t,n,o,r,i;return m(this,function(a){switch(a.label){case 0:return t=L.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return x(void 0,void 0,void 0,function(){var n,o;return m(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,P(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return a.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(a.sent(),o.length>0)throw r=q(),i={values:r,errorFields:o},null==f||f(i),new Le("Form validation failed",r,o);return[2,q()]}})})},[P,q,f]),Z=s(function(e){A(function(t){var n=g({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=g(g({},n[e]),{value:r[e],error:void 0,touched:!1,validating:!1}),L.current[e]=g({},n[e]))}),n})},[r]),K=s(function(e){A(function(t){var n=g({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=g(g({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},L.current[t]=g({},n[t])}),a){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),a(e,o)}return n})},[a]),_=s(function(){return x(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,X()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[X,c]),G=s(function(e){if(A(function(t){var n=g({},t);return e.forEach(function(e){var t=e.name,o=e.value,r=e.errors,i=r&&r.length>0?r[0]:void 0;n[t]?n[t]=g(g(g({},n[t]),void 0!==o&&{value:o}),{error:i,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:i,touched:!0,validating:!1},L.current[t]=g({},n[t])}),n}),a&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return a(t,q())},0)}},[a,q]),J=s(function(e,t){t?z.current[e]=t:delete z.current[e]},[]),U=s(function(e,t){var n=z.current[e];null==n||n.scrollIntoView(g({behavior:"smooth",block:"center"},t))},[]);p(n,function(){return{getFieldValue:B,getFieldsValue:q,setFieldValue:T,setFieldsValue:K,setFields:G,getFieldError:W,validateField:P,validateFields:X,resetFields:Z,submit:_,scrollToField:U}});var Q=i(function(){return{fields:M,getFieldValue:B,setFieldValue:T,getFieldError:W,setFieldError:N,isFieldTouched:I,setFieldTouched:R,isFieldValidating:j,setFieldValidating:H,registerField:O,unregisterField:V,validateField:P,validateFields:X,resetFields:Z,getFieldsValue:q,setFieldsValue:K,setFields:G,submit:_,scrollToField:U,registerFieldRef:J,labelWidth:v,labelAlign:b}},[M,B,T,W,N,I,R,j,H,O,V,P,X,Z,q,K,G,_,U,J,v,b]),$=g({},D);return"vertical"===C?($.display="flex",$.flexDirection="column"):"inline"===C&&($.display="inline-flex",$.flexWrap="wrap",$.gap="16px"),e(Ae.Provider,{value:Q,children:e("form",{className:"aha-form ".concat(k),style:$,onSubmit:function(e){return x(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,X()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:S})})});ze.displayName="Form";var Be=ze;Be.Item=function(n){var r=n.name,l=n.label,c=n.htmlFor;n.labelCol,n.wrapperCol;var p=n.required,f=void 0!==p&&p,h=n.rules,v=void 0===h?[]:h;n.hasFeedback;var x=n.validateStatus,m=n.help,y=n.extra,b=n.className,w=void 0===b?"":b,C=n.style,F=n.children;n.labelAlign,n.labelWidth;var k=n.hidden,D=void 0!==k&&k,S=n.tooltip,E=a(Ae),M=u(null),A=s(function(e){M.current=e,r&&(null==E?void 0:E.registerFieldRef)&&E.registerFieldRef(r,e)},[r,E]),L=(null==E?void 0:E.fields)||{};r&&E&&E.getFieldValue(r);var z=r&&E?E.getFieldError(r):void 0,B=!(!r||!E)&&E.isFieldTouched(r),T=!(!r||!E)&&E.isFieldValidating(r);r&&L[r];var W=x||(z?"error":T?"validating":B&&!z?"success":void 0),N=void 0!==m?m:z||void 0,I=u(v),R=u(f),j=u(!1),H=f||v.some(function(e){return e.required}),Y=i(function(){if(!j.current)return j.current=!0,!0;if(I.current.length!==v.length)return!0;if(I.current===v)return!1;for(var e=0;e<v.length;e++){var t=I.current[e],n=v[e];if((null==t?void 0:t.required)!==(null==n?void 0:n.required)||(null==t?void 0:t.message)!==(null==n?void 0:n.message)||(null==t?void 0:t.type)!==(null==n?void 0:n.type)||(null==t?void 0:t.pattern)!==(null==n?void 0:n.pattern)||(null==t?void 0:t.min)!==(null==n?void 0:n.min)||(null==t?void 0:t.max)!==(null==n?void 0:n.max)||(null==t?void 0:t.len)!==(null==n?void 0:n.len)||(null==t?void 0:t.whitespace)!==(null==n?void 0:n.whitespace))return!0}return!1},[v]);d(function(){if(r&&E)return(!I.current||Y||R.current!==f)&&(I.current=v,R.current=f,E.registerField(r,{rules:v,required:H})),function(){r&&E&&E.unregisterField(r)}},[r]);if(D)return null;return t("div",{ref:A,className:"aha-form-item ".concat(w),style:g({display:"flex",flexDirection:"column",marginBottom:"16px"},C),children:[l&&t("label",{htmlFor:c,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[l,H&&e("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),S&&e(function(n){var r=n.content,i=o.useState(!1),a=i[0],l=i[1],d=o.useRef(null);return o.useEffect(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&l(!1)};if(a)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a]),t("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e("div",{onClick:function(e){e.stopPropagation(),l(!a)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e(de,{})}),a&&t("div",{ref:d,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[r,e("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:S})]}),t("div",{style:{width:"100%"},children:[e("div",{children:o.Children.map(F,function(e){return o.isValidElement(e)?function(e){var t,n,i,a,l,d,s,c,u;if(!o.isValidElement(e))return e;var p=g({},e.props);if(r&&E){var f=E.getFieldValue(r),h=E.setFieldValue;if(!h)return e;var v=e.type;if(v&&("object"==typeof v||"function"==typeof v)&&"displayName"in v){var x=v.displayName;if("Input"===x||"Textarea"===x){p.value=f||"";var m=null===(t=e.props)||void 0===t?void 0:t.onChange,y=null===(n=e.props)||void 0===n?void 0:n.onBlur;p.onChange=function(e){h(r,e.target.value),null==m||m(e),r&&E&&setTimeout(function(){E.validateField(r)},0)},p.onBlur=function(e){r&&E&&(E.setFieldTouched(r,!0),E.validateField(r)),null==y||y(e)},p.error="error"===W}else if("Select"===x){p.value=f;var b=null===(i=e.props)||void 0===i?void 0:i.onChange,w=null===(a=e.props)||void 0===a?void 0:a.onBlur;p.onChange=function(e,t){h(r,e),null==b||b(e,t),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))},p.onBlur=function(e){r&&E&&(E.setFieldTouched(r,!0),E.validateField(r)),null==w||w(e)},p.error="error"===W}else if("Switch"===x){p.checked=f||!1;var C=null===(l=e.props)||void 0===l?void 0:l.onChange;p.onChange=function(e,t){h(r,e),null==C||C(e,t),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))}}else if("Checkbox"===x){p.checked=f||!1;var F=null===(d=e.props)||void 0===d?void 0:d.onChange;p.onChange=function(e){h(r,e.target.checked),null==F||F(e),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))}}else if("Radio"===x){var k=null===(s=e.props)||void 0===s?void 0:s.value;if(void 0!==k){p.checked=f===k;var D=null===(c=e.props)||void 0===c?void 0:c.onChange;p.onChange=function(e){h(r,k),null==D||D(e),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))}}}}else{void 0!==f&&(p.value=f);var S=null===(u=e.props)||void 0===u?void 0:u.onChange;p.onChange=function(e){var t,n,o=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;h(r,o),null==S||S(e)}}}return"error"===W&&"error"in p&&(p.error=!0),o.cloneElement(e,p)}(e):e})}),N&&e("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===W?"#D92D20":"warning"===W?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:N}),y&&!N&&e("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:y})]})]})},Be.useForm=function(){return[u(null)]};var Te=function(n){var r=n.items,i=void 0===r?[]:r,a=n.userProfile,d=n.selectedKeys,c=n.defaultSelectedKeys,p=void 0===c?[]:c,f=n.onSelect,h=n.onDeselect,v=n.onClick,x=n.className,m=void 0===x?"":x,b=n.style,w=n.width,C=void 0===w?320:w;F().primaryColor;var k=u(null),D=u({}),S=void 0!==d,E=l(p),M=E[0],A=E[1],L=S?d:M,z=function(e){return"children"in e&&Array.isArray(e.children)},B=s(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(z(i)){var a=B(e,i.children,n);if(a)return a}else{var l=i,d=y(y([],n,!0),[l.key],!1);if(l.key===e)return d}}return null},[]),T=s(function(e){var t;if(!e.disabled){var n,o=B(e.key,i)||[e.key];L.includes(e.key)?(n=L.filter(function(t){return t!==e.key}),null==h||h({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:o,selectedKeys:n})),S||A(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==v||v({key:e.key,keyPath:o})}},[L,S,f,h,v,i,B]),W=function(n){var o=L.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,o)},n.key);var r=g({display:"flex",alignItems:"center",padding:"10px 16px",cursor:n.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:n.disabled?.5:1},n.style);return t("div",{ref:function(e){D.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:r,onClick:function(){return T(n)},onMouseEnter:function(e){n.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[n.icon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.icon}),e("span",{style:{flex:1},children:n.label}),n.suffixIcon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.suffixIcon})]},n.key)},N=g({width:"number"==typeof C?"".concat(C,"px"):C,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},b),I=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!z(o)||!(!z(n)||z(o))};return t("div",{ref:k,className:"aha-menu-list ".concat(m),style:N,children:[a&&(a?a.render?a.render(a):e("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e("div",{children:i.map(function(n,r){return t(o.Fragment,{children:[I(r,i)&&e("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),z(n)?(a=n,e("div",{className:"aha-menu-group ".concat(a.className||""),children:a.children.map(function(e){return W(e)})},"group-".concat(a.title))):W(n)]},r);var a})})]})};Te.displayName="MenuList";var We=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,d=o+6,s=0,c=0;switch(n){case"top":s=e.top-t.height-d+i,c=a-t.width/2+r;break;case"bottom":default:s=e.bottom+d+i,c=a-t.width/2+r;break;case"left":s=l-t.height/2+i,c=e.left-t.width-d+r;break;case"right":s=l-t.height/2+i,c=e.right+d+r;break;case"top-left":s=e.top-t.height-d+i,c=e.left+r;break;case"top-right":s=e.top-t.height-d+i,c=e.right-t.width+r;break;case"bottom-left":s=e.bottom+d+i,c=e.left+r;break;case"bottom-right":s=e.bottom+d+i,c=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return c<r+8?c=r+8:c+t.width>r+u-8&&(c=r+u-t.width-8),s<i+8?s=i+8:s+t.height>i+p-8&&(s=i+p-t.height-8),{top:s,left:c}},Ne=function(e,t,n,o){void 0===o&&(o=6);var r=We(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,d=i-(window.scrollY||window.pageYOffset),s=a-l,c=d+t.height,u=s+t.width,p=d,f=s,h=Math.max(p,e.top),g=Math.min(c,e.bottom),v=Math.max(f,e.left),x=Math.min(u,e.right);return g>h+1&&x>v+1},Ie=function(t,n){var o=g({position:"absolute",width:0,height:0,borderStyle:"solid"},n),r={top:g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:g(g({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:r[t]})},Re=function(o){var r=o.content,i=o.children,a=o.position,c=void 0===a?"top":a,p=o.trigger,h=void 0===p?"hover":p,v=o.delay,x=void 0===v?200:v,m=o.disabled,y=void 0!==m&&m,b=o.className,w=void 0===b?"":b,C=o.tooltipClassName,F=void 0===C?"":C,k=o.gap,D=void 0===k?6:k,S=o.showArrow,E=void 0===S||S,M=o.width,A=o.defaultVisible,L=void 0!==A&&A,z=o.visible,B=o.onVisibleChange,T=void 0!==z,W=l(L),N=W[0],I=W[1],R=T?z:N,j=l(T?null!=z&&z:L),H=j[0],Y=j[1],O=s(function(e){T||I(e),null==B||B(e)},[T,B]);d(function(){T&&(z?requestAnimationFrame(function(){Y(!0)}):Y(!1))},[T,z]);var V=l(c),P=V[0],q=V[1],X=l("320px"),Z=X[0],K=X[1],_=l({position:"absolute",top:0,left:0,pointerEvents:"hover"===h?"auto":"none"}),G=_[0],J=_[1],U=l({}),Q=U[0],$=U[1],ee=u(null),te=u(null),ne=u(null),oe=u(null),re=s(function(){if(ee.current&&te.current&&R&&H){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!Ne(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!Ne(e,t,a,o))return a}return n}(e,t,c,D);q(n);var o=We(e,t,n,D),r=o.top,i=o.left;if(J(function(e){return g(g({},e),{position:"absolute",top:"".concat(r,"px"),left:"".concat(i,"px"),pointerEvents:"hover"===h?"auto":"none",zIndex:9999})}),E){var a=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,d=t.top+(t.height-6)/2,s=o-i,c=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(d-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(d-c,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,i,r);$(a)}}},[R,c,D,E,H,h]),ie=s(function(){y||(oe.current&&(clearTimeout(oe.current),oe.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){O(!0),T||requestAnimationFrame(function(){Y(!0)})},x))},[y,x,O,T]),ae=s(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),oe.current&&clearTimeout(oe.current),T?O(!1):(Y(!1),oe.current=setTimeout(function(){O(!1),oe.current=null},150))},[O,T]),le=s(function(){"hover"===h&&(oe.current&&(clearTimeout(oe.current),oe.current=null),R||(O(!0),requestAnimationFrame(function(){Y(!0)})))},[h,R]),de=s(function(e){y||"click"!==h||(e.stopPropagation(),R?ae():(ne.current&&(clearTimeout(ne.current),ne.current=null),O(!0),requestAnimationFrame(function(){Y(!0)})))},[y,h,R,ae]);d(function(){if(L&&R&&H){var e=function(){ee.current&&te.current?re():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[L,R,H,re]),d(function(){if(R)return requestAnimationFrame(function(){re()}),window.addEventListener("scroll",re,!0),window.addEventListener("resize",re),function(){window.removeEventListener("scroll",re,!0),window.removeEventListener("resize",re)}},[R,re]),d(function(){if(R&&"click"===h){var e=function(e){ee.current&&te.current&&!ee.current.contains(e.target)&&!te.current.contains(e.target)&&ae()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[R,h,ae]),d(function(){return function(){ne.current&&clearTimeout(ne.current),oe.current&&clearTimeout(oe.current)}},[]);var se={position:"absolute",top:0,left:0,opacity:H?1:0,transform:H?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===h?"auto":"none",zIndex:9999},ce=s(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);d(function(){var e=function(){K(ce())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ce]);var ue=g(g({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==M?{width:"number"==typeof M?"".concat(M,"px"):M,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:Z,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),pe=t("div",{style:g(g(g({},se),G),{pointerEvents:"hover"===h?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(F),onMouseEnter:"hover"===h?le:void 0,onMouseLeave:"hover"===h?ae:void 0,children:[e("div",{ref:te,className:"aha-tooltip ".concat(F),style:ue,role:"tooltip",children:r}),E&&Ie(P,Q)]}),fe=s(function(){"hover"===h&&(oe.current=setTimeout(function(){ae()},100))},[h,ae]),he="click"===h?{onClick:de}:{onMouseEnter:ie,onMouseLeave:fe,onFocus:ie,onBlur:ae};return t(n,{children:[e("div",g({ref:ee,className:"aha-tooltip-trigger ".concat(w),style:{display:"inline-block",cursor:"click"===h?"pointer":"default"}},he,{children:i})),R&&"undefined"!=typeof document&&f(pe,document.body)]})},je=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},He=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},Ye=function(o){var r=o.children,i=o.content,a=o.trigger,c=void 0===a?"click":a,p=o.open,h=o.defaultOpen,v=void 0!==h&&h,x=o.onOpenChange,m=o.placement,y=void 0===m?"right":m,b=o.width,w=o.offset,C=void 0===w?8:w,F=o.className,k=void 0===F?"":F,D=o.popoverClassName,S=void 0===D?"":D,E=o.disabled,M=void 0!==E&&E,A=void 0!==p,L=l(v),z=L[0],B=L[1],T=A?!!p:z,W=l({top:0,left:0,opacity:0}),N=W[0],I=W[1],R=u(null),j=u(null),H=s(function(e){A||B(e),null==x||x(e)},[A,x]),Y=s(function(){if(T&&R.current&&j.current){var e=R.current.getBoundingClientRect(),t=j.current.getBoundingClientRect(),n=function(){if(je(e,t,y,C))return y;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(y);return je(e,t,n,C)||He(e,n)>He(e,y)?n:y}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,C),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,d=t;return d<o+8&&(d=o+8),d+n.width>o+i-8&&(d=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:d}}(o.top,o.left,t);I({top:r.top,left:r.left,opacity:1})}},[T,y,C]),O=s(function(){M||H(!0)},[M,H]),V=s(function(){H(!1)},[H]),P=s(function(){M||H(!T)},[M,T,H]);d(function(){if(T)return requestAnimationFrame(function(){Y()}),window.addEventListener("resize",Y),window.addEventListener("scroll",Y,!0),function(){window.removeEventListener("resize",Y),window.removeEventListener("scroll",Y,!0)}},[T,Y]),d(function(){if(T&&"click"===c){var e=function(e){var t=e.target;R.current&&j.current&&!R.current.contains(t)&&!j.current.contains(t)&&V()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[T,c,V]);var q="hover"===c?{onMouseEnter:O,onMouseLeave:V,onFocus:O,onBlur:V}:{onClick:function(e){e.stopPropagation(),P()}},X=T?e("div",{ref:j,className:"aha-popover ".concat(S),style:{position:"absolute",zIndex:9999,top:N.top,left:N.left,opacity:N.opacity,transition:"opacity 120ms ease-out",width:"number"==typeof b?"".concat(b,"px"):b,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===c?O:void 0,onMouseLeave:"hover"===c?V:void 0,children:i}):null;return t(n,{children:[e("div",g({ref:R,className:"aha-popover-trigger ".concat(k),style:{display:"inline-block",cursor:M?"not-allowed":"pointer"}},q,{children:r})),X&&"undefined"!=typeof document&&f(X,document.body)]})};Ye.displayName="Popover";var Oe=240,Ve=function(n){var o=n.open,r=n.defaultOpen,a=void 0!==r&&r,c=n.onClose,u=n.afterOpenChange,p=n.title,h=n.extra,v=n.footer,x=n.children,m=n.placement,y=void 0===m?"right":m,b=n.width,w=void 0===b?378:b,C=n.height,F=void 0===C?378:C,k=n.mask,D=void 0===k||k,S=n.maskClosable,E=void 0===S||S,M=n.closable,A=void 0===M||M,L=n.closeIcon,z=n.keyboard,B=void 0===z||z,T=n.destroyOnClose,W=void 0!==T&&T,N=n.zIndex,I=void 0===N?1e3:N,R=n.mobileBreakpoint,j=void 0===R?768:R,H=n.className,Y=void 0===H?"":H,O=n.style,V=n.drawerStyle,P=n.headerStyle,q=n.bodyStyle,X=n.footerStyle,Z=n.maskStyle,K=void 0!==o,_=l(a),G=_[0],J=_[1],U=K?!!o:G,Q=l(U),$=Q[0],ee=Q[1],te=l(U),ne=te[0],oe=te[1],re=l(!1),ie=re[0],ae=re[1],le=l(!1),de=le[0],se=le[1];d(function(){ae(!0)},[]),d(function(){var e=function(){se(window.innerWidth<j)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[j]),d(function(){if(U){ee(!0),oe(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){oe(!0)})}),t=window.setTimeout(function(){null==u||u(!0)},Oe);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}oe(!1);var n=window.setTimeout(function(){W&&ee(!1),null==u||u(!1)},Oe);return function(){return window.clearTimeout(n)}},[U,W,u]),d(function(){if(U&&B){var e=function(e){"Escape"===e.key&&(null==c||c(e),K||J(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[U,B,c,K]),d(function(){if(ie&&U){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[U,ie]);var ce=s(function(e){null==c||c(e),K||J(!1)},[c,K]),ue=i(function(){return de?"100vw":"left"===y||"right"===y?"number"==typeof w?"".concat(w,"px"):w:"100vw"},[y,de,w]),pe=i(function(){return"top"===y||"bottom"===y?"number"==typeof F?"".concat(F,"px"):F:"100vh"},[y,F]),fe=i(function(){return de&&("left"===y||"right"===y)?"bottom":y},[de,y]),he=i(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(Oe,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:I+1};switch(fe){case"left":return g(g({},e),{top:0,left:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(-100%)"});case"right":return g(g({},e),{top:0,right:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(100%)"});case"top":return g(g({},e),{top:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(-100%)"});default:return g(g({},e),{bottom:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(100%)"})}},[fe,ue,pe,ne,I]);if(!ie||!$&&!U)return null;var ge=t("div",{className:"aha-drawer-root ".concat(Y),style:g({position:"fixed",inset:0,zIndex:I,pointerEvents:U||ne?"auto":"none"},O),children:[D&&e("div",{"aria-hidden":!0,onClick:E?function(e){return ce(e)}:void 0,style:g({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:ne?1:0,transition:"opacity ".concat(Oe,"ms cubic-bezier(0.2, 0, 0, 1)")},Z)}),t("div",{role:"dialog","aria-modal":"true",style:g(g({},he),V),children:[(void 0!==p||A||h)&&t("div",{style:g({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},P),children:[e("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:p}),t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h,A&&e("button",{type:"button",onClick:function(e){return ce(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:L||e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e("div",{style:g({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},q),children:x}),void 0!==v&&e("div",{style:g({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},X),children:v})]},"".concat(fe,"-").concat(U?"open":"closed"))]});return f(ge,document.body)};Ve.displayName="Drawer";export{A as Alert,S as Button,te as CheckIcon,ce as Checkbox,Me as DatePicker,Ve as Drawer,Be as Form,$ as Input,Te as MenuList,ne as MinusIcon,se as Pagination,Ye as Popover,ye as Progress,xe as Radio,ee as Select,we as Switch,me as Tab,ve as Table,Q as Tag,be as Textarea,C as ThemeProvider,I as Toast,G as ToastProvider,Re as Tooltip,H as clearAllToasts,j as closeToast,Y as debugToast,R as toast,V as toastError,P as toastInfo,q as toastQuestion,O as toastSuccess,F as useTheme};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o,{createContext as r,useMemo as i,useContext as a,useState as l,useEffect as d,useCallback as s,forwardRef as c,useRef as u,useImperativeHandle as p}from"react";import{createPortal as f}from"react-dom";var h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},h(e,t)};var g=function(){return g=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},g.apply(this,arguments)};function v(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function x(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function l(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}d((o=o.apply(e,t||[])).next())})}function m(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(d){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,d])}}}function y(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var b={primaryColor:"#FB6011"},w=r(b),C=function(t){var n=t.theme,o=t.children,r=i(function(){return g(g({},b),n)},[n]);return e(w.Provider,{value:r,children:o})},F=function(){var e=a(w);return e||b},k={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},D=function(o){var r=o.size,i=o.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},S=function(n){var o,r=n.children,i=n.type,a=void 0===i?"default":i,d=n.size,s=void 0===d?"medium":d,c=n.disabled,u=void 0!==c&&c,p=n.loading,f=void 0!==p&&p,h=n.onClick,x=n.htmlType,m=void 0===x?"button":x,y=n.className,b=void 0===y?"":y,w=n.style,C=n.icon,S=n.iconPosition,E=void 0===S?"left":S,M=v(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),A=F().primaryColor,L=void 0===A?"#FB6011":A,z=l(!1),B=z[0],T=z[1],W=l(!1),N=W[0],I=W[1],R=k[s],j=u||f,H=function(){if(f){var t="primary"===a?"#FFFFFF":"#101828",n=parseInt(R.iconSize.replace("px",""));return e(D,{size:n,color:t})}return C?e("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:R.iconSize,height:R.iconSize,flexShrink:0},children:C}):null},Y=(o=g({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:R.gap,height:R.height,paddingLeft:R.paddingLeft,paddingRight:R.paddingRight,fontSize:R.fontSize,lineHeight:R.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:j?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},w),"primary"===a?(o.color="#FFFFFF",o.backgroundColor=L,u?(o.opacity=.4,o.cursor="not-allowed"):f?o.backgroundColor=L:N?o.backgroundColor="#EC470A":B&&(o.backgroundColor="#FD843A")):u?(o.backgroundColor="#FAFAF9",o.color="#D6D3D1",o.border="1px solid #E7E5E4"):f?(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):N?(o.backgroundColor="#F5F5F4",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(o.backgroundColor="#FAFAF9",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),o);return t("button",g({type:m,className:"aha-button aha-button--".concat(a," aha-button--").concat(s," ").concat(j?"aha-button--disabled":""," ").concat(f?"aha-button--loading":""," ").concat(b),disabled:j,onClick:function(e){j?e.preventDefault():null==h||h(e)},onMouseEnter:function(){return!j&&T(!0)},onMouseLeave:function(){T(!1),I(!1)},onMouseDown:function(){return!j&&I(!0)},onMouseUp:function(){return I(!1)},style:Y},M,{children:[f&&H(),!f&&"left"===E&&H(),r&&e("span",{style:{display:"inline-block"},children:r}),!f&&"right"===E&&H()]}))};S.displayName="Button";var E={success:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},M=e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),A=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,d=n.title,s=n.description,c=n.icon,u=void 0===c?E[a]:c,p=n.showIcon,f=void 0===p||p,h=n.closeable,g=void 0!==h&&h,v=n.action,x=n.children,m=n.onClose,y=l(!0),b=y[0],w=y[1],C=function(){w(!1),null==m||m()},F=v||g;return b?t("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[f&&u,t("div",{className:"flex flex-col gap-1 ".concat(F?"flex-1 min-w-0":""),children:[d&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:d}),s&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),x&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:x})]}),F&&t("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[v,g&&e("div",{className:"cursor-pointer relative top-[-12px]",onClick:C,onKeyDown:function(e){return"Enter"===e.key&&C()},role:"button",tabIndex:0,"aria-label":"关闭",children:M})]})]}):null},L={success:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},z=function(t){var n=t.className;return e("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},B=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return y([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),T=new B,W=function(){var o=l([]),r=o[0],i=o[1];d(function(){console.log("Toast: ToastContainer 组件已挂载");var e=T.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=T.subscribe(function(){var e=T.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=r.filter(function(e){return"top-left"===e.props.position}),s=r.filter(function(e){return"top-right"===e.props.position}),c=r.filter(function(e){return"bottom-left"===e.props.position}),u=r.filter(function(e){return"bottom-right"===e.props.position});return t(n,{children:[e("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e(N,g({},t),t.id)})}),e("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e(N,g({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e(N,g({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:u.map(function(t){return e(N,g({},t),t.id)})})]})},N=function(n){var o=n.id,r=n.props,i=l(!1),a=i[0],c=i[1],u=l(!1),p=u[0],f=u[1],h=r.message,g=r.type,v=void 0===g?"info":g,x=r.duration,m=void 0===x?3e3:x,y=r.icon,b=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var D=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:L.success};case"error":return{bgColor:"#E7000B",defaultIcon:L.error};case"question":return{bgColor:"#1C1917",defaultIcon:L.question};default:return{bgColor:"#1447E6",defaultIcon:L.info}}}(v);d(function(){var e=setTimeout(function(){c(!0)},10);return function(){return clearTimeout(e)}},[]),d(function(){if(m>0){var e=setTimeout(function(){S()},m);return function(){return clearTimeout(e)}}},[m,o]);var S=s(function(){f(!0),setTimeout(function(){T.removeToast(o),null==F||F()},300)},[o,F]),E=s(function(){null==k||k()},[k]);return e("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!p?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!p?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:E,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:D.bgColor,color:"white"},children:[e("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:y||D.defaultIcon}),t("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:h}),b&&e("div",{style:{marginTop:"12px"},children:b})]}),C&&e("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e(z,{})})]})})},I=function(t){return e(N,{id:"direct",props:t})},R=function(e){return console.log("Toast: 调用 toast 函数",e),_(),setTimeout(function(){var t=T.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},j=function(e){T.removeToast(e)},H=function(){T.clearAll()},Y=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",T.getToasts()),console.log("容器根节点:",Z),console.log("是否正在初始化:",K),console.log("====================")},O=function(e,t){return _(),R(g(g({},t),{message:e,type:"success"}))},V=function(e,t){return _(),R(g(g({},t),{message:e,type:"error"}))},P=function(e,t){return _(),R(g(g({},t),{message:e,type:"info"}))},q=function(e,t){return _(),R(g(g({},t),{message:e,type:"question"}))},X=null,Z=null,K=!1,_=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(K)console.log("Toast: 容器正在初始化中,跳过");else if(X)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),K=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),X=t,void(K=!1);console.log("Toast: 创建容器元素"),(X=document.createElement("div")).id="aha-toast-container",document.body.appendChild(X),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),Z=n(X),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(W,{})),console.log("Toast: 容器渲染完成"),K=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),Z=n(X),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(W,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}K=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),K=!1})}}catch(e){console.error("Toast: 创建容器失败",e),K=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},G=function(o){var r=o.children,i=l(!1),a=i[0],s=i[1];return d(function(){s(!0)},[]),t(n,{children:[r,a&&f(e(W,{}),document.body)]})},J={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},U={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},Q=function(n){var r=n.children,i=n.color,a=n.variant,l=void 0===a?"light":a,d=n.size,s=void 0===d?"large":d,c=n.stroke,u=void 0!==c&&c,p=n.icon,f=n.iconPosition,h=void 0===f?"none":f,x=n.className,m=void 0===x?"":x,y=n.onClick,b=v(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=F().primaryColor,C=function(e,t){if("string"==typeof e&&e in J){var n=J[e];return"Orange"===e&&t?g(g({},n),{fill:g(g({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),r=parseInt(o.substr(0,2),16),i=parseInt(o.substr(2,2),16),a=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return J.Green}(i,w),k=U[s],D={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===s?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===s?"1.375":"1",transition:"all 0.2s",fontSize:"large"===s?"14px":"12px",height:"small"===s?"20px":"24px"};"light"===l&&(D.backgroundColor=C.light.bg,D.color=C.light.text,u&&(D.outline="1px solid",D.outlineOffset="-1px",D.outlineColor=function(e){if("string"==typeof e&&e in J)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(r,", 0.3)")}return"#A4F4CF"}(i))),y&&(D.cursor="pointer",D.opacity="1");var S=["rounded-md","inline-flex","justify-start","items-center",k.padding,k.gap,"font-medium","font-dm-sans","large"===s?"leading-snug":"leading-none","transition-colors","duration-200","small"===s?"h-5":"h-6"].filter(Boolean);"fill"===l&&(D.backgroundColor=C.fill.bg,D.color=C.fill.text),y&&S.push("cursor-pointer","hover:opacity-80"),m&&S.push(m);var E=S.join(" "),M=function(){if(!p)return null;var t=function(e,t){if("string"==typeof e&&e in J)switch(e){case"Green":default:return"#009966";case"Red":return"#E7000B";case"Orange":return t||"#E17100";case"Blue":return"#155DFC";case"Yellow":return"#EC470A";case"Cyan":return"#0092B8";case"Violet":return"#7F22FE";case"Pink":return"#E60076";case"Gray":return"#57534D"}return"string"==typeof e&&e.startsWith("#")?e:"#009966"}(i,w),n="small"===s?"14px":"16px";return e("div",{className:"flex items-center justify-center",style:{width:n,height:n},children:"svg"===p.type?o.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",g({className:E,style:D,onClick:y},b,{children:["leading"===h&&M(),e("div",{className:"px-1 flex justify-center items-center",children:e("div",{className:"justify-center ".concat(k.textSize," font-medium font-dm-sans ").concat("large"===s?"leading-snug":"leading-none"),children:r})}),"after"===h&&M()]}))},$=c(function(r,i){var a=r.size,l=void 0===a?"medium":a,s=r.disabled,c=void 0!==s&&s,p=r.error,f=void 0!==p&&p,h=r.readOnly,x=void 0!==h&&h,m=r.prefix,y=r.suffix,b=r.allowClear,w=void 0!==b&&b,C=r.onClear,k=r.className,D=void 0===k?"":k,S=r.style,E=r.type,M=void 0===E?"text":E,A=r.placeholder,L=r.value,z=r.defaultValue,B=r.onChange,T=r.onFocus,W=r.onBlur,N=r.onPressEnter,I=v(r,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),R=F().primaryColor,j=void 0===R?"#FB6011":R,H=u(null),Y=o.useState(z||L||""),O=Y[0],V=Y[1],P=o.useState(!1),q=P[0],X=P[1];d(function(){"function"==typeof i?i(H.current):i&&(i.current=H.current)},[i]);var Z=void 0!==L,K=Z?L:O,_=function(e){var t;e.stopPropagation(),Z||V("");null==B||B({target:{value:""},currentTarget:{value:""}}),null==C||C(),null===(t=H.current)||void 0===t||t.focus()},G=w&&K&&!c,J={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},U=y||G?"40px":"12px",Q=g({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":q?j:"#D7D3D0"),backgroundColor:c||x?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:m?"40px":"12px",paddingRight:U,paddingTop:J[l].paddingTop,paddingBottom:J[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},S);return t(n,{children:[e("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n /* 移除数字输入框的上下箭头 */\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] {\n -moz-appearance: textfield;\n }\n '}),t("div",{className:"aha-input-wrapper ".concat(D),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[m&&e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:m}),e("input",g({ref:H,type:M,value:K,placeholder:A,disabled:c,readOnly:x,onChange:function(e){Z||V(e.target.value),null==B||B(e)},onFocus:function(e){X(!0),null==T||T(e)},onBlur:function(e){X(!1),null==W||W(e)},onKeyDown:function(e){var t;"Enter"===e.key&&N&&N(e),null===(t=I.onKeyDown)||void 0===t||t.call(I,e)},style:Q,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(y||G)&&t("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[G&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:_,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),y&&e("span",{style:{pointerEvents:"none"},children:y})]})]})]})});$.displayName="Input";var ee=function(r){var a,c=r.value,p=r.defaultValue,h=r.options,v=void 0===h?[]:h,x=r.mode,m=r.disabled,b=void 0!==m&&m,w=r.error,C=void 0!==w&&w,k=r.placeholder,D=void 0===k?"Please select":k,S=r.size,E=void 0===S?"medium":S,M=r.showSearch,A=void 0!==M&&M,L=r.filterOption,z=void 0===L||L,B=r.allowClear,T=void 0!==B&&B,W=r.onChange,N=r.onSelect,I=r.onDeselect,R=r.onSearch,j=r.onFocus,H=r.onBlur,Y=r.onDropdownVisibleChange,O=r.className,V=void 0===O?"":O,P=r.style,q=r.dropdownClassName,X=void 0===q?"":q,Z=r.dropdownStyle,K=r.defaultOpen,_=void 0!==K&&K,G=r.open,J=r.maxTagCount,U=r.tagRender,Q=r.optionRender,$=F().primaryColor,ee=void 0===$?"#FB6011":$,te=l(void 0!==p?p:x?[]:void 0),ne=te[0],oe=te[1],re=l(_),ie=re[0],ae=re[1],le=l(""),de=le[0],se=le[1],ce=l(-1),ue=ce[0],pe=ce[1],fe=u(null),he=u(null),ge=u(null),ve=l(null),xe=ve[0],me=ve[1],ye=void 0!==c,be=void 0!==G,we=ye?c:ne,Ce=be?G:ie,Fe="multiple"===x||"tags"===x,ke=s(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(t){return e.includes(t.value)})},[we,v]),De=s(function(){return A&&de?!1===z?v:"function"==typeof z?v.filter(function(e){return z(de,e)}):v.filter(function(e){var t=String(e.label||"").toLowerCase(),n=de.toLowerCase();return t.includes(n)}):v},[v,de,A,z]),Se=i(function(){return De()},[De]);d(function(){if(Ce&&fe.current){var e=function(){var e,t;if(fe.current){var n=fe.current.getBoundingClientRect(),o=null!==(t=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*Se.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;me({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Ce,Se.length]),d(function(){var e=function(e){var t=e.target;fe.current&&!fe.current.contains(t)&&ge.current&&!ge.current.contains(t)&&(be||ae(!1),null==Y||Y(!1),se(""))};if(Ce)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Ce,be,Y]),d(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Se.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var n=Se[ue];n&&!n.disabled&&Ee(n)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!1),null==Y||Y(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,Se,ue,be,Y]),d(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Ee=s(function(e){var t;if(!e.disabled)if(Fe){var n,o=Array.isArray(we)?we:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==I||I(e.value,e)):(n=y(y([],o,!0),[e.value],!1),null==N||N(e.value,e)),ye||oe(n);var r=v.filter(function(e){return n.includes(e.value)});null==W||W(n,r)}else ye||oe(e.value),null==W||W(e.value,e),null==N||N(e.value,e),be||ae(!1),null==Y||Y(!1),se(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,v,W,N,I,Y]),Me=s(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),o=v.find(function(e){return e.value===t});ye||oe(n),null==W||W(n,ke()),null==I||I(t,o)}},[Fe,we,ye,v,W,I,ke]),Ae=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||oe(t),null==W||W(t,[]),se("")},Le={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},ze=i(function(){return ke()},[ke]),Be=i(function(){return T&&we&&!b},[T,we,b]),Te=i(function(){return Fe?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Fe,we]),We=i(function(){if(!Fe||!Array.isArray(we)||0===we.length)return null;var n="responsive"===J?ze.slice(0,2):J?ze.slice(0,J):ze,r=J&&ze.length>n.length?ze.length-n.length:0;return t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var r={label:n.label,value:n.value,closable:!b,onClose:function(){return Me({},n.value)}};return U?e(o.Fragment,{children:U(r)},n.value):t("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!b&&e("span",{onClick:function(e){return Me(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),r>0&&t("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",r]})]})},[Fe,we,ze,J,b,U]);return t(n,{children:[e("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),t("div",{ref:fe,className:"aha-select ".concat(V),style:g({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(C?"#F04438":Ce?ee:"#D7D3D0"),backgroundColor:b?"#FAFAF9":"#FFFFFF",cursor:b?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Le[E].paddingTop,paddingBottom:Le[E].paddingBottom,fontSize:Le[E].fontSize,lineHeight:Le[E].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},P),onClick:function(){if(!b){var e=!Ce;be||ae(e),null==Y||Y(e),e&&A?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==j||j(e)},onBlur:function(e){null==H||H(e)},onTouchStart:function(e){b||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:b?-1:0,children:[e("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Fe?We||e("span",D?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:D}:{style:{flex:1,minHeight:"24px"}}):A&&Ce?e("input",{ref:he,type:"text",value:de,onChange:function(e){var t=e.target.value;se(t),null==R||R(t),pe(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:b?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Te?void 0:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Te?b?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Te?(null===(a=ze[0])||void 0===a?void 0:a.label)||we:D||" "})}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Be&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ae,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Ce})]})]}),Ce&&xe&&f(e("div",{ref:ge,className:"aha-select-dropdown ".concat(X),style:g({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===xe.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===xe.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},Z),children:0===Se.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Se.map(function(n,o){var r=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,i=o===ue;return Q?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Ee(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Q(n,{selected:r,focused:i,disabled:n.disabled||!1})},n.value):t("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return Ee(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e("span",{children:n.label}),r&&e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:e("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};ee.displayName="Select";var te=function(t){var n=t.className,o=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ne=function(t){var n=t.className,o=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},oe=function(t){var n=t.className,o=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},re=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ie=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ae=function(t){var n=t.className,o=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},le=function(t){var n=t.className,o=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},de=function(n){var o=n.className,r=n.style;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("g",{clipPath:"url(#clip0_54_1653)",children:e("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e("defs",{children:e("clipPath",{id:"clip0_54_1653",children:e("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},se=function(o){var r=o.current,a=o.defaultCurrent,s=void 0===a?1:a,c=o.total,u=void 0===c?0:c,p=o.pageSize,f=o.defaultPageSize,h=void 0===f?10:f,v=o.showSizeChanger,x=void 0!==v&&v,m=o.pageSizeOptions,y=void 0===m?["10","20","50","100"]:m,b=o.showQuickJumper,w=void 0!==b&&b,C=o.showTotal,k=o.onChange,D=o.onShowSizeChange,E=o.simple,M=void 0!==E&&E,A=o.disabled,L=void 0!==A&&A,z=o.hideOnSinglePage,B=void 0!==z&&z,T=o.className,W=void 0===T?"":T,N=o.style,I=o.size,R=void 0===I?"default":I,j=o.responsive,H=void 0!==j&&j;o.showLessItems;var Y=o.itemRender,O=F().primaryColor,V=void 0===O?"#FB6011":O,P=l(s),q=P[0],X=P[1],Z=l(h),K=Z[0],_=Z[1],G=l(""),J=G[0],U=G[1],Q=null!=r?r:q,te=null!=p?p:K,ne=i(function(){return Math.ceil(u/te)},[u,te]);d(function(){void 0!==r&&X(r)},[r]),d(function(){void 0!==p&&_(p)},[p]);var oe=function(e){e<1||e>ne||e===Q||L||(void 0===r&&X(e),null==k||k(e,te))},re=function(){var e=parseInt(J,10);e>=1&&e<=ne&&(oe(e),U(""))};if(B&&ne<=1)return null;if(M)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(W),style:N,children:[e(S,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ae,{})}),t("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ne]}),e(S,{onClick:function(){return oe(Q+1)},disabled:L||Q===ne,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(le,{})})]});var ie=(Q-1)*te+1,de=Math.min(Q*te,u);return t("div",{className:"aha-pagination w-full ".concat(W),style:g({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:H?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},N),children:[C&&e("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(u,[ie,de])}),t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[u>0&&e(n,{children:Y?Y(Q-1,"prev",e(S,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ae,{})})):e(S,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ae,{})})}),e("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ne<=7)return Array.from({length:ne},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ne)}else if(Q>=ne-3){e.push(1),e.push("jump-prev");for(t=ne-4;t<=ne;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ne)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e(S,{onClick:function(){return oe(t)},disabled:L,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",o):o}if("jump-prev"===t)return o=e(S,{onClick:function(){return oe(Math.max(1,Q-5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e(S,{onClick:function(){return oe(Math.min(ne,Q+5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(Q+5,"jump-next",o):o;return null}(t)})}),u>0&&e(n,{children:Y?Y(Q+1,"next",e(S,{onClick:function(){return oe(Q+1)},disabled:L||Q===ne,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(le,{})})):e(S,{onClick:function(){return oe(Q+1)},disabled:L||Q===ne,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(le,{})})}),x&&e(ee,{value:te,options:y.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(u/t),o=Q>n?n:Q,void 0===p&&_(t),void 0===r&&X(o),null==D||D(o,t),void(null==k||k(o,t));var t,n,o},disabled:L,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),w&&t("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e($,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:re,disabled:L,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof w&&w.goButton?e(S,{onClick:re,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:w.goButton}):e(S,{onClick:re,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},ce=function(n){var o=n.checked,r=void 0!==o&&o,i=n.indeterminate,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.className,u=void 0===c?"":c,p=n.style,f=n.children,h=F().primaryColor,v=r||a,x=d?"#FAFAF9":v?h:"white",m=d?"#FAFAF9":v?h:"#D7D3D0";return t("div",{className:"aha-checkbox ".concat(u),style:g({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},p),onClick:function(e){d||(null==s||s({target:{checked:!r},currentTarget:{checked:!r}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:v?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:e(a?ne:te,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),e("input",{type:"checkbox",checked:r,ref:function(e){e&&(e.indeterminate=a)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};ce.displayName="Checkbox";var ue=function(o){var r=o.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},pe=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e(ue,{color:o}):n;return e("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},fe=function(e,t){return"string"==typeof t?null==e?void 0:e[t]:t.reduce(function(e,t){return null==e?void 0:e[t]},e)},he=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=fe(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},ge=function(t){var n=t.order,o=F().primaryColor;return"ascend"===n?e(ie,{style:{color:o}}):"descend"===n?e(re,{style:{color:o}}):e(oe,{})},ve=function(n){var r,a,c,p,f=n.columns,h=void 0===f?[]:f,x=n.dataSource,m=void 0===x?[]:x,b=n.rowKey,w=void 0===b?"key":b,C=n.rowSelection,k=n.pagination,D=void 0!==k&&k,S=n.size,E=void 0===S?"middle":S,M=n.bordered,A=void 0!==M&&M,L=n.loading,z=void 0!==L&&L,B=n.locale,T=n.showHeader,W=void 0===T||T,N=n.title,I=n.footer,R=n.summary,j=n.scroll,H=n.tableLayout,Y=void 0===H?"auto":H,O=n.onChange,V=n.onSorterChange,P=n.onPaginationChange,q=n.onRow,X=n.className,Z=void 0===X?"":X,K=n.innerClassName,_=void 0===K?"":K,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=v(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=F().primaryColor||"#FB6011",te=l((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];d(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&oe(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var re=l(new Map),ie=re[0],ae=re[1],le=l((null==J?void 0:J.defaultExpandedRowKeys)||[]),de=le[0],ue=le[1],ve=l(D&&"object"==typeof D&&(D.current||D.defaultCurrent)||1),xe=ve[0],me=ve[1],ye=l(D&&"object"==typeof D&&(D.pageSize||D.defaultPageSize)||10),be=ye[0],we=ye[1];d(function(){D&&"object"==typeof D&&(void 0!==D.current&&me(D.current),void 0!==D.pageSize&&we(D.pageSize))},[D]);var Ce=l(null),Fe=Ce[0],ke=Ce[1],De=l(null),Se=De[0],Ee=De[1],Me=l(!1),Ae=Me[0],Le=Me[1],ze=u(null),Be=u(null);d(function(){var e=function(){Le(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Te=s(function(e,t){var n,o,r,i=null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e);if(!(null==i?void 0:i.disabled)){var a,l=he(e,w);a="radio"===(null==C?void 0:C.type)?t?[l]:[]:t?y(y([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var d=m.filter(function(e){return a.includes(he(e,w))});null===(o=null==C?void 0:C.onChange)||void 0===o||o.call(C,a,d),null===(r=null==C?void 0:C.onSelect)||void 0===r||r.call(C,e,t,d,new Event("select"))}},[ne,w,C,m]),We=s(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}).map(function(e){return he(e,w)}),i=e?r:[];oe(i);var a=m.filter(function(e){return i.includes(he(e,w))}),l=e?t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}):[];null===(n=null==C?void 0:C.onChange)||void 0===n||n.call(C,i,a),null===(o=null==C?void 0:C.onSelectAll)||void 0===o||o.call(C,e,a,l)},[w,C,m]),Ne=s(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),V&&V(1===r.length?r[0]:r),O&&O({current:xe,pageSize:be},{},1===r.length?r[0]:r,{currentDataSource:m,action:"sort"})}},[ie,O,V,xe,be,m,h]);s(function(e,t){var n,o,r,i=he(e,w);r=t?y(y([],de,!0),[i],!1):de.filter(function(e){return e!==i}),ue(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[de,w,J]);var Ie,Re=s(function(){var e=y([],m,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=fe(e,r.dataIndex||n),l=fe(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[m,ie,h]),je=Re(),He=Boolean(D&&"object"==typeof D&&void 0!==D.total),Ye=i(function(){if(!1===D||!D)return je;if(He)return je;var e=(xe-1)*be,t=e+be;return je.slice(e,t)},[je,xe,be,D,He]),Oe=s(function(e,t){var n,o,r=null!=t?t:be;if(me(e),t&&we(t),P&&P(e,r),D&&"object"==typeof D&&(null===(n=D.onChange)||void 0===n||n.call(D,e,t),t&&(null===(o=D.onShowSizeChange)||void 0===o||o.call(D,e,t))),O){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});O({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:je,action:"paginate"})}},[D,P,O,be,ie,h,je]),Ve=s(function(e,t,n){var o=fe(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Pe=s(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(C&&("left"===C.fixed||!0===C.fixed))r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=h[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<h.length;i++){var a;if("right"===(a=h[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(C&&"right"===C.fixed)r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return r}}},[h,C]),qe=s(function(){if(!W)return null;var n,o,r,i,a=h.map(function(n,o){var r,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||o,a=ie.get(i)||null,l=Pe(o,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e("th",g({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:d,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:d||void 0,maxWidth:d,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(r=n.onHeaderCell)||void 0===r?void 0:r.call(n,n))||{},{children:t("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:a,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){Ne(n,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e(ge,{order:a||void 0})})]})}),i)});if(C){var l="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",d=e("th",{style:{width:l,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!C.hideSelectAll&&"radio"!==C.type&&(n=Ye.filter(function(e){var t;return!(null===(t=C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}),o=n.map(function(e){return he(e,w)}),r=n.length>0&&o.every(function(e){return ne.includes(e)}),i=o.some(function(e){return ne.includes(e)}),e(ce,{checked:r,indeterminate:i&&!r,onChange:function(e){return We(e.target.checked,Ye)}})),C.columnTitle&&e("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");a.unshift(d)}var s=null==Q?void 0:Q(h,0);return e("thead",{ref:Be,children:e("tr",g({},s||{},{children:a}))})},[h,W,ie,C,ne,Ye,w,Ne,We,B,Q,Pe]),Xe=s(function(e){ke(e)},[]),Ze=s(function(e,t){e.preventDefault(),Ee(t)},[]),Ke=s(function(e,t){if(e.preventDefault(),null===Fe||Fe===t)return ke(null),void Ee(null);var n=y([],Ye,!0),o=n[Fe];n.splice(Fe,1),n.splice(t,0,o),ke(null),Ee(null)},[Fe,Ye]),_e=s(function(){ke(null),Ee(null)},[]),Ge=s(function(){var t=null==B?void 0:B.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=h.length+(C?1:0);return e("tr",{className:"aha-table-placeholder",children:e("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==B?void 0:B.emptyText,h.length,C]),Je=s(function(){return 0===Ye.length?Ge():Ye.map(function(n,r){var i,a=he(n,w),l=ne.includes(a),d=de.includes(a),s=(null==q?void 0:q(n,r))||{},c=r===Ye.length-1;return t(o.Fragment,{children:[t("tr",g({className:"".concat("function"==typeof U?U(n,r):U||""," ").concat(Fe===r?"dragging":""," ").concat(Se===r?"drag-over":""),draggable:!0,onDragStart:function(){return Xe(r)},onDragOver:function(e){return Ze(e,r)},onDrop:function(e){return Ke(e,r)},onDragEnd:_e,style:g({cursor:"move",opacity:Fe===r?.5:1,backgroundColor:Se===r?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){Fe!==r&&Se!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){Fe!==r&&Se!==r&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[C&&e("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(ce,{checked:l,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,n).disabled})})}),h.map(function(t,o){var i,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||o,l=(null===(i=t.onCell)||void 0===i?void 0:i.call(t,n,r))||{},d=Pe(o,t.fixed,!1),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e("td",g({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:g({width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},l.style),colSpan:t.colSpan,rowSpan:t.rowSpan},l,{children:Ve(t,n,r)}),a)})]})),(null==J?void 0:J.expandedRowRender)&&d&&e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:J.expandedRowRender(n,r,0,!0)})})]},a)})},[Ye,w,ne,de,C,h,q,U,Te,Ve,J,Fe,Se,Xe,Ze,Ke,_e,Pe,Ge]),Ue=function(){var t;if(!1===D||!D)return null;var n=null!==(t=D.total)&&void 0!==t?t:je.length,o=D.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e(se,{current:xe,total:n,pageSize:be,showSizeChanger:D.showSizeChanger,pageSizeOptions:D.pageSizeOptions,showQuickJumper:D.showQuickJumper,showTotal:D.showTotal,onChange:Oe,onShowSizeChange:Oe,simple:D.simple,responsive:D.responsive,size:"small"===E?"small":"default"})})},Qe=i(function(){return h.some(function(e){return e.fixed})||C&&C.fixed},[h,C]),$e=i(function(){return h.every(function(e){return e.width})&&(!C||C.columnWidth)},[h,C]),et=i(function(){if(null==j?void 0:j.x){if("number"==typeof j.x)return j.x;if(!0===j.x)return h.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Qe)return h.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[h,null==j?void 0:j.x,C,Qe]),tt=i(function(){return"fixed"===Y||Qe||$e||h.some(function(e){return e.width})?"fixed":Y},[Y,Qe,$e,h]),nt=g(g({width:"100%",minWidth:et?"".concat(et,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:tt,backgroundColor:"white"},A&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),ot=g({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==j?void 0:j.y)?"".concat(j.y,"px"):void 0,borderRadius:"8px"},G);if(Ae)return t("div",g({ref:ze,className:"aha-table aha-table-mobile-wrapper ".concat(Z),style:ot,"aria-busy":!!z||void 0},$,{children:[N&&e("div",{style:{marginBottom:"16px"},children:N(je)}),D&&"object"==typeof D&&(null===(r=D.position)||void 0===r?void 0:r.startsWith("top"))&&Ue(),(Ie="function"==typeof(null==B?void 0:B.emptyText)?B.emptyText():void 0!==(null==B?void 0:B.emptyText)?B.emptyText:"No data",0===Ye.length?e("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ie}):e("div",{className:"aha-table-mobile",children:Ye.map(function(n,o){var r,i=he(n,w),a=ne.includes(i);return t("div",{className:"aha-table-mobile-row ".concat(a?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:a?"#e6f7ff":"white"},children:[C&&e("div",{style:{marginBottom:"8px"},children:e(ce,{checked:a,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,n).disabled})}),h.map(function(r){var i=r.key||(Array.isArray(r.dataIndex)?r.dataIndex.join("."):r.dataIndex),a=fe(n,r.dataIndex||""),l=r.render?r.render(a,n,o):a;return t("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[t("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof r.title?r.title({}):r.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})})),I&&e("div",{style:{marginTop:"16px"},children:I(je)}),D&&("object"!=typeof D||!(null===(a=D.position)||void 0===a?void 0:a.startsWith("top")))&&Ue(),e(pe,{loading:z,spinColor:ee})]}));var rt={position:"relative",overflowX:(null==j?void 0:j.x)||Qe?"auto":"visible",overflowY:(null==j?void 0:j.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==j?void 0:j.x)?"100%":"number"==typeof(null==j?void 0:j.x)?"".concat(j.x,"px"):void 0,maxHeight:"number"==typeof(null==j?void 0:j.y)?"".concat(j.y,"px"):void 0,borderRadius:"8px"};return t("div",g({ref:ze,className:"aha-table ".concat(Z),style:ot,"aria-busy":!!z||void 0},$,{children:[N&&e("div",{style:{marginBottom:"16px"},children:N(je)}),D&&"object"==typeof D&&(null===(c=D.position)||void 0===c?void 0:c.startsWith("top"))&&Ue(),e("div",{style:rt,children:e("div",{style:{width:"100%",minWidth:et?"".concat(et,"px"):"100%",display:"block"},children:t("table",{style:nt,className:_,children:[qe(),e("tbody",{children:Je()}),R&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:R(je)})})})]})})}),I&&e("div",{style:{marginTop:"16px"},children:I(je)}),D&&("object"!=typeof D||!(null===(p=D.position)||void 0===p?void 0:p.startsWith("top")))&&Ue(),e(pe,{loading:z,spinColor:ee})]}))},xe=function(n){var o=n.checked,r=void 0!==o&&o,i=n.disabled,a=void 0!==i&&i,l=n.onChange,d=n.className,s=void 0===d?"":d,c=n.style,u=n.children,p=n.value,f=n.name,h=F().primaryColor,v=void 0===h?"#FB6011":h,x=a?"#FAFAF9":r?v:"white",m=a?"#FAFAF9":r?v:"#D7D3D0";return t("div",{className:"aha-radio ".concat(s),style:g({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},c),onClick:function(e){a||(null==l||l({target:{checked:!r,value:p},currentTarget:{checked:!r,value:p}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:r?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),u&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:r,onChange:l,disabled:a,value:p,name:f,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};xe.displayName="Radio";var me=function(n){var r=n.items,a=void 0===r?[]:r,c=n.variant,p=void 0===c?"underline":c,f=n.layout,h=void 0===f?"equal":f,x=n.defaultValue,m=n.value,y=n.onChange,b=n.className,w=void 0===b?"":b,C=n.mode,k=void 0===C?"children":C,D=n.scrollable,S=void 0!==D&&D,E=v(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),M=F().primaryColor;if(!a||0===a.length)return null;var A=i(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),L=void 0!==m,z=A.length>0?A[0].key:"",B=function(e){if(void 0===e)return z;var t=A.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:z},T=l(function(){var e,t=null!==(e=null!=m?m:x)&&void 0!==e?e:z;return B(t)}),W=T[0],N=T[1],I=L?void 0!==m?B(m):z:W;d(function(){console.log("[Tab Debug] currentValue:",I,"type:",typeof I),console.log("[Tab Debug] normalizedItems:",A.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",m,"isControlled:",L)},[I,A,m,L]);var R=s(function(e,t){if(!t){L||N(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),S&&"underline"===p){var o=Y.current[O(e)],r=q.current;if(o&&r){K.current=!0;var i,l=function(){if(r&&V.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),K.current=!1,r.removeEventListener("scroll",d)},150)};r.addEventListener("scroll",d,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[L,y,a,S,p]),j=A.find(function(e){if(e.key===I)return!0;if(String(e.key)===String(I))return!0;var t=Number(e.key),n=Number(I);return!isNaN(t)&&!isNaN(n)&&t===n}),H=M||"#FB6011",Y=u({}),O=function(e){return String(e)},V=u(null),P=u(null),q=u(null),X=u(null),Z=u("");u(new Set);var K=u(!1),_=l({width:0,left:0,opacity:0}),G=_[0],J=_[1],U=l({width:0,left:0,opacity:0}),Q=U[0],$=U[1],ee=s(function(){"underline"===p&&q.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(V.current&&q.current){var e=Y.current[O(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=q.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=q.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),d="".concat(a,"px");J(function(e){return e.left===l&&e.width===d&&1===e.opacity?e:{width:d,left:l,opacity:1}})}}}})})},[p,I,A]),te=s(function(){"background"===p&&X.current&&P.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&X.current){var e=Y.current[O(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=X.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");$(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[p,I,A]);d(function(){I?Z.current!==I&&(Z.current=I,"underline"===p&&q.current&&!K.current&&ee(),"background"===p&&X.current&&P.current&&te()):Z.current=""},[I,p,A.length,L,ee,te]),d(function(){if(I){var e=setTimeout(function(){if("underline"===p)(e=Y.current[O(I)])&&q.current&&V.current&&(ee(),S&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=Y.current[O(I)])&&X.current&&P.current){var t=X.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");$({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),d(function(){if(S&&"underline"===p&&I&&!K.current){var e=setTimeout(function(){var e=Y.current[O(I)],t=q.current;if(e&&t){K.current=!0;var n,o=function(){if(t&&V.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),K.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[I,S,p]);var ne;return t("div",{className:"aha-tab-container",children:["underline"===p?(ne={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},S&&(ne.overflowX="auto",ne.overflowY="hidden",ne.scrollBehavior="smooth",ne.scrollbarWidth="none",ne.WebkitOverflowScrolling="touch"),t("div",g({ref:q,className:"aha-tab aha-tab--underline ".concat(S?"aha-tab--scrollable":""," ").concat(w),style:ne},E,{children:[e("div",{ref:V,style:g({position:"absolute",bottom:"0px",height:"2px",backgroundColor:H,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},G)}),A.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p}),t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:S?0:void 0,whiteSpace:S?"nowrap":void 0},children:[n.icon&&function(){var t,i=typeof n.icon,a=o.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:i,isReactElement:a,iconValue:n.icon}),o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:20,height:20,style:g(g({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?H:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:20,height:20,style:{color:r?H:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?H:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:r?"#FFF6ED":"#FAFAF9",border:r?"1px solid #FFD1A9":"1px solid #E7E5E4",color:r?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===h?"100%":"fit-content",t("div",g({ref:X,className:"aha-tab aha-tab--background aha-tab--".concat(h," ").concat(w),style:n},E,{children:[e("div",{ref:P,style:g({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},Q)}),A.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===h?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:i,children:[n.icon&&function(){var t;return o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:16,height:16,style:g(g({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:16,height:16,style:{color:r?"#44403C":"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:r?"#FFF6ED":"#FAFAF9",border:r?"1px solid #FFD1A9":"1px solid #E7E5E4",color:r?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),S&&"underline"===p&&e("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===k&&(null==j?void 0:j.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:j.children})]})},ye=function(o){var r=o.percent,i=void 0===r?0:r,a=o.type,s=void 0===a?"circle":a,c=o.width,p=void 0===c?120:c,f=o.title,h=o.titlePosition,x=o.showPercent,m=void 0===x||x,y=o.animated,b=void 0!==y&&y,w=o.status,C=void 0===w?"normal":w,k=o.className,D=void 0===k?"":k,S=o.style,E=o.strokeColor,M=o.trailColor,A=void 0===M?"#F5F5F4":M,L=v(o,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),z=F().primaryColor,B=Math.min(100,Math.max(0,i)),T=u(!0),W=l(!1),N=W[0],I=W[1],R=l(0),j=R[0],H=R[1];d(function(){if(b&&T.current&&B>0){T.current=!1,H(0),I(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){H(B)})});var e=setTimeout(function(){I(!1),H(B)},300);return function(){return clearTimeout(e)}}T.current?(T.current=!1,I(!1),H(B)):H(B)},[b,B]);var Y=E||z||"#FB6011";"success"===C?Y="#00BC7D":"exception"===C&&(Y="#FB2C36");var O=h||"inside",V=Math.max(4,Math.round(.06*p)),P=(p-V)/2,q="semicircle"===s?p/2:p,X="14px",Z="12px",K=function(){var o=f&&"outside"===O?p+4+18+4:p,r=2*Math.PI*P,i=r-(N?j:B)/100*r;return t("div",{style:{position:"relative",width:p,height:o,display:"flex",alignItems:"center",justifyContent:"center"},children:[t("svg",{width:p,height:p,style:{position:"absolute",top:0,left:0},children:[e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:i,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:X,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]})},_=g({display:"inline-flex",flexDirection:"column",alignItems:"center",width:p},S);return e("div",g({className:"aha-progress aha-progress--".concat(s," ").concat(D),style:_},L,{children:function(){switch(s){case"circle":return K();case"semicircle":return r=V/2,i=p-V/2,a=(o=q+V)-V/2,l=q/2+V/2+V/2,d=f&&"outside"===O?o+4+18+4:o,c=Math.PI*P,u=c-(N?j:B)/100*c,t("div",{style:{position:"relative",width:p,height:d,overflow:"hidden"},children:[t("svg",{width:p,height:o,viewBox:"0 0 ".concat(p," ").concat(o),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(r," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("path",{d:"M ".concat(r," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(o,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),K()}var o,r,i,a,l,d,c,u}()}))},be=c(function(r,i){var a=r.disabled,l=void 0!==a&&a,s=r.error,c=void 0!==s&&s,p=r.readOnly,f=void 0!==p&&p,h=r.showCount,x=void 0!==h&&h,m=r.maxLength,y=r.className,b=void 0===y?"":y,w=r.style,C=r.placeholder,k=r.value,D=r.defaultValue,S=r.rows,E=void 0===S?3:S,M=r.autoSize,A=void 0!==M&&M,L=r.onChange,z=r.onFocus,B=r.onBlur,T=v(r,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),W=F().primaryColor,N=void 0===W?"#FB6011":W,I=u(null),R=o.useState(D||k||""),j=R[0],H=R[1],Y=o.useState(!1),O=Y[0],V=Y[1],P=o.useState(void 0),q=P[0],X=P[1];d(function(){"function"==typeof i?i(I.current):i&&(i.current=I.current)},[i]);var Z=void 0!==k,K=Z?k:j,_=String(K||"").length;d(function(){if(A&&I.current){var e=I.current,t="object"==typeof A&&A.minRows||1,n="object"==typeof A?A.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),X(l)}},[K,A]);var G=g(g({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":O?N:"#D7D3D0"),backgroundColor:l||f?"#FAFAF9":"#FFFFFF",color:l?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:A?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==q&&A?{height:"".concat(q,"px")}:{}),w);return t(n,{children:[e("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n "}),t("div",{className:"aha-textarea-wrapper ".concat(b),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e("textarea",g({ref:I,value:K,placeholder:C,disabled:l,readOnly:f,rows:A?void 0:E,maxLength:m,onChange:function(e){Z||H(e.target.value),null==L||L(e)},onFocus:function(e){V(!0),null==z||z(e)},onBlur:function(e){V(!1),null==B||B(e)},style:G,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(x||m)&&e("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:m?t("span",{children:[_," / ",m]}):e("span",{children:_})})]})]})});be.displayName="Textarea";var we=function(n){var r=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.onClick,u=n.checkedChildren,p=n.unCheckedChildren,f=n.size,h=void 0===f?"default":f,v=n.loading,x=void 0!==v&&v,m=n.className,y=void 0===m?"":m,b=n.style,w=F().primaryColor,C=void 0===w?"#FB6011":w,k=o.useState(a),D=k[0],S=k[1],E=void 0!==r,M=E?r:D,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[h],L=M||x,z=d?"#E7E5E4":L?C:"#F5F5F4",B=L?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":M,disabled:d||x,onClick:function(e){if(!d&&!x){var t=!M;E||S(t),null==s||s(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(y),style:g({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:L?"flex-end":"flex-start",width:A.width,height:A.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===h?"10px":"12px",backgroundColor:z,cursor:d||x?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(u||p)&&e("span",{style:{position:"absolute",left:L?"6px":"auto",right:L?"auto":"6px",fontSize:A.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:d?.5:1,zIndex:1,pointerEvents:"none"},children:L?u:p}),e("span",{style:{position:"absolute",left:B,top:"50%",transform:"translateY(-50%)",width:A.thumbSize,height:A.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:x&&t("svg",{width:"small"===h?"8":"10",height:"small"===h?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};we.displayName="Switch";var Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fe=["January","February","March","April","May","June","July","August","September","October","November","December"],ke=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),Fe[o]).replace(new RegExp("","g"),Ce[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},De=function(e,t){return new Date(e,t+1,0).getDate()},Se=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Ee=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},Me=function(o){var r=o.mode,a=void 0===r?"date":r,c=o.disabled,p=void 0!==c&&c,h=o.error,v=void 0!==h&&h,x=o.placeholder,m=void 0===x?"Select date":x,y=o.startPlaceholder,b=void 0===y?"Start date":y,w=o.endPlaceholder,C=void 0===w?"End date":w,k=o.size,D=void 0===k?"medium":k,S=o.allowClear,E=void 0!==S&&S,M=o.format,A=void 0===M?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":M,L=o.onFocus,z=o.onBlur,B=o.onOpenChange,T=o.className,W=void 0===T?"":T,N=o.style,I=o.dropdownClassName,R=void 0===I?"":I,j=o.dropdownStyle,H=o.defaultOpen,Y=void 0!==H&&H,O=o.open,V=o.minDate,P=o.maxDate,q=o.separator,X=void 0===q?" - ":q,Z=o.presetRanges,K=void 0!==Z&&Z,_=o.calendarCount,G=void 0===_?1:_,J=o.showApplyCancel,U=void 0!==J&&J,Q=o.applyText,$=void 0===Q?"Apply":Q,ee=o.cancelText,te=void 0===ee?"Cancel":ee,ne=o.onApply,oe=o.onCancel,re=o.showSelectedRange,ie=void 0!==re&&re,ae=o.startSelectedRangeText,le=void 0===ae?"Select dates":ae,de=o.endSelectedRangeText,se=void 0===de?"Select dates":de,ce=o.rangeDisplayMode,ue=void 0===ce?"range":ce,pe=F().primaryColor,fe=void 0===pe?"#FB6011":pe,he="range"===a,ge=l(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),ve=ge[0],xe=ge[1],me=l(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),ye=me[0],be=me[1],we=l(Y),Ce=we[0],Me=we[1],Ae=l(!0),Le=Ae[0],ze=Ae[1],Be=l(null),Te=Be[0],We=Be[1],Ne=l(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ie=Ne[0],Re=Ne[1],je=l(function(){if(2===G&&he){var e=new Date(Ie.year,Ie.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),He=je[0],Ye=je[1];d(function(){if(2===G&&he){var e=new Date(Ie.year,Ie.month+1,1);Ye({year:e.getFullYear(),month:e.getMonth()})}else Ye(null)},[Ie,G,he]);var Oe=u(null),Ve=u(null),Pe=u(null),qe=u(null),Xe=u(null),Ze=l(null),Ke=Ze[0],_e=Ze[1],Ge=u(!1),Je=u(!1),Ue=u(null),Qe="value"in o&&void 0!==o.value,$e=void 0!==O,et=he?null:Qe&&"date"===a&&"value"in o?o.value:ve,tt=he?Qe&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:ye:{startDate:null,endDate:null},nt=$e?O:Ce;d(function(){if(nt&&!Ge.current){if(he){var e=tt.startDate||tt.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Re({year:t,month:n})}else{var o=new Date;Re({year:o.getFullYear(),month:o.getMonth()})}}else if(et){t=et.getFullYear(),n=et.getMonth();Re({year:t,month:n})}else{o=new Date;Re({year:o.getFullYear(),month:o.getMonth()})}Ge.current=!0}else nt||(Ge.current=!1)},[nt,et,tt,he]),d(function(){if(nt&&Oe.current){Je.current=!1,Ue.current=null;var e=function(){if(Oe.current){var e=Oe.current.getBoundingClientRect();if(Je.current&&null!==Ue.current){var t,n=Ue.current;if(Xe.current){var o=Xe.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void _e({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";_e({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(Xe.current){var t=Xe.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),Je.current=!0,Ue.current=i}_e({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}_e(null),Je.current=!1,Ue.current=null},[nt]),d(function(){var e=function(e){var t=e.target;Oe.current&&!Oe.current.contains(t)&&Xe.current&&!Xe.current.contains(t)&&($e||Me(!1),null==B||B(!1))};if(nt)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[nt,$e,B]);var ot,rt,it,at,lt=s(function(e){var t;Ee(e,V,P)&&(Qe||xe(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),$e||Me(!1),null==B||B(!1))},[Qe,$e,a,o,B,V,P]),dt=s(function(e){var t;if(Ee(e,V,P)){var n,r=U&&Te?Te:tt;r.startDate&&r.endDate?(n={startDate:e,endDate:null},ze(!1)):Le?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},ze(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(ze(!0),U||($e||Me(!1),null==B||B(!1))):ze(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},ze(!1)):(n={startDate:r.startDate,endDate:e},ze(!0),U||($e||Me(!1),null==B||B(!1))),U?We(n):(Qe||be(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[Le,tt,Te,U,Qe,$e,a,o,B,V,P]),st=function(e){var t,n;if(e.stopPropagation(),he){var r={startDate:null,endDate:null};Qe||be(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),ze(!0)}else Qe||xe(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!nt){var i=new Date;Re({year:i.getFullYear(),month:i.getMonth()})}},ct=function(){if(!p){var e=!nt;if($e||Me(e),null==B||B(e),e){if(he){if(ze(!tt.startDate),U&&We(tt),!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else if(!et){t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else!e&&U&&We(null)}},ut=i(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),pt=i(function(){return Array.isArray(K)?K:!0===K?ut:[]},[K,ut]),ft=pt.length>0,ht=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Re({year:n,month:r})}U?We(e):(Qe||be(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),$e||Me(!1),null==B||B(!1))},gt=function(){Re(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},vt=function(){Re(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},xt=s(function(e,t){for(var n=De(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),mt=i(function(){return xt(Ie.year,Ie.month)},[Ie,xt]),yt=i(function(){return 2===G&&he&&He?xt(He.year,He.month):null},[G,he,He,xt]),bt=function(){He&&Ye(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},wt=function(){He&&Ye(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},Ct={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Ft=E&&!p&&(he?tt.startDate||tt.endDate:et),kt=et?ke(et,A):"",Dt=tt.startDate?ke(tt.startDate,A):"",St=tt.endDate?ke(tt.endDate,A):"",Et=i(function(){if(!he||"text"!==ue)return"";if(tt.startDate&&tt.endDate){var e=ke(tt.startDate,"MMM D, YYYY"),t=ke(tt.endDate,"MMM D, YYYY");return"".concat(e," ").concat(X," ").concat(t)}return tt.startDate?ke(tt.startDate,"MMM D, YYYY"):tt.endDate?ke(tt.endDate,"MMM D, YYYY"):""},[he,ue,tt,X]),Mt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return t(n,{children:[e("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),t("div",{ref:Oe,className:"aha-date-picker ".concat(W),style:g({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(v?"#F04438":nt?fe:"#D7D3D0"),backgroundColor:p?"#FAFAF9":"#FFFFFF",cursor:p?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:Ft?"30px":"12px",paddingTop:Ct[D].paddingTop,paddingBottom:Ct[D].paddingBottom,fontSize:Ct[D].fontSize,lineHeight:Ct[D].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:ct,onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},tabIndex:p?-1:0,children:[e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:p?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),he?"text"===ue?e("input",{ref:Ve,type:"text",value:Et,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate||tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):t("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e("input",{ref:Pe,type:"text",value:Dt,readOnly:!0,placeholder:b,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!0),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e("span",{style:{color:p?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:X}),e("input",{ref:qe,type:"text",value:St,readOnly:!0,placeholder:C,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!1),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e("input",{ref:Ve,type:"text",value:kt,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":et?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),Ft&&e("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:st,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),nt&&Ke&&f(e("div",{ref:Xe,className:"aha-date-picker-dropdown ".concat(R),style:g({position:"absolute",top:"".concat(Ke.top,"px"),left:"".concat(Ke.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Ke.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Ke.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},j),children:t("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:he&&ft&&1===G?"column":"row"},children:[he&&ft&&2===G&&e("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:U?"0":"8px"},children:pt.map(function(t,n){var o=Te?Se(t.range.startDate,Te.startDate)&&Se(t.range.endDate,Te.endDate):Se(t.range.startDate,tt.startDate)&&Se(t.range.endDate,tt.endDate);return e("div",{onClick:function(){return ht(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?fe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),t("div",{children:[e("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===G?"row":"column",gap:2===G?"24px":"0"},children:(at=function(n,o,r,i,a){return void 0===a&&(a=0),t("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:2===G&&he?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===G&&he&&1===a)&&e("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",left:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[Fe[n.month]," ",n.year]}),!(2===G&&he&&0===a)&&e("button",{type:"button",onClick:i,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",right:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),he&&ie&&1===G&&0===a&&(l=U&&Te?Te:tt,d=l.startDate?ke(l.startDate,"MMM D, YYYY"):le,s=l.endDate?ke(l.endDate,"MMM D, YYYY"):se,t("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.startDate?"text-[#44403C]":"text-[#79716B]"),children:d}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),he&&ft&&1===G&&e("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:pt.map(function(t,n){var o=Te?Se(t.range.startDate,Te.startDate)&&Se(t.range.endDate,Te.endDate):Se(t.range.startDate,tt.startDate)&&Se(t.range.endDate,tt.endDate);return e("button",{type:"button",onClick:function(){return ht(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?fe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Mt.map(function(t){return e("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var r,i,a=(r=n.year,i=n.month,new Date(r,i,1).getDay()),l=(0===a?7:a)-1,d=[],s=0;s<l;s++)d.push(e("div",{},"empty-".concat(s)));return o.forEach(function(o,r){if(o){var i=l+r,a=o.getMonth()===n.month,s=Se(o,new Date),c=!Ee(o,V,P);if(he){var u=U&&Te?Te:tt,p=Se(o,u.startDate),f=Se(o,u.endDate),h=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(o,u.startDate,u.endDate),g=i%7==0,v=i%7==6,x=p,m=f,y={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(x||m)y.background=fe,y.borderRadius="50%",y.color="#FFFFFF",y.fontWeight=500;else if(h){y.background="#F5F5F4",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;var b=1===o.getDate(),w=De(n.year,n.month),C=o.getDate()===w,F=g||b,k=v||C;F&&k?y.borderRadius="18px":F?(y.borderTopLeftRadius="18px",y.borderBottomLeftRadius="18px",y.borderTopRightRadius="0",y.borderBottomRightRadius="0"):k?(y.borderTopRightRadius="18px",y.borderBottomRightRadius="18px",y.borderTopLeftRadius="0",y.borderBottomLeftRadius="0"):y.borderRadius="0"}else y.background="transparent",y.borderRadius="50%",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;d.push(t("button",{type:"button",disabled:c,onClick:function(){return dt(o)},style:y,onMouseEnter:function(e){c||x||m||(e.currentTarget.style.backgroundColor=h?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){x||m||(e.currentTarget.style.backgroundColor=h?"#F5F5F4":"transparent")},children:[o.getDate(),s&&e("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:x||m?"#FFFFFF":fe}})]},"date-".concat(r)))}else{var D=Se(o,et);d.push(t("button",{type:"button",disabled:c,onClick:function(){return lt(o)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:D?fe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:D?500:400,color:D?"#FFFFFF":a?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||D||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){D||(e.currentTarget.style.backgroundColor="transparent")},children:[o.getDate(),s&&!D&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:fe}})]},"date-".concat(r)))}}}),d}()})]},a);var l,d,s},t(n,{children:[at(Ie,mt,gt,vt,0),2===G&&he&&He&&yt&&at(He,yt,bt,wt,1)]}))}),he&&ie&&2===G&&!U&&(ot=tt,rt=ot.startDate?ke(ot.startDate,"MMM D, YYYY"):le,it=ot.endDate?ke(ot.endDate,"MMM D, YYYY"):se,e("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(ot.startDate?"text-[#44403C]":"text-[#79716B]"),children:rt}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(ot.endDate?"text-[#44403C]":"text-[#79716B]"),children:it})]})})),he&&U&&t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[ie&&2===G&&function(){var n=Te||tt,o=n.startDate?ke(n.startDate,"MMM D, YYYY"):le,r=n.endDate?ke(n.endDate,"MMM D, YYYY"):se;return t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.startDate?"text-[#44403C]":"text-[#79716B]"),children:o}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.endDate?"text-[#44403C]":"text-[#79716B]"),children:r})]})}(),t("div",{className:"".concat(2===G?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e("button",{type:"button",onClick:function(){We(null),null==oe||oe(),$e||Me(!1),null==B||B(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:te}),e("button",{type:"button",onClick:function(){var e;Te&&(Qe||be(Te),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Te)),null==ne||ne(Te),$e||Me(!1),null==B||B(!1),We(null))},disabled:!Te||!Te.startDate||!Te.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Te&&Te.startDate&&Te.endDate?fe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Te&&Te.startDate&&Te.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor=fe)},children:$})]})]})]})]})}),document.body)]})};Me.displayName="DatePicker";var Ae=r(null),Le=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),ze=o.forwardRef(function(t,n){var o=t.initialValues,r=void 0===o?{}:o,a=t.onValuesChange,c=t.onFinish,f=t.onFinishFailed,h=t.labelWidth,v=void 0===h?"120px":h,y=t.labelAlign,b=void 0===y?"right":y,w=t.layout,C=void 0===w?"horizontal":w;t.size;var F=t.className,k=void 0===F?"":F,D=t.style,S=t.children,E=l(function(){var e={};return Object.keys(r).forEach(function(t){e[t]={value:r[t],error:void 0,touched:!1,validating:!1}}),e}),M=E[0],A=E[1],L=u(M);d(function(){L.current=M},[M]);var z=u({}),B=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.value},[]),T=s(function(e,t){A(function(n){var o=g({},n);if(o[e]?o[e]=g(g({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},L.current[e]?L.current[e]=g(g({},L.current[e]),{value:t}):L.current[e]={value:t,error:void 0,touched:!1,validating:!1},a){var r={};r[e]=t;var i={};Object.keys(o).forEach(function(e){i[e]=o[e].value}),a(r,i)}return o})},[a]),W=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.error},[]),N=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{error:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),I=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.touched)||!1},[]),R=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{touched:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),j=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.validating)||!1},[]),H=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{validating:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),Y=u();Y.current=function(e,t){A(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var d=o[l],s=i[l];if((null==d?void 0:d.required)!==(null==s?void 0:s.required)||(null==d?void 0:d.message)!==(null==s?void 0:s.message)||(null==d?void 0:d.type)!==(null==s?void 0:s.type)||(null==d?void 0:d.pattern)!==(null==s?void 0:s.pattern)||(null==d?void 0:d.min)!==(null==s?void 0:s.min)||(null==d?void 0:d.max)!==(null==s?void 0:s.max)||(null==d?void 0:d.len)!==(null==s?void 0:s.len)||(null==d?void 0:d.whitespace)!==(null==s?void 0:s.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var c=g({},n);return c[e]?c[e]=g(g({},c[e]),{rules:t.rules,required:t.required}):c[e]={value:r[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},c})};var O=s(function(e,t){var n;null===(n=Y.current)||void 0===n||n.call(Y,e,t)},[]),V=s(function(e){delete z.current[e],A(function(t){var n=g({},t);return delete n[e],n}),delete L.current[e]},[]),P=s(function(e){return x(void 0,void 0,void 0,function(){var t,n,o,r,i,a,l,d,s;return m(this,function(c){switch(c.label){case 0:if(!(t=L.current[e]))return[2,void 0];H(e,!0),n=t.rules||[],r=0,i=n,c.label=1;case 1:if(!(r<i.length))return[3,6];if(a=i[r],l=t.value,a.required&&(null==l||""===l))return o=a.message||"".concat(e," is required"),[3,6];if(a.type&&null!=l&&""!==l&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[a.type])&&!d(l))return o=a.message||"".concat(e," must be a valid ").concat(a.type),[3,6];if(a.pattern&&null!=l&&""!==l&&!a.pattern.test(String(l)))return o=a.message||"".concat(e," format is invalid"),[3,6];if(void 0!==a.min&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))<a.min)return o=a.message||"".concat(e," must be at least ").concat(a.min),[3,6];if(void 0!==a.max&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))>a.max)return o=a.message||"".concat(e," must be at most ").concat(a.max),[3,6];if(void 0!==a.len&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))!==a.len)return o=a.message||"".concat(e," must be exactly ").concat(a.len),[3,6];if(a.whitespace&&"string"==typeof l&&l.trim()!==l)return o=a.message||"".concat(e," cannot be whitespace"),[3,6];if(!a.validator)return[3,5];c.label=2;case 2:return c.trys.push([2,4,,5]),[4,a.validator(a,l)];case 3:return c.sent(),[3,5];case 4:return s=c.sent(),o=(null==s?void 0:s.message)||a.message||"".concat(e," validation failed"),[3,6];case 5:return r++,[3,1];case 6:return L.current[e]?L.current[e]=g(g({},L.current[e]),{error:o,validating:!1,touched:!0}):L.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},A(function(n){var r=g({},n);return r[e]?r[e]=g(g({},r[e]),{error:o,validating:!1,touched:!0}):r[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},r}),[2,o]}})})},[]),q=s(function(e){var t=L.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),X=s(function(e){return x(void 0,void 0,void 0,function(){var t,n,o,r,i;return m(this,function(a){switch(a.label){case 0:return t=L.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return x(void 0,void 0,void 0,function(){var n,o;return m(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,P(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return a.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(a.sent(),o.length>0)throw r=q(),i={values:r,errorFields:o},null==f||f(i),new Le("Form validation failed",r,o);return[2,q()]}})})},[P,q,f]),Z=s(function(e){A(function(t){var n=g({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=g(g({},n[e]),{value:r[e],error:void 0,touched:!1,validating:!1}),L.current[e]=g({},n[e]))}),n})},[r]),K=s(function(e){A(function(t){var n=g({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=g(g({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},L.current[t]=g({},n[t])}),a){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),a(e,o)}return n})},[a]),_=s(function(){return x(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,X()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[X,c]),G=s(function(e){if(A(function(t){var n=g({},t);return e.forEach(function(e){var t=e.name,o=e.value,r=e.errors,i=r&&r.length>0?r[0]:void 0;n[t]?n[t]=g(g(g({},n[t]),void 0!==o&&{value:o}),{error:i,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:i,touched:!0,validating:!1},L.current[t]=g({},n[t])}),n}),a&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return a(t,q())},0)}},[a,q]),J=s(function(e,t){t?z.current[e]=t:delete z.current[e]},[]),U=s(function(e,t){var n=z.current[e];null==n||n.scrollIntoView(g({behavior:"smooth",block:"center"},t))},[]);p(n,function(){return{getFieldValue:B,getFieldsValue:q,setFieldValue:T,setFieldsValue:K,setFields:G,getFieldError:W,validateField:P,validateFields:X,resetFields:Z,submit:_,scrollToField:U}});var Q=i(function(){return{fields:M,getFieldValue:B,setFieldValue:T,getFieldError:W,setFieldError:N,isFieldTouched:I,setFieldTouched:R,isFieldValidating:j,setFieldValidating:H,registerField:O,unregisterField:V,validateField:P,validateFields:X,resetFields:Z,getFieldsValue:q,setFieldsValue:K,setFields:G,submit:_,scrollToField:U,registerFieldRef:J,labelWidth:v,labelAlign:b}},[M,B,T,W,N,I,R,j,H,O,V,P,X,Z,q,K,G,_,U,J,v,b]),$=g({},D);return"vertical"===C?($.display="flex",$.flexDirection="column"):"inline"===C&&($.display="inline-flex",$.flexWrap="wrap",$.gap="16px"),e(Ae.Provider,{value:Q,children:e("form",{className:"aha-form ".concat(k),style:$,onSubmit:function(e){return x(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,X()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:S})})});ze.displayName="Form";var Be=ze;Be.Item=function(n){var r=n.name,l=n.label,c=n.htmlFor;n.labelCol,n.wrapperCol;var p=n.required,f=void 0!==p&&p,h=n.rules,v=void 0===h?[]:h;n.hasFeedback;var x=n.validateStatus,m=n.help,y=n.extra,b=n.className,w=void 0===b?"":b,C=n.style,F=n.children;n.labelAlign,n.labelWidth;var k=n.hidden,D=void 0!==k&&k,S=n.tooltip,E=a(Ae),M=u(null),A=s(function(e){M.current=e,r&&(null==E?void 0:E.registerFieldRef)&&E.registerFieldRef(r,e)},[r,E]),L=(null==E?void 0:E.fields)||{};r&&E&&E.getFieldValue(r);var z=r&&E?E.getFieldError(r):void 0,B=!(!r||!E)&&E.isFieldTouched(r),T=!(!r||!E)&&E.isFieldValidating(r);r&&L[r];var W=x||(z?"error":T?"validating":B&&!z?"success":void 0),N=void 0!==m?m:z||void 0,I=u(v),R=u(f),j=u(!1),H=f||v.some(function(e){return e.required}),Y=i(function(){if(!j.current)return j.current=!0,!0;if(I.current.length!==v.length)return!0;if(I.current===v)return!1;for(var e=0;e<v.length;e++){var t=I.current[e],n=v[e];if((null==t?void 0:t.required)!==(null==n?void 0:n.required)||(null==t?void 0:t.message)!==(null==n?void 0:n.message)||(null==t?void 0:t.type)!==(null==n?void 0:n.type)||(null==t?void 0:t.pattern)!==(null==n?void 0:n.pattern)||(null==t?void 0:t.min)!==(null==n?void 0:n.min)||(null==t?void 0:t.max)!==(null==n?void 0:n.max)||(null==t?void 0:t.len)!==(null==n?void 0:n.len)||(null==t?void 0:t.whitespace)!==(null==n?void 0:n.whitespace))return!0}return!1},[v]);d(function(){if(r&&E)return(!I.current||Y||R.current!==f)&&(I.current=v,R.current=f,E.registerField(r,{rules:v,required:H})),function(){r&&E&&E.unregisterField(r)}},[r]);if(D)return null;return t("div",{ref:A,className:"aha-form-item ".concat(w),style:g({display:"flex",flexDirection:"column",marginBottom:"16px"},C),children:[l&&t("label",{htmlFor:c,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[l,H&&e("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),S&&e(function(n){var r=n.content,i=o.useState(!1),a=i[0],l=i[1],d=o.useRef(null);return o.useEffect(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&l(!1)};if(a)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a]),t("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e("div",{onClick:function(e){e.stopPropagation(),l(!a)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e(de,{})}),a&&t("div",{ref:d,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[r,e("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:S})]}),t("div",{style:{width:"100%"},children:[e("div",{children:o.Children.map(F,function(e){return o.isValidElement(e)?function(e){var t,n,i,a,l,d,s,c,u;if(!o.isValidElement(e))return e;var p=g({},e.props);if(r&&E){var f=E.getFieldValue(r),h=E.setFieldValue;if(!h)return e;var v=e.type;if(v&&("object"==typeof v||"function"==typeof v)&&"displayName"in v){var x=v.displayName;if("Input"===x||"Textarea"===x){p.value=f||"";var m=null===(t=e.props)||void 0===t?void 0:t.onChange,y=null===(n=e.props)||void 0===n?void 0:n.onBlur;p.onChange=function(e){h(r,e.target.value),null==m||m(e),r&&E&&setTimeout(function(){E.validateField(r)},0)},p.onBlur=function(e){r&&E&&(E.setFieldTouched(r,!0),E.validateField(r)),null==y||y(e)},p.error="error"===W}else if("Select"===x){p.value=f;var b=null===(i=e.props)||void 0===i?void 0:i.onChange,w=null===(a=e.props)||void 0===a?void 0:a.onBlur;p.onChange=function(e,t){h(r,e),null==b||b(e,t),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))},p.onBlur=function(e){r&&E&&(E.setFieldTouched(r,!0),E.validateField(r)),null==w||w(e)},p.error="error"===W}else if("Switch"===x){p.checked=f||!1;var C=null===(l=e.props)||void 0===l?void 0:l.onChange;p.onChange=function(e,t){h(r,e),null==C||C(e,t),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))}}else if("Checkbox"===x){p.checked=f||!1;var F=null===(d=e.props)||void 0===d?void 0:d.onChange;p.onChange=function(e){h(r,e.target.checked),null==F||F(e),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))}}else if("Radio"===x){var k=null===(s=e.props)||void 0===s?void 0:s.value;if(void 0!==k){p.checked=f===k;var D=null===(c=e.props)||void 0===c?void 0:c.onChange;p.onChange=function(e){h(r,k),null==D||D(e),r&&E&&(E.setFieldTouched(r,!0),setTimeout(function(){E.validateField(r)},0))}}}}else{void 0!==f&&(p.value=f);var S=null===(u=e.props)||void 0===u?void 0:u.onChange;p.onChange=function(e){var t,n,o=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;h(r,o),null==S||S(e)}}}return"error"===W&&"error"in p&&(p.error=!0),o.cloneElement(e,p)}(e):e})}),N&&e("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===W?"#D92D20":"warning"===W?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:N}),y&&!N&&e("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:y})]})]})},Be.useForm=function(){return[u(null)]};var Te=function(n){var r=n.items,i=void 0===r?[]:r,a=n.userProfile,d=n.selectedKeys,c=n.defaultSelectedKeys,p=void 0===c?[]:c,f=n.onSelect,h=n.onDeselect,v=n.onClick,x=n.className,m=void 0===x?"":x,b=n.style,w=n.width,C=void 0===w?320:w;F().primaryColor;var k=u(null),D=u({}),S=void 0!==d,E=l(p),M=E[0],A=E[1],L=S?d:M,z=function(e){return"children"in e&&Array.isArray(e.children)},B=s(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(z(i)){var a=B(e,i.children,n);if(a)return a}else{var l=i,d=y(y([],n,!0),[l.key],!1);if(l.key===e)return d}}return null},[]),T=s(function(e){var t;if(!e.disabled){var n,o=B(e.key,i)||[e.key];L.includes(e.key)?(n=L.filter(function(t){return t!==e.key}),null==h||h({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:o,selectedKeys:n})),S||A(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==v||v({key:e.key,keyPath:o})}},[L,S,f,h,v,i,B]),W=function(n){var o=L.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,o)},n.key);var r=g({display:"flex",alignItems:"center",padding:"10px 16px",cursor:n.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:n.disabled?.5:1},n.style);return t("div",{ref:function(e){D.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:r,onClick:function(){return T(n)},onMouseEnter:function(e){n.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[n.icon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.icon}),e("span",{style:{flex:1},children:n.label}),n.suffixIcon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.suffixIcon})]},n.key)},N=g({width:"number"==typeof C?"".concat(C,"px"):C,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},b),I=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!z(o)||!(!z(n)||z(o))};return t("div",{ref:k,className:"aha-menu-list ".concat(m),style:N,children:[a&&(a?a.render?a.render(a):e("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e("div",{children:i.map(function(n,r){return t(o.Fragment,{children:[I(r,i)&&e("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),z(n)?(a=n,e("div",{className:"aha-menu-group ".concat(a.className||""),children:a.children.map(function(e){return W(e)})},"group-".concat(a.title))):W(n)]},r);var a})})]})};Te.displayName="MenuList";var We=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,d=o+6,s=0,c=0;switch(n){case"top":s=e.top-t.height-d+i,c=a-t.width/2+r;break;case"bottom":default:s=e.bottom+d+i,c=a-t.width/2+r;break;case"left":s=l-t.height/2+i,c=e.left-t.width-d+r;break;case"right":s=l-t.height/2+i,c=e.right+d+r;break;case"top-left":s=e.top-t.height-d+i,c=e.left+r;break;case"top-right":s=e.top-t.height-d+i,c=e.right-t.width+r;break;case"bottom-left":s=e.bottom+d+i,c=e.left+r;break;case"bottom-right":s=e.bottom+d+i,c=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return c<r+8?c=r+8:c+t.width>r+u-8&&(c=r+u-t.width-8),s<i+8?s=i+8:s+t.height>i+p-8&&(s=i+p-t.height-8),{top:s,left:c}},Ne=function(e,t,n,o){void 0===o&&(o=6);var r=We(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,d=i-(window.scrollY||window.pageYOffset),s=a-l,c=d+t.height,u=s+t.width,p=d,f=s,h=Math.max(p,e.top),g=Math.min(c,e.bottom),v=Math.max(f,e.left),x=Math.min(u,e.right);return g>h+1&&x>v+1},Ie=function(t,n){var o=g({position:"absolute",width:0,height:0,borderStyle:"solid"},n),r={top:g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:g(g({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:r[t]})},Re=function(o){var r=o.content,i=o.children,a=o.position,c=void 0===a?"top":a,p=o.trigger,h=void 0===p?"hover":p,v=o.delay,x=void 0===v?200:v,m=o.disabled,y=void 0!==m&&m,b=o.className,w=void 0===b?"":b,C=o.tooltipClassName,F=void 0===C?"":C,k=o.gap,D=void 0===k?6:k,S=o.showArrow,E=void 0===S||S,M=o.width,A=o.defaultVisible,L=void 0!==A&&A,z=o.visible,B=o.onVisibleChange,T=void 0!==z,W=l(L),N=W[0],I=W[1],R=T?z:N,j=l(T?null!=z&&z:L),H=j[0],Y=j[1],O=s(function(e){T||I(e),null==B||B(e)},[T,B]);d(function(){T&&(z?requestAnimationFrame(function(){Y(!0)}):Y(!1))},[T,z]);var V=l(c),P=V[0],q=V[1],X=l("320px"),Z=X[0],K=X[1],_=l({position:"absolute",top:0,left:0,pointerEvents:"hover"===h?"auto":"none"}),G=_[0],J=_[1],U=l({}),Q=U[0],$=U[1],ee=u(null),te=u(null),ne=u(null),oe=u(null),re=s(function(){if(ee.current&&te.current&&R&&H){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!Ne(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!Ne(e,t,a,o))return a}return n}(e,t,c,D);q(n);var o=We(e,t,n,D),r=o.top,i=o.left;if(J(function(e){return g(g({},e),{position:"absolute",top:"".concat(r,"px"),left:"".concat(i,"px"),pointerEvents:"hover"===h?"auto":"none",zIndex:9999})}),E){var a=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,d=t.top+(t.height-6)/2,s=o-i,c=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(d-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(d-c,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,i,r);$(a)}}},[R,c,D,E,H,h]),ie=s(function(){y||(oe.current&&(clearTimeout(oe.current),oe.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){O(!0),T||requestAnimationFrame(function(){Y(!0)})},x))},[y,x,O,T]),ae=s(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),oe.current&&clearTimeout(oe.current),T?O(!1):(Y(!1),oe.current=setTimeout(function(){O(!1),oe.current=null},150))},[O,T]),le=s(function(){"hover"===h&&(oe.current&&(clearTimeout(oe.current),oe.current=null),R||(O(!0),requestAnimationFrame(function(){Y(!0)})))},[h,R]),de=s(function(e){y||"click"!==h||(e.stopPropagation(),R?ae():(ne.current&&(clearTimeout(ne.current),ne.current=null),O(!0),requestAnimationFrame(function(){Y(!0)})))},[y,h,R,ae]);d(function(){if(L&&R&&H){var e=function(){ee.current&&te.current?re():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[L,R,H,re]),d(function(){if(R)return requestAnimationFrame(function(){re()}),window.addEventListener("scroll",re,!0),window.addEventListener("resize",re),function(){window.removeEventListener("scroll",re,!0),window.removeEventListener("resize",re)}},[R,re]),d(function(){if(R&&"click"===h){var e=function(e){ee.current&&te.current&&!ee.current.contains(e.target)&&!te.current.contains(e.target)&&ae()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[R,h,ae]),d(function(){return function(){ne.current&&clearTimeout(ne.current),oe.current&&clearTimeout(oe.current)}},[]);var se={position:"absolute",top:0,left:0,opacity:H?1:0,transform:H?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===h?"auto":"none",zIndex:9999},ce=s(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);d(function(){var e=function(){K(ce())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ce]);var ue=g(g({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==M?{width:"number"==typeof M?"".concat(M,"px"):M,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:Z,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),pe=t("div",{style:g(g(g({},se),G),{pointerEvents:"hover"===h?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(F),onMouseEnter:"hover"===h?le:void 0,onMouseLeave:"hover"===h?ae:void 0,children:[e("div",{ref:te,className:"aha-tooltip ".concat(F),style:ue,role:"tooltip",children:r}),E&&Ie(P,Q)]}),fe=s(function(){"hover"===h&&(oe.current=setTimeout(function(){ae()},100))},[h,ae]),he="click"===h?{onClick:de}:{onMouseEnter:ie,onMouseLeave:fe,onFocus:ie,onBlur:ae};return t(n,{children:[e("div",g({ref:ee,className:"aha-tooltip-trigger ".concat(w),style:{display:"inline-block",cursor:"click"===h?"pointer":"default"}},he,{children:i})),R&&"undefined"!=typeof document&&f(pe,document.body)]})},je=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},He=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},Ye=function(o){var r=o.children,i=o.content,a=o.trigger,c=void 0===a?"click":a,p=o.open,h=o.defaultOpen,v=void 0!==h&&h,x=o.onOpenChange,m=o.placement,y=void 0===m?"right":m,b=o.width,w=o.offset,C=void 0===w?8:w,F=o.className,k=void 0===F?"":F,D=o.popoverClassName,S=void 0===D?"":D,E=o.disabled,M=void 0!==E&&E,A=void 0!==p,L=l(v),z=L[0],B=L[1],T=A?!!p:z,W=l({top:0,left:0,opacity:0}),N=W[0],I=W[1],R=u(null),j=u(null),H=s(function(e){A||B(e),null==x||x(e)},[A,x]),Y=s(function(){if(T&&R.current&&j.current){var e=R.current.getBoundingClientRect(),t=j.current.getBoundingClientRect(),n=function(){if(je(e,t,y,C))return y;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(y);return je(e,t,n,C)||He(e,n)>He(e,y)?n:y}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,C),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,d=t;return d<o+8&&(d=o+8),d+n.width>o+i-8&&(d=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:d}}(o.top,o.left,t);I({top:r.top,left:r.left,opacity:1})}},[T,y,C]),O=s(function(){M||H(!0)},[M,H]),V=s(function(){H(!1)},[H]),P=s(function(){M||H(!T)},[M,T,H]);d(function(){if(T)return requestAnimationFrame(function(){Y()}),window.addEventListener("resize",Y),window.addEventListener("scroll",Y,!0),function(){window.removeEventListener("resize",Y),window.removeEventListener("scroll",Y,!0)}},[T,Y]),d(function(){if(T&&"click"===c){var e=function(e){var t=e.target;R.current&&j.current&&!R.current.contains(t)&&!j.current.contains(t)&&V()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[T,c,V]);var q="hover"===c?{onMouseEnter:O,onMouseLeave:V,onFocus:O,onBlur:V}:{onClick:function(e){e.stopPropagation(),P()}},X=T?e("div",{ref:j,className:"aha-popover ".concat(S),style:{position:"absolute",zIndex:9999,top:N.top,left:N.left,opacity:N.opacity,transition:"opacity 120ms ease-out",width:"number"==typeof b?"".concat(b,"px"):b,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===c?O:void 0,onMouseLeave:"hover"===c?V:void 0,onMouseDown:"click"===c?function(e){return e.stopPropagation()}:void 0,children:i}):null;return t(n,{children:[e("div",g({ref:R,className:"aha-popover-trigger ".concat(k),style:{display:"inline-block",cursor:M?"not-allowed":"pointer"}},q,{children:r})),X&&"undefined"!=typeof document&&f(X,document.body)]})};Ye.displayName="Popover";var Oe=240,Ve=function(n){var o=n.open,r=n.defaultOpen,a=void 0!==r&&r,c=n.onClose,u=n.afterOpenChange,p=n.title,h=n.extra,v=n.footer,x=n.children,m=n.placement,y=void 0===m?"right":m,b=n.width,w=void 0===b?378:b,C=n.height,F=void 0===C?378:C,k=n.mask,D=void 0===k||k,S=n.maskClosable,E=void 0===S||S,M=n.closable,A=void 0===M||M,L=n.closeIcon,z=n.keyboard,B=void 0===z||z,T=n.destroyOnClose,W=void 0!==T&&T,N=n.zIndex,I=void 0===N?1e3:N,R=n.mobileBreakpoint,j=void 0===R?768:R,H=n.className,Y=void 0===H?"":H,O=n.style,V=n.drawerStyle,P=n.headerStyle,q=n.bodyStyle,X=n.footerStyle,Z=n.maskStyle,K=void 0!==o,_=l(a),G=_[0],J=_[1],U=K?!!o:G,Q=l(U),$=Q[0],ee=Q[1],te=l(U),ne=te[0],oe=te[1],re=l(!1),ie=re[0],ae=re[1],le=l(!1),de=le[0],se=le[1];d(function(){ae(!0)},[]),d(function(){var e=function(){se(window.innerWidth<j)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[j]),d(function(){if(U){ee(!0),oe(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){oe(!0)})}),t=window.setTimeout(function(){null==u||u(!0)},Oe);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}oe(!1);var n=window.setTimeout(function(){W&&ee(!1),null==u||u(!1)},Oe);return function(){return window.clearTimeout(n)}},[U,W,u]),d(function(){if(U&&B){var e=function(e){"Escape"===e.key&&(null==c||c(e),K||J(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[U,B,c,K]),d(function(){if(ie&&U){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[U,ie]);var ce=s(function(e){null==c||c(e),K||J(!1)},[c,K]),ue=i(function(){return de?"100vw":"left"===y||"right"===y?"number"==typeof w?"".concat(w,"px"):w:"100vw"},[y,de,w]),pe=i(function(){return"top"===y||"bottom"===y?"number"==typeof F?"".concat(F,"px"):F:"100vh"},[y,F]),fe=i(function(){return de&&("left"===y||"right"===y)?"bottom":y},[de,y]),he=i(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(Oe,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:I+1};switch(fe){case"left":return g(g({},e),{top:0,left:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(-100%)"});case"right":return g(g({},e),{top:0,right:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(100%)"});case"top":return g(g({},e),{top:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(-100%)"});default:return g(g({},e),{bottom:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(100%)"})}},[fe,ue,pe,ne,I]);if(!ie||!$&&!U)return null;var ge=t("div",{className:"aha-drawer-root ".concat(Y),style:g({position:"fixed",inset:0,zIndex:I,pointerEvents:U||ne?"auto":"none"},O),children:[D&&e("div",{"aria-hidden":!0,onClick:E?function(e){return ce(e)}:void 0,style:g({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:ne?1:0,transition:"opacity ".concat(Oe,"ms cubic-bezier(0.2, 0, 0, 1)")},Z)}),t("div",{role:"dialog","aria-modal":"true",style:g(g({},he),V),children:[(void 0!==p||A||h)&&t("div",{style:g({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},P),children:[e("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:p}),t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h,A&&e("button",{type:"button",onClick:function(e){return ce(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:L||e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e("div",{style:g({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},q),children:x}),void 0!==v&&e("div",{style:g({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},X),children:v})]},"".concat(fe,"-").concat(U?"open":"closed"))]});return f(ge,document.body)};Ve.displayName="Drawer";export{A as Alert,S as Button,te as CheckIcon,ce as Checkbox,Me as DatePicker,Ve as Drawer,Be as Form,$ as Input,Te as MenuList,ne as MinusIcon,se as Pagination,Ye as Popover,ye as Progress,xe as Radio,ee as Select,we as Switch,me as Tab,ve as Table,Q as Tag,be as Textarea,C as ThemeProvider,I as Toast,G as ToastProvider,Re as Tooltip,H as clearAllToasts,j as closeToast,Y as debugToast,R as toast,V as toastError,P as toastInfo,q as toastQuestion,O as toastSuccess,F as useTheme};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|