@photonhealth/elements 0.16.11 → 0.16.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1002,7 +1002,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1002
1002
  }
1003
1003
  }
1004
1004
  }
1005
- `,pa=e=>(()=>{var t=eH(),r=t.firstChild,n=r.nextSibling;return E(r,b(xe,{size:"sm",color:"gray",get children(){return e.label}})),E(n,()=>e.children),t})(),aH=e=>{const[t,r,n]=e.split("-");return`${r}-${n}-${t}`};function oH(e){const t=ni(),[r,n]=H(void 0),i=async()=>{const{data:s}=await t.apollo.query({query:iH,variables:{id:e.patientId}});s?.patient&&n(s?.patient)};ge(()=>{e.patientId&&i()});const a=F(()=>e.address||r()?.address),o=F(()=>{if(r()?.phone){const s=JB(r()?.phone);return s.valid?s.number.national:r()?.phone}return""});return b(Fr,{addChildrenDivider:!0,get children(){return[(()=>{var s=tH();return E(s,b(xe,{color:"gray",children:"Patient Info"}),null),E(s,b(Z,{get when(){return e?.editPatient},get children(){return b(st,{variant:"secondary",size:"sm",get onClick(){return e?.editPatient},children:"Edit Patient"})}}),null),s})(),(()=>{var s=rH(),l=s.firstChild,d=l.firstChild,u=d.firstChild,c=d.nextSibling,h=c.firstChild;return E(s,b(xe,{size:"lg",bold:!0,get loading(){return!r()},sampleLoadingText:"Sally Patient",get children(){return r()?.name.full||"N/A"}}),l),E(u,b(pa,{label:"Email",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"fake@email.com",get children(){return r()?.email||"N/A"}})}}),null),E(u,b(pa,{label:"Phone",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"555-555-5555",get children(){return o()||"N/A"}})}}),null),E(u,b(pa,{label:"Address",get children(){return b(Z,{get when(){return!r()||a()},get fallback(){return nH()},get children(){return[(()=>{var f=m1();return E(f,b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"123 Fake St",get children(){return a()?.street1}})),f})(),b(Z,{get when(){return!r()||a()?.street2},get children(){var f=m1();return E(f,b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"Apt 3",get children(){return a()?.street2}})),f}}),(()=>{var f=m1();return E(f,b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"Brooklyn, NY 11221",get children(){return[F(()=>a()?.city),", ",F(()=>a()?.state)," ",F(()=>a()?.postalCode)]}})),f})()]}})}}),null),E(h,b(pa,{label:"DOB",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"female",get children(){return aH(r()?.dateOfBirth||"N/A")}})}}),null),E(h,b(pa,{label:"Weight",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"150 lbs",get children(){return e?.weight?`${e.weight} ${e.weightUnit}`:"N/A"}})}}),null),E(h,b(pa,{label:"Sex",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"female",get children(){return r()?.sex||"N/A"}})}}),null),E(h,b(pa,{label:"Gender",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"female",get children(){return r()?.gender||"N/A"}})}}),null),s})()]}})}var sH=x('<div class="group relative w-max"><span class="pointer-events-none absolute -bottom-8 left-0 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity group-hover:opacity-100">');function A6(e){return(()=>{var t=sH(),r=t.firstChild;return E(t,()=>e.children,r),E(r,()=>e.text),t})()}var lH=x('<button class="text-gray-700 hover:text-gray-900 hover:bg-blue-50 rounded-md p-2 disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-gray-700 disabled:cursor-not-allowed"type=button>');const dH=e=>{const t=qe({size:"md"},e),r=(()=>{var n=lH();return n.$$click=()=>{e.loading||e.onClick()},E(n,b(Z,{get when(){return!e.loading},get children(){return b(at,{get name(){return e.iconName},get size(){return t.iconSize}})}}),null),E(n,b(Z,{get when(){return e.loading},get children(){return b(ri,{get size(){return t.iconSize}})}}),null),X(i=>{var a=e.label,o=e.disabled;return a!==i.e&&ft(n,"aria-label",i.e=a),o!==i.t&&(n.disabled=i.t=o),i},{e:void 0,t:void 0}),n})();return F(()=>F(()=>!!e.disabled)()?r:b(A6,{get text(){return e.label},children:r}))};cn(["click"]);var uH=x('<div class="px-4 sm:px-6 py-3.5">Actions'),cH=x('<div class="px-4 sm:px-6 py-4 col-span-3 text-center">'),hH=x('<div class="grid w-full text-xs relative"><div><div class="px-4 sm:px-6 py-3.5">Medication</div><div class="px-4 sm:px-6 py-3.5 cursor-pointer flex">Written<div class=ml-1>'),fH=x('<div class="px-4 sm:px-6 py-4 truncate"><div class="flex-col flex-1 min-w-0 whitespace-normal"><div class="text-gray-500 text-ellipsis overflow-hidden">'),pH=x('<div class="px-4 sm:px-6 py-4 self-center">'),mH=x('<div class="px-4 sm:px-6 py-4 m-auto">'),g1=x('<div class="px-4 sm:px-6 py-4 select-none">'),gH=x('<div class="text-ellipsis overflow-hidden">'),vH=x('<a class="text-ellipsis block overflow-hidden text-blue-500 underline"target=_blank>');function yH(e){const t=Jq(),[r,n]=H(void 0),i=F(()=>e.enableRefillButton),a=F(()=>Zt("grid grid-cols-subgrid border-b text-xs font-semibold text-gray-900 sticky top-0 bg-white z-10",{"col-span-3":i(),"col-span-2":!i()})),o=async(s,l)=>{if(r()===void 0){if(n(s.id),!t)throw new Error("Refill requires <PrescribeProvider>");try{await t.tryCreatePrescription({...s,treatment:l,effectiveDate:Df(new Date,"yyyy-MM-dd").toString(),diagnoseCodes:s.diagnoses?.map(d=>d.code)||[]})}finally{n(void 0)}}};return(()=>{var s=hH(),l=s.firstChild,d=l.firstChild,u=d.nextSibling,c=u.firstChild,h=c.nextSibling;return u.$$click=()=>e.onSortOrderToggle(),E(h,b(Z,{get when(){return e.sortOrder==="desc"},get children(){return b(at,{name:"chevronDown",size:"sm"})}}),null),E(h,b(Z,{get when(){return e.sortOrder==="asc"},get children(){return b(at,{name:"chevronUp",size:"sm"})}}),null),E(l,b(Z,{get when(){return e.enableRefillButton},get children(){return uH()}}),null),E(s,b(Z,{get when(){return!e.isLoading&&e.rowItems},get fallback(){return[b(v1,{get enableRefill(){return e.enableRefillButton}}),b(v1,{get enableRefill(){return e.enableRefillButton}}),b(v1,{get enableRefill(){return e.enableRefillButton}})]},get children(){return b(wt,{get each(){return e.rowItems},children:f=>[(()=>{var p=fH(),v=p.firstChild,m=v.firstChild;return E(v,b($H,{get treatmentName(){return f.treatment.name},get prescriptionId(){return f.prescription?.id},get enableLinks(){return e.enableLinks},get linkBaseUrl(){return e.baseURL}}),m),E(m,()=>KW(f.prescription)),p})(),(()=>{var p=pH();return E(p,()=>bH(f)),p})(),b(Z,{get when(){return e.enableRefillButton},get children(){var p=mH();return E(p,b(dH,{iconName:"documentPlus",iconSize:"sm",label:"Refill",onClick:()=>{f.prescription&&o(f.prescription,f.treatment)},get disabled(){return!f.prescription},get loading(){return r()===f.prescription?.id}})),p}})]})}}),null),E(s,b(Z,{get when(){return!e.isLoading&&e.rowItems&&e.rowItems.length===0},get children(){var f=cH();return E(f,b(xe,{color:"gray",children:"No medication history found."})),f}}),null),X(f=>{var p=`1fr min-content ${i()?"min-content":""}`,v=a();return p!==f.e&&((f.e=p)!=null?s.style.setProperty("grid-template-columns",p):s.style.removeProperty("grid-template-columns")),v!==f.t&&ot(l,f.t=v),f},{e:void 0,t:void 0}),s})()}const v1=e=>[(()=>{var t=g1();return E(t,b(xe,{get sampleLoadingText(){return YW(10,25)},loading:!0})),t})(),(()=>{var t=g1();return E(t,b(xe,{sampleLoadingText:"aaaaa",loading:!0})),t})(),b(Z,{get when(){return e.enableRefill},get children(){var t=g1();return E(t,b(xe,{sampleLoadingText:"aaa",loading:!0})),t}})];function bH(e){return e.prescription?F6(e.prescription?.writtenAt)||"N/A":"External"}const $H=e=>{const t=F(()=>e.enableLinks&&!!e.prescriptionId);return[b(Z,{get when(){return!t()},get children(){var r=gH();return E(r,()=>e.treatmentName),r}}),b(Z,{get when(){return t()},get children(){var r=vH();return E(r,()=>e.treatmentName),X(()=>ft(r,"href",`${e.linkBaseUrl}${e.prescriptionId}`)),r}})]};cn(["click"]);var wH=x('<div class="flex items-center justify-between px-4 py-3 sm:px-6 sm:py-4">'),xH=x('<div class="max-h-80 overflow-y-auto">');const Jd=Ve`
1005
+ `,pa=e=>(()=>{var t=eH(),r=t.firstChild,n=r.nextSibling;return E(r,b(xe,{size:"sm",color:"gray",get children(){return e.label}})),E(n,()=>e.children),t})(),aH=e=>{const[t,r,n]=e.split("-");return`${r}-${n}-${t}`};function oH(e){const t=ni(),[r,n]=H(void 0),i=async()=>{const{data:s}=await t.apollo.query({query:iH,variables:{id:e.patientId}});s?.patient&&n(s?.patient)};ge(()=>{e.patientId&&i()});const a=F(()=>e.address||r()?.address),o=F(()=>{if(r()?.phone){const s=JB(r()?.phone);return s.valid?s.number.national:r()?.phone}return""});return b(Fr,{addChildrenDivider:!0,get children(){return[(()=>{var s=tH();return E(s,b(xe,{color:"gray",children:"Patient Info"}),null),E(s,b(Z,{get when(){return e?.editPatient},get children(){return b(st,{variant:"secondary",size:"sm",get onClick(){return e?.editPatient},children:"Edit Patient"})}}),null),s})(),(()=>{var s=rH(),l=s.firstChild,d=l.firstChild,u=d.firstChild,c=d.nextSibling,h=c.firstChild;return E(s,b(xe,{size:"lg",bold:!0,get loading(){return!r()},sampleLoadingText:"Sally Patient",get children(){return r()?.name.full||"N/A"}}),l),E(u,b(pa,{label:"Email",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"fake@email.com",get children(){return r()?.email||"N/A"}})}}),null),E(u,b(pa,{label:"Phone",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"555-555-5555",get children(){return o()||"N/A"}})}}),null),E(u,b(pa,{label:"Address",get children(){return b(Z,{get when(){return!r()||a()},get fallback(){return nH()},get children(){return[(()=>{var f=m1();return E(f,b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"123 Fake St",get children(){return a()?.street1}})),f})(),b(Z,{get when(){return!r()||a()?.street2},get children(){var f=m1();return E(f,b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"Apt 3",get children(){return a()?.street2}})),f}}),(()=>{var f=m1();return E(f,b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"Brooklyn, NY 11221",get children(){return[F(()=>a()?.city),", ",F(()=>a()?.state)," ",F(()=>a()?.postalCode)]}})),f})()]}})}}),null),E(h,b(pa,{label:"DOB",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"female",get children(){return aH(r()?.dateOfBirth||"N/A")}})}}),null),E(h,b(pa,{label:"Weight",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"150 lbs",get children(){return e?.weight?`${e.weight} ${e.weightUnit}`:"N/A"}})}}),null),E(h,b(pa,{label:"Sex",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"female",get children(){return r()?.sex||"N/A"}})}}),null),E(h,b(pa,{label:"Gender",get children(){return b(xe,{size:"sm",get loading(){return!r()},sampleLoadingText:"female",get children(){return r()?.gender||"N/A"}})}}),null),s})()]}})}var sH=x('<div class="group relative w-max"><span class="pointer-events-none absolute -bottom-8 left-0 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity group-hover:opacity-100">');function A6(e){return(()=>{var t=sH(),r=t.firstChild;return E(t,()=>e.children,r),E(r,()=>e.text),t})()}var lH=x('<button class="text-gray-700 hover:text-gray-900 hover:bg-blue-50 rounded-md p-2 disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-gray-700 disabled:cursor-not-allowed"type=button>');const dH=e=>{const t=qe({size:"md"},e),r=(()=>{var n=lH();return n.$$click=()=>{e.loading||e.onClick()},E(n,b(Z,{get when(){return!e.loading},get children(){return b(at,{get name(){return e.iconName},get size(){return t.iconSize}})}}),null),E(n,b(Z,{get when(){return e.loading},get children(){return b(ri,{get size(){return t.iconSize}})}}),null),X(i=>{var a=e.label,o=e.disabled;return a!==i.e&&ft(n,"aria-label",i.e=a),o!==i.t&&(n.disabled=i.t=o),i},{e:void 0,t:void 0}),n})();return F(()=>F(()=>!!e.disabled)()?r:b(A6,{get text(){return e.label},children:r}))};cn(["click"]);var uH=x('<div class="px-4 sm:px-6 py-3.5">Actions'),cH=x('<div class="px-4 sm:px-6 py-4 col-span-3 text-center">'),hH=x('<div class="grid w-full text-xs relative"><div><div class="px-4 sm:px-6 py-3.5">Medication</div><div class="px-4 sm:px-6 py-3.5 cursor-pointer flex">Written<div class=ml-1>'),fH=x('<div class="px-4 sm:px-6 py-4 truncate"><div class="flex-col flex-1 min-w-0 whitespace-normal"><div class="text-gray-500 text-ellipsis overflow-hidden">'),pH=x('<div class="px-4 sm:px-6 py-4 self-center">'),mH=x('<div class="px-4 sm:px-6 py-4 m-auto">'),g1=x('<div class="px-4 sm:px-6 py-4 select-none">'),gH=x('<div class="text-ellipsis overflow-hidden">'),vH=x('<a class="text-ellipsis block overflow-hidden text-blue-500 underline"target=_blank>');function yH(e){const t=Jq(),[r,n]=H(void 0),i=F(()=>e.enableRefillButton),a=F(()=>Zt("grid grid-cols-subgrid border-b text-xs font-semibold text-gray-900 sticky top-0 bg-white z-10",{"col-span-3":i(),"col-span-2":!i()})),o=async(s,l)=>{if(r()===void 0){if(n(s.id),!t)throw new Error("Refill requires <PrescribeProvider>");try{await t.tryCreatePrescription({...s,treatment:l,effectiveDate:Df(new Date,"yyyy-MM-dd").toString(),diagnoseCodes:s.diagnoses?.map(d=>d.code)||[]})}finally{n(void 0)}}};return(()=>{var s=hH(),l=s.firstChild,d=l.firstChild,u=d.nextSibling,c=u.firstChild,h=c.nextSibling;return u.$$click=()=>e.onSortOrderToggle(),E(h,b(Z,{get when(){return e.sortOrder==="desc"},get children(){return b(at,{name:"chevronDown",size:"sm"})}}),null),E(h,b(Z,{get when(){return e.sortOrder==="asc"},get children(){return b(at,{name:"chevronUp",size:"sm"})}}),null),E(l,b(Z,{get when(){return e.enableRefillButton},get children(){return uH()}}),null),E(s,b(Z,{get when(){return!e.isLoading&&e.rowItems},get fallback(){return[b(v1,{get enableRefill(){return e.enableRefillButton}}),b(v1,{get enableRefill(){return e.enableRefillButton}}),b(v1,{get enableRefill(){return e.enableRefillButton}})]},get children(){return b(wt,{get each(){return e.rowItems},children:f=>[(()=>{var p=fH(),v=p.firstChild,m=v.firstChild;return E(v,b($H,{get treatmentName(){return f.treatment.name},get prescriptionId(){return f.prescription?.id},get enableLinks(){return e.enableLinks},get linkBaseUrl(){return e.baseURL}}),m),E(m,()=>KW(f.prescription)),p})(),(()=>{var p=pH();return E(p,()=>bH(f)),p})(),b(Z,{get when(){return e.enableRefillButton},get children(){var p=mH();return E(p,b(dH,{iconName:"documentPlus",iconSize:"sm",label:"Refill",onClick:()=>{f.prescription&&o(f.prescription,f.treatment)},get disabled(){return!f.prescription},get loading(){return F(()=>!!f.prescription)()&&r()===f.prescription.id}})),p}})]})}}),null),E(s,b(Z,{get when(){return!e.isLoading&&e.rowItems&&e.rowItems.length===0},get children(){var f=cH();return E(f,b(xe,{color:"gray",children:"No medication history found."})),f}}),null),X(f=>{var p=`1fr min-content ${i()?"min-content":""}`,v=a();return p!==f.e&&((f.e=p)!=null?s.style.setProperty("grid-template-columns",p):s.style.removeProperty("grid-template-columns")),v!==f.t&&ot(l,f.t=v),f},{e:void 0,t:void 0}),s})()}const v1=e=>[(()=>{var t=g1();return E(t,b(xe,{get sampleLoadingText(){return YW(10,25)},loading:!0})),t})(),(()=>{var t=g1();return E(t,b(xe,{sampleLoadingText:"aaaaa",loading:!0})),t})(),b(Z,{get when(){return e.enableRefill},get children(){var t=g1();return E(t,b(xe,{sampleLoadingText:"aaa",loading:!0})),t}})];function bH(e){return e.prescription?F6(e.prescription?.writtenAt)||"N/A":"External"}const $H=e=>{const t=F(()=>e.enableLinks&&!!e.prescriptionId);return[b(Z,{get when(){return!t()},get children(){var r=gH();return E(r,()=>e.treatmentName),r}}),b(Z,{get when(){return t()},get children(){var r=vH();return E(r,()=>e.treatmentName),X(()=>ft(r,"href",`${e.linkBaseUrl}${e.prescriptionId}`)),r}})]};cn(["click"]);var wH=x('<div class="flex items-center justify-between px-4 py-3 sm:px-6 sm:py-4">'),xH=x('<div class="max-h-80 overflow-y-auto">');const Jd=Ve`
1006
1006
  query GetPatient($id: ID!) {
1007
1007
  patient(id: $id) {
1008
1008
  id
@@ -1421,7 +1421,7 @@ Description:
1421
1421
  }
1422
1422
  }
1423
1423
  }
1424
- `,cQ={CatalogTreatmentsFieldsComponentFragment:uQ};class hQ{sdk;setStore;store;authentication;getSDK;clinical;autoLogin;constructor(t,r=!1){this.sdk=t,this.autoLogin=r;const[n,i]=la({authentication:{isAuthenticated:!1,isInOrg:!1,permissions:[],isLoading:!0,error:void 0,user:void 0},catalog:{isLoading:!1,treatments:[],templates:[]},catalogs:{isLoading:!1,catalogs:[]},dispenseUnits:{isLoading:!1,dispenseUnits:new Array},patients:{isLoading:!1,patients:[],finished:!1},patient:{isLoading:!1,patient:void 0},prescription:{isLoading:!1,errors:[],error:void 0,data:void 0}});this.setStore=i,this.store=n,this.authentication={state:n.authentication,handleRedirect:async a=>{try{const o=await this.sdk.authentication.handleRedirect(a);dQ(o?.appState),await this.authentication.checkSession()}catch(o){const s=new URLSearchParams(window.location.search).get("error_description");o.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):s?.includes("is not part of the org")?this.setStore("authentication",{...this.store.authentication,error:"User is not authorized",isLoading:!1}):this.setStore("authentication",{...this.store.authentication,error:o.message})}},checkSession:this.checkSession.bind(this),login:this.login.bind(this),logout:this.logout.bind(this)},this.getSDK=this._getSDK.bind(this),this.clinical={catalog:{state:n.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:n.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:n.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:n.patients,getPatients:this.getPatients.bind(this)},patient:{state:n.patient,getPatient:this.getPatient.bind(this)},prescription:{state:n.prescription,createPrescription:this.createPrescription.bind(this)}}}_getSDK(){return this.sdk}async checkSession(){try{await this.sdk.authentication.checkSession();const t=await this.sdk.authentication.isAuthenticated();this.setStore("authentication",{...this.store.authentication,isAuthenticated:t});const r=await this.sdk.authentication.getUser(),n=!!this.sdk?.organization&&!!r?.org_id;let i=[];if(this.autoLogin||t)try{const o=await this.sdk.authentication.getAccessToken();i=lQ(o)?.permissions||[]}catch{i=[]}const a=t&&n&&this.sdk.organization===r.org_id;this.setStore("authentication",{...this.store.authentication,user:r,isLoading:!1,isInOrg:a,permissions:i||[]})}catch{this.setStore("authentication",{...this.store.authentication,isLoading:!1})}}async login(t={}){await this.sdk.authentication.login(t),await this.checkSession()}async logout(t={}){await this.sdk.authentication.logout(t),this.setStore("authentication",{...this.store.authentication,isAuthenticated:!1,isInOrg:!1,permissions:[],user:void 0})}async getPatients(t){t||(t={}),this.setStore("patients",{...this.store.patients,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?r.patients:this.store.patients.patients.concat(r.patients),finished:r.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:r.patient}),r.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:r}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:cQ});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:r.catalog.treatments.map(n=>n)||[],templates:r.catalog.templates.map(n=>n)||[]})}async getCatalogs(){this.setStore("catalogs",{...this.store.catalogs,isLoading:!0});const{data:t}=await this.sdk.clinical.catalog.getCatalogs();this.setStore("catalogs",{...this.store.catalogs,isLoading:!1,catalogs:t.catalogs})}async getDispenseUnits(){this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!0});const{data:t}=await this.sdk.clinical.prescription.getDispenseUnits();this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!1,dispenseUnits:t.dispenseUnits.map((r,n)=>({id:String(n),...r}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const r=this.sdk.clinical.prescription.createPrescription({});try{const{data:n,errors:i}=await r({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),n?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:n.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:n,errors:i}}catch(n){return this.setStore("prescription",{...this.store.prescription,error:n,isLoading:!1}),{data:null,errors:[]}}}}const fQ=(e,t,r)=>{const n=r(e,t);return Er(()=>clearInterval(n))},q6="%[a-f0-9]{2}",bg=new RegExp("("+q6+")|([^%]+?)","gi"),$g=new RegExp("("+q6+")+","gi");function Ch(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],Ch(r),Ch(n))}function pQ(e){try{return decodeURIComponent(e)}catch{let t=e.match(bg)||[];for(let r=1;r<t.length;r++)e=Ch(t,r).join(""),t=e.match(bg)||[];return e}}function mQ(e){const t={"%FE%FF":"��","%FF%FE":"��"};let r=$g.exec(e);for(;r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{const i=pQ(r[0]);i!==r[0]&&(t[r[0]]=i)}r=$g.exec(e)}t["%C2"]="�";const n=Object.keys(t);for(const i of n)e=e.replace(new RegExp(i,"g"),t[i]);return e}function gQ(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return mQ(e)}}function vQ(e,t){const r={};if(Array.isArray(t))for(const n of t){const i=Object.getOwnPropertyDescriptor(e,n);i?.enumerable&&Object.defineProperty(r,n,i)}else for(const n of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,n);if(i.enumerable){const a=e[n];t(n,a,e)&&Object.defineProperty(r,n,i)}}return r}function B6(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const r=e.indexOf(t);return r===-1?[]:[e.slice(0,r),e.slice(r+t.length)]}const yQ=e=>e==null,bQ=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Sh=Symbol("encodeFragmentIdentifier");function $Q(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Jt(t,e),"[",i,"]"].join("")]:[...r,[Jt(t,e),"[",Jt(i,e),"]=",Jt(n,e)].join("")]};case"bracket":return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Jt(t,e),"[]"].join("")]:[...r,[Jt(t,e),"[]=",Jt(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Jt(t,e),":list="].join("")]:[...r,[Jt(t,e),":list=",Jt(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Jt(r,e),t,Jt(i,e)].join("")]:[[n,Jt(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,Jt(t,e)]:[...r,[Jt(t,e),"=",Jt(n,e)].join("")]}}function wQ(e){let t;switch(e.arrayFormat){case"index":return(r,n,i)=>{if(t=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!t){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][t[1]]=n};case"bracket":return(r,n,i)=>{if(t=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!t){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(t=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!t){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const a=typeof n=="string"&&n.includes(e.arrayFormatSeparator),o=typeof n=="string"&&!a&&mi(n,e).includes(e.arrayFormatSeparator);n=o?mi(n,e):n;const s=a||o?n.split(e.arrayFormatSeparator).map(l=>mi(l,e)):n===null?n:mi(n,e);i[r]=s};case"bracket-separator":return(r,n,i)=>{const a=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!a){i[r]=n&&mi(n,e);return}const o=n===null?[]:mi(n,e).split(e.arrayFormatSeparator);if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function H6(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Jt(e,t){return t.encode?t.strict?bQ(e):encodeURIComponent(e):e}function mi(e,t){return t.decode?gQ(e):e}function W6(e){return Array.isArray(e)?e.sort():typeof e=="object"?W6(Object.keys(e)).sort((t,r)=>Number(t)-Number(r)).map(t=>e[t]):e}function Q6(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function xQ(e){let t="";const r=e.indexOf("#");return r!==-1&&(t=e.slice(r)),t}function wg(e,t,r){return r==="string"&&typeof e=="string"?e:typeof r=="function"&&typeof e=="string"?r(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""||t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function ep(e){e=Q6(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function tp(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},H6(t.arrayFormatSeparator);const r=wQ(t),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const i of e.split("&")){if(i==="")continue;const a=t.decode?i.replaceAll("+"," "):i;let[o,s]=B6(a,"=");o===void 0&&(o=a),s=s===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:mi(s,t),r(mi(o,t),s,n)}for(const[i,a]of Object.entries(n))if(typeof a=="object"&&a!==null&&t.types[i]!=="string")for(const[o,s]of Object.entries(a)){const l=t.types[i]?t.types[i].replace("[]",""):void 0;a[o]=wg(s,t,l)}else typeof a=="object"&&a!==null&&t.types[i]==="string"?n[i]=Object.values(a).join(t.arrayFormatSeparator):n[i]=wg(a,t,t.types[i]);return t.sort===!1?n:(t.sort===!0?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((i,a)=>{const o=n[a];return i[a]=o&&typeof o=="object"&&!Array.isArray(o)?W6(o):o,i},Object.create(null))}function G6(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},H6(t.arrayFormatSeparator);const r=o=>t.skipNull&&yQ(e[o])||t.skipEmptyString&&e[o]==="",n=$Q(t),i={};for(const[o,s]of Object.entries(e))r(o)||(i[o]=s);const a=Object.keys(i);return t.sort!==!1&&a.sort(t.sort),a.map(o=>{const s=e[o];return s===void 0?"":s===null?Jt(o,t):Array.isArray(s)?s.length===0&&t.arrayFormat==="bracket-separator"?Jt(o,t)+"[]":s.reduce(n(o),[]).join("&"):Jt(o,t)+"="+Jt(s,t)}).filter(o=>o.length>0).join("&")}function Y6(e,t){t={decode:!0,...t};let[r,n]=B6(e,"#");return r===void 0&&(r=e),{url:r?.split("?")?.[0]??"",query:tp(ep(e),t),...t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:mi(n,t)}:{}}}function K6(e,t){t={encode:!0,strict:!0,[Sh]:!0,...t};const r=Q6(e.url).split("?")[0]||"",n=ep(e.url),i={...tp(n,{sort:!1}),...e.query};let a=G6(i,t);a&&=`?${a}`;let o=xQ(e.url);if(typeof e.fragmentIdentifier=="string"){const s=new URL(r);s.hash=e.fragmentIdentifier,o=t[Sh]?s.hash:`#${e.fragmentIdentifier}`}return`${r}${a}${o}`}function Z6(e,t,r){r={parseFragmentIdentifier:!0,[Sh]:!1,...r};const{url:n,query:i,fragmentIdentifier:a}=Y6(e,r);return K6({url:n,query:vQ(i,t),fragmentIdentifier:a},r)}function kQ(e,t,r){const n=Array.isArray(t)?i=>!t.includes(i):(i,a)=>!t(i,a);return Z6(e,n,r)}const X6=Object.freeze(Object.defineProperty({__proto__:null,exclude:kQ,extract:ep,parse:tp,parseUrl:Y6,pick:Z6,stringify:G6,stringifyUrl:K6},Symbol.toStringTag,{value:"Module"})),_Q=(e=window.location.search)=>{if(!e)return!1;const t=X6.parse(e);return"state"in t&&"photon"in t&&("code"in t||"error"in t)},CQ=e=>/^\d+$/.test(e)&&e.length>=5;function Eh(e,t){return e.every(r=>t.includes(r))}const SQ="0.16.11",EQ={version:SQ};var TQ=Y("<slot>"),OQ=Y("<div>");const AQ=EQ?.version,IQ=e=>{let t;const r=e.redirectUri?e.redirectUri:window.location.origin,n=X6.stringifyUrl({url:r,query:{photon:!0}}),i=new qk({env:e.env,domain:e.domain,audience:e.audience,connection:e.connection,uri:e.uri,clientId:e.id,redirectURI:n,organization:e.org,developmentMode:e.developmentMode},AQ),a=new hQ(i,e.autoLogin);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[o]=H(a),s=async()=>{await o()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},l=async()=>{await o()?.authentication.checkSession(),fQ(async()=>{await o()?.authentication.checkSession()},6e4,setInterval)};return ge(()=>{_Q()&&o()?s():o()&&l()}),ge(()=>{if(!o()?.authentication.state.isLoading){if(!o()?.authentication.state.isAuthenticated&&e.autoLogin){const d={appState:{}};e.redirectPath&&(d.appState.returnTo=e.redirectPath),o()?.authentication.login(d)}else if(e.externalUserId!=null&&o().authentication.state.user?.sub?.split("|").reverse()[0]!==e.externalUserId){o()?.authentication.logout();const d={appState:{}};e.redirectPath&&(d.appState.returnTo=e.redirectPath),o()?.authentication.login(d)}}}),(()=>{var d=OQ(),u=t;return typeof u=="function"?Fe(u,d):t=d,I(d,b(U6.Provider,{get value(){return o()},get children(){return b(Zq,{get children(){return b(AR,{client:i,get children(){var c=TQ();return c._$owner=pe(),c}})}})}})),d})()};Et("photon-client",{domain:{attribute:"domain",value:void 0,reflect:!1,notify:!1,parse:!1},id:{attribute:"id",value:void 0,reflect:!1,notify:!1,parse:!1},redirectUri:{attribute:"redirect-uri",value:void 0,reflect:!1,notify:!1,parse:!1},redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1},org:{attribute:"org",value:void 0,reflect:!1,notify:!1,parse:!1},audience:{attribute:"audience",value:void 0,reflect:!1,notify:!1,parse:!1},connection:{attribute:"connection",value:void 0,reflect:!1,notify:!1,parse:!1},uri:{attribute:"uri",value:void 0,reflect:!1,notify:!1,parse:!1},developmentMode:{attribute:"dev-mode",value:!1,reflect:!0,notify:!1,parse:!0},errorMessage:{attribute:"error-message",value:"Oh snap! There was an error loading. Please contact your site's administrator",reflect:!1,notify:!1,parse:!1},autoLogin:{attribute:"auto-login",value:!1,reflect:!1,notify:!1,parse:!0},env:{attribute:"env",value:void 0,reflect:!1,notify:!1,parse:!1},externalUserId:{attribute:"user-id",value:void 0,reflect:!0,notify:!0,parse:!1}},IQ);const Rt='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-2000{z-index:2000}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * (1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229,231,235,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249,250,251,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59,130,246,var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254,226,226,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255,255,255,var(--tw-bg-opacity))}.p-0{padding:0}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-40{padding-bottom:10rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0,0,0,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37,99,235,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55,65,81,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185,28,28,var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100,116,139,var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13,148,136,var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29,78,216,var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43,108,176,var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107,114,128,var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:\\!w-auto{width:auto!important}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:flex{display:flex}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}';var PQ=Y("<style>"),MQ=Y('<button class="w-full disabled:bg-gray-500 bg-photon-blue hover:bg-blue-700 text-white h-10 px-4 rounded-lg font-sans hover:bg-photon-blue-dark transition ease-in-out delay-50">');const DQ=e=>{const t=Xr();return ge(()=>{t||console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=PQ();return I(r,Rt),r})(),t?(()=>{var r=MQ();return r.$$click=async()=>{const n={appState:{}};e.redirectPath&&(n.appState.returnTo=e.redirectPath),t.authentication.state.isAuthenticated?await t.authentication.logout():await t.authentication.login(n)},I(r,()=>t.authentication.state.isAuthenticated?"Log out":"Log in"),X(()=>r.disabled=t.authentication.state.isLoading),r})():null]};Et("photon-auth-button",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},DQ);eo(["click"]);var NQ=Y("<style>"),LQ=Y(`<div class="flex flex-col w-screen max-w-sm"><svg viewBox="0 0 305 62.61"xmlns=http://www.w3.org/2000/svg class="h-[28px] pl-[19.75px]"><g fill=#273D52><path d="M0 54.1169H6.81375V35.7722H18.0826C29.5481 35.7722 34.3963 30.3343 34.3963 18.7378V17.4275C34.3963 5.76548 29.417 0.655167 18.0826 0.655167H0V54.1169ZM6.81375 30.1377V6.28961H18.2792C24.7653 6.28961 27.386 8.9758 27.386 16.0516V20.0481C27.386 27.1895 24.7653 30.1377 18.2792 30.1377H6.81375Z"></path><path d="M70.9593 54.1169H77.773V0.655167H70.9593V24.4378H50.8456V0.655167H44.0319V54.1169H50.8456V30.3343H70.9593V54.1169Z"></path><path d="M107.146 54.772C119.528 54.772 125.687 46.5169 125.687 34.9205V19.7861C125.687 8.25511 119.528 0 107.146 0C94.6974 0 88.5388 8.25511 88.5388 19.7861V34.9205C88.5388 46.5169 94.6974 54.772 107.146 54.772ZM95.5491 35.9687V18.8033C95.5491 10.7448 99.4801 5.89651 107.146 5.89651C114.745 5.89651 118.677 10.7448 118.677 18.8033V35.9687C118.677 44.0928 114.745 48.8755 107.146 48.8755C99.4801 48.8755 95.5491 44.0928 95.5491 35.9687Z"></path><path d="M144.295 54.1169H151.109V6.48616H164.54V0.655167H130.864V6.48616H144.295V54.1169Z"></path><path d="M188.299 54.772C200.682 54.772 206.841 46.5169 206.841 34.9205V19.7861C206.841 8.25511 200.682 0 188.299 0C175.851 0 169.693 8.25511 169.693 19.7861V34.9205C169.693 46.5169 175.851 54.772 188.299 54.772ZM176.703 35.9687V18.8033C176.703 10.7448 180.634 5.89651 188.299 5.89651C195.899 5.89651 199.83 10.7448 199.83 18.8033V35.9687C199.83 44.0928 195.899 48.8755 188.299 48.8755C180.634 48.8755 176.703 44.0928 176.703 35.9687Z"></path><path d="M217.6 54.1169H224.021V14.3482L245.576 54.1169H252.608L248.058 45.1084L245.641 40.4239L224.086 0.655167H217.6V54.1169Z"></path></g><g fill=#B35724><circle cx=249.798 cy=5.202 r=5.202></circle></g></svg><h1 class="font-medium text-3xl text-center font-sans mt-6 mb-3">Log in to your account</h1><p class="text-gray-500 font-sans text-center mb-8">Don't have an account? <a href=mailto:rado@photon.health class="text-teal-600 hover:underline hover:cursor-pointer font-sans font-light">Contact Sales</a></p><photon-auth-button>`,!0,!1,!1);const FQ=e=>{const t=Xr();return ge(()=>{t||console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=NQ();return I(r,Rt),r})(),(()=>{var r=LQ(),n=r.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return o._$owner=pe(),X(()=>o.redirectPath=e.redirectPath),r})()]};Et("photon-login",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},FQ);const bd=(e,t)=>{let r;const n=()=>clearTimeout(r);return pe()&&Er(n),Object.assign((...a)=>{r!==void 0&&n(),r=setTimeout(()=>e(...a),t)},{clear:n})};/**
1424
+ `,cQ={CatalogTreatmentsFieldsComponentFragment:uQ};class hQ{sdk;setStore;store;authentication;getSDK;clinical;autoLogin;constructor(t,r=!1){this.sdk=t,this.autoLogin=r;const[n,i]=la({authentication:{isAuthenticated:!1,isInOrg:!1,permissions:[],isLoading:!0,error:void 0,user:void 0},catalog:{isLoading:!1,treatments:[],templates:[]},catalogs:{isLoading:!1,catalogs:[]},dispenseUnits:{isLoading:!1,dispenseUnits:new Array},patients:{isLoading:!1,patients:[],finished:!1},patient:{isLoading:!1,patient:void 0},prescription:{isLoading:!1,errors:[],error:void 0,data:void 0}});this.setStore=i,this.store=n,this.authentication={state:n.authentication,handleRedirect:async a=>{try{const o=await this.sdk.authentication.handleRedirect(a);dQ(o?.appState),await this.authentication.checkSession()}catch(o){const s=new URLSearchParams(window.location.search).get("error_description");o.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):s?.includes("is not part of the org")?this.setStore("authentication",{...this.store.authentication,error:"User is not authorized",isLoading:!1}):this.setStore("authentication",{...this.store.authentication,error:o.message})}},checkSession:this.checkSession.bind(this),login:this.login.bind(this),logout:this.logout.bind(this)},this.getSDK=this._getSDK.bind(this),this.clinical={catalog:{state:n.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:n.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:n.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:n.patients,getPatients:this.getPatients.bind(this)},patient:{state:n.patient,getPatient:this.getPatient.bind(this)},prescription:{state:n.prescription,createPrescription:this.createPrescription.bind(this)}}}_getSDK(){return this.sdk}async checkSession(){try{await this.sdk.authentication.checkSession();const t=await this.sdk.authentication.isAuthenticated();this.setStore("authentication",{...this.store.authentication,isAuthenticated:t});const r=await this.sdk.authentication.getUser(),n=!!this.sdk?.organization&&!!r?.org_id;let i=[];if(this.autoLogin||t)try{const o=await this.sdk.authentication.getAccessToken();i=lQ(o)?.permissions||[]}catch{i=[]}const a=t&&n&&this.sdk.organization===r.org_id;this.setStore("authentication",{...this.store.authentication,user:r,isLoading:!1,isInOrg:a,permissions:i||[]})}catch{this.setStore("authentication",{...this.store.authentication,isLoading:!1})}}async login(t={}){await this.sdk.authentication.login(t),await this.checkSession()}async logout(t={}){await this.sdk.authentication.logout(t),this.setStore("authentication",{...this.store.authentication,isAuthenticated:!1,isInOrg:!1,permissions:[],user:void 0})}async getPatients(t){t||(t={}),this.setStore("patients",{...this.store.patients,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?r.patients:this.store.patients.patients.concat(r.patients),finished:r.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:r.patient}),r.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:r}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:cQ});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:r.catalog.treatments.map(n=>n)||[],templates:r.catalog.templates.map(n=>n)||[]})}async getCatalogs(){this.setStore("catalogs",{...this.store.catalogs,isLoading:!0});const{data:t}=await this.sdk.clinical.catalog.getCatalogs();this.setStore("catalogs",{...this.store.catalogs,isLoading:!1,catalogs:t.catalogs})}async getDispenseUnits(){this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!0});const{data:t}=await this.sdk.clinical.prescription.getDispenseUnits();this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!1,dispenseUnits:t.dispenseUnits.map((r,n)=>({id:String(n),...r}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const r=this.sdk.clinical.prescription.createPrescription({});try{const{data:n,errors:i}=await r({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),n?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:n.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:n,errors:i}}catch(n){return this.setStore("prescription",{...this.store.prescription,error:n,isLoading:!1}),{data:null,errors:[]}}}}const fQ=(e,t,r)=>{const n=r(e,t);return Er(()=>clearInterval(n))},q6="%[a-f0-9]{2}",bg=new RegExp("("+q6+")|([^%]+?)","gi"),$g=new RegExp("("+q6+")+","gi");function Ch(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],Ch(r),Ch(n))}function pQ(e){try{return decodeURIComponent(e)}catch{let t=e.match(bg)||[];for(let r=1;r<t.length;r++)e=Ch(t,r).join(""),t=e.match(bg)||[];return e}}function mQ(e){const t={"%FE%FF":"��","%FF%FE":"��"};let r=$g.exec(e);for(;r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{const i=pQ(r[0]);i!==r[0]&&(t[r[0]]=i)}r=$g.exec(e)}t["%C2"]="�";const n=Object.keys(t);for(const i of n)e=e.replace(new RegExp(i,"g"),t[i]);return e}function gQ(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return mQ(e)}}function vQ(e,t){const r={};if(Array.isArray(t))for(const n of t){const i=Object.getOwnPropertyDescriptor(e,n);i?.enumerable&&Object.defineProperty(r,n,i)}else for(const n of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,n);if(i.enumerable){const a=e[n];t(n,a,e)&&Object.defineProperty(r,n,i)}}return r}function B6(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const r=e.indexOf(t);return r===-1?[]:[e.slice(0,r),e.slice(r+t.length)]}const yQ=e=>e==null,bQ=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Sh=Symbol("encodeFragmentIdentifier");function $Q(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Jt(t,e),"[",i,"]"].join("")]:[...r,[Jt(t,e),"[",Jt(i,e),"]=",Jt(n,e)].join("")]};case"bracket":return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Jt(t,e),"[]"].join("")]:[...r,[Jt(t,e),"[]=",Jt(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Jt(t,e),":list="].join("")]:[...r,[Jt(t,e),":list=",Jt(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Jt(r,e),t,Jt(i,e)].join("")]:[[n,Jt(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,Jt(t,e)]:[...r,[Jt(t,e),"=",Jt(n,e)].join("")]}}function wQ(e){let t;switch(e.arrayFormat){case"index":return(r,n,i)=>{if(t=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!t){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][t[1]]=n};case"bracket":return(r,n,i)=>{if(t=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!t){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(t=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!t){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const a=typeof n=="string"&&n.includes(e.arrayFormatSeparator),o=typeof n=="string"&&!a&&mi(n,e).includes(e.arrayFormatSeparator);n=o?mi(n,e):n;const s=a||o?n.split(e.arrayFormatSeparator).map(l=>mi(l,e)):n===null?n:mi(n,e);i[r]=s};case"bracket-separator":return(r,n,i)=>{const a=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!a){i[r]=n&&mi(n,e);return}const o=n===null?[]:mi(n,e).split(e.arrayFormatSeparator);if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function H6(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Jt(e,t){return t.encode?t.strict?bQ(e):encodeURIComponent(e):e}function mi(e,t){return t.decode?gQ(e):e}function W6(e){return Array.isArray(e)?e.sort():typeof e=="object"?W6(Object.keys(e)).sort((t,r)=>Number(t)-Number(r)).map(t=>e[t]):e}function Q6(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function xQ(e){let t="";const r=e.indexOf("#");return r!==-1&&(t=e.slice(r)),t}function wg(e,t,r){return r==="string"&&typeof e=="string"?e:typeof r=="function"&&typeof e=="string"?r(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""||t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function ep(e){e=Q6(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function tp(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},H6(t.arrayFormatSeparator);const r=wQ(t),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const i of e.split("&")){if(i==="")continue;const a=t.decode?i.replaceAll("+"," "):i;let[o,s]=B6(a,"=");o===void 0&&(o=a),s=s===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:mi(s,t),r(mi(o,t),s,n)}for(const[i,a]of Object.entries(n))if(typeof a=="object"&&a!==null&&t.types[i]!=="string")for(const[o,s]of Object.entries(a)){const l=t.types[i]?t.types[i].replace("[]",""):void 0;a[o]=wg(s,t,l)}else typeof a=="object"&&a!==null&&t.types[i]==="string"?n[i]=Object.values(a).join(t.arrayFormatSeparator):n[i]=wg(a,t,t.types[i]);return t.sort===!1?n:(t.sort===!0?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((i,a)=>{const o=n[a];return i[a]=o&&typeof o=="object"&&!Array.isArray(o)?W6(o):o,i},Object.create(null))}function G6(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},H6(t.arrayFormatSeparator);const r=o=>t.skipNull&&yQ(e[o])||t.skipEmptyString&&e[o]==="",n=$Q(t),i={};for(const[o,s]of Object.entries(e))r(o)||(i[o]=s);const a=Object.keys(i);return t.sort!==!1&&a.sort(t.sort),a.map(o=>{const s=e[o];return s===void 0?"":s===null?Jt(o,t):Array.isArray(s)?s.length===0&&t.arrayFormat==="bracket-separator"?Jt(o,t)+"[]":s.reduce(n(o),[]).join("&"):Jt(o,t)+"="+Jt(s,t)}).filter(o=>o.length>0).join("&")}function Y6(e,t){t={decode:!0,...t};let[r,n]=B6(e,"#");return r===void 0&&(r=e),{url:r?.split("?")?.[0]??"",query:tp(ep(e),t),...t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:mi(n,t)}:{}}}function K6(e,t){t={encode:!0,strict:!0,[Sh]:!0,...t};const r=Q6(e.url).split("?")[0]||"",n=ep(e.url),i={...tp(n,{sort:!1}),...e.query};let a=G6(i,t);a&&=`?${a}`;let o=xQ(e.url);if(typeof e.fragmentIdentifier=="string"){const s=new URL(r);s.hash=e.fragmentIdentifier,o=t[Sh]?s.hash:`#${e.fragmentIdentifier}`}return`${r}${a}${o}`}function Z6(e,t,r){r={parseFragmentIdentifier:!0,[Sh]:!1,...r};const{url:n,query:i,fragmentIdentifier:a}=Y6(e,r);return K6({url:n,query:vQ(i,t),fragmentIdentifier:a},r)}function kQ(e,t,r){const n=Array.isArray(t)?i=>!t.includes(i):(i,a)=>!t(i,a);return Z6(e,n,r)}const X6=Object.freeze(Object.defineProperty({__proto__:null,exclude:kQ,extract:ep,parse:tp,parseUrl:Y6,pick:Z6,stringify:G6,stringifyUrl:K6},Symbol.toStringTag,{value:"Module"})),_Q=(e=window.location.search)=>{if(!e)return!1;const t=X6.parse(e);return"state"in t&&"photon"in t&&("code"in t||"error"in t)},CQ=e=>/^\d+$/.test(e)&&e.length>=5;function Eh(e,t){return e.every(r=>t.includes(r))}const SQ="0.16.12",EQ={version:SQ};var TQ=Y("<slot>"),OQ=Y("<div>");const AQ=EQ?.version,IQ=e=>{let t;const r=e.redirectUri?e.redirectUri:window.location.origin,n=X6.stringifyUrl({url:r,query:{photon:!0}}),i=new qk({env:e.env,domain:e.domain,audience:e.audience,connection:e.connection,uri:e.uri,clientId:e.id,redirectURI:n,organization:e.org,developmentMode:e.developmentMode},AQ),a=new hQ(i,e.autoLogin);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[o]=H(a),s=async()=>{await o()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},l=async()=>{await o()?.authentication.checkSession(),fQ(async()=>{await o()?.authentication.checkSession()},6e4,setInterval)};return ge(()=>{_Q()&&o()?s():o()&&l()}),ge(()=>{if(!o()?.authentication.state.isLoading){if(!o()?.authentication.state.isAuthenticated&&e.autoLogin){const d={appState:{}};e.redirectPath&&(d.appState.returnTo=e.redirectPath),o()?.authentication.login(d)}else if(e.externalUserId!=null&&o().authentication.state.user?.sub?.split("|").reverse()[0]!==e.externalUserId){o()?.authentication.logout();const d={appState:{}};e.redirectPath&&(d.appState.returnTo=e.redirectPath),o()?.authentication.login(d)}}}),(()=>{var d=OQ(),u=t;return typeof u=="function"?Fe(u,d):t=d,I(d,b(U6.Provider,{get value(){return o()},get children(){return b(Zq,{get children(){return b(AR,{client:i,get children(){var c=TQ();return c._$owner=pe(),c}})}})}})),d})()};Et("photon-client",{domain:{attribute:"domain",value:void 0,reflect:!1,notify:!1,parse:!1},id:{attribute:"id",value:void 0,reflect:!1,notify:!1,parse:!1},redirectUri:{attribute:"redirect-uri",value:void 0,reflect:!1,notify:!1,parse:!1},redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1},org:{attribute:"org",value:void 0,reflect:!1,notify:!1,parse:!1},audience:{attribute:"audience",value:void 0,reflect:!1,notify:!1,parse:!1},connection:{attribute:"connection",value:void 0,reflect:!1,notify:!1,parse:!1},uri:{attribute:"uri",value:void 0,reflect:!1,notify:!1,parse:!1},developmentMode:{attribute:"dev-mode",value:!1,reflect:!0,notify:!1,parse:!0},errorMessage:{attribute:"error-message",value:"Oh snap! There was an error loading. Please contact your site's administrator",reflect:!1,notify:!1,parse:!1},autoLogin:{attribute:"auto-login",value:!1,reflect:!1,notify:!1,parse:!0},env:{attribute:"env",value:void 0,reflect:!1,notify:!1,parse:!1},externalUserId:{attribute:"user-id",value:void 0,reflect:!0,notify:!0,parse:!1}},IQ);const Rt='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-2000{z-index:2000}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * (1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229,231,235,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249,250,251,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59,130,246,var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254,226,226,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255,255,255,var(--tw-bg-opacity))}.p-0{padding:0}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-40{padding-bottom:10rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0,0,0,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37,99,235,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55,65,81,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185,28,28,var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100,116,139,var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13,148,136,var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29,78,216,var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43,108,176,var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107,114,128,var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:\\!w-auto{width:auto!important}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:flex{display:flex}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}';var PQ=Y("<style>"),MQ=Y('<button class="w-full disabled:bg-gray-500 bg-photon-blue hover:bg-blue-700 text-white h-10 px-4 rounded-lg font-sans hover:bg-photon-blue-dark transition ease-in-out delay-50">');const DQ=e=>{const t=Xr();return ge(()=>{t||console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=PQ();return I(r,Rt),r})(),t?(()=>{var r=MQ();return r.$$click=async()=>{const n={appState:{}};e.redirectPath&&(n.appState.returnTo=e.redirectPath),t.authentication.state.isAuthenticated?await t.authentication.logout():await t.authentication.login(n)},I(r,()=>t.authentication.state.isAuthenticated?"Log out":"Log in"),X(()=>r.disabled=t.authentication.state.isLoading),r})():null]};Et("photon-auth-button",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},DQ);eo(["click"]);var NQ=Y("<style>"),LQ=Y(`<div class="flex flex-col w-screen max-w-sm"><svg viewBox="0 0 305 62.61"xmlns=http://www.w3.org/2000/svg class="h-[28px] pl-[19.75px]"><g fill=#273D52><path d="M0 54.1169H6.81375V35.7722H18.0826C29.5481 35.7722 34.3963 30.3343 34.3963 18.7378V17.4275C34.3963 5.76548 29.417 0.655167 18.0826 0.655167H0V54.1169ZM6.81375 30.1377V6.28961H18.2792C24.7653 6.28961 27.386 8.9758 27.386 16.0516V20.0481C27.386 27.1895 24.7653 30.1377 18.2792 30.1377H6.81375Z"></path><path d="M70.9593 54.1169H77.773V0.655167H70.9593V24.4378H50.8456V0.655167H44.0319V54.1169H50.8456V30.3343H70.9593V54.1169Z"></path><path d="M107.146 54.772C119.528 54.772 125.687 46.5169 125.687 34.9205V19.7861C125.687 8.25511 119.528 0 107.146 0C94.6974 0 88.5388 8.25511 88.5388 19.7861V34.9205C88.5388 46.5169 94.6974 54.772 107.146 54.772ZM95.5491 35.9687V18.8033C95.5491 10.7448 99.4801 5.89651 107.146 5.89651C114.745 5.89651 118.677 10.7448 118.677 18.8033V35.9687C118.677 44.0928 114.745 48.8755 107.146 48.8755C99.4801 48.8755 95.5491 44.0928 95.5491 35.9687Z"></path><path d="M144.295 54.1169H151.109V6.48616H164.54V0.655167H130.864V6.48616H144.295V54.1169Z"></path><path d="M188.299 54.772C200.682 54.772 206.841 46.5169 206.841 34.9205V19.7861C206.841 8.25511 200.682 0 188.299 0C175.851 0 169.693 8.25511 169.693 19.7861V34.9205C169.693 46.5169 175.851 54.772 188.299 54.772ZM176.703 35.9687V18.8033C176.703 10.7448 180.634 5.89651 188.299 5.89651C195.899 5.89651 199.83 10.7448 199.83 18.8033V35.9687C199.83 44.0928 195.899 48.8755 188.299 48.8755C180.634 48.8755 176.703 44.0928 176.703 35.9687Z"></path><path d="M217.6 54.1169H224.021V14.3482L245.576 54.1169H252.608L248.058 45.1084L245.641 40.4239L224.086 0.655167H217.6V54.1169Z"></path></g><g fill=#B35724><circle cx=249.798 cy=5.202 r=5.202></circle></g></svg><h1 class="font-medium text-3xl text-center font-sans mt-6 mb-3">Log in to your account</h1><p class="text-gray-500 font-sans text-center mb-8">Don't have an account? <a href=mailto:rado@photon.health class="text-teal-600 hover:underline hover:cursor-pointer font-sans font-light">Contact Sales</a></p><photon-auth-button>`,!0,!1,!1);const FQ=e=>{const t=Xr();return ge(()=>{t||console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=NQ();return I(r,Rt),r})(),(()=>{var r=LQ(),n=r.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return o._$owner=pe(),X(()=>o.redirectPath=e.redirectPath),r})()]};Et("photon-login",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},FQ);const bd=(e,t)=>{let r;const n=()=>clearTimeout(r);return pe()&&Er(n),Object.assign((...a)=>{r!==void 0&&n(),r=setTimeout(()=>e(...a),t)},{clear:n})};/**
1425
1425
  * @license
1426
1426
  * Copyright 2019 Google LLC
1427
1427
  * SPDX-License-Identifier: BSD-3-Clause
package/dist/index.mjs CHANGED
@@ -37630,7 +37630,7 @@ function yH(e) {
37630
37630
  return !f.prescription;
37631
37631
  },
37632
37632
  get loading() {
37633
- return r() === f.prescription?.id;
37633
+ return F(() => !!f.prescription)() && r() === f.prescription.id;
37634
37634
  }
37635
37635
  })), p;
37636
37636
  }
@@ -41238,7 +41238,7 @@ const X6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41238
41238
  function Eh(e, t) {
41239
41239
  return e.every((r) => t.includes(r));
41240
41240
  }
41241
- const SQ = "0.16.11", EQ = {
41241
+ const SQ = "0.16.12", EQ = {
41242
41242
  version: SQ
41243
41243
  };
41244
41244
  var TQ = /* @__PURE__ */ Y("<slot>"), OQ = /* @__PURE__ */ Y("<div>");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photonhealth/elements",
3
- "version": "0.16.11",
3
+ "version": "0.16.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",