PageSourceSearch

https://app.fusehealth.com/_next/static/chunks/pages/products/[id]-new-3f1e2c3ce15e8a71.js

js fusehealth.com collected 2026-10-05 05:31:27 UTC 24,021 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c9e7e0f9-450b-4862-9698-a7bfaff32fb1",e._sentryDebugIdIdentifier="sentry-dbid-c9e7e0f9-450b-4862-9698-a7bfaff32fb1")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5181],{83602:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/[id]-new",function(){return s(77087)}])},88924:function(e,t,s){"use strict";s.d(t,{Z:function(){return S}});var a=s(651),n=s(92379),r=s(52062),i=s(36146),d=s(63484),l=s(57486),c=s(73332),o=s(52997),x=s(94979),u=s(43941),m=()=>{let{user:e,token:t,logout:s,overrideToken:r}=(0,c.a)(),[i,d]=(0,n.useState)(!1);if(!(null==e?void 0:e.impersonating))return null;let l=async()=>{d(!0);try{if((await fetch("".concat("https://api.fusehealth.com","/admin/exit-impersonation"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}})).ok){localStorage.removeItem("admin_token"),localStorage.removeItem("admin_user"),window.close(),s({message:"Impersonation session ended."});return}s({message:"Impersonation session ended."})}catch(e){s({message:"Impersonation session ended."})}finally{d(!1)}};return(0,a.jsxs)("div",{className:"bg-amber-500 text-white px-4 py-2 flex items-center justify-between text-sm font-medium z-50",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(o.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:"Impersonation Mode — You are viewing this account as a SuperAdmin. This session is audit-logged and attributed to you."})]}),(0,a.jsxs)("button",{onClick:l,disabled:i,className:"flex items-center gap-1.5 bg-white/20 hover:bg-white/30 text-white px-3 py-1 rounded-md transition-colors disabled:opacity-50",children:[i?(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(u.Z,{className:"h-3.5 w-3.5"}),"End Session"]})]})},p=s(54177),h=s(78311),f=s(81097),b=s(20728);let g="fuse:connectStripeBanner:dismissedUntil";var v=()=>{let e=(0,r.useRouter)(),{data:t,loading:s}=(0,b.J)(),[i,d]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{try{let e=window.localStorage.getItem(g);if(e){let t=parseInt(e,10);!Number.isNaN(t)&&t>Date.now()&&d(!0)}}catch(e){}},[]),s||!t||!t.onboardingCompleted||t.stripeConnectComplete||t.isDemo||e.pathname.startsWith("/onboarding")||i)?null:(0,a.jsxs)("div",{className:"bg-amber-50 border-b border-amber-200 px-4 py-2 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-amber-900",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4 flex-shrink-0"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{children:"Connect Stripe to start accepting payments."})," Patients can browse your products, but checkout is paused until you finish Stripe setup."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,a.jsxs)("button",{onClick:()=>{e.push("/onboarding")},className:"text-sm font-medium text-amber-700 hover:text-amber-900 flex items-center gap-1",children:["Connect Stripe",(0,a.jsx)(h.Z,{className:"h-3 w-3"})]}),(0,a.jsx)("button",{onClick:()=>{try{window.localStorage.setItem(g,String(Date.now()+864e5))}catch(e){}d(!0)},"aria-label":"Dismiss banner",className:"text-amber-700 hover:text-amber-900",children:(0,a.jsx)(f.Z,{className:"h-4 w-4"})})]})]})},j=s(78156),N=s(44565);let y=[{label:"Enroll in Growth",planType:"standard"},{label:"Enroll in Pro",planType:"premium"}];var w=()=>{let{trialExpired:e,isLoading:t}=(0,N.m)(),s=(0,r.useRouter)(),i=(0,n.useRef)(null);if((0,n.useEffect)(()=>{var t;if(!e)return;let s=i.current;if(!s)return;let a=Array.from(s.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));null===(t=a[0])||void 0===t||t.focus();let n=e=>{if("Tab"!==e.key||0===a.length)return;let t=a[0],s=a[a.length-1];e.shiftKey?document.activeElement===t&&(e.preventDefault(),s.focus()):document.activeElement===s&&(e.preventDefault(),t.focus())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),t||!e)return null;let d=e=>{localStorage.setItem("preselectedPlan",e),s.push("/plans")};return(0,a.jsx)("div",{ref:i,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm","aria-modal":"true",role:"dialog","aria-labelledby":"trial-expired-title",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md mx-4 p-10 flex flex-col items-center text-center",children:[(0,a.jsx)("div",{className:"mb-5 flex items-center justify-center w-14 h-14 roun
1ded-full bg-amber-50 border border-amber-100",children:(0,a.jsx)(j.Z,{className:"h-6 w-6 text-amber-500"})}),(0,a.jsx)("h2",{id:"trial-expired-title",className:"text-[22px] font-bold text-gray-900 tracking-tight mb-2",children:"Your trial has expired"}),(0,a.jsx)("p",{className:"text-[14px] text-gray-500 mb-8 leading-relaxed",children:"Choose a plan to continue using the platform. Your data and settings are saved."}),(0,a.jsx)("div",{className:"flex flex-col sm:flex-row gap-3 w-full",children:y.map(e=>{let{label:t,planType:s}=e;return(0,a.jsxs)("button",{onClick:()=>d(s),className:"premium"===s?"flex-1 flex items-center justify-center gap-2 px-5 py-3 rounded-xl text-[14px] font-semibold bg-violet-600 hover:bg-violet-700 text-white transition-colors shadow-sm":"flex-1 flex items-center justify-center gap-2 px-5 py-3 rounded-xl text-[14px] font-semibold bg-white border border-gray-200 hover:border-violet-300 hover:bg-violet-50 text-gray-800 transition-colors shadow-sm",children:[t,(0,a.jsx)(h.Z,{className:"h-4 w-4 shrink-0"})]},s)})})]})})},k=s(34268);function S(e){var t;let{children:s}=e,o=(0,r.useRouter)(),x="/programs"===o.pathname||o.pathname.startsWith("/programs/"),{user:u,isLoading:p}=(0,c.a)(),{data:h,loading:f}=(0,b.J)(),{data:g}=(0,k.f)(),[j,N]=(0,n.useState)(!1),y=(null==g?void 0:g.tutorialFinished)===!0||null!==(t=null==h?void 0:h.onboardingCompleted)&&void 0!==t&&t;return((0,n.useEffect)(()=>{p||f||!u||null===h||y||o.replace("/onboarding")},[p,f,u,h,y]),(0,n.useEffect)(()=>{let e=()=>N(!1);return o.events.on("routeChangeStart",e),()=>o.events.off("routeChangeStart",e)},[o]),p||f||null===h||y)?(0,a.jsxs)("div",{className:"flex min-h-screen h-screen bg-ds-bg overflow-hidden",children:[(0,a.jsx)(w,{}),(0,a.jsx)("div",{className:(0,i.cn)("fixed inset-0 z-[89] bg-[rgba(17,20,28,0.42)] transition-opacity duration-300 shell:hidden",j?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>N(!1)}),(0,a.jsx)("div",{className:(0,i.cn)("hidden shell:block flex-shrink-0 transition-[width] duration-200",x?"w-16":"w-[248px]"),"aria-hidden":"true"}),(0,a.jsx)("div",{className:(0,i.cn)("fixed inset-y-0 left-0 z-[95] transition-transform duration-300 ease-in-out","shell:translate-x-0",j?"translate-x-0 shadow-[24px_0_60px_rgba(17,20,28,0.25)]":"-translate-x-full"),children:(0,a.jsx)(d.Y,{mobileOpen:j,onNavigate:()=>N(!1)})}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[(0,a.jsx)(v,{}),(0,a.jsx)(m,{}),(0,a.jsx)(l.h,{onMenuToggle:()=>N(e=>!e)}),(0,a.jsx)("main",{className:"flex-1 overflow-y-auto overflow-x-auto",children:s})]})]}):null}},77087:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return y}});var a=s(651),n=s(92379),r=s(52062),i=s(66054),d=s.n(i),l=s(73332),c=s(88924),o=s(83720),x=s(10070),u=s(89681),m=s(77569),p=s(36641),h=s(45865),f=s(412);let b="rounded-ds border border-ds-border bg-ds-bg-raised shadow-ds-sm",g="flex flex-col space-y-1.5 border-b border-ds-border px-5 py-4",v="flex items-center gap-2 text-[13.5px] font-semibold tracking-[-0.1px] text-ds-fg",j="inline-flex items-center justify-center gap-1.5 rounded-ds-sm bg-ds-accent px-3 py-[7px] text-[12.5px] font-semibold text-white shadow-ds-primary transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",N="inline-flex items-center justify-center gap-1 rounded-ds-sm border border-ds-border bg-ds-bg-raised px-3 py-[7px] text-[12.5px] font-semibold text-ds-fg shadow-ds-sm transition-colors hover:bg-ds-bg-sunken disabled:cursor-not-allowed disabled:opacity-50";function y(){let[e,t]=(0,n.useState)(null),[s,i]=(0,n.useState)(!0),[y,w]=(0,n.useState)(null),[k,S]=(0,n.useState)([]),[P,C]=(0,n.useState)(null),[I,E]=(0,n.useState)(!1),[Z,_]=(0,n.use
1State)(""),[A,T]=(0,n.useState)(!1),[F,z]=(0,n.useState)([]),[D,O]=(0,n.useState)(null),[B,q]=(0,n.useState)({totalOrders:0,activeSubscribers:0}),{user:M,token:J}=(0,l.a)(),R=(0,r.useRouter)(),{id:L}=R.query;(0,n.useEffect)(()=>{(async()=>{if(J&&L)try{i(!0);let e=await fetch("".concat("https://api.fusehealth.com","/products/").concat(L),{headers:{Authorization:"Bearer ".concat(J)}});if(e.ok){let s=await e.json();s.success?t(s.data):w(s.message||"Failed to load product")}else w("Failed to load product")}catch(e){w("Failed to load product")}finally{i(!1)}})()},[J,L]),(0,n.useEffect)(()=>{(async()=>{if(J&&L&&M)try{let t=null==M?void 0:M.clinicId,[s,a,n,r]=await Promise.all([fetch("".concat("https://api.fusehealth.com","/tenant-products"),{headers:{Authorization:"Bearer ".concat(J)}}),fetch("".concat("https://api.fusehealth.com","/questionnaires/product/").concat(L),{headers:{Authorization:"Bearer ".concat(J)}}),fetch("".concat("https://api.fusehealth.com","/admin/forms/global-products?globalProductId=").concat(L),{headers:{Authorization:"Bearer ".concat(J)}}),t?fetch("".concat("https://api.fusehealth.com","/orders?clinicId=").concat(t),{headers:{Authorization:"Bearer ".concat(J)}}):Promise.resolve(null)]);if(s.ok){let e=(await s.json().then(e=>(null==e?void 0:e.data)||[])).find(e=>(null==e?void 0:e.productId)===L);C(e||null)}if(a.ok){let e=await a.json();S(Array.isArray(null==e?void 0:e.data)?e.data:[])}if(n.ok){let e=await n.json();z(Array.isArray(null==e?void 0:e.data)?e.data:[])}if(r&&r.ok){var e;let t=await r.json(),s=((null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.orders)||[]).filter(e=>{var t;return null===(t=e.orderItems)||void 0===t?void 0:t.some(e=>e.productId===L)});q({totalOrders:s.length,activeSubscribers:0})}}catch(e){console.error("Error fetching data:",e)}})()},[J,L,M]);let W=async()=>{if(!P||!J)return;let e=parseFloat(Z);if(isNaN(e)||e<=0){w("Please enter a valid price greater than $0");return}try{T(!0),w(null);let t=await fetch("".concat("https://api.fusehealth.com","/tenant-products/update"),{method:"POST",headers:{Authorization:"Bearer ".concat(J),"Content-Type":"application/json"},body:JSON.stringify({tenantProductId:P.id,price:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message||"Failed to update price")}let s=await t.json();if(s.success)C({...P,price:e}),E(!1),_(""),w("✅ Price updated successfully!"),setTimeout(()=>w(null),3e3);else throw Error(s.message||"Failed to update price")}catch(e){w(e.message||"Failed to update price")}finally{T(!1)}},Y=async e=>{if(J&&L){O(e);try{let t=await fetch("".concat("https://api.fusehealth.com","/admin/forms/global-products"),{method:"POST",headers:{Authorization:"Bearer ".concat(J),"Content-Type":"application/json"},body:JSON.stringify({globalProductId:L,questionnaireId:e})});if(!t.ok)throw Error("Failed to enable form");let s=await t.json();(null==s?void 0:s.data)&&(z(t=>[...t.filter(t=>(null==t?void 0:t.questionnaireId)!==e),s.data]),!P&&(await fetch("".concat("https://api.fusehealth.com","/tenant-products/update-selection"),{method:"POST",headers:{Authorization:"Bearer ".concat(J),"Content-Type":"application/json"},body:JSON.stringify({products:[{productId:L,questionnaireId:e}]})})).ok&&window.location.reload())}catch(e){w((null==e?void 0:e.message)||"Failed to enable form")}finally{O(null)}}},U=async e=>{if(J&&L)try{if(!(await fetch("".concat("https://api.fusehealth.com","/admin/forms/global-products"),{method:"DELETE",headers:{Authorization:"Bearer ".concat(J),"Content-Type":"application/json"},body:JSON.stringify({formId:e})})).ok)throw Error("Failed to disable form");z(t=>t.filter(t=>(null==t?void 0:t.id)!==e))}catch(e){w((null==e?void 0:e.message)||"Failed to disable form")}},X=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e);return s?(0,a.jsx)(c.Z,{children:(0,a.jsx)("div",{className:"min-h-full bg-ds-bg flex items-center justify-center py-32",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"w-8 h-8 border-4 border-ds-accent border-t-transparent rounded-full animate-spin mx-auto mb-4"}),(0,a.jsx)("p",{className:"text-[13px] text-ds-fg-muted",children:"Loading product..."})]})})}):y&&!e?(0,a.jsx)(c.Z,{children:(0,a.jsx)("div",{className:"min-h-full bg-ds-bg px-5 py-6 shell:px-8 shell:py-7",children:(0,a.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,a.jsxs)("button",{onClick:()=>R.push("/products"),className:"mb-6 inline-flex items-center gap-1.5 text-[12.5px] font-medium text-ds-fg-muted transition-colors hover:text-ds-fg",children:[(0,a.jsx)(o.Z,{className:"h-3.5 w-3.5"}),"Back to Products"]}),(0,a.jsxs)("div",{className:"".concat(b," p-12 text-center"),children:[(0,a.jsx)(x.Z,{className:"h-12 w-12 text-ds-danger mx-auto mb-4"}),(0,a.jsx)("h3",{className:"text-[15px] font-semibold text-ds-fg mb-2",children:"Product Not Found"}),(0,a.jsx)("p",{className:"text-[13px] text-ds-fg-muted",children:y})]})]})})}):(0,a.jsxs)(c.Z,{children:[(0,a.jsx)(d(),{children:(0,a.jsxs)("title",{children:[(null==e?void 0:e.name)||"Product"," - Fuse Admin"]})}),(0,a.jsx)("div",{className:"min-h-full bg-ds-bg px-5 py-6 shell:px-8 shell:py-7",children:(0,a.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,a.jsxs)("button",{onClick:()=>R.push("/products"),className:"mb-4 inline-flex items-center gap-1.5 text-[12.5px] font-medium text-ds-fg-muted transition-colors hover:text-ds-fg",children:[(0,a.jsx)(o.Z,{className:"h-3.5 w-3.5"}),"Back to Products"]}),(0,a.jsxs)("div",{className:"mb-[22px] flex items-end justify-between gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"m-0 text-2xl font-semibold tracking-[-0.4px] text-ds-fg",children:null==e?void 0:e.name}),(0,a.jsx)("p",{className:"mt-1 text-[13px] text-ds-fg-muted",children:null==e?void 0:e.description}),(null==e?void 0:e.placeholderSig)&&(0,a.jsxs)("p",{className:"mt-1 text-[13px] text-ds-fg-muted",children:["Placeholder Sig: ",e.placeholderSig]})]}),e&&(e.active?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-[3px] text-[10.5px] font-bold uppercase tracking-[0.5px] bg-ds-success-soft text-ds-success",children:[(0,a.jsx)("span",{className:"h-[5px] w-[5px] rounded-full bg-ds-success"}),"Active"]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-[3px] text-[10.5px] font-bold uppercase tracking-[0.5px] bg-ds-danger-soft text-ds-danger",children:[(0,a.jsx)("span",{className:"h-[5px] w-[5px] rounded-full bg-ds-danger"}),"Inactive"]}))]}),y&&(0,a.jsx)("div",{className:"mb-6 rounded-ds border px-4 py-3 ".concat(y.includes("✅")?"border-ds-success/40 bg-ds-success-soft":"border-ds-danger/40 bg-ds-danger-soft"),children:(0,a.jsx)("p",{className:"text-[13px] font-medium ".concat(y.includes("✅")?"text-ds-success":"text-ds-danger"),children:y})}),(0,a.jsxs)("div",{className:"".concat(b," mb-6"),children:[(0,a.jsx)("div",{className:g,children:(0,a.jsx)("h3",{className:v,children:"Pricing & Configuration"})}),(0,a.jsxs)("div",{className:"".concat("p-5"," space-y-6"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[10.5px] font-bold text-ds-fg-subtle uppercase tracking-[0.6px] mb-3",children:"Pricing"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"p-4 rounded-ds border border-ds-info/40 bg-ds-info-soft",children:[(0,a.jsx)("div",{className:"text-[11px] font-semibold text-ds-info mb-1",children:"Pharmacy Wholesale Cost"}),(0,a.jsx)("div",{className:"text-[11px] text-ds-fg-muted mb-2",children:"What you pay"}),(0,a.jsx)("div",{className:"text-[26px] font-semibold tracking-[-0.4px] tabular-nums text-ds-fg",children:(null==e?void 0:e.pharmacyPrice)?X(e.pharmacyPrice):"Not set"})]}),P?(0,a.jsxs)("div",{className:"p-4 rounded-ds border border-ds-success/40 bg-ds-success-soft",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("div",{className:"text-[11px] font-semibold text-ds-success",children:"Your Retail Price"}),!I&&(0,a.jsxs)("button",{className:"inline-flex h-6 items-center gap-1 rounded-ds-sm px-2 text-[11px] font-semibold text-ds-fg-muted transition-colors hover:bg-ds-bg-raised hover:text-ds-fg",onClick:()=>{E(!0),_(P.price.toString())},children:[(0,a.jsx)(u.Z,{className:"h-3 w-3 mr-1"}),"Edit"]})]}),(0,a.jsx)("div",{className:"text-[11px] text-ds-fg-muted mb-2",children:"What customers pay"}),I?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex gap-2 mb-2",children:(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-lg text-ds-fg-subtle",children:"$"}),(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:Z,onChange:e=>_(e.target.value),className:"w-full rounded-[10px] border border-ds-border bg-ds-bg-raised pl-8 pr-3 py-2 text-2xl font-bold tabular-nums text-ds-fg outline-none transition-shadow focus:border-ds-accent focus:shadow-[0_0_0_3px_var(--ds-accent-soft)]",autoF
1ocus:!0})]})}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:W,disabled:A,className:"flex-1 ".concat(j),children:A?"Saving...":"Save"}),(0,a.jsx)("button",{onClick:()=>{E(!1),_("")},disabled:A,className:N,children:"Cancel"})]}),(null==e?void 0:e.pharmacyPrice)&&(0,a.jsx)("div",{className:"text-[11px] text-ds-success mt-2",children:(()=>{let t=parseFloat(Z)||0,s=t-((null==e?void 0:e.pharmacyPrice)||0),a=t>0?s/t*100:0;return"Profit: ".concat(X(s)," (").concat(a.toFixed(1),"% margin)")})()})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[26px] font-semibold tracking-[-0.4px] tabular-nums text-ds-fg",children:X(P.price)}),(null==e?void 0:e.pharmacyPrice)&&(0,a.jsx)("div",{className:"text-[11px] text-ds-success mt-2",children:(()=>{let t=P.price,s=t-((null==e?void 0:e.pharmacyPrice)||0),a=t>0?s/t*100:0;return"Profit: ".concat(X(s)," per unit (").concat(a.toFixed(1),"% margin)")})()})]})]}):(0,a.jsx)("div",{className:"p-4 rounded-ds border border-ds-border bg-ds-bg-sunken flex items-center justify-center",children:(0,a.jsx)("p",{className:"text-[13px] text-ds-fg-muted text-center",children:"Enable this product to set custom pricing"})})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[10.5px] font-bold text-ds-fg-subtle uppercase tracking-[0.6px] mb-3",children:"Product Forms"}),0===k.length?(0,a.jsx)("div",{className:"p-4 rounded-ds border border-ds-border bg-ds-bg-sunken text-center",children:(0,a.jsx)("p",{className:"text-[13px] text-ds-fg-muted",children:"No forms available for this product"})}):(0,a.jsx)("div",{className:"space-y-3",children:k.map(e=>{let t=F.find(t=>(null==t?void 0:t.questionnaireId)===e.id);return(0,a.jsx)("div",{className:"p-4 rounded-ds border border-ds-border transition-colors hover:border-ds-border-strong",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("div",{className:"text-[13px] font-medium text-ds-fg",children:e.title}),(0,a.jsx)("div",{className:"text-[11px] text-ds-fg-subtle mt-0.5",children:e.formTemplateType||"Standard Form"})]}),t?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-[3px] text-[10.5px] font-bold uppercase tracking-[0.5px] bg-ds-success-soft text-ds-success",children:[(0,a.jsx)(m.Z,{className:"h-3 w-3"})," Enabled"]}),(0,a.jsx)("button",{onClick:()=>U(null==t?void 0:t.id),className:N,children:"Disable"})]}):(0,a.jsx)("button",{onClick:()=>Y(e.id),disabled:D===e.id,className:j,children:D===e.id?"Enabling...":"Enable for Clinic"})]})},e.id)})})]})]})]}),(0,a.jsxs)("div",{className:"".concat(b," mb-6"),children:[(0,a.jsx)("div",{className:g,children:(0,a.jsx)("h3",{className:v,children:"Product Performance"})}),(0,a.jsx)("div",{className:"p-5",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{className:"p-4 rounded-ds border border-ds-accent/40 bg-ds-accent-soft",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4 text-ds-accent"}),(0,a.jsx)("span",{className:"text-[10.5px] font-bold uppercase tracking-[0.6px] text-ds-accent",children:"Total Orders"})]}),(0,a.jsx)("div",{className:"text-[26px] font-semibold tracking-[-0.4px] tabular-nums text-ds-fg",children:B.totalOrders}),(0,a.jsx)("p",{className:"text-[11px] text-ds-fg-muted mt-1",children:"All-time orders for this product"})]}),(0,a.jsxs)("div",{className:"p-4 rounded-ds border border-ds-info/40 bg-ds-info-soft",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(h.Z,{className:"h-4 w-4 text-ds-info"}),(0,a.jsx)("span",{className:"text-[10.5px] font-bold uppercase tracking-[0.6px] text-ds-info",children:"Active Subscribers"})]}),(0,a.jsx)("div",{className:"text-[26px] font-semibold tracking-[-0.4px] tabular-nums text-ds-fg",children:B.activeSubscribers}),(0,a.jsx)("p",{className:"text-[11px] text-ds-fg-muted mt-1",children:"Customers with active subscriptions"})]})]})})]}),(0,a.jsxs)("div",{className:b,children:[(0,a.jsx)("div",{className:g,children:(0,a.jsx)("h3",{className:v,children:"Product Details"})}),(0,a.jsx)("div",{className:"p-5",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-[13px]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-ds-fg-muted",children:"Pharmacy Product ID:"}),(0,a.jsx)("p",{className:"font-medium text-ds-fg",children:(null==e?void 0:e.pharmacyProductId)||"Not assigned"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-ds-fg-muted",children:"Default Dosage:"}),(0,a.jsx)("p",{className:"font-medium text-ds-fg",children:(null==e?void 0:e.placeholderSig)||"N/A"})]}),(0,f.activeIngredientText)(null==e?void 0:e.activeIngredients)&&(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("span",{className:"text-ds-fg-muted",children:"Active Ingredients:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(0,f.activeIngredientLabels)(null==e?void 0:e.activeIngredients).map((e,t)=>(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-ds-border bg-ds-bg-sunken px-2 py-[2px] text-[11px] font-medium text-ds-fg-muted",children:e},t))})]})]})})]})]})})]})}},10070:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(69686).Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},52997:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(69686).Z)("ShieldAlert",[["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",ke
1y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},89681:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(69686).Z)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])}},function(e){e.O(0,[2789,727,9425,5599,4891,412,2888,9774,179],function(){return e(e.s=83602)}),_N_E=e.O()}]);

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.