akeyless-client-commons 1.1.25 → 1.1.26
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["c:\\work\\akeyless\\commons\\client_commons\\dist\\components\\index.mjs"],"names":[],"mappings":"0BAAA,YAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAAtC","sourcesContent":["// src/components/utils/Checkboxes.tsx\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar Checkbox = ({ id, checked, setChecked, rotate = true, style }) => {\n return /* @__PURE__ */ jsxs(\"div\", { className: \"checkbox-wrapper-51\", children: [\n /* @__PURE__ */ jsx(\"input\", { type: \"checkbox\", id, className: \"hidden\", checked, onChange: () => setChecked(!checked) }),\n /* @__PURE__ */ jsxs(\"label\", { htmlFor: id, className: \"relative block w-[42px] h-[24px] cursor-pointer transform-gpu\", children: [\n /* @__PURE__ */ jsx(\n \"div\",\n {\n className: `relative top-[1px] left-[1px] w-[40px] h-[22px] rounded-[12px] transition-colors duration-200 ease-in-out ${checked ? \"bg-[#52d66b]\" : \"bg-[#c8ccd4]\"}`\n }\n ),\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: `absolute ${rotate ? \"left-0\" : \"right-0\"} top-0 w-[24px] h-[24px] bg-white rounded-full shadow-md transition-transform duration-200 ease-in-out ${checked ? rotate ? \"translate-x-[18px]\" : \"-translate-x-[18px]\" : \"\"}`,\n children: /* @__PURE__ */ jsx(\"svg\", { width: \"10px\", height: \"10px\", viewBox: \"0 0 10 10\", className: \"m-[7px] fill-none\", children: /* @__PURE__ */ jsx(\n \"path\",\n {\n d: \"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n className: \"transition-all duration-500 linear\",\n stroke: checked ? \"#52d66b\" : \"#c8ccd4\",\n style: {\n strokeDasharray: checked ? \"25\" : \"24\",\n strokeDashoffset: checked ? \"25\" : \"0\"\n }\n }\n ) })\n }\n )\n ] })\n ] });\n};\n\n// src/components/utils/ErrorBoundary.tsx\nimport React from \"react\";\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar ErrorBoundary = class extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: null,\n errorInfo: null\n };\n }\n static getDerivedStateFromError(error) {\n return {\n hasError: true,\n error\n };\n }\n componentDidCatch(error, errorInfo) {\n console.error(\"Error:\", error);\n console.log(\"Error Info:\", errorInfo);\n this.setState({ errorInfo });\n }\n render() {\n if (this.state.hasError) {\n return this.props.fallback || /* @__PURE__ */ jsx2(\"div\", { className: \"full center\", children: /* @__PURE__ */ jsx2(\"h1\", { children: \"\\u05DE\\u05E9\\u05D4\\u05D5 \\u05D4\\u05E9\\u05EA\\u05D1\\u05E9....\" }) });\n }\n return this.props.children;\n }\n};\n\n// src/components/utils/loaders.tsx\nimport { ClipLoader } from \"react-spinners\";\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nvar Loader = ({ color, size: size3, style = {}, className = \"\" }) => {\n return /* @__PURE__ */ jsx3(\"div\", { className: `flex items-center justify-center ${className}`, style, children: /* @__PURE__ */ jsx3(ClipLoader, { loading: true, color: color || \"#699A2C\", size: size3 || 18 }) });\n};\n\n// src/lib/utils.ts\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\n\n// src/components/utils/global.tsx\nimport { jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar Version = ({ version, className = \"\" }) => {\n return /* @__PURE__ */ jsxs2(\"div\", { className: cn(\"absolute text-black z-30 bottom-[0px] text-xs right-0 px-1 \", className), children: [\n \"v\",\n version\n ] });\n};\n\n// src/components/table/components.tsx\nimport ExcelJS from \"exceljs\";\nimport { saveAs } from \"file-saver\";\nimport { memo, useMemo as useMemo6 } from \"react\";\n\n// src/assets/svg.tsx\nimport { jsx as jsx4, jsxs as jsxs3 } from \"react/jsx-runtime\";\nvar RedXSvg = ({ height, width, viewBox }) => /* @__PURE__ */ jsxs3(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"32\", height: height || \"32\", viewBox: viewBox || \"0 0 32 32\", fill: \"none\", children: [\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M21.0801 10.3C20.6101 9.80996 19.8301 9.79996 19.3401 10.27L15.6101 13.89L11.8801 10.27C11.3901 9.79996 10.6101 9.80996 10.1401 10.3C9.67008 10.79 9.68008 11.57 10.1701 12.04L13.8501 15.61L10.1701 19.18C9.68008 19.65 9.67008 20.43 10.1401 20.92C10.6101 21.41 11.3901 21.42 11.8801 20.95L15.6101 17.33L19.3401 20.95C19.5701 21.17 19.8801 21.3 20.2001 21.3C20.8801 21.29 21.4301 20.73 21.4201 20.04C21.4201 19.72 21.2901 19.41 21.0601 19.19L17.3801 15.62L21.0601 12.05C21.5501 11.58 21.5601 10.8 21.0901 10.31L21.0801 10.3Z\",\n fill: \"#FF4C2B\"\n }\n ),\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M15.61 0C6.99 0 0 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z\",\n fill: \"#FF4C2B\"\n }\n )\n] });\nvar RedXSvg2 = ({ height, width, viewBox }) => /* @__PURE__ */ jsx4(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"18px\", height: height || \"18px\", viewBox: viewBox || \"0,0,256,256\", fillRule: \"nonzero\", children: /* @__PURE__ */ jsx4(\n \"g\",\n {\n fill: \"#e90404\",\n fillRule: \"nonzero\",\n stroke: \"none\",\n strokeWidth: \"1\",\n children: /* @__PURE__ */ jsx4(\"g\", { transform: \"scale(10.66667,10.66667)\", children: /* @__PURE__ */ jsx4(\"path\", { d: \"M4.99023,3.99023c-0.40692,0.00011 -0.77321,0.24676 -0.92633,0.62377c-0.15312,0.37701 -0.06255,0.80921 0.22907,1.09303l6.29297,6.29297l-6.29297,6.29297c-0.26124,0.25082 -0.36647,0.62327 -0.27511,0.97371c0.09136,0.35044 0.36503,0.62411 0.71547,0.71547c0.35044,0.09136 0.72289,-0.01388 0.97371,-0.27511l6.29297,-6.29297l6.29297,6.29297c0.25082,0.26124 0.62327,0.36648 0.97371,0.27512c0.35044,-0.09136 0.62411,-0.36503 0.71547,-0.71547c0.09136,-0.35044 -0.01388,-0.72289 -0.27512,-0.97371l-6.29297,-6.29297l6.29297,-6.29297c0.29576,-0.28749 0.38469,-0.72707 0.22393,-1.10691c-0.16075,-0.37985 -0.53821,-0.62204 -0.9505,-0.60988c-0.2598,0.00774 -0.50638,0.11632 -0.6875,0.30273l-6.29297,6.29297l-6.29297,-6.29297c-0.18827,-0.19353 -0.4468,-0.30272 -0.7168,-0.30273z\" }) })\n }\n) });\nvar GreenVSvg = ({ height, width, viewBox }) => /* @__PURE__ */ jsxs3(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"32\", height: height || \"32\", viewBox: viewBox || \"0 0 32 32\", fill: \"none\", children: [\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M15.61 0C6.99 0 0.01 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z\",\n fill: \"#3B8F08\"\n }\n ),\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M21.66 10.15L13.37 18.44L9.58003 14.54C9.10003 14.06 8.32003 14.07 7.84003 14.54C7.38003 15.01 7.36003 15.76 7.82003 16.24L12.48 21.03C12.96 21.52 13.74 21.52 14.23 21.05L23.41 11.87C23.88 11.38 23.87 10.6 23.38 10.13C22.9 9.67003 22.15 9.67003 21.68 10.13L21.66 10.15Z\",\n fill: \"#3B8F08\"\n }\n )\n] });\n\n// src/assets/table.tsx\nimport { Fragment, jsx as jsx5, jsxs as jsxs4 } from \"react/jsx-runtime\";\nvar sortSvg = (upside_down) => {\n return /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n style: upside_down ? { transform: \"rotate(180deg)\" } : {},\n className: \"absolute top-[3px] left-1\",\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 1536.000000 1536.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,1536.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M6465 15350 c3 -5 -27 -25 -68 -44 -40 -19 -103 -57 -140 -86 -37 -28 -584 -569 -1215 -1203 -631 -633 -1699 -1705 -2374 -2382 -674 -676 -1237 -1243 -1249 -1260 -13 -16 -37 -46 -53 -65 -36 -41 -108 -185 -126 -250 -32 -119 -30 -352 3 -465 35 -120 102 -231 197 -325 132 -133 288 -208 479 -231 214 -26 418 31 596 166 39 29 703 685 1477 1458 774 772 1432 1421 1461 1441 105 73 239 71 347 -3 52 -36 70 -57 107 -131 17 -33 18 -252 24 -4710 6 -4979 3 -4715 49 -4855 118 -363 507 -605 876 -545 77 13 201 53 245 79 19 12 45 26 59 31 41 18 157 119 206 179 43 53 113 173 127 217 3 11 16 51 29 89 l22 70 6 4690 c5 4887 4 4736 43 4784 6 7 16 23 22 34 20 42 116 103 188 120 42 10 75 13 85 8 10 -5 34 -11 55 -15 20 -4 59 -21 85 -38 26 -17 686 -671 1467 -1453 781 -782 1443 -1439 1470 -1459 68 -49 178 -106 245 -128 30 -10 100 -24 155 -32 87 -12 114 -12 200 1 128 18 187 39 360 131 37 19 178 162 211 212 36 56 94 176 94 194 0 7 7 31 16 52 23 55 23 352 0 406 -9 21 -16 46 -16 56 0 30 -83 185 -130 242 -80 98 -4793 4810 -4865 4865 -66 50 -182 111 -250 132 -16 5 -29 15 -27 21 1 9 -62 12 -249 12 -157 0 -248 -4 -244 -10z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n );\n};\nvar emptyFilterSvg = (solid) => {\n return /* @__PURE__ */ jsx5(Fragment, { children: solid ? /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M382 8980 c-7 -11 -19 -20 -27 -20 -46 0 -166 -99 -196 -162 -46 -95 -51 -115 -47 -199 3 -70 9 -95 37 -149 42 -85 45 -90 118 -190 34 -47 72 -98 83 -115 12 -16 50 -70 85 -120 143 -200 188 -263 235 -330 27 -38 56 -79 64 -90 8 -11 46 -65 85 -120 38 -55 96 -136 128 -179 32 -44 60 -84 62 -90 2 -6 32 -48 65 -93 34 -45 99 -137 146 -203 47 -66 113 -159 148 -205 34 -46 62 -87 62 -90 0 -4 20 -33 45 -65 25 -32 45 -61 45 -64 0 -3 33 -50 73 -105 39 -54 106 -146 147 -205 41 -58 103 -144 138 -191 34 -46 62 -87 62 -90 0 -3 22 -36 50 -73 27 -37 61 -83 75 -102 14 -19 59 -82 100 -140 41 -58 95 -133 120 -167 25 -34 45 -66 45 -70 0 -4 13 -22 28 -40 15 -17 47 -61 72 -97 25 -37 74 -107 110 -156 36 -50 99 -138 140 -196 41 -58 108 -150 148 -205 39 -54 72 -102 72 -105 0 -3 20 -32 45 -64 25 -32 45 -62 45 -67 0 -5 14 -22 30 -38 17 -16 30 -33 30 -38 0 -5 19 -34 43 -65 90 -122 154 -259 178 -387 11 -56 14 -423 19 -1850 l5 -1780 29 -58 c36 -71 112 -148 168 -171 24 -10 51 -22 60 -27 24 -12 205 -11 213 1 3 6 15 10 25 10 11 0 34 6 52 14 18 8 52 21 76 30 64 24 118 44 165 62 23 8 55 22 70 30 16 8 36 14 46 14 9 0 26 7 37 15 10 8 27 15 37 15 11 0 31 6 45 14 15 8 47 22 72 31 25 9 60 23 78 31 18 8 39 14 47 14 7 0 26 6 42 14 15 8 48 22 73 31 25 10 57 23 72 31 14 8 35 14 45 14 11 0 28 7 39 15 10 8 26 15 35 15 14 0 62 19 197 76 18 8 40 14 48 14 9 0 28 6 42 14 28 15 36 18 235 92 23 9 56 22 72 29 17 7 50 21 75 31 84 34 127 77 181 182 9 18 20 56 24 85 4 28 10 714 14 1522 6 1402 7 1472 25 1520 41 109 110 235 188 344 46 62 88 121 93 130 6 9 30 45 55 80 72 101 159 222 250 351 47 67 113 159 148 205 34 46 62 87 62 90 0 4 27 42 60 85 33 43 60 81 60 84 0 3 22 36 50 73 27 37 60 83 72 101 13 18 30 41 38 52 8 10 35 49 60 85 25 37 73 104 108 150 34 46 62 87 62 90 0 3 33 50 73 103 40 53 81 111 91 127 11 17 45 65 78 107 32 43 58 80 58 83 0 4 20 33 45 65 25 32 45 63 45 70 0 6 7 13 15 16 8 4 15 10 15 16 0 5 26 44 58 86 32 42 70 95 85 117 64 95 144 206 208 292 38 51 69 95 69 99 0 3 13 23 29 43 26 33 92 126 193 271 21 30 48 68 60 85 85 112 108 144 108 150 0 3 27 42 60 85 33 43 60 81 60 85 0 3 28 44 63 90 34 47 82 114 107 151 25 36 50 71 56 77 5 7 32 44 58 82 27 39 62 86 77 106 16 20 29 42 29 48 0 6 4 11 8 11 5 0 25 32 45 71 36 68 37 75 37 175 0 118 -13 163 -69 234 -37 48 -127 112 -173 124 -16 3 -28 13 -28 21 0 13 -486 15 -4103 15 -4091 0 -4102 0 -4115 -20z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) : /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 300.000000 300.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,300.000000) scale(0.050000,-0.050000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M58 5702 c-100 -101 -84 -148 136 -416 107 -130 242 -294 301 -366 58 -71 173 -211 254 -310 81 -99 441 -535 799 -969 l652 -789 0 -1201 c0 -1396 2 -1411 182 -1411 60 0 1302 604 1360 662 36 36 38 79 38 935 0 494 5 925 12 959 8 41 370 495 1110 1393 1202 1459 1158 1394 1040 1513 l-59 58 -2883 0 -2883 0 -59 -58z m5349 -327 c-16 -26 -150 -190 -683 -835 -169 -203 -381 -460 -472 -570 -90 -110 -290 -352 -443 -537 -154 -186 -301 -369 -329 -408 l-50 -70 -6 -913 -5 -913 -410 -205 c-225 -112 -413 -204 -418 -204 -6 0 -12 503 -15 1117 l-6 1118 -50 70 c-27 39 -175 222 -329 408 -153 185 -353 427 -443 537 -91 110 -303 367 -472 570 -533 645 -667 809 -683 835 -12 20 474 25 2407 25 1933 0 2419 -5 2407 -25z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) });\n};\nvar slashFilterSvg = (solid) => {\n return /* @__PURE__ */ jsx5(Fragment, { children: solid ? /* @__PURE__ */ jsx5(\"div\", { className: \"mt-[-4px] mr-[-2px] \", children: /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 186 0 14 -3600 3624 -3614 3624 -3 0 -6 -6 -6 -12z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) }) : /* @__PURE__ */ jsx5(\"div\", { className: \"mt-[-4px] mr-[-2px] \", children: /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z m5494 -1490 c6 -10 -1204 -2436 -1226 -2458 -13 -13 -168 139 -1247 1217 -677 677 -1231 1236 -1231 1241 0 12 3697 12 3704 0z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 185 0 18 -692 715 -709 715 -6 0 -11 -38 -13 -97 l-3 -98 -745 0 -745 0 -3 858 -2 859 -694 694 c-382 382 -697 694 -700 694 -3 0 -6 -6 -6 -12z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) }) });\n};\nvar exportToExcelSvg = (width, height, viewBox) => {\n return /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: width || \"18\",\n height: height || \"18\",\n viewBox: viewBox || \"0 0 150.000000 150.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,150.000000) scale(0.100000,-0.100000)\", fill: \"#ffffff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M205 1418 c-3 -7 -4 -317 -3 -688 l3 -675 435 -3 c239 -1 441 0 449 3 11 4 9 11 -9 30 l-23 25 -396 2 -396 3 0 625 0 625 280 0 280 0 5 -190 5 -190 190 -5 190 -5 5 -175 5 -175 25 0 25 0 3 200 2 199 -202 203 -203 203 -333 0 c-257 0 -334 -3 -337 -12z m828 -235 c70 -70 127 -131 127 -135 0 -5 -60 -7 -132 -6 l-133 3 -3 133 c-1 72 1 132 6 132 4 0 65 -57 135 -127z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M518 915 c-6 -6 9 -37 42 -90 11 -16 23 -37 27 -45 4 -8 19 -36 35 -61 15 -25 28 -56 28 -68 0 -20 -29 -69 -121 -209 -16 -24 -29 -47 -29 -53 0 -5 31 -9 68 -9 l69 0 42 82 c60 116 66 118 107 35 56 -114 53 -112 127 -115 51 -2 67 0 67 11 0 7 -5 18 -11 24 -11 11 -26 36 -49 78 -6 11 -19 34 -30 50 -11 17 -24 40 -29 52 -5 11 -15 24 -20 28 -26 16 -18 33 97 212 25 39 39 70 34 75 -5 5 -36 8 -68 6 l-59 -3 -42 -84 c-24 -46 -45 -86 -48 -89 -6 -6 -44 40 -45 54 0 6 -13 35 -29 65 l-28 54 -65 3 c-35 2 -67 0 -70 -3z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M1135 548 c-3 -7 -6 -67 -7 -133 l-3 -120 -55 -3 c-30 -1 -61 -5 -68 -7 -8 -3 28 -53 95 -132 122 -146 129 -153 140 -153 4 0 22 17 38 37 26 32 53 63 175 206 13 15 30 27 38 27 9 0 12 3 8 7 -3 4 -39 9 -79 12 l-72 6 -5 130 -5 130 -98 3 c-72 2 -99 -1 -102 -10z m145 -183 l5 -130 28 -3 c15 -2 27 -8 27 -14 0 -18 -92 -128 -107 -128 -11 1 -97 107 -101 125 -2 8 7 15 25 17 l28 3 3 120 c1 66 4 126 7 133 3 9 18 12 42 10 l38 -3 5 -130z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n );\n};\n\n// src/components/table/hooks.tsx\nimport { useContext as useContext2, useDeferredValue, useState as useState2, useTransition } from \"react\";\nimport { create } from \"zustand\";\nimport { isEqual as isEqual2 } from \"lodash\";\n\n// src/components/table/Table.tsx\nimport React2, { createContext, useMemo } from \"react\";\nimport { isEqual } from \"lodash\";\n\n// src/helpers/forms.ts\nimport XRegExp from \"xregexp\";\nvar textRegex = XRegExp(\"[^\\\\p{L}\\\\s-]\", \"gu\");\nvar numbersRegex = XRegExp(\"[^0-9\\\\s-+]\", \"g\");\nvar numbersOnlyRegex = XRegExp(\"[^0-9]\", \"g\");\nvar priceRegex = XRegExp(\"[^0-9.]\", \"g\");\nvar emailRegex = XRegExp(\"[^\\\\p{L}0-9.@\\\\s-]\", \"gu\");\nvar colorRegex = XRegExp(\"[^#0-9A-Fa-f]\", \"g\");\nvar carsRegex = XRegExp(\"[^\\\\p{L}0-9,_]\", \"gu\");\nvar textNumbersRegex = XRegExp(\"[^\\\\p{L}0-9\\\\s+\\\\-]\", \"gu\");\nvar addressRegex = XRegExp(\"[^\\\\p{L}0-9\\\\s.,+-\\\\-]\", \"gu\");\nvar chartsRegex = XRegExp(\"[^\\\\p{L}0-9\\\\s.,_@!+-\\\\-]\", \"gu\");\nvar handleChange = (e) => {\n e.target.setCustomValidity(\"\");\n const validation = e.target.getAttribute(\"data-validation\");\n if (validation === \"text\") {\n e.target.value = XRegExp.replace(e.target.value, textRegex, \"\");\n } else if (validation === \"numbers\") {\n e.target.value = XRegExp.replace(e.target.value, numbersRegex, \"\");\n } else if (validation === \"numbersOnly\") {\n e.target.value = XRegExp.replace(e.target.value, numbersOnlyRegex, \"\");\n } else if (validation === \"price\") {\n e.target.value = XRegExp.replace(e.target.value, priceRegex, \"\");\n } else if (validation === \"textNumbers\") {\n e.target.value = XRegExp.replace(e.target.value, textNumbersRegex, \"\");\n } else if (validation === \"email\") {\n e.target.value = XRegExp.replace(e.target.value, emailRegex, \"\");\n } else if (validation === \"color\") {\n e.target.value = XRegExp.replace(e.target.value, colorRegex, \"\");\n } else if (validation === \"address\") {\n e.target.value = XRegExp.replace(e.target.value, addressRegex, \"\");\n } else if (validation === \"cars\") {\n e.target.value = XRegExp.replace(e.target.value, carsRegex, \"\");\n } else if (validation === \"charts\") {\n e.target.value = XRegExp.replace(e.target.value, chartsRegex, \"\");\n }\n};\nvar handlePaste = (e) => {\n const validation = e.currentTarget.getAttribute(\"data-validation\");\n let pasteData = e.clipboardData.getData(\"text\");\n if (validation === \"text\") {\n pasteData = XRegExp.replace(pasteData, textRegex, \"\");\n } else if (validation === \"numbers\") {\n pasteData = XRegExp.replace(pasteData, numbersRegex, \"\");\n } else if (validation === \"numbersOnly\") {\n pasteData = XRegExp.replace(pasteData, numbersOnlyRegex, \"\");\n } else if (validation === \"price\") {\n pasteData = XRegExp.replace(pasteData, priceRegex, \"\");\n } else if (validation === \"textNumbers\") {\n pasteData = XRegExp.replace(pasteData, textNumbersRegex, \"\");\n } else if (validation === \"email\") {\n pasteData = XRegExp.replace(pasteData, emailRegex, \"\");\n } else if (validation === \"color\") {\n pasteData = XRegExp.replace(pasteData, colorRegex, \"\");\n } else if (validation === \"address\") {\n pasteData = XRegExp.replace(pasteData, addressRegex, \"\");\n } else if (validation === \"cars\") {\n pasteData = XRegExp.replace(pasteData, carsRegex, \"\");\n } else if (validation === \"charts\") {\n pasteData = XRegExp.replace(pasteData, chartsRegex, \"\");\n }\n e.preventDefault();\n document.execCommand(\"insertText\", false, pasteData);\n};\nvar handleInvalid = (e, requireError) => {\n e.target.setCustomValidity(requireError || \"This filed is required !\");\n};\nvar useValidation = (validationType, requireError) => {\n return {\n onChange: handleChange,\n onPaste: handlePaste,\n onInvalid: (e) => handleInvalid(e, requireError),\n \"data-validation\": validationType\n };\n};\nvar getFormElementValue = (form, name) => {\n return form.elements.namedItem(name)?.value || \"\";\n};\n\n// src/components/table/Table.tsx\nimport { jsx as jsx6, jsxs as jsxs5 } from \"react/jsx-runtime\";\nvar TableContext = createContext(null);\nvar TableProvider = (props) => {\n const {\n // basic props\n data,\n headers,\n optionalElement,\n keysToRender = [],\n direction = \"ltr\",\n onRowClick = (data2) => {\n },\n // container styles props\n containerStyle,\n containerClassName = \"\",\n tableContainerClass = \"\",\n tableContainerStyle = {},\n tableStyle = {},\n // row style\n rowStyles = {},\n rowClassName,\n // cell style\n cellClassName,\n cellStyle = {},\n // header styles\n headerStyle = {},\n headerCellStyle,\n searchInputStyle = {},\n // search\n searchInputClassName = \"\",\n includeSearch,\n searchPlaceHolder,\n // sort\n sortKeys,\n sortLabel = \"Sort by\",\n // filter\n filterableColumns = [],\n filterLabel = \"Filter by\",\n // export to excel\n exportToExcelKeys,\n dataToAddToExcelTable,\n exportExcelTitle = \"Export to excel\",\n excelFileName,\n // summary\n sumColumns,\n summaryLabel = \"\",\n summaryContainerStyle = {},\n summaryLabelStyle = {},\n summaryRowStyle = {},\n // max rows\n maxRows = data.length\n } = props;\n const { sortColumn, sortOrder, handleSort, clearSort } = useSort();\n const { searchQuery, handleSearch, clearSearch, deferredSearchQuery } = useSearch();\n const { filters, filterPopupsDisplay, filterOptions, handleFilterChange, handleFilterClick, closeFilterWindow, clearFilter } = useFilter({\n data,\n filterableColumns\n });\n const allKeys = useMemo(() => {\n return Array.from(\n data.reduce((keys, obj) => {\n Object.keys(obj).forEach((key) => keys.add(key));\n return keys;\n }, /* @__PURE__ */ new Set())\n );\n }, [data]);\n const dataToRender = useMemo(() => {\n let filtered = data;\n if (includeSearch && deferredSearchQuery.length > 0) {\n const cleanString = (str) => str.replace(textNumbersRegex, \"\").toLowerCase().trim();\n const normalizedSearchQuery = cleanString(deferredSearchQuery);\n filtered = data.filter(\n (item) => allKeys.some((key) => {\n return cleanString(String(item[key])).includes(normalizedSearchQuery);\n })\n );\n }\n if (filterableColumns.length > 0 && filterPopupsDisplay !== \"\") {\n console.log(\"filtering ...\");\n Object.keys(filters).forEach((key) => {\n if (filters[key].length > 0) {\n filtered = filtered.filter((item) => filters[key].includes(item[key]));\n }\n });\n }\n if (sortColumn !== null && sortOrder !== null && sortKeys?.length > 0) {\n console.log(\"sorting ...\");\n filtered = filtered.sort((a, b) => {\n const aValue = a[sortKeys[sortColumn]];\n const bValue = b[sortKeys[sortColumn]];\n if (aValue < bValue) return sortOrder === \"asc\" ? -1 : 1;\n if (aValue > bValue) return sortOrder === \"asc\" ? 1 : -1;\n return 0;\n });\n }\n const renderedData = filtered.length > maxRows ? filtered.slice(0, maxRows) : filtered;\n return { renderedData, filtered };\n }, [deferredSearchQuery, sortColumn, sortOrder, filters, data]);\n const providerValues = {\n ...props,\n // props with default values\n direction,\n keysToRender,\n filterableColumns,\n maxRows,\n // states and functions\n sortColumn,\n sortOrder,\n handleSort,\n searchQuery,\n deferredSearchQuery,\n handleSearch,\n dataToRender,\n filters,\n filterPopupsDisplay,\n filterOptions,\n handleFilterChange,\n handleFilterClick,\n closeFilterWindow\n };\n return /* @__PURE__ */ jsx6(TableContext.Provider, { value: providerValues, children: /* @__PURE__ */ jsx6(\"div\", { className: `flex flex-col gap-2 ${containerClassName}`, style: { ...containerStyle, direction }, children: props.children }) });\n};\nvar TableBase = (props) => {\n const {\n containerHeaderClassName,\n optionalElement,\n tableContainerClass,\n tableContainerStyle,\n tableStyle,\n includeSearch,\n exportToExcelKeys,\n sumColumns,\n direction,\n maxRowsLabel1,\n maxRowsLabel2,\n searchContainerClassName\n } = props;\n return /* @__PURE__ */ jsxs5(TableProvider, { ...props, children: [\n /* @__PURE__ */ jsxs5(\"div\", { style: { direction }, className: cn(\"flex justify-start items-center gap-2\", containerHeaderClassName || \"\"), children: [\n /* @__PURE__ */ jsxs5(\"div\", { className: cn(\"flex justify-start items-center gap-2\", searchContainerClassName), children: [\n includeSearch && /* @__PURE__ */ jsx6(Search, {}),\n exportToExcelKeys && /* @__PURE__ */ jsx6(ExportToExcel, {})\n ] }),\n maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */ jsx6(MaxRowsLabel, {}),\n optionalElement && optionalElement\n ] }),\n /* @__PURE__ */ jsx6(\n \"div\",\n {\n style: { ...tableContainerStyle || {}, direction },\n className: cn(`animate-slide-in-up overflow-y-auto`, tableContainerClass || \"\"),\n children: /* @__PURE__ */ jsxs5(\"table\", { style: tableStyle, className: \"min-w-full text-sm font-light relative\", children: [\n /* @__PURE__ */ jsx6(TableHead, {}),\n /* @__PURE__ */ jsx6(TableBody, {})\n ] })\n }\n ),\n sumColumns && /* @__PURE__ */ jsx6(Summary, {})\n ] });\n};\nvar areEqual = (prevProps, nextProps) => isEqual(prevProps, nextProps);\nvar Table = React2.memo(TableBase, areEqual);\nTable.displayName = \"Table\";\n\n// src/components/table/hooks.tsx\nvar useTableContext = () => {\n const context = useContext2(TableContext);\n if (!context) {\n throw new Error(\"useTableContext must be used within a Table component\");\n }\n return context;\n};\nvar useFilter = ({ data, filterableColumns }) => {\n const initFilter = filterableColumns.reduce((acc, col) => ({ ...acc, [col.dataKey]: [] }), {});\n const [filters, setFilters] = useState2(initFilter);\n const [filterPopupsDisplay, setFilterPopupsDisplay] = useState2(\"\");\n const filterOptions = filterableColumns.reduce((acc, col) => {\n acc[col.dataKey] = Array.from(new Set(data.map((item) => item[col.dataKey])));\n return acc;\n }, {});\n const handleFilterChange = (dataKey, value) => {\n const newFilters = { ...filters };\n if (newFilters[dataKey].includes(value)) {\n newFilters[dataKey] = newFilters[dataKey].filter((item) => item !== value);\n } else {\n newFilters[dataKey].push(value);\n }\n setFilters(newFilters);\n };\n const clearFilter = () => {\n if (!isEqual2(filters, initFilter)) {\n setFilters(initFilter);\n }\n };\n const handleFilterClick = (dataKey) => {\n setFilterPopupsDisplay((prev) => {\n if (prev === dataKey) {\n setFilters(initFilter);\n return \"\";\n }\n return dataKey;\n });\n };\n const closeFilterWindow = () => {\n setFilterPopupsDisplay(\"\");\n };\n return {\n filters,\n filterPopupsDisplay,\n filterOptions,\n handleFilterChange,\n handleFilterClick,\n closeFilterWindow,\n clearFilter\n };\n};\nvar useSort = () => {\n const [sortColumn, setSortColumn] = useState2(null);\n const [sortOrder, setSortOrder] = useState2(null);\n const handleSort = (columnIndex) => {\n let newSortOrder = \"asc\";\n if (sortColumn === columnIndex && sortOrder === \"asc\") {\n newSortOrder = \"desc\";\n }\n setSortColumn(columnIndex);\n setSortOrder(newSortOrder);\n };\n const clearSort = () => {\n if (sortColumn) {\n setSortColumn(null);\n }\n if (sortOrder) {\n setSortOrder(null);\n }\n };\n return { sortColumn, sortOrder, handleSort, clearSort };\n};\nvar useSearch = () => {\n const [searchQuery, setSearchQuery] = useState2(\"\");\n const [isPending, startTransition] = useTransition();\n const deferredSearchQuery = useDeferredValue(searchQuery);\n const handleSearch = (e) => {\n const value = e.target.value;\n startTransition(() => {\n setSearchQuery(value);\n });\n };\n const clearSearch = () => {\n if (searchQuery) {\n startTransition(() => {\n setSearchQuery(\"\");\n });\n }\n };\n return { searchQuery, handleSearch, clearSearch, isPending, deferredSearchQuery };\n};\n\n// src/helpers/firebase.ts\nimport moment from \"moment\";\nimport { initializeApp } from \"firebase/app\";\nimport { getStorage } from \"firebase/storage\";\nimport { getAuth } from \"firebase/auth\";\nimport {\n addDoc,\n collection,\n deleteDoc,\n doc,\n getDoc,\n getDocs,\n query,\n setDoc,\n Timestamp,\n where,\n getFirestore,\n onSnapshot,\n orderBy\n} from \"firebase/firestore\";\nvar initApp = () => {\n const isNodeEnv2 = typeof process !== \"undefined\" && process.env;\n const firebaseConfig = {\n apiKey: isNodeEnv2 ? process.env.NEXT_PUBLIC_API_KEY : import.meta.env.VITE_API_KEY,\n authDomain: isNodeEnv2 ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import.meta.env.VITE_AUTH_DOMAIN,\n projectId: isNodeEnv2 ? process.env.NEXT_PUBLIC_PROJECT_ID : import.meta.env.VITE_PROJECT_ID,\n storageBucket: isNodeEnv2 ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import.meta.env.VITE_STORAGE_BUCKET,\n messagingSenderId: isNodeEnv2 ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import.meta.env.VITE_MESSAGING_SENDER_ID,\n appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID\n };\n try {\n const app = initializeApp(firebaseConfig);\n const auth2 = getAuth(app);\n const db2 = getFirestore(app);\n const storage2 = getStorage(app);\n return { db: db2, auth: auth2, storage: storage2 };\n } catch (error) {\n console.error(\"Failed to initialize Firebase app:\", error);\n return {};\n }\n};\nvar { db, auth, storage } = initApp();\nvar collections = {\n clients: collection(db, \"nx-clients\"),\n sites: collection(db, \"nx-sites\"),\n cars: collection(db, \"units\"),\n users: collection(db, \"nx-users\"),\n lastLocations: collection(db, \"last_locations\"),\n ermEvents: collection(db, \"erm_events_general\"),\n erm2Events: collection(db, \"erm2_events_general\"),\n ruptelaEvents: collection(db, \"ruptela_events_general\"),\n polygons: collection(db, \"nx-polygons\"),\n polygonEvents: collection(db, \"polygon_events\"),\n polygonCars: collection(db, \"polygon_cars\"),\n canbus: collection(db, \"erm_canbus_parameters\"),\n states: collection(db, \"erm_states\"),\n app_pro_commands_queue: collection(db, \"app_pro_commands_queue\"),\n trips: collection(db, \"erm2_trip\"),\n tripsDetails: collection(db, \"erm2_trip_details\"),\n audit: collection(db, \"nx-audit\"),\n nx_settings: collection(db, \"nx-settings\"),\n settings: collection(db, \"settings\"),\n translations: collection(db, \"nx-translations\"),\n nx_cars: collection(db, \"nx-cars\"),\n boards: collection(db, \"boards\"),\n protection_types: collection(db, \"protectionTypes\"),\n board_types: collection(db, \"boardTypes\"),\n charge_capacities: collection(db, \"nx-charge-capacities\")\n};\nvar fire_base_TIME_TEMP = Timestamp.now;\n\n// src/helpers/global.ts\nimport { CountryOptions } from \"akeyless-types-commons\";\nimport axios from \"axios\";\n\n// src/helpers/phoneNumber.ts\nimport { parsePhoneNumberFromString } from \"libphonenumber-js\";\n\n// src/helpers/global.ts\nimport { isEqual as isEqual3 } from \"lodash\";\nvar renderOnce = () => {\n return true;\n};\nvar getLocationUrl = (lang, lat) => {\n return `https://www.google.com/maps?q=${lang},${lat}`;\n};\nvar isNodeEnv = typeof process !== \"undefined\" && process.env;\nvar { mode, isLocal } = {\n mode: isNodeEnv ? process.env.NEXT_PUBLIC_MODE : import.meta.env.VITE_MODE,\n isLocal: (isNodeEnv ? process.env.NEXT_PUBLIC_IS_LOCAL : import.meta.env.VITE_is_local) === \"true\"\n};\n\n// src/helpers/time_helpers.ts\nimport { Timestamp as Timestamp2 } from \"firebase/firestore\";\nimport moment2 from \"moment-timezone\";\nfunction timestamp_to_string(firebaseTimestamp, options) {\n let date;\n if (firebaseTimestamp instanceof Timestamp2) {\n date = firebaseTimestamp.toDate();\n } else if (firebaseTimestamp instanceof Date) {\n date = firebaseTimestamp;\n } else if (typeof firebaseTimestamp === \"string\") {\n date = moment2.utc(firebaseTimestamp, options?.fromFormat || \"DD/MM/YYYY HH:mm:ss\").toDate();\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date string format\");\n }\n } else {\n throw new Error(\"Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.\");\n }\n if (options?.tz) {\n const result = moment2(date).tz(options?.tz).format(options?.format || \"DD/MM/YYYY HH:mm:ss\");\n return result;\n }\n return moment2.utc(date).format(options?.format || \"DD/MM/YYYY HH:mm:ss\");\n}\n\n// src/helpers/api.ts\nimport axios2 from \"axios\";\nvar baseDomain = mode === \"qa\" ? \"https://nx-api.xyz/api\" : \"https://nx-api.info/api\";\nvar devicesDomain = isLocal ? \"http://localhost:9001/api/devices\" : baseDomain + \"/devices\";\nvar biDomain = isLocal ? \"http://localhost:9002/api/bi\" : baseDomain + \"/bi\";\nvar callCenterDomain = isLocal ? \"http://localhost:9003/api/call-center\" : baseDomain + \"/call-center\";\n\n// src/components/ui/badge.tsx\nimport { cva } from \"class-variance-authority\";\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n outline: \"text-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ jsx7(\"div\", { className: cn(badgeVariants({ variant }), className), ...props });\n}\n\n// src/components/ui/button.tsx\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva as cva2 } from \"class-variance-authority\";\nimport * as React3 from \"react\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar buttonVariants = cva2(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive: \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40\",\n outline: \"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"size-9\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Button = React3.forwardRef(\n ({ className, variant, size: size3, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return /* @__PURE__ */ jsx8(Comp, { ref, \"data-slot\": \"button\", className: cn(buttonVariants({ variant, size: size3, className })), ...props });\n }\n);\nButton.displayName = \"Button\";\n\n// src/components/ui/input.tsx\nimport * as React4 from \"react\";\nimport { jsx as jsx9 } from \"react/jsx-runtime\";\nvar Input = React4.forwardRef(\n ({ className, type, ...props }, ref) => {\n return /* @__PURE__ */ jsx9(\n \"input\",\n {\n type,\n className: cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n ),\n ref,\n ...props\n }\n );\n }\n);\nInput.displayName = \"Input\";\n\n// src/components/ui/progress.tsx\nimport * as React5 from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { jsx as jsx10 } from \"react/jsx-runtime\";\nvar ProgressComponent = React5.forwardRef(\n ({ className, value, containerClassName, indicatorClassName, showValueClassName, showValue = false, ...props }, ref) => /* @__PURE__ */ jsx10(\"div\", { className: cn(\"relative w-full\", containerClassName), children: /* @__PURE__ */ jsx10(ProgressPrimitive.Root, { ref, className: cn(\"w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full\", className), ...props, children: /* @__PURE__ */ jsx10(\n ProgressPrimitive.Indicator,\n {\n className: cn(\"h-full w-full flex-1 bg-[green] transition-all rounded-full\", indicatorClassName),\n style: { transform: `translateX(-${100 - (value || 0)}%)` },\n children: showValue && /* @__PURE__ */ jsx10(\"div\", { className: cn(\"absolute right-1 top-[-2px] font-medium text-white\", showValueClassName), children: `${value || 0}%` })\n }\n ) }) })\n);\nProgressComponent.displayName = ProgressPrimitive.Root.displayName;\n\n// src/components/ui/multiselect.tsx\nimport ReactDOM2 from \"react-dom\";\nimport { Command as CommandPrimitive2, useCommandState } from \"cmdk\";\nimport { X as X2 } from \"lucide-react\";\nimport * as React9 from \"react\";\nimport { forwardRef as forwardRef6, useEffect as useEffect4, useCallback as useCallback2, useMemo as useMemo4, useRef as useRef3 } from \"react\";\n\n// src/components/ui/command.tsx\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search as Search2 } from \"lucide-react\";\nimport * as React7 from \"react\";\n\n// src/components/ui/dialog.tsx\nimport * as React6 from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport { jsx as jsx11, jsxs as jsxs6 } from \"react/jsx-runtime\";\nvar DialogPortal = DialogPrimitive.Portal;\nvar DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(\n DialogPrimitive.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props\n }\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nvar DialogContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(DialogPortal, { children: [\n /* @__PURE__ */ jsx11(DialogOverlay, {}),\n /* @__PURE__ */ jsxs6(\n DialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsxs6(DialogPrimitive.Close, { className: \"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\", children: [\n /* @__PURE__ */ jsx11(X, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx11(\"span\", { className: \"sr-only\", children: \"Close\" })\n ] })\n ]\n }\n )\n] }));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nvar DialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx11(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className\n ),\n ...props\n }\n);\nDialogHeader.displayName = \"DialogHeader\";\nvar DialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx11(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nDialogFooter.displayName = \"DialogFooter\";\nvar DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(\n DialogPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className\n ),\n ...props\n }\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nvar DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(\n DialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n// src/components/ui/command.tsx\nimport { jsx as jsx12, jsxs as jsxs7 } from \"react/jsx-runtime\";\nvar Command = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(\n CommandPrimitive,\n {\n ref,\n className: cn(\"flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground\", className),\n ...props\n }\n )\n);\nCommand.displayName = CommandPrimitive.displayName;\nvar CommandInput = React7.forwardRef(({ className, withSearchIcon, ...props }, ref) => /* @__PURE__ */ jsxs7(\"div\", { className: \"flex items-center border-b border-input px-3\", \"cmdk-input-wrapper\": \"\", children: [\n withSearchIcon && /* @__PURE__ */ jsx12(Search2, { size: 20, strokeWidth: 2, className: \"me-3 text-muted-foreground/80\" }),\n /* @__PURE__ */ jsx12(\n CommandPrimitive.Input,\n {\n ref,\n className: cn(\n \"flex h-10 w-full rounded-lg bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props\n }\n )\n] }));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\nvar CommandList = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(CommandPrimitive.List, { ref, className: cn(\"max-h-80 overflow-y-auto overflow-x-hidden\", className), ...props })\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\nvar CommandEmpty = React7.forwardRef(\n (props, ref) => /* @__PURE__ */ jsx12(CommandPrimitive.Empty, { ref, className: \"py-6 text-center text-sm\", ...props })\n);\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nvar CommandGroup = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(\n CommandPrimitive.Group,\n {\n ref,\n className: cn(\n \"overflow-hidden p-2 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n ),\n ...props\n }\n )\n);\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nvar CommandSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(CommandPrimitive.Separator, { ref, className: cn(\"-mx-1 h-px bg-border\", className), ...props }));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nvar CommandItem = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(\n CommandPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n ),\n ...props\n }\n )\n);\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nvar CommandShortcut = ({ className, ...props }) => {\n return /* @__PURE__ */ jsx12(\n \"kbd\",\n {\n className: cn(\n \"-me-1 ms-auto inline-flex h-5 max-h-full items-center rounded border border-border bg-background px-1 font-[inherit] text-[0.625rem] font-medium text-muted-foreground/70\",\n className\n ),\n ...props\n }\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n// src/components/ui/multiselect.tsx\nimport { isEqual as isEqual4 } from \"lodash\";\n\n// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs\nvar min = Math.min;\nvar max = Math.max;\nvar round = Math.round;\nvar floor = Math.floor;\nvar createCoords = (v) => ({\n x: v,\n y: v\n});\nvar oppositeSideMap = {\n left: \"right\",\n right: \"left\",\n bottom: \"top\",\n top: \"bottom\"\n};\nvar oppositeAlignmentMap = {\n start: \"end\",\n end: \"start\"\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === \"function\" ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split(\"-\")[0];\n}\nfunction getAlignment(placement) {\n return placement.split(\"-\")[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === \"x\" ? \"y\" : \"x\";\n}\nfunction getAxisLength(axis) {\n return axis === \"y\" ? \"height\" : \"width\";\n}\nfunction getSideAxis(placement) {\n return [\"top\", \"bottom\"].includes(getSide(placement)) ? \"y\" : \"x\";\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === \"x\" ? alignment === (rtl ? \"end\" : \"start\") ? \"right\" : \"left\" : alignment === \"start\" ? \"bottom\" : \"top\";\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = [\"left\", \"right\"];\n const rl = [\"right\", \"left\"];\n const tb = [\"top\", \"bottom\"];\n const bt = [\"bottom\", \"top\"];\n switch (side) {\n case \"top\":\n case \"bottom\":\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case \"left\":\n case \"right\":\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === \"start\", rtl);\n if (alignment) {\n list = list.map((side) => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== \"number\" ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\n// node_modules/@floating-ui/core/dist/floating-ui.core.mjs\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === \"y\";\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case \"top\":\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case \"bottom\":\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case \"right\":\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case \"left\":\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case \"start\":\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case \"end\":\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\nvar computePosition = async (reference, floating, config) => {\n const {\n placement = \"bottom\",\n strategy = \"absolute\",\n middleware = [],\n platform: platform2\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));\n let rects = await platform2.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platform2,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === \"object\") {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform2.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform: platform2,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = \"clippingAncestors\",\n rootBoundary = \"viewport\",\n elementContext = \"floating\",\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === \"floating\" ? \"reference\" : \"floating\";\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform2.getClippingRect({\n element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === \"floating\" ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));\n const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\nvar flip = function(options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: \"flip\",\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform: platform2,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = \"bestFit\",\n fallbackAxisSideDirection = \"none\",\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== \"none\";\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements2 = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides2 = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides2[0]], overflow[sides2[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n if (!overflows.every((side2) => side2 <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements2[nextIndex];\n if (nextPlacement) {\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case \"bestFit\": {\n var _overflowsData$filter2;\n const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === \"y\";\n }\n return true;\n }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement2) {\n resetPlacement = placement2;\n }\n break;\n }\n case \"initialPlacement\":\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform: platform2,\n elements\n } = state;\n const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === \"y\";\n const mainAxisMulti = [\"left\", \"top\"].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === \"number\" ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === \"number\") {\n crossAxis = alignment === \"end\" ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\nvar offset = function(options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: \"offset\",\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\nvar shift = function(options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: \"shift\",\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: (_ref) => {\n let {\n x: x2,\n y: y2\n } = _ref;\n return {\n x: x2,\n y: y2\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === \"y\" ? \"top\" : \"left\";\n const maxSide = mainAxis === \"y\" ? \"bottom\" : \"right\";\n const min2 = mainAxisCoord + overflow[minSide];\n const max2 = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min2, mainAxisCoord, max2);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === \"y\" ? \"top\" : \"left\";\n const maxSide = crossAxis === \"y\" ? \"bottom\" : \"right\";\n const min2 = crossAxisCoord + overflow[minSide];\n const max2 = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min2, crossAxisCoord, max2);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n\n// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs\nfunction hasWindow() {\n return typeof window !== \"undefined\";\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || \"\").toLowerCase();\n }\n return \"#document\";\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === \"undefined\") {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && ![\"inline\", \"contents\"].includes(display);\n}\nfunction isTableElement(element) {\n return [\"table\", \"td\", \"th\"].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [\":popover-open\", \":modal\"].some((selector) => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n return [\"transform\", \"translate\", \"scale\", \"rotate\", \"perspective\"].some((value) => css[value] ? css[value] !== \"none\" : false) || (css.containerType ? css.containerType !== \"normal\" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== \"none\" : false) || !webkit && (css.filter ? css.filter !== \"none\" : false) || [\"transform\", \"translate\", \"scale\", \"rotate\", \"perspective\", \"filter\"].some((value) => (css.willChange || \"\").includes(value)) || [\"paint\", \"layout\", \"strict\", \"content\"].some((value) => (css.contain || \"\").includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === \"undefined\" || !CSS.supports) return false;\n return CSS.supports(\"-webkit-backdrop-filter\", \"none\");\n}\nfunction isLastTraversableNode(node) {\n return [\"html\", \"body\", \"#document\"].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === \"html\") {\n return node;\n }\n const result = (\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot || // DOM Element detected.\n node.parentNode || // ShadowRoot detected.\n isShadowRoot(node) && node.host || // Fallback.\n getDocumentElement(node)\n );\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\n// node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\nvar noOffsets = /* @__PURE__ */ createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (\n // RTL <body> scrollbar.\n getWindowScrollBarX(documentElement, htmlRect)\n ));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === \"fixed\";\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== \"body\" || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === \"rtl\") {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === \"fixed\") {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === \"fixed\");\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === \"viewport\") {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === \"document\") {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === \"fixed\" || hasFixedPositionAncestor(parentNode, stopNode);\n}\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== \"body\");\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === \"fixed\";\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === \"fixed\") {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === \"static\" && !!currentContainingBlockComputedStyle && [\"absolute\", \"fixed\"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n result = result.filter((ancestor) => ancestor !== currentNode);\n } else {\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === \"clippingAncestors\" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === \"fixed\";\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== \"body\" || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === \"static\";\n}\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === \"fixed\") {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\nvar getElementRects = async function(data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\nfunction isRTL(element) {\n return getComputedStyle(element).direction === \"rtl\";\n}\nvar platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1e3);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n refresh();\n }\n isFirstUpdate = false;\n }\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === \"function\",\n layoutShift = typeof IntersectionObserver === \"function\",\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];\n ancestors.forEach((ancestor) => {\n ancestorScroll && ancestor.addEventListener(\"scroll\", update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener(\"resize\", update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver((_ref) => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach((ancestor) => {\n ancestorScroll && ancestor.removeEventListener(\"scroll\", update);\n ancestorResize && ancestor.removeEventListener(\"resize\", update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\nvar offset2 = offset;\nvar shift2 = shift;\nvar flip2 = flip;\nvar computePosition2 = (reference, floating, options) => {\n const cache = /* @__PURE__ */ new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\n// node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs\nimport * as React8 from \"react\";\nimport { useLayoutEffect, useEffect as useEffect3 } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nvar index = typeof document !== \"undefined\" ? useLayoutEffect : useEffect3;\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === \"function\" && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === \"object\") {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0; ) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0; ) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0; ) {\n const key = keys[i];\n if (key === \"_owner\" && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\nfunction getDPR(element) {\n if (typeof window === \"undefined\") {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\nfunction useLatestRef(value) {\n const ref = React8.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = \"bottom\",\n strategy = \"absolute\",\n middleware = [],\n platform: platform2,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React8.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React8.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React8.useState(null);\n const [_floating, _setFloating] = React8.useState(null);\n const setReference = React8.useCallback((node) => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React8.useCallback((node) => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React8.useRef(null);\n const floatingRef = React8.useRef(null);\n const dataRef = React8.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform2);\n const openRef = useLatestRef(open);\n const update = React8.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {\n const fullData = {\n ...data2,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData((data2) => ({\n ...data2,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React8.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React8.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React8.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React8.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...getDPR(elements.floating) >= 1.5 && {\n willChange: \"transform\"\n }\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React8.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\nvar offset3 = (options, deps) => ({\n ...offset2(options),\n options: [options, deps]\n});\nvar shift3 = (options, deps) => ({\n ...shift2(options),\n options: [options, deps]\n});\nvar flip3 = (options, deps) => ({\n ...flip2(options),\n options: [options, deps]\n});\n\n// src/components/ui/multiselect.tsx\nimport { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs8 } from \"react/jsx-runtime\";\nvar Portal2 = ({ children }) => {\n return ReactDOM2.createPortal(children, document.body);\n};\nfunction transToGroupOption(options, groupBy) {\n if (options.length === 0) return {};\n if (!groupBy) return { \"\": options };\n const groupOption = {};\n options.forEach((option) => {\n const key = option[groupBy] || \"\";\n if (!groupOption[key]) {\n groupOption[key] = [];\n }\n groupOption[key].push(option);\n });\n return groupOption;\n}\nfunction removePickedOption(groupOption, picked) {\n const cloneOption = JSON.parse(JSON.stringify(groupOption));\n for (const [key, value] of Object.entries(cloneOption)) {\n cloneOption[key] = value.filter((val) => !picked.find((p) => p.value === val.value));\n }\n return cloneOption;\n}\nfunction isOptionsExist(groupOption, targetOption) {\n for (const [, value] of Object.entries(groupOption)) {\n if (value.some((option) => targetOption.find((p) => p.value === option.value))) {\n return true;\n }\n }\n return false;\n}\nvar CommandEmpty2 = forwardRef6(({ className, ...props }, forwardedRef) => {\n const render = useCommandState((state) => state.filtered.count === 0);\n if (!render) return null;\n return /* @__PURE__ */ jsx13(\"div\", { ref: forwardedRef, className: cn(\"px-2 py-4 text-center text-sm\", className), \"cmdk-empty\": \"\", role: \"presentation\", ...props });\n});\nCommandEmpty2.displayName = \"CommandEmpty\";\nfunction useDebounce(value, delay) {\n const [debouncedValue, setDebouncedValue] = React9.useState(value);\n useEffect4(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay || 500);\n return () => clearTimeout(timer);\n }, [value, delay]);\n return debouncedValue;\n}\nvar MultipleSelector = forwardRef6(\n ({\n value,\n onChange,\n placeholder,\n defaultOptions: arrayDefaultOptions = [],\n options: arrayOptions,\n delay,\n onSearch,\n onSearchSync,\n loadingIndicator,\n emptyIndicator,\n maxSelected = Number.MAX_SAFE_INTEGER,\n onMaxSelected,\n hidePlaceholderWhenSelected = true,\n disabled,\n groupBy,\n className,\n badgeClassName,\n selectFirstItem = true,\n creatable = false,\n triggerSearchOnFocus = true,\n commandProps,\n inputProps,\n hideClearAllButton = false,\n dropdownClassName,\n dropdownOptionClassName,\n emptyIndicatorClassName,\n unremovableOptions = [],\n name,\n dropdownContainerClassName = \"\"\n }, ref) => {\n const [isLoading, setIsLoading] = React9.useState(false);\n const { x, y, strategy, refs, update } = useFloating({\n placement: \"bottom-start\",\n middleware: [offset3(4), flip3(), shift3()],\n whileElementsMounted: autoUpdate\n });\n const containerRef = useRef3(null);\n const setContainerRef = (node) => {\n containerRef.current = node;\n refs.setReference(node);\n };\n const inputRef = useRef3(null);\n const [open, setOpen] = React9.useState(false);\n const [onScrollbar, setOnScrollbar] = React9.useState(false);\n const dropdownRef = useRef3(null);\n const [selected, setSelected] = React9.useState(value || []);\n const [options, setOptions] = React9.useState(transToGroupOption(arrayDefaultOptions, groupBy));\n const [inputValue, setInputValue] = React9.useState(\"\");\n const debouncedSearchTerm = useDebounce(inputValue, delay || 500);\n React9.useImperativeHandle(\n ref,\n () => ({\n selectedValue: [...selected],\n input: inputRef.current,\n focus: () => inputRef.current?.focus(),\n reset: () => setSelected([])\n }),\n [selected]\n );\n useEffect4(() => {\n if (open) {\n update();\n }\n }, [open, update]);\n const handleClickOutside = useCallback2((event) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target) && containerRef.current && !containerRef.current.contains(event.target)) {\n setOpen(false);\n inputRef.current?.blur();\n }\n }, []);\n useEffect4(() => {\n if (open) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"touchend\", handleClickOutside);\n } else {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"touchend\", handleClickOutside);\n }\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"touchend\", handleClickOutside);\n };\n }, [open, handleClickOutside]);\n useEffect4(() => {\n if (value) {\n setSelected(value);\n }\n }, [value]);\n useEffect4(() => {\n if (!arrayOptions || onSearch) return;\n const newOption = transToGroupOption(arrayOptions || [], groupBy);\n if (JSON.stringify(newOption) !== JSON.stringify(options)) {\n setOptions(newOption);\n }\n }, [arrayDefaultOptions, arrayOptions, groupBy, onSearch, options]);\n useEffect4(() => {\n const doSearchSync = () => {\n const res = onSearchSync?.(debouncedSearchTerm);\n setOptions(transToGroupOption(res || [], groupBy));\n };\n const exec = async () => {\n if (!onSearchSync || !open) return;\n if (triggerSearchOnFocus) {\n doSearchSync();\n }\n if (debouncedSearchTerm) {\n doSearchSync();\n }\n };\n void exec();\n }, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus, onSearchSync]);\n useEffect4(() => {\n const doSearch = async () => {\n setIsLoading(true);\n const res = await onSearch?.(debouncedSearchTerm);\n setOptions(transToGroupOption(res || [], groupBy));\n setIsLoading(false);\n };\n const exec = async () => {\n if (!onSearch || !open) return;\n if (triggerSearchOnFocus) {\n await doSearch();\n }\n if (debouncedSearchTerm) {\n await doSearch();\n }\n };\n void exec();\n }, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus, onSearch]);\n const handleUnselect = useCallback2(\n (option) => {\n if (unremovableOptions.find((v) => isEqual4(v.value, option.value))) {\n return;\n }\n const newOptions = selected.filter((s) => s.value !== option.value);\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n [onChange, selected, unremovableOptions]\n );\n const handleKeyDown = useCallback2(\n (e) => {\n const input = inputRef.current;\n if (input) {\n if (e.key === \"Delete\" || e.key === \"Backspace\") {\n if (input.value === \"\" && selected.length > 0) {\n const lastSelectOption = selected[selected.length - 1];\n if (!lastSelectOption.fixed) {\n handleUnselect(lastSelectOption);\n }\n }\n }\n if (e.key === \"Escape\") {\n input.blur();\n }\n }\n },\n [handleUnselect, selected]\n );\n const combinedFloatingRef = useCallback2(\n (node) => {\n if (!node) return;\n refs.setFloating(node);\n dropdownRef.current = node;\n },\n [refs]\n );\n const CreatableItem = () => {\n if (!creatable) return void 0;\n if (isOptionsExist(options, [{ value: inputValue, label: inputValue }]) || selected.find((s) => s.value === inputValue)) {\n return void 0;\n }\n const Item = /* @__PURE__ */ jsx13(\n CommandItem,\n {\n value: inputValue,\n className: \"cursor-pointer\",\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onSelect: (val) => {\n if (selected.length >= maxSelected) {\n onMaxSelected?.(selected.length);\n return;\n }\n setInputValue(\"\");\n const newOptions = [...selected, { value: val, label: val }];\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n children: `Create \"${inputValue}\"`\n }\n );\n if (!onSearch && inputValue.length > 0) {\n return Item;\n }\n if (onSearch && debouncedSearchTerm.length > 0 && !isLoading) {\n return Item;\n }\n return void 0;\n };\n const EmptyItem = useCallback2(() => {\n if (!emptyIndicator) return void 0;\n if (onSearch && !creatable && Object.keys(options).length === 0) {\n return /* @__PURE__ */ jsx13(CommandItem, { className: \"\", value: \"-\", disabled: true, children: emptyIndicator });\n }\n return /* @__PURE__ */ jsx13(CommandEmpty2, { className: emptyIndicatorClassName, children: emptyIndicator });\n }, [creatable, emptyIndicator, onSearch, options, emptyIndicatorClassName]);\n const selectables = useMemo4(() => removePickedOption(options, selected), [options, selected]);\n const commandFilter = useCallback2(() => {\n if (commandProps?.filter) {\n return commandProps.filter;\n }\n if (creatable) {\n return (value2, search) => value2.toLowerCase().includes(search.toLowerCase()) ? 1 : -1;\n }\n return void 0;\n }, [creatable, commandProps?.filter]);\n return /* @__PURE__ */ jsxs8(\n Command,\n {\n ...commandProps,\n onKeyDown: (e) => {\n handleKeyDown(e);\n commandProps?.onKeyDown?.(e);\n },\n className: cn(\"h-auto overflow-visible bg-transparent\", commandProps?.className),\n shouldFilter: commandProps?.shouldFilter !== void 0 ? commandProps.shouldFilter : !onSearch,\n filter: commandFilter(),\n children: [\n /* @__PURE__ */ jsx13(\n \"div\",\n {\n ref: setContainerRef,\n className: cn(\n \"relative min-h-[38px] py-2 rounded-lg border border-input text-sm transition-shadow focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50\",\n {\n \"p-1\": selected.length !== 0,\n \"cursor-text\": !disabled && selected.length !== 0\n },\n !hideClearAllButton && \"pe-9\",\n className\n ),\n onClick: () => {\n if (disabled) return;\n inputRef.current?.focus();\n },\n children: /* @__PURE__ */ jsxs8(\"div\", { className: \"flex flex-wrap gap-1\", children: [\n selected.map((option) => /* @__PURE__ */ jsxs8(\n \"div\",\n {\n className: cn(\n \"animate-fadeIn relative inline-flex h-7 cursor-default items-center rounded-md border border-solid bg-background pe-7 pl-2 ps-2 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50 data-[fixed]:pe-2 px-1\",\n badgeClassName\n ),\n \"data-fixed\": option.fixed,\n \"data-disabled\": disabled || void 0,\n children: [\n option.label,\n !unremovableOptions.find((v) => isEqual4(v.value, option.value)) && /* @__PURE__ */ jsx13(\n \"button\",\n {\n className: \"absolute -inset-y-px -end-px flex size-7 items-center justify-center rounded-e-lg border border-transparent p-0 text-muted-foreground/80 outline-0 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70\",\n onKeyDown: (e) => {\n if (e.key === \"Enter\") {\n handleUnselect(option);\n }\n },\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onClick: () => handleUnselect(option),\n \"aria-label\": \"Remove\",\n children: /* @__PURE__ */ jsx13(X2, { size: 14, strokeWidth: 2, \"aria-hidden\": \"true\" })\n }\n )\n ]\n },\n option.value\n )),\n /* @__PURE__ */ jsx13(\n CommandPrimitive2.Input,\n {\n ...inputProps,\n ref: inputRef,\n value: inputValue,\n disabled,\n onValueChange: (val) => {\n setInputValue(val);\n inputProps?.onValueChange?.(val);\n },\n onBlur: (event) => {\n if (!onScrollbar) {\n setOpen(false);\n }\n inputProps?.onBlur?.(event);\n },\n onFocus: (event) => {\n setOpen(true);\n if (triggerSearchOnFocus) {\n onSearch?.(debouncedSearchTerm);\n }\n inputProps?.onFocus?.(event);\n },\n placeholder: hidePlaceholderWhenSelected && selected.length !== 0 ? \"\" : placeholder,\n className: cn(\n \"flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed\",\n {\n \"w-full\": hidePlaceholderWhenSelected,\n \"px-3 py-2\": selected.length === 0,\n \"ml-1\": selected.length !== 0\n },\n inputProps?.className\n )\n }\n ),\n /* @__PURE__ */ jsx13(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n setSelected(selected.filter((s) => s.fixed));\n onChange?.(selected.filter((s) => s.fixed));\n },\n className: cn(\n \"absolute end-0 top-0 flex size-9 items-center justify-center rounded-lg border border-transparent text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70\",\n (hideClearAllButton || disabled || selected.length < 1 || selected.filter((s) => s.fixed).length === selected.length) && \"hidden\"\n ),\n \"aria-label\": \"Clear all\",\n children: /* @__PURE__ */ jsx13(X2, { size: 16, strokeWidth: 2, \"aria-hidden\": \"true\" })\n }\n )\n ] })\n }\n ),\n open && /* @__PURE__ */ jsx13(Portal2, { children: /* @__PURE__ */ jsx13(\n \"div\",\n {\n ref: combinedFloatingRef,\n style: {\n position: strategy,\n top: y ?? 0,\n left: x ?? 0,\n width: containerRef.current?.offsetWidth\n },\n className: cn(\"z-[9999] overflow-hidden rounded-lg border border-input\", dropdownContainerClassName),\n \"data-state\": open ? \"open\" : \"closed\",\n children: /* @__PURE__ */ jsx13(\n CommandList,\n {\n className: \"bg-popover text-popover-foreground shadow-lg shadow-black/5 outline-none\",\n onMouseLeave: () => {\n setOnScrollbar(false);\n },\n onMouseEnter: () => {\n setOnScrollbar(true);\n },\n onMouseUp: () => {\n inputRef.current?.focus();\n },\n children: isLoading ? /* @__PURE__ */ jsx13(Fragment2, { children: loadingIndicator }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [\n EmptyItem(),\n CreatableItem(),\n !selectFirstItem && /* @__PURE__ */ jsx13(CommandItem, { value: \"-\", className: \"hidden\" }),\n Object.entries(selectables).map(([key, dropdowns]) => /* @__PURE__ */ jsx13(CommandGroup, { heading: key, className: cn(\"h-full overflow-auto\", dropdownClassName), children: dropdowns.map((option) => /* @__PURE__ */ jsx13(\n CommandItem,\n {\n value: option.value,\n disabled: option.disable,\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onSelect: () => {\n setOptions(transToGroupOption(arrayDefaultOptions, groupBy));\n if (selected.length >= maxSelected) {\n onMaxSelected?.(selected.length);\n return;\n }\n setInputValue(\"\");\n const newOptions = [...selected, option];\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n className: cn(\n \"cursor-pointer\",\n option.disable && \"cursor-not-allowed opacity-50\",\n dropdownOptionClassName\n ),\n children: option.label\n },\n option.value\n )) }, key))\n ] })\n }\n )\n }\n ) }),\n /* @__PURE__ */ jsx13(\"input\", { value: JSON.stringify(selected), type: \"hidden\", name })\n ]\n }\n );\n }\n);\nMultipleSelector.displayName = \"MultipleSelector\";\nvar multiselect_default = MultipleSelector;\n\n// src/components/ui/popover.tsx\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { jsx as jsx14, jsxs as jsxs9 } from \"react/jsx-runtime\";\nfunction Popover({ ...props }) {\n return /* @__PURE__ */ jsx14(PopoverPrimitive.Root, { \"data-slot\": \"popover\", ...props });\n}\nfunction PopoverTrigger({ ...props }) {\n return /* @__PURE__ */ jsx14(PopoverPrimitive.Trigger, { \"data-slot\": \"popover-trigger\", ...props });\n}\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n showArrow = false,\n ...props\n}) {\n return /* @__PURE__ */ jsx14(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs9(\n PopoverPrimitive.Content,\n {\n \"data-slot\": \"popover-content\",\n align,\n sideOffset,\n className: cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[1000] w-72 rounded-md border p-4 shadow-md outline-hidden\",\n className\n ),\n ...props,\n children: [\n props.children,\n showArrow && /* @__PURE__ */ jsx14(PopoverPrimitive.Arrow, { className: \"fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]\" })\n ]\n }\n ) });\n}\n\n// src/components/ui/SearchSelect.tsx\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\nimport { useId, useMemo as useMemo5, useState as useState5 } from \"react\";\nimport { jsx as jsx15, jsxs as jsxs10 } from \"react/jsx-runtime\";\nfunction SearchSelect({\n options,\n name,\n selectPlaceholder = \"Select\",\n defaultValue,\n notFoundLabel,\n searchPlaceholder = \"Search\",\n dropdownClassName,\n dropdownOptionClassName,\n notFoundLabelClassName,\n elementClassName,\n searchClassName,\n selectButtonClassName,\n value,\n disabled,\n onChange,\n direction\n}) {\n const id = useId();\n const [open, setOpen] = useState5(false);\n const [selectedValue, setSelectedValue] = useState5(value ?? defaultValue ?? \"\");\n const selectLabel = useMemo5(() => {\n return selectedValue ? options.find((item) => item.value === selectedValue)?.label : selectPlaceholder;\n }, [selectedValue, options, selectPlaceholder]);\n return /* @__PURE__ */ jsxs10(\"div\", { style: { direction }, className: cn(\"w-full\", elementClassName), children: [\n /* @__PURE__ */ jsxs10(Popover, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx15(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(\n Button,\n {\n id,\n variant: \"outline\",\n role: \"combobox\",\n \"aria-expanded\": open,\n disabled,\n className: cn(\n \"bg-background hover:bg-background border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px]\",\n selectButtonClassName\n ),\n children: [\n /* @__PURE__ */ jsx15(\"span\", { className: cn(\"truncate\", !selectedValue && \"text-muted-foreground\"), children: selectLabel }),\n /* @__PURE__ */ jsx15(ChevronDownIcon, { size: 16, className: \"text-muted-foreground/80 shrink-0\", \"aria-hidden\": \"true\" })\n ]\n }\n ) }),\n /* @__PURE__ */ jsx15(PopoverContent, { className: cn(\"border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 bg-[#fff]\"), align: \"start\", children: /* @__PURE__ */ jsxs10(Command, { children: [\n /* @__PURE__ */ jsx15(CommandInput, { style: { direction }, className: cn(searchClassName), placeholder: searchPlaceholder }),\n /* @__PURE__ */ jsxs10(CommandList, { children: [\n /* @__PURE__ */ jsx15(CommandEmpty, { className: cn(\"w-full py-2 text-center\", notFoundLabelClassName), children: notFoundLabel }),\n /* @__PURE__ */ jsx15(CommandGroup, { className: cn(\"max-h-52 overflow-y-auto\", dropdownClassName), children: options.map((option) => /* @__PURE__ */ jsxs10(\n CommandItem,\n {\n className: cn(\n \"hover:bg-[#cccbcb] cursor-pointer\",\n dropdownOptionClassName,\n selectedValue === option.value && \"bg-[#cccbcb]\"\n ),\n value: JSON.stringify(option),\n onSelect: (currentValue) => {\n const parsedValue = JSON.parse(currentValue);\n setSelectedValue(parsedValue.value);\n onChange?.(parsedValue.value);\n setOpen(false);\n },\n children: [\n option.label,\n selectedValue === option.value && /* @__PURE__ */ jsx15(CheckIcon, { size: 16, className: \"ml-auto\" })\n ]\n },\n option.value\n )) })\n ] })\n ] }) })\n ] }),\n /* @__PURE__ */ jsx15(\"input\", { name, type: \"hidden\", value: selectedValue })\n ] });\n}\n\n// src/components/table/components.tsx\nimport { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs11 } from \"react/jsx-runtime\";\nvar getFixedNumber = (number = 0, fix = 4) => {\n const sum_value = number % 1 === 0 ? number : number.toFixed(fix).replace(/\\.?0+$/, \"\");\n return String(sum_value);\n};\nvar TableRow2 = ({ item, index: index2 }) => {\n const { rowStyles, rowClassName, keysToRender, onRowClick, zebraStriping } = useTableContext();\n const zebraClassName = zebraStriping ? index2 % 2 === 0 ? zebraStriping.evenRowClassName || \"\" : zebraStriping.oddRowClassName || \"bg-gray-300\" : \"\";\n return /* @__PURE__ */ jsx16(\n \"tr\",\n {\n className: cn(\"hover:bg-[#808080] hover:text-[#fff]\", zebraClassName, rowClassName || \"\"),\n onClick: () => onRowClick && onRowClick(item),\n style: rowStyles,\n children: keysToRender.map((key, index3) => /* @__PURE__ */ jsx16(TableCell, { value: item[key] }, index3))\n }\n );\n};\nvar TableCell = ({ value }) => {\n const { cellStyle, cellClassName } = useTableContext();\n return /* @__PURE__ */ jsx16(\n \"td\",\n {\n title: [\"string\", \"number\", \"boolean\"].includes(typeof value) ? value : \"\",\n style: cellStyle,\n className: cn(\"chivo ellipsis border-black border-[1px] max-w-[90px] px-1 text-center\", cellClassName || \"\"),\n children: value\n }\n );\n};\nvar Filter = memo(({ filterableColumn, index: index2 }) => {\n const { direction, headers, filters, filterOptions, filterPopupsDisplay, handleFilterChange, handleFilterClick, closeFilterWindow, filterLabel } = useTableContext();\n const displayRight = direction === \"rtl\" && index2 === headers.length - 1 || direction === \"ltr\" && index2 !== headers.length - 1;\n return /* @__PURE__ */ jsxs11(\"div\", { className: \"absolute top-1 right-1 \", children: [\n /* @__PURE__ */ jsx16(\n \"button\",\n {\n title: filterLabel + \" \" + filterableColumn.header,\n className: \"text-[12px]\",\n onClick: () => handleFilterClick(filterableColumn.dataKey),\n children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */ jsx16(Fragment3, { children: filters[filterableColumn.dataKey]?.length > 0 ? /* @__PURE__ */ jsx16(Fragment3, { children: slashFilterSvg(true) }) : /* @__PURE__ */ jsx16(Fragment3, { children: emptyFilterSvg(true) }) }) : /* @__PURE__ */ jsx16(Fragment3, { children: filters[filterableColumn.dataKey]?.length > 0 ? /* @__PURE__ */ jsx16(Fragment3, { children: slashFilterSvg() }) : /* @__PURE__ */ jsx16(Fragment3, { children: emptyFilterSvg() }) })\n }\n ),\n /* @__PURE__ */ jsx16(\"div\", { className: \"relative\", children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */ jsxs11(\n \"div\",\n {\n className: `absolute top-[-20px] z-20 ${displayRight ? \" left-[100%]\" : \"right-[100%]\"} w-44 h-52 text-black bg-white p-1 flex flex-col items-center gap-2 shadow`,\n children: [\n /* @__PURE__ */ jsxs11(\"div\", { className: \"flex justify-between items-center border-black border-b-[1px] w-[90%]\", children: [\n /* @__PURE__ */ jsx16(\"div\", { className: \"text-start\", children: filterLabel + \" \" + filterableColumn.header }),\n /* @__PURE__ */ jsx16(\"button\", { onClick: closeFilterWindow, children: /* @__PURE__ */ jsx16(RedXSvg2, {}) })\n ] }),\n /* @__PURE__ */ jsx16(\"div\", { className: \"overflow-auto h-[80%] flex flex-col gap-1 w-full cursor-pointer \", children: filterOptions[filterableColumn.dataKey]?.map((option, i) => /* @__PURE__ */ jsxs11(\"div\", { className: \"flex items-center px-2 justify-start hover:bg-[#547f22] hover:text-white\", children: [\n /* @__PURE__ */ jsx16(\n \"input\",\n {\n type: \"checkbox\",\n className: \"cursor-pointer\",\n checked: filters[filterableColumn.dataKey]?.includes(option),\n onChange: () => handleFilterChange(filterableColumn.dataKey, option)\n }\n ),\n /* @__PURE__ */ jsx16(\"button\", { className: \"flex-1 text-start px-2\", onClick: () => handleFilterChange(filterableColumn.dataKey, option), children: filterableColumn.ui ? filterableColumn.ui(option) : option })\n ] }, i)) })\n ]\n }\n ) })\n ] });\n});\nvar TableHead = memo(() => {\n const {\n headers,\n headerStyle,\n headerCellStyle,\n sortColumn,\n handleSort,\n sortKeys,\n sortOrder,\n filterableColumns = [],\n sortLabel,\n headerClassName,\n headerCellClassName\n } = useTableContext();\n const sortDisplay = useMemo6(() => Boolean(sortKeys?.length), [sortKeys]);\n return /* @__PURE__ */ jsx16(\"thead\", { className: cn(\"bg-[#282828] text-white sticky top-0\", headerClassName), children: /* @__PURE__ */ jsx16(\"tr\", { style: headerStyle, children: headers.map((header, index2) => {\n const filterableColumn = filterableColumns.find((col) => col.header === header);\n return /* @__PURE__ */ jsxs11(\n \"th\",\n {\n title: sortDisplay ? `${sortLabel} ${header}` : header,\n style: headerCellStyle,\n className: cn(\"border-black border-[1px] max-w-[130px] px-2 text-center relative\", headerCellClassName),\n children: [\n /* @__PURE__ */ jsx16(\"div\", { className: `px-2 ${sortDisplay ? \"cursor-pointer\" : \"\"}`, onClick: () => sortDisplay && handleSort(index2), children: header }),\n sortDisplay && sortColumn === index2 && (sortOrder === \"desc\" ? /* @__PURE__ */ jsx16(Fragment3, { children: sortSvg() }) : /* @__PURE__ */ jsx16(Fragment3, { children: sortSvg(true) })),\n filterableColumn && /* @__PURE__ */ jsx16(Filter, { filterableColumn, index: index2 })\n ]\n },\n index2\n );\n }) }) });\n}, renderOnce);\nvar TableBody = memo(() => {\n const { dataToRender } = useTableContext();\n return /* @__PURE__ */ jsx16(\"tbody\", { className: \"divide-y divide-gray-600\", children: dataToRender.renderedData.map((item, index2) => /* @__PURE__ */ jsx16(TableRow2, { item, index: index2 }, index2)) });\n}, renderOnce);\nvar MaxRowsLabel = memo(() => {\n const { data, dataToRender, maxRowsLabel1, maxRowsLabel2, maxRows, maxRowsContainerClassName } = useTableContext();\n return /* @__PURE__ */ jsxs11(\"div\", { className: cn(\"flex justify-start items-center text-lg gap-1\", maxRowsContainerClassName || \"\"), children: [\n /* @__PURE__ */ jsx16(\"div\", { children: maxRowsLabel1 }),\n /* @__PURE__ */ jsx16(\"div\", { children: maxRows > dataToRender.renderedData.length ? dataToRender.renderedData.length : maxRows }),\n /* @__PURE__ */ jsx16(\"div\", { children: maxRowsLabel2 }),\n /* @__PURE__ */ jsx16(\"div\", { children: dataToRender.filtered.length })\n ] });\n}, renderOnce);\nvar ExportToExcel = memo(() => {\n const {\n exportToExcelKeys,\n dataToAddToExcelTable,\n excelFileName,\n dataToRender,\n headers,\n sumColumns,\n exportExcelTitle,\n exportExcelContent,\n exportToExcelClassName\n } = useTableContext();\n const addPropertiesToExcel = (properties) => {\n let newData = [...dataToRender.renderedData];\n let newHeaders = [...headers];\n properties.forEach((val) => {\n newHeaders.unshift(val.header);\n newData = newData.map((v) => ({ ...v, [val.key]: val.value }));\n });\n return { data: newData, headers: newHeaders };\n };\n const onExportExcelClick = async () => {\n if (exportToExcelKeys) {\n const workbook = new ExcelJS.Workbook();\n const worksheet = workbook.addWorksheet(\"Sheet1\");\n const dataToExport = dataToAddToExcelTable ? addPropertiesToExcel(dataToAddToExcelTable) : { data: dataToRender.renderedData, headers };\n worksheet.addRow(dataToExport.headers);\n dataToExport.data.forEach((item) => {\n const row = exportToExcelKeys.map((key) => item[key]);\n worksheet.addRow(row);\n });\n if (sumColumns) {\n sumColumns.forEach((val) => {\n const sumRow = worksheet.addRow([]);\n sumRow.getCell(1).value = val.label;\n const value = dataToRender.renderedData.reduce((acc, v) => {\n return acc + Number(v[val.dataKey]) || 0;\n }, 0).toFixed(2);\n sumRow.getCell(2).value = value;\n });\n }\n const buffer = await workbook.xlsx.writeBuffer();\n const blob = new Blob([buffer], { type: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" });\n saveAs(blob, `${excelFileName || \"table_data\"}.xlsx`);\n }\n };\n return /* @__PURE__ */ jsx16(\n \"button\",\n {\n onClick: onExportExcelClick,\n title: exportExcelTitle,\n className: cn(\"px-2 py-[2px] bg-[#547f22] text-white rounded-lg text-[16px]\", exportToExcelClassName),\n children: exportExcelContent || exportToExcelSvg()\n }\n );\n}, renderOnce);\nvar Search = memo(() => {\n const { searchQuery, handleSearch, searchPlaceHolder, searchInputClassName, searchInputStyle } = useTableContext();\n return /* @__PURE__ */ jsx16(\n \"input\",\n {\n className: cn(\"w-40 border-black border-[1px] text-lg px-2 \", searchInputClassName),\n type: \"text\",\n placeholder: searchPlaceHolder,\n value: searchQuery,\n onChange: handleSearch,\n style: searchInputStyle\n }\n );\n}, renderOnce);\nvar Summary = memo(() => {\n const { summaryContainerStyle, summaryLabelStyle, summaryLabel, summaryRowStyle, sumColumns, dataToRender, direction } = useTableContext();\n return /* @__PURE__ */ jsxs11(\n \"div\",\n {\n style: { ...summaryContainerStyle, direction },\n className: \"w-full h-8 flex justify-between items-center px-3 text-[18px] font-bold\",\n children: [\n /* @__PURE__ */ jsx16(\"div\", { style: summaryLabelStyle, children: summaryLabel }),\n /* @__PURE__ */ jsx16(\"div\", { style: summaryRowStyle, className: \"flex gap-3\", children: sumColumns.map((val) => {\n const sum_res = dataToRender.renderedData.reduce((acc, v) => acc + Number(v[val.dataKey]) || 0, 0);\n const sum_value = getFixedNumber(sum_res);\n return /* @__PURE__ */ jsxs11(\"div\", { className: \"flex gap-1 justify-start\", children: [\n /* @__PURE__ */ jsx16(\"div\", { children: val.label }),\n /* @__PURE__ */ jsx16(\"span\", { children: \":\" }),\n /* @__PURE__ */ jsx16(\"div\", { children: val.ui ? val.ui(sum_value) : sum_value })\n ] }, val.dataKey + val.label);\n }) })\n ]\n }\n );\n}, renderOnce);\nvar TimesUI = ({ timestamp, format, tz, direction, fromFormat, className = \"\" }) => {\n const time = timestamp_to_string(timestamp, { format, fromFormat, tz });\n return /* @__PURE__ */ jsx16(\"div\", { style: { direction: \"ltr\" }, className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className), title: time, children: time });\n};\nvar TableButton = ({ onClick, title, className, type, children }) => {\n const icon = {\n add: \"fa-regular fa-plus text-2xl\",\n edit: \"fa-light fa-pen-to-square text-xl\",\n delete: \"fa-light fa-trash text-xl\"\n };\n return /* @__PURE__ */ jsx16(Fragment3, { children: type === \"custom\" ? /* @__PURE__ */ jsx16(\"button\", { className, title, onClick, children }) : type === \"add\" ? /* @__PURE__ */ jsx16(Button, { title, onClick, children: /* @__PURE__ */ jsx16(\"i\", { className: cn(\"fa-regular fa-plus text-2xl\", className) }) }) : /* @__PURE__ */ jsx16(\"button\", { title, onClick, children: /* @__PURE__ */ jsx16(\"i\", { className: cn(icon[type], className) }) }) });\n};\nvar DurationUI = ({\n duration,\n daysLabel = \"d\",\n hoursLabel = \"h\",\n minutesLabel = \"m\",\n secondsLabel = \"s\",\n className = \"\",\n direction\n}) => {\n const { daysStr, hoursStr, minutesStr, secondsStr } = useMemo6(() => {\n const secondsInDay = 86400;\n const days = Math.floor(duration / secondsInDay);\n const remainderAfterDays = duration % secondsInDay;\n const hours = Math.floor(remainderAfterDays / 3600);\n const remainderAfterHours = remainderAfterDays % 3600;\n const minutes = Math.floor(remainderAfterHours / 60);\n const seconds = remainderAfterHours % 60;\n const daysStr2 = String(days).padStart(2, \"0\");\n const hoursStr2 = String(hours).padStart(2, \"0\");\n const minutesStr2 = String(minutes).padStart(2, \"0\");\n const secondsStr2 = String(seconds).padStart(2, \"0\");\n return {\n daysStr: daysStr2,\n hoursStr: hoursStr2,\n minutesStr: minutesStr2,\n secondsStr: secondsStr2\n };\n }, [duration]);\n return /* @__PURE__ */ jsxs11(\n \"div\",\n {\n title: `${daysStr} ${daysLabel} ${hoursStr} ${hoursLabel} ${minutesStr} ${minutesLabel} ${secondsStr} ${secondsLabel}`.trim(),\n style: { direction: \"ltr\" },\n className: cn(`flex gap-1 ${direction === \"rtl\" ? \"justify-end\" : \"justify-start\"}`, className),\n children: [\n daysStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n daysStr,\n \" \",\n daysLabel\n ] }),\n hoursStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n hoursStr,\n \" \",\n hoursLabel\n ] }),\n minutesStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n minutesStr,\n \" \",\n minutesLabel\n ] }),\n secondsStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n secondsStr,\n \" \",\n secondsLabel\n ] })\n ]\n }\n );\n};\nvar PhoneUI = ({ phone, direction, className = \"\" }) => {\n return /* @__PURE__ */ jsx16(\"div\", { style: { direction: \"ltr\" }, className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className), title: phone, children: phone });\n};\nvar BooleanUi = ({ value, size: size3, className, falseUi, trueUi }) => {\n return value ? trueUi ?? /* @__PURE__ */ jsx16(\"i\", { className: cn(`fa-light fa-check ${size3 === \"small\" ? \"text-lg\" : \"text-2xl\"}`, className) }) : falseUi ?? /* @__PURE__ */ jsx16(\"i\", { className: cn(`fa-light fa-xmark ${size3 === \"small\" ? \"text-lg\" : \"text-2xl\"}`, className) });\n};\nvar GeoUi = ({ value, className, linkUi }) => {\n const lang = value.lng || value.longitude;\n const lat = value.lat || value.latitude;\n const googleMapsLink = getLocationUrl(lang, lat);\n const langLatUi = linkUi || ` ${lang} ${lat}`;\n return /* @__PURE__ */ jsx16(\"a\", { href: googleMapsLink, target: \"_blank\", className: cn(\"_ellipsis\", className), title: `${lang} ${lat}`, children: langLatUi });\n};\nvar NumberUI = ({ number, direction, className = \"\" }) => {\n return /* @__PURE__ */ jsx16(\n \"div\",\n {\n style: { direction: \"ltr\" },\n className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className),\n title: String(number),\n children: number\n }\n );\n};\n\n// src/components/forms/ModularForm/ModularForm.tsx\nimport { cloneElement, useState as useState8 } from \"react\";\n\n// src/components/forms/ModularForm/formElements.tsx\nimport { useCallback as useCallback4, useMemo as useMemo8, useState as useState7 } from \"react\";\n\n// src/components/forms/ModularForm/InternationalPhonePicker.tsx\nimport { ChevronDown, Phone } from \"lucide-react\";\nimport { forwardRef as forwardRef7, useEffect as useEffect5, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from \"react\";\nimport * as RPNInput from \"react-phone-number-input\";\nimport flags from \"react-phone-number-input/flags\";\nimport { jsx as jsx17, jsxs as jsxs12 } from \"react/jsx-runtime\";\nfunction InternationalPhonePicker({\n setPhoneValue,\n phoneValue = \"\",\n placeholder = \"\",\n className = \"\",\n containerClassName = \"\",\n defaultCountry = \"IL\",\n flagContainerClassName = \"\",\n inputClassName = \"\",\n defaultValue,\n name,\n style,\n onEnter,\n labelContent,\n labelClassName,\n required,\n direction\n}) {\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\") {\n if (onEnter) {\n onEnter();\n }\n }\n };\n const [tempPhoneValue, setTempPhoneValue] = useState6(\"\");\n useEffect5(() => {\n if (defaultValue) {\n if (setPhoneValue) {\n setPhoneValue(defaultValue);\n } else {\n setTempPhoneValue(defaultValue);\n }\n }\n }, [defaultValue, setPhoneValue]);\n return /* @__PURE__ */ jsxs12(\"div\", { style: { direction }, className: cn(\"space-y-2\", `${labelContent ? \"flex gap-1 items-center\" : \"\"}`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx17(ElementLabel, { labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx17(\n RPNInput.default,\n {\n style: { direction: \"ltr\" },\n className: cn(\"flex rounded-lg shadow-sm shadow-black/5\", className),\n international: true,\n countries: [\"US\", \"IL\", \"NG\"],\n defaultCountry,\n flagComponent: FlagComponent,\n countrySelectComponent: CountrySelect,\n countrySelectProps: { className: flagContainerClassName },\n inputComponent: PhoneInput,\n numberInputProps: { className: cn(\"min-h-10\", inputClassName), onKeyDown: handleKeyDown, defaultValue, style },\n placeholder,\n value: tempPhoneValue || phoneValue,\n onChange: (newValue) => {\n if (setPhoneValue) {\n return setPhoneValue(newValue ?? \"\");\n }\n setTempPhoneValue(newValue ?? \"\");\n }\n }\n ),\n /* @__PURE__ */ jsx17(\"input\", { type: \"hidden\", name, value: tempPhoneValue })\n ] });\n}\nvar PhoneInput = forwardRef7(({ className, onKeyDown, defaultValue, style, ...props }, ref) => {\n const inputRef = useRef4(null);\n useEffect5(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n return /* @__PURE__ */ jsx17(\n Input,\n {\n className: cn(\"-ms-px rounded-s-none shadow-none focus-visible:z-10 h-full\", className),\n onKeyDown,\n defaultValue,\n style,\n ref: (el) => {\n inputRef.current = el;\n if (typeof ref === \"function\") {\n ref(el);\n } else if (ref) {\n ref.current = el;\n }\n },\n ...props\n }\n );\n});\nPhoneInput.displayName = \"PhoneInput\";\nvar CountrySelect = ({ disabled, value, onChange, options, className }) => {\n const handleSelect = (event) => {\n onChange(event.target.value);\n };\n const originalClassName = useMemo7(() => {\n return \"relative inline-flex items-center self-stretch rounded-s-lg border border-input bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50\";\n }, []);\n return /* @__PURE__ */ jsxs12(\"div\", { className: cn(originalClassName, className), children: [\n /* @__PURE__ */ jsxs12(\"div\", { className: \"inline-flex items-center gap-1\", \"aria-hidden\": \"true\", children: [\n /* @__PURE__ */ jsx17(FlagComponent, { country: value, countryName: value, \"aria-hidden\": \"true\" }),\n /* @__PURE__ */ jsx17(\"span\", { className: \"text-muted-foreground/80\", children: /* @__PURE__ */ jsx17(ChevronDown, { size: 16, strokeWidth: 2, \"aria-hidden\": \"true\" }) })\n ] }),\n /* @__PURE__ */ jsx17(\n \"select\",\n {\n disabled,\n value,\n onChange: handleSelect,\n className: \"absolute inset-0 text-sm opacity-0\",\n \"aria-label\": \"Select country\",\n children: options.filter((x) => x.value).map((option, i) => /* @__PURE__ */ jsxs12(\"option\", { className: \"text-black\", value: option.value, children: [\n option.label,\n \" \",\n option.value && `+${RPNInput.getCountryCallingCode(option.value)}`\n ] }, option.value ?? `empty-${i}`))\n }\n )\n ] });\n};\nvar FlagComponent = ({ country, countryName }) => {\n const Flag = flags[country];\n return /* @__PURE__ */ jsx17(\"span\", { className: \"w-5 overflow-hidden rounded-sm\", children: Flag ? /* @__PURE__ */ jsx17(Flag, { title: countryName }) : /* @__PURE__ */ jsx17(Phone, { size: 16, \"aria-hidden\": \"true\" }) });\n};\n\n// src/components/forms/ModularForm/formElements.tsx\nimport { jsx as jsx18, jsxs as jsxs13 } from \"react/jsx-runtime\";\nvar useSortValues = (options, sortDirection, sortAsNumber) => {\n const sortOptions = useMemo8(() => {\n const sorted = sortAsNumber ? options.sort((a, b) => parseInt(b.label) - parseInt(a.label)) : options.sort((a, b) => a.label.localeCompare(b.label));\n return sortDirection === \"cba\" ? sorted.reverse() : sorted;\n }, [options, sortDirection, sortAsNumber]);\n return sortOptions;\n};\nvar InputContainer = ({\n validationError,\n name = \"\",\n inputType = \"text\",\n labelContent = \"\",\n defaultValue = \"\",\n validationName = \"textNumbers\",\n containerClassName = \"\",\n labelClassName = \"\",\n elementClassName = \"\",\n required = false,\n placeholder,\n props,\n minLength,\n onKeyDown,\n onChange,\n direction,\n value\n}) => {\n const handleChangeFunction = useCallback4(\n (e) => {\n handleChange(e);\n onChange?.(e);\n },\n [onChange]\n );\n const validationProps = useMemo8(() => {\n return { ...useValidation(validationName, validationError), onChange: handleChangeFunction };\n }, [handleChangeFunction]);\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx18(\n \"input\",\n {\n ...props,\n minLength,\n placeholder,\n className: cn(`w-[70%] bg-inherit border-b-[1px] border-black px-2`, elementClassName),\n defaultValue,\n ...validationProps,\n value,\n onChange: (e) => handleChangeFunction(e),\n required,\n name,\n onKeyDown,\n type: inputType\n }\n )\n ] });\n};\nvar SelectContainer = ({\n name = \"\",\n labelContent = \"\",\n containerClassName = \"\",\n labelClassName = \"\",\n defaultValue = \"\",\n elementClassName = \"\",\n optionClassName = \"\",\n required = false,\n options = [],\n optionsContainerClassName = \"\",\n sortDirection = \"abc\",\n sortAsNumber,\n direction,\n onChange\n}) => {\n const sortOptions = useSortValues(options, sortDirection, sortAsNumber);\n const [isOpen, setIsOpen] = useState7(false);\n const [selectedValue, setSelectedValue] = useState7(defaultValue || sortOptions[0]?.value || \"\");\n const handleOptionClick = (value) => {\n setSelectedValue(value);\n onChange?.(value);\n setIsOpen(false);\n };\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsxs13(\"div\", { className: cn(`w-[70%] relative`, elementClassName), onClick: () => setIsOpen(!isOpen), children: [\n /* @__PURE__ */ jsx18(\"div\", { className: `border-b-[1px] border-black max-h-6 cursor-pointer`, children: options.find((opt) => opt.value === selectedValue)?.label || selectedValue }),\n isOpen ? /* @__PURE__ */ jsx18(\"i\", { className: \"fa-light fa-chevron-up absolute top-[1px] left-1 cursor-pointer\" }) : /* @__PURE__ */ jsx18(\"i\", { className: \"fa-light fa-chevron-down absolute top-[1px] left-1 cursor-pointer\" }),\n isOpen && /* @__PURE__ */ jsx18(\"div\", { className: cn(`absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10`, optionsContainerClassName), children: sortOptions.map((option) => /* @__PURE__ */ jsx18(\n \"div\",\n {\n className: `p-2 cursor-pointer hover:bg-gray-200 ${optionClassName}`,\n onClick: () => handleOptionClick(option.value),\n children: option.label\n },\n option.value\n )) }),\n /* @__PURE__ */ jsx18(\"input\", { value: selectedValue, type: \"hidden\", name, required })\n ] })\n ] });\n};\nfunction MultiSelect({\n onChange,\n selectedOptions,\n emptyOptionsElement,\n unremovableOptions,\n options = [],\n styles = {},\n name = \"multipleSelect\",\n placeholder = \"Select items\",\n labelContent,\n required,\n labelClassName,\n groupBy,\n onSearch,\n onSearchSync,\n triggerSearchOnFocus,\n sortDirection = \"abc\",\n sortAsNumber,\n direction,\n searchInputProps\n}) {\n const sortOptions = useSortValues(options, sortDirection, sortAsNumber);\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`${labelContent ? \"flex gap-1 items-center\" : \"\"}`, styles.containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx18(\n multiselect_default,\n {\n commandProps: {\n label: placeholder\n },\n name,\n defaultOptions: sortOptions,\n unremovableOptions,\n value: selectedOptions,\n onChange,\n onSearch,\n onSearchSync,\n triggerSearchOnFocus,\n groupBy,\n placeholder,\n hideClearAllButton: true,\n hidePlaceholderWhenSelected: true,\n badgeClassName: styles.badgeClassName,\n className: styles.className,\n dropdownClassName: styles.dropdownClassName,\n dropdownOptionClassName: styles.dropdownOptionClassName,\n emptyIndicator: emptyOptionsElement || /* @__PURE__ */ jsx18(\"p\", { className: \"text-center text-sm\", children: \"all options selected.\" }),\n emptyIndicatorClassName: styles.emptyIndicatorClassName,\n dropdownContainerClassName: styles.dropdownContainerClassName,\n inputProps: searchInputProps\n }\n )\n ] });\n}\nvar SelectWithSearch = ({\n options,\n labelClassName,\n labelContent,\n name,\n onChange,\n value,\n placeholder,\n required,\n defaultValue,\n notFoundLabel,\n searchPlaceholder,\n containerClassName,\n dropdownClassName,\n dropdownOptionClassName,\n elementClassName,\n notFoundLabelClassName,\n searchClassName,\n selectButtonClassName,\n sortDirection = \"abc\",\n sortAsNumber,\n disabled,\n direction\n}) => {\n const sortOptions = useSortValues(options, sortDirection, sortAsNumber);\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`flex justify-between items-center w-full`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx18(\n SearchSelect,\n {\n direction,\n options: sortOptions,\n value,\n onChange,\n defaultValue,\n name,\n elementClassName,\n selectPlaceholder: placeholder,\n selectButtonClassName,\n disabled,\n searchClassName,\n searchPlaceholder,\n dropdownClassName,\n dropdownOptionClassName,\n notFoundLabelClassName,\n notFoundLabel\n }\n )\n ] });\n};\nvar TextAreaContainer = ({\n name = \"\",\n labelContent = \"\",\n defaultValue = \"\",\n containerClassName = \"\",\n labelClassName = \"\",\n elementClassName = \"\",\n required = false,\n placeholder,\n props,\n minLength,\n onKeyDown,\n onChange,\n direction\n}) => {\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`flex flex-col gap-2 items-center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(\n ElementLabel,\n {\n direction,\n labelContent,\n labelClassName: `w-fit text-xl px-2 border-b-2 border-[#000] text-center ${labelClassName}`,\n name,\n required,\n withDots: false\n }\n ),\n /* @__PURE__ */ jsx18(\n \"textarea\",\n {\n ...props,\n onChange,\n minLength,\n placeholder,\n className: cn(`w-full bg-inherit border-[1px] border-black min-h-16 max-h-52 px-2`, elementClassName),\n defaultValue,\n required,\n name,\n onKeyDown\n }\n )\n ] });\n};\nvar ElementLabel = ({\n labelContent,\n labelClassName,\n name,\n required,\n withDots = true,\n direction\n}) => {\n return /* @__PURE__ */ jsxs13(\"label\", { style: { direction }, className: cn(`text-start w-[30%] flex gap-0.5`, labelClassName), htmlFor: name, children: [\n /* @__PURE__ */ jsx18(\"div\", { children: labelContent }),\n required && /* @__PURE__ */ jsx18(\"div\", { className: \"text-red-500\", children: \"*\" }),\n withDots && /* @__PURE__ */ jsx18(\"div\", { children: \":\" })\n ] });\n};\n\n// src/components/forms/ModularForm/ModularForm.tsx\nimport { jsx as jsx19, jsxs as jsxs14 } from \"react/jsx-runtime\";\nvar ModularForm = ({\n submitFunction = async (form) => {\n },\n elements = [],\n headerContent,\n buttonContent,\n formClassName = \"\",\n headerClassName = \"\",\n direction = \"rtl\",\n buttonClassName = \"\",\n submitRef\n}) => {\n const [errorMsg, setErrorMsg] = useState8(\"\");\n const [isLoading, setIsLoading] = useState8(false);\n const onSubmit = async (e) => {\n e.preventDefault();\n setErrorMsg(\"\");\n setIsLoading(true);\n try {\n const form = e.currentTarget;\n elements.forEach((element) => {\n if (element.minLength) {\n const elementValue = getFormElementValue(form, element.name);\n if (elementValue.length < element.minLength) {\n throw element.validationError || `${element.labelContent || element.name} must be at least ${element.minLength} characters`;\n }\n }\n });\n await submitFunction(e);\n } catch (err) {\n if (typeof err === \"string\") {\n setErrorMsg(err);\n }\n if (err.message) {\n setErrorMsg(err.message);\n }\n console.error(\"Error from submit ModularForm:\", err);\n }\n setIsLoading(false);\n };\n return /* @__PURE__ */ jsxs14(\"form\", { onSubmit, style: { direction }, className: cn(`w-[350px] px-5 py-5 flex flex-col gap-5`, formClassName), children: [\n headerContent && /* @__PURE__ */ jsx19(\"div\", { className: cn(`border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]`, headerClassName), children: headerContent }),\n elements.map((element, index2) => {\n switch (element.type) {\n case \"input\":\n return /* @__PURE__ */ jsx19(InputContainer, { ...element, direction }, index2);\n case \"textarea\":\n return /* @__PURE__ */ jsx19(TextAreaContainer, { ...element, direction }, index2);\n case \"select\":\n return /* @__PURE__ */ jsx19(SelectContainer, { ...element, direction }, index2);\n case \"multiSelect\":\n return /* @__PURE__ */ jsx19(MultiSelect, { ...element, direction }, index2);\n case \"selectWithSearch\":\n return /* @__PURE__ */ jsx19(SelectWithSearch, { ...element, direction }, index2);\n case \"internationalPhoneInput\":\n return /* @__PURE__ */ jsx19(InternationalPhonePicker, { ...element, direction }, index2);\n case \"custom\":\n return typeof element.element?.type !== \"string\" && cloneElement(element.element, { key: index2 });\n default:\n return null;\n }\n }),\n /* @__PURE__ */ jsxs14(\"div\", { className: \"flex justify-between w-full\", children: [\n /* @__PURE__ */ jsx19(\"div\", { title: errorMsg, className: \"text-[#f22] text-[18px] max-w-[80%] ellipsis\", children: errorMsg }),\n /* @__PURE__ */ jsx19(\n \"button\",\n {\n ref: submitRef,\n disabled: isLoading,\n className: cn(`bg-[#547f22] px-3 py-1 rounded-lg text-white min-w-20`, buttonClassName),\n type: \"submit\",\n children: isLoading ? /* @__PURE__ */ jsx19(Loader, { size: 25, color: \"#fff\" }) : buttonContent\n }\n )\n ] })\n ] });\n};\nvar ModularForm_default = ModularForm;\n\n// src/components/forms/index.tsx\nimport { useState as useState9 } from \"react\";\nimport moment3 from \"moment\";\nimport { jsx as jsx20, jsxs as jsxs15 } from \"react/jsx-runtime\";\nvar ConfirmForm = ({\n onV,\n onX,\n headline = \"\",\n direction = \"rtl\",\n containerClassName = \"\",\n buttonsContainerClassName = \"\",\n headlineClassName = \"\"\n}) => {\n const onConfirm = async () => {\n try {\n await onV();\n } catch (error) {\n console.error(\"'onV' failed:\", error);\n }\n };\n const onDenied = async () => {\n try {\n await onX();\n } catch (error) {\n console.error(\"'onX' failed:\", error);\n }\n };\n return /* @__PURE__ */ jsxs15(\"div\", { style: { direction, padding: \"30px\" }, className: cn(\"w-full h-full flex flex-col gap-3\", containerClassName), children: [\n /* @__PURE__ */ jsx20(\"div\", { className: cn(\"text-lg font-bold\", headlineClassName), children: headline }),\n /* @__PURE__ */ jsxs15(\"div\", { className: cn(\"flex justify-center items-center gap-2 w-full\", buttonsContainerClassName), children: [\n /* @__PURE__ */ jsx20(\"button\", { onClick: onDenied, children: /* @__PURE__ */ jsx20(RedXSvg, {}) }),\n /* @__PURE__ */ jsx20(\"button\", { onClick: onConfirm, children: /* @__PURE__ */ jsx20(GreenVSvg, {}) })\n ] })\n ] });\n};\nvar DatePicker = ({\n submit = async (form) => {\n },\n formClassName = \"\",\n labelsClassName = \"\",\n inputsClassName = \"\",\n buttonClassName = \"\",\n buttonStyle = {},\n defaultFrom,\n defaultTo,\n direction = \"rtl\",\n fromText = \"From date\",\n toText = \"To date\",\n buttonText = \"Search\"\n}) => {\n const [isLoading, setIsLoading] = useState9(false);\n const onSubmit = async (e) => {\n e.preventDefault();\n setIsLoading(true);\n await submit(e);\n setIsLoading(false);\n };\n return /* @__PURE__ */ jsxs15(\"form\", { style: { direction }, onSubmit, className: cn(`w-full h-10 flex justify-start gap-3 items-center `, formClassName), children: [\n /* @__PURE__ */ jsxs15(\"label\", { className: cn(`center text-[14px] relative gap-2`, labelsClassName), htmlFor: \"from\", children: [\n fromText,\n /* @__PURE__ */ jsx20(\n \"input\",\n {\n className: `w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ${inputsClassName}`,\n type: \"date\",\n name: \"from\",\n defaultValue: defaultFrom || moment3(/* @__PURE__ */ new Date()).format(\"YYYY-MM-DD\")\n }\n )\n ] }),\n /* @__PURE__ */ jsxs15(\"label\", { className: cn(`center text-[14px] relative gap-2 `, labelsClassName), htmlFor: \"to\", children: [\n toText,\n /* @__PURE__ */ jsx20(\n \"input\",\n {\n className: `w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ${inputsClassName}`,\n type: \"date\",\n name: \"to\",\n defaultValue: defaultTo || moment3(/* @__PURE__ */ new Date()).format(\"YYYY-MM-DD\")\n }\n )\n ] }),\n /* @__PURE__ */ jsx20(\n \"button\",\n {\n disabled: isLoading,\n style: buttonStyle,\n className: cn(`bg-[#699a2c] text-[#fff] font-[500] w-[75px] h-[27px]`, buttonClassName),\n type: \"submit\",\n children: isLoading ? /* @__PURE__ */ jsx20(Loader, { className: \"pt-[2px]\", size: 20, color: \"#fff\" }) : buttonText\n }\n )\n ] });\n};\n\n// src/components/CodeInput.tsx\nimport { OTPInput } from \"input-otp\";\nimport { useEffect as useEffect6, useRef as useRef5 } from \"react\";\nimport { jsx as jsx21 } from \"react/jsx-runtime\";\nfunction CodeInput({ codeValue, setCodeValue, className = \"\", slotContainerClassName = \"\" }) {\n const firstInputRef = useRef5(null);\n useEffect6(() => {\n if (firstInputRef.current) {\n firstInputRef.current.focus();\n }\n }, []);\n return /* @__PURE__ */ jsx21(\"div\", { className: cn(\"space-y-2 flex justify-center items-center\", className), children: /* @__PURE__ */ jsx21(\n OTPInput,\n {\n ref: firstInputRef,\n value: codeValue,\n onChange: (newVal) => setCodeValue(newVal),\n containerClassName: \"flex items-center gap-3 has-[:disabled]:opacity-50\",\n maxLength: 6,\n render: ({ slots }) => /* @__PURE__ */ jsx21(\"div\", { className: cn(\"flex gap-5\", slotContainerClassName), children: slots.map((slot, idx) => /* @__PURE__ */ jsx21(Slot2, { ...slot }, idx)) })\n }\n ) });\n}\nfunction Slot2(props) {\n return /* @__PURE__ */ jsx21(\n \"div\",\n {\n className: cn(\n \"flex size-9 items-center justify-center rounded-lg border border-input bg-background font-medium text-foreground shadow-sm shadow-black/5 transition-shadow\",\n { \"z-10 border border-ring ring-[3px] ring-ring/20\": props.isActive }\n ),\n children: props.char !== null && /* @__PURE__ */ jsx21(\"div\", { children: props.char })\n }\n );\n}\nexport {\n Badge,\n BooleanUi,\n Button,\n Checkbox,\n CodeInput,\n ConfirmForm,\n DatePicker,\n DurationUI,\n ElementLabel,\n ErrorBoundary,\n ExportToExcel,\n Filter,\n GeoUi,\n Input,\n InputContainer,\n InternationalPhonePicker,\n Loader,\n MaxRowsLabel,\n ModularForm_default as ModularForm,\n MultiSelect,\n NumberUI,\n PhoneUI,\n ProgressComponent,\n Search,\n SelectContainer,\n SelectWithSearch,\n Summary,\n Table,\n TableBody,\n TableButton,\n TableCell,\n TableContext,\n TableHead,\n TableProvider,\n TableRow2 as TableRow,\n TextAreaContainer,\n TimesUI,\n Version,\n badgeVariants,\n buttonVariants,\n getFixedNumber,\n useDebounce,\n useSortValues\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["c:\\work\\akeyless\\commons\\client_commons\\dist\\components\\index.mjs"],"names":[],"mappings":"0BAAA,YAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4CAAtC","sourcesContent":["// src/components/utils/Checkboxes.tsx\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar Checkbox = ({ id, checked, setChecked, rotate = true, style }) => {\n return /* @__PURE__ */ jsxs(\"div\", { className: \"checkbox-wrapper-51\", children: [\n /* @__PURE__ */ jsx(\"input\", { type: \"checkbox\", id, className: \"hidden\", checked, onChange: () => setChecked(!checked) }),\n /* @__PURE__ */ jsxs(\"label\", { htmlFor: id, className: \"relative block w-[42px] h-[24px] cursor-pointer transform-gpu\", children: [\n /* @__PURE__ */ jsx(\n \"div\",\n {\n className: `relative top-[1px] left-[1px] w-[40px] h-[22px] rounded-[12px] transition-colors duration-200 ease-in-out ${checked ? \"bg-[#52d66b]\" : \"bg-[#c8ccd4]\"}`\n }\n ),\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: `absolute ${rotate ? \"left-0\" : \"right-0\"} top-0 w-[24px] h-[24px] bg-white rounded-full shadow-md transition-transform duration-200 ease-in-out ${checked ? rotate ? \"translate-x-[18px]\" : \"-translate-x-[18px]\" : \"\"}`,\n children: /* @__PURE__ */ jsx(\"svg\", { width: \"10px\", height: \"10px\", viewBox: \"0 0 10 10\", className: \"m-[7px] fill-none\", children: /* @__PURE__ */ jsx(\n \"path\",\n {\n d: \"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n className: \"transition-all duration-500 linear\",\n stroke: checked ? \"#52d66b\" : \"#c8ccd4\",\n style: {\n strokeDasharray: checked ? \"25\" : \"24\",\n strokeDashoffset: checked ? \"25\" : \"0\"\n }\n }\n ) })\n }\n )\n ] })\n ] });\n};\n\n// src/components/utils/ErrorBoundary.tsx\nimport React from \"react\";\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar ErrorBoundary = class extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: null,\n errorInfo: null\n };\n }\n static getDerivedStateFromError(error) {\n return {\n hasError: true,\n error\n };\n }\n componentDidCatch(error, errorInfo) {\n console.error(\"Error:\", error);\n console.log(\"Error Info:\", errorInfo);\n this.setState({ errorInfo });\n }\n render() {\n if (this.state.hasError) {\n return this.props.fallback || /* @__PURE__ */ jsx2(\"div\", { className: \"full center\", children: /* @__PURE__ */ jsx2(\"h1\", { children: \"\\u05DE\\u05E9\\u05D4\\u05D5 \\u05D4\\u05E9\\u05EA\\u05D1\\u05E9....\" }) });\n }\n return this.props.children;\n }\n};\n\n// src/components/utils/loaders.tsx\nimport { ClipLoader } from \"react-spinners\";\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nvar Loader = ({ color, size: size3, style = {}, className = \"\" }) => {\n return /* @__PURE__ */ jsx3(\"div\", { className: `flex items-center justify-center ${className}`, style, children: /* @__PURE__ */ jsx3(ClipLoader, { loading: true, color: color || \"#699A2C\", size: size3 || 18 }) });\n};\n\n// src/lib/utils.ts\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\n\n// src/components/utils/global.tsx\nimport { jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar Version = ({ version, className = \"\" }) => {\n return /* @__PURE__ */ jsxs2(\"div\", { className: cn(\"absolute text-black z-30 bottom-[0px] text-xs right-0 px-1 \", className), children: [\n \"v\",\n version\n ] });\n};\n\n// src/components/table/components.tsx\nimport ExcelJS from \"exceljs\";\nimport { saveAs } from \"file-saver\";\nimport { memo, useMemo as useMemo6 } from \"react\";\n\n// src/assets/svg.tsx\nimport { jsx as jsx4, jsxs as jsxs3 } from \"react/jsx-runtime\";\nvar RedXSvg = ({ height, width, viewBox }) => /* @__PURE__ */ jsxs3(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"32\", height: height || \"32\", viewBox: viewBox || \"0 0 32 32\", fill: \"none\", children: [\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M21.0801 10.3C20.6101 9.80996 19.8301 9.79996 19.3401 10.27L15.6101 13.89L11.8801 10.27C11.3901 9.79996 10.6101 9.80996 10.1401 10.3C9.67008 10.79 9.68008 11.57 10.1701 12.04L13.8501 15.61L10.1701 19.18C9.68008 19.65 9.67008 20.43 10.1401 20.92C10.6101 21.41 11.3901 21.42 11.8801 20.95L15.6101 17.33L19.3401 20.95C19.5701 21.17 19.8801 21.3 20.2001 21.3C20.8801 21.29 21.4301 20.73 21.4201 20.04C21.4201 19.72 21.2901 19.41 21.0601 19.19L17.3801 15.62L21.0601 12.05C21.5501 11.58 21.5601 10.8 21.0901 10.31L21.0801 10.3Z\",\n fill: \"#FF4C2B\"\n }\n ),\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M15.61 0C6.99 0 0 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z\",\n fill: \"#FF4C2B\"\n }\n )\n] });\nvar RedXSvg2 = ({ height, width, viewBox }) => /* @__PURE__ */ jsx4(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"18px\", height: height || \"18px\", viewBox: viewBox || \"0,0,256,256\", fillRule: \"nonzero\", children: /* @__PURE__ */ jsx4(\n \"g\",\n {\n fill: \"#e90404\",\n fillRule: \"nonzero\",\n stroke: \"none\",\n strokeWidth: \"1\",\n children: /* @__PURE__ */ jsx4(\"g\", { transform: \"scale(10.66667,10.66667)\", children: /* @__PURE__ */ jsx4(\"path\", { d: \"M4.99023,3.99023c-0.40692,0.00011 -0.77321,0.24676 -0.92633,0.62377c-0.15312,0.37701 -0.06255,0.80921 0.22907,1.09303l6.29297,6.29297l-6.29297,6.29297c-0.26124,0.25082 -0.36647,0.62327 -0.27511,0.97371c0.09136,0.35044 0.36503,0.62411 0.71547,0.71547c0.35044,0.09136 0.72289,-0.01388 0.97371,-0.27511l6.29297,-6.29297l6.29297,6.29297c0.25082,0.26124 0.62327,0.36648 0.97371,0.27512c0.35044,-0.09136 0.62411,-0.36503 0.71547,-0.71547c0.09136,-0.35044 -0.01388,-0.72289 -0.27512,-0.97371l-6.29297,-6.29297l6.29297,-6.29297c0.29576,-0.28749 0.38469,-0.72707 0.22393,-1.10691c-0.16075,-0.37985 -0.53821,-0.62204 -0.9505,-0.60988c-0.2598,0.00774 -0.50638,0.11632 -0.6875,0.30273l-6.29297,6.29297l-6.29297,-6.29297c-0.18827,-0.19353 -0.4468,-0.30272 -0.7168,-0.30273z\" }) })\n }\n) });\nvar GreenVSvg = ({ height, width, viewBox }) => /* @__PURE__ */ jsxs3(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"32\", height: height || \"32\", viewBox: viewBox || \"0 0 32 32\", fill: \"none\", children: [\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M15.61 0C6.99 0 0.01 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z\",\n fill: \"#3B8F08\"\n }\n ),\n /* @__PURE__ */ jsx4(\n \"path\",\n {\n d: \"M21.66 10.15L13.37 18.44L9.58003 14.54C9.10003 14.06 8.32003 14.07 7.84003 14.54C7.38003 15.01 7.36003 15.76 7.82003 16.24L12.48 21.03C12.96 21.52 13.74 21.52 14.23 21.05L23.41 11.87C23.88 11.38 23.87 10.6 23.38 10.13C22.9 9.67003 22.15 9.67003 21.68 10.13L21.66 10.15Z\",\n fill: \"#3B8F08\"\n }\n )\n] });\n\n// src/assets/table.tsx\nimport { Fragment, jsx as jsx5, jsxs as jsxs4 } from \"react/jsx-runtime\";\nvar sortSvg = (upside_down) => {\n return /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n style: upside_down ? { transform: \"rotate(180deg)\" } : {},\n className: \"absolute top-[3px] left-1\",\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 1536.000000 1536.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,1536.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M6465 15350 c3 -5 -27 -25 -68 -44 -40 -19 -103 -57 -140 -86 -37 -28 -584 -569 -1215 -1203 -631 -633 -1699 -1705 -2374 -2382 -674 -676 -1237 -1243 -1249 -1260 -13 -16 -37 -46 -53 -65 -36 -41 -108 -185 -126 -250 -32 -119 -30 -352 3 -465 35 -120 102 -231 197 -325 132 -133 288 -208 479 -231 214 -26 418 31 596 166 39 29 703 685 1477 1458 774 772 1432 1421 1461 1441 105 73 239 71 347 -3 52 -36 70 -57 107 -131 17 -33 18 -252 24 -4710 6 -4979 3 -4715 49 -4855 118 -363 507 -605 876 -545 77 13 201 53 245 79 19 12 45 26 59 31 41 18 157 119 206 179 43 53 113 173 127 217 3 11 16 51 29 89 l22 70 6 4690 c5 4887 4 4736 43 4784 6 7 16 23 22 34 20 42 116 103 188 120 42 10 75 13 85 8 10 -5 34 -11 55 -15 20 -4 59 -21 85 -38 26 -17 686 -671 1467 -1453 781 -782 1443 -1439 1470 -1459 68 -49 178 -106 245 -128 30 -10 100 -24 155 -32 87 -12 114 -12 200 1 128 18 187 39 360 131 37 19 178 162 211 212 36 56 94 176 94 194 0 7 7 31 16 52 23 55 23 352 0 406 -9 21 -16 46 -16 56 0 30 -83 185 -130 242 -80 98 -4793 4810 -4865 4865 -66 50 -182 111 -250 132 -16 5 -29 15 -27 21 1 9 -62 12 -249 12 -157 0 -248 -4 -244 -10z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n );\n};\nvar emptyFilterSvg = (solid) => {\n return /* @__PURE__ */ jsx5(Fragment, { children: solid ? /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M382 8980 c-7 -11 -19 -20 -27 -20 -46 0 -166 -99 -196 -162 -46 -95 -51 -115 -47 -199 3 -70 9 -95 37 -149 42 -85 45 -90 118 -190 34 -47 72 -98 83 -115 12 -16 50 -70 85 -120 143 -200 188 -263 235 -330 27 -38 56 -79 64 -90 8 -11 46 -65 85 -120 38 -55 96 -136 128 -179 32 -44 60 -84 62 -90 2 -6 32 -48 65 -93 34 -45 99 -137 146 -203 47 -66 113 -159 148 -205 34 -46 62 -87 62 -90 0 -4 20 -33 45 -65 25 -32 45 -61 45 -64 0 -3 33 -50 73 -105 39 -54 106 -146 147 -205 41 -58 103 -144 138 -191 34 -46 62 -87 62 -90 0 -3 22 -36 50 -73 27 -37 61 -83 75 -102 14 -19 59 -82 100 -140 41 -58 95 -133 120 -167 25 -34 45 -66 45 -70 0 -4 13 -22 28 -40 15 -17 47 -61 72 -97 25 -37 74 -107 110 -156 36 -50 99 -138 140 -196 41 -58 108 -150 148 -205 39 -54 72 -102 72 -105 0 -3 20 -32 45 -64 25 -32 45 -62 45 -67 0 -5 14 -22 30 -38 17 -16 30 -33 30 -38 0 -5 19 -34 43 -65 90 -122 154 -259 178 -387 11 -56 14 -423 19 -1850 l5 -1780 29 -58 c36 -71 112 -148 168 -171 24 -10 51 -22 60 -27 24 -12 205 -11 213 1 3 6 15 10 25 10 11 0 34 6 52 14 18 8 52 21 76 30 64 24 118 44 165 62 23 8 55 22 70 30 16 8 36 14 46 14 9 0 26 7 37 15 10 8 27 15 37 15 11 0 31 6 45 14 15 8 47 22 72 31 25 9 60 23 78 31 18 8 39 14 47 14 7 0 26 6 42 14 15 8 48 22 73 31 25 10 57 23 72 31 14 8 35 14 45 14 11 0 28 7 39 15 10 8 26 15 35 15 14 0 62 19 197 76 18 8 40 14 48 14 9 0 28 6 42 14 28 15 36 18 235 92 23 9 56 22 72 29 17 7 50 21 75 31 84 34 127 77 181 182 9 18 20 56 24 85 4 28 10 714 14 1522 6 1402 7 1472 25 1520 41 109 110 235 188 344 46 62 88 121 93 130 6 9 30 45 55 80 72 101 159 222 250 351 47 67 113 159 148 205 34 46 62 87 62 90 0 4 27 42 60 85 33 43 60 81 60 84 0 3 22 36 50 73 27 37 60 83 72 101 13 18 30 41 38 52 8 10 35 49 60 85 25 37 73 104 108 150 34 46 62 87 62 90 0 3 33 50 73 103 40 53 81 111 91 127 11 17 45 65 78 107 32 43 58 80 58 83 0 4 20 33 45 65 25 32 45 63 45 70 0 6 7 13 15 16 8 4 15 10 15 16 0 5 26 44 58 86 32 42 70 95 85 117 64 95 144 206 208 292 38 51 69 95 69 99 0 3 13 23 29 43 26 33 92 126 193 271 21 30 48 68 60 85 85 112 108 144 108 150 0 3 27 42 60 85 33 43 60 81 60 85 0 3 28 44 63 90 34 47 82 114 107 151 25 36 50 71 56 77 5 7 32 44 58 82 27 39 62 86 77 106 16 20 29 42 29 48 0 6 4 11 8 11 5 0 25 32 45 71 36 68 37 75 37 175 0 118 -13 163 -69 234 -37 48 -127 112 -173 124 -16 3 -28 13 -28 21 0 13 -486 15 -4103 15 -4091 0 -4102 0 -4115 -20z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) : /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 300.000000 300.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,300.000000) scale(0.050000,-0.050000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M58 5702 c-100 -101 -84 -148 136 -416 107 -130 242 -294 301 -366 58 -71 173 -211 254 -310 81 -99 441 -535 799 -969 l652 -789 0 -1201 c0 -1396 2 -1411 182 -1411 60 0 1302 604 1360 662 36 36 38 79 38 935 0 494 5 925 12 959 8 41 370 495 1110 1393 1202 1459 1158 1394 1040 1513 l-59 58 -2883 0 -2883 0 -59 -58z m5349 -327 c-16 -26 -150 -190 -683 -835 -169 -203 -381 -460 -472 -570 -90 -110 -290 -352 -443 -537 -154 -186 -301 -369 -329 -408 l-50 -70 -6 -913 -5 -913 -410 -205 c-225 -112 -413 -204 -418 -204 -6 0 -12 503 -15 1117 l-6 1118 -50 70 c-27 39 -175 222 -329 408 -153 185 -353 427 -443 537 -91 110 -303 367 -472 570 -533 645 -667 809 -683 835 -12 20 474 25 2407 25 1933 0 2419 -5 2407 -25z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) });\n};\nvar slashFilterSvg = (solid) => {\n return /* @__PURE__ */ jsx5(Fragment, { children: solid ? /* @__PURE__ */ jsx5(\"div\", { className: \"mt-[-4px] mr-[-2px] \", children: /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 186 0 14 -3600 3624 -3614 3624 -3 0 -6 -6 -6 -12z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) }) : /* @__PURE__ */ jsx5(\"div\", { className: \"mt-[-4px] mr-[-2px] \", children: /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z m5494 -1490 c6 -10 -1204 -2436 -1226 -2458 -13 -13 -168 139 -1247 1217 -677 677 -1231 1236 -1231 1241 0 12 3697 12 3704 0z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 185 0 18 -692 715 -709 715 -6 0 -11 -38 -13 -97 l-3 -98 -745 0 -745 0 -3 858 -2 859 -694 694 c-382 382 -697 694 -700 694 -3 0 -6 -6 -6 -12z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) }) });\n};\nvar exportToExcelSvg = (width, height, viewBox) => {\n return /* @__PURE__ */ jsxs4(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: width || \"18\",\n height: height || \"18\",\n viewBox: viewBox || \"0 0 150.000000 150.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ jsxs4(\"g\", { transform: \"translate(0.000000,150.000000) scale(0.100000,-0.100000)\", fill: \"#ffffff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M205 1418 c-3 -7 -4 -317 -3 -688 l3 -675 435 -3 c239 -1 441 0 449 3 11 4 9 11 -9 30 l-23 25 -396 2 -396 3 0 625 0 625 280 0 280 0 5 -190 5 -190 190 -5 190 -5 5 -175 5 -175 25 0 25 0 3 200 2 199 -202 203 -203 203 -333 0 c-257 0 -334 -3 -337 -12z m828 -235 c70 -70 127 -131 127 -135 0 -5 -60 -7 -132 -6 l-133 3 -3 133 c-1 72 1 132 6 132 4 0 65 -57 135 -127z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M518 915 c-6 -6 9 -37 42 -90 11 -16 23 -37 27 -45 4 -8 19 -36 35 -61 15 -25 28 -56 28 -68 0 -20 -29 -69 -121 -209 -16 -24 -29 -47 -29 -53 0 -5 31 -9 68 -9 l69 0 42 82 c60 116 66 118 107 35 56 -114 53 -112 127 -115 51 -2 67 0 67 11 0 7 -5 18 -11 24 -11 11 -26 36 -49 78 -6 11 -19 34 -30 50 -11 17 -24 40 -29 52 -5 11 -15 24 -20 28 -26 16 -18 33 97 212 25 39 39 70 34 75 -5 5 -36 8 -68 6 l-59 -3 -42 -84 c-24 -46 -45 -86 -48 -89 -6 -6 -44 40 -45 54 0 6 -13 35 -29 65 l-28 54 -65 3 c-35 2 -67 0 -70 -3z\" }),\n \" \",\n /* @__PURE__ */ jsx5(\"path\", { d: \"M1135 548 c-3 -7 -6 -67 -7 -133 l-3 -120 -55 -3 c-30 -1 -61 -5 -68 -7 -8 -3 28 -53 95 -132 122 -146 129 -153 140 -153 4 0 22 17 38 37 26 32 53 63 175 206 13 15 30 27 38 27 9 0 12 3 8 7 -3 4 -39 9 -79 12 l-72 6 -5 130 -5 130 -98 3 c-72 2 -99 -1 -102 -10z m145 -183 l5 -130 28 -3 c15 -2 27 -8 27 -14 0 -18 -92 -128 -107 -128 -11 1 -97 107 -101 125 -2 8 7 15 25 17 l28 3 3 120 c1 66 4 126 7 133 3 9 18 12 42 10 l38 -3 5 -130z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n );\n};\n\n// src/components/table/hooks.tsx\nimport { useContext as useContext2, useDeferredValue, useState as useState2, useTransition } from \"react\";\nimport { create } from \"zustand\";\nimport { isEqual as isEqual2 } from \"lodash\";\n\n// src/components/table/Table.tsx\nimport React2, { createContext, useMemo } from \"react\";\nimport { isEqual } from \"lodash\";\n\n// src/helpers/forms.ts\nimport XRegExp from \"xregexp\";\nvar textRegex = XRegExp(\"[^\\\\p{L}\\\\s-]\", \"gu\");\nvar numbersRegex = XRegExp(\"[^0-9\\\\s-+]\", \"g\");\nvar numbersOnlyRegex = XRegExp(\"[^0-9]\", \"g\");\nvar priceRegex = XRegExp(\"[^0-9.]\", \"g\");\nvar emailRegex = XRegExp(\"[^\\\\p{L}0-9.@\\\\s-]\", \"gu\");\nvar colorRegex = XRegExp(\"[^#0-9A-Fa-f]\", \"g\");\nvar carsRegex = XRegExp(\"[^\\\\p{L}0-9,_]\", \"gu\");\nvar textNumbersRegex = XRegExp(\"[^\\\\p{L}0-9\\\\s+\\\\-]\", \"gu\");\nvar addressRegex = XRegExp(\"[^\\\\p{L}0-9\\\\s.,+-\\\\-]\", \"gu\");\nvar chartsRegex = XRegExp(\"[^\\\\p{L}0-9\\\\s.,_@!+-\\\\-]\", \"gu\");\nvar handleChange = (e) => {\n e.target.setCustomValidity(\"\");\n const validation = e.target.getAttribute(\"data-validation\");\n if (validation === \"text\") {\n e.target.value = XRegExp.replace(e.target.value, textRegex, \"\");\n } else if (validation === \"numbers\") {\n e.target.value = XRegExp.replace(e.target.value, numbersRegex, \"\");\n } else if (validation === \"numbersOnly\") {\n e.target.value = XRegExp.replace(e.target.value, numbersOnlyRegex, \"\");\n } else if (validation === \"price\") {\n e.target.value = XRegExp.replace(e.target.value, priceRegex, \"\");\n } else if (validation === \"textNumbers\") {\n e.target.value = XRegExp.replace(e.target.value, textNumbersRegex, \"\");\n } else if (validation === \"email\") {\n e.target.value = XRegExp.replace(e.target.value, emailRegex, \"\");\n } else if (validation === \"color\") {\n e.target.value = XRegExp.replace(e.target.value, colorRegex, \"\");\n } else if (validation === \"address\") {\n e.target.value = XRegExp.replace(e.target.value, addressRegex, \"\");\n } else if (validation === \"cars\") {\n e.target.value = XRegExp.replace(e.target.value, carsRegex, \"\");\n } else if (validation === \"charts\") {\n e.target.value = XRegExp.replace(e.target.value, chartsRegex, \"\");\n }\n};\nvar handlePaste = (e) => {\n const validation = e.currentTarget.getAttribute(\"data-validation\");\n let pasteData = e.clipboardData.getData(\"text\");\n if (validation === \"text\") {\n pasteData = XRegExp.replace(pasteData, textRegex, \"\");\n } else if (validation === \"numbers\") {\n pasteData = XRegExp.replace(pasteData, numbersRegex, \"\");\n } else if (validation === \"numbersOnly\") {\n pasteData = XRegExp.replace(pasteData, numbersOnlyRegex, \"\");\n } else if (validation === \"price\") {\n pasteData = XRegExp.replace(pasteData, priceRegex, \"\");\n } else if (validation === \"textNumbers\") {\n pasteData = XRegExp.replace(pasteData, textNumbersRegex, \"\");\n } else if (validation === \"email\") {\n pasteData = XRegExp.replace(pasteData, emailRegex, \"\");\n } else if (validation === \"color\") {\n pasteData = XRegExp.replace(pasteData, colorRegex, \"\");\n } else if (validation === \"address\") {\n pasteData = XRegExp.replace(pasteData, addressRegex, \"\");\n } else if (validation === \"cars\") {\n pasteData = XRegExp.replace(pasteData, carsRegex, \"\");\n } else if (validation === \"charts\") {\n pasteData = XRegExp.replace(pasteData, chartsRegex, \"\");\n }\n e.preventDefault();\n document.execCommand(\"insertText\", false, pasteData);\n};\nvar handleInvalid = (e, requireError) => {\n e.target.setCustomValidity(requireError || \"This filed is required !\");\n};\nvar useValidation = (validationType, requireError) => {\n return {\n onChange: handleChange,\n onPaste: handlePaste,\n onInvalid: (e) => handleInvalid(e, requireError),\n \"data-validation\": validationType\n };\n};\nvar getFormElementValue = (form, name) => {\n return form.elements.namedItem(name)?.value || \"\";\n};\n\n// src/components/table/Table.tsx\nimport { jsx as jsx6, jsxs as jsxs5 } from \"react/jsx-runtime\";\nvar TableContext = createContext(null);\nvar TableProvider = (props) => {\n const {\n // basic props\n data,\n headers,\n optionalElement,\n keysToRender = [],\n direction = \"ltr\",\n onRowClick = (data2) => {\n },\n // container styles props\n containerStyle,\n containerClassName = \"\",\n tableContainerClass = \"\",\n tableContainerStyle = {},\n tableStyle = {},\n // row style\n rowStyles = {},\n rowClassName,\n // cell style\n cellClassName,\n cellStyle = {},\n // header styles\n headerStyle = {},\n headerCellStyle,\n searchInputStyle = {},\n // search\n searchInputClassName = \"\",\n includeSearch,\n searchPlaceHolder,\n // sort\n sortKeys,\n sortLabel = \"Sort by\",\n // filter\n filterableColumns = [],\n filterLabel = \"Filter by\",\n // export to excel\n exportToExcelKeys,\n dataToAddToExcelTable,\n exportExcelTitle = \"Export to excel\",\n excelFileName,\n // summary\n sumColumns,\n summaryLabel = \"\",\n summaryContainerStyle = {},\n summaryLabelStyle = {},\n summaryRowStyle = {},\n // max rows\n maxRows = data.length\n } = props;\n const { sortColumn, sortOrder, handleSort, clearSort } = useSort();\n const { searchQuery, handleSearch, clearSearch, deferredSearchQuery } = useSearch();\n const { filters, filterPopupsDisplay, filterOptions, handleFilterChange, handleFilterClick, closeFilterWindow, clearFilter } = useFilter({\n data,\n filterableColumns\n });\n const allKeys = useMemo(() => {\n return Array.from(\n data.reduce((keys, obj) => {\n Object.keys(obj).forEach((key) => keys.add(key));\n return keys;\n }, /* @__PURE__ */ new Set())\n );\n }, [data]);\n const dataToRender = useMemo(() => {\n let filtered = data;\n if (includeSearch && deferredSearchQuery.length > 0) {\n const cleanString = (str) => str.replace(textNumbersRegex, \"\").toLowerCase().trim();\n const normalizedSearchQuery = cleanString(deferredSearchQuery);\n filtered = data.filter(\n (item) => allKeys.some((key) => {\n return cleanString(String(item[key])).includes(normalizedSearchQuery);\n })\n );\n }\n if (filterableColumns.length > 0 && filterPopupsDisplay !== \"\") {\n console.log(\"filtering ...\");\n Object.keys(filters).forEach((key) => {\n if (filters[key].length > 0) {\n filtered = filtered.filter((item) => filters[key].includes(item[key]));\n }\n });\n }\n if (sortColumn !== null && sortOrder !== null && sortKeys?.length > 0) {\n console.log(\"sorting ...\");\n filtered = filtered.sort((a, b) => {\n const aValue = a[sortKeys[sortColumn]];\n const bValue = b[sortKeys[sortColumn]];\n if (aValue < bValue) return sortOrder === \"asc\" ? -1 : 1;\n if (aValue > bValue) return sortOrder === \"asc\" ? 1 : -1;\n return 0;\n });\n }\n const renderedData = filtered.length > maxRows ? filtered.slice(0, maxRows) : filtered;\n return { renderedData, filtered };\n }, [deferredSearchQuery, sortColumn, sortOrder, filters, data]);\n const providerValues = {\n ...props,\n // props with default values\n direction,\n keysToRender,\n filterableColumns,\n maxRows,\n // states and functions\n sortColumn,\n sortOrder,\n handleSort,\n searchQuery,\n deferredSearchQuery,\n handleSearch,\n dataToRender,\n filters,\n filterPopupsDisplay,\n filterOptions,\n handleFilterChange,\n handleFilterClick,\n closeFilterWindow\n };\n return /* @__PURE__ */ jsx6(TableContext.Provider, { value: providerValues, children: /* @__PURE__ */ jsx6(\"div\", { className: `flex flex-col gap-2 ${containerClassName}`, style: { ...containerStyle, direction }, children: props.children }) });\n};\nvar TableBase = (props) => {\n const {\n containerHeaderClassName,\n optionalElement,\n tableContainerClass,\n tableContainerStyle,\n tableStyle,\n includeSearch,\n exportToExcelKeys,\n sumColumns,\n direction,\n maxRowsLabel1,\n maxRowsLabel2,\n searchContainerClassName\n } = props;\n return /* @__PURE__ */ jsxs5(TableProvider, { ...props, children: [\n /* @__PURE__ */ jsxs5(\"div\", { style: { direction }, className: cn(\"flex justify-start items-center gap-2\", containerHeaderClassName || \"\"), children: [\n /* @__PURE__ */ jsxs5(\"div\", { className: cn(\"flex justify-start items-center gap-2\", searchContainerClassName), children: [\n includeSearch && /* @__PURE__ */ jsx6(Search, {}),\n exportToExcelKeys && /* @__PURE__ */ jsx6(ExportToExcel, {})\n ] }),\n maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */ jsx6(MaxRowsLabel, {}),\n optionalElement && optionalElement\n ] }),\n /* @__PURE__ */ jsx6(\n \"div\",\n {\n style: { ...tableContainerStyle || {}, direction },\n className: cn(`animate-slide-in-up overflow-y-auto`, tableContainerClass || \"\"),\n children: /* @__PURE__ */ jsxs5(\"table\", { style: tableStyle, className: \"min-w-full text-sm font-light relative\", children: [\n /* @__PURE__ */ jsx6(TableHead, {}),\n /* @__PURE__ */ jsx6(TableBody, {})\n ] })\n }\n ),\n sumColumns && /* @__PURE__ */ jsx6(Summary, {})\n ] });\n};\nvar areEqual = (prevProps, nextProps) => isEqual(prevProps, nextProps);\nvar Table = React2.memo(TableBase, areEqual);\nTable.displayName = \"Table\";\n\n// src/components/table/hooks.tsx\nvar useTableContext = () => {\n const context = useContext2(TableContext);\n if (!context) {\n throw new Error(\"useTableContext must be used within a Table component\");\n }\n return context;\n};\nvar useFilter = ({ data, filterableColumns }) => {\n const initFilter = filterableColumns.reduce((acc, col) => ({ ...acc, [col.dataKey]: [] }), {});\n const [filters, setFilters] = useState2(initFilter);\n const [filterPopupsDisplay, setFilterPopupsDisplay] = useState2(\"\");\n const filterOptions = filterableColumns.reduce((acc, col) => {\n acc[col.dataKey] = Array.from(new Set(data.map((item) => item[col.dataKey])));\n return acc;\n }, {});\n const handleFilterChange = (dataKey, value) => {\n const newFilters = { ...filters };\n if (newFilters[dataKey].includes(value)) {\n newFilters[dataKey] = newFilters[dataKey].filter((item) => item !== value);\n } else {\n newFilters[dataKey].push(value);\n }\n setFilters(newFilters);\n };\n const clearFilter = () => {\n if (!isEqual2(filters, initFilter)) {\n setFilters(initFilter);\n }\n };\n const handleFilterClick = (dataKey) => {\n setFilterPopupsDisplay((prev) => {\n if (prev === dataKey) {\n setFilters(initFilter);\n return \"\";\n }\n return dataKey;\n });\n };\n const closeFilterWindow = () => {\n setFilterPopupsDisplay(\"\");\n };\n return {\n filters,\n filterPopupsDisplay,\n filterOptions,\n handleFilterChange,\n handleFilterClick,\n closeFilterWindow,\n clearFilter\n };\n};\nvar useSort = () => {\n const [sortColumn, setSortColumn] = useState2(null);\n const [sortOrder, setSortOrder] = useState2(null);\n const handleSort = (columnIndex) => {\n let newSortOrder = \"asc\";\n if (sortColumn === columnIndex && sortOrder === \"asc\") {\n newSortOrder = \"desc\";\n }\n setSortColumn(columnIndex);\n setSortOrder(newSortOrder);\n };\n const clearSort = () => {\n if (sortColumn) {\n setSortColumn(null);\n }\n if (sortOrder) {\n setSortOrder(null);\n }\n };\n return { sortColumn, sortOrder, handleSort, clearSort };\n};\nvar useSearch = () => {\n const [searchQuery, setSearchQuery] = useState2(\"\");\n const [isPending, startTransition] = useTransition();\n const deferredSearchQuery = useDeferredValue(searchQuery);\n const handleSearch = (e) => {\n const value = e.target.value;\n startTransition(() => {\n setSearchQuery(value);\n });\n };\n const clearSearch = () => {\n if (searchQuery) {\n startTransition(() => {\n setSearchQuery(\"\");\n });\n }\n };\n return { searchQuery, handleSearch, clearSearch, isPending, deferredSearchQuery };\n};\n\n// src/helpers/firebase.ts\nimport moment from \"moment\";\nimport { initializeApp } from \"firebase/app\";\nimport { getStorage } from \"firebase/storage\";\nimport { getAuth } from \"firebase/auth\";\nimport {\n addDoc,\n collection,\n deleteDoc,\n doc,\n getDoc,\n getDocs,\n query,\n setDoc,\n Timestamp,\n where,\n getFirestore,\n onSnapshot,\n orderBy\n} from \"firebase/firestore\";\nvar initApp = () => {\n const isNodeEnv2 = typeof process !== \"undefined\" && process.env;\n const firebaseConfig = {\n apiKey: isNodeEnv2 ? process.env.NEXT_PUBLIC_API_KEY : import.meta.env.VITE_API_KEY,\n authDomain: isNodeEnv2 ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import.meta.env.VITE_AUTH_DOMAIN,\n projectId: isNodeEnv2 ? process.env.NEXT_PUBLIC_PROJECT_ID : import.meta.env.VITE_PROJECT_ID,\n storageBucket: isNodeEnv2 ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import.meta.env.VITE_STORAGE_BUCKET,\n messagingSenderId: isNodeEnv2 ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import.meta.env.VITE_MESSAGING_SENDER_ID,\n appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID\n };\n try {\n const app = initializeApp(firebaseConfig);\n const auth2 = getAuth(app);\n const db2 = getFirestore(app);\n const storage2 = getStorage(app);\n return { db: db2, auth: auth2, storage: storage2 };\n } catch (error) {\n console.error(\"Failed to initialize Firebase app:\", error);\n return {};\n }\n};\nvar { db, auth, storage } = initApp();\nvar collections = {\n clients: collection(db, \"nx-clients\"),\n sites: collection(db, \"nx-sites\"),\n cars: collection(db, \"units\"),\n users: collection(db, \"nx-users\"),\n lastLocations: collection(db, \"last_locations\"),\n ermEvents: collection(db, \"erm_events_general\"),\n erm2Events: collection(db, \"erm2_events_general\"),\n ruptelaEvents: collection(db, \"ruptela_events_general\"),\n polygons: collection(db, \"nx-polygons\"),\n polygonEvents: collection(db, \"polygon_events\"),\n polygonCars: collection(db, \"polygon_cars\"),\n canbus: collection(db, \"erm_canbus_parameters\"),\n states: collection(db, \"erm_states\"),\n app_pro_commands_queue: collection(db, \"app_pro_commands_queue\"),\n trips: collection(db, \"erm2_trip\"),\n tripsDetails: collection(db, \"erm2_trip_details\"),\n audit: collection(db, \"nx-audit\"),\n nx_settings: collection(db, \"nx-settings\"),\n settings: collection(db, \"settings\"),\n translations: collection(db, \"nx-translations\"),\n nx_cars: collection(db, \"nx-cars\"),\n boards: collection(db, \"boards\"),\n protection_types: collection(db, \"protectionTypes\"),\n board_types: collection(db, \"boardTypes\"),\n charge_capacities: collection(db, \"nx-charge-capacities\")\n};\nvar fire_base_TIME_TEMP = Timestamp.now;\n\n// src/helpers/global.ts\nimport { CountryOptions } from \"akeyless-types-commons\";\nimport axios from \"axios\";\n\n// src/helpers/phoneNumber.ts\nimport { parsePhoneNumberFromString } from \"libphonenumber-js\";\n\n// src/helpers/global.ts\nimport { isEqual as isEqual3 } from \"lodash\";\nvar renderOnce = () => {\n return true;\n};\nvar getLocationUrl = (lang, lat) => {\n return `https://www.google.com/maps?q=${lang},${lat}`;\n};\nvar isNodeEnv = typeof process !== \"undefined\" && process.env;\nvar { mode, isLocal } = {\n mode: isNodeEnv ? process.env.NEXT_PUBLIC_MODE : import.meta.env.VITE_MODE,\n isLocal: (isNodeEnv ? process.env.NEXT_PUBLIC_IS_LOCAL : import.meta.env.VITE_is_local) === \"true\"\n};\n\n// src/helpers/time_helpers.ts\nimport { Timestamp as Timestamp2 } from \"firebase/firestore\";\nimport moment2 from \"moment-timezone\";\nfunction timestamp_to_string(firebaseTimestamp, options) {\n let date;\n if (firebaseTimestamp instanceof Timestamp2) {\n date = firebaseTimestamp.toDate();\n } else if (firebaseTimestamp instanceof Date) {\n date = firebaseTimestamp;\n } else if (typeof firebaseTimestamp === \"string\") {\n date = moment2.utc(firebaseTimestamp, options?.fromFormat || \"DD/MM/YYYY HH:mm:ss\").toDate();\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date string format\");\n }\n } else {\n throw new Error(\"Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.\");\n }\n if (options?.tz) {\n const result = moment2(date).tz(options?.tz).format(options?.format || \"DD/MM/YYYY HH:mm:ss\");\n return result;\n }\n return moment2.utc(date).format(options?.format || \"DD/MM/YYYY HH:mm:ss\");\n}\n\n// src/helpers/api.ts\nimport axios2 from \"axios\";\nvar baseDomain = mode === \"qa\" ? \"https://nx-api.xyz/api\" : \"https://nx-api.info/api\";\nvar devicesDomain = isLocal ? \"http://localhost:9001/api/devices\" : baseDomain + \"/devices\";\nvar biDomain = isLocal ? \"http://localhost:9002/api/bi\" : baseDomain + \"/bi\";\nvar callCenterDomain = isLocal ? \"http://localhost:9003/api/call-center\" : baseDomain + \"/call-center\";\n\n// src/components/ui/badge.tsx\nimport { cva } from \"class-variance-authority\";\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n outline: \"text-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ jsx7(\"div\", { className: cn(badgeVariants({ variant }), className), ...props });\n}\n\n// src/components/ui/button.tsx\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva as cva2 } from \"class-variance-authority\";\nimport * as React3 from \"react\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar buttonVariants = cva2(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive: \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40\",\n outline: \"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"size-9\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Button = React3.forwardRef(\n ({ className, variant, size: size3, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return /* @__PURE__ */ jsx8(Comp, { ref, \"data-slot\": \"button\", className: cn(buttonVariants({ variant, size: size3, className })), ...props });\n }\n);\nButton.displayName = \"Button\";\n\n// src/components/ui/input.tsx\nimport * as React4 from \"react\";\nimport { jsx as jsx9 } from \"react/jsx-runtime\";\nvar Input = React4.forwardRef(\n ({ className, type, ...props }, ref) => {\n return /* @__PURE__ */ jsx9(\n \"input\",\n {\n type,\n className: cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n ),\n ref,\n ...props\n }\n );\n }\n);\nInput.displayName = \"Input\";\n\n// src/components/ui/progress.tsx\nimport * as React5 from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { jsx as jsx10 } from \"react/jsx-runtime\";\nvar ProgressComponent = React5.forwardRef(\n ({ className, value, containerClassName, indicatorClassName, showValueClassName, showValue = false, ...props }, ref) => /* @__PURE__ */ jsx10(\"div\", { className: cn(\"relative w-full\", containerClassName), children: /* @__PURE__ */ jsx10(ProgressPrimitive.Root, { ref, className: cn(\"w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full\", className), ...props, children: /* @__PURE__ */ jsx10(\n ProgressPrimitive.Indicator,\n {\n className: cn(\"h-full w-full flex-1 bg-[green] transition-all rounded-full\", indicatorClassName),\n style: { transform: `translateX(-${100 - (value || 0)}%)` },\n children: showValue && /* @__PURE__ */ jsx10(\"div\", { className: cn(\"absolute right-1 top-[-2px] font-medium text-white\", showValueClassName), children: `${value || 0}%` })\n }\n ) }) })\n);\nProgressComponent.displayName = ProgressPrimitive.Root.displayName;\n\n// src/components/ui/multiselect.tsx\nimport ReactDOM2 from \"react-dom\";\nimport { Command as CommandPrimitive2, useCommandState } from \"cmdk\";\nimport { X as X2 } from \"lucide-react\";\nimport * as React9 from \"react\";\nimport { forwardRef as forwardRef6, useEffect as useEffect4, useCallback as useCallback2, useMemo as useMemo4, useRef as useRef3 } from \"react\";\n\n// src/components/ui/command.tsx\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search as Search2 } from \"lucide-react\";\nimport * as React7 from \"react\";\n\n// src/components/ui/dialog.tsx\nimport * as React6 from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport { jsx as jsx11, jsxs as jsxs6 } from \"react/jsx-runtime\";\nvar DialogPortal = DialogPrimitive.Portal;\nvar DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(\n DialogPrimitive.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props\n }\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nvar DialogContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(DialogPortal, { children: [\n /* @__PURE__ */ jsx11(DialogOverlay, {}),\n /* @__PURE__ */ jsxs6(\n DialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsxs6(DialogPrimitive.Close, { className: \"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\", children: [\n /* @__PURE__ */ jsx11(X, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx11(\"span\", { className: \"sr-only\", children: \"Close\" })\n ] })\n ]\n }\n )\n] }));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nvar DialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx11(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className\n ),\n ...props\n }\n);\nDialogHeader.displayName = \"DialogHeader\";\nvar DialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx11(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nDialogFooter.displayName = \"DialogFooter\";\nvar DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(\n DialogPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className\n ),\n ...props\n }\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nvar DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(\n DialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n// src/components/ui/command.tsx\nimport { jsx as jsx12, jsxs as jsxs7 } from \"react/jsx-runtime\";\nvar Command = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(\n CommandPrimitive,\n {\n ref,\n className: cn(\"flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground\", className),\n ...props\n }\n )\n);\nCommand.displayName = CommandPrimitive.displayName;\nvar CommandInput = React7.forwardRef(({ className, withSearchIcon, ...props }, ref) => /* @__PURE__ */ jsxs7(\"div\", { className: \"flex items-center border-b border-input px-3\", \"cmdk-input-wrapper\": \"\", children: [\n withSearchIcon && /* @__PURE__ */ jsx12(Search2, { size: 20, strokeWidth: 2, className: \"me-3 text-muted-foreground/80\" }),\n /* @__PURE__ */ jsx12(\n CommandPrimitive.Input,\n {\n ref,\n className: cn(\n \"flex h-10 w-full rounded-lg bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props\n }\n )\n] }));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\nvar CommandList = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(CommandPrimitive.List, { ref, className: cn(\"max-h-80 overflow-y-auto overflow-x-hidden\", className), ...props })\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\nvar CommandEmpty = React7.forwardRef(\n (props, ref) => /* @__PURE__ */ jsx12(CommandPrimitive.Empty, { ref, className: \"py-6 text-center text-sm\", ...props })\n);\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nvar CommandGroup = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(\n CommandPrimitive.Group,\n {\n ref,\n className: cn(\n \"overflow-hidden p-2 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n ),\n ...props\n }\n )\n);\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nvar CommandSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(CommandPrimitive.Separator, { ref, className: cn(\"-mx-1 h-px bg-border\", className), ...props }));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nvar CommandItem = React7.forwardRef(\n ({ className, ...props }, ref) => /* @__PURE__ */ jsx12(\n CommandPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n ),\n ...props\n }\n )\n);\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nvar CommandShortcut = ({ className, ...props }) => {\n return /* @__PURE__ */ jsx12(\n \"kbd\",\n {\n className: cn(\n \"-me-1 ms-auto inline-flex h-5 max-h-full items-center rounded border border-border bg-background px-1 font-[inherit] text-[0.625rem] font-medium text-muted-foreground/70\",\n className\n ),\n ...props\n }\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n// src/components/ui/multiselect.tsx\nimport { isEqual as isEqual4 } from \"lodash\";\n\n// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs\nvar min = Math.min;\nvar max = Math.max;\nvar round = Math.round;\nvar floor = Math.floor;\nvar createCoords = (v) => ({\n x: v,\n y: v\n});\nvar oppositeSideMap = {\n left: \"right\",\n right: \"left\",\n bottom: \"top\",\n top: \"bottom\"\n};\nvar oppositeAlignmentMap = {\n start: \"end\",\n end: \"start\"\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === \"function\" ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split(\"-\")[0];\n}\nfunction getAlignment(placement) {\n return placement.split(\"-\")[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === \"x\" ? \"y\" : \"x\";\n}\nfunction getAxisLength(axis) {\n return axis === \"y\" ? \"height\" : \"width\";\n}\nfunction getSideAxis(placement) {\n return [\"top\", \"bottom\"].includes(getSide(placement)) ? \"y\" : \"x\";\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === \"x\" ? alignment === (rtl ? \"end\" : \"start\") ? \"right\" : \"left\" : alignment === \"start\" ? \"bottom\" : \"top\";\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = [\"left\", \"right\"];\n const rl = [\"right\", \"left\"];\n const tb = [\"top\", \"bottom\"];\n const bt = [\"bottom\", \"top\"];\n switch (side) {\n case \"top\":\n case \"bottom\":\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case \"left\":\n case \"right\":\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === \"start\", rtl);\n if (alignment) {\n list = list.map((side) => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== \"number\" ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\n// node_modules/@floating-ui/core/dist/floating-ui.core.mjs\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === \"y\";\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case \"top\":\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case \"bottom\":\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case \"right\":\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case \"left\":\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case \"start\":\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case \"end\":\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\nvar computePosition = async (reference, floating, config) => {\n const {\n placement = \"bottom\",\n strategy = \"absolute\",\n middleware = [],\n platform: platform2\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));\n let rects = await platform2.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platform2,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === \"object\") {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform2.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform: platform2,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = \"clippingAncestors\",\n rootBoundary = \"viewport\",\n elementContext = \"floating\",\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === \"floating\" ? \"reference\" : \"floating\";\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform2.getClippingRect({\n element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === \"floating\" ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));\n const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\nvar flip = function(options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: \"flip\",\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform: platform2,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = \"bestFit\",\n fallbackAxisSideDirection = \"none\",\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== \"none\";\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements2 = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides2 = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides2[0]], overflow[sides2[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n if (!overflows.every((side2) => side2 <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements2[nextIndex];\n if (nextPlacement) {\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case \"bestFit\": {\n var _overflowsData$filter2;\n const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === \"y\";\n }\n return true;\n }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement2) {\n resetPlacement = placement2;\n }\n break;\n }\n case \"initialPlacement\":\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform: platform2,\n elements\n } = state;\n const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === \"y\";\n const mainAxisMulti = [\"left\", \"top\"].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === \"number\" ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === \"number\") {\n crossAxis = alignment === \"end\" ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\nvar offset = function(options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: \"offset\",\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\nvar shift = function(options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: \"shift\",\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: (_ref) => {\n let {\n x: x2,\n y: y2\n } = _ref;\n return {\n x: x2,\n y: y2\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === \"y\" ? \"top\" : \"left\";\n const maxSide = mainAxis === \"y\" ? \"bottom\" : \"right\";\n const min2 = mainAxisCoord + overflow[minSide];\n const max2 = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min2, mainAxisCoord, max2);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === \"y\" ? \"top\" : \"left\";\n const maxSide = crossAxis === \"y\" ? \"bottom\" : \"right\";\n const min2 = crossAxisCoord + overflow[minSide];\n const max2 = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min2, crossAxisCoord, max2);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n\n// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs\nfunction hasWindow() {\n return typeof window !== \"undefined\";\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || \"\").toLowerCase();\n }\n return \"#document\";\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === \"undefined\") {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && ![\"inline\", \"contents\"].includes(display);\n}\nfunction isTableElement(element) {\n return [\"table\", \"td\", \"th\"].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [\":popover-open\", \":modal\"].some((selector) => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n return [\"transform\", \"translate\", \"scale\", \"rotate\", \"perspective\"].some((value) => css[value] ? css[value] !== \"none\" : false) || (css.containerType ? css.containerType !== \"normal\" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== \"none\" : false) || !webkit && (css.filter ? css.filter !== \"none\" : false) || [\"transform\", \"translate\", \"scale\", \"rotate\", \"perspective\", \"filter\"].some((value) => (css.willChange || \"\").includes(value)) || [\"paint\", \"layout\", \"strict\", \"content\"].some((value) => (css.contain || \"\").includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === \"undefined\" || !CSS.supports) return false;\n return CSS.supports(\"-webkit-backdrop-filter\", \"none\");\n}\nfunction isLastTraversableNode(node) {\n return [\"html\", \"body\", \"#document\"].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === \"html\") {\n return node;\n }\n const result = (\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot || // DOM Element detected.\n node.parentNode || // ShadowRoot detected.\n isShadowRoot(node) && node.host || // Fallback.\n getDocumentElement(node)\n );\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\n// node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\nvar noOffsets = /* @__PURE__ */ createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (\n // RTL <body> scrollbar.\n getWindowScrollBarX(documentElement, htmlRect)\n ));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === \"fixed\";\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== \"body\" || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === \"rtl\") {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === \"fixed\") {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === \"fixed\");\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === \"viewport\") {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === \"document\") {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === \"fixed\" || hasFixedPositionAncestor(parentNode, stopNode);\n}\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== \"body\");\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === \"fixed\";\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === \"fixed\") {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === \"static\" && !!currentContainingBlockComputedStyle && [\"absolute\", \"fixed\"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n result = result.filter((ancestor) => ancestor !== currentNode);\n } else {\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === \"clippingAncestors\" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === \"fixed\";\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== \"body\" || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === \"static\";\n}\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === \"fixed\") {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\nvar getElementRects = async function(data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\nfunction isRTL(element) {\n return getComputedStyle(element).direction === \"rtl\";\n}\nvar platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1e3);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n refresh();\n }\n isFirstUpdate = false;\n }\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === \"function\",\n layoutShift = typeof IntersectionObserver === \"function\",\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];\n ancestors.forEach((ancestor) => {\n ancestorScroll && ancestor.addEventListener(\"scroll\", update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener(\"resize\", update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver((_ref) => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach((ancestor) => {\n ancestorScroll && ancestor.removeEventListener(\"scroll\", update);\n ancestorResize && ancestor.removeEventListener(\"resize\", update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\nvar offset2 = offset;\nvar shift2 = shift;\nvar flip2 = flip;\nvar computePosition2 = (reference, floating, options) => {\n const cache = /* @__PURE__ */ new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\n// node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs\nimport * as React8 from \"react\";\nimport { useLayoutEffect, useEffect as useEffect3 } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nvar index = typeof document !== \"undefined\" ? useLayoutEffect : useEffect3;\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === \"function\" && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === \"object\") {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0; ) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0; ) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0; ) {\n const key = keys[i];\n if (key === \"_owner\" && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\nfunction getDPR(element) {\n if (typeof window === \"undefined\") {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\nfunction useLatestRef(value) {\n const ref = React8.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = \"bottom\",\n strategy = \"absolute\",\n middleware = [],\n platform: platform2,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React8.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React8.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React8.useState(null);\n const [_floating, _setFloating] = React8.useState(null);\n const setReference = React8.useCallback((node) => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React8.useCallback((node) => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React8.useRef(null);\n const floatingRef = React8.useRef(null);\n const dataRef = React8.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform2);\n const openRef = useLatestRef(open);\n const update = React8.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {\n const fullData = {\n ...data2,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData((data2) => ({\n ...data2,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React8.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React8.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React8.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React8.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...getDPR(elements.floating) >= 1.5 && {\n willChange: \"transform\"\n }\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React8.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\nvar offset3 = (options, deps) => ({\n ...offset2(options),\n options: [options, deps]\n});\nvar shift3 = (options, deps) => ({\n ...shift2(options),\n options: [options, deps]\n});\nvar flip3 = (options, deps) => ({\n ...flip2(options),\n options: [options, deps]\n});\n\n// src/components/ui/multiselect.tsx\nimport { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs8 } from \"react/jsx-runtime\";\nvar Portal2 = ({ children }) => {\n return ReactDOM2.createPortal(children, document.body);\n};\nfunction transToGroupOption(options, groupBy) {\n if (options.length === 0) return {};\n if (!groupBy) return { \"\": options };\n const groupOption = {};\n options.forEach((option) => {\n const key = option[groupBy] || \"\";\n if (!groupOption[key]) {\n groupOption[key] = [];\n }\n groupOption[key].push(option);\n });\n return groupOption;\n}\nfunction removePickedOption(groupOption, picked) {\n const cloneOption = JSON.parse(JSON.stringify(groupOption));\n for (const [key, value] of Object.entries(cloneOption)) {\n cloneOption[key] = value.filter((val) => !picked.find((p) => p.value === val.value));\n }\n return cloneOption;\n}\nfunction isOptionsExist(groupOption, targetOption) {\n for (const [, value] of Object.entries(groupOption)) {\n if (value.some((option) => targetOption.find((p) => p.value === option.value))) {\n return true;\n }\n }\n return false;\n}\nvar CommandEmpty2 = forwardRef6(({ className, ...props }, forwardedRef) => {\n const render = useCommandState((state) => state.filtered.count === 0);\n if (!render) return null;\n return /* @__PURE__ */ jsx13(\"div\", { ref: forwardedRef, className: cn(\"px-2 py-4 text-center text-sm\", className), \"cmdk-empty\": \"\", role: \"presentation\", ...props });\n});\nCommandEmpty2.displayName = \"CommandEmpty\";\nfunction useDebounce(value, delay) {\n const [debouncedValue, setDebouncedValue] = React9.useState(value);\n useEffect4(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay || 500);\n return () => clearTimeout(timer);\n }, [value, delay]);\n return debouncedValue;\n}\nvar MultipleSelector = forwardRef6(\n ({\n value,\n onChange,\n placeholder,\n defaultOptions: arrayDefaultOptions = [],\n options: arrayOptions,\n delay,\n onSearch,\n onSearchSync,\n loadingIndicator,\n emptyIndicator,\n maxSelected = Number.MAX_SAFE_INTEGER,\n onMaxSelected,\n hidePlaceholderWhenSelected = true,\n disabled,\n groupBy,\n className,\n badgeClassName,\n selectFirstItem = true,\n creatable = false,\n triggerSearchOnFocus = true,\n commandProps,\n inputProps,\n hideClearAllButton = false,\n dropdownClassName,\n dropdownOptionClassName,\n emptyIndicatorClassName,\n unremovableOptions = [],\n name,\n dropdownContainerClassName = \"\"\n }, ref) => {\n const [isLoading, setIsLoading] = React9.useState(false);\n const { x, y, strategy, refs, update } = useFloating({\n placement: \"bottom-start\",\n middleware: [offset3(4), flip3(), shift3()],\n whileElementsMounted: autoUpdate\n });\n const containerRef = useRef3(null);\n const setContainerRef = (node) => {\n containerRef.current = node;\n refs.setReference(node);\n };\n const inputRef = useRef3(null);\n const [open, setOpen] = React9.useState(false);\n const [onScrollbar, setOnScrollbar] = React9.useState(false);\n const dropdownRef = useRef3(null);\n const [selected, setSelected] = React9.useState(value || []);\n const [options, setOptions] = React9.useState(transToGroupOption(arrayDefaultOptions, groupBy));\n const [inputValue, setInputValue] = React9.useState(\"\");\n const debouncedSearchTerm = useDebounce(inputValue, delay || 500);\n React9.useImperativeHandle(\n ref,\n () => ({\n selectedValue: [...selected],\n input: inputRef.current,\n focus: () => inputRef.current?.focus(),\n reset: () => setSelected([])\n }),\n [selected]\n );\n useEffect4(() => {\n if (open) {\n update();\n }\n }, [open, update]);\n const handleClickOutside = useCallback2((event) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target) && containerRef.current && !containerRef.current.contains(event.target)) {\n setOpen(false);\n inputRef.current?.blur();\n }\n }, []);\n useEffect4(() => {\n if (open) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"touchend\", handleClickOutside);\n } else {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"touchend\", handleClickOutside);\n }\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"touchend\", handleClickOutside);\n };\n }, [open, handleClickOutside]);\n useEffect4(() => {\n if (value) {\n setSelected(value);\n }\n }, [value]);\n useEffect4(() => {\n if (!arrayOptions || onSearch) return;\n const newOption = transToGroupOption(arrayOptions || [], groupBy);\n if (JSON.stringify(newOption) !== JSON.stringify(options)) {\n setOptions(newOption);\n }\n }, [arrayDefaultOptions, arrayOptions, groupBy, onSearch, options]);\n useEffect4(() => {\n const doSearchSync = () => {\n const res = onSearchSync?.(debouncedSearchTerm);\n setOptions(transToGroupOption(res || [], groupBy));\n };\n const exec = async () => {\n if (!onSearchSync || !open) return;\n if (triggerSearchOnFocus) {\n doSearchSync();\n }\n if (debouncedSearchTerm) {\n doSearchSync();\n }\n };\n void exec();\n }, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus, onSearchSync]);\n useEffect4(() => {\n const doSearch = async () => {\n setIsLoading(true);\n const res = await onSearch?.(debouncedSearchTerm);\n setOptions(transToGroupOption(res || [], groupBy));\n setIsLoading(false);\n };\n const exec = async () => {\n if (!onSearch || !open) return;\n if (triggerSearchOnFocus) {\n await doSearch();\n }\n if (debouncedSearchTerm) {\n await doSearch();\n }\n };\n void exec();\n }, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus, onSearch]);\n const handleUnselect = useCallback2(\n (option) => {\n if (unremovableOptions.find((v) => isEqual4(v.value, option.value))) {\n return;\n }\n const newOptions = selected.filter((s) => s.value !== option.value);\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n [onChange, selected, unremovableOptions]\n );\n const handleKeyDown = useCallback2(\n (e) => {\n const input = inputRef.current;\n if (input) {\n if (e.key === \"Delete\" || e.key === \"Backspace\") {\n if (input.value === \"\" && selected.length > 0) {\n const lastSelectOption = selected[selected.length - 1];\n if (!lastSelectOption.fixed) {\n handleUnselect(lastSelectOption);\n }\n }\n }\n if (e.key === \"Escape\") {\n input.blur();\n }\n }\n },\n [handleUnselect, selected]\n );\n const combinedFloatingRef = useCallback2(\n (node) => {\n if (!node) return;\n refs.setFloating(node);\n dropdownRef.current = node;\n },\n [refs]\n );\n const CreatableItem = () => {\n if (!creatable) return void 0;\n if (isOptionsExist(options, [{ value: inputValue, label: inputValue }]) || selected.find((s) => s.value === inputValue)) {\n return void 0;\n }\n const Item = /* @__PURE__ */ jsx13(\n CommandItem,\n {\n value: inputValue,\n className: \"cursor-pointer\",\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onSelect: (val) => {\n if (selected.length >= maxSelected) {\n onMaxSelected?.(selected.length);\n return;\n }\n setInputValue(\"\");\n const newOptions = [...selected, { value: val, label: val }];\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n children: `Create \"${inputValue}\"`\n }\n );\n if (!onSearch && inputValue.length > 0) {\n return Item;\n }\n if (onSearch && debouncedSearchTerm.length > 0 && !isLoading) {\n return Item;\n }\n return void 0;\n };\n const EmptyItem = useCallback2(() => {\n if (!emptyIndicator) return void 0;\n if (onSearch && !creatable && Object.keys(options).length === 0) {\n return /* @__PURE__ */ jsx13(CommandItem, { className: \"\", value: \"-\", disabled: true, children: emptyIndicator });\n }\n return /* @__PURE__ */ jsx13(CommandEmpty2, { className: emptyIndicatorClassName, children: emptyIndicator });\n }, [creatable, emptyIndicator, onSearch, options, emptyIndicatorClassName]);\n const selectables = useMemo4(() => removePickedOption(options, selected), [options, selected]);\n const commandFilter = useCallback2(() => {\n if (commandProps?.filter) {\n return commandProps.filter;\n }\n if (creatable) {\n return (value2, search) => value2.toLowerCase().includes(search.toLowerCase()) ? 1 : -1;\n }\n return void 0;\n }, [creatable, commandProps?.filter]);\n return /* @__PURE__ */ jsxs8(\n Command,\n {\n ...commandProps,\n onKeyDown: (e) => {\n handleKeyDown(e);\n commandProps?.onKeyDown?.(e);\n },\n className: cn(\"h-auto overflow-visible bg-transparent\", commandProps?.className),\n shouldFilter: commandProps?.shouldFilter !== void 0 ? commandProps.shouldFilter : !onSearch,\n filter: commandFilter(),\n children: [\n /* @__PURE__ */ jsx13(\n \"div\",\n {\n ref: setContainerRef,\n className: cn(\n \"relative min-h-[38px] py-2 rounded-lg border border-input text-sm transition-shadow focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50\",\n {\n \"p-1\": selected.length !== 0,\n \"cursor-text\": !disabled && selected.length !== 0\n },\n !hideClearAllButton && \"pe-9\",\n className\n ),\n onClick: () => {\n if (disabled) return;\n inputRef.current?.focus();\n },\n children: /* @__PURE__ */ jsxs8(\"div\", { className: \"flex flex-wrap gap-1\", children: [\n selected.map((option) => /* @__PURE__ */ jsxs8(\n \"div\",\n {\n className: cn(\n \"animate-fadeIn relative inline-flex h-7 cursor-default items-center rounded-md border border-solid bg-background pe-7 pl-2 ps-2 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50 data-[fixed]:pe-2 px-1\",\n badgeClassName\n ),\n \"data-fixed\": option.fixed,\n \"data-disabled\": disabled || void 0,\n children: [\n option.label,\n !unremovableOptions.find((v) => isEqual4(v.value, option.value)) && /* @__PURE__ */ jsx13(\n \"button\",\n {\n className: \"absolute -inset-y-px -end-px flex size-7 items-center justify-center rounded-e-lg border border-transparent p-0 text-muted-foreground/80 outline-0 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70\",\n onKeyDown: (e) => {\n if (e.key === \"Enter\") {\n handleUnselect(option);\n }\n },\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onClick: () => handleUnselect(option),\n \"aria-label\": \"Remove\",\n children: /* @__PURE__ */ jsx13(X2, { size: 14, strokeWidth: 2, \"aria-hidden\": \"true\" })\n }\n )\n ]\n },\n option.value\n )),\n /* @__PURE__ */ jsx13(\n CommandPrimitive2.Input,\n {\n ...inputProps,\n ref: inputRef,\n value: inputValue,\n disabled,\n onValueChange: (val) => {\n setInputValue(val);\n inputProps?.onValueChange?.(val);\n },\n onBlur: (event) => {\n if (!onScrollbar) {\n setOpen(false);\n }\n inputProps?.onBlur?.(event);\n },\n onFocus: (event) => {\n setOpen(true);\n if (triggerSearchOnFocus) {\n onSearch?.(debouncedSearchTerm);\n }\n inputProps?.onFocus?.(event);\n },\n placeholder: hidePlaceholderWhenSelected && selected.length !== 0 ? \"\" : placeholder,\n className: cn(\n \"flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed\",\n {\n \"w-full\": hidePlaceholderWhenSelected,\n \"px-3 py-2\": selected.length === 0,\n \"ml-1\": selected.length !== 0\n },\n inputProps?.className\n )\n }\n ),\n /* @__PURE__ */ jsx13(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n setSelected(selected.filter((s) => s.fixed));\n onChange?.(selected.filter((s) => s.fixed));\n },\n className: cn(\n \"absolute end-0 top-0 flex size-9 items-center justify-center rounded-lg border border-transparent text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70\",\n (hideClearAllButton || disabled || selected.length < 1 || selected.filter((s) => s.fixed).length === selected.length) && \"hidden\"\n ),\n \"aria-label\": \"Clear all\",\n children: /* @__PURE__ */ jsx13(X2, { size: 16, strokeWidth: 2, \"aria-hidden\": \"true\" })\n }\n )\n ] })\n }\n ),\n open && /* @__PURE__ */ jsx13(Portal2, { children: /* @__PURE__ */ jsx13(\n \"div\",\n {\n ref: combinedFloatingRef,\n style: {\n position: strategy,\n top: y ?? 0,\n left: x ?? 0,\n width: containerRef.current?.offsetWidth\n },\n className: cn(\"z-[9999] overflow-hidden rounded-lg border border-input\", dropdownContainerClassName),\n \"data-state\": open ? \"open\" : \"closed\",\n children: /* @__PURE__ */ jsx13(\n CommandList,\n {\n className: \"bg-popover text-popover-foreground shadow-lg shadow-black/5 outline-none\",\n onMouseLeave: () => {\n setOnScrollbar(false);\n },\n onMouseEnter: () => {\n setOnScrollbar(true);\n },\n onMouseUp: () => {\n inputRef.current?.focus();\n },\n children: isLoading ? /* @__PURE__ */ jsx13(Fragment2, { children: loadingIndicator }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [\n EmptyItem(),\n CreatableItem(),\n !selectFirstItem && /* @__PURE__ */ jsx13(CommandItem, { value: \"-\", className: \"hidden\" }),\n Object.entries(selectables).map(([key, dropdowns]) => /* @__PURE__ */ jsx13(CommandGroup, { heading: key, className: cn(\"h-full overflow-auto\", dropdownClassName), children: dropdowns.map((option) => /* @__PURE__ */ jsx13(\n CommandItem,\n {\n value: option.value,\n disabled: option.disable,\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onSelect: () => {\n setOptions(transToGroupOption(arrayDefaultOptions, groupBy));\n if (selected.length >= maxSelected) {\n onMaxSelected?.(selected.length);\n return;\n }\n setInputValue(\"\");\n const newOptions = [...selected, option];\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n className: cn(\n \"cursor-pointer\",\n option.disable && \"cursor-not-allowed opacity-50\",\n dropdownOptionClassName\n ),\n children: option.label\n },\n option.value\n )) }, key))\n ] })\n }\n )\n }\n ) }),\n /* @__PURE__ */ jsx13(\"input\", { value: JSON.stringify(selected), type: \"hidden\", name })\n ]\n }\n );\n }\n);\nMultipleSelector.displayName = \"MultipleSelector\";\nvar multiselect_default = MultipleSelector;\n\n// src/components/ui/popover.tsx\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { jsx as jsx14, jsxs as jsxs9 } from \"react/jsx-runtime\";\nfunction Popover({ ...props }) {\n return /* @__PURE__ */ jsx14(PopoverPrimitive.Root, { \"data-slot\": \"popover\", ...props });\n}\nfunction PopoverTrigger({ ...props }) {\n return /* @__PURE__ */ jsx14(PopoverPrimitive.Trigger, { \"data-slot\": \"popover-trigger\", ...props });\n}\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n showArrow = false,\n ...props\n}) {\n return /* @__PURE__ */ jsx14(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs9(\n PopoverPrimitive.Content,\n {\n \"data-slot\": \"popover-content\",\n align,\n sideOffset,\n className: cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[1000] w-72 rounded-md border p-4 shadow-md outline-hidden\",\n className\n ),\n ...props,\n children: [\n props.children,\n showArrow && /* @__PURE__ */ jsx14(PopoverPrimitive.Arrow, { className: \"fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]\" })\n ]\n }\n ) });\n}\n\n// src/components/ui/SearchSelect.tsx\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\nimport { useId, useMemo as useMemo5, useState as useState5 } from \"react\";\nimport { jsx as jsx15, jsxs as jsxs10 } from \"react/jsx-runtime\";\nfunction SearchSelect({\n options,\n name,\n selectPlaceholder = \"Select\",\n defaultValue,\n notFoundLabel,\n searchPlaceholder = \"Search\",\n dropdownClassName,\n dropdownOptionClassName,\n notFoundLabelClassName,\n elementClassName,\n searchClassName,\n selectButtonClassName,\n value,\n disabled,\n onChange,\n direction\n}) {\n const id = useId();\n const [open, setOpen] = useState5(false);\n const [selectedValue, setSelectedValue] = useState5(value ?? defaultValue ?? \"\");\n const selectLabel = useMemo5(() => {\n return selectedValue ? options.find((item) => item.value === selectedValue)?.label : selectPlaceholder;\n }, [selectedValue, options, selectPlaceholder]);\n return /* @__PURE__ */ jsxs10(\"div\", { style: { direction }, className: cn(\"w-full\", elementClassName), children: [\n /* @__PURE__ */ jsxs10(Popover, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx15(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(\n Button,\n {\n id,\n variant: \"outline\",\n role: \"combobox\",\n \"aria-expanded\": open,\n disabled,\n className: cn(\n \"bg-background hover:bg-background border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px]\",\n selectButtonClassName\n ),\n children: [\n /* @__PURE__ */ jsx15(\"span\", { className: cn(\"truncate\", !selectedValue && \"text-muted-foreground\"), children: selectLabel }),\n /* @__PURE__ */ jsx15(ChevronDownIcon, { size: 16, className: \"text-muted-foreground/80 shrink-0\", \"aria-hidden\": \"true\" })\n ]\n }\n ) }),\n /* @__PURE__ */ jsx15(PopoverContent, { className: cn(\"border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 bg-[#fff]\"), align: \"start\", children: /* @__PURE__ */ jsxs10(Command, { children: [\n /* @__PURE__ */ jsx15(CommandInput, { style: { direction }, className: cn(searchClassName), placeholder: searchPlaceholder }),\n /* @__PURE__ */ jsxs10(CommandList, { children: [\n /* @__PURE__ */ jsx15(CommandEmpty, { className: cn(\"w-full py-2 text-center\", notFoundLabelClassName), children: notFoundLabel }),\n /* @__PURE__ */ jsx15(CommandGroup, { className: cn(\"max-h-52 overflow-y-auto\", dropdownClassName), children: options.map((option) => /* @__PURE__ */ jsxs10(\n CommandItem,\n {\n className: cn(\n \"hover:bg-[#cccbcb] cursor-pointer\",\n dropdownOptionClassName,\n selectedValue === option.value && \"bg-[#cccbcb]\"\n ),\n value: JSON.stringify(option),\n onSelect: (currentValue) => {\n const parsedValue = JSON.parse(currentValue);\n setSelectedValue(parsedValue.value);\n onChange?.(parsedValue.value);\n setOpen(false);\n },\n children: [\n option.label,\n selectedValue === option.value && /* @__PURE__ */ jsx15(CheckIcon, { size: 16, className: \"ml-auto\" })\n ]\n },\n option.value\n )) })\n ] })\n ] }) })\n ] }),\n /* @__PURE__ */ jsx15(\"input\", { name, type: \"hidden\", value: selectedValue })\n ] });\n}\n\n// src/components/table/components.tsx\nimport { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs11 } from \"react/jsx-runtime\";\nvar getFixedNumber = (number = 0, fix = 4) => {\n const sum_value = number % 1 === 0 ? number : number.toFixed(fix).replace(/\\.?0+$/, \"\");\n return String(sum_value);\n};\nvar TableRow2 = ({ item, index: index2 }) => {\n const { rowStyles, rowClassName, keysToRender, onRowClick, zebraStriping } = useTableContext();\n const zebraClassName = zebraStriping ? index2 % 2 === 0 ? zebraStriping.evenRowClassName || \"\" : zebraStriping.oddRowClassName || \"bg-gray-300\" : \"\";\n return /* @__PURE__ */ jsx16(\n \"tr\",\n {\n className: cn(\"hover:bg-[#808080] hover:text-[#fff]\", zebraClassName, rowClassName || \"\"),\n onClick: () => onRowClick && onRowClick(item),\n style: rowStyles,\n children: keysToRender.map((key, index3) => /* @__PURE__ */ jsx16(TableCell, { value: item[key] }, index3))\n }\n );\n};\nvar TableCell = ({ value }) => {\n const { cellStyle, cellClassName } = useTableContext();\n return /* @__PURE__ */ jsx16(\n \"td\",\n {\n title: [\"string\", \"number\", \"boolean\"].includes(typeof value) ? value : \"\",\n style: cellStyle,\n className: cn(\"chivo ellipsis border-black border-[1px] max-w-[90px] px-1 text-center\", cellClassName || \"\"),\n children: value\n }\n );\n};\nvar Filter = memo(({ filterableColumn, index: index2 }) => {\n const { direction, headers, filters, filterOptions, filterPopupsDisplay, handleFilterChange, handleFilterClick, closeFilterWindow, filterLabel } = useTableContext();\n const displayRight = direction === \"rtl\" && index2 === headers.length - 1 || direction === \"ltr\" && index2 !== headers.length - 1;\n return /* @__PURE__ */ jsxs11(\"div\", { className: \"absolute top-1 right-1 \", children: [\n /* @__PURE__ */ jsx16(\n \"button\",\n {\n title: filterLabel + \" \" + filterableColumn.header,\n className: \"text-[12px]\",\n onClick: () => handleFilterClick(filterableColumn.dataKey),\n children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */ jsx16(Fragment3, { children: filters[filterableColumn.dataKey]?.length > 0 ? /* @__PURE__ */ jsx16(Fragment3, { children: slashFilterSvg(true) }) : /* @__PURE__ */ jsx16(Fragment3, { children: emptyFilterSvg(true) }) }) : /* @__PURE__ */ jsx16(Fragment3, { children: filters[filterableColumn.dataKey]?.length > 0 ? /* @__PURE__ */ jsx16(Fragment3, { children: slashFilterSvg() }) : /* @__PURE__ */ jsx16(Fragment3, { children: emptyFilterSvg() }) })\n }\n ),\n /* @__PURE__ */ jsx16(\"div\", { className: \"relative\", children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */ jsxs11(\n \"div\",\n {\n className: `absolute top-[-20px] z-20 ${displayRight ? \" left-[100%]\" : \"right-[100%]\"} w-44 h-52 text-black bg-white p-1 flex flex-col items-center gap-2 shadow`,\n children: [\n /* @__PURE__ */ jsxs11(\"div\", { className: \"flex justify-between items-center border-black border-b-[1px] w-[90%]\", children: [\n /* @__PURE__ */ jsx16(\"div\", { className: \"text-start\", children: filterLabel + \" \" + filterableColumn.header }),\n /* @__PURE__ */ jsx16(\"button\", { onClick: closeFilterWindow, children: /* @__PURE__ */ jsx16(RedXSvg2, {}) })\n ] }),\n /* @__PURE__ */ jsx16(\"div\", { className: \"overflow-auto h-[80%] flex flex-col gap-1 w-full cursor-pointer \", children: filterOptions[filterableColumn.dataKey]?.map((option, i) => /* @__PURE__ */ jsxs11(\"div\", { className: \"flex items-center px-2 justify-start hover:bg-[#547f22] hover:text-white\", children: [\n /* @__PURE__ */ jsx16(\n \"input\",\n {\n type: \"checkbox\",\n className: \"cursor-pointer\",\n checked: filters[filterableColumn.dataKey]?.includes(option),\n onChange: () => handleFilterChange(filterableColumn.dataKey, option)\n }\n ),\n /* @__PURE__ */ jsx16(\"button\", { className: \"flex-1 text-start px-2\", onClick: () => handleFilterChange(filterableColumn.dataKey, option), children: filterableColumn.ui ? filterableColumn.ui(option) : option })\n ] }, i)) })\n ]\n }\n ) })\n ] });\n});\nvar TableHead = memo(() => {\n const {\n headers,\n headerStyle,\n headerCellStyle,\n sortColumn,\n handleSort,\n sortKeys,\n sortOrder,\n filterableColumns = [],\n sortLabel,\n headerClassName,\n headerCellClassName\n } = useTableContext();\n const sortDisplay = useMemo6(() => Boolean(sortKeys?.length), [sortKeys]);\n return /* @__PURE__ */ jsx16(\"thead\", { className: cn(\"bg-[#282828] text-white sticky top-0\", headerClassName), children: /* @__PURE__ */ jsx16(\"tr\", { style: headerStyle, children: headers.map((header, index2) => {\n const filterableColumn = filterableColumns.find((col) => col.header === header);\n return /* @__PURE__ */ jsxs11(\n \"th\",\n {\n title: sortDisplay ? `${sortLabel} ${header}` : header,\n style: headerCellStyle,\n className: cn(\"border-black border-[1px] max-w-[130px] px-2 text-center relative\", headerCellClassName),\n children: [\n /* @__PURE__ */ jsx16(\"div\", { className: `px-2 ${sortDisplay ? \"cursor-pointer\" : \"\"}`, onClick: () => sortDisplay && handleSort(index2), children: header }),\n sortDisplay && sortColumn === index2 && (sortOrder === \"desc\" ? /* @__PURE__ */ jsx16(Fragment3, { children: sortSvg() }) : /* @__PURE__ */ jsx16(Fragment3, { children: sortSvg(true) })),\n filterableColumn && /* @__PURE__ */ jsx16(Filter, { filterableColumn, index: index2 })\n ]\n },\n index2\n );\n }) }) });\n}, renderOnce);\nvar TableBody = memo(() => {\n const { dataToRender } = useTableContext();\n return /* @__PURE__ */ jsx16(\"tbody\", { className: \"divide-y divide-gray-600\", children: dataToRender.renderedData.map((item, index2) => /* @__PURE__ */ jsx16(TableRow2, { item, index: index2 }, index2)) });\n}, renderOnce);\nvar MaxRowsLabel = memo(() => {\n const { data, dataToRender, maxRowsLabel1, maxRowsLabel2, maxRows, maxRowsContainerClassName } = useTableContext();\n return /* @__PURE__ */ jsxs11(\"div\", { className: cn(\"flex justify-start items-center text-lg gap-1\", maxRowsContainerClassName || \"\"), children: [\n /* @__PURE__ */ jsx16(\"div\", { children: maxRowsLabel1 }),\n /* @__PURE__ */ jsx16(\"div\", { children: maxRows > dataToRender.renderedData.length ? dataToRender.renderedData.length : maxRows }),\n /* @__PURE__ */ jsx16(\"div\", { children: maxRowsLabel2 }),\n /* @__PURE__ */ jsx16(\"div\", { children: dataToRender.filtered.length })\n ] });\n}, renderOnce);\nvar ExportToExcel = memo(() => {\n const {\n exportToExcelKeys,\n dataToAddToExcelTable,\n excelFileName,\n dataToRender,\n headers,\n sumColumns,\n exportExcelTitle,\n exportExcelContent,\n exportToExcelClassName\n } = useTableContext();\n const addPropertiesToExcel = (properties) => {\n let newData = [...dataToRender.renderedData];\n let newHeaders = [...headers];\n properties.forEach((val) => {\n newHeaders.unshift(val.header);\n newData = newData.map((v) => ({ ...v, [val.key]: val.value }));\n });\n return { data: newData, headers: newHeaders };\n };\n const onExportExcelClick = async () => {\n if (exportToExcelKeys) {\n const workbook = new ExcelJS.Workbook();\n const worksheet = workbook.addWorksheet(\"Sheet1\");\n const dataToExport = dataToAddToExcelTable ? addPropertiesToExcel(dataToAddToExcelTable) : { data: dataToRender.renderedData, headers };\n worksheet.addRow(dataToExport.headers);\n dataToExport.data.forEach((item) => {\n const row = exportToExcelKeys.map((key) => item[key]);\n worksheet.addRow(row);\n });\n if (sumColumns) {\n sumColumns.forEach((val) => {\n const sumRow = worksheet.addRow([]);\n sumRow.getCell(1).value = val.label;\n const value = dataToRender.renderedData.reduce((acc, v) => {\n return acc + Number(v[val.dataKey]) || 0;\n }, 0).toFixed(2);\n sumRow.getCell(2).value = value;\n });\n }\n const buffer = await workbook.xlsx.writeBuffer();\n const blob = new Blob([buffer], { type: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" });\n saveAs(blob, `${excelFileName || \"table_data\"}.xlsx`);\n }\n };\n return /* @__PURE__ */ jsx16(\n \"button\",\n {\n onClick: onExportExcelClick,\n title: exportExcelTitle,\n className: cn(\"px-2 py-[2px] bg-[#547f22] text-white rounded-lg text-[16px]\", exportToExcelClassName),\n children: exportExcelContent || exportToExcelSvg()\n }\n );\n}, renderOnce);\nvar Search = memo(() => {\n const { searchQuery, handleSearch, searchPlaceHolder, searchInputClassName, searchInputStyle } = useTableContext();\n return /* @__PURE__ */ jsx16(\n \"input\",\n {\n className: cn(\"w-40 border-black border-[1px] text-lg px-2 \", searchInputClassName),\n type: \"text\",\n placeholder: searchPlaceHolder,\n value: searchQuery,\n onChange: handleSearch,\n style: searchInputStyle\n }\n );\n}, renderOnce);\nvar Summary = memo(() => {\n const { summaryContainerStyle, summaryLabelStyle, summaryLabel, summaryRowStyle, sumColumns, dataToRender, direction } = useTableContext();\n return /* @__PURE__ */ jsxs11(\n \"div\",\n {\n style: { ...summaryContainerStyle, direction },\n className: \"w-full h-8 flex justify-between items-center px-3 text-[18px] font-bold\",\n children: [\n /* @__PURE__ */ jsx16(\"div\", { style: summaryLabelStyle, children: summaryLabel }),\n /* @__PURE__ */ jsx16(\"div\", { style: summaryRowStyle, className: \"flex gap-3\", children: sumColumns.map((val) => {\n const sum_res = dataToRender.renderedData.reduce((acc, v) => acc + Number(v[val.dataKey]) || 0, 0);\n const sum_value = getFixedNumber(sum_res);\n return /* @__PURE__ */ jsxs11(\"div\", { className: \"flex gap-1 justify-start\", children: [\n /* @__PURE__ */ jsx16(\"div\", { children: val.label }),\n /* @__PURE__ */ jsx16(\"span\", { children: \":\" }),\n /* @__PURE__ */ jsx16(\"div\", { children: val.ui ? val.ui(sum_value) : sum_value })\n ] }, val.dataKey + val.label);\n }) })\n ]\n }\n );\n}, renderOnce);\nvar TimesUI = ({ timestamp, format, tz, direction, fromFormat, className = \"\" }) => {\n const time = timestamp_to_string(timestamp, { format, fromFormat, tz });\n return /* @__PURE__ */ jsx16(\"div\", { style: { direction: \"ltr\" }, className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className), title: time, children: time });\n};\nvar TableButton = ({ onClick, title, className, type, children }) => {\n const icon = {\n add: \"fa-regular fa-plus text-2xl\",\n edit: \"fa-light fa-pen-to-square text-xl\",\n delete: \"fa-light fa-trash text-xl\"\n };\n return /* @__PURE__ */ jsx16(Fragment3, { children: type === \"custom\" ? /* @__PURE__ */ jsx16(\"button\", { className, title, onClick, children }) : type === \"add\" ? /* @__PURE__ */ jsx16(Button, { title, onClick, children: /* @__PURE__ */ jsx16(\"i\", { className: cn(\"fa-regular fa-plus text-2xl\", className) }) }) : /* @__PURE__ */ jsx16(\"button\", { title, onClick, children: /* @__PURE__ */ jsx16(\"i\", { className: cn(icon[type], className) }) }) });\n};\nvar DurationUI = ({\n duration,\n daysLabel = \"d\",\n hoursLabel = \"h\",\n minutesLabel = \"m\",\n secondsLabel = \"s\",\n className = \"\",\n direction\n}) => {\n const { daysStr, hoursStr, minutesStr, secondsStr } = useMemo6(() => {\n const secondsInDay = 86400;\n const days = Math.floor(duration / secondsInDay);\n const remainderAfterDays = duration % secondsInDay;\n const hours = Math.floor(remainderAfterDays / 3600);\n const remainderAfterHours = remainderAfterDays % 3600;\n const minutes = Math.floor(remainderAfterHours / 60);\n const seconds = remainderAfterHours % 60;\n const daysStr2 = String(days).padStart(2, \"0\");\n const hoursStr2 = String(hours).padStart(2, \"0\");\n const minutesStr2 = String(minutes).padStart(2, \"0\");\n const secondsStr2 = String(seconds).padStart(2, \"0\");\n return {\n daysStr: daysStr2,\n hoursStr: hoursStr2,\n minutesStr: minutesStr2,\n secondsStr: secondsStr2\n };\n }, [duration]);\n return /* @__PURE__ */ jsxs11(\n \"div\",\n {\n title: `${daysStr} ${daysLabel} ${hoursStr} ${hoursLabel} ${minutesStr} ${minutesLabel} ${secondsStr} ${secondsLabel}`.trim(),\n style: { direction: \"ltr\" },\n className: cn(`flex gap-1 ${direction === \"rtl\" ? \"justify-end\" : \"justify-start\"}`, className),\n children: [\n daysStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n daysStr,\n \" \",\n daysLabel\n ] }),\n hoursStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n hoursStr,\n \" \",\n hoursLabel\n ] }),\n minutesStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n minutesStr,\n \" \",\n minutesLabel\n ] }),\n secondsStr !== \"00\" && /* @__PURE__ */ jsxs11(\"span\", { style: { display: \"inline-block\" }, children: [\n secondsStr,\n \" \",\n secondsLabel\n ] })\n ]\n }\n );\n};\nvar PhoneUI = ({ phone, direction, className = \"\" }) => {\n return /* @__PURE__ */ jsx16(\"div\", { style: { direction: \"ltr\" }, className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className), title: phone, children: phone });\n};\nvar BooleanUi = ({ value, size: size3, className, falseUi, trueUi }) => {\n return value ? trueUi ?? /* @__PURE__ */ jsx16(\"i\", { className: cn(`fa-light fa-check ${size3 === \"small\" ? \"text-lg\" : \"text-2xl\"}`, className) }) : falseUi ?? /* @__PURE__ */ jsx16(\"i\", { className: cn(`fa-light fa-xmark ${size3 === \"small\" ? \"text-lg\" : \"text-2xl\"}`, className) });\n};\nvar GeoUi = ({ value, className, linkUi }) => {\n const lang = value.lng || value.longitude;\n const lat = value.lat || value.latitude;\n const googleMapsLink = getLocationUrl(lang, lat);\n const langLatUi = linkUi || ` ${lang} ${lat}`;\n return /* @__PURE__ */ jsx16(\"a\", { href: googleMapsLink, target: \"_blank\", className: cn(\"_ellipsis\", className), title: `${lang} ${lat}`, children: langLatUi });\n};\nvar NumberUI = ({ number, direction, className = \"\" }) => {\n return /* @__PURE__ */ jsx16(\n \"div\",\n {\n style: { direction: \"ltr\" },\n className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className),\n title: String(number),\n children: number\n }\n );\n};\n\n// src/components/forms/ModularForm/ModularForm.tsx\nimport { cloneElement, useState as useState8 } from \"react\";\n\n// src/components/forms/ModularForm/formElements.tsx\nimport { useCallback as useCallback4, useMemo as useMemo8, useState as useState7 } from \"react\";\n\n// src/components/forms/ModularForm/InternationalPhonePicker.tsx\nimport { ChevronDown, Phone } from \"lucide-react\";\nimport { forwardRef as forwardRef7, useEffect as useEffect5, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from \"react\";\nimport * as RPNInput from \"react-phone-number-input\";\nimport flags from \"react-phone-number-input/flags\";\nimport { jsx as jsx17, jsxs as jsxs12 } from \"react/jsx-runtime\";\nfunction InternationalPhonePicker({\n setPhoneValue,\n phoneValue = \"\",\n placeholder = \"\",\n className = \"\",\n containerClassName = \"\",\n defaultCountry = \"IL\",\n flagContainerClassName = \"\",\n inputClassName = \"\",\n defaultValue,\n name,\n style,\n onEnter,\n labelContent,\n labelClassName,\n required,\n direction\n}) {\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\") {\n if (onEnter) {\n onEnter();\n }\n }\n };\n const [tempPhoneValue, setTempPhoneValue] = useState6(\"\");\n useEffect5(() => {\n if (defaultValue) {\n if (setPhoneValue) {\n setPhoneValue(defaultValue);\n } else {\n setTempPhoneValue(defaultValue);\n }\n }\n }, [defaultValue, setPhoneValue]);\n return /* @__PURE__ */ jsxs12(\"div\", { style: { direction }, className: cn(\"space-y-2\", `${labelContent ? \"flex gap-1 items-center\" : \"\"}`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx17(ElementLabel, { labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx17(\n RPNInput.default,\n {\n style: { direction: \"ltr\" },\n className: cn(\"flex rounded-lg shadow-sm shadow-black/5\", className),\n international: true,\n countries: [\"US\", \"IL\", \"NG\"],\n defaultCountry,\n flagComponent: FlagComponent,\n countrySelectComponent: CountrySelect,\n countrySelectProps: { className: flagContainerClassName },\n inputComponent: PhoneInput,\n numberInputProps: { className: cn(\"min-h-10\", inputClassName), onKeyDown: handleKeyDown, defaultValue, style },\n placeholder,\n value: tempPhoneValue || phoneValue,\n onChange: (newValue) => {\n if (setPhoneValue) {\n return setPhoneValue(newValue ?? \"\");\n }\n setTempPhoneValue(newValue ?? \"\");\n }\n }\n ),\n /* @__PURE__ */ jsx17(\"input\", { type: \"hidden\", name, value: tempPhoneValue })\n ] });\n}\nvar PhoneInput = forwardRef7(({ className, onKeyDown, defaultValue, style, ...props }, ref) => {\n const inputRef = useRef4(null);\n useEffect5(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n return /* @__PURE__ */ jsx17(\n Input,\n {\n className: cn(\"-ms-px rounded-s-none shadow-none focus-visible:z-10 h-full\", className),\n onKeyDown,\n defaultValue,\n style,\n ref: (el) => {\n inputRef.current = el;\n if (typeof ref === \"function\") {\n ref(el);\n } else if (ref) {\n ref.current = el;\n }\n },\n ...props\n }\n );\n});\nPhoneInput.displayName = \"PhoneInput\";\nvar CountrySelect = ({ disabled, value, onChange, options, className }) => {\n const handleSelect = (event) => {\n onChange(event.target.value);\n };\n const originalClassName = useMemo7(() => {\n return \"relative inline-flex items-center self-stretch rounded-s-lg border border-input bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50\";\n }, []);\n return /* @__PURE__ */ jsxs12(\"div\", { className: cn(originalClassName, className), children: [\n /* @__PURE__ */ jsxs12(\"div\", { className: \"inline-flex items-center gap-1\", \"aria-hidden\": \"true\", children: [\n /* @__PURE__ */ jsx17(FlagComponent, { country: value, countryName: value, \"aria-hidden\": \"true\" }),\n /* @__PURE__ */ jsx17(\"span\", { className: \"text-muted-foreground/80\", children: /* @__PURE__ */ jsx17(ChevronDown, { size: 16, strokeWidth: 2, \"aria-hidden\": \"true\" }) })\n ] }),\n /* @__PURE__ */ jsx17(\n \"select\",\n {\n disabled,\n value,\n onChange: handleSelect,\n className: \"absolute inset-0 text-sm opacity-0\",\n \"aria-label\": \"Select country\",\n children: options.filter((x) => x.value).map((option, i) => /* @__PURE__ */ jsxs12(\"option\", { className: \"text-black\", value: option.value, children: [\n option.label,\n \" \",\n option.value && `+${RPNInput.getCountryCallingCode(option.value)}`\n ] }, option.value ?? `empty-${i}`))\n }\n )\n ] });\n};\nvar FlagComponent = ({ country, countryName }) => {\n const Flag = flags[country];\n return /* @__PURE__ */ jsx17(\"span\", { className: \"w-5 overflow-hidden rounded-sm\", children: Flag ? /* @__PURE__ */ jsx17(Flag, { title: countryName }) : /* @__PURE__ */ jsx17(Phone, { size: 16, \"aria-hidden\": \"true\" }) });\n};\n\n// src/components/forms/ModularForm/formElements.tsx\nimport { jsx as jsx18, jsxs as jsxs13 } from \"react/jsx-runtime\";\nvar useSortValues = (options, sortDirection, sortAsNumber) => {\n const sortOptions = useMemo8(() => {\n const sorted = sortAsNumber ? options.sort((a, b) => parseInt(b.label) - parseInt(a.label)) : options.sort((a, b) => a.label.localeCompare(b.label));\n return sortDirection === \"cba\" ? sorted.reverse() : sorted;\n }, [options, sortDirection, sortAsNumber]);\n return sortOptions;\n};\nvar InputContainer = ({\n validationError,\n name = \"\",\n inputType = \"text\",\n labelContent = \"\",\n defaultValue = \"\",\n validationName = \"textNumbers\",\n containerClassName = \"\",\n labelClassName = \"\",\n elementClassName = \"\",\n required = false,\n placeholder,\n props,\n minLength,\n onKeyDown,\n onChange,\n direction,\n value\n}) => {\n const handleChangeFunction = useCallback4(\n (e) => {\n handleChange(e);\n onChange?.(e);\n },\n [onChange]\n );\n const validationProps = useMemo8(() => {\n return { ...useValidation(validationName, validationError), onChange: handleChangeFunction };\n }, [handleChangeFunction]);\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx18(\n \"input\",\n {\n ...props,\n minLength,\n placeholder,\n className: cn(`w-[70%] bg-inherit border-b-[1px] border-black px-2`, elementClassName),\n defaultValue,\n ...validationProps,\n value,\n onChange: (e) => handleChangeFunction(e),\n required,\n name,\n onKeyDown,\n type: inputType\n }\n )\n ] });\n};\nvar SelectContainer = ({\n name = \"\",\n labelContent = \"\",\n containerClassName = \"\",\n labelClassName = \"\",\n defaultValue = \"\",\n elementClassName = \"\",\n optionClassName = \"\",\n required = false,\n options = [],\n optionsContainerClassName = \"\",\n sortDirection = \"abc\",\n sortAsNumber,\n direction,\n onChange\n}) => {\n const sortOptions = useSortValues(options, sortDirection, sortAsNumber);\n const [isOpen, setIsOpen] = useState7(false);\n const [selectedValue, setSelectedValue] = useState7(defaultValue || sortOptions[0]?.value || \"\");\n const handleOptionClick = (value) => {\n setSelectedValue(value);\n onChange?.(value);\n setIsOpen(false);\n };\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsxs13(\"div\", { className: cn(`w-[70%] relative`, elementClassName), onClick: () => setIsOpen(!isOpen), children: [\n /* @__PURE__ */ jsx18(\"div\", { className: `border-b-[1px] border-black max-h-6 cursor-pointer`, children: options.find((opt) => opt.value === selectedValue)?.label || selectedValue }),\n isOpen ? /* @__PURE__ */ jsx18(\"i\", { className: \"fa-light fa-chevron-up absolute top-[1px] left-1 cursor-pointer\" }) : /* @__PURE__ */ jsx18(\"i\", { className: \"fa-light fa-chevron-down absolute top-[1px] left-1 cursor-pointer\" }),\n isOpen && /* @__PURE__ */ jsx18(\"div\", { className: cn(`absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10`, optionsContainerClassName), children: sortOptions.map((option) => /* @__PURE__ */ jsx18(\n \"div\",\n {\n className: `p-2 cursor-pointer hover:bg-gray-200 ${optionClassName}`,\n onClick: () => handleOptionClick(option.value),\n children: option.label\n },\n option.value\n )) }),\n /* @__PURE__ */ jsx18(\"input\", { value: selectedValue, type: \"hidden\", name, required })\n ] })\n ] });\n};\nfunction MultiSelect({\n onChange,\n selectedOptions,\n emptyOptionsElement,\n unremovableOptions,\n options = [],\n styles = {},\n name = \"multipleSelect\",\n placeholder = \"Select items\",\n labelContent,\n required,\n labelClassName,\n groupBy,\n onSearch,\n onSearchSync,\n triggerSearchOnFocus,\n sortDirection = \"abc\",\n sortAsNumber,\n direction,\n searchInputProps\n}) {\n const sortOptions = useSortValues(options, sortDirection, sortAsNumber);\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`${labelContent ? \"flex gap-1 items-center\" : \"\"}`, styles.containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx18(\n multiselect_default,\n {\n commandProps: {\n label: placeholder\n },\n name,\n defaultOptions: sortOptions,\n unremovableOptions,\n value: selectedOptions,\n onChange,\n onSearch,\n onSearchSync,\n triggerSearchOnFocus,\n groupBy,\n placeholder,\n hideClearAllButton: true,\n hidePlaceholderWhenSelected: true,\n badgeClassName: styles.badgeClassName,\n className: styles.className,\n dropdownClassName: styles.dropdownClassName,\n dropdownOptionClassName: styles.dropdownOptionClassName,\n emptyIndicator: emptyOptionsElement || /* @__PURE__ */ jsx18(\"p\", { className: \"text-center text-sm\", children: \"all options selected.\" }),\n emptyIndicatorClassName: styles.emptyIndicatorClassName,\n dropdownContainerClassName: styles.dropdownContainerClassName,\n inputProps: searchInputProps\n }\n )\n ] });\n}\nvar SelectWithSearch = ({\n options,\n labelClassName,\n labelContent,\n name,\n onChange,\n value,\n placeholder,\n required,\n defaultValue,\n notFoundLabel,\n searchPlaceholder,\n containerClassName,\n dropdownClassName,\n dropdownOptionClassName,\n elementClassName,\n notFoundLabelClassName,\n searchClassName,\n selectButtonClassName,\n sortDirection = \"abc\",\n sortAsNumber,\n disabled,\n direction\n}) => {\n const sortOptions = useSortValues(options, sortDirection, sortAsNumber);\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`flex justify-between items-center w-full`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(ElementLabel, { direction, labelContent, labelClassName, name, required }),\n /* @__PURE__ */ jsx18(\n SearchSelect,\n {\n direction,\n options: sortOptions,\n value,\n onChange,\n defaultValue,\n name,\n elementClassName,\n selectPlaceholder: placeholder,\n selectButtonClassName,\n disabled,\n searchClassName,\n searchPlaceholder,\n dropdownClassName,\n dropdownOptionClassName,\n notFoundLabelClassName,\n notFoundLabel\n }\n )\n ] });\n};\nvar TextAreaContainer = ({\n name = \"\",\n labelContent = \"\",\n defaultValue = \"\",\n containerClassName = \"\",\n labelClassName = \"\",\n elementClassName = \"\",\n required = false,\n placeholder,\n props,\n minLength,\n onKeyDown,\n onChange,\n direction\n}) => {\n return /* @__PURE__ */ jsxs13(\"div\", { className: cn(`flex flex-col gap-2 items-center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ jsx18(\n ElementLabel,\n {\n direction,\n labelContent,\n labelClassName: `w-fit text-xl px-2 border-b-2 border-[#000] text-center ${labelClassName}`,\n name,\n required,\n withDots: false\n }\n ),\n /* @__PURE__ */ jsx18(\n \"textarea\",\n {\n ...props,\n onChange,\n minLength,\n placeholder,\n className: cn(`w-full bg-inherit border-[1px] border-black min-h-16 max-h-52 px-2`, elementClassName),\n defaultValue,\n required,\n name,\n onKeyDown\n }\n )\n ] });\n};\nvar ElementLabel = ({\n labelContent,\n labelClassName,\n name,\n required,\n withDots = true,\n direction\n}) => {\n return /* @__PURE__ */ jsxs13(\"label\", { style: { direction }, className: cn(`text-start w-[30%] flex gap-0.5`, labelClassName), htmlFor: name, children: [\n /* @__PURE__ */ jsx18(\"div\", { children: labelContent }),\n required && /* @__PURE__ */ jsx18(\"div\", { className: \"text-red-500\", children: \"*\" }),\n withDots && /* @__PURE__ */ jsx18(\"div\", { children: \":\" })\n ] });\n};\n\n// src/components/forms/ModularForm/ModularForm.tsx\nimport { jsx as jsx19, jsxs as jsxs14 } from \"react/jsx-runtime\";\nvar ModularForm = ({\n submitFunction = async (form) => {\n },\n elements = [],\n headerContent,\n buttonContent,\n formClassName = \"\",\n headerClassName = \"\",\n direction = \"rtl\",\n buttonClassName = \"\",\n submitRef\n}) => {\n const [errorMsg, setErrorMsg] = useState8(\"\");\n const [isLoading, setIsLoading] = useState8(false);\n const onSubmit = async (e) => {\n e.preventDefault();\n setErrorMsg(\"\");\n setIsLoading(true);\n try {\n const form = e.currentTarget;\n elements.forEach((element) => {\n if (element.minLength) {\n const elementValue = getFormElementValue(form, element.name);\n if (elementValue.length < element.minLength) {\n throw element.validationError || `${element.labelContent || element.name} must be at least ${element.minLength} characters`;\n }\n }\n });\n await submitFunction(e);\n } catch (err) {\n if (typeof err === \"string\") {\n setErrorMsg(err);\n }\n if (err.message) {\n setErrorMsg(err.message);\n }\n console.error(\"Error from submit ModularForm:\", err);\n }\n setIsLoading(false);\n };\n return /* @__PURE__ */ jsxs14(\"form\", { onSubmit, style: { direction }, className: cn(`w-[350px] px-5 py-5 flex flex-col gap-5`, formClassName), children: [\n headerContent && /* @__PURE__ */ jsx19(\"div\", { className: cn(`border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]`, headerClassName), children: headerContent }),\n elements.map((element, index2) => {\n switch (element.type) {\n case \"input\":\n return /* @__PURE__ */ jsx19(InputContainer, { ...element, direction }, index2);\n case \"textarea\":\n return /* @__PURE__ */ jsx19(TextAreaContainer, { ...element, direction }, index2);\n case \"select\":\n return /* @__PURE__ */ jsx19(SelectContainer, { ...element, direction }, index2);\n case \"multiSelect\":\n return /* @__PURE__ */ jsx19(MultiSelect, { ...element, direction }, index2);\n case \"selectWithSearch\":\n return /* @__PURE__ */ jsx19(SelectWithSearch, { ...element, direction }, index2);\n case \"internationalPhoneInput\":\n return /* @__PURE__ */ jsx19(InternationalPhonePicker, { ...element, direction }, index2);\n case \"custom\":\n return typeof element.element?.type !== \"string\" && cloneElement(element.element, { key: index2 });\n default:\n return null;\n }\n }),\n /* @__PURE__ */ jsxs14(\"div\", { className: \"flex justify-between w-full\", children: [\n /* @__PURE__ */ jsx19(\"div\", { title: errorMsg, className: \"text-[#f22] text-[18px] max-w-[80%] ellipsis\", children: errorMsg }),\n /* @__PURE__ */ jsx19(\n \"button\",\n {\n ref: submitRef,\n disabled: isLoading,\n className: cn(`bg-[#547f22] px-3 py-1 rounded-lg text-white min-w-20`, buttonClassName),\n type: \"submit\",\n children: isLoading ? /* @__PURE__ */ jsx19(Loader, { size: 25, color: \"#fff\" }) : buttonContent\n }\n )\n ] })\n ] });\n};\nvar ModularForm_default = ModularForm;\n\n// src/components/forms/index.tsx\nimport { useState as useState9 } from \"react\";\nimport moment3 from \"moment\";\nimport { jsx as jsx20, jsxs as jsxs15 } from \"react/jsx-runtime\";\nvar ConfirmForm = ({\n onV,\n onX,\n headline = \"\",\n direction = \"rtl\",\n containerClassName = \"\",\n buttonsContainerClassName = \"\",\n headlineClassName = \"\"\n}) => {\n const onConfirm = async () => {\n try {\n await onV();\n } catch (error) {\n console.error(\"'onV' failed:\", error);\n }\n };\n const onDenied = async () => {\n try {\n await onX();\n } catch (error) {\n console.error(\"'onX' failed:\", error);\n }\n };\n return /* @__PURE__ */ jsxs15(\"div\", { style: { direction, padding: \"30px\" }, className: cn(\"w-full h-full flex flex-col gap-3\", containerClassName), children: [\n /* @__PURE__ */ jsx20(\"div\", { className: cn(\"text-lg font-bold\", headlineClassName), children: headline }),\n /* @__PURE__ */ jsxs15(\"div\", { className: cn(\"flex justify-center items-center gap-2 w-full\", buttonsContainerClassName), children: [\n /* @__PURE__ */ jsx20(\"button\", { onClick: onDenied, children: /* @__PURE__ */ jsx20(RedXSvg, {}) }),\n /* @__PURE__ */ jsx20(\"button\", { onClick: onConfirm, children: /* @__PURE__ */ jsx20(GreenVSvg, {}) })\n ] })\n ] });\n};\nvar DatePicker = ({\n submit = async (form) => {\n },\n formClassName = \"\",\n labelsClassName = \"\",\n inputsClassName = \"\",\n buttonClassName = \"\",\n buttonStyle = {},\n defaultFrom,\n defaultTo,\n direction = \"rtl\",\n fromText = \"From date\",\n toText = \"To date\",\n buttonText = \"Search\"\n}) => {\n const [isLoading, setIsLoading] = useState9(false);\n const onSubmit = async (e) => {\n e.preventDefault();\n setIsLoading(true);\n await submit(e);\n setIsLoading(false);\n };\n return /* @__PURE__ */ jsxs15(\"form\", { style: { direction }, onSubmit, className: cn(`w-full h-10 flex justify-start gap-3 items-center `, formClassName), children: [\n /* @__PURE__ */ jsxs15(\"label\", { className: cn(`center text-[14px] relative gap-2`, labelsClassName), htmlFor: \"from\", children: [\n fromText,\n /* @__PURE__ */ jsx20(\n \"input\",\n {\n className: `w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ${inputsClassName}`,\n type: \"date\",\n name: \"from\",\n defaultValue: defaultFrom || moment3(/* @__PURE__ */ new Date()).format(\"YYYY-MM-DD\")\n }\n )\n ] }),\n /* @__PURE__ */ jsxs15(\"label\", { className: cn(`center text-[14px] relative gap-2 `, labelsClassName), htmlFor: \"to\", children: [\n toText,\n /* @__PURE__ */ jsx20(\n \"input\",\n {\n className: `w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ${inputsClassName}`,\n type: \"date\",\n name: \"to\",\n defaultValue: defaultTo || moment3(/* @__PURE__ */ new Date()).format(\"YYYY-MM-DD\")\n }\n )\n ] }),\n /* @__PURE__ */ jsx20(\n \"button\",\n {\n disabled: isLoading,\n style: buttonStyle,\n className: cn(`bg-[#699a2c] text-[#fff] font-[500] w-[75px] h-[27px]`, buttonClassName),\n type: \"submit\",\n children: isLoading ? /* @__PURE__ */ jsx20(Loader, { className: \"pt-[2px]\", size: 20, color: \"#fff\" }) : buttonText\n }\n )\n ] });\n};\n\n// src/components/CodeInput.tsx\nimport { OTPInput } from \"input-otp\";\nimport { useEffect as useEffect6, useRef as useRef5 } from \"react\";\nimport { jsx as jsx21 } from \"react/jsx-runtime\";\nfunction CodeInput({ codeValue, setCodeValue, className = \"\", slotContainerClassName = \"\" }) {\n const firstInputRef = useRef5(null);\n useEffect6(() => {\n if (firstInputRef.current) {\n firstInputRef.current.focus();\n }\n }, []);\n return /* @__PURE__ */ jsx21(\"div\", { className: cn(\"space-y-2 flex justify-center items-center\", className), children: /* @__PURE__ */ jsx21(\n OTPInput,\n {\n ref: firstInputRef,\n value: codeValue,\n onChange: (newVal) => setCodeValue(newVal),\n containerClassName: \"flex items-center gap-3 has-[:disabled]:opacity-50\",\n maxLength: 6,\n render: ({ slots }) => /* @__PURE__ */ jsx21(\"div\", { className: cn(\"flex gap-5\", slotContainerClassName), children: slots.map((slot, idx) => /* @__PURE__ */ jsx21(Slot2, { ...slot }, idx)) })\n }\n ) });\n}\nfunction Slot2(props) {\n return /* @__PURE__ */ jsx21(\n \"div\",\n {\n className: cn(\n \"flex size-9 items-center justify-center rounded-lg border border-input bg-background font-medium text-foreground shadow-sm shadow-black/5 transition-shadow\",\n { \"z-10 border border-ring ring-[3px] ring-ring/20\": props.isActive }\n ),\n children: props.char !== null && /* @__PURE__ */ jsx21(\"div\", { children: props.char })\n }\n );\n}\nexport {\n Badge,\n BooleanUi,\n Button,\n Checkbox,\n CodeInput,\n ConfirmForm,\n DatePicker,\n DurationUI,\n ElementLabel,\n ErrorBoundary,\n ExportToExcel,\n Filter,\n GeoUi,\n Input,\n InputContainer,\n InternationalPhonePicker,\n Loader,\n MaxRowsLabel,\n ModularForm_default as ModularForm,\n MultiSelect,\n NumberUI,\n PhoneUI,\n ProgressComponent,\n Search,\n SelectContainer,\n SelectWithSearch,\n Summary,\n Table,\n TableBody,\n TableButton,\n TableCell,\n TableContext,\n TableHead,\n TableProvider,\n TableRow2 as TableRow,\n TextAreaContainer,\n TimesUI,\n Version,\n badgeVariants,\n buttonVariants,\n getFixedNumber,\n useDebounce,\n useSortValues\n};\n"]}
|