import { L as useLanguagesApi, n as useFluidContext } from "./FluidProvider-DIE1VH2Z.mjs";
import { j as useAccountApi } from "./portal_tenant-l4a-eX2B.mjs";
import { i as usePayApi } from "./api-context-3GmfqvIB.mjs";
import { n as useCountriesApi } from "./countries-api-context-CMh13cfX.mjs";
import { Q as DialogContent, R as Label, Sn as useZodForm, X as Dialog, et as DialogFooter, f as fluidToast, in as BreadcrumbItem, it as DialogTitle, k as Input, on as BreadcrumbList, rn as Breadcrumb, sn as BreadcrumbPage, tt as DialogHeader, vn as Button } from "./src-Dk1FJOX0.mjs";
import { n as ScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-Dn12BZyj.mjs";
import { n as payKeys, r as storeKeys, t as accountKeys } from "./query-keys-BkMRwfNo.mjs";
import { t as useAccount } from "./use-account-B201ntr4.mjs";
import { a as AddressFormDialog, f as UserInfoDialog, g as useProfileTranslation, h as ProfileTranslationBridge, i as CreditCardFormDialog, m as EllipsesDropdown, n as createFluidPayApiAdapter, o as EditPaymentMethodDialog, p as ConfirmActionDialog, r as mapToFluidPayPaymentMethod, s as FluidPayCoreProvider, t as AddressAutocompleteInput } from "./AddressAutocompleteInput-DBr3dEbL.mjs";
import { s as usePortalMySiteProfile } from "./use-mysite-portal-B7N48vKo.mjs";
import { useCallback, useMemo, useState } from "react";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
import { Copy, Facebook, Globe, Instagram, Link2, Linkedin, LogOut, Mail, MapPin, Pencil, Phone, Plus, Quote, Sparkles, Twitter, User, Youtube } from "lucide-react";
import { z } from "zod";
//#region src/screens/profile/derive-last-name.ts
function deriveLastName(firstName, fullName) {
	if (!firstName) return "";
	const prefix = `${firstName} `;
	return fullName.startsWith(prefix) ? fullName.slice(prefix.length) : "";
}
//#endregion
//#region src/screens/profile/ProfileLayout.tsx
function ProfileLayout(props) {
	const { account, pointsBalance, pointsLedger, rewardsEnabled, addresses, paymentMethods, mySiteDisplayUrl, socialLinks, onEditPersonalInfo, onAddAddress, onEditAddress, onDeleteAddress, onAddPaymentMethod, onEditPaymentMethod, onCopyMySiteLink, onEditMySiteLink, onConnectSocial, onSignOut } = props;
	const fullName = `${account.first_name ?? ""} ${account.last_name ?? ""}`.trim();
	const heroDisplay = (account.first_name || "").trim().split(" ")[0] || account.email?.split("@")[0] || "Account";
	const connectedSocialCount = Object.values(socialLinks).filter((v) => typeof v === "string" && v.length > 0).length;
	const [isPointsHistoryOpen, setIsPointsHistoryOpen] = useState(false);
	const POINTS_PREVIEW_COUNT = 4;
	const ledger = pointsLedger ?? [];
	const ledgerPreview = ledger.slice(0, POINTS_PREVIEW_COUNT);
	const hasMoreLedger = ledger.length > POINTS_PREVIEW_COUNT;
	return /* @__PURE__ */ jsx("div", {
		className: "relative",
		children: /* @__PURE__ */ jsxs("div", {
			className: "max-w-profile-container relative mx-auto px-5 pt-8 pb-20 md:px-8",
			children: [
				/* @__PURE__ */ jsxs("section", {
					className: "flex items-center gap-3.5",
					children: [
						/* @__PURE__ */ jsx("div", {
							className: "size-profile-avatar-sm md:size-profile-avatar relative shrink-0 overflow-hidden rounded-full ring-1 ring-black/5",
							children: account.avatar_url ? /* @__PURE__ */ jsx("img", {
								src: account.avatar_url,
								alt: "",
								className: "h-full w-full object-cover"
							}) : /* @__PURE__ */ jsx("div", {
								className: "bg-profile-dark text-profile-dark-foreground flex h-full w-full items-center justify-center text-lg font-semibold",
								children: heroDisplay.charAt(0).toUpperCase()
							})
						}),
						/* @__PURE__ */ jsxs("div", {
							className: "min-w-0 flex-1",
							children: [/* @__PURE__ */ jsx("h1", {
								className: "text-profile-hero tracking-profile-hero text-profile-text md:text-profile-hero-lg truncate font-bold",
								children: heroDisplay
							}), /* @__PURE__ */ jsx("p", {
								className: "text-profile-sm-plus text-profile-text-muted mt-0.5 truncate",
								children: account.email
							})]
						}),
						/* @__PURE__ */ jsx("div", {
							className: "flex shrink-0 items-center gap-2",
							children: rewardsEnabled && /* @__PURE__ */ jsxs("div", {
								className: "ring-profile-border bg-profile-card text-profile-xs-plus text-profile-text inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 font-semibold ring-1",
								children: [
									/* @__PURE__ */ jsx(Sparkles, {
										className: "text-profile-accent size-3",
										strokeWidth: 2.25
									}),
									(pointsBalance ?? 0).toLocaleString(),
									" pts"
								]
							})
						})
					]
				}),
				/* @__PURE__ */ jsx(SectionHeader, {
					title: "Personal information",
					action: /* @__PURE__ */ jsx(PillButton, {
						onClick: onEditPersonalInfo,
						icon: Pencil,
						label: "Edit"
					})
				}),
				/* @__PURE__ */ jsxs("div", {
					className: "ring-profile-border bg-profile-card mt-2.5 overflow-hidden rounded-2xl ring-1",
					children: [
						/* @__PURE__ */ jsx(FieldRow, {
							icon: User,
							label: "Name",
							value: fullName || account.first_name || ""
						}),
						/* @__PURE__ */ jsx(FieldRow, {
							icon: Mail,
							label: "Email",
							value: account.email ?? ""
						}),
						/* @__PURE__ */ jsx(FieldRow, {
							icon: Phone,
							label: "Phone",
							value: account.phone ?? "",
							placeholder: "Add phone number"
						}),
						/* @__PURE__ */ jsx(FieldRow, {
							icon: Quote,
							label: "Bio",
							value: account.bio ?? "",
							placeholder: "Add a short bio",
							multiline: true,
							isLast: true
						})
					]
				}),
				/* @__PURE__ */ jsx(SectionHeader, { title: "Payment methods" }),
				/* @__PURE__ */ jsxs("div", {
					className: "mt-2.5 grid grid-cols-1 gap-2.5 sm:grid-cols-3",
					children: [paymentMethods.map((method) => /* @__PURE__ */ jsx(PaymentCardVisual, {
						method,
						onClick: () => onEditPaymentMethod(method)
					}, method.id)), /* @__PURE__ */ jsx(AddPaymentTile, { onClick: onAddPaymentMethod })]
				}),
				rewardsEnabled && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SectionHeader, {
					title: "Points history",
					action: /* @__PURE__ */ jsxs("span", {
						className: "text-profile-xs text-profile-text-faint",
						children: [(pointsBalance ?? 0).toLocaleString(), " pts available"]
					})
				}), ledger.length > 0 ? /* @__PURE__ */ jsxs("div", {
					className: "ring-profile-border bg-profile-card mt-2.5 overflow-hidden rounded-2xl ring-1",
					children: [ledgerPreview.map((entry, i) => /* @__PURE__ */ jsx(PointsLedgerRow, {
						entry,
						isLast: !hasMoreLedger && i === ledgerPreview.length - 1
					}, entry.id)), hasMoreLedger && /* @__PURE__ */ jsxs("button", {
						type: "button",
						onClick: () => setIsPointsHistoryOpen(true),
						className: "text-profile-xs text-profile-text hover:bg-profile-pill-hover flex w-full items-center justify-center gap-1 px-4 py-3 font-bold transition-colors",
						children: [
							"See all ",
							ledger.length,
							" transactions"
						]
					})]
				}) : /* @__PURE__ */ jsxs("div", {
					className: "ring-dashed ring-profile-dashed-border bg-profile-card mt-2.5 flex flex-col items-center justify-center gap-1 rounded-2xl px-4 py-8 text-center ring-1",
					children: [
						/* @__PURE__ */ jsx(Sparkles, {
							className: "text-profile-text-faint size-5",
							strokeWidth: 1.75
						}),
						/* @__PURE__ */ jsx("div", {
							className: "text-profile-base text-profile-text font-bold",
							children: "No points yet"
						}),
						/* @__PURE__ */ jsx("div", {
							className: "text-profile-xs text-profile-text-muted",
							children: "Earn points on every order to unlock rewards."
						})
					]
				})] }),
				/* @__PURE__ */ jsx(SectionHeader, {
					title: "Your MySite link",
					action: onEditMySiteLink ? /* @__PURE__ */ jsx(PillButton, {
						onClick: onEditMySiteLink,
						icon: Pencil,
						label: "Edit link"
					}) : void 0
				}),
				/* @__PURE__ */ jsxs("div", {
					className: "ring-profile-border bg-profile-card mt-2.5 flex items-center gap-3 rounded-2xl p-3.5 ring-1",
					children: [
						/* @__PURE__ */ jsx("div", {
							className: "size-profile-mysite-icon bg-profile-icon-bg text-profile-text flex shrink-0 items-center justify-center rounded-full",
							children: /* @__PURE__ */ jsx(Link2, {
								className: "size-[18px]",
								strokeWidth: 2
							})
						}),
						/* @__PURE__ */ jsxs("div", {
							className: "min-w-0 flex-1",
							children: [/* @__PURE__ */ jsx("div", {
								className: "text-profile-2xs tracking-profile-uppercase-1 text-profile-text-faint font-bold uppercase",
								children: "Public link"
							}), /* @__PURE__ */ jsx("div", {
								className: "text-profile-base text-profile-text mt-0.5 truncate font-mono font-semibold",
								children: mySiteDisplayUrl || "Set your MySite link"
							})]
						}),
						/* @__PURE__ */ jsxs("button", {
							type: "button",
							onClick: onCopyMySiteLink,
							disabled: !mySiteDisplayUrl,
							className: "ring-profile-border bg-profile-card text-profile-xs text-profile-text hover:bg-profile-pill-hover inline-flex items-center gap-1 rounded-md px-3 py-1.5 font-bold ring-1 transition-all disabled:cursor-not-allowed disabled:opacity-40",
							children: [/* @__PURE__ */ jsx(Copy, {
								className: "size-3",
								strokeWidth: 2.25
							}), "Copy"]
						})
					]
				}),
				/* @__PURE__ */ jsx(SectionHeader, { title: "Shipping addresses" }),
				/* @__PURE__ */ jsxs("div", {
					className: "mt-2.5 grid grid-cols-1 gap-2.5 sm:grid-cols-2",
					children: [addresses.map((address) => /* @__PURE__ */ jsx(AddressCard, {
						address,
						onEdit: () => onEditAddress(address),
						onDelete: address.default ? void 0 : () => onDeleteAddress(address)
					}, address.id)), /* @__PURE__ */ jsx(AddAddressTile, { onClick: onAddAddress })]
				}),
				/* @__PURE__ */ jsx(SectionHeader, {
					title: "Social media",
					action: /* @__PURE__ */ jsxs("span", {
						className: "text-profile-xs text-profile-text-faint",
						children: [connectedSocialCount, " connected"]
					})
				}),
				/* @__PURE__ */ jsx("div", {
					className: "ring-profile-border bg-profile-card mt-2.5 overflow-hidden rounded-2xl ring-1",
					children: SOCIAL_ENTRIES.map((entry, i) => /* @__PURE__ */ jsx(SocialRow, {
						entry,
						handle: socialLinks[entry.key] ?? "",
						isLast: i === SOCIAL_ENTRIES.length - 1,
						onConnect: () => onConnectSocial(entry.key)
					}, entry.key))
				}),
				/* @__PURE__ */ jsx(Dialog, {
					open: isPointsHistoryOpen,
					onOpenChange: setIsPointsHistoryOpen,
					children: /* @__PURE__ */ jsxs(DialogContent, {
						className: "max-w-md md:max-w-lg",
						children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Points history" }) }), /* @__PURE__ */ jsx("div", {
							className: "ring-profile-border bg-profile-card max-h-[60vh] overflow-y-auto rounded-2xl ring-1",
							children: ledger.map((entry, i) => /* @__PURE__ */ jsx(PointsLedgerRow, {
								entry,
								isLast: i === ledger.length - 1
							}, entry.id))
						})]
					})
				}),
				onSignOut && /* @__PURE__ */ jsxs("div", {
					className: "ring-profile-border bg-profile-card mt-8 flex flex-wrap items-center justify-between gap-3 rounded-2xl p-3.5 ring-1",
					children: [/* @__PURE__ */ jsxs("div", {
						className: "flex items-center gap-3",
						children: [/* @__PURE__ */ jsx("div", {
							className: "bg-profile-danger-bg flex size-9 items-center justify-center rounded-md",
							children: /* @__PURE__ */ jsx(LogOut, {
								className: "text-profile-danger-icon size-4",
								strokeWidth: 2.25
							})
						}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
							className: "text-profile-base text-profile-text font-bold",
							children: "Sign out"
						}), /* @__PURE__ */ jsx("div", {
							className: "text-profile-xs-plus text-profile-text-muted",
							children: "You can sign back in any time"
						})] })]
					}), /* @__PURE__ */ jsx("button", {
						type: "button",
						onClick: onSignOut,
						className: "bg-profile-danger-button-bg text-profile-sm text-profile-danger-button-text hover:bg-profile-danger-button-hover rounded-md px-4 py-2 font-bold transition-colors",
						children: "Sign out"
					})]
				})
			]
		})
	});
}
function SectionHeader({ title, action }) {
	return /* @__PURE__ */ jsxs("div", {
		className: "mt-8 flex items-end justify-between",
		children: [/* @__PURE__ */ jsx("h2", {
			className: "text-profile-lg tracking-profile-heading text-profile-text font-bold",
			children: title
		}), action ?? null]
	});
}
function PillButton({ onClick, icon: Icon, label, disabled }) {
	return /* @__PURE__ */ jsxs("button", {
		type: "button",
		onClick,
		disabled,
		className: "ring-profile-border bg-profile-card text-profile-xs text-profile-text hover:bg-profile-pill-hover inline-flex items-center gap-1 rounded-md px-3 py-1.5 font-bold ring-1 transition-all disabled:cursor-not-allowed disabled:opacity-40",
		children: [/* @__PURE__ */ jsx(Icon, {
			className: "size-3",
			strokeWidth: 2.25
		}), label]
	});
}
function PointsLedgerRow({ entry, isLast }) {
	const isCredit = entry.amount >= 0;
	const sign = isCredit ? "+" : "−";
	const magnitude = Math.abs(entry.amount).toLocaleString();
	const amountColor = isCredit ? "text-emerald-600" : "text-profile-danger-icon";
	const sourceName = entry.metadata?.source?.name?.trim();
	const transactionType = entry.metadata?.transaction_type;
	const label = sourceName || (transactionType ? transactionType.charAt(0).toUpperCase() + transactionType.slice(1) : isCredit ? "Points earned" : "Points redeemed");
	const dateLabel = formatLedgerDate(entry.created_at);
	return /* @__PURE__ */ jsxs("div", {
		className: `flex items-center gap-3 px-4 py-3.5 ${isLast ? "" : "border-profile-divider border-b"}`,
		children: [
			/* @__PURE__ */ jsx("div", {
				className: "bg-profile-icon-bg flex size-9 shrink-0 items-center justify-center rounded-full",
				children: /* @__PURE__ */ jsx(Sparkles, {
					className: `size-4 ${isCredit ? "text-profile-accent" : "text-profile-text-muted"}`,
					strokeWidth: 2
				})
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "min-w-0 flex-1",
				children: [/* @__PURE__ */ jsx("div", {
					className: "text-profile-md text-profile-text truncate font-medium",
					children: label
				}), /* @__PURE__ */ jsx("div", {
					className: "text-profile-xs text-profile-text-muted",
					children: dateLabel
				})]
			}),
			/* @__PURE__ */ jsxs("div", {
				className: `text-profile-md shrink-0 font-mono font-bold tabular-nums ${amountColor}`,
				children: [sign, magnitude]
			})
		]
	});
}
function formatLedgerDate(iso) {
	try {
		return new Date(iso).toLocaleDateString(void 0, {
			month: "short",
			day: "numeric",
			year: "numeric"
		});
	} catch {
		return iso;
	}
}
function FieldRow({ icon: Icon, label, value, placeholder, isLast, multiline }) {
	const display = value || placeholder || "";
	return /* @__PURE__ */ jsxs("div", {
		className: `flex gap-3 px-4 py-3.5 ${multiline ? "items-start" : "items-center"} ${isLast ? "" : "border-profile-divider border-b"}`,
		children: [/* @__PURE__ */ jsx("div", {
			className: "bg-profile-icon-bg text-profile-text-muted flex size-9 shrink-0 items-center justify-center rounded-full",
			children: /* @__PURE__ */ jsx(Icon, {
				className: "size-4",
				strokeWidth: 2
			})
		}), /* @__PURE__ */ jsxs("div", {
			className: "min-w-0 flex-1",
			children: [/* @__PURE__ */ jsx("div", {
				className: "text-profile-2xs tracking-profile-uppercase-1 text-profile-text-faint font-bold uppercase",
				children: label
			}), /* @__PURE__ */ jsx("div", {
				className: `mt-0.5 ${multiline ? "whitespace-pre-line" : "truncate"} text-profile-md font-medium ${!value && Boolean(placeholder) ? "text-profile-text-placeholder" : "text-profile-text"}`,
				children: display
			})]
		})]
	});
}
const CARD_BRAND_LABEL = {
	amex: "AMERICAN EXPRESS",
	visa: "VISA",
	mastercard: "MASTERCARD",
	discover: "DISCOVER",
	diners: "DINERS CLUB",
	jcb: "JCB",
	unionpay: "UNIONPAY"
};
const CARD_BRAND_BADGE = {
	amex: "AMEX",
	visa: "VISA",
	mastercard: "MC",
	discover: "DISC",
	diners: "DC",
	jcb: "JCB",
	unionpay: "UPI"
};
function PaymentCardVisual({ method, onClick }) {
	const brand = (method.details.card_brand || "").toLowerCase();
	const brandLabel = CARD_BRAND_LABEL[brand] || (brand ? brand.toUpperCase() : "CARD");
	const badge = CARD_BRAND_BADGE[brand] || "CARD";
	const last4 = method.details.last_four ?? "••••";
	const expMonth = String(method.details.exp_month ?? "").padStart(2, "0");
	const expYear = String(method.details.exp_year ?? "").slice(-2);
	const exp = expMonth && expYear ? `${expMonth}/${expYear}` : "";
	const holder = method.billing_address?.name ?? "";
	const badgeBg = brand === "visa" ? "bg-[#1A1F71]" : brand === "mastercard" ? "bg-[#EB001B]" : "bg-[#0064D2]";
	return /* @__PURE__ */ jsxs("button", {
		type: "button",
		onClick,
		className: "group bg-foreground text-background ring-foreground/10 relative flex aspect-[1.586/1] flex-col justify-between overflow-hidden rounded-xl p-4 text-left shadow-sm ring-1 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg",
		children: [
			/* @__PURE__ */ jsx("div", {
				"aria-hidden": true,
				className: "absolute inset-0 bg-[repeating-linear-gradient(135deg,transparent_0px,transparent_22px,currentColor_22px,currentColor_24px)] opacity-[0.04]"
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "relative flex items-start justify-between",
				children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
					className: "text-profile-micro tracking-profile-uppercase-2 text-background/50 font-semibold uppercase",
					children: brandLabel
				}), /* @__PURE__ */ jsx("div", {
					className: "text-profile-hero tracking-profile-mono text-background mt-1 font-mono font-bold",
					children: last4
				})] }), method.default && /* @__PURE__ */ jsx("span", {
					className: "text-profile-micro bg-background/10 text-background/80 rounded-md px-2 py-0.5 font-bold tracking-wider uppercase",
					children: "Default"
				})]
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "relative flex items-end justify-between gap-2",
				children: [
					/* @__PURE__ */ jsxs("div", {
						className: "min-w-0 flex-1",
						children: [/* @__PURE__ */ jsx("div", {
							className: "text-profile-nano tracking-profile-uppercase-2 text-background/40 font-semibold uppercase",
							children: "Cardholder"
						}), /* @__PURE__ */ jsx("div", {
							className: "text-profile-xs-plus text-background truncate font-semibold",
							children: holder || " "
						})]
					}),
					/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
						className: "text-profile-nano tracking-profile-uppercase-2 text-background/40 font-semibold uppercase",
						children: "Expires"
					}), /* @__PURE__ */ jsx("div", {
						className: "text-profile-xs-plus text-background font-mono font-semibold",
						children: exp
					})] }),
					/* @__PURE__ */ jsx("div", {
						className: `text-profile-micro shrink-0 rounded px-1.5 py-0.5 font-bold tracking-wider text-white ${badgeBg}`,
						children: badge
					})
				]
			})
		]
	});
}
function AddPaymentTile({ onClick }) {
	return /* @__PURE__ */ jsxs("button", {
		type: "button",
		onClick,
		className: "group ring-dashed ring-profile-dashed-border bg-profile-card text-profile-text-muted hover:bg-profile-canvas hover:text-profile-text flex aspect-[1.586/1] flex-col items-center justify-center gap-1.5 rounded-xl ring-1 transition-colors",
		children: [
			/* @__PURE__ */ jsx("div", {
				className: "ring-profile-border bg-profile-card flex size-9 items-center justify-center rounded-full ring-1",
				children: /* @__PURE__ */ jsx(Plus, {
					className: "size-4",
					strokeWidth: 2.25
				})
			}),
			/* @__PURE__ */ jsx("div", {
				className: "text-profile-sm text-profile-text font-bold",
				children: "Add payment method"
			}),
			/* @__PURE__ */ jsx("div", {
				className: "text-profile-2xs-plus text-profile-text-faint",
				children: "Visa, Mastercard, Amex"
			})
		]
	});
}
function AddressCard({ address, onEdit, onDelete }) {
	const label = address.name?.trim() || "Address";
	const cityLine = [
		address.city,
		address.state,
		address.postal_code
	].filter(Boolean).join(", ");
	return /* @__PURE__ */ jsxs("div", {
		className: "ring-profile-border bg-profile-card hover:bg-profile-pill-hover focus-within:ring-profile-text/40 relative flex flex-col rounded-2xl ring-1 transition-all duration-200 focus-within:ring-2 hover:ring-2",
		children: [/* @__PURE__ */ jsxs("button", {
			type: "button",
			onClick: onEdit,
			className: "flex w-full flex-col rounded-2xl p-4 pr-12 text-left focus-visible:outline-none",
			children: [/* @__PURE__ */ jsxs("div", {
				className: "flex items-start justify-between gap-2",
				children: [/* @__PURE__ */ jsxs("div", {
					className: "flex items-center gap-2",
					children: [/* @__PURE__ */ jsx("div", {
						className: "bg-profile-icon-bg flex size-8 items-center justify-center rounded-full",
						children: /* @__PURE__ */ jsx(MapPin, {
							className: "text-profile-text-muted size-4",
							strokeWidth: 2
						})
					}), /* @__PURE__ */ jsx("div", {
						className: "text-profile-md text-profile-text font-bold",
						children: label
					})]
				}), address.default && /* @__PURE__ */ jsx("span", {
					className: "bg-profile-dark text-profile-micro text-profile-dark-foreground rounded-md px-2 py-0.5 font-bold tracking-wider uppercase",
					children: "Default"
				})]
			}), /* @__PURE__ */ jsxs("div", {
				className: "text-profile-sm-plus text-profile-text mt-3 space-y-0.5 leading-snug",
				children: [
					address.address1 && /* @__PURE__ */ jsx("div", { children: address.address1 }),
					address.address2 && /* @__PURE__ */ jsx("div", { children: address.address2 }),
					cityLine && /* @__PURE__ */ jsx("div", { children: cityLine }),
					address.country_code && /* @__PURE__ */ jsx("div", {
						className: "text-profile-text-muted",
						children: address.country_code
					})
				]
			})]
		}), onDelete && /* @__PURE__ */ jsx("div", {
			className: "absolute top-2 right-2 z-10",
			children: /* @__PURE__ */ jsx(EllipsesDropdown, {
				onEdit,
				onDelete,
				editLabel: "Edit",
				deleteLabel: "Delete"
			})
		})]
	});
}
function AddAddressTile({ onClick }) {
	return /* @__PURE__ */ jsxs("button", {
		type: "button",
		onClick,
		className: "group ring-dashed ring-profile-dashed-border min-h-profile-tile-min-h bg-profile-card text-profile-text-muted hover:bg-profile-canvas hover:text-profile-text flex flex-col items-center justify-center gap-1.5 rounded-2xl ring-1 transition-colors",
		children: [/* @__PURE__ */ jsx("div", {
			className: "ring-profile-border bg-profile-card flex size-9 items-center justify-center rounded-full ring-1",
			children: /* @__PURE__ */ jsx(Plus, {
				className: "size-4",
				strokeWidth: 2.25
			})
		}), /* @__PURE__ */ jsx("div", {
			className: "text-profile-base text-profile-text font-bold",
			children: "Add an address"
		})]
	});
}
const SOCIAL_ENTRIES = [
	{
		key: "linkedin",
		label: "LinkedIn",
		icon: Linkedin,
		placeholder: "linkedin.com/in/username"
	},
	{
		key: "facebook",
		label: "Facebook",
		icon: Facebook,
		placeholder: "facebook.com/username"
	},
	{
		key: "x",
		label: "X",
		icon: Twitter,
		placeholder: "x.com/username"
	},
	{
		key: "instagram",
		label: "Instagram",
		icon: Instagram,
		placeholder: "instagram.com/username"
	},
	{
		key: "youtube",
		label: "YouTube",
		icon: Youtube,
		placeholder: "youtube.com/@channel"
	},
	{
		key: "pinterest",
		label: "Pinterest",
		icon: Globe,
		placeholder: "pinterest.com/username"
	},
	{
		key: "tiktok",
		label: "TikTok",
		icon: Globe,
		placeholder: "tiktok.com/@username"
	}
];
function SocialRow({ entry, handle, isLast, onConnect }) {
	const Icon = entry.icon;
	return /* @__PURE__ */ jsxs("div", {
		className: `flex items-center gap-3 px-4 py-3.5 ${isLast ? "" : "border-profile-divider border-b"}`,
		children: [
			/* @__PURE__ */ jsx("div", {
				className: "bg-profile-icon-bg text-profile-text flex size-9 shrink-0 items-center justify-center rounded-full",
				children: /* @__PURE__ */ jsx(Icon, {
					className: "size-4",
					strokeWidth: 2
				})
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "min-w-0 flex-1",
				children: [/* @__PURE__ */ jsx("div", {
					className: "text-profile-base text-profile-text font-bold",
					children: entry.label
				}), /* @__PURE__ */ jsx("div", {
					className: `text-profile-sm truncate ${handle ? "text-profile-text-muted" : "text-profile-text-placeholder"}`,
					children: handle || entry.placeholder
				})]
			}),
			/* @__PURE__ */ jsx(PillButton, {
				onClick: onConnect,
				icon: handle ? Pencil : Plus,
				label: handle ? "Edit" : "Connect"
			})
		]
	});
}
//#endregion
//#region src/screens/ProfileContentScreen.tsx
function mapAccountToCustomerAccount(raw) {
	return {
		fluid_pay_account: {
			id: raw.id,
			email: raw.email,
			address_count: 0,
			payment_methods_count: 0,
			language_iso: null
		},
		customer: {
			id: raw.id,
			active: true,
			active_subscriptions_count: 0,
			display_total_spent: "0",
			email: raw.email,
			first_name: raw.first_name,
			full_name: `${raw.first_name} ${raw.last_name}`.trim(),
			inactive_subscriptions_count: 0,
			is_rep: raw.member_type === "rep",
			phone: raw.phone,
			orders_count: 0
		}
	};
}
function composeAddressName(firstName, lastName) {
	const combined = `${firstName} ${lastName}`.trim();
	return combined.length > 0 ? combined : null;
}
function mapToFluidPayAddress(raw) {
	return {
		id: raw.id,
		address1: raw.street1,
		address2: raw.street2,
		city: raw.city,
		country_code: raw.country,
		default: raw.default,
		name: raw.name,
		postal_code: raw.zip,
		state: raw.state,
		subdivision_code: null
	};
}
const SOCIAL_KEY_TO_FIELD = {
	linkedin: "linkedin",
	facebook: "facebook",
	x: "twitter",
	instagram: "instagram",
	youtube: "youtube",
	pinterest: null,
	tiktok: "tiktok"
};
const SOCIAL_LABELS = {
	linkedin: "LinkedIn",
	facebook: "Facebook",
	x: "X",
	instagram: "Instagram",
	youtube: "YouTube",
	pinterest: "Pinterest",
	tiktok: "TikTok"
};
const SOCIAL_PLACEHOLDERS = {
	linkedin: "linkedin.com/in/username",
	facebook: "facebook.com/username",
	x: "x.com/username",
	instagram: "instagram.com/username",
	youtube: "youtube.com/@channel",
	pinterest: "pinterest.com/username",
	tiktok: "tiktok.com/@username"
};
function ProfileContentScreen({ onToast }) {
	const { t } = useProfileTranslation();
	const payApi = usePayApi();
	const accountApi = useAccountApi();
	const queryClient = useQueryClient();
	const fluidPayShim = useMemo(() => createFluidPayApiAdapter(payApi), [payApi]);
	const { data: mySiteProfile } = usePortalMySiteProfile();
	const mySiteUrl = mySiteProfile?.mysite_url ?? "";
	const mySiteDisplayUrl = mySiteUrl ? mySiteUrl.replace(/^https?:\/\//, "") : "";
	const { data: accountRep, isLoading: isLoadingAccount, isError: isAccountError } = useAccount();
	const accountData = useMemo(() => accountRep ? mapAccountToCustomerAccount(accountRep) : void 0, [accountRep]);
	const { data: addressesData } = useQuery({
		queryKey: payKeys.addresses.list(),
		queryFn: async () => {
			return (await payApi.fetchAddresses()).addresses.map(mapToFluidPayAddress);
		},
		enabled: true
	});
	const { data: paymentMethodsData } = useQuery({
		queryKey: payKeys.paymentMethods.list(),
		queryFn: async () => {
			return (await payApi.fetchPaymentMethods()).payment_methods.map(mapToFluidPayPaymentMethod);
		},
		enabled: true
	});
	const countriesAdapter = useCountriesApi();
	const languagesAdapter = useLanguagesApi();
	const { data: countriesData } = useQuery({
		queryKey: storeKeys.countries(),
		queryFn: () => countriesAdapter.listCountries(),
		enabled: true
	});
	const { data: languagesData } = useQuery({
		queryKey: storeKeys.languages(),
		queryFn: () => languagesAdapter.listLanguages(),
		enabled: true
	});
	const { data: pointsLedgerData, isError: isPointsLedgerError } = useQuery({
		queryKey: payKeys.pointsLedgers.list(),
		queryFn: () => payApi.fetchPointsLedgers(),
		enabled: true,
		retry: (failureCount, error) => {
			if (error instanceof Error && "status" in error && error.status === 403) return false;
			return failureCount < 1;
		}
	});
	const rewardPointsEnabled = !isPointsLedgerError && pointsLedgerData != null;
	const adaptedPointsLedger = useMemo(() => {
		return (pointsLedgerData?.points_ledgers ?? []).map((entry) => {
			const meta = entry.metadata;
			return {
				id: entry.id,
				amount: entry.amount,
				company_id: 0,
				created_at: entry.created_at,
				customer_id: 0,
				metadata: {
					transaction_type: meta?.transaction_type ?? void 0,
					source: meta?.source ?? void 0
				},
				total_balance: entry.total_balance,
				updated_at: entry.created_at
			};
		});
	}, [pointsLedgerData]);
	const updateCustomerMutation = useMutation({
		mutationFn: async (data) => {
			await accountApi.updateAccount({ account: {
				first_name: data.first_name,
				last_name: data.last_name,
				phone: data.phone_number,
				bio: data.bio
			} });
		},
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: accountKeys.all });
			onToast("Profile updated", "success");
		},
		onError: () => {
			onToast("Failed to update profile", "error");
		}
	});
	const deletePaymentMethodMutation = useMutation({
		mutationFn: (paymentMethodId) => payApi.deletePaymentMethod(paymentMethodId),
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: payKeys.paymentMethods.all });
		},
		onError: () => {
			onToast("Failed to delete payment method", "error");
		}
	});
	const updatePaymentMethodMutation = useMutation({
		mutationFn: ({ paymentMethodId, data }) => payApi.updatePaymentMethod(paymentMethodId, { payment_method: {
			default: data.set_as_default,
			billing_address: {
				name: data.billing_address.name,
				street1: data.billing_address.address1,
				street2: data.billing_address.address2 ?? null,
				city: data.billing_address.city,
				state: data.billing_address.state,
				zip: data.billing_address.zip,
				country: data.billing_address.country_code
			}
		} }),
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: payKeys.paymentMethods.all });
		},
		onError: () => {
			onToast("Failed to update payment method", "error");
		}
	});
	const createAddressMutation = useMutation({
		mutationFn: (body) => payApi.createAddress({ address: {
			name: composeAddressName(body.address.first_name, body.address.last_name),
			street1: body.address.address1,
			street2: body.address.address2,
			city: body.address.city,
			state: body.address.state,
			zip: body.address.postal_code,
			country: body.address.country_code
		} }),
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: payKeys.addresses.all });
			onToast("Address created", "success");
		},
		onError: () => {
			onToast("Failed to create address", "error");
		}
	});
	const updateAddressMutation = useMutation({
		mutationFn: ({ addressId, body }) => payApi.updateAddress(addressId, { address: {
			name: composeAddressName(body.address.first_name, body.address.last_name),
			street1: body.address.address1,
			street2: body.address.address2,
			city: body.address.city,
			state: body.address.state,
			zip: body.address.postal_code,
			country: body.address.country_code
		} }),
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: payKeys.addresses.all });
			onToast("Address updated", "success");
		},
		onError: () => {
			onToast("Failed to update address", "error");
		}
	});
	const deleteAddressMutation = useMutation({
		mutationFn: (addressId) => payApi.deleteAddress(addressId),
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: payKeys.addresses.all });
			onToast("Address deleted", "success");
		},
		onError: () => {
			onToast("Failed to delete address", "error");
		}
	});
	const addCreditCardMutation = useMutation({
		mutationFn: (data) => payApi.createPaymentMethod({ payment_method: {
			type: "card",
			token: data.payment_method.token,
			default: data.default_payment_method
		} }),
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: payKeys.paymentMethods.all });
			onToast("Payment method added", "success");
		},
		onError: () => {
			onToast("Failed to add payment method", "error");
		}
	});
	const addresses = addressesData ?? [];
	const paymentMethods = paymentMethodsData ?? [];
	const adaptedLanguages = (languagesData?.languages ?? []).map((l, i) => ({
		id: i,
		name: l.name,
		iso: l.code
	}));
	const countries = countriesData?.countries;
	const countryOptions = useMemo(() => [...countries ?? []].map((c) => ({
		iso: c.code,
		name: c.name
	})).sort((a, b) => a.name.localeCompare(b.name)), [countries]);
	const statesByCountry = useMemo(() => {
		const map = /* @__PURE__ */ new Map();
		for (const c of countries ?? []) map.set(c.code, c.states.map((s) => ({
			name: s.name,
			isoCode: s.code
		})));
		return map;
	}, [countries]);
	const fetchStatesFromCountries = useCallback((countryCode) => Promise.resolve(statesByCountry.get(countryCode) ?? []), [statesByCountry]);
	const [isInfoDialogOpen, setIsInfoDialogOpen] = useState(false);
	const [addressDialog, setAddressDialog] = useState({
		open: false,
		selected: null
	});
	const [deletingAddress, setDeletingAddress] = useState(null);
	const [isAddCardOpen, setIsAddCardOpen] = useState(false);
	const [editPaymentMethod, setEditPaymentMethod] = useState(null);
	const userInfoLanguage = useMemo(() => {
		return adaptedLanguages.find((l) => l.iso === accountData?.fluid_pay_account.language_iso)?.name ?? "English";
	}, [adaptedLanguages, accountData]);
	const derivedLastName = useMemo(() => {
		if (!accountData) return "";
		const { first_name, full_name } = accountData.customer;
		return deriveLastName(first_name, full_name);
	}, [accountData]);
	const userInfoForm = useZodForm(useMemo(() => z.object({
		first_name: z.string().min(1, "First name is required"),
		last_name: z.string().min(1, "Last name is required"),
		phone_number: z.string().optional(),
		language: z.string().min(1, "Language is required"),
		bio: z.string().optional()
	}), []), { defaultValues: {
		first_name: accountData?.customer.first_name ?? "",
		last_name: derivedLastName,
		phone_number: accountData?.customer.phone ?? "",
		language: userInfoLanguage,
		bio: accountRep?.bio ?? ""
	} });
	const handleOpenInfoDialog = useCallback(() => {
		userInfoForm.reset({
			first_name: accountData?.customer.first_name ?? "",
			last_name: derivedLastName,
			phone_number: accountData?.customer.phone ?? "",
			language: userInfoLanguage,
			bio: accountRep?.bio ?? ""
		});
		setIsInfoDialogOpen(true);
	}, [
		accountData,
		accountRep,
		derivedLastName,
		userInfoLanguage,
		userInfoForm
	]);
	const onSubmitUserInfo = userInfoForm.handleSubmit(async (data) => {
		try {
			await updateCustomerMutation.mutateAsync(data);
			setIsInfoDialogOpen(false);
		} catch {}
	});
	const socialLinks = useMemo(() => {
		const src = accountRep?.social_links ?? {};
		const result = {};
		for (const [key, field] of Object.entries(SOCIAL_KEY_TO_FIELD)) {
			if (!field) continue;
			const v = src[field];
			if (typeof v === "string" && v.length > 0) result[key] = v;
		}
		return result;
	}, [accountRep]);
	const handleCopyMySiteLink = useCallback(async () => {
		if (!mySiteUrl) return;
		try {
			await navigator.clipboard.writeText(mySiteUrl);
			onToast("MySite link copied", "success");
		} catch {
			onToast("Failed to copy link", "error");
		}
	}, [mySiteUrl, onToast]);
	const [editingSocial, setEditingSocial] = useState(null);
	const [socialDraft, setSocialDraft] = useState("");
	const handleConnectSocial = useCallback((key) => {
		const field = SOCIAL_KEY_TO_FIELD[key];
		if (!field) {
			onToast("This platform isn't editable yet", "warning");
			return;
		}
		setSocialDraft(accountRep?.social_links?.[field] ?? "");
		setEditingSocial(key);
	}, [accountRep, onToast]);
	const updateSocialMutation = useMutation({
		mutationFn: async ({ field, value }) => {
			const current = accountRep?.social_links ?? {};
			await accountApi.updateAccount({ account: { social_links: {
				...current,
				[field]: value
			} } });
		},
		onSuccess: () => {
			queryClient.invalidateQueries({ queryKey: accountKeys.all });
			onToast("Social link updated", "success");
		},
		onError: () => {
			onToast("Failed to update social link", "error");
		}
	});
	const handleSubmitSocial = useCallback(async () => {
		if (!editingSocial) return;
		const field = SOCIAL_KEY_TO_FIELD[editingSocial];
		if (!field) return;
		await updateSocialMutation.mutateAsync({
			field,
			value: socialDraft.trim()
		});
		setEditingSocial(null);
	}, [
		editingSocial,
		socialDraft,
		updateSocialMutation
	]);
	if (isAccountError && !isLoadingAccount) return /* @__PURE__ */ jsx("div", {
		className: "px-4 py-8 sm:px-9",
		children: /* @__PURE__ */ jsx("div", {
			className: "text-muted-foreground text-center text-sm",
			children: "Unable to load account data. Please try again later."
		})
	});
	if (isLoadingAccount || !accountData || !accountRep) return /* @__PURE__ */ jsx("div", {
		className: "px-4 pt-4 sm:px-9 md:pt-8",
		children: /* @__PURE__ */ jsxs("div", {
			className: "space-y-4",
			children: [
				/* @__PURE__ */ jsx("div", { className: "bg-muted h-16 animate-pulse rounded" }),
				/* @__PURE__ */ jsx("div", { className: "bg-muted h-32 animate-pulse rounded" }),
				/* @__PURE__ */ jsx("div", { className: "bg-muted h-32 animate-pulse rounded" })
			]
		})
	});
	return /* @__PURE__ */ jsxs(FluidPayCoreProvider, {
		api: fluidPayShim,
		children: [
			/* @__PURE__ */ jsx(ProfileLayout, {
				account: accountRep,
				pointsBalance: rewardPointsEnabled ? pointsLedgerData?.points_ledgers?.[0]?.total_balance ?? 0 : void 0,
				pointsLedger: adaptedPointsLedger,
				rewardsEnabled: rewardPointsEnabled,
				addresses,
				paymentMethods,
				mySiteDisplayUrl,
				socialLinks,
				onEditPersonalInfo: handleOpenInfoDialog,
				onAddAddress: () => setAddressDialog({
					open: true,
					selected: null
				}),
				onEditAddress: (address) => setAddressDialog({
					open: true,
					selected: address
				}),
				onDeleteAddress: (address) => setDeletingAddress(address),
				onAddPaymentMethod: () => setIsAddCardOpen(true),
				onEditPaymentMethod: (pm) => setEditPaymentMethod(pm),
				onCopyMySiteLink: handleCopyMySiteLink,
				onConnectSocial: handleConnectSocial
			}),
			/* @__PURE__ */ jsx(UserInfoDialog, {
				control: userInfoForm.control,
				isOpen: isInfoDialogOpen,
				onSubmit: onSubmitUserInfo,
				handleClose: () => setIsInfoDialogOpen(false),
				languageOptions: adaptedLanguages.map((l) => ({
					name: l.name,
					value: l.name
				})),
				errorMsg: void 0,
				isSubmitting: updateCustomerMutation.isPending,
				email: accountRep.email ?? ""
			}),
			/* @__PURE__ */ jsx(AddressFormDialog, {
				isOpen: addressDialog.open,
				onClose: () => setAddressDialog({
					open: false,
					selected: null
				}),
				selectedAddress: addressDialog.selected,
				t: (key) => t(key),
				onSubmit: async (formData) => {
					if (addressDialog.selected) await updateAddressMutation.mutateAsync({
						addressId: addressDialog.selected.id,
						body: formData
					});
					else await createAddressMutation.mutateAsync(formData);
					setAddressDialog({
						open: false,
						selected: null
					});
				},
				isSubmitting: createAddressMutation.isPending || updateAddressMutation.isPending,
				onDelete: addressDialog.selected && !addressDialog.selected.default ? async () => {
					if (!addressDialog.selected) return;
					try {
						await deleteAddressMutation.mutateAsync(addressDialog.selected.id);
						setAddressDialog({
							open: false,
							selected: null
						});
					} catch {}
				} : void 0,
				isDeleting: deleteAddressMutation.isPending,
				countries: countryOptions,
				fetchStates: fetchStatesFromCountries,
				renderAddressAutocomplete: ({ control, setValue, countryCode }) => /* @__PURE__ */ jsx(AddressAutocompleteInput, {
					control,
					setValue,
					countryIso: countryCode,
					addressLineField: "address1",
					cityField: "city",
					stateField: "state",
					postalCodeField: "postal_code",
					placeholder: t("address_line_1")
				})
			}),
			/* @__PURE__ */ jsx(ConfirmActionDialog, {
				title: t("delete_address"),
				description: t("delete_address_message"),
				openDialog: deletingAddress !== null,
				setOpenDialog: (open) => {
					if (!open) setDeletingAddress(null);
				},
				onAction: async () => {
					if (!deletingAddress) return;
					try {
						await deleteAddressMutation.mutateAsync(deletingAddress.id);
						setDeletingAddress(null);
					} catch {}
				},
				isLoading: deleteAddressMutation.isPending,
				actionText: t("delete")
			}),
			/* @__PURE__ */ jsx(CreditCardFormDialog, {
				isOpen: isAddCardOpen,
				onClose: () => setIsAddCardOpen(false),
				t: (key) => t(key),
				onSubmit: async (data) => {
					try {
						await addCreditCardMutation.mutateAsync(data);
						setIsAddCardOpen(false);
					} catch {}
				},
				isSubmitting: addCreditCardMutation.isPending,
				countries: countryOptions,
				jwt: "",
				renderAddressAutocomplete: ({ control, setValue, countryCode }) => /* @__PURE__ */ jsx(AddressAutocompleteInput, {
					control,
					setValue,
					countryIso: countryCode,
					addressLineField: "address1",
					cityField: "city",
					stateField: "state",
					postalCodeField: "zip",
					placeholder: t("address_line_1")
				})
			}),
			editPaymentMethod && /* @__PURE__ */ jsx(EditPaymentMethodDialog, {
				isOpen: true,
				onClose: () => setEditPaymentMethod(null),
				paymentMethod: editPaymentMethod,
				countries: countryOptions,
				onSubmit: (data) => {
					updatePaymentMethodMutation.mutate({
						paymentMethodId: editPaymentMethod.id,
						data
					}, { onSuccess: () => setEditPaymentMethod(null) });
				},
				isSubmitting: updatePaymentMethodMutation.isPending,
				onDelete: () => {
					deletePaymentMethodMutation.mutate(editPaymentMethod.id, { onSuccess: () => setEditPaymentMethod(null) });
				},
				isDeleting: deletePaymentMethodMutation.isPending
			}),
			/* @__PURE__ */ jsx(Dialog, {
				open: editingSocial !== null,
				onOpenChange: (open) => !open && setEditingSocial(null),
				children: /* @__PURE__ */ jsxs(DialogContent, {
					className: "max-w-sm md:max-w-md",
					children: [
						/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: editingSocial ? `Edit ${SOCIAL_LABELS[editingSocial]} link` : "Edit social link" }) }),
						/* @__PURE__ */ jsxs("div", {
							className: "space-y-2 pt-2",
							children: [/* @__PURE__ */ jsx(Label, {
								htmlFor: "social-handle",
								className: "mb-1.5 block text-sm font-medium",
								children: "URL"
							}), /* @__PURE__ */ jsx(Input, {
								id: "social-handle",
								value: socialDraft,
								onChange: (e) => setSocialDraft(e.target.value),
								placeholder: editingSocial ? SOCIAL_PLACEHOLDERS[editingSocial] : "",
								onKeyDown: (e) => {
									if (e.key === "Enter") {
										e.preventDefault();
										handleSubmitSocial();
									}
								},
								autoFocus: true
							})]
						}),
						/* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
							type: "button",
							variant: "outline",
							onClick: () => setEditingSocial(null),
							disabled: updateSocialMutation.isPending,
							children: "Cancel"
						}), /* @__PURE__ */ jsx(Button, {
							type: "button",
							onClick: () => {
								handleSubmitSocial();
							},
							disabled: updateSocialMutation.isPending,
							children: updateSocialMutation.isPending ? "Saving..." : "Save"
						})] })
					]
				})
			})
		]
	});
}
//#endregion
//#region src/screens/ProfileScreen.tsx
function defaultToast(message, type) {
	fluidToast({
		title: message,
		type
	});
}
function ProfileScreen({ onToast, background, textColor, accentColor, padding, borderRadius, ...divProps }) {
	const { config } = useFluidContext();
	return /* @__PURE__ */ jsx(ProfileTranslationBridge, { children: /* @__PURE__ */ jsx(ProfileScreenContent, {
		onToast: onToast ?? defaultToast,
		countryIso: config.countryIso ?? "US",
		divProps
	}) });
}
function ProfileScreenContent({ onToast, countryIso, divProps }) {
	const { t } = useProfileTranslation();
	return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, {
		className: "text-lg",
		children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
			className: "font-semibold",
			children: t("breadcrumb")
		}) })
	}) }) }), /* @__PURE__ */ jsx("div", {
		...divProps,
		children: /* @__PURE__ */ jsx(ProfileContentScreen, {
			onToast,
			countryIso
		})
	})] });
}
const profileScreenPropertySchema = {
	widgetType: "ProfileScreen",
	displayName: "Profile Screen",
	tabsConfig: [{
		id: "styling",
		label: "Styling"
	}],
	fields: []
};
//#endregion
export { profileScreenPropertySchema as n, ProfileScreen as t };

//# sourceMappingURL=ProfileScreen-CkRFE_jb.mjs.map