PageSourceSearch

https://bookingflows.com/static/js/1356.169b9f03.chunk.js

js bookingflows.com collected 2026-10-02 00:31:00 UTC 34,267 bytes, 3 lines download raw bytes

1/*! For license information please see 1356.169b9f03.chunk.js.LICENSE.txt */
2"use strict";(globalThis.webpackChunkfrontend||=[]).push([[1356],{5949(e,t,s){s.d(t,{Ex:()=>o});s(65043);var a=s(10917),r=s(99766),n=s(70579);const i=(0,a.F)("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium whitespace-nowrap transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",destructive:"bg-danger text-white",outline:"border border-border-strong text-foreground",neutral:"bg-neutral-soft text-neutral-soft-foreground",info:"bg-info-soft text-info-soft-foreground",success:"bg-success-soft text-success-soft-foreground",warning:"bg-warning-soft text-warning-soft-foreground",danger:"bg-danger-soft text-danger-soft-foreground",ink:"bg-surface-ink text-white"}},defaultVariants:{variant:"default"}}),l={default:"bg-white/80",secondary:"bg-gray-500",destructive:"bg-white/80",outline:"bg-gray-400",neutral:"bg-gray-400",info:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",ink:"bg-white/80"};function o(e){let{className:t,variant:s="default",dot:a=!1,children:o,...d}=e;return(0,n.jsxs)("span",{className:(0,r.cn)(i({variant:s}),t),...d,children:[a&&(0,n.jsx)("span",{"aria-hidden":"true",className:(0,r.cn)("h-1.5 w-1.5 rounded-full shrink-0",l[s]||l.neutral)}),o]})}},91637(e,t,s){var a=s(65043),r=s(99878),n=s(36210),i=s(38326),l=s(29868),o=s(99766),d=s(70579);const c=r.bL,x=r.l9;r.YJ,r.ZL,r.Pb,r.z6;a.forwardRef((e,t)=>{let{className:s,inset:a,children:n,...l}=e;return(0,d.jsxs)(r.ZP,{ref:t,className:(0,o.cn)("flex cursor-default select-none items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-gray-100 data-[state=open]:bg-gray-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a&&"pl-8",s),...l,children:[n,(0,d.jsx)(i.A,{className:"ml-auto"})]})}).displayName=r.ZP.displayName;a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,d.jsx)(r.G5,{ref:t,className:(0,o.cn)("z-popover min-w-[8rem] overflow-hidden rounded-xl bg-surface-raised p-1 text-popover-foreground shadow-raised data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",s),...a})}).displayName=r.G5.displayName;const m=a.forwardRef((e,t)=>{let{className:s,sideOffset:a=4,...n}=e;return(0,d.jsx)(r.ZL,{children:(0,d.jsx)(r.UC,{ref:t,sideOffset:a,className:(0,o.cn)("z-popover max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-xl bg-surface-raised p-1.5 text-popover-foreground shadow-raised","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",s),...n})})});m.displayName=r.UC.displayName;const p=a.forwardRef((e,t)=>{let{className:s,inset:a,...n}=e;return(0,d.jsx)(r.q7,{ref:t,className:(0,o.cn)("relative flex cursor-default select-none items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",a&&"pl-8",s),...n})});p.displayName=r.q7.displayName;a.forwardRef((e,t)=>{let{className:s,children:a,checked:i,...l}=e;return(0,d.jsxs)(r.H_,{ref:t,className:(0,o.cn)("relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:i,...l,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(r.VF,{children:(0,d.jsx)(n.A,{className:"h-4 w-4"})})}),a]})}).displayName=r.H_.displayName;a.forwardRef((e,t)=>
2{let{className:s,children:a,...n}=e;return(0,d.jsxs)(r.hN,{ref:t,className:(0,o.cn)("relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(r.VF,{children:(0,d.jsx)(l.A,{className:"h-2 w-2 fill-current"})})}),a]})}).displayName=r.hN.displayName;const u=a.forwardRef((e,t)=>{let{className:s,inset:a,...n}=e;return(0,d.jsx)(r.JU,{ref:t,className:(0,o.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",s),...n})});u.displayName=r.JU.displayName;const h=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,d.jsx)(r.wv,{ref:t,className:(0,o.cn)("-mx-1.5 my-1 h-px bg-gray-100",s),...a})});h.displayName=r.wv.displayName;s.d(t,["SQ",0,m,"_2",0,p,"lp",0,u,"mB",0,h,"rI",0,c,"ty",0,x])},92264(e,t,s){var a=s(65043),r=s(99766),n=s(70579);const i="w-full rounded-lg border border-input bg-surface text-base text-foreground placeholder:text-foreground-subtle transition-[border-color,box-shadow,background-color] duration-fast focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 aria-[invalid=true]:border-danger aria-[invalid=true]:ring-2 aria-[invalid=true]:ring-danger/20 disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-foreground-muted md:text-sm",l=a.forwardRef((e,t)=>{let{className:s,type:a,maxLength:l=500,...o}=e;return(0,n.jsx)("input",{type:a,maxLength:l,className:(0,r.cn)(i,"flex h-9 px-3 py-1 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",s),ref:t,...o})});l.displayName="Input",s.d(t,["K",0,i,"p",0,l])},91356(e,t,s){s.r(t);var a=s(65043),r=s(53217),n=s(77819),i=s(76833),l=s(22024),o=s(28646),d=s(75088),c=s(72313),x=s(86376),m=s(73062),p=s(7104),u=s(70764),h=s(35087),g=s(41680),f=s(25040),y=s(35327),b=s(50516),v=s(42489),j=s(44919),N=s(13390),w=s(92264),k=s(5949),_=s(91637),S=s(56328),A=s(70579);const $="https://api.bookingflows.com",R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD";try{return new Intl.NumberFormat(void 0,{style:"currency",currency:(t||"USD").toUpperCase(),currencyDisplay:"narrowSymbol"}).format(Number(e||0))}catch{return`${Number(e||0).toFixed(2)} ${t}`}},C=e=>{let{children:t,className:s=""}=e;return(0,A.jsx)("div",{className:`bg-white rounded-xl shadow-soft ${s}`,children:t})},P=e=>{let{icon:t,iconColor:s,label:a,value:r,testId:n}=e;return(0,A.jsxs)(C,{className:"p-4","data-testid":n,children:[(0,A.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,A.jsx)(t,{className:`w-4 h-4 ${s}`}),(0,A.jsx)("span",{className:"text-xs text-gray-500",children:a})]}),(0,A.jsx)("p",{className:"text-xl font-semibold text-gray-900",children:r})]})},z=()=>{var e,t;const{partnerId:s}=(0,r.g)(),[z]=(0,r.ok)(),L=z.get("token"),D=z.get("connected"),[M,T]=(0,a.useState)(!0),[E,F]=(0,a.useState)(null),[q,I]=(0,a.useState)(null),[O,U]=(0,a.useState)([]),[H,V]=(0,a.useState)({total:0,pending:0,count:0}),[B,J]=(0,a.useState)(null),[Y,Z]=(0,a.useState)(!1),[G,Q]=(0,a.useState)({page:1,limit:20,total:0,pages:1}),[W,K]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(""),[te,se]=(0,a.useState)(!1),[ae,re]=(0,a.useState)(!1);(0,a.useEffect)(()=>{s&&L?(ne(1),"true"===D&&(S.oR.success("Stripe account connected successfully!"),window.history.replaceState({},"",`/partner-portal/${s}?token=${L}`))):T(!1)},[s,L,D]);const ne=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{e>1&&K(!0);const t=await fetch(`${$}/api/v2/public/partners/${s}/portal?token=${L}&page=${e}&limit=20`);if(!t.ok){if(401===t.status)throw new Error("Invalid or expired link. Please request a new one.");throw new Error("Failed to load partner data")}const a=await t.json();I(a.partner),U(a.payouts||[]),V(a.stats||{total:0,pending:0,count:0}),J(a.links||null),a.pagination&&Q(a.pagination)}catch(t){F(t.message)}finally{T(!1),K(!1)}},ie=async e=>{e.preventDefault(),se(!0);try{const e=await fetch(`${$}/api/v2/public/partners/request-portal-link`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:X})});if(!e.ok){const t=await e.json();throw new Error(t.detail||"Failed to send login link")}re(!0),S.oR.success("Login link sent! Check your email.")}catch(t){S.oR.error(t.message)}finally{se(!1)}},le=(e,t,s)=>{const a=new Blob([e],{type:s}),r=URL.createObjectURL(a),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)};return s&&L?M?(0,A.jsx)("div",{className:"min-h-screen bg-white flex items-center justify-center",children:(0,A.jsx)(l.A,{className:"w-6 h-6 animate-spin text-blue-600"})}):E?(0,A.jsx)("div",{className:"min-h-screen bg-white flex items-center justify-center p-4","data-testid":"partner-error-page",children:(0,A.jsxs)(C,{className:"p-6 max-w-md w-full text-center",children:[(0,A.jsx)("div",{className:"w-12 h-12 bg-red-50 rounded-xl flex items-center justify-center mx-auto mb-4",children:(0,A.jsx)(n.A,{className:"w-6 h-6 text-red-600"})}),(0,A.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-1",children:"Access Error"}),(0,A.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:E}),(0,A.jsx)(N.$n,{onClick:()=>window.location.href="/partner-portal",className:"h-10 bg-blue-600 hover:bg-blue-700 text-white","data-testid":"request-new-link-btn",children:"Request New Link"})]})}):(0,A.jsxs)("div",{className:"min-h-screen bg-white","data-testid":"partner-portal",children:[(0,A.jsx)("header",{className:"bg-white",children:(0,A.jsx)("div",{className:"max-w-3xl mx-auto px-3 sm:px-4 py-3 sm:py-4",children:(0,A.jsxs)("div",{className:"flex items-center justify-between",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,A.jsx)("img",{src:"/logo-icon.png",alt:"BookingFlows",className:"w-8 h-8 sm:w-10 sm:h-10"}),(0,A.jsxs)("div",{children:[(0,A.jsx)("h1",{className:"text-base sm:text-lg font-semibold text-gray-900",children:"Partner Portal"}),(0,A.jsx)("p",{className:"text-xs text-gray-500",children:null===q||void 0===q?void 0:q.organization_name})]})]}),(0,A.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[(0,A.jsxs)("div",{className:"hidden sm:flex items-center gap-1.5 text-xs text-gray-500 bg-gray-100 px-2.5 py-1 rounded-full",children:[(0,A.jsx)(h.A,{className:"w-3.5 h-3.5"}),"View Only"]}),(0,A.jsx)(k.Ex,{className:"shadow-none "+("connected"===(null===q||void 0===q?void 0:q.status)||"active"===(null===q||void 0===q?void 0:q.status)?"bg-success-soft text-success-soft-foreground border-0":"bg-gray-100 text-gray-600 border-0"),children:null===q||void 0===q?void 0:q.status})]})]})})}),(0,A.jsxs)("main",{className:"max-w-3xl mx-auto px-3 sm:px-4 py-4 sm:py-6 space-y-4 sm:sp
2ace-y-6",children:[(0,A.jsxs)(C,{className:"p-5","data-testid":"partner-info-card",children:[(0,A.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,A.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:"Your Partnership"}),(0,A.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-400",children:[(0,A.jsx)(v.A,{className:"w-3.5 h-3.5"}),"Secure"]})]}),(0,A.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs text-gray-500 mb-0.5",children:"Name"}),(0,A.jsx)("p",{className:"text-sm font-medium text-gray-900",children:null===q||void 0===q?void 0:q.name})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs text-gray-500 mb-0.5",children:"Email"}),(0,A.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:null===q||void 0===q?void 0:q.email})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs text-gray-500 mb-0.5",children:"Type"}),(0,A.jsx)("p",{className:"text-sm font-medium text-gray-900 capitalize",children:null===q||void 0===q||null===(e=q.partner_type)||void 0===e?void 0:e.replace("_"," ")})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs text-gray-500 mb-0.5",children:"Revenue Share"}),(0,A.jsxs)("p",{className:"text-sm font-bold text-blue-600",children:[null===q||void 0===q?void 0:q.percentage,"%"]})]})]})]}),(0,A.jsxs)(C,{className:"p-5","data-testid":"stripe-status-card",children:[(0,A.jsx)("h2",{className:"text-base font-semibold text-gray-900 mb-4",children:"Payment Setup"}),null!==q&&void 0!==q&&q.stripe_onboarding_complete?(0,A.jsxs)("div",{className:"flex items-center justify-between p-4 bg-green-50 rounded-xl",children:[(0,A.jsxs)("div",{className:"flex items-center gap-3",children:[(0,A.jsx)(i.A,{className:"w-5 h-5 text-green-600"}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-sm font-medium text-green-800",children:"Stripe Connected"}),(0,A.jsx)("p",{className:"text-xs text-green-600",children:"Payouts will be sent automatically"})]})]}),(0,A.jsxs)("a",{href:"https://dashboard.stripe.com",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-green-700 hover:text-green-800 font-medium flex items-center gap-1","data-testid":"stripe-dashboard-link",children:["Stripe Dashboard",(0,A.jsx)(u.A,{className:"w-3 h-3"})]})]}):null!==q&&void 0!==q&&q.stripe_account_id?(0,A.jsxs)("div",{className:"space-y-4",children:[(0,A.jsx)("div",{className:"p-4 bg-blue-50 rounded-xl",children:(0,A.jsxs)("div",{className:"flex items-start gap-3",children:[(0,A.jsx)(d.A,{className:"w-5 h-5 text-blue-600 mt-0.5"}),(0,A.jsxs)("div",{className:"flex-1",children:[(0,A.jsx)("p",{className:"text-sm font-medium text-blue-800",children:"Stripe Verification in Progress"}),(0,A.jsx)("p",{className:"text-xs text-blue-600 mt-1",children:"Stripe is validating your account. This usually takes 1-5 minutes, but may take longer if additional information is needed."}),(0,A.jsx)("p",{className:"text-xs text-blue-500 mt-2",children:"You may need to provide ID verification or banking details in your Stripe dashboard."})]})]})}),(0,A.jsxs)("div",{className:"flex items-center gap-3",children:[(0,A.jsxs)(N.$n,{onClick:async()=>{Z(!0);try{var e;const a=await fetch(`${$}/api/v2/public/partners/${s}/stripe-dashboard-link?token=${L}`);if(!a.ok){const e=await a.json();throw new Error(e.detail||"Failed to check status")}const r=await a.json();if(r.is_fully_verified)S.oR.success("Stripe account is fully verified!"),await ne();else if(null!==(e=r.status)&&void 0!==e&&e.needs_more_info&&r.dashboard_url)S.oR.info(r.status.message),setTimeout(()=>{window.location.href=r.dashboard_url},1500);else{var t;S.oR.info((null===(t=r.status)||void 0===t?void 0:t.message)||"Stripe is still reviewing your account."),await ne()}}catch(a){S.oR.error(a.message||"Failed to check status")}finally{Z(!1)}},variant:"outline",className:"h-10 bg-white hover:bg-gray-50",disabled:Y,"data-testid":"check-status-btn",children:[Y?(0,A.jsx)(l.A,{className:"w-4 h-4 animate-spin mr-2"}):(0,A.jsx)(b.A,{className:"w-4 h-4 mr-2"}),"Check Status"]}),(0,A.jsxs)("a",{href:"https://dashboard.stripe.com",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-700 font-medium flex items-center gap-1",children:["Open Stripe Dashboard",(0,A.jsx)(u.A,{className:"w-3.5 h-3.5"})]})]})]}):(0,A.jsxs)("div",{className:"space-y-4",children:[(0,A.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-amber-50 rounded-xl",children:[(0,A.jsx)(d.A,{className:"w-5 h-5 text-amber-600"}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-sm font-medium text-amber-800",children:"Stripe Not Connected"}),(0,A.jsx)("p",{className:"text-xs text-amber-600",children:"Connect to receive your earnings"})]})]}),(0,A.jsxs)(N.$n,{onClick:async()=>{try{const e=await fetch(`${$}/api/v2/public/partners/${s}/connect-stripe?token=${L}`,{method:"POST"});if(!e.ok)throw new Error("Failed to create Stripe link");const t=await e.json();t.onboarding_url&&(window.location.href=t.onboarding_url)}catch(e){S.oR.error(e.message)}},className:"h-10 bg-blue-600 hover:bg-blue-700 text-white","data-testid":"connect-stripe-btn",children:[(0,A.jsx)(x.A,{className:"w-4 h-4 mr-2"}),"Connect Stripe Account"]})]})]}),B&&(0,A.jsxs)(C,{className:"p-5","data-testid":"links-card",children:[(0,A.jsx)("h2",{className:"text-base font-semibold text-gray-900 mb-4",children:"Your Referral Link"}),(0,A.jsx)("div",{className:"space-y-4",children:B.referral_url&&(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1.5",children:"Referral Link"}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsxs)("div",{className:"flex-1 flex items-center gap-2 bg-gray-50 rounded-lg px-3 py-2.5 min-w-0 overflow-hidden",children:[(0,A.jsx)(f.A,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),(0,A.jsx)("span",{className:"text-sm text-gray-700 truncate hidden sm:block",children:B.referral_url}),(0,A.jsx)("span",{className:"text-sm text-gray-700 truncate sm:hidden",children:B.referral_url.length>45?B.referral_url.slice(0,22)+"..."+B.referral_url.slice(-20):B.referral_url})]}),(0,A.jsx)(N.$n,{variant:"outline",className:"h-10 px-3 bg-white hover:bg-gray-50 flex-shrink-0",onClick:()=>
2{return e=B.referral_url,t="Referral link",navigator.clipboard.writeText(e),void S.oR.success(`${t} copied!`);var e,t},"data-testid":"copy-referral-link-btn",children:(0,A.jsx)(c.A,{className:"w-4 h-4"})})]}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1.5",children:"Share this link to track your referrals"})]})}),"revenue_partner"===(null===q||void 0===q?void 0:q.partner_type)&&(0,A.jsxs)("div",{className:"mt-5 pt-5 border-t border-gray-100",children:[(0,A.jsx)("p",{className:"text-xs font-medium text-gray-600 mb-2",children:q.apply_to_all_services?"You earn on ALL services":"You earn on these services:"}),!q.apply_to_all_services&&(null===(t=q.assigned_services)||void 0===t?void 0:t.length)>0&&(0,A.jsx)("div",{className:"flex flex-wrap gap-1.5",children:q.assigned_services.map((e,t)=>(0,A.jsx)(k.Ex,{className:"bg-primary-soft text-primary-soft-foreground border-0 text-xs shadow-none",children:e},t))})]})]}),(0,A.jsxs)("div",{className:"grid grid-cols-3 gap-2 sm:gap-4",children:[(0,A.jsx)(P,{icon:m.A,iconColor:"text-green-600",label:"Total Earned",value:R(H.total,null===q||void 0===q?void 0:q.currency),testId:"stat-total-earned"}),(0,A.jsx)(P,{icon:d.A,iconColor:"text-amber-500",label:"Awaiting Transfer",value:R(H.pending,null===q||void 0===q?void 0:q.currency),testId:"stat-pending"}),(0,A.jsx)(P,{icon:j.A,iconColor:"text-blue-600",label:"Referrals",value:H.count||0,testId:"stat-referrals"})]}),(0,A.jsxs)(C,{className:"overflow-hidden","data-testid":"payouts-table",children:[(0,A.jsxs)("div",{className:"p-5 flex items-center justify-between",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:"Payout History"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Payouts are transferred to your Stripe account after booking confirmation"})]}),O.length>0&&(0,A.jsxs)(_.rI,{children:[(0,A.jsx)(_.ty,{asChild:!0,children:(0,A.jsxs)(N.$n,{variant:"outline",className:"h-9 text-sm gap-2 bg-white hover:bg-gray-50",children:[(0,A.jsx)(p.A,{className:"w-4 h-4"}),"Export"]})}),(0,A.jsxs)(_.SQ,{align:"end",children:[(0,A.jsxs)(_._2,{onClick:()=>{if(0===O.length)return void S.oR.error("No data to export");const e=O.filter(e=>"completed"===e.status).reduce((e,t)=>e+(t.amount||0),0),t=`\n      <html><head><title>Partner Payout Report</title>\n      <style>\n        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; padding: 40px; color: #1a1a1a; }\n        h1 { font-size: 22px; margin-bottom: 4px; }\n        .subtitle { color: #666; font-size: 13px; margin-bottom: 30px; }\n        .summary { display: flex; gap: 24px; margin-bottom: 30px; }\n        .stat { background: #f9fafb; border-radius: 8px; padding: 16px 20px; }\n        .stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }\n        .stat-value { font-size: 20px; font-weight: 600; margin-top: 4px; }\n        table { width: 100%; border-collapse: collapse; font-size: 13px; }\n        th { text-align: left; padding: 10px 12px; background: #f3f4f6; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #666; }\n        td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }\n        .amount { text-align: right; font-weight: 600; }\n        .status-completed { color: #15803d; }\n        .status-failed { color: #dc2626; }\n        .status-pending { color: #d97706; }\n        .footer { margin-top: 30px; font-size: 11px; color: #999; border-top: 1px solid #eee; padding-top: 12px; }\n      </style></head><body>\n      <h1>Partner Payout Report</h1>\n      <p class="subtitle">${null===q||void 0===q?void 0:q.name} &bull; ${null===q||void 0===q?void 0:q.email} &bull; ${null===q||void 0===q?void 0:q.percentage}% Revenue Share</p>\n      <div class="summary">\n        <div class="stat"><div class="stat-label">Total Earned</div><div class="stat-value">${R(e,null===q||void 0===q?void 0:q.currency)}</div></div>\n        <div class="stat"><div class="stat-label">Referrals</div><div class="stat-value">${O.length}</div></div>\n      </div>\n      <table>\n        <thead><tr><th>
2Date & Time</th><th>Booking</th><th style="text-align:right">Amount</th><th>Status</th></tr></thead>\n        <tbody>\n          ${O.map(e=>`<tr>\n            <td>${new Date(e.created_at).toLocaleDateString()} ${new Date(e.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}</td>\n            <td>#${e.booking_confirmation_code}</td>\n            <td class="amount">${R(e.amount,null===q||void 0===q?void 0:q.currency)} (${e.percentage_applied}%)</td>\n            <td class="${"completed"===e.status?"status-completed":"transfer_failed"===e.status?"status-failed":"status-pending"}">${"completed"===e.status?"Transferred":"transfer_failed"===e.status?"Failed":"Pending"}</td>\n          </tr>`).join("")}\n        </tbody>\n      </table>\n      <div class="footer">Generated ${(new Date).toLocaleString()} &bull; Powered by BookingFlows</div>\n      </body></html>\n    `,s=window.open("","_blank");s.document.write(t),s.document.close(),s.onload=()=>{s.print()},S.oR.success("PDF ready to save")},className:"text-sm","data-testid":"export-pdf-btn",children:[(0,A.jsx)(g.A,{className:"w-4 h-4 mr-2"}),"Export as PDF"]}),(0,A.jsxs)(_._2,{onClick:()=>{if(0===O.length)return void S.oR.error("No data to export");const e=[["Date","Time","Booking Code","Amount","Percentage","Status"],...O.map(e=>[new Date(e.created_at).toLocaleDateString(),new Date(e.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),e.booking_confirmation_code,`"${R(e.amount,null===q||void 0===q?void 0:q.currency)}"`,`${e.percentage_applied}%`,e.status])].map(e=>e.join(",")).join("\n");le(e,`partner-payouts-${(new Date).toISOString().split("T")[0]}.csv`,"text/csv"),S.oR.success("CSV exported")},className:"text-sm","data-testid":"export-csv-btn",children:[(0,A.jsx)(g.A,{className:"w-4 h-4 mr-2"}),"Export as CSV"]}),(0,A.jsxs)(_._2,{onClick:()=>{if(0===O.length)return void S.oR.error("No data to export");const e={partner:{name:null===q||void 0===q?void 0:q.name,email:null===q||void 0===q?void 0:q.email,type:null===q||void 0===q?void 0:q.partner_type,percentage:null===q||void 0===q?void 0:q.percentage},stats:H,payouts:O.map(e=>({date:e.created_at,booking_code:e.booking_confirmation_code,amount:e.amount,percentage:e.percentage_applied,status:e.status})),exported_at:(new Date).toISOString()};le(JSON.stringify(e,null,2),`partner-payouts-${(new Date).toISOString().split("T")[0]}.json`,"application/json"),S.oR.success("JSON exported")},className:"text-sm","data-testid":"export-json-btn",children:[(0,A.jsx)(g.A,{className:"w-4 h-4 mr-2"}),"Export as JSON"]})]})]})]}),0===O.length?(0,A.jsxs)("div",{className:"px-5 pb-8 pt-4 text-center","data-testid":"empty-payouts",children:[(0,A.jsx)("div",{className:"w-12 h-12 bg-gray-100 rounded-xl flex items-center justify-center mx-auto mb-3",children:(0,A.jsx)(o.A,{className:"w-6 h-6 text-gray-400"})}),(0,A.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"No payouts yet"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Earnings will appear here once bookings are made through your links"}),"            "]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"overflow-x-auto",children:(0,A.jsxs)("table",{className:"w-full",children:[(0,A.jsx)("thead",{className:"bg-gray-50",children:(0,A.jsxs)("tr",{children:[(0,A.jsx)("th",{className:"px-3 sm:px-5 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date & Time"}),(0,A.jsx)("th",{className:"px-3 sm:px-5 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Booking"}),(0,A.jsx)("th",{className:"px-3 sm:px-5 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"}),(0,A.jsx)("th",{className:"px-3 sm:px-5 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"})]})}),(0,A.jsx)("tbody",{className:"divide-y divide-gray-100",children:O.map(e=>(0,A.jsxs)("tr",{className:"hover:bg-gray-50/50",children:[(0,A.jsxs)("td",{className:"px-3 sm:px-5 py-3 sm:py-4 text-sm text-gray-600",children:[(0,A.jsx)("div",{children:new Date(e.created_at).toLocaleDateString()}),(0,A.jsx)("div",{className:"text-xs text-gray-400",children:new Date(e.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),(0,A.jsxs)("td",{className:"px-3 sm:px-5 py-3 sm:py-4 text-xs sm:text-sm font-mono text-gray-900",children:["#",e.booking_confirmation_code]}),(0,A.jsxs)("td",{className:"px-3 sm:px-5 py-3 sm:py-4 text-sm text-gray-900 text-right",children:[(0,A.jsx)("span",{className:"font-semibold",children:R(e.amount,null===q||void 0===q?void 0:q.currency)}),(0,A.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:["(",e.percentage_applied,"%)"]})]}),(0,A.jsx)("td",{className:"px-3 sm:px-5 py-3 sm:py-4 text-center",children:(0,A.jsx)(k.Ex,{className:"shadow-none "+("completed"===e.status||"paid"===e.status?"bg-success-soft text-success-soft-foreground border-0 text-xs":"pending"===e.status?"bg-warning-soft text-warning-soft-foreground border-0 text-xs":"pending_str
2ipe"===e.status?"bg-primary-soft text-primary-soft-foreground border-0 text-xs":"transfer_failed"===e.status?"bg-warning-soft text-warning-soft-foreground border-0 text-xs":"bg-gray-100 text-gray-600 border-0 text-xs"),title:"pending"===e.status?"Funds are settling on the platform balance (\u22482 business days) \u2014 transferred automatically at the next daily settlement":"completed"===e.status?"Transferred to your Stripe account":"pending_stripe"===e.status?"Connect your Stripe account to receive this payout":"transfer_failed"===e.status?"Transfer will be retried automatically at the next daily settlement":"settled_offline"===e.status?"Paid to you outside Stripe":"",children:"pending"===e.status?"Settling":"completed"===e.status?"Transferred":"pending_stripe"===e.status?"Connect Stripe":"transfer_failed"===e.status?"Retrying":"settled_offline"===e.status?"Paid offline":e.status})})]},e.id))})]})}),G.pages>1&&(0,A.jsxs)("div",{className:"px-3 sm:px-5 py-3 border-t border-gray-100 flex items-center justify-between",children:[(0,A.jsxs)("span",{className:"text-xs text-gray-500",children:["Page ",G.page," of ",G.pages," (",G.total," payouts)"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(N.$n,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:G.page<=1||W,onClick:()=>ne(G.page-1),children:"Previous"}),(0,A.jsx)(N.$n,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:G.page>=G.pages||W,onClick:()=>ne(G.page+1),children:"Next"})]})]})]})]})]}),(0,A.jsx)("footer",{className:"max-w-3xl mx-auto px-4 py-8 text-center",children:(0,A.jsx)("p",{className:"text-xs text-gray-400",children:"Powered by BookingFlows"})})]}):(0,A.jsx)("div",{className:"min-h-screen bg-white flex items-center justify-center p-4","data-testid":"partner-login-page",children:(0,A.jsxs)(C,{className:"p-6 sm:p-8 max-w-md w-full",children:[(0,A.jsxs)("div",{className:"text-center mb-6",children:[(0,A.jsx)("img",{src:"/logo-icon.png",alt:"BookingFlows",className:"w-12 h-12 mx-auto mb-4"}),(0,A.jsx)("h1",{className:"dash-page-title",children:"Partner Portal"}),(0,A.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Enter your email to access your dashboard"})]}),ae?(0,A.jsxs)("div",{className:"text-center","data-testid":"magic-link-sent",children:[(0,A.jsx)("div",{className:"w-12 h-12 bg-green-50 rounded-xl flex items-center justify-center mx-auto mb-4",children:(0,A.jsx)(y.A,{className:"w-6 h-6 text-green-600"})}),(0,A.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-1",children:"Check your email"}),(0,A.jsxs)("p",{className:"text-sm text-gray-600",children:["We sent a login link to ",(0,A.jsx)("strong",{className:"text-gray-900",children:X})]}),(0,A.jsx)("button",{onClick:()=>re(!1),className:"mt-4 text-sm text-blue-600 hover:text-blue-700 font-medium","data-testid":"try-different-email-btn",children:"Try a different email"})]}):(0,A.jsxs)("form",{onSubmit:ie,className:"space-y-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsxs)("label",{className:"block text-sm font-medium text-gray-900 mb-1.5",children:["Partner Email ",(0,A.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,A.jsx)(w.p,{type:"email",value:X,onChange:e=>ee(e.target.value),placeholder:"[email protected]",required:!0,className:"h-10","data-testid":"partner-email-input"})]}),(0,A.jsx)(N.$n,{type:"submit",className:"w-full h-10 bg-blue-600 hover:bg-blue-700 text-white",disabled:te,"data-testid":"send-login-link-btn",children:te?(0,A.jsx)(l.A,{className:"w-4 h-4 animate-spin"}):"Send Login Link"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 text-center",children:"We'll email you a secure link to access your portal"})]})]})})};s.d(t,["default",0,z])},28646(e,t,s){const a=(0,s(31212).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);s.d(t,["A",0,a])},77819(e,t,s){const a=(0,s(31212).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);
2s.d(t,["A",0,a])},76833(e,t,s){const a=(0,s(31212).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);s.d(t,["A",0,a])},75088(e,t,s){const a=(0,s(31212).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);s.d(t,["A",0,a])},86376(e,t,s){const a=(0,s(31212).A)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);s.d(t,["A",0,a])},73062(e,t,s){const a=(0,s(31212).A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);s.d(t,["A",0,a])},7104(e,t,s){const a=(0,s(31212).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);s.d(t,["A",0,a])},70764(e,t,s){const a=(0,s(31212).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);s.d(t,["A",0,a])},35087(e,t,s){const a=(0,s(31212).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);s.d(t,["A",0,a])},41680(e,t,s){const a=(0,s(31212).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);s.d(t,["A",0,a])},25040(e,t,s){const a=(0,s(31212).A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);s.d(t,["A",0,a])},35327(e,t,s){const a=(0,s(31212).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);s.d(t,["A",0,a])},50516(e,t,s){const a=(0,s(31212).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);s.d(t,["A",0,a])},42489(e,t,s){const a=(0,s(31212).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);s.d(t,["A",0,a])},44919(e,t,s){const a=(0,s(31212).A)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);s.d(t,["A",0,a])}}]);
3//# sourceMappingURL=1356.169b9f03.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.