@icanbwell/composite 1.1098.0 → 1.1099.1

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/native.js +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
866
866
  <div class="wrapper">
867
867
  <bwell-error-component />
868
868
  </div>
869
- `}}customElements.get(ve)===void 0&&customElements.define(ve,Te);const De=[{name:"loader",defaultElement:document.createElement(ne)},{name:"error",defaultElement:document.createElement(ve)}],ze=["error","loading"],Ie={error:"error",loading:"loader"},xe=({src:Ot,elementNameSuffix:Ft,version:Qt,prefetchFeatureApp:zt})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;window.bwell||(window.bwell=new ue({metadata:{version:Qt}}));const cr=`bwell-${Ft}`;if(customElements.get(cr)!==void 0)return;class Dn extends h{constructor(){super(),Ke.add(this),$e.set(this,(0,T.nanoid)()),Et.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Ye.set(this,new q.EventEmitter),Lt.set(this,void 0),mn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),Ht.set(this,void 0),this.attachShadow({mode:"open"});const qr=new he(De).attachToShadowRoot(this.shadowRoot);qr.addEventListener("visibilitychange",({visibility:wt,container:Ve,name:ot})=>{ot==="error"&&wt==="visible"&&window.bwell._registerEmbeddableContent(Ve),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=wt==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Ht,{slots:qr,attributes:new V().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Ye,"f")},"f"),(0,p.__classPrivateFieldSet)(this,Lt,(0,p.__classPrivateFieldGet)(this,Ke,"m",Un).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,Ke,"m",Mr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,Sn,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,$e,this.id||(0,p.__classPrivateFieldGet)(this,$e,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Et,new z((0,p.__classPrivateFieldGet)(this,$e,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Et,"f").registerDispatcher(qr=>this.dispatchEvent(qr)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,Lt,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,Lt,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}),zt&&(0,b.h)(Ot).catch(()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}))})}disconnectedCallback(){var qr;(0,p.__classPrivateFieldGet)(this,Ye,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(qr=(0,p.__classPrivateFieldGet)(this,Et,"f"))===null||qr===void 0||qr.deregister(),(0,p.__classPrivateFieldGet)(this,Ye,"f").removeAllListeners()}}$e=new WeakMap,Et=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Lt=new WeakMap,mn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,Ke=new WeakSet,Un=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${cr}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,$e,"f"),name:Ft,elementName:cr,utils:(0,p.__classPrivateFieldGet)(this,Ht,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},Mr=function({visibility:qr,name:wt}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=qr==="hidden"?"unset":"hidden"},gn=function(qr){(0,p.__classPrivateFieldGet)(this,Rt,"f")(),(0,p.__classPrivateFieldSet)(this,Rt,void 0,"f")},In=function(qr){return wt=>{const Ve=ze.findIndex(Je=>Je===qr);if(!ze.slice(0,Ve).some(Je=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(Je)!==null)){if(wt!==null)(0,p.__classPrivateFieldGet)(this,Rt,"f")&&(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[qr]),"f");else if(wt===null&&(0,p.__classPrivateFieldGet)(this,Rt,"f")){(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr);const Je=ze.find(tt=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(tt)!==null);Je&&(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[Je]),"f")}}}},customElements.define(cr,Dn)}),_e={rE:"1.1098.0"},it="composite";var bt=e(67321);xe({src:`https://embeddables.prod.icanbwell.com/${it}/${_e.rE}/scripts/embeddable.federated.js`,elementNameSuffix:it,version:_e.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,b,h)=>b in p?i(p,b,{enumerable:!0,configurable:!0,writable:!0,value:h}):p[b]=h,A=(p,b)=>{for(var h in b||(b={}))c.call(b,h)&&y(p,h,b[h]);if(g)for(var h of g(b))u.call(b,h)&&y(p,h,b[h]);return p},m=(p,b)=>o(p,a(b));const d=(p,b,h)=>{const f=_.cloneDeep(p);if(!f.contained||b<0)return f;const v=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(v!==-1&&!h){const M=f.contained[v];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===b+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[v]=M}}else h&&v!==-1&&(f.contained[v]=m(A({},f.contained[v]),{item:h}));return f},O=({formId:p,questionnaireResponse:b,showQuestionPrefix:h,nextQuestion:f,onGoBack:v,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=b.questionnaire)==null?void 0:P.replace("#",""),I=(D=b?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(b);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:C,questionnaireResponseItem:(N=b?.item)!=null?N:[],questionnaireSchema:I,status:b.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:v,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,p=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},b=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,v=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Ee]=(0,t.useState)(he),[ge,re]=(0,t.useState)(he),[ae,{loading:me,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:ue,error:ne}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Te}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Ee(he)},onCompleted:Qt=>{var zt,Ke;const $e=(Ke=(zt=Qt.placeAutocomplete)==null?void 0:zt.predictions)==null?void 0:Ke.map(Et=>{var Qe;return{id:Et.placeId,label:(0,s.removeAfterLastComma)(Et.description),mainText:Et?.mainText||((Qe=Et.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Et?.secondaryText||Et.description.split(",").slice(1).join(",").trim())}});Ee($e?.length?$e:he)}}),De=(0,t.useMemo)(()=>be.map(Qt=>b(p({},Qt),{displayLabel:(0,r.RZ)(Qt?.label||"",V)})),[V,be]),ze=Qt=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if(F(Qt),G(Qt),ie(!1),Qt&&typeof Qt=="string"){const cr=be.find(tt=>tt.id===Qt),Dn=cr?.label||V;if(!cr)return;q(Dn),k(Dn),setTimeout(()=>{const tt=[{id:cr.id,label:cr.label}];Ee(tt),re(tt)},f);const $r=yield ae({variables:{placeId:Qt}}),qr=(Ke=(zt=$r?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,wt=(Et=($e=$r?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,Ve=((Ye=(Qe=$r?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((mn=(Lt=$r?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(Sn=$r?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(qr&&wt)if(!Ve||!Je){const tt=yield de({variables:{latitude:String(qr),longitude:String(wt)}}),rt=((Ht=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",lt=((Mr=(Un=tt?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",St=((In=(gn=tt?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:qr,longitude:wt,zipCode:rt,state:lt,stateCode:St,placeId:Qt,description:Dn,value:Qt})}else T({latitude:qr,longitude:wt,zipCode:Ve,state:ot,stateCode:Je,placeId:Qt,description:Dn,value:Qt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Qt=>h(void 0,null,function*(){return yield J({variables:{input:Qt,types:"geocode"}})})),_e=Qt=>h(void 0,null,function*(){if(ie(!1),q(Qt),z?.(Qt),!Qt||Qt.trim().length===0){F(null),Ee(he),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Qt});return}const zt=Qt.trim();zt.length>=2?yield xe(zt):Ee(he)}),it=Qt=>{te.current=Qt},bt=()=>{q(I),Ee(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if(N&&w){Ee([{id:N,label:V||w}]),re([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const cr=yield ae({variables:{placeId:N}}),Dn=(Ke=(zt=cr?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,$r=(Et=($e=cr?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,qr=((Ye=(Qe=cr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",wt=((mn=(Lt=cr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Ve=((et=(Sn=cr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Dn&&$r)if(!qr||!wt||!Ve){const ot=yield de({variables:{latitude:String(Dn),longitude:String($r)}}),Je=((Ht=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",tt=((Mr=(Un=ot?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",rt=((In=(gn=ot?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Dn,longitude:$r,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Dn,longitude:$r,zipCode:qr,state:wt,stateCode:Ve,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Ee(he),re(he)}))()},[]);const Ot=se||!!pe||!!ne||!!Te||!!R,Ft=Ot?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:it,onBlur:bt,isInvalid:Ot,hint:Ft,autoComplete:"address-line1",className:"w-full",children:Qt=>{const zt=Qt,Ke=V.trim().length>=2,$e=zt.mainText||"",Et=zt.secondaryText||"",Qe=$e.trim().length>0,Ye=Et.trim().length>0,Lt=Qe?(0,r.RZ)($e,V):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Ye?(0,r.RZ)(Et,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:zt.id,supportingText:zt.supportingText,isDisabled:zt.isDisabled,icon:zt.icon,avatarUrl:zt.avatarUrl,textValue:zt.label,children:Ke&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:zt.label})})}})})}},18077:()=>{},12200:(Z,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const p=c.getId(O),b=c.getRouteMeta(p)||{},h=getBreadcrumbTitleKey(p,b,u);if(!h||b.breadcrumbHide)return[];const f=y[p];let v=c.getHref(p),M=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:p,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:p,href:v,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,v=(C,R)=>{for(var L in R||(R={}))b.call(R,L)&&f(C,L,R[L]);if(p)for(var L of p(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(v({},q.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Te){Te instanceof Error?P?.error(Te,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Te)}`)}},[w,P]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Te=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Te,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Ee=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield he()))return P?.error("Location services not available"),!1;const Te=yield Ee();return Te!==o.Ef.GRANTED&&Te!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Te}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[he,P,Ee]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Te=N.locationPermission;if(Te===o.Ef.DENIED||Te===o.Ef.BLOCKED||Te===o.Ef.UNAVAILABLE){F(Te);return}k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}if(Te===o.Ef.GRANTED){try{const Ie=yield Ee();if(Ie===o.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Ee();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield re())){te(o.Ef.UNAVAILABLE);return}k(!0);let Te=yield Ee();if(te(Te),Te===o.Ef.GRANTED||Te===o.Ef.PROMPT){if(L==="Android"&&Te===o.Ef.GRANTED)try{Te=yield ge(),te(Te)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Te!==o.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[re,P,L,te,be,Ee,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield he())?yield Ee():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[he,P,Ee]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Te=yield Ee();te(Te)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[he,P,te,Ee]),de=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Te=yield Ee();if(Te===o.Ef.DENIED||Te===o.Ef.BLOCKED||Te===o.Ef.UNAVAILABLE){te(Te);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Te=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Te?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Te}`)}te(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[he,P,te,be,ge,Ee]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Te=yield be(z);Te&&(G(Te),F(o.Ef.GRANTED),w(M(v({},q.current),{location:`${Te.coords.latitude},${Te.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Te.coords.latitude}`,lng:`${Te.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[he,P,w,te,be]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(v({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:ne,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:de,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:me}),[I,ne,U,K,ae,de,ue,pe,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>In,GI:()=>F,rz:()=>Ft,Fp:()=>Ot,el:()=>bt,ao:()=>it,oA:()=>T,Yt:()=>cr,g4:()=>_e,tn:()=>wt,n4:()=>S,gD:()=>z,Vp:()=>Mr,Cx:()=>P,bK:()=>R,gi:()=>gn,Z$:()=>he,GT:()=>Un,hr:()=>be,JL:()=>Ee,Ck:()=>L,dU:()=>C,wG:()=>Ye,hZ:()=>Et,$e:()=>Qt,qT:()=>$e,GQ:()=>Ke,q3:()=>Qe,D_:()=>zt,Uf:()=>N,_l:()=>G,Md:()=>q,V7:()=>V,fe:()=>ie,JP:()=>ye,Z_:()=>E,zO:()=>te,UZ:()=>k,$7:()=>xe,rb:()=>w,VF:()=>Rt,vf:()=>mn,PV:()=>Ht,PS:()=>Lt,Iz:()=>et,zD:()=>I,m3:()=>De,XP:()=>ze,PM:()=>pe,cX:()=>ge,G6:()=>re,Us:()=>ue,AA:()=>me,G0:()=>Te,mO:()=>J,HH:()=>de,PU:()=>qr,Tl:()=>ve,uH:()=>Ie,c3:()=>ae,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const i=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),A=e(9495);const m=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const p=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));p.displayName="Virus";const b=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));b.displayName="CreditCard02";const h=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const v=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));v.displayName="ClipboardPlus";const M=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));M.displayName="Route";const x=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,z="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",T="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",S="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",C="http://hl7.org/fhir/StructureDefinition/minValue",R="http://hl7.org/fhir/StructureDefinition/maxValue",L="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",P="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",N="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",w="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",V="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",q="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",k="tz-code",U="footer",F="check-box",K="header",G="page",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],be={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},Ee={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ge="ui-toolkit/CoordinatePicker",re="ui-toolkit/DetailsInfo",ae="ui-toolkit/ServiceChoice",me="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",de="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",ne="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ve="ui-toolkit/SelectableOption",Te="ui-toolkit/Modal",De="ui-toolkit/Alert",ze="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",_e="http://icanbwell.com/fhir/StructureDefinition/icon-name",it="http://icanbwell.com/fhir/StructureDefinition/error-title",bt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ot="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ft="http://icanbwell.com/fhir/StructureDefinition/description",Qt="http://icanbwell.com/fhir/StructureDefinition/modal-description",zt="http://icanbwell.com/fhir/StructureDefinition/modal-title",Ke="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",$e="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Et="http://icanbwell.com/fhir/StructureDefinition/button-text",Qe="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Lt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Sn="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",et="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ht="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Un="http://hl7.org/fhir/StructureDefinition/mimeType",Mr="http://hl7.org/fhir/StructureDefinition/maxSize",gn="http://icanbwell.com/fhir/StructureDefinition/message-severity",In="http://icanbwell.com/fhir/StructureDefinition/alert-color",cr="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dn="http://icanbwell.com/fhir/StructureDefinition/placeholder",$r="http://icanbwell.com/fhir/StructureDefinition/hint-text",qr="ui-toolkit/PrefilledMemberDemographicsAlert",wt="http://hl7.org/fhir/issue-severity",Ve="http://icanbwell.com/fhir/StructureDefinition/button-type",ot="http://icanbwell.com/fhir/StructureDefinition/button-action",Je="button-type",tt="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",rt="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",lt="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",St="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",st="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",le={},ye={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:p,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":b,"link-03":h,"search-lg":f.q,"clipboard-plus":v,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>wt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>w,mR:()=>yt,nt:()=>z,od:()=>N,t7:()=>it,yQ:()=>Se,zj:()=>pe});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(69364),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(pt,Yt,qt)=>Yt in pt?A(pt,Yt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):pt[Yt]=qt,f=(pt,Yt)=>{for(var qt in Yt||(Yt={}))p.call(Yt,qt)&&h(pt,qt,Yt[qt]);if(O)for(var qt of O(Yt))b.call(Yt,qt)&&h(pt,qt,Yt[qt]);return pt},v=(pt,Yt)=>m(pt,d(Yt));const M=pt=>{var Yt;return(Yt=pt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Pt,$t;return($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)!=null?$t:[]}).find(qt=>{var Pt;return(Pt=qt.code)==null?void 0:Pt.startsWith("ui-toolkit/")}))==null?void 0:Yt.code},x=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.V7);return qt?.valueCode||"off"},z=(pt,Yt,qt)=>{const Pt=(0,u.A)(qt);return pt&&Yt&&qt?Pt.replace("<p>",`<span>${Yt} `).replace("</p>","</span>").trim():Pt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=pt=>{const Yt=pt?.find(qt=>qt.url===y.Vp);return Yt?.valueInteger},S=pt=>{const Yt=pt?.find(qt=>qt.url===y.Z_);return Yt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(pt,Yt)=>{const qt=pt?.find(Pt=>Pt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Yt&&E[Yt]||C},L=pt=>{const Yt=pt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Yt?.valueString},P=pt=>{const Yt=pt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Yt?.length?Yt.join(","):void 0},D=pt=>pt.split(",").map(Pt=>Pt.trim()).map(Pt=>y.JL[Pt]||Pt).filter((Pt,$t,Zt)=>Zt.indexOf(Pt)===$t).join(", "),N=(pt,Yt,qt)=>{const Pt=D(pt),$t=Pt.lastIndexOf(","),Zt=$t!==-1?`${Pt.substring(0,$t)} or${Pt.substring($t+1)}`:Pt,An=[Yt&&`max. ${(Yt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return An.length>0?`${Zt} (${An.join(", ")})`:Zt},w=pt=>{const Yt=pt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Yt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(pt,Yt)=>{var qt,Pt,$t;const Zt=Yt?.find(An=>An.url.includes(pt));return($t=(Pt=(qt=Zt?.valueInteger)!=null?qt:Zt?.valueDecimal)!=null?Pt:Zt?.valueString)!=null?$t:Zt?.valueDate},q=pt=>{if(!!pt){if(/^\d{4}-\d{2}-\d{2}$/.test(pt))return pt;try{const Yt=(0,o.evaluate)({},pt);if(Array.isArray(Yt)&&Yt.length>0){const qt=Yt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Pt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Zt=String(qt.getDate()).padStart(2,"0");return`${Pt}-${$t}-${Zt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(pt,Yt)=>{var qt,Pt;const $t=Yt?.find(An=>An.url===pt);if(!$t)return;const Zt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Zt||q((Pt=$t.valueExpression)==null?void 0:Pt.expression)},k=(pt,Yt)=>{if(!(!pt||pt.length===0))for(const qt of pt){const Pt=V(Yt,qt.extension);if(Pt!==void 0)return Pt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Yt);if($t!==void 0)return $t}}},U=(pt,Yt)=>{try{const qt=String(pt??Yt);let Pt;if(qt.includes("/"))Pt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Pt=(0,t.A)($t)}return(0,r.A)(Pt)}catch(qt){return console.error("Date parsing error:",qt,pt),null}},F=(pt,Yt)=>{var qt;for(const Pt of pt){if(Pt.linkId===Yt)return Pt;if((qt=Pt.item)!=null&&qt.length){const $t=F(Pt.item,Yt);if($t!==void 0)return $t}}},K=(pt,Yt)=>{var qt;const Pt=[];for(const $t of pt)if($t.linkId===Yt&&Pt.push($t),(qt=$t.item)!=null&&qt.length){const Zt=K($t.item,Yt);Pt.push(...Zt)}return Pt},G=(pt,Yt,qt=0)=>K(pt,Yt)[qt];function se(pt){return pt!=null}const ie=(pt,Yt)=>{var qt,Pt,$t;if("answerString"in pt&&se(pt.answerString)){if(pt.operator==="=")return Yt?.valueString===pt.answerString;if(pt.operator==="!=")return Yt?.valueString!==pt.answerString}if("answerBoolean"in pt&&se(pt.answerBoolean)){if(pt.operator==="=")return Yt?.valueBoolean===pt.answerBoolean;if(pt.operator==="!=")return Yt?.valueBoolean!==pt.answerBoolean}if("answerInteger"in pt&&se(pt.answerInteger)||"answerDecimal"in pt&&se(pt.answerDecimal)){const Zt=Number(Yt?.valueInteger||Yt?.valueDecimal),An=Number(pt.answerInteger||pt.answerDecimal);if(pt.operator==="=")return Zt===An;if(pt.operator==="!=")return Zt!==An;if(pt.operator===">")return Zt>An;if(pt.operator==="<")return Zt<An;if(pt.operator===">=")return Zt>=An;if(pt.operator==="<=")return Zt<=An}if("answerQuantity"in pt&&se(pt.answerQuantity)){const Zt=Yt?.valueQuantity,An=pt.answerQuantity;if(Zt?.unit!==An?.unit)return!1;if(pt.operator==="=")return Zt.value===An.value;if(pt.operator==="!=")return Zt.value!==An.value;if(pt.operator===">")return Zt.value>An.value;if(pt.operator==="<")return Zt.value<An.value;if(pt.operator===">=")return Zt.value>=An.value;if(pt.operator==="<=")return Zt.value<=An.value}if("answerCoding"in pt&&se(pt.answerCoding)){const Zt=Yt?.valueCoding,An=pt.answerCoding;if(pt.operator==="=")return Zt?.code===An.code;if(pt.operator==="!=")return Zt?.code!==An.code}if("answerReference"in pt&&se(pt.answerReference)){const Zt=Yt?.valueReference,An=pt.answerReference;if(pt.operator==="=")return Zt?.reference===An.reference;if(pt.operator==="!=")return Zt?.reference!==An.reference}if("answerDate"in pt&&se(pt.answerDate)||"answerDateTime"in pt&&se(pt.answerDateTime)||"answerTime"in pt&&se(pt.answerTime)){const Zt=new Date(($t=(Pt=(qt=Yt?.valueDate)!=null?qt:Yt?.valueDateTime)!=null?Pt:Yt?.valueTime)!=null?$t:""),An=new Date(pt.answerDate||pt.answerDateTime||pt.answerTime||"");if(pt.operator==="=")return Zt.getTime()===An.getTime();if(pt.operator==="!=")return Zt.getTime()!==An.getTime();if(pt.operator===">")return Zt.getTime()>An.getTime();if(pt.operator==="<")return Zt.getTime()<An.getTime();if(pt.operator===">=")return Zt.getTime()>=An.getTime();if(pt.operator==="<=")return Zt.getTime()<=An.getTime()}return pt.operator==="exists"?Yt!=null===pt.answerBoolean:!0},te=(pt,Yt,qt)=>{const Pt=$t=>{const Zt=K(qt,$t.question);return Zt.length===0||Zt.every(An=>!An.answer||An.answer.length===0)?ie($t,void 0):Zt.some(An=>{var zr;return(zr=An.answer)==null?void 0:zr.some(jr=>ie($t,jr&&Object.keys(jr).length>0?jr:void 0))})};return pt&&pt?.length>0?Yt==="any"?pt?.some($t=>Pt($t)):pt?.every($t=>Pt($t)):!0},he=(pt,Yt,qt,Pt,$t)=>{if(!pt||pt.length===0)return!0;const Zt=An=>{var zr;let jr;if(Pt&&typeof $t=="number"){const Pn=qt.filter(rn=>rn.linkId===Pt)[$t];if(Pn?.item){const rn=Pn.item.find(vt=>vt.linkId===An.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))}}if(!jr){const Rn=K(qt,An.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))});jr=void 0}return ie(An,jr)};return Yt==="any"?pt.some(An=>Zt(An)):pt.every(An=>Zt(An))},be=(pt,Yt)=>{var qt;if(!!((qt=pt?.valueExpression)!=null&&qt.expression))try{const Pt=evaluate(Yt,pt.valueExpression.expression);return Array.isArray(Pt)?Pt.some($t=>Boolean($t)):Boolean(Pt)}catch{return}},Ee=(pt,Yt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Zt=>Zt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Pt,Yt);return v(f({},pt),{readOnly:$t??pt.readOnly})},ge=(pt,Yt,qt)=>{const{required:Pt,maxLength:$t,type:Zt,extension:An,enableWhen:zr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=pt;if(!te(zr,jr,Yt)||pt.type==="group"||pt.type==="display")return"";if(Rn)return re(pt,Yt,qt);const rn=de(pt,Yt);return rn&&ue(rn,pt)?ne(pt,Yt,qt,rn):pe(An,Zt,Pt,$t,qt,Pn)},re=(pt,Yt,qt)=>{const{required:Pt}=pt;if(Pt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Zt=0;Zt<qt.length;Zt++){const An=qt[Zt];if(An&&Object.keys(An).length>0&&Object.values(An).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){$t=!0;const jr=pe(pt.extension,pt.type,!0,pt.maxLength,[An],pt.answerOption);if(jr)return`Item ${Zt+1}: ${jr}`;if(pt.item&&pt.item.length>0){const Rn=ae(pt.item,Yt,pt.linkId,Zt);if(Rn)return`Item ${Zt+1}: ${Rn}`}}else return`Item ${Zt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Zt=qt[$t];if(Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=pe(pt.extension,pt.type,!1,pt.maxLength,[Zt],pt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(pt.item&&pt.item.length>0){const jr=ae(pt.item,Yt,pt.linkId,$t);if(jr)return`Item ${$t+1}: ${jr}`}}}return""},ae=(pt,Yt,qt,Pt)=>{var $t,Zt;for(const An of pt){if(!he(An.enableWhen,An.enableBehavior,Yt,qt,Pt))continue;const zr=F(Yt,qt),jr=($t=zr?.item)==null?void 0:$t.find(Pn=>Pn.linkId===An.linkId),Rn=(Zt=jr?.answer)!=null&&Zt[Pt]?[jr.answer[Pt]]:void 0;if(An.required){if(!Rn||!Rn[0]||!me(Rn[0]))return`${An.text||An.linkId} is required`;const Pn=pe(An.extension,An.type,!0,An.maxLength,Rn,An.answerOption);if(Pn)return`${An.text||An.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&me(Rn[0])){const Pn=pe(An.extension,An.type,!1,An.maxLength,Rn,An.answerOption);if(Pn)return`${An.text||An.linkId}: ${Pn}`}if(An.item&&An.item.length>0){const Pn=ae(An.item,Yt,An.linkId,Pt);if(Pn)return Pn}}return""},me=pt=>!pt||Object.keys(pt).length===0?!1:Object.values(pt).some(Yt=>Yt!=null&&Yt!==""&&(Array.isArray(Yt)?Yt.length>0:!0)),pe=(pt,Yt,qt,Pt,$t,Zt)=>{var An,zr,jr,Rn,Pn;let rn="";const vt=!!pt?.find(Cn=>{var jn,wr;return Cn.url===y.gD&&((wr=(jn=Cn.valueCodeableConcept)==null?void 0:jn.coding)==null?void 0:wr.some(Wr=>Wr.system===y.n4&&Wr.code===y.GI))}),Tt=$t?.[0],Kt={choice:((An=Tt?.valueCoding)==null?void 0:An.code)||(Tt?.valueString&&Zt?.some(Cn=>Cn.valueString===Tt.valueString)?Tt.valueString:null),"open-choice":((zr=Tt?.valueCoding)==null?void 0:zr.code)||Tt?.valueString,boolean:Tt?.valueBoolean,string:Tt?.valueString,text:Tt?.valueString,url:Tt?.valueUri,integer:Tt?.valueInteger,decimal:Tt?.valueDecimal,dateTime:Tt?.valueDateTime,date:Tt?.valueDate,time:Tt?.valueTime,quantity:(jr=Tt?.valueQuantity)==null?void 0:jr.value,reference:(Rn=Tt?.valueReference)==null?void 0:Rn.display,attachment:(Pn=Tt?.valueAttachment)==null?void 0:Pn.title};if(!(Yt in Kt))return"";const un=Kt[Yt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Yt==="boolean"&&un!==!0&&vt)?"This field is required":"",maxLength:()=>Pt&&un!==null&&un!==void 0&&un.toString().length>Pt?`Input should not exceed ${Pt} characters`:"",minLength:()=>{const Cn=V("minLength",pt);return Cn&&un!==null&&un!==void 0&&un.toString().length<Number(Cn)?`Input should be at least ${Cn} characters`:""},urlRegex:()=>{const Cn=new RegExp(y.rx),jn=V("regexError",pt),wr=jn??"Please enter a valid url starting from http:// and https://";return Cn&&Yt==="url"&&un&&!Cn.test(un)?String(wr):""},regex:()=>{const Cn=V("regex",pt);if(!Cn||typeof un!="string")return"";const jn=new RegExp(Cn),wr=V("regexError",pt),Wr=wr??"Please enter a valid input";return jn&&un&&!jn.test(un)?String(Wr):""},dateTime:()=>{if(Yt==="dateTime"&&un){const Cn=un?.toString(),jn=new Date(Cn);return isNaN(jn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Yt!=="date"||!un)return"";const Cn=un.replace(/\D/g,"");return Cn.length>0&&Cn.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.dU,pt),Wr=U(wr??"01/01/1900","01/01/1900"),_r=U(un,"");if(!Wr||!_r)return"";if((0,s.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Ck))==null?void 0:Cn.valueString;return f0??`Date should not be before ${wr??"01/01/1900"}`}return""}const jn=V("minValue",pt);return jn!=null&&un!==null&&un!==void 0&&un<jn?`Input should not be less than ${jn}`:""},maxValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.bK,pt),Wr=U(wr??"01/01/2100","01/01/2100"),_r=U(un,"");if(!Wr||!_r)return"";if((0,i.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Cx))==null?void 0:Cn.valueString;return f0??`Date should not be after ${wr??"01/01/2100"}`}return""}const jn=V("maxValue",pt);return jn!=null&&un!==null&&un!==void 0&&un>jn?`Input should not exceed ${jn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},de=(pt,Yt)=>{for(const qt of Yt)if(qt.item){if(qt.item.find(Zt=>Zt.linkId===pt.linkId))return qt;const $t=de(pt,qt.item);if($t)return $t}return null},ue=(pt,Yt)=>{if(pt.answer&&pt.answer.length>1)return!0;if(pt.item){const qt=pt.item.find(Pt=>Pt.linkId===Yt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},ne=(pt,Yt,qt,Pt)=>{var $t,Zt;const{required:An}=pt,zr=($t=Pt.item)==null?void 0:$t.find(Pn=>Pn.linkId===pt.linkId),jr=zr?.answer||[],Rn=((Zt=Pt.answer)==null?void 0:Zt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=jr[Pn];if(An){if(!rn||!me(rn))return`Item ${Pn+1}: ${pt.text||pt.linkId} is required`;const vt=pe(pt.extension,pt.type,!0,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}else if(rn&&me(rn)){const vt=pe(pt.extension,pt.type,!1,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}}return""},J=(pt,Yt)=>{for(const qt of pt){if(qt?.linkId===Yt)return qt;if(qt?.item&&qt.item.length>0){const Pt=J(qt.item,Yt);if(Pt)return Pt}}},ve=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===FOOTER_CODE))}))},Te=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===HEADER_CODE))}))},ze=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===y.gD&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===y.n4&&Zt.code===y._l))}))},Ie=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===CHECKBOX_CODE))}))},_e=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.fe);return qt?.valueInteger},it=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.zO);return qt?.valueInteger},bt=pt=>{var Yt;const qt=(Yt=pt?.extension)==null?void 0:Yt.find(Pt=>Pt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},Ot=(pt,Yt,qt,Pt,$t,Zt)=>{const An=jr=>Yt.filter(Rn=>Rn.linkId===jr),zr=new Set;return pt.map(jr=>{if(zr.has(jr.linkId)||ve(jr))return null;const Pn=An(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(zr.add(jr.linkId),rn){const vt=[];if(Pn.forEach((Tt,Kt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&$t&&$t.length>0){const Cn=Tt?.item||[];on=[...Cn],$t.forEach(jn=>{const wr=on.findIndex(Wr=>Wr.linkId===jn.linkId);wr>=0?on[wr]=v(f({},Cn[wr]),{answer:jn.answer}):on.push(jn)})}else jr.item&&(on=Ot(jr.item,Tt?.item||[],qt,Pt,$t,Kt));qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&Pt?un.answer=Pt:un.answer=Tt.answer||[{}],on&&on.length>0?un.item=on:Tt.item&&(un.item=Tt.item),vt.push(un)}),qt===jr.linkId&&typeof Zt=="number"&&Zt>=Pn.length)for(let Tt=Pn.length;Tt<=Zt;Tt++){const Kt={linkId:jr.linkId,text:jr.text,answer:Tt===Zt&&Pt?Pt:[{}]};Tt===Zt&&$t&&$t.length>0?Kt.item=$t:jr.item&&(Kt.item=Ot(jr.item,[],void 0,void 0,void 0,void 0)),vt.push(Kt)}return vt}else if(jr.repeats&&typeof Zt=="number"&&qt===jr.linkId){const vt=Pn[0]||{linkId:jr.linkId,text:jr.text,answer:[]},Tt={linkId:jr.linkId,text:jr.text,answer:[...vt.answer||[]]};if(Pt&&Pt.length>0){for(;Tt.answer.length<=Zt;)Tt.answer.push({});Tt.answer[Zt]=Pt[0]}return Tt}else{const vt=Pn[0],Tt=jr.item?Ot(jr.item,vt?.item||[],qt,Pt,$t,Zt):void 0,Kt=Tt&&Tt.length>0,un={linkId:jr.linkId,text:jr.text};return qt&&jr.linkId===qt&&typeof Zt!="number"?(Pt||!Pt&&!$t?un.answer=Pt:vt?.answer&&(un.answer=vt.answer),$t?un.item=$t:Kt&&(un.item=Tt)):(vt?.answer?un.answer=vt.answer:un.answer=[{}],Kt&&(un.item=Tt)),un}}).filter(Boolean).flat()},Ft=(pt,Yt)=>{for(const qt of pt)if(qt.linkId===Yt||qt.item&&Ft(qt.item,Yt))return qt.linkId;return null},Qt=(pt,Yt,qt,Pt)=>{var $t;const Zt=($t=pt?.item)!=null?$t:Pt;return!Zt||Zt.length===0?!0:Zt.every(An=>{var zr;const jr=K(Yt,An.linkId);if(jr.length===0){const Rn=(zr=F(Yt,An.linkId))==null?void 0:zr.answer;if(ge(An,Yt,Rn)&&te(An.enableWhen,An.enableBehavior,Yt)&&qt.includes(An.linkId))return!1}else for(const Rn of jr)if(ge(An,Yt,Rn.answer)&&te(An.enableWhen,An.enableBehavior,Yt)&&qt.includes(An.linkId))return!1;return An.item?Qt(An,Yt,qt):!0})},zt=(pt,Yt,qt=!0)=>{for(const Pt of pt)if(Pt.linkId===Yt&&Pt.answer&&Pt.answer.length>0||Pt.item&&Pt.item.length>0&&zt(Pt.item,Yt,qt))return!0;return!1},Ke=(pt,Yt,qt=0)=>{const Pt=pt.filter($t=>$t.linkId===Yt);if(Pt.length>qt){const $t=Pt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Zt=>Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(An=>An!=null&&An!==""));if($t.item&&$t.item.length>0)return zt($t.item,Yt,!1)}return zt(pt,Yt,!1)},$e=(pt,Yt)=>{if(!pt||!pt.item)return!1;const qt=Pt=>{var $t;if(Te(Pt)&&Pt.required&&te(Pt.enableWhen,Pt.enableBehavior,Yt)){const Zt=F(Yt,Pt.linkId),An=pe(Pt.extension,Pt.type,Pt.required,Pt.maxLength,Zt?.answer,Pt.answerOption);if(!(($t=Zt?.answer)!=null&&$t.length)||An)return!0}if(Pt.item){for(const Zt of Pt.item)if(qt(Zt))return!0}return!1};for(const Pt of pt.item)if(qt(Pt))return!0;return!1},Et=pt=>{var Yt,qt,Pt;if(pt.valueString!==void 0)return pt.valueString;if(pt.valueBoolean!==void 0)return pt.valueBoolean;if(pt.valueInteger!==void 0)return pt.valueInteger;if(pt.valueDecimal!==void 0)return pt.valueDecimal;if(pt.valueDate!==void 0)return pt.valueDate;if(pt.valueDateTime!==void 0)return pt.valueDateTime;if(((Yt=pt.valueCoding)==null?void 0:Yt.code)!==void 0)return pt.valueCoding.code;if(((qt=pt.valueReference)==null?void 0:qt.reference)!==void 0)return pt.valueReference.reference;if(((Pt=pt.valueQuantity)==null?void 0:Pt.value)!==void 0)return pt.valueQuantity.value;if(pt.valueAttachment!==void 0)return pt.valueAttachment},Qe=pt=>{const Yt={linkId:pt.linkId};if(pt.answer&&pt.answer.length>0){const qt=pt.answer.map(Pt=>Et(Pt)).filter(Pt=>Pt!==void 0);qt.length>0&&(Yt.answer=qt)}if(pt.item&&pt.item.length>0){const qt=pt.item.map(Pt=>Qe(Pt)).filter(Pt=>{const $t=Object.keys(Pt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Yt.item=qt)}return Yt},Ye=(pt,Yt,qt,Pt,$t,Zt)=>{var An;const zr=(An=Yt?.item)==null?void 0:An[qt[Pt]],jr=zr?.linkId;if(!jr)return!1;const Rn=K(pt,jr),Pn=K($t,jr),rn=vt=>{if(vt!=null){if(Array.isArray(vt)){const Tt=vt.filter(Kt=>Kt!=null).map(Kt=>rn(Kt)).filter(Kt=>Kt!==void 0);return Tt.length===0||Tt.length===1&&typeof Tt[0]=="object"&&Object.keys(Tt[0]).length===0?void 0:Tt}if(typeof vt=="object"){const Tt={};for(const[Kt,un]of Object.entries(vt))if(un!=null){const on=rn(un);on!==void 0&&(Tt[Kt]=on)}return Object.keys(Tt).length===0?void 0:Tt}return vt}};if(Rn.length!==Pn.length)return!1;for(let vt=0;vt<Rn.length;vt++){const Tt=Rn[vt],Kt=Pn[vt];if(!Tt||!Kt)return!1;const un=Qe(rn(Tt)),on=Qe(rn(Kt));if(!_.isEqual(un,on))return!1}return Pt!==Zt},Lt=(pt,Yt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(pt,Yt,qt)||null,mn=(pt,Yt)=>{const qt={},Pt=$t=>{$t.forEach(Zt=>{const An=K(Yt,Zt.linkId);if(st(Zt,pt)||Zt.repeats)for(let zr=0;zr<An.length;zr++){const jr=An[zr];if(jr?.answer&&jr.answer.length>0){const Rn=Lt(Zt,Yt,jr.answer);Rn&&(qt[Zt.linkId]=v(f({},qt[Zt.linkId]),{[zr]:Rn}))}}else{const zr=F(Yt,Zt.linkId);if(zr?.answer&&zr.answer.length>0){const jr=Lt(Zt,Yt,zr.answer);jr&&(qt[Zt.linkId]={0:jr})}}Zt.item&&Zt.item.length>0&&Pt(Zt.item)})};return Pt(pt),qt},Sn=pt=>{if(!pt)return"";const Yt=pt.split("-");if(Yt.length===3){const[qt,Pt,$t]=Yt;return`${qt.slice(-4)}-${Pt}-${$t}`}return""},et=pt=>pt.trim().replace(/[A-Za-z]+/g,""),Rt=(pt,Yt)=>{const qt=(Pt,$t)=>{for(const Zt of Pt){if(Zt.linkId===$t)return Zt.answer;if(Zt.item&&Zt.item.length>0){const An=qt(Zt.item,$t);if(An!==void 0)return An}}};return qt(pt,Yt)},Ht=(pt,Yt)=>{if(!Yt||Yt.length===0)return null;const qt=pt.linkId,Pt=($t,Zt,An=[])=>{for(const zr of $t){const jr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>rn.repeats===!0)?zr:null;if(Pt(zr.item,Zt,jr))return zr}}return null};return Pt(Yt,qt)},Un=(pt,Yt)=>{if(!Yt||Yt.length===0)return!1;const qt=pt.linkId,Pt=($t,Zt,An=[])=>{for(const zr of $t){const jr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>{const vt=M(rn.extension||[]);return!!vt&&vt!==UI_TOOLKIT_FORM_CONTAINER});if(Pt(zr.item,Zt,jr))return!0}}return!1};return Pt(Yt,qt)},Mr=(pt,Yt,qt)=>{const Pt={};if(!pt)return Pt;const{linkId:$t}=Yt;if(pt[$t]){const Zt=pt[$t];Pt[$t]=Zt[qt]||""}return Yt.item&&Yt.item.length>0&&Yt.item.forEach(Zt=>{if(pt[Zt.linkId]){const An=pt[Zt.linkId];Pt[Zt.linkId]=An[qt]||""}}),Pt},gn=(pt,Yt)=>{const qt={};if(!pt||!pt[Yt])return qt;const Pt=pt[Yt];return qt[Yt]=Pt[0]||"",qt},In=pt=>{const Yt=pt.findIndex(Zt=>!Te(Zt)),qt=Yt>=0?[Yt]:[],Pt=new Map;let $t=null;if(pt.forEach((Zt,An)=>{const zr=ze(Zt);if(zr&&Zt.type==="group")An!==Yt&&qt.push(An),Pt.set(An,[An]),$t=An;else if($t!==null&&!zr){const jr=Pt.get($t)||[];Pt.set($t,[...jr,An])}}),pt.length>0&&qt.length>0){const Zt=qt[0];if(!Pt.has(Zt)){const An=qt.find(jr=>jr>Zt),zr=[];for(let jr=Zt;jr<(An??pt.length);jr++)zr.push(jr);Pt.set(Zt,zr)}}return{groupIndices:qt,itemsToRenderMap:Pt}},cr=(pt,Yt,qt,Pt)=>{let $t=[...Pt];const Zt=(An,zr)=>{An.forEach(jr=>{if((!jr?.enableWhen||te(jr?.enableWhen,jr.enableBehavior,zr))&&jr.initial&&!zt(zr,jr.linkId))if(jr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Ke(zr,jr.linkId,rn)||($t=Ot(qt,$t,jr.linkId,jr.initial,void 0,rn))}):$t=Ot(qt,$t,jr.linkId,jr.initial)}else $t=Ot(qt,$t,jr.linkId,jr.initial);jr.item&&Zt(jr.item,zr)})};return Zt(pt,Yt),$t},Dn=(pt,Yt,qt)=>{if(!pt)return[];const Pt=[],$t=Zt=>{Zt.required===Yt&&te(Zt.enableWhen,Zt.enableBehavior,qt)&&!Te(Zt)&&Zt.type!=="display"&&Pt.push(Zt),Zt.item&&Zt.item.length>0&&Zt.item.forEach($t)};return pt.forEach($t),Pt},$r=(pt,Yt)=>pt.every(qt=>{var Pt;const $t=K(Yt,qt.linkId);if($t.length>0)return $t.every(Zt=>!ge(qt,Yt,Zt.answer));{const Zt=(Pt=F(Yt,qt.linkId))==null?void 0:Pt.answer;return!ge(qt,Yt,Zt)}}),qr=(pt,Yt)=>{let qt=-1;for(let Pt=pt.length-1;Pt>=0;Pt--)if(pt[Pt].linkId===Yt){qt=Pt;break}return qt},wt=(pt,Yt)=>pt.filter(qt=>qt.linkId!==Yt).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:wt(qt.item,Yt)}):qt),Ve=(pt,Yt,qt=pt)=>pt.reduce((Pt,$t)=>{const Zt=J(Yt,$t.linkId);return Zt?.enableWhen&&!te(Zt.enableWhen,Zt.enableBehavior,qt)||($t.item&&$t.item.length>0?Pt.push(v(f({},$t),{item:Ve($t.item,Yt,qt)})):Pt.push($t)),Pt},[]),ot=(pt,Yt,qt=[])=>{const Pt=[],$t=Zt=>{Zt.forEach(An=>{Pt.push(An.linkId),An.item&&An.item.length>0&&$t(An.item)})};for(let Zt=0;Zt<pt.length;Zt++){const An=pt[Zt];if(An.linkId===Yt){const zr=pt.slice(0,Zt+1),jr=pt.slice(Zt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,vt)=>{const Tt=J(qt,vt.linkId);return!Tt||ze(Tt)||Te(Tt)&&te(Tt.enableWhen,Tt.enableBehavior,zr)?rn.kept.push(vt):rn.removed.push(vt),rn},{kept:[],removed:[]});return $t(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Pt,found:!0}}if(An.item&&An.item.length>0){const zr=ot(An.item,Yt,qt);if(zr.found){const jr=pt.slice(0,Zt),Rn=pt.slice(Zt+1),Pn=[...jr,v(f({},An),{item:zr.trimmedData})],{kept:rn,removed:vt}=Rn.reduce((Tt,Kt)=>{const un=J(qt,Kt.linkId);return!un||ze(un)||Te(un)&&te(un.enableWhen,un.enableBehavior,Pn)?Tt.kept.push(Kt):Tt.removed.push(Kt),Tt},{kept:[],removed:[]});return $t(vt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Pt],found:!0}}}}return{trimmedData:pt,trimmedLinkIds:[],found:!1}},Je=(pt,Yt)=>pt.filter(qt=>!Yt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:Je(qt.item,Yt)}):qt),tt=pt=>{var Yt;if(!pt)return"empty";const qt=y.Z$.find(({patterns:Pt})=>Pt.some($t=>pt.includes($t)));return(Yt=qt?.type)!=null?Yt:"empty"},rt=(pt,Yt)=>{const{groupIndices:qt}=In(pt),Pt=pt.findIndex($t=>$t.linkId===Yt);return Pt!==-1?qt.indexOf(Pt):-1},lt=pt=>{if(!pt)return{restriction:null,warning:null};const Yt=qt=>{const Pt=pt.find(Zt=>Zt.url===qt&&Zt.valueString);if(!Pt?.valueString)return null;const $t=Pt.valueString.replace(/\\n/g,`
869
+ `}}customElements.get(ve)===void 0&&customElements.define(ve,Te);const De=[{name:"loader",defaultElement:document.createElement(ne)},{name:"error",defaultElement:document.createElement(ve)}],ze=["error","loading"],Ie={error:"error",loading:"loader"},xe=({src:Ot,elementNameSuffix:Ft,version:Qt,prefetchFeatureApp:zt})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;window.bwell||(window.bwell=new ue({metadata:{version:Qt}}));const cr=`bwell-${Ft}`;if(customElements.get(cr)!==void 0)return;class Dn extends h{constructor(){super(),Ke.add(this),$e.set(this,(0,T.nanoid)()),Et.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Ye.set(this,new q.EventEmitter),Lt.set(this,void 0),mn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),Ht.set(this,void 0),this.attachShadow({mode:"open"});const qr=new he(De).attachToShadowRoot(this.shadowRoot);qr.addEventListener("visibilitychange",({visibility:wt,container:Ve,name:ot})=>{ot==="error"&&wt==="visible"&&window.bwell._registerEmbeddableContent(Ve),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=wt==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Ht,{slots:qr,attributes:new V().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Ye,"f")},"f"),(0,p.__classPrivateFieldSet)(this,Lt,(0,p.__classPrivateFieldGet)(this,Ke,"m",Un).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,Ke,"m",Mr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,Sn,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,$e,this.id||(0,p.__classPrivateFieldGet)(this,$e,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Et,new z((0,p.__classPrivateFieldGet)(this,$e,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Et,"f").registerDispatcher(qr=>this.dispatchEvent(qr)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,Lt,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,Lt,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}),zt&&(0,b.h)(Ot).catch(()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}))})}disconnectedCallback(){var qr;(0,p.__classPrivateFieldGet)(this,Ye,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(qr=(0,p.__classPrivateFieldGet)(this,Et,"f"))===null||qr===void 0||qr.deregister(),(0,p.__classPrivateFieldGet)(this,Ye,"f").removeAllListeners()}}$e=new WeakMap,Et=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Lt=new WeakMap,mn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,Ke=new WeakSet,Un=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${cr}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,$e,"f"),name:Ft,elementName:cr,utils:(0,p.__classPrivateFieldGet)(this,Ht,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},Mr=function({visibility:qr,name:wt}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=qr==="hidden"?"unset":"hidden"},gn=function(qr){(0,p.__classPrivateFieldGet)(this,Rt,"f")(),(0,p.__classPrivateFieldSet)(this,Rt,void 0,"f")},In=function(qr){return wt=>{const Ve=ze.findIndex(Je=>Je===qr);if(!ze.slice(0,Ve).some(Je=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(Je)!==null)){if(wt!==null)(0,p.__classPrivateFieldGet)(this,Rt,"f")&&(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[qr]),"f");else if(wt===null&&(0,p.__classPrivateFieldGet)(this,Rt,"f")){(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr);const Je=ze.find(tt=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(tt)!==null);Je&&(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[Je]),"f")}}}},customElements.define(cr,Dn)}),_e={rE:"1.1099.1"},it="composite";var bt=e(67321);xe({src:`https://embeddables.prod.icanbwell.com/${it}/${_e.rE}/scripts/embeddable.federated.js`,elementNameSuffix:it,version:_e.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,b,h)=>b in p?i(p,b,{enumerable:!0,configurable:!0,writable:!0,value:h}):p[b]=h,A=(p,b)=>{for(var h in b||(b={}))c.call(b,h)&&y(p,h,b[h]);if(g)for(var h of g(b))u.call(b,h)&&y(p,h,b[h]);return p},m=(p,b)=>o(p,a(b));const d=(p,b,h)=>{const f=_.cloneDeep(p);if(!f.contained||b<0)return f;const v=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(v!==-1&&!h){const M=f.contained[v];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===b+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[v]=M}}else h&&v!==-1&&(f.contained[v]=m(A({},f.contained[v]),{item:h}));return f},O=({formId:p,questionnaireResponse:b,showQuestionPrefix:h,nextQuestion:f,onGoBack:v,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=b.questionnaire)==null?void 0:P.replace("#",""),I=(D=b?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(b);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:C,questionnaireResponseItem:(N=b?.item)!=null?N:[],questionnaireSchema:I,status:b.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:v,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,p=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},b=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,v=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Ee]=(0,t.useState)(he),[ge,re]=(0,t.useState)(he),[ae,{loading:me,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:ue,error:ne}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Te}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Ee(he)},onCompleted:Qt=>{var zt,Ke;const $e=(Ke=(zt=Qt.placeAutocomplete)==null?void 0:zt.predictions)==null?void 0:Ke.map(Et=>{var Qe;return{id:Et.placeId,label:(0,s.removeAfterLastComma)(Et.description),mainText:Et?.mainText||((Qe=Et.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Et?.secondaryText||Et.description.split(",").slice(1).join(",").trim())}});Ee($e?.length?$e:he)}}),De=(0,t.useMemo)(()=>be.map(Qt=>b(p({},Qt),{displayLabel:(0,r.RZ)(Qt?.label||"",V)})),[V,be]),ze=Qt=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if(F(Qt),G(Qt),ie(!1),Qt&&typeof Qt=="string"){const cr=be.find(tt=>tt.id===Qt),Dn=cr?.label||V;if(!cr)return;q(Dn),k(Dn),setTimeout(()=>{const tt=[{id:cr.id,label:cr.label}];Ee(tt),re(tt)},f);const $r=yield ae({variables:{placeId:Qt}}),qr=(Ke=(zt=$r?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,wt=(Et=($e=$r?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,Ve=((Ye=(Qe=$r?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((mn=(Lt=$r?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(Sn=$r?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(qr&&wt)if(!Ve||!Je){const tt=yield de({variables:{latitude:String(qr),longitude:String(wt)}}),rt=((Ht=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",lt=((Mr=(Un=tt?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",St=((In=(gn=tt?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:qr,longitude:wt,zipCode:rt,state:lt,stateCode:St,placeId:Qt,description:Dn,value:Qt})}else T({latitude:qr,longitude:wt,zipCode:Ve,state:ot,stateCode:Je,placeId:Qt,description:Dn,value:Qt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Qt=>h(void 0,null,function*(){return yield J({variables:{input:Qt,types:"geocode"}})})),_e=Qt=>h(void 0,null,function*(){if(ie(!1),q(Qt),z?.(Qt),!Qt||Qt.trim().length===0){F(null),Ee(he),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Qt});return}const zt=Qt.trim();zt.length>=2?yield xe(zt):Ee(he)}),it=Qt=>{te.current=Qt},bt=()=>{q(I),Ee(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if(N&&w){Ee([{id:N,label:V||w}]),re([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const cr=yield ae({variables:{placeId:N}}),Dn=(Ke=(zt=cr?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,$r=(Et=($e=cr?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,qr=((Ye=(Qe=cr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",wt=((mn=(Lt=cr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Ve=((et=(Sn=cr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Dn&&$r)if(!qr||!wt||!Ve){const ot=yield de({variables:{latitude:String(Dn),longitude:String($r)}}),Je=((Ht=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",tt=((Mr=(Un=ot?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",rt=((In=(gn=ot?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Dn,longitude:$r,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Dn,longitude:$r,zipCode:qr,state:wt,stateCode:Ve,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Ee(he),re(he)}))()},[]);const Ot=se||!!pe||!!ne||!!Te||!!R,Ft=Ot?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:it,onBlur:bt,isInvalid:Ot,hint:Ft,autoComplete:"address-line1",className:"w-full",children:Qt=>{const zt=Qt,Ke=V.trim().length>=2,$e=zt.mainText||"",Et=zt.secondaryText||"",Qe=$e.trim().length>0,Ye=Et.trim().length>0,Lt=Qe?(0,r.RZ)($e,V):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Ye?(0,r.RZ)(Et,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:zt.id,supportingText:zt.supportingText,isDisabled:zt.isDisabled,icon:zt.icon,avatarUrl:zt.avatarUrl,textValue:zt.label,children:Ke&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:zt.label})})}})})}},18077:()=>{},12200:(Z,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const p=c.getId(O),b=c.getRouteMeta(p)||{},h=getBreadcrumbTitleKey(p,b,u);if(!h||b.breadcrumbHide)return[];const f=y[p];let v=c.getHref(p),M=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:p,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:p,href:v,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,v=(C,R)=>{for(var L in R||(R={}))b.call(R,L)&&f(C,L,R[L]);if(p)for(var L of p(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(v({},q.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Te){Te instanceof Error?P?.error(Te,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Te)}`)}},[w,P]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Te=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Te,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Ee=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield he()))return P?.error("Location services not available"),!1;const Te=yield Ee();return Te!==o.Ef.GRANTED&&Te!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Te}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[he,P,Ee]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Te=N.locationPermission;if(Te===o.Ef.DENIED||Te===o.Ef.BLOCKED||Te===o.Ef.UNAVAILABLE){F(Te);return}k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}if(Te===o.Ef.GRANTED){try{const Ie=yield Ee();if(Ie===o.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Ee();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield re())){te(o.Ef.UNAVAILABLE);return}k(!0);let Te=yield Ee();if(te(Te),Te===o.Ef.GRANTED||Te===o.Ef.PROMPT){if(L==="Android"&&Te===o.Ef.GRANTED)try{Te=yield ge(),te(Te)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Te!==o.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[re,P,L,te,be,Ee,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield he())?yield Ee():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[he,P,Ee]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Te=yield Ee();te(Te)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[he,P,te,Ee]),de=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Te=yield Ee();if(Te===o.Ef.DENIED||Te===o.Ef.BLOCKED||Te===o.Ef.UNAVAILABLE){te(Te);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Te=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Te?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Te}`)}te(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[he,P,te,be,ge,Ee]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Te=yield be(z);Te&&(G(Te),F(o.Ef.GRANTED),w(M(v({},q.current),{location:`${Te.coords.latitude},${Te.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Te.coords.latitude}`,lng:`${Te.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[he,P,w,te,be]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(v({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:ne,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:de,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:me}),[I,ne,U,K,ae,de,ue,pe,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>In,GI:()=>F,rz:()=>Ft,Fp:()=>Ot,el:()=>bt,ao:()=>it,oA:()=>T,Yt:()=>cr,g4:()=>_e,tn:()=>wt,n4:()=>S,gD:()=>z,Vp:()=>Mr,Cx:()=>P,bK:()=>R,gi:()=>gn,Z$:()=>he,GT:()=>Un,hr:()=>be,JL:()=>Ee,Ck:()=>L,dU:()=>C,wG:()=>Ye,hZ:()=>Et,$e:()=>Qt,qT:()=>$e,GQ:()=>Ke,q3:()=>Qe,D_:()=>zt,Uf:()=>N,_l:()=>G,Md:()=>q,V7:()=>V,fe:()=>ie,JP:()=>ye,Z_:()=>E,zO:()=>te,UZ:()=>k,$7:()=>xe,rb:()=>w,VF:()=>Rt,vf:()=>mn,PV:()=>Ht,PS:()=>Lt,Iz:()=>et,zD:()=>I,m3:()=>De,XP:()=>ze,PM:()=>pe,cX:()=>ge,G6:()=>re,Us:()=>ue,AA:()=>me,G0:()=>Te,mO:()=>J,HH:()=>de,PU:()=>qr,Tl:()=>ve,uH:()=>Ie,c3:()=>ae,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const i=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),A=e(9495);const m=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const p=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));p.displayName="Virus";const b=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));b.displayName="CreditCard02";const h=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const v=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));v.displayName="ClipboardPlus";const M=({size:Fe=24,color:Se="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Fe,height:Fe,stroke:Se,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));M.displayName="Route";const x=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,z="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",T="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",S="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",C="http://hl7.org/fhir/StructureDefinition/minValue",R="http://hl7.org/fhir/StructureDefinition/maxValue",L="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",P="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",N="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",w="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",V="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",q="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",k="tz-code",U="footer",F="check-box",K="header",G="page",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],be={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},Ee={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ge="ui-toolkit/CoordinatePicker",re="ui-toolkit/DetailsInfo",ae="ui-toolkit/ServiceChoice",me="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",de="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",ne="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ve="ui-toolkit/SelectableOption",Te="ui-toolkit/Modal",De="ui-toolkit/Alert",ze="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",_e="http://icanbwell.com/fhir/StructureDefinition/icon-name",it="http://icanbwell.com/fhir/StructureDefinition/error-title",bt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ot="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ft="http://icanbwell.com/fhir/StructureDefinition/description",Qt="http://icanbwell.com/fhir/StructureDefinition/modal-description",zt="http://icanbwell.com/fhir/StructureDefinition/modal-title",Ke="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",$e="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Et="http://icanbwell.com/fhir/StructureDefinition/button-text",Qe="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Lt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Sn="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",et="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ht="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Un="http://hl7.org/fhir/StructureDefinition/mimeType",Mr="http://hl7.org/fhir/StructureDefinition/maxSize",gn="http://icanbwell.com/fhir/StructureDefinition/message-severity",In="http://icanbwell.com/fhir/StructureDefinition/alert-color",cr="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dn="http://icanbwell.com/fhir/StructureDefinition/placeholder",$r="http://icanbwell.com/fhir/StructureDefinition/hint-text",qr="ui-toolkit/PrefilledMemberDemographicsAlert",wt="http://hl7.org/fhir/issue-severity",Ve="http://icanbwell.com/fhir/StructureDefinition/button-type",ot="http://icanbwell.com/fhir/StructureDefinition/button-action",Je="button-type",tt="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",rt="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",lt="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",St="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",st="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",le={},ye={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:p,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":b,"link-03":h,"search-lg":f.q,"clipboard-plus":v,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>wt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>w,mR:()=>yt,nt:()=>z,od:()=>N,t7:()=>it,yQ:()=>Se,zj:()=>pe});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(69364),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(pt,Yt,qt)=>Yt in pt?A(pt,Yt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):pt[Yt]=qt,f=(pt,Yt)=>{for(var qt in Yt||(Yt={}))p.call(Yt,qt)&&h(pt,qt,Yt[qt]);if(O)for(var qt of O(Yt))b.call(Yt,qt)&&h(pt,qt,Yt[qt]);return pt},v=(pt,Yt)=>m(pt,d(Yt));const M=pt=>{var Yt;return(Yt=pt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Pt,$t;return($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)!=null?$t:[]}).find(qt=>{var Pt;return(Pt=qt.code)==null?void 0:Pt.startsWith("ui-toolkit/")}))==null?void 0:Yt.code},x=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.V7);return qt?.valueCode||"off"},z=(pt,Yt,qt)=>{const Pt=(0,u.A)(qt);return pt&&Yt&&qt?Pt.replace("<p>",`<span>${Yt} `).replace("</p>","</span>").trim():Pt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=pt=>{const Yt=pt?.find(qt=>qt.url===y.Vp);return Yt?.valueInteger},S=pt=>{const Yt=pt?.find(qt=>qt.url===y.Z_);return Yt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(pt,Yt)=>{const qt=pt?.find(Pt=>Pt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Yt&&E[Yt]||C},L=pt=>{const Yt=pt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Yt?.valueString},P=pt=>{const Yt=pt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Yt?.length?Yt.join(","):void 0},D=pt=>pt.split(",").map(Pt=>Pt.trim()).map(Pt=>y.JL[Pt]||Pt).filter((Pt,$t,Zt)=>Zt.indexOf(Pt)===$t).join(", "),N=(pt,Yt,qt)=>{const Pt=D(pt),$t=Pt.lastIndexOf(","),Zt=$t!==-1?`${Pt.substring(0,$t)} or${Pt.substring($t+1)}`:Pt,An=[Yt&&`max. ${(Yt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return An.length>0?`${Zt} (${An.join(", ")})`:Zt},w=pt=>{const Yt=pt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Yt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(pt,Yt)=>{var qt,Pt,$t;const Zt=Yt?.find(An=>An.url.includes(pt));return($t=(Pt=(qt=Zt?.valueInteger)!=null?qt:Zt?.valueDecimal)!=null?Pt:Zt?.valueString)!=null?$t:Zt?.valueDate},q=pt=>{if(!!pt){if(/^\d{4}-\d{2}-\d{2}$/.test(pt))return pt;try{const Yt=(0,o.evaluate)({},pt);if(Array.isArray(Yt)&&Yt.length>0){const qt=Yt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Pt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Zt=String(qt.getDate()).padStart(2,"0");return`${Pt}-${$t}-${Zt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(pt,Yt)=>{var qt,Pt;const $t=Yt?.find(An=>An.url===pt);if(!$t)return;const Zt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Zt||q((Pt=$t.valueExpression)==null?void 0:Pt.expression)},k=(pt,Yt)=>{if(!(!pt||pt.length===0))for(const qt of pt){const Pt=V(Yt,qt.extension);if(Pt!==void 0)return Pt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Yt);if($t!==void 0)return $t}}},U=(pt,Yt)=>{try{const qt=String(pt??Yt);let Pt;if(qt.includes("/"))Pt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Pt=(0,t.A)($t)}return(0,r.A)(Pt)}catch(qt){return console.error("Date parsing error:",qt,pt),null}},F=(pt,Yt)=>{var qt;for(const Pt of pt){if(Pt.linkId===Yt)return Pt;if((qt=Pt.item)!=null&&qt.length){const $t=F(Pt.item,Yt);if($t!==void 0)return $t}}},K=(pt,Yt)=>{var qt;const Pt=[];for(const $t of pt)if($t.linkId===Yt&&Pt.push($t),(qt=$t.item)!=null&&qt.length){const Zt=K($t.item,Yt);Pt.push(...Zt)}return Pt},G=(pt,Yt,qt=0)=>K(pt,Yt)[qt];function se(pt){return pt!=null}const ie=(pt,Yt)=>{var qt,Pt,$t;if("answerString"in pt&&se(pt.answerString)){if(pt.operator==="=")return Yt?.valueString===pt.answerString;if(pt.operator==="!=")return Yt?.valueString!==pt.answerString}if("answerBoolean"in pt&&se(pt.answerBoolean)){if(pt.operator==="=")return Yt?.valueBoolean===pt.answerBoolean;if(pt.operator==="!=")return Yt?.valueBoolean!==pt.answerBoolean}if("answerInteger"in pt&&se(pt.answerInteger)||"answerDecimal"in pt&&se(pt.answerDecimal)){const Zt=Number(Yt?.valueInteger||Yt?.valueDecimal),An=Number(pt.answerInteger||pt.answerDecimal);if(pt.operator==="=")return Zt===An;if(pt.operator==="!=")return Zt!==An;if(pt.operator===">")return Zt>An;if(pt.operator==="<")return Zt<An;if(pt.operator===">=")return Zt>=An;if(pt.operator==="<=")return Zt<=An}if("answerQuantity"in pt&&se(pt.answerQuantity)){const Zt=Yt?.valueQuantity,An=pt.answerQuantity;if(Zt?.unit!==An?.unit)return!1;if(pt.operator==="=")return Zt.value===An.value;if(pt.operator==="!=")return Zt.value!==An.value;if(pt.operator===">")return Zt.value>An.value;if(pt.operator==="<")return Zt.value<An.value;if(pt.operator===">=")return Zt.value>=An.value;if(pt.operator==="<=")return Zt.value<=An.value}if("answerCoding"in pt&&se(pt.answerCoding)){const Zt=Yt?.valueCoding,An=pt.answerCoding;if(pt.operator==="=")return Zt?.code===An.code;if(pt.operator==="!=")return Zt?.code!==An.code}if("answerReference"in pt&&se(pt.answerReference)){const Zt=Yt?.valueReference,An=pt.answerReference;if(pt.operator==="=")return Zt?.reference===An.reference;if(pt.operator==="!=")return Zt?.reference!==An.reference}if("answerDate"in pt&&se(pt.answerDate)||"answerDateTime"in pt&&se(pt.answerDateTime)||"answerTime"in pt&&se(pt.answerTime)){const Zt=new Date(($t=(Pt=(qt=Yt?.valueDate)!=null?qt:Yt?.valueDateTime)!=null?Pt:Yt?.valueTime)!=null?$t:""),An=new Date(pt.answerDate||pt.answerDateTime||pt.answerTime||"");if(pt.operator==="=")return Zt.getTime()===An.getTime();if(pt.operator==="!=")return Zt.getTime()!==An.getTime();if(pt.operator===">")return Zt.getTime()>An.getTime();if(pt.operator==="<")return Zt.getTime()<An.getTime();if(pt.operator===">=")return Zt.getTime()>=An.getTime();if(pt.operator==="<=")return Zt.getTime()<=An.getTime()}return pt.operator==="exists"?Yt!=null===pt.answerBoolean:!0},te=(pt,Yt,qt)=>{const Pt=$t=>{const Zt=K(qt,$t.question);return Zt.length===0||Zt.every(An=>!An.answer||An.answer.length===0)?ie($t,void 0):Zt.some(An=>{var zr;return(zr=An.answer)==null?void 0:zr.some(jr=>ie($t,jr&&Object.keys(jr).length>0?jr:void 0))})};return pt&&pt?.length>0?Yt==="any"?pt?.some($t=>Pt($t)):pt?.every($t=>Pt($t)):!0},he=(pt,Yt,qt,Pt,$t)=>{if(!pt||pt.length===0)return!0;const Zt=An=>{var zr;let jr;if(Pt&&typeof $t=="number"){const Pn=qt.filter(rn=>rn.linkId===Pt)[$t];if(Pn?.item){const rn=Pn.item.find(vt=>vt.linkId===An.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))}}if(!jr){const Rn=K(qt,An.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))});jr=void 0}return ie(An,jr)};return Yt==="any"?pt.some(An=>Zt(An)):pt.every(An=>Zt(An))},be=(pt,Yt)=>{var qt;if(!!((qt=pt?.valueExpression)!=null&&qt.expression))try{const Pt=evaluate(Yt,pt.valueExpression.expression);return Array.isArray(Pt)?Pt.some($t=>Boolean($t)):Boolean(Pt)}catch{return}},Ee=(pt,Yt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Zt=>Zt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Pt,Yt);return v(f({},pt),{readOnly:$t??pt.readOnly})},ge=(pt,Yt,qt)=>{const{required:Pt,maxLength:$t,type:Zt,extension:An,enableWhen:zr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=pt;if(!te(zr,jr,Yt)||pt.type==="group"||pt.type==="display")return"";if(Rn)return re(pt,Yt,qt);const rn=de(pt,Yt);return rn&&ue(rn,pt)?ne(pt,Yt,qt,rn):pe(An,Zt,Pt,$t,qt,Pn)},re=(pt,Yt,qt)=>{const{required:Pt}=pt;if(Pt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Zt=0;Zt<qt.length;Zt++){const An=qt[Zt];if(An&&Object.keys(An).length>0&&Object.values(An).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){$t=!0;const jr=pe(pt.extension,pt.type,!0,pt.maxLength,[An],pt.answerOption);if(jr)return`Item ${Zt+1}: ${jr}`;if(pt.item&&pt.item.length>0){const Rn=ae(pt.item,Yt,pt.linkId,Zt);if(Rn)return`Item ${Zt+1}: ${Rn}`}}else return`Item ${Zt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Zt=qt[$t];if(Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=pe(pt.extension,pt.type,!1,pt.maxLength,[Zt],pt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(pt.item&&pt.item.length>0){const jr=ae(pt.item,Yt,pt.linkId,$t);if(jr)return`Item ${$t+1}: ${jr}`}}}return""},ae=(pt,Yt,qt,Pt)=>{var $t,Zt;for(const An of pt){if(!he(An.enableWhen,An.enableBehavior,Yt,qt,Pt))continue;const zr=F(Yt,qt),jr=($t=zr?.item)==null?void 0:$t.find(Pn=>Pn.linkId===An.linkId),Rn=(Zt=jr?.answer)!=null&&Zt[Pt]?[jr.answer[Pt]]:void 0;if(An.required){if(!Rn||!Rn[0]||!me(Rn[0]))return`${An.text||An.linkId} is required`;const Pn=pe(An.extension,An.type,!0,An.maxLength,Rn,An.answerOption);if(Pn)return`${An.text||An.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&me(Rn[0])){const Pn=pe(An.extension,An.type,!1,An.maxLength,Rn,An.answerOption);if(Pn)return`${An.text||An.linkId}: ${Pn}`}if(An.item&&An.item.length>0){const Pn=ae(An.item,Yt,An.linkId,Pt);if(Pn)return Pn}}return""},me=pt=>!pt||Object.keys(pt).length===0?!1:Object.values(pt).some(Yt=>Yt!=null&&Yt!==""&&(Array.isArray(Yt)?Yt.length>0:!0)),pe=(pt,Yt,qt,Pt,$t,Zt)=>{var An,zr,jr,Rn,Pn;let rn="";const vt=!!pt?.find(Cn=>{var jn,wr;return Cn.url===y.gD&&((wr=(jn=Cn.valueCodeableConcept)==null?void 0:jn.coding)==null?void 0:wr.some(Wr=>Wr.system===y.n4&&Wr.code===y.GI))}),Tt=$t?.[0],Kt={choice:((An=Tt?.valueCoding)==null?void 0:An.code)||(Tt?.valueString&&Zt?.some(Cn=>Cn.valueString===Tt.valueString)?Tt.valueString:null),"open-choice":((zr=Tt?.valueCoding)==null?void 0:zr.code)||Tt?.valueString,boolean:Tt?.valueBoolean,string:Tt?.valueString,text:Tt?.valueString,url:Tt?.valueUri,integer:Tt?.valueInteger,decimal:Tt?.valueDecimal,dateTime:Tt?.valueDateTime,date:Tt?.valueDate,time:Tt?.valueTime,quantity:(jr=Tt?.valueQuantity)==null?void 0:jr.value,reference:(Rn=Tt?.valueReference)==null?void 0:Rn.display,attachment:(Pn=Tt?.valueAttachment)==null?void 0:Pn.title};if(!(Yt in Kt))return"";const un=Kt[Yt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Yt==="boolean"&&un!==!0&&vt)?"This field is required":"",maxLength:()=>Pt&&un!==null&&un!==void 0&&un.toString().length>Pt?`Input should not exceed ${Pt} characters`:"",minLength:()=>{const Cn=V("minLength",pt);return Cn&&un!==null&&un!==void 0&&un.toString().length<Number(Cn)?`Input should be at least ${Cn} characters`:""},urlRegex:()=>{const Cn=new RegExp(y.rx),jn=V("regexError",pt),wr=jn??"Please enter a valid url starting from http:// and https://";return Cn&&Yt==="url"&&un&&!Cn.test(un)?String(wr):""},regex:()=>{const Cn=V("regex",pt);if(!Cn||typeof un!="string")return"";const jn=new RegExp(Cn),wr=V("regexError",pt),Wr=wr??"Please enter a valid input";return jn&&un&&!jn.test(un)?String(Wr):""},dateTime:()=>{if(Yt==="dateTime"&&un){const Cn=un?.toString(),jn=new Date(Cn);return isNaN(jn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Yt!=="date"||!un)return"";const Cn=un.replace(/\D/g,"");return Cn.length>0&&Cn.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.dU,pt),Wr=U(wr??"01/01/1900","01/01/1900"),_r=U(un,"");if(!Wr||!_r)return"";if((0,s.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Ck))==null?void 0:Cn.valueString;return f0??`Date should not be before ${wr??"01/01/1900"}`}return""}const jn=V("minValue",pt);return jn!=null&&un!==null&&un!==void 0&&un<jn?`Input should not be less than ${jn}`:""},maxValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.bK,pt),Wr=U(wr??"01/01/2100","01/01/2100"),_r=U(un,"");if(!Wr||!_r)return"";if((0,i.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Cx))==null?void 0:Cn.valueString;return f0??`Date should not be after ${wr??"01/01/2100"}`}return""}const jn=V("maxValue",pt);return jn!=null&&un!==null&&un!==void 0&&un>jn?`Input should not exceed ${jn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},de=(pt,Yt)=>{for(const qt of Yt)if(qt.item){if(qt.item.find(Zt=>Zt.linkId===pt.linkId))return qt;const $t=de(pt,qt.item);if($t)return $t}return null},ue=(pt,Yt)=>{if(pt.answer&&pt.answer.length>1)return!0;if(pt.item){const qt=pt.item.find(Pt=>Pt.linkId===Yt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},ne=(pt,Yt,qt,Pt)=>{var $t,Zt;const{required:An}=pt,zr=($t=Pt.item)==null?void 0:$t.find(Pn=>Pn.linkId===pt.linkId),jr=zr?.answer||[],Rn=((Zt=Pt.answer)==null?void 0:Zt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=jr[Pn];if(An){if(!rn||!me(rn))return`Item ${Pn+1}: ${pt.text||pt.linkId} is required`;const vt=pe(pt.extension,pt.type,!0,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}else if(rn&&me(rn)){const vt=pe(pt.extension,pt.type,!1,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}}return""},J=(pt,Yt)=>{for(const qt of pt){if(qt?.linkId===Yt)return qt;if(qt?.item&&qt.item.length>0){const Pt=J(qt.item,Yt);if(Pt)return Pt}}},ve=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===FOOTER_CODE))}))},Te=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===HEADER_CODE))}))},ze=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===y.gD&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===y.n4&&Zt.code===y._l))}))},Ie=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===CHECKBOX_CODE))}))},_e=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.fe);return qt?.valueInteger},it=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.zO);return qt?.valueInteger},bt=pt=>{var Yt;const qt=(Yt=pt?.extension)==null?void 0:Yt.find(Pt=>Pt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},Ot=(pt,Yt,qt,Pt,$t,Zt)=>{const An=jr=>Yt.filter(Rn=>Rn.linkId===jr),zr=new Set;return pt.map(jr=>{if(zr.has(jr.linkId)||ve(jr))return null;const Pn=An(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(zr.add(jr.linkId),rn){const vt=[];if(Pn.forEach((Tt,Kt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&$t&&$t.length>0){const Cn=Tt?.item||[];on=[...Cn],$t.forEach(jn=>{const wr=on.findIndex(Wr=>Wr.linkId===jn.linkId);wr>=0?on[wr]=v(f({},Cn[wr]),{answer:jn.answer}):on.push(jn)})}else jr.item&&(on=Ot(jr.item,Tt?.item||[],qt,Pt,$t,Kt));qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&Pt?un.answer=Pt:un.answer=Tt.answer||[{}],on&&on.length>0?un.item=on:Tt.item&&(un.item=Tt.item),vt.push(un)}),qt===jr.linkId&&typeof Zt=="number"&&Zt>=Pn.length)for(let Tt=Pn.length;Tt<=Zt;Tt++){const Kt={linkId:jr.linkId,text:jr.text,answer:Tt===Zt&&Pt?Pt:[{}]};Tt===Zt&&$t&&$t.length>0?Kt.item=$t:jr.item&&(Kt.item=Ot(jr.item,[],void 0,void 0,void 0,void 0)),vt.push(Kt)}return vt}else if(jr.repeats&&typeof Zt=="number"&&qt===jr.linkId){const vt=Pn[0]||{linkId:jr.linkId,text:jr.text,answer:[]},Tt={linkId:jr.linkId,text:jr.text,answer:[...vt.answer||[]]};if(Pt&&Pt.length>0){for(;Tt.answer.length<=Zt;)Tt.answer.push({});Tt.answer[Zt]=Pt[0]}return Tt}else{const vt=Pn[0],Tt=jr.item?Ot(jr.item,vt?.item||[],qt,Pt,$t,Zt):void 0,Kt=Tt&&Tt.length>0,un={linkId:jr.linkId,text:jr.text};return qt&&jr.linkId===qt&&typeof Zt!="number"?(Pt||!Pt&&!$t?un.answer=Pt:vt?.answer&&(un.answer=vt.answer),$t?un.item=$t:Kt&&(un.item=Tt)):(vt?.answer?un.answer=vt.answer:un.answer=[{}],Kt&&(un.item=Tt)),un}}).filter(Boolean).flat()},Ft=(pt,Yt)=>{for(const qt of pt)if(qt.linkId===Yt||qt.item&&Ft(qt.item,Yt))return qt.linkId;return null},Qt=(pt,Yt,qt,Pt)=>{var $t;const Zt=($t=pt?.item)!=null?$t:Pt;return!Zt||Zt.length===0?!0:Zt.every(An=>{var zr;const jr=K(Yt,An.linkId);if(jr.length===0){const Rn=(zr=F(Yt,An.linkId))==null?void 0:zr.answer;if(ge(An,Yt,Rn)&&te(An.enableWhen,An.enableBehavior,Yt)&&qt.includes(An.linkId))return!1}else for(const Rn of jr)if(ge(An,Yt,Rn.answer)&&te(An.enableWhen,An.enableBehavior,Yt)&&qt.includes(An.linkId))return!1;return An.item?Qt(An,Yt,qt):!0})},zt=(pt,Yt,qt=!0)=>{for(const Pt of pt)if(Pt.linkId===Yt&&Pt.answer&&Pt.answer.length>0||Pt.item&&Pt.item.length>0&&zt(Pt.item,Yt,qt))return!0;return!1},Ke=(pt,Yt,qt=0)=>{const Pt=pt.filter($t=>$t.linkId===Yt);if(Pt.length>qt){const $t=Pt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Zt=>Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(An=>An!=null&&An!==""));if($t.item&&$t.item.length>0)return zt($t.item,Yt,!1)}return zt(pt,Yt,!1)},$e=(pt,Yt)=>{if(!pt||!pt.item)return!1;const qt=Pt=>{var $t;if(Te(Pt)&&Pt.required&&te(Pt.enableWhen,Pt.enableBehavior,Yt)){const Zt=F(Yt,Pt.linkId),An=pe(Pt.extension,Pt.type,Pt.required,Pt.maxLength,Zt?.answer,Pt.answerOption);if(!(($t=Zt?.answer)!=null&&$t.length)||An)return!0}if(Pt.item){for(const Zt of Pt.item)if(qt(Zt))return!0}return!1};for(const Pt of pt.item)if(qt(Pt))return!0;return!1},Et=pt=>{var Yt,qt,Pt;if(pt.valueString!==void 0)return pt.valueString;if(pt.valueBoolean!==void 0)return pt.valueBoolean;if(pt.valueInteger!==void 0)return pt.valueInteger;if(pt.valueDecimal!==void 0)return pt.valueDecimal;if(pt.valueDate!==void 0)return pt.valueDate;if(pt.valueDateTime!==void 0)return pt.valueDateTime;if(((Yt=pt.valueCoding)==null?void 0:Yt.code)!==void 0)return pt.valueCoding.code;if(((qt=pt.valueReference)==null?void 0:qt.reference)!==void 0)return pt.valueReference.reference;if(((Pt=pt.valueQuantity)==null?void 0:Pt.value)!==void 0)return pt.valueQuantity.value;if(pt.valueAttachment!==void 0)return pt.valueAttachment},Qe=pt=>{const Yt={linkId:pt.linkId};if(pt.answer&&pt.answer.length>0){const qt=pt.answer.map(Pt=>Et(Pt)).filter(Pt=>Pt!==void 0);qt.length>0&&(Yt.answer=qt)}if(pt.item&&pt.item.length>0){const qt=pt.item.map(Pt=>Qe(Pt)).filter(Pt=>{const $t=Object.keys(Pt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Yt.item=qt)}return Yt},Ye=(pt,Yt,qt,Pt,$t,Zt)=>{var An;const zr=(An=Yt?.item)==null?void 0:An[qt[Pt]],jr=zr?.linkId;if(!jr)return!1;const Rn=K(pt,jr),Pn=K($t,jr),rn=vt=>{if(vt!=null){if(Array.isArray(vt)){const Tt=vt.filter(Kt=>Kt!=null).map(Kt=>rn(Kt)).filter(Kt=>Kt!==void 0);return Tt.length===0||Tt.length===1&&typeof Tt[0]=="object"&&Object.keys(Tt[0]).length===0?void 0:Tt}if(typeof vt=="object"){const Tt={};for(const[Kt,un]of Object.entries(vt))if(un!=null){const on=rn(un);on!==void 0&&(Tt[Kt]=on)}return Object.keys(Tt).length===0?void 0:Tt}return vt}};if(Rn.length!==Pn.length)return!1;for(let vt=0;vt<Rn.length;vt++){const Tt=Rn[vt],Kt=Pn[vt];if(!Tt||!Kt)return!1;const un=Qe(rn(Tt)),on=Qe(rn(Kt));if(!_.isEqual(un,on))return!1}return Pt!==Zt},Lt=(pt,Yt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(pt,Yt,qt)||null,mn=(pt,Yt)=>{const qt={},Pt=$t=>{$t.forEach(Zt=>{const An=K(Yt,Zt.linkId);if(st(Zt,pt)||Zt.repeats)for(let zr=0;zr<An.length;zr++){const jr=An[zr];if(jr?.answer&&jr.answer.length>0){const Rn=Lt(Zt,Yt,jr.answer);Rn&&(qt[Zt.linkId]=v(f({},qt[Zt.linkId]),{[zr]:Rn}))}}else{const zr=F(Yt,Zt.linkId);if(zr?.answer&&zr.answer.length>0){const jr=Lt(Zt,Yt,zr.answer);jr&&(qt[Zt.linkId]={0:jr})}}Zt.item&&Zt.item.length>0&&Pt(Zt.item)})};return Pt(pt),qt},Sn=pt=>{if(!pt)return"";const Yt=pt.split("-");if(Yt.length===3){const[qt,Pt,$t]=Yt;return`${qt.slice(-4)}-${Pt}-${$t}`}return""},et=pt=>pt.trim().replace(/[A-Za-z]+/g,""),Rt=(pt,Yt)=>{const qt=(Pt,$t)=>{for(const Zt of Pt){if(Zt.linkId===$t)return Zt.answer;if(Zt.item&&Zt.item.length>0){const An=qt(Zt.item,$t);if(An!==void 0)return An}}};return qt(pt,Yt)},Ht=(pt,Yt)=>{if(!Yt||Yt.length===0)return null;const qt=pt.linkId,Pt=($t,Zt,An=[])=>{for(const zr of $t){const jr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>rn.repeats===!0)?zr:null;if(Pt(zr.item,Zt,jr))return zr}}return null};return Pt(Yt,qt)},Un=(pt,Yt)=>{if(!Yt||Yt.length===0)return!1;const qt=pt.linkId,Pt=($t,Zt,An=[])=>{for(const zr of $t){const jr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>{const vt=M(rn.extension||[]);return!!vt&&vt!==UI_TOOLKIT_FORM_CONTAINER});if(Pt(zr.item,Zt,jr))return!0}}return!1};return Pt(Yt,qt)},Mr=(pt,Yt,qt)=>{const Pt={};if(!pt)return Pt;const{linkId:$t}=Yt;if(pt[$t]){const Zt=pt[$t];Pt[$t]=Zt[qt]||""}return Yt.item&&Yt.item.length>0&&Yt.item.forEach(Zt=>{if(pt[Zt.linkId]){const An=pt[Zt.linkId];Pt[Zt.linkId]=An[qt]||""}}),Pt},gn=(pt,Yt)=>{const qt={};if(!pt||!pt[Yt])return qt;const Pt=pt[Yt];return qt[Yt]=Pt[0]||"",qt},In=pt=>{const Yt=pt.findIndex(Zt=>!Te(Zt)),qt=Yt>=0?[Yt]:[],Pt=new Map;let $t=null;if(pt.forEach((Zt,An)=>{const zr=ze(Zt);if(zr&&Zt.type==="group")An!==Yt&&qt.push(An),Pt.set(An,[An]),$t=An;else if($t!==null&&!zr){const jr=Pt.get($t)||[];Pt.set($t,[...jr,An])}}),pt.length>0&&qt.length>0){const Zt=qt[0];if(!Pt.has(Zt)){const An=qt.find(jr=>jr>Zt),zr=[];for(let jr=Zt;jr<(An??pt.length);jr++)zr.push(jr);Pt.set(Zt,zr)}}return{groupIndices:qt,itemsToRenderMap:Pt}},cr=(pt,Yt,qt,Pt)=>{let $t=[...Pt];const Zt=(An,zr)=>{An.forEach(jr=>{if((!jr?.enableWhen||te(jr?.enableWhen,jr.enableBehavior,zr))&&jr.initial&&!zt(zr,jr.linkId))if(jr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Ke(zr,jr.linkId,rn)||($t=Ot(qt,$t,jr.linkId,jr.initial,void 0,rn))}):$t=Ot(qt,$t,jr.linkId,jr.initial)}else $t=Ot(qt,$t,jr.linkId,jr.initial);jr.item&&Zt(jr.item,zr)})};return Zt(pt,Yt),$t},Dn=(pt,Yt,qt)=>{if(!pt)return[];const Pt=[],$t=Zt=>{Zt.required===Yt&&te(Zt.enableWhen,Zt.enableBehavior,qt)&&!Te(Zt)&&Zt.type!=="display"&&Pt.push(Zt),Zt.item&&Zt.item.length>0&&Zt.item.forEach($t)};return pt.forEach($t),Pt},$r=(pt,Yt)=>pt.every(qt=>{var Pt;const $t=K(Yt,qt.linkId);if($t.length>0)return $t.every(Zt=>!ge(qt,Yt,Zt.answer));{const Zt=(Pt=F(Yt,qt.linkId))==null?void 0:Pt.answer;return!ge(qt,Yt,Zt)}}),qr=(pt,Yt)=>{let qt=-1;for(let Pt=pt.length-1;Pt>=0;Pt--)if(pt[Pt].linkId===Yt){qt=Pt;break}return qt},wt=(pt,Yt)=>pt.filter(qt=>qt.linkId!==Yt).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:wt(qt.item,Yt)}):qt),Ve=(pt,Yt,qt=pt)=>pt.reduce((Pt,$t)=>{const Zt=J(Yt,$t.linkId);return Zt?.enableWhen&&!te(Zt.enableWhen,Zt.enableBehavior,qt)||($t.item&&$t.item.length>0?Pt.push(v(f({},$t),{item:Ve($t.item,Yt,qt)})):Pt.push($t)),Pt},[]),ot=(pt,Yt,qt=[])=>{const Pt=[],$t=Zt=>{Zt.forEach(An=>{Pt.push(An.linkId),An.item&&An.item.length>0&&$t(An.item)})};for(let Zt=0;Zt<pt.length;Zt++){const An=pt[Zt];if(An.linkId===Yt){const zr=pt.slice(0,Zt+1),jr=pt.slice(Zt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,vt)=>{const Tt=J(qt,vt.linkId);return!Tt||ze(Tt)||Te(Tt)&&te(Tt.enableWhen,Tt.enableBehavior,zr)?rn.kept.push(vt):rn.removed.push(vt),rn},{kept:[],removed:[]});return $t(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Pt,found:!0}}if(An.item&&An.item.length>0){const zr=ot(An.item,Yt,qt);if(zr.found){const jr=pt.slice(0,Zt),Rn=pt.slice(Zt+1),Pn=[...jr,v(f({},An),{item:zr.trimmedData})],{kept:rn,removed:vt}=Rn.reduce((Tt,Kt)=>{const un=J(qt,Kt.linkId);return!un||ze(un)||Te(un)&&te(un.enableWhen,un.enableBehavior,Pn)?Tt.kept.push(Kt):Tt.removed.push(Kt),Tt},{kept:[],removed:[]});return $t(vt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Pt],found:!0}}}}return{trimmedData:pt,trimmedLinkIds:[],found:!1}},Je=(pt,Yt)=>pt.filter(qt=>!Yt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:Je(qt.item,Yt)}):qt),tt=pt=>{var Yt;if(!pt)return"empty";const qt=y.Z$.find(({patterns:Pt})=>Pt.some($t=>pt.includes($t)));return(Yt=qt?.type)!=null?Yt:"empty"},rt=(pt,Yt)=>{const{groupIndices:qt}=In(pt),Pt=pt.findIndex($t=>$t.linkId===Yt);return Pt!==-1?qt.indexOf(Pt):-1},lt=pt=>{if(!pt)return{restriction:null,warning:null};const Yt=qt=>{const Pt=pt.find(Zt=>Zt.url===qt&&Zt.valueString);if(!Pt?.valueString)return null;const $t=Pt.valueString.replace(/\\n/g,`
870
870
  `).split(`
871
871
  `).map(Zt=>Zt.trim()).filter(Boolean).map(Zt=>Zt.startsWith("*")?Zt.substring(1).trim():Zt);return $t.length===0?null:$t.length===1?{isList:!1,items:$t}:{isList:!0,items:$t}};return{restriction:Yt("restriction"),warning:Yt("warning")}},St=(pt,Yt)=>{var qt;switch(Yt.type){case"boolean-to-string":return typeof pt=="boolean"?pt?Yt.trueValue:Yt.falseValue:pt;case"map":return Yt.mapping&&pt in Yt.mapping?Yt.mapping[pt]:pt;case"date-format":return pt;case"number-format":if(typeof pt=="number"){let Pt=pt.toFixed((qt=Yt.decimals)!=null?qt:0);return Yt.prefix&&(Pt=Yt.prefix+Pt),Yt.suffix&&(Pt=Pt+Yt.suffix),Pt}return pt;case"passthrough":default:return pt}},st=(pt,Yt)=>{const qt=pt.linkId,Pt=(Zt,An,zr=[])=>{for(const jr of Zt){const Rn=[...zr,jr];if(jr.item){if(jr.item.some(vt=>vt.linkId===An))return Rn.filter(vt=>vt.repeats===!0);const rn=Pt(jr.item,An,Rn);if(rn.length>0)return rn}}return[]},$t=Pt(Yt,qt);return $t.length>0?$t[$t.length-1]:null},le=(pt,Yt)=>{if(!pt?.item)return[];const qt=[];for(const Pt of pt.item){if(Pt.type!=="group")continue;te(Pt.enableWhen,Pt.enableBehavior,Yt||[])&&Pt.linkId&&qt.push(Pt.linkId)}return qt},ye=(pt,Yt)=>{const qt=le(pt,Yt||void 0);return qt[qt.length-1]},Fe=({questionnaire:pt,extensionUrl:Yt,errorCode:qt})=>{if(!qt||!pt?.item)return;const Pt=pt.item.find($t=>{var Zt;return(Zt=$t.extension)==null?void 0:Zt.some(An=>An.url===Yt&&An.valueString===qt)});return Pt?.linkId},Se=(pt,Yt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Zt=>Zt.url===y.rb);if(!Pt?.valueString)return;const $t=Pt.valueString;return J(Yt,$t)},yt=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===y.rb))},Xt=(pt,Yt)=>pt.filter(qt=>qt.linkId!==Yt).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:Xt(qt.item,Yt)}):qt),vn=pt=>{const Yt=V(ANALYTICS_FORM_NAME_EXTENSION_URL,pt.extension);return Yt??k(pt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Vn=pt=>V(ANALYTICS_EVENT_NAME_EXTENSION_URL,pt.extension),gr=pt=>V(ANALYTICS_PAGE_NAME_EXTENSION_URL,pt.extension),Bt=pt=>V(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,pt.extension),we=pt=>V(ANALYTICS_OPTION_NAME_EXTENSION_URL,pt),Ze=(pt,Yt)=>{var qt,Pt,$t;if(!pt.answerOption)return;const Zt=F(Yt,pt.linkId),An=($t=(Pt=(qt=Zt?.answer)==null?void 0:qt[0])==null?void 0:Pt.valueCoding)==null?void 0:$t.code;if(!An)return;const zr=pt.answerOption.find(jr=>{var Rn;return((Rn=jr.valueCoding)==null?void 0:Rn.code)===An});if(!!zr)return we(zr.extension)},At=(pt,Yt)=>{const qt={},Pt=$t=>{if(!!$t)for(const Zt of $t){const An=Bt(Zt);if(An){let zr;switch(Zt.type){case"choice":zr=Ze(Zt,Yt);break;default:break}zr&&(qt[An]=zr)}Zt.item&&Zt.item.length>0&&Pt(Zt.item)}};return Pt(pt.item),qt},en=pt=>!!(pt.initial&&pt.initial.length>0),nn=(pt,Yt,qt)=>{if(!pt)return[];const Pt=[],$t=Zt=>{Zt.forEach(An=>{if(qt&&qt.includes(An.linkId))return;const zr=Te(An),jr=Yt.includes(An.linkId);(jr||zr&&An.required)&&Pt.push(An),jr&&An.item&&An.item.length>0&&$t(An.item)})};return $t(pt),Pt},fn=(pt,Yt,qt,Pt,$t,Zt)=>{var An;if(qt<0||!Pt?.item)return!0;const zr=$t.current[qt],jr=qt+1,Rn=$t.current[jr],Pn=qt===0?0:zr,rn=Rn??Pt.item.length,vt=[];for(let Cn=Pn;Cn<rn;Cn++){const jn=(An=Pt?.item)==null?void 0:An[Cn];if(jn){if(Zt&&Zt.includes(jn.linkId))continue;const wr=Te(jn);(Yt.includes(jn.linkId)||wr&&jn.required)&&vt.push(jn),jn.item&&jn.item.length>0&&vt.push(...nn(jn.item,Yt,Zt))}}const Tt=vt.filter(Cn=>Cn.required===!0),Kt=vt.filter(Cn=>Cn.required!==!0),un=$r(Tt,pt),on=Kt?.every(Cn=>{var jn;const wr=(jn=F(pt,Cn.linkId))==null?void 0:jn.answer;return wr?!ge(Cn,pt,wr):!0});return!Tt?.length||un&&on}},28058:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),i=e(69364),o=e(25624);const a=({item:er})=>{const Qr=er.text||"",Yr=er.extension||[],Li=_o=>{var xo;return(xo=Yr.find(So=>So.url===_o))==null?void 0:xo.valueString},ro=Li(i.$7),Mo=Li(i.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:Qr,description:ro??"",color:Mo})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(er,Qr,Yr)=>Qr in er?u(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,O=(er,Qr)=>{for(var Yr in Qr||(Qr={}))A.call(Qr,Yr)&&d(er,Yr,Qr[Yr]);if(y)for(var Yr of y(Qr))m.call(Qr,Yr)&&d(er,Yr,Qr[Yr]);return er};const p=({item:er})=>{const[Qr,Yr]=(0,t.useState)(!1),Li=er.extension||[],ro=Ln=>{var lr;return(lr=Li.find(hn=>hn.url===Ln))==null?void 0:lr.valueString},Mo=ro(i.PS)||er.text||"",_o=ro(i.Iz)||"button",xo=ro(i.VF),So=ro(i.PV),No=ro(i.vf),uo=No?i.JP[No]:void 0,ua=ro(i.D_)||"",Sr=ro(i.$e),ar=ro(i.GQ),Tr=ro(i.qT)||"gray",Pe=ro(i.hZ),Ce=ro(i.wG),We=ro(i.q3),gt=ar?i.JP[ar]:void 0,jt=()=>Yr(!0),tn=()=>{switch(_o){case"icon-button":return(0,n.jsxs)("button",{onClick:jt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Mo||ua||void 0,children:[uo&&(0,n.jsx)(uo,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Mo&&(0,n.jsx)("span",{className:"text-sm",children:Mo})]});default:return(0,n.jsx)(r.Button,{color:xo??"secondary",size:So??"md",iconLeading:uo,onClick:jt,"aria-label":Mo,children:Mo})}};return(0,n.jsxs)(n.Fragment,{children:[tn(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${er.linkId}`,isOpen:Qr,onOpenChange:Yr,title:{content:ua},description:{content:Sr?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(Sr)}}):void 0},closeButton:{onCloseClick:()=>Yr(!1)}},gt?{featuredIcon:{icon:gt,color:Tr,size:"lg",className:"bg-white"}}:{}),Pe?{primaryButton:{children:Pe,onClick:()=>{var Ln,lr;Ce==="open-zendesk"&&((lr=(Ln=globalThis.zE)==null?void 0:Ln.activate)==null||lr.call(Ln,{hideOnClose:!0})),Yr(!1)}}}:{}),We?{secondaryButton:{children:We,onClick:()=>Yr(!1)}}:{}))]})};var b=e(18522);const h=({item:er})=>{var Qr,Yr,Li,ro,Mo,_o,xo,So,No,uo;const{hasExternalError:ua}=(0,b.c)(),Sr=er.text||"",ar=(Yr=(Qr=er.extension)==null?void 0:Qr.find(hn=>hn.url===i.ao))==null?void 0:Yr.valueString,Tr=ua&&ar?ar:Sr,Pe=(ro=(Li=er.extension)==null?void 0:Li.find(hn=>hn.url===i.$7))==null?void 0:ro.valueString,Ce=(_o=(Mo=er.extension)==null?void 0:Mo.find(hn=>hn.url===i.el))==null?void 0:_o.valueString,We=ua&&Ce?Ce:Pe,gt=(So=(xo=er.extension)==null?void 0:xo.find(hn=>hn.url===i.g4))==null?void 0:So.valueString,jt=(uo=(No=er.extension)==null?void 0:No.find(hn=>hn.url===i.Fp))==null?void 0:uo.valueString,tn=gt?i.JP[gt]:void 0,Ln=jt?i.JP[jt]:void 0,lr=ua&&Ln?Ln:tn;return(0,n.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[lr&&(0,n.jsx)(r.FeaturedIcon,{icon:lr,color:ua&&Ln?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,n.jsx)("h1",{className:"text-primary max-w-[330px] text-center text-3xl font-medium md:max-w-[352px]",children:Tr}),(0,n.jsx)("p",{className:"text-md text-secondary text-center",children:We})]})]})};var f=e(15297),v=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(er,Qr,Yr)=>Qr in er?M(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,E=(er,Qr)=>{for(var Yr in Qr||(Qr={}))z.call(Qr,Yr)&&S(er,Yr,Qr[Yr]);if(x)for(var Yr of x(Qr))T.call(Qr,Yr)&&S(er,Yr,Qr[Yr]);return er};const C=({item:er})=>{const[Qr,Yr]=(0,t.useState)(!1),Li=(0,v.T$)(),ro=er.extension||[],Mo=Pe=>{var Ce;return(Ce=ro.find(We=>We.url===Pe))==null?void 0:Ce.valueString},_o=er.text||"",xo=Mo(i.PS)||"",So=Mo(i.D_)||"",No=Mo(i.$e),uo=Mo(i.GQ),ua=Mo(i.qT)||"gray",Sr=Mo(i.hZ),ar=Mo(i.q3),Tr=uo?i.JP[uo]:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-secondary ring-border-secondary flex items-center justify-between rounded-lg px-4 py-2.5 ring-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(f.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:_o})]}),xo&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Yr(!0),children:xo})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${er.linkId}`,isOpen:Qr,onOpenChange:Yr,title:{content:So},description:{content:No?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(No)}}):void 0},closeButton:{onCloseClick:()=>Yr(!1)}},Tr?{featuredIcon:{icon:Tr,color:ua,size:"lg",className:"bg-white"}}:{}),Sr?{primaryButton:{children:Sr,onClick:()=>{Yr(!1),Li.navigate({id:"profile"})}}}:{}),ar?{secondaryButton:{children:ar,onClick:()=>Yr(!1)}}:{}))]})},R=({item:er,selectedAnswer:Qr,handleInputChange:Yr})=>{var Li,ro,Mo;const _o=(Li=er.answerOption)!=null?Li:[],xo=(Mo=(ro=Qr?.[0])==null?void 0:ro.valueCoding)==null?void 0:Mo.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:_o.map(So=>{var No,uo,ua,Sr,ar,Tr,Pe;const Ce=(uo=(No=So.valueCoding)==null?void 0:No.code)!=null?uo:"",We=(Sr=(ua=So.valueCoding)==null?void 0:ua.display)!=null?Sr:"",gt=xo===Ce,jt=(ar=So.extension)==null?void 0:ar.find(hn=>hn.url===i.g4),tn=(Tr=So.extension)==null?void 0:Tr.find(hn=>hn.url===i.rz),Ln=jt?.valueString?i.JP[jt.valueString]:void 0,lr=(Pe=tn?.valueString)!=null?Pe:"";return(0,n.jsx)(r.SelectableOption,{icon:Ln,title:We,description:lr,isSelected:gt,onSelect:()=>{Yr(er,[{valueCoding:{code:Ce,display:We}}])}},Ce)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:er,isLabel:Qr,required:Yr,className:Li,id:ro})=>(0,n.jsxs)("p",{id:ro,className:Li??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(Qr&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(er||"")}}),Yr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",V=(er,Qr)=>{const Yr=er.replace(/\D/g,"");let Li="",ro=0;for(let Mo=0;Mo<Qr.length&&ro<Yr.length;Mo++)Qr[Mo]==="#"?(Li+=Yr[ro],ro++):Li+=Qr[Mo];return Li},q=er=>{if(!er)return w;const Qr=er.find(Yr=>Yr.url===i.Md);return Qr?.valueString||w},I=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo;const{linkId:So,text:No,required:uo,prefix:ua,readOnly:Sr,extension:ar}=er,Tr=q(ar),Pe=((xo=Yr?.[0])==null?void 0:xo.valueString)||"",[Ce,We]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Pe){const lr=V(Pe,Tr);We(lr)}},[Pe,Tr]);const gt=No?(0,o.nt)(ro,ua,No):"",jt=Mo?.[So]||"",tn=lr=>{const hn=V(lr,Tr);We(hn),Li(er,[{valueString:hn}])},Ln=()=>{Qr&&Qr(So)};return(0,n.jsxs)("div",{"data-testid":So,children:[gt&&(0,n.jsx)(N,{isLabel:!0,text:gt,required:uo||!1}),(0,n.jsx)(r.Input,{id:So,"aria-label":So,"data-testid":So,type:"tel",placeholder:"Enter phone number",value:Ce,onChange:tn,onBlur:Ln,isDisabled:Sr||_o,isRequired:uo,hint:jt,isInvalid:!!jt,size:"md"},So)]})},k=({item:er,questionnaireSchemaItems:Qr})=>{var Yr;const{isLoading:Li,setCurrentGroupIndex:ro}=(0,b.c)(),Mo=(Yr=er.extension)==null?void 0:Yr.find(No=>No.url===i.Uf),_o=Mo?.valueString,xo=er.text||"Save & continue",So=()=>{if(_o){const No=(0,o.Ue)(Qr||[],_o);No!==-1&&ro(No)}};return(0,n.jsx)("div",{"data-testid":er.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Li,onClick:So,isDisabled:er.readOnly,children:xo})})},U=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},t.createElement("path",{d:"M10 16h4m-5.2 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V6.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 2 16.88 2 15.2 2H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 22 7.12 22 8.8 22ZM15 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));U.displayName="Passport";var F=e(56327);const K=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},t.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));K.displayName="UserCircle";var G=e(14711);const se=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));se.displayName="Mail01";var ie=e(31165),te=e(14449),he=e(27163);const be=er=>{try{const Qr=er.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Qr)return er;const[,Yr,Li,ro]=Qr;return new Date(Date.UTC(parseInt(Yr),parseInt(Li)-1,parseInt(ro))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return er}},Ee=er=>{try{if(er.includes("AM")||er.includes("PM"))return er;const Qr=er.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Qr)return er;const[,Yr,Li]=Qr,ro=parseInt(Yr),Mo=ro>=12?"PM":"AM";return`${ro%12||12}:${Li} ${Mo}`}catch{return er}},ge=(er,Qr,Yr=f.d)=>{var Li;const ro=(Li=er.extension)==null?void 0:Li.find(Mo=>Mo.url===i.g4);return ro?.valueString&&i.JP[ro.valueString]?i.JP[ro.valueString]:er.linkId&&Qr[er.linkId]?Qr[er.linkId]:Yr},re={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":F.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":se,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":ie.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":te.X},ae=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],pe=["appointment-review/facility-phone"],de=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],ne=({item:er,questionnaireSchemaItems:Qr})=>{var Yr;const{setCurrentGroupIndex:Li}=(0,b.c)(),{trackEvent:ro}=(0,s.st)(),Mo=er.item||[];if(Mo.length===0)return null;const _o=(Yr=er.extension)==null?void 0:Yr.find(uo=>uo.url===i.Uf),xo=_o?.valueString,So=()=>{if(ro("edit_info_clicked",{section:er.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),xo){const uo=(0,o.Ue)(Qr||[],xo);uo!==-1&&Li(uo)}},No=Mo.map(uo=>{let ua="";if(uo.initial&&uo.initial.length>0){const Tr=uo.initial.map(Pe=>{var Ce,We;let gt=((Ce=Pe.valueCoding)==null?void 0:Ce.display)||((We=Pe.valueReference)==null?void 0:We.display)||Pe.valueString||"";return gt&&typeof gt=="string"&&(ae.includes(uo.linkId)?gt=be(gt):me.includes(uo.linkId)&&(gt=Ee(gt))),gt}).filter(Boolean);Tr.length>1||uo.repeats&&Tr.length>0?ua=Tr:Tr.length===1&&(ua=Tr[0])}if(!ua||Array.isArray(ua)&&ua.length===0)return null;let Sr;pe.includes(uo.linkId)?Sr="phone":de.includes(uo.linkId)&&(Sr="address");let ar;return ue.includes(uo.linkId)&&(ar="phone"),{Icon:ge(uo,re),label:uo.text||uo.linkId,value:ua,linkType:Sr,displayType:ar}}).filter(Boolean);return No.length===0?null:(0,n.jsx)("div",{"data-testid":er.linkId,children:(0,n.jsx)(he.InfoCard,{title:er.text||"Details",infoDetails:No,actionButtonText:xo&&"Edit info",onActionButtonClick:xo?So:void 0})})},J=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},t.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));J.displayName="AlertTriangle";var ve=e(18807);const Te=({item:er})=>{const{setHideFooterButton:Qr,incrementCustomErrorCount:Yr,decrementCustomErrorCount:Li}=(0,b.c)();return(0,t.useEffect)(()=>(Qr(!0),Yr(),()=>{Qr(!1),Li()}),[Qr,Yr,Li]),(0,n.jsx)("div",{"data-testid":er.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(r.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,ve.p)(er.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(J,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},ze=({item:er})=>{var Qr,Yr,Li,ro;const{incrementCustomErrorCount:Mo,decrementCustomErrorCount:_o,setHideFooterButton:xo}=(0,b.c)(),[So,No]=(0,t.useState)(!1),uo=(Qr=er.extension)==null?void 0:Qr.find(Ce=>Ce.url===i.gi),ua=(Li=(Yr=uo?.valueCodeableConcept)==null?void 0:Yr.coding)==null?void 0:Li.find(Ce=>Ce.system===i.tn),Sr=ua?.code||"error",ar=De[Sr]||"error";(0,t.useEffect)(()=>{if(ar==="error")return Mo(),xo(!0),No(!0),()=>{_o(),xo(!1)};No(!0)},[ar,Mo,_o,xo]);const Tr=ua?.display||"Error",Pe=(ro=er.text)!=null?ro:"";return So?(0,n.jsx)("div",{"data-testid":er.linkId,children:(0,n.jsx)(r.InfoBanner,{type:ar,title:Tr,description:Pe})}):null},Ie=({configKey:er,customErrorConfigurations:Qr})=>{if(!Qr)return null;const Yr=Qr[er];if(!Yr)return null;const{icon:Li,title:ro,description:Mo,primaryButton:_o,secondaryButton:xo}=Yr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:ro,description:Mo,featuredIconProps:{icon:Li,color:"gray"},primaryButton:_o,secondaryButton:xo})},xe=10,_e=({item:er,customErrorConfigurations:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo,So,No,uo;const{trackEvent:ua}=(0,s.st)(),{setHideFooterButton:Sr}=(0,b.c)(),{linkId:ar,text:Tr,required:Pe,answerOption:Ce,prefix:We,readOnly:gt}=er,jt=er?.type==="reference",tn=(xo=Yr?.map(Tn=>{var tr,Hr;return jt?(tr=Tn.valueReference)==null?void 0:tr.display:(Hr=Tn.valueCoding)==null?void 0:Hr.code}).filter(Tn=>Tn!==void 0))!=null?xo:[],[Ln,lr]=(0,t.useState)(tn.length),hn=Tr?(0,o.nt)(ro,We,Tr):"",Zn=(No=(So=er.extension)==null?void 0:So.find(Tn=>Tn.url===i.Z_))==null?void 0:No.valueInteger,cn=(uo=Ce?.map(Tn=>{var tr,Hr,p0,ui;return{value:jt?((tr=Tn.valueReference)==null?void 0:tr.display)||"":((Hr=Tn.valueCoding)==null?void 0:Hr.code)||"",label:jt?((p0=Tn.valueReference)==null?void 0:p0.display)||"":((ui=Tn.valueCoding)==null?void 0:ui.display)||"",valueReference:Tn.valueReference}}))!=null?uo:[],Or=Mo?.[ar],Cr=cn.length>xe,Vr=Cr?cn.slice(0,xe):cn,d0=Cr?cn.slice(xe):[],Zr=d0.some(Tn=>tn?.includes(Tn?.value)),[K0,Ni]=(0,t.useState)(Zr);if(!(er.answerOption&&er.answerOption.length>0))return Sr(!0),(0,n.jsx)(Ie,{configKey:er.linkId,customErrorConfigurations:Qr});const _t=cn.filter(Tn=>tn?.includes(Tn?.value)).map(Tn=>{var tr;const{restriction:Hr,warning:p0}=jt?(0,o.eC)((tr=Tn.valueReference)==null?void 0:tr.extension):{restriction:null,warning:null};return{label:Tn.label,restriction:Hr,warning:p0}}).filter(Tn=>Tn.restriction||Tn.warning),En=(Tn,tr)=>{var Hr;ua("vaccine_type_checkbox_selected",{on_or_off:Tn?"on":"off",vaccine:tr,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let p0;if(Tn){const ui=cn.find(g0=>g0.value===tr);p0=[...(Hr=Yr?.filter(g0=>Object.keys(g0).length!==0))!=null?Hr:[],jt?{valueReference:ui?.valueReference}:{valueCoding:{code:tr,display:ui?.label}}],lr(g0=>g0+1)}else p0=Yr?.filter(ui=>{var g0,wi;return jt?((g0=ui.valueReference)==null?void 0:g0.display)!==tr:((wi=ui.valueCoding)==null?void 0:wi.code)!==tr})||[{}],lr(ui=>ui-1);Li&&Li(er,p0)};return(0,n.jsxs)("div",{"data-testid":ar,children:[hn&&(0,n.jsx)(N,{text:hn,required:Pe||!1}),Cr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:Vr.map((Tn,tr)=>{const Hr=tn?.includes(Tn?.value),p0=!Hr&&Zn?Ln>=Zn:!1;return(0,n.jsx)("div",{className:tr!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Tn.value,id:tr.toString(),name:Tn.label,isInvalid:!!Or,isSelected:Hr,label:Tn.label,onChange:ui=>En(ui,Tn.value),isDisabled:gt||_o||p0})},tr)})}),Cr&&!K0&&!Zr&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{Ni(!0),ua("see_all_vaccines_clicked",{_event_metadata:{description:"A user clicked the see all link on the vaccine type page."}})},color:"link-color",size:"sm",isDisabled:gt||_o,children:"See all"})}),Cr&&K0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),Cr&&K0&&(0,n.jsx)("div",{children:d0.map((Tn,tr)=>{const Hr=tn?.includes(Tn?.value),p0=!Hr&&Zn?Ln>=Zn:!1;return(0,n.jsx)("div",{className:tr!==d0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Tn.value,id:(xe+tr).toString(),name:Tn.label,isInvalid:!!Or,isSelected:Hr,label:Tn.label,onChange:ui=>En(ui,Tn.value),isDisabled:gt||_o||p0})},xe+tr)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Or,children:Or}),_t.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:_t.map((Tn,tr)=>(0,n.jsxs)("div",{children:[Tn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${Tn.label}`,description:Tn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Tn.restriction.items.map((Hr,p0)=>(0,n.jsx)("li",{className:"text-sm",children:Hr},p0))}):(0,n.jsx)("p",{className:"text-sm",children:Tn.restriction.items[0]})}),Tn.warning&&(0,n.jsx)("div",{className:Tn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${Tn.label}`,description:Tn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Tn.warning.items.map((Hr,p0)=>(0,n.jsx)("li",{className:"text-sm",children:Hr},p0))}):(0,n.jsx)("p",{className:"text-sm",children:Tn.warning.items[0]})})})]},tr))})]})};var it=e(76323),bt=e(56192),Ot=e(66267),Ft=Object.defineProperty,Qt=Object.defineProperties,zt=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Qe=(er,Qr,Yr)=>Qr in er?Ft(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,Ye=(er,Qr)=>{for(var Yr in Qr||(Qr={}))$e.call(Qr,Yr)&&Qe(er,Yr,Qr[Yr]);if(Ke)for(var Yr of Ke(Qr))Et.call(Qr,Yr)&&Qe(er,Yr,Qr[Yr]);return er},Lt=(er,Qr)=>Qt(er,zt(Qr)),mn=(er,Qr,Yr)=>new Promise((Li,ro)=>{var Mo=So=>{try{xo(Yr.next(So))}catch(No){ro(No)}},_o=So=>{try{xo(Yr.throw(So))}catch(No){ro(No)}},xo=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);xo((Yr=Yr.apply(er,Qr)).next())});const Sn=({item:er,handleInputChange:Qr,onCompleteHandler:Yr,errors:Li})=>{const{i18n:{t:ro},loading:Mo}=(0,Ot.E_)({keys:["shared-translations"]}),{trackEvent:_o}=(0,s.st)(),{linkId:xo,required:So,readOnly:No}=er,uo=Li?.[xo]||"",[ua,Sr]=(0,t.useState)(it.LocationType.CURRENT_LOCATION),[ar,Tr]=(0,t.useState)(""),Pe=(0,t.useRef)({}),[Ce,We]=(0,t.useState)([{id:it.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:gt,setIsLoading:jt,setIsCurrentFormValid:tn,isCurrentFormValid:Ln}=(0,b.c)(),{position:lr,loading:hn,locationPermission:Zn}=(0,it.useDeviceLocationContext)(),{queryParams:cn,setQueryParams:Or}=(0,it.useSearchQueryParams)(),[Cr,{loading:Vr}]=(0,bt.qtq)({fetchPolicy:"cache-first"}),[d0,{loading:Zr}]=(0,bt.YyG)({fetchPolicy:"cache-first"}),K0=er.item?(0,o.Yo)(er.item,"postal-code"):void 0,Ni=er.item?(0,o.Yo)(er.item,"state"):void 0,dt=er.item?(0,o.Yo)(er.item,"latitude"):void 0,_t=er.item?(0,o.Yo)(er.item,"longitude"):void 0,En=k0=>{if(!k0||!K0)return Tr(""),!1;const Ci=(0,o.zj)(K0.extension,K0.type,!1,K0.maxLength,[{valueString:k0}]);return Ci?(Tr(ua!==it.LocationType.ZIP_CODE?ro("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ci),!1):(Tr(""),!0)},Tn=()=>{const{latitude:k0,longitude:Ci,state:G0,zipcode:c0}=Pe.current;return!!(k0&&Ci&&G0&&c0)},tr=(0,t.useCallback)(k0=>{Pe.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},er.item&&(Ni&&Qr(Ni,[{valueString:""}]),dt&&Qr(dt,[{valueDecimal:void 0}]),_t&&Qr(_t,[{valueDecimal:void 0}]),K0&&Qr(K0,[{valueString:""}])),Or({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:k0,locationPermission:Zn}),tn&&tn(!1),Tr("")},[Qr,er.item,dt,Zn,_t,tn,Or,Ni,K0]);(0,t.useEffect)(()=>{if(!So)return;!Tn()&&tn&&tn(!1)},[Ln,So,tn]);const Hr=k0=>{Pe.current=Ye(Ye({},Pe.current),k0),k0.addressDescription&&_o("address_selected",{value:k0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),g0(Pe.current.latitude,Pe.current.longitude,Pe.current.state,Pe.current.zipcode,Pe.current.placeId,Pe.current.addressDescription)},p0=k0=>mn(void 0,null,function*(){var Ci,G0,c0;if(Tr(""),Pe.current.zipcode=k0,tn&&tn(!1),En(k0)){_o("zip_code_entered",{value:k0,_event_metadata:{description:"A user entered a zip code."}});const Z0=yield d0({variables:{location:k0}}),x0=(Ci=Z0?.data)==null?void 0:Ci.geocoding,Ao=Z0?.error;if(x0){const Bi=x0.stateCode||"",Fo=(G0=x0.latitude)!=null?G0:void 0,ko=(c0=x0.longitude)!=null?c0:void 0;Hr({latitude:Fo,longitude:ko,state:Bi,zipcode:k0,placeId:void 0,addressDescription:void 0})}else Ao&&(Hr({latitude:void 0,longitude:void 0,state:void 0,zipcode:k0,placeId:void 0,addressDescription:void 0}),Tr(ro("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else g0(Pe.current.latitude,Pe.current.longitude,Pe.current.state,k0)}),ui=()=>{const k0=Pe.current.zipcode||"";!k0||ua!==it.LocationType.ZIP_CODE||En(k0)};(0,t.useEffect)(()=>{cn.locationType&&(Sr(cn.locationType),cn.locationType===it.LocationType.ZIP_CODE&&cn.zipCode&&p0(cn.zipCode),cn.locationType===it.LocationType.ADDRESS&&cn.placeId&&cn.addressDescription&&(Pe.current.addressDescription=cn.addressDescription,Pe.current.placeId=cn.placeId))},[]),(0,t.useEffect)(()=>{const k0=[it.LocationPermissionEnum.DENIED,it.LocationPermissionEnum.UNAVAILABLE,it.LocationPermissionEnum.BLOCKED].includes(cn.locationPermission),Ci=[it.LocationPermissionEnum.GRANTED,it.LocationPermissionEnum.PROMPT].includes(cn.locationPermission);if(k0&&Ce.length!==2){if(We([{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}]),ua===it.LocationType.CURRENT_LOCATION||!cn.locationType||cn.locationType===""){const G0=cn.locationType===it.LocationType.ZIP_CODE?it.LocationType.ZIP_CODE:it.LocationType.ADDRESS;Sr(G0),Or(Lt(Ye({},cn),{locationType:G0})),tr(G0)}Tr("")}Ci&&Ce.length!==3&&We([{id:it.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}])},[ua,Zn,Ce.length,cn,Or,tr]);const g0=(k0,Ci,G0,c0,Z0,x0)=>{if(!er.item)return;Ni&&Qr(Ni,[{valueString:G0||""}]),dt&&Qr(dt,[{valueDecimal:k0}]),_t&&Qr(_t,[{valueDecimal:Ci}]),K0&&Qr(K0,[{valueString:c0||""}]),Or(Lt(Ye({},cn),{lat:String(k0),lng:String(Ci),location:`${k0},${Ci}`,zipCode:c0||"",placeId:Z0||"",addressDescription:x0||"",locationPermission:Zn}));const Ao=Tn()&&En(c0||"");tn&&tn(Ao),Yr&&Yr(xo)};(0,t.useEffect)(()=>{const k0=()=>mn(void 0,null,function*(){var Ci;try{const G0=yield Cr({variables:{latitude:String(lr?.coords.latitude),longitude:String(lr?.coords.longitude)}}),c0=(Ci=G0?.data)==null?void 0:Ci.geocodingByLatLon,Z0=c0?.stateCode||"",x0=c0?.zipCode||"";(!x0||!Z0)&&Tr(ro("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),Hr({latitude:lr?.coords.latitude,longitude:lr?.coords.longitude,state:Z0,zipcode:x0,placeId:void 0,addressDescription:void 0})}catch{Sr(it.LocationType.ADDRESS)}});ua===it.LocationType.CURRENT_LOCATION&&lr&&k0()},[ua,lr]);const wi=k0=>{if(!k0||!k0.latitude||!k0.longitude||!k0.zipCode||!k0.stateCode){Hr({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),k0&&typeof k0.value=="string"&&k0.value.trim().length!==0&&Tr(ro("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}Hr({latitude:k0.latitude,longitude:k0.longitude,state:k0.stateCode,zipcode:k0.zipCode,placeId:k0.placeId,addressDescription:k0.description})};return(0,t.useEffect)(()=>{jt(hn||Vr||Zr||Mo)},[hn,Vr,Zr,Mo,jt]),(0,t.useEffect)(()=>{cn.locationType!==ua&&Or(Lt(Ye({},cn),{locationType:ua}))},[ua]),(0,n.jsxs)("div",{"data-testid":er.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:So||!1}),(0,n.jsx)(r.Select,{id:xo,"aria-label":xo,"data-testid":xo,isDisabled:No||Vr||Zr||gt,selectedKey:ua,onSelectionChange:k0=>{var Ci;_o("location_type_input_selected",{choice:(Ci=Ce.find(({id:G0})=>G0===k0))==null?void 0:Ci.label,_event_metadata:{description:"A user changed the location type input."}}),k0!==ua&&(tr(k0),Sr(k0))},hint:uo,isInvalid:!!uo,items:Ce,placeholder:"Select an option",isRequired:So,children:k0=>(0,n.jsx)(r.Select.Item,{id:k0.id,"data-testid":k0.id,value:k0,children:k0.label},k0.id)},xo),ua===it.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!ar,children:ar}),ua===it.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:So||!1}),(0,n.jsx)(it.AddressTypeahead,{onValueChange:wi,isDisabled:gt,setIsLoading:jt,initialValue:{placeId:Pe.current.placeId||"",description:Pe.current.addressDescription||""},errorText:ar||uo})]}),ua===it.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:So||!1}),(0,n.jsx)(r.Input,{isRequired:So,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${xo}-zipcode`,placeholder:"Type your response here...",value:Pe.current.zipcode||"",onChange:p0,onBlur:ui,isDisabled:No||Zr||gt,hint:ar||uo,isInvalid:!!ar||!!uo,autoComplete:"postal-code"},`${xo}-zipcode`)]})]})},et=er=>(0,n.jsx)(it.DeviceLocationProvider,{children:(0,n.jsx)(Sn,Ye({},er))}),Rt={[i.cX]:et,[i.G6]:ne,[i.c3]:_e,[i.AA]:ze,[i.mO]:h,[i.PM]:k,[i.HH]:I,[i.Us]:Te,[i.Tl]:R,[i.G0]:p,[i.m3]:a,[i.PU]:C,[i.XP]:g.l,[i.uH]:L.v};var Ht,Un=new Uint8Array(16);function Mr(){if(!Ht&&(Ht=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Un)}const gn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function In(er){return typeof er=="string"&&gn.test(er)}const cr=In;for(var Dn=[],$r=0;$r<256;++$r)Dn.push(($r+256).toString(16).substr(1));function qr(er){var Qr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Yr=(Dn[er[Qr+0]]+Dn[er[Qr+1]]+Dn[er[Qr+2]]+Dn[er[Qr+3]]+"-"+Dn[er[Qr+4]]+Dn[er[Qr+5]]+"-"+Dn[er[Qr+6]]+Dn[er[Qr+7]]+"-"+Dn[er[Qr+8]]+Dn[er[Qr+9]]+"-"+Dn[er[Qr+10]]+Dn[er[Qr+11]]+Dn[er[Qr+12]]+Dn[er[Qr+13]]+Dn[er[Qr+14]]+Dn[er[Qr+15]]).toLowerCase();if(!cr(Yr))throw TypeError("Stringified UUID is invalid");return Yr}const wt=qr;function Ve(er,Qr,Yr){er=er||{};var Li=er.random||(er.rng||Mr)();if(Li[6]=Li[6]&15|64,Li[8]=Li[8]&63|128,Qr){Yr=Yr||0;for(var ro=0;ro<16;++ro)Qr[Yr+ro]=Li[ro];return Qr}return wt(Li)}const ot=Ve,Je=(er,Qr="application/octet-stream")=>{try{const Yr=window.atob(er),Li=new Uint8Array(Yr.length);for(let Mo=0;Mo<Yr.length;Mo++)Li[Mo]=Yr.charCodeAt(Mo);return new Blob([Li],{type:Qr}).size}catch{return 0}},tt=(er,Qr)=>`data:${Qr};base64,${er}`,rt=(er,Qr,Yr=512)=>{const Li=window.atob(er),ro=[];for(let _o=0;_o<Li.length;_o+=Yr){const xo=Li.slice(_o,_o+Yr),So=new Array(xo.length);for(let uo=0;uo<xo.length;uo++)So[uo]=xo.charCodeAt(uo);const No=new Uint8Array(So);ro.push(No)}const Mo=new Blob(ro,{type:Qr});return URL.createObjectURL(Mo)},lt=er=>{const Qr=new Date().toISOString().replace(/[:.-]/g,"");return`${er.split(" ").join("-")}_${Qr}`},St=4e3,st=.8,le=(er,Qr)=>{var Yr,Li;const ro=(Yr=Qr?.maxDimension)!=null?Yr:St,Mo=(Li=Qr?.quality)!=null?Li:st;return new Promise((_o,xo)=>{if(!er.type.startsWith("image/")){_o(er);return}const So=new Image,No=new FileReader;No.onload=()=>{const uo=No.result;So.onload=()=>{let{width:ua,height:Sr}=So;if(ua>ro||Sr>ro){const We=ro/Math.max(ua,Sr);ua=Math.round(ua*We),Sr=Math.round(Sr*We)}const ar=document.createElement("canvas");ar.width=ua,ar.height=Sr;const Tr=ar.getContext("2d");if(!Tr){_o(er);return}Tr.drawImage(So,0,0,ua,Sr);const Pe=er.type==="image/png"?"image/png":"image/jpeg",Ce=er.type==="image/png"?void 0:Mo;ar.toBlob(We=>{if(!We||We.size>=er.size){_o(er);return}_o(new File([We],er.name,{type:Pe}))},Pe,Ce)},So.onerror=()=>{xo(new Error(`Failed to load image: ${er.name}`))},So.src=uo},No.onerror=()=>{xo(new Error(`Failed to read file: ${er.name}`))},No.readAsDataURL(er)})},ye=50,Fe=(er,Qr=ye)=>{if(er.length<=Qr)return er;const Yr=er.lastIndexOf("."),Li=Yr!==-1?er.slice(Yr):"",ro=Yr!==-1?er.slice(0,Yr):er,Mo=Qr-Li.length-1,_o=Math.ceil(Mo/2),xo=Math.floor(Mo/2);return`${ro.slice(0,_o)}\u2026${ro.slice(-xo)}${Li}`};var Se=Object.defineProperty,yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,gr=Object.prototype.propertyIsEnumerable,Bt=(er,Qr,Yr)=>Qr in er?Se(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,we=(er,Qr)=>{for(var Yr in Qr||(Qr={}))Vn.call(Qr,Yr)&&Bt(er,Yr,Qr[Yr]);if(vn)for(var Yr of vn(Qr))gr.call(Qr,Yr)&&Bt(er,Yr,Qr[Yr]);return er},Ze=(er,Qr)=>yt(er,Xt(Qr)),At=(er,Qr,Yr)=>new Promise((Li,ro)=>{var Mo=So=>{try{xo(Yr.next(So))}catch(No){ro(No)}},_o=So=>{try{xo(Yr.throw(So))}catch(No){ro(No)}},xo=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);xo((Yr=Yr.apply(er,Qr)).next())});const en=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{const{linkId:xo,text:So,required:No,prefix:uo,readOnly:ua,repeats:Sr,extension:ar}=er,Tr=(0,o.Qr)(ar),Pe=(0,o.cz)(ar),Ce=(0,o.$H)(ar)||"image/*,.pdf,.doc,.docx",We=So?(0,o.nt)(ro,uo,So):"",gt=Mo?.[xo]||"",[jt,tn]=(0,t.useState)([]),Ln=(0,t.useRef)(Yr||[]);(0,t.useEffect)(()=>{Yr&&(Ln.current=Yr)},[Yr]),(0,t.useEffect)(()=>{Yr?.length&&tn(Cr=>{const Vr=Cr.filter(Zr=>Zr.isLoading||Zr.failed);return[...Yr.filter(Zr=>Zr.valueAttachment).map((Zr,K0)=>{var Ni,dt,_t,En,Tn;const tr=((Ni=Zr.valueAttachment)==null?void 0:Ni.title)||`attachment-${K0}`,Hr=(dt=Zr.valueAttachment)==null?void 0:dt.id,p0=Cr.find(wi=>Hr&&wi.id===Hr||!Hr&&wi.id===`existing-${K0}`),ui=(_t=Zr.valueAttachment)==null?void 0:_t.data,g0=ui?Je(ui,(En=Zr.valueAttachment)==null?void 0:En.contentType):0;return{id:Hr||p0?.id||`existing-${K0}`,name:tr,size:p0?.size||g0,progress:100,failed:!1,type:(0,o.J4)((Tn=Zr.valueAttachment)==null?void 0:Tn.contentType),isLoading:!1}}),...Vr]})},[Yr]);const lr=Cr=>{let Vr=Array.from(Cr);if(Pe!==void 0){const Zr=Pe-jt.length;if(Zr<=0)return;Vr=Vr.slice(0,Zr)}const d0=Vr.map(Zr=>{const K0=Tr&&Zr.size>Tr,Ni=Zr.name.replace(/\s+/g,"-");return{id:ot(),name:Ni,size:Zr.size,progress:0,type:(0,o.J4)(Zr.type),failed:!!K0,isLoading:!K0,disableRetry:!!K0,errorMessage:K0?`File size exceeds ${(Tr/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});tn(Zr=>[...Zr,...d0]),d0.filter(Zr=>!Zr.failed).forEach(Zr=>{const K0=Vr.find(Ni=>Ni.name.replace(/\s+/g,"-")===Zr.name);K0&&hn(K0,Zr.id)})},hn=(Cr,Vr)=>At(void 0,null,function*(){try{const d0=yield le(Cr),Zr=yield Or(d0),K0=d0.name.replace(/\s+/g,"-");tn(En=>En.map(Tn=>Tn.id===Vr?Ze(we({},Tn),{isLoading:!1,progress:100,failed:!1}):Tn));const Ni={valueAttachment:{id:Vr,contentType:d0.type,data:Zr,title:K0}},_t=[...(Ln.current||[]).filter(En=>En.valueAttachment||Object.keys(En).length>0),Ni];Ln.current=_t,Li(er,_t),Qr(xo)}catch{tn(Zr=>Zr.map(K0=>K0.id===Vr?Ze(we({},K0),{isLoading:!1,failed:!0}):K0))}}),Zn=Cr=>{const Vr=jt.find(d0=>d0.id===Cr);if(tn(d0=>d0.filter(Zr=>Zr.id!==Cr)),Vr){const d0=(Ln.current||[]).filter((Zr,K0)=>{var Ni;if(Cr.startsWith("existing-")){const dt=parseInt(Cr.replace("existing-",""));return K0!==dt}return((Ni=Zr.valueAttachment)==null?void 0:Ni.id)!==Cr}).filter(Zr=>Zr.valueAttachment||Object.keys(Zr).length>0);Ln.current=d0,Li(er,d0.length>0?d0:[{}])}},cn=Cr=>{const Vr=jt.find(d0=>d0.id===Cr);if(Vr){tn(Zr=>Zr.map(K0=>K0.id===Cr?Ze(we({},K0),{failed:!1,isLoading:!0,progress:0}):K0));const d0=new File([""],Vr.name,{type:"application/octet-stream"});hn(d0,Cr)}},Or=Cr=>new Promise((Vr,d0)=>{const Zr=new FileReader;Zr.onload=()=>{const Ni=Zr.result.split(",")[1];Vr(Ni)},Zr.onerror=d0,Zr.readAsDataURL(Cr)});return(0,n.jsxs)("div",{children:[We&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:We,required:No||!1}),(0,n.jsx)(r.FileUpload,{files:jt,onDropFiles:lr,onDeleteFile:Zn,onRetryFile:cn,onDropUnacceptedFiles:()=>{},hint:(0,o.od)(Ce,Tr,Pe),accept:Ce,allowsMultiple:Sr!==!1,isDisabled:ua||_o||Pe!==void 0&&jt.length>=Pe,className:"w-full",showDisclosureModal:!0}),gt&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:gt})]})},nn=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo,So;const{linkId:No,text:uo,prefix:ua,readOnly:Sr,required:ar,extension:Tr}=er,{trackQuestionnaireEvent:Pe}=(0,b.c)(),Ce=uo?(0,o.nt)(ro,ua,uo):"",We=Mo?.[No];return Tr?.find(jt=>{var tn,Ln;return jt.url===i.gD&&((Ln=(tn=jt.valueCodeableConcept)==null?void 0:tn.coding)==null?void 0:Ln.some(lr=>lr.system===i.n4&&lr.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":No,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":No,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:No,name:No,isDisabled:Sr||_o,isSelected:(xo=Yr?.[0])==null?void 0:xo.valueBoolean,"aria-label":No,label:"",className:"mt-1",onChange:jt=>{Pe(er.linkId,{value:jt}),Li(er,[{valueBoolean:jt}]),Qr(er.linkId)}}),Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:ar||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!We,children:We})]}):(0,n.jsxs)("div",{"data-testid":No,children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:ar||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:No,name:No,"aria-label":No,value:String((So=Yr?.[0])==null?void 0:So.valueBoolean)||"",onChange:jt=>{Li(er,[{valueBoolean:jt==="true"}]),Qr(er.linkId)},isInvalid:!!We,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Sr||_o}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Sr||_o})]},No),We&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:We})})]})};var fn=Object.defineProperty,pt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Pt=(er,Qr,Yr)=>Qr in er?fn(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,$t=(er,Qr)=>{for(var Yr in Qr||(Qr={}))Yt.call(Qr,Yr)&&Pt(er,Yr,Qr[Yr]);if(pt)for(var Yr of pt(Qr))qt.call(Qr,Yr)&&Pt(er,Yr,Qr[Yr]);return er};const Zt=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,ua;const{linkId:Sr,text:ar,required:Tr,answerOption:Pe,prefix:Ce,readOnly:We}=er,gt=ar?(0,o.nt)(ro,Ce,ar):"",jt=Pe?.map(lr=>{var hn,Zn,cn,Or;return{id:((hn=lr.valueCoding)==null?void 0:hn.code)||lr.valueString||"",label:((Zn=lr.valueCoding)==null?void 0:Zn.display)||lr.valueString||"",value:((cn=lr.valueCoding)==null?void 0:cn.code)||lr.valueString||"",extension:lr.extension||[],system:((Or=lr.valueCoding)==null?void 0:Or.system)||void 0}})||[],tn=((uo=(No=Yr?.[0])==null?void 0:No.valueCoding)==null?void 0:uo.code)||((ua=Yr?.[0])==null?void 0:ua.valueString)||"",Ln=Mo?.[Sr];return(0,n.jsxs)("div",{children:[gt&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:gt,required:Tr||!1}),(0,n.jsx)(r.Select,{id:Sr,"aria-label":Sr,"data-testid":Sr,isDisabled:We||_o,selectedKey:tn,onSelectionChange:lr=>{const hn=String(lr),Zn=jt.find(Cr=>Cr.value===hn),cn=Zn?Zn.label:"",Or=Boolean(Pe?.find(Cr=>Cr.valueString===hn));Li(er,[Or?{valueString:hn}:{valueCoding:$t({code:hn,display:cn},Zn?.system?{system:Zn.system}:{}),extension:Zn?.extension||[]}]),Qr(er.linkId)},isInvalid:!!Ln,hint:Ln||So,items:jt,placeholder:xo,isRequired:Tr,children:lr=>(0,n.jsx)(r.Select.Item,{id:lr.id,"data-testid":lr.value,value:lr.value,children:lr.label},lr.id)},Sr)]})};var An=Object.defineProperty,zr=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,Pn=(er,Qr,Yr)=>Qr in er?An(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,rn=(er,Qr)=>{for(var Yr in Qr||(Qr={}))jr.call(Qr,Yr)&&Pn(er,Yr,Qr[Yr]);if(zr)for(var Yr of zr(Qr))Rn.call(Qr,Yr)&&Pn(er,Yr,Qr[Yr]);return er};const vt=er=>{var Qr,Yr,Li;const{item:ro,selectedAnswer:Mo,updatedText:_o,required:xo,errorMessage:So}=er,No=ro?.type==="reference",uo=(Qr=Mo?.map(Pe=>{var Ce,We;return No?(Ce=Pe.valueReference)==null?void 0:Ce.display:(We=Pe.valueCoding)==null?void 0:We.code}).filter(Pe=>Pe!==void 0))!=null?Qr:[],[ua,Sr]=(0,t.useState)(uo.length),ar=(Li=(Yr=ro.extension)==null?void 0:Yr.find(Pe=>Pe.url===i.Z_))==null?void 0:Li.valueInteger,Tr=(Pe,Ce)=>{var We,gt,jt;let tn;if(Pe){const Ln=er.options.find(lr=>lr.value===Ce);tn=[...(gt=(We=er.selectedAnswer)==null?void 0:We.filter(lr=>Object.keys(lr).length!==0))!=null?gt:[],No?{valueReference:Ln?.valueReference}:{valueCoding:rn({code:Ce,display:Ln?.label},Ln?.system?{system:Ln.system}:{}),extension:Ln?.extension||[]}],Sr(lr=>lr+1)}else tn=((jt=er.selectedAnswer)==null?void 0:jt.filter(Ln=>{var lr,hn;return No?((lr=Ln.valueReference)==null?void 0:lr.display)!==Ce:((hn=Ln.valueCoding)==null?void 0:hn.code)!==Ce}))||[{}],Sr(Ln=>Ln-1);er.handleInputChange(er.item,tn)};return(0,n.jsxs)("div",{"data-testid":ro.linkId,children:[_o&&(0,n.jsx)(N,{isLabel:!0,text:_o,required:xo||!1}),(0,n.jsx)("div",{children:er.options.map((Pe,Ce)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Pe.value,id:Ce.toString(),className:Ce!==er.options.length-1?"mb-2xl":"",name:Pe.label,isInvalid:!!So,isSelected:uo?.includes(Pe?.value),label:Pe.label,onChange:We=>Tr(We,Pe.value),isDisabled:er.readOnly||er.isLoading||(!uo?.includes(Pe?.value)&&ar?ua>=ar:!1)},Ce))}),(0,n.jsx)(r.HintText,{isInvalid:!!So,children:So})]})},Tt=({item:er,onCompleteHandler:Qr,updatedText:Yr,options:Li,handleInputChange:ro,errorMessage:Mo,readOnly:_o,initialValue:xo,selectedAnswer:So,isLoading:No,required:uo})=>{var ua,Sr;const ar=`${er.linkId}-label`,Tr=`${er.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":er.linkId,children:[Yr&&(0,n.jsx)(N,{id:ar,isLabel:!0,text:Yr,required:uo||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:er.linkId,name:er.linkId,"aria-labelledby":Yr?ar:void 0,"aria-describedby":Mo?Tr:void 0,isRequired:uo,className:Li.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Sr=(ua=So?.[0])==null?void 0:ua.valueCoding)==null?void 0:Sr.code)||xo||"",onChange:Pe=>{const Ce=Pe,We=Li.find(jt=>jt.value===Ce),gt=We?We.label:"";ro(er,[{valueCoding:{code:Ce,display:gt,system:We?.system||void 0},extension:We?.extension||[]}]),Qr(er.linkId)},isInvalid:!!Mo,children:Li.map(Pe=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Pe.value,isDisabled:_o||No,value:Pe.value,label:Pe.label},Pe.value))},er.linkId),Mo&&(0,n.jsx)("div",{id:Tr,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Mo})})]})};var Kt=Object.defineProperty,un=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,jn=(er,Qr,Yr)=>Qr in er?Kt(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,wr=(er,Qr)=>{for(var Yr in Qr||(Qr={}))on.call(Qr,Yr)&&jn(er,Yr,Qr[Yr]);if(un)for(var Yr of un(Qr))Cn.call(Qr,Yr)&&jn(er,Yr,Qr[Yr]);return er};const Wr=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,ua,Sr,ar;const{linkId:Tr,text:Pe,required:Ce,answerOption:We,prefix:gt,readOnly:jt}=er,tn=er?.type==="reference",Ln=Pe?(0,o.nt)(ro,gt,Pe):"",hn=(()=>{var d0,Zr;const K0=We?.find(Ni=>Ni.initialSelected===!0);return K0?tn?((d0=K0.valueReference)==null?void 0:d0.display)||"":((Zr=K0?.valueCoding)==null?void 0:Zr.code)||"":""})(),Zn=(We?.map(d0=>{var Zr,K0,Ni,dt,_t;return{label:((Zr=d0?.valueCoding)==null?void 0:Zr.display)||((K0=d0?.valueReference)==null?void 0:K0.display)||"",value:tn?((Ni=d0.valueReference)==null?void 0:Ni.display)||"":((dt=d0.valueCoding)==null?void 0:dt.code)||"",valueReference:tn?d0.valueReference:{},extension:d0.extension||[],system:((_t=d0.valueCoding)==null?void 0:_t.system)||""}})||[]).filter(d0=>d0.label),cn=Mo?.[Tr],Or=(ar=(Sr=(ua=(uo=(No=er?.extension)==null?void 0:No.find(d0=>d0.url.includes("questionnaire-itemControl")))==null?void 0:uo.valueCodeableConcept)==null?void 0:ua.coding)==null?void 0:Sr[0])==null?void 0:ar.code;let Cr=null;const Vr={item:er,onCompleteHandler:Qr,updatedText:Ln,options:Zn,handleInputChange:Li,errorMessage:cn,required:Ce,readOnly:jt,initialValue:hn,selectedAnswer:Yr,isLoading:_o,showQuestionPrefix:ro,placeholder:xo,hintText:So};switch(Or){case"drop-down":Cr=(0,n.jsx)(Zt,wr({},Vr));break;case"check-box":Cr=(0,n.jsx)(vt,wr({},Vr));break;case"radio-button":Cr=(0,n.jsx)(Tt,wr({},Vr));break}return(0,n.jsx)(n.Fragment,{children:Cr})};var _r=e(73697),f0=e(71924),Di=e(46776);const _0=er=>`${String(er.month).padStart(2,"0")}/${String(er.day).padStart(2,"0")}/${er.year}`,si=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,ua;const{linkId:Sr,text:ar,required:Tr,prefix:Pe,readOnly:Ce}=er,We=(0,t.useRef)(null),[gt,jt]=(0,t.useState)(!1),[tn,Ln]=(0,t.useState)(null),{setIsCurrentFormValid:lr,isCurrentFormValid:hn,trackQuestionnaireEvent:Zn}=(0,b.c)(),cn=ar?(0,o.nt)(ro,Pe,ar):"",Or=Mo?.[Sr]||"",Cr=(No=er.extension)==null?void 0:No.find(G0=>G0.url===i.dU),Vr=(uo=er.extension)==null?void 0:uo.find(G0=>G0.url===i.bK),d0=(0,t.useMemo)(()=>{var G0;const c0=Cr?.valueString||Cr?.valueDate;return c0||(0,o.iI)((G0=Cr?.valueExpression)==null?void 0:G0.expression)},[Cr]),Zr=(0,t.useMemo)(()=>{var G0;const c0=Vr?.valueString||Vr?.valueDate;return c0||(0,o.iI)((G0=Vr?.valueExpression)==null?void 0:G0.expression)},[Vr]),K0=(0,t.useMemo)(()=>{if(d0&&/^\d{4}-\d{2}-\d{2}$/.test(d0))try{return(0,_r._U)(d0)}catch{}return(0,_r._U)("1900-01-01")},[d0]),Ni=(0,t.useMemo)(()=>{if(Zr&&/^\d{4}-\d{2}-\d{2}$/.test(Zr))try{return(0,_r._U)(Zr)}catch(G0){console.warn("Failed to parse maxDateStr:",Zr,G0)}return(0,_r._U)("2099-12-31")},[Zr]),_t=(G0=>{if(!G0)return"";const c0=G0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!c0)return G0;const[,Z0,x0,Ao]=c0;return`${x0}/${Ao}/${Z0}`})(((ua=Yr?.[0])==null?void 0:ua.valueDate)||""),En=G0=>{if(!G0)return"";const c0=G0.replace(/\D/g,"");if(c0.length===0)return"";if(c0.length<=2)return c0.length===2?`${c0}/`:c0;const Z0=Ao=>{const Bi=Ao.slice(0,2),Fo=Ao.slice(2);return Fo.length===2?`${Bi}/${Fo}/`:`${Bi}/${Fo}`},x0=Ao=>{const Bi=Ao.slice(0,2),Fo=Ao.slice(2,4),ko=Ao.slice(4,8);return`${Bi}/${Fo}/${ko}`};return c0.length<=4?Z0(c0):x0(c0)},Tn=()=>{if(Ce||_o)return;if(_t.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const c0=(0,_r._U)(_t);Ln(c0)}catch{Ln(null)}else{const c0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(c0){const[,Z0,x0,Ao]=c0,Bi=parseInt(Z0,10),Fo=parseInt(x0,10);if(Bi>=1&&Bi<=12&&Fo>=1&&Fo<=31)try{const ko=(0,_r._U)(`${Ao}-${Z0}-${x0}`);Ln(ko)}catch{Ln(null)}else Ln(null)}else Ln(null)}jt(!0)},tr=()=>{if(tn){const G0=`${tn.year}-${String(tn.month).padStart(2,"0")}-${String(tn.day).padStart(2,"0")}`;Zn(er.linkId,{value:(0,o.CP)(`${String(tn.month).padStart(2,"0")}/${String(tn.day).padStart(2,"0")}/${tn.year}`)}),Li(er,[{valueDate:(0,o.Fy)(G0)}])}jt(!1),Ln(null)},Hr=()=>{jt(!1),Ln(null)},p0=G0=>{var c0;const Z0=((c0=We.current)==null?void 0:c0.selectionStart)||0,x0=_t,Ao=En(G0),Bi=Ao.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Bi){const[,Fo,ko,Oa]=Bi,Sa=parseInt(Fo,10),Ls=parseInt(ko,10),Bs=parseInt(Oa,10);if(ui(Sa,Ls,Bs).isValid){const Zo=`${Oa}-${Fo}-${ko}`;Zn(er.linkId,{value:(0,o.CP)(`${Fo}/${ko}/${Oa}`)}),Li(er,[{valueDate:(0,o.Fy)(Zo)}])}else Li(er,[{valueDate:Ao}])}else Li(er,[{valueDate:Ao}]);setTimeout(()=>{if(We.current){const Fo=x0.replace(/\D/g,""),ko=Ao.replace(/\D/g,"");let Oa=Z0;Ao===x0&&(Oa=Z0-1),ko.length>=Fo.length&&Ao!==x0?Ao[Z0-1]==="/"?Oa=Z0+1:Oa=Z0:ko.length<Fo.length&&(x0[Z0-1]==="/"?Oa=Math.max(0,Z0-1):Oa=Z0),We.current.setSelectionRange(Oa,Oa)}},0)},ui=(G0,c0,Z0)=>{if(G0<1||G0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(c0<1||c0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const x0=new Date(Z0,G0,0).getDate();if(c0>x0)return{isValid:!1,error:"Invalid day for the selected month"};if(d0||Zr){const Ao=new f0.ng(Z0,G0,c0);if(d0&&/^\d{4}-\d{2}-\d{2}$/.test(d0))try{const Bi=(0,_r._U)(d0);if(Ao.compare(Bi)<0){const Fo=(0,o.di)(i.Ck,er.extension);if(Fo)return{isValid:!1,error:Fo};const ko=_0(Bi);return{isValid:!1,error:`Date must be on or after ${ko}`}}}catch{}if(Zr&&/^\d{4}-\d{2}-\d{2}$/.test(Zr))try{const Bi=(0,_r._U)(Zr);if(Ao.compare(Bi)>0){const Fo=(0,o.di)(i.Cx,er.extension);if(Fo)return{isValid:!1,error:Fo};const ko=_0(Bi);return{isValid:!1,error:`Date must be on or before ${ko}`}}}catch{}}return{isValid:!0,error:""}},g0=()=>{const G0=_t.replace(/\D/g,"");if(G0.length>0&&G0.length<8){Qr(er.linkId);return}const c0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!c0&&G0.length>=6){Qr(er.linkId);return}if(c0){const[,Z0,x0,Ao]=c0,Bi=parseInt(Z0,10),Fo=parseInt(x0,10),ko=parseInt(Ao,10);if(ui(Bi,Fo,ko).isValid){const Oa=`${Ao}-${Z0}-${x0}`;Li(er,[{valueDate:(0,o.Fy)(Oa)}])}}Qr(er.linkId)},k0=(()=>{if(!_t)return"";const G0=_t.replace(/\D/g,"");if(G0.length>0&&G0.length<8)return"";const c0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!c0&&G0.length>=6)return hn&&lr(!1),"Invalid date";if(c0){const[,Z0,x0,Ao]=c0,Bi=parseInt(Z0,10),Fo=parseInt(x0,10),ko=parseInt(Ao,10),{isValid:Oa,error:Sa}=ui(Bi,Fo,ko);if(!Oa)return hn&&lr(!1),Sa||"Invalid date"}return""})(),Ci=!!Or||!!k0;return(0,n.jsxs)("div",{children:[cn&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:cn,required:Tr||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Ce||_o,className:(0,P.cx)("absolute top-3 right-3.5 z-3 cursor-pointer","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Ce||_o)&&"cursor-not-allowed opacity-50"),onClick:Tn,"aria-label":"Open calendar",children:(0,n.jsx)(F.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,P.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Ce||_o)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:We,isRequired:Tr,size:"md",type:"text",name:Sr,"data-testid":Sr,id:Sr,value:_t,onChange:p0,placeholder:xo,isDisabled:Ce||_o,onBlur:g0,hint:k0||Or||So,isInvalid:Ci,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Sr)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:gt,onOpenChange:G0=>{G0||Hr()},primaryButton:{children:"Apply",onClick:tr,isDisabled:!tn},secondaryButton:{children:"Cancel",onClick:Hr},children:(0,n.jsx)(Di.lr,{value:tn,onChange:Ln,minValue:K0,maxValue:Ni,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:K0,maxValue:Ni,onYearPickerOpen:()=>{Ln(null)}})})})]})},X0=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo;const{linkId:So,text:No,required:uo,prefix:ua,readOnly:Sr}=er,ar=No?(0,o.nt)(ro,ua,No):"",Tr=Mo?.[So]||"";return(0,n.jsxs)("div",{children:[ar&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ar,required:uo||!1}),(0,n.jsx)(r.Input,{isRequired:uo,size:"md",type:"datetime-local",id:So,"aria-label":So,"data-testid":So,placeholder:"Type your response here...",value:((xo=Yr?.[0])==null?void 0:xo.valueDateTime)||"",onChange:Pe=>{let Ce=Pe;const[We,gt]=Ce.split("T");We&&gt&&(Ce=`${(0,o.Fy)(We)}T${gt}:00`),Li(er,[{valueDateTime:Ce}])},isDisabled:Sr||_o,onBlur:()=>{Qr(er.linkId)},hint:Tr,isInvalid:!!Tr},So)]})},Si=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:ua,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=ua?(0,o.nt)(ro,ar,ua):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er),gt=(No=Yr?.[0])==null?void 0:No.valueDecimal,[jt,tn]=(0,t.useState)(String(gt??""));return(0,t.useEffect)(()=>{tn(String(gt??""))},[gt]),(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,size:"md",id:uo,"aria-label":uo,"data-testid":uo,placeholder:xo,value:jt,onChange:Ln=>{tn(Ln)},isDisabled:Tr||_o,onBlur:()=>{const Ln=parseFloat(jt);tn(isNaN(Ln)?"":String(Ln)),Li(er,[{valueDecimal:isNaN(Ln)?void 0:Ln}]),Qr(er.linkId)},type:"number",hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},pr=({item:er,showStepper:Qr=!1})=>{var Yr;const{text:Li,linkId:ro,type:Mo}=er,_o=Li&&(0,o.nt)(!1,"",Li),xo=(Yr=er.extension)==null?void 0:Yr.find(ua=>ua.url===i.Yt),So=xo?.valueBoolean===!0,No=Mo==="group"&&(0,o.$O)(er)!==void 0,uo=()=>{const ua=(0,o.$O)(er),Sr=(0,o.t7)(er);if(ua===void 0||Sr===void 0||Sr<=0)return[];const ar=[];for(let Tr=1;Tr<=Sr;Tr++){let Pe="incomplete";Tr<ua?Pe="complete":Tr===ua&&(Pe="current"),ar.push({title:"",description:"",status:Pe})}return ar};return _o&&!So?(0,n.jsxs)("div",{"data-testid":ro,children:[(0,n.jsx)(N,{text:_o,required:!1,className:""}),Qr&&No&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:uo()})})]}):null},mr=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:ua,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=ua?(0,o.nt)(ro,ar,ua):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,"data-testid":uo,size:"md",id:uo,"aria-label":uo,placeholder:xo,value:String((No=Yr?.[0])==null?void 0:No.valueInteger)||"",onChange:gt=>{Li(er,[{valueInteger:Number(gt)}])},isDisabled:Tr||_o,onBlur:()=>{Qr(er.linkId)},type:"number",hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},vr=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,ua;const{linkId:Sr,text:ar,extension:Tr,required:Pe,prefix:Ce,readOnly:We}=er,gt=ar?(0,o.nt)(ro,Ce,ar):"",jt=Tr?.find(lr=>lr.url.includes("questionnaire-unitOption")),tn=Mo?.[Sr],Ln=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[gt&&(0,n.jsx)(N,{isLabel:!0,text:gt,required:Pe||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Pe,size:"md",id:Sr,"aria-label":Sr,"data-testid":Sr,value:(No=Yr?.[0])!=null&&No.valueQuantity?String((uo=Yr[0].valueQuantity)==null?void 0:uo.value):"",onChange:lr=>{Li(er,[{valueQuantity:{value:parseFloat(lr)}}])},isDisabled:We||_o,onBlur:()=>{var lr,hn,Zn;const cn=(lr=Yr?.[0])!=null&&lr.valueQuantity?parseFloat(String((Zn=(hn=Yr?.[0])==null?void 0:hn.valueQuantity)==null?void 0:Zn.value)).toFixed(2):"";Li(er,[{valueQuantity:{value:parseFloat(cn)}}]),Qr(er.linkId)},hint:tn||So,isInvalid:!!tn,trailingAddon:(0,n.jsx)("p",{className:"bg-primary ring-primary flex size-full w-max items-center rounded-lg rounded-l-none p-1 text-center ring-1 ring-inset",children:(ua=jt?.valueCoding)==null?void 0:ua.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:xo,autoComplete:Ln})},Sr)]})};var T0=e(61784);const M0="ui-toolkit-modern",Q0={CLOSE_MODAL:"CLOSE_MODAL",PROFILE:"PROFILE",SEARCH:"SEARCH",CALENDAR_PREV_WEEK:"CALENDAR_PREV_WEEK",CALENDAR_NEXT_WEEK:"CALENDAR_NEXT_WEEK",CALENDAR_CANCEL:"CALENDAR_CANCEL",CALENDAR_APPLY:"CALENDAR_APPLY",CALENDAR:"CALENDAR",NEXT_AVAILABLE_APPOINTMENTS:"NEXT_AVAILABLE_APPOINTMENTS",NO_NEXT_AVAILABLE_APPOINTMENTS:"NO_NEXT_AVAILABLE_APPOINTMENTS",TODAY:"TODAY",CLICK_TO_UPLOAD:"CLICK_TO_UPLOAD",OR_DRAG_AND_DROP:"OR_DRAG_AND_DROP",FAILED_TO_UPLOAD:"FAILED_TO_UPLOAD",TRY_AGAIN:"TRY_AGAIN",LOCATIONS_LOWER_CASE:"LOCATIONS_LOWER_CASE",LOCATION_LOWER_CASE:"LOCATION_LOWER_CASE",EXPAND:"EXPAND",COLLAPSE:"COLLAPSE",DISCLOSURE_MODAL_TITLE:"DISCLOSURE_MODAL_TITLE",DISCLOSURE_MODAL_DESCRIPTION:"DISCLOSURE_MODAL_DESCRIPTION",DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE:"DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE",DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON:"DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON",FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON:"FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON",FILE_DISCLOSURE_UPLOAD_BUTTON:"FILE_DISCLOSURE_UPLOAD_BUTTON",FILE_UPLOAD_DROPZONE:"FILE_UPLOAD_DROPZONE",DOWNLOAD_DISCLOSURE_TITLE:"DOWNLOAD_DISCLOSURE_TITLE",DOWNLOAD_DISCLOSURE_DESCRIPTION:"DOWNLOAD_DISCLOSURE_DESCRIPTION",DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE:"DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE",DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE:"DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE",DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE:"DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE",DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON:"DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON",DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON:"DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON",DISMISS:"DISMISS",LOCATION_DISTANCE:"LOCATION_DISTANCE",LOCATION_DISTANCE_AWAY:"LOCATION_DISTANCE_AWAY",MILE:"MILE",MILES:"MILES",ADDRESS:"ADDRESS",CURRENT_LOCATION:"CURRENT_LOCATION",ZIP_CODE:"ZIP_CODE",SEE_ALL:"SEE_ALL",SEE_LESS:"SEE_LESS"},$i={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},ki={[$i.CURRENT_LOCATION]:Q0.CURRENT_LOCATION,[$i.ZIP_CODE]:Q0.ZIP_CODE,[$i.ADDRESS]:Q0.ADDRESS},so={mi:{singular:Q0.MILE,plural:Q0.MILES}},Ro=({resourceData:er,handleInputChange:Qr,item:Yr,questionnaireSchemaItems:Li})=>{var ro;const{t:Mo}=(0,T0.SS)(),{queryParams:_o}=(0,it.useSearchQueryParams)(),xo=_o.locationType||"",{setCurrentGroupIndex:So,handleContinueButtonClick:No,setHideFooterButton:uo}=(0,b.c)(),{trackEvent:ua}=(0,s.st)();(0,t.useEffect)(()=>{if(!Yr.readOnly)return uo(!0),()=>{uo(!1)}},[Yr.readOnly,uo]);const Sr=(ro=Yr.extension)==null?void 0:ro.find(hn=>hn.url===i.Uf),ar=Sr?.valueString,Tr=()=>{if(ar){const hn=(0,o.Ue)(Li||[],ar);hn!==-1&&So(hn)}},Pe=hn=>{const Zn=hn.find(cn=>cn.url.includes("description"));return Zn?.valueString||""},Ce=hn=>{const Zn=hn.find(Zr=>Zr.url.includes("distance-value")),cn=hn.find(Zr=>Zr.url.includes("distance-unit")),Or=Zn?.valueString?Number(Zn.valueString):NaN,Cr=cn?.valueString||"";if(!Cr||isNaN(Or))return null;const Vr=Math.round(Or);let d0=Cr;return so[Cr]&&(d0=Mo(Vr===1?so[Cr].singular:so[Cr].plural)),xo&&ki[xo]?Mo(Q0.LOCATION_DISTANCE,{distance:`${Vr} ${d0}`,locationType:Mo(ki[xo])}):Mo(Q0.LOCATION_DISTANCE_AWAY,{distance:`${Vr} ${d0}`})},We=hn=>({id:hn.id||"",providerName:hn.name||"",specialty:"",distance:Ce(hn.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:hn.address||"",valueReference:hn.valueReference||{reference:hn.id}}),gt=hn=>{var Zn,cn,Or,Cr;const Vr=hn;return We({id:Vr.id,name:(Zn=Vr.name)!=null?Zn:"",address:(Cr=(Or=(cn=Vr?.address)==null?void 0:cn.line)==null?void 0:Or[0])!=null?Cr:"",extension:Vr?.extension,valueReference:{reference:Vr.id}})},jt=hn=>We({id:hn?.reference,name:hn?.display,address:Pe(hn?.extension||[]),extension:hn?.extension,valueReference:hn}),Ln=(()=>er&&Array.isArray(er)&&er.length>0?er.map(gt):Yr.initial&&Array.isArray(Yr.initial)&&Yr.initial.length>0?Yr.initial.map(hn=>jt(hn.valueReference)):Yr.answerOption?Yr.answerOption.map(hn=>jt(hn.valueReference)):[])(),lr=hn=>{Qr(Yr,[{valueReference:hn}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Yr.readOnly&&"pb-4xl"),children:Yr.readOnly?Ln.map(({address:hn,id:Zn,providerName:cn,placeholderIcon:Or,distance:Cr})=>(0,n.jsx)(it.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Or},locationName:cn,address:hn,distance:Cr,actionButtonText:ar?"Change location":void 0,onActionButtonClick:ar?Tr:void 0},Zn)):Ln.map(({address:hn,id:Zn,providerName:cn,placeholderIcon:Or,specialty:Cr,valueReference:Vr,distance:d0})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Or},providerName:{content:cn},specialty:{content:Cr},location:{address:hn,distance:d0},actionButton:{children:"Schedule appointment",onClick:()=>{ua("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:hn,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),lr(Vr),No?.()}}},Zn))})};var To=e(79079),eo=e(32066),Io=e(43915),mo=e(36181),qo=e(37234),Uo=e(59931),qa=e(65388),Dr=Object.defineProperty,Jn=Object.defineProperties,Kr=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,U0=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable,$n=(er,Qr,Yr)=>Qr in er?Dr(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,Er=(er,Qr)=>{for(var Yr in Qr||(Qr={}))U0.call(Qr,Yr)&&$n(er,Yr,Qr[Yr]);if(Lr)for(var Yr of Lr(Qr))bn.call(Qr,Yr)&&$n(er,Yr,Qr[Yr]);return er},u0=(er,Qr)=>Jn(er,Kr(Qr));const Qn="tz-code",Nr={"ui-toolkit/LocationCard":Ro,"ui-toolkit/TimeSlotSelection":({resourceData:er,item:Qr,handleInputChange:Yr,selectedAnswer:Li,questionnaireSchemaItems:ro,formData:Mo,onCompleteHandler:_o})=>{var xo,So;const{t:No}=(0,To.S)(),{trackEvent:uo}=(0,s.st)(),{isLoading:ua,setIsInlineNextQuestionTriggered:Sr}=(0,b.c)(),ar=c0=>{const Z0=c0.match(/^(\d{4}-\d{2}-\d{2})/);return Z0?Z0[1]:c0},Tr=c0=>{const Z0=c0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return Z0?`${Z0[1]} ${Z0[2]}`:c0},Pe=c0=>{const Z0=c0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Z0){const[,x0,Ao,Bi]=Z0;return new Date(parseInt(x0),parseInt(Ao)-1,parseInt(Bi))}return new Date},We=(()=>{var c0;if((c0=Li?.[0])!=null&&c0.valueReference){const Z0=Li[0].valueReference,x0=Z0.display||"",Ao=ar(x0);if(Ao)return{date:Pe(Ao),slotId:Z0.reference||""}}return{date:new Date,slotId:""}})(),[gt,jt]=(0,t.useState)(We.date),[tn,Ln]=(0,t.useState)(We.slotId),[lr,hn]=(0,t.useState)(new Set),Zn=(0,t.useMemo)(()=>new f0.ng(gt.getFullYear(),gt.getMonth()+1,gt.getDate()),[gt]),cn=c0=>({display:c0.display||"",id:c0.id||"",start:c0.start||"",extension:Array.isArray(c0.extension)?c0.extension:[],identifier:Array.isArray(c0.identifier)?c0.identifier:[],type:c0.type||""}),Or=c0=>cn({display:c0.start?Tr(c0.start):"",id:c0.id,start:c0.start,extension:c0.extension,identifier:c0.identifier}),Cr=c0=>cn({display:c0?.display||"",id:c0?.reference,start:c0?.display,extension:c0?.extension,identifier:c0?.identifier,type:c0?.type}),Vr=()=>{if(Array.isArray(er)&&er.length>0)return er.filter(c0=>c0.resourceType==="Appointment").map(Or);if(Qr.initial&&Array.isArray(Qr.initial)&&Qr.initial.length>0)return Qr.initial.map(c0=>Cr(c0.valueReference));if(Qr.answerOption)return Qr.answerOption.map(c0=>Cr(c0.valueReference))},d0=(0,t.useMemo)(()=>Vr()||[],[er,Li,Qr]),Zr=(0,t.useMemo)(()=>{const c0={};return d0.forEach(Z0=>{if(Z0.start&&Z0.id){const x0=ar(Z0.start);c0[x0]||(c0[x0]=[]),c0[x0].push({display:Z0.display,id:Z0.id,start:Z0.start,extension:Z0.extension})}}),c0},[d0]),K0=(0,t.useMemo)(()=>{const c0=Object.keys(Zr).sort(),Z0=[];if(c0.length===0)return Z0.push(Zn),lr.forEach(Bi=>{const Fo=(0,Io.A)(Bi);Z0.push(new f0.ng(Fo.getFullYear(),Fo.getMonth()+1,Fo.getDate()))}),Z0;const x0=(0,Io.A)(c0[c0.length-1]),Ao=new f0.ng(x0.getFullYear(),x0.getMonth()+1,x0.getDate());for(let Bi=Zn;Bi.compare(Ao)<=0;Bi=Bi.add({days:1})){const Fo=`${Bi.year}-${String(Bi.month).padStart(2,"0")}-${String(Bi.day).padStart(2,"0")}`;Zr[Fo]||Z0.push(Bi)}return lr.forEach(Bi=>{const Fo=(0,Io.A)(Bi),ko=new f0.ng(Fo.getFullYear(),Fo.getMonth()+1,Fo.getDate());Z0.some(Oa=>Oa.year===ko.year&&Oa.month===ko.month&&Oa.day===ko.day)||Z0.push(ko)}),Z0},[Zr,lr,Zn]),Ni=(0,t.useMemo)(()=>(0,o.mR)(Qr)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Qr]),dt=(0,t.useMemo)(()=>Object.keys(Zr).map(c0=>{const Z0=(0,Io.A)(c0);return new f0.ng(Z0.getFullYear(),Z0.getMonth()+1,Z0.getDate())}),[Zr]),_t=(0,mo.A)((0,qo.A)(gt),"yyyy-MM-dd"),En=(0,t.useMemo)(()=>Zr[_t]||[],[Zr,_t]);(0,t.useEffect)(()=>{const c0=Object.entries(Zr).sort(([Z0],[x0])=>Z0.localeCompare(x0)).slice(0,3).reduce((Z0,[x0,Ao])=>u0(Er({},Z0),{[`${x0} ${p0}`]:Ao.map(Bi=>{var Fo;return(0,qa.YX)({time:Bi.start,timeZone:(0,o.lv)((Fo=En[0])==null?void 0:Fo.extension)}).time})}),{});uo("slots_returned",{Specialty:"Vaccines",first_three_days_slots:c0,_event_metadata:{description:"The API called for bookable slots based on the user's answers on who, when, where and why they want to book an appointment."}})},[]);const Tn=t.useRef(null),tr=t.useRef(null),Hr=t.useRef(!1);(0,t.useEffect)(()=>{var c0;const Z0=Object.keys(Zr).sort();Z0.length===0||Hr.current||(Hr.current=!0,(c0=Li?.[0])!=null&&c0.valueReference||jt((0,Io.A)(Z0[0])))},[Zr]),(0,t.useEffect)(()=>{var c0;const Z0=Object.keys(Zr).sort();if(Z0.length===0)return;const Ao=!(Tn.current===null)&&JSON.stringify(Tn.current)!==JSON.stringify(Zr);if(Tn.current=Zr,!!Ao&&(hn(new Set),tr.current)){const Bi=tr.current;if(!(((c0=Zr[Bi])==null?void 0:c0.length)>0)){const ko=new Set,Oa=(0,Io.A)(Bi),Sa=(0,Io.A)(Z0[0]);let Ls=Oa;for(;Ls<Sa;){const Bs=(0,mo.A)(Ls,"yyyy-MM-dd");ko.add(Bs),Ls=new Date(Ls),Ls.setDate(Ls.getDate()+1)}hn(ko),Ln("")}tr.current=null}},[Zr]);const p0=(0,t.useMemo)(()=>{var c0;const Z0=En[0];if(!Z0?.extension)return"";const x0=Z0.extension.find(Ao=>Ao?.url===Qn);try{return(0,Uo.formatToTimeZone)(new Date,"(z)",{timeZone:(c0=x0?.valueCode)!=null?c0:""})}catch{return""}},[En]),ui=(0,t.useMemo)(()=>{const c0=No(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return p0?`${c0} ${p0}`:c0},[No,p0]),g0=(0,t.useMemo)(()=>{const c0=(0,eo.Ec)((0,eo.Xj)()).add({days:Ni}),Z0=`${c0.year}-${String(c0.month).padStart(2,"0")}-${String(c0.day).padStart(2,"0")}`,Ao=Object.keys(Zr).sort().find(Bi=>Bi>_t&&Bi<=Z0);if(Ao){const Bi=(0,Io.A)(Ao);return new f0.ng(Bi.getFullYear(),Bi.getMonth()+1,Bi.getDate())}return null},[Zr,_t,Ni]),wi=()=>{if(g0){const c0=g0.toDate((0,eo.Xj)());jt(c0),Ln("")}},k0=c0=>{if(!c0){Ln(""),Yr(Qr,void 0);return}Ln(c0.id);const Z0=[{valueReference:{display:c0.display,reference:c0.id,extension:c0.extension,identifier:c0.identifier,type:c0.type}}];Yr(Qr,Z0)},Ci=c0=>{var Z0;if(!c0||ua||!Hr.current)return;const x0=Object.keys(Zr).sort(),Ao=x0[x0.length-1],Bi=x0[0],Fo=`${c0.year}-${String(c0.month).padStart(2,"0")}-${String(c0.day).padStart(2,"0")}`;if(Ao&&(Fo>Ao||Bi&&Fo<Bi)&&(0,o.mR)(Qr)&&ro&&!K0?.some(Oa=>Oa.compare(c0)===0)){const Oa=(0,o.yQ)(Qr,ro);if(Oa){tr.current=Fo;let Sa="-06:00";if((Z0=d0[0])!=null&&Z0.start){const f1=d0[0].start.match(/([+-]\d{2}:\d{2})$/);f1&&(Sa=f1[1])}const Bs=[{valueDateTime:`${Fo}T23:59:59${Sa}`}],Zo=Yr(Oa,Bs);Yr(Qr,void 0,(0,o.Nw)(Zo||Mo||[],Qr.linkId),void 0,!0),Sr(!0),_o(Oa.linkId,!0,!0)}}const ko=c0.toDate((0,eo.Xj)());jt(ko),Ln("")},G0=c0=>{if(!c0)return;const Z0=En.find(x0=>x0.id===c0);uo("slot_selected",{Specialty:"Vaccines",time_slot:Z0?(0,qa.YX)({time:Z0.start,timeZone:(0,o.lv)(En[0].extension)}).dateWithTime:"",_event_metadata:{description:"A user clicked an option to select a slot or search a different date set if no slots were found."}}),k0(Z0??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Ci,disabledDates:K0,highlightedDates:dt,loading:ua,minValue:(0,eo.Ec)((0,eo.Xj)()),maxValue:(0,eo.Ec)((0,eo.Xj)()).add({days:Ni}),value:Zn,defaultValue:Zn,appointmentSlots:{title:ui,onChange:G0,defaultValue:Li&&((So=(xo=Li[0])==null?void 0:xo.valueReference)==null?void 0:So.reference)||void 0,value:tn||void 0,items:En.map(c0=>({label:Ee(c0.start),value:c0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[No(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),g0&&(0,n.jsx)("button",{onClick:wi,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:No(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var ri=Object.defineProperty,qi=Object.defineProperties,ea=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,S0=(er,Qr,Yr)=>Qr in er?ri(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,ja=(er,Qr)=>{for(var Yr in Qr||(Qr={}))la.call(Qr,Yr)&&S0(er,Yr,Qr[Yr]);if(Wo)for(var Yr of Wo(Qr))Oi.call(Qr,Yr)&&S0(er,Yr,Qr[Yr]);return er},cs=(er,Qr)=>qi(er,ea(Qr)),ys=(er,Qr)=>{var Yr={};for(var Li in er)la.call(er,Li)&&Qr.indexOf(Li)<0&&(Yr[Li]=er[Li]);if(er!=null&&Wo)for(var Li of Wo(er))Qr.indexOf(Li)<0&&Oi.call(er,Li)&&(Yr[Li]=er[Li]);return Yr};const gs=(er,Qr)=>er.answerOption?er.answerOption.map(Yr=>{var Li,ro;const Mo=(ro=(Li=Yr.valueReference)==null?void 0:Li.reference)==null?void 0:ro.replace("#","");return Qr.find(_o=>_o.id===Mo)}).filter(Boolean):[],ss=er=>{var Qr,Yr,Li;const ro=er.find(Mo=>{var _o,xo;return Mo.url.includes("questionnaire-itemControl")&&((xo=(_o=Mo.valueCodeableConcept)==null?void 0:_o.coding)==null?void 0:xo.some(So=>{var No;return(No=So.code)==null?void 0:No.startsWith("ui-toolkit/")}))});return(Li=(Yr=(Qr=ro?.valueCodeableConcept)==null?void 0:Qr.coding)==null?void 0:Yr.find(Mo=>{var _o;return(_o=Mo.code)==null?void 0:_o.startsWith("ui-toolkit/")}))==null?void 0:Li.code},d1=er=>{var{uiToolkitCode:Qr,props:Yr}=er,Li=Yr,{item:ro,contained:Mo=[],customErrorConfigurations:_o}=Li,xo=ys(Li,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:So}=(0,b.c)(),No=Nr[Qr];if(!No)return(0,n.jsx)(n.Fragment,{});const uo=gs(ro,Mo),ua=uo.length>0;return!(ro.answerOption&&ro.answerOption.length>0)&&!ua&&!ro.readOnly?(So(!0),(0,n.jsx)(Ie,{configKey:Qr,customErrorConfigurations:_o})):(0,n.jsx)(No,cs(ja({},xo),{item:ro,contained:Mo,customErrorConfigurations:_o,resourceData:uo,"data-testid":ro.linkId}))},O0={attachment:en,choice:Wr,boolean:nn,integer:mr,string:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:ua,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=ua?(0,o.nt)(ro,ar,ua):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,size:"md","aria-label":uo,"data-testid":uo,id:uo,type:We==="tel"?"tel":"text",placeholder:xo,value:((No=Yr?.[0])==null?void 0:No.valueString)||"",onChange:gt=>{Li(er,[{valueString:gt}])},isDisabled:Tr||_o,onBlur:gt=>{const jt=gt.target.value,tn=jt.trim();tn!==jt&&Li(er,[{valueString:tn}]),Qr(er.linkId)},hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},url:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:ua,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=ua?(0,o.nt)(ro,ar,ua):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,size:"md",type:"url",id:uo,"data-testid":uo,"aria-label":uo,placeholder:xo,value:((No=Yr?.[0])==null?void 0:No.valueUri)||"",onChange:gt=>{Li(er,[{valueUri:gt}])},isDisabled:Tr||_o,onBlur:gt=>{const jt=gt.target.value,tn=jt.trim();tn!==jt&&Li(er,[{valueUri:tn}]),Qr(er.linkId)},hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},text:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:ua,required:Sr,prefix:ar,readOnly:Tr,maxLength:Pe}=er,Ce=ua?(0,o.nt)(ro,ar,ua):"",We=Mo?.[uo]||"",gt=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Sr||!1}),(0,n.jsx)(r.TextArea,{isRequired:Sr,id:uo,"aria-label":uo,"data-testid":uo,rows:3,placeholder:xo,value:((No=Yr?.[0])==null?void 0:No.valueString)||"",onChange:jt=>{Li(er,[{valueString:jt}])},isDisabled:Tr||_o,onBlur:jt=>{const tn=jt.target.value,Ln=tn.trim();Ln!==tn&&Li(er,[{valueString:Ln}]),Qr(er.linkId)},hint:We||So,counter:!0,isInvalid:!!We,maxLength:Pe,autoComplete:gt},uo)]})},date:si,time:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo;const{linkId:So,text:No,required:uo,prefix:ua,readOnly:Sr}=er,ar=No?(0,o.nt)(ro,ua,No):"",Tr=Mo?.[So]||"";return(0,n.jsxs)("div",{children:[ar&&(0,n.jsx)(N,{isLabel:!0,text:ar,required:uo||!1}),(0,n.jsx)(r.Input,{isRequired:uo,size:"md",type:"time",id:So,"data-testid":So,"aria-label":So,placeholder:"Type your response here...",value:((xo=Yr?.[0])==null?void 0:xo.valueTime)||"",onChange:Pe=>{Li(er,[{valueTime:Pe}])},isDisabled:Sr||_o,onBlur:()=>{Qr(er.linkId)},hint:Tr,isInvalid:!!Tr},So)]})},dateTime:X0,quantity:vr,decimal:Si,question:pr,display:pr,group:pr,reference:er=>{var Qr,Yr,Li,ro,Mo;const{setHideFooterButton:_o}=(0,b.c)(),{item:xo,customErrorConfigurations:So}=er,No=xo.extension||[],uo=ss(No);return uo?(0,n.jsx)(d1,{uiToolkitCode:uo,props:er}):((Mo=(ro=(Li=(Yr=(Qr=xo?.extension)==null?void 0:Qr.find(Sr=>Sr.url.includes("questionnaire-itemControl")))==null?void 0:Yr.valueCodeableConcept)==null?void 0:Li.coding)==null?void 0:ro[0])==null?void 0:Mo.code)==="check-box"?xo.answerOption&&xo.answerOption.length>0?(0,n.jsx)(Wr,cs(ja({},er),{item:xo})):(_o(!0),(0,n.jsx)(Ie,{configKey:xo.linkId,customErrorConfigurations:So})):null}};var F0=(er,Qr,Yr)=>new Promise((Li,ro)=>{var Mo=So=>{try{xo(Yr.next(So))}catch(No){ro(No)}},_o=So=>{try{xo(Yr.throw(So))}catch(No){ro(No)}},xo=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);xo((Yr=Yr.apply(er,Qr)).next())});const Wt=({item:er,selectedAnswer:Qr,showQuestionPrefix:Yr})=>{const{text:Li,prefix:ro,required:Mo}=er,_o=Li?getUpdatedQuestionText(Yr,ro,Li):"",[xo,So]=useState(null),[No,uo]=useState(!1),{documentDownload:ua,webview:Sr}=useNativeBridge(),ar=(Qr||[]).filter(We=>{var gt,jt;return((gt=We.valueAttachment)==null?void 0:gt.data)&&((jt=We.valueAttachment)==null?void 0:jt.title)}).map((We,gt)=>{var jt,tn,Ln,lr,hn,Zn,cn;return{id:((jt=We.valueAttachment)==null?void 0:jt.id)||`preview-${gt}`,fileName:((tn=We.valueAttachment)==null?void 0:tn.title)||`attachment-${gt}`,contentType:((Ln=We.valueAttachment)==null?void 0:Ln.contentType)||"application/octet-stream",base64Data:((lr=We.valueAttachment)==null?void 0:lr.data)||"",size:getBase64Size(((hn=We.valueAttachment)==null?void 0:hn.data)||"",(Zn=We.valueAttachment)==null?void 0:Zn.contentType),type:getFileTypeFromMimeType((cn=We.valueAttachment)==null?void 0:cn.contentType)}}),Tr=useCallback(We=>{const{fileName:gt,contentType:jt,base64Data:tn}=We;if(Sr.isWithin)So({fileName:gt,contentType:jt,base64Data:tn}),uo(!0);else{const Ln=base64toObjectUrl(tn,jt),lr=document.createElement("a");lr.href=Ln,lr.download=gt,document.body.appendChild(lr),lr.click(),document.body.removeChild(lr),URL.revokeObjectURL(Ln)}},[Sr.isWithin]),Pe=useCallback(()=>F0(void 0,null,function*(){!xo||(yield ua.writeFile(xo.fileName,prepareDataUrl(xo.base64Data,xo.contentType)))}),[xo,ua]),Ce=useCallback(()=>{uo(!1),So(null)},[]);return ar.length?jsxs("div",{children:[_o&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:_o,required:Mo||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:ar.map(We=>jsx("button",{type:"button",onClick:()=>Tr(We),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(We.fileName),size:We.size,type:We.type})},We.id))}),jsx(DownloadDisclosureModal,{opened:No,onClose:Ce,onDownload:Pe,contentType:xo?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Xe=Object.defineProperty,ut=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,Nn=Object.getOwnPropertySymbols,ir=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,z0=(er,Qr,Yr)=>Qr in er?Xe(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,V0=(er,Qr)=>{for(var Yr in Qr||(Qr={}))ir.call(Qr,Yr)&&z0(er,Yr,Qr[Yr]);if(Nn)for(var Yr of Nn(Qr))xr.call(Qr,Yr)&&z0(er,Yr,Qr[Yr]);return er},j0=(er,Qr)=>ut(er,Dt(Qr));const to=(er,Qr,Yr,Li)=>{var ro;const Mo=er.extension||[];if(Li?.[BUTTON_TYPE_EXTERNAL_KEY]&&Mo.some(uo=>uo.url===BUTTON_TYPE_EXTENSION_URL))return Li[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(er)||hasParentWithUIToolkitWidget(er,Qr))return null;if(Yr&&er.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const _o=getUIToolkitCode(Mo),xo=Mo.filter(uo=>uo.url.includes("questionnaire-itemControl")).flatMap(uo=>{var ua,Sr;return(Sr=(ua=uo.valueCodeableConcept)==null?void 0:ua.coding)!=null?Sr:[]})||[];let So;return Li&&(So=(ro=xo.find(uo=>uo.code&&Li[uo.code]))==null?void 0:ro.code),(So&&Li?Li[So]:void 0)||UI_TOOLKIT_WIDGET_MAP[_o||""]||typeToRenderFunctionMap[er.type]||null},Zi=er=>{var Qr;const{item:Yr,selectedAnswer:Li,handleInputChange:ro,showQuestionPrefix:Mo,errors:_o,questionnaireSchemaItems:xo,formData:So,isNestedRepeatedItem:No=!1}=er,{linkId:uo,text:ua,prefix:Sr,required:ar,repeats:Tr}=Yr,Pe=getMaxOccursFromExtensions(Yr.extension),Ce=getPlaceholderFromExtensions(Yr.extension,Yr.type),[We,gt]=useState(()=>{if(Yr.type==="group"&&Yr.item&&Yr.item.length>0){const d0=So?.filter(Zr=>Zr.linkId===Yr.linkId)||[];if(d0.length>0)return d0.map((Zr,K0)=>K0)}else if(Li&&Li.length>0)return Li.map((d0,Zr)=>Zr);return[0]}),jt=Pe!==void 0&&We.length>=Pe,tn=ua?getUpdatedQuestionText(Mo,Sr,ua):"",Ln=()=>{const d0=Math.max(...We,-1)+1,Zr=[...We,d0];if(gt(Zr),Yr.type==="group"&&Yr.item&&Yr.item.length>0){const K0=Yr.item.map(dt=>({linkId:dt.linkId,text:dt.text,answer:[{}]})),Ni={linkId:Yr.linkId,text:Yr.text,answer:[{}],item:K0};ro(Yr,void 0,[Ni])}else{const K0=[...Li||[]];K0.push({}),ro(Yr,K0)}},lr=d0=>{if(We.length<=1)return;const Zr=We.filter((K0,Ni)=>Ni!==We.length-1);if(gt(Zr),Yr.type==="group"&&Yr.item&&Yr.item.length>0){const K0=[];if(So?.forEach((Ni,dt)=>{Ni.linkId===uo&&K0.push({item:Ni,originalIndex:dt})}),d0>=0&&d0<K0.length){const Ni=K0[d0],dt=So?.filter((_t,En)=>En!==Ni.originalIndex);ro(Yr,void 0,dt,void 0,!0)}}else{const K0=Li?.filter((Ni,dt)=>dt!==d0)||[];ro(Yr,K0.length>0?K0:[{}])}},hn=d0=>{if(!So||!Yr.item)return[];const Zr=dt=>{const _t=[];for(const En of dt)if(En.linkId===Yr.linkId&&_t.push(En),En.item&&En.item.length>0){const Tn=Zr(En.item);_t.push(...Tn)}return _t},Ni=Zr(So)[d0];return Ni?.item?Ni.item:[]},Zn=(d0,Zr)=>{if(isHiddenExtensionPresent(d0))return null;const K0=hn(Zr);if(!isQuestionEnabledForInstance(d0.enableWhen,d0.enableBehavior,So||[],Yr.linkId,Zr))return null;if(d0.repeats){const Tn=findNestedAnswer(K0,d0.linkId),tr=j0(V0({},er),{item:d0,selectedAnswer:Tn||[{}],errors:getInstanceErrors(_o,Yr,Zr),handleInputChange:(Hr,p0,ui)=>ro(Hr,p0,ui,Zr)});return jsx("div",{children:jsx(Zi,j0(V0({},tr),{isNestedRepeatedItem:!0}))},d0.linkId)}if(d0.type==="group"&&d0.item&&!getUIToolkitCode(d0?.extension||[]))return jsxs("div",{children:[d0.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:d0.text}),jsx("div",{className:"space-y-3",children:d0.item.map(Tn=>{if(!isQuestionEnabledForInstance(Tn.enableWhen,Tn.enableBehavior,So||[],Yr.linkId,Zr))return null;const Hr=to(Tn,xo,er.isLoading,er.externalComponentRenderMap);if(!Hr)return null;const p0=findNestedAnswer(K0,Tn.linkId),ui=j0(V0({},er),{item:Tn,selectedAnswer:p0,placeholder:getPlaceholderFromExtensions(Tn.extension,Tn.type),errors:getInstanceErrors(_o,Yr,Zr),handleInputChange:(g0,wi,k0)=>ro(g0,wi,k0,Zr)});return createElement(Hr,j0(V0({},ui),{key:Tn.linkId}))})})]},d0.linkId);const dt=to(d0,xo,er.isLoading,er.externalComponentRenderMap);if(!dt)return null;const _t=findNestedAnswer(K0,d0.linkId),En=j0(V0({},er),{item:d0,selectedAnswer:_t,placeholder:getPlaceholderFromExtensions(d0.extension,d0.type),errors:getInstanceErrors(_o,Yr,Zr),handleInputChange:(Tn,tr,Hr)=>ro(Tn,tr,Hr,Zr)});return createElement(dt,j0(V0({},En),{key:`${d0.linkId}-${Zr}`}))},cn=()=>{const d0=getDirectErrors(_o,uo);return jsxs("div",{className:"flex flex-col gap-2",children:[d0[uo]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:d0[uo]}),!jt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Ln,className:"mt-4 text-center",isDisabled:er.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Or=d0=>We.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>lr(d0),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${d0+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:er.isLoading}),Cr=to(Yr,xo,er.isLoading,er.externalComponentRenderMap);return hasRepeatingParent(Yr,xo)&&!No?null:!Tr||Tr&&hasCheckboxExtension(Yr)?Cr?jsx(Cr,j0(V0({},er),{placeholder:Ce,errors:{[Yr.linkId]:((Qr=_o?.[Yr.linkId])==null?void 0:Qr[0])||""}})):null:Yr.type==="group"&&Yr.item&&Yr.item.length>0&&Yr.repeats?jsxs("div",{"data-testid":`${uo}-repeating`,children:[tn&&jsx(FHIRQuestionnaireQuestionText,{text:tn,required:ar||!1}),We.map(d0=>{var Zr;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${d0>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",d0+1]}),Or(d0)]}),jsx("div",{className:"space-y-4",children:(Zr=Yr.item)==null?void 0:Zr.map(K0=>Zn(K0,d0))})]},`${uo}-instance-${d0}`)}),cn()]}):Cr?jsxs("div",{"data-testid":`${uo}-repeating`,children:[We.map(d0=>{const Zr=Li?.[d0]?[Li[d0]]:void 0,K0=j0(V0({},er),{item:Yr,selectedAnswer:Zr,errors:getInstanceErrors(_o,Yr,d0),handleInputChange:(Ni,dt,_t)=>ro(Ni,dt,_t,d0)});return jsxs("div",{className:"relative mb-2",children:[jsxs("div",{className:"flex items-end justify-between",children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",d0+1]}),Or(d0)]}),jsx(Cr,V0({},K0))]},`${uo}-instance-${d0}`)}),jsxs("div",{children:[(()=>{const Zr=getDirectErrors(_o,uo)[uo];return Zr&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:Zr})})(),!jt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Ln,className:"mt-4 text-center",isDisabled:er.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var lo=Object.defineProperty,Lo=Object.defineProperties,va=Object.getOwnPropertyDescriptors,Qo=Object.getOwnPropertySymbols,Aa=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Is=(er,Qr,Yr)=>Qr in er?lo(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,Ea=(er,Qr)=>{for(var Yr in Qr||(Qr={}))Aa.call(Qr,Yr)&&Is(er,Yr,Qr[Yr]);if(Qo)for(var Yr of Qo(Qr))Qa.call(Qr,Yr)&&Is(er,Yr,Qr[Yr]);return er},vs=(er,Qr)=>Lo(er,va(Qr));const Vs=null,ts=({formId:er,questionnaireSchema:Qr,questionnaireResponseItem:Yr,errorConfig:Li,customErrorConfigurations:ro,showQuestionPrefix:Mo=!0,isAdaptiveFlow:_o=!1,status:xo,hideBackButton:So=!1,showStepper:No=!1,onComplete:uo,onClearError:ua,handleHiddenQuestion:Sr,onGoBack:ar,onFormDataChange:Tr=()=>{},externalComponentRenderMap:Pe,children:Ce})=>{var We,gt;const{setHandleContinueButtonClick:jt,setHandleBackButtonClick:tn,setIsCurrentFormValid:Ln,setCurrentGroupLinkId:lr,setCurrentGroupIndex:hn,setTotalSteps:Zn,setHideFooterButton:cn,setIsInlineNextQuestionTriggered:Or,isCurrentFormValid:Cr,currentGroupIndex:Vr,isLoading:d0,hasCustomError:Zr,groupItemIndicesRef:K0}=useFHIRQuestionnaire(),{trackEvent:Ni}=useAnalytics(),[dt,_t]=useState([]),[En,Tn]=useState(new Set),[tr,Hr]=useState([]),[p0,ui]=useState([]),g0=K0,wi=useRef(new Map),k0=useRef(new Set),[Ci,G0]=useState({}),[c0,Z0]=useState(!1),[x0,Ao]=useState(Qr),Bi=useRef(Yr||[]),Fo=useRef(!1),ko=useRef(!1),Oa=useMemo(()=>getTotalStepsFromQuestionnaire(Qr),[Qr]),[Sa,Ls]=useState(!1),Bs=useRef([]),Zo=(ji,Vi)=>{var Vo,_i,ta,Ia,Fa;if(isCallNextQuestionExtensionPresent(ji))return ji.linkId;const Rr=validateCurrentPage(Vi,dt,Vr,x0,g0),Kn=g0.current[Vr],n0=Vr+1,b1=g0.current[n0],_l=Vr===0?0:Kn,dl=(_i=b1??((Vo=x0?.item)==null?void 0:Vo.length))!=null?_i:0;let ru=-1;for(let pi=_l;pi<dl;pi++){const _n=(ta=x0?.item)==null?void 0:ta[pi];if(_n?.linkId===ji.linkId){ru=pi;break}}const Dl=(pi,_n=[])=>(pi.forEach(go=>{var jo;if((!go.enableWhen||isQuestionEnabled(go.enableWhen,go.enableBehavior,Vi))&&isCallNextQuestionExtensionPresent(go)&&!Bs.current.includes(go.linkId))if(go.required){const La=(jo=findResponseItem(Vi,go.linkId))==null?void 0:jo.answer;(La&&La.length>0&&Object.keys(La[0]).length>0||go.initial&&go.initial.length>0&&!En.has(go.linkId))&&_n.push(go.linkId)}else _n.push(go.linkId);go.item&&go.item.length>0&&Dl(go.item,_n)}),_n),cu=[],au=ru!==-1?ru+1:dl;for(let pi=_l;pi<au;pi++){const _n=(Ia=x0?.item)==null?void 0:Ia[pi];_n&&Dl([_n],cu)}if(cu.length>0&&Rr){const pi=cu[cu.length-1],_n=La=>La.flatMap(m1=>[m1,...m1.item?_n(m1.item):[]]),go=_n((Fa=x0?.item)!=null?Fa:[]),jo=go.findIndex(La=>La.linkId===pi),Ya=go.findIndex(La=>La.linkId===ji.linkId);return jo!==-1&&Ya>jo?void 0:pi}},f1=ji=>Zo(ji,Bi.current)?!0:ji.item&&ji.item.length>0?ji.item.some(f1):!1,Ys=()=>{var ji;if(!_o||Vr<0||!x0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const Vi=g0.current[Vr],_i=(wi.current.get(Vi)||[Vi]).some(Fa=>{var Rr;const Kn=(Rr=x0.item)==null?void 0:Rr[Fa];return Kn?f1(Kn):!1}),ta=Vr<g0.current.length-1;let Ia=!1;if(_i&&ta){const Fa=Vr+1,Rr=g0.current[Fa],Kn=(ji=x0?.item)==null?void 0:ji[Rr],n0=!Kn?.enableWhen||isQuestionEnabled(Kn.enableWhen,Kn.enableBehavior,Bi.current),b1=Kn?isPageExtensionPresent(Kn):!1;Ia=n0&&b1}return{shouldTriggerInlineLoading:_i,canNavigateToNextGroup:Ia,hasMoreGroups:ta}},ms=(ji,Vi,Vo,_i)=>{const ta=getUpdatedFormData(x0?.item||[],Bi.current,ji,Vi,Vo,_i);return Bi.current=ta,Tr(ta),ta},F1=(ji,Vi,Vo,_i,ta)=>{ms(Vi,Vo,_i,ta),_i.forEach(Ia=>{const Fa=getValidationError(vs(Ea({},ji),{linkId:Ia.linkId}),Bi.current,Ia.answer);Fa&&G0(Rr=>vs(Ea({},Rr),{[Ia.linkId]:typeof ta=="number"?vs(Ea({},Rr[Ia.linkId]),{[ta]:Fa}):Fa}))})},Ar=(ji,Vi,Vo,_i,ta)=>{var Ia;const Fa=ms(Vi,Vo,_i,ta),Rr=(Ia=findResponseItem(Fa,Vi))==null?void 0:Ia.answer,Kn=getValidationError(ji,Bi.current,Rr);G0(n0=>vs(Ea({},n0),{[Vi]:typeof ta=="number"?vs(Ea({},n0[Vi]),{[ta]:Kn}):Kn}))},Yn=(ji,Vi)=>{const Vo=validateCurrentPage(Vi,dt,Vr,x0,g0);if(Ln(Vo),x0?.item){const _i=validateAllItemsRecursively(x0.item,Vi);if(Object.keys(_i).length>0)G0(ta=>Ea(Ea({},ta),_i));else{const ta=x0.item,Ia={},Fa=Rr=>{Rr.forEach(Kn=>{Ia[Kn.linkId]={},Kn.item&&Fa(Kn.item)})};Fa(ta),G0(Rr=>Ea(Ea({},Rr),Ia))}}},Pr=(ji,Vi,Vo,_i,ta=!1)=>{var Ia;const{linkId:Fa}=ji;if(ta)return Bi.current=Vo||[],Yn(Fa,Vo||[]),Bi.current;if(Vo&&Vo.length>0&&ji.type==="group"&&ji.repeats){let b1=Bi.current.length;for(let dl=Bi.current.length-1;dl>=0;dl--)if(Bi.current[dl].linkId===Fa){b1=dl+1;break}const _l=[...Bi.current.slice(0,b1),...Vo,...Bi.current.slice(b1)];return Bi.current=_l,Yn(Fa,_l),Bi.current}if(typeof _i=="number"&&Vi){const b1=hasRepeatingParent(ji,x0?.item||[]);if(b1){const _l=Bi.current.filter(ru=>ru.linkId===b1.linkId);if(_i<_l.length){const ru=Bi.current.map(Dl=>{if(Dl.linkId===b1.linkId&&Bi.current.slice(0,Bi.current.indexOf(Dl)).filter(au=>au.linkId===b1.linkId).length===_i){const au=(go,jo)=>{const Ya=new Map(go.map(m1=>[m1.linkId,m1])),La=[];return jo?.forEach(m1=>{const sl=Ya.get(m1.linkId);if(m1.linkId===Fa)La.push(Ea({linkId:m1.linkId,text:m1.text,answer:Vi},sl?.item&&{item:sl.item}));else if(sl)if(m1.item&&m1.item.length>0){const Il=au(sl.item||[],m1.item);La.push(vs(Ea({},sl),{item:Il}))}else La.push(sl);else if(m1.item&&m1.item.length>0){const Il=au([],m1.item);Il.some(S1=>S1.linkId===Fa||S1.item&&pi(S1.item,Fa))&&La.push({linkId:m1.linkId,text:m1.text,answer:[{}],item:Il})}Ya.delete(m1.linkId)}),Ya.forEach(m1=>{La.push(m1)}),La},pi=(go,jo)=>go.some(Ya=>Ya.linkId===jo||Ya.item&&pi(Ya.item,jo)),_n=au(Dl.item||[],b1.item);return vs(Ea({},Dl),{item:_n})}return Dl});Bi.current=ru,Tr(ru)}else{const ru=_i+1,Dl=_l.length;if(Dl<ru||ru===1){const cu=[],au=(go,jo,Ya)=>go.map(La=>{const m1={linkId:La.linkId,text:La.text,answer:La.linkId===jo?Ya:[{}]};return La.item&&La.item.length>0&&(m1.item=au(La.item,jo,Ya)),m1});for(let go=Dl;go<ru;go++){const jo=b1.item?au(b1.item,Fa,Vi):[],Ya={linkId:b1.linkId,text:b1.text,answer:[{}],item:jo};cu.push(Ya)}let pi=Bi.current.length;for(let go=Bi.current.length-1;go>=0;go--)if(Bi.current[go].linkId===b1.linkId){pi=go+1;break}const _n=[...Bi.current.slice(0,pi),...cu,...Bi.current.slice(pi)];Bi.current=_n,Tr(_n)}}const dl=getValidationError(ji,Bi.current,Vi);return G0(ru=>vs(Ea({},ru),{[Fa]:typeof _i=="number"?vs(Ea({},ru[Fa]),{[_i]:dl}):dl})),Yn(Fa,Bi.current),Bi.current}}if(typeof _i=="number")return Vo&&Vo.length>0?F1(ji,Fa,Vi,Vo,_i):Ar(ji,Fa,Vi,Vo,_i),Bi.current;const Rr=ms(Fa,Vi,Vo),Kn=(Ia=findResponseItem(Rr,Fa))==null?void 0:Ia.answer,n0=getValidationError(ji,Rr,Kn);return G0(b1=>vs(Ea({},b1),{[Fa]:typeof _i=="number"?vs(Ea({},b1[Fa]),{[_i]:n0}):n0})),Yn(Fa,Rr),Bi.current},sr=()=>{var ji;for(let Vi=Vr+1;Vi<g0.current.length;Vi++){const Vo=g0.current[Vi],_i=(ji=x0?.item)==null?void 0:ji[Vo];if(!!_i&&(!_i.enableWhen||isQuestionEnabled(_i.enableWhen,_i.enableBehavior,Bi.current)))return!0}return!1},Fr=()=>{var ji,Vi,Vo,_i,ta;const Ia=(ji=Qr?.item)==null?void 0:ji[g0.current[Vr]];if(Ia){const Kn=(Vi=getAnalyticsEventName(Ia))!=null?Vi:"questionnaire_form",n0=getAnalyticsPageName(Ia);if(n0){const b1=(Vo=getAnalyticsFormName(Qr))!=null?Vo:Qr.name,_l=collectAnalyticsProperties(Ia,Bi.current),dl={};b1&&(dl.form_name=b1),dl.page_name=n0,Object.assign(dl,_l),Ni(Kn,dl)}}const Fa=Vr<g0.current.length-1,Rr=checkCurrentStepDataMatch(Bi.current,x0,g0.current,Vr,Yr,g0.current.length-1);if(_o&&Fa){const Kn=Vr+1,n0=g0.current[Kn],b1=(_i=x0?.item)==null?void 0:_i[n0],_l=!b1?.enableWhen||isQuestionEnabled(b1.enableWhen,b1.enableBehavior,Bi.current),dl=b1?isPageExtensionPresent(b1):!1;if(_l&&dl&&Rr){hn(Kn),Ln(!1),window.scrollTo(0,0);return}}if(Rr&&g0.current.length>0){sr()?hn(Vr+1):(uo(removeDisabledItems(Bi.current,x0?.item||[])),Ln(!1),window.scrollTo(0,0));return}if(Vr<g0.current.length-1){const Kn=(ta=x0?.item)==null?void 0:ta[g0.current[Vr]];if(!Kn){uo(removeDisabledItems(Bi.current,x0?.item||[]));return}const n0=Kn.linkId,b1=findLastGroupInstanceIndex(Bi.current,n0),_l=Bi.current.slice(0,b1+1);if(!validateCurrentPage(_l,dt,Vr,x0,g0))return;_o?(Bi.current=_l,Tr(_l),uo(Bi.current),Ln(!1)):g0.current.length>0&&(sr()?hn(Vr+1):(uo(removeDisabledItems(Bi.current,x0?.item||[])),window.scrollTo(0,0)))}else uo(removeDisabledItems(Bi.current,x0?.item||[])),Ln(!1),window.scrollTo(0,0)};useEffect(()=>{var ji;jt(()=>Fr),tn(()=>io),Ln(Cr);const Vi=(ji=x0?.item)==null?void 0:ji[g0.current[Vr]];Vi&&lr(Vi.linkId)},[Cr,Vr]),useEffect(()=>{if(!Qr?.item)return;const{groupIndices:ji,itemsToRenderMap:Vi}=collectGroupItemIndices(Qr.item);g0.current=ji,wi.current=Vi;const Vo=Oa??ji.length;Zn(Vo),Hr(ji),_o?(ko.current||hn(ji.length>0?ji.length-1:0),Or(!1),ko.current=!1):Vr===-1&&hn(0)},[Qr?.item,Oa]),useEffect(()=>{if(Vr<0||!x0?.item)return;const ji=validateCurrentPage(Bi.current,dt,Vr,x0,g0);if(!ji){Ln(!1);return}const{shouldTriggerInlineLoading:Vi,canNavigateToNextGroup:Vo,hasMoreGroups:_i}=Ys();if(_o&&Vi){if(!_i){Ln(!1);return}if(Vo&&ji){Ln(!0);return}else{Ln(!1);return}}Ln(ji)},[Vr,x0?.item,Zr,_o,Bi.current,dt]),useEffect(()=>{if(!Qr?.item||Fo.current)return;const ji=initializeQuestionnaireItems(Qr.item,Bi.current,Qr.item,Bi.current);if(ji!==Bi.current){Bi.current=ji;const Vo=(ta=>{const Ia=new Set,Fa=Rr=>{Rr.forEach(Kn=>{var n0;const b1=Kn.initial&&Kn.initial.length>0,_l=(Kn.type==="choice"||Kn.type==="open-choice")&&((n0=Kn.answerOption)==null?void 0:n0.some(dl=>dl.initialSelected===!0));(b1||_l)&&(!Kn.enableWhen||isQuestionEnabled(Kn.enableWhen,Kn.enableBehavior,Bi.current))&&Ia.add(Kn.linkId),Kn.item&&Fa(Kn.item)})};return Fa(ta),Ia})(x0?.item||[]);Tn(Vo);const _i=validateAllItemsRecursively(x0?.item||[],Bi.current);Object.keys(_i).length>0&&G0(ta=>Ea(Ea({},ta),_i))}Fo.current=!0},[x0?.item,Qr]),useEffect(()=>{Ao(Qr)},[Qr]),useEffect(()=>{Vr>=0&&window.scrollTo(0,0)},[Vr]),useEffect(()=>{var ji;if(!_o||dt.length===0||d0||!x0?.item)return;const Vi=g0.current[Vr];if(Vi===void 0)return;const Vo=wi.current.get(Vi)||[Vi],_i=[];if(Vo.forEach(Kn=>{var n0;const b1=(n0=x0?.item)==null?void 0:n0[Kn];b1&&hasInitialValue(b1)&&_i.push(b1)}),_i.length===0||!_i.some(Kn=>Zo(Kn,Bi.current)&&!Bs.current.includes(Kn.linkId)?(Bs.current.push(Kn.linkId),!0):!1))return;const Ia=validateCurrentPage(Bi.current,dt,Vr,x0,g0),Fa=(ji=x0?.item)==null?void 0:ji[Vi],Rr=isHiddenAnswerInValid(Fa,Bi.current);!Ia||Rr||(k0.current.add(Vr),Or(!0),ko.current=!0,B0(_i[_i.length-1].linkId))},[Vr,dt,_o,d0,x0]);const B0=(ji,Vi=!1,Vo=!1)=>{var _i;if(Vi){uo(removeDisabledItems(Bi.current,x0?.item||[]),Vo),Ln(!1);return}const ta=findQuestionByLinkId(x0?.item||[],ji);if(!ta)return;const Ia=(_i=findResponseItem(Bi.current,ji))==null?void 0:_i.answer;if(getValidationError(ta,Bi.current,Ia))return;const Fa=getUpdatedFormData(x0?.item||[],Bi.current,ji,Ia),Rr=Zo(ta,Fa);if(!Rr)return;Ln(!1);const Kn=findRootGroupLinkId(x0?.item||[],ji);let n0=Fa,b1=[];const _l=deepTrimFormData(Fa,Rr,x0?.item||[]);n0=_l.trimmedData,b1=_l.trimmedLinkIds;const dl=findQuestionByLinkId(x0?.item||[],Kn||"");Bi.current=n0;const ru=findGroupPositionByLinkId(x0?.item||[],ji||""),Dl=ru!==-1?ru:Vr;if(validateCurrentPage(n0,dt,Dl,x0,g0,b1)&&!isHiddenAnswerInValid(dl,n0)){Or(!0),ko.current=!0;let au;const pi=(()=>{var jo;const Ya=ks=>ks.flatMap(S1=>[S1,...S1.item?Ya(S1.item):[]]),La=Ya((jo=x0?.item)!=null?jo:[]),m1=La.findIndex(ks=>ks.linkId===Rr),sl=new Set;let Il=!0;for(;Il;){Il=!1;for(const ks of La){if(sl.has(ks.linkId)||!ks.enableWhen)continue;ks.enableWhen.some(z1=>{const Y1=La.findIndex(Xl=>Xl.linkId===z1.question);return Y1!==-1&&Y1<=m1||sl.has(z1.question)})&&(sl.add(ks.linkId),Il=!0)}}return b1.filter(ks=>!sl.has(ks))})();pi.length>0&&(au=removeItemsFromSchema(x0?.item||[],pi),Ao(vs(Ea({},x0),{item:au})));const go=((jo,Ya)=>{const La=[];let m1=!1;const sl=Il=>{for(const ks of Il)m1?(La.push(ks.linkId),ks.item&&sl(ks.item)):ks.linkId===Ya?m1=!0:ks.item&&sl(ks.item)};return sl(jo),La})(x0?.item||[],Rr);go.length>0&&(Bs.current=Bs.current.filter(jo=>!go.includes(jo)),Tn(jo=>{const Ya=new Set(jo);return go.forEach(La=>Ya.delete(La)),Ya})),Bs.current.push(Rr),uo(removeDisabledItems(n0,x0?.item||[]),!0,au)}},J0=(ji,Vi,Vo=!1)=>{const _i=updateItemWithReadOnlyExpression(ji,x0),ta={item:_i,selectedAnswer:Vi,handleInputChange:Pr,showQuestionPrefix:Mo,onCompleteHandler:B0,errors:Ci,isLoading:d0,isCurrentFormValid:Cr,contained:x0?.contained,questionnaireSchemaItems:x0?.item,customErrorConfigurations:ro,formData:Bi.current,showStepper:No,totalStepsFromExtension:Oa,externalComponentRenderMap:Pe,hintText:getHintTextFromExtensions(_i.extension)};if(typeof Sr=="function"&&Vo)Sr(ji,ta,Bi.current);else if(ji.type in typeToRenderFunctionMap&&!Vo)return dt.includes(ji.linkId)||_t(Ia=>[...Ia,ji.linkId]),jsx(RenderFHIRQuestionnaireItem,Ea({},ta),ji.linkId);return null},It=ji=>ji.map(Vi=>{var Vo,_i;const ta=isHiddenExtensionPresent(Vi);let Ia=(Vo=findResponseItem(Bi.current,Vi.linkId))==null?void 0:Vo.answer;if((!Ia||Object.keys((_i=Ia?.[0])!=null?_i:{}).length===0)&&!En.has(Vi.linkId)){if(Vi.initial&&Vi.initial.length>0)Ia=Vi.initial,Tn(Fa=>new Set(Fa).add(Vi.linkId));else if((Vi.type==="choice"||Vi.type==="open-choice")&&Vi.answerOption){const Fa=Vi.answerOption.filter(Rr=>Rr.initialSelected===!0);Fa.length>0&&(Ia=Fa.map(Rr=>{let Kn={};return Rr.valueCoding?Kn={valueCoding:{code:Rr.valueCoding.code,display:Rr.valueCoding.display,system:Rr.valueCoding.system}}:Rr.valueReference&&(Kn={valueReference:{reference:Rr.valueReference.reference,display:Rr.valueReference.display}}),Kn}).filter(Rr=>Object.keys(Rr).length>0),Tn(Rr=>new Set(Rr).add(Vi.linkId)))}Ia&&(Bi.current=getUpdatedFormData(x0?.item||[],Bi.current,Vi.linkId,Ia))}if(!Vi?.enableWhen||isQuestionEnabled(Vi?.enableWhen,Vi.enableBehavior,Bi.current)){const Fa=Vs.includes(Vi.linkId)||getUIToolkitCode(Vi.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[J0(Vi,Ia,ta),Vi.item&&!ta&&(Fa?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:It(Vi.item)})}):It(Vi.item))]},Vi.linkId)}else if(Vi.type==="group"&&!ta)return p0.includes(Vi.linkId)||(Oa===void 0&&Zn(g0.current.length-1||-1),g0.current=g0.current.filter((Fa,Rr)=>Rr!==Vr),ui(Fa=>[...Fa,Vi.linkId])),null});if(Vr>=0){const ji=[];let Vi=0,Vo=0;for(;Vi<tr.length&&Vo<g0.current.length;){const _i=tr[Vi],ta=g0.current[Vo];if(_i<ta){const Ia=(We=x0?.item)==null?void 0:We[_i];(!Ia?.enableWhen||isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,Bi.current))&&ji.push(Vi),Vi++}else _i===ta&&Vi++,Vo++}for(;Vi<tr.length;){const _i=tr[Vi],ta=(gt=x0?.item)==null?void 0:gt[_i];(!ta?.enableWhen||isQuestionEnabled(ta.enableWhen,ta.enableBehavior,Bi.current))&&ji.push(Vi),Vi++}if(ji.length>0){Oa===void 0&&Zn(g0.current.length+ji.length),ji.reverse().forEach(ta=>{const Ia=tr[ta];let Fa=0;for(let Rr=0;Rr<g0.current.length;Rr++){if(g0.current[Rr]>Ia){Fa=Rr;break}Fa=Rr+1}g0.current.splice(Fa,0,Ia)});const _i=ji.map(ta=>{var Ia;const Fa=tr[ta],Rr=(Ia=x0?.item)==null?void 0:Ia[Fa];return Rr?.linkId}).filter(Boolean);ui(ta=>ta.filter(Ia=>!_i.includes(Ia)))}tr.forEach(_i=>{var ta;const Ia=(ta=x0?.item)==null?void 0:ta[_i];Ia?.enableWhen&&!isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,Bi.current)&&Bi.current.some(Rr=>Rr.linkId===Ia.linkId)&&(Bi.current=removeAnswerFromFormData(Bi.current,Ia.linkId))})}const io=()=>{var ji;if(Li&&!c0&&Vr>0&&xo!=="completed")hn(g0.current.length-1),Z0(!0),cn(!1),ua?.();else if(Vr>0&&xo!=="completed"){let Vi=Vr-1;for(;Vi>0;){const Vo=g0.current[Vi],_i=(ji=x0?.item)==null?void 0:ji[Vo];if(!_i?.enableWhen||isQuestionEnabled(_i.enableWhen,_i.enableBehavior,Bi.current))break;Vi--}hn(Vi),Ln(!0),cn(!1),ua?.()}else ar?.()},Co=ji=>ji.preventDefault();return useEffect(()=>{const ji=setTimeout(()=>{Ls(!0)},0);return()=>clearTimeout(ji)},[]),Sa?jsxs(Fragment,{children:[jsxs("form",{id:er,className:"w-full","data-testid":"questionnaire-form",onSubmit:Co,children:[!So&&jsxs("div",{className:"tw group text-secondary gap-md mb-2xl hover:text-secondary_hover flex w-fit cursor-pointer items-center text-sm font-semibold hover:font-bold",role:"button","data-testid":"questionnaire-back-button",tabIndex:0,onClick:()=>io(),onKeyDown:ji=>{(ji.key==="Enter"||ji.key===" ")&&io()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Li&&!c0?jsx(EmptyState,{className:"mt-5xl",title:Li.title,description:Li.description,featuredIconProps:{icon:Li.icon,color:"gray"},primaryButton:Li.primaryButton,secondaryButton:Li.secondaryButton?vs(Ea({},Li.secondaryButton),{onClick:io}):void 0}):jsxs(Fragment,{children:[!x0?.item&&d0&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),x0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:It(Vr>=0?x0.item.filter((ji,Vi)=>{const Vo=g0.current[Vr];return(wi.current.get(Vo)||[Vo]).includes(Vi)}):x0?.item||[])})]})]}),Fo.current&&Ce]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Z,l,e)=>{"use strict";e.d(l,{l:()=>b});var n=e(31085),t=e(14041),r=e(36087),s=e(69364),i=e(25624),o=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(h,f,v)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[f]=v,d=(h,f)=>{for(var v in f||(f={}))y.call(f,v)&&m(h,v,f[v]);if(u)for(var v of u(f))A.call(f,v)&&m(h,v,f[v]);return h},O=(h,f)=>g(h,c(f));const p=({selected:h,onClick:f,icon:v,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:v}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!h&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},b=({item:h,handleInputChange:f,formData:v,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,o.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,E=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,i.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),C=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,i.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),R=N=>{var w,V;if(!v)return!1;const q=(0,i.MU)(v,N);return((V=(w=q?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(N=>R(N.linkId)),[E,v]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||E.length===0){P.current&&(z(),P.current=!1);return}!L&&!P.current?(x(),P.current=!0):L&&P.current&&(z(),P.current=!1)},[L,S,E.length,x,z]),(0,t.useEffect)(()=>{C.forEach(N=>{var w,V;const q=v?(0,i.MU)(v,N.linkId):void 0;(!q||((V=(w=q.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[C]),(0,t.useEffect)(()=>()=>{P.current&&z()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:E.map(N=>{var w,V,q,I;const k=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(se=>se.url===s.g4),F=(V=N.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(p,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Z,l,e)=>{"use strict";e.d(l,{v:()=>o});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const i=({selected:a,onClick:g,label:c,readOnly:u})=>{const y=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:y,"aria-pressed":!!a,children:c})},o=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var p,b;if(!c)return!1;const h=(0,s.MU)(c,O);return((b=(p=h?.answer)==null?void 0:p[0])==null?void 0:b.valueBoolean)===!0},d=O=>{const p=m(O.linkId);g(O,[{valueBoolean:!p}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var p;const b=m(O.linkId);return(0,n.jsx)(i,{label:(p=O.text)!=null?p:"",selected:b,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},18522:(Z,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(b,h,f)=>h in b?i(b,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):b[h]=f,A=(b,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(b,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(b,f,h[f]);return b},m=(b,h)=>o(b,a(h));const d=(0,t.createContext)(void 0),O=()=>{const b=(0,t.useContext)(d);if(!b)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return b},p=({children:b,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[v,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[E,C]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[N,w]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),ie=()=>{k(re=>re+1)},te=useCallback(re=>{F(re)},[]),he=()=>{k(re=>Math.max(0,re-1))},be=I>0,Ee=useCallback((re,ae,me)=>{if(!h)return;const pe=h[re];if(!pe)return;let de;if(Array.isArray(pe))if(me)de=pe.find(Te=>Te.inputType===me);else{console.warn(`Multiple analytics configs found for linkId "${re}" but no inputType provided. Skipping tracking.`);return}else{if(me&&pe.inputType&&pe.inputType!==me)return;de=pe}if(!de)return;let ue=A({},ae);de.valueTransform&&(ue=Object.keys(ae).reduce((Te,De)=>{var ze;const Ie=(ze=de.valueTransform)==null?void 0:ze[De];return Te[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Te},{}));let ne=A({},ue);de.propertyMapping&&(ne=Object.keys(ue).reduce((Te,De)=>{var ze;const Ie=((ze=de.propertyMapping)==null?void 0:ze[De])||De;return Te[Ie]=ue[De],Te},{}));const J=de.eventName,ve=de.description;f(J,m(A(A({},ne),de.properties),{_event_metadata:ve?{description:ve}:void 0}))},[h,f]),ge={isCurrentFormValid:T,currentGroupLinkId:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:v,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:ie,decrementCustomErrorCount:he,trackQuestionnaireEvent:Ee,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:b})}},35473:(Z,l,e)=>{"use strict";var n=e(28058),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var i=e(25624),o=e(69364),a=e(7630),g=e(72866)},61388:(Z,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:i,onActionButtonClick:o,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),i&&o&&(0,n.jsx)(t.Button,{color:"link-color",onClick:o,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:i})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Z,l,e)=>{"use strict";e.d(l,{d:()=>i});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const i=({infoDetails:o,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,p)=>{d.preventDefault(),O.linkType==="phone"?g(p):O.linkType==="address"?c({address:p}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:p=>y(p,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:o.map((d,O)=>{const p=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(p,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const b=Array.isArray(d.value)?d.value:[d.value];return b.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:b.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(b[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Z,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Z,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Z,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Z,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Z,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),i=e(76808),o=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,b=(x,z,T)=>z in x?y(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,h=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&b(x,T,z[T]);if(d)for(var T of d(z))p.call(z,T)&&b(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),v=(x,z,T)=>new Promise((S,E)=>{var C=P=>{try{L(T.next(P))}catch(D){E(D)}},R=P=>{try{L(T.throw(P))}catch(D){E(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(C,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:E})=>{const{locationPermission:C,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{w(f(h({},N),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,N,w]),F=(0,t.useCallback)(()=>{S===void 0&&(!C||[a.Ef.GRANTED].includes(C)&&I.get()||[a.Ef.PROMPT].includes(C)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(C)))},[S,C,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,i.Ul)(),G=(0,t.useCallback)(()=>v(void 0,null,function*(){x&&x(!0);let be;try{be=yield L(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Ee){Ee instanceof Error?K?.error(Ee,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Ee)}`),S!==void 0&&E?E():q(!1)}return x&&x(!1),!!be}),[K,U,L,x,S,E]),se=(0,t.useCallback)(()=>v(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&E?E():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),ie=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():q(!1)},[D,P,w,N,I,S,E]),te=(0,t.useCallback)(()=>ie("close"),[ie]),he=(0,t.useCallback)(()=>ie("cancel"),[ie]);return(0,n.jsx)(o.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:he}})}},35471:(Z,l,e)=>{"use strict";var n=e(26877)},98741:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(y,A,m)=>A in y?r(y,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[A]=m,g=(y,A)=>{for(var m in A||(A={}))i.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))o.call(A,m)&&a(y,m,A[m]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(y)},u=({animationData:y,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),p=useRef(null);return useEffect(()=>{if(!!O.current){try{const b=c(y);p.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:b})}catch(b){console.error("Failed to load Lottie animation:",b)}return()=>{var b;(b=p.current)==null||b.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Z,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const i=y=>y*1609.34;var o=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:y,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:p="100%",googleMapsApiKey:b})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:b||""}),v={height:typeof O=="number"?`${O}px`:O,width:typeof p=="number"?`${p}px`:p},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:i(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,o.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:v,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,o.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:v,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,o.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:v,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Z,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Z,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Z,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:o,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:y,pendingText:A})=>{const m=!!A,d=!m&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:o,size:"md",initials:getInitials(o),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:o}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},i=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Z,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:i,fullImageHeader:o=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[o?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),i&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:i})]}),s]})]})}),r=null},51254:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:i,icon:o})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:o.icon,color:(a=o.color)!=null?a:"brand",size:"lg",className:o.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),i&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:i})]})]})}},69092:()=>{},33457:(Z,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Z,l,e)=>{"use strict";e.d(l,{i:()=>Qe});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Ye=24,color:Lt="currentColor",...mn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Ye,height:Ye,stroke:Lt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...mn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var i=e(14449),o=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Ye){Ye()}let y=null;const A=Ye=>y=Ye,m=()=>y,d=(0,r.createContext)(null),O=null;function p(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Ye=>{h=Ye},v=(Ye,Lt)=>Ye===Lt;function M(Ye=d){const Lt=Ye===d?p:()=>(0,r.useContext)(Ye);return function(Sn,et=v){const{store:Rt,subscription:Ht,getServerState:Un}=Lt(),Mr=h(Ht.addNestedSub,Rt.getState,Un||Rt.getState,Sn,et);return(0,r.useDebugValue)(Mr),Mr}}const x=M();var z=e(75985),T=e(524);function S(){const Ye=getBatch();let Lt=null,mn=null;return{clear(){Lt=null,mn=null},notify(){Ye(()=>{let Sn=Lt;for(;Sn;)Sn.callback(),Sn=Sn.next})},get(){let Sn=[],et=Lt;for(;et;)Sn.push(et),et=et.next;return Sn},subscribe(Sn){let et=!0,Rt=mn={callback:Sn,next:null,prev:mn};return Rt.prev?Rt.prev.next=Rt:Lt=Rt,function(){!et||Lt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:mn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Lt=Rt.next)}}}}const E={notify(){},get:()=>[]};function C(Ye,Lt){let mn,Sn=E;function et(cr){return Mr(),Sn.subscribe(cr)}function Rt(){Sn.notify()}function Ht(){In.onStateChange&&In.onStateChange()}function Un(){return Boolean(mn)}function Mr(){mn||(mn=Lt?Lt.addNestedSub(Ht):Ye.subscribe(Ht),Sn=S())}function gn(){mn&&(mn(),mn=void 0,Sn.clear(),Sn=E)}const In={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:Ht,isSubscribed:Un,trySubscribe:Mr,tryUnsubscribe:gn,getListeners:()=>Sn};return In}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=Ye=>{D=Ye},w=null,V=null,q=Ye=>{try{return JSON.stringify(Ye)}catch{return String(Ye)}};function I(Ye,Lt,mn){useIsomorphicLayoutEffect(()=>Ye(...Lt),mn)}function k(Ye,Lt,mn,Sn,et,Rt){Ye.current=Sn,mn.current=!1,et.current&&(et.current=null,Rt())}function U(Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In){if(!Ye)return()=>{};let cr=!1,Dn=null;const $r=()=>{if(cr||!Un.current)return;const wt=Lt.getState();let Ve,ot;try{Ve=Sn(wt,et.current)}catch(Je){ot=Je,Dn=Je}ot||(Dn=null),Ve===Rt.current?Ht.current||gn():(Rt.current=Ve,Mr.current=Ve,Ht.current=!0,In())};return mn.onStateChange=$r,mn.trySubscribe(),$r(),()=>{if(cr=!0,mn.tryUnsubscribe(),mn.onStateChange=null,Dn)throw Dn}}const F=()=>w;function K(Ye,Lt){return Ye===Lt}let G=!1;function se(Ye,Lt,mn,{pure:Sn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:Ht=shallowEqual,areMergedPropsEqual:Un=shallowEqual,forwardRef:Mr=!1,context:gn=ReactReduxContext}={}){const In=gn,cr=mapStateToPropsFactory(Ye),Dn=mapDispatchToPropsFactory(Lt),$r=mergePropsFactory(mn),qr=Boolean(Ye);return Ve=>{const ot=Ve.displayName||Ve.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:qr,displayName:Je,wrappedComponentName:ot,WrappedComponent:Ve,initMapStateToProps:cr,initMapDispatchToProps:Dn,initMergeProps:$r,areStatesEqual:et,areStatePropsEqual:Ht,areOwnPropsEqual:Rt,areMergedPropsEqual:Un};function rt(st){const[le,ye,Fe]=useMemo(()=>{const{reactReduxForwardedRef:Rn}=st,Pn=_objectWithoutPropertiesLoose(st,P);return[st.context,Rn,Pn]},[st]),Se=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:In,[le,In]),yt=useContext(Se),Xt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(yt)&&Boolean(yt.store),Vn=Xt?st.store:yt.store,gr=vn?yt.getServerState:Vn.getState,Bt=useMemo(()=>defaultSelectorFactory(Vn.dispatch,tt),[Vn]),[we,Ze]=useMemo(()=>{if(!qr)return V;const Rn=createSubscription(Vn,Xt?void 0:yt.subscription),Pn=Rn.notifyNestedSubs.bind(Rn);return[Rn,Pn]},[Vn,Xt,yt]),At=useMemo(()=>Xt?yt:_extends({},yt,{subscription:we}),[Xt,yt,we]),en=useRef(),nn=useRef(Fe),fn=useRef(),pt=useRef(!1),Yt=useRef(!1),qt=useRef(!1),Pt=useRef();useIsomorphicLayoutEffect(()=>(qt.current=!0,()=>{qt.current=!1}),[]);const $t=useMemo(()=>()=>fn.current&&Fe===nn.current?fn.current:Bt(Vn.getState(),Fe),[Vn,Fe]),Zt=useMemo(()=>Pn=>we?U(qr,Vn,we,Bt,nn,en,pt,qt,fn,Ze,Pn):()=>{},[we]);I(k,[nn,en,pt,Fe,fn,Ze]);let An;try{An=D(Zt,$t,gr?()=>Bt(gr(),Fe):$t)}catch(Rn){throw Pt.current&&(Rn.message+=`
872
872
  The error may be correlated with this previous error:
package/native.js CHANGED
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1098.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.12.3"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1345.0",D="@icanbwell/composite. repo version: 0.1345.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1099.1",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.12.3"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1346.1",D="@icanbwell/composite. repo version: 0.1346.1",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/composite",
3
- "version": "1.1098.0",
3
+ "version": "1.1099.1",
4
4
  "author": "icanbwell",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,6 +43,6 @@
43
43
  "optional": true
44
44
  }
45
45
  },
46
- "repoVersion": "0.1345.0",
47
- "description": "@icanbwell/composite. repo version: 0.1345.0"
46
+ "repoVersion": "0.1346.1",
47
+ "description": "@icanbwell/composite. repo version: 0.1346.1"
48
48
  }