@retinalabsllc/zairusjs 16.1.3 → 16.1.45

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.mjs CHANGED
@@ -4508,9 +4508,16 @@ var UniversalBuyCryptoPage = ({
4508
4508
  };
4509
4509
 
4510
4510
  // src/components/UniversalDepartmentsPage.tsx
4511
- import React46 from "react";
4511
+ import React46, { useState as useState32 } from "react";
4512
+ import toast12 from "react-hot-toast";
4512
4513
  import { HugeiconsIcon as HugeiconsIcon32 } from "@hugeicons/react";
4513
- import { ArrowLeft01Icon as ArrowLeft01Icon13, ArrowRight01Icon as ArrowRight01Icon9, Loading03Icon as Loading03Icon20 } from "@hugeicons/core-free-icons";
4514
+ import {
4515
+ ArrowLeft01Icon as ArrowLeft01Icon13,
4516
+ ArrowRight01Icon as ArrowRight01Icon9,
4517
+ Loading03Icon as Loading03Icon20,
4518
+ Folder01Icon,
4519
+ CancelCircleIcon as CancelCircleIcon9
4520
+ } from "@hugeicons/core-free-icons";
4514
4521
  var formatMembersCount = (num) => {
4515
4522
  if (num >= 1e6) return (num / 1e6).toFixed(1) + "m";
4516
4523
  if (num >= 1e3) return (num / 1e3).toFixed(1) + "k";
@@ -4525,25 +4532,50 @@ var UniversalDepartmentsPage = ({
4525
4532
  currentPage,
4526
4533
  totalPages,
4527
4534
  onPageChange,
4528
- onDepartmentClick
4535
+ onDepartmentClick,
4536
+ onCreateDepartment
4529
4537
  }) => {
4530
- return /* @__PURE__ */ React46.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ React46.createElement("div", null, /* @__PURE__ */ React46.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-500" }, headerDescription))), /* @__PURE__ */ React46.createElement("div", { className: "w-full overflow-hidden" }, isLoading ? /* @__PURE__ */ React46.createElement(PageSpinner6, null) : /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React46.createElement("div", null, departments.length === 0 ? /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-400 py-6 text-center" }, "No departments available") : departments.map((dept) => /* @__PURE__ */ React46.createElement(
4538
+ const [isCreateModalOpen, setIsCreateModalOpen] = useState32(false);
4539
+ const [deptName, setDeptName] = useState32("");
4540
+ const [isCreating, setIsCreating] = useState32(false);
4541
+ const handleCreateSubmit = async (e) => {
4542
+ e.preventDefault();
4543
+ if (deptName.length < 2 || isCreating || !onCreateDepartment) return;
4544
+ setIsCreating(true);
4545
+ try {
4546
+ await onCreateDepartment(deptName);
4547
+ setDeptName("");
4548
+ setIsCreateModalOpen(false);
4549
+ } catch (error) {
4550
+ toast12.error(error.message || "Failed to create department.");
4551
+ } finally {
4552
+ setIsCreating(false);
4553
+ }
4554
+ };
4555
+ return /* @__PURE__ */ React46.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-row items-center justify-between gap-4" }, /* @__PURE__ */ React46.createElement("h2", { className: "text-black text-xl tracking-tight" }, headerTitle), onCreateDepartment && /* @__PURE__ */ React46.createElement(
4556
+ "button",
4557
+ {
4558
+ onClick: () => setIsCreateModalOpen(true),
4559
+ className: "shrink-0 px-4 py-1.5 border border-neutral-200 text-black text-[12px] tracking-wide rounded-full hover:bg-neutral-50 transition-colors outline-none"
4560
+ },
4561
+ "Create new"
4562
+ )), headerDescription && /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-500" }, headerDescription)), /* @__PURE__ */ React46.createElement("div", { className: "w-full overflow-hidden" }, isLoading ? /* @__PURE__ */ React46.createElement(PageSpinner6, null) : /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React46.createElement("div", null, departments.length === 0 ? /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-400 py-6 text-center" }, "No departments available") : departments.map((dept) => /* @__PURE__ */ React46.createElement(
4531
4563
  "div",
4532
4564
  {
4533
4565
  key: dept.id,
4534
4566
  onClick: () => onDepartmentClick(dept.id),
4535
- className: "flex flex-col py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl gap-2"
4567
+ className: "flex flex-row items-center gap-4 py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl"
4536
4568
  },
4537
- /* @__PURE__ */ React46.createElement("p", { className: "text-[14px] text-black tracking-tight truncate" }, dept.name),
4538
- /* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-3 min-w-0" }, dept.avatars && dept.avatars.length > 0 && /* @__PURE__ */ React46.createElement("div", { className: "flex items-center -space-x-2 shrink-0" }, dept.avatars.slice(0, 4).map((src, idx) => /* @__PURE__ */ React46.createElement("div", { key: idx, className: "w-7 h-7 rounded-lg border-2 border-white bg-neutral-100 overflow-hidden shrink-0" }, /* @__PURE__ */ React46.createElement(
4569
+ /* @__PURE__ */ React46.createElement("div", { className: "w-10 h-10 rounded-xl border border-neutral-200 flex items-center justify-center shrink-0" }, /* @__PURE__ */ React46.createElement(HugeiconsIcon32, { icon: Folder01Icon, size: 18, className: "text-neutral-500" })),
4570
+ /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col min-w-0 gap-1 flex-1" }, /* @__PURE__ */ React46.createElement("p", { className: "text-[14px] text-black tracking-tight truncate" }, dept.name), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-3 min-w-0" }, dept.avatars && dept.avatars.length > 0 && /* @__PURE__ */ React46.createElement("div", { className: "flex items-center -space-x-2 shrink-0" }, dept.avatars.slice(0, 4).map((src, idx) => /* @__PURE__ */ React46.createElement("div", { key: idx, className: "w-6 h-6 rounded-md border-2 border-white bg-neutral-100 overflow-hidden shrink-0" }, /* @__PURE__ */ React46.createElement(
4539
4571
  "img",
4540
4572
  {
4541
4573
  src: src || "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif",
4542
4574
  alt: "Member",
4543
4575
  className: "w-full h-full object-cover"
4544
4576
  }
4545
- )))), dept.totalMembers > 0 ? /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-500 truncate block" }, formatMembersCount(dept.totalMembers), " ", dept.totalMembers > 4 ? "+" : "") : /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 truncate block" }, "Empty"))
4546
- ))), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center justify-between pt-6 mt-2" }, /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", currentPage, " of ", totalPages === 0 ? 1 : totalPages), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React46.createElement(
4577
+ )))), dept.totalMembers > 0 ? /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-500 truncate block" }, formatMembersCount(dept.totalMembers), " ", dept.totalMembers > 4 ? "+" : "") : /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 truncate block" }, "Empty")))
4578
+ ))), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center justify-between pt-6 mt-2 " }, /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", currentPage, " of ", totalPages === 0 ? 1 : totalPages), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React46.createElement(
4547
4579
  "button",
4548
4580
  {
4549
4581
  onClick: () => onPageChange(currentPage - 1),
@@ -4559,13 +4591,55 @@ var UniversalDepartmentsPage = ({
4559
4591
  className: "p-2 bg-white border border-neutral-200 rounded-full text-black hover:bg-neutral-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
4560
4592
  },
4561
4593
  /* @__PURE__ */ React46.createElement(HugeiconsIcon32, { icon: ArrowRight01Icon9, size: 14 })
4594
+ )))))), isCreateModalOpen && /* @__PURE__ */ React46.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React46.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => !isCreating && setIsCreateModalOpen(false) }), /* @__PURE__ */ React46.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React46.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-neutral-100" }, /* @__PURE__ */ React46.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Create Department"), /* @__PURE__ */ React46.createElement(
4595
+ "button",
4596
+ {
4597
+ onClick: () => setIsCreateModalOpen(false),
4598
+ disabled: isCreating,
4599
+ className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50"
4600
+ },
4601
+ /* @__PURE__ */ React46.createElement(HugeiconsIcon32, { icon: CancelCircleIcon9, size: 18 })
4602
+ )), /* @__PURE__ */ React46.createElement("div", { className: "p-6" }, /* @__PURE__ */ React46.createElement("form", { onSubmit: handleCreateSubmit, className: "flex flex-col gap-8" }, /* @__PURE__ */ React46.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React46.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Department Name"), /* @__PURE__ */ React46.createElement(
4603
+ "input",
4604
+ {
4605
+ type: "text",
4606
+ value: deptName,
4607
+ onChange: (e) => setDeptName(e.target.value),
4608
+ required: true,
4609
+ autoFocus: true,
4610
+ maxLength: 50,
4611
+ disabled: isCreating,
4612
+ className: "w-full px-2 py-3 bg-transparent text-sm border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300 disabled:opacity-50",
4613
+ placeholder: "e.g. Engineering, Marketing..."
4614
+ }
4615
+ )), /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React46.createElement(
4616
+ ThreeDActionButton,
4617
+ {
4618
+ type: "submit",
4619
+ disabled: deptName.length < 2 || isCreating,
4620
+ isLoading: isCreating,
4621
+ className: "w-full"
4622
+ },
4623
+ "Create Department"
4624
+ ), /* @__PURE__ */ React46.createElement(
4625
+ "button",
4626
+ {
4627
+ type: "button",
4628
+ onClick: () => {
4629
+ setIsCreateModalOpen(false);
4630
+ setDeptName("");
4631
+ },
4632
+ disabled: isCreating,
4633
+ className: "w-full flex items-center justify-center py-2.5 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 transition-colors outline-none text-xs tracking-wide"
4634
+ },
4635
+ "Cancel"
4562
4636
  )))))));
4563
4637
  };
4564
4638
 
4565
4639
  // src/components/UniversalMembersPage.tsx
4566
- import React47, { useState as useState32, useEffect as useEffect18, useRef as useRef12 } from "react";
4640
+ import React47, { useState as useState33, useEffect as useEffect18, useRef as useRef12 } from "react";
4567
4641
  import { HugeiconsIcon as HugeiconsIcon33 } from "@hugeicons/react";
4568
- import toast12 from "react-hot-toast";
4642
+ import toast13 from "react-hot-toast";
4569
4643
  import {
4570
4644
  ArrowLeft01Icon as ArrowLeft01Icon14,
4571
4645
  ArrowRight01Icon as ArrowRight01Icon10,
@@ -4575,8 +4649,8 @@ import {
4575
4649
  ListSettingIcon as ListSettingIcon2
4576
4650
  } from "@hugeicons/core-free-icons";
4577
4651
  var MemberAvatar = ({ src, status }) => {
4578
- const [loaded, setLoaded] = useState32(false);
4579
- const [error, setError] = useState32(false);
4652
+ const [loaded, setLoaded] = useState33(false);
4653
+ const [error, setError] = useState33(false);
4580
4654
  const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
4581
4655
  const finalSrc = error || !src ? defaultAvatar : src;
4582
4656
  const getStatusColor = () => {
@@ -4624,16 +4698,16 @@ var UniversalMembersPage = ({
4624
4698
  onRemoveMember,
4625
4699
  onInviteMember
4626
4700
  }) => {
4627
- const [expandedId, setExpandedId] = useState32(null);
4628
- const [memberToRemove, setMemberToRemove] = useState32(null);
4629
- const [isRemoving, setIsRemoving] = useState32(false);
4630
- const [isInviteMode, setIsInviteMode] = useState32(false);
4631
- const [inviteEmail, setInviteEmail] = useState32("");
4632
- const [isInviting, setIsInviting] = useState32(false);
4633
- const [localSearchQuery, setLocalSearchQuery] = useState32(searchQuery);
4634
- const [isTyping, setIsTyping] = useState32(false);
4635
- const [isStatusModalOpen, setIsStatusModalOpen] = useState32(false);
4636
- const [isRoleModalOpen, setIsRoleModalOpen] = useState32(false);
4701
+ const [expandedId, setExpandedId] = useState33(null);
4702
+ const [memberToRemove, setMemberToRemove] = useState33(null);
4703
+ const [isRemoving, setIsRemoving] = useState33(false);
4704
+ const [isInviteMode, setIsInviteMode] = useState33(false);
4705
+ const [inviteEmail, setInviteEmail] = useState33("");
4706
+ const [isInviting, setIsInviting] = useState33(false);
4707
+ const [localSearchQuery, setLocalSearchQuery] = useState33(searchQuery);
4708
+ const [isTyping, setIsTyping] = useState33(false);
4709
+ const [isStatusModalOpen, setIsStatusModalOpen] = useState33(false);
4710
+ const [isRoleModalOpen, setIsRoleModalOpen] = useState33(false);
4637
4711
  const statusDropdownRef = useRef12(null);
4638
4712
  const roleDropdownRef = useRef12(null);
4639
4713
  const cleanEmailId = (val) => val.toLowerCase().replace(/[^a-z0-9@._-]/g, "");
@@ -4667,11 +4741,11 @@ var UniversalMembersPage = ({
4667
4741
  setIsRemoving(true);
4668
4742
  try {
4669
4743
  await onRemoveMember(memberToRemove.id);
4670
- toast12.success("Member removed successfully.");
4744
+ toast13.success("Member removed successfully.");
4671
4745
  setExpandedId(null);
4672
4746
  setMemberToRemove(null);
4673
4747
  } catch (error) {
4674
- toast12.error("Failed to remove member.");
4748
+ toast13.error("Failed to remove member.");
4675
4749
  } finally {
4676
4750
  setIsRemoving(false);
4677
4751
  }
@@ -4685,7 +4759,7 @@ var UniversalMembersPage = ({
4685
4759
  setInviteEmail("");
4686
4760
  setIsInviteMode(false);
4687
4761
  } catch (error) {
4688
- toast12.error(error.message || "Failed to send invitation.");
4762
+ toast13.error(error.message || "Failed to send invitation.");
4689
4763
  } finally {
4690
4764
  setIsInviting(false);
4691
4765
  }
@@ -4829,16 +4903,16 @@ var UniversalMembersPage = ({
4829
4903
  };
4830
4904
 
4831
4905
  // src/components/UniversalHome2.tsx
4832
- import React48, { useState as useState33 } from "react";
4906
+ import React48, { useState as useState34 } from "react";
4833
4907
  import { useRouter as useRouter3 } from "next/navigation";
4834
4908
  import { HugeiconsIcon as HugeiconsIcon34 } from "@hugeicons/react";
4835
- import toast13 from "react-hot-toast";
4909
+ import toast14 from "react-hot-toast";
4836
4910
  import {
4837
4911
  Loading03Icon as Loading03Icon22,
4838
4912
  Notification01Icon as Notification01Icon2,
4839
4913
  ArrowLeft01Icon as ArrowLeft01Icon15,
4840
4914
  ArrowRight01Icon as ArrowRight01Icon11,
4841
- CancelCircleIcon as CancelCircleIcon9,
4915
+ CancelCircleIcon as CancelCircleIcon10,
4842
4916
  ArrowUpRight01Icon as ArrowUpRight01Icon3,
4843
4917
  Settings03Icon
4844
4918
  } from "@hugeicons/core-free-icons";
@@ -4862,11 +4936,11 @@ var UniversalHome2 = ({
4862
4936
  customContent,
4863
4937
  departmentsProps
4864
4938
  }) => {
4865
- const [isAvatarLoaded, setIsAvatarLoaded] = useState33(false);
4866
- const [showNotifDialog, setShowNotifDialog] = useState33(false);
4867
- const [showOrgSwitcher, setShowOrgSwitcher] = useState33(false);
4868
- const [selectedNotif, setSelectedNotif] = useState33(null);
4869
- const [isResolving, setIsResolving] = useState33(false);
4939
+ const [isAvatarLoaded, setIsAvatarLoaded] = useState34(false);
4940
+ const [showNotifDialog, setShowNotifDialog] = useState34(false);
4941
+ const [showOrgSwitcher, setShowOrgSwitcher] = useState34(false);
4942
+ const [selectedNotif, setSelectedNotif] = useState34(null);
4943
+ const [isResolving, setIsResolving] = useState34(false);
4870
4944
  const router = useRouter3();
4871
4945
  const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
4872
4946
  const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
@@ -4893,7 +4967,7 @@ var UniversalHome2 = ({
4893
4967
  setShowNotifDialog(false);
4894
4968
  setSelectedNotif(null);
4895
4969
  } catch (error) {
4896
- toast13.error("Failed to process invitation");
4970
+ toast14.error("Failed to process invitation");
4897
4971
  } finally {
4898
4972
  setIsResolving(false);
4899
4973
  }
@@ -4959,7 +5033,7 @@ var UniversalHome2 = ({
4959
5033
  {
4960
5034
  ...departmentsProps
4961
5035
  }
4962
- )), showOrgSwitcher && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-neutral-100" }, /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon9, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ React48.createElement(
5036
+ )), showOrgSwitcher && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-neutral-100" }, /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon10, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ React48.createElement(
4963
5037
  "button",
4964
5038
  {
4965
5039
  key: org.id,
@@ -4967,11 +5041,11 @@ var UniversalHome2 = ({
4967
5041
  onOrganizationSelect?.(org.id);
4968
5042
  setShowOrgSwitcher(false);
4969
5043
  },
4970
- className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors border-b border-neutral-50 last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
5044
+ className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
4971
5045
  },
4972
- /* @__PURE__ */ React48.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black font-medium" : "text-neutral-600"}` }, org.name),
5046
+ /* @__PURE__ */ React48.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black " : "text-neutral-600"}` }, org.name),
4973
5047
  activeOrgId === org.id && /* @__PURE__ */ React48.createElement("div", { className: "w-2 h-2 rounded-full bg-emerald-500" })
4974
- )))))), showNotifDialog && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ React48.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowLeft01Icon15, size: 14 }), " Back") : /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight flex items-center gap-2" }, "Notifications", isNotifsLoading && /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 14, className: "animate-spin text-neutral-400" })), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon9, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, selectedNotif ? /* @__PURE__ */ React48.createElement("div", { className: "p-4 text-left" }, /* @__PURE__ */ React48.createElement("h4", { className: "text-[14px] text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ React48.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ React48.createElement("p", { className: "text-[12px] text-neutral-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ React48.createElement("div", { className: "mt-8 flex gap-3 pt-6 border-t border-neutral-100" }, /* @__PURE__ */ React48.createElement(
5048
+ )))))), showNotifDialog && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ React48.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowLeft01Icon15, size: 14 }), " Back") : /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight flex items-center gap-2" }, "Notifications", isNotifsLoading && /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 14, className: "animate-spin text-neutral-400" })), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon10, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, selectedNotif ? /* @__PURE__ */ React48.createElement("div", { className: "p-4 text-left" }, /* @__PURE__ */ React48.createElement("h4", { className: "text-[14px] text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ React48.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ React48.createElement("p", { className: "text-[12px] text-neutral-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ React48.createElement("div", { className: "mt-8 flex gap-3 pt-6 border-t border-neutral-100" }, /* @__PURE__ */ React48.createElement(
4975
5049
  "button",
4976
5050
  {
4977
5051
  onClick: () => handleResolve("ACCEPTED"),
@@ -5017,6 +5091,438 @@ var UniversalHome2 = ({
5017
5091
  /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowRight01Icon11, size: 12 })
5018
5092
  ))))));
5019
5093
  };
5094
+
5095
+ // src/components/UniversalSettings.tsx
5096
+ import React49, { useState as useState35, useEffect as useEffect19, useRef as useRef13 } from "react";
5097
+ import toast15 from "react-hot-toast";
5098
+ import { HugeiconsIcon as HugeiconsIcon35 } from "@hugeicons/react";
5099
+ import {
5100
+ ArrowLeft01Icon as ArrowLeft01Icon16,
5101
+ ArrowRight01Icon as ArrowRight01Icon12,
5102
+ Loading03Icon as Loading03Icon23,
5103
+ Search01Icon as Search01Icon4,
5104
+ SearchList02Icon as SearchList02Icon3,
5105
+ ListSettingIcon as ListSettingIcon3,
5106
+ CircleLock02Icon as CircleLock02Icon3,
5107
+ Coins01Icon
5108
+ } from "@hugeicons/core-free-icons";
5109
+ var MemberAvatar2 = ({ src, status, sizeClass = "w-10 h-10" }) => {
5110
+ const [loaded, setLoaded] = useState35(false);
5111
+ const [error, setError] = useState35(false);
5112
+ const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
5113
+ const finalSrc = error || !src ? defaultAvatar : src;
5114
+ const getStatusColor = () => {
5115
+ switch (status?.toUpperCase()) {
5116
+ case "ACTIVE":
5117
+ return "bg-emerald-500";
5118
+ case "BUSY":
5119
+ return "bg-amber-500";
5120
+ case "OFFLINE":
5121
+ return "bg-rose-500";
5122
+ case "AWAY":
5123
+ return "bg-neutral-400";
5124
+ default:
5125
+ return "bg-neutral-200";
5126
+ }
5127
+ };
5128
+ return /* @__PURE__ */ React49.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React49.createElement("div", { className: "w-full h-full rounded-lg bg-neutral-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Loading03Icon23, className: "animate-spin text-neutral-400 absolute", size: 14 }), /* @__PURE__ */ React49.createElement(
5129
+ "img",
5130
+ {
5131
+ src: finalSrc,
5132
+ alt: "Member Avatar",
5133
+ className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`,
5134
+ onLoad: () => setLoaded(true),
5135
+ onError: () => setError(true)
5136
+ }
5137
+ )), /* @__PURE__ */ React49.createElement("div", { className: `absolute -bottom-1 -right-1 w-3.5 h-3.5 rounded-full border-2 border-white z-10 ${getStatusColor()}` }));
5138
+ };
5139
+ var PageSpinner8 = () => /* @__PURE__ */ React49.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Loading03Icon23, size: 32, className: "animate-spin mb-4 text-black" }));
5140
+ var InputSpinner3 = () => /* @__PURE__ */ React49.createElement("svg", { className: "animate-spin h-4 w-4 text-neutral-400", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24" }, /* @__PURE__ */ React49.createElement("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /* @__PURE__ */ React49.createElement("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" }));
5141
+ var UniversalSettings = ({
5142
+ accountType,
5143
+ userRole,
5144
+ members = [],
5145
+ isMembersLoading = false,
5146
+ membersCurrentPage = 1,
5147
+ membersTotalPages = 1,
5148
+ onMembersPageChange = () => {
5149
+ },
5150
+ membersSearchQuery = "",
5151
+ onMembersSearchChange = () => {
5152
+ },
5153
+ activeStatusFilter = "ALL",
5154
+ onStatusFilterChange = () => {
5155
+ },
5156
+ activeRoleFilter = "ALL",
5157
+ onRoleFilterChange = () => {
5158
+ },
5159
+ onRemoveMember,
5160
+ onInviteMember,
5161
+ initialDisplayName,
5162
+ initialSlug,
5163
+ slugPrefixUrl = "https://truhuddle.com/company/",
5164
+ onSaveAccount,
5165
+ onCheckSlugAvailability,
5166
+ aiCredits,
5167
+ isBillingLoading = false,
5168
+ onTopUp,
5169
+ onBack
5170
+ }) => {
5171
+ const onBackHandler = onBack ?? (() => {
5172
+ if (typeof window !== "undefined") window.history.back();
5173
+ });
5174
+ const [activeTab, setActiveTab] = useState35(accountType === "ORGANIZATION" ? "MEMBERS" : "ACCOUNT");
5175
+ useEffect19(() => {
5176
+ if (accountType === "INDIVIDUAL" && activeTab === "MEMBERS") {
5177
+ setActiveTab("ACCOUNT");
5178
+ }
5179
+ }, [accountType, activeTab]);
5180
+ const [expandedId, setExpandedId] = useState35(null);
5181
+ const [memberToRemove, setMemberToRemove] = useState35(null);
5182
+ const [isRemoving, setIsRemoving] = useState35(false);
5183
+ const [isInviteMode, setIsInviteMode] = useState35(false);
5184
+ const [inviteEmail, setInviteEmail] = useState35("");
5185
+ const [isInviting, setIsInviting] = useState35(false);
5186
+ const [localSearchQuery, setLocalSearchQuery] = useState35(membersSearchQuery);
5187
+ const [isTyping, setIsTyping] = useState35(false);
5188
+ const [isStatusModalOpen, setIsStatusModalOpen] = useState35(false);
5189
+ const [isRoleModalOpen, setIsRoleModalOpen] = useState35(false);
5190
+ const statusDropdownRef = useRef13(null);
5191
+ const roleDropdownRef = useRef13(null);
5192
+ const [displayName, setDisplayName] = useState35(initialDisplayName);
5193
+ const [slug, setSlug] = useState35(initialSlug);
5194
+ const [isCheckingSlug, setIsCheckingSlug] = useState35(false);
5195
+ const [slugAvailable, setSlugAvailable] = useState35(null);
5196
+ const [isSavingAccount, setIsSavingAccount] = useState35(false);
5197
+ const isAccountReadOnly = accountType === "ORGANIZATION" && userRole !== "ADMIN" && userRole !== "MANAGER";
5198
+ const cleanEmailId = (val) => val.toLowerCase().replace(/[^a-z0-9@._-]/g, "");
5199
+ useEffect19(() => {
5200
+ function handleClickOutside(event) {
5201
+ if (statusDropdownRef.current && !statusDropdownRef.current.contains(event.target)) setIsStatusModalOpen(false);
5202
+ if (roleDropdownRef.current && !roleDropdownRef.current.contains(event.target)) setIsRoleModalOpen(false);
5203
+ }
5204
+ document.addEventListener("mousedown", handleClickOutside);
5205
+ return () => document.removeEventListener("mousedown", handleClickOutside);
5206
+ }, []);
5207
+ useEffect19(() => {
5208
+ if (activeTab !== "MEMBERS") return;
5209
+ setIsTyping(true);
5210
+ const handler = setTimeout(() => {
5211
+ onMembersSearchChange(localSearchQuery);
5212
+ setIsTyping(false);
5213
+ }, 600);
5214
+ return () => clearTimeout(handler);
5215
+ }, [localSearchQuery, onMembersSearchChange, activeTab]);
5216
+ const handleConfirmRemove = async () => {
5217
+ if (!memberToRemove || !onRemoveMember) return;
5218
+ setIsRemoving(true);
5219
+ try {
5220
+ await onRemoveMember(memberToRemove.id);
5221
+ toast15.success("Member removed successfully.");
5222
+ setExpandedId(null);
5223
+ setMemberToRemove(null);
5224
+ } catch (error) {
5225
+ toast15.error("Failed to remove member.");
5226
+ } finally {
5227
+ setIsRemoving(false);
5228
+ }
5229
+ };
5230
+ const handleInviteSubmit = async (e) => {
5231
+ e.preventDefault();
5232
+ if (inviteEmail.length < 5 || isInviting || !onInviteMember) return;
5233
+ setIsInviting(true);
5234
+ try {
5235
+ await onInviteMember(inviteEmail);
5236
+ setInviteEmail("");
5237
+ setIsInviteMode(false);
5238
+ } catch (error) {
5239
+ toast15.error(error.message || "Failed to send invitation.");
5240
+ } finally {
5241
+ setIsInviting(false);
5242
+ }
5243
+ };
5244
+ const activeExpandedMember = expandedId ? members.find((m) => m.id === expandedId) : null;
5245
+ useEffect19(() => {
5246
+ setDisplayName(initialDisplayName || "");
5247
+ setSlug(initialSlug || "");
5248
+ }, [initialDisplayName, initialSlug]);
5249
+ const handleDisplayNameChange = (val) => setDisplayName(val.replace(/[^a-zA-Z0-9\s-]/g, "").substring(0, 50));
5250
+ const handleSlugChange = (val) => setSlug(val.toLowerCase().replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-").substring(0, 50));
5251
+ useEffect19(() => {
5252
+ if (!slug || slug === initialSlug) {
5253
+ setSlugAvailable(null);
5254
+ setIsCheckingSlug(false);
5255
+ return;
5256
+ }
5257
+ if (slug.length < 3) {
5258
+ setSlugAvailable(false);
5259
+ setIsCheckingSlug(false);
5260
+ return;
5261
+ }
5262
+ setIsCheckingSlug(true);
5263
+ setSlugAvailable(null);
5264
+ const checkTimer = setTimeout(async () => {
5265
+ try {
5266
+ if (onCheckSlugAvailability) {
5267
+ const res = await onCheckSlugAvailability(slug);
5268
+ setSlugAvailable(res.available);
5269
+ }
5270
+ } catch (error) {
5271
+ setSlugAvailable(null);
5272
+ } finally {
5273
+ setIsCheckingSlug(false);
5274
+ }
5275
+ }, 1500);
5276
+ return () => clearTimeout(checkTimer);
5277
+ }, [slug, initialSlug, onCheckSlugAvailability]);
5278
+ const handleSaveAccount = async (e) => {
5279
+ e.preventDefault();
5280
+ if (isSavingAccount || isCheckingSlug || isAccountReadOnly || !onSaveAccount) return;
5281
+ if (slug !== initialSlug && slugAvailable === false) {
5282
+ toast15.error("Please select an available address handle.");
5283
+ return;
5284
+ }
5285
+ setIsSavingAccount(true);
5286
+ try {
5287
+ const payload = {
5288
+ displayName: displayName !== initialDisplayName ? displayName : void 0,
5289
+ slug: slug !== initialSlug ? slug : void 0
5290
+ };
5291
+ const res = await onSaveAccount(payload);
5292
+ if (res.success) {
5293
+ toast15.success("Profile updated successfully.");
5294
+ } else {
5295
+ toast15.error(res.error || "Failed to update profile.");
5296
+ }
5297
+ } catch (error) {
5298
+ toast15.error("Service unavailable. Try again later.");
5299
+ } finally {
5300
+ setIsSavingAccount(false);
5301
+ }
5302
+ };
5303
+ const hasAccountChanges = displayName !== initialDisplayName || slug !== initialSlug;
5304
+ const isAccountSaveDisabled = isSavingAccount || isAccountReadOnly || isCheckingSlug || !hasAccountChanges || displayName.length < 3 || slug.length < 3 || slug !== initialSlug && slugAvailable === false;
5305
+ return /* @__PURE__ */ React49.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement(ManagedToaster, null), /* @__PURE__ */ React49.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ React49.createElement("button", { onClick: onBackHandler, className: "flex items-center gap-2 text-neutral-500 hover:text-black transition-colors text-[13px] outline-none" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ArrowLeft01Icon16, size: 16 }), " Back")), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1 mb-8 px-1" }, /* @__PURE__ */ React49.createElement("h1", { className: "text-black text-xl tracking-tight" }, "System Settings"), /* @__PURE__ */ React49.createElement("p", { className: "text-xs text-neutral-500" }, "Manage your workspace identity, team configurations, and AI billing parameters.")), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-6 border-b border-neutral-200 mb-6 overflow-x-auto custom-scrollbar px-1" }, accountType === "ORGANIZATION" && /* @__PURE__ */ React49.createElement(
5306
+ "button",
5307
+ {
5308
+ onClick: () => {
5309
+ setActiveTab("MEMBERS");
5310
+ setExpandedId(null);
5311
+ setIsInviteMode(false);
5312
+ },
5313
+ className: `pb-3 text-[13px] tracking-wide outline-none transition-colors border-b-2 whitespace-nowrap ${activeTab === "MEMBERS" ? "border-black text-black" : "border-transparent text-neutral-500 hover:text-black"}`
5314
+ },
5315
+ "Members"
5316
+ ), /* @__PURE__ */ React49.createElement(
5317
+ "button",
5318
+ {
5319
+ onClick: () => setActiveTab("ACCOUNT"),
5320
+ className: `pb-3 text-[13px] tracking-wide outline-none transition-colors border-b-2 whitespace-nowrap ${activeTab === "ACCOUNT" ? "border-black text-black" : "border-transparent text-neutral-500 hover:text-black"}`
5321
+ },
5322
+ "Account Profile"
5323
+ ), /* @__PURE__ */ React49.createElement(
5324
+ "button",
5325
+ {
5326
+ onClick: () => setActiveTab("BILLING"),
5327
+ className: `pb-3 text-[13px] tracking-wide outline-none transition-colors border-b-2 whitespace-nowrap ${activeTab === "BILLING" ? "border-black text-black" : "border-transparent text-neutral-500 hover:text-black"}`
5328
+ },
5329
+ "Billing"
5330
+ )), activeTab === "MEMBERS" && accountType === "ORGANIZATION" && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement(
5331
+ ConfirmationDialog,
5332
+ {
5333
+ isOpen: !!memberToRemove,
5334
+ title: "Remove Member",
5335
+ message: `Are you sure you want to remove ${memberToRemove?.name}? This action cannot be undone.`,
5336
+ confirmText: "Remove",
5337
+ cancelText: "Cancel",
5338
+ isProcessing: isRemoving,
5339
+ isDestructive: true,
5340
+ onClose: () => setMemberToRemove(null),
5341
+ onConfirm: handleConfirmRemove
5342
+ }
5343
+ ), !isInviteMode && !activeExpandedMember && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-row flex-nowrap mb-4 items-center justify-between gap-4 w-full px-1" }, /* @__PURE__ */ React49.createElement("div", { className: "relative flex-1 min-w-0 max-w-full" }, /* @__PURE__ */ React49.createElement("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Search01Icon4, size: 16, className: "text-neutral-400" })), /* @__PURE__ */ React49.createElement(
5344
+ "input",
5345
+ {
5346
+ type: "text",
5347
+ placeholder: "Search members...",
5348
+ value: localSearchQuery,
5349
+ onChange: (e) => setLocalSearchQuery(e.target.value),
5350
+ className: "w-full pl-10 pr-4 py-2 bg-white rounded-full text-[13px] text-black placeholder-neutral-400 outline-none transition-colors focus:border-black"
5351
+ }
5352
+ )), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ React49.createElement(
5353
+ "button",
5354
+ {
5355
+ onClick: () => setIsStatusModalOpen(true),
5356
+ className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
5357
+ },
5358
+ /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: SearchList02Icon3, size: 16 })
5359
+ ), /* @__PURE__ */ React49.createElement(
5360
+ "button",
5361
+ {
5362
+ onClick: () => setIsRoleModalOpen(true),
5363
+ className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
5364
+ },
5365
+ /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ListSettingIcon3, size: 16 })
5366
+ ))), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, activeExpandedMember ? /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in zoom-in-95 duration-300 w-full" }, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-4 mb-8" }, /* @__PURE__ */ React49.createElement(MemberAvatar2, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React49.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.name), /* @__PURE__ */ React49.createElement("span", { className: "text-[12px] text-neutral-500 capitalize" }, activeExpandedMember.role.toLowerCase()))), activeExpandedMember.departmentName && /* @__PURE__ */ React49.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React49.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-1" }, "Assigned Department"), /* @__PURE__ */ React49.createElement("span", { className: "text-[12px] text-black truncate block" }, activeExpandedMember.departmentName)), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col sm:flex-row gap-3 pt-6 border-t border-neutral-100" }, !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
5367
+ "button",
5368
+ {
5369
+ onClick: () => setMemberToRemove(activeExpandedMember),
5370
+ className: "w-full sm:flex-1 py-2.5 bg-white border border-rose-200 text-rose-600 hover:bg-rose-50 rounded-full text-[12px] tracking-wide transition-colors outline-none"
5371
+ },
5372
+ "Remove Access"
5373
+ ), /* @__PURE__ */ React49.createElement(
5374
+ "button",
5375
+ {
5376
+ onClick: () => setExpandedId(null),
5377
+ className: "w-full sm:flex-1 py-2.5 bg-white border border-neutral-200 text-black hover:bg-neutral-100 rounded-full text-[12px] tracking-wide transition-colors outline-none"
5378
+ },
5379
+ "Close Profile"
5380
+ ))) : (
5381
+ // Standard List & Invite Header
5382
+ /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-row items-center justify-between gap-4" }, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl tracking-tight" }, isInviteMode ? "Add Member" : "Team Directory"), !isInviteMode && !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
5383
+ "button",
5384
+ {
5385
+ onClick: () => setIsInviteMode(true),
5386
+ className: "shrink-0 px-4 py-1.5 border border-neutral-200 text-black text-[12px] tracking-wide rounded-full hover:bg-neutral-50 transition-colors outline-none"
5387
+ },
5388
+ "Invite Team"
5389
+ )), !isInviteMode && /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-500" }, "Manage members and access controls across your organization.")), /* @__PURE__ */ React49.createElement("div", { className: "w-full overflow-hidden" }, isInviteMode ? /* @__PURE__ */ React49.createElement("form", { onSubmit: handleInviteSubmit, className: "flex flex-col gap-8 animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", { className: "space-y-1.5 mt-2" }, /* @__PURE__ */ React49.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Email Address"), /* @__PURE__ */ React49.createElement(
5390
+ "input",
5391
+ {
5392
+ type: "email",
5393
+ value: inviteEmail,
5394
+ onChange: (e) => setInviteEmail(cleanEmailId(e.target.value)),
5395
+ required: true,
5396
+ autoFocus: true,
5397
+ className: "w-full px-2 py-3 bg-transparent text-sm border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300",
5398
+ placeholder: "name@company.com"
5399
+ }
5400
+ )), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React49.createElement(
5401
+ ThreeDActionButton,
5402
+ {
5403
+ type: "submit",
5404
+ disabled: inviteEmail.length < 5 || isInviting,
5405
+ isLoading: isInviting,
5406
+ className: "w-full"
5407
+ },
5408
+ "Send Invitation"
5409
+ ), /* @__PURE__ */ React49.createElement(
5410
+ "button",
5411
+ {
5412
+ type: "button",
5413
+ onClick: () => {
5414
+ setIsInviteMode(false);
5415
+ setInviteEmail("");
5416
+ },
5417
+ disabled: isInviting,
5418
+ className: "w-full flex items-center justify-center py-2.5 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 transition-colors outline-none text-xs tracking-wide"
5419
+ },
5420
+ "Cancel"
5421
+ ))) : isMembersLoading || isTyping ? /* @__PURE__ */ React49.createElement(PageSpinner8, null) : /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col min-w-0 animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", null, members.length === 0 ? /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-400 py-6 text-center" }, "No members found") : members.map((member) => /* @__PURE__ */ React49.createElement(
5422
+ "div",
5423
+ {
5424
+ key: member.id,
5425
+ onClick: () => setExpandedId(member.id),
5426
+ className: "flex items-center justify-between py-3 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl"
5427
+ },
5428
+ /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React49.createElement(MemberAvatar2, { src: member.avatarUrl, status: member.status }), /* @__PURE__ */ React49.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-0.5" }, /* @__PURE__ */ React49.createElement("p", { className: "text-[13px] text-black truncate" }, member.name), /* @__PURE__ */ React49.createElement("p", { className: "text-[11px] text-neutral-500 capitalize truncate" }, member.role.toLowerCase())))
5429
+ ))), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center justify-between pt-6 mt-2 " }, /* @__PURE__ */ React49.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", membersCurrentPage, " of ", membersTotalPages === 0 ? 1 : membersTotalPages), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React49.createElement(
5430
+ "button",
5431
+ {
5432
+ onClick: () => onMembersPageChange(membersCurrentPage - 1),
5433
+ disabled: membersCurrentPage <= 1 || isMembersLoading,
5434
+ className: "p-2 bg-white border border-neutral-200 rounded-full text-black hover:bg-neutral-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
5435
+ },
5436
+ /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ArrowLeft01Icon16, size: 14 })
5437
+ ), /* @__PURE__ */ React49.createElement(
5438
+ "button",
5439
+ {
5440
+ onClick: () => onMembersPageChange(membersCurrentPage + 1),
5441
+ disabled: membersCurrentPage >= membersTotalPages || isMembersLoading || membersTotalPages === 0,
5442
+ className: "p-2 bg-white border border-neutral-200 rounded-full text-black hover:bg-neutral-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
5443
+ },
5444
+ /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ArrowRight01Icon12, size: 14 })
5445
+ ))))))
5446
+ )), isStatusModalOpen && /* @__PURE__ */ React49.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React49.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => setIsStatusModalOpen(false) }), /* @__PURE__ */ React49.createElement("div", { ref: statusDropdownRef, className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React49.createElement("div", { className: "p-6 text-center w-full mb-2" }, /* @__PURE__ */ React49.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Status Filter")), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex flex-col pl-2 pr-2 gap-1" }, ["ALL", "ACTIVE", "BUSY", "OFFLINE", "AWAY"].map((option) => /* @__PURE__ */ React49.createElement(
5447
+ "button",
5448
+ {
5449
+ key: option,
5450
+ onClick: () => {
5451
+ onStatusFilterChange(option);
5452
+ setIsStatusModalOpen(false);
5453
+ },
5454
+ className: `text-left px-4 py-3 text-[11px] tracking-wide transition-colors rounded-full flex items-center justify-between outline-none ${activeStatusFilter === option ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}`
5455
+ },
5456
+ /* @__PURE__ */ React49.createElement("span", { className: "truncate pr-2 capitalize" }, option.toLowerCase())
5457
+ ))), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex mt-2" }, /* @__PURE__ */ React49.createElement("button", { onClick: () => setIsStatusModalOpen(false), className: "w-full py-4 text-[13px] text-neutral-500 hover:text-black transition-colors outline-none" }, "Cancel")))), isRoleModalOpen && /* @__PURE__ */ React49.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React49.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => setIsRoleModalOpen(false) }), /* @__PURE__ */ React49.createElement("div", { ref: roleDropdownRef, className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React49.createElement("div", { className: "p-6 text-center w-full mb-2" }, /* @__PURE__ */ React49.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Role Filter")), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex flex-col pl-2 pr-2 gap-1" }, ["ALL", "ADMIN", "MANAGER", "MEMBER", "GUEST"].map((option) => /* @__PURE__ */ React49.createElement(
5458
+ "button",
5459
+ {
5460
+ key: option,
5461
+ onClick: () => {
5462
+ onRoleFilterChange(option);
5463
+ setIsRoleModalOpen(false);
5464
+ },
5465
+ className: `text-left px-4 py-3 text-[11px] tracking-wide transition-colors rounded-full flex items-center justify-between outline-none ${activeRoleFilter === option ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}`
5466
+ },
5467
+ /* @__PURE__ */ React49.createElement("span", { className: "truncate pr-2 capitalize" }, option.toLowerCase())
5468
+ ))), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex mt-2" }, /* @__PURE__ */ React49.createElement("button", { onClick: () => setIsRoleModalOpen(false), className: "w-full py-4 text-[13px] text-neutral-500 hover:text-black transition-colors outline-none" }, "Cancel"))))), activeTab === "ACCOUNT" && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React49.createElement("div", null, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl mb-1 tracking-tight" }, "Public Profile"), /* @__PURE__ */ React49.createElement("p", { className: "text-xs text-neutral-500" }, "Manage your workspace identifiers and structural configuration details.")), isAccountReadOnly && /* @__PURE__ */ React49.createElement("span", { className: "p-2 w-9 h-9 bg-neutral-100 text-neutral-400 rounded-full shrink-0" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: CircleLock02Icon3, size: 18, className: "text-current" }))), /* @__PURE__ */ React49.createElement("div", { className: "w-full max-w-5xl" }, /* @__PURE__ */ React49.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSaveAccount, autoComplete: "off" }, /* @__PURE__ */ React49.createElement(
5469
+ TextInput,
5470
+ {
5471
+ label: "Display Name",
5472
+ value: displayName,
5473
+ onChange: handleDisplayNameChange,
5474
+ disabled: isAccountReadOnly || isSavingAccount,
5475
+ placeholder: "Sovereign User",
5476
+ maxLength: 50
5477
+ }
5478
+ ), /* @__PURE__ */ React49.createElement("div", { className: "space-y-1.5 relative w-full" }, /* @__PURE__ */ React49.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Workspace Handle"), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center relative w-full border-b border-neutral-200 focus-within:border-black transition-all duration-300 overflow-hidden" }, /* @__PURE__ */ React49.createElement(
5479
+ "input",
5480
+ {
5481
+ type: "text",
5482
+ value: slug,
5483
+ disabled: isAccountReadOnly || isSavingAccount,
5484
+ onChange: (e) => handleSlugChange(e.target.value),
5485
+ spellCheck: "false",
5486
+ autoComplete: "off",
5487
+ className: "w-full pr-10 pl-0 py-3 text-sm bg-transparent text-black outline-none disabled:opacity-50 disabled:cursor-not-allowed",
5488
+ placeholder: "workspace-handle"
5489
+ }
5490
+ ), /* @__PURE__ */ React49.createElement("div", { className: "absolute right-2 top-1/2 -translate-y-1/2" }, isCheckingSlug && /* @__PURE__ */ React49.createElement(InputSpinner3, null), !isCheckingSlug && !isAccountReadOnly && slug !== initialSlug && slug.length >= 3 && slugAvailable === false && /* @__PURE__ */ React49.createElement("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-red-100" }, /* @__PURE__ */ React49.createElement("svg", { className: "w-2 h-2 text-red-600", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React49.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" }))), !isCheckingSlug && !isAccountReadOnly && slug !== initialSlug && slug.length >= 3 && slugAvailable === true && /* @__PURE__ */ React49.createElement("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-green-100" }, /* @__PURE__ */ React49.createElement("svg", { className: "w-2 h-2 text-green-600", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React49.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M16.707 5.293a1 1 0 00-1.414 0L8 12.586 4.707 9.293a1 1 0 10-1.414 1.414l4 4a1 1 0 001.414 0l8-8a1 1 0 000-1.414z" })))))), /* @__PURE__ */ React49.createElement("div", { className: "pt-8 mt-2 flex items-center gap-4" }, /* @__PURE__ */ React49.createElement(
5491
+ ThreeDActionButton,
5492
+ {
5493
+ type: "submit",
5494
+ disabled: isAccountSaveDisabled,
5495
+ isLoading: isSavingAccount,
5496
+ className: "min-w-32"
5497
+ },
5498
+ "Save Changes"
5499
+ ), hasAccountChanges && !isSavingAccount && !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
5500
+ "button",
5501
+ {
5502
+ type: "button",
5503
+ onClick: () => {
5504
+ setDisplayName(initialDisplayName);
5505
+ setSlug(initialSlug);
5506
+ },
5507
+ className: "text-[11px] tracking-widest text-neutral-400 hover:text-black transition-colors outline-none"
5508
+ },
5509
+ "Cancel"
5510
+ ))))), activeTab === "BILLING" && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", { className: "bg-[#143731] rounded-3xl p-6 relative overflow-hidden flex flex-col w-full mt-2" }, /* @__PURE__ */ React49.createElement("div", { className: "relative z-10 flex flex-col items-start w-full" }, /* @__PURE__ */ React49.createElement("p", { className: "text-[11px] text-white leading-tight mb-1" }, /* @__PURE__ */ React49.createElement("span", { className: "text-white/60" }, "AI Credits Balance")), isBillingLoading ? /* @__PURE__ */ React49.createElement("div", { className: "h-8 w-32 bg-white/10 animate-pulse rounded mt-2" }) : /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-2 mt-1" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Coins01Icon, size: 24, className: "text-white" }), /* @__PURE__ */ React49.createElement("span", { className: "text-2xl text-white tracking-tight" }, aiCredits)), /* @__PURE__ */ React49.createElement("div", { className: "mt-8 w-full " }, /* @__PURE__ */ React49.createElement(
5511
+ "button",
5512
+ {
5513
+ onClick: onTopUp,
5514
+ className: "px-6 py-2.5 rounded-full border border-white/50 bg-transparent text-white/50 text-[12px] tracking-wide transition-colors outline-none hover:bg-white/10 hover:text-white hover:border-white"
5515
+ },
5516
+ "Top Up Credits"
5517
+ ))), /* @__PURE__ */ React49.createElement(
5518
+ "img",
5519
+ {
5520
+ src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/save_box.avif",
5521
+ alt: "Credits",
5522
+ className: "absolute bottom-2 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none drop-shadow-md opacity-50"
5523
+ }
5524
+ )), /* @__PURE__ */ React49.createElement("div", { className: "mt-4 px-1" }, /* @__PURE__ */ React49.createElement("p", { className: "text-[11px] text-neutral-500 leading-relaxed max-w-lg" }, "AI credits are consumed when generating intelligent summaries, transcriptions, and automated huddle insights. Additional credits are billed dynamically to your primary payment method."))));
5525
+ };
5020
5526
  export {
5021
5527
  AppBento2,
5022
5528
  CardInfoDialog,
@@ -5062,6 +5568,7 @@ export {
5062
5568
  UniversalReferralPage,
5063
5569
  UniversalRewardPage,
5064
5570
  UniversalSecurityPage,
5571
+ UniversalSettings,
5065
5572
  UniversalSidebar,
5066
5573
  UniversalTransactionPage,
5067
5574
  UniversalVerificationPage,