@icanbwell/composite 1.1169.0 → 1.1169.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(ge)===void 0&&customElements.define(ge,xe);const Ie=[{name:"loader",defaultElement:document.createElement(te)},{name:"error",defaultElement:document.createElement(ge)}],Ee=["error","loading"],De={error:"error",loading:"loader"},ze=({src:Mt,elementNameSuffix:Nt,version:kt,prefetchFeatureApp:Ot})=>(0,g.__awaiter)(void 0,void 0,void 0,function*(){var Ke,Ye,Ft,ot,tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn;window.bwell||(window.bwell=new le({metadata:{version:kt}}));const Bn=`bwell-${Nt}`;if(customElements.get(Bn)!==void 0)return;class xn extends h{constructor(){super(),Ke.add(this),Ye.set(this,(0,x.nanoid)()),Ft.set(this,void 0),ot.set(this,document.createElement("feature-app-loader")),tt.set(this,new k.EventEmitter),qt.set(this,void 0),zn.set(this,void 0),An.set(this,void 0),lt.set(this,void 0),_t.set(this,void 0),dn.set(this,void 0),this.attachShadow({mode:"open"});const Pr=new he(Ie).attachToShadowRoot(this.shadowRoot);Pr.addEventListener("visibilitychange",({visibility:Wt,container:Fe,name:it})=>{it==="error"&&Wt==="visible"&&window.bwell._registerEmbeddableContent(Fe),(0,g.__classPrivateFieldGet)(this,ot,"f").style.display=Wt==="hidden"?"unset":"hidden"}),(0,g.__classPrivateFieldSet)(this,dn,{slots:Pr,attributes:new V().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,tt,"f")},"f"),(0,g.__classPrivateFieldSet)(this,qt,(0,g.__classPrivateFieldGet)(this,Ke,"m",rr).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,zn,(0,g.__classPrivateFieldGet)(this,Ke,"m",Br).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,An,(0,g.__classPrivateFieldGet)(this,Ke,"m",nn).call(this,"error"),"f"),(0,g.__classPrivateFieldSet)(this,lt,(0,g.__classPrivateFieldGet)(this,Ke,"m",nn).call(this,"loading"),"f")}connectedCallback(){return(0,g.__awaiter)(this,void 0,void 0,function*(){(0,g.__classPrivateFieldGet)(this,An,"f").call(this,(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get("error")),(0,g.__classPrivateFieldGet)(this,lt,"f").call(this,(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get("loading")),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.addEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,zn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.addChangeListener("loading",(0,g.__classPrivateFieldGet)(this,lt,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("error")}(0,g.__classPrivateFieldSet)(this,Ye,this.id||(0,g.__classPrivateFieldGet)(this,Ye,"f"),"f"),(0,g.__classPrivateFieldSet)(this,Ft,new T((0,g.__classPrivateFieldGet)(this,Ye,"f")),"f"),(0,g.__classPrivateFieldGet)(this,Ft,"f").registerDispatcher(Pr=>this.dispatchEvent(Pr)),window.bwell.isInitialized?(0,g.__classPrivateFieldGet)(this,qt,"f").call(this):(window.bwell.once("initialized",(0,g.__classPrivateFieldGet)(this,qt,"f")),window.bwell.once("error",()=>{(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("error")}),Ot&&(0,A.h)(Mt).catch(()=>{(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Pr;(0,g.__classPrivateFieldGet)(this,tt,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,zn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,lt,"f")),(Pr=(0,g.__classPrivateFieldGet)(this,Ft,"f"))===null||Pr===void 0||Pr.deregister(),(0,g.__classPrivateFieldGet)(this,tt,"f").removeAllListeners()}}Ye=new WeakMap,Ft=new WeakMap,ot=new WeakMap,tt=new WeakMap,qt=new WeakMap,zn=new WeakMap,An=new WeakMap,lt=new WeakMap,_t=new WeakMap,dn=new WeakMap,Ke=new WeakSet,rr=function(){(0,g.__classPrivateFieldGet)(this,ot,"f").setAttribute("featureAppId",`bwell-embeddable:${Bn}`),(0,g.__classPrivateFieldGet)(this,ot,"f").setAttribute("src",Mt),(0,g.__classPrivateFieldGet)(this,ot,"f").config={id:(0,g.__classPrivateFieldGet)(this,Ye,"f"),name:Nt,elementName:Bn,utils:(0,g.__classPrivateFieldGet)(this,dn,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,ot,"f"))},Br=function({visibility:Pr,name:Wt}){(0,g.__classPrivateFieldGet)(this,ot,"f").style.display=Pr==="hidden"?"unset":"hidden"},jt=function(Pr){(0,g.__classPrivateFieldGet)(this,_t,"f")(),(0,g.__classPrivateFieldSet)(this,_t,void 0,"f")},nn=function(Pr){return Wt=>{const Fe=Ee.findIndex(Ze=>Ze===Pr);if(!Ee.slice(0,Fe).some(Ze=>(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get(Ze)!==null)){if(Wt!==null)(0,g.__classPrivateFieldGet)(this,_t,"f")&&(0,g.__classPrivateFieldGet)(this,Ke,"m",jt).call(this,Pr),(0,g.__classPrivateFieldSet)(this,_t,(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlotLocked(De[Pr]),"f");else if(Wt===null&&(0,g.__classPrivateFieldGet)(this,_t,"f")){(0,g.__classPrivateFieldGet)(this,Ke,"m",jt).call(this,Pr);const Ze=Ee.find(Qe=>(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get(Qe)!==null);Ze&&(0,g.__classPrivateFieldSet)(this,_t,(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlotLocked(De[Ze]),"f")}}}},customElements.define(Bn,xn)}),We={rE:"1.1169.0"},st="composite";var ft=e(67321);ze({src:`https://embeddables.prod.icanbwell.com/${st}/${We.rE}/scripts/embeddable.federated.js`,elementNameSuffix:st,version:We.rE,prefetchFeatureApp:!0})},79566:(Y,s,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),l=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,b=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(A,h,d)=>h in A?i(A,h,{enumerable:!0,configurable:!0,writable:!0,value:d}):A[h]=d,p=(A,h)=>{for(var d in h||(h={}))u.call(h,d)&&m(A,d,h[d]);if(c)for(var d of c(h))y.call(h,d)&&m(A,d,h[d]);return A},f=(A,h)=>a(A,b(h));const O=(A,h,d)=>{const v=_.cloneDeep(A);if(!v.contained||h<0)return v;const M=v.contained.findIndex(S=>S.resourceType==="Questionnaire");if(M!==-1&&!d){const S=v.contained[M];if(S.item){if(!S.item.some(C=>isPageExtensionPresent(C)))return v;let x=0,z=S.item.length;for(let C=0;C<S.item.length;C++){const E=S.item[C];if(isPageExtensionPresent(E)){if(x===h+1){z=C;break}x++}}S.item=S.item.slice(0,z),v.contained[M]=S}}else d&&M!==-1&&(v.contained[M]=f(p({},v.contained[M]),{item:d}));return v},g=({formId:A,questionnaireResponse:h,showQuestionPrefix:d,nextQuestion:v,onGoBack:M,handleHiddenQuestion:S,errorConfig:T,onClearError:x,customErrorConfigurations:z,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:L,className:P,children:D})=>{var N,w,V;const{currentGroupIndex:k,hasCustomError:I}=useFHIRQuestionnaire(),G=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(X=>X.id===G&&X.resourceType==="Questionnaire"),F=(X,q,ae)=>{let se=_.cloneDeep(h);se.item=X,se=trimQuestionnaireItems(se,k,ae),v(se,q)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,P),children:jsx(FHIRQuestionnaire,{formId:A,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:d,errorConfig:T,customErrorConfigurations:z,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:x,handleHiddenQuestion:S,showStepper:C,hideBackButton:E,externalComponentRenderMap:L,children:D})})}},19622:(Y,s,e)=>{"use strict";e.d(s,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),l=e(76323),o=e(36087),i=e(56192),a=e(76808),b=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,O=(M,S,T)=>S in M?c(M,S,{enumerable:!0,configurable:!0,writable:!0,value:T}):M[S]=T,g=(M,S)=>{for(var T in S||(S={}))p.call(S,T)&&O(M,T,S[T]);if(m)for(var T of m(S))f.call(S,T)&&O(M,T,S[T]);return M},A=(M,S)=>u(M,y(S)),h=(M,S,T)=>new Promise((x,z)=>{var C=L=>{try{R(T.next(L))}catch(P){z(P)}},E=L=>{try{R(T.throw(L))}catch(P){z(P)}},R=L=>L.done?x(L.value):Promise.resolve(L.value).then(C,E);R((T=T.apply(M,S)).next())});const d=10,v=({id:M="location-filter-desktop",initialValue:S,onInputChange:T,onValueChange:x,isDisabled:z=!1,className:C="",setIsLoading:E,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,b.E_)({keys:["shared-translations"]}),N=S?.placeId,w=S?.description,[V,k]=(0,t.useState)(""),[I,G]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[X,q]=(0,t.useState)(null),[ae,se]=(0,t.useState)(!1),ne=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ve,ye]=(0,t.useState)(he),[Ae,J]=(0,t.useState)(he),[oe,{loading:me,error:ce}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:le,error:te}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[re,{loading:ge,error:xe}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),ye(he)},onCompleted:kt=>{var Ot,Ke;const Ye=(Ke=(Ot=kt.placeAutocomplete)==null?void 0:Ot.predictions)==null?void 0:Ke.map(Ft=>{var ot;return{id:Ft.placeId,label:(0,l.removeAfterLastComma)(Ft.description),mainText:Ft?.mainText||((ot=Ft.description.split(",")[0])==null?void 0:ot.trim()),secondaryText:(0,l.removeAfterLastComma)(Ft?.secondaryText||Ft.description.split(",").slice(1).join(",").trim())}});ye(Ye?.length?Ye:he)}}),Ie=(0,t.useMemo)(()=>ve.map(kt=>A(g({},kt),{displayLabel:(0,r.RZ)(kt?.label||"",V)})),[V,ve]),Ee=kt=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn;if(F(kt),q(kt),se(!1),kt&&typeof kt=="string"){const Bn=ve.find(Qe=>Qe.id===kt),xn=Bn?.label||V;if(!Bn)return;k(xn),G(xn),setTimeout(()=>{const Qe=[{id:Bn.id,label:Bn.label}];ye(Qe),J(Qe)},d);const Nr=yield oe({variables:{placeId:kt}}),Pr=(Ke=(Ot=Nr?.data)==null?void 0:Ot.geocodingByPlaceId)==null?void 0:Ke.latitude,Wt=(Ft=(Ye=Nr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Ft.longitude,Fe=((tt=(ot=Nr?.data)==null?void 0:ot.geocodingByPlaceId)==null?void 0:tt.zipCode)||"",it=((zn=(qt=Nr?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:zn.state)||"",Ze=((lt=(An=Nr?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(Pr&&Wt)if(!Fe||!Ze){const Qe=yield de({variables:{latitude:String(Pr),longitude:String(Wt)}}),et=((dn=(_t=Qe?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",ct=((Br=(rr=Qe?.data)==null?void 0:rr.geocodingByLatLon)==null?void 0:Br.state)||"",Pt=((nn=(jt=Qe?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:Pr,longitude:Wt,zipCode:et,state:ct,stateCode:Pt,placeId:kt,description:xn,value:kt})}else x({latitude:Pr,longitude:Wt,zipCode:Fe,state:it,stateCode:Ze,placeId:kt,description:xn,value:kt});else se(!0)}}),De=()=>!0,ze=(0,l.useDebounce)(kt=>h(void 0,null,function*(){return yield re({variables:{input:kt,types:"geocode"}})})),We=kt=>h(void 0,null,function*(){if(se(!1),k(kt),T?.(kt),!kt||kt.trim().length===0){F(null),ye(he),x({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:kt});return}const Ot=kt.trim();Ot.length>=2?yield ze(Ot):ye(he)}),st=kt=>{ne.current=kt},ft=()=>{k(I),ye(Ae),F(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn;if(N&&w){ye([{id:N,label:V||w}]),J([{id:N,label:V||w}]),F(N),q(N),k(w),G(w),w===V&&k(w);const Bn=yield oe({variables:{placeId:N}}),xn=(Ke=(Ot=Bn?.data)==null?void 0:Ot.geocodingByPlaceId)==null?void 0:Ke.latitude,Nr=(Ft=(Ye=Bn?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Ft.longitude,Pr=((tt=(ot=Bn?.data)==null?void 0:ot.geocodingByPlaceId)==null?void 0:tt.zipCode)||"",Wt=((zn=(qt=Bn?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:zn.state)||"",Fe=((lt=(An=Bn?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(xn&&Nr)if(!Pr||!Wt||!Fe){const it=yield de({variables:{latitude:String(xn),longitude:String(Nr)}}),Ze=((dn=(_t=it?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",Qe=((Br=(rr=it?.data)==null?void 0:rr.geocodingByLatLon)==null?void 0:Br.state)||"",et=((nn=(jt=it?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:xn,longitude:Nr,zipCode:Ze,state:Qe,stateCode:et,placeId:N,description:w,value:N})}else x({latitude:xn,longitude:Nr,zipCode:Pr,state:Wt,stateCode:Fe,placeId:N,description:w,value:N})}else F(null),q(null),k(""),G(""),ye(he),J(he)}))()},[]);const Mt=ae||!!ce||!!te||!!xe||!!R,Nt=Mt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||D)},[E,me,le,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:z,inputValue:V,isLoading:ge||me||le,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Ie,selectedKey:U,onSelectionChange:Ee,onInputChange:We,defaultFilter:De,onOpenChange:st,onBlur:ft,isInvalid:Mt,hint:Nt,autoComplete:"address-line1",className:"w-full",children:kt=>{const Ot=kt,Ke=V.trim().length>=2,Ye=Ot.mainText||"",Ft=Ot.secondaryText||"",ot=Ye.trim().length>0,tt=Ft.trim().length>0,qt=ot?(0,r.RZ)(Ye,V):{beforePart:"",highlightedPart:"",remainingPart:""},zn=tt?(0,r.RZ)(Ft,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ot.id,supportingText:Ot.supportingText,isDisabled:Ot.isDisabled,icon:Ot.icon,avatarUrl:Ot.avatarUrl,textValue:Ot.label,children:Ke&&ot?(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:qt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:qt.highlightedPart}),(0,n.jsx)("span",{children:qt.remainingPart})]}),tt&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:zn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:zn.highlightedPart}),(0,n.jsx)("span",{children:zn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ot.label})})}})})}},18077:()=>{},12200:(Y,s,e)=>{"use strict";e.d(s,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(s,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(s,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(s,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(s,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(s,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(s,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,s,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const l=({icon:o,title:i})=>{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:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,s,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),l=e(64081),o=e(62754);const i=({className:a})=>{const{pathname:b}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:m,i18n:{t:p}}=useI18nChild({keys:["shared"]}),f=getPathSegments(b).flatMap(O=>{const g=c.getId(O),A=c.getRouteMeta(g)||{},h=getBreadcrumbTitleKey(g,A,u);if(!h||A.breadcrumbHide)return[];const d=y[g];let v=c.getHref(g),M=h;return d&&(d.href?v=d.href:d.search&&(v=c.getHref({id:g,search:d.search})),d.titleKey&&(M=d.titleKey)),[{routeId:g,href:v,label:p(M),onClick:d?.onClick}]});return m||f.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:f.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,s,e)=>{"use strict";e.d(s,{rJ:()=>C,GU:()=>z});var n=e(31085),t=e(14041),r=e(76323),l=e(78579),o=e(76808),i=e(5380),a=e(87896),b=e(26877);const c=(E,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),E)),u=(E,R,L)=>Promise.race([E,c(R,L)]),y=5e3,m=1e4;var p=Object.defineProperty,f=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(E,R,L)=>R in E?p(E,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[R]=L,v=(E,R)=>{for(var L in R||(R={}))A.call(R,L)&&d(E,L,R[L]);if(g)for(var L of g(R))h.call(R,L)&&d(E,L,R[L]);return E},M=(E,R)=>f(E,O(R)),S=(E,R,L)=>new Promise((P,D)=>{var N=k=>{try{V(L.next(k))}catch(I){D(I)}},w=k=>{try{V(L.throw(k))}catch(I){D(I)}},V=k=>k.done?P(k.value):Promise.resolve(k.value).then(N,w);V((L=L.apply(E,R)).next())});const T={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},x=(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)}),z=()=>(0,t.useContext)(x),C=({children:E})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,o.Ul)(),{geolocation:D}=(0,l.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,G]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[X,q]=(0,t.useState)(),[ae,se]=(0,t.useState)(!1),ne=(0,t.useCallback)(ge=>{F(ge);try{w(M(v({},k.current),{locationPermission:ge||i.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?P?.error(xe,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,P]),he=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,P]),ve=(0,t.useCallback)(ge=>S(void 0,null,function*(){const xe=D.getCurrentPosition(ge).then(Ie=>{if(!Ie||!Ie.coords)throw new Error("Location data is invalid or unavailable");return Ie});try{return yield u(xe,y,"Location request timed out. Please check that location services are enabled.")}catch(Ie){throw Ie instanceof Error&&P?.error(Ie,"Geolocation timeout or error"),Ie}}),[D,P]),ye=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),Ae=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(D.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[D]),J=(0,t.useCallback)(()=>S(void 0,null,function*(){try{if(!(yield he()))return P?.error("Location services not available"),!1;const xe=yield ye();return xe!==i.Ef.GRANTED&&xe!==i.Ef.PROMPT?(P?.error(`Location permission not granted: ${xe}`),!1):!0}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[he,P,ye]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>S(void 0,null,function*(){const xe=N.locationPermission;if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){F(xe);return}G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}if(xe===i.Ef.GRANTED){try{const De=yield ye();if(De===i.Ef.GRANTED){const ze=yield ve(T);ze&&(q(ze),ne(i.Ef.GRANTED))}else De===i.Ef.PROMPT?(ne(De),se(!0)):ne(De)}catch(De){De instanceof Error?P?.error(De,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(De)}`),ne(i.Ef.UNAVAILABLE)}return}const Ee=yield ye();if(ne(Ee),Ee===i.Ef.GRANTED)try{const De=yield ve(T);De?q(De):ne(i.Ef.UNAVAILABLE)}catch(De){De instanceof Error?P?.error(De,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(De)}`),ne(i.Ef.UNAVAILABLE)}else Ee===i.Ef.PROMPT&&se(!0)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(Ie)}`),ne(i.Ef.UNAVAILABLE)}finally{G(!1)}}))()},[]);const oe=(0,t.useCallback)(()=>S(void 0,null,function*(){try{if(!(yield J())){ne(i.Ef.UNAVAILABLE);return}G(!0);let xe=yield ye();if(ne(xe),xe===i.Ef.GRANTED||xe===i.Ef.PROMPT){if(L==="Android"&&xe===i.Ef.GRANTED)try{xe=yield Ae(),ne(xe)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(Ie)}`);return}if(xe!==i.Ef.UNAVAILABLE){const Ie=yield ve(T);return q(Ie),Ie}}return}catch(ge){ne(i.Ef.UNAVAILABLE),ge instanceof Error?P?.error(ge,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{G(!1)}}),[J,P,L,ne,ve,ye,Ae]),me=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return(yield he())?yield ye():i.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ge)}`),i.Ef.UNAVAILABLE}}),[he,P,ye]),ce=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield ye();ne(xe)}catch(ge){ge instanceof Error?P?.error(ge,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE)}finally{G(!1)}}),[he,P,ne,ye]),de=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield ye();if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){ne(xe);return}const Ie=yield Ae();if(ne(Ie),["granted","prompt"].includes(Ie)){const Ee=yield ve(T);return q(Ee),Ee}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||P?.error(ge,"Error requesting location");else{const xe=ge&&typeof ge=="object"&&"message"in ge?ge.message:JSON.stringify(ge);xe?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${xe}`)}ne(i.Ef.UNAVAILABLE);return}finally{G(!1)}}),[he,P,ne,ve,Ae,ye]),le=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield ve(T);xe&&(q(xe),F(i.Ef.GRANTED),w(M(v({},k.current),{location:`${xe.coords.latitude},${xe.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${xe.coords.latitude}`,lng:`${xe.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?P?.error(ge,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE),ge}finally{G(!1)}}),[he,P,w,ne,ve]),te=(0,t.useCallback)(()=>S(void 0,null,function*(){try{G(!0);const ge=yield oe();ge&&w(M(v({},k.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?P?.error(ge,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{G(!1)}}),[P,U,oe,w]),re=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:F,position:X,refreshPosition:oe,requestPosition:de,requestCurrentLocation:le,checkAndSetLocationPermission:ce,checkLocaitonPermission:me}),[I,te,U,X,oe,de,le,ce,me]);return(0,n.jsxs)(x.Provider,{value:re,children:[ae&&(0,n.jsx)(b.J,{isOpen:ae,onClose:()=>se(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},82825:(Y,s,e)=>{"use strict";e.d(s,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,s,e)=>{"use strict";e.d(s,{pc:()=>Pt,GI:()=>ye,rz:()=>_t,Cq:()=>X,Fp:()=>lt,el:()=>An,ao:()=>zn,oA:()=>D,Yt:()=>ut,Nu:()=>un,g4:()=>qt,tn:()=>Te,n4:()=>N,gD:()=>P,Vp:()=>et,Cx:()=>G,bK:()=>k,gi:()=>ct,Z$:()=>de,GT:()=>Qe,hr:()=>le,JL:()=>te,Ck:()=>I,dU:()=>V,wG:()=>xn,hZ:()=>nn,$e:()=>dn,qT:()=>jt,GQ:()=>Br,q3:()=>Bn,D_:()=>rr,Uf:()=>F,_l:()=>J,Md:()=>se,V7:()=>ae,fe:()=>me,JP:()=>sn,Z_:()=>w,zO:()=>ce,UZ:()=>he,$7:()=>Ye,rb:()=>q,_W:()=>ot,WS:()=>Ft,VF:()=>it,vf:()=>Pr,PV:()=>Ze,PS:()=>Nr,Iz:()=>Fe,zD:()=>ne,m3:()=>Nt,XP:()=>kt,PM:()=>Ee,cX:()=>re,G6:()=>ge,Us:()=>ze,AA:()=>Ie,G0:()=>Mt,mO:()=>st,HH:()=>De,PU:()=>Ve,it:()=>Ke,Tl:()=>ft,uH:()=>Ot,c3:()=>xe,rx:()=>L});var n=e(36087),t=e(14041);const r=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 l=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));l.displayName="UserCheck02";const o=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 b=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));b.displayName="Users01";const c=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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),m=e(9495);const p=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));p.displayName="Hash01";const f=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));f.displayName="Hash02";const O=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 g=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));g.displayName="Virus";const A=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));A.displayName="CreditCard02";const h=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 d=e(85418);const v=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 4m1 11 2 2 4.5-4.5M9.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="ClipboardCheck";const M=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));M.displayName="ClipboardPlus";const S=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));S.displayName="Route";const T=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));T.displayName="Briefcase01";const x=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));x.displayName="Translate01";const z=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));z.displayName="AnnotationQuestion";const C=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const E=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));E.displayName="Shield01";const R=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const L=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,P="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",k="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",G="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",F="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",X="http://icanbwell.com/fhir/StructureDefinition/questionnaire-edit-return-to-group",q="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",se="http://hl7.org/fhir/StructureDefinition/entryFormat",ne="http://hl7.org/fhir/StructureDefinition/tz-code",he="tz-code",ve="footer",ye="check-box",Ae="header",J="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",ce="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",de=[{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"}],le={"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"},te={"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"},re="ui-toolkit/CoordinatePicker",ge="ui-toolkit/DetailsInfo",xe="ui-toolkit/ServiceChoice",Ie="ui-toolkit/InfoBanner",Ee="ui-toolkit/Button",De="ui-toolkit/Phone",ze="ui-toolkit/ErrorCard",We="ui-toolkit/FormContainer",st="ui-toolkit/PageHeader",ft="ui-toolkit/SelectableOption",Mt="ui-toolkit/Modal",Nt="ui-toolkit/Alert",kt="ui-toolkit/AppSectionAccess",Ot="ui-toolkit/SensitiveDataCategory",Ke="ui-toolkit/QuestCard",Ye="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ft="http://icanbwell.com/fhir/StructureDefinition/text-align",ot={LEFT:"left",CENTER:"center"},tt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},qt="http://icanbwell.com/fhir/StructureDefinition/icon-name",zn="http://icanbwell.com/fhir/StructureDefinition/error-title",An="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",lt="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",_t="http://icanbwell.com/fhir/StructureDefinition/description",dn="http://icanbwell.com/fhir/StructureDefinition/modal-description",rr="http://icanbwell.com/fhir/StructureDefinition/modal-title",Br="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",jt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",nn="http://icanbwell.com/fhir/StructureDefinition/button-text",Bn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",xn="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Nr="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Pr="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Wt="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",it="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ze="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Qe="http://hl7.org/fhir/StructureDefinition/mimeType",et="http://hl7.org/fhir/StructureDefinition/maxSize",ct="http://icanbwell.com/fhir/StructureDefinition/message-severity",Pt="http://icanbwell.com/fhir/StructureDefinition/alert-color",ut="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ue="http://icanbwell.com/fhir/StructureDefinition/placeholder",Ce="http://icanbwell.com/fhir/StructureDefinition/hint-text",Ve="ui-toolkit/PrefilledMemberDemographicsAlert",Te="http://hl7.org/fhir/issue-severity",It="http://icanbwell.com/fhir/StructureDefinition/button-type",Yt="http://icanbwell.com/fhir/StructureDefinition/button-action",yn="button-type",qn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",pr="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ht="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Xe="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Dt={},sn={"user-check":r,"user-check-02":l,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":b,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:m.X,hash:p,"hash-02":f,"folder-heart":n.FolderHeart,"medical-cross":O,virus:g,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":A,"link-03":h,"search-lg":d.q,"clipboard-check":v,"clipboard-plus":M,route:S,"briefcase-01":T,"translate-01":x,"annotation-question":z,"globe-05":C,"shield-01":E,"upload-01":R},un="http://icanbwell.com/fhir/StructureDefinition/questionnaire-hideRequiredIndicator"},25624:(Y,s,e)=>{"use strict";e.d(s,{$H:()=>N,$O:()=>ft,AT:()=>pr,CP:()=>dn,Fy:()=>_t,GN:()=>ve,J4:()=>Pt,MU:()=>q,Nw:()=>Ze,Qr:()=>C,Ue:()=>ut,Yo:()=>xe,a0:()=>x,cz:()=>E,di:()=>I,eC:()=>ue,iI:()=>G,lv:()=>k,mR:()=>qn,nt:()=>z,od:()=>V,t7:()=>Mt,u0:()=>S,yQ:()=>yn,zj:()=>le});var n=e(17637),t=e(43915),r=e(37234),l=e(65328),o=e(91595),i=e(27779),a=e.n(i),b=e(45250),c=e.n(b),u=e(16681),y=e(18807),m=e(1053),p=Object.defineProperty,f=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(gt,Bt,en)=>Bt in gt?p(gt,Bt,{enumerable:!0,configurable:!0,writable:!0,value:en}):gt[Bt]=en,v=(gt,Bt)=>{for(var en in Bt||(Bt={}))A.call(Bt,en)&&d(gt,en,Bt[en]);if(g)for(var en of g(Bt))h.call(Bt,en)&&d(gt,en,Bt[en]);return gt},M=(gt,Bt)=>f(gt,O(Bt));const S=(gt,Bt,en,Rt)=>{if(gt){const Kt=gt(Bt,v({defaultValue:en},Rt));if(Kt&&Kt!==Bt)return Kt}return Rt?Object.entries(Rt).reduce((Kt,[At,Je])=>Kt.replace(`{{${At}}}`,String(Je)),en):en},T=gt=>{var Bt;return(Bt=gt.filter(en=>en.url.includes("questionnaire-itemControl")).flatMap(en=>{var Rt,Kt;return(Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)!=null?Kt:[]}).find(en=>{var Rt;return(Rt=en.code)==null?void 0:Rt.startsWith("ui-toolkit/")}))==null?void 0:Bt.code},x=gt=>{var Bt;const en=(Bt=gt.extension)==null?void 0:Bt.find(Rt=>Rt.url===m.V7);return en?.valueCode||"off"},z=(gt,Bt,en)=>{const Rt=(0,y.A)(en);return gt&&Bt&&en?Rt.replace("<p>",`<span>${Bt} `).replace("</p>","</span>").trim():Rt.replace("<p>","<span>").replace("</p>","</span>").trim()},C=gt=>{const Bt=gt?.find(en=>en.url===m.Vp);return Bt?.valueInteger},E=gt=>{const Bt=gt?.find(en=>en.url===m.Z_);return Bt?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},L="Type your response here...",P=(gt,Bt)=>{const en=gt?.find(Rt=>Rt.url===PLACEHOLDER_EXTENSION_URL);return en?.valueString||Bt&&R[Bt]||L},D=gt=>{const Bt=gt?.find(en=>en.url===HINT_TEXT_EXTENSION_URL);return Bt?.valueString},N=gt=>{const Bt=gt?.filter(en=>en.url===m.GT&&en.valueCode).map(en=>m.hr[en.valueCode]||en.valueCode);return Bt?.length?Bt.join(","):void 0},w=gt=>gt.split(",").map(Rt=>Rt.trim()).map(Rt=>m.JL[Rt]||Rt).filter((Rt,Kt,At)=>At.indexOf(Rt)===Kt).join(", "),V=(gt,Bt,en)=>{const Rt=w(gt),Kt=Rt.lastIndexOf(","),At=Kt!==-1?`${Rt.substring(0,Kt)} or${Rt.substring(Kt+1)}`:Rt,Je=[Bt&&`max. ${parseFloat((Bt/(1e3*1e3)).toFixed(1))}MB`,en&&`upto ${en} file${en>1?"s":""}`].filter(Boolean);return Je.length>0?`${At} (${Je.join(", ")})`:At},k=gt=>{const Bt=gt?.find(en=>en?.url===m.zD||en?.url===m.UZ);return Bt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(gt,Bt)=>{var en,Rt,Kt;const At=Bt?.find(Je=>Je.url.includes(gt));return(Kt=(Rt=(en=At?.valueInteger)!=null?en:At?.valueDecimal)!=null?Rt:At?.valueString)!=null?Kt:At?.valueDate},G=gt=>{if(!!gt){if(/^\d{4}-\d{2}-\d{2}$/.test(gt))return gt;try{const Bt=(0,i.evaluate)({},gt);if(Array.isArray(Bt)&&Bt.length>0){const en=Bt[0];if(en instanceof Date&&!isNaN(en.getTime())){const Rt=en.getFullYear(),Kt=String(en.getMonth()+1).padStart(2,"0"),At=String(en.getDate()).padStart(2,"0");return`${Rt}-${Kt}-${At}`}if(typeof en=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(en))return en}}catch{}}},U=(gt,Bt)=>{var en,Rt;const Kt=Bt?.find(Je=>Je.url===gt);if(!Kt)return;const At=(en=Kt.valueString)!=null?en:Kt.valueDate;return At||G((Rt=Kt.valueExpression)==null?void 0:Rt.expression)},F=(gt,Bt)=>{if(!(!gt||gt.length===0))for(const en of gt){const Rt=I(Bt,en.extension);if(Rt!==void 0)return Rt;if(en.item&&en.item.length>0){const Kt=F(en.item,Bt);if(Kt!==void 0)return Kt}}},X=(gt,Bt)=>{try{const en=String(gt??Bt);let Rt;if(en.includes("/"))Rt=(0,n.A)(en,"MM/dd/yyyy",new Date);else{const Kt=en.split("T")[0];Rt=(0,t.A)(Kt)}return(0,r.A)(Rt)}catch(en){return console.error("Date parsing error:",en,gt),null}},q=(gt,Bt)=>{var en;for(const Rt of gt){if(Rt.linkId===Bt)return Rt;if((en=Rt.item)!=null&&en.length){const Kt=q(Rt.item,Bt);if(Kt!==void 0)return Kt}}},ae=(gt,Bt)=>{var en;const Rt=[];for(const Kt of gt)if(Kt.linkId===Bt&&Rt.push(Kt),(en=Kt.item)!=null&&en.length){const At=ae(Kt.item,Bt);Rt.push(...At)}return Rt},se=(gt,Bt,en=0)=>ae(gt,Bt)[en];function ne(gt){return gt!=null}const he=(gt,Bt)=>{var en,Rt,Kt;if("answerString"in gt&&ne(gt.answerString)){if(gt.operator==="=")return Bt?.valueString===gt.answerString;if(gt.operator==="!=")return Bt?.valueString!==gt.answerString}if("answerBoolean"in gt&&ne(gt.answerBoolean)){if(gt.operator==="=")return Bt?.valueBoolean===gt.answerBoolean;if(gt.operator==="!=")return Bt?.valueBoolean!==gt.answerBoolean}if("answerInteger"in gt&&ne(gt.answerInteger)||"answerDecimal"in gt&&ne(gt.answerDecimal)){const At=Number(Bt?.valueInteger||Bt?.valueDecimal),Je=Number(gt.answerInteger||gt.answerDecimal);if(gt.operator==="=")return At===Je;if(gt.operator==="!=")return At!==Je;if(gt.operator===">")return At>Je;if(gt.operator==="<")return At<Je;if(gt.operator===">=")return At>=Je;if(gt.operator==="<=")return At<=Je}if("answerQuantity"in gt&&ne(gt.answerQuantity)){const At=Bt?.valueQuantity,Je=gt.answerQuantity;if(At?.unit!==Je?.unit)return!1;if(gt.operator==="=")return At.value===Je.value;if(gt.operator==="!=")return At.value!==Je.value;if(gt.operator===">")return At.value>Je.value;if(gt.operator==="<")return At.value<Je.value;if(gt.operator===">=")return At.value>=Je.value;if(gt.operator==="<=")return At.value<=Je.value}if("answerCoding"in gt&&ne(gt.answerCoding)){const At=Bt?.valueCoding,Je=gt.answerCoding;if(gt.operator==="=")return At?.code===Je.code;if(gt.operator==="!=")return At?.code!==Je.code}if("answerReference"in gt&&ne(gt.answerReference)){const At=Bt?.valueReference,Je=gt.answerReference;if(gt.operator==="=")return At?.reference===Je.reference;if(gt.operator==="!=")return At?.reference!==Je.reference}if("answerDate"in gt&&ne(gt.answerDate)||"answerDateTime"in gt&&ne(gt.answerDateTime)||"answerTime"in gt&&ne(gt.answerTime)){const At=new Date((Kt=(Rt=(en=Bt?.valueDate)!=null?en:Bt?.valueDateTime)!=null?Rt:Bt?.valueTime)!=null?Kt:""),Je=new Date(gt.answerDate||gt.answerDateTime||gt.answerTime||"");if(gt.operator==="=")return At.getTime()===Je.getTime();if(gt.operator==="!=")return At.getTime()!==Je.getTime();if(gt.operator===">")return At.getTime()>Je.getTime();if(gt.operator==="<")return At.getTime()<Je.getTime();if(gt.operator===">=")return At.getTime()>=Je.getTime();if(gt.operator==="<=")return At.getTime()<=Je.getTime()}return gt.operator==="exists"?Bt!=null===gt.answerBoolean:!0},ve=(gt,Bt,en)=>{const Rt=Kt=>{const At=ae(en,Kt.question);return At.length===0||At.every(Je=>!Je.answer||Je.answer.length===0)?he(Kt,void 0):At.some(Je=>{var zt;return(zt=Je.answer)==null?void 0:zt.some(Vt=>he(Kt,Vt&&Object.keys(Vt).length>0?Vt:void 0))})};return gt&&gt?.length>0?Bt==="any"?gt?.some(Kt=>Rt(Kt)):gt?.every(Kt=>Rt(Kt)):!0},ye=(gt,Bt,en,Rt,Kt)=>{if(!gt||gt.length===0)return!0;const At=Je=>{var zt;let Vt;if(Rt&&typeof Kt=="number"){const rn=en.filter(hn=>hn.linkId===Rt)[Kt];if(rn?.item){const hn=rn.item.find(kn=>kn.linkId===Je.question);if(hn?.answer&&hn.answer.length>0)return(zt=hn?.answer)==null?void 0:zt.some(kn=>he(Je,kn&&Object.keys(kn).length>0?kn:void 0))}}if(!Vt){const vn=ae(en,Je.question);if(vn.length>0)return vn.some(rn=>{var hn;return(hn=rn.answer)==null?void 0:hn.some(kn=>he(Je,kn&&Object.keys(kn).length>0?kn:void 0))});Vt=void 0}return he(Je,Vt)};return Bt==="any"?gt.some(Je=>At(Je)):gt.every(Je=>At(Je))},Ae=(gt,Bt)=>{var en;if(!!((en=gt?.valueExpression)!=null&&en.expression))try{const Rt=evaluate(Bt,gt.valueExpression.expression);return Array.isArray(Rt)?Rt.some(Kt=>Boolean(Kt)):Boolean(Rt)}catch{return}},J=(gt,Bt)=>{var en;const Rt=(en=gt.extension)==null?void 0:en.find(At=>At.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Kt=Ae(Rt,Bt);return M(v({},gt),{readOnly:Kt??gt.readOnly})},oe=(gt,Bt,en,Rt)=>{const{required:Kt,maxLength:At,type:Je,extension:zt,enableWhen:Vt,enableBehavior:vn,repeats:rn,answerOption:hn}=gt;if(!ve(Vt,vn,Bt)||gt.type==="group"||gt.type==="display")return"";if(rn)return me(gt,Bt,en,Rt);const kn=te(gt,Bt);return kn&&re(kn,gt)?ge(gt,Bt,en,kn,Rt):le(zt,Je,Kt,At,en,hn,Rt)},me=(gt,Bt,en,Rt)=>{const{required:Kt}=gt;if(Kt){if(!en||en.length===0)return S(Rt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let At=!1;for(let Je=0;Je<en.length;Je++){const zt=en[Je];if(zt&&Object.keys(zt).length>0&&Object.values(zt).some(vn=>vn!=null&&vn!==""&&(Array.isArray(vn)?vn.length>0:!0))){At=!0;const vn=le(gt.extension,gt.type,!0,gt.maxLength,[zt],gt.answerOption,Rt);if(vn)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Je+1,error:vn});if(gt.item&&gt.item.length>0){const rn=ce(gt.item,Bt,gt.linkId,Je,Rt);if(rn)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Je+1,error:rn})}}else return S(Rt,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Je+1})}if(!At)return S(Rt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(en&&en.length>0)for(let At=0;At<en.length;At++){const Je=en[At];if(Je&&Object.keys(Je).length>0&&Object.values(Je).some(Vt=>Vt!=null&&Vt!==""&&(Array.isArray(Vt)?Vt.length>0:!0))){const Vt=le(gt.extension,gt.type,!1,gt.maxLength,[Je],gt.answerOption,Rt);if(Vt)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:At+1,error:Vt});if(gt.item&&gt.item.length>0){const vn=ce(gt.item,Bt,gt.linkId,At,Rt);if(vn)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:At+1,error:vn})}}}return""},ce=(gt,Bt,en,Rt,Kt)=>{var At,Je;for(const zt of gt){if(!ye(zt.enableWhen,zt.enableBehavior,Bt,en,Rt))continue;const Vt=q(Bt,en),vn=(At=Vt?.item)==null?void 0:At.find(hn=>hn.linkId===zt.linkId),rn=(Je=vn?.answer)!=null&&Je[Rt]?[vn.answer[Rt]]:void 0;if(zt.required){if(!rn||!rn[0]||!de(rn[0]))return S(Kt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:zt.text||zt.linkId});const hn=le(zt.extension,zt.type,!0,zt.maxLength,rn,zt.answerOption,Kt);if(hn)return`${zt.text||zt.linkId}: ${hn}`}else if(rn&&rn[0]&&de(rn[0])){const hn=le(zt.extension,zt.type,!1,zt.maxLength,rn,zt.answerOption,Kt);if(hn)return`${zt.text||zt.linkId}: ${hn}`}if(zt.item&&zt.item.length>0){const hn=ce(zt.item,Bt,zt.linkId,Rt,Kt);if(hn)return hn}}return""},de=gt=>!gt||Object.keys(gt).length===0?!1:Object.values(gt).some(Bt=>Bt!=null&&Bt!==""&&(Array.isArray(Bt)?Bt.length>0:!0)),le=(gt,Bt,en,Rt,Kt,At,Je)=>{var zt,Vt,vn,rn,hn;let kn="";const Sr=!!gt?.find(yo=>{var Wo,Do;return yo.url===m.gD&&((Do=(Wo=yo.valueCodeableConcept)==null?void 0:Wo.coding)==null?void 0:Do.some(ii=>ii.system===m.n4&&ii.code===m.GI))}),ur=Kt?.[0],Lr={choice:((zt=ur?.valueCoding)==null?void 0:zt.code)||(ur?.valueString&&At?.some(yo=>yo.valueString===ur.valueString)?ur.valueString:null),"open-choice":((Vt=ur?.valueCoding)==null?void 0:Vt.code)||ur?.valueString,boolean:ur?.valueBoolean,string:ur?.valueString,text:ur?.valueString,url:ur?.valueUri,integer:ur?.valueInteger,decimal:ur?.valueDecimal,dateTime:ur?.valueDateTime,date:ur?.valueDate,time:ur?.valueTime,quantity:(vn=ur?.valueQuantity)==null?void 0:vn.value,reference:(rn=ur?.valueReference)==null?void 0:rn.display,attachment:(hn=ur?.valueAttachment)==null?void 0:hn.title};if(!(Bt in Lr))return"";const Gr=Lr[Bt],si={required:()=>en&&(Gr==null||Gr===""||Gr==="NaN"||Number.isNaN(Gr)||Bt==="boolean"&&Gr!==!0&&Sr)?S(Je,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Rt&&Gr!==null&&Gr!==void 0&&Gr.toString().length>Rt?S(Je,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Rt}):"",minLength:()=>{const yo=I("minLength",gt);return yo&&Gr!==null&&Gr!==void 0&&Gr.toString().length<Number(yo)?S(Je,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:yo}):""},urlRegex:()=>{const yo=new RegExp(m.rx),Wo=I("regexError",gt),Do=Wo??S(Je,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return yo&&Bt==="url"&&Gr&&!yo.test(Gr)?String(Do):""},regex:()=>{const yo=I("regex",gt);if(!yo||typeof Gr!="string")return"";const Wo=new RegExp(yo),Do=I("regexError",gt),ii=Do??S(Je,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Wo&&Gr&&!Wo.test(Gr)?String(ii):""},dateTime:()=>{if(Bt==="dateTime"&&Gr){const yo=Gr?.toString(),Wo=new Date(yo);return isNaN(Wo.getTime())?S(Je,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(Bt!=="date"||!Gr)return"";const yo=Gr.replace(/\D/g,"");return yo.length>0&&yo.length<8||isNaN(new Date(Gr).getTime())?S(Je,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var yo;if(Bt==="date"){const Do=U(m.dU,gt),ii=X(Do??"01/01/1900","01/01/1900"),tr=X(Gr,"");if(!ii||!tr)return"";if((0,l.A)(tr,ii)){const dr=(yo=gt?.find(Dr=>Dr.url===m.Ck))==null?void 0:yo.valueString;return dr??S(Je,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:Do??"01/01/1900"})}return""}const Wo=I("minValue",gt);return Wo!=null&&Gr!==null&&Gr!==void 0&&Gr<Wo?S(Je,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Wo}):""},maxValue:()=>{var yo;if(Bt==="date"){const Do=U(m.bK,gt),ii=X(Do??"01/01/2100","01/01/2100"),tr=X(Gr,"");if(!ii||!tr)return"";if((0,o.A)(tr,ii)){const dr=(yo=gt?.find(Dr=>Dr.url===m.Cx))==null?void 0:yo.valueString;return dr??S(Je,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:Do??"01/01/2100"})}return""}const Wo=I("maxValue",gt);return Wo!=null&&Gr!==null&&Gr!==void 0&&Gr>Wo?S(Je,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Wo}):""}};return kn=si.required()||si.maxLength()||si.minLength()||si.urlRegex()||si.regex()||si.dateTime()||si.date()||si.minValue()||si.maxValue()||"",kn},te=(gt,Bt)=>{for(const en of Bt)if(en.item){if(en.item.find(At=>At.linkId===gt.linkId))return en;const Kt=te(gt,en.item);if(Kt)return Kt}return null},re=(gt,Bt)=>{if(gt.answer&&gt.answer.length>1)return!0;if(gt.item){const en=gt.item.find(Rt=>Rt.linkId===Bt.linkId);if(en&&en.answer&&en.answer.length>1)return!0}return!1},ge=(gt,Bt,en,Rt,Kt)=>{var At,Je;const{required:zt}=gt,Vt=(At=Rt.item)==null?void 0:At.find(hn=>hn.linkId===gt.linkId),vn=Vt?.answer||[],rn=((Je=Rt.answer)==null?void 0:Je.length)||1;for(let hn=0;hn<rn;hn++){const kn=vn[hn];if(zt){if(!kn||!de(kn))return S(Kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:hn+1,error:S(Kt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:gt.text||gt.linkId})});const Sr=le(gt.extension,gt.type,!0,gt.maxLength,[kn],gt.answerOption,Kt);if(Sr)return S(Kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:hn+1,error:Sr})}else if(kn&&de(kn)){const Sr=le(gt.extension,gt.type,!1,gt.maxLength,[kn],gt.answerOption,Kt);if(Sr)return S(Kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:hn+1,error:Sr})}}return""},xe=(gt,Bt)=>{for(const en of gt){if(en?.linkId===Bt)return en;if(en?.item&&en.item.length>0){const Rt=xe(en.item,Bt);if(Rt)return Rt}}},Ie=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===ITEM_CONTROL_EXTENSION_URL&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&At.code===FOOTER_CODE))}))},Ee=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===m.oA&&en.valueBoolean))},De=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===ITEM_CONTROL_EXTENSION_URL&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&At.code===HEADER_CODE))}))},ze=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===m.gD&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===m.n4&&At.code===m._l))}))},We=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&en.valueBoolean))},st=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===ITEM_CONTROL_EXTENSION_URL&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&At.code===CHECKBOX_CODE))}))},ft=gt=>{var Bt;const en=(Bt=gt.extension)==null?void 0:Bt.find(Rt=>Rt.url===m.fe);return en?.valueInteger},Mt=gt=>{var Bt;const en=(Bt=gt.extension)==null?void 0:Bt.find(Rt=>Rt.url===m.zO);return en?.valueInteger},Nt=gt=>{var Bt;const en=(Bt=gt?.extension)==null?void 0:Bt.find(Rt=>Rt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return en?.valueInteger},kt=(gt,Bt,en,Rt,Kt,At)=>{const Je=Vt=>Bt.filter(vn=>vn.linkId===Vt),zt=new Set;return gt.map(Vt=>{if(zt.has(Vt.linkId)||Ie(Vt))return null;const rn=Je(Vt.linkId),hn=Vt.type==="group"&&Vt.repeats;if(zt.add(Vt.linkId),hn){const kn=[];if(rn.forEach((Sr,ur)=>{const Lr={linkId:Vt.linkId,text:Vt.text};let Gr;if(en===Vt.linkId&&typeof At=="number"&&At===ur&&Kt&&Kt.length>0){const si=Sr?.item||[];Gr=[...si],Kt.forEach(yo=>{const Wo=Gr.findIndex(Do=>Do.linkId===yo.linkId);Wo>=0?Gr[Wo]=M(v({},si[Wo]),{answer:yo.answer}):Gr.push(yo)})}else Vt.item&&(Gr=kt(Vt.item,Sr?.item||[],en,Rt,Kt,ur));en===Vt.linkId&&typeof At=="number"&&At===ur&&Rt?Lr.answer=Rt:Lr.answer=Sr.answer||[{}],Gr&&Gr.length>0?Lr.item=Gr:Sr.item&&(Lr.item=Sr.item),kn.push(Lr)}),en===Vt.linkId&&typeof At=="number"&&At>=rn.length)for(let Sr=rn.length;Sr<=At;Sr++){const ur={linkId:Vt.linkId,text:Vt.text,answer:Sr===At&&Rt?Rt:[{}]};Sr===At&&Kt&&Kt.length>0?ur.item=Kt:Vt.item&&(ur.item=kt(Vt.item,[],void 0,void 0,void 0,void 0)),kn.push(ur)}return kn}else if(Vt.repeats&&typeof At=="number"&&en===Vt.linkId){const kn=rn[0]||{linkId:Vt.linkId,text:Vt.text,answer:[]},Sr={linkId:Vt.linkId,text:Vt.text,answer:[...kn.answer||[]]};if(Rt&&Rt.length>0){for(;Sr.answer.length<=At;)Sr.answer.push({});Sr.answer[At]=Rt[0]}return Sr}else{const kn=rn[0],Sr=Vt.item?kt(Vt.item,kn?.item||[],en,Rt,Kt,At):void 0,ur=Sr&&Sr.length>0,Lr={linkId:Vt.linkId,text:Vt.text};return en&&Vt.linkId===en&&typeof At!="number"?(Rt||!Rt&&!Kt?Lr.answer=Rt:kn?.answer&&(Lr.answer=kn.answer),Kt?Lr.item=Kt:ur&&(Lr.item=Sr)):(kn?.answer?Lr.answer=kn.answer:Lr.answer=[{}],ur&&(Lr.item=Sr)),Lr}}).filter(Boolean).flat()},Ot=(gt,Bt)=>{for(const en of gt)if(en.linkId===Bt||en.item&&Ot(en.item,Bt))return en.linkId;return null},Ke=(gt,Bt,en,Rt)=>{var Kt;const At=(Kt=gt?.item)!=null?Kt:Rt;return!At||At.length===0?!0:At.every(Je=>{var zt;const Vt=ae(Bt,Je.linkId);if(Vt.length===0){const vn=(zt=q(Bt,Je.linkId))==null?void 0:zt.answer;if(oe(Je,Bt,vn)&&ve(Je.enableWhen,Je.enableBehavior,Bt)&&en.includes(Je.linkId))return!1}else for(const vn of Vt)if(oe(Je,Bt,vn.answer)&&ve(Je.enableWhen,Je.enableBehavior,Bt)&&en.includes(Je.linkId))return!1;return Je.item?Ke(Je,Bt,en):!0})},Ye=(gt,Bt,en=!0)=>{for(const Rt of gt)if(Rt.linkId===Bt&&Rt.answer&&Rt.answer.length>0||Rt.item&&Rt.item.length>0&&Ye(Rt.item,Bt,en))return!0;return!1},Ft=(gt,Bt,en=0)=>{const Rt=gt.filter(Kt=>Kt.linkId===Bt);if(Rt.length>en){const Kt=Rt[en];if(Kt.answer&&Kt.answer.length>0)return Kt.answer.some(At=>At&&Object.keys(At).length>0&&Object.values(At).some(Je=>Je!=null&&Je!==""));if(Kt.item&&Kt.item.length>0)return Ye(Kt.item,Bt,!1)}return Ye(gt,Bt,!1)},ot=(gt,Bt)=>{if(!gt||!gt.item)return!1;const en=Rt=>{var Kt;if(Ee(Rt)&&Rt.required&&ve(Rt.enableWhen,Rt.enableBehavior,Bt)){const At=q(Bt,Rt.linkId),Je=le(Rt.extension,Rt.type,Rt.required,Rt.maxLength,At?.answer,Rt.answerOption);if(!((Kt=At?.answer)!=null&&Kt.length)||Je)return!0}if(Rt.item){for(const At of Rt.item)if(en(At))return!0}return!1};for(const Rt of gt.item)if(en(Rt))return!0;return!1},tt=gt=>{var Bt,en,Rt;if(gt.valueString!==void 0)return gt.valueString;if(gt.valueBoolean!==void 0)return gt.valueBoolean;if(gt.valueInteger!==void 0)return gt.valueInteger;if(gt.valueDecimal!==void 0)return gt.valueDecimal;if(gt.valueDate!==void 0)return gt.valueDate;if(gt.valueDateTime!==void 0)return gt.valueDateTime;if(((Bt=gt.valueCoding)==null?void 0:Bt.code)!==void 0)return gt.valueCoding.code;if(((en=gt.valueReference)==null?void 0:en.reference)!==void 0)return gt.valueReference.reference;if(((Rt=gt.valueQuantity)==null?void 0:Rt.value)!==void 0)return gt.valueQuantity.value;if(gt.valueAttachment!==void 0)return gt.valueAttachment},qt=gt=>{const Bt={linkId:gt.linkId};if(gt.answer&&gt.answer.length>0){const en=gt.answer.map(Rt=>tt(Rt)).filter(Rt=>Rt!==void 0);en.length>0&&(Bt.answer=en)}if(gt.item&&gt.item.length>0){const en=gt.item.map(Rt=>qt(Rt)).filter(Rt=>{const Kt=Object.keys(Rt);return Kt.length>1||Kt.length===1&&Kt[0]!=="linkId"});en.length>0&&(Bt.item=en)}return Bt},zn=(gt,Bt,en,Rt,Kt,At)=>{var Je;const zt=(Je=Bt?.item)==null?void 0:Je[en[Rt]],Vt=zt?.linkId;if(!Vt)return!1;const vn=ae(gt,Vt),rn=ae(Kt,Vt),hn=kn=>{if(kn!=null){if(Array.isArray(kn)){const Sr=kn.filter(ur=>ur!=null).map(ur=>hn(ur)).filter(ur=>ur!==void 0);return Sr.length===0||Sr.length===1&&typeof Sr[0]=="object"&&Object.keys(Sr[0]).length===0?void 0:Sr}if(typeof kn=="object"){const Sr={};for(const[ur,Lr]of Object.entries(kn))if(Lr!=null){const Gr=hn(Lr);Gr!==void 0&&(Sr[ur]=Gr)}return Object.keys(Sr).length===0?void 0:Sr}return kn}};if(vn.length!==rn.length)return!1;for(let kn=0;kn<vn.length;kn++){const Sr=vn[kn],ur=rn[kn];if(!Sr||!ur)return!1;const Lr=qt(hn(Sr)),Gr=qt(hn(ur));if(!_.isEqual(Lr,Gr))return!1}return Rt!==At},An=(gt,Bt,en,Rt)=>en&&en.length>0&&!(en.length===1&&Object.keys(en[0]).length===0)&&oe(gt,Bt,en,Rt)||null,lt=(gt,Bt,en)=>{const Rt={},Kt=At=>{At.forEach(Je=>{const zt=ae(Bt,Je.linkId);if(Ve(Je,gt)||Je.repeats)for(let Vt=0;Vt<zt.length;Vt++){const vn=zt[Vt];if(vn?.answer&&vn.answer.length>0){const rn=An(Je,Bt,vn.answer,en);rn&&(Rt[Je.linkId]=M(v({},Rt[Je.linkId]),{[Vt]:rn}))}}else{const Vt=q(Bt,Je.linkId);if(Vt?.answer&&Vt.answer.length>0){const vn=An(Je,Bt,Vt.answer,en);vn&&(Rt[Je.linkId]={0:vn})}}Je.item&&Je.item.length>0&&Kt(Je.item)})};return Kt(gt),Rt},_t=gt=>{if(!gt)return"";const Bt=gt.split("-");if(Bt.length===3){const[en,Rt,Kt]=Bt;return`${en.slice(-4)}-${Rt}-${Kt}`}return""},dn=gt=>gt.trim().replace(/[A-Za-z]+/g,""),rr=(gt,Bt)=>{const en=(Rt,Kt)=>{for(const At of Rt){if(At.linkId===Kt)return At.answer;if(At.item&&At.item.length>0){const Je=en(At.item,Kt);if(Je!==void 0)return Je}}};return en(gt,Bt)},Br=(gt,Bt)=>{if(!Bt||Bt.length===0)return null;const en=gt.linkId,Rt=(Kt,At,Je=[])=>{for(const zt of Kt){const Vt=[...Je,zt];if(zt.item){if(zt.item.some(hn=>hn.linkId===At))return Vt.some(hn=>hn.repeats===!0)?zt:null;if(Rt(zt.item,At,Vt))return zt}}return null};return Rt(Bt,en)},jt=(gt,Bt)=>{if(!Bt||Bt.length===0)return!1;const en=gt.linkId,Rt=(Kt,At,Je=[])=>{for(const zt of Kt){const Vt=[...Je,zt];if(zt.item){if(zt.item.some(hn=>hn.linkId===At))return Vt.some(hn=>{const kn=T(hn.extension||[]);return!!kn&&kn!==UI_TOOLKIT_FORM_CONTAINER});if(Rt(zt.item,At,Vt))return!0}}return!1};return Rt(Bt,en)},nn=(gt,Bt,en)=>{const Rt={};if(!gt)return Rt;const{linkId:Kt}=Bt;if(gt[Kt]){const At=gt[Kt];Rt[Kt]=At[en]||""}return Bt.item&&Bt.item.length>0&&Bt.item.forEach(At=>{if(gt[At.linkId]){const Je=gt[At.linkId];Rt[At.linkId]=Je[en]||""}}),Rt},Bn=(gt,Bt)=>{const en={};if(!gt||!gt[Bt])return en;const Rt=gt[Bt];return en[Bt]=Rt[0]||"",en},xn=gt=>{const Bt=gt.findIndex(At=>!Ee(At)),en=Bt>=0?[Bt]:gt.length>0?[0]:[],Rt=new Map;let Kt=null;if(gt.forEach((At,Je)=>{const zt=ze(At);if(zt&&At.type==="group")Je!==Bt&&en.push(Je),Rt.set(Je,[Je]),Kt=Je;else if(Kt!==null&&!zt){const Vt=Rt.get(Kt)||[];Rt.set(Kt,[...Vt,Je])}}),gt.length>0&&en.length>0){const At=en[0];if(!Rt.has(At)){const Je=en.find(Vt=>Vt>At),zt=[];for(let Vt=At;Vt<(Je??gt.length);Vt++)zt.push(Vt);Rt.set(At,zt)}}return{groupIndices:en,itemsToRenderMap:Rt}},Nr=(gt,Bt,en,Rt)=>{let Kt=[...Rt];const At=(Je,zt)=>{Je.forEach(Vt=>{if((!Vt?.enableWhen||ve(Vt?.enableWhen,Vt.enableBehavior,zt))&&Vt.initial&&!Ye(zt,Vt.linkId))if(Vt.repeats){const vn=zt.filter(rn=>rn.linkId===Vt.linkId);vn.length>0?vn.forEach((rn,hn)=>{Ft(zt,Vt.linkId,hn)||(Kt=kt(en,Kt,Vt.linkId,Vt.initial,void 0,hn))}):Kt=kt(en,Kt,Vt.linkId,Vt.initial)}else Kt=kt(en,Kt,Vt.linkId,Vt.initial);Vt.item&&At(Vt.item,zt)})};return At(gt,Bt),Kt},Pr=(gt,Bt,en)=>{if(!gt)return[];const Rt=[],Kt=At=>{At.required===Bt&&ve(At.enableWhen,At.enableBehavior,en)&&!Ee(At)&&At.type!=="display"&&Rt.push(At),At.item&&At.item.length>0&&At.item.forEach(Kt)};return gt.forEach(Kt),Rt},Wt=(gt,Bt)=>gt.every(en=>{var Rt;const Kt=ae(Bt,en.linkId);if(Kt.length>0)return Kt.every(At=>!oe(en,Bt,At.answer));{const At=(Rt=q(Bt,en.linkId))==null?void 0:Rt.answer;return!oe(en,Bt,At)}}),Fe=(gt,Bt)=>{let en=-1;for(let Rt=gt.length-1;Rt>=0;Rt--)if(gt[Rt].linkId===Bt){en=Rt;break}return en},it=(gt,Bt)=>gt.findIndex(en=>en.linkId===Bt),Ze=(gt,Bt)=>gt.filter(en=>en.linkId!==Bt).map(en=>en.item&&en.item.length>0?M(v({},en),{item:Ze(en.item,Bt)}):en),Qe=(gt,Bt,en=gt)=>gt.reduce((Rt,Kt)=>{const At=xe(Bt,Kt.linkId);return At?.enableWhen&&!ve(At.enableWhen,At.enableBehavior,en)||(Kt.item&&Kt.item.length>0?Rt.push(M(v({},Kt),{item:Qe(Kt.item,Bt,en)})):Rt.push(Kt)),Rt},[]),et=(gt,Bt,en=[])=>{const Rt=[],Kt=At=>{At.forEach(Je=>{Rt.push(Je.linkId),Je.item&&Je.item.length>0&&Kt(Je.item)})};for(let At=0;At<gt.length;At++){const Je=gt[At];if(Je.linkId===Bt){const zt=gt.slice(0,At+1),Vt=gt.slice(At+1),{kept:vn,removed:rn}=Vt.reduce((hn,kn)=>{const Sr=xe(en,kn.linkId);return!Sr||Ee(Sr)&&ve(Sr.enableWhen,Sr.enableBehavior,zt)?hn.kept.push(kn):hn.removed.push(kn),hn},{kept:[],removed:[]});return Kt(rn),{trimmedData:[...zt,...vn],trimmedLinkIds:Rt,found:!0}}if(Je.item&&Je.item.length>0){const zt=et(Je.item,Bt,en);if(zt.found){const Vt=gt.slice(0,At),vn=gt.slice(At+1),rn=[...Vt,M(v({},Je),{item:zt.trimmedData})],{kept:hn,removed:kn}=vn.reduce((Sr,ur)=>{const Lr=xe(en,ur.linkId);return!Lr||Ee(Lr)&&ve(Lr.enableWhen,Lr.enableBehavior,rn)?Sr.kept.push(ur):Sr.removed.push(ur),Sr},{kept:[],removed:[]});return Kt(kn),{trimmedData:[...rn,...hn],trimmedLinkIds:[...zt.trimmedLinkIds,...Rt],found:!0}}}}return{trimmedData:gt,trimmedLinkIds:[],found:!1}},ct=(gt,Bt)=>gt.filter(en=>!Bt.includes(en.linkId)).map(en=>en.item&&en.item.length>0?M(v({},en),{item:ct(en.item,Bt)}):en),Pt=gt=>{var Bt;if(!gt)return"empty";const en=m.Z$.find(({patterns:Rt})=>Rt.some(Kt=>gt.includes(Kt)));return(Bt=en?.type)!=null?Bt:"empty"},ut=(gt,Bt)=>{const{groupIndices:en}=xn(gt),Rt=gt.findIndex(Kt=>Kt.linkId===Bt);return Rt!==-1?en.indexOf(Rt):-1},ue=gt=>{if(!gt)return{restriction:null,warning:null};const Bt=en=>{const Rt=gt.find(At=>At.url===en&&At.valueString);if(!Rt?.valueString)return null;const Kt=Rt.valueString.replace(/\\n/g,`
869
+ `}}customElements.get(ge)===void 0&&customElements.define(ge,xe);const Ie=[{name:"loader",defaultElement:document.createElement(te)},{name:"error",defaultElement:document.createElement(ge)}],Ee=["error","loading"],De={error:"error",loading:"loader"},ze=({src:Mt,elementNameSuffix:Nt,version:kt,prefetchFeatureApp:Ot})=>(0,g.__awaiter)(void 0,void 0,void 0,function*(){var Ke,Ye,Ft,ot,tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn;window.bwell||(window.bwell=new le({metadata:{version:kt}}));const Bn=`bwell-${Nt}`;if(customElements.get(Bn)!==void 0)return;class xn extends h{constructor(){super(),Ke.add(this),Ye.set(this,(0,x.nanoid)()),Ft.set(this,void 0),ot.set(this,document.createElement("feature-app-loader")),tt.set(this,new k.EventEmitter),qt.set(this,void 0),zn.set(this,void 0),An.set(this,void 0),lt.set(this,void 0),_t.set(this,void 0),dn.set(this,void 0),this.attachShadow({mode:"open"});const Pr=new he(Ie).attachToShadowRoot(this.shadowRoot);Pr.addEventListener("visibilitychange",({visibility:Wt,container:Fe,name:it})=>{it==="error"&&Wt==="visible"&&window.bwell._registerEmbeddableContent(Fe),(0,g.__classPrivateFieldGet)(this,ot,"f").style.display=Wt==="hidden"?"unset":"hidden"}),(0,g.__classPrivateFieldSet)(this,dn,{slots:Pr,attributes:new V().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,tt,"f")},"f"),(0,g.__classPrivateFieldSet)(this,qt,(0,g.__classPrivateFieldGet)(this,Ke,"m",rr).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,zn,(0,g.__classPrivateFieldGet)(this,Ke,"m",Br).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,An,(0,g.__classPrivateFieldGet)(this,Ke,"m",nn).call(this,"error"),"f"),(0,g.__classPrivateFieldSet)(this,lt,(0,g.__classPrivateFieldGet)(this,Ke,"m",nn).call(this,"loading"),"f")}connectedCallback(){return(0,g.__awaiter)(this,void 0,void 0,function*(){(0,g.__classPrivateFieldGet)(this,An,"f").call(this,(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get("error")),(0,g.__classPrivateFieldGet)(this,lt,"f").call(this,(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get("loading")),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.addEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,zn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.addChangeListener("loading",(0,g.__classPrivateFieldGet)(this,lt,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("error")}(0,g.__classPrivateFieldSet)(this,Ye,this.id||(0,g.__classPrivateFieldGet)(this,Ye,"f"),"f"),(0,g.__classPrivateFieldSet)(this,Ft,new T((0,g.__classPrivateFieldGet)(this,Ye,"f")),"f"),(0,g.__classPrivateFieldGet)(this,Ft,"f").registerDispatcher(Pr=>this.dispatchEvent(Pr)),window.bwell.isInitialized?(0,g.__classPrivateFieldGet)(this,qt,"f").call(this):(window.bwell.once("initialized",(0,g.__classPrivateFieldGet)(this,qt,"f")),window.bwell.once("error",()=>{(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("error")}),Ot&&(0,A.h)(Mt).catch(()=>{(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Pr;(0,g.__classPrivateFieldGet)(this,tt,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,zn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,lt,"f")),(Pr=(0,g.__classPrivateFieldGet)(this,Ft,"f"))===null||Pr===void 0||Pr.deregister(),(0,g.__classPrivateFieldGet)(this,tt,"f").removeAllListeners()}}Ye=new WeakMap,Ft=new WeakMap,ot=new WeakMap,tt=new WeakMap,qt=new WeakMap,zn=new WeakMap,An=new WeakMap,lt=new WeakMap,_t=new WeakMap,dn=new WeakMap,Ke=new WeakSet,rr=function(){(0,g.__classPrivateFieldGet)(this,ot,"f").setAttribute("featureAppId",`bwell-embeddable:${Bn}`),(0,g.__classPrivateFieldGet)(this,ot,"f").setAttribute("src",Mt),(0,g.__classPrivateFieldGet)(this,ot,"f").config={id:(0,g.__classPrivateFieldGet)(this,Ye,"f"),name:Nt,elementName:Bn,utils:(0,g.__classPrivateFieldGet)(this,dn,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,ot,"f"))},Br=function({visibility:Pr,name:Wt}){(0,g.__classPrivateFieldGet)(this,ot,"f").style.display=Pr==="hidden"?"unset":"hidden"},jt=function(Pr){(0,g.__classPrivateFieldGet)(this,_t,"f")(),(0,g.__classPrivateFieldSet)(this,_t,void 0,"f")},nn=function(Pr){return Wt=>{const Fe=Ee.findIndex(Ze=>Ze===Pr);if(!Ee.slice(0,Fe).some(Ze=>(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get(Ze)!==null)){if(Wt!==null)(0,g.__classPrivateFieldGet)(this,_t,"f")&&(0,g.__classPrivateFieldGet)(this,Ke,"m",jt).call(this,Pr),(0,g.__classPrivateFieldSet)(this,_t,(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlotLocked(De[Pr]),"f");else if(Wt===null&&(0,g.__classPrivateFieldGet)(this,_t,"f")){(0,g.__classPrivateFieldGet)(this,Ke,"m",jt).call(this,Pr);const Ze=Ee.find(Qe=>(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.get(Qe)!==null);Ze&&(0,g.__classPrivateFieldSet)(this,_t,(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlotLocked(De[Ze]),"f")}}}},customElements.define(Bn,xn)}),We={rE:"1.1169.1"},st="composite";var ft=e(67321);ze({src:`https://embeddables.prod.icanbwell.com/${st}/${We.rE}/scripts/embeddable.federated.js`,elementNameSuffix:st,version:We.rE,prefetchFeatureApp:!0})},79566:(Y,s,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),l=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,b=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(A,h,d)=>h in A?i(A,h,{enumerable:!0,configurable:!0,writable:!0,value:d}):A[h]=d,p=(A,h)=>{for(var d in h||(h={}))u.call(h,d)&&m(A,d,h[d]);if(c)for(var d of c(h))y.call(h,d)&&m(A,d,h[d]);return A},f=(A,h)=>a(A,b(h));const O=(A,h,d)=>{const v=_.cloneDeep(A);if(!v.contained||h<0)return v;const M=v.contained.findIndex(S=>S.resourceType==="Questionnaire");if(M!==-1&&!d){const S=v.contained[M];if(S.item){if(!S.item.some(C=>isPageExtensionPresent(C)))return v;let x=0,z=S.item.length;for(let C=0;C<S.item.length;C++){const E=S.item[C];if(isPageExtensionPresent(E)){if(x===h+1){z=C;break}x++}}S.item=S.item.slice(0,z),v.contained[M]=S}}else d&&M!==-1&&(v.contained[M]=f(p({},v.contained[M]),{item:d}));return v},g=({formId:A,questionnaireResponse:h,showQuestionPrefix:d,nextQuestion:v,onGoBack:M,handleHiddenQuestion:S,errorConfig:T,onClearError:x,customErrorConfigurations:z,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:L,className:P,children:D})=>{var N,w,V;const{currentGroupIndex:k,hasCustomError:I}=useFHIRQuestionnaire(),G=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(X=>X.id===G&&X.resourceType==="Questionnaire"),F=(X,q,ae)=>{let se=_.cloneDeep(h);se.item=X,se=trimQuestionnaireItems(se,k,ae),v(se,q)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,P),children:jsx(FHIRQuestionnaire,{formId:A,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:d,errorConfig:T,customErrorConfigurations:z,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:x,handleHiddenQuestion:S,showStepper:C,hideBackButton:E,externalComponentRenderMap:L,children:D})})}},19622:(Y,s,e)=>{"use strict";e.d(s,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),l=e(76323),o=e(36087),i=e(56192),a=e(76808),b=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,O=(M,S,T)=>S in M?c(M,S,{enumerable:!0,configurable:!0,writable:!0,value:T}):M[S]=T,g=(M,S)=>{for(var T in S||(S={}))p.call(S,T)&&O(M,T,S[T]);if(m)for(var T of m(S))f.call(S,T)&&O(M,T,S[T]);return M},A=(M,S)=>u(M,y(S)),h=(M,S,T)=>new Promise((x,z)=>{var C=L=>{try{R(T.next(L))}catch(P){z(P)}},E=L=>{try{R(T.throw(L))}catch(P){z(P)}},R=L=>L.done?x(L.value):Promise.resolve(L.value).then(C,E);R((T=T.apply(M,S)).next())});const d=10,v=({id:M="location-filter-desktop",initialValue:S,onInputChange:T,onValueChange:x,isDisabled:z=!1,className:C="",setIsLoading:E,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,b.E_)({keys:["shared-translations"]}),N=S?.placeId,w=S?.description,[V,k]=(0,t.useState)(""),[I,G]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[X,q]=(0,t.useState)(null),[ae,se]=(0,t.useState)(!1),ne=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ve,ye]=(0,t.useState)(he),[Ae,J]=(0,t.useState)(he),[oe,{loading:me,error:ce}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:le,error:te}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[re,{loading:ge,error:xe}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),ye(he)},onCompleted:kt=>{var Ot,Ke;const Ye=(Ke=(Ot=kt.placeAutocomplete)==null?void 0:Ot.predictions)==null?void 0:Ke.map(Ft=>{var ot;return{id:Ft.placeId,label:(0,l.removeAfterLastComma)(Ft.description),mainText:Ft?.mainText||((ot=Ft.description.split(",")[0])==null?void 0:ot.trim()),secondaryText:(0,l.removeAfterLastComma)(Ft?.secondaryText||Ft.description.split(",").slice(1).join(",").trim())}});ye(Ye?.length?Ye:he)}}),Ie=(0,t.useMemo)(()=>ve.map(kt=>A(g({},kt),{displayLabel:(0,r.RZ)(kt?.label||"",V)})),[V,ve]),Ee=kt=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn;if(F(kt),q(kt),se(!1),kt&&typeof kt=="string"){const Bn=ve.find(Qe=>Qe.id===kt),xn=Bn?.label||V;if(!Bn)return;k(xn),G(xn),setTimeout(()=>{const Qe=[{id:Bn.id,label:Bn.label}];ye(Qe),J(Qe)},d);const Nr=yield oe({variables:{placeId:kt}}),Pr=(Ke=(Ot=Nr?.data)==null?void 0:Ot.geocodingByPlaceId)==null?void 0:Ke.latitude,Wt=(Ft=(Ye=Nr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Ft.longitude,Fe=((tt=(ot=Nr?.data)==null?void 0:ot.geocodingByPlaceId)==null?void 0:tt.zipCode)||"",it=((zn=(qt=Nr?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:zn.state)||"",Ze=((lt=(An=Nr?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(Pr&&Wt)if(!Fe||!Ze){const Qe=yield de({variables:{latitude:String(Pr),longitude:String(Wt)}}),et=((dn=(_t=Qe?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",ct=((Br=(rr=Qe?.data)==null?void 0:rr.geocodingByLatLon)==null?void 0:Br.state)||"",Pt=((nn=(jt=Qe?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:Pr,longitude:Wt,zipCode:et,state:ct,stateCode:Pt,placeId:kt,description:xn,value:kt})}else x({latitude:Pr,longitude:Wt,zipCode:Fe,state:it,stateCode:Ze,placeId:kt,description:xn,value:kt});else se(!0)}}),De=()=>!0,ze=(0,l.useDebounce)(kt=>h(void 0,null,function*(){return yield re({variables:{input:kt,types:"geocode"}})})),We=kt=>h(void 0,null,function*(){if(se(!1),k(kt),T?.(kt),!kt||kt.trim().length===0){F(null),ye(he),x({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:kt});return}const Ot=kt.trim();Ot.length>=2?yield ze(Ot):ye(he)}),st=kt=>{ne.current=kt},ft=()=>{k(I),ye(Ae),F(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn;if(N&&w){ye([{id:N,label:V||w}]),J([{id:N,label:V||w}]),F(N),q(N),k(w),G(w),w===V&&k(w);const Bn=yield oe({variables:{placeId:N}}),xn=(Ke=(Ot=Bn?.data)==null?void 0:Ot.geocodingByPlaceId)==null?void 0:Ke.latitude,Nr=(Ft=(Ye=Bn?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Ft.longitude,Pr=((tt=(ot=Bn?.data)==null?void 0:ot.geocodingByPlaceId)==null?void 0:tt.zipCode)||"",Wt=((zn=(qt=Bn?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:zn.state)||"",Fe=((lt=(An=Bn?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(xn&&Nr)if(!Pr||!Wt||!Fe){const it=yield de({variables:{latitude:String(xn),longitude:String(Nr)}}),Ze=((dn=(_t=it?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",Qe=((Br=(rr=it?.data)==null?void 0:rr.geocodingByLatLon)==null?void 0:Br.state)||"",et=((nn=(jt=it?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:xn,longitude:Nr,zipCode:Ze,state:Qe,stateCode:et,placeId:N,description:w,value:N})}else x({latitude:xn,longitude:Nr,zipCode:Pr,state:Wt,stateCode:Fe,placeId:N,description:w,value:N})}else F(null),q(null),k(""),G(""),ye(he),J(he)}))()},[]);const Mt=ae||!!ce||!!te||!!xe||!!R,Nt=Mt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||D)},[E,me,le,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:z,inputValue:V,isLoading:ge||me||le,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Ie,selectedKey:U,onSelectionChange:Ee,onInputChange:We,defaultFilter:De,onOpenChange:st,onBlur:ft,isInvalid:Mt,hint:Nt,autoComplete:"address-line1",className:"w-full",children:kt=>{const Ot=kt,Ke=V.trim().length>=2,Ye=Ot.mainText||"",Ft=Ot.secondaryText||"",ot=Ye.trim().length>0,tt=Ft.trim().length>0,qt=ot?(0,r.RZ)(Ye,V):{beforePart:"",highlightedPart:"",remainingPart:""},zn=tt?(0,r.RZ)(Ft,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ot.id,supportingText:Ot.supportingText,isDisabled:Ot.isDisabled,icon:Ot.icon,avatarUrl:Ot.avatarUrl,textValue:Ot.label,children:Ke&&ot?(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:qt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:qt.highlightedPart}),(0,n.jsx)("span",{children:qt.remainingPart})]}),tt&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:zn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:zn.highlightedPart}),(0,n.jsx)("span",{children:zn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ot.label})})}})})}},18077:()=>{},12200:(Y,s,e)=>{"use strict";e.d(s,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(s,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(s,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(s,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(s,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(s,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(s,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,s,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const l=({icon:o,title:i})=>{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:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,s,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),l=e(64081),o=e(62754);const i=({className:a})=>{const{pathname:b}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:m,i18n:{t:p}}=useI18nChild({keys:["shared"]}),f=getPathSegments(b).flatMap(O=>{const g=c.getId(O),A=c.getRouteMeta(g)||{},h=getBreadcrumbTitleKey(g,A,u);if(!h||A.breadcrumbHide)return[];const d=y[g];let v=c.getHref(g),M=h;return d&&(d.href?v=d.href:d.search&&(v=c.getHref({id:g,search:d.search})),d.titleKey&&(M=d.titleKey)),[{routeId:g,href:v,label:p(M),onClick:d?.onClick}]});return m||f.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:f.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,s,e)=>{"use strict";e.d(s,{rJ:()=>C,GU:()=>z});var n=e(31085),t=e(14041),r=e(76323),l=e(78579),o=e(76808),i=e(5380),a=e(87896),b=e(26877);const c=(E,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),E)),u=(E,R,L)=>Promise.race([E,c(R,L)]),y=5e3,m=1e4;var p=Object.defineProperty,f=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(E,R,L)=>R in E?p(E,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[R]=L,v=(E,R)=>{for(var L in R||(R={}))A.call(R,L)&&d(E,L,R[L]);if(g)for(var L of g(R))h.call(R,L)&&d(E,L,R[L]);return E},M=(E,R)=>f(E,O(R)),S=(E,R,L)=>new Promise((P,D)=>{var N=k=>{try{V(L.next(k))}catch(I){D(I)}},w=k=>{try{V(L.throw(k))}catch(I){D(I)}},V=k=>k.done?P(k.value):Promise.resolve(k.value).then(N,w);V((L=L.apply(E,R)).next())});const T={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},x=(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)}),z=()=>(0,t.useContext)(x),C=({children:E})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,o.Ul)(),{geolocation:D}=(0,l.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,G]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[X,q]=(0,t.useState)(),[ae,se]=(0,t.useState)(!1),ne=(0,t.useCallback)(ge=>{F(ge);try{w(M(v({},k.current),{locationPermission:ge||i.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?P?.error(xe,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,P]),he=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,P]),ve=(0,t.useCallback)(ge=>S(void 0,null,function*(){const xe=D.getCurrentPosition(ge).then(Ie=>{if(!Ie||!Ie.coords)throw new Error("Location data is invalid or unavailable");return Ie});try{return yield u(xe,y,"Location request timed out. Please check that location services are enabled.")}catch(Ie){throw Ie instanceof Error&&P?.error(Ie,"Geolocation timeout or error"),Ie}}),[D,P]),ye=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),Ae=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(D.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[D]),J=(0,t.useCallback)(()=>S(void 0,null,function*(){try{if(!(yield he()))return P?.error("Location services not available"),!1;const xe=yield ye();return xe!==i.Ef.GRANTED&&xe!==i.Ef.PROMPT?(P?.error(`Location permission not granted: ${xe}`),!1):!0}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[he,P,ye]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>S(void 0,null,function*(){const xe=N.locationPermission;if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){F(xe);return}G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}if(xe===i.Ef.GRANTED){try{const De=yield ye();if(De===i.Ef.GRANTED){const ze=yield ve(T);ze&&(q(ze),ne(i.Ef.GRANTED))}else De===i.Ef.PROMPT?(ne(De),se(!0)):ne(De)}catch(De){De instanceof Error?P?.error(De,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(De)}`),ne(i.Ef.UNAVAILABLE)}return}const Ee=yield ye();if(ne(Ee),Ee===i.Ef.GRANTED)try{const De=yield ve(T);De?q(De):ne(i.Ef.UNAVAILABLE)}catch(De){De instanceof Error?P?.error(De,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(De)}`),ne(i.Ef.UNAVAILABLE)}else Ee===i.Ef.PROMPT&&se(!0)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(Ie)}`),ne(i.Ef.UNAVAILABLE)}finally{G(!1)}}))()},[]);const oe=(0,t.useCallback)(()=>S(void 0,null,function*(){try{if(!(yield J())){ne(i.Ef.UNAVAILABLE);return}G(!0);let xe=yield ye();if(ne(xe),xe===i.Ef.GRANTED||xe===i.Ef.PROMPT){if(L==="Android"&&xe===i.Ef.GRANTED)try{xe=yield Ae(),ne(xe)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(Ie)}`);return}if(xe!==i.Ef.UNAVAILABLE){const Ie=yield ve(T);return q(Ie),Ie}}return}catch(ge){ne(i.Ef.UNAVAILABLE),ge instanceof Error?P?.error(ge,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{G(!1)}}),[J,P,L,ne,ve,ye,Ae]),me=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return(yield he())?yield ye():i.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ge)}`),i.Ef.UNAVAILABLE}}),[he,P,ye]),ce=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield ye();ne(xe)}catch(ge){ge instanceof Error?P?.error(ge,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE)}finally{G(!1)}}),[he,P,ne,ye]),de=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield ye();if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){ne(xe);return}const Ie=yield Ae();if(ne(Ie),["granted","prompt"].includes(Ie)){const Ee=yield ve(T);return q(Ee),Ee}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||P?.error(ge,"Error requesting location");else{const xe=ge&&typeof ge=="object"&&"message"in ge?ge.message:JSON.stringify(ge);xe?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${xe}`)}ne(i.Ef.UNAVAILABLE);return}finally{G(!1)}}),[he,P,ne,ve,Ae,ye]),le=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield ve(T);xe&&(q(xe),F(i.Ef.GRANTED),w(M(v({},k.current),{location:`${xe.coords.latitude},${xe.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${xe.coords.latitude}`,lng:`${xe.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?P?.error(ge,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE),ge}finally{G(!1)}}),[he,P,w,ne,ve]),te=(0,t.useCallback)(()=>S(void 0,null,function*(){try{G(!0);const ge=yield oe();ge&&w(M(v({},k.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?P?.error(ge,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{G(!1)}}),[P,U,oe,w]),re=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:F,position:X,refreshPosition:oe,requestPosition:de,requestCurrentLocation:le,checkAndSetLocationPermission:ce,checkLocaitonPermission:me}),[I,te,U,X,oe,de,le,ce,me]);return(0,n.jsxs)(x.Provider,{value:re,children:[ae&&(0,n.jsx)(b.J,{isOpen:ae,onClose:()=>se(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},82825:(Y,s,e)=>{"use strict";e.d(s,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,s,e)=>{"use strict";e.d(s,{pc:()=>Pt,GI:()=>ye,rz:()=>_t,Cq:()=>X,Fp:()=>lt,el:()=>An,ao:()=>zn,oA:()=>D,Yt:()=>ut,Nu:()=>un,g4:()=>qt,tn:()=>Te,n4:()=>N,gD:()=>P,Vp:()=>et,Cx:()=>G,bK:()=>k,gi:()=>ct,Z$:()=>de,GT:()=>Qe,hr:()=>le,JL:()=>te,Ck:()=>I,dU:()=>V,wG:()=>xn,hZ:()=>nn,$e:()=>dn,qT:()=>jt,GQ:()=>Br,q3:()=>Bn,D_:()=>rr,Uf:()=>F,_l:()=>J,Md:()=>se,V7:()=>ae,fe:()=>me,JP:()=>sn,Z_:()=>w,zO:()=>ce,UZ:()=>he,$7:()=>Ye,rb:()=>q,_W:()=>ot,WS:()=>Ft,VF:()=>it,vf:()=>Pr,PV:()=>Ze,PS:()=>Nr,Iz:()=>Fe,zD:()=>ne,m3:()=>Nt,XP:()=>kt,PM:()=>Ee,cX:()=>re,G6:()=>ge,Us:()=>ze,AA:()=>Ie,G0:()=>Mt,mO:()=>st,HH:()=>De,PU:()=>Ve,it:()=>Ke,Tl:()=>ft,uH:()=>Ot,c3:()=>xe,rx:()=>L});var n=e(36087),t=e(14041);const r=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 l=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));l.displayName="UserCheck02";const o=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 b=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));b.displayName="Users01";const c=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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),m=e(9495);const p=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));p.displayName="Hash01";const f=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));f.displayName="Hash02";const O=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 g=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));g.displayName="Virus";const A=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));A.displayName="CreditCard02";const h=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 d=e(85418);const v=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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 4m1 11 2 2 4.5-4.5M9.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="ClipboardCheck";const M=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));M.displayName="ClipboardPlus";const S=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},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"}));S.displayName="Route";const T=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));T.displayName="Briefcase01";const x=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));x.displayName="Translate01";const z=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));z.displayName="AnnotationQuestion";const C=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const E=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));E.displayName="Shield01";const R=({size:Jt=24,color:Fn="currentColor",...gr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Jt,height:Jt,stroke:Fn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...gr},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const L=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,P="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",k="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",G="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",F="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",X="http://icanbwell.com/fhir/StructureDefinition/questionnaire-edit-return-to-group",q="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",se="http://hl7.org/fhir/StructureDefinition/entryFormat",ne="http://hl7.org/fhir/StructureDefinition/tz-code",he="tz-code",ve="footer",ye="check-box",Ae="header",J="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",ce="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",de=[{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"}],le={"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"},te={"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"},re="ui-toolkit/CoordinatePicker",ge="ui-toolkit/DetailsInfo",xe="ui-toolkit/ServiceChoice",Ie="ui-toolkit/InfoBanner",Ee="ui-toolkit/Button",De="ui-toolkit/Phone",ze="ui-toolkit/ErrorCard",We="ui-toolkit/FormContainer",st="ui-toolkit/PageHeader",ft="ui-toolkit/SelectableOption",Mt="ui-toolkit/Modal",Nt="ui-toolkit/Alert",kt="ui-toolkit/AppSectionAccess",Ot="ui-toolkit/SensitiveDataCategory",Ke="ui-toolkit/QuestCard",Ye="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ft="http://icanbwell.com/fhir/StructureDefinition/text-align",ot={LEFT:"left",CENTER:"center"},tt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},qt="http://icanbwell.com/fhir/StructureDefinition/icon-name",zn="http://icanbwell.com/fhir/StructureDefinition/error-title",An="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",lt="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",_t="http://icanbwell.com/fhir/StructureDefinition/description",dn="http://icanbwell.com/fhir/StructureDefinition/modal-description",rr="http://icanbwell.com/fhir/StructureDefinition/modal-title",Br="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",jt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",nn="http://icanbwell.com/fhir/StructureDefinition/button-text",Bn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",xn="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Nr="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Pr="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Wt="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",it="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ze="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Qe="http://hl7.org/fhir/StructureDefinition/mimeType",et="http://hl7.org/fhir/StructureDefinition/maxSize",ct="http://icanbwell.com/fhir/StructureDefinition/message-severity",Pt="http://icanbwell.com/fhir/StructureDefinition/alert-color",ut="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ue="http://icanbwell.com/fhir/StructureDefinition/placeholder",Ce="http://icanbwell.com/fhir/StructureDefinition/hint-text",Ve="ui-toolkit/PrefilledMemberDemographicsAlert",Te="http://hl7.org/fhir/issue-severity",It="http://icanbwell.com/fhir/StructureDefinition/button-type",Yt="http://icanbwell.com/fhir/StructureDefinition/button-action",yn="button-type",qn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",pr="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ht="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Xe="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Dt={},sn={"user-check":r,"user-check-02":l,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":b,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:m.X,hash:p,"hash-02":f,"folder-heart":n.FolderHeart,"medical-cross":O,virus:g,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":A,"link-03":h,"search-lg":d.q,"clipboard-check":v,"clipboard-plus":M,route:S,"briefcase-01":T,"translate-01":x,"annotation-question":z,"globe-05":C,"shield-01":E,"upload-01":R},un="http://icanbwell.com/fhir/StructureDefinition/questionnaire-hideRequiredIndicator"},25624:(Y,s,e)=>{"use strict";e.d(s,{$H:()=>N,$O:()=>ft,AT:()=>pr,CP:()=>dn,Fy:()=>_t,GN:()=>ve,J4:()=>Pt,MU:()=>q,Nw:()=>Ze,Qr:()=>C,Ue:()=>ut,Yo:()=>xe,a0:()=>x,cz:()=>E,di:()=>I,eC:()=>ue,iI:()=>G,lv:()=>k,mR:()=>qn,nt:()=>z,od:()=>V,t7:()=>Mt,u0:()=>S,yQ:()=>yn,zj:()=>le});var n=e(17637),t=e(43915),r=e(37234),l=e(65328),o=e(91595),i=e(27779),a=e.n(i),b=e(45250),c=e.n(b),u=e(16681),y=e(18807),m=e(1053),p=Object.defineProperty,f=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(gt,Bt,en)=>Bt in gt?p(gt,Bt,{enumerable:!0,configurable:!0,writable:!0,value:en}):gt[Bt]=en,v=(gt,Bt)=>{for(var en in Bt||(Bt={}))A.call(Bt,en)&&d(gt,en,Bt[en]);if(g)for(var en of g(Bt))h.call(Bt,en)&&d(gt,en,Bt[en]);return gt},M=(gt,Bt)=>f(gt,O(Bt));const S=(gt,Bt,en,Rt)=>{if(gt){const Kt=gt(Bt,v({defaultValue:en},Rt));if(Kt&&Kt!==Bt)return Kt}return Rt?Object.entries(Rt).reduce((Kt,[At,Je])=>Kt.replace(`{{${At}}}`,String(Je)),en):en},T=gt=>{var Bt;return(Bt=gt.filter(en=>en.url.includes("questionnaire-itemControl")).flatMap(en=>{var Rt,Kt;return(Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)!=null?Kt:[]}).find(en=>{var Rt;return(Rt=en.code)==null?void 0:Rt.startsWith("ui-toolkit/")}))==null?void 0:Bt.code},x=gt=>{var Bt;const en=(Bt=gt.extension)==null?void 0:Bt.find(Rt=>Rt.url===m.V7);return en?.valueCode||"off"},z=(gt,Bt,en)=>{const Rt=(0,y.A)(en);return gt&&Bt&&en?Rt.replace("<p>",`<span>${Bt} `).replace("</p>","</span>").trim():Rt.replace("<p>","<span>").replace("</p>","</span>").trim()},C=gt=>{const Bt=gt?.find(en=>en.url===m.Vp);return Bt?.valueInteger},E=gt=>{const Bt=gt?.find(en=>en.url===m.Z_);return Bt?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},L="Type your response here...",P=(gt,Bt)=>{const en=gt?.find(Rt=>Rt.url===PLACEHOLDER_EXTENSION_URL);return en?.valueString||Bt&&R[Bt]||L},D=gt=>{const Bt=gt?.find(en=>en.url===HINT_TEXT_EXTENSION_URL);return Bt?.valueString},N=gt=>{const Bt=gt?.filter(en=>en.url===m.GT&&en.valueCode).map(en=>m.hr[en.valueCode]||en.valueCode);return Bt?.length?Bt.join(","):void 0},w=gt=>gt.split(",").map(Rt=>Rt.trim()).map(Rt=>m.JL[Rt]||Rt).filter((Rt,Kt,At)=>At.indexOf(Rt)===Kt).join(", "),V=(gt,Bt,en)=>{const Rt=w(gt),Kt=Rt.lastIndexOf(","),At=Kt!==-1?`${Rt.substring(0,Kt)} or${Rt.substring(Kt+1)}`:Rt,Je=[Bt&&`max. ${parseFloat((Bt/(1e3*1e3)).toFixed(1))}MB`,en&&`upto ${en} file${en>1?"s":""}`].filter(Boolean);return Je.length>0?`${At} (${Je.join(", ")})`:At},k=gt=>{const Bt=gt?.find(en=>en?.url===m.zD||en?.url===m.UZ);return Bt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(gt,Bt)=>{var en,Rt,Kt;const At=Bt?.find(Je=>Je.url.includes(gt));return(Kt=(Rt=(en=At?.valueInteger)!=null?en:At?.valueDecimal)!=null?Rt:At?.valueString)!=null?Kt:At?.valueDate},G=gt=>{if(!!gt){if(/^\d{4}-\d{2}-\d{2}$/.test(gt))return gt;try{const Bt=(0,i.evaluate)({},gt);if(Array.isArray(Bt)&&Bt.length>0){const en=Bt[0];if(en instanceof Date&&!isNaN(en.getTime())){const Rt=en.getFullYear(),Kt=String(en.getMonth()+1).padStart(2,"0"),At=String(en.getDate()).padStart(2,"0");return`${Rt}-${Kt}-${At}`}if(typeof en=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(en))return en}}catch{}}},U=(gt,Bt)=>{var en,Rt;const Kt=Bt?.find(Je=>Je.url===gt);if(!Kt)return;const At=(en=Kt.valueString)!=null?en:Kt.valueDate;return At||G((Rt=Kt.valueExpression)==null?void 0:Rt.expression)},F=(gt,Bt)=>{if(!(!gt||gt.length===0))for(const en of gt){const Rt=I(Bt,en.extension);if(Rt!==void 0)return Rt;if(en.item&&en.item.length>0){const Kt=F(en.item,Bt);if(Kt!==void 0)return Kt}}},X=(gt,Bt)=>{try{const en=String(gt??Bt);let Rt;if(en.includes("/"))Rt=(0,n.A)(en,"MM/dd/yyyy",new Date);else{const Kt=en.split("T")[0];Rt=(0,t.A)(Kt)}return(0,r.A)(Rt)}catch(en){return console.error("Date parsing error:",en,gt),null}},q=(gt,Bt)=>{var en;for(const Rt of gt){if(Rt.linkId===Bt)return Rt;if((en=Rt.item)!=null&&en.length){const Kt=q(Rt.item,Bt);if(Kt!==void 0)return Kt}}},ae=(gt,Bt)=>{var en;const Rt=[];for(const Kt of gt)if(Kt.linkId===Bt&&Rt.push(Kt),(en=Kt.item)!=null&&en.length){const At=ae(Kt.item,Bt);Rt.push(...At)}return Rt},se=(gt,Bt,en=0)=>ae(gt,Bt)[en];function ne(gt){return gt!=null}const he=(gt,Bt)=>{var en,Rt,Kt;if("answerString"in gt&&ne(gt.answerString)){if(gt.operator==="=")return Bt?.valueString===gt.answerString;if(gt.operator==="!=")return Bt?.valueString!==gt.answerString}if("answerBoolean"in gt&&ne(gt.answerBoolean)){if(gt.operator==="=")return Bt?.valueBoolean===gt.answerBoolean;if(gt.operator==="!=")return Bt?.valueBoolean!==gt.answerBoolean}if("answerInteger"in gt&&ne(gt.answerInteger)||"answerDecimal"in gt&&ne(gt.answerDecimal)){const At=Number(Bt?.valueInteger||Bt?.valueDecimal),Je=Number(gt.answerInteger||gt.answerDecimal);if(gt.operator==="=")return At===Je;if(gt.operator==="!=")return At!==Je;if(gt.operator===">")return At>Je;if(gt.operator==="<")return At<Je;if(gt.operator===">=")return At>=Je;if(gt.operator==="<=")return At<=Je}if("answerQuantity"in gt&&ne(gt.answerQuantity)){const At=Bt?.valueQuantity,Je=gt.answerQuantity;if(At?.unit!==Je?.unit)return!1;if(gt.operator==="=")return At.value===Je.value;if(gt.operator==="!=")return At.value!==Je.value;if(gt.operator===">")return At.value>Je.value;if(gt.operator==="<")return At.value<Je.value;if(gt.operator===">=")return At.value>=Je.value;if(gt.operator==="<=")return At.value<=Je.value}if("answerCoding"in gt&&ne(gt.answerCoding)){const At=Bt?.valueCoding,Je=gt.answerCoding;if(gt.operator==="=")return At?.code===Je.code;if(gt.operator==="!=")return At?.code!==Je.code}if("answerReference"in gt&&ne(gt.answerReference)){const At=Bt?.valueReference,Je=gt.answerReference;if(gt.operator==="=")return At?.reference===Je.reference;if(gt.operator==="!=")return At?.reference!==Je.reference}if("answerDate"in gt&&ne(gt.answerDate)||"answerDateTime"in gt&&ne(gt.answerDateTime)||"answerTime"in gt&&ne(gt.answerTime)){const At=new Date((Kt=(Rt=(en=Bt?.valueDate)!=null?en:Bt?.valueDateTime)!=null?Rt:Bt?.valueTime)!=null?Kt:""),Je=new Date(gt.answerDate||gt.answerDateTime||gt.answerTime||"");if(gt.operator==="=")return At.getTime()===Je.getTime();if(gt.operator==="!=")return At.getTime()!==Je.getTime();if(gt.operator===">")return At.getTime()>Je.getTime();if(gt.operator==="<")return At.getTime()<Je.getTime();if(gt.operator===">=")return At.getTime()>=Je.getTime();if(gt.operator==="<=")return At.getTime()<=Je.getTime()}return gt.operator==="exists"?Bt!=null===gt.answerBoolean:!0},ve=(gt,Bt,en)=>{const Rt=Kt=>{const At=ae(en,Kt.question);return At.length===0||At.every(Je=>!Je.answer||Je.answer.length===0)?he(Kt,void 0):At.some(Je=>{var zt;return(zt=Je.answer)==null?void 0:zt.some(Vt=>he(Kt,Vt&&Object.keys(Vt).length>0?Vt:void 0))})};return gt&&gt?.length>0?Bt==="any"?gt?.some(Kt=>Rt(Kt)):gt?.every(Kt=>Rt(Kt)):!0},ye=(gt,Bt,en,Rt,Kt)=>{if(!gt||gt.length===0)return!0;const At=Je=>{var zt;let Vt;if(Rt&&typeof Kt=="number"){const rn=en.filter(hn=>hn.linkId===Rt)[Kt];if(rn?.item){const hn=rn.item.find(kn=>kn.linkId===Je.question);if(hn?.answer&&hn.answer.length>0)return(zt=hn?.answer)==null?void 0:zt.some(kn=>he(Je,kn&&Object.keys(kn).length>0?kn:void 0))}}if(!Vt){const vn=ae(en,Je.question);if(vn.length>0)return vn.some(rn=>{var hn;return(hn=rn.answer)==null?void 0:hn.some(kn=>he(Je,kn&&Object.keys(kn).length>0?kn:void 0))});Vt=void 0}return he(Je,Vt)};return Bt==="any"?gt.some(Je=>At(Je)):gt.every(Je=>At(Je))},Ae=(gt,Bt)=>{var en;if(!!((en=gt?.valueExpression)!=null&&en.expression))try{const Rt=evaluate(Bt,gt.valueExpression.expression);return Array.isArray(Rt)?Rt.some(Kt=>Boolean(Kt)):Boolean(Rt)}catch{return}},J=(gt,Bt)=>{var en;const Rt=(en=gt.extension)==null?void 0:en.find(At=>At.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Kt=Ae(Rt,Bt);return M(v({},gt),{readOnly:Kt??gt.readOnly})},oe=(gt,Bt,en,Rt)=>{const{required:Kt,maxLength:At,type:Je,extension:zt,enableWhen:Vt,enableBehavior:vn,repeats:rn,answerOption:hn}=gt;if(!ve(Vt,vn,Bt)||gt.type==="group"||gt.type==="display")return"";if(rn)return me(gt,Bt,en,Rt);const kn=te(gt,Bt);return kn&&re(kn,gt)?ge(gt,Bt,en,kn,Rt):le(zt,Je,Kt,At,en,hn,Rt)},me=(gt,Bt,en,Rt)=>{const{required:Kt}=gt;if(Kt){if(!en||en.length===0)return S(Rt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let At=!1;for(let Je=0;Je<en.length;Je++){const zt=en[Je];if(zt&&Object.keys(zt).length>0&&Object.values(zt).some(vn=>vn!=null&&vn!==""&&(Array.isArray(vn)?vn.length>0:!0))){At=!0;const vn=le(gt.extension,gt.type,!0,gt.maxLength,[zt],gt.answerOption,Rt);if(vn)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Je+1,error:vn});if(gt.item&&gt.item.length>0){const rn=ce(gt.item,Bt,gt.linkId,Je,Rt);if(rn)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Je+1,error:rn})}}else return S(Rt,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Je+1})}if(!At)return S(Rt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(en&&en.length>0)for(let At=0;At<en.length;At++){const Je=en[At];if(Je&&Object.keys(Je).length>0&&Object.values(Je).some(Vt=>Vt!=null&&Vt!==""&&(Array.isArray(Vt)?Vt.length>0:!0))){const Vt=le(gt.extension,gt.type,!1,gt.maxLength,[Je],gt.answerOption,Rt);if(Vt)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:At+1,error:Vt});if(gt.item&&gt.item.length>0){const vn=ce(gt.item,Bt,gt.linkId,At,Rt);if(vn)return S(Rt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:At+1,error:vn})}}}return""},ce=(gt,Bt,en,Rt,Kt)=>{var At,Je;for(const zt of gt){if(!ye(zt.enableWhen,zt.enableBehavior,Bt,en,Rt))continue;const Vt=q(Bt,en),vn=(At=Vt?.item)==null?void 0:At.find(hn=>hn.linkId===zt.linkId),rn=(Je=vn?.answer)!=null&&Je[Rt]?[vn.answer[Rt]]:void 0;if(zt.required){if(!rn||!rn[0]||!de(rn[0]))return S(Kt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:zt.text||zt.linkId});const hn=le(zt.extension,zt.type,!0,zt.maxLength,rn,zt.answerOption,Kt);if(hn)return`${zt.text||zt.linkId}: ${hn}`}else if(rn&&rn[0]&&de(rn[0])){const hn=le(zt.extension,zt.type,!1,zt.maxLength,rn,zt.answerOption,Kt);if(hn)return`${zt.text||zt.linkId}: ${hn}`}if(zt.item&&zt.item.length>0){const hn=ce(zt.item,Bt,zt.linkId,Rt,Kt);if(hn)return hn}}return""},de=gt=>!gt||Object.keys(gt).length===0?!1:Object.values(gt).some(Bt=>Bt!=null&&Bt!==""&&(Array.isArray(Bt)?Bt.length>0:!0)),le=(gt,Bt,en,Rt,Kt,At,Je)=>{var zt,Vt,vn,rn,hn;let kn="";const Sr=!!gt?.find(yo=>{var Wo,Do;return yo.url===m.gD&&((Do=(Wo=yo.valueCodeableConcept)==null?void 0:Wo.coding)==null?void 0:Do.some(ii=>ii.system===m.n4&&ii.code===m.GI))}),ur=Kt?.[0],Lr={choice:((zt=ur?.valueCoding)==null?void 0:zt.code)||(ur?.valueString&&At?.some(yo=>yo.valueString===ur.valueString)?ur.valueString:null),"open-choice":((Vt=ur?.valueCoding)==null?void 0:Vt.code)||ur?.valueString,boolean:ur?.valueBoolean,string:ur?.valueString,text:ur?.valueString,url:ur?.valueUri,integer:ur?.valueInteger,decimal:ur?.valueDecimal,dateTime:ur?.valueDateTime,date:ur?.valueDate,time:ur?.valueTime,quantity:(vn=ur?.valueQuantity)==null?void 0:vn.value,reference:(rn=ur?.valueReference)==null?void 0:rn.display,attachment:(hn=ur?.valueAttachment)==null?void 0:hn.title};if(!(Bt in Lr))return"";const Gr=Lr[Bt],si={required:()=>en&&(Gr==null||Gr===""||Gr==="NaN"||Number.isNaN(Gr)||Bt==="boolean"&&Gr!==!0&&Sr)?S(Je,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Rt&&Gr!==null&&Gr!==void 0&&Gr.toString().length>Rt?S(Je,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Rt}):"",minLength:()=>{const yo=I("minLength",gt);return yo&&Gr!==null&&Gr!==void 0&&Gr.toString().length<Number(yo)?S(Je,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:yo}):""},urlRegex:()=>{const yo=new RegExp(m.rx),Wo=I("regexError",gt),Do=Wo??S(Je,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return yo&&Bt==="url"&&Gr&&!yo.test(Gr)?String(Do):""},regex:()=>{const yo=I("regex",gt);if(!yo||typeof Gr!="string")return"";const Wo=new RegExp(yo),Do=I("regexError",gt),ii=Do??S(Je,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Wo&&Gr&&!Wo.test(Gr)?String(ii):""},dateTime:()=>{if(Bt==="dateTime"&&Gr){const yo=Gr?.toString(),Wo=new Date(yo);return isNaN(Wo.getTime())?S(Je,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(Bt!=="date"||!Gr)return"";const yo=Gr.replace(/\D/g,"");return yo.length>0&&yo.length<8||isNaN(new Date(Gr).getTime())?S(Je,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var yo;if(Bt==="date"){const Do=U(m.dU,gt),ii=X(Do??"01/01/1900","01/01/1900"),tr=X(Gr,"");if(!ii||!tr)return"";if((0,l.A)(tr,ii)){const dr=(yo=gt?.find(Dr=>Dr.url===m.Ck))==null?void 0:yo.valueString;return dr??S(Je,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:Do??"01/01/1900"})}return""}const Wo=I("minValue",gt);return Wo!=null&&Gr!==null&&Gr!==void 0&&Gr<Wo?S(Je,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Wo}):""},maxValue:()=>{var yo;if(Bt==="date"){const Do=U(m.bK,gt),ii=X(Do??"01/01/2100","01/01/2100"),tr=X(Gr,"");if(!ii||!tr)return"";if((0,o.A)(tr,ii)){const dr=(yo=gt?.find(Dr=>Dr.url===m.Cx))==null?void 0:yo.valueString;return dr??S(Je,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:Do??"01/01/2100"})}return""}const Wo=I("maxValue",gt);return Wo!=null&&Gr!==null&&Gr!==void 0&&Gr>Wo?S(Je,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Wo}):""}};return kn=si.required()||si.maxLength()||si.minLength()||si.urlRegex()||si.regex()||si.dateTime()||si.date()||si.minValue()||si.maxValue()||"",kn},te=(gt,Bt)=>{for(const en of Bt)if(en.item){if(en.item.find(At=>At.linkId===gt.linkId))return en;const Kt=te(gt,en.item);if(Kt)return Kt}return null},re=(gt,Bt)=>{if(gt.answer&&gt.answer.length>1)return!0;if(gt.item){const en=gt.item.find(Rt=>Rt.linkId===Bt.linkId);if(en&&en.answer&&en.answer.length>1)return!0}return!1},ge=(gt,Bt,en,Rt,Kt)=>{var At,Je;const{required:zt}=gt,Vt=(At=Rt.item)==null?void 0:At.find(hn=>hn.linkId===gt.linkId),vn=Vt?.answer||[],rn=((Je=Rt.answer)==null?void 0:Je.length)||1;for(let hn=0;hn<rn;hn++){const kn=vn[hn];if(zt){if(!kn||!de(kn))return S(Kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:hn+1,error:S(Kt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:gt.text||gt.linkId})});const Sr=le(gt.extension,gt.type,!0,gt.maxLength,[kn],gt.answerOption,Kt);if(Sr)return S(Kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:hn+1,error:Sr})}else if(kn&&de(kn)){const Sr=le(gt.extension,gt.type,!1,gt.maxLength,[kn],gt.answerOption,Kt);if(Sr)return S(Kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:hn+1,error:Sr})}}return""},xe=(gt,Bt)=>{for(const en of gt){if(en?.linkId===Bt)return en;if(en?.item&&en.item.length>0){const Rt=xe(en.item,Bt);if(Rt)return Rt}}},Ie=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===ITEM_CONTROL_EXTENSION_URL&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&At.code===FOOTER_CODE))}))},Ee=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===m.oA&&en.valueBoolean))},De=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===ITEM_CONTROL_EXTENSION_URL&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&At.code===HEADER_CODE))}))},ze=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===m.gD&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===m.n4&&At.code===m._l))}))},We=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&en.valueBoolean))},st=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>{var Rt,Kt;return en.url===ITEM_CONTROL_EXTENSION_URL&&((Kt=(Rt=en.valueCodeableConcept)==null?void 0:Rt.coding)==null?void 0:Kt.some(At=>At.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&At.code===CHECKBOX_CODE))}))},ft=gt=>{var Bt;const en=(Bt=gt.extension)==null?void 0:Bt.find(Rt=>Rt.url===m.fe);return en?.valueInteger},Mt=gt=>{var Bt;const en=(Bt=gt.extension)==null?void 0:Bt.find(Rt=>Rt.url===m.zO);return en?.valueInteger},Nt=gt=>{var Bt;const en=(Bt=gt?.extension)==null?void 0:Bt.find(Rt=>Rt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return en?.valueInteger},kt=(gt,Bt,en,Rt,Kt,At)=>{const Je=Vt=>Bt.filter(vn=>vn.linkId===Vt),zt=new Set;return gt.map(Vt=>{if(zt.has(Vt.linkId)||Ie(Vt))return null;const rn=Je(Vt.linkId),hn=Vt.type==="group"&&Vt.repeats;if(zt.add(Vt.linkId),hn){const kn=[];if(rn.forEach((Sr,ur)=>{const Lr={linkId:Vt.linkId,text:Vt.text};let Gr;if(en===Vt.linkId&&typeof At=="number"&&At===ur&&Kt&&Kt.length>0){const si=Sr?.item||[];Gr=[...si],Kt.forEach(yo=>{const Wo=Gr.findIndex(Do=>Do.linkId===yo.linkId);Wo>=0?Gr[Wo]=M(v({},si[Wo]),{answer:yo.answer}):Gr.push(yo)})}else Vt.item&&(Gr=kt(Vt.item,Sr?.item||[],en,Rt,Kt,ur));en===Vt.linkId&&typeof At=="number"&&At===ur&&Rt?Lr.answer=Rt:Lr.answer=Sr.answer||[{}],Gr&&Gr.length>0?Lr.item=Gr:Sr.item&&(Lr.item=Sr.item),kn.push(Lr)}),en===Vt.linkId&&typeof At=="number"&&At>=rn.length)for(let Sr=rn.length;Sr<=At;Sr++){const ur={linkId:Vt.linkId,text:Vt.text,answer:Sr===At&&Rt?Rt:[{}]};Sr===At&&Kt&&Kt.length>0?ur.item=Kt:Vt.item&&(ur.item=kt(Vt.item,[],void 0,void 0,void 0,void 0)),kn.push(ur)}return kn}else if(Vt.repeats&&typeof At=="number"&&en===Vt.linkId){const kn=rn[0]||{linkId:Vt.linkId,text:Vt.text,answer:[]},Sr={linkId:Vt.linkId,text:Vt.text,answer:[...kn.answer||[]]};if(Rt&&Rt.length>0){for(;Sr.answer.length<=At;)Sr.answer.push({});Sr.answer[At]=Rt[0]}return Sr}else{const kn=rn[0],Sr=Vt.item?kt(Vt.item,kn?.item||[],en,Rt,Kt,At):void 0,ur=Sr&&Sr.length>0,Lr={linkId:Vt.linkId,text:Vt.text};return en&&Vt.linkId===en&&typeof At!="number"?(Rt||!Rt&&!Kt?Lr.answer=Rt:kn?.answer&&(Lr.answer=kn.answer),Kt?Lr.item=Kt:ur&&(Lr.item=Sr)):(kn?.answer?Lr.answer=kn.answer:Lr.answer=[{}],ur&&(Lr.item=Sr)),Lr}}).filter(Boolean).flat()},Ot=(gt,Bt)=>{for(const en of gt)if(en.linkId===Bt||en.item&&Ot(en.item,Bt))return en.linkId;return null},Ke=(gt,Bt,en,Rt)=>{var Kt;const At=(Kt=gt?.item)!=null?Kt:Rt;return!At||At.length===0?!0:At.every(Je=>{var zt;const Vt=ae(Bt,Je.linkId);if(Vt.length===0){const vn=(zt=q(Bt,Je.linkId))==null?void 0:zt.answer;if(oe(Je,Bt,vn)&&ve(Je.enableWhen,Je.enableBehavior,Bt)&&en.includes(Je.linkId))return!1}else for(const vn of Vt)if(oe(Je,Bt,vn.answer)&&ve(Je.enableWhen,Je.enableBehavior,Bt)&&en.includes(Je.linkId))return!1;return Je.item?Ke(Je,Bt,en):!0})},Ye=(gt,Bt,en=!0)=>{for(const Rt of gt)if(Rt.linkId===Bt&&Rt.answer&&Rt.answer.length>0||Rt.item&&Rt.item.length>0&&Ye(Rt.item,Bt,en))return!0;return!1},Ft=(gt,Bt,en=0)=>{const Rt=gt.filter(Kt=>Kt.linkId===Bt);if(Rt.length>en){const Kt=Rt[en];if(Kt.answer&&Kt.answer.length>0)return Kt.answer.some(At=>At&&Object.keys(At).length>0&&Object.values(At).some(Je=>Je!=null&&Je!==""));if(Kt.item&&Kt.item.length>0)return Ye(Kt.item,Bt,!1)}return Ye(gt,Bt,!1)},ot=(gt,Bt)=>{if(!gt||!gt.item)return!1;const en=Rt=>{var Kt;if(Ee(Rt)&&Rt.required&&ve(Rt.enableWhen,Rt.enableBehavior,Bt)){const At=q(Bt,Rt.linkId),Je=le(Rt.extension,Rt.type,Rt.required,Rt.maxLength,At?.answer,Rt.answerOption);if(!((Kt=At?.answer)!=null&&Kt.length)||Je)return!0}if(Rt.item){for(const At of Rt.item)if(en(At))return!0}return!1};for(const Rt of gt.item)if(en(Rt))return!0;return!1},tt=gt=>{var Bt,en,Rt;if(gt.valueString!==void 0)return gt.valueString;if(gt.valueBoolean!==void 0)return gt.valueBoolean;if(gt.valueInteger!==void 0)return gt.valueInteger;if(gt.valueDecimal!==void 0)return gt.valueDecimal;if(gt.valueDate!==void 0)return gt.valueDate;if(gt.valueDateTime!==void 0)return gt.valueDateTime;if(((Bt=gt.valueCoding)==null?void 0:Bt.code)!==void 0)return gt.valueCoding.code;if(((en=gt.valueReference)==null?void 0:en.reference)!==void 0)return gt.valueReference.reference;if(((Rt=gt.valueQuantity)==null?void 0:Rt.value)!==void 0)return gt.valueQuantity.value;if(gt.valueAttachment!==void 0)return gt.valueAttachment},qt=gt=>{const Bt={linkId:gt.linkId};if(gt.answer&&gt.answer.length>0){const en=gt.answer.map(Rt=>tt(Rt)).filter(Rt=>Rt!==void 0);en.length>0&&(Bt.answer=en)}if(gt.item&&gt.item.length>0){const en=gt.item.map(Rt=>qt(Rt)).filter(Rt=>{const Kt=Object.keys(Rt);return Kt.length>1||Kt.length===1&&Kt[0]!=="linkId"});en.length>0&&(Bt.item=en)}return Bt},zn=(gt,Bt,en,Rt,Kt,At)=>{var Je;const zt=(Je=Bt?.item)==null?void 0:Je[en[Rt]],Vt=zt?.linkId;if(!Vt)return!1;const vn=ae(gt,Vt),rn=ae(Kt,Vt),hn=kn=>{if(kn!=null){if(Array.isArray(kn)){const Sr=kn.filter(ur=>ur!=null).map(ur=>hn(ur)).filter(ur=>ur!==void 0);return Sr.length===0||Sr.length===1&&typeof Sr[0]=="object"&&Object.keys(Sr[0]).length===0?void 0:Sr}if(typeof kn=="object"){const Sr={};for(const[ur,Lr]of Object.entries(kn))if(Lr!=null){const Gr=hn(Lr);Gr!==void 0&&(Sr[ur]=Gr)}return Object.keys(Sr).length===0?void 0:Sr}return kn}};if(vn.length!==rn.length)return!1;for(let kn=0;kn<vn.length;kn++){const Sr=vn[kn],ur=rn[kn];if(!Sr||!ur)return!1;const Lr=qt(hn(Sr)),Gr=qt(hn(ur));if(!_.isEqual(Lr,Gr))return!1}return Rt!==At},An=(gt,Bt,en,Rt)=>en&&en.length>0&&!(en.length===1&&Object.keys(en[0]).length===0)&&oe(gt,Bt,en,Rt)||null,lt=(gt,Bt,en)=>{const Rt={},Kt=At=>{At.forEach(Je=>{const zt=ae(Bt,Je.linkId);if(Ve(Je,gt)||Je.repeats)for(let Vt=0;Vt<zt.length;Vt++){const vn=zt[Vt];if(vn?.answer&&vn.answer.length>0){const rn=An(Je,Bt,vn.answer,en);rn&&(Rt[Je.linkId]=M(v({},Rt[Je.linkId]),{[Vt]:rn}))}}else{const Vt=q(Bt,Je.linkId);if(Vt?.answer&&Vt.answer.length>0){const vn=An(Je,Bt,Vt.answer,en);vn&&(Rt[Je.linkId]={0:vn})}}Je.item&&Je.item.length>0&&Kt(Je.item)})};return Kt(gt),Rt},_t=gt=>{if(!gt)return"";const Bt=gt.split("-");if(Bt.length===3){const[en,Rt,Kt]=Bt;return`${en.slice(-4)}-${Rt}-${Kt}`}return""},dn=gt=>gt.trim().replace(/[A-Za-z]+/g,""),rr=(gt,Bt)=>{const en=(Rt,Kt)=>{for(const At of Rt){if(At.linkId===Kt)return At.answer;if(At.item&&At.item.length>0){const Je=en(At.item,Kt);if(Je!==void 0)return Je}}};return en(gt,Bt)},Br=(gt,Bt)=>{if(!Bt||Bt.length===0)return null;const en=gt.linkId,Rt=(Kt,At,Je=[])=>{for(const zt of Kt){const Vt=[...Je,zt];if(zt.item){if(zt.item.some(hn=>hn.linkId===At))return Vt.some(hn=>hn.repeats===!0)?zt:null;if(Rt(zt.item,At,Vt))return zt}}return null};return Rt(Bt,en)},jt=(gt,Bt)=>{if(!Bt||Bt.length===0)return!1;const en=gt.linkId,Rt=(Kt,At,Je=[])=>{for(const zt of Kt){const Vt=[...Je,zt];if(zt.item){if(zt.item.some(hn=>hn.linkId===At))return Vt.some(hn=>{const kn=T(hn.extension||[]);return!!kn&&kn!==UI_TOOLKIT_FORM_CONTAINER});if(Rt(zt.item,At,Vt))return!0}}return!1};return Rt(Bt,en)},nn=(gt,Bt,en)=>{const Rt={};if(!gt)return Rt;const{linkId:Kt}=Bt;if(gt[Kt]){const At=gt[Kt];Rt[Kt]=At[en]||""}return Bt.item&&Bt.item.length>0&&Bt.item.forEach(At=>{if(gt[At.linkId]){const Je=gt[At.linkId];Rt[At.linkId]=Je[en]||""}}),Rt},Bn=(gt,Bt)=>{const en={};if(!gt||!gt[Bt])return en;const Rt=gt[Bt];return en[Bt]=Rt[0]||"",en},xn=gt=>{const Bt=gt.findIndex(At=>!Ee(At)),en=Bt>=0?[Bt]:gt.length>0?[0]:[],Rt=new Map;let Kt=null;if(gt.forEach((At,Je)=>{const zt=ze(At);if(zt&&At.type==="group")Je!==Bt&&en.push(Je),Rt.set(Je,[Je]),Kt=Je;else if(Kt!==null&&!zt){const Vt=Rt.get(Kt)||[];Rt.set(Kt,[...Vt,Je])}}),gt.length>0&&en.length>0){const At=en[0];if(!Rt.has(At)){const Je=en.find(Vt=>Vt>At),zt=[];for(let Vt=At;Vt<(Je??gt.length);Vt++)zt.push(Vt);Rt.set(At,zt)}}return{groupIndices:en,itemsToRenderMap:Rt}},Nr=(gt,Bt,en,Rt)=>{let Kt=[...Rt];const At=(Je,zt)=>{Je.forEach(Vt=>{if((!Vt?.enableWhen||ve(Vt?.enableWhen,Vt.enableBehavior,zt))&&Vt.initial&&!Ye(zt,Vt.linkId))if(Vt.repeats){const vn=zt.filter(rn=>rn.linkId===Vt.linkId);vn.length>0?vn.forEach((rn,hn)=>{Ft(zt,Vt.linkId,hn)||(Kt=kt(en,Kt,Vt.linkId,Vt.initial,void 0,hn))}):Kt=kt(en,Kt,Vt.linkId,Vt.initial)}else Kt=kt(en,Kt,Vt.linkId,Vt.initial);Vt.item&&At(Vt.item,zt)})};return At(gt,Bt),Kt},Pr=(gt,Bt,en)=>{if(!gt)return[];const Rt=[],Kt=At=>{At.required===Bt&&ve(At.enableWhen,At.enableBehavior,en)&&!Ee(At)&&At.type!=="display"&&Rt.push(At),At.item&&At.item.length>0&&At.item.forEach(Kt)};return gt.forEach(Kt),Rt},Wt=(gt,Bt)=>gt.every(en=>{var Rt;const Kt=ae(Bt,en.linkId);if(Kt.length>0)return Kt.every(At=>!oe(en,Bt,At.answer));{const At=(Rt=q(Bt,en.linkId))==null?void 0:Rt.answer;return!oe(en,Bt,At)}}),Fe=(gt,Bt)=>{let en=-1;for(let Rt=gt.length-1;Rt>=0;Rt--)if(gt[Rt].linkId===Bt){en=Rt;break}return en},it=(gt,Bt)=>gt.findIndex(en=>en.linkId===Bt),Ze=(gt,Bt)=>gt.filter(en=>en.linkId!==Bt).map(en=>en.item&&en.item.length>0?M(v({},en),{item:Ze(en.item,Bt)}):en),Qe=(gt,Bt,en=gt)=>gt.reduce((Rt,Kt)=>{const At=xe(Bt,Kt.linkId);return At?.enableWhen&&!ve(At.enableWhen,At.enableBehavior,en)||(Kt.item&&Kt.item.length>0?Rt.push(M(v({},Kt),{item:Qe(Kt.item,Bt,en)})):Rt.push(Kt)),Rt},[]),et=(gt,Bt,en=[])=>{const Rt=[],Kt=At=>{At.forEach(Je=>{Rt.push(Je.linkId),Je.item&&Je.item.length>0&&Kt(Je.item)})};for(let At=0;At<gt.length;At++){const Je=gt[At];if(Je.linkId===Bt){const zt=gt.slice(0,At+1),Vt=gt.slice(At+1),{kept:vn,removed:rn}=Vt.reduce((hn,kn)=>{const Sr=xe(en,kn.linkId);return!Sr||Ee(Sr)&&ve(Sr.enableWhen,Sr.enableBehavior,zt)?hn.kept.push(kn):hn.removed.push(kn),hn},{kept:[],removed:[]});return Kt(rn),{trimmedData:[...zt,...vn],trimmedLinkIds:Rt,found:!0}}if(Je.item&&Je.item.length>0){const zt=et(Je.item,Bt,en);if(zt.found){const Vt=gt.slice(0,At),vn=gt.slice(At+1),rn=[...Vt,M(v({},Je),{item:zt.trimmedData})],{kept:hn,removed:kn}=vn.reduce((Sr,ur)=>{const Lr=xe(en,ur.linkId);return!Lr||Ee(Lr)&&ve(Lr.enableWhen,Lr.enableBehavior,rn)?Sr.kept.push(ur):Sr.removed.push(ur),Sr},{kept:[],removed:[]});return Kt(kn),{trimmedData:[...rn,...hn],trimmedLinkIds:[...zt.trimmedLinkIds,...Rt],found:!0}}}}return{trimmedData:gt,trimmedLinkIds:[],found:!1}},ct=(gt,Bt)=>gt.filter(en=>!Bt.includes(en.linkId)).map(en=>en.item&&en.item.length>0?M(v({},en),{item:ct(en.item,Bt)}):en),Pt=gt=>{var Bt;if(!gt)return"empty";const en=m.Z$.find(({patterns:Rt})=>Rt.some(Kt=>gt.includes(Kt)));return(Bt=en?.type)!=null?Bt:"empty"},ut=(gt,Bt)=>{const{groupIndices:en}=xn(gt),Rt=gt.findIndex(Kt=>Kt.linkId===Bt);return Rt!==-1?en.indexOf(Rt):-1},ue=gt=>{if(!gt)return{restriction:null,warning:null};const Bt=en=>{const Rt=gt.find(At=>At.url===en&&At.valueString);if(!Rt?.valueString)return null;const Kt=Rt.valueString.replace(/\\n/g,`
870
870
  `).split(`
871
871
  `).map(At=>At.trim()).filter(Boolean).map(At=>At.startsWith("*")?At.substring(1).trim():At);return Kt.length===0?null:Kt.length===1?{isList:!1,items:Kt}:{isList:!0,items:Kt}};return{restriction:Bt("restriction"),warning:Bt("warning")}},Ce=(gt,Bt)=>{var en;switch(Bt.type){case"boolean-to-string":return typeof gt=="boolean"?gt?Bt.trueValue:Bt.falseValue:gt;case"map":return Bt.mapping&&gt in Bt.mapping?Bt.mapping[gt]:gt;case"date-format":return gt;case"number-format":if(typeof gt=="number"){let Rt=gt.toFixed((en=Bt.decimals)!=null?en:0);return Bt.prefix&&(Rt=Bt.prefix+Rt),Bt.suffix&&(Rt=Rt+Bt.suffix),Rt}return gt;case"passthrough":default:return gt}},Ve=(gt,Bt)=>{const en=gt.linkId,Rt=(At,Je,zt=[])=>{for(const Vt of At){const vn=[...zt,Vt];if(Vt.item){if(Vt.item.some(kn=>kn.linkId===Je))return vn.filter(kn=>kn.repeats===!0);const hn=Rt(Vt.item,Je,vn);if(hn.length>0)return hn}}return[]},Kt=Rt(Bt,en);return Kt.length>0?Kt[Kt.length-1]:null},Te=(gt,Bt)=>{if(!gt?.item)return[];const en=[];for(const Rt of gt.item){if(Rt.type!=="group")continue;ve(Rt.enableWhen,Rt.enableBehavior,Bt||[])&&Rt.linkId&&en.push(Rt.linkId)}return en},It=(gt,Bt)=>{const en=Te(gt,Bt||void 0);return en[en.length-1]},Yt=({questionnaire:gt,extensionUrl:Bt,errorCode:en})=>{if(!en||!gt?.item)return;const Rt=gt.item.find(Kt=>{var At;return(At=Kt.extension)==null?void 0:At.some(Je=>Je.url===Bt&&Je.valueString===en)});return Rt?.linkId},yn=(gt,Bt)=>{var en;const Rt=(en=gt.extension)==null?void 0:en.find(At=>At.url===m.rb);if(!Rt?.valueString)return;const Kt=Rt.valueString;return xe(Bt,Kt)},qn=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===m.rb))},pr=gt=>{var Bt,en;return(en=(Bt=gt.extension)==null?void 0:Bt.some(Rt=>Rt.url===m.Nu&&Rt.valueBoolean===!0))!=null?en:!1},Ht=(gt,Bt)=>gt.filter(en=>en.linkId!==Bt).map(en=>en.item&&en.item.length>0?M(v({},en),{item:Ht(en.item,Bt)}):en),we=gt=>{const Bt=I(ANALYTICS_FORM_NAME_EXTENSION_URL,gt.extension);return Bt??F(gt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Xe=gt=>I(ANALYTICS_EVENT_NAME_EXTENSION_URL,gt.extension),Dt=gt=>I(ANALYTICS_PAGE_NAME_EXTENSION_URL,gt.extension),sn=gt=>I(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,gt.extension),un=gt=>I(ANALYTICS_OPTION_NAME_EXTENSION_URL,gt),Jt=(gt,Bt)=>{var en,Rt,Kt;if(!gt.answerOption)return;const At=q(Bt,gt.linkId),Je=(Kt=(Rt=(en=At?.answer)==null?void 0:en[0])==null?void 0:Rt.valueCoding)==null?void 0:Kt.code;if(!Je)return;const zt=gt.answerOption.find(Vt=>{var vn;return((vn=Vt.valueCoding)==null?void 0:vn.code)===Je});if(!!zt)return un(zt.extension)},Fn=(gt,Bt)=>{const en={},Rt=Kt=>{if(!!Kt)for(const At of Kt){const Je=sn(At);if(Je){let zt;switch(At.type){case"choice":zt=Jt(At,Bt);break;default:break}zt&&(en[Je]=zt)}At.item&&At.item.length>0&&Rt(At.item)}};return Rt(gt.item),en},gr=gt=>!!(gt.initial&&gt.initial.length>0),Tr=(gt,Bt,en,Rt)=>{if(!gt)return[];const Kt=[],At=Je=>{Je.forEach(zt=>{if(en&&en.includes(zt.linkId)||Rt&&zt.enableWhen&&!ve(zt.enableWhen,zt.enableBehavior,Rt))return;const Vt=Ee(zt),vn=Bt.includes(zt.linkId);(vn||Vt&&zt.required)&&Kt.push(zt),vn&&zt.item&&zt.item.length>0&&At(zt.item)})};return At(gt),Kt},Xr=(gt,Bt,en,Rt,Kt,At)=>{var Je;if(en<0||!Rt?.item)return!0;const zt=Kt.current[en],Vt=Rt.item[zt];if(Vt?.enableWhen&&!ve(Vt.enableWhen,Vt.enableBehavior,gt))return!0;const vn=en+1,rn=Kt.current[vn],hn=en===0?0:zt,kn=rn??Rt.item.length,Sr=[];for(let yo=hn;yo<kn;yo++){const Wo=(Je=Rt?.item)==null?void 0:Je[yo];if(Wo){if(At&&At.includes(Wo.linkId)||Wo.enableWhen&&!ve(Wo.enableWhen,Wo.enableBehavior,gt))continue;const Do=Ee(Wo);(Bt.includes(Wo.linkId)||Do&&Wo.required)&&Sr.push(Wo),Wo.item&&Wo.item.length>0&&Sr.push(...Tr(Wo.item,Bt,At,gt))}}const ur=Sr.filter(yo=>yo.required===!0),Lr=Sr.filter(yo=>yo.required!==!0),Gr=Wt(ur,gt),si=Lr?.every(yo=>{var Wo;const Do=(Wo=q(gt,yo.linkId))==null?void 0:Wo.answer;return Do?!oe(yo,gt,Do):!0});return!ur?.length||Gr&&si},Qr=gt=>{var Bt,en;return!!gt.answer&&gt.answer.length>0&&Object.keys(gt.answer[0]).length>0||((en=(Bt=gt.item)==null?void 0:Bt.some(Qr))!=null?en:!1)},Oo=(gt,Bt)=>gt.map(en=>{var Rt;const Kt=xe(Bt,en.linkId);if(!Kt||Kt.type!=="group"||Kt.required===!0)return en;const Je=en.answer&&en.answer.length>0&&Object.keys(en.answer[0]).length>0,zt=(Rt=en.item)==null?void 0:Rt.some(Qr);return!Je&&!zt?M(v({},en),{answer:[{}]}):en.item&&en.item.length>0?M(v({},en),{item:Oo(en.item,Kt.item||[])}):en})},2658:(Y,s,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(44738),l=e(36087),o=e(8322),i=e(1053),a=e(25624);const b=({item:hr})=>{const to=hr.text||"",oo=hr.extension||[],gn=Ar=>{var Nn;return(Nn=oo.find(mr=>mr.url===Ar))==null?void 0:Nn.valueString},wn=gn(i.$7),Zn=gn(i.pc)||"default";return(0,n.jsx)(l.AlertFloating,{title:to,description:wn??"",color:Zn})};var c=e(7630),u=e(16212),y=Object.defineProperty,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,O=(hr,to,oo)=>to in hr?y(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,g=(hr,to)=>{for(var oo in to||(to={}))p.call(to,oo)&&O(hr,oo,to[oo]);if(m)for(var oo of m(to))f.call(to,oo)&&O(hr,oo,to[oo]);return hr};const A=({item:hr})=>{const[to,oo]=(0,t.useState)(!1),gn=hr.extension||[],wn=Ho=>{var Fo;return(Fo=gn.find(li=>li.url===Ho))==null?void 0:Fo.valueString},Zn=wn(i.PS)||hr.text||"",Ar=wn(i.Iz)||"button",Nn=wn(i.VF),mr=wn(i.PV),Ur=wn(i.vf),Ct=Ur?i.JP[Ur]:void 0,He=wn(i.D_)||"",rt=wn(i.$e),St=wn(i.GQ),On=wn(i.qT)||"gray",Rn=wn(i.hZ),Qn=wn(i.wG),$r=wn(i.q3),po=St?i.JP[St]:void 0,fo=()=>oo(!0),qo=()=>{switch(Ar){case"icon-button":return(0,n.jsxs)("button",{onClick:fo,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Zn||He||void 0,children:[Ct&&(0,n.jsx)(Ct,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Zn&&(0,n.jsx)("span",{className:"text-sm",children:Zn})]});default:return(0,n.jsx)(l.Button,{color:Nn??"secondary",size:mr??"md",iconLeading:Ct,onClick:fo,"aria-label":Zn,children:Zn})}};return(0,n.jsxs)(n.Fragment,{children:[qo(),(0,n.jsx)(l.Modal,g(g(g({id:`modal-${hr.linkId}`,isOpen:to,onOpenChange:oo,title:{content:He},description:{content:rt?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:u.Wp.sanitizeHtml(rt)}}):void 0},closeButton:{onCloseClick:()=>oo(!1)}},po?{featuredIcon:{icon:po,color:On,size:"lg",className:"bg-white"}}:{}),Rn?{primaryButton:{children:Rn,onClick:()=>{var Ho,Fo;Qn==="open-zendesk"&&((Fo=(Ho=globalThis.zE)==null?void 0:Ho.activate)==null||Fo.call(Ho,{hideOnClose:!0})),oo(!1)}}}:{}),$r?{secondaryButton:{children:$r,onClick:()=>oo(!1)}}:{}))]})};var h=e(18522);const d=({item:hr})=>{var to,oo,gn,wn,Zn,Ar,Nn,mr,Ur,Ct,He,rt;const{hasExternalError:St}=(0,h.c)(),On=hr.text||"",Rn=(oo=(to=hr.extension)==null?void 0:to.find(Ti=>Ti.url===i.ao))==null?void 0:oo.valueString,Qn=St&&Rn?Rn:On,$r=(wn=(gn=hr.extension)==null?void 0:gn.find(Ti=>Ti.url===i.$7))==null?void 0:wn.valueString,po=(Ar=(Zn=hr.extension)==null?void 0:Zn.find(Ti=>Ti.url===i.el))==null?void 0:Ar.valueString,fo=St&&po?po:$r,qo=(mr=(Nn=hr.extension)==null?void 0:Nn.find(Ti=>Ti.url===i.g4))==null?void 0:mr.valueString,Ho=(Ct=(Ur=hr.extension)==null?void 0:Ur.find(Ti=>Ti.url===i.Fp))==null?void 0:Ct.valueString,Fo=qo?i.JP[qo]:void 0,li=Ho?i.JP[Ho]:void 0,Ji=St&&li?li:Fo,Fi=((rt=(He=hr.extension)==null?void 0:He.find(Ti=>Ti.url===i.WS))==null?void 0:rt.valueString)===i._W.LEFT,s0=Fi?"items-start":"items-center",D0=Fi?"text-left":"text-center",Sa=Fi?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${s0} gap-4`,children:[Ji&&(0,n.jsx)(l.FeaturedIcon,{icon:Ji,color:St&&li?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${s0} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${D0} ${Sa} md:max-w-[352px]`,children:Qn}),(0,n.jsx)("p",{className:`text-md text-secondary ${D0}`,children:fo})]})]})};var v=e(15297),M=e(17814),S=Object.defineProperty,T=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,C=(hr,to,oo)=>to in hr?S(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,E=(hr,to)=>{for(var oo in to||(to={}))x.call(to,oo)&&C(hr,oo,to[oo]);if(T)for(var oo of T(to))z.call(to,oo)&&C(hr,oo,to[oo]);return hr};const R=({item:hr})=>{const[to,oo]=(0,t.useState)(!1),gn=(0,M.T$)(),wn=hr.extension||[],Zn=Rn=>{var Qn;return(Qn=wn.find($r=>$r.url===Rn))==null?void 0:Qn.valueString},Ar=hr.text||"",Nn=Zn(i.PS)||"",mr=Zn(i.D_)||"",Ur=Zn(i.$e),Ct=Zn(i.GQ),He=Zn(i.qT)||"gray",rt=Zn(i.hZ),St=Zn(i.q3),On=Ct?i.JP[Ct]: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)(v.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:Ar})]}),Nn&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>oo(!0),children:Nn})]}),(0,n.jsx)(l.Modal,E(E(E({id:`modal-${hr.linkId}`,isOpen:to,onOpenChange:oo,title:{content:mr},description:{content:Ur?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:u.Wp.sanitizeHtml(Ur)}}):void 0},closeButton:{onCloseClick:()=>oo(!1)}},On?{featuredIcon:{icon:On,color:He,size:"lg",className:"bg-white"}}:{}),rt?{primaryButton:{children:rt,onClick:()=>{oo(!1),gn.navigate({id:"profile"})}}}:{}),St?{secondaryButton:{children:St,onClick:()=>oo(!1)}}:{}))]})},L=({item:hr,selectedAnswer:to,handleInputChange:oo})=>{var gn,wn,Zn;const Ar=(gn=hr.answerOption)!=null?gn:[],Nn=(Zn=(wn=to?.[0])==null?void 0:wn.valueCoding)==null?void 0:Zn.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:Ar.map(mr=>{var Ur,Ct,He,rt,St,On,Rn;const Qn=(Ct=(Ur=mr.valueCoding)==null?void 0:Ur.code)!=null?Ct:"",$r=(rt=(He=mr.valueCoding)==null?void 0:He.display)!=null?rt:"",po=Nn===Qn,fo=(St=mr.extension)==null?void 0:St.find(li=>li.url===i.g4),qo=(On=mr.extension)==null?void 0:On.find(li=>li.url===i.rz),Ho=fo?.valueString?i.JP[fo.valueString]:void 0,Fo=(Rn=qo?.valueString)!=null?Rn:"";return(0,n.jsx)(l.SelectableOption,{icon:Ho,title:$r,description:Fo,isSelected:po,onSelect:()=>{oo(hr,[{valueCoding:{code:Qn,display:$r}}])}},Qn)})})};var P=e(72866),D=e(96814);const N="(###) ###-####",w=(hr,to)=>{const oo=hr.replace(/\D/g,"");let gn="",wn=0;for(let Zn=0;Zn<to.length&&wn<oo.length;Zn++)to[Zn]==="#"?(gn+=oo[wn],wn++):gn+=to[Zn];return gn},V=hr=>{if(!hr)return N;const to=hr.find(oo=>oo.url===i.Md);return to?.valueString||N},k=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar})=>{var Nn;const{linkId:mr,text:Ur,required:Ct,prefix:He,readOnly:rt,extension:St}=hr,On=V(St),Rn=((Nn=oo?.[0])==null?void 0:Nn.valueString)||"",[Qn,$r]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Rn){const Fo=w(Rn,On);$r(Fo)}},[Rn,On]);const po=Ur?(0,a.nt)(wn,He,Ur):"",fo=Zn?.[mr]||"",qo=Fo=>{const li=w(Fo,On);$r(li),gn(hr,[{valueString:li}])},Ho=()=>{to&&to(mr)};return(0,n.jsxs)("div",{"data-testid":mr,children:[po&&(0,n.jsx)(D.W,{isLabel:!0,text:po,required:Ct||!1,item:hr}),(0,n.jsx)(l.Input,{id:mr,"aria-label":mr,"data-testid":mr,type:"tel",placeholder:"Enter phone number",value:Qn,onChange:qo,onBlur:Ho,isDisabled:rt||Ar,isRequired:Ct,hint:fo,isInvalid:!!fo,size:"md"},mr)]})},I=({item:hr,questionnaireSchemaItems:to})=>{var oo;const{isLoading:gn,setCurrentGroupIndex:wn}=(0,h.c)(),Zn=(oo=hr.extension)==null?void 0:oo.find(Ur=>Ur.url===i.Uf),Ar=Zn?.valueString,Nn=hr.text||"Save & continue",mr=()=>{if(Ar){const Ur=(0,a.Ue)(to||[],Ar);Ur!==-1&&wn(Ur)}};return(0,n.jsx)("div",{"data-testid":hr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(l.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:gn,onClick:mr,isDisabled:hr.readOnly,children:Nn})})},G=({size:hr=24,color:to="currentColor",...oo})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:to,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...oo},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"}));G.displayName="Passport";var U=e(56327);const F=({size:hr=24,color:to="currentColor",...oo})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:to,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...oo},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"}));F.displayName="UserCircle";var X=e(14711);const q=({size:hr=24,color:to="currentColor",...oo})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:to,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...oo},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"}));q.displayName="Mail01";var ae=e(31165),se=e(14449),ne=e(59931),he=e(27163);const ve=hr=>{try{const to=hr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!to)return hr;const[,oo,gn,wn]=to;return new Date(Date.UTC(parseInt(oo),parseInt(gn)-1,parseInt(wn))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return hr}},ye=hr=>{try{if(hr.includes("AM")||hr.includes("PM"))return hr;const to=hr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!to)return hr;const[,oo,gn]=to,wn=parseInt(oo),Zn=wn>=12?"PM":"AM";return`${wn%12||12}:${gn} ${Zn}`}catch{return hr}},Ae=(hr,to,oo=v.d)=>{var gn;const wn=(gn=hr.extension)==null?void 0:gn.find(Zn=>Zn.url===i.g4);return wn?.valueString&&i.JP[wn.valueString]?i.JP[wn.valueString]:hr.linkId&&to[hr.linkId]?to[hr.linkId]:oo},J={"appointment-review/first-name":G,"appointment-review/last-name":G,"appointment-review/dob":U.V,"appointment-review/gender":F,"appointment-review/phone":X.b,"appointment-review/email":q,"appointment-review/vaccines":l.Vaccine,"appointment-review/appointment-date":U.V,"appointment-review/appointment-time":ae.z,"appointment-review/facility-name":l.HospitalBuilding,"appointment-review/facility-phone":X.b,"appointment-review/facility-address":se.X},oe=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],ce=["appointment-review/facility-phone"],de=["appointment-review/facility-address"],le=["appointment-review/phone","appointment-review/facility-phone"],te=({item:hr,questionnaireSchemaItems:to})=>{var oo,gn;const{setCurrentGroupIndex:wn,setEditReturnGroupIndex:Zn,currentGroupIndex:Ar,isLoading:Nn}=(0,h.c)(),{trackEvent:mr}=(0,o.st)(),Ur=hr.item||[];if(Ur.length===0)return null;const Ct=(oo=hr.extension)==null?void 0:oo.find(Rn=>Rn.url===i.Uf),He=Ct?.valueString,rt=!!((gn=hr.extension)!=null&&gn.find(Rn=>Rn.url===i.Cq&&Rn.valueBoolean)),St=()=>{if(mr("edit_info_clicked",{section:hr.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),He){const Rn=(0,a.Ue)(to||[],He);Rn!==-1&&(rt&&Zn(Ar),wn(Rn))}},On=Ur.map(Rn=>{let Qn="";if(Rn.initial&&Rn.initial.length>0){const fo=Rn.initial.map(qo=>{var Ho,Fo,li,Ji,Fi,s0,D0,Sa;let Ti=((Ho=qo.valueCoding)==null?void 0:Ho.display)||((Fo=qo.valueReference)==null?void 0:Fo.display)||qo.valueString||"";if(Ti&&typeof Ti=="string"){if(oe.includes(Rn.linkId)){const _0=(Fi=(Ji=(li=qo.valueReference)==null?void 0:li.extension)==null?void 0:Ji.find(H0=>H0?.url===i.zD||H0?.url===i.UZ))==null?void 0:Fi.valueCode;if(_0)try{Ti=(0,ne.formatToTimeZone)(Ti,"YYYY-MM-DD",{timeZone:_0})}catch{}Ti=ve(Ti)}else if(me.includes(Rn.linkId)){const _0=(Sa=(D0=(s0=qo.valueReference)==null?void 0:s0.extension)==null?void 0:D0.find(H0=>H0?.url===i.zD||H0?.url===i.UZ))==null?void 0:Sa.valueCode;if(_0)try{Ti=(0,ne.formatToTimeZone)(Ti,"h:mm A",{timeZone:_0})}catch{Ti=ye(Ti)}else Ti=ye(Ti)}}return Ti}).filter(Boolean);fo.length>1||Rn.repeats&&fo.length>0?Qn=fo:fo.length===1&&(Qn=fo[0])}if(!Qn||Array.isArray(Qn)&&Qn.length===0)return null;let $r;ce.includes(Rn.linkId)?$r="phone":de.includes(Rn.linkId)&&($r="address");let po;return le.includes(Rn.linkId)&&(po="phone"),{Icon:Ae(Rn,J),label:Rn.text||Rn.linkId,value:Qn,linkType:$r,displayType:po}}).filter(Boolean);return On.length===0?null:(0,n.jsx)("div",{"data-testid":hr.linkId,children:(0,n.jsx)(he.InfoCard,{title:hr.text||"Details",infoDetails:On,actionButtonText:He&&!Nn?"Edit info":void 0,onActionButtonClick:He&&!Nn?St:void 0})})},re=({size:hr=24,color:to="currentColor",...oo})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:to,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...oo},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"}));re.displayName="AlertTriangle";var ge=e(18807);const xe=({item:hr})=>{const{setHideFooterButton:to,incrementCustomErrorCount:oo,decrementCustomErrorCount:gn,addErrorLinkId:wn,removeErrorLinkId:Zn}=(0,h.c)();return(0,t.useEffect)(()=>(to(!0),oo(),wn(hr.linkId),()=>{to(!1),gn(),Zn(hr.linkId)}),[to,oo,gn,wn,Zn,hr.linkId]),(0,n.jsx)("div",{"data-testid":hr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(l.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(l.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,ge.p)(hr.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(re,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},Ie={information:"info",warning:"warning",error:"error",fatal:"fatal",success:"success"},Ee=({item:hr})=>{var to,oo,gn,wn;const{incrementCustomErrorCount:Zn,decrementCustomErrorCount:Ar,addErrorLinkId:Nn,removeErrorLinkId:mr,setHideFooterButton:Ur}=(0,h.c)(),[Ct,He]=(0,t.useState)(!1),rt=(to=hr.extension)==null?void 0:to.find(po=>po.url===i.gi),St=(gn=(oo=rt?.valueCodeableConcept)==null?void 0:oo.coding)==null?void 0:gn.find(po=>po.system===i.tn),On=St?.code||"error",Rn=Ie[On]||"error";(0,t.useEffect)(()=>{if(Rn==="error")return Zn(),Ur(!0),He(!0),()=>{Ar(),Ur(!1)};if(Rn==="fatal")return Zn(),Nn(hr.linkId),Ur(!0),He(!0),()=>{Ar(),mr(hr.linkId),Ur(!1)};He(!0)},[Rn]);const Qn=St?.display||"Error",$r=(wn=hr.text)!=null?wn:"";return Ct?(0,n.jsx)("div",{"data-testid":hr.linkId,children:(0,n.jsx)(l.InfoBanner,{type:Rn==="fatal"?"error":Rn,title:Qn,description:$r})}):null};var De=e(65735);const ze=({configKey:hr,customErrorConfigurations:to})=>{if(!to)return null;const oo=to[hr];if(!oo)return null;const{icon:gn,title:wn,description:Zn,primaryButton:Ar,secondaryButton:Nn}=oo;return(0,n.jsx)(l.EmptyState,{className:"mt-5xl",title:wn,description:Zn,featuredIconProps:{icon:gn,color:"gray"},primaryButton:Ar,secondaryButton:Nn})},We=10,st=({item:hr,customErrorConfigurations:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar})=>{var Nn,mr,Ur,Ct;const{trackEvent:He}=(0,o.st)(),{setHideFooterButton:rt}=(0,h.c)(),{linkId:St,text:On,required:Rn,answerOption:Qn,prefix:$r,readOnly:po}=hr,fo=hr?.type==="reference",qo=(Nn=oo?.map(K0=>{var $a,Ks;return fo?($a=K0.valueReference)==null?void 0:$a.display:(Ks=K0.valueCoding)==null?void 0:Ks.code}).filter(K0=>K0!==void 0))!=null?Nn:[],[Ho,Fo]=(0,t.useState)(qo.length),li=On?(0,a.nt)(wn,$r,On):"",Ji=(Ur=(mr=hr.extension)==null?void 0:mr.find(K0=>K0.url===i.Z_))==null?void 0:Ur.valueInteger,Fi=(Ct=Qn?.map(K0=>{var $a,Ks,c1,I1;return{value:fo?(($a=K0.valueReference)==null?void 0:$a.display)||"":((Ks=K0.valueCoding)==null?void 0:Ks.code)||"",label:fo?((c1=K0.valueReference)==null?void 0:c1.display)||"":((I1=K0.valueCoding)==null?void 0:I1.display)||"",valueReference:K0.valueReference}}))!=null?Ct:[],s0=Zn?.[St],D0=Fi.length>We,Sa=D0?Fi.slice(0,We):Fi,Ti=D0?Fi.slice(We):[],_0=Ti.some(K0=>qo?.includes(K0?.value)),[H0,e0]=(0,t.useState)(_0);if(!(hr.answerOption&&hr.answerOption.length>0))return rt(!0),(0,n.jsx)(ze,{configKey:hr.linkId,customErrorConfigurations:to});const qs=Fi.filter(K0=>qo?.includes(K0?.value)).map(K0=>{var $a;const{restriction:Ks,warning:c1}=fo?(0,a.eC)(($a=K0.valueReference)==null?void 0:$a.extension):{restriction:null,warning:null};return{label:K0.label,restriction:Ks,warning:c1}}).filter(K0=>K0.restriction||K0.warning),h1=(K0,$a)=>{var Ks;He("vaccine_type_checkbox_selected",{on_or_off:K0?"on":"off",vaccine:$a,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let c1;if(K0){const I1=Fi.find(W1=>W1.value===$a);c1=[...(Ks=oo?.filter(W1=>Object.keys(W1).length!==0))!=null?Ks:[],fo?{valueReference:I1?.valueReference}:{valueCoding:{code:$a,display:I1?.label}}],Fo(W1=>W1+1)}else c1=oo?.filter(I1=>{var W1,nl;return fo?((W1=I1.valueReference)==null?void 0:W1.display)!==$a:((nl=I1.valueCoding)==null?void 0:nl.code)!==$a})||[{}],Fo(I1=>I1-1);gn&&gn(hr,c1)};return(0,n.jsxs)("div",{"data-testid":St,children:[li&&(0,n.jsx)(D.W,{text:li,required:Rn||!1,item:hr}),D0&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:Sa.map((K0,$a)=>{const Ks=qo?.includes(K0?.value),c1=!Ks&&Ji?Ho>=Ji:!1;return(0,n.jsx)("div",{className:$a!==Sa.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(l.Checkbox,{size:"md","data-testid":K0.value,id:$a.toString(),name:K0.label,isInvalid:!!s0,isSelected:Ks,label:K0.label,onChange:I1=>h1(I1,K0.value),isDisabled:po||Ar||c1})},$a)})}),D0&&!H0&&!_0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(l.Button,{type:"button",onClick:()=>{e0(!0),He("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:po||Ar,children:"See all"})}),D0&&H0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),D0&&H0&&(0,n.jsx)("div",{children:Ti.map((K0,$a)=>{const Ks=qo?.includes(K0?.value),c1=!Ks&&Ji?Ho>=Ji:!1;return(0,n.jsx)("div",{className:$a!==Ti.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(l.Checkbox,{size:"md","data-testid":K0.value,id:(We+$a).toString(),name:K0.label,isInvalid:!!s0,isSelected:Ks,label:K0.label,onChange:I1=>h1(I1,K0.value),isDisabled:po||Ar||c1})},We+$a)})}),(0,n.jsx)(l.HintText,{isInvalid:!!s0,children:s0}),qs.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:qs.map((K0,$a)=>(0,n.jsxs)("div",{children:[K0.restriction&&(0,n.jsx)(l.InfoBanner,{type:"warning",title:`[Restriction] ${K0.label}`,description:K0.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:K0.restriction.items.map((Ks,c1)=>(0,n.jsx)("li",{className:"text-sm",children:Ks},c1))}):(0,n.jsx)("p",{className:"text-sm",children:K0.restriction.items[0]})}),K0.warning&&(0,n.jsx)("div",{className:K0.restriction?"mt-2":"",children:(0,n.jsx)(l.InfoBanner,{type:"warning",title:`[Warning] ${K0.label}`,description:K0.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:K0.warning.items.map((Ks,c1)=>(0,n.jsx)("li",{className:"text-sm",children:Ks},c1))}):(0,n.jsx)("p",{className:"text-sm",children:K0.warning.items[0]})})})]},$a))})]})};var ft=e(76323),Mt=e(56192),Nt=e(66267),kt=Object.defineProperty,Ot=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Ft=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,tt=(hr,to,oo)=>to in hr?kt(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,qt=(hr,to)=>{for(var oo in to||(to={}))Ft.call(to,oo)&&tt(hr,oo,to[oo]);if(Ye)for(var oo of Ye(to))ot.call(to,oo)&&tt(hr,oo,to[oo]);return hr},zn=(hr,to)=>Ot(hr,Ke(to)),An=(hr,to,oo)=>new Promise((gn,wn)=>{var Zn=mr=>{try{Nn(oo.next(mr))}catch(Ur){wn(Ur)}},Ar=mr=>{try{Nn(oo.throw(mr))}catch(Ur){wn(Ur)}},Nn=mr=>mr.done?gn(mr.value):Promise.resolve(mr.value).then(Zn,Ar);Nn((oo=oo.apply(hr,to)).next())});const lt=({item:hr,handleInputChange:to,onCompleteHandler:oo,errors:gn})=>{const{i18n:{t:wn},loading:Zn}=(0,Nt.E_)({keys:["shared-translations","ui-toolkit-modern"]}),{trackEvent:Ar}=(0,o.st)(),{linkId:Nn,required:mr,readOnly:Ur}=hr,Ct=gn?.[Nn]||"",[He,rt]=(0,t.useState)(ft.LocationType.CURRENT_LOCATION),[St,On]=(0,t.useState)(""),Rn=(0,t.useRef)({}),[Qn,$r]=(0,t.useState)([{id:ft.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:ft.LocationType.ADDRESS,label:"Address"},{id:ft.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:po,setIsLoading:fo,setIsCurrentFormValid:qo,isCurrentFormValid:Ho}=(0,h.c)(),{position:Fo,loading:li,locationPermission:Ji}=(0,ft.useDeviceLocationContext)(),{queryParams:Fi,setQueryParams:s0}=(0,ft.useSearchQueryParams)(),[D0,{loading:Sa}]=(0,Mt.qtq)({fetchPolicy:"cache-first"}),[Ti,{loading:_0}]=(0,Mt.YyG)({fetchPolicy:"cache-first"}),H0=hr.item?(0,a.Yo)(hr.item,"postal-code"):void 0,e0=hr.item?(0,a.Yo)(hr.item,"state"):void 0,Na=hr.item?(0,a.Yo)(hr.item,"latitude"):void 0,qs=hr.item?(0,a.Yo)(hr.item,"longitude"):void 0,h1=ja=>{if(!ja||!H0)return On(""),!1;const J1=(0,a.zj)(H0.extension,H0.type,!1,H0.maxLength,[{valueString:ja}],void 0,wn);return J1?(On(He!==ft.LocationType.ZIP_CODE?wn("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):J1),!1):(On(""),!0)},K0=()=>{const{latitude:ja,longitude:J1,state:co,zipcode:zr}=Rn.current;return!!(ja&&J1&&co&&zr)},$a=(0,t.useCallback)(ja=>{Rn.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},hr.item&&(e0&&to(e0,[{valueString:""}]),Na&&to(Na,[{valueDecimal:void 0}]),qs&&to(qs,[{valueDecimal:void 0}]),H0&&to(H0,[{valueString:""}])),s0({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:ja,locationPermission:Ji}),qo&&qo(!1),On("")},[to,hr.item,Na,Ji,qs,qo,s0,e0,H0]);(0,t.useEffect)(()=>{if(!mr)return;!K0()&&qo&&qo(!1)},[Ho,mr,qo]);const Ks=ja=>{Rn.current=qt(qt({},Rn.current),ja),ja.addressDescription&&Ar("address_selected",{value:ja.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),W1(Rn.current.latitude,Rn.current.longitude,Rn.current.state,Rn.current.zipcode,Rn.current.placeId,Rn.current.addressDescription)},c1=ja=>An(void 0,null,function*(){var J1,co,zr;if(On(""),Rn.current.zipcode=ja,qo&&qo(!1),h1(ja)){Ar("zip_code_entered",{value:ja,_event_metadata:{description:"A user entered a zip code."}});const Rr=yield Ti({variables:{location:ja}}),Re=(J1=Rr?.data)==null?void 0:J1.geocoding,Se=Rr?.error;if(Re){const Ue=Re.stateCode||"",Lt=(co=Re.latitude)!=null?co:void 0,tn=(zr=Re.longitude)!=null?zr:void 0;Ks({latitude:Lt,longitude:tn,state:Ue,zipcode:ja,placeId:void 0,addressDescription:void 0})}else Se&&(Ks({latitude:void 0,longitude:void 0,state:void 0,zipcode:ja,placeId:void 0,addressDescription:void 0}),On(wn("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else W1(Rn.current.latitude,Rn.current.longitude,Rn.current.state,ja)}),I1=()=>{const ja=Rn.current.zipcode||"";!ja||He!==ft.LocationType.ZIP_CODE||h1(ja)};(0,t.useEffect)(()=>{Fi.locationType&&(rt(Fi.locationType),Fi.locationType===ft.LocationType.ZIP_CODE&&Fi.zipCode&&c1(Fi.zipCode),Fi.locationType===ft.LocationType.ADDRESS&&Fi.placeId&&Fi.addressDescription&&(Rn.current.addressDescription=Fi.addressDescription,Rn.current.placeId=Fi.placeId))},[]),(0,t.useEffect)(()=>{const ja=[ft.LocationPermissionEnum.DENIED,ft.LocationPermissionEnum.UNAVAILABLE,ft.LocationPermissionEnum.BLOCKED].includes(Fi.locationPermission),J1=[ft.LocationPermissionEnum.GRANTED,ft.LocationPermissionEnum.PROMPT].includes(Fi.locationPermission);if(ja&&Qn.length!==2){if($r([{id:ft.LocationType.ADDRESS,label:"Address"},{id:ft.LocationType.ZIP_CODE,label:"Zip code"}]),He===ft.LocationType.CURRENT_LOCATION||!Fi.locationType||Fi.locationType===""){const co=Fi.locationType===ft.LocationType.ZIP_CODE?ft.LocationType.ZIP_CODE:ft.LocationType.ADDRESS;rt(co),s0(zn(qt({},Fi),{locationType:co})),$a(co)}On("")}J1&&Qn.length!==3&&$r([{id:ft.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:ft.LocationType.ADDRESS,label:"Address"},{id:ft.LocationType.ZIP_CODE,label:"Zip code"}])},[He,Ji,Qn.length,Fi,s0,$a]);const W1=(ja,J1,co,zr,Rr,Re)=>{if(!hr.item)return;e0&&to(e0,[{valueString:co||""}]),Na&&to(Na,[{valueDecimal:ja}]),qs&&to(qs,[{valueDecimal:J1}]),H0&&to(H0,[{valueString:zr||""}]),s0(zn(qt({},Fi),{lat:String(ja),lng:String(J1),location:`${ja},${J1}`,zipCode:zr||"",placeId:Rr||"",addressDescription:Re||"",locationPermission:Ji}));const Se=K0()&&h1(zr||"");qo&&qo(Se),oo&&oo(Nn)};(0,t.useEffect)(()=>{const ja=()=>An(void 0,null,function*(){var J1;try{const co=yield D0({variables:{latitude:String(Fo?.coords.latitude),longitude:String(Fo?.coords.longitude)}}),zr=(J1=co?.data)==null?void 0:J1.geocodingByLatLon,Rr=zr?.stateCode||"",Re=zr?.zipCode||"";(!Re||!Rr)&&On(wn("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),Ks({latitude:Fo?.coords.latitude,longitude:Fo?.coords.longitude,state:Rr,zipcode:Re,placeId:void 0,addressDescription:void 0})}catch{rt(ft.LocationType.ADDRESS)}});He===ft.LocationType.CURRENT_LOCATION&&Fo&&ja()},[He,Fo]);const nl=ja=>{if(!ja||!ja.latitude||!ja.longitude||!ja.zipCode||!ja.stateCode){Ks({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),ja&&typeof ja.value=="string"&&ja.value.trim().length!==0&&On(wn("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}Ks({latitude:ja.latitude,longitude:ja.longitude,state:ja.stateCode,zipcode:ja.zipCode,placeId:ja.placeId,addressDescription:ja.description})};return(0,t.useEffect)(()=>{fo(li||Sa||_0||Zn)},[li,Sa,_0,Zn,fo]),(0,t.useEffect)(()=>{Fi.locationType!==He&&s0(zn(qt({},Fi),{locationType:He}))},[He]),(0,n.jsxs)("div",{"data-testid":hr.linkId,children:[(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:mr||!1,item:hr}),(0,n.jsx)(l.Select,{id:Nn,"aria-label":Nn,"data-testid":Nn,isDisabled:Ur||Sa||_0||po,selectedKey:He,onSelectionChange:ja=>{var J1;Ar("location_type_input_selected",{choice:(J1=Qn.find(({id:co})=>co===ja))==null?void 0:J1.label,_event_metadata:{description:"A user changed the location type input."}}),ja!==He&&($a(ja),rt(ja))},hint:Ct,isInvalid:!!Ct,items:Qn,placeholder:"Select an option",isRequired:mr,children:ja=>(0,n.jsx)(l.Select.Item,{id:ja.id,"data-testid":ja.id,value:ja,children:ja.label},ja.id)},Nn),He===ft.LocationType.CURRENT_LOCATION&&(0,n.jsx)(l.HintText,{isInvalid:!!St,children:St}),He===ft.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:mr||!1,item:hr}),(0,n.jsx)(ft.AddressTypeahead,{onValueChange:nl,isDisabled:po,setIsLoading:fo,initialValue:{placeId:Rn.current.placeId||"",description:Rn.current.addressDescription||""},errorText:St||Ct})]}),He===ft.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:mr||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:mr,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Nn}-zipcode`,placeholder:"Type your response here...",value:Rn.current.zipcode||"",onChange:c1,onBlur:I1,isDisabled:Ur||_0||po,hint:St||Ct,isInvalid:!!St||!!Ct,autoComplete:"postal-code"},`${Nn}-zipcode`)]})]})},_t=hr=>(0,n.jsx)(ft.DeviceLocationProvider,{children:(0,n.jsx)(lt,qt({},hr))}),dn={[i.cX]:_t,[i.G6]:te,[i.c3]:st,[i.AA]:Ee,[i.mO]:d,[i.PM]:I,[i.HH]:k,[i.Us]:xe,[i.Tl]:L,[i.G0]:A,[i.m3]:b,[i.PU]:R,[i.XP]:c.l,[i.uH]:P.v,[i.it]:De.d};var rr=e(81367),Br=e(94043);const jt=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar})=>{var Nn,mr;const{linkId:Ur,text:Ct,prefix:He,readOnly:rt,required:St,extension:On}=hr,{trackQuestionnaireEvent:Rn}=(0,h.c)(),Qn=Ct?(0,a.nt)(wn,He,Ct):"",$r=Zn?.[Ur];return On?.find(fo=>{var qo,Ho;return fo.url===i.gD&&((Ho=(qo=fo.valueCodeableConcept)==null?void 0:qo.coding)==null?void 0:Ho.some(Fo=>Fo.system===i.n4&&Fo.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":Ur,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Ur,children:[(0,n.jsx)(l.Checkbox,{size:"md",id:Ur,name:Ur,isDisabled:rt||Ar,isSelected:(Nn=oo?.[0])==null?void 0:Nn.valueBoolean,"aria-label":Ur,label:"",className:"mt-1",onChange:fo=>{Rn(hr.linkId,{value:fo}),gn(hr,[{valueBoolean:fo}]),to(hr.linkId)}}),Qn&&(0,n.jsx)(D.W,{isLabel:!0,text:Qn,required:St||!1,item:hr})]}),(0,n.jsx)(l.HintText,{isInvalid:!!$r,children:$r})]}):(0,n.jsxs)("div",{"data-testid":Ur,children:[Qn&&(0,n.jsx)(D.W,{isLabel:!0,text:Qn,required:St||!1,item:hr}),(0,n.jsxs)(l.RadioGroup,{size:"md",id:Ur,name:Ur,"aria-label":Ur,value:String((mr=oo?.[0])==null?void 0:mr.valueBoolean)||"",onChange:fo=>{gn(hr,[{valueBoolean:fo==="true"}]),to(hr.linkId)},isInvalid:!!$r,children:[(0,n.jsx)(l.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:rt||Ar}),(0,n.jsx)(l.RadioButton,{size:"md",value:"false",label:"No",isDisabled:rt||Ar})]},Ur),$r&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,Br.cx)("text-error-primary","text-sm","mt-[1.5]"),children:$r})})]})};var nn=Object.defineProperty,Bn=Object.getOwnPropertySymbols,xn=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,Pr=(hr,to,oo)=>to in hr?nn(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,Wt=(hr,to)=>{for(var oo in to||(to={}))xn.call(to,oo)&&Pr(hr,oo,to[oo]);if(Bn)for(var oo of Bn(to))Nr.call(to,oo)&&Pr(hr,oo,to[oo]);return hr};const Fe=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur,Ct,He;const{linkId:rt,text:St,required:On,answerOption:Rn,prefix:Qn,readOnly:$r}=hr,po=St?(0,a.nt)(wn,Qn,St):"",fo=Rn?.map(Fo=>{var li,Ji,Fi,s0;return{id:((li=Fo.valueCoding)==null?void 0:li.code)||Fo.valueString||"",label:((Ji=Fo.valueCoding)==null?void 0:Ji.display)||Fo.valueString||"",value:((Fi=Fo.valueCoding)==null?void 0:Fi.code)||Fo.valueString||"",extension:Fo.extension||[],system:((s0=Fo.valueCoding)==null?void 0:s0.system)||void 0}})||[],qo=((Ct=(Ur=oo?.[0])==null?void 0:Ur.valueCoding)==null?void 0:Ct.code)||((He=oo?.[0])==null?void 0:He.valueString)||"",Ho=Zn?.[rt];return(0,n.jsxs)("div",{children:[po&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:po,required:On||!1,item:hr}),(0,n.jsx)(l.Select,{id:rt,"aria-label":rt,"data-testid":rt,isDisabled:$r||Ar,selectedKey:qo,onSelectionChange:Fo=>{const li=String(Fo),Ji=fo.find(D0=>D0.value===li),Fi=Ji?Ji.label:"",s0=Boolean(Rn?.find(D0=>D0.valueString===li));gn(hr,[s0?{valueString:li}:{valueCoding:Wt({code:li,display:Fi},Ji?.system?{system:Ji.system}:{}),extension:Ji?.extension||[]}]),to(hr.linkId)},isInvalid:!!Ho,hint:Ho||mr,items:fo,placeholder:Nn,isRequired:On,children:Fo=>(0,n.jsx)(l.Select.Item,{id:Fo.id,"data-testid":Fo.value,value:Fo.value,children:Fo.label},Fo.id)},rt)]})};var it=Object.defineProperty,Ze=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ct=(hr,to,oo)=>to in hr?it(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,Pt=(hr,to)=>{for(var oo in to||(to={}))Qe.call(to,oo)&&ct(hr,oo,to[oo]);if(Ze)for(var oo of Ze(to))et.call(to,oo)&&ct(hr,oo,to[oo]);return hr};const ut=hr=>{var to,oo,gn;const{item:wn,selectedAnswer:Zn,updatedText:Ar,required:Nn,errorMessage:mr}=hr,Ur=wn?.type==="reference",Ct=(to=Zn?.map(Rn=>{var Qn,$r;return Ur?(Qn=Rn.valueReference)==null?void 0:Qn.display:($r=Rn.valueCoding)==null?void 0:$r.code}).filter(Rn=>Rn!==void 0))!=null?to:[],[He,rt]=(0,t.useState)(Ct.length),St=(gn=(oo=wn.extension)==null?void 0:oo.find(Rn=>Rn.url===i.Z_))==null?void 0:gn.valueInteger,On=(Rn,Qn)=>{var $r,po,fo;let qo;if(Rn){const Ho=hr.options.find(Fo=>Fo.value===Qn);qo=[...(po=($r=hr.selectedAnswer)==null?void 0:$r.filter(Fo=>Object.keys(Fo).length!==0))!=null?po:[],Ur?{valueReference:Ho?.valueReference}:{valueCoding:Pt({code:Qn,display:Ho?.label},Ho?.system?{system:Ho.system}:{}),extension:Ho?.extension||[]}],rt(Fo=>Fo+1)}else qo=((fo=hr.selectedAnswer)==null?void 0:fo.filter(Ho=>{var Fo,li;return Ur?((Fo=Ho.valueReference)==null?void 0:Fo.display)!==Qn:((li=Ho.valueCoding)==null?void 0:li.code)!==Qn}))||[{}],rt(Ho=>Ho-1);hr.handleInputChange(hr.item,qo)};return(0,n.jsxs)("div",{"data-testid":wn.linkId,children:[Ar&&(0,n.jsx)(D.W,{isLabel:!0,text:Ar,required:Nn||!1,item:wn}),(0,n.jsx)("div",{children:hr.options.map((Rn,Qn)=>(0,n.jsx)(l.Checkbox,{size:"md","data-testid":Rn.value,id:Qn.toString(),className:Qn!==hr.options.length-1?"mb-2xl":"",name:Rn.label,isInvalid:!!mr,isSelected:Ct?.includes(Rn?.value),label:Rn.label,onChange:$r=>On($r,Rn.value),isDisabled:hr.readOnly||hr.isLoading||(!Ct?.includes(Rn?.value)&&St?He>=St:!1)},Qn))}),(0,n.jsx)(l.HintText,{isInvalid:!!mr,children:mr})]})},ue=({item:hr,onCompleteHandler:to,updatedText:oo,options:gn,handleInputChange:wn,errorMessage:Zn,readOnly:Ar,initialValue:Nn,selectedAnswer:mr,isLoading:Ur,required:Ct})=>{var He,rt;const St=`${hr.linkId}-label`,On=`${hr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":hr.linkId,children:[oo&&(0,n.jsx)(D.W,{id:St,isLabel:!0,text:oo,required:Ct||!1,item:hr}),(0,n.jsx)(l.RadioGroup,{size:"md",id:hr.linkId,name:hr.linkId,"aria-labelledby":oo?St:void 0,"aria-describedby":Zn?On:void 0,isRequired:Ct,className:gn.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((rt=(He=mr?.[0])==null?void 0:He.valueCoding)==null?void 0:rt.code)||Nn||"",onChange:Rn=>{const Qn=Rn,$r=gn.find(fo=>fo.value===Qn),po=$r?$r.label:"";wn(hr,[{valueCoding:{code:Qn,display:po,system:$r?.system||void 0},extension:$r?.extension||[]}]),to(hr.linkId)},isInvalid:!!Zn,children:gn.map(Rn=>(0,n.jsx)(l.RadioButton,{size:"md","data-testid":Rn.value,isDisabled:Ar||Ur,value:Rn.value,label:Rn.label},Rn.value))},hr.linkId),Zn&&(0,n.jsx)("div",{id:On,children:(0,n.jsx)("span",{className:(0,Br.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Zn})})]})};var Ce=Object.defineProperty,Ve=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,Yt=(hr,to,oo)=>to in hr?Ce(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,yn=(hr,to)=>{for(var oo in to||(to={}))Te.call(to,oo)&&Yt(hr,oo,to[oo]);if(Ve)for(var oo of Ve(to))It.call(to,oo)&&Yt(hr,oo,to[oo]);return hr};const qn=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur,Ct,He,rt,St;const{linkId:On,text:Rn,required:Qn,answerOption:$r,prefix:po,readOnly:fo}=hr,qo=hr?.type==="reference",Ho=Rn?(0,a.nt)(wn,po,Rn):"",li=(()=>{var Ti,_0;const H0=$r?.find(e0=>e0.initialSelected===!0);return H0?qo?((Ti=H0.valueReference)==null?void 0:Ti.display)||"":((_0=H0?.valueCoding)==null?void 0:_0.code)||"":""})(),Ji=($r?.map(Ti=>{var _0,H0,e0,Na,qs;return{label:((_0=Ti?.valueCoding)==null?void 0:_0.display)||((H0=Ti?.valueReference)==null?void 0:H0.display)||"",value:qo?((e0=Ti.valueReference)==null?void 0:e0.display)||"":((Na=Ti.valueCoding)==null?void 0:Na.code)||"",valueReference:qo?Ti.valueReference:{},extension:Ti.extension||[],system:((qs=Ti.valueCoding)==null?void 0:qs.system)||""}})||[]).filter(Ti=>Ti.label),Fi=Zn?.[On],s0=(St=(rt=(He=(Ct=(Ur=hr?.extension)==null?void 0:Ur.find(Ti=>Ti.url.includes("questionnaire-itemControl")))==null?void 0:Ct.valueCodeableConcept)==null?void 0:He.coding)==null?void 0:rt[0])==null?void 0:St.code;let D0=null;const Sa={item:hr,onCompleteHandler:to,updatedText:Ho,options:Ji,handleInputChange:gn,errorMessage:Fi,required:Qn,readOnly:fo,initialValue:li,selectedAnswer:oo,isLoading:Ar,showQuestionPrefix:wn,placeholder:Nn,hintText:mr};switch(s0){case"drop-down":D0=(0,n.jsx)(Fe,yn({},Sa));break;case"check-box":D0=(0,n.jsx)(ut,yn({},Sa));break;case"radio-button":D0=(0,n.jsx)(ue,yn({},Sa));break}return(0,n.jsx)(n.Fragment,{children:D0})};var pr=e(8077),Ht=e(31936),we=e(77806),Xe=e(16681);const Dt=hr=>`${String(hr.month).padStart(2,"0")}/${String(hr.day).padStart(2,"0")}/${hr.year}`,sn=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur,Ct,He;const{linkId:rt,text:St,required:On,prefix:Rn,readOnly:Qn}=hr,$r=(0,t.useRef)(null),[po,fo]=(0,t.useState)(!1),[qo,Ho]=(0,t.useState)(null),{t:Fo}=(0,r.SS)(),{setIsCurrentFormValid:li,isCurrentFormValid:Ji,trackQuestionnaireEvent:Fi}=(0,h.c)(),s0=St?(0,a.nt)(wn,Rn,St):"",D0=Zn?.[rt]||"",Sa=(Ur=hr.extension)==null?void 0:Ur.find(zr=>zr.url===i.dU),Ti=(Ct=hr.extension)==null?void 0:Ct.find(zr=>zr.url===i.bK),_0=(0,t.useMemo)(()=>{var zr;const Rr=Sa?.valueString||Sa?.valueDate;return Rr||(0,a.iI)((zr=Sa?.valueExpression)==null?void 0:zr.expression)},[Sa]),H0=(0,t.useMemo)(()=>{var zr;const Rr=Ti?.valueString||Ti?.valueDate;return Rr||(0,a.iI)((zr=Ti?.valueExpression)==null?void 0:zr.expression)},[Ti]),e0=(0,t.useMemo)(()=>{if(_0&&/^\d{4}-\d{2}-\d{2}$/.test(_0))try{return(0,pr._U)(_0)}catch{}return(0,pr._U)("1900-01-01")},[_0]),Na=(0,t.useMemo)(()=>{if(H0&&/^\d{4}-\d{2}-\d{2}$/.test(H0))try{return(0,pr._U)(H0)}catch(zr){console.warn("Failed to parse maxDateStr:",H0,zr)}return(0,pr._U)("2099-12-31")},[H0]),h1=(zr=>{if(!zr)return"";const Rr=zr.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!Rr)return zr;const[,Re,Se,Ue]=Rr;return`${Se}/${Ue}/${Re}`})(((He=oo?.[0])==null?void 0:He.valueDate)||""),K0=zr=>{if(!zr)return"";const Rr=zr.replace(/\D/g,"");if(Rr.length===0)return"";if(Rr.length<=2)return Rr.length===2?`${Rr}/`:Rr;const Re=Ue=>{const Lt=Ue.slice(0,2),tn=Ue.slice(2);return tn.length===2?`${Lt}/${tn}/`:`${Lt}/${tn}`},Se=Ue=>{const Lt=Ue.slice(0,2),tn=Ue.slice(2,4),Mn=Ue.slice(4,8);return`${Lt}/${tn}/${Mn}`};return Rr.length<=4?Re(Rr):Se(Rr)},$a=()=>{if(Qn||Ar)return;if(h1.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const Rr=(0,pr._U)(h1);Ho(Rr)}catch{Ho(null)}else{const Rr=h1.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Rr){const[,Re,Se,Ue]=Rr,Lt=parseInt(Re,10),tn=parseInt(Se,10);if(Lt>=1&&Lt<=12&&tn>=1&&tn<=31)try{const Mn=(0,pr._U)(`${Ue}-${Re}-${Se}`);Ho(Mn)}catch{Ho(null)}else Ho(null)}else Ho(null)}fo(!0)},Ks=()=>{if(qo){const zr=`${qo.year}-${String(qo.month).padStart(2,"0")}-${String(qo.day).padStart(2,"0")}`;Fi(hr.linkId,{value:(0,a.CP)(`${String(qo.month).padStart(2,"0")}/${String(qo.day).padStart(2,"0")}/${qo.year}`)}),gn(hr,[{valueDate:(0,a.Fy)(zr)}])}fo(!1),Ho(null)},c1=()=>{fo(!1),Ho(null)},I1=zr=>{var Rr;const Re=((Rr=$r.current)==null?void 0:Rr.selectionStart)||0,Se=h1,Ue=K0(zr),Lt=Ue.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Lt){const[,tn,Mn,Sn]=Lt,_r=parseInt(tn,10),Cn=parseInt(Mn,10),Er=parseInt(Sn,10);if(W1(_r,Cn,Er).isValid){const Ln=`${Sn}-${tn}-${Mn}`;Fi(hr.linkId,{value:(0,a.CP)(`${tn}/${Mn}/${Sn}`)}),gn(hr,[{valueDate:(0,a.Fy)(Ln)}])}else gn(hr,[{valueDate:Ue}])}else gn(hr,[{valueDate:Ue}]);setTimeout(()=>{if($r.current){const tn=Se.replace(/\D/g,""),Mn=Ue.replace(/\D/g,"");let Sn=Re;Ue===Se&&(Sn=Re-1),Mn.length>=tn.length&&Ue!==Se?Ue[Re-1]==="/"?Sn=Re+1:Sn=Re:Mn.length<tn.length&&(Se[Re-1]==="/"?Sn=Math.max(0,Re-1):Sn=Re),$r.current.setSelectionRange(Sn,Sn)}},0)},W1=(zr,Rr,Re)=>{if(zr<1||zr>12)return{isValid:!1,error:(0,a.u0)(Fo,Xe.p.VALIDATION_MONTH_RANGE,"Month must be between 01 and 12")};if(Rr<1||Rr>31)return{isValid:!1,error:(0,a.u0)(Fo,Xe.p.VALIDATION_DAY_RANGE,"Day must be between 01 and 31")};const Se=new Date(Re,zr,0).getDate();if(Rr>Se)return{isValid:!1,error:(0,a.u0)(Fo,Xe.p.VALIDATION_INVALID_DAY_FOR_MONTH,"Invalid day for the selected month")};if(_0||H0){const Ue=new Ht.ng(Re,zr,Rr);if(_0&&/^\d{4}-\d{2}-\d{2}$/.test(_0))try{const Lt=(0,pr._U)(_0);if(Ue.compare(Lt)<0){const tn=(0,a.di)(i.Ck,hr.extension);if(tn)return{isValid:!1,error:tn};const Mn=Dt(Lt);return{isValid:!1,error:(0,a.u0)(Fo,Xe.p.VALIDATION_DATE_ON_OR_AFTER,"Date must be on or after {{minDate}}",{minDate:Mn})}}}catch{}if(H0&&/^\d{4}-\d{2}-\d{2}$/.test(H0))try{const Lt=(0,pr._U)(H0);if(Ue.compare(Lt)>0){const tn=(0,a.di)(i.Cx,hr.extension);if(tn)return{isValid:!1,error:tn};const Mn=Dt(Lt);return{isValid:!1,error:(0,a.u0)(Fo,Xe.p.VALIDATION_DATE_ON_OR_BEFORE,"Date must be on or before {{maxDate}}",{maxDate:Mn})}}}catch{}}return{isValid:!0,error:""}},nl=()=>{const zr=h1.replace(/\D/g,"");if(zr.length>0&&zr.length<8){to(hr.linkId);return}const Rr=h1.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!Rr&&zr.length>=6){to(hr.linkId);return}if(Rr){const[,Re,Se,Ue]=Rr,Lt=parseInt(Re,10),tn=parseInt(Se,10),Mn=parseInt(Ue,10);if(W1(Lt,tn,Mn).isValid){const Sn=`${Ue}-${Re}-${Se}`;gn(hr,[{valueDate:(0,a.Fy)(Sn)}])}}to(hr.linkId)},J1=(()=>{if(!h1)return"";const zr=h1.replace(/\D/g,"");if(zr.length>0&&zr.length<8)return"";const Rr=h1.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!Rr&&zr.length>=6)return Ji&&li(!1),(0,a.u0)(Fo,Xe.p.VALIDATION_INVALID_DATE,"Invalid date");if(Rr){const[,Re,Se,Ue]=Rr,Lt=parseInt(Re,10),tn=parseInt(Se,10),Mn=parseInt(Ue,10),{isValid:Sn,error:_r}=W1(Lt,tn,Mn);if(!Sn)return Ji&&li(!1),_r||(0,a.u0)(Fo,Xe.p.VALIDATION_INVALID_DATE,"Invalid date")}return""})(),co=!!D0||!!J1;return(0,n.jsxs)("div",{children:[s0&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:s0,required:On||!1,item:hr}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Qn||Ar,className:(0,Br.cx)("absolute top-2.5 right-3 z-3 cursor-pointer p-0.5","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Qn||Ar)&&"cursor-not-allowed opacity-50"),onClick:$a,"aria-label":"Open calendar",children:(0,n.jsx)(U.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,Br.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Qn||Ar)&&"bg-disabled_subtle")}),(0,n.jsx)(l.Input,{ref:$r,isRequired:On,size:"md",type:"text",name:rt,"data-testid":rt,id:rt,value:h1,onChange:I1,placeholder:Nn,isDisabled:Qn||Ar,onBlur:nl,hint:J1||D0||mr,isInvalid:co,className:(0,Br.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},rt)]}),(0,n.jsx)(l.Modal,{id:"calendar-date-picker-modal",isOpen:po,onOpenChange:zr=>{zr||c1()},primaryButton:{children:"Apply",onClick:Ks,isDisabled:!qo},secondaryButton:{children:"Cancel",onClick:c1},children:(0,n.jsx)(we.lr,{value:qo,onChange:Ho,minValue:e0,maxValue:Na,children:(0,n.jsx)(l.Calendar,{showDateInput:!1,minValue:e0,maxValue:Na,onYearPickerOpen:()=>{Ho(null)}})})})]})},un=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar})=>{var Nn;const{linkId:mr,text:Ur,required:Ct,prefix:He,readOnly:rt}=hr,St=Ur?(0,a.nt)(wn,He,Ur):"",On=Zn?.[mr]||"";return(0,n.jsxs)("div",{children:[St&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:St,required:Ct||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:Ct,size:"md",type:"datetime-local",id:mr,"aria-label":mr,"data-testid":mr,placeholder:"Type your response here...",value:((Nn=oo?.[0])==null?void 0:Nn.valueDateTime)||"",onChange:Rn=>{let Qn=Rn;const[$r,po]=Qn.split("T");$r&&po&&(Qn=`${(0,a.Fy)($r)}T${po}:00`),gn(hr,[{valueDateTime:Qn}])},isDisabled:rt||Ar,onBlur:()=>{to(hr.linkId)},hint:On,isInvalid:!!On},mr)]})},Jt=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:On}=hr,Rn=He?(0,a.nt)(wn,St,He):"",Qn=Zn?.[Ct]||"",$r=(0,a.a0)(hr),po=(Ur=oo?.[0])==null?void 0:Ur.valueDecimal,[fo,qo]=(0,t.useState)(String(po??""));return(0,t.useEffect)(()=>{qo(String(po??""))},[po]),(0,n.jsxs)("div",{children:[Rn&&(0,n.jsx)(D.W,{isLabel:!0,text:Rn,required:rt||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:rt,size:"md",id:Ct,"aria-label":Ct,"data-testid":Ct,placeholder:Nn,value:fo,onChange:Ho=>{qo(Ho)},isDisabled:On||Ar,onBlur:()=>{const Ho=parseFloat(fo);qo(isNaN(Ho)?"":String(Ho)),gn(hr,[{valueDecimal:isNaN(Ho)?void 0:Ho}]),to(hr.linkId)},type:"number",hint:Qn||mr,isInvalid:!!Qn,autoComplete:$r},Ct)]})},Fn=({item:hr,showStepper:to=!1})=>{var oo;const{text:gn,linkId:wn,type:Zn}=hr,Ar=gn&&(0,a.nt)(!1,"",gn),Nn=(oo=hr.extension)==null?void 0:oo.find(He=>He.url===i.Yt),mr=Nn?.valueBoolean===!0,Ur=Zn==="group"&&(0,a.$O)(hr)!==void 0,Ct=()=>{const He=(0,a.$O)(hr),rt=(0,a.t7)(hr);if(He===void 0||rt===void 0||rt<=0)return[];const St=[];for(let On=1;On<=rt;On++){let Rn="incomplete";On<He?Rn="complete":On===He&&(Rn="current"),St.push({title:"",description:"",status:Rn})}return St};return Ar&&!mr?(0,n.jsxs)("div",{"data-testid":wn,children:[(0,n.jsx)(D.W,{text:Ar,required:!1,className:""}),to&&Ur&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(l.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:Ct()})})]}):null},gr=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:On}=hr,Rn=He?(0,a.nt)(wn,St,He):"",Qn=Zn?.[Ct]||"",$r=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Rn&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:Rn,required:rt||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:rt,"data-testid":Ct,size:"md",id:Ct,"aria-label":Ct,placeholder:Nn,value:String((Ur=oo?.[0])==null?void 0:Ur.valueInteger)||"",onChange:po=>{gn(hr,[{valueInteger:Number(po)}])},isDisabled:On||Ar,onBlur:()=>{to(hr.linkId)},type:"number",hint:Qn||mr,isInvalid:!!Qn,autoComplete:$r},Ct)]})},Tr=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur,Ct,He;const{linkId:rt,text:St,extension:On,required:Rn,prefix:Qn,readOnly:$r}=hr,po=St?(0,a.nt)(wn,Qn,St):"",fo=On?.find(Fo=>Fo.url.includes("questionnaire-unitOption")),qo=Zn?.[rt],Ho=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[po&&(0,n.jsx)(D.W,{isLabel:!0,text:po,required:Rn||!1,item:hr}),(0,n.jsx)(l.InputGroup,{isRequired:Rn,size:"md",id:rt,"aria-label":rt,"data-testid":rt,value:(Ur=oo?.[0])!=null&&Ur.valueQuantity?String((Ct=oo[0].valueQuantity)==null?void 0:Ct.value):"",onChange:Fo=>{gn(hr,[{valueQuantity:{value:parseFloat(Fo)}}])},isDisabled:$r||Ar,onBlur:()=>{var Fo,li,Ji;const Fi=(Fo=oo?.[0])!=null&&Fo.valueQuantity?parseFloat(String((Ji=(li=oo?.[0])==null?void 0:li.valueQuantity)==null?void 0:Ji.value)).toFixed(2):"";gn(hr,[{valueQuantity:{value:parseFloat(Fi)}}]),to(hr.linkId)},hint:qo||mr,isInvalid:!!qo,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:(He=fo?.valueCoding)==null?void 0:He.display}),children:(0,n.jsx)(l.InputBase,{type:"number",placeholder:Nn,autoComplete:Ho})},rt)]})},Xr={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},Qr={[Xr.CURRENT_LOCATION]:Xe.p.CURRENT_LOCATION,[Xr.ZIP_CODE]:Xe.p.ZIP_CODE,[Xr.ADDRESS]:Xe.p.ADDRESS},Oo={mi:{singular:Xe.p.MILE,plural:Xe.p.MILES}},gt=({resourceData:hr,handleInputChange:to,item:oo,questionnaireSchemaItems:gn})=>{var wn;const{t:Zn}=(0,r.SS)(),{queryParams:Ar}=(0,ft.useSearchQueryParams)(),Nn=Ar.locationType||"",{setCurrentGroupIndex:mr,handleContinueButtonClick:Ur,setHideFooterButton:Ct}=(0,h.c)(),{trackEvent:He}=(0,o.st)();(0,t.useEffect)(()=>{if(!oo.readOnly)return Ct(!0),()=>{Ct(!1)}},[oo.readOnly,Ct]);const rt=(wn=oo.extension)==null?void 0:wn.find(li=>li.url===i.Uf),St=rt?.valueString,On=()=>{if(St){const li=(0,a.Ue)(gn||[],St);li!==-1&&mr(li)}},Rn=li=>{const Ji=li.find(Fi=>Fi.url.includes("description"));return Ji?.valueString||""},Qn=li=>{const Ji=li.find(_0=>_0.url.includes("distance-value")),Fi=li.find(_0=>_0.url.includes("distance-unit")),s0=Ji?.valueString?Number(Ji.valueString):NaN,D0=Fi?.valueString||"";if(!D0||isNaN(s0))return null;const Sa=Math.round(s0);let Ti=D0;return Oo[D0]&&(Ti=Zn(Sa===1?Oo[D0].singular:Oo[D0].plural)),Nn&&Qr[Nn]?Zn(Xe.p.LOCATION_DISTANCE,{distance:`${Sa} ${Ti}`,locationType:Zn(Qr[Nn])}):Zn(Xe.p.LOCATION_DISTANCE_AWAY,{distance:`${Sa} ${Ti}`})},$r=li=>({id:li.id||"",providerName:li.name||"",specialty:"",distance:Qn(li.extension||[])||"",placeholderIcon:l.WalgreensLogo,address:li.address||"",valueReference:li.valueReference||{reference:li.id}}),po=li=>{var Ji,Fi,s0,D0;const Sa=li;return $r({id:Sa.id,name:(Ji=Sa.name)!=null?Ji:"",address:(D0=(s0=(Fi=Sa?.address)==null?void 0:Fi.line)==null?void 0:s0[0])!=null?D0:"",extension:Sa?.extension,valueReference:{reference:Sa.id}})},fo=li=>$r({id:li?.reference,name:li?.display,address:Rn(li?.extension||[]),extension:li?.extension,valueReference:li}),Ho=(()=>hr&&Array.isArray(hr)&&hr.length>0?hr.map(po):oo.initial&&Array.isArray(oo.initial)&&oo.initial.length>0?oo.initial.map(li=>fo(li.valueReference)):oo.answerOption?oo.answerOption.map(li=>fo(li.valueReference)):[])(),Fo=li=>{to(oo,[{valueReference:li}])};return(0,n.jsx)("div",{className:(0,l.cx)("gap-md flex flex-col",!oo.readOnly&&"pb-4xl"),children:oo.readOnly?Ho.map(({address:li,id:Ji,providerName:Fi,placeholderIcon:s0,distance:D0})=>(0,n.jsx)(ft.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:s0},locationName:Fi,address:li,distance:D0,actionButtonText:St?"Change location":void 0,onActionButtonClick:St?On:void 0},Ji)):Ho.map(({address:li,id:Ji,providerName:Fi,placeholderIcon:s0,specialty:D0,valueReference:Sa,distance:Ti})=>(0,n.jsx)(l.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:s0},providerName:{content:Fi},specialty:{content:D0},location:{address:li,distance:Ti},actionButton:{children:"Schedule appointment",onClick:()=>{He("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:li,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),Fo(Sa),Ur?.()}}},Ji))})};var Bt=e(79079),en=e(21886),Rt=e(43915),Kt=e(36181),At=e(37234),Je=e(65388),zt=Object.defineProperty,Vt=Object.defineProperties,vn=Object.getOwnPropertyDescriptors,rn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,Sr=(hr,to,oo)=>to in hr?zt(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,ur=(hr,to)=>{for(var oo in to||(to={}))hn.call(to,oo)&&Sr(hr,oo,to[oo]);if(rn)for(var oo of rn(to))kn.call(to,oo)&&Sr(hr,oo,to[oo]);return hr},Lr=(hr,to)=>Vt(hr,vn(to));const si={"ui-toolkit/LocationCard":gt,"ui-toolkit/TimeSlotSelection":({resourceData:hr,item:to,handleInputChange:oo,selectedAnswer:gn,questionnaireSchemaItems:wn,formData:Zn,onCompleteHandler:Ar})=>{var Nn,mr;const{t:Ur}=(0,Bt.S)(),{trackEvent:Ct}=(0,o.st)(),{isLoading:He,setIsInlineNextQuestionTriggered:rt}=(0,h.c)(),St=Re=>{const Se=Re.match(/^(\d{4}-\d{2}-\d{2})/);return Se?Se[1]:Re},On=(0,t.useCallback)(Re=>{var Se;return(Se=Re.find(Ue=>Ue?.url===i.zD||Ue?.url===i.UZ))==null?void 0:Se.valueCode},[]),Rn=(0,t.useCallback)((Re,Se)=>{const Ue=On(Se);if(!Ue)return ye(Re);try{return(0,ne.formatToTimeZone)(Re,"h:mm A",{timeZone:Ue})}catch{return ye(Re)}},[On]),Qn=(0,t.useCallback)((Re,Se)=>{const Ue=On(Se);if(!Ue)return St(Re);try{return(0,ne.formatToTimeZone)(Re,"YYYY-MM-DD",{timeZone:Ue})}catch{return St(Re)}},[On]),$r=Re=>{const Se=Re.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Se){const[,Ue,Lt,tn]=Se;return new Date(parseInt(Ue),parseInt(Lt)-1,parseInt(tn))}return new Date},fo=(()=>{var Re;if((Re=gn?.[0])!=null&&Re.valueReference){const Se=gn[0].valueReference,Ue=Se.display||"",Lt=Qn(Ue,Se.extension||[]);if(Lt)return{date:$r(Lt),slotId:Se.reference||""}}return{date:new Date,slotId:""}})(),[qo,Ho]=(0,t.useState)(fo.date),[Fo,li]=(0,t.useState)(fo.slotId),[Ji,Fi]=(0,t.useState)(new Set),s0=(0,t.useMemo)(()=>new Ht.ng(qo.getFullYear(),qo.getMonth()+1,qo.getDate()),[qo]),D0=Re=>({display:Re.display||"",id:Re.id||"",start:Re.start||"",extension:Array.isArray(Re.extension)?Re.extension:[],identifier:Array.isArray(Re.identifier)?Re.identifier:[],type:Re.type||""}),Sa=Re=>{var Se;return D0({display:(Se=Re.start)!=null?Se:"",id:Re.id,start:Re.start,extension:Re.extension,identifier:Re.identifier})},Ti=Re=>D0({display:Re?.display||"",id:Re?.reference,start:Re?.display,extension:Re?.extension,identifier:Re?.identifier,type:Re?.type}),_0=()=>{if(Array.isArray(hr)&&hr.length>0)return hr.filter(Re=>Re.resourceType==="Appointment").map(Sa);if(to.initial&&Array.isArray(to.initial)&&to.initial.length>0)return to.initial.map(Re=>Ti(Re.valueReference));if(to.answerOption)return to.answerOption.map(Re=>Ti(Re.valueReference))},H0=(0,t.useMemo)(()=>_0()||[],[hr,gn,to]),e0=(0,t.useMemo)(()=>{const Re={};return H0.forEach(Se=>{if(Se.start&&Se.id){const Ue=Qn(Se.start,Se.extension);Re[Ue]||(Re[Ue]=[]),Re[Ue].push({display:Se.display,id:Se.id,start:Se.start,extension:Se.extension})}}),Re},[H0,Qn]),Na=(0,t.useMemo)(()=>{const Re=Object.keys(e0).sort(),Se=[];if(Re.length===0)return Se.push(s0),Ji.forEach(tn=>{const Mn=(0,Rt.A)(tn);Se.push(new Ht.ng(Mn.getFullYear(),Mn.getMonth()+1,Mn.getDate()))}),Se;const Ue=(0,Rt.A)(Re[Re.length-1]),Lt=new Ht.ng(Ue.getFullYear(),Ue.getMonth()+1,Ue.getDate());for(let tn=s0;tn.compare(Lt)<=0;tn=tn.add({days:1})){const Mn=`${tn.year}-${String(tn.month).padStart(2,"0")}-${String(tn.day).padStart(2,"0")}`;e0[Mn]||Se.push(tn)}if(!(0,a.mR)(to)){const tn=(0,en.Ec)((0,en.Xj)()).add({days:30});let Mn=Lt.add({days:1});for(;Mn.compare(tn)<=0;)Se.push(Mn),Mn=Mn.add({days:1})}return Ji.forEach(tn=>{const Mn=(0,Rt.A)(tn),Sn=new Ht.ng(Mn.getFullYear(),Mn.getMonth()+1,Mn.getDate());Se.some(_r=>_r.year===Sn.year&&_r.month===Sn.month&&_r.day===Sn.day)||Se.push(Sn)}),Se},[e0,Ji,s0,to]),qs=(0,t.useMemo)(()=>(0,a.mR)(to)?l.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[to]),h1=(0,t.useMemo)(()=>Object.keys(e0).map(Re=>{const Se=(0,Rt.A)(Re);return new Ht.ng(Se.getFullYear(),Se.getMonth()+1,Se.getDate())}),[e0]),K0=(0,Kt.A)((0,At.A)(qo),"yyyy-MM-dd"),$a=(0,t.useMemo)(()=>e0[K0]||[],[e0,K0]);(0,t.useEffect)(()=>{const Re=Object.entries(e0).sort(([Se],[Ue])=>Se.localeCompare(Ue)).slice(0,3).reduce((Se,[Ue,Lt])=>Lr(ur({},Se),{[`${Ue} ${W1}`]:Lt.map(tn=>{var Mn;return(0,Je.YX)({time:tn.start,timeZone:(0,a.lv)((Mn=$a[0])==null?void 0:Mn.extension)}).time})}),{});Ct("slots_returned",{Specialty:"Vaccines",first_three_days_slots:Re,_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 Ks=t.useRef(null),c1=t.useRef(null),I1=t.useRef(!1);(0,t.useEffect)(()=>{var Re;const Se=Object.keys(e0).sort();Se.length===0||I1.current||(I1.current=!0,(Re=gn?.[0])!=null&&Re.valueReference||Ho((0,Rt.A)(Se[0])))},[e0]),(0,t.useEffect)(()=>{var Re;const Se=Object.keys(e0).sort();if(Se.length===0)return;const Lt=!(Ks.current===null)&&JSON.stringify(Ks.current)!==JSON.stringify(e0);if(Ks.current=e0,!!Lt&&(Fi(new Set),c1.current)){const tn=c1.current;if(!(((Re=e0[tn])==null?void 0:Re.length)>0)){const Sn=new Set,_r=(0,Rt.A)(tn),Cn=(0,Rt.A)(Se[0]);let Er=_r;for(;Er<Cn;){const Ln=(0,Kt.A)(Er,"yyyy-MM-dd");Sn.add(Ln),Er=new Date(Er),Er.setDate(Er.getDate()+1)}Fi(Sn),li("")}c1.current=null}},[e0]);const W1=(0,t.useMemo)(()=>{const Re=$a[0];if(!Re?.extension)return"";const Se=On(Re.extension);try{return(0,ne.formatToTimeZone)(new Date,"(z)",{timeZone:Se??""})}catch{return""}},[$a,On]),nl=(0,t.useMemo)(()=>{const Re=Ur(l.Translations.NEXT_AVAILABLE_APPOINTMENTS);return W1?`${Re} ${W1}`:Re},[Ur,W1]),ja=(0,t.useMemo)(()=>{const Re=(0,en.Ec)((0,en.Xj)()).add({days:qs}),Se=`${Re.year}-${String(Re.month).padStart(2,"0")}-${String(Re.day).padStart(2,"0")}`,Lt=Object.keys(e0).sort().find(tn=>tn>K0&&tn<=Se);if(Lt){const tn=(0,Rt.A)(Lt);return new Ht.ng(tn.getFullYear(),tn.getMonth()+1,tn.getDate())}return null},[e0,K0,qs]),J1=()=>{if(ja){const Re=ja.toDate((0,en.Xj)());Ho(Re),li("")}},co=Re=>{if(!Re){li(""),oo(to,void 0);return}li(Re.id);const Se=[{valueReference:{display:Re.display,reference:Re.id,extension:Re.extension,identifier:Re.identifier,type:Re.type}}];oo(to,Se)},zr=Re=>{var Se;if(!Re||He||!I1.current)return;const Ue=Object.keys(e0).sort(),Lt=Ue[Ue.length-1],tn=Ue[0],Mn=`${Re.year}-${String(Re.month).padStart(2,"0")}-${String(Re.day).padStart(2,"0")}`;if(Lt&&(Mn>Lt||tn&&Mn<tn)&&(0,a.mR)(to)&&wn&&!Na?.some(_r=>_r.compare(Re)===0)){const _r=(0,a.yQ)(to,wn);if(_r){c1.current=Mn;let Cn="-06:00";if((Se=H0[0])!=null&&Se.start){const Jr=H0[0].start.match(/([+-]\d{2}:\d{2})$/);Jr&&(Cn=Jr[1])}const Ln=[{valueDateTime:`${Mn}T23:59:59${Cn}`}],Fr=oo(_r,Ln);oo(to,void 0,(0,a.Nw)(Fr||Zn||[],to.linkId),void 0,!0),rt(!0),Ar(_r.linkId,!0,!0)}}const Sn=Re.toDate((0,en.Xj)());Ho(Sn)},Rr=Re=>{if(!Re)return;const Se=$a.find(Ue=>Ue.id===Re);Ct("slot_selected",{Specialty:"Vaccines",time_slot:Se?(0,Je.YX)({time:Se.start,timeZone:(0,a.lv)($a[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."}}),co(Se??null)};return(0,n.jsx)(l.TimeSlot,{onChange:zr,disabledDates:Na,highlightedDates:h1,loading:He,minValue:(0,en.Ec)((0,en.Xj)()),maxValue:(0,en.Ec)((0,en.Xj)()).add({days:qs}),value:s0,defaultValue:s0,appointmentSlots:{title:nl,onChange:Rr,defaultValue:gn&&((mr=(Nn=gn[0])==null?void 0:Nn.valueReference)==null?void 0:mr.reference)||void 0,value:Fo||void 0,items:$a.map(Re=>({label:Rn(Re.start,Re.extension),value:Re.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Ur(l.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),ja&&(0,n.jsx)("button",{onClick:J1,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Ur(l.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var yo=Object.defineProperty,Wo=Object.defineProperties,Do=Object.getOwnPropertyDescriptors,ii=Object.getOwnPropertySymbols,tr=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,Dr=(hr,to,oo)=>to in hr?yo(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,Ro=(hr,to)=>{for(var oo in to||(to={}))tr.call(to,oo)&&Dr(hr,oo,to[oo]);if(ii)for(var oo of ii(to))dr.call(to,oo)&&Dr(hr,oo,to[oo]);return hr},Ao=(hr,to)=>Wo(hr,Do(to)),bi=(hr,to)=>{var oo={};for(var gn in hr)tr.call(hr,gn)&&to.indexOf(gn)<0&&(oo[gn]=hr[gn]);if(hr!=null&&ii)for(var gn of ii(hr))to.indexOf(gn)<0&&dr.call(hr,gn)&&(oo[gn]=hr[gn]);return oo};const Ni=(hr,to)=>hr.answerOption?hr.answerOption.map(oo=>{var gn,wn;const Zn=(wn=(gn=oo.valueReference)==null?void 0:gn.reference)==null?void 0:wn.replace("#","");return to.find(Ar=>Ar.id===Zn)}).filter(Boolean):[],Wi=hr=>{var to,oo,gn;const wn=hr.find(Zn=>{var Ar,Nn;return Zn.url.includes("questionnaire-itemControl")&&((Nn=(Ar=Zn.valueCodeableConcept)==null?void 0:Ar.coding)==null?void 0:Nn.some(mr=>{var Ur;return(Ur=mr.code)==null?void 0:Ur.startsWith("ui-toolkit/")}))});return(gn=(oo=(to=wn?.valueCodeableConcept)==null?void 0:to.coding)==null?void 0:oo.find(Zn=>{var Ar;return(Ar=Zn.code)==null?void 0:Ar.startsWith("ui-toolkit/")}))==null?void 0:gn.code},Qi=hr=>{var{uiToolkitCode:to,props:oo}=hr,gn=oo,{item:wn,contained:Zn=[],customErrorConfigurations:Ar}=gn,Nn=bi(gn,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:mr}=(0,h.c)(),Ur=si[to];if(!Ur)return(0,n.jsx)(n.Fragment,{});const Ct=Ni(wn,Zn),He=Ct.length>0;return!(wn.answerOption&&wn.answerOption.length>0)&&!He&&!wn.readOnly?(mr(!0),(0,n.jsx)(ze,{configKey:to,customErrorConfigurations:Ar})):(0,n.jsx)(Ur,Ao(Ro({},Nn),{item:wn,contained:Zn,customErrorConfigurations:Ar,resourceData:Ct,"data-testid":wn.linkId}))},j0=hr=>{var to,oo,gn,wn,Zn;const{setHideFooterButton:Ar}=(0,h.c)(),{item:Nn,customErrorConfigurations:mr}=hr,Ur=Nn.extension||[],Ct=Wi(Ur);return Ct?(0,n.jsx)(Qi,{uiToolkitCode:Ct,props:hr}):((Zn=(wn=(gn=(oo=(to=Nn?.extension)==null?void 0:to.find(rt=>rt.url.includes("questionnaire-itemControl")))==null?void 0:oo.valueCodeableConcept)==null?void 0:gn.coding)==null?void 0:wn[0])==null?void 0:Zn.code)==="check-box"?Nn.answerOption&&Nn.answerOption.length>0?(0,n.jsx)(qn,Ao(Ro({},hr),{item:Nn})):(Ar(!0),(0,n.jsx)(ze,{configKey:Nn.linkId,customErrorConfigurations:mr})):null},C0=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:On}=hr,Rn=He?(0,a.nt)(wn,St,He):"",Qn=Zn?.[Ct]||"",$r=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Rn&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:Rn,required:rt||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:rt,size:"md","aria-label":Ct,"data-testid":Ct,id:Ct,type:$r==="tel"?"tel":"text",placeholder:Nn,value:((Ur=oo?.[0])==null?void 0:Ur.valueString)||"",onChange:po=>{gn(hr,[{valueString:po}])},isDisabled:On||Ar,onBlur:po=>{const fo=po.target.value,qo=fo.trim();qo!==fo&&gn(hr,[{valueString:qo}]),to(hr.linkId)},hint:Qn||mr,isInvalid:!!Qn,autoComplete:$r},Ct)]})},ga=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:On,maxLength:Rn}=hr,Qn=He?(0,a.nt)(wn,St,He):"",$r=Zn?.[Ct]||"",po=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Qn&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:Qn,required:rt||!1,item:hr}),(0,n.jsx)(l.TextArea,{isRequired:rt,id:Ct,"aria-label":Ct,"data-testid":Ct,rows:3,placeholder:Nn,value:((Ur=oo?.[0])==null?void 0:Ur.valueString)||"",onChange:fo=>{gn(hr,[{valueString:fo}])},isDisabled:On||Ar,onBlur:fo=>{const qo=fo.target.value,Ho=qo.trim();Ho!==qo&&gn(hr,[{valueString:Ho}]),to(hr.linkId)},hint:$r||mr,counter:!0,isInvalid:!!$r,maxLength:Rn,autoComplete:po},Ct)]})},G0=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar})=>{var Nn;const{linkId:mr,text:Ur,required:Ct,prefix:He,readOnly:rt}=hr,St=Ur?(0,a.nt)(wn,He,Ur):"",On=Zn?.[mr]||"";return(0,n.jsxs)("div",{children:[St&&(0,n.jsx)(D.W,{isLabel:!0,text:St,required:Ct||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:Ct,size:"md",type:"time",id:mr,"data-testid":mr,"aria-label":mr,placeholder:"Type your response here...",value:((Nn=oo?.[0])==null?void 0:Nn.valueTime)||"",onChange:Rn=>{gn(hr,[{valueTime:Rn}])},isDisabled:rt||Ar,onBlur:()=>{to(hr.linkId)},hint:On,isInvalid:!!On},mr)]})},f0=({item:hr,onCompleteHandler:to,selectedAnswer:oo,handleInputChange:gn,showQuestionPrefix:wn,errors:Zn,isLoading:Ar,placeholder:Nn,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:On}=hr,Rn=He?(0,a.nt)(wn,St,He):"",Qn=Zn?.[Ct]||"",$r=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Rn&&(0,n.jsx)(D.W,{isLabel:!0,className:"mb-sm text-md",text:Rn,required:rt||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:rt,size:"md",type:"url",id:Ct,"data-testid":Ct,"aria-label":Ct,placeholder:Nn,value:((Ur=oo?.[0])==null?void 0:Ur.valueUri)||"",onChange:po=>{gn(hr,[{valueUri:po}])},isDisabled:On||Ar,onBlur:po=>{const fo=po.target.value,qo=fo.trim();qo!==fo&&gn(hr,[{valueUri:qo}]),to(hr.linkId)},hint:Qn||mr,isInvalid:!!Qn,autoComplete:$r},Ct)]})},ji={attachment:rr.i,choice:qn,boolean:jt,integer:gr,string:C0,url:f0,text:ga,date:sn,time:G0,dateTime:un,quantity:Tr,decimal:Jt,question:Fn,display:Fn,group:Fn,reference:j0};var m0=(hr,to,oo)=>new Promise((gn,wn)=>{var Zn=mr=>{try{Nn(oo.next(mr))}catch(Ur){wn(Ur)}},Ar=mr=>{try{Nn(oo.throw(mr))}catch(Ur){wn(Ur)}},Nn=mr=>mr.done?gn(mr.value):Promise.resolve(mr.value).then(Zn,Ar);Nn((oo=oo.apply(hr,to)).next())});const La=({item:hr,selectedAnswer:to,showQuestionPrefix:oo})=>{const{text:gn,prefix:wn,required:Zn}=hr,Ar=gn?getUpdatedQuestionText(oo,wn,gn):"",[Nn,mr]=useState(null),[Ur,Ct]=useState(!1),{documentDownload:He,webview:rt}=useNativeBridge(),St=(to||[]).filter($r=>{var po,fo;return((po=$r.valueAttachment)==null?void 0:po.data)&&((fo=$r.valueAttachment)==null?void 0:fo.title)}).map(($r,po)=>{var fo,qo,Ho,Fo,li,Ji,Fi;return{id:((fo=$r.valueAttachment)==null?void 0:fo.id)||`preview-${po}`,fileName:((qo=$r.valueAttachment)==null?void 0:qo.title)||`attachment-${po}`,contentType:((Ho=$r.valueAttachment)==null?void 0:Ho.contentType)||"application/octet-stream",base64Data:((Fo=$r.valueAttachment)==null?void 0:Fo.data)||"",size:getBase64Size(((li=$r.valueAttachment)==null?void 0:li.data)||"",(Ji=$r.valueAttachment)==null?void 0:Ji.contentType),type:getFileTypeFromMimeType((Fi=$r.valueAttachment)==null?void 0:Fi.contentType)}}),On=useCallback($r=>{const{fileName:po,contentType:fo,base64Data:qo}=$r;if(rt.isWithin)mr({fileName:po,contentType:fo,base64Data:qo}),Ct(!0);else{const Ho=base64toObjectUrl(qo,fo),Fo=document.createElement("a");Fo.href=Ho,Fo.download=po,document.body.appendChild(Fo),Fo.click(),document.body.removeChild(Fo),URL.revokeObjectURL(Ho)}},[rt.isWithin]),Rn=useCallback(()=>m0(void 0,null,function*(){!Nn||(yield He.writeFile(Nn.fileName,prepareDataUrl(Nn.base64Data,Nn.contentType)))}),[Nn,He]),Qn=useCallback(()=>{Ct(!1),mr(null)},[]);return St.length?jsxs("div",{children:[Ar&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:Ar,required:Zn||!1,item:hr}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:St.map($r=>jsx("button",{type:"button",onClick:()=>On($r),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName($r.fileName),size:$r.size,type:$r.type})},$r.id))}),jsx(DownloadDisclosureModal,{opened:Ur,onClose:Qn,onDownload:Rn,contentType:Nn?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var cr=Object.defineProperty,nr=Object.defineProperties,jr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,ko=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Gn=(hr,to,oo)=>to in hr?cr(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,Or=(hr,to)=>{for(var oo in to||(to={}))ko.call(to,oo)&&Gn(hr,oo,to[oo]);if(Ir)for(var oo of Ir(to))En.call(to,oo)&&Gn(hr,oo,to[oo]);return hr},uo=(hr,to)=>nr(hr,jr(to));const or=(hr,to,oo,gn)=>{var wn;const Zn=hr.extension||[];if(gn?.[BUTTON_TYPE_EXTERNAL_KEY]&&Zn.some(He=>He.url===BUTTON_TYPE_EXTENSION_URL))return gn[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(hr)||hasParentWithUIToolkitWidget(hr,to))return null;if(oo&&hr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const Ar=getUIToolkitCode(Zn),Nn=Zn.filter(He=>He.url.includes("questionnaire-itemControl")).flatMap(He=>{var rt,St;return(St=(rt=He.valueCodeableConcept)==null?void 0:rt.coding)!=null?St:[]})||[];let mr;gn&&(mr=(wn=Nn.find(He=>He.code&&gn[He.code]))==null?void 0:wn.code);const Ur=gn?.[hr.linkId];return(mr&&gn?gn[mr]:void 0)||Ur||UI_TOOLKIT_WIDGET_MAP[Ar||""]||typeToRenderFunctionMap[hr.type]||null},Jn=hr=>{var to;const{item:oo,selectedAnswer:gn,handleInputChange:wn,showQuestionPrefix:Zn,errors:Ar,questionnaireSchemaItems:Nn,formData:mr,isNestedRepeatedItem:Ur=!1}=hr,{linkId:Ct,text:He,prefix:rt,required:St,repeats:On}=oo,Rn=getMaxOccursFromExtensions(oo.extension),Qn=getPlaceholderFromExtensions(oo.extension,oo.type),[$r,po]=useState(()=>{if(oo.type==="group"&&oo.item&&oo.item.length>0){const Ti=mr?.filter(_0=>_0.linkId===oo.linkId)||[];if(Ti.length>0)return Ti.map((_0,H0)=>H0)}else if(gn&&gn.length>0)return gn.map((Ti,_0)=>_0);return[0]}),fo=Rn!==void 0&&$r.length>=Rn,qo=He?getUpdatedQuestionText(Zn,rt,He):"",Ho=()=>{const Ti=Math.max(...$r,-1)+1,_0=[...$r,Ti];if(po(_0),oo.type==="group"&&oo.item&&oo.item.length>0){const H0=oo.item.map(Na=>({linkId:Na.linkId,text:Na.text,answer:[{}]})),e0={linkId:oo.linkId,text:oo.text,answer:[{}],item:H0};wn(oo,void 0,[e0])}else{const H0=[...gn||[]];H0.push({}),wn(oo,H0)}},Fo=Ti=>{if($r.length<=1)return;const _0=$r.filter((H0,e0)=>e0!==$r.length-1);if(po(_0),oo.type==="group"&&oo.item&&oo.item.length>0){const H0=[];if(mr?.forEach((e0,Na)=>{e0.linkId===Ct&&H0.push({item:e0,originalIndex:Na})}),Ti>=0&&Ti<H0.length){const e0=H0[Ti],Na=mr?.filter((qs,h1)=>h1!==e0.originalIndex);wn(oo,void 0,Na,void 0,!0)}}else{const H0=gn?.filter((e0,Na)=>Na!==Ti)||[];wn(oo,H0.length>0?H0:[{}])}},li=Ti=>{if(!mr||!oo.item)return[];const _0=Na=>{const qs=[];for(const h1 of Na)if(h1.linkId===oo.linkId&&qs.push(h1),h1.item&&h1.item.length>0){const K0=_0(h1.item);qs.push(...K0)}return qs},e0=_0(mr)[Ti];return e0?.item?e0.item:[]},Ji=(Ti,_0)=>{if(isHiddenExtensionPresent(Ti))return null;const H0=li(_0);if(!isQuestionEnabledForInstance(Ti.enableWhen,Ti.enableBehavior,mr||[],oo.linkId,_0))return null;if(Ti.repeats){const K0=findNestedAnswer(H0,Ti.linkId),$a=uo(Or({},hr),{item:Ti,selectedAnswer:K0||[{}],errors:getInstanceErrors(Ar,oo,_0),handleInputChange:(Ks,c1,I1)=>wn(Ks,c1,I1,_0)});return jsx("div",{children:jsx(Jn,uo(Or({},$a),{isNestedRepeatedItem:!0}))},Ti.linkId)}if(Ti.type==="group"&&Ti.item&&!getUIToolkitCode(Ti?.extension||[]))return jsxs("div",{children:[Ti.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:Ti.text}),jsx("div",{className:"space-y-3",children:Ti.item.map(K0=>{if(!isQuestionEnabledForInstance(K0.enableWhen,K0.enableBehavior,mr||[],oo.linkId,_0))return null;const Ks=or(K0,Nn,hr.isLoading,hr.externalComponentRenderMap);if(!Ks)return null;const c1=findNestedAnswer(H0,K0.linkId),I1=uo(Or({},hr),{item:K0,selectedAnswer:c1,placeholder:getPlaceholderFromExtensions(K0.extension,K0.type),errors:getInstanceErrors(Ar,oo,_0),handleInputChange:(W1,nl,ja)=>wn(W1,nl,ja,_0)});return createElement(Ks,uo(Or({},I1),{key:K0.linkId}))})})]},Ti.linkId);const Na=or(Ti,Nn,hr.isLoading,hr.externalComponentRenderMap);if(!Na)return null;const qs=findNestedAnswer(H0,Ti.linkId),h1=uo(Or({},hr),{item:Ti,selectedAnswer:qs,placeholder:getPlaceholderFromExtensions(Ti.extension,Ti.type),errors:getInstanceErrors(Ar,oo,_0),handleInputChange:(K0,$a,Ks)=>wn(K0,$a,Ks,_0)});return createElement(Na,uo(Or({},h1),{key:`${Ti.linkId}-${_0}`}))},Fi=()=>{const Ti=getDirectErrors(Ar,Ct);return jsxs("div",{className:"flex flex-col gap-2",children:[Ti[Ct]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Ti[Ct]}),!fo&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Ho,className:"mt-4 text-center",isDisabled:hr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},s0=Ti=>$r.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>Fo(Ti),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${Ti+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:hr.isLoading}),D0=or(oo,Nn,hr.isLoading,hr.externalComponentRenderMap);return hasRepeatingParent(oo,Nn)&&!Ur?null:!On||On&&hasCheckboxExtension(oo)?D0?jsx(D0,uo(Or({},hr),{placeholder:Qn,errors:{[oo.linkId]:((to=Ar?.[oo.linkId])==null?void 0:to[0])||""}})):null:oo.type==="group"&&oo.item&&oo.item.length>0&&oo.repeats?jsxs("div",{"data-testid":`${Ct}-repeating`,children:[qo&&jsx(FHIRQuestionnaireQuestionText,{text:qo,required:St||!1,item:oo}),$r.map(Ti=>{var _0;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${Ti>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Ti+1]}),s0(Ti)]}),jsx("div",{className:"space-y-4",children:(_0=oo.item)==null?void 0:_0.map(H0=>Ji(H0,Ti))})]},`${Ct}-instance-${Ti}`)}),Fi()]}):D0?jsxs("div",{"data-testid":`${Ct}-repeating`,children:[$r.map(Ti=>{const _0=gn?.[Ti]?[gn[Ti]]:void 0,H0=uo(Or({},hr),{item:oo,selectedAnswer:_0,errors:getInstanceErrors(Ar,oo,Ti),handleInputChange:(e0,Na,qs)=>wn(e0,Na,qs,Ti)});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 ",Ti+1]}),s0(Ti)]}),jsx(D0,Or({},H0))]},`${Ct}-instance-${Ti}`)}),jsxs("div",{children:[(()=>{const _0=getDirectErrors(Ar,Ct)[Ct];return _0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:_0})})(),!fo&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Ho,className:"mt-4 text-center",isDisabled:hr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Wr=Object.defineProperty,ei=Object.defineProperties,qi=Object.getOwnPropertyDescriptors,X0=Object.getOwnPropertySymbols,F0=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,yi=(hr,to,oo)=>to in hr?Wr(hr,to,{enumerable:!0,configurable:!0,writable:!0,value:oo}):hr[to]=oo,Mo=(hr,to)=>{for(var oo in to||(to={}))F0.call(to,oo)&&yi(hr,oo,to[oo]);if(X0)for(var oo of X0(to))ea.call(to,oo)&&yi(hr,oo,to[oo]);return hr},fa=(hr,to)=>ei(hr,qi(to));const ps=null,xs=({formId:hr,questionnaireSchema:to,questionnaireResponseItem:oo,errorConfig:gn,customErrorConfigurations:wn,showQuestionPrefix:Zn=!0,isAdaptiveFlow:Ar=!1,status:Nn,hideBackButton:mr=!1,showStepper:Ur=!1,onComplete:Ct,onClearError:He,handleHiddenQuestion:rt,onGoBack:St,onFormDataChange:On=()=>{},externalComponentRenderMap:Rn,children:Qn})=>{var $r,po;const{setHandleContinueButtonClick:fo,setHandleBackButtonClick:qo,setHandleEditReturnComplete:Ho,setIsCurrentFormValid:Fo,setCurrentGroupLinkId:li,setCurrentGroupIndex:Ji,editReturnGroupIndex:Fi,setEditReturnGroupIndex:s0,setTotalSteps:D0,setHideFooterButton:Sa,setIsInlineNextQuestionTriggered:Ti,setIsLoading:_0,isCurrentFormValid:H0,currentGroupIndex:e0,isLoading:Na,hasCustomError:qs,groupItemIndicesRef:h1,errorLinkIds:K0}=useFHIRQuestionnaire(),{trackEvent:$a}=useAnalytics(),{t:Ks}=useUIToolkitTranslations(),[c1,I1]=useState([]),[W1,nl]=useState(new Set),[ja,J1]=useState([]),[co,zr]=useState([]),Rr=h1,Re=useRef(new Map),Se=useRef(new Set),[Ue,Lt]=useState({}),[tn,Mn]=useState(!1),[Sn,_r]=useState(to),Cn=useRef(oo||[]),Er=useRef(!1),Ln=useRef(!1),Fr=useMemo(()=>getTotalStepsFromQuestionnaire(to),[to]),[Jr,To]=useState(!1),oi=useRef([]),_o=(Hi,t0)=>{var E0,V0,S0,k0,pa,za;if(isCallNextQuestionExtensionPresent(Hi))return Hi.linkId;const Ta=validateCurrentPage(t0,c1,e0,Sn,Rr),us=Cr=>{for(const vr of Cr){if((!vr.enableWhen||isQuestionEnabled(vr.enableWhen,vr.enableBehavior,t0))&&isCallNextQuestionExtensionPresent(vr))return vr.linkId;if(vr.item){const bo=us(vr.item);if(bo)return bo}}},Ga=(Cr,vr)=>{for(const ht of Cr)if(ht.item){const bo=ht.item.findIndex(Ri=>Ri.linkId===vr);if(bo!==-1)return us(ht.item.slice(bo+1));const zo=Ga(ht.item,vr);if(zo!==void 0)return zo}},L0=Ga((E0=Sn?.item)!=null?E0:[],Hi.linkId);if(L0)return L0;const Bs=Rr.current[e0],n1=e0+1,Tt=Rr.current[n1],on=e0===0?0:Bs,yt=(S0=Tt??((V0=Sn?.item)==null?void 0:V0.length))!=null?S0:0;let Et=-1;for(let Cr=on;Cr<yt;Cr++){const vr=(k0=Sn?.item)==null?void 0:k0[Cr];if(vr?.linkId===Hi.linkId){Et=Cr;break}}const an=(Cr,vr=[])=>(Cr.forEach(ht=>{var bo;if((!ht.enableWhen||isQuestionEnabled(ht.enableWhen,ht.enableBehavior,t0))&&isCallNextQuestionExtensionPresent(ht))if(ht.required){const Ri=(bo=findResponseItem(t0,ht.linkId))==null?void 0:bo.answer;(Ri&&Ri.length>0&&Object.keys(Ri[0]).length>0||ht.initial&&ht.initial.length>0&&!W1.has(ht.linkId))&&vr.push(ht.linkId)}else vr.push(ht.linkId);ht.item&&ht.item.length>0&&an(ht.item,vr)}),vr),Qt=[],Wn=Et!==-1?Et+1:yt;for(let Cr=on;Cr<Wn;Cr++){const vr=(pa=Sn?.item)==null?void 0:pa[Cr];vr&&an([vr],Qt)}if(Qt.length>0&&Ta){const Cr=Qt[Qt.length-1],vr=Ri=>Ri.flatMap(xi=>[xi,...xi.item?vr(xi.item):[]]),ht=vr((za=Sn?.item)!=null?za:[]),bo=ht.findIndex(Ri=>Ri.linkId===Cr),zo=ht.findIndex(Ri=>Ri.linkId===Hi.linkId);return bo!==-1&&zo>bo?void 0:Cr}},_i=Hi=>_o(Hi,Cn.current)?!0:Hi.item&&Hi.item.length>0?Hi.item.some(_i):!1,g0=()=>{var Hi,t0;if(!Ar||e0<0||!Sn?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const E0=Rr.current[e0],V0=Re.current.get(E0)||[E0],S0=(Hi=Sn.item)==null?void 0:Hi[V0[V0.length-1]],k0=S0?_i(S0):!1,pa=e0<Rr.current.length-1;let za=!1;if(k0&&pa){const Ta=e0+1,us=Rr.current[Ta],Ga=(t0=Sn?.item)==null?void 0:t0[us],L0=!Ga?.enableWhen||isQuestionEnabled(Ga.enableWhen,Ga.enableBehavior,Cn.current),Bs=Ga?isPageExtensionPresent(Ga):!1;za=L0&&Bs}return{shouldTriggerInlineLoading:k0,canNavigateToNextGroup:za,hasMoreGroups:pa}},b0=(Hi,t0,E0,V0)=>{const S0=getUpdatedFormData(Sn?.item||[],Cn.current,Hi,t0,E0,V0);return Cn.current=S0,On(S0),S0},h0=(Hi,t0,E0,V0,S0)=>{b0(t0,E0,V0,S0),V0.forEach(k0=>{const pa=getValidationError(fa(Mo({},Hi),{linkId:k0.linkId}),Cn.current,k0.answer,Ks);pa&&Lt(za=>fa(Mo({},za),{[k0.linkId]:typeof S0=="number"?fa(Mo({},za[k0.linkId]),{[S0]:pa}):pa}))})},p0=(Hi,t0,E0,V0,S0)=>{var k0;const pa=b0(t0,E0,V0,S0),za=(k0=findResponseItem(pa,t0))==null?void 0:k0.answer,Ta=getValidationError(Hi,Cn.current,za,Ks);Lt(us=>fa(Mo({},us),{[t0]:typeof S0=="number"?fa(Mo({},us[t0]),{[S0]:Ta}):Ta}))},x0=(Hi,t0)=>{const E0=validateCurrentPage(t0,c1,e0,Sn,Rr);if(Fo(E0),Sn?.item){const V0=validateAllItemsRecursively(Sn.item,t0,Ks);if(Object.keys(V0).length>0)Lt(S0=>Mo(Mo({},S0),V0));else{const S0=Sn.item,k0={},pa=za=>{za.forEach(Ta=>{k0[Ta.linkId]={},Ta.item&&pa(Ta.item)})};pa(S0),Lt(za=>Mo(Mo({},za),k0))}}},Ki=(Hi,t0,E0,V0,S0=!1)=>{var k0;const{linkId:pa}=Hi;if(S0)return Cn.current=E0||[],x0(pa,E0||[]),Cn.current;if(E0&&E0.length>0&&Hi.type==="group"&&Hi.repeats){let Ga=Cn.current.length;for(let Bs=Cn.current.length-1;Bs>=0;Bs--)if(Cn.current[Bs].linkId===pa){Ga=Bs+1;break}const L0=[...Cn.current.slice(0,Ga),...E0,...Cn.current.slice(Ga)];return Cn.current=L0,x0(pa,L0),Cn.current}if(typeof V0=="number"&&t0){const Ga=hasRepeatingParent(Hi,Sn?.item||[]);if(Ga){const L0=Cn.current.filter(n1=>n1.linkId===Ga.linkId);if(V0<L0.length){const n1=Cn.current.map(Tt=>{if(Tt.linkId===Ga.linkId&&Cn.current.slice(0,Cn.current.indexOf(Tt)).filter(yt=>yt.linkId===Ga.linkId).length===V0){const yt=(Qt,Wn)=>{const Cr=new Map(Qt.map(ht=>[ht.linkId,ht])),vr=[];return Wn?.forEach(ht=>{const bo=Cr.get(ht.linkId);if(ht.linkId===pa)vr.push(Mo({linkId:ht.linkId,text:ht.text,answer:t0},bo?.item&&{item:bo.item}));else if(bo)if(ht.item&&ht.item.length>0){const zo=yt(bo.item||[],ht.item);vr.push(fa(Mo({},bo),{item:zo}))}else vr.push(bo);else if(ht.item&&ht.item.length>0){const zo=yt([],ht.item);zo.some(xi=>xi.linkId===pa||xi.item&&Et(xi.item,pa))&&vr.push({linkId:ht.linkId,text:ht.text,answer:[{}],item:zo})}Cr.delete(ht.linkId)}),Cr.forEach(ht=>{vr.push(ht)}),vr},Et=(Qt,Wn)=>Qt.some(Cr=>Cr.linkId===Wn||Cr.item&&Et(Cr.item,Wn)),an=yt(Tt.item||[],Ga.item);return fa(Mo({},Tt),{item:an})}return Tt});Cn.current=n1,On(n1)}else{const n1=V0+1,Tt=L0.length;if(Tt<n1||n1===1){const on=[],yt=(Qt,Wn,Cr)=>Qt.map(vr=>{const ht={linkId:vr.linkId,text:vr.text,answer:vr.linkId===Wn?Cr:[{}]};return vr.item&&vr.item.length>0&&(ht.item=yt(vr.item,Wn,Cr)),ht});for(let Qt=Tt;Qt<n1;Qt++){const Wn=Ga.item?yt(Ga.item,pa,t0):[],Cr={linkId:Ga.linkId,text:Ga.text,answer:[{}],item:Wn};on.push(Cr)}let Et=Cn.current.length;for(let Qt=Cn.current.length-1;Qt>=0;Qt--)if(Cn.current[Qt].linkId===Ga.linkId){Et=Qt+1;break}const an=[...Cn.current.slice(0,Et),...on,...Cn.current.slice(Et)];Cn.current=an,On(an)}}const Bs=getValidationError(Hi,Cn.current,t0,Ks);return Lt(n1=>fa(Mo({},n1),{[pa]:typeof V0=="number"?fa(Mo({},n1[pa]),{[V0]:Bs}):Bs})),x0(pa,Cn.current),Cn.current}}if(typeof V0=="number")return E0&&E0.length>0?h0(Hi,pa,t0,E0,V0):p0(Hi,pa,t0,E0,V0),Cn.current;const za=b0(pa,t0,E0),Ta=(k0=findResponseItem(za,pa))==null?void 0:k0.answer,us=getValidationError(Hi,za,Ta,Ks);return Lt(Ga=>fa(Mo({},Ga),{[pa]:typeof V0=="number"?fa(Mo({},Ga[pa]),{[V0]:us}):us})),x0(pa,za),Cn.current},P0=()=>{var Hi;for(let t0=e0+1;t0<Rr.current.length;t0++){const E0=Rr.current[t0],V0=(Hi=Sn?.item)==null?void 0:Hi[E0];if(!!V0&&(!V0.enableWhen||isQuestionEnabled(V0.enableWhen,V0.enableBehavior,Cn.current)))return!0}return!1},A0=()=>{var Hi,t0,E0,V0,S0;const k0=(Hi=to?.item)==null?void 0:Hi[Rr.current[e0]];if(k0){const Ta=(t0=getAnalyticsEventName(k0))!=null?t0:"questionnaire_form",us=getAnalyticsPageName(k0);if(us){const Ga=(E0=getAnalyticsFormName(to))!=null?E0:to.name,L0=collectAnalyticsProperties(k0,Cn.current),Bs={};Ga&&(Bs.form_name=Ga),Bs.page_name=us,Object.assign(Bs,L0),$a(Ta,Bs)}}const pa=e0<Rr.current.length-1,za=checkCurrentStepDataMatch(Cn.current,Sn,Rr.current,e0,oo,Rr.current.length-1);if(Fi!==null&&za&&Es()){window.scrollTo(0,0);return}if(Ar&&pa){const Ta=e0+1,us=Rr.current[Ta],Ga=(V0=Sn?.item)==null?void 0:V0[us],L0=!Ga?.enableWhen||isQuestionEnabled(Ga.enableWhen,Ga.enableBehavior,Cn.current),Bs=Ga?isPageExtensionPresent(Ga):!1;if(L0&&Bs&&za){Ji(Ta),Fo(!1),window.scrollTo(0,0);return}}if(za&&Rr.current.length>0){P0()?Ji(e0+1):(Ct(removeDisabledItems(Cn.current,Sn?.item||[])),Fo(!1),window.scrollTo(0,0));return}if(e0<Rr.current.length-1){const Ta=(S0=Sn?.item)==null?void 0:S0[Rr.current[e0]];if(!Ta){Ct(removeDisabledItems(Cn.current,Sn?.item||[]));return}const us=Ta.linkId,Ga=findLastGroupInstanceIndex(Cn.current,us),L0=Cn.current.slice(0,Ga+1);if(!validateCurrentPage(L0,c1,e0,Sn,Rr))return;if(Es()){window.scrollTo(0,0);return}Ar?(Cn.current=L0,On(L0),Ct(ensureOptionalGroupsHaveAnswer(Cn.current,Sn?.item||[])),Fo(!1)):Rr.current.length>0&&(P0()?Ji(e0+1):(Ct(removeDisabledItems(Cn.current,Sn?.item||[])),window.scrollTo(0,0)))}else Ct(removeDisabledItems(Cn.current,Sn?.item||[])),Fo(!1),window.scrollTo(0,0)},Es=()=>{var Hi,t0,E0;if(Fi===null)return!1;const V0=Rr.current[Fi],S0=(t0=(Hi=Sn?.item)==null?void 0:Hi[V0])==null?void 0:t0.linkId,k0=S0?findFirstGroupInstanceIndex(Cn.current,S0):-1,pa=k0>=0?Cn.current.slice(0,k0):Cn.current,za=k0>=0&&V0!==void 0?(E0=Sn?.item)==null?void 0:E0.slice(0,V0):Sn?.item;return Cn.current=pa,On(pa),s0(null),Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(pa,Sn?.item||[]),Sn?.item||[]),void 0,za),Fo(!1),!0};useEffect(()=>{var Hi;fo(()=>A0),qo(()=>Fs),Ho(()=>Es),Fo(H0);const t0=(Hi=Sn?.item)==null?void 0:Hi[Rr.current[e0]];t0&&li(t0.linkId)},[H0,e0,Fi]),useEffect(()=>{if(!to?.item)return;const{groupIndices:Hi,itemsToRenderMap:t0}=collectGroupItemIndices(to.item);Rr.current=Hi,Re.current=t0;const E0=Fr??Hi.length;D0(E0),J1(Hi),Ar?(Ln.current||Ji(Hi.length>0?Hi.length-1:0),Ti(!1),Ln.current=!1):e0===-1&&Ji(0)},[to?.item,Fr]),useEffect(()=>{if(e0<0||!Sn?.item)return;const Hi=validateCurrentPage(Cn.current,c1,e0,Sn,Rr);if(!Hi){Fo(!1);return}const{shouldTriggerInlineLoading:t0,canNavigateToNextGroup:E0,hasMoreGroups:V0}=g0();if(Ar&&t0){if(!V0){Fo(!1);return}if(E0&&Hi){Fo(!0);return}else{Fo(!1);return}}Fo(Hi)},[e0,Sn?.item,qs,Ar,Cn.current,c1]),useEffect(()=>{if(!to?.item||Er.current)return;const Hi=initializeQuestionnaireItems(to.item,Cn.current,to.item,Cn.current);if(Hi!==Cn.current){Cn.current=Hi;const E0=(S0=>{const k0=new Set,pa=za=>{za.forEach(Ta=>{var us;const Ga=Ta.initial&&Ta.initial.length>0,L0=(Ta.type==="choice"||Ta.type==="open-choice")&&((us=Ta.answerOption)==null?void 0:us.some(Bs=>Bs.initialSelected===!0));(Ga||L0)&&(!Ta.enableWhen||isQuestionEnabled(Ta.enableWhen,Ta.enableBehavior,Cn.current))&&k0.add(Ta.linkId),Ta.item&&pa(Ta.item)})};return pa(S0),k0})(Sn?.item||[]);nl(E0);const V0=validateAllItemsRecursively(Sn?.item||[],Cn.current,Ks);Object.keys(V0).length>0&&Lt(S0=>Mo(Mo({},S0),V0))}Er.current=!0},[Sn?.item,to,Ks]),useEffect(()=>{_r(to)},[to]),useEffect(()=>{if(K0.size===0)return;const Hi=za=>!za.enableWhen||isQuestionEnabled(za.enableWhen,za.enableBehavior,Cn.current)?K0.has(za.linkId)?!0:(za.item||[]).some(Hi):!1,t0=za=>za.flatMap(Ta=>[Ta.linkId,...t0(Ta.item||[])]),E0=za=>{const Ta=za.findIndex(Hi);return Ta===-1?za.flatMap(us=>E0(us.item||[])):za.slice(Ta+1).flatMap(us=>[us.linkId,...t0(us.item||[])])};if(!Sn?.item)return;const V0=E0(Sn.item);if(V0.length===0)return;_r(za=>za?.item?fa(Mo({},za),{item:removeItemsFromSchema(za.item,V0)}):za);const S0=za=>za.flatMap(Ta=>[Ta,...Ta.item?S0(Ta.item):[]]),k0=Sn.item,pa=k0.findIndex(za=>S0([za]).some(Ta=>K0.has(Ta.linkId)&&(!Ta.enableWhen||isQuestionEnabled(Ta.enableWhen,Ta.enableBehavior,Cn.current))));if(pa!==-1){const za=new Set(S0(k0.slice(pa)).map(Ta=>Ta.linkId));oi.current=oi.current.filter(Ta=>!za.has(Ta))}nl(za=>{const Ta=new Set(za);return V0.forEach(us=>Ta.delete(us)),Ta})},[K0]),useEffect(()=>{e0>=0&&window.scrollTo(0,0)},[e0]),useEffect(()=>{var Hi;if(!Ar||Na||K0.size>0||!Sn?.item)return;const t0=Rr.current[e0];if(t0===void 0)return;const E0=Re.current.get(t0)||[t0],V0=[];if(E0.forEach(Ta=>{var us;const Ga=(us=Sn?.item)==null?void 0:us[Ta];Ga&&hasInitialValue(Ga)&&V0.push(Ga)}),V0.length===0||!V0.some(Ta=>_o(Ta,Cn.current)&&!oi.current.includes(Ta.linkId)?(oi.current.push(Ta.linkId),!0):!1))return;const k0=validateCurrentPage(Cn.current,c1,e0,Sn,Rr),pa=(Hi=Sn?.item)==null?void 0:Hi[t0],za=isHiddenAnswerInValid(pa,Cn.current);!k0||za||(Se.current.add(e0),_0(!0),Q0(V0[V0.length-1].linkId))},[e0,c1,Ar,Na,Sn]),useEffect(()=>{if(!Ar||Na||!Sn?.item)return;const Hi=Rr.current[e0];Hi===void 0||!(Re.current.get(Hi)||[Hi]).every(V0=>{var S0;const k0=(S0=Sn.item)==null?void 0:S0[V0];return k0?isHiddenExtensionPresent(k0):!0})||Se.current.has(e0)||(Se.current.add(e0),Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(Cn.current,Sn.item),Sn.item)))},[e0,Sn?.item,Ar,Na]);const Q0=(Hi,t0=!1,E0=!1)=>{var V0,S0,k0;if(t0){Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(Cn.current,Sn?.item||[]),Sn?.item||[]),E0),Fo(!1);return}const pa=findQuestionByLinkId(Sn?.item||[],Hi);if(!pa)return;const za=(V0=findResponseItem(Cn.current,Hi))==null?void 0:V0.answer;if(getValidationError(pa,Cn.current,za,Ks))return;const Ta=getUpdatedFormData(Sn?.item||[],Cn.current,Hi,za),us=_o(pa,Ta);if(!us)return;const Ga=(S0=findResponseItem(oo||[],Hi))==null?void 0:S0.answer,L0=Ri=>JSON.stringify(Ri,(xi,n0)=>n0??void 0);if(L0(za)===L0(Ga)||Hi!==us&&oi.current.includes(us))return;Fo(!1);const Bs=findRootGroupLinkId(Sn?.item||[],Hi);let n1=Ta,Tt=[];const on=deepTrimFormData(Ta,us,Sn?.item||[]);n1=on.trimmedData,Tt=on.trimmedLinkIds;const yt=findQuestionByLinkId(Sn?.item||[],Bs||"");Cn.current=n1;const Et=findGroupPositionByLinkId(Sn?.item||[],Hi||""),an=Et!==-1?Et:e0;let Qt;const Wn=(()=>{var Ri;const xi=(Ri=Sn?.item)!=null?Ri:[],n0=(F1,N1)=>F1.some(Wl=>Wl.linkId===N1||(Wl.item?n0(Wl.item,N1):!1)),wi=xi.findIndex(F1=>F1.linkId===us||(F1.item?n0(F1.item,us):!1));if(wi===-1)return[];const va=F1=>F1.flatMap(N1=>[N1.linkId,...N1.item?va(N1.item):[]]),Ha=F1=>F1.flatMap(N1=>[N1,...N1.item?Ha(N1.item):[]]),Ba=Ha(xi),Vs=Ba.findIndex(F1=>F1.linkId===us),wa=new Set;let fs=!0;for(;fs;){fs=!1;for(const F1 of Ba){if(wa.has(F1.linkId)||!F1.enableWhen)continue;F1.enableWhen.some(Wl=>{const hu=Ba.findIndex(gi=>gi.linkId===Wl.question);return hu!==-1&&hu<=Vs||wa.has(Wl.question)})&&(wa.add(F1.linkId),fs=!0)}}const Kl=oi.current.includes(us)?(()=>{const F1=new Set(va([xi[wi]]));return Ba.slice(Vs+1).filter(N1=>F1.has(N1.linkId)&&!wa.has(N1.linkId)&&!isHiddenExtensionPresent(N1)).map(N1=>N1.linkId)})():[],Il=Ha(xi.slice(wi+1)).filter(F1=>!wa.has(F1.linkId)&&!isHiddenExtensionPresent(F1)).map(F1=>F1.linkId);return[...Kl,...Il]})();if(Wn.length>0){Qt=removeItemsFromSchema(Sn?.item||[],Wn),_r(fa(Mo({},Sn),{item:Qt}));const Ri=new Set(Wn);oi.current=oi.current.filter(xi=>!Ri.has(xi))}const Cr=[...Tt,...Wn],vr=validateCurrentPage(n1,c1,an,Sn,Rr,Cr);if(vr&&Es()){window.scrollTo(0,0);return}const ht=findQuestionByLinkId(Sn?.item||[],us),bo=(k0=findResponseItem(n1,us))==null?void 0:k0.answer,zo=!ht?.required||bo!==void 0&&bo.length>0&&Object.keys(bo[0]).length>0;if(vr&&zo&&!isHiddenAnswerInValid(yt,n1)){Ti(!0),Ln.current=!0;const xi=((n0,wi)=>{const va=[];let Ha=!1;const Ba=Vs=>{for(const wa of Vs)Ha?(va.push(wa.linkId),wa.item&&Ba(wa.item)):wa.linkId===wi?Ha=!0:wa.item&&Ba(wa.item)};return Ba(n0),va})(Sn?.item||[],us);xi.length>0&&(oi.current=oi.current.filter(n0=>!xi.includes(n0)),nl(n0=>{const wi=new Set(n0);return xi.forEach(va=>wi.delete(va)),wi})),oi.current.push(us),Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(n1,Sn?.item||[]),Sn?.item||[]),!0,Qt||Sn.item)}},ds=(Hi,t0,E0=!1)=>{const V0=updateItemWithReadOnlyExpression(Hi,Sn),S0={item:V0,selectedAnswer:t0,handleInputChange:Ki,showQuestionPrefix:Zn,onCompleteHandler:Q0,errors:Ue,isLoading:Na,isCurrentFormValid:H0,contained:Sn?.contained,questionnaireSchemaItems:Sn?.item,customErrorConfigurations:wn,formData:Cn.current,showStepper:Ur,totalStepsFromExtension:Fr,externalComponentRenderMap:Rn,hintText:getHintTextFromExtensions(V0.extension)};if(typeof rt=="function"&&E0)rt(Hi,S0,Cn.current);else if(Hi.type in typeToRenderFunctionMap&&!E0)return c1.includes(Hi.linkId)||I1(k0=>[...k0,Hi.linkId]),jsx(RenderFHIRQuestionnaireItem,Mo({},S0),Hi.linkId);return null},es=Hi=>{const t0=S0=>!S0.enableWhen||isQuestionEnabled(S0.enableWhen,S0.enableBehavior,Cn.current)?K0.has(S0.linkId)?!0:(S0.item||[]).some(t0):!1,E0=Hi.findIndex(t0),V0=E0!==-1?Hi.slice(0,E0+1):Hi;return E0!==-1&&Hi.slice(E0+1).forEach(S0=>{Cn.current.some(pa=>pa.linkId===S0.linkId)&&(Cn.current=removeAnswerFromFormData(Cn.current,S0.linkId))}),V0.map(S0=>{var k0,pa,za,Ta;const us=isHiddenExtensionPresent(S0);let Ga=(k0=findResponseItem(Cn.current,S0.linkId))==null?void 0:k0.answer;if((!Ga||Object.keys((pa=Ga?.[0])!=null?pa:{}).length===0)&&!W1.has(S0.linkId)){if(S0.initial&&S0.initial.length>0)Ga=S0.initial,nl(L0=>new Set(L0).add(S0.linkId));else if((S0.type==="choice"||S0.type==="open-choice")&&S0.answerOption){const L0=S0.answerOption.filter(Bs=>Bs.initialSelected===!0);L0.length>0&&(Ga=L0.map(Bs=>{let n1={};return Bs.valueCoding?n1={valueCoding:{code:Bs.valueCoding.code,display:Bs.valueCoding.display,system:Bs.valueCoding.system}}:Bs.valueReference&&(n1={valueReference:{reference:Bs.valueReference.reference,display:Bs.valueReference.display}}),n1}).filter(Bs=>Object.keys(Bs).length>0),nl(Bs=>new Set(Bs).add(S0.linkId)))}Ga&&(Cn.current=getUpdatedFormData(Sn?.item||[],Cn.current,S0.linkId,Ga))}if(!S0?.enableWhen||isQuestionEnabled(S0?.enableWhen,S0.enableBehavior,Cn.current)){const L0=ps.includes(S0.linkId)||getUIToolkitCode(S0.extension||[])===UI_TOOLKIT_FORM_CONTAINER,Bs=((za=S0?.extension)!=null?za:[]).filter(Tt=>Tt.url.includes("questionnaire-itemControl")).flatMap(Tt=>{var on,yt;return(yt=(on=Tt.valueCodeableConcept)==null?void 0:on.coding)!=null?yt:[]});let n1;return Rn&&(n1=(Ta=Bs.find(Tt=>Tt.code&&Rn[Tt.code]))==null?void 0:Ta.code),jsxs(React.Fragment,{children:[ds(S0,Ga,us),S0.item&&!us&&!n1&&(L0?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:es(S0.item)})}):es(S0.item))]},S0.linkId)}else if(S0.type==="group"&&!us)return co.includes(S0.linkId)||(Fr===void 0&&D0(Rr.current.length-1||-1),Rr.current=Rr.current.filter((L0,Bs)=>Bs!==e0),zr(L0=>[...L0,S0.linkId])),null})};if(e0>=0){const Hi=[];let t0=0,E0=0;for(;t0<ja.length&&E0<Rr.current.length;){const V0=ja[t0],S0=Rr.current[E0];if(V0<S0){const k0=($r=Sn?.item)==null?void 0:$r[V0];(!k0?.enableWhen||isQuestionEnabled(k0.enableWhen,k0.enableBehavior,Cn.current))&&Hi.push(t0),t0++}else V0===S0&&t0++,E0++}for(;t0<ja.length;){const V0=ja[t0],S0=(po=Sn?.item)==null?void 0:po[V0];(!S0?.enableWhen||isQuestionEnabled(S0.enableWhen,S0.enableBehavior,Cn.current))&&Hi.push(t0),t0++}if(Hi.length>0){Fr===void 0&&D0(Rr.current.length+Hi.length),Hi.reverse().forEach(S0=>{const k0=ja[S0];let pa=0;for(let za=0;za<Rr.current.length;za++){if(Rr.current[za]>k0){pa=za;break}pa=za+1}Rr.current.splice(pa,0,k0)});const V0=Hi.map(S0=>{var k0;const pa=ja[S0],za=(k0=Sn?.item)==null?void 0:k0[pa];return za?.linkId}).filter(Boolean);zr(S0=>S0.filter(k0=>!V0.includes(k0)))}ja.forEach(V0=>{var S0;const k0=(S0=Sn?.item)==null?void 0:S0[V0];k0?.enableWhen&&!isQuestionEnabled(k0.enableWhen,k0.enableBehavior,Cn.current)&&Cn.current.some(za=>za.linkId===k0.linkId)&&(Cn.current=removeAnswerFromFormData(Cn.current,k0.linkId))})}const Fs=()=>{var Hi;if(gn&&!tn&&e0>0&&Nn!=="completed")Ji(Rr.current.length-1),Mn(!0),Sa(!1),He?.();else if(e0>0&&Nn!=="completed"){let t0=e0-1;for(;t0>0;){const E0=Rr.current[t0],V0=(Hi=Sn?.item)==null?void 0:Hi[E0];if(!V0?.enableWhen||isQuestionEnabled(V0.enableWhen,V0.enableBehavior,Cn.current))break;t0--}Ji(t0),Fo(!0),Sa(!1),He?.()}else St?.()},os=Hi=>Hi.preventDefault();return useEffect(()=>{const Hi=setTimeout(()=>{To(!0)},0);return()=>clearTimeout(Hi)},[]),Jr?jsxs(Fragment,{children:[jsxs("form",{id:hr,className:"w-full","data-testid":"questionnaire-form",onSubmit:os,children:[!mr&&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:()=>Fs(),onKeyDown:Hi=>{(Hi.key==="Enter"||Hi.key===" ")&&Fs()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),gn&&!tn?jsx(EmptyState,{className:"mt-5xl",title:gn.title,description:gn.description,featuredIconProps:{icon:gn.icon,color:"gray"},primaryButton:gn.primaryButton,secondaryButton:gn.secondaryButton?fa(Mo({},gn.secondaryButton),{onClick:Fs}):void 0}):jsxs(Fragment,{children:[!Sn?.item&&Na&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),Sn?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:es(e0>=0?(()=>{var Hi;const t0=Rr.current[e0],E0=Re.current.get(t0)||[t0],V0=(Hi=Sn.item)==null?void 0:Hi[t0];return V0?.enableWhen&&!isQuestionEnabled(V0.enableWhen,V0.enableBehavior,Cn.current)?[V0]:Sn.item.filter((S0,k0)=>E0.includes(k0))})():Sn?.item||[])})]})]}),Er.current&&Qn]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,s,e)=>{"use strict";e.d(s,{l:()=>A});var n=e(31085),t=e(14041),r=e(36087),l=e(1053),o=e(25624),i=e(18522),a=Object.defineProperty,b=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,p=(h,d,v)=>d in h?a(h,d,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[d]=v,f=(h,d)=>{for(var v in d||(d={}))y.call(d,v)&&p(h,v,d[v]);if(u)for(var v of u(d))m.call(d,v)&&p(h,v,d[v]);return h},O=(h,d)=>b(h,c(d));const g=({selected:h,onClick:d,icon:v,title:M,description:S,readOnly:T})=>{const x=(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:S})]})]}),z=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",T?"cursor-not-allowed":"cursor-pointer",T?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!T&&!h&&"hover:border-gray-400");return T?(0,n.jsx)("div",{className:z,children:x}):(0,n.jsx)("button",{type:"button",onClick:d,className:z,"aria-pressed":!!h,children:x})},A=({item:h,handleInputChange:d,formData:v,isLoading:M})=>{const{incrementCustomErrorCount:S,decrementCustomErrorCount:T}=(0,i.c)(),x=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),z=h.readOnly===!0,C=(0,t.useMemo)(()=>x.filter(N=>!N.enableWhen||(0,o.GN)(N.enableWhen,N.enableBehavior,v??[])),[x,v]),E=(0,t.useMemo)(()=>x.filter(N=>N.enableWhen&&!(0,o.GN)(N.enableWhen,N.enableBehavior,v??[])),[x,v]),R=N=>{var w,V;if(!v)return!1;const k=(0,o.MU)(v,N);return((V=(w=k?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>C.some(N=>R(N.linkId)),[C,v]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(z||C.length===0){P.current&&(T(),P.current=!1);return}!L&&!P.current?(S(),P.current=!0):L&&P.current&&(T(),P.current=!1)},[L,z,C.length,S,T]),(0,t.useEffect)(()=>{E.forEach(N=>{var w,V;const k=v?(0,o.MU)(v,N.linkId):void 0;(!k||((V=(w=k.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&d(N,[{valueBoolean:!1}])})},[E]),(0,t.useEffect)(()=>()=>{P.current&&T()},[]);const D=N=>{const w=R(N.linkId);d(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(f({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:C.map(N=>{var w,V,k,I;const G=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(ae=>ae.url===l.g4),F=(V=N.extension)==null?void 0:V.find(ae=>ae.url===l.rz),X=U?.valueString?l.JP[U.valueString]:void 0,q=(k=F?.valueString)!=null?k:"";return(0,n.jsx)(g,{icon:X?(0,n.jsx)(X,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:q,selected:G,readOnly:z,onClick:z?void 0:()=>D(N)},N.linkId)})}))}},72866:(Y,s,e)=>{"use strict";e.d(s,{v:()=>i});var n=e(31085),t=e(94627),r=e(36087),l=e(25624);const o=({selected:a,onClick:b,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:b,className:y,"aria-pressed":!!a,children:c})},i=({item:a,handleInputChange:b,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],m=a.readOnly===!0,p=O=>{var g,A;if(!c)return!1;const h=(0,l.MU)(c,O);return((A=(g=h?.answer)==null?void 0:g[0])==null?void 0:A.valueBoolean)===!0},f=O=>{const g=p(O.linkId);b(O,[{valueBoolean:!g}])};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 g;const A=p(O.linkId);return(0,n.jsx)(o,{label:(g=O.text)!=null?g:"",selected:A,readOnly:m,onClick:m?void 0:()=>f(O)},O.linkId)})})]})}},81367:(Y,s,e)=>{"use strict";e.d(s,{i:()=>G});var n=e(31085),t=e(14041),r=e(36087),l,o=new Uint8Array(16);function i(){if(!l&&(l=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!l))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(o)}const a=/^(?:[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 b(U){return typeof U=="string"&&a.test(U)}const c=b;for(var u=[],y=0;y<256;++y)u.push((y+256).toString(16).substr(1));function m(U){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,X=(u[U[F+0]]+u[U[F+1]]+u[U[F+2]]+u[U[F+3]]+"-"+u[U[F+4]]+u[U[F+5]]+"-"+u[U[F+6]]+u[U[F+7]]+"-"+u[U[F+8]]+u[U[F+9]]+"-"+u[U[F+10]]+u[U[F+11]]+u[U[F+12]]+u[U[F+13]]+u[U[F+14]]+u[U[F+15]]).toLowerCase();if(!c(X))throw TypeError("Stringified UUID is invalid");return X}const p=m;function f(U,F,X){U=U||{};var q=U.random||(U.rng||i)();if(q[6]=q[6]&15|64,q[8]=q[8]&63|128,F){X=X||0;for(var ae=0;ae<16;++ae)F[X+ae]=q[ae];return F}return p(q)}const O=f,g=(U,F="application/octet-stream")=>{try{const X=window.atob(U),q=new Uint8Array(X.length);for(let se=0;se<X.length;se++)q[se]=X.charCodeAt(se);return new Blob([q],{type:F}).size}catch{return 0}},A=(U,F)=>`data:${F};base64,${U}`,h=(U,F,X=512)=>{const q=window.atob(U),ae=[];for(let ne=0;ne<q.length;ne+=X){const he=q.slice(ne,ne+X),ve=new Array(he.length);for(let Ae=0;Ae<he.length;Ae++)ve[Ae]=he.charCodeAt(Ae);const ye=new Uint8Array(ve);ae.push(ye)}const se=new Blob(ae,{type:F});return URL.createObjectURL(se)},d=U=>{const F=new Date().toISOString().replace(/[:.-]/g,"");return`${U.split(" ").join("-")}_${F}`},v=4e3,M=.8,S=(U,F)=>{var X,q;const ae=(X=F?.maxDimension)!=null?X:v,se=(q=F?.quality)!=null?q:M;return new Promise((ne,he)=>{if(!U.type.startsWith("image/")){ne(U);return}if(U.type==="image/heic"||U.type==="image/heif"||U.name.toLowerCase().endsWith(".heic")||U.name.toLowerCase().endsWith(".heif")){ne(U);return}const ye=new Image,Ae=new FileReader;Ae.onload=()=>{const J=Ae.result;ye.onload=()=>{let{width:oe,height:me}=ye;if(oe>ae||me>ae){const re=ae/Math.max(oe,me);oe=Math.round(oe*re),me=Math.round(me*re)}const ce=document.createElement("canvas");ce.width=oe,ce.height=me;const de=ce.getContext("2d");if(!de){ne(U);return}de.drawImage(ye,0,0,oe,me);const le=U.type==="image/png"?"image/png":"image/jpeg",te=U.type==="image/png"?void 0:se;ce.toBlob(re=>{if(!re||re.size>=U.size){ne(U);return}ne(new File([re],U.name,{type:le}))},le,te)},ye.onerror=()=>{he(new Error(`Failed to load image: ${U.name}`))},ye.src=J},Ae.onerror=()=>{he(new Error(`Failed to read file: ${U.name}`))},Ae.readAsDataURL(U)})},T=50,x=(U,F=T)=>{if(U.length<=F)return U;const X=U.lastIndexOf("."),q=X!==-1?U.slice(X):"",ae=X!==-1?U.slice(0,X):U,se=F-q.length-1,ne=Math.ceil(se/2),he=Math.floor(se/2);return`${ae.slice(0,ne)}\u2026${ae.slice(-he)}${q}`};var z=e(25624),C=e(96814),E=Object.defineProperty,R=Object.defineProperties,L=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,w=(U,F,X)=>F in U?E(U,F,{enumerable:!0,configurable:!0,writable:!0,value:X}):U[F]=X,V=(U,F)=>{for(var X in F||(F={}))D.call(F,X)&&w(U,X,F[X]);if(P)for(var X of P(F))N.call(F,X)&&w(U,X,F[X]);return U},k=(U,F)=>R(U,L(F)),I=(U,F,X)=>new Promise((q,ae)=>{var se=ve=>{try{he(X.next(ve))}catch(ye){ae(ye)}},ne=ve=>{try{he(X.throw(ve))}catch(ye){ae(ye)}},he=ve=>ve.done?q(ve.value):Promise.resolve(ve.value).then(se,ne);he((X=X.apply(U,F)).next())});const G=({item:U,onCompleteHandler:F,selectedAnswer:X,handleInputChange:q,showQuestionPrefix:ae,errors:se,isLoading:ne,allowMultiple:he=!0})=>{const{linkId:ve,text:ye,required:Ae,prefix:J,readOnly:oe,repeats:me,extension:ce}=U,de=(0,z.Qr)(ce),le=he?(0,z.cz)(ce):1,te=(0,z.$H)(ce)||"image/*,.pdf,.doc,.docx",re=ye?(0,z.nt)(ae,J,ye):"",ge=se?.[ve]||"",[xe,Ie]=(0,t.useState)([]),Ee=(0,t.useRef)(X||[]);(0,t.useEffect)(()=>{X&&(Ee.current=X)},[X]),(0,t.useEffect)(()=>{X?.length&&Ie(Mt=>{const Nt=Mt.filter(Ot=>Ot.isLoading||Ot.failed);return[...X.filter(Ot=>Ot.valueAttachment).map((Ot,Ke)=>{var Ye,Ft,ot,tt,qt;const zn=((Ye=Ot.valueAttachment)==null?void 0:Ye.title)||`attachment-${Ke}`,An=(Ft=Ot.valueAttachment)==null?void 0:Ft.id,lt=Mt.find(rr=>An&&rr.id===An||!An&&rr.id===`existing-${Ke}`),_t=(ot=Ot.valueAttachment)==null?void 0:ot.data,dn=_t?g(_t,(tt=Ot.valueAttachment)==null?void 0:tt.contentType):0;return{id:An||lt?.id||`existing-${Ke}`,name:zn,size:lt?.size||dn,progress:100,failed:!1,type:(0,z.J4)((qt=Ot.valueAttachment)==null?void 0:qt.contentType),isLoading:!1}}),...Nt]})},[X]);const De=Mt=>{let Nt=Array.from(Mt);if(le!==void 0){const Ot=le-xe.length;if(Ot<=0)return;Nt=Nt.slice(0,Ot)}const kt=Nt.map(Ot=>{const Ke=Ot.name.replace(/\s+/g,"-");return{id:O(),name:Ke,size:Ot.size,progress:0,type:(0,z.J4)(Ot.type),failed:!1,isLoading:!0}});Ie(Ot=>[...Ot,...kt]),kt.forEach(Ot=>{const Ke=Nt.find(Ye=>Ye.name.replace(/\s+/g,"-")===Ot.name);Ke&&ze(Ke,Ot.id)})},ze=(Mt,Nt)=>I(void 0,null,function*(){try{const kt=yield S(Mt);if(de&&kt.size>de){const tt=parseFloat((de/1e6).toFixed(1));Ie(qt=>qt.map(zn=>zn.id===Nt?k(V({},zn),{isLoading:!1,failed:!0,disableRetry:!0,errorMessage:`File size exceeds ${tt} MB limit`}):zn));return}const Ot=yield ft(kt),Ke=kt.name.replace(/\s+/g,"-");Ie(tt=>tt.map(qt=>qt.id===Nt?k(V({},qt),{isLoading:!1,progress:100,failed:!1}):qt));const Ye={valueAttachment:{id:Nt,contentType:kt.type,data:Ot,title:Ke}},ot=[...(Ee.current||[]).filter(tt=>tt.valueAttachment||Object.keys(tt).length>0),Ye];Ee.current=ot,q(U,ot),F(ve)}catch{Ie(Ot=>Ot.map(Ke=>Ke.id===Nt?k(V({},Ke),{isLoading:!1,failed:!0}):Ke))}}),We=Mt=>{const Nt=xe.find(kt=>kt.id===Mt);if(Ie(kt=>kt.filter(Ot=>Ot.id!==Mt)),Nt){const kt=(Ee.current||[]).filter((Ot,Ke)=>{var Ye;if(Mt.startsWith("existing-")){const Ft=parseInt(Mt.replace("existing-",""));return Ke!==Ft}return((Ye=Ot.valueAttachment)==null?void 0:Ye.id)!==Mt}).filter(Ot=>Ot.valueAttachment||Object.keys(Ot).length>0);Ee.current=kt,q(U,kt.length>0?kt:[{}])}},st=Mt=>{const Nt=xe.find(kt=>kt.id===Mt);if(Nt){Ie(Ot=>Ot.map(Ke=>Ke.id===Mt?k(V({},Ke),{failed:!1,isLoading:!0,progress:0}):Ke));const kt=new File([""],Nt.name,{type:"application/octet-stream"});ze(kt,Mt)}},ft=Mt=>new Promise((Nt,kt)=>{const Ot=new FileReader;Ot.onload=()=>{const Ye=Ot.result.split(",")[1];Nt(Ye)},Ot.onerror=kt,Ot.readAsDataURL(Mt)});return(0,n.jsxs)("div",{children:[re&&(0,n.jsx)(C.W,{isLabel:!0,className:"mb-sm text-md",text:re,required:Ae||!1,item:U}),(0,n.jsx)(r.FileUpload,{files:xe,onDropFiles:De,onDeleteFile:We,onRetryFile:st,onDropUnacceptedFiles:()=>{},hint:(0,z.od)(te,de,le),accept:te,allowsMultiple:he&&me!==!1,isDisabled:oe||ne||le!==void 0&&xe.length>=le,className:"w-full",showDisclosureModal:!0}),ge&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:ge})]})}},65735:(Y,s,e)=>{"use strict";e.d(s,{d:()=>l});var n=e(31085),t=e(36087),r=e(1053);const l=({item:o})=>{var i,a,b,c;const u=o.text||"",y=(a=(i=o.extension)==null?void 0:i.find(f=>f.url===r.rz))==null?void 0:a.valueString,m=(c=(b=o.extension)==null?void 0:b.find(f=>f.url===r.g4))==null?void 0:c.valueString,p=m?r.JP[m]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":o.linkId,children:[p&&(0,n.jsx)(t.FeaturedIcon,{icon:p,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("h1",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},96814:(Y,s,e)=>{"use strict";e.d(s,{W:()=>i});var n=e(31085),t=e(94043),r=e(94627),l=e(36087),o=e(25624);const i=({text:a,isLabel:b,required:c,item:u,className:y,id:m})=>{const p=c&&!(u&&(0,o.AT)(u));return(0,n.jsxs)("p",{id:m,className:y??"mb-md text-md",children:[(0,n.jsx)(l.Content,{as:"span",className:(0,t.cx)(b&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,r.p)(a||"")}}),p&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]})}},18522:(Y,s,e)=>{"use strict";e.d(s,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),l=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(A,h,d)=>h in A?o(A,h,{enumerable:!0,configurable:!0,writable:!0,value:d}):A[h]=d,m=(A,h)=>{for(var d in h||(h={}))c.call(h,d)&&y(A,d,h[d]);if(b)for(var d of b(h))u.call(h,d)&&y(A,d,h[d]);return A},p=(A,h)=>i(A,a(h));const f=(0,t.createContext)(void 0),O=()=>{const A=(0,t.useContext)(f);if(!A)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return A},g=({children:A,analyticsConfig:h})=>{const{trackEvent:d}=useAnalytics(),[v,M]=useState(null),[S,T]=useState(null),[x,z]=useState(null),[C,E]=useState(!1),[R,L]=useState(null),[P,D]=useState(-1),[N,w]=useState(null),[V,k]=useState(!1),[I,G]=useState(-1),[U,F]=useState(!1),[X,q]=useState(0),[ae,se]=useState(!1),[ne,he]=useState(!1),ve=useRef([]),[ye,Ae]=useState(new Set),J=useCallback(ge=>{Ae(xe=>{const Ie=new Set(xe);return Ie.add(ge),Ie})},[]),oe=useCallback(ge=>{Ae(xe=>{const Ie=new Set(xe);return Ie.delete(ge),Ie})},[]),me=useCallback(()=>{q(ge=>ge+1)},[]),ce=useCallback(ge=>{se(ge)},[]),de=useCallback(()=>{q(ge=>Math.max(0,ge-1))},[]),le=X>0,te=useCallback((ge,xe,Ie)=>{if(!h)return;const Ee=h[ge];if(!Ee)return;let De;if(Array.isArray(Ee))if(Ie)De=Ee.find(Mt=>Mt.inputType===Ie);else{console.warn(`Multiple analytics configs found for linkId "${ge}" but no inputType provided. Skipping tracking.`);return}else{if(Ie&&Ee.inputType&&Ee.inputType!==Ie)return;De=Ee}if(!De)return;let ze=m({},xe);De.valueTransform&&(ze=Object.keys(xe).reduce((Mt,Nt)=>{var kt;const Ot=(kt=De.valueTransform)==null?void 0:kt[Nt];return Mt[Nt]=Ot?applyValueTransform(xe[Nt],Ot):xe[Nt],Mt},{}));let We=m({},ze);De.propertyMapping&&(We=Object.keys(ze).reduce((Mt,Nt)=>{var kt;const Ot=((kt=De.propertyMapping)==null?void 0:kt[Nt])||Nt;return Mt[Ot]=ze[Nt],Mt},{}));const st=De.eventName,ft=De.description;d(st,p(m(m({},We),De.properties),{_event_metadata:ft?{description:ft}:void 0}))},[h,d]),re={isCurrentFormValid:C,currentGroupLinkId:R,currentGroupIndex:P,hideFooterButton:V,totalSteps:I,isLoading:U,isInlineNextQuestionTriggered:ne,hasCustomError:le,analyticsConfig:h,hasExternalError:ae,handleContinueButtonClick:v,handleBackButtonClick:S,handleEditReturnComplete:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:T,setHandleEditReturnComplete:z,setIsCurrentFormValid:E,setCurrentGroupLinkId:L,setCurrentGroupIndex:D,editReturnGroupIndex:N,setEditReturnGroupIndex:w,setHideFooterButton:k,setTotalSteps:G,setIsLoading:F,setIsInlineNextQuestionTriggered:he,incrementCustomErrorCount:me,decrementCustomErrorCount:de,errorLinkIds:ye,addErrorLinkId:J,removeErrorLinkId:oe,trackQuestionnaireEvent:te,setHasExternalError:ce,groupItemIndicesRef:ve};return jsx(f.Provider,{value:re,children:A})}},35473:(Y,s,e)=>{"use strict";var n=e(2658),t=e(18522),r=e(78912),l=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(s,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(s,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(s,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(s,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var o=e(25624),i=e(1053),a=e(7630),b=e(72866),c=e(65735),u=e(81367),y=e(96814)},61388:(Y,s,e)=>{"use strict";e.d(s,{n:()=>l});var n=e(31085),t=e(36087),r=e(33180);const l=({actionButtonText:o,onActionButtonClick:i,title:a,infoDetails:b})=>(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}),o&&i&&(0,n.jsx)(t.Button,{color:"link-color",onClick:i,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:b})]})},79286:()=>{},97257:(Y,s,e)=>{"use strict";e.d(s,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),l=e(36087);const o=({infoDetails:i,className:a})=>{const{redirectToBook:b,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(f,O,g)=>{f.preventDefault(),O.linkType==="phone"?b(g):O.linkType==="address"?c({address:g}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},m=(f,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(f);default:return f}},p=(f,O)=>O.linkType||O.link?(0,n.jsx)(l.Button,{color:"link-color",onClick:g=>y(g,O,f),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:m(f,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:m(f,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:i.map((f,O)=>{const g=f.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(l.FeaturedIcon,{icon:(0,n.jsx)(g,{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:f.label}),(()=>{const A=Array.isArray(f.value)?f.value:[f.value];return A.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:A.map((h,d)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:p(h,f)},d))}):p(A[0],f)})()]})]},O)})})}},71428:()=>{},3203:(Y,s,e)=>{"use strict";e.d(s,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(s,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(s,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(s,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(s,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,s,e)=>{"use strict";e.d(s,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(s,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(s,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(s,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(s,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,s,e)=>{"use strict";e.d(s,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(s,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(s,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(s,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(s,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var l=e(33180);e.o(l,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return l.BWELL_STORED_TOKENS_KEY}}),e.o(l,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return l.LocationPermissionEnum}}),e.o(l,"LocationType")&&e.d(s,{LocationType:function(){return l.LocationType}}),e.o(l,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return l.SchedulingLocationCard}}),e.o(l,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return l.formatPhoneNumber}}),e.o(l,"getInitials")&&e.d(s,{getInitials:function(){return l.getInitials}}),e.o(l,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return l.removeAfterLastComma}}),e.o(l,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return l.shouldForceLogoutAfterAuthFailure}}),e.o(l,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return l.unformatPhoneNumber}}),e.o(l,"useDebounce")&&e.d(s,{useDebounce:function(){return l.useDebounce}}),e.o(l,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return l.useDeviceDetection}}),e.o(l,"useRedirect")&&e.d(s,{useRedirect:function(){return l.useRedirect}}),e.o(l,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return l.useSearchQueryParams}})},98549:(Y,s,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:l})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${l}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/l*100,variant:"determinate"})})},26877:(Y,s,e)=>{"use strict";e.d(s,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:S=24,color:T="currentColor",...x})=>t.createElement("svg",{viewBox:"0 0 24 24",width:S,height:S,stroke:T,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...x},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 l=e(8322),o=e(76808),i=e(92094),a=e(5380),b=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,m=Object.defineProperties,p=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,A=(S,T,x)=>T in S?y(S,T,{enumerable:!0,configurable:!0,writable:!0,value:x}):S[T]=x,h=(S,T)=>{for(var x in T||(T={}))O.call(T,x)&&A(S,x,T[x]);if(f)for(var x of f(T))g.call(T,x)&&A(S,x,T[x]);return S},d=(S,T)=>m(S,p(T)),v=(S,T,x)=>new Promise((z,C)=>{var E=P=>{try{L(x.next(P))}catch(D){C(D)}},R=P=>{try{L(x.throw(P))}catch(D){C(D)}},L=P=>P.done?z(P.value):Promise.resolve(P.value).then(E,R);L((x=x.apply(S,T)).next())});const M=({setLocationUpdating:S,title:T,description:x,isOpen:z,onClose:C})=>{const{locationPermission:E,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,l.st)(),{queryParams:N,setQueryParams:w}=(0,b.i)(),[V,k]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),G=z!==void 0?z:V;(0,t.useEffect)(()=>{(G||z)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[z,G,D]);const U=(0,t.useCallback)(ve=>{w(d(h({},N),{location:ve,locationType:a.iF.CURRENT_LOCATION,locationPermission:E||""}))},[E,N,w]),F=(0,t.useCallback)(()=>{z===void 0&&(!E||[a.Ef.GRANTED].includes(E)&&I.get()||[a.Ef.PROMPT].includes(E)&&I.get()&&R||k([a.Ef.PROMPT,a.Ef.GRANTED].includes(E)))},[z,E,I,R]);(0,t.useEffect)(()=>{F()},[F]);const X=(0,o.Ul)(),q=(0,t.useCallback)(()=>v(void 0,null,function*(){S&&S(!0);let ve;try{ve=yield L(),ve&&U&&U(`${ve.coords.latitude},${ve.coords.longitude}`)}catch(ye){ye instanceof Error?X?.error(ye,"Error requesting location"):X?.error(`Error requesting location - ${JSON.stringify(ye)}`),z!==void 0&&C?C():k(!1)}return S&&S(!1),!!ve}),[X,U,L,S,z,C]),ae=(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."}}),z!==void 0&&C?C():k(!1),I.set(new Date().toISOString()),yield q()}),[D,z,C,I,q]),se=(0,t.useCallback)(ve=>{D("location_permissions_cta_clicked",{click:ve==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(d(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),z!==void 0&&C?C():k(!1)},[D,P,w,N,I,z,C]),ne=(0,t.useCallback)(()=>se("close"),[se]),he=(0,t.useCallback)(()=>se("cancel"),[se]);return(0,n.jsx)(i.Modal,{id:"location-modal",isOpen:G,className:"sm:max-w-md",title:{content:T,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:x},closeButton:{onCloseClick:ne},primaryButton:{children:"Use my current location",onClick:ae},secondaryButton:{children:"Search another way",onClick:he}})}},35471:(Y,s,e)=>{"use strict";var n=e(26877)},98741:(Y,s,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,l=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(y,m,p)=>m in y?r(y,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):y[m]=p,b=(y,m)=>{for(var p in m||(m={}))o.call(m,p)&&a(y,p,m[p]);if(l)for(var p of l(m))i.call(m,p)&&a(y,p,m[p]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const m=p=>{if(!p||typeof p!="object")return p;if(Array.isArray(p))return p.map(m);const f=b({},p);delete f.ef,delete f.expr,typeof f.x=="string"&&delete f.x;for(const O in f)typeof f[O]=="object"&&(f[O]=m(f[O]));return f};return m(y)},u=({animationData:y,loop:m=!0,autoplay:p=!0,className:f=""})=>{const O=useRef(null),g=useRef(null);return useEffect(()=>{if(!!O.current){try{const A=c(y);g.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:m,autoplay:p,animationData:A})}catch(A){console.error("Failed to load Lottie animation:",A)}return()=>{var A;(A=g.current)==null||A.destroy()}}},[y,m,p]),jsx("div",{ref:O,className:f})}},81304:(Y,s,e)=>{"use strict";e.d(s,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),l=e(66267);const o=y=>y*1609.34;var i=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var b=e(92469);const c=({center:y,isLoading:m=!1,searchRadius:p,className:f,height:O="350px",width:g="100%",googleMapsApiKey:A,ariaLabel:h})=>{const d=(0,l.Bd)(),{isLoaded:v}=(0,r.KD)({googleMapsApiKey:A||""}),M={height:typeof O=="number"?`${O}px`:O,width:typeof g=="number"?`${g}px`:g},S=(0,t.useCallback)(x=>{google.maps.event.addListenerOnce(x,"idle",()=>{if(p&&y.lat&&y.lng){const C=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:o(p)}).getBounds();C&&x.fitBounds(C,0)}if(h){const C=x.getDiv().querySelector('[role="region"][aria-label="Map"]');C&&C.setAttribute("aria-label",h)}})},[y,p,h]);if(!v||m)return(0,n.jsx)("div",{className:(0,i.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",f),style:M,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:d("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,i.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",f),style:M,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:d("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const T={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,i.cx)("focus-within:ring-focus-ring overflow-hidden rounded-lg focus-within:ring-2 focus-within:ring-offset-2 [&_iframe]:outline-none",f),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:M,onLoad:S,options:T,zoom:12,children:(0,n.jsx)(b.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,s,e)=>{"use strict";e.d(s,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(s,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(s,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(s,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(s,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var l=e(92469)},92469:(Y,s,e)=>{"use strict";e.d(s,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:l})=>typeof l?.lat=="number"&&typeof l?.lng=="number"&&!isNaN(l.lat)&&!isNaN(l.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:l.lat,lng:l.lng}}):null},43743:(Y,s,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const l=({name:i,profileUrl:a,subTitle:b,variant:c="default",showChevron:u=!0,onClick:y,pendingText:m})=>{const p=!!m,f=!p&&!!y,O=u&&f;return jsxs("button",{type:"button",onClick:f?y:void 0,disabled:!f,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",f?"cursor-pointer":"cursor-default",p&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:i,size:"md",initials:getInitials(i),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:i}),p?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),m]}):jsx("span",{className:"text-secondary text-sm",children:b})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},o=()=>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:(Y,s,e)=>{"use strict";var n=e(31085);const t=({children:l,content:o,fullImageHeader:i=!1,header:a,title:b})=>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:[i?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:b}),o&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:o})]}),l]})]})}),r=null},51254:(Y,s,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:l,description:o,icon:i})=>{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:i.icon,color:(a=i.color)!=null?a:"brand",size:"lg",className:i.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:l}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},69092:()=>{},33457:(Y,s,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(s,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(s,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(s,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(s,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(s,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(s,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(s,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(s,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(s,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(s,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(s,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(s,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(s,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,s,e)=>{"use strict";e.d(s,{i:()=>ot});var n=e(31085),t=e(36087),r=e(14041);const l=({size:tt=24,color:qt="currentColor",...zn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:tt,height:tt,stroke:qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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"}));l.displayName="Building04";var o=e(14449),i=e(14711),a=e(58139),b=e(37121),c=e(43144);function u(tt){tt()}let y=null;const m=tt=>y=tt,p=()=>y,f=(0,r.createContext)(null),O=null;function g(){return(0,r.useContext)(f)}let h=()=>{throw new Error("uSES not initialized!")};const d=tt=>{h=tt},v=(tt,qt)=>tt===qt;function M(tt=f){const qt=tt===f?g:()=>(0,r.useContext)(tt);return function(An,lt=v){const{store:_t,subscription:dn,getServerState:rr}=qt(),Br=h(dn.addNestedSub,_t.getState,rr||_t.getState,An,lt);return(0,r.useDebugValue)(Br),Br}}const S=M();var T=e(75985),x=e(524);function z(){const tt=getBatch();let qt=null,zn=null;return{clear(){qt=null,zn=null},notify(){tt(()=>{let An=qt;for(;An;)An.callback(),An=An.next})},get(){let An=[],lt=qt;for(;lt;)An.push(lt),lt=lt.next;return An},subscribe(An){let lt=!0,_t=zn={callback:An,next:null,prev:zn};return _t.prev?_t.prev.next=_t:qt=_t,function(){!lt||qt===null||(lt=!1,_t.next?_t.next.prev=_t.prev:zn=_t.prev,_t.prev?_t.prev.next=_t.next:qt=_t.next)}}}}const C={notify(){},get:()=>[]};function E(tt,qt){let zn,An=C;function lt(Bn){return Br(),An.subscribe(Bn)}function _t(){An.notify()}function dn(){nn.onStateChange&&nn.onStateChange()}function rr(){return Boolean(zn)}function Br(){zn||(zn=qt?qt.addNestedSub(dn):tt.subscribe(dn),An=z())}function jt(){zn&&(zn(),zn=void 0,An.clear(),An=C)}const nn={addNestedSub:lt,notifyNestedSubs:_t,handleChangeWrapper:dn,isSubscribed:rr,trySubscribe:Br,tryUnsubscribe:jt,getListeners:()=>An};return nn}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=tt=>{D=tt},w=null,V=null,k=tt=>{try{return JSON.stringify(tt)}catch{return String(tt)}};function I(tt,qt,zn){useIsomorphicLayoutEffect(()=>tt(...qt),zn)}function G(tt,qt,zn,An,lt,_t){tt.current=An,zn.current=!1,lt.current&&(lt.current=null,_t())}function U(tt,qt,zn,An,lt,_t,dn,rr,Br,jt,nn){if(!tt)return()=>{};let Bn=!1,xn=null;const Nr=()=>{if(Bn||!rr.current)return;const Wt=qt.getState();let Fe,it;try{Fe=An(Wt,lt.current)}catch(Ze){it=Ze,xn=Ze}it||(xn=null),Fe===_t.current?dn.current||jt():(_t.current=Fe,Br.current=Fe,dn.current=!0,nn())};return zn.onStateChange=Nr,zn.trySubscribe(),Nr(),()=>{if(Bn=!0,zn.tryUnsubscribe(),zn.onStateChange=null,xn)throw xn}}const F=()=>w;function X(tt,qt){return tt===qt}let q=!1;function ae(tt,qt,zn,{pure:An,areStatesEqual:lt=X,areOwnPropsEqual:_t=shallowEqual,areStatePropsEqual:dn=shallowEqual,areMergedPropsEqual:rr=shallowEqual,forwardRef:Br=!1,context:jt=ReactReduxContext}={}){const nn=jt,Bn=mapStateToPropsFactory(tt),xn=mapDispatchToPropsFactory(qt),Nr=mergePropsFactory(zn),Pr=Boolean(tt);return Fe=>{const it=Fe.displayName||Fe.name||"Component",Ze=`Connect(${it})`,Qe={shouldHandleStateChanges:Pr,displayName:Ze,wrappedComponentName:it,WrappedComponent:Fe,initMapStateToProps:Bn,initMapDispatchToProps:xn,initMergeProps:Nr,areStatesEqual:lt,areStatePropsEqual:dn,areOwnPropsEqual:_t,areMergedPropsEqual:rr};function et(ut){const[ue,Ce,Ve]=useMemo(()=>{const{reactReduxForwardedRef:Rt}=ut,Kt=_objectWithoutPropertiesLoose(ut,P);return[ut.context,Rt,Kt]},[ut]),Te=useMemo(()=>ue&&ue.Consumer&&isContextConsumer(React.createElement(ue.Consumer,null))?ue:nn,[ue,nn]),It=useContext(Te),Yt=Boolean(ut.store)&&Boolean(ut.store.getState)&&Boolean(ut.store.dispatch),yn=Boolean(It)&&Boolean(It.store),qn=Yt?ut.store:It.store,pr=yn?It.getServerState:qn.getState,Ht=useMemo(()=>defaultSelectorFactory(qn.dispatch,Qe),[qn]),[we,Xe]=useMemo(()=>{if(!Pr)return V;const Rt=createSubscription(qn,Yt?void 0:It.subscription),Kt=Rt.notifyNestedSubs.bind(Rt);return[Rt,Kt]},[qn,Yt,It]),Dt=useMemo(()=>Yt?It:_extends({},It,{subscription:we}),[Yt,It,we]),sn=useRef(),un=useRef(Ve),Jt=useRef(),Fn=useRef(!1),gr=useRef(!1),Tr=useRef(!1),Xr=useRef();useIsomorphicLayoutEffect(()=>(Tr.current=!0,()=>{Tr.current=!1}),[]);const Qr=useMemo(()=>()=>Jt.current&&Ve===un.current?Jt.current:Ht(qn.getState(),Ve),[qn,Ve]),Oo=useMemo(()=>Kt=>we?U(Pr,qn,we,Ht,un,sn,Fn,Tr,Jt,Xe,Kt):()=>{},[we]);I(G,[un,sn,Fn,Ve,Jt,Xe]);let gt;try{gt=D(Oo,Qr,pr?()=>Ht(pr(),Ve):Qr)}catch(Rt){throw Xr.current&&(Rt.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.1169.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.14.2"},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.1430.0",D="@icanbwell/composite. repo version: 0.1430.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.1169.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.14.2"},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.1430.1",D="@icanbwell/composite. repo version: 0.1430.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.1169.0",
3
+ "version": "1.1169.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.1430.0",
47
- "description": "@icanbwell/composite. repo version: 0.1430.0"
46
+ "repoVersion": "0.1430.1",
47
+ "description": "@icanbwell/composite. repo version: 0.1430.1"
48
48
  }