aha-components 1.8.1 → 1.8.2

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.
Files changed (92) hide show
  1. package/dist/Input.esm.js +1 -1
  2. package/dist/Input.esm.js.map +1 -1
  3. package/dist/Input.js +1 -1
  4. package/dist/Input.js.map +1 -1
  5. package/dist/Pagination.esm.js +1 -1
  6. package/dist/Pagination.esm.js.map +1 -1
  7. package/dist/Pagination.js +1 -1
  8. package/dist/Pagination.js.map +1 -1
  9. package/dist/Table.esm.js +1 -1
  10. package/dist/Table.esm.js.map +1 -1
  11. package/dist/Table.js +1 -1
  12. package/dist/Table.js.map +1 -1
  13. package/dist/Textarea.esm.js +1 -1
  14. package/dist/Textarea.esm.js.map +1 -1
  15. package/dist/Textarea.js +1 -1
  16. package/dist/Textarea.js.map +1 -1
  17. package/dist/components/Checkbox/Checkbox.stories 2.d.ts +12 -0
  18. package/dist/components/Checkbox/index 2.d.ts +12 -0
  19. package/dist/components/DatePicker/DatePicker.stories 2.d.ts +25 -0
  20. package/dist/components/DatePicker/index 2.d.ts +96 -0
  21. package/dist/components/Drawer/Drawer.stories 2.d.ts +9 -0
  22. package/dist/components/Drawer/index 2.d.ts +58 -0
  23. package/dist/components/Form/Form.stories 2.d.ts +15 -0
  24. package/dist/components/Form/FormContext 2.d.ts +41 -0
  25. package/dist/components/Form/FormItem 2.d.ts +58 -0
  26. package/dist/components/Form/index 2.d.ts +85 -0
  27. package/dist/components/Input/Input.stories 2.d.ts +16 -0
  28. package/dist/components/Input/Input.stories.d.ts +7 -4
  29. package/dist/components/Input/InputGroup.d.ts +25 -0
  30. package/dist/components/Input/InputTags.d.ts +17 -0
  31. package/dist/components/Input/index 2.d.ts +41 -0
  32. package/dist/components/Input/index.d.ts +7 -18
  33. package/dist/components/Loading/Loading.stories 2.d.ts +11 -0
  34. package/dist/components/Loading/index 2.d.ts +10 -0
  35. package/dist/components/MenuList/MenuList.stories 2.d.ts +17 -0
  36. package/dist/components/MenuList/MenuList.test 2.d.ts +1 -0
  37. package/dist/components/MenuList/index 2.d.ts +85 -0
  38. package/dist/components/Pagination/Pagination.stories 2.d.ts +16 -0
  39. package/dist/components/Pagination/index 2.d.ts +27 -0
  40. package/dist/components/Popover/Popover.stories 2.d.ts +11 -0
  41. package/dist/components/Popover/index 2.d.ts +31 -0
  42. package/dist/components/Progress/Progress.stories 2.d.ts +18 -0
  43. package/dist/components/Progress/Progress.test 2.d.ts +1 -0
  44. package/dist/components/Progress/index 2.d.ts +33 -0
  45. package/dist/components/Radio/Radio.stories 2.d.ts +10 -0
  46. package/dist/components/Radio/index 2.d.ts +13 -0
  47. package/dist/components/Select/Select.stories 2.d.ts +17 -0
  48. package/dist/components/Select/index 2.d.ts +74 -0
  49. package/dist/components/Switch/Switch.stories 2.d.ts +14 -0
  50. package/dist/components/Switch/index 2.d.ts +27 -0
  51. package/dist/components/Tab/Tab.stories 2.d.ts +19 -0
  52. package/dist/components/Tab/index 2.d.ts +26 -0
  53. package/dist/components/Table/Table.stories 2.d.ts +21 -0
  54. package/dist/components/Table/index 2.d.ts +167 -0
  55. package/dist/components/Textarea/Textarea.stories 2.d.ts +15 -0
  56. package/dist/components/Textarea/Textarea.stories.d.ts +3 -6
  57. package/dist/components/Textarea/TextareaTags.d.ts +8 -0
  58. package/dist/components/Textarea/index 2.d.ts +38 -0
  59. package/dist/components/Textarea/index.d.ts +6 -17
  60. package/dist/components/Tooltip/Tooltip.stories 2.d.ts +20 -0
  61. package/dist/components/Tooltip/index 2.d.ts +35 -0
  62. package/dist/icons/index 2.d.ts +33 -0
  63. package/dist/index.css +962 -1
  64. package/dist/index.d.ts +54 -36
  65. package/dist/index.esm.css +962 -1
  66. package/dist/index.esm.js +1 -1
  67. package/dist/index.esm.js.map +1 -1
  68. package/dist/index.js +1 -1
  69. package/dist/index.js.map +1 -1
  70. package/dist/stories/DesignTokens.stories 2.d.ts +5 -0
  71. package/dist/theme/Theme.stories 2.d.ts +10 -0
  72. package/dist/theme/ThemeContext 2.d.ts +11 -0
  73. package/dist/theme/utils 2.d.ts +10 -0
  74. package/dist/tokens.d.ts +2 -0
  75. package/package.json +1 -1
  76. package/dist/AlertComponent.esm.js +0 -2
  77. package/dist/AlertComponent.esm.js.map +0 -1
  78. package/dist/AlertComponent.js +0 -2
  79. package/dist/AlertComponent.js.map +0 -1
  80. package/dist/Card.esm.js +0 -2
  81. package/dist/Card.esm.js.map +0 -1
  82. package/dist/Card.js +0 -2
  83. package/dist/Card.js.map +0 -1
  84. package/dist/TestComponent.esm.js +0 -2
  85. package/dist/TestComponent.esm.js.map +0 -1
  86. package/dist/TestComponent.js +0 -2
  87. package/dist/TestComponent.js.map +0 -1
  88. package/dist/Toast.css +0 -1
  89. package/dist/Toast.esm.css +0 -1
  90. package/dist/components/AlertComponent/index.d.ts +0 -9
  91. package/dist/components/Card/index.d.ts +0 -10
  92. package/dist/components/TestComponent/index.d.ts +0 -7
package/dist/Table.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-dom"),o=function(){return o=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},o.apply(this,arguments)};function r(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t}function i(e,n,t){if(t||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var a={primaryColor:"#FB6011"},l=n.createContext(a),d=function(){var e=n.useContext(l);return e||a},s={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},c={primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link",default:"secondary"},u={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},p=function(n){var t=n.size,o=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:o,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},f=function(t){var i=t.children,a=t.type,l=void 0===a?"secondary":a,f=t.size,x=void 0===f?"md":f,h=t.disabled,v=void 0!==h&&h,g=t.loading,m=void 0!==g&&g,y=t.iconOnly,b=t.focused,w=void 0!==b&&b,k=t.onClick,j=t.htmlType,C=void 0===j?"button":j,S=t.className,F=void 0===S?"":S,z=t.style,A=t.icon,W=t.iconPosition,L=void 0===W?"left":W,E=r(t,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),I=d().primaryColor,M=n.useState(!1),B=M[0],D=M[1],N=n.useState(!1),R=N[0],H=N[1],T=c[l]||"secondary",O=u[s[x]||"md"],P=null!=y?y:!!A&&null==i,_="link-color"===T||"link-gray"===T||"destructive-link"===T,K=v||m,X=w,q=I,Y=function(){if(v)return"primary"===T||"secondary"===T||"destructive-primary"===T||"destructive-secondary"===T?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=B||R;return"primary"===T?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":q||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===T?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===T?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===T?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===T?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===T?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),V=function(){if(X)return"destructive-primary"===T||"destructive-secondary"===T||"destructive-tertiary"===T||"destructive-link"===T?"destructive-primary"===T||"destructive-secondary"===T?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===T||"secondary"===T?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),J=o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:O.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:O.fontSize,lineHeight:"".concat(O.lineHeight,"px"),cursor:K?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:Y.bg,color:Y.color,border:Y.border,boxShadow:null!=V?V:Y.boxShadow,textDecoration:Y.textDecoration},z);_?(J.borderRadius="4px",J.overflow="hidden",P?(J.width=O.height,J.height=O.height,J.padding=0):(J.height=O.height,J.paddingLeft=O.paddingX,J.paddingRight=O.paddingX)):(J.borderRadius="var(--radius-md, 8px)",P?(J.width=O.height,J.height=O.height,J.padding=0):(J.height=O.height,J.paddingLeft=O.paddingX,J.paddingRight=O.paddingX));var Q=function(){return m?e.jsx(p,{size:O.iconSize,color:Y.iconColor}):A?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:O.iconSize,height:O.iconSize,color:Y.iconColor,flexShrink:0},children:A}):null},U=m||A&&"left"===L,G=!m&&A&&"right"===L;return e.jsxs("button",o({type:C,className:["aha-button","aha-button--".concat(T),"aha-button--".concat(s[x]||"md"),P&&"aha-button--icon-only",K&&"aha-button--disabled",m&&"aha-button--loading",X&&"aha-button--focused",F].filter(Boolean).join(" "),disabled:K,onClick:function(e){K?e.preventDefault():null==k||k(e)},onMouseEnter:function(){return!K&&D(!0)},onMouseLeave:function(){D(!1),H(!1)},onMouseDown:function(){return!K&&H(!0)},onMouseUp:function(){return H(!1)},style:J},E,{children:[U&&Q(),!P&&i,G&&Q(),P&&!A&&!m&&i]}))};f.displayName="Button";var x=n.forwardRef(function(t,i){var a=t.size,l=void 0===a?"medium":a,s=t.disabled,c=void 0!==s&&s,u=t.error,p=void 0!==u&&u,f=t.readOnly,x=void 0!==f&&f,h=t.prefix,v=t.suffix,g=t.allowClear,m=void 0!==g&&g,y=t.onClear,b=t.className,w=void 0===b?"":b,k=t.style,j=t.type,C=void 0===j?"text":j,S=t.placeholder,F=t.value,z=t.defaultValue,A=t.onChange,W=t.onFocus,L=t.onBlur,E=t.onPressEnter,I=r(t,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),M=d().primaryColor,B=void 0===M?"#FB6011":M,D=n.useRef(null),N=n.useState(z||F||""),R=N[0],H=N[1],T=n.useState(!1),O=T[0],P=T[1];n.useEffect(function(){"function"==typeof i?i(D.current):i&&(i.current=D.current)},[i]);var _=void 0!==F,K=_?F:R,X=function(e){var n;e.stopPropagation(),_||H("");null==A||A({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(n=D.current)||void 0===n||n.focus()},q=m&&K&&!c,Y={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"}},V=v||q?"40px":"12px",J=o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":O?B:"#D7D3D0"),backgroundColor:c||x?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:h?"40px":"12px",paddingRight:V,paddingTop:Y[l].paddingTop,paddingBottom:Y[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},k);return e.jsxs(e.Fragment,{children:[e.jsx("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 '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[h&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:h}),e.jsx("input",o({ref:D,type:C,value:K,placeholder:S,disabled:c,readOnly:x,onChange:function(e){_||H(e.target.value),null==A||A(e)},onFocus:function(e){P(!0),null==W||W(e)},onBlur:function(e){P(!1),null==L||L(e)},onKeyDown:function(e){var n;"Enter"===e.key&&E&&E(e),null===(n=I.onKeyDown)||void 0===n||n.call(I,e)},style:J,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(v||q)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[q&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:X,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),v&&e.jsx("span",{style:{pointerEvents:"none"},children:v})]})]})]})});x.displayName="Input";var h=function(r){var a,l=r.value,s=r.defaultValue,c=r.options,u=void 0===c?[]:c,p=r.mode,f=r.disabled,x=void 0!==f&&f,h=r.error,v=void 0!==h&&h,g=r.placeholder,m=void 0===g?"Please select":g,y=r.size,b=void 0===y?"medium":y,w=r.showSearch,k=void 0!==w&&w,j=r.filterOption,C=void 0===j||j,S=r.allowClear,F=void 0!==S&&S,z=r.onChange,A=r.onSelect,W=r.onDeselect,L=r.onSearch,E=r.onFocus,I=r.onBlur,M=r.onDropdownVisibleChange,B=r.className,D=void 0===B?"":B,N=r.style,R=r.dropdownClassName,H=void 0===R?"":R,T=r.dropdownStyle,O=r.defaultOpen,P=void 0!==O&&O,_=r.open,K=r.maxTagCount,X=r.tagRender,q=r.optionRender,Y=d().primaryColor,V=void 0===Y?"#FB6011":Y,J=n.useState(void 0!==s?s:p?[]:void 0),Q=J[0],U=J[1],G=n.useState(P),Z=G[0],$=G[1],ee=n.useState(""),ne=ee[0],te=ee[1],oe=n.useState(-1),re=oe[0],ie=oe[1],ae=n.useRef(null),le=n.useRef(null),de=n.useRef(null),se=n.useState(null),ce=se[0],ue=se[1],pe=void 0!==l,fe=void 0!==_,xe=pe?l:Q,he=fe?_:Z,ve="multiple"===p||"tags"===p,ge=n.useCallback(function(){if(!xe)return[];var e=Array.isArray(xe)?xe:[xe];return u.filter(function(n){return e.includes(n.value)})},[xe,u]),me=n.useCallback(function(){return k&&ne?!1===C?u:"function"==typeof C?u.filter(function(e){return C(ne,e)}):u.filter(function(e){var n=String(e.label||"").toLowerCase(),t=ne.toLowerCase();return n.includes(t)}):u},[u,ne,k,C]),ye=n.useMemo(function(){return me()},[me]);n.useEffect(function(){if(he&&ae.current){var e=function(){var e,n;if(ae.current){var t=ae.current.getBoundingClientRect(),o=null!==(n=null===(e=de.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-t.bottom,i=t.top,a=r<o+4&&i>r,l=a?t.top+window.scrollY-o-4:t.bottom+window.scrollY+4;ue({top:l,left:t.left+window.scrollX,width:t.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)}}ue(null)},[he,ye.length]),n.useEffect(function(){var e=function(e){var n=e.target;ae.current&&!ae.current.contains(n)&&de.current&&!de.current.contains(n)&&(fe||$(!1),null==M||M(!1),te(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,fe,M]),n.useEffect(function(){if(he){var e=function(e){var n;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var t=ye[re];t&&!t.disabled&&be(t)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==M||M(!1),null===(n=ae.current)||void 0===n||n.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,re,fe,M]),n.useEffect(function(){if(re>=0&&de.current){var e=de.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=n.useCallback(function(e){var n;if(!e.disabled)if(ve){var t,o=Array.isArray(xe)?xe:[];o.includes(e.value)?(t=o.filter(function(n){return n!==e.value}),null==W||W(e.value,e)):(t=i(i([],o,!0),[e.value],!1),null==A||A(e.value,e)),pe||U(t);var r=u.filter(function(e){return t.includes(e.value)});null==z||z(t,r)}else pe||U(e.value),null==z||z(e.value,e),null==A||A(e.value,e),fe||$(!1),null==M||M(!1),te(""),null===(n=ae.current)||void 0===n||n.focus()},[ve,xe,pe,fe,u,z,A,W,M]),we=n.useCallback(function(e,n){if(e.stopPropagation(),ve&&Array.isArray(xe)){var t=xe.filter(function(e){return e!==n}),o=u.find(function(e){return e.value===n});pe||U(t),null==z||z(t,ge()),null==W||W(n,o)}},[ve,xe,pe,u,z,W,ge]),ke=function(e){e.stopPropagation();var n=ve?[]:void 0;pe||U(n),null==z||z(n,[]),te("")},je={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"}},Ce=n.useMemo(function(){return ge()},[ge]),Se=n.useMemo(function(){return F&&xe&&!x},[F,xe,x]),Fe=n.useMemo(function(){return ve?Array.isArray(xe)&&xe.length>0:null!=xe&&""!==xe},[ve,xe]),ze=n.useMemo(function(){if(!ve||!Array.isArray(xe)||0===xe.length)return null;var t="responsive"===K?Ce.slice(0,2):K?Ce.slice(0,K):Ce,o=K&&Ce.length>t.length?Ce.length-t.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[t.map(function(t){var o={label:t.label,value:t.value,closable:!x,onClose:function(){return we({},t.value)}};return X?e.jsx(n.Fragment,{children:X(o)},t.value):e.jsxs("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.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),!x&&e.jsx("span",{onClick:function(e){return we(e,t.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},t.value)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ve,xe,Ce,K,x,X]);return e.jsxs(e.Fragment,{children:[e.jsx("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 "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(D),style:o({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(v?"#F04438":he?V:"#D7D3D0"),backgroundColor:x?"#FAFAF9":"#FFFFFF",cursor:x?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:je[b].paddingTop,paddingBottom:je[b].paddingBottom,fontSize:je[b].fontSize,lineHeight:je[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:function(){if(!x){var e=!he;fe||$(e),null==M||M(e),e&&k?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):te("")}},onFocus:function(e){null==E||E(e)},onBlur:function(e){null==I||I(e)},onTouchStart:function(e){x||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:x?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ve?ze||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):k&&he?e.jsx("input",{ref:le,type:"text",value:ne,onChange:function(e){var n=e.target.value;te(n),null==L||L(n),ie(-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:x?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Fe?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Fe?x?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Fe?(null===(a=Ce[0])||void 0===a?void 0:a.label)||xe:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Se&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ke,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(n){var t=n.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ce&&t.createPortal(e.jsx("div",{ref:de,className:"aha-select-dropdown ".concat(H),style:o({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.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"===ce.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ce.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},T),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(n,t){var o=ve?Array.isArray(xe)&&xe.includes(n.value):xe===n.value,r=t===re;return q?e.jsx("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&be(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:q(n,{selected:o,focused:r,disabled:n.disabled||!1})},n.value):e.jsxs("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(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.jsx("span",{children:n.label}),o&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:V,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};h.displayName="Select";var v=function(n){var t=n.className,o=n.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:e.jsx("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"})})},g=function(n){var t=n.className,o=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},m=function(n){var t=n.className,o=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},y=function(n){var t=n.className,o=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:e.jsx("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"})})},b=function(n){var t=n.className,o=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:e.jsx("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"})})},w=function(t){var r=t.current,i=t.defaultCurrent,a=void 0===i?1:i,l=t.total,s=void 0===l?0:l,c=t.pageSize,u=t.defaultPageSize,p=void 0===u?10:u,v=t.showSizeChanger,g=void 0!==v&&v,m=t.pageSizeOptions,w=void 0===m?["10","20","50","100"]:m,k=t.showQuickJumper,j=void 0!==k&&k,C=t.showTotal,S=t.onChange,F=t.onShowSizeChange,z=t.simple,A=void 0!==z&&z,W=t.disabled,L=void 0!==W&&W,E=t.hideOnSinglePage,I=void 0!==E&&E,M=t.className,B=void 0===M?"":M,D=t.style,N=t.size,R=void 0===N?"default":N,H=t.responsive,T=void 0!==H&&H;t.showLessItems;var O=t.itemRender,P=d().primaryColor,_=void 0===P?"#FB6011":P,K=n.useState(a),X=K[0],q=K[1],Y=n.useState(p),V=Y[0],J=Y[1],Q=n.useState(""),U=Q[0],G=Q[1],Z=null!=r?r:X,$=null!=c?c:V,ee=n.useMemo(function(){return Math.ceil(s/$)},[s,$]);n.useEffect(function(){void 0!==r&&q(r)},[r]),n.useEffect(function(){void 0!==c&&J(c)},[c]);var ne=function(e){e<1||e>ee||e===Z||L||(void 0===r&&q(e),null==S||S(e,$))},te=function(){var e=parseInt(U,10);e>=1&&e<=ee&&(ne(e),G(""))};if(I&&ee<=1)return null;if(A)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(B),style:D,children:[e.jsx(f,{onClick:function(){return ne(Z-1)},disabled:L||1===Z,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Z," / ",ee]}),e.jsx(f,{onClick:function(){return ne(Z+1)},disabled:L||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})]});var oe=(Z-1)*$+1,re=Math.min(Z*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(B),style:o({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},D),children:[C&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(s,[oe,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:O?O(Z-1,"prev",e.jsx(f,{onClick:function(){return ne(Z-1)},disabled:L||1===Z,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.jsx(y,{})})):e.jsx(f,{onClick:function(){return ne(Z-1)},disabled:L||1===Z,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.jsx(y,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,n){return n+1});var e=[];if(Z<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(ee)}else if(Z>=ee-3){e.push(1),e.push("jump-prev");for(n=ee-4;n<=ee;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=Z-1;n<=Z+1;n++)e.push(n);e.push("jump-next"),e.push(ee)}return e}().map(function(n){return function(n){if("number"==typeof n){var t=n===Z,o=e.jsx(f,{onClick:function(){return ne(n)},disabled:L,type:t?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:t?"1px solid ".concat(_):void 0,boxShadow:"none",borderRadius:"8px"},children:n},n);return O?O(n,"page",o):o}if("jump-prev"===n)return o=e.jsx(f,{onClick:function(){return ne(Math.max(1,Z-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"),O?O(Z-5,"jump-prev",o):o;if("jump-next"===n)return o=e.jsx(f,{onClick:function(){return ne(Math.min(ee,Z+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"),O?O(Z+5,"jump-next",o):o;return null}(n)})}),s>0&&e.jsx(e.Fragment,{children:O?O(Z+1,"next",e.jsx(f,{onClick:function(){return ne(Z+1)},disabled:L||Z===ee,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.jsx(b,{})})):e.jsx(f,{onClick:function(){return ne(Z+1)},disabled:L||Z===ee,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.jsx(b,{})})}),g&&e.jsx(h,{value:$,options:w.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return n=Number(e),t=Math.ceil(s/n),o=Z>t?t:Z,void 0===c&&J(n),void 0===r&&q(o),null==F||F(o,n),void(null==S||S(o,n));var n,t,o},disabled:L,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),j&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(x,{type:"number",min:1,value:U,onChange:function(e){return G(e.target.value)},onPressEnter:te,disabled:L,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof j&&j.goButton?e.jsx(f,{onClick:te,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:j.goButton}):e.jsx(f,{onClick:te,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},k=function(t){var r=t.checked,i=void 0!==r&&r,a=t.indeterminate,l=void 0!==a&&a,d=t.disabled,s=void 0!==d&&d,c=t.onChange,u=t.className,p=void 0===u?"":u,f=t.style,x=t.children,h=t.size,v=void 0===h?"sm":h,g=t.hint,m=t.isFocused,y=n.useState(!1),b=y[0],w=y[1],k=n.useState(!1),j=k[0],C=k[1],S=i||l,F=null!=m?m:j,z=function(){s||(null==c||c({target:{checked:!i},currentTarget:{checked:!i}}))},A="sm"===v?"16px":"20px",W="sm"===v?"12px":"14px",L="sm"===v?"var(--radius-xs, 4px)":"var(--radius-sm, 6px)",E="sm"===v?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",I="sm"===v?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",M="sm"===v?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",B=s&&S?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)",D=x||g;return e.jsxs("div",{className:"aha-checkbox ".concat(p),role:"checkbox","aria-checked":l?"mixed":i,"aria-disabled":s,tabIndex:s?-1:0,style:o({display:"inline-flex",alignItems:"flex-start",gap:M,cursor:s?"not-allowed":"pointer",outline:"none"},f),onClick:z,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),z())},onMouseEnter:function(){return!s&&w(!0)},onMouseLeave:function(){return w(!1)},onFocus:function(){return!s&&C(!0)},onBlur:function(){return C(!1)},children:[e.jsxs("div",{style:{position:"relative",width:A,height:A,minWidth:A,minHeight:A,flexShrink:0,borderRadius:L,border:s?"1px solid var(--color-border-disabled, #d7d3d0)":S?b?"1px solid var(--color-bg-brand-solid_hover, #ec470a)":"1px solid var(--color-bg-brand-solid, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",backgroundColor:s?"var(--color-bg-disabled_subtle, #fafaf9)":S?b?"var(--color-bg-brand-solid_hover, #ec470a)":"var(--color-bg-brand-solid, #fb6011)":b?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:F?"var(--focus-ring, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px #fb6011)":"none",marginTop:D?"2px":"0"},children:[e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:W,height:W,color:B,opacity:l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M2.91675 7H11.0834",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:W,height:W,color:B,opacity:i&&!l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),D&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"md"===v?"var(--spacing-xxs, 2px)":"0"},children:[x&&e.jsx("span",{style:{fontSize:E,lineHeight:I,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:s?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:x}),g&&e.jsx("span",{style:{fontSize:E,lineHeight:I,fontWeight:"var(--font-weight-regular, 400)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:"var(--color-text-tertiary, #57534e)"},onClick:function(e){return e.stopPropagation()},children:g})]})]})};k.displayName="Checkbox";var j=function(n){var t=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("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.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},C=function(n){var t=n.loading,o=n.spinColor;if(!t)return null;var r=!0===t?e.jsx(j,{color:o}):t;return e.jsx("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})},S=function(e,n){return"string"==typeof n?null==e?void 0:e[n]:n.reduce(function(e,n){return null==e?void 0:e[n]},e)},F=function(e,n){var t,o;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=S(e,n))&&void 0!==t?t:"":null!==(o=e.key)&&void 0!==o?o:""},z=function(n){var t=n.order,o=d().primaryColor;return"ascend"===t?e.jsx(m,{style:{color:o}}):"descend"===t?e.jsx(g,{style:{color:o}}):e.jsx(v,{})};exports.default=function(t){var a,l,s,c,u=t.columns,p=void 0===u?[]:u,f=t.dataSource,x=void 0===f?[]:f,h=t.rowKey,v=void 0===h?"key":h,g=t.rowSelection,m=t.pagination,y=void 0!==m&&m,b=t.size,j=void 0===b?"middle":b,A=t.bordered,W=void 0!==A&&A,L=t.loading,E=void 0!==L&&L,I=t.locale,M=t.showHeader,B=void 0===M||M,D=t.title,N=t.footer,R=t.summary,H=t.scroll,T=t.tableLayout,O=void 0===T?"auto":T,P=t.onChange,_=t.onSorterChange,K=t.onPaginationChange,X=t.onRow,q=t.className,Y=void 0===q?"":q,V=t.innerClassName,J=void 0===V?"":V,Q=t.style,U=t.expandable,G=t.rowClassName,Z=t.onHeaderRow;t.sticky;var $=r(t,["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=d().primaryColor||"#FB6011",ne=n.useState((null==g?void 0:g.selectedRowKeys)||(null==g?void 0:g.defaultSelectedRowKeys)||[]),te=ne[0],oe=ne[1];n.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&oe(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var re=n.useState(new Map),ie=re[0],ae=re[1],le=n.useState((null==U?void 0:U.defaultExpandedRowKeys)||[]),de=le[0],se=le[1],ce=n.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=ce[0],pe=ce[1],fe=n.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),xe=fe[0],he=fe[1];n.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&he(y.pageSize))},[y]);var ve=n.useState(null),ge=ve[0],me=ve[1],ye=n.useState(null),be=ye[0],we=ye[1],ke=n.useState(!1),je=ke[0],Ce=ke[1],Se=n.useRef(null),Fe=n.useRef(null);n.useEffect(function(){var e=function(){Ce(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var ze=n.useCallback(function(e,n){var t,o,r,a=null===(t=null==g?void 0:g.getCheckboxProps)||void 0===t?void 0:t.call(g,e);if(!(null==a?void 0:a.disabled)){var l,d=F(e,v);l="radio"===(null==g?void 0:g.type)?n?[d]:[]:n?i(i([],te,!0),[d],!1):te.filter(function(e){return e!==d}),oe(l);var s=x.filter(function(e){return l.includes(F(e,v))});null===(o=null==g?void 0:g.onChange)||void 0===o||o.call(g,l,s),null===(r=null==g?void 0:g.onSelect)||void 0===r||r.call(g,e,n,s,new Event("select"))}},[te,v,g,x]),Ae=n.useCallback(function(e,n){var t,o,r=n.filter(function(e){var n;return!(null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e).disabled)}).map(function(e){return F(e,v)}),i=e?r:[];oe(i);var a=x.filter(function(e){return i.includes(F(e,v))}),l=e?n.filter(function(e){var n;return!(null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e).disabled)}):[];null===(t=null==g?void 0:g.onChange)||void 0===t||t.call(g,i,a),null===(o=null==g?void 0:g.onSelectAll)||void 0===o||o.call(g,e,a,l)},[v,g,x]),We=n.useCallback(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var o=new Map(ie);null===n?o.delete(t):o.set(t,n),ae(o);var r=Array.from(o.entries()).map(function(n){var t=n[0],o=n[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t})||e,order:o,field:t,columnKey:t}}),i={column:e,order:n,field:t,columnKey:t};e.onSorterChange&&e.onSorterChange(i),_&&_(1===r.length?r[0]:r),P&&P({current:ue,pageSize:xe},{},1===r.length?r[0]:r,{currentDataSource:x,action:"sort"})}},[ie,P,_,ue,xe,x,p]);n.useCallback(function(e,n){var t,o,r,a=F(e,v);r=n?i(i([],de,!0),[a],!1):de.filter(function(e){return e!==a}),se(r),null===(t=null==U?void 0:U.onExpand)||void 0===t||t.call(U,n,e),null===(o=null==U?void 0:U.onExpandedRowsChange)||void 0===o||o.call(U,r)},[de,v,U]);var Le,Ee=n.useCallback(function(){var e=i([],x,!0);return ie.size>0&&e.sort(function(e,n){for(var t=function(t,o){var r=p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,n);else if(!0===r.sorter){var a=S(e,r.dataIndex||t),l=S(n,r.dataIndex||t);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=t(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[x,ie,p]),Ie=Ee(),Me=Boolean(y&&"object"==typeof y&&void 0!==y.total),Be=n.useMemo(function(){if(!1===y||!y)return Ie;if(Me)return Ie;var e=(ue-1)*xe,n=e+xe;return Ie.slice(e,n)},[Ie,ue,xe,y,Me]),De=n.useCallback(function(e,n){var t,o,r=null!=n?n:xe;if(pe(e),n&&he(n),K&&K(e,r),y&&"object"==typeof y&&(null===(t=y.onChange)||void 0===t||t.call(y,e,n),n&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,n))),P){var i=Array.from(ie.entries()).map(function(e){var n=e[0],t=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});P({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Ie,action:"paginate"})}},[y,K,P,xe,ie,p,Ie]),Ne=n.useCallback(function(e,n,t){var o=S(n,e.dataIndex||"");return e.render?e.render(o,n,t):o},[]),Re=n.useCallback(function(e,n,t){if(n){var o=!0===n?"left":n,r=0;if("left"===o){if(g&&("left"===g.fixed||!0===g.fixed))r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[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<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(g&&"right"===g.fixed)r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return r}}},[p,g]),He=n.useCallback(function(){if(!B)return null;var n,t,r,i,a=p.map(function(n,t){var r,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||t,a=ie.get(i)||null,l=Re(t,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("th",o({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:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e.jsx("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.jsx("button",{onClick:function(){We(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.jsx(z,{order:a||void 0})})]})}),i)});if(g){var l="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",d=e.jsx("th",{style:{width:l,position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.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:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!g.hideSelectAll&&"radio"!==g.type&&(n=Be.filter(function(e){var n;return!(null===(n=g.getCheckboxProps)||void 0===n?void 0:n.call(g,e).disabled)}),t=n.map(function(e){return F(e,v)}),r=n.length>0&&t.every(function(e){return te.includes(e)}),i=t.some(function(e){return te.includes(e)}),e.jsx(k,{checked:r,indeterminate:i&&!r,onChange:function(e){return Ae(e.target.checked,Be)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");a.unshift(d)}var s=null==Z?void 0:Z(p,0);return e.jsx("thead",{ref:Fe,children:e.jsx("tr",o({},s||{},{children:a}))})},[p,B,ie,g,te,Be,v,We,Ae,I,Z,Re]),Te=n.useCallback(function(e){me(e)},[]),Oe=n.useCallback(function(e,n){e.preventDefault(),we(n)},[]),Pe=n.useCallback(function(e,n){if(e.preventDefault(),null===ge||ge===n)return me(null),void we(null);var t=i([],Be,!0),o=t[ge];t.splice(ge,1),t.splice(n,0,o),me(null),we(null)},[ge,Be]),_e=n.useCallback(function(){me(null),we(null)},[]),Ke=n.useCallback(function(){var n=null==I?void 0:I.emptyText,t="function"==typeof n?n():void 0!==n?n:"No data",o=p.length+(g?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("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:t})})},[null==I?void 0:I.emptyText,p.length,g]),Xe=n.useCallback(function(){return 0===Be.length?Ke():Be.map(function(t,r){var i,a=F(t,v),l=te.includes(a),d=de.includes(a),s=(null==X?void 0:X(t,r))||{},c=r===Be.length-1;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",o({className:"".concat("function"==typeof G?G(t,r):G||""," ").concat(ge===r?"dragging":""," ").concat(be===r?"drag-over":""),draggable:!0,onDragStart:function(){return Te(r)},onDragOver:function(e){return Oe(e,r)},onDrop:function(e){return Pe(e,r)},onDragEnd:_e,style:o({cursor:"move",opacity:ge===r?.5:1,backgroundColor:be===r?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){ge!==r&&be!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ge!==r&&be!==r&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[g&&e.jsx("td",{style:{width:"number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(k,{checked:l,onChange:function(e){return ze(t,e.target.checked)},disabled:null===(i=g.getCheckboxProps)||void 0===i?void 0:i.call(g,t).disabled})})}),p.map(function(n,i){var a,l=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||i,d=(null===(a=n.onCell)||void 0===a?void 0:a.call(n,t,r))||{},s=Re(i,n.fixed,!1),u=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("td",o({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:o({width:u,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:u||void 0,maxWidth:u,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===n.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:"white",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:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:n.align||"left"},d.style),colSpan:n.colSpan,rowSpan:n.rowSpan},d,{children:Ne(n,t,r)}),l)})]})),(null==U?void 0:U.expandedRowRender)&&d&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(g?1:0),children:U.expandedRowRender(t,r,0,!0)})})]},a)})},[Be,v,te,de,g,p,X,G,ze,Ne,U,ge,be,Te,Oe,Pe,_e,Re,Ke]),qe=function(){var n;if(!1===y||!y)return null;var t=null!==(n=y.total)&&void 0!==n?n:Ie.length,o=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e.jsx(w,{current:ue,total:t,pageSize:xe,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:De,onShowSizeChange:De,simple:y.simple,responsive:y.responsive,size:"small"===j?"small":"default"})})},Ye=n.useMemo(function(){return p.some(function(e){return e.fixed})||g&&g.fixed},[p,g]),Ve=n.useMemo(function(){return p.every(function(e){return e.width})&&(!g||g.columnWidth)},[p,g]),Je=n.useMemo(function(){if(null==H?void 0:H.x){if("number"==typeof H.x)return H.x;if(!0===H.x)return p.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(g?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth||"60").replace("px",""))||60:0)}if(Ye)return p.reduce(function(e,n){return n.fixed&&n.width?e+("number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0):e},0)+(g&&g.fixed&&g.columnWidth?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth).replace("px",""))||60:0)},[p,null==H?void 0:H.x,g,Ye]),Qe=n.useMemo(function(){return"fixed"===O||Ye||Ve||p.some(function(e){return e.width})?"fixed":O},[O,Ye,Ve,p]),Ue=o(o({width:"100%",minWidth:Je?"".concat(Je,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Qe,backgroundColor:"white"},W&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ge=o({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"},Q);if(je)return e.jsxs("div",o({ref:Se,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Ge,"aria-busy":!!E||void 0},$,{children:[D&&e.jsx("div",{style:{marginBottom:"16px"},children:D(Ie)}),y&&"object"==typeof y&&(null===(a=y.position)||void 0===a?void 0:a.startsWith("top"))&&qe(),(Le="function"==typeof(null==I?void 0:I.emptyText)?I.emptyText():void 0!==(null==I?void 0:I.emptyText)?I.emptyText:"No data",0===Be.length?e.jsx("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:Le}):e.jsx("div",{className:"aha-table-mobile",children:Be.map(function(n,t){var o,r=F(n,v),i=te.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(k,{checked:i,onChange:function(e){return ze(n,e.target.checked)},disabled:null===(o=g.getCheckboxProps)||void 0===o?void 0:o.call(g,n).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=S(n,o.dataIndex||""),a=o.render?o.render(i,n,t):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(Ie)}),y&&("object"!=typeof y||!(null===(l=y.position)||void 0===l?void 0:l.startsWith("top")))&&qe(),e.jsx(C,{loading:E,spinColor:ee})]}));var Ze={position:"relative",overflowX:(null==H?void 0:H.x)||Ye?"auto":"visible",overflowY:(null==H?void 0:H.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==H?void 0:H.x)?"100%":"number"==typeof(null==H?void 0:H.x)?"".concat(H.x,"px"):void 0,maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",o({ref:Se,className:"aha-table ".concat(Y),style:Ge,"aria-busy":!!E||void 0},$,{children:[D&&e.jsx("div",{style:{marginBottom:"16px"},children:D(Ie)}),y&&"object"==typeof y&&(null===(s=y.position)||void 0===s?void 0:s.startsWith("top"))&&qe(),e.jsx("div",{style:Ze,children:e.jsx("div",{style:{width:"100%",minWidth:Je?"".concat(Je,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Ue,className:J,children:[He(),e.jsx("tbody",{children:Xe()}),R&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(g?1:0),children:R(Ie)})})})]})})}),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(Ie)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&qe(),e.jsx(C,{loading:E,spinColor:ee})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),n=require("react-dom"),t=function(){return t=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++)for(var r in o=arguments[n])Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e},t.apply(this,arguments)};function r(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}function i(e,o,n){if(n||2===arguments.length)for(var t,r=0,i=o.length;r<i;r++)!t&&r in o||(t||(t=Array.prototype.slice.call(o,0,r)),t[r]=o[r]);return e.concat(t||Array.prototype.slice.call(o))}"function"==typeof SuppressedError&&SuppressedError;var a={primaryColor:"#FB6011"},l=o.createContext(a),d=function(){var e=o.useContext(l);return e||a},s={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},c={primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link",default:"secondary"},u={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},p=function(o){var n=o.size,t=o.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:t,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},f=function(n){var i=n.children,a=n.type,l=void 0===a?"secondary":a,f=n.size,x=void 0===f?"md":f,h=n.disabled,v=void 0!==h&&h,g=n.loading,m=void 0!==g&&g,y=n.iconOnly,b=n.focused,w=void 0!==b&&b,k=n.onClick,j=n.htmlType,S=void 0===j?"button":j,C=n.className,z=void 0===C?"":C,F=n.style,W=n.icon,L=n.iconPosition,A=void 0===L?"left":L,E=r(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),I=d().primaryColor,B=o.useState(!1),M=B[0],R=B[1],N=o.useState(!1),D=N[0],H=N[1],T=c[l]||"secondary",O=u[s[x]||"md"],P=null!=y?y:!!W&&null==i,_="link-color"===T||"link-gray"===T||"destructive-link"===T,K=v||m,q=w,X=I,Y=function(){if(v)return"primary"===T||"secondary"===T||"destructive-primary"===T||"destructive-secondary"===T?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=M||D;return"primary"===T?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":X||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===T?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===T?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===T?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===T?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===T?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),V=function(){if(q)return"destructive-primary"===T||"destructive-secondary"===T||"destructive-tertiary"===T||"destructive-link"===T?"destructive-primary"===T||"destructive-secondary"===T?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===T||"secondary"===T?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),J=t({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:O.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:O.fontSize,lineHeight:"".concat(O.lineHeight,"px"),cursor:K?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:Y.bg,color:Y.color,border:Y.border,boxShadow:null!=V?V:Y.boxShadow,textDecoration:Y.textDecoration},F);_?(J.borderRadius="4px",J.overflow="hidden",P?(J.width=O.height,J.height=O.height,J.padding=0):(J.height=O.height,J.paddingLeft=O.paddingX,J.paddingRight=O.paddingX)):(J.borderRadius="var(--radius-md, 8px)",P?(J.width=O.height,J.height=O.height,J.padding=0):(J.height=O.height,J.paddingLeft=O.paddingX,J.paddingRight=O.paddingX));var Q=function(){return m?e.jsx(p,{size:O.iconSize,color:Y.iconColor}):W?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:O.iconSize,height:O.iconSize,color:Y.iconColor,flexShrink:0},children:W}):null},G=m||W&&"left"===A,U=!m&&W&&"right"===A;return e.jsxs("button",t({type:S,className:["aha-button","aha-button--".concat(T),"aha-button--".concat(s[x]||"md"),P&&"aha-button--icon-only",K&&"aha-button--disabled",m&&"aha-button--loading",q&&"aha-button--focused",z].filter(Boolean).join(" "),disabled:K,onClick:function(e){K?e.preventDefault():null==k||k(e)},onMouseEnter:function(){return!K&&R(!0)},onMouseLeave:function(){R(!1),H(!1)},onMouseDown:function(){return!K&&H(!0)},onMouseUp:function(){return H(!1)},style:J},E,{children:[G&&Q(),!P&&i,U&&Q(),P&&!W&&!m&&i]}))};f.displayName="Button";var x="var(--shadow-xs)",h={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}};o.forwardRef(function(n,i){var a=n.size,l=void 0===a?"mediumSmall":a,d=n.error,s=void 0!==d&&d,c=n.disabled,u=void 0!==c&&c,p=n.readOnly,f=void 0!==p&&p,v=n.prefix,g=n.suffix,m=n.leadingText,y=n.trailingText,b=n.leadingAddon,w=n.trailingAddon,k=n.className,j=void 0===k?"":k,S=n.style,C=n.onFocus,z=n.onBlur,F=n.onKeyDown,W=n.onPressEnter,L=n.value,A=n.defaultValue,E=n.onChange,I=n.placeholder,B=n.type,M=void 0===B?"text":B,R=n.label,N=n.required,D=n.hintText,H=r(n,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),T=o.useRef(null),O=o.useState(!1),P=O[0],_=O[1],K=o.useState(null!=A?A:""),q=K[0],X=K[1];o.useEffect(function(){"function"==typeof i?i(T.current):i&&(i.current=T.current)},[i]);var Y=void 0!==L,V=Y?L:q,J=u?{border:"1px solid var(--color-border-disabled)",boxShadow:x,outline:"none"}:s&&P?{border:"1px solid var(--color-border-error)",boxShadow:x,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:s?{border:"1px solid var(--color-border-error_subtle)",boxShadow:x,outline:"none"}:P?{border:"1px solid var(--color-border-brand)",boxShadow:x,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:x,outline:"none"},Q=J.border,G=J.boxShadow,U=J.outline,Z=J.outlineOffset,$=h[l],ee=$.pt,oe=$.pb,ne=u?"var(--color-border-disabled)":"var(--color-border-primary)",te=!!v,re=!!g,ie={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1,pointerEvents:"none"},ae={display:"flex",alignItems:"center",paddingTop:ee,paddingBottom:oe,paddingLeft:"14px",paddingRight:"12px",color:"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",whiteSpace:"nowrap",flexShrink:0,backgroundColor:u?"var(--color-bg-disabled_subtle)":"transparent"},le=e.jsxs("div",{className:"aha-input-group ".concat(j),style:t({display:"flex",alignItems:"stretch",width:"100%",border:Q,boxShadow:G,outline:U,outlineOffset:Z,borderRadius:"var(--radius-md)",backgroundColor:u||f?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},S),children:[void 0!==m&&e.jsx("div",{style:t(t({},ae),{borderRight:"1px solid ".concat(ne)}),children:m}),void 0!==b&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(ne)},children:b}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[te&&e.jsx("span",{style:t(t({},ie),{left:"14px"}),children:v}),e.jsx("input",t({ref:T,type:M,value:V,placeholder:I,disabled:u,readOnly:f,onChange:function(e){Y||X(e.target.value),null==E||E(e)},onFocus:function(e){_(!0),null==C||C(e)},onBlur:function(e){_(!1),null==z||z(e)},onKeyDown:function(e){"Enter"===e.key&&W&&W(e),null==F||F(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",backgroundColor:"transparent",color:u?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ee,paddingBottom:oe,paddingLeft:te?"40px":"14px",paddingRight:re?"40px":"14px"},autoComplete:H.autoComplete||"off"},H)),re&&e.jsx("span",{style:t(t({},ie),{right:"14px"}),children:g})]}),void 0!==y&&e.jsx("div",{style:t(t({},ae),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(ne)}),children:y}),void 0!==w&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(ne)},children:w})]});if(!R&&!D)return le;var de={margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:s?"var(--color-error-600)":"var(--color-text-tertiary)"};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,N&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),le,D&&e.jsx("p",{style:de,children:D})]})}).displayName="InputGroup";var v={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},g="var(--shadow-xs)",m=function(o){var n=o.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:n,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},y=o.forwardRef(function(n,i){var a=n.size,l=void 0===a?"mediumSmall":a,d=n.disabled,s=void 0!==d&&d,c=n.error,u=void 0!==c&&c,p=n.readOnly,f=void 0!==p&&p,x=n.prefix,h=n.suffix,y=n.allowClear,b=void 0!==y&&y,w=n.onClear,k=n.className,j=void 0===k?"":k,S=n.style,C=n.type,z=void 0===C?"text":C,F=n.placeholder,W=n.value,L=n.defaultValue,A=n.onChange,E=n.onFocus,I=n.onBlur,B=n.onPressEnter,M=n.label,R=n.required,N=n.hintText,D=r(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),H=o.useRef(null),T=o.useState(L||W||""),O=T[0],P=T[1],_=o.useState(!1),K=_[0],q=_[1];o.useEffect(function(){"function"==typeof i?i(H.current):i&&(i.current=H.current)},[i]);var X=void 0!==W,Y=X?W:O,V=b&&Y&&!s,J=s?{border:"1px solid var(--color-border-disabled)",boxShadow:g,outline:"none"}:u&&K?{border:"1px solid var(--color-border-error)",boxShadow:g,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:u?{border:"1px solid var(--color-border-error_subtle)",boxShadow:g,outline:"none"}:K?{border:"1px solid var(--color-border-brand)",boxShadow:g,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:g,outline:"none"},Q=J.border,G=J.boxShadow,U=J.outline,Z=J.outlineOffset,$=v[l],ee=$.height,oe=$.paddingTop,ne=$.paddingBottom,te=t({width:"100%",height:ee,boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",borderRadius:"var(--radius-md)",border:Q,boxShadow:G,backgroundColor:s||f?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:s?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:oe,paddingBottom:ne,paddingLeft:x?"40px":"14px",paddingRight:h||V?"40px":"14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",outline:U,outlineOffset:Z,WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},S),re={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:s?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1},ie=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: var(--color-text-placeholder);\n font-size: var(--font-size-text-md);\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input::-moz-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input:-ms-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\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"] { -moz-appearance: textfield; }\n '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(j),style:{position:"relative",display:"block",width:"100%"},children:[x&&e.jsx("span",{style:t(t({},re),{left:"14px",pointerEvents:"none"}),children:x}),e.jsx("input",t({ref:H,type:z,value:Y,placeholder:F,disabled:s,readOnly:f,onChange:function(e){X||P(e.target.value),null==A||A(e)},onFocus:function(e){q(!0),null==E||E(e)},onBlur:function(e){q(!1),null==I||I(e)},onKeyDown:function(e){var o;"Enter"===e.key&&B&&B(e),null===(o=D.onKeyDown)||void 0===o||o.call(D,e)},style:te,autoComplete:D.autoComplete||"off",autoCorrect:D.autoCorrect||"off",autoCapitalize:D.autoCapitalize||"off",spellCheck:D.spellCheck||!1},D)),(h||V)&&e.jsxs("span",{style:t(t({},re),{right:"14px",gap:"var(--spacing-xs)"}),children:[V&&e.jsx(m,{onClick:function(e){var o;e.stopPropagation(),X||P("");null==A||A({target:{value:""},currentTarget:{value:""}}),null==w||w(),null===(o=H.current)||void 0===o||o.focus()}}),h]})]})]});return M||N?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[M&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[M,R&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ie,N&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:u?"var(--color-error-600)":"var(--color-text-tertiary)"},children:N})]}):ie});y.displayName="Input";var b=function(r){var a,l=r.value,s=r.defaultValue,c=r.options,u=void 0===c?[]:c,p=r.mode,f=r.disabled,x=void 0!==f&&f,h=r.error,v=void 0!==h&&h,g=r.placeholder,m=void 0===g?"Please select":g,y=r.size,b=void 0===y?"medium":y,w=r.showSearch,k=void 0!==w&&w,j=r.filterOption,S=void 0===j||j,C=r.allowClear,z=void 0!==C&&C,F=r.onChange,W=r.onSelect,L=r.onDeselect,A=r.onSearch,E=r.onFocus,I=r.onBlur,B=r.onDropdownVisibleChange,M=r.className,R=void 0===M?"":M,N=r.style,D=r.dropdownClassName,H=void 0===D?"":D,T=r.dropdownStyle,O=r.defaultOpen,P=void 0!==O&&O,_=r.open,K=r.maxTagCount,q=r.tagRender,X=r.optionRender,Y=d().primaryColor,V=void 0===Y?"#FB6011":Y,J=o.useState(void 0!==s?s:p?[]:void 0),Q=J[0],G=J[1],U=o.useState(P),Z=U[0],$=U[1],ee=o.useState(""),oe=ee[0],ne=ee[1],te=o.useState(-1),re=te[0],ie=te[1],ae=o.useRef(null),le=o.useRef(null),de=o.useRef(null),se=o.useState(null),ce=se[0],ue=se[1],pe=void 0!==l,fe=void 0!==_,xe=pe?l:Q,he=fe?_:Z,ve="multiple"===p||"tags"===p,ge=o.useCallback(function(){if(!xe)return[];var e=Array.isArray(xe)?xe:[xe];return u.filter(function(o){return e.includes(o.value)})},[xe,u]),me=o.useCallback(function(){return k&&oe?!1===S?u:"function"==typeof S?u.filter(function(e){return S(oe,e)}):u.filter(function(e){var o=String(e.label||"").toLowerCase(),n=oe.toLowerCase();return o.includes(n)}):u},[u,oe,k,S]),ye=o.useMemo(function(){return me()},[me]);o.useEffect(function(){if(he&&ae.current){var e=function(){var e,o;if(ae.current){var n=ae.current.getBoundingClientRect(),t=null!==(o=null===(e=de.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==o?o:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<t+4&&i>r,l=a?n.top+window.scrollY-t-4:n.bottom+window.scrollY+4;ue({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)}}ue(null)},[he,ye.length]),o.useEffect(function(){var e=function(e){var o=e.target;ae.current&&!ae.current.contains(o)&&de.current&&!de.current.contains(o)&&(fe||$(!1),null==B||B(!1),ne(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,fe,B]),o.useEffect(function(){if(he){var e=function(e){var o;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var n=ye[re];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(o=ae.current)||void 0===o||o.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,re,fe,B]),o.useEffect(function(){if(re>=0&&de.current){var e=de.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=o.useCallback(function(e){var o;if(!e.disabled)if(ve){var n,t=Array.isArray(xe)?xe:[];t.includes(e.value)?(n=t.filter(function(o){return o!==e.value}),null==L||L(e.value,e)):(n=i(i([],t,!0),[e.value],!1),null==W||W(e.value,e)),pe||G(n);var r=u.filter(function(e){return n.includes(e.value)});null==F||F(n,r)}else pe||G(e.value),null==F||F(e.value,e),null==W||W(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(o=ae.current)||void 0===o||o.focus()},[ve,xe,pe,fe,u,F,W,L,B]),we=o.useCallback(function(e,o){if(e.stopPropagation(),ve&&Array.isArray(xe)){var n=xe.filter(function(e){return e!==o}),t=u.find(function(e){return e.value===o});pe||G(n),null==F||F(n,ge()),null==L||L(o,t)}},[ve,xe,pe,u,F,L,ge]),ke=function(e){e.stopPropagation();var o=ve?[]:void 0;pe||G(o),null==F||F(o,[]),ne("")},je={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"}},Se=o.useMemo(function(){return ge()},[ge]),Ce=o.useMemo(function(){return z&&xe&&!x},[z,xe,x]),ze=o.useMemo(function(){return ve?Array.isArray(xe)&&xe.length>0:null!=xe&&""!==xe},[ve,xe]),Fe=o.useMemo(function(){if(!ve||!Array.isArray(xe)||0===xe.length)return null;var n="responsive"===K?Se.slice(0,2):K?Se.slice(0,K):Se,t=K&&Se.length>n.length?Se.length-n.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var t={label:n.label,value:n.value,closable:!x,onClose:function(){return we({},n.value)}};return q?e.jsx(o.Fragment,{children:q(t)},n.value):e.jsxs("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.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!x&&e.jsx("span",{onClick:function(e){return we(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),t>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",t]})]})},[ve,xe,Se,K,x,q]);return e.jsxs(e.Fragment,{children:[e.jsx("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 "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(R),style:t({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(v?"#F04438":he?V:"#D7D3D0"),backgroundColor:x?"#FAFAF9":"#FFFFFF",cursor:x?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:je[b].paddingTop,paddingBottom:je[b].paddingBottom,fontSize:je[b].fontSize,lineHeight:je[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:function(){if(!x){var e=!he;fe||$(e),null==B||B(e),e&&k?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==E||E(e)},onBlur:function(e){null==I||I(e)},onTouchStart:function(e){x||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:x?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ve?Fe||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):k&&he?e.jsx("input",{ref:le,type:"text",value:oe,onChange:function(e){var o=e.target.value;ne(o),null==A||A(o),ie(-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:x?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:ze?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:ze?x?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:ze?(null===(a=Se[0])||void 0===a?void 0:a.label)||xe:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Ce&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ke,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(o){var n=o.isOpen;return e.jsx("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.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ce&&n.createPortal(e.jsx("div",{ref:de,className:"aha-select-dropdown ".concat(H),style:t({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.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"===ce.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ce.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},T),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(o,n){var t=ve?Array.isArray(xe)&&xe.includes(o.value):xe===o.value,r=n===re;return X?e.jsx("div",{className:"aha-select-option ".concat(o.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return!o.disabled&&be(o)},style:{cursor:o.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:X(o,{selected:t,focused:r,disabled:o.disabled||!1})},o.value):e.jsxs("div",{className:"aha-select-option ".concat(o.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return be(o)},style:{padding:"8px 16px",cursor:o.disabled?"not-allowed":"pointer",color:o.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.jsx("span",{children:o.label}),t&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:V,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},o.value)})}),document.body)]})};b.displayName="Select";var w=function(o){var n=o.className,t=o.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:e.jsx("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"})})},k=function(o){var n=o.className,t=o.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},j=function(o){var n=o.className,t=o.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},S=function(o){var n=o.className,t=o.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:e.jsx("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"})})},C=function(o){var n=o.className,t=o.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:e.jsx("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"})})},z=function(n){var r=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,u=n.defaultPageSize,p=void 0===u?10:u,x=n.showSizeChanger,h=void 0!==x&&x,v=n.pageSizeOptions,g=void 0===v?["10","20","50","100"]:v,m=n.showQuickJumper,w=void 0!==m&&m,k=n.showTotal,j=n.onChange,z=n.onShowSizeChange,F=n.simple,W=void 0!==F&&F,L=n.disabled,A=void 0!==L&&L,E=n.hideOnSinglePage,I=void 0!==E&&E,B=n.className,M=void 0===B?"":B,R=n.style,N=n.size,D=void 0===N?"default":N,H=n.responsive,T=void 0!==H&&H;n.showLessItems;var O=n.itemRender,P=d().primaryColor,_=void 0===P?"#FB6011":P,K=o.useState(a),q=K[0],X=K[1],Y=o.useState(p),V=Y[0],J=Y[1],Q=o.useState(""),G=Q[0],U=Q[1],Z=null!=r?r:q,$=null!=c?c:V,ee=o.useMemo(function(){return Math.ceil(s/$)},[s,$]);o.useEffect(function(){void 0!==r&&X(r)},[r]),o.useEffect(function(){void 0!==c&&J(c)},[c]);var oe=function(e){e<1||e>ee||e===Z||A||(void 0===r&&X(e),null==j||j(e,$))},ne=function(){var e=parseInt(G,10);e>=1&&e<=ee&&(oe(e),U(""))};if(I&&ee<=1)return null;if(W)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(M),style:R,children:[e.jsx(f,{onClick:function(){return oe(Z-1)},disabled:A||1===Z,type:"default",size:"default"===D?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(S,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Z," / ",ee]}),e.jsx(f,{onClick:function(){return oe(Z+1)},disabled:A||Z===ee,type:"default",size:"default"===D?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(C,{})})]});var te=(Z-1)*$+1,re=Math.min(Z*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(M),style:t({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},R),children:[k&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:k(s,[te,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:O?O(Z-1,"prev",e.jsx(f,{onClick:function(){return oe(Z-1)},disabled:A||1===Z,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(S,{})})):e.jsx(f,{onClick:function(){return oe(Z-1)},disabled:A||1===Z,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(S,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,o){return o+1});var e=[];if(Z<=4){for(var o=1;o<=5;o++)e.push(o);e.push("jump-next"),e.push(ee)}else if(Z>=ee-3){e.push(1),e.push("jump-prev");for(o=ee-4;o<=ee;o++)e.push(o)}else{e.push(1),e.push("jump-prev");for(o=Z-1;o<=Z+1;o++)e.push(o);e.push("jump-next"),e.push(ee)}return e}().map(function(o){return function(o){if("number"==typeof o){var n=o===Z,t=e.jsx(f,{onClick:function(){return oe(o)},disabled:A,type:n?"primary":"default",size:"default"===D?"medium":"small",style:{minWidth:"small"===D?"32px":"36px",height:"small"===D?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(_):void 0,boxShadow:"none",borderRadius:"8px"},children:o},o);return O?O(o,"page",t):t}if("jump-prev"===o)return t=e.jsx(f,{onClick:function(){return oe(Math.max(1,Z-5))},disabled:A,type:"default",size:"default"===D?"medium":"small",style:{minWidth:"small"===D?"32px":"36px",height:"small"===D?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),O?O(Z-5,"jump-prev",t):t;if("jump-next"===o)return t=e.jsx(f,{onClick:function(){return oe(Math.min(ee,Z+5))},disabled:A,type:"default",size:"default"===D?"medium":"small",style:{minWidth:"small"===D?"32px":"36px",height:"small"===D?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),O?O(Z+5,"jump-next",t):t;return null}(o)})}),s>0&&e.jsx(e.Fragment,{children:O?O(Z+1,"next",e.jsx(f,{onClick:function(){return oe(Z+1)},disabled:A||Z===ee,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(C,{})})):e.jsx(f,{onClick:function(){return oe(Z+1)},disabled:A||Z===ee,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(C,{})})}),h&&e.jsx(b,{value:$,options:g.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return o=Number(e),n=Math.ceil(s/o),t=Z>n?n:Z,void 0===c&&J(o),void 0===r&&X(t),null==z||z(t,o),void(null==j||j(t,o));var o,n,t},disabled:A,size:"small"===D?"small":"medium",style:{minWidth:"small"===D?80:96}}),w&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(y,{type:"number",min:1,value:G,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:A,size:"small"===D?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof w&&w.goButton?e.jsx(f,{onClick:ne,disabled:A,type:"default",size:"default"===D?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:w.goButton}):e.jsx(f,{onClick:ne,disabled:A,type:"default",size:"default"===D?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},F=function(n){var r=n.checked,i=void 0!==r&&r,a=n.indeterminate,l=void 0!==a&&a,d=n.disabled,s=void 0!==d&&d,c=n.onChange,u=n.className,p=void 0===u?"":u,f=n.style,x=n.children,h=n.size,v=void 0===h?"sm":h,g=n.hint,m=n.isFocused,y=o.useState(!1),b=y[0],w=y[1],k=o.useState(!1),j=k[0],S=k[1],C=i||l,z=null!=m?m:j,F=function(){s||(null==c||c({target:{checked:!i},currentTarget:{checked:!i}}))},W="sm"===v?"16px":"20px",L="sm"===v?"12px":"14px",A="sm"===v?"var(--radius-xs, 4px)":"var(--radius-sm, 6px)",E="sm"===v?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",I="sm"===v?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",B="sm"===v?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",M=s&&C?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)",R=x||g;return e.jsxs("div",{className:"aha-checkbox ".concat(p),role:"checkbox","aria-checked":l?"mixed":i,"aria-disabled":s,tabIndex:s?-1:0,style:t({display:"inline-flex",alignItems:"flex-start",gap:B,cursor:s?"not-allowed":"pointer",outline:"none"},f),onClick:F,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),F())},onMouseEnter:function(){return!s&&w(!0)},onMouseLeave:function(){return w(!1)},onFocus:function(){return!s&&S(!0)},onBlur:function(){return S(!1)},children:[e.jsxs("div",{style:{position:"relative",width:W,height:W,minWidth:W,minHeight:W,flexShrink:0,borderRadius:A,border:s?"1px solid var(--color-border-disabled, #d7d3d0)":C?b?"1px solid var(--color-bg-brand-solid_hover, #ec470a)":"1px solid var(--color-bg-brand-solid, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",backgroundColor:s?"var(--color-bg-disabled_subtle, #fafaf9)":C?b?"var(--color-bg-brand-solid_hover, #ec470a)":"var(--color-bg-brand-solid, #fb6011)":b?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:z?"var(--focus-ring, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px #fb6011)":"none",marginTop:R?"2px":"0"},children:[e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:L,height:L,color:M,opacity:l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M2.91675 7H11.0834",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:L,height:L,color:M,opacity:i&&!l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),R&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"md"===v?"var(--spacing-xxs, 2px)":"0"},children:[x&&e.jsx("span",{style:{fontSize:E,lineHeight:I,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:s?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:x}),g&&e.jsx("span",{style:{fontSize:E,lineHeight:I,fontWeight:"var(--font-weight-regular, 400)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:"var(--color-text-tertiary, #57534e)"},onClick:function(e){return e.stopPropagation()},children:g})]})]})};F.displayName="Checkbox";var W=function(o){var n=o.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("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.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},L=function(o){var n=o.loading,t=o.spinColor;if(!n)return null;var r=!0===n?e.jsx(W,{color:t}):n;return e.jsx("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})},A=function(e,o){return"string"==typeof o?null==e?void 0:e[o]:o.reduce(function(e,o){return null==e?void 0:e[o]},e)},E=function(e,o){var n,t;return"function"==typeof o?o(e):"string"==typeof o?null!==(n=A(e,o))&&void 0!==n?n:"":null!==(t=e.key)&&void 0!==t?t:""},I=function(o){var n=o.order,t=d().primaryColor;return"ascend"===n?e.jsx(j,{style:{color:t}}):"descend"===n?e.jsx(k,{style:{color:t}}):e.jsx(w,{})};exports.default=function(n){var a,l,s,c,u=n.columns,p=void 0===u?[]:u,f=n.dataSource,x=void 0===f?[]:f,h=n.rowKey,v=void 0===h?"key":h,g=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,k=n.bordered,j=void 0!==k&&k,S=n.loading,C=void 0!==S&&S,W=n.locale,B=n.showHeader,M=void 0===B||B,R=n.title,N=n.footer,D=n.summary,H=n.scroll,T=n.tableLayout,O=void 0===T?"auto":T,P=n.onChange,_=n.onSorterChange,K=n.onPaginationChange,q=n.onRow,X=n.className,Y=void 0===X?"":X,V=n.innerClassName,J=void 0===V?"":V,Q=n.style,G=n.expandable,U=n.rowClassName,Z=n.onHeaderRow;n.sticky;var $=r(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=d().primaryColor||"#FB6011",oe=o.useState((null==g?void 0:g.selectedRowKeys)||(null==g?void 0:g.defaultSelectedRowKeys)||[]),ne=oe[0],te=oe[1];o.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&te(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var re=o.useState(new Map),ie=re[0],ae=re[1],le=o.useState((null==G?void 0:G.defaultExpandedRowKeys)||[]),de=le[0],se=le[1],ce=o.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=ce[0],pe=ce[1],fe=o.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),xe=fe[0],he=fe[1];o.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&he(y.pageSize))},[y]);var ve=o.useState(null),ge=ve[0],me=ve[1],ye=o.useState(null),be=ye[0],we=ye[1],ke=o.useState(!1),je=ke[0],Se=ke[1],Ce=o.useRef(null),ze=o.useRef(null);o.useEffect(function(){var e=function(){Se(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Fe=o.useCallback(function(e,o){var n,t,r,a=null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e);if(!(null==a?void 0:a.disabled)){var l,d=E(e,v);l="radio"===(null==g?void 0:g.type)?o?[d]:[]:o?i(i([],ne,!0),[d],!1):ne.filter(function(e){return e!==d}),te(l);var s=x.filter(function(e){return l.includes(E(e,v))});null===(t=null==g?void 0:g.onChange)||void 0===t||t.call(g,l,s),null===(r=null==g?void 0:g.onSelect)||void 0===r||r.call(g,e,o,s,new Event("select"))}},[ne,v,g,x]),We=o.useCallback(function(e,o){var n,t,r=o.filter(function(e){var o;return!(null===(o=null==g?void 0:g.getCheckboxProps)||void 0===o?void 0:o.call(g,e).disabled)}).map(function(e){return E(e,v)}),i=e?r:[];te(i);var a=x.filter(function(e){return i.includes(E(e,v))}),l=e?o.filter(function(e){var o;return!(null===(o=null==g?void 0:g.getCheckboxProps)||void 0===o?void 0:o.call(g,e).disabled)}):[];null===(n=null==g?void 0:g.onChange)||void 0===n||n.call(g,i,a),null===(t=null==g?void 0:g.onSelectAll)||void 0===t||t.call(g,e,a,l)},[v,g,x]),Le=o.useCallback(function(e,o){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var t=new Map(ie);null===o?t.delete(n):t.set(n,o),ae(t);var r=Array.from(t.entries()).map(function(o){var n=o[0],t=o[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:t,field:n,columnKey:n}}),i={column:e,order:o,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),_&&_(1===r.length?r[0]:r),P&&P({current:ue,pageSize:xe},{},1===r.length?r[0]:r,{currentDataSource:x,action:"sort"})}},[ie,P,_,ue,xe,x,p]);o.useCallback(function(e,o){var n,t,r,a=E(e,v);r=o?i(i([],de,!0),[a],!1):de.filter(function(e){return e!==a}),se(r),null===(n=null==G?void 0:G.onExpand)||void 0===n||n.call(G,o,e),null===(t=null==G?void 0:G.onExpandedRowsChange)||void 0===t||t.call(G,r)},[de,v,G]);var Ae,Ee=o.useCallback(function(){var e=i([],x,!0);return ie.size>0&&e.sort(function(e,o){for(var n=function(n,t){var r=p.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,o);else if(!0===r.sorter){var a=A(e,r.dataIndex||n),l=A(o,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===t?i:-i}:void 0},t=0,r=Array.from(ie.entries());t<r.length;t++){var i=r[t],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[x,ie,p]),Ie=Ee(),Be=Boolean(y&&"object"==typeof y&&void 0!==y.total),Me=o.useMemo(function(){if(!1===y||!y)return Ie;if(Be)return Ie;var e=(ue-1)*xe,o=e+xe;return Ie.slice(e,o)},[Ie,ue,xe,y,Be]),Re=o.useCallback(function(e,o){var n,t,r=null!=o?o:xe;if(pe(e),o&&he(o),K&&K(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,o),o&&(null===(t=y.onShowSizeChange)||void 0===t||t.call(y,e,o))),P){var i=Array.from(ie.entries()).map(function(e){var o=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===o}),order:n,field:o,columnKey:o}});P({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Ie,action:"paginate"})}},[y,K,P,xe,ie,p,Ie]),Ne=o.useCallback(function(e,o,n){var t=A(o,e.dataIndex||"");return e.render?e.render(t,o,n):t},[]),De=o.useCallback(function(e,o,n){if(o){var t=!0===o?"left":o,r=0;if("left"===t){if(g&&("left"===g.fixed||!0===g.fixed))r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===t){for(i=e+1;i<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(g&&"right"===g.fixed)r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return r}}},[p,g]),He=o.useCallback(function(){if(!M)return null;var o,n,r,i,a=p.map(function(o,n){var r,i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex)||n,a=ie.get(i)||null,l=De(n,o.fixed,!0),d=o.width?"number"==typeof o.width?"".concat(o.width,"px"):o.width:void 0;return e.jsx("th",t({className:"".concat(o.className||""," ").concat(o.align?"text-".concat(o.align):""),style:{width:d,minWidth:o.minWidth?"number"==typeof o.minWidth?"".concat(o.minWidth,"px"):o.minWidth:d||void 0,maxWidth:d,position:o.fixed?"sticky":"relative",left:"left"===o.fixed||!0===o.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===o.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:o.fixed?"left"===o.fixed||!0===o.fixed?10:9:1,backgroundColor:(o.fixed,"#F9FAFB"),boxShadow:"left"===o.fixed||!0===o.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===o.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:o.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(r=o.onHeaderCell)||void 0===r?void 0:r.call(o,o))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===o.align?"flex-end":"center"===o.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof o.title?o.title({sortOrder:a,sortColumn:o}):o.title}),o.sorter&&e.jsx("button",{onClick:function(){Le(o,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.jsx(I,{order:a||void 0})})]})}),i)});if(g){var l="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",d=e.jsx("th",{style:{width:l,position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.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:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!g.hideSelectAll&&"radio"!==g.type&&(o=Me.filter(function(e){var o;return!(null===(o=g.getCheckboxProps)||void 0===o?void 0:o.call(g,e).disabled)}),n=o.map(function(e){return E(e,v)}),r=o.length>0&&n.every(function(e){return ne.includes(e)}),i=n.some(function(e){return ne.includes(e)}),e.jsx(F,{checked:r,indeterminate:i&&!r,onChange:function(e){return We(e.target.checked,Me)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");a.unshift(d)}var s=null==Z?void 0:Z(p,0);return e.jsx("thead",{ref:ze,children:e.jsx("tr",t({},s||{},{children:a}))})},[p,M,ie,g,ne,Me,v,Le,We,W,Z,De]),Te=o.useCallback(function(e){me(e)},[]),Oe=o.useCallback(function(e,o){e.preventDefault(),we(o)},[]),Pe=o.useCallback(function(e,o){if(e.preventDefault(),null===ge||ge===o)return me(null),void we(null);var n=i([],Me,!0),t=n[ge];n.splice(ge,1),n.splice(o,0,t),me(null),we(null)},[ge,Me]),_e=o.useCallback(function(){me(null),we(null)},[]),Ke=o.useCallback(function(){var o=null==W?void 0:W.emptyText,n="function"==typeof o?o():void 0!==o?o:"No data",t=p.length+(g?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:t,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==W?void 0:W.emptyText,p.length,g]),qe=o.useCallback(function(){return 0===Me.length?Ke():Me.map(function(n,r){var i,a=E(n,v),l=ne.includes(a),d=de.includes(a),s=(null==q?void 0:q(n,r))||{},c=r===Me.length-1;return e.jsxs(o.Fragment,{children:[e.jsxs("tr",t({className:"".concat("function"==typeof U?U(n,r):U||""," ").concat(ge===r?"dragging":""," ").concat(be===r?"drag-over":""),draggable:!0,onDragStart:function(){return Te(r)},onDragOver:function(e){return Oe(e,r)},onDrop:function(e){return Pe(e,r)},onDragEnd:_e,style:t({cursor:"move",opacity:ge===r?.5:1,backgroundColor:be===r?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){ge!==r&&be!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ge!==r&&be!==r&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[g&&e.jsx("td",{style:{width:"number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F,{checked:l,onChange:function(e){return Fe(n,e.target.checked)},disabled:null===(i=g.getCheckboxProps)||void 0===i?void 0:i.call(g,n).disabled})})}),p.map(function(o,i){var a,l=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex)||i,d=(null===(a=o.onCell)||void 0===a?void 0:a.call(o,n,r))||{},s=De(i,o.fixed,!1),u=o.width?"number"==typeof o.width?"".concat(o.width,"px"):o.width:void 0;return e.jsx("td",t({className:"".concat(o.className||""," ").concat(o.align?"text-".concat(o.align):""),style:t({width:u,minWidth:o.minWidth?"number"==typeof o.minWidth?"".concat(o.minWidth,"px"):o.minWidth:u||void 0,maxWidth:u,position:o.fixed?"sticky":"relative",left:"left"===o.fixed||!0===o.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===o.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,zIndex:o.fixed?"left"===o.fixed||!0===o.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===o.fixed||!0===o.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===o.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:o.align||"left"},d.style),colSpan:o.colSpan,rowSpan:o.rowSpan},d,{children:Ne(o,n,r)}),l)})]})),(null==G?void 0:G.expandedRowRender)&&d&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(g?1:0),children:G.expandedRowRender(n,r,0,!0)})})]},a)})},[Me,v,ne,de,g,p,q,U,Fe,Ne,G,ge,be,Te,Oe,Pe,_e,De,Ke]),Xe=function(){var o;if(!1===y||!y)return null;var n=null!==(o=y.total)&&void 0!==o?o:Ie.length,t=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:t.includes("Right")?"flex-end":t.includes("Left")?"flex-start":"center"},children:e.jsx(z,{current:ue,total:n,pageSize:xe,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:Re,onShowSizeChange:Re,simple:y.simple,responsive:y.responsive,size:"small"===w?"small":"default"})})},Ye=o.useMemo(function(){return p.some(function(e){return e.fixed})||g&&g.fixed},[p,g]),Ve=o.useMemo(function(){return p.every(function(e){return e.width})&&(!g||g.columnWidth)},[p,g]),Je=o.useMemo(function(){if(null==H?void 0:H.x){if("number"==typeof H.x)return H.x;if(!0===H.x)return p.reduce(function(e,o){return e+(o.width?"number"==typeof o.width?o.width:parseInt(String(o.width).replace("px",""))||0:150)},0)+(g?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth||"60").replace("px",""))||60:0)}if(Ye)return p.reduce(function(e,o){return o.fixed&&o.width?e+("number"==typeof o.width?o.width:parseInt(String(o.width).replace("px",""))||0):e},0)+(g&&g.fixed&&g.columnWidth?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth).replace("px",""))||60:0)},[p,null==H?void 0:H.x,g,Ye]),Qe=o.useMemo(function(){return"fixed"===O||Ye||Ve||p.some(function(e){return e.width})?"fixed":O},[O,Ye,Ve,p]),Ge=t(t({width:"100%",minWidth:Je?"".concat(Je,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Qe,backgroundColor:"white"},j&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=t({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"},Q);if(je)return e.jsxs("div",t({ref:Ce,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Ue,"aria-busy":!!C||void 0},$,{children:[R&&e.jsx("div",{style:{marginBottom:"16px"},children:R(Ie)}),y&&"object"==typeof y&&(null===(a=y.position)||void 0===a?void 0:a.startsWith("top"))&&Xe(),(Ae="function"==typeof(null==W?void 0:W.emptyText)?W.emptyText():void 0!==(null==W?void 0:W.emptyText)?W.emptyText:"No data",0===Me.length?e.jsx("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:Ae}):e.jsx("div",{className:"aha-table-mobile",children:Me.map(function(o,n){var t,r=E(o,v),i=ne.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(F,{checked:i,onChange:function(e){return Fe(o,e.target.checked)},disabled:null===(t=g.getCheckboxProps)||void 0===t?void 0:t.call(g,o).disabled})}),p.map(function(t){var r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex),i=A(o,t.dataIndex||""),a=t.render?t.render(i,o,n):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof t.title?t.title({}):t.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(Ie)}),y&&("object"!=typeof y||!(null===(l=y.position)||void 0===l?void 0:l.startsWith("top")))&&Xe(),e.jsx(L,{loading:C,spinColor:ee})]}));var Ze={position:"relative",overflowX:(null==H?void 0:H.x)||Ye?"auto":"visible",overflowY:(null==H?void 0:H.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==H?void 0:H.x)?"100%":"number"==typeof(null==H?void 0:H.x)?"".concat(H.x,"px"):void 0,maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",t({ref:Ce,className:"aha-table ".concat(Y),style:Ue,"aria-busy":!!C||void 0},$,{children:[R&&e.jsx("div",{style:{marginBottom:"16px"},children:R(Ie)}),y&&"object"==typeof y&&(null===(s=y.position)||void 0===s?void 0:s.startsWith("top"))&&Xe(),e.jsx("div",{style:Ze,children:e.jsx("div",{style:{width:"100%",minWidth:Je?"".concat(Je,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Ge,className:J,children:[He(),e.jsx("tbody",{children:qe()}),D&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(g?1:0),children:D(Ie)})})})]})})}),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(Ie)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&Xe(),e.jsx(L,{loading:C,spinColor:ee})]}))};
2
2
  //# sourceMappingURL=Table.js.map