@algorithm-shift/design-system 1.2.79 → 1.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -330,7 +330,7 @@ function Repeater({
330
330
  [items, count]
331
331
  );
332
332
  if (!list.length) {
333
- return emptyFallback ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: emptyFallback }) : null;
333
+ return emptyFallback ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: emptyFallback }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: "No items to display." });
334
334
  }
335
335
  const content = list.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react4.default.Fragment, { children: render(item, i, list) }, i));
336
336
  return wrapper ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: wrapper(content) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: content });
@@ -27602,7 +27602,7 @@ function RichText({ className, style, ...props }) {
27602
27602
  }
27603
27603
 
27604
27604
  // src/components/Inputs/Dropdown/Dropdown.tsx
27605
- var import_react19 = require("react");
27605
+ var import_react21 = require("react");
27606
27606
 
27607
27607
  // src/components/ui/select.tsx
27608
27608
  var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
@@ -27730,15 +27730,269 @@ function SelectScrollDownButton({
27730
27730
  );
27731
27731
  }
27732
27732
 
27733
- // src/components/Inputs/Dropdown/Dropdown.tsx
27733
+ // src/components/Inputs/Dropdown/LazyDropdown.tsx
27734
+ var import_react20 = require("react");
27735
+
27736
+ // src/components/Wrappers/Portal.tsx
27737
+ var import_react_dom = __toESM(require("react-dom"));
27738
+ var Portal3 = ({ children, container }) => {
27739
+ const target = container || document.body;
27740
+ return import_react_dom.default.createPortal(children, target);
27741
+ };
27742
+ var Portal_default = Portal3;
27743
+
27744
+ // src/hooks/useLazyDropdown.ts
27745
+ var import_react19 = require("react");
27746
+ var import_axios = __toESM(require("axios"));
27747
+ function useLazyDropdown(config) {
27748
+ const [options, setOptions] = (0, import_react19.useState)([]);
27749
+ const [page, setPage] = (0, import_react19.useState)(1);
27750
+ const [hasMore, setHasMore] = (0, import_react19.useState)(true);
27751
+ const [loading, setLoading] = (0, import_react19.useState)(false);
27752
+ const [searchTerm, setSearchTerm] = (0, import_react19.useState)("");
27753
+ const debounceTimer = (0, import_react19.useRef)(null);
27754
+ const allDataRef = (0, import_react19.useRef)([]);
27755
+ const configRef = (0, import_react19.useRef)(config);
27756
+ const PAGE_SIZE = config.pageSize || 10;
27757
+ (0, import_react19.useEffect)(() => {
27758
+ configRef.current = config;
27759
+ }, [config]);
27760
+ const transformToOptions = (0, import_react19.useCallback)((data) => {
27761
+ if (!data || !Array.isArray(data)) return [];
27762
+ const cfg = configRef.current;
27763
+ return data.map((item) => ({
27764
+ value: item[cfg.dataKey] ?? item.id ?? "",
27765
+ label: item[cfg.dataLabel] ?? item.name ?? item.label ?? ""
27766
+ }));
27767
+ }, []);
27768
+ const fetchApiData = (0, import_react19.useCallback)(async (pageNum, term) => {
27769
+ if (!configRef.current.apiUrl) return [];
27770
+ const limit = PAGE_SIZE;
27771
+ const params = { page: pageNum, limit };
27772
+ if (term) params[configRef.current.dataLabel ?? "search"] = term;
27773
+ const res = await import_axios.default.get(configRef.current.apiUrl, {
27774
+ params,
27775
+ withCredentials: true
27776
+ });
27777
+ if (res.data?.success && Array.isArray(res.data.data)) {
27778
+ const data = res.data.data;
27779
+ return transformToOptions(data);
27780
+ }
27781
+ return [];
27782
+ }, [PAGE_SIZE, transformToOptions]);
27783
+ const loadPage = (0, import_react19.useCallback)(async (pageNum, term) => {
27784
+ const cfg = configRef.current;
27785
+ if (!cfg.enabled) return;
27786
+ setLoading(true);
27787
+ try {
27788
+ let pageOptions = [];
27789
+ if (cfg.dataSource === "api") {
27790
+ pageOptions = await fetchApiData(pageNum, term);
27791
+ setHasMore(pageOptions.length === PAGE_SIZE);
27792
+ } else {
27793
+ const allData = allDataRef.current || [];
27794
+ let filtered = allData;
27795
+ if (term) {
27796
+ const termLower = term.toLowerCase();
27797
+ filtered = allData.filter((item) => {
27798
+ const label = String(item[cfg.dataLabel] ?? item.name ?? item.label ?? "").toLowerCase();
27799
+ const value = String(item[cfg.dataKey] ?? item.id ?? "").toLowerCase();
27800
+ return label.includes(termLower) || value.includes(termLower);
27801
+ });
27802
+ }
27803
+ const start = (pageNum - 1) * PAGE_SIZE;
27804
+ const end = start + PAGE_SIZE;
27805
+ pageOptions = transformToOptions(filtered.slice(start, end));
27806
+ setHasMore(end < filtered.length);
27807
+ }
27808
+ setOptions((prev) => pageNum === 1 ? pageOptions : [...prev, ...pageOptions]);
27809
+ setPage(pageNum);
27810
+ } catch (err) {
27811
+ console.error("\u274C useLazyDropdown loadPage error:", err);
27812
+ setHasMore(false);
27813
+ } finally {
27814
+ setLoading(false);
27815
+ }
27816
+ }, [fetchApiData, transformToOptions]);
27817
+ const loadMore = (0, import_react19.useCallback)(() => {
27818
+ if (!loading && hasMore) {
27819
+ loadPage(page + 1, searchTerm);
27820
+ }
27821
+ }, [loading, hasMore, page, searchTerm, loadPage]);
27822
+ const search = (0, import_react19.useCallback)((term) => {
27823
+ setSearchTerm(term);
27824
+ if (debounceTimer.current) clearTimeout(debounceTimer.current);
27825
+ debounceTimer.current = setTimeout(() => {
27826
+ loadPage(1, term);
27827
+ }, 300);
27828
+ }, [loadPage]);
27829
+ const reset = (0, import_react19.useCallback)(() => {
27830
+ setSearchTerm("");
27831
+ setPage(1);
27832
+ loadPage(1, "");
27833
+ }, [loadPage]);
27834
+ (0, import_react19.useEffect)(() => {
27835
+ if (config.initialData?.length) {
27836
+ allDataRef.current = config.initialData;
27837
+ loadPage(1, "");
27838
+ }
27839
+ }, [config.initialData, loadPage]);
27840
+ (0, import_react19.useEffect)(() => {
27841
+ return () => {
27842
+ if (debounceTimer.current) clearTimeout(debounceTimer.current);
27843
+ };
27844
+ }, []);
27845
+ return {
27846
+ options,
27847
+ loading,
27848
+ hasMore,
27849
+ loadMore,
27850
+ search,
27851
+ reset
27852
+ };
27853
+ }
27854
+
27855
+ // src/components/Inputs/Dropdown/LazyDropdown.tsx
27734
27856
  var import_jsx_runtime36 = require("react/jsx-runtime");
27857
+ function LazySelectDropdown({
27858
+ options = [],
27859
+ value,
27860
+ onChange,
27861
+ placeholder,
27862
+ className,
27863
+ id,
27864
+ disabled,
27865
+ readOnly,
27866
+ source,
27867
+ apiUrl,
27868
+ pageSize,
27869
+ dataKey = "id",
27870
+ dataLabel = "name",
27871
+ errorMessage
27872
+ }) {
27873
+ const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
27874
+ const [searchTerm, setSearchTerm] = (0, import_react20.useState)("");
27875
+ const dropdownRef = (0, import_react20.useRef)(null);
27876
+ const observerTarget = (0, import_react20.useRef)(null);
27877
+ const {
27878
+ options: lazyOptions,
27879
+ loading,
27880
+ hasMore,
27881
+ loadMore,
27882
+ search,
27883
+ reset
27884
+ } = useLazyDropdown({
27885
+ enabled: true,
27886
+ dataSource: source || "",
27887
+ apiUrl,
27888
+ pageSize: pageSize || 10,
27889
+ dataKey,
27890
+ dataLabel,
27891
+ initialData: options || []
27892
+ });
27893
+ const selectedOption = lazyOptions.find((opt) => opt.value === value);
27894
+ (0, import_react20.useEffect)(() => {
27895
+ const handleClickOutside = (e) => {
27896
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
27897
+ setIsOpen(false);
27898
+ setSearchTerm("");
27899
+ }
27900
+ };
27901
+ document.addEventListener("mousedown", handleClickOutside);
27902
+ return () => document.removeEventListener("mousedown", handleClickOutside);
27903
+ }, []);
27904
+ (0, import_react20.useEffect)(() => {
27905
+ if (!isOpen || !hasMore || loading) return;
27906
+ const observer = new IntersectionObserver(
27907
+ (entries) => {
27908
+ if (entries[0].isIntersecting) loadMore();
27909
+ },
27910
+ { threshold: 0.1 }
27911
+ );
27912
+ if (observerTarget.current) observer.observe(observerTarget.current);
27913
+ return () => observer.disconnect();
27914
+ }, [isOpen, hasMore, loading, loadMore]);
27915
+ const handleSearchChange = (e) => {
27916
+ const term = e.target.value;
27917
+ setSearchTerm(term);
27918
+ search(term);
27919
+ };
27920
+ const handleSelect = (optValue) => {
27921
+ onChange?.(optValue);
27922
+ setIsOpen(false);
27923
+ setSearchTerm("");
27924
+ reset();
27925
+ };
27926
+ const handleFocus = () => {
27927
+ if (!disabled) setIsOpen(true);
27928
+ };
27929
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
27930
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
27931
+ "input",
27932
+ {
27933
+ type: "text",
27934
+ id,
27935
+ name: id,
27936
+ className: cn(
27937
+ "w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
27938
+ disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer",
27939
+ className,
27940
+ errorMessage ? "border-red-500" : ""
27941
+ ),
27942
+ placeholder: selectedOption?.label || placeholder,
27943
+ value: isOpen ? searchTerm : selectedOption?.label || "",
27944
+ onFocus: handleFocus,
27945
+ onChange: handleSearchChange,
27946
+ readOnly: !isOpen || readOnly,
27947
+ disabled
27948
+ }
27949
+ ),
27950
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
27951
+ isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Portal_default, { container: dropdownRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
27952
+ "div",
27953
+ {
27954
+ className: "fixed z-[9999] w-fit mt-1 bg-white border border-gray-300 rounded-lg shadow-lg max-h-60 overflow-y-auto",
27955
+ style: { width: dropdownRef.current?.offsetWidth },
27956
+ children: loading && lazyOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "px-3 py-4 text-center text-gray-500 flex items-center justify-center gap-2 text-sm", children: [
27957
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "animate-spin w-4 h-4 border-2 border-gray-300 border-t-blue-500 rounded-full" }),
27958
+ "Loading..."
27959
+ ] }) : lazyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
27960
+ lazyOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
27961
+ "div",
27962
+ {
27963
+ onClick: () => handleSelect(option.value),
27964
+ className: `px-3 py-2 hover:bg-blue-50 cursor-pointer text-sm ${option.value === value ? "bg-blue-100" : ""}`,
27965
+ children: option.label
27966
+ },
27967
+ `${option.value}-${index}`
27968
+ )),
27969
+ hasMore && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
27970
+ "div",
27971
+ {
27972
+ ref: observerTarget,
27973
+ className: "px-3 py-2 text-center text-gray-400 text-sm border-t",
27974
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-center gap-2 text-sm", children: [
27975
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "animate-spin w-3 h-3 border-2 border-gray-300 border-t-blue-500 rounded-full" }),
27976
+ "Loading more..."
27977
+ ] }) : "Scroll for more..."
27978
+ }
27979
+ )
27980
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "px-3 py-4 text-sm text-center text-gray-500", children: searchTerm ? `No results for "${searchTerm}"` : "No options available" })
27981
+ }
27982
+ ) })
27983
+ ] });
27984
+ }
27985
+ var LazyDropdown_default = LazySelectDropdown;
27986
+
27987
+ // src/components/Inputs/Dropdown/Dropdown.tsx
27988
+ var import_jsx_runtime37 = require("react/jsx-runtime");
27735
27989
  var Dropdown = ({ className, style, ...props }) => {
27736
27990
  const list = Array.isArray(props?.data) ? props.data : [];
27737
- const placeholder = props.placeholder ? props.placeholder : "Placeholder text";
27991
+ const placeholder = props.placeholder ? props.placeholder : "Select an option";
27738
27992
  const isEditable = props.isEditable ?? true;
27739
27993
  const isDisabled = props.isDisabled ?? false;
27740
27994
  const isReadonly = props.isReadonly ?? false;
27741
- (0, import_react19.useEffect)(() => {
27995
+ (0, import_react21.useEffect)(() => {
27742
27996
  if (props.value !== void 0) {
27743
27997
  handleChange(props.value);
27744
27998
  }
@@ -27752,9 +28006,25 @@ var Dropdown = ({ className, style, ...props }) => {
27752
28006
  value: item[dataKey],
27753
28007
  label: item[dataLabel]
27754
28008
  }));
27755
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
27756
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Select, { name: props.name, value: props.value || "", onValueChange: handleChange, disabled: isDisabled || !isEditable, children: [
27757
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28009
+ if (props.lazyLoad) {
28010
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28011
+ LazyDropdown_default,
28012
+ {
28013
+ ...props,
28014
+ id: props.name || "lazy-select-field",
28015
+ options: list,
28016
+ onChange: handleChange,
28017
+ placeholder,
28018
+ className,
28019
+ style,
28020
+ disabled: isDisabled || !isEditable,
28021
+ readOnly: isReadonly
28022
+ }
28023
+ );
28024
+ }
28025
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
28026
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Select, { name: props.name, value: props.value || "", onValueChange: handleChange, disabled: isDisabled || !isEditable, children: [
28027
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27758
28028
  SelectTrigger,
27759
28029
  {
27760
28030
  id: props.name || "select-field",
@@ -27764,31 +28034,31 @@ var Dropdown = ({ className, style, ...props }) => {
27764
28034
  borderColor: props.errorMessage ? "#f87171" : style?.borderColor
27765
28035
  },
27766
28036
  "aria-readonly": isReadonly,
27767
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectValue, { placeholder })
28037
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectValue, { placeholder })
27768
28038
  }
27769
28039
  ),
27770
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(SelectContent, { children: [
27771
- props.dataLoading && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectItem, { value: "none", disabled: true, children: "Loading..." }),
27772
- !props.dataLoading && options.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectItem, { value: "none", disabled: true, children: "No options" }),
27773
- options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value))
28040
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(SelectContent, { children: [
28041
+ props.dataLoading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: "none", disabled: true, children: "Loading..." }),
28042
+ !props.dataLoading && options.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: "none", disabled: true, children: "No options" }),
28043
+ options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value))
27774
28044
  ] })
27775
28045
  ] }),
27776
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28046
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
27777
28047
  ] });
27778
28048
  };
27779
28049
  var Dropdown_default = Dropdown;
27780
28050
 
27781
28051
  // src/components/Inputs/SwitchToggle/SwitchToggle.tsx
27782
- var import_react20 = require("react");
28052
+ var import_react22 = require("react");
27783
28053
 
27784
28054
  // src/components/ui/switch.tsx
27785
28055
  var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
27786
- var import_jsx_runtime37 = require("react/jsx-runtime");
28056
+ var import_jsx_runtime38 = require("react/jsx-runtime");
27787
28057
  function Switch({
27788
28058
  className,
27789
28059
  ...props
27790
28060
  }) {
27791
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28061
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
27792
28062
  SwitchPrimitive.Root,
27793
28063
  {
27794
28064
  "data-slot": "switch",
@@ -27797,7 +28067,7 @@ function Switch({
27797
28067
  className
27798
28068
  ),
27799
28069
  ...props,
27800
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28070
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
27801
28071
  SwitchPrimitive.Thumb,
27802
28072
  {
27803
28073
  "data-slot": "switch-thumb",
@@ -27811,11 +28081,11 @@ function Switch({
27811
28081
  }
27812
28082
 
27813
28083
  // src/components/Inputs/SwitchToggle/SwitchToggle.tsx
27814
- var import_jsx_runtime38 = require("react/jsx-runtime");
28084
+ var import_jsx_runtime39 = require("react/jsx-runtime");
27815
28085
  var SwitchToggle = ({ className, style, ...props }) => {
27816
28086
  const isEditable = props.isEditable ?? true;
27817
28087
  const isDisabled = props.isDisabled ?? false;
27818
- (0, import_react20.useEffect)(() => {
28088
+ (0, import_react22.useEffect)(() => {
27819
28089
  if (props.value !== void 0) {
27820
28090
  handleChange?.(props.value);
27821
28091
  }
@@ -27823,9 +28093,9 @@ var SwitchToggle = ({ className, style, ...props }) => {
27823
28093
  const handleChange = (value) => {
27824
28094
  props.onChange?.(value);
27825
28095
  };
27826
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
27827
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
27828
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
28096
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
28097
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
28098
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
27829
28099
  Switch,
27830
28100
  {
27831
28101
  id: props.name || "switch",
@@ -27834,23 +28104,23 @@ var SwitchToggle = ({ className, style, ...props }) => {
27834
28104
  disabled: isDisabled || !isEditable
27835
28105
  }
27836
28106
  ),
27837
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Label2, { htmlFor: props.name || "switch", children: props.text })
28107
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Label2, { htmlFor: props.name || "switch", children: props.text })
27838
28108
  ] }) }),
27839
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28109
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
27840
28110
  ] });
27841
28111
  };
27842
28112
  var SwitchToggle_default = SwitchToggle;
27843
28113
 
27844
28114
  // src/components/Inputs/PhoneInput/PhoneInput.tsx
27845
- var import_react21 = require("react");
28115
+ var import_react23 = require("react");
27846
28116
  var import_react_international_phone = require("react-international-phone");
27847
28117
  var import_style = require("react-international-phone/style.css");
27848
- var import_jsx_runtime39 = require("react/jsx-runtime");
28118
+ var import_jsx_runtime40 = require("react/jsx-runtime");
27849
28119
  var PhoneInput = ({ className, style, ...props }) => {
27850
28120
  const placeholder = props.placeholder ?? "Enter phone number";
27851
28121
  const isEditable = props.isEditable ?? true;
27852
28122
  const isDisabled = props.isDisabled ?? false;
27853
- (0, import_react21.useEffect)(() => {
28123
+ (0, import_react23.useEffect)(() => {
27854
28124
  if (props.value !== void 0) {
27855
28125
  handleChange?.(props.value);
27856
28126
  }
@@ -27858,8 +28128,8 @@ var PhoneInput = ({ className, style, ...props }) => {
27858
28128
  const handleChange = (val) => {
27859
28129
  props.onChange?.(val);
27860
28130
  };
27861
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
27862
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
28131
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
28132
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
27863
28133
  import_react_international_phone.PhoneInput,
27864
28134
  {
27865
28135
  defaultCountry: "in",
@@ -27883,21 +28153,21 @@ var PhoneInput = ({ className, style, ...props }) => {
27883
28153
  disabled: isDisabled || !isEditable
27884
28154
  }
27885
28155
  ),
27886
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28156
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
27887
28157
  ] });
27888
28158
  };
27889
28159
  var PhoneInput_default = PhoneInput;
27890
28160
 
27891
28161
  // src/components/Inputs/SearchInput/SearchInput.tsx
27892
- var import_react22 = require("react");
27893
- var import_jsx_runtime40 = require("react/jsx-runtime");
28162
+ var import_react24 = require("react");
28163
+ var import_jsx_runtime41 = require("react/jsx-runtime");
27894
28164
  var SearchInput = ({ className, style, ...props }) => {
27895
28165
  const placeholder = props.placeholder ?? "Placeholder text";
27896
28166
  const isEditable = props.isEditable ?? true;
27897
28167
  const isDisabled = props.isDisabled ?? false;
27898
28168
  const isReadonly = props.isReadonly ?? false;
27899
28169
  const isAutocomplete = props.isAutocomplete ?? false;
27900
- (0, import_react22.useEffect)(() => {
28170
+ (0, import_react24.useEffect)(() => {
27901
28171
  if (props.value !== void 0) {
27902
28172
  const e = { target: { value: props.value } };
27903
28173
  handleChange?.(e);
@@ -27906,8 +28176,8 @@ var SearchInput = ({ className, style, ...props }) => {
27906
28176
  const handleChange = (e) => {
27907
28177
  props.onChange?.(e);
27908
28178
  };
27909
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
27910
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
28179
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
28180
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
27911
28181
  Input,
27912
28182
  {
27913
28183
  type: "text",
@@ -27926,17 +28196,17 @@ var SearchInput = ({ className, style, ...props }) => {
27926
28196
  readOnly: isReadonly
27927
28197
  }
27928
28198
  ) }),
27929
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28199
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
27930
28200
  ] });
27931
28201
  };
27932
28202
  var SearchInput_default = SearchInput;
27933
28203
 
27934
28204
  // src/components/Inputs/FileInput/FileInput.tsx
27935
- var import_react23 = require("react");
27936
- var import_jsx_runtime41 = require("react/jsx-runtime");
28205
+ var import_react25 = require("react");
28206
+ var import_jsx_runtime42 = require("react/jsx-runtime");
27937
28207
  var FileInput2 = ({ className, style, ...props }) => {
27938
28208
  const placeholder = props.placeholder ?? "Placeholder text";
27939
- (0, import_react23.useEffect)(() => {
28209
+ (0, import_react25.useEffect)(() => {
27940
28210
  if (props.value !== void 0) {
27941
28211
  const e = { target: { value: props.value } };
27942
28212
  handleChange?.(e);
@@ -27945,8 +28215,8 @@ var FileInput2 = ({ className, style, ...props }) => {
27945
28215
  const handleChange = (e) => {
27946
28216
  props.onChange?.(e);
27947
28217
  };
27948
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "d-flex items-center relative align-middle", children: [
27949
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
28218
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "d-flex items-center relative align-middle", children: [
28219
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
27950
28220
  Input,
27951
28221
  {
27952
28222
  type: "file",
@@ -27963,14 +28233,14 @@ var FileInput2 = ({ className, style, ...props }) => {
27963
28233
  onChange: handleChange
27964
28234
  }
27965
28235
  ),
27966
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28236
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
27967
28237
  ] });
27968
28238
  };
27969
28239
  var FileInput_default = FileInput2;
27970
28240
 
27971
28241
  // src/components/Inputs/DatePicker/DatePicker.tsx
27972
- var import_react24 = require("react");
27973
- var import_jsx_runtime42 = require("react/jsx-runtime");
28242
+ var import_react26 = require("react");
28243
+ var import_jsx_runtime43 = require("react/jsx-runtime");
27974
28244
  function DatePicker({ className, style, ...props }) {
27975
28245
  const placeholder = props.placeholder ?? "Placeholder text";
27976
28246
  const minimumDate = props.minimumDate ?? "none";
@@ -27995,7 +28265,7 @@ function DatePicker({ className, style, ...props }) {
27995
28265
  };
27996
28266
  const minDate = resolveDate(minimumDate, customMinimumDate);
27997
28267
  const maxDate = resolveDate(maximumDate, customMaximumDate);
27998
- (0, import_react24.useEffect)(() => {
28268
+ (0, import_react26.useEffect)(() => {
27999
28269
  if (props.value !== void 0) {
28000
28270
  handleChange(props.value);
28001
28271
  }
@@ -28007,8 +28277,8 @@ function DatePicker({ className, style, ...props }) {
28007
28277
  if (!value) return "";
28008
28278
  return new Date(value).toISOString().split("T")[0];
28009
28279
  };
28010
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
28011
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
28280
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
28281
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
28012
28282
  Input,
28013
28283
  {
28014
28284
  type: "date",
@@ -28033,18 +28303,18 @@ function DatePicker({ className, style, ...props }) {
28033
28303
  max: maxDate
28034
28304
  }
28035
28305
  ) }),
28036
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28306
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28037
28307
  ] });
28038
28308
  }
28039
28309
 
28040
28310
  // src/components/Inputs/DateRange/DateRange.tsx
28041
- var import_react25 = __toESM(require("react"));
28311
+ var import_react27 = __toESM(require("react"));
28042
28312
  var import_date_fns = require("date-fns");
28043
28313
 
28044
28314
  // src/components/ui/calendar.tsx
28045
28315
  var React6 = __toESM(require("react"));
28046
28316
  var import_react_day_picker = require("react-day-picker");
28047
- var import_jsx_runtime43 = require("react/jsx-runtime");
28317
+ var import_jsx_runtime44 = require("react/jsx-runtime");
28048
28318
  function Calendar2({
28049
28319
  className,
28050
28320
  classNames,
@@ -28056,7 +28326,7 @@ function Calendar2({
28056
28326
  ...props
28057
28327
  }) {
28058
28328
  const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
28059
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
28329
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
28060
28330
  import_react_day_picker.DayPicker,
28061
28331
  {
28062
28332
  showOutsideDays,
@@ -28155,7 +28425,7 @@ function Calendar2({
28155
28425
  },
28156
28426
  components: {
28157
28427
  Root: ({ className: className2, rootRef, ...props2 }) => {
28158
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
28428
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
28159
28429
  "div",
28160
28430
  {
28161
28431
  "data-slot": "calendar",
@@ -28167,10 +28437,10 @@ function Calendar2({
28167
28437
  },
28168
28438
  Chevron: ({ className: className2, orientation, ...props2 }) => {
28169
28439
  if (orientation === "left") {
28170
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChevronLeft, { className: cn("size-4", className2), ...props2 });
28440
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChevronLeft, { className: cn("size-4", className2), ...props2 });
28171
28441
  }
28172
28442
  if (orientation === "right") {
28173
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
28443
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
28174
28444
  ChevronRight,
28175
28445
  {
28176
28446
  className: cn("size-4", className2),
@@ -28178,11 +28448,11 @@ function Calendar2({
28178
28448
  }
28179
28449
  );
28180
28450
  }
28181
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChevronDown, { className: cn("size-4", className2), ...props2 });
28451
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChevronDown, { className: cn("size-4", className2), ...props2 });
28182
28452
  },
28183
28453
  DayButton: CalendarDayButton,
28184
28454
  WeekNumber: ({ children, ...props2 }) => {
28185
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
28455
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("td", { ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
28186
28456
  },
28187
28457
  ...components
28188
28458
  },
@@ -28201,7 +28471,7 @@ function CalendarDayButton({
28201
28471
  React6.useEffect(() => {
28202
28472
  if (modifiers.focused) ref.current?.focus();
28203
28473
  }, [modifiers.focused]);
28204
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
28474
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
28205
28475
  Button,
28206
28476
  {
28207
28477
  ref,
@@ -28224,16 +28494,16 @@ function CalendarDayButton({
28224
28494
 
28225
28495
  // src/components/ui/popover.tsx
28226
28496
  var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
28227
- var import_jsx_runtime44 = require("react/jsx-runtime");
28497
+ var import_jsx_runtime45 = require("react/jsx-runtime");
28228
28498
  function Popover({
28229
28499
  ...props
28230
28500
  }) {
28231
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
28501
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
28232
28502
  }
28233
28503
  function PopoverTrigger({
28234
28504
  ...props
28235
28505
  }) {
28236
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
28506
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
28237
28507
  }
28238
28508
  function PopoverContent({
28239
28509
  className,
@@ -28241,7 +28511,7 @@ function PopoverContent({
28241
28511
  sideOffset = 4,
28242
28512
  ...props
28243
28513
  }) {
28244
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
28514
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28245
28515
  PopoverPrimitive.Content,
28246
28516
  {
28247
28517
  "data-slot": "popover-content",
@@ -28257,16 +28527,16 @@ function PopoverContent({
28257
28527
  }
28258
28528
 
28259
28529
  // src/components/Inputs/DateRange/DateRange.tsx
28260
- var import_jsx_runtime45 = require("react/jsx-runtime");
28530
+ var import_jsx_runtime46 = require("react/jsx-runtime");
28261
28531
  var DateRange = ({ className, style, ...props }) => {
28262
28532
  const isDateRange = (val) => !!val && val.from instanceof Date;
28263
- const [date, setDate] = import_react25.default.useState(
28533
+ const [date, setDate] = import_react27.default.useState(
28264
28534
  isDateRange(props.value) ? props.value : {
28265
28535
  from: /* @__PURE__ */ new Date(),
28266
28536
  to: (0, import_date_fns.addDays)(/* @__PURE__ */ new Date(), 7)
28267
28537
  }
28268
28538
  );
28269
- (0, import_react25.useEffect)(() => {
28539
+ (0, import_react27.useEffect)(() => {
28270
28540
  if (props.value && isDateRange(props.value)) {
28271
28541
  handleChange?.(props.value);
28272
28542
  }
@@ -28277,9 +28547,9 @@ var DateRange = ({ className, style, ...props }) => {
28277
28547
  props.onChange?.(value);
28278
28548
  }
28279
28549
  };
28280
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
28281
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Popover, { children: [
28282
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28550
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
28551
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Popover, { children: [
28552
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28283
28553
  Button,
28284
28554
  {
28285
28555
  id: "date",
@@ -28288,15 +28558,15 @@ var DateRange = ({ className, style, ...props }) => {
28288
28558
  "w-full justify-start text-left font-normal text-[11px] border-[#BDBDBD]",
28289
28559
  !date && "text-muted-foreground"
28290
28560
  ),
28291
- children: date?.from ? date.to ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
28561
+ children: date?.from ? date.to ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
28292
28562
  (0, import_date_fns.format)(date.from, "LLL dd, y"),
28293
28563
  " -",
28294
28564
  " ",
28295
28565
  (0, import_date_fns.format)(date.to, "LLL dd, y")
28296
- ] }) : (0, import_date_fns.format)(date.from, "LLL dd, y") : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Pick a date range" })
28566
+ ] }) : (0, import_date_fns.format)(date.from, "LLL dd, y") : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Pick a date range" })
28297
28567
  }
28298
28568
  ) }),
28299
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28569
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28300
28570
  Calendar2,
28301
28571
  {
28302
28572
  mode: "range",
@@ -28307,21 +28577,21 @@ var DateRange = ({ className, style, ...props }) => {
28307
28577
  }
28308
28578
  ) })
28309
28579
  ] }) }),
28310
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28580
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28311
28581
  ] });
28312
28582
  };
28313
28583
  var DateRange_default = DateRange;
28314
28584
 
28315
28585
  // src/components/Inputs/TextInputGroup/TextInputGroup.tsx
28316
- var import_react26 = require("react");
28317
- var import_jsx_runtime46 = require("react/jsx-runtime");
28586
+ var import_react28 = require("react");
28587
+ var import_jsx_runtime47 = require("react/jsx-runtime");
28318
28588
  var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28319
28589
  const placeholder = props.placeholder ?? "Placeholder text";
28320
28590
  const isEditable = props.isEditable ?? true;
28321
28591
  const isDisabled = props.isDisabled ?? false;
28322
28592
  const isReadonly = props.isReadonly ?? false;
28323
28593
  const isAutocomplete = props.isAutocomplete ?? false;
28324
- (0, import_react26.useEffect)(() => {
28594
+ (0, import_react28.useEffect)(() => {
28325
28595
  if (props.value !== void 0) {
28326
28596
  const e = { target: { value: props.value } };
28327
28597
  handleChange?.(e);
@@ -28330,8 +28600,8 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28330
28600
  const handleChange = (e) => {
28331
28601
  props.onChange?.(e);
28332
28602
  };
28333
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
28334
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28603
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
28604
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28335
28605
  "div",
28336
28606
  {
28337
28607
  className: cn(
@@ -28341,8 +28611,8 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28341
28611
  props.errorMessage ? "border-red-500" : ""
28342
28612
  ),
28343
28613
  children: [
28344
- prepend && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
28345
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28614
+ prepend && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
28615
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28346
28616
  Input,
28347
28617
  {
28348
28618
  id: props.name || "prepend-input",
@@ -28364,11 +28634,11 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28364
28634
  readOnly: isReadonly
28365
28635
  }
28366
28636
  ),
28367
- append && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-r-md", children: append })
28637
+ append && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-r-md", children: append })
28368
28638
  ]
28369
28639
  }
28370
28640
  ),
28371
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28641
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28372
28642
  ] });
28373
28643
  };
28374
28644
  var TextInputGroup_default = TextInputGroup;
@@ -28381,22 +28651,22 @@ var import_cmdk = require("cmdk");
28381
28651
 
28382
28652
  // src/components/ui/dialog.tsx
28383
28653
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
28384
- var import_jsx_runtime47 = require("react/jsx-runtime");
28654
+ var import_jsx_runtime48 = require("react/jsx-runtime");
28385
28655
  function Dialog({
28386
28656
  ...props
28387
28657
  }) {
28388
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
28658
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
28389
28659
  }
28390
28660
  function DialogPortal({
28391
28661
  ...props
28392
28662
  }) {
28393
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
28663
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
28394
28664
  }
28395
28665
  function DialogOverlay({
28396
28666
  className,
28397
28667
  ...props
28398
28668
  }) {
28399
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28669
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28400
28670
  DialogPrimitive.Overlay,
28401
28671
  {
28402
28672
  "data-slot": "dialog-overlay",
@@ -28414,9 +28684,9 @@ function DialogContent({
28414
28684
  showCloseButton = true,
28415
28685
  ...props
28416
28686
  }) {
28417
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
28418
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogOverlay, {}),
28419
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28687
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
28688
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogOverlay, {}),
28689
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28420
28690
  DialogPrimitive.Content,
28421
28691
  {
28422
28692
  "data-slot": "dialog-content",
@@ -28427,14 +28697,14 @@ function DialogContent({
28427
28697
  ...props,
28428
28698
  children: [
28429
28699
  children,
28430
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28700
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28431
28701
  DialogPrimitive.Close,
28432
28702
  {
28433
28703
  "data-slot": "dialog-close",
28434
28704
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
28435
28705
  children: [
28436
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(X, {}),
28437
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "sr-only", children: "Close" })
28706
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(X, {}),
28707
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "sr-only", children: "Close" })
28438
28708
  ]
28439
28709
  }
28440
28710
  )
@@ -28444,7 +28714,7 @@ function DialogContent({
28444
28714
  ] });
28445
28715
  }
28446
28716
  function DialogHeader({ className, ...props }) {
28447
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28717
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28448
28718
  "div",
28449
28719
  {
28450
28720
  "data-slot": "dialog-header",
@@ -28454,7 +28724,7 @@ function DialogHeader({ className, ...props }) {
28454
28724
  );
28455
28725
  }
28456
28726
  function DialogFooter({ className, ...props }) {
28457
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28727
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28458
28728
  "div",
28459
28729
  {
28460
28730
  "data-slot": "dialog-footer",
@@ -28470,7 +28740,7 @@ function DialogTitle({
28470
28740
  className,
28471
28741
  ...props
28472
28742
  }) {
28473
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28743
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28474
28744
  DialogPrimitive.Title,
28475
28745
  {
28476
28746
  "data-slot": "dialog-title",
@@ -28483,7 +28753,7 @@ function DialogDescription({
28483
28753
  className,
28484
28754
  ...props
28485
28755
  }) {
28486
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28756
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28487
28757
  DialogPrimitive.Description,
28488
28758
  {
28489
28759
  "data-slot": "dialog-description",
@@ -28494,12 +28764,12 @@ function DialogDescription({
28494
28764
  }
28495
28765
 
28496
28766
  // src/components/ui/command.tsx
28497
- var import_jsx_runtime48 = require("react/jsx-runtime");
28767
+ var import_jsx_runtime49 = require("react/jsx-runtime");
28498
28768
  function Command2({
28499
28769
  className,
28500
28770
  ...props
28501
28771
  }) {
28502
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28772
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28503
28773
  import_cmdk.Command,
28504
28774
  {
28505
28775
  "data-slot": "command",
@@ -28515,14 +28785,14 @@ function CommandInput({
28515
28785
  className,
28516
28786
  ...props
28517
28787
  }) {
28518
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28788
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28519
28789
  "div",
28520
28790
  {
28521
28791
  "data-slot": "command-input-wrapper",
28522
28792
  className: "flex h-9 items-center gap-2 border-b px-3",
28523
28793
  children: [
28524
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Search, { className: "size-4 shrink-0 opacity-50" }),
28525
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28794
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Search, { className: "size-4 shrink-0 opacity-50" }),
28795
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28526
28796
  import_cmdk.Command.Input,
28527
28797
  {
28528
28798
  "data-slot": "command-input",
@@ -28541,7 +28811,7 @@ function CommandList({
28541
28811
  className,
28542
28812
  ...props
28543
28813
  }) {
28544
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28814
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28545
28815
  import_cmdk.Command.List,
28546
28816
  {
28547
28817
  "data-slot": "command-list",
@@ -28556,7 +28826,7 @@ function CommandList({
28556
28826
  function CommandEmpty({
28557
28827
  ...props
28558
28828
  }) {
28559
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28829
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28560
28830
  import_cmdk.Command.Empty,
28561
28831
  {
28562
28832
  "data-slot": "command-empty",
@@ -28569,7 +28839,7 @@ function CommandGroup({
28569
28839
  className,
28570
28840
  ...props
28571
28841
  }) {
28572
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28842
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28573
28843
  import_cmdk.Command.Group,
28574
28844
  {
28575
28845
  "data-slot": "command-group",
@@ -28585,7 +28855,7 @@ function CommandItem({
28585
28855
  className,
28586
28856
  ...props
28587
28857
  }) {
28588
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28858
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28589
28859
  import_cmdk.Command.Item,
28590
28860
  {
28591
28861
  "data-slot": "command-item",
@@ -28599,7 +28869,7 @@ function CommandItem({
28599
28869
  }
28600
28870
 
28601
28871
  // src/components/Inputs/Multiselect/MultiSelect.tsx
28602
- var import_jsx_runtime49 = require("react/jsx-runtime");
28872
+ var import_jsx_runtime50 = require("react/jsx-runtime");
28603
28873
  var MultiSelect = ({
28604
28874
  value = [],
28605
28875
  onChange,
@@ -28624,15 +28894,15 @@ var MultiSelect = ({
28624
28894
  );
28625
28895
  };
28626
28896
  const selectedLabels = React8.useMemo(
28627
- () => data.filter((opt) => value.includes(opt.value)).map((opt) => opt.label),
28897
+ () => data?.filter((opt) => value.includes(opt.value)).map((opt) => opt.label),
28628
28898
  [data, value]
28629
28899
  );
28630
- const options = data.map((item) => ({
28900
+ const options = data?.map((item) => ({
28631
28901
  value: item[dataKey],
28632
28902
  label: item[dataLabel]
28633
28903
  }));
28634
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
28635
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28904
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
28905
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
28636
28906
  Button,
28637
28907
  {
28638
28908
  variant: "outline",
@@ -28641,12 +28911,12 @@ var MultiSelect = ({
28641
28911
  disabled,
28642
28912
  type: "button",
28643
28913
  children: [
28644
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
28645
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
28914
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
28915
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
28646
28916
  ]
28647
28917
  }
28648
28918
  ) }),
28649
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28919
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28650
28920
  PopoverContent,
28651
28921
  {
28652
28922
  align: "start",
@@ -28655,26 +28925,26 @@ var MultiSelect = ({
28655
28925
  onInteractOutside: (e) => {
28656
28926
  if (e.target.closest(".keep-open")) e.preventDefault();
28657
28927
  },
28658
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Command2, { shouldFilter: searchable, children: [
28659
- searchable && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CommandInput, { placeholder: "Search..." }),
28660
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(CommandList, { children: [
28661
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CommandEmpty, { children: "No options found." }),
28662
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CommandGroup, { children: options.map((opt) => {
28928
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Command2, { shouldFilter: searchable, children: [
28929
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CommandInput, { placeholder: "Search..." }),
28930
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(CommandList, { children: [
28931
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CommandEmpty, { children: "No options found." }),
28932
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CommandGroup, { children: options.map((opt) => {
28663
28933
  const isSelected = value.includes(opt.value);
28664
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28934
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28665
28935
  "div",
28666
28936
  {
28667
28937
  className: "keep-open",
28668
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28938
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28669
28939
  CommandItem,
28670
28940
  {
28671
28941
  onMouseDown: (e) => {
28672
28942
  e.preventDefault();
28673
28943
  toggleOption(opt.value);
28674
28944
  },
28675
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
28676
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Checkbox, { checked: isSelected }),
28677
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: opt.label })
28945
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
28946
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Checkbox, { checked: isSelected }),
28947
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: opt.label })
28678
28948
  ] })
28679
28949
  },
28680
28950
  opt.value
@@ -28687,7 +28957,7 @@ var MultiSelect = ({
28687
28957
  ] })
28688
28958
  }
28689
28959
  ),
28690
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28960
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28691
28961
  ] });
28692
28962
  };
28693
28963
  var MultiSelect_default = MultiSelect;
@@ -28696,17 +28966,17 @@ var MultiSelect_default = MultiSelect;
28696
28966
  var React9 = __toESM(require("react"));
28697
28967
  var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
28698
28968
  var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
28699
- var import_react_table = require("@tanstack/react-table");
28969
+ var import_react_table2 = require("@tanstack/react-table");
28700
28970
 
28701
28971
  // src/components/ui/table.tsx
28702
- var import_jsx_runtime50 = require("react/jsx-runtime");
28972
+ var import_jsx_runtime51 = require("react/jsx-runtime");
28703
28973
  function Table3({ className, ...props }) {
28704
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28974
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28705
28975
  "div",
28706
28976
  {
28707
28977
  "data-slot": "table-container",
28708
28978
  className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
28709
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28979
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28710
28980
  "table",
28711
28981
  {
28712
28982
  "data-slot": "table",
@@ -28718,7 +28988,7 @@ function Table3({ className, ...props }) {
28718
28988
  );
28719
28989
  }
28720
28990
  function TableHeader({ className, ...props }) {
28721
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28991
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28722
28992
  "thead",
28723
28993
  {
28724
28994
  "data-slot": "table-header",
@@ -28731,7 +29001,7 @@ function TableHeader({ className, ...props }) {
28731
29001
  );
28732
29002
  }
28733
29003
  function TableBody({ className, ...props }) {
28734
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29004
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28735
29005
  "tbody",
28736
29006
  {
28737
29007
  "data-slot": "table-body",
@@ -28744,7 +29014,7 @@ function TableBody({ className, ...props }) {
28744
29014
  );
28745
29015
  }
28746
29016
  function TableRow({ className, ...props }) {
28747
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29017
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28748
29018
  "tr",
28749
29019
  {
28750
29020
  "data-slot": "table-row",
@@ -28757,7 +29027,7 @@ function TableRow({ className, ...props }) {
28757
29027
  );
28758
29028
  }
28759
29029
  function TableHead({ className, ...props }) {
28760
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29030
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28761
29031
  "th",
28762
29032
  {
28763
29033
  "data-slot": "table-head",
@@ -28770,7 +29040,7 @@ function TableHead({ className, ...props }) {
28770
29040
  );
28771
29041
  }
28772
29042
  function TableCell({ className, ...props }) {
28773
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29043
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28774
29044
  "td",
28775
29045
  {
28776
29046
  "data-slot": "table-cell",
@@ -28783,8 +29053,246 @@ function TableCell({ className, ...props }) {
28783
29053
  );
28784
29054
  }
28785
29055
 
29056
+ // src/lib/table/useDynamicColumns.ts
29057
+ var import_react_table = require("@tanstack/react-table");
29058
+
29059
+ // src/lib/table/cellRendererFactory.tsx
29060
+ var import_image3 = __toESM(require("next/image"));
29061
+
29062
+ // src/lib/table/valueFormatter.ts
29063
+ var import_dayjs = __toESM(require("dayjs"));
29064
+ var valueFormatter = (value, format2, customFormatters = {}) => {
29065
+ if (!format2) return value;
29066
+ if (value == null) return "";
29067
+ if (format2.startsWith("custom:")) {
29068
+ const key = format2.replace("custom:", "");
29069
+ return customFormatters[key] ? customFormatters[key](value) : value;
29070
+ }
29071
+ const [type, arg] = format2.split(":");
29072
+ switch (type) {
29073
+ case "date":
29074
+ return (0, import_dayjs.default)(value).format(arg || "YYYY-MM-DD");
29075
+ case "datetime":
29076
+ return (0, import_dayjs.default)(value).format(arg || "YYYY-MM-DD HH:mm:ss");
29077
+ case "time":
29078
+ return (0, import_dayjs.default)(value).format(arg || "HH:mm");
29079
+ case "number":
29080
+ return Number(value).toFixed(parseInt(arg || "2"));
29081
+ case "currency":
29082
+ return new Intl.NumberFormat("en-IN", {
29083
+ style: "currency",
29084
+ currency: arg || "INR"
29085
+ }).format(Number(value));
29086
+ case "uppercase":
29087
+ return String(value).toUpperCase();
29088
+ case "lowercase":
29089
+ return String(value).toLowerCase();
29090
+ default:
29091
+ return value;
29092
+ }
29093
+ };
29094
+
29095
+ // src/lib/table/cellRendererFactory.tsx
29096
+ var import_jsx_runtime52 = require("react/jsx-runtime");
29097
+ var getContrastColor = (bg) => {
29098
+ let c = bg.trim().toUpperCase();
29099
+ if (/^#([a-fA-F0-9]{3})$/.test(c)) {
29100
+ c = "#" + c.slice(1).split("").map((x) => x + x).join("");
29101
+ }
29102
+ const named = {
29103
+ white: "#FFFFFF",
29104
+ black: "#000000",
29105
+ red: "#FF0000",
29106
+ green: "#008000",
29107
+ blue: "#0000FF",
29108
+ gray: "#808080",
29109
+ grey: "#808080",
29110
+ orange: "#FFA500",
29111
+ yellow: "#FFFF00",
29112
+ purple: "#800080",
29113
+ pink: "#FFC0CB",
29114
+ teal: "#008080"
29115
+ };
29116
+ if (!c.startsWith("#")) {
29117
+ const lower = c.toLowerCase();
29118
+ if (named[lower]) c = named[lower];
29119
+ else return "#FFFFFF";
29120
+ }
29121
+ if (!/^#([a-fA-F0-9]{6})$/.test(c)) return "#FFFFFF";
29122
+ const r = parseInt(c.slice(1, 3), 16);
29123
+ const g = parseInt(c.slice(3, 5), 16);
29124
+ const b = parseInt(c.slice(5, 7), 16);
29125
+ const brightness = (r * 299 + g * 587 + b * 114) / 1e3;
29126
+ return brightness > 160 ? "#000000" : "#FFFFFF";
29127
+ };
29128
+ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers = {}, format2, customFormatters = {}) => {
29129
+ const formattedValue = valueFormatter(value, format2, customFormatters);
29130
+ switch (renderer) {
29131
+ /* -------------------- BASIC -------------------- */
29132
+ case "text":
29133
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: row?.[rendererProps?.rowField] || formattedValue });
29134
+ case "number":
29135
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || formattedValue, "number:2") });
29136
+ case "date":
29137
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: valueFormatter(row?.[rendererProps?.rowField] || formattedValue, "date:DD MMM YYYY") });
29138
+ case "link":
29139
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29140
+ "a",
29141
+ {
29142
+ href: `${rendererProps?.prefix || ""}${row?.[rendererProps?.rowField] || formattedValue}`,
29143
+ target: "_blank",
29144
+ rel: "noreferrer",
29145
+ className: `text-blue-500 underline ${rendererProps?.className || ""}`,
29146
+ children: rendererProps?.label || formattedValue
29147
+ }
29148
+ );
29149
+ /* -------------------- VISUAL -------------------- */
29150
+ case "image":
29151
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29152
+ import_image3.default,
29153
+ {
29154
+ src: row?.[rendererProps?.rowField] || formattedValue || rendererProps?.fallback || "/placeholder.png",
29155
+ alt: rendererProps?.alt || "",
29156
+ width: rendererProps?.width || 40,
29157
+ height: rendererProps?.height || 40,
29158
+ className: `object-cover ${rendererProps?.rounded ? "rounded-full" : ""} ${rendererProps?.className || ""}`,
29159
+ style: {
29160
+ borderRadius: rendererProps?.rounded ? "50%" : 0,
29161
+ objectFit: "cover"
29162
+ }
29163
+ }
29164
+ ) });
29165
+ case "icon":
29166
+ const maybeIcon = lucide_react_exports[rendererProps?.icon];
29167
+ const IconComponent = typeof maybeIcon === "function" ? maybeIcon : Star;
29168
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29169
+ IconComponent,
29170
+ {
29171
+ size: rendererProps?.size || 16,
29172
+ color: rendererProps?.color || "#555",
29173
+ className: rendererProps?.className || ""
29174
+ }
29175
+ );
29176
+ case "badge": {
29177
+ const color = rendererProps?.colorMap?.[formattedValue] || rendererProps?.color || "gray";
29178
+ if (!formattedValue) return null;
29179
+ const textColor = getContrastColor(color);
29180
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29181
+ "span",
29182
+ {
29183
+ className: `inline-block px-2 py-1 text-xs rounded-full bg-${color}-100 text-${textColor}-700 ${rendererProps?.className || ""}`,
29184
+ style: { backgroundColor: color, color: textColor },
29185
+ children: formattedValue
29186
+ }
29187
+ );
29188
+ }
29189
+ case "chip": {
29190
+ const color = rendererProps?.color || "gray";
29191
+ const maybeIcon2 = lucide_react_exports[rendererProps?.icon];
29192
+ const IconComponent2 = typeof maybeIcon2 === "function" ? maybeIcon2 : Star;
29193
+ if (!formattedValue) return null;
29194
+ const textColor = getContrastColor(color);
29195
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
29196
+ "span",
29197
+ {
29198
+ className: `inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[${color}]-100 text-[${textColor}]-700`,
29199
+ style: { backgroundColor: color, color: textColor },
29200
+ children: [
29201
+ rendererProps?.icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: IconComponent2 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box, { className: "h-4 w-4" }) }),
29202
+ formattedValue
29203
+ ]
29204
+ }
29205
+ );
29206
+ }
29207
+ /* -------------------- INTERACTIVE -------------------- */
29208
+ case "button":
29209
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29210
+ "button",
29211
+ {
29212
+ onClick: () => rendererProps?.onClick?.(row, formattedValue),
29213
+ className: `px-2 py-1 rounded text-white bg-blue-600 hover:bg-blue-700 ${rendererProps?.className || ""}`,
29214
+ children: row?.[rendererProps?.rowField] || rendererProps.value || formattedValue
29215
+ }
29216
+ );
29217
+ case "switch":
29218
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { className: "inline-flex items-center cursor-pointer", children: [
29219
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29220
+ "input",
29221
+ {
29222
+ type: "checkbox",
29223
+ checked: !!value,
29224
+ onChange: (e) => rendererProps?.onChange?.(row, e.target.checked),
29225
+ className: "sr-only peer"
29226
+ }
29227
+ ),
29228
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
29229
+ ] });
29230
+ case "progress":
29231
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29232
+ "div",
29233
+ {
29234
+ className: "bg-blue-600 h-2 rounded-full transition-all",
29235
+ style: { width: `${row?.[rendererProps?.rowField] || formattedValue || 0}%` }
29236
+ }
29237
+ ) });
29238
+ case "rating": {
29239
+ const stars = Math.round(Number(row?.[rendererProps?.rowField] || formattedValue) || 0);
29240
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29241
+ Star,
29242
+ {
29243
+ size: 16,
29244
+ className: i < stars ? "text-yellow-400" : "text-gray-300",
29245
+ fill: i < stars ? "#facc15" : "none"
29246
+ },
29247
+ i
29248
+ )) });
29249
+ }
29250
+ /* -------------------- ADVANCED -------------------- */
29251
+ case "custom": {
29252
+ const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
29253
+ if (CustomRenderer)
29254
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29255
+ CustomRenderer,
29256
+ {
29257
+ value: formattedValue,
29258
+ row,
29259
+ ...rendererProps
29260
+ }
29261
+ );
29262
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "Missing custom renderer" });
29263
+ }
29264
+ /* -------------------- DEFAULT -------------------- */
29265
+ default:
29266
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: formattedValue });
29267
+ }
29268
+ };
29269
+
29270
+ // src/lib/table/useDynamicColumns.ts
29271
+ var columnHelper = (0, import_react_table.createColumnHelper)();
29272
+ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) => {
29273
+ return config.columns.map(
29274
+ (col) => columnHelper.accessor(col.accessorKey ?? col.id, {
29275
+ id: col.accessorKey ?? col.id,
29276
+ header: col.header,
29277
+ cell: (info) => {
29278
+ const value = info.getValue();
29279
+ const row = info.row.original;
29280
+ return cellRendererFactory(
29281
+ col.renderer,
29282
+ col.rendererProps,
29283
+ value,
29284
+ row,
29285
+ customRenderers,
29286
+ col.format,
29287
+ customFormatters
29288
+ );
29289
+ }
29290
+ })
29291
+ );
29292
+ };
29293
+
28786
29294
  // src/components/ui/data-table.tsx
28787
- var import_jsx_runtime51 = require("react/jsx-runtime");
29295
+ var import_jsx_runtime53 = require("react/jsx-runtime");
28788
29296
  function DataTable({
28789
29297
  columns,
28790
29298
  data,
@@ -28810,7 +29318,7 @@ function DataTable({
28810
29318
  const deleteColumn = React9.useMemo(() => ({
28811
29319
  id: "delete",
28812
29320
  header: "Actions",
28813
- cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29321
+ cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28814
29322
  "button",
28815
29323
  {
28816
29324
  className: "px-3 py-1 text-[12px] bg-red-800 text-white rounded hover:bg-neutral-600 cursor-pointer",
@@ -28831,9 +29339,10 @@ function DataTable({
28831
29339
  }
28832
29340
  return columns;
28833
29341
  }, [columns, enableDelete, deleteColumn]);
28834
- const table = (0, import_react_table.useReactTable)({
29342
+ const dynamicCols = useDynamicColumns({ columns: combinedColumns });
29343
+ const table = (0, import_react_table2.useReactTable)({
28835
29344
  data,
28836
- columns: combinedColumns,
29345
+ columns: dynamicCols,
28837
29346
  state: {
28838
29347
  columnFilters,
28839
29348
  columnVisibility,
@@ -28846,9 +29355,9 @@ function DataTable({
28846
29355
  },
28847
29356
  onColumnFiltersChange: setColumnFilters,
28848
29357
  onColumnVisibilityChange: setColumnVisibility,
28849
- getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
28850
- getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
28851
- getPaginationRowModel: pagination && paginationMode === "client" ? (0, import_react_table.getPaginationRowModel)() : void 0,
29358
+ getCoreRowModel: (0, import_react_table2.getCoreRowModel)(),
29359
+ getFilteredRowModel: (0, import_react_table2.getFilteredRowModel)(),
29360
+ getPaginationRowModel: pagination && paginationMode === "client" ? (0, import_react_table2.getPaginationRowModel)() : void 0,
28852
29361
  manualPagination: paginationMode === "server",
28853
29362
  pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
28854
29363
  ...paginationMode === "server" ? {
@@ -28878,11 +29387,11 @@ function DataTable({
28878
29387
  }
28879
29388
  return [];
28880
29389
  };
28881
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
28882
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
28883
- globalSearch && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
28884
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative w-full", children: [
28885
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29390
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
29391
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
29392
+ globalSearch && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
29393
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "relative w-full", children: [
29394
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28886
29395
  "input",
28887
29396
  {
28888
29397
  type: "text",
@@ -28897,9 +29406,9 @@ function DataTable({
28897
29406
  className: "border border-gray-300 rounded-md text-sm px-3 py-2 pl-8 w-full focus:outline-none focus:ring-1 focus:ring-[#12715B]"
28898
29407
  }
28899
29408
  ),
28900
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
29409
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
28901
29410
  ] }),
28902
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29411
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28903
29412
  Button,
28904
29413
  {
28905
29414
  size: "sm",
@@ -28909,8 +29418,8 @@ function DataTable({
28909
29418
  }
28910
29419
  )
28911
29420
  ] }),
28912
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
28913
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29421
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Popover, { children: [
29422
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28914
29423
  Button,
28915
29424
  {
28916
29425
  variant: "outline",
@@ -28919,10 +29428,10 @@ function DataTable({
28919
29428
  children: "Manage Columns"
28920
29429
  }
28921
29430
  ) }),
28922
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
28923
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
28924
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
28925
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29431
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
29432
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
29433
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
29434
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28926
29435
  "input",
28927
29436
  {
28928
29437
  type: "checkbox",
@@ -28941,8 +29450,8 @@ function DataTable({
28941
29450
  ),
28942
29451
  "Toggle All"
28943
29452
  ] }),
28944
- table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
28945
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29453
+ table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
29454
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28946
29455
  "input",
28947
29456
  {
28948
29457
  type: "checkbox",
@@ -28955,13 +29464,13 @@ function DataTable({
28955
29464
  ] })
28956
29465
  ] })
28957
29466
  ] }),
28958
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Table3, { children: [
28959
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: hg.headers.map((header) => {
29467
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Table3, { children: [
29468
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: hg.headers.map((header) => {
28960
29469
  const canSort = header.column.getCanSort();
28961
29470
  const canFilter = header.column.getCanFilter();
28962
29471
  const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
28963
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableHead, { className: "relative select-none", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
28964
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
29472
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableHead, { className: "relative select-none", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between", children: [
29473
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
28965
29474
  "span",
28966
29475
  {
28967
29476
  className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
@@ -28972,33 +29481,33 @@ function DataTable({
28972
29481
  onSortChange?.(header.column.id, newDir);
28973
29482
  },
28974
29483
  children: [
28975
- (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
28976
- canSort && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
28977
- sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
28978
- sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
28979
- !sortDir && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
29484
+ (0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()),
29485
+ canSort && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
29486
+ sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
29487
+ sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
29488
+ !sortDir && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
28980
29489
  ] })
28981
29490
  ]
28982
29491
  }
28983
29492
  ),
28984
- canFilter && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
28985
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29493
+ canFilter && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Popover, { children: [
29494
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28986
29495
  "span",
28987
29496
  {
28988
29497
  role: "presentation",
28989
29498
  className: "pl-5 cursor-pointer",
28990
29499
  onClick: (e) => e.stopPropagation(),
28991
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons2.faEllipsisH, className: "w-5 h-5 text-gray-500" })
29500
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons2.faEllipsisH, className: "w-5 h-5 text-gray-500" })
28992
29501
  }
28993
29502
  ) }),
28994
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29503
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
28995
29504
  PopoverContent,
28996
29505
  {
28997
29506
  align: "center",
28998
29507
  sideOffset: 14,
28999
29508
  className: "w-50 p-3 z-[200] border-gray-300",
29000
29509
  avoidCollisions: true,
29001
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
29510
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29002
29511
  "form",
29003
29512
  {
29004
29513
  onSubmit: (e) => {
@@ -29011,8 +29520,8 @@ function DataTable({
29011
29520
  },
29012
29521
  className: "space-y-2",
29013
29522
  children: [
29014
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
29015
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29523
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
29524
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29016
29525
  "input",
29017
29526
  {
29018
29527
  name: "filter",
@@ -29022,7 +29531,7 @@ function DataTable({
29022
29531
  autoComplete: "off"
29023
29532
  }
29024
29533
  ),
29025
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29534
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29026
29535
  Button,
29027
29536
  {
29028
29537
  type: "submit",
@@ -29038,10 +29547,10 @@ function DataTable({
29038
29547
  ] })
29039
29548
  ] }) }, header.id);
29040
29549
  }) }, hg.id)) }),
29041
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableCell, { colSpan: combinedColumns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => {
29550
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: combinedColumns.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableCell, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => {
29042
29551
  const meta = cell.column.columnDef.meta || {};
29043
29552
  const isClickable = meta?.isClickable;
29044
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29553
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29045
29554
  TableCell,
29046
29555
  {
29047
29556
  className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100" : ""}`,
@@ -29051,21 +29560,21 @@ function DataTable({
29051
29560
  onCellClick(cell.row.original, cell.column.id);
29052
29561
  }
29053
29562
  },
29054
- children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
29563
+ children: (0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext())
29055
29564
  },
29056
29565
  cell.id
29057
29566
  );
29058
- }) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableCell, { colSpan: combinedColumns.length, className: "h-24 text-center", children: "No results." }) }) })
29567
+ }) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableCell, { colSpan: combinedColumns.length, className: "h-24 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
29059
29568
  ] }),
29060
- pagination && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
29061
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
29569
+ pagination && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
29570
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
29062
29571
  "Page ",
29063
29572
  table.getState().pagination.pageIndex + 1,
29064
29573
  " of ",
29065
29574
  table.getPageCount()
29066
29575
  ] }),
29067
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
29068
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29576
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
29577
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29069
29578
  "button",
29070
29579
  {
29071
29580
  onClick: () => table.previousPage(),
@@ -29078,7 +29587,7 @@ function DataTable({
29078
29587
  table.getState().pagination.pageIndex + 1,
29079
29588
  table.getPageCount(),
29080
29589
  5
29081
- ).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29590
+ ).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29082
29591
  "button",
29083
29592
  {
29084
29593
  disabled: pageNum === "...",
@@ -29088,7 +29597,7 @@ function DataTable({
29088
29597
  },
29089
29598
  index
29090
29599
  )),
29091
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29600
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29092
29601
  "button",
29093
29602
  {
29094
29603
  onClick: () => table.nextPage(),
@@ -29103,7 +29612,7 @@ function DataTable({
29103
29612
  }
29104
29613
 
29105
29614
  // src/components/DataDisplay/Table/Table.tsx
29106
- var import_jsx_runtime52 = require("react/jsx-runtime");
29615
+ var import_jsx_runtime54 = require("react/jsx-runtime");
29107
29616
  var Table4 = ({
29108
29617
  columns,
29109
29618
  data,
@@ -29129,7 +29638,7 @@ var Table4 = ({
29129
29638
  const rawColumns = Array.isArray(columns) ? columns : [];
29130
29639
  const rawData = Array.isArray(data) ? data : [];
29131
29640
  const isControlled = typeof page === "number";
29132
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29641
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29133
29642
  DataTable,
29134
29643
  {
29135
29644
  ...props,
@@ -29162,9 +29671,9 @@ var Table4 = ({
29162
29671
  var Table_default = Table4;
29163
29672
 
29164
29673
  // src/components/ui/pagination.tsx
29165
- var import_jsx_runtime53 = require("react/jsx-runtime");
29674
+ var import_jsx_runtime55 = require("react/jsx-runtime");
29166
29675
  function Pagination({ className, ...props }) {
29167
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29676
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29168
29677
  "nav",
29169
29678
  {
29170
29679
  role: "navigation",
@@ -29179,7 +29688,7 @@ function PaginationContent({
29179
29688
  className,
29180
29689
  ...props
29181
29690
  }) {
29182
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29691
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29183
29692
  "ul",
29184
29693
  {
29185
29694
  "data-slot": "pagination-content",
@@ -29189,7 +29698,7 @@ function PaginationContent({
29189
29698
  );
29190
29699
  }
29191
29700
  function PaginationItem({ ...props }) {
29192
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { "data-slot": "pagination-item", ...props });
29701
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { "data-slot": "pagination-item", ...props });
29193
29702
  }
29194
29703
  function PaginationLink({
29195
29704
  className,
@@ -29197,7 +29706,7 @@ function PaginationLink({
29197
29706
  size = "icon",
29198
29707
  ...props
29199
29708
  }) {
29200
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29709
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29201
29710
  "a",
29202
29711
  {
29203
29712
  "aria-current": isActive ? "page" : void 0,
@@ -29218,7 +29727,7 @@ function PaginationPrevious({
29218
29727
  className,
29219
29728
  ...props
29220
29729
  }) {
29221
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29730
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29222
29731
  PaginationLink,
29223
29732
  {
29224
29733
  "aria-label": "Go to previous page",
@@ -29226,8 +29735,8 @@ function PaginationPrevious({
29226
29735
  className: cn("gap-1 px-2.5 sm:pl-2.5", className),
29227
29736
  ...props,
29228
29737
  children: [
29229
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronLeft, {}),
29230
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Previous" })
29738
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronLeft, {}),
29739
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "hidden sm:block", children: "Previous" })
29231
29740
  ]
29232
29741
  }
29233
29742
  );
@@ -29236,7 +29745,7 @@ function PaginationNext({
29236
29745
  className,
29237
29746
  ...props
29238
29747
  }) {
29239
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29748
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29240
29749
  PaginationLink,
29241
29750
  {
29242
29751
  "aria-label": "Go to next page",
@@ -29244,8 +29753,8 @@ function PaginationNext({
29244
29753
  className: cn("gap-1 px-2.5 sm:pr-2.5", className),
29245
29754
  ...props,
29246
29755
  children: [
29247
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Next" }),
29248
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {})
29756
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "hidden sm:block", children: "Next" }),
29757
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronRight, {})
29249
29758
  ]
29250
29759
  }
29251
29760
  );
@@ -29254,7 +29763,7 @@ function PaginationEllipsis({
29254
29763
  className,
29255
29764
  ...props
29256
29765
  }) {
29257
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29766
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29258
29767
  "span",
29259
29768
  {
29260
29769
  "aria-hidden": true,
@@ -29262,15 +29771,15 @@ function PaginationEllipsis({
29262
29771
  className: cn("flex size-9 items-center justify-center", className),
29263
29772
  ...props,
29264
29773
  children: [
29265
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Ellipsis, { className: "size-4" }),
29266
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: "More pages" })
29774
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Ellipsis, { className: "size-4" }),
29775
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "More pages" })
29267
29776
  ]
29268
29777
  }
29269
29778
  );
29270
29779
  }
29271
29780
 
29272
29781
  // src/components/DataDisplay/Pagination/Pagination.tsx
29273
- var import_jsx_runtime54 = require("react/jsx-runtime");
29782
+ var import_jsx_runtime56 = require("react/jsx-runtime");
29274
29783
  var CustomPagination = ({
29275
29784
  totalPages,
29276
29785
  currentPage,
@@ -29316,10 +29825,10 @@ var CustomPagination = ({
29316
29825
  }
29317
29826
  };
29318
29827
  const pageNumbers = getPageNumbers();
29319
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
29320
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
29321
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
29322
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
29828
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
29829
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
29830
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
29831
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
29323
29832
  Select,
29324
29833
  {
29325
29834
  defaultValue: String(perPage),
@@ -29327,26 +29836,26 @@ var CustomPagination = ({
29327
29836
  onPageChange({ page: 1, itemsPerPage: Number(value) });
29328
29837
  },
29329
29838
  children: [
29330
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: "Select" }) }),
29331
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(SelectContent, { children: [
29332
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "5", children: "5" }),
29333
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "10", children: "10" }),
29334
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "20", children: "20" }),
29335
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "50", children: "50" })
29839
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Select" }) }),
29840
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
29841
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "5", children: "5" }),
29842
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "10", children: "10" }),
29843
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "20", children: "20" }),
29844
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "50", children: "50" })
29336
29845
  ] })
29337
29846
  ]
29338
29847
  }
29339
29848
  )
29340
29849
  ] }),
29341
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(PaginationContent, { children: [
29342
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29850
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PaginationContent, { children: [
29851
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
29343
29852
  PaginationPrevious,
29344
29853
  {
29345
29854
  onClick: () => handlePageChange(currentPage - 1),
29346
29855
  className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
29347
29856
  }
29348
29857
  ) }),
29349
- pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29858
+ pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
29350
29859
  PaginationLink,
29351
29860
  {
29352
29861
  onClick: () => handlePageChange(pageNumber),
@@ -29355,7 +29864,7 @@ var CustomPagination = ({
29355
29864
  children: pageNumber
29356
29865
  }
29357
29866
  ) }, index)),
29358
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29867
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
29359
29868
  PaginationNext,
29360
29869
  {
29361
29870
  onClick: () => handlePageChange(currentPage + 1),
@@ -29368,11 +29877,11 @@ var CustomPagination = ({
29368
29877
  var Pagination_default = CustomPagination;
29369
29878
 
29370
29879
  // src/components/Navigation/Tabs/Tabs.tsx
29371
- var import_react27 = require("react");
29880
+ var import_react29 = require("react");
29372
29881
  var import_link5 = __toESM(require("next/link"));
29373
29882
  var import_navigation3 = require("next/navigation");
29374
- var import_jsx_runtime55 = require("react/jsx-runtime");
29375
- var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
29883
+ var import_jsx_runtime57 = require("react/jsx-runtime");
29884
+ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
29376
29885
  function groupMenus(menus = []) {
29377
29886
  const menuMap = /* @__PURE__ */ new Map();
29378
29887
  menus.forEach((menu) => {
@@ -29405,7 +29914,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29405
29914
  });
29406
29915
  return sortMenus(rootMenus);
29407
29916
  }
29408
- const rawTabs = (0, import_react27.useMemo)(() => {
29917
+ const rawTabs = (0, import_react29.useMemo)(() => {
29409
29918
  if (!Array.isArray(tabs)) return [];
29410
29919
  if (source === "manual") return Array.isArray(tabs) ? tabs : [];
29411
29920
  return groupMenus(tabs);
@@ -29418,9 +29927,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29418
29927
  return pathname === path || path !== "/" && pathname?.startsWith(path);
29419
29928
  };
29420
29929
  const router = (0, import_navigation3.useRouter)();
29421
- const [showExitDialog, setShowExitDialog] = (0, import_react27.useState)(false);
29422
- const [pendingUrl, setPendingUrl] = (0, import_react27.useState)(null);
29423
- const handleBuilderExit = (0, import_react27.useCallback)(
29930
+ const [showExitDialog, setShowExitDialog] = (0, import_react29.useState)(false);
29931
+ const [pendingUrl, setPendingUrl] = (0, import_react29.useState)(null);
29932
+ const handleBuilderExit = (0, import_react29.useCallback)(
29424
29933
  (e, url) => {
29425
29934
  if (isBuilder) {
29426
29935
  e.preventDefault();
@@ -29439,23 +29948,23 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29439
29948
  const renderDesktopTab = (tab, index) => {
29440
29949
  const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
29441
29950
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
29442
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenu, { children: [
29443
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
29951
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenu, { children: [
29952
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
29444
29953
  tab.header,
29445
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
29954
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
29446
29955
  ] }),
29447
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29956
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29448
29957
  DropdownMenuContent,
29449
29958
  {
29450
29959
  align: "start",
29451
29960
  sideOffset: 6,
29452
29961
  className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
29453
- children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29962
+ children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29454
29963
  DropdownMenuItem,
29455
29964
  {
29456
29965
  asChild: true,
29457
29966
  className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
29458
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29967
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29459
29968
  import_link5.default,
29460
29969
  {
29461
29970
  href: item.url || "#",
@@ -29471,7 +29980,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29471
29980
  )
29472
29981
  ] }, index);
29473
29982
  }
29474
- return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29983
+ return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29475
29984
  import_link5.default,
29476
29985
  {
29477
29986
  href: tab.url,
@@ -29482,14 +29991,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29482
29991
  children: tab.header
29483
29992
  },
29484
29993
  index
29485
- ) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
29994
+ ) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
29486
29995
  };
29487
- const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenu, { children: [
29488
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
29489
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Menu, { className: "h-4 w-4" }),
29996
+ const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenu, { children: [
29997
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
29998
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Menu, { className: "h-4 w-4" }),
29490
29999
  "Menu"
29491
30000
  ] }),
29492
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30001
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29493
30002
  DropdownMenuContent,
29494
30003
  {
29495
30004
  align: "start",
@@ -29498,25 +30007,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29498
30007
  children: rawTabs.map((tab, i) => {
29499
30008
  const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
29500
30009
  if (hasChildren) {
29501
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuSub, { children: [
29502
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
29503
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30010
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenuSub, { children: [
30011
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
30012
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29504
30013
  DropdownMenuItem,
29505
30014
  {
29506
30015
  asChild: true,
29507
30016
  className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
29508
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
30017
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
29509
30018
  },
29510
30019
  item.id || index
29511
30020
  )) })
29512
30021
  ] }, i);
29513
30022
  }
29514
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30023
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29515
30024
  DropdownMenuItem,
29516
30025
  {
29517
30026
  asChild: true,
29518
30027
  className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
29519
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
30028
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
29520
30029
  },
29521
30030
  i
29522
30031
  );
@@ -29526,19 +30035,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29526
30035
  ] });
29527
30036
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
29528
30037
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
29529
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
29530
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className, style, children: [
29531
- forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
29532
- forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
30038
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
30039
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className, style, children: [
30040
+ forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30041
+ forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
29533
30042
  ] }),
29534
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
29535
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogHeader, { children: [
29536
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogTitle, { children: "Exit Builder?" }),
29537
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30043
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30044
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DialogHeader, { children: [
30045
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogTitle, { children: "Exit Builder?" }),
30046
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
29538
30047
  ] }),
29539
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogFooter, { children: [
29540
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
29541
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30048
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DialogFooter, { children: [
30049
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30050
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
29542
30051
  ] })
29543
30052
  ] }) })
29544
30053
  ] });
@@ -29546,18 +30055,18 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29546
30055
  var Tabs_default = Tabs;
29547
30056
 
29548
30057
  // src/components/Navigation/Stages/Stages.tsx
29549
- var import_react28 = __toESM(require("react"));
29550
- var import_jsx_runtime56 = require("react/jsx-runtime");
30058
+ var import_react30 = __toESM(require("react"));
30059
+ var import_jsx_runtime58 = require("react/jsx-runtime");
29551
30060
  var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage }) => {
29552
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
29553
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
29554
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => {
30061
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
30062
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30063
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => {
29555
30064
  const currentIndex = stages.findIndex((s) => s.key === currentStage);
29556
30065
  const isAllCompleted = currentStage === "completed";
29557
30066
  const isCompleted = isAllCompleted || index < currentIndex;
29558
30067
  const isActive = !isAllCompleted && index === currentIndex;
29559
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react28.default.Fragment, { children: [
29560
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30068
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react30.default.Fragment, { children: [
30069
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
29561
30070
  "button",
29562
30071
  {
29563
30072
  className: `
@@ -29571,10 +30080,10 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
29571
30080
  children: stage.header
29572
30081
  }
29573
30082
  ),
29574
- index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
30083
+ index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
29575
30084
  ] }, stage.id);
29576
30085
  }) }),
29577
- isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30086
+ isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
29578
30087
  "button",
29579
30088
  {
29580
30089
  className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
@@ -29592,26 +30101,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
29592
30101
  var Stages_default = StagesComponent;
29593
30102
 
29594
30103
  // src/components/Navigation/Spacer/Spacer.tsx
29595
- var import_jsx_runtime57 = require("react/jsx-runtime");
30104
+ var import_jsx_runtime59 = require("react/jsx-runtime");
29596
30105
  var Spacer = ({ className, style }) => {
29597
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `${className}`, style });
30106
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: `${className}`, style });
29598
30107
  };
29599
30108
  var Spacer_default = Spacer;
29600
30109
 
29601
30110
  // src/components/Navigation/Profile/Profile.tsx
29602
- var import_jsx_runtime58 = require("react/jsx-runtime");
30111
+ var import_jsx_runtime60 = require("react/jsx-runtime");
29603
30112
 
29604
30113
  // src/components/Navigation/Notification/Notification.tsx
29605
- var import_jsx_runtime59 = require("react/jsx-runtime");
30114
+ var import_jsx_runtime61 = require("react/jsx-runtime");
29606
30115
 
29607
30116
  // src/components/Navigation/Logo/Logo.tsx
29608
- var import_jsx_runtime60 = require("react/jsx-runtime");
30117
+ var import_jsx_runtime62 = require("react/jsx-runtime");
29609
30118
 
29610
30119
  // src/components/ui/avatar.tsx
29611
30120
  var React11 = __toESM(require("react"));
29612
30121
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
29613
- var import_jsx_runtime61 = require("react/jsx-runtime");
29614
- var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
30122
+ var import_jsx_runtime63 = require("react/jsx-runtime");
30123
+ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
29615
30124
  AvatarPrimitive.Root,
29616
30125
  {
29617
30126
  ref,
@@ -29623,7 +30132,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
29623
30132
  }
29624
30133
  ));
29625
30134
  Avatar.displayName = AvatarPrimitive.Root.displayName;
29626
- var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
30135
+ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
29627
30136
  AvatarPrimitive.Image,
29628
30137
  {
29629
30138
  ref,
@@ -29632,7 +30141,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
29632
30141
  }
29633
30142
  ));
29634
30143
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
29635
- var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
30144
+ var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
29636
30145
  AvatarPrimitive.Fallback,
29637
30146
  {
29638
30147
  ref,
@@ -29647,11 +30156,11 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
29647
30156
 
29648
30157
  // src/components/Navigation/Navbar/Navbar.tsx
29649
30158
  var import_link6 = __toESM(require("next/link"));
29650
- var import_image3 = __toESM(require("next/image"));
30159
+ var import_image4 = __toESM(require("next/image"));
29651
30160
  var import_navigation4 = require("next/navigation");
29652
30161
  var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
29653
- var import_react29 = require("react");
29654
- var import_jsx_runtime62 = require("react/jsx-runtime");
30162
+ var import_react31 = require("react");
30163
+ var import_jsx_runtime64 = require("react/jsx-runtime");
29655
30164
  function Navbar({
29656
30165
  style,
29657
30166
  badgeType,
@@ -29671,9 +30180,9 @@ function Navbar({
29671
30180
  }) {
29672
30181
  const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
29673
30182
  const router = (0, import_navigation4.useRouter)();
29674
- const [showExitDialog, setShowExitDialog] = (0, import_react29.useState)(false);
29675
- const [pendingUrl, setPendingUrl] = (0, import_react29.useState)(null);
29676
- const handleBuilderExit = (0, import_react29.useCallback)(
30183
+ const [showExitDialog, setShowExitDialog] = (0, import_react31.useState)(false);
30184
+ const [pendingUrl, setPendingUrl] = (0, import_react31.useState)(null);
30185
+ const handleBuilderExit = (0, import_react31.useCallback)(
29677
30186
  (e, url) => {
29678
30187
  if (isBuilder) {
29679
30188
  e.preventDefault();
@@ -29689,29 +30198,29 @@ function Navbar({
29689
30198
  router.push(pendingUrl);
29690
30199
  }
29691
30200
  };
29692
- const formatedMenu = (0, import_react29.useMemo)(() => {
30201
+ const formatedMenu = (0, import_react31.useMemo)(() => {
29693
30202
  if (source === "state" && navList && navList.length) {
29694
30203
  return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
29695
30204
  }
29696
30205
  return list || [];
29697
30206
  }, [source, navList]);
29698
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
29699
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30207
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
30208
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29700
30209
  "nav",
29701
30210
  {
29702
30211
  className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
29703
30212
  style,
29704
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
29705
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30213
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
30214
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29706
30215
  import_link6.default,
29707
30216
  {
29708
30217
  href: "/",
29709
30218
  onClick: (e) => handleBuilderExit(e, "/"),
29710
30219
  className: "flex items-center space-x-2",
29711
- children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_image3.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
30220
+ children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_image4.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
29712
30221
  }
29713
30222
  ),
29714
- !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30223
+ !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29715
30224
  import_link6.default,
29716
30225
  {
29717
30226
  href: item.url || "#",
@@ -29721,39 +30230,39 @@ function Navbar({
29721
30230
  },
29722
30231
  item.id
29723
30232
  )) }),
29724
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center space-x-3", children: [
29725
- !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
29726
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
29727
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
29728
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
29729
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
29730
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
29731
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
30233
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center space-x-3", children: [
30234
+ !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
30235
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
30236
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
30237
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
30238
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
30239
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
30240
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
29732
30241
  ] }),
29733
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(DropdownMenu, { children: [
29734
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center space-x-2", children: [
29735
- !isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
29736
- !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
29737
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30242
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DropdownMenu, { children: [
30243
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center space-x-2", children: [
30244
+ !isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
30245
+ !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
30246
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29738
30247
  AvatarImage,
29739
30248
  {
29740
30249
  src: "/images/appbuilder/toolset/profile.svg",
29741
30250
  alt: "Profile"
29742
30251
  }
29743
- ) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
29744
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30252
+ ) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
30253
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29745
30254
  Button,
29746
30255
  {
29747
30256
  variant: "ghost",
29748
30257
  size: "icon",
29749
30258
  className: "text-gray-900 md:hidden dark:invert",
29750
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Menu, { className: "h-6 w-6" })
30259
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Menu, { className: "h-6 w-6" })
29751
30260
  }
29752
30261
  )
29753
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Menu, { className: "h-6 w-6" }) })
30262
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Menu, { className: "h-6 w-6" }) })
29754
30263
  ] }) }),
29755
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
29756
- profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30264
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
30265
+ profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29757
30266
  import_link6.default,
29758
30267
  {
29759
30268
  href: item.url || "#",
@@ -29761,9 +30270,9 @@ function Navbar({
29761
30270
  children: item.header
29762
30271
  }
29763
30272
  ) }, item.id)) }),
29764
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "md:hidden", children: [
29765
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
29766
- formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30273
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "md:hidden", children: [
30274
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
30275
+ formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
29767
30276
  import_link6.default,
29768
30277
  {
29769
30278
  href: item.url || "#",
@@ -29778,51 +30287,51 @@ function Navbar({
29778
30287
  ] })
29779
30288
  }
29780
30289
  ),
29781
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
29782
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(DialogHeader, { children: [
29783
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DialogTitle, { children: "Exit Builder?" }),
29784
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30290
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30291
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogHeader, { children: [
30292
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DialogTitle, { children: "Exit Builder?" }),
30293
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
29785
30294
  ] }),
29786
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(DialogFooter, { children: [
29787
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
29788
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30295
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogFooter, { children: [
30296
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30297
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
29789
30298
  ] })
29790
30299
  ] }) })
29791
30300
  ] });
29792
30301
  }
29793
30302
 
29794
30303
  // src/components/Chart/BarChart.tsx
29795
- var import_react30 = __toESM(require("react"));
30304
+ var import_react32 = __toESM(require("react"));
29796
30305
  var import_recharts = require("recharts");
29797
- var import_jsx_runtime63 = require("react/jsx-runtime");
30306
+ var import_jsx_runtime65 = require("react/jsx-runtime");
29798
30307
  var ChartComponent = ({ className, style, loading, ...props }) => {
29799
30308
  const data = Array.isArray(props.data) ? props.data : [];
29800
30309
  const chartType = props.chartType || "bar";
29801
30310
  const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
29802
30311
  if (loading || data.length === 0) {
29803
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30312
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
29804
30313
  "div",
29805
30314
  {
29806
30315
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
29807
30316
  style,
29808
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30317
+ children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29809
30318
  }
29810
30319
  );
29811
30320
  }
29812
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_recharts.BarChart, { data, title: "Leads", desc: "content", children: [
29813
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
29814
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.XAxis, { dataKey: "name" }),
29815
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.YAxis, {}),
29816
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
29817
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
29818
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30321
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts.BarChart, { data, title: "Leads", desc: "content", children: [
30322
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
30323
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.XAxis, { dataKey: "name" }),
30324
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.YAxis, {}),
30325
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
30326
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
30327
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
29819
30328
  import_recharts.Bar,
29820
30329
  {
29821
30330
  dataKey: "value",
29822
30331
  fill: "#00695C",
29823
30332
  radius: [6, 6, 0, 0],
29824
30333
  isAnimationActive: false,
29825
- children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30334
+ children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
29826
30335
  "rect",
29827
30336
  {
29828
30337
  fill: entry.color || "#00695C"
@@ -29831,16 +30340,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
29831
30340
  ))
29832
30341
  }
29833
30342
  )
29834
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_recharts.AreaChart, { data, children: [
29835
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
29836
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
29837
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
30343
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts.AreaChart, { data, children: [
30344
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
30345
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
30346
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
29838
30347
  ] }) }),
29839
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
29840
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.XAxis, { dataKey: "name" }),
29841
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.YAxis, {}),
29842
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
29843
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30348
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
30349
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.XAxis, { dataKey: "name" }),
30350
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.YAxis, {}),
30351
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
30352
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
29844
30353
  import_recharts.Area,
29845
30354
  {
29846
30355
  type: "monotone",
@@ -29853,12 +30362,12 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
29853
30362
  )
29854
30363
  ] }) }) });
29855
30364
  };
29856
- var BarChart_default = import_react30.default.memo(ChartComponent);
30365
+ var BarChart_default = import_react32.default.memo(ChartComponent);
29857
30366
 
29858
30367
  // src/components/Chart/PieChart.tsx
29859
- var import_react31 = __toESM(require("react"));
30368
+ var import_react33 = __toESM(require("react"));
29860
30369
  var import_recharts2 = require("recharts");
29861
- var import_jsx_runtime64 = require("react/jsx-runtime");
30370
+ var import_jsx_runtime66 = require("react/jsx-runtime");
29862
30371
  var getRandomColor = () => {
29863
30372
  const palette = [
29864
30373
  "#2563eb",
@@ -29878,32 +30387,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29878
30387
  const showLegends = props.showLegends ?? true;
29879
30388
  const labelType = props.labelType || "inside";
29880
30389
  const canvasMode = props.canvasMode;
29881
- const data = (0, import_react31.useMemo)(() => {
30390
+ const data = (0, import_react33.useMemo)(() => {
29882
30391
  if (!Array.isArray(props.data)) return [];
29883
30392
  return props.data.map((item) => ({ ...item, color: getRandomColor() }));
29884
30393
  }, [props.data]);
29885
- const total = (0, import_react31.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30394
+ const total = (0, import_react33.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
29886
30395
  const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
29887
- const [mounted, setMounted] = (0, import_react31.useState)(false);
29888
- (0, import_react31.useEffect)(() => {
30396
+ const [mounted, setMounted] = (0, import_react33.useState)(false);
30397
+ (0, import_react33.useEffect)(() => {
29889
30398
  const timeout = setTimeout(() => setMounted(true), 100);
29890
30399
  return () => clearTimeout(timeout);
29891
30400
  }, []);
29892
- const renderLegends = (0, import_react31.useMemo)(() => {
30401
+ const renderLegends = (0, import_react33.useMemo)(() => {
29893
30402
  if (!showLegends) return null;
29894
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
30403
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
29895
30404
  "div",
29896
30405
  {
29897
30406
  className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
29898
30407
  children: [
29899
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30408
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
29900
30409
  "span",
29901
30410
  {
29902
30411
  className: "inline-block w-[16px] h-[16px] rounded",
29903
30412
  style: { backgroundColor: d.color }
29904
30413
  }
29905
30414
  ),
29906
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
30415
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
29907
30416
  ]
29908
30417
  },
29909
30418
  d.name
@@ -29911,24 +30420,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29911
30420
  }, [data, showLegends]);
29912
30421
  if (!mounted) return null;
29913
30422
  if (loading || data.length === 0) {
29914
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30423
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
29915
30424
  "div",
29916
30425
  {
29917
30426
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
29918
30427
  style,
29919
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30428
+ children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29920
30429
  }
29921
30430
  );
29922
30431
  }
29923
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
30432
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
29924
30433
  "div",
29925
30434
  {
29926
30435
  className: `relative flex flex-col items-center ${className}`,
29927
30436
  style,
29928
30437
  children: [
29929
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
29930
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts2.PieChart, { children: [
29931
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
30438
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
30439
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_recharts2.PieChart, { children: [
30440
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
29932
30441
  import_recharts2.Pie,
29933
30442
  {
29934
30443
  data,
@@ -29940,8 +30449,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29940
30449
  labelLine: false,
29941
30450
  isAnimationActive: false,
29942
30451
  children: [
29943
- data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
29944
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30452
+ data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
30453
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
29945
30454
  import_recharts2.LabelList,
29946
30455
  {
29947
30456
  dataKey: "value",
@@ -29954,14 +30463,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29954
30463
  ]
29955
30464
  }
29956
30465
  ),
29957
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30466
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
29958
30467
  import_recharts2.Tooltip,
29959
30468
  {
29960
30469
  formatter: (value, name) => [`${value}k`, name]
29961
30470
  }
29962
30471
  )
29963
30472
  ] }) }),
29964
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
30473
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
29965
30474
  "div",
29966
30475
  {
29967
30476
  className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ${forceMobile ? "text-2xl" : "text-4xl"} font-bold text-[#000]`,
@@ -29972,18 +30481,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29972
30481
  }
29973
30482
  )
29974
30483
  ] }),
29975
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
30484
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
29976
30485
  ]
29977
30486
  }
29978
30487
  );
29979
30488
  };
29980
- var PieChart_default = import_react31.default.memo(DonutChart);
30489
+ var PieChart_default = import_react33.default.memo(DonutChart);
29981
30490
 
29982
30491
  // src/components/Blocks/EmailComposer.tsx
29983
- var import_jsx_runtime65 = require("react/jsx-runtime");
30492
+ var import_jsx_runtime67 = require("react/jsx-runtime");
29984
30493
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
29985
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
29986
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30494
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
30495
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
29987
30496
  "input",
29988
30497
  {
29989
30498
  type: "email",
@@ -29992,8 +30501,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29992
30501
  required: true
29993
30502
  }
29994
30503
  ) }),
29995
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-2", children: [
29996
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30504
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center gap-2", children: [
30505
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
29997
30506
  "input",
29998
30507
  {
29999
30508
  type: "email",
@@ -30004,7 +30513,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30004
30513
  required: true
30005
30514
  }
30006
30515
  ),
30007
- !showCc && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30516
+ !showCc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30008
30517
  "button",
30009
30518
  {
30010
30519
  onClick: () => setShowCc?.(true),
@@ -30012,7 +30521,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30012
30521
  children: "Cc"
30013
30522
  }
30014
30523
  ),
30015
- !showBcc && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30524
+ !showBcc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30016
30525
  "button",
30017
30526
  {
30018
30527
  onClick: () => setShowBcc?.(true),
@@ -30021,7 +30530,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30021
30530
  }
30022
30531
  )
30023
30532
  ] }) }),
30024
- showCc && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30533
+ showCc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30025
30534
  "input",
30026
30535
  {
30027
30536
  type: "text",
@@ -30031,7 +30540,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30031
30540
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30032
30541
  }
30033
30542
  ) }),
30034
- showBcc && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30543
+ showBcc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30035
30544
  "input",
30036
30545
  {
30037
30546
  type: "text",
@@ -30041,7 +30550,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30041
30550
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30042
30551
  }
30043
30552
  ) }),
30044
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30553
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30045
30554
  "input",
30046
30555
  {
30047
30556
  type: "text",
@@ -30051,11 +30560,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30051
30560
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30052
30561
  }
30053
30562
  ) }),
30054
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MyEditor, { value: body, onChange: setBody }) }),
30055
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex justify-end gap-2", children: [
30056
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
30057
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
30058
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
30563
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MyEditor, { value: body, onChange: setBody }) }),
30564
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex justify-end gap-2", children: [
30565
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
30566
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
30567
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
30059
30568
  ] })
30060
30569
  ] }) });
30061
30570
  }
@@ -30100,10 +30609,10 @@ function showSonnerToast({
30100
30609
  // src/components/ui/sonner.tsx
30101
30610
  var import_next_themes = require("next-themes");
30102
30611
  var import_sonner2 = require("sonner");
30103
- var import_jsx_runtime66 = require("react/jsx-runtime");
30612
+ var import_jsx_runtime68 = require("react/jsx-runtime");
30104
30613
  var Toaster = ({ ...props }) => {
30105
30614
  const { theme = "system" } = (0, import_next_themes.useTheme)();
30106
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30615
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
30107
30616
  import_sonner2.Toaster,
30108
30617
  {
30109
30618
  theme,