1import{r as l,j as e,J as F,_ as B,$,U as Se,b_ as Pe,K as L,a8 as C,I as b,T as we,B as x,a9 as me,Y as xe,bJ as pe,a7 as Oe,V as k,t as Ae,bf as Me,bR as oe,al as Te,am as De,an as le,bL as ze,l as Be,ap as ce,y as Fe,z as Le,D as ke,G as Ee,H as q,as as Q,at as je,P as de,av as Z,aw as ee,ax as se,ay as ie,ag as he,W as ue,F as $e,bg as He,bh as R,bi as G,bj as W,bk as _,bI as J,bl as Y,ae as Ue,az as Ve,a3 as ge,bF as ve}from"./index-M9vbWaAR.js";import{z as Re}from"./zod-resolver-compat-z4nTAUk2.js";import{a as Ie,b as Ge,c as We,d as _e,f as fe,e as ne,g as ye,u as Ne}from"./use-pricing-card-management-3B4kUyI9.js";import{a as Je}from"./schema-D9gO_jTS.js";import{S as qe}from"./save-CqCebU1d.js";import{B as Ke}from"./Breadcrumbs-T8gbmSyV.js";import{T as Xe,a as Ye,b as Ce,c as M,d as Qe,e as z}from"./table-DVMjlRkO.js";import{A as Ze,h as es,a as ss,b as is,c as as,d as rs,e as ts,f as ns,g as ls}from"./alert-dialog-Ct6-LbiJ.js";function be({card:r,sessionType:c,pricingSettings:S,onSave:N,onCancel:g}){const[v,P]=l.useState(r?.cardTitle||""),[w,f]=l.useState(r?.cardDescription||""),[p,A]=l.useState(r?.features||[]),[E,I]=l.useState(r?.ctaText||"Get Started"),[y,K]=l.useState(r?.ctaLink||"/consultation"),[T,d]=l.useState(r?.isPopular||!1),[O,H]=l.useState(r?.isActive!==!1),[U,X]=l.useState(r?.sortOrder||1),[u,i]=l.useState(r?.licenses?.map(s=>s.licenseType)||[]),n=Array.isArray(S)?S.filter(s=>s.isActive):[],t=(s,o)=>{i(o?h=>[...h,s]:h=>h.filter(D=>D!==s))},j=()=>{A(s=>[...s,""])},ae=s=>{A(o=>o.filter((h,D)=>D!==s))},re=(s,o)=>{A(h=>h.map((D,V)=>V===s?o:D))},te=()=>{const s={cardTitle:v,cardDescription:w,features:p.filter(o=>o.trim()!==""),ctaText:E,ctaLink:y,isPopular:T,isActive:O,sortOrder:U,sessionType:c,licenses:u};N(s)},a=()=>n.filter(s=>u.includes(s.licenseType)),m=()=>{const s=a();if(s.length===0)return"No pricing selected";const o=s.map(V=>c==="individual"?V.individualSessionPrice:V.couplesSessionPrice).map(V=>V/100),h=Math.min(...o),D=Math.max(...o);return h===D?`$${h.toFixed(0)}`:`$${h.toFixed(0)} - $${D.toFixed(0)}`};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(F,{children:[e.jsx(B,{children:e.jsxs($,{className:"flex items-center gap-2",children:[c==="individual"?e.jsx(Se,{className:"h-5 w-5"}):e.jsx(Pe,{className:"h-5 w-5"}),"Card Information"]})}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"cardTitle",children:"Card Title"}),e.jsx(b,{id:"cardTitle",value:v,onChange:s=>P(s.target.value),placeholder:"e.g., Licensed Mental Health Counselor"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"sortOrder",children:"Sort Order"}),e.jsx(b,{id:"sortOrder",type:"number",min:"1",value:U,onChange:s=>X(parseInt(s.target.value)||1)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"cardDescription",children:"Card Description"}),e.jsx(we,{id:"cardDescription",value:w,onChange:s=>f(s.target.value),placeholder:"Brief description of this pricing tier...",rows:3})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(C,{children:"Card Features"}),e.jsx(x,{type:"button",variant:"outline",size:"sm",onClick:j,children:"Add Feature"})]}),e.jsxs("div",{className:"space-y-2",children:[p.map((s,o)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{value:s,onChange:h=>re(o,h.target.value),placeholder:"Enter a feature (e.g., HIPAA compliant platform)"}),e.jsx(x,{type:"button",variant:"outline",size:"sm",onClick:()=>ae(o),children:e.jsx(me,{className:"h-4 w-4"})})]},o)),p.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:'No features added. Click "Add Feature" to add features for this pricing card.'})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"ctaText",children:"Call-to-Action Text"}),e.jsx(b,{id:"ctaText",value:E,onChange:s=>I(s.target.value),placeholder:"e.g., Get Started, Book Now, Schedule Consultation"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"ctaLink",children:"Call-to-Action Link"}),e.jsx(b,{id:"ctaLink",value:y,onChange:s=>K(s.target.value),placeholder:"e.g., /consultation, /booking, /contact"})]})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(xe,{id:"isPopular",checked:T,onCheckedChange:d}),e.jsxs(C,{htmlFor:"isPopular",className:"flex items-center gap-2",children:[e.jsx(pe,{className:"h-4 w-4"}),"Mark as Popular"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(xe,{id:"isActive",checked:O,onCheckedChange:H}),e.jsx(C,{htmlFor:"isActive",children:"Active"})]})]})]})]}),e.jsxs(F,{children:[e.jsxs(B,{children:[e.jsx($,{children:"License Types & Pricing"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select which license types should be included in this pricing card"})]}),e.jsx(L,{children:n.length>0?e.jsx("div",{className:"space-y-3",children:n.map(s=>{const o=c==="individual"?s.individualSessionPrice:s.couplesSessionPrice;return e.jsxs("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[e.jsx(Oe,{id:`license-${s.id}`,checked:u.includes(s.licenseType),onCheckedChange:h=>t(s.licenseType,h)}),e.jsxs("div",{className:"flex-1",children:[e.jsx(C,{htmlFor:`license-${s.id}`,className:"font-medium",children:s.licenseType}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description||"No description"})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"font-semibold",children:["$",(o/100).toFixed(0)]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[s.sessionDuration," min"]})]})]},s.id)})}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No active license types available. Create license type pricing first."})})]}),e.jsxs(F,{children:[e.jsxs(B,{children:[e.jsx($,{children:"Card Preview"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Preview how this card will appear on the pricing page"})]}),e.jsx(L,{children:e.jsxs("div",{className:"border rounded-lg p-6 bg-card relative",children:[T&&e.jsxs(k,{className:"absolute top-2 right-2",children:[e.jsx(pe,{className:"h-3 w-3 mr-1"}),"Popular"]}),e.jsxs("div",{className:"text-center mb-4",children:[e.jsx("div",{className:"text-3xl font-bold text-primary mb-1",children:m()}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["per ",c," session"]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"font-semibold",children:v||"Card Title"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:w||"Card description will appear here"}),u.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-sm font-medium",children:"Included License Types:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:u.map(s=>e.jsx(k,{variant:"secondary",className:"text-xs",children:s},s))})]})]}),e.jsx(x,{className:"w-full mt-4",disabled:!0,children:"Book Session"})]})})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsxs(x,{variant:"outline",onClick:g,children:[e.jsx(me,{className:"h-4 w-4 mr-2"}),"Cancel"]}),e.jsxs(x,{onClick:te,disabled:!v||u.length===0,children:[e.jsx(qe,{className:"h-4 w-4 mr-2"}),r?"Update Card":"Create Card"]})]})]})}const cs=Je,ds=cs.extend({individualSessionPrice:ve().min(0,"Price must be positive"),couplesSessionPrice:ve().min(0,"Price must be positive")}),os=()=>{const{toast:r}=Ae(),[c,S]=l.useState("individual"),[N,g]=l.useState(null),[v,P]=l.useState(!1),[w,f]=l.useState(!1),[p,A]=l.useState("all"),{data:E=[],isLoading:I,createCard:y,updateCard:K,deleteC
1ard:T}=Ne("individual"),{data:d=[],isLoading:O,createCard:H,updateCard:U,deleteCard:X}=Ne("couples"),{data:u=[]}=Ie(),i=Array.isArray(u)?u:[],n=a=>p==="all"?a:p==="active"?a.filter(m=>m.isActive):p==="inactive"?a.filter(m=>!m.isActive):a,t=n(Array.isArray(E)?E:[]),j=n(Array.isArray(d)?d:[]),ae=a=>{g(a),P(!0)},re=()=>{g(null),f(!0)},te=async(a,m)=>{try{m==="individual"?await T.mutateAsync({id:a,sessionType:m}):await X.mutateAsync({id:a,sessionType:m}),r({title:"Success",description:"Pricing card deleted successfully",variant:"default"})}catch(s){console.error("Error deleting card:",s),r({title:"Error",description:"Failed to delete pricing card",variant:"destructive"})}};return I||O?e.jsx("div",{className:"flex justify-center items-center h-48",children:e.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-primary border-t-transparent rounded-full"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Pricing Card Management"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Create and manage pricing card groupings that group multiple license types together"})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs(Fe,{value:p,onValueChange:a=>A(a),children:[e.jsx(Le,{className:"w-[160px]",children:e.jsx(ke,{placeholder:"Filter by status"})}),e.jsxs(Ee,{children:[e.jsx(q,{value:"all",children:"All Cards"}),e.jsx(q,{value:"active",children:"Active Only"}),e.jsx(q,{value:"inactive",children:"Inactive Only"})]})]})})]}),e.jsxs(Te,{value:c,onValueChange:S,className:"space-y-4",children:[e.jsxs(De,{children:[e.jsx(le,{value:"individual",children:"Individual Therapy"}),e.jsx(le,{value:"couples",children:"Couples Therapy"})]}),e.jsx(ce,{value:"individual",className:"space-y-4",children:e.jsxs(F,{children:[e.jsxs(B,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs($,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-5 w-5"}),"Individual Therapy Cards (",t.length,")"]}),e.jsx(ge,{children:"Manage pricing cards for individual therapy sessions"})]}),e.jsxs(x,{onClick:()=>{S("individual"),re()},children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),"Add Card"]})]}),e.jsx(L,{children:t.length>0?e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:t.map(a=>e.jsxs(F,{className:"relative",children:[e.jsxs(B,{children:[e.jsx($,{className:"text-base",children:a.cardTitle}),a.isPopular&&e.jsx(k,{className:"absolute top-2 right-2",children:"Popular"})]}),e.jsxs(L,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:a.cardDescription}),e.jsxs("div",{className:"text-sm mb-3",children:[e.jsxs("p",{children:["License types: ",a.licenses?.length||0]}),e.jsx(k,{variant:a.isActive?"default":"secondary",children:a.isActive?"Active":"Inactive"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>ae(a),children:[e.jsx(he,{className:"h-4 w-4 mr-1"}),"Edit"]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>te(a.id,"individual"),children:[e.jsx(ue,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]})]},a.id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No individual therapy pricing cards found"})})]})}),e.jsx(ce,{value:"couples",className:"space-y-4",children:e.jsxs(F,{children:[e.jsxs(B,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs($,{className:"flex items-center gap-2",children:[e.jsx(Pe,{className:"h-5 w-5"}),"Couples Therapy Cards (",j.length,")"]}),e.jsx(ge,{children:"Manage pricing cards for couples therapy sessions"})]}),e.jsxs(x,{onClick:()=>{S("couples"),re()},children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),"Add Card"]})]}),e.jsx(L,{children:j.length>0?e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:j.map(a=>e.jsxs(F,{className:"relative",children:[e.jsxs(B,{children:[e.jsx($,{className:"text-base",children:a.cardTitle}),a.isPopular&&e.jsx(k,{className:"absolute top-2 right-2",children:"Popular"})]}),e.jsxs(L,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:a.cardDescription}),e.jsxs("div",{className:"text-sm mb-3",children:[e.jsxs("p",{children:["License types: ",a.licenses?.length||0]}),e.jsx(k,{variant:a.isActive?"default":"secondary",children:a.isActive?"Active":"Inactive"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>ae(a),children:[e.jsx(he,{className:"h-4 w-4 mr-1"}),"Edit"]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>te(a.id,"couples"),children:[e.jsx(ue,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]})]},a.id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No couples therapy pricing cards foun
1d"})})]})})]}),e.jsx(Q,{open:v,onOpenChange:P,children:e.jsxs(Z,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ee,{children:[e.jsx(se,{children:N?"Edit Pricing Card":"Create Pricing Card"}),e.jsx(ie,{children:"Configure card information, pricing display, and license connections"})]}),e.jsx(be,{card:N,sessionType:c,pricingSettings:i,onSave:async a=>{try{N?(c==="individual"?await K.mutateAsync({id:N.id,data:a}):await U.mutateAsync({id:N.id,data:a}),r({title:"Success",description:"Pricing card updated successfully"})):(c==="individual"?await y.mutateAsync({...a,sessionType:"individual"}):await H.mutateAsync({...a,sessionType:"couples"}),r({title:"Success",description:"Pricing card created successfully"})),P(!1),g(null)}catch(m){console.error("Error saving card:",m),r({title:"Error",description:"Failed to save pricing card",variant:"destructive"})}},onCancel:()=>{P(!1),g(null)}})]})}),e.jsx(Q,{open:w,onOpenChange:f,children:e.jsxs(Z,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ee,{children:[e.jsx(se,{children:"Create New Pricing Card"}),e.jsxs(ie,{children:["Create a new pricing card for ",c," therapy sessions"]})]}
1),e.jsx(be,{card:null,sessionType:c,pricingSettings:i,onSave:async a=>{try{c==="individual"?await y.mutateAsync({...a,sessionType:"individual"}):await H.mutateAsync({...a,sessionType:"couples"}),r({title:"Success",description:"Pricing card created successfully"}),f(!1)}catch(m){console.error("Error creating card:",m),r({title:"Error",description:"Failed to create pricing card",variant:"destructive"})}},onCancel:()=>f(!1)})]})})]})};function fs(){const{toast:r}=Ae(),{data:c,isLoading:S,error:N}=Ie(),g=Ge(),v=We(),P=_e(),[w,f]=l.useState(!1),[p,A]=l.useState(null),[E,I]=l.useState(!1),[y,K]=l.useState("all"),T=Array.isArray(c)?c.filter(i=>y==="all"?!0:y==="active"?i.isActive:y==="inactive"?!i.isActive:!0):[],d=Me({resolver:Re(ds),defaultValues:{licenseType:"",individualSessionPrice:0,couplesSessionPrice:0,sessionDuration:50,description:"",isActive:!0}}),O=async i=>{try{const n={...i,individualSessionPrice:ne(i.individualSessionPrice),couplesSessionPrice:ne(i.couplesSessionPrice)};await g.mutateAsync(n),r({title:"Success",description:"Pricing settings created successfully",variant:"default"}),f(!1),d.reset()}catch(n){console.error("Error creating pricing:",n),r({title:"Error",description:"Failed to create pricing settings",variant:"destructive"})}},H=i=>{A(i),d.reset({licenseType:i.licenseType,individualSessionPrice:ye(i.individualSessionPrice),couplesSessionPrice:ye(i.couplesSessionPrice),sessionDuration:i.sessionDuration,description:i.description||"",isActive:i.isActive}),I(!0)},U=async i=>{if(p)try{const n={...i,individualSessionPrice:ne(i.individualSessionPrice),couplesSessionPrice:ne(i.couplesSessionPrice)};await v.mutateAsync({id:p.id,data:n}
1),r({title:"Success",description:"Pricing settings updated successfully",variant:"default"}),I(!1),A(null),d.reset()}catch(n){console.error("Error updating pricing:",n),r({title:"Error",description:"Failed to update pricing settings",variant:"destructive"})}},X=async(i,n)=>{try{await P.mutateAsync(i),r({title:"Success",description:`Pricing settings for ${n} deleted successfully`,variant:"default"})}catch(t){console.error("Error deleting pricing:",t),r({title:"Error",description:"Failed to delete pricing settings",variant:"destructive"})}};if(S)return e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"flex justify-center items-center h-48",children:e.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-primary border-t-transparent rounded-full"})})});if(N)return e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"bg-destructive/10 text-destructive p-4 rounded-md",children:"Error loading pricing settings. Please try again later."})});const u=({onSubmit:i,isEditing:n=!1})=>e.jsx(He,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(i),className:"space-y-6",children:[e.jsx(R,{control:d.control,name:"licenseType",render:({field:t})=>e.jsxs(G,{children:[e.jsx(W,{children:"License Type"}),e.jsx(_,{children:e.jsx(b,{placeholder:"e.g., LCSW, LMFT, LPC, PhD, PsyD",...t,disabled:n})}),e.jsx(J,{children:"The license type abbreviation (e.g., LCSW, LMFT, LPC)"}),e.jsx(Y,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(R,{control:d.control,name:"individualSessionPrice",render:({field:t})=>e.jsxs(G,{children:[e.jsx(W,{children:"Individual Session Price"}),e.jsx(_,{children:e.jsxs("div",{className:"relative",children:[e.jsx(oe,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(b,{type:"number",step:"0.01",min:"0",placeholder:"150.00",className:"pl-10",...t,onChange:j=>t.onChange(parseFloat(j.target.value)||0)})]})}),e.jsx(J,{children:"Price in dollars for individual therapy sessions"}),e.jsx(Y,{})]})}),e.jsx(R,{control:d.control,name:"couplesSessionPrice",render:({field:t})=>e.jsxs(G,{children:[e.jsx(W,{children:"Couples Session Price"}),e.jsx(_,{children:e.jsxs("div",{className:"relative",children:[e.jsx(oe,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(b,{type:"number",step:"0.01",min:"0",placeholder:"180.00",className:"pl-10",...t,onChange:j=>t.onChange(parseFloat(j.target.value)||0)})]})}),e.jsx(J,{children:"Price in dollars for couples therapy sessions"}),e.jsx(Y,{})]})})]}),e.jsx(R,{control:d.control,name:"sessionDuration",render:({field:t})=>e.jsxs(G,{children:[e.jsx(W,{children:"Session Duration"}),e.jsx(_,{children:e.jsxs("div",{className:"relative",children:[e.jsx(Ue,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(b,{type:"number",min:"1",placeholder:"50",className:"pl-10",...t,onChange:j=>t.onChange(parseInt(j.target.value)||50)})]})}),e.jsx(J,{children:"Session duration in minutes"}),e.jsx(Y,{})]})}),e.jsx(R,{control:d.control,name:"description",render:({field:t})=>e.jsxs(G,{children:[e.jsx(W,{children:"Description"}),e.jsx(_,{children:e.jsx(we,{placeholder:"Description of this license type...",...t,value:t.value||""})}),e.jsx(J,{children:"Optional description of the license type"}),e.jsx(Y,{})]})}),e.jsx(R,{control:d.control,name:"isActive",render:({field:t})=>e.jsxs(G,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(W,{className:"text-base",children:"Active"}),e.jsx(J,{children:"Enable this pricing configuration"})]}),e.jsx(_,{children:e.jsx(xe,{checked:t.value,onCheckedChange:t.onChange})})]})}),e.jsx(Ve,{children:e.jsx(x,{type:"submit",disabled:g.isPending||v.isPending,children:g.isPending||v.isPending?"Saving...":n?"Update":"Create"})})]})});return e.jsxs("div",{className:"p-6 pb-32",children:[e.jsx(Ke,{items:[{label:"Admin Dashboard",href:"/admin"},{label:"Pricing Management",href:"/admin/pricing"}]}),e.jsx("div",{className:"flex justify-between items-center mb-6",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center",children:[e.jsx(oe,{className:"h-6 w-6 mr-2"}),"Pricing Management"]}),e.jsx("p",{className:"text-muted-foreground",children:"Manage license types and pricing card groupings for therapy sessions"})]})}),e.jsxs(Te,{defaultValue:"license-types",className:"space-y-6",children:[e.jsxs(De,{className:"grid w-full grid-cols-2",children:[e.jsxs(le,{value:"license-types",className:"flex items-center gap-2",children:[e.jsx(ze,{className:"h-4 w-4"}),"License Type Pricing"]}),e.jsxs(le,{value:"pricing-cards",className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-4 w-4"}),"Pricing Card Management"]})]}),e.jsxs(ce,{value:"license-types",className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"License Type Pricing"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Configure individual and couples session pricing for different therapist license types"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(Fe,{value:y,onValueChange:i=>K(i),children:[e.jsx(Le,{className:"w-[160px]",children:e.jsx(ke,{placeholder:"Filter by status"})}),e.jsxs(Ee,{children:[e.jsx(q,{value:"all",children:"All Licenses"}),e.jsx(q,{value:"active",children:"Active Only"}),e.jsx(q,{value:"inactive",children:"Inactive Only"})]})]}),e.jsxs(Q,{open:w,onOpenChange:f,children:[e.jsx(je,{asChild:!0,children:e.jsxs(x,{children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),"Add License Type"]})}),e.jsxs(Z,{className:"max-w-2xl",children:[e.jsxs(ee,{children:[e.jsx(se,{children:"Create New Pricing Settings"}),e.jsx(ie,{children:"Add pricing configuration for a new license type."})]}),e.jsx(u,{onSubmit:O})]})]})]})]}),e.jsx(F,{children:e.jsx(L,{className:"p-0",children:T.length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(Xe,{children:[e.jsx(Ye,{children:e.jsxs(Ce,{children:[e.jsx(M,{children:"License Type"}),e.jsx(M,{children:"Individual Session"}),e.jsx(M,{children:"Couples Session"}),e.jsx(M,{children:"Duration"}),e.jsx(M,{children:"Status"}),e.jsx(M,{children:"Description"}),e.jsx(M,{className:"text-right",children:"Actions"})]})}),e.jsx(Qe,{children:T.map(i=>e.jsxs(Ce,{children:[e.jsx(z,{className:"font-medium",children:e.jsx(k,{variant:"outline",children:i.licenseType})}),e.jsx(z,{children:fe(i.individualSessionPrice)}),e.jsx(z,{children:fe(i.couplesSessionPrice)}),e.jsxs(z,{children:[i.sessionDuration," min"]}),e.jsx(z,{children:e.jsx(k,{variant:i.isActive?"default":"secondary",children:i.isActive?"Active":"Inactive"})}),e.jsx(z,{className:"max-w-xs truncate",children:i.description||"No description"}),e.jsx(z,{className:"text-right",children:e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>H(i),children:e.jsx(he,{className:"h-4 w-4"})}),e.jsxs(Ze,{children:[e.jsx(es,{asChild:!0,children:e.jsx(x,{variant:"outline",size:"sm",children:e.jsx(ue,{className:"h-4 w-4"})})}),e.jsxs(ss,{children:[e.jsxs(is,{children:[e.jsx(as,{children:"Delete Pricing Settings"}),e.jsxs(rs,{children:["Are you sure you want to delete pricing settings for ",i.licenseType,"? This action cannot be undone."]})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(ls,{onClick:()=>X(i.id,i.licenseType),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})})]},i.id))})]})}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx($e,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No pricing settings found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Create your first pricing configuration to get started"}),e.jsxs(Q,{open:w,onOpenChange:f,children:[e.jsx(je,{asChild:!0,children:e.jsxs(x,{children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),"Add License Type"]})}),e.jsxs(Z,{className:"max-w-2xl",children:[e.jsxs(ee,{children:[e.jsx(se,{children:"Create New Pricing Settings"}),e.jsx(ie,{children:"Add pricing configuration for a new license type."})]}),e.jsx(u,{onSubmit:O})]})]})]})})})]}),e.jsx(ce,{value:"pricing-cards",className:"space-y-6",children:e.jsx(os,{})})]}),e.jsx(Q,{open:E,onOpenChange:I,children:e.jsxs(Z,{className:"max-w-2xl",children:[e.jsxs(ee,{children:[e.jsx(se,{children:"Edit Pricing Settings"}),e.jsxs(ie,{children:["Update pricing configuration for ",p?.licenseType,"."]})]}),e.jsx(u,{onSubmit:U,isEditing:!0})]})})]})}export{fs as default};
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.