@icanbwell/composite 1.1174.1 → 1.1175.0

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)}],Ce=["error","loading"],Le={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,Tn,yn,lt,_t,dn,or,Br,jt,nn;window.bwell||(window.bwell=new le({metadata:{version:kt}}));const wn=`bwell-${Nt}`;if(customElements.get(wn)!==void 0)return;class Rn 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),Tn.set(this,void 0),yn.set(this,void 0),lt.set(this,void 0),_t.set(this,void 0),dn.set(this,void 0),this.attachShadow({mode:"open"});const Dr=new he(Ie).attachToShadowRoot(this.shadowRoot);Dr.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:Dr,attributes:new F().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,tt,"f")},"f"),(0,g.__classPrivateFieldSet)(this,qt,(0,g.__classPrivateFieldGet)(this,Ke,"m",or).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,Tn,(0,g.__classPrivateFieldGet)(this,Ke,"m",Br).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,yn,(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,yn,"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,Tn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,yn,"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(Dr=>this.dispatchEvent(Dr)),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 Dr;(0,g.__classPrivateFieldGet)(this,tt,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,Tn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,yn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,lt,"f")),(Dr=(0,g.__classPrivateFieldGet)(this,Ft,"f"))===null||Dr===void 0||Dr.deregister(),(0,g.__classPrivateFieldGet)(this,tt,"f").removeAllListeners()}}Ye=new WeakMap,Ft=new WeakMap,ot=new WeakMap,tt=new WeakMap,qt=new WeakMap,Tn=new WeakMap,yn=new WeakMap,lt=new WeakMap,_t=new WeakMap,dn=new WeakMap,Ke=new WeakSet,or=function(){(0,g.__classPrivateFieldGet)(this,ot,"f").setAttribute("featureAppId",`bwell-embeddable:${wn}`),(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:wn,utils:(0,g.__classPrivateFieldGet)(this,dn,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,ot,"f"))},Br=function({visibility:Dr,name:Wt}){(0,g.__classPrivateFieldGet)(this,ot,"f").style.display=Dr==="hidden"?"unset":"hidden"},jt=function(Dr){(0,g.__classPrivateFieldGet)(this,_t,"f")(),(0,g.__classPrivateFieldSet)(this,_t,void 0,"f")},nn=function(Dr){return Wt=>{const Fe=Ce.findIndex(Ze=>Ze===Dr);if(!Ce.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,Dr),(0,g.__classPrivateFieldSet)(this,_t,(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlotLocked(Le[Dr]),"f");else if(Wt===null&&(0,g.__classPrivateFieldGet)(this,_t,"f")){(0,g.__classPrivateFieldGet)(this,Ke,"m",jt).call(this,Dr);const Ze=Ce.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(Le[Ze]),"f")}}}},customElements.define(wn,Rn)}),We={rE:"1.1174.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:(Z,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:P,className:D,children:L})=>{var N,w,F;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"),B=(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`,D),children:jsx(FHIRQuestionnaire,{formId:A,onFormDataChange:R,questionnaireResponseItem:(F=h?.item)!=null?F:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:d,errorConfig:T,customErrorConfigurations:z,isAdaptiveFlow:!0,onComplete:B,onGoBack:M,onClearError:x,handleHiddenQuestion:S,showStepper:C,hideBackButton:E,externalComponentRenderMap:P,children:L})})}},19622:(Z,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=P=>{try{R(T.next(P))}catch(D){z(D)}},E=P=>{try{R(T.throw(P))}catch(D){z(D)}},R=P=>P.done?x(P.value):Promise.resolve(P.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 P=(0,a.Ul)(),{i18n:{t:D},loading:L}=(0,b.E_)({keys:["shared-translations"]}),N=S?.placeId,w=S?.description,[F,k]=(0,t.useState)(""),[I,G]=(0,t.useState)(""),[U,B]=(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,Ae]=(0,t.useState)(he),[Me,J]=(0,t.useState)(he),[oe,{loading:me,error:ce}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[de,{loading:le,error:te}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[re,{loading:ge,error:xe}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Ae(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())}});Ae(Ye?.length?Ye:he)}}),Ie=(0,t.useMemo)(()=>ve.map(kt=>A(g({},kt),{displayLabel:(0,r.RZ)(kt?.label||"",F)})),[F,ve]),Ce=kt=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,Tn,yn,lt,_t,dn,or,Br,jt,nn;if(B(kt),q(kt),se(!1),kt&&typeof kt=="string"){const wn=ve.find(Qe=>Qe.id===kt),Rn=wn?.label||F;if(!wn)return;k(Rn),G(Rn),setTimeout(()=>{const Qe=[{id:wn.id,label:wn.label}];Ae(Qe),J(Qe)},d);const Nr=yield oe({variables:{placeId:kt}}),Dr=(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=((Tn=(qt=Nr?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Ze=((lt=(yn=Nr?.data)==null?void 0:yn.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(Dr&&Wt)if(!Fe||!Ze){const Qe=yield de({variables:{latitude:String(Dr),longitude:String(Wt)}}),et=((dn=(_t=Qe?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",ct=((Br=(or=Qe?.data)==null?void 0:or.geocodingByLatLon)==null?void 0:Br.state)||"",Dt=((nn=(jt=Qe?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:Dr,longitude:Wt,zipCode:et,state:ct,stateCode:Dt,placeId:kt,description:Rn,value:kt})}else x({latitude:Dr,longitude:Wt,zipCode:Fe,state:it,stateCode:Ze,placeId:kt,description:Rn,value:kt});else se(!0)}}),Le=()=>!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){B(null),Ae(he),x({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:kt});return}const Ot=kt.trim();Ot.length>=2?yield ze(Ot):Ae(he)}),st=kt=>{ne.current=kt},ft=()=>{k(I),Ae(Me),B(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,Tn,yn,lt,_t,dn,or,Br,jt,nn;if(N&&w){Ae([{id:N,label:F||w}]),J([{id:N,label:F||w}]),B(N),q(N),k(w),G(w),w===F&&k(w);const wn=yield oe({variables:{placeId:N}}),Rn=(Ke=(Ot=wn?.data)==null?void 0:Ot.geocodingByPlaceId)==null?void 0:Ke.latitude,Nr=(Ft=(Ye=wn?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Ft.longitude,Dr=((tt=(ot=wn?.data)==null?void 0:ot.geocodingByPlaceId)==null?void 0:tt.zipCode)||"",Wt=((Tn=(qt=wn?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Fe=((lt=(yn=wn?.data)==null?void 0:yn.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(Rn&&Nr)if(!Dr||!Wt||!Fe){const it=yield de({variables:{latitude:String(Rn),longitude:String(Nr)}}),Ze=((dn=(_t=it?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",Qe=((Br=(or=it?.data)==null?void 0:or.geocodingByLatLon)==null?void 0:Br.state)||"",et=((nn=(jt=it?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:Rn,longitude:Nr,zipCode:Ze,state:Qe,stateCode:et,placeId:N,description:w,value:N})}else x({latitude:Rn,longitude:Nr,zipCode:Dr,state:Wt,stateCode:Fe,placeId:N,description:w,value:N})}else B(null),q(null),k(""),G(""),Ae(he),J(he)}))()},[]);const Mt=ae||!!ce||!!te||!!xe||!!R,Nt=Mt?R||D("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||L)},[E,me,le,L]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:z,inputValue:F,isLoading:ge||me||le,placeholder:D("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Ie,selectedKey:U,onSelectionChange:Ce,onInputChange:We,defaultFilter:Le,onOpenChange:st,onBlur:ft,isInvalid:Mt,hint:Nt,autoComplete:"address-line1",className:"w-full",children:kt=>{const Ot=kt,Ke=F.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,F):{beforePart:"",highlightedPart:"",remainingPart:""},Tn=tt?(0,r.RZ)(Ft,F):{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:Tn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Tn.highlightedPart}),(0,n.jsx)("span",{children:Tn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ot.label})})}})})}},18077:()=>{},12200:(Z,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:(Z,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:(Z,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:(Z,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((P,D)=>setTimeout(()=>D(new Error(R)),E)),u=(E,R,P)=>Promise.race([E,c(R,P)]),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,P)=>R in E?p(E,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[R]=P,v=(E,R)=>{for(var P in R||(R={}))A.call(R,P)&&d(E,P,R[P]);if(g)for(var P of g(R))h.call(R,P)&&d(E,P,R[P]);return E},M=(E,R)=>f(E,O(R)),S=(E,R,P)=>new Promise((D,L)=>{var N=k=>{try{F(P.next(k))}catch(I){L(I)}},w=k=>{try{F(P.throw(k))}catch(I){L(I)}},F=k=>k.done?D(k.value):Promise.resolve(k.value).then(N,w);F((P=P.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:P}=(0,r.useDeviceDetection)(),D=(0,o.Ul)(),{geolocation:L}=(0,l.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),F=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,G]=(0,t.useState)(!1),[U,B]=(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=>{B(ge);try{w(M(v({},k.current),{locationPermission:ge||i.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?D?.error(xe,"Failed to update query params"):D?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,D]),he=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return yield L.isAvailable()}catch(ge){return ge instanceof Error?D?.error(ge,"Error checking geolocation availability"):D?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[L,D]),ve=(0,t.useCallback)(ge=>S(void 0,null,function*(){const xe=L.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&&D?.error(Ie,"Geolocation timeout or error"),Ie}}),[L,D]),Ae=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(L.checkPermission(),y,"Check permission timed out")}),[L]),Me=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(L.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[L]),J=(0,t.useCallback)(()=>S(void 0,null,function*(){try{if(!(yield he()))return D?.error("Location services not available"),!1;const xe=yield Ae();return xe!==i.Ef.GRANTED&&xe!==i.Ef.PROMPT?(D?.error(`Location permission not granted: ${xe}`),!1):!0}catch(ge){return ge instanceof Error?D?.error(ge,"Error checking location services"):D?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[he,D,Ae]);(0,t.useEffect)(()=>{if(F.current)return;F.current=!0,(()=>S(void 0,null,function*(){const xe=N.locationPermission;if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){B(xe);return}G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}if(xe===i.Ef.GRANTED){try{const Le=yield Ae();if(Le===i.Ef.GRANTED){const ze=yield ve(T);ze&&(q(ze),ne(i.Ef.GRANTED))}else Le===i.Ef.PROMPT?(ne(Le),se(!0)):ne(Le)}catch(Le){Le instanceof Error?D?.error(Le,"Error getting initial location with granted permission"):D?.error(`Error getting initial location with granted permission - ${JSON.stringify(Le)}`),ne(i.Ef.UNAVAILABLE)}return}const Ce=yield Ae();if(ne(Ce),Ce===i.Ef.GRANTED)try{const Le=yield ve(T);Le?q(Le):ne(i.Ef.UNAVAILABLE)}catch(Le){Le instanceof Error?D?.error(Le,"Error getting initial location"):D?.error(`Error getting initial location - ${JSON.stringify(Le)}`),ne(i.Ef.UNAVAILABLE)}else Ce===i.Ef.PROMPT&&se(!0)}catch(Ie){Ie instanceof Error?D?.error(Ie,"Error initializing location permission"):D?.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 Ae();if(ne(xe),xe===i.Ef.GRANTED||xe===i.Ef.PROMPT){if(P==="Android"&&xe===i.Ef.GRANTED)try{xe=yield Me(),ne(xe)}catch(Ie){Ie instanceof Error?D?.error(Ie,"Error re-requesting Android permission"):D?.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?D?.error(ge,"Error refreshing location"):D?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{G(!1)}}),[J,D,P,ne,ve,Ae,Me]),me=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return(yield he())?yield Ae():i.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?D?.error(ge,"Error checking location permission"):D?.error(`Error checking location permission - ${JSON.stringify(ge)}`),i.Ef.UNAVAILABLE}}),[he,D,Ae]),ce=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield Ae();ne(xe)}catch(ge){ge instanceof Error?D?.error(ge,"Error checking and setting location permission"):D?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE)}finally{G(!1)}}),[he,D,ne,Ae]),de=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield Ae();if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){ne(xe);return}const Ie=yield Me();if(ne(Ie),["granted","prompt"].includes(Ie)){const Ce=yield ve(T);return q(Ce),Ce}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||D?.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")||D?.error(`Error requesting location - ${xe}`)}ne(i.Ef.UNAVAILABLE);return}finally{G(!1)}}),[he,D,ne,ve,Me,Ae]),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),B(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?D?.error(ge,"Error requesting current location"):D?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE),ge}finally{G(!1)}}),[he,D,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?D?.error(ge,"Error overriding search settings"):D?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{G(!1)}}),[D,U,oe,w]),re=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:B,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:(Z,s,e)=>{"use strict";e.d(s,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Z,s,e)=>{"use strict";e.d(s,{pc:()=>Dt,GI:()=>Ae,rz:()=>_t,Cq:()=>X,Fp:()=>lt,el:()=>yn,ao:()=>Tn,oA:()=>L,Yt:()=>ut,Nu:()=>un,g4:()=>qt,tn:()=>Te,n4:()=>N,gD:()=>D,Vp:()=>et,Cx:()=>G,bK:()=>k,gi:()=>ct,Z$:()=>de,GT:()=>Qe,hr:()=>le,JL:()=>te,Ck:()=>I,dU:()=>F,wG:()=>Rn,hZ:()=>nn,$e:()=>dn,qT:()=>jt,GQ:()=>Br,q3:()=>wn,D_:()=>or,Uf:()=>B,_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:()=>Dr,PV:()=>Ze,PS:()=>Nr,Iz:()=>Fe,zD:()=>ne,m3:()=>Nt,XP:()=>kt,PM:()=>Ce,cX:()=>re,G6:()=>ge,Us:()=>ze,AA:()=>Ie,G0:()=>Mt,mO:()=>st,HH:()=>Le,PU:()=>Ve,it:()=>Ke,Tl:()=>ft,uH:()=>Ot,c3:()=>xe,rx:()=>P});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 P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,D="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",L="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",F="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",B="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",Ae="check-box",Me="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",Ce="ui-toolkit/Button",Le="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",Tn="http://icanbwell.com/fhir/StructureDefinition/error-title",yn="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",or="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",wn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Rn="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Nr="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Dr="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",Dt="http://icanbwell.com/fhir/StructureDefinition/alert-color",ut="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ue="http://icanbwell.com/fhir/StructureDefinition/placeholder",Oe="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",On="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",Lt={},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:(Z,s,e)=>{"use strict";e.d(s,{$H:()=>N,$O:()=>ft,AT:()=>pr,CP:()=>dn,Fy:()=>_t,GN:()=>ve,J4:()=>Dt,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:()=>F,t7:()=>Mt,u0:()=>S,yQ:()=>On,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"},P="Type your response here...",D=(gt,Bt)=>{const en=gt?.find(Rt=>Rt.url===PLACEHOLDER_EXTENSION_URL);return en?.valueString||Bt&&R[Bt]||P},L=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(", "),F=(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)},B=(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=B(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},Ae=(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))},Me=(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=Me(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(!Ae(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,Lo;return yo.url===m.gD&&((Lo=(Wo=yo.valueCodeableConcept)==null?void 0:Wo.coding)==null?void 0:Lo.some(ii=>ii.system===m.n4&&ii.code===m.GI))}),ur=Kt?.[0],Pr={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 Pr))return"";const jr=Pr[Bt],si={required:()=>en&&(jr==null||jr===""||jr==="NaN"||Number.isNaN(jr)||Bt==="boolean"&&jr!==!0&&Sr)?S(Je,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Rt&&jr!==null&&jr!==void 0&&jr.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&&jr!==null&&jr!==void 0&&jr.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),Lo=Wo??S(Je,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return yo&&Bt==="url"&&jr&&!yo.test(jr)?String(Lo):""},regex:()=>{const yo=I("regex",gt);if(!yo||typeof jr!="string")return"";const Wo=new RegExp(yo),Lo=I("regexError",gt),ii=Lo??S(Je,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Wo&&jr&&!Wo.test(jr)?String(ii):""},dateTime:()=>{if(Bt==="dateTime"&&jr){const yo=jr?.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"||!jr)return"";const yo=jr.replace(/\D/g,"");return yo.length>0&&yo.length<8||isNaN(new Date(jr).getTime())?S(Je,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var yo;if(Bt==="date"){const Lo=U(m.dU,gt),ii=X(Lo??"01/01/1900","01/01/1900"),nr=X(jr,"");if(!ii||!nr)return"";if((0,l.A)(nr,ii)){const dr=(yo=gt?.find(Lr=>Lr.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:Lo??"01/01/1900"})}return""}const Wo=I("minValue",gt);return Wo!=null&&jr!==null&&jr!==void 0&&jr<Wo?S(Je,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Wo}):""},maxValue:()=>{var yo;if(Bt==="date"){const Lo=U(m.bK,gt),ii=X(Lo??"01/01/2100","01/01/2100"),nr=X(jr,"");if(!ii||!nr)return"";if((0,o.A)(nr,ii)){const dr=(yo=gt?.find(Lr=>Lr.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:Lo??"01/01/2100"})}return""}const Wo=I("maxValue",gt);return Wo!=null&&jr!==null&&jr!==void 0&&jr>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))}))},Ce=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===m.oA&&en.valueBoolean))},Le=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 Pr={linkId:Vt.linkId,text:Vt.text};let jr;if(en===Vt.linkId&&typeof At=="number"&&At===ur&&Kt&&Kt.length>0){const si=Sr?.item||[];jr=[...si],Kt.forEach(yo=>{const Wo=jr.findIndex(Lo=>Lo.linkId===yo.linkId);Wo>=0?jr[Wo]=M(v({},si[Wo]),{answer:yo.answer}):jr.push(yo)})}else Vt.item&&(jr=kt(Vt.item,Sr?.item||[],en,Rt,Kt,ur));en===Vt.linkId&&typeof At=="number"&&At===ur&&Rt?Pr.answer=Rt:Pr.answer=Sr.answer||[{}],jr&&jr.length>0?Pr.item=jr:Sr.item&&(Pr.item=Sr.item),kn.push(Pr)}),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,Pr={linkId:Vt.linkId,text:Vt.text};return en&&Vt.linkId===en&&typeof At!="number"?(Rt||!Rt&&!Kt?Pr.answer=Rt:kn?.answer&&(Pr.answer=kn.answer),Kt?Pr.item=Kt:ur&&(Pr.item=Sr)):(kn?.answer?Pr.answer=kn.answer:Pr.answer=[{}],ur&&(Pr.item=Sr)),Pr}}).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(Ce(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},Tn=(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,Pr]of Object.entries(kn))if(Pr!=null){const jr=hn(Pr);jr!==void 0&&(Sr[ur]=jr)}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 Pr=qt(hn(Sr)),jr=qt(hn(ur));if(!_.isEqual(Pr,jr))return!1}return Rt!==At},yn=(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=yn(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=yn(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,""),or=(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},wn=(gt,Bt)=>{const en={};if(!gt||!gt[Bt])return en;const Rt=gt[Bt];return en[Bt]=Rt[0]||"",en},Rn=gt=>{const Bt=gt.findIndex(At=>!Ce(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},Dr=(gt,Bt,en)=>{if(!gt)return[];const Rt=[],Kt=At=>{At.required===Bt&&ve(At.enableWhen,At.enableBehavior,en)&&!Ce(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||Ce(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 Pr=xe(en,ur.linkId);return!Pr||Ce(Pr)&&ve(Pr.enableWhen,Pr.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),Dt=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}=Rn(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)}],Ce=["error","loading"],Le={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,Tn,yn,lt,_t,dn,or,Br,jt,nn;window.bwell||(window.bwell=new le({metadata:{version:kt}}));const wn=`bwell-${Nt}`;if(customElements.get(wn)!==void 0)return;class Rn 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),Tn.set(this,void 0),yn.set(this,void 0),lt.set(this,void 0),_t.set(this,void 0),dn.set(this,void 0),this.attachShadow({mode:"open"});const Dr=new he(Ie).attachToShadowRoot(this.shadowRoot);Dr.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:Dr,attributes:new F().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,tt,"f")},"f"),(0,g.__classPrivateFieldSet)(this,qt,(0,g.__classPrivateFieldGet)(this,Ke,"m",or).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,Tn,(0,g.__classPrivateFieldGet)(this,Ke,"m",Br).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,yn,(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,yn,"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,Tn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,yn,"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(Dr=>this.dispatchEvent(Dr)),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 Dr;(0,g.__classPrivateFieldGet)(this,tt,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,dn,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,Tn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,yn,"f")),(0,g.__classPrivateFieldGet)(this,dn,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,lt,"f")),(Dr=(0,g.__classPrivateFieldGet)(this,Ft,"f"))===null||Dr===void 0||Dr.deregister(),(0,g.__classPrivateFieldGet)(this,tt,"f").removeAllListeners()}}Ye=new WeakMap,Ft=new WeakMap,ot=new WeakMap,tt=new WeakMap,qt=new WeakMap,Tn=new WeakMap,yn=new WeakMap,lt=new WeakMap,_t=new WeakMap,dn=new WeakMap,Ke=new WeakSet,or=function(){(0,g.__classPrivateFieldGet)(this,ot,"f").setAttribute("featureAppId",`bwell-embeddable:${wn}`),(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:wn,utils:(0,g.__classPrivateFieldGet)(this,dn,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,ot,"f"))},Br=function({visibility:Dr,name:Wt}){(0,g.__classPrivateFieldGet)(this,ot,"f").style.display=Dr==="hidden"?"unset":"hidden"},jt=function(Dr){(0,g.__classPrivateFieldGet)(this,_t,"f")(),(0,g.__classPrivateFieldSet)(this,_t,void 0,"f")},nn=function(Dr){return Wt=>{const Fe=Ce.findIndex(Ze=>Ze===Dr);if(!Ce.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,Dr),(0,g.__classPrivateFieldSet)(this,_t,(0,g.__classPrivateFieldGet)(this,dn,"f").slots.showSlotLocked(Le[Dr]),"f");else if(Wt===null&&(0,g.__classPrivateFieldGet)(this,_t,"f")){(0,g.__classPrivateFieldGet)(this,Ke,"m",jt).call(this,Dr);const Ze=Ce.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(Le[Ze]),"f")}}}},customElements.define(wn,Rn)}),We={rE:"1.1175.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:(Z,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:P,className:D,children:L})=>{var N,w,F;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"),B=(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`,D),children:jsx(FHIRQuestionnaire,{formId:A,onFormDataChange:R,questionnaireResponseItem:(F=h?.item)!=null?F:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:d,errorConfig:T,customErrorConfigurations:z,isAdaptiveFlow:!0,onComplete:B,onGoBack:M,onClearError:x,handleHiddenQuestion:S,showStepper:C,hideBackButton:E,externalComponentRenderMap:P,children:L})})}},19622:(Z,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=P=>{try{R(T.next(P))}catch(D){z(D)}},E=P=>{try{R(T.throw(P))}catch(D){z(D)}},R=P=>P.done?x(P.value):Promise.resolve(P.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 P=(0,a.Ul)(),{i18n:{t:D},loading:L}=(0,b.E_)({keys:["shared-translations"]}),N=S?.placeId,w=S?.description,[F,k]=(0,t.useState)(""),[I,G]=(0,t.useState)(""),[U,B]=(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,Ae]=(0,t.useState)(he),[Me,J]=(0,t.useState)(he),[oe,{loading:me,error:ce}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[de,{loading:le,error:te}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[re,{loading:ge,error:xe}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Ae(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())}});Ae(Ye?.length?Ye:he)}}),Ie=(0,t.useMemo)(()=>ve.map(kt=>A(g({},kt),{displayLabel:(0,r.RZ)(kt?.label||"",F)})),[F,ve]),Ce=kt=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,Tn,yn,lt,_t,dn,or,Br,jt,nn;if(B(kt),q(kt),se(!1),kt&&typeof kt=="string"){const wn=ve.find(Qe=>Qe.id===kt),Rn=wn?.label||F;if(!wn)return;k(Rn),G(Rn),setTimeout(()=>{const Qe=[{id:wn.id,label:wn.label}];Ae(Qe),J(Qe)},d);const Nr=yield oe({variables:{placeId:kt}}),Dr=(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=((Tn=(qt=Nr?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Ze=((lt=(yn=Nr?.data)==null?void 0:yn.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(Dr&&Wt)if(!Fe||!Ze){const Qe=yield de({variables:{latitude:String(Dr),longitude:String(Wt)}}),et=((dn=(_t=Qe?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",ct=((Br=(or=Qe?.data)==null?void 0:or.geocodingByLatLon)==null?void 0:Br.state)||"",Dt=((nn=(jt=Qe?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:Dr,longitude:Wt,zipCode:et,state:ct,stateCode:Dt,placeId:kt,description:Rn,value:kt})}else x({latitude:Dr,longitude:Wt,zipCode:Fe,state:it,stateCode:Ze,placeId:kt,description:Rn,value:kt});else se(!0)}}),Le=()=>!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){B(null),Ae(he),x({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:kt});return}const Ot=kt.trim();Ot.length>=2?yield ze(Ot):Ae(he)}),st=kt=>{ne.current=kt},ft=()=>{k(I),Ae(Me),B(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ot,Ke,Ye,Ft,ot,tt,qt,Tn,yn,lt,_t,dn,or,Br,jt,nn;if(N&&w){Ae([{id:N,label:F||w}]),J([{id:N,label:F||w}]),B(N),q(N),k(w),G(w),w===F&&k(w);const wn=yield oe({variables:{placeId:N}}),Rn=(Ke=(Ot=wn?.data)==null?void 0:Ot.geocodingByPlaceId)==null?void 0:Ke.latitude,Nr=(Ft=(Ye=wn?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Ft.longitude,Dr=((tt=(ot=wn?.data)==null?void 0:ot.geocodingByPlaceId)==null?void 0:tt.zipCode)||"",Wt=((Tn=(qt=wn?.data)==null?void 0:qt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Fe=((lt=(yn=wn?.data)==null?void 0:yn.geocodingByPlaceId)==null?void 0:lt.stateCode)||"";if(Rn&&Nr)if(!Dr||!Wt||!Fe){const it=yield de({variables:{latitude:String(Rn),longitude:String(Nr)}}),Ze=((dn=(_t=it?.data)==null?void 0:_t.geocodingByLatLon)==null?void 0:dn.zipCode)||"",Qe=((Br=(or=it?.data)==null?void 0:or.geocodingByLatLon)==null?void 0:Br.state)||"",et=((nn=(jt=it?.data)==null?void 0:jt.geocodingByLatLon)==null?void 0:nn.stateCode)||"";x({latitude:Rn,longitude:Nr,zipCode:Ze,state:Qe,stateCode:et,placeId:N,description:w,value:N})}else x({latitude:Rn,longitude:Nr,zipCode:Dr,state:Wt,stateCode:Fe,placeId:N,description:w,value:N})}else B(null),q(null),k(""),G(""),Ae(he),J(he)}))()},[]);const Mt=ae||!!ce||!!te||!!xe||!!R,Nt=Mt?R||D("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||L)},[E,me,le,L]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:z,inputValue:F,isLoading:ge||me||le,placeholder:D("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Ie,selectedKey:U,onSelectionChange:Ce,onInputChange:We,defaultFilter:Le,onOpenChange:st,onBlur:ft,isInvalid:Mt,hint:Nt,autoComplete:"address-line1",className:"w-full",children:kt=>{const Ot=kt,Ke=F.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,F):{beforePart:"",highlightedPart:"",remainingPart:""},Tn=tt?(0,r.RZ)(Ft,F):{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:Tn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Tn.highlightedPart}),(0,n.jsx)("span",{children:Tn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ot.label})})}})})}},18077:()=>{},12200:(Z,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:(Z,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:(Z,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:(Z,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((P,D)=>setTimeout(()=>D(new Error(R)),E)),u=(E,R,P)=>Promise.race([E,c(R,P)]),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,P)=>R in E?p(E,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[R]=P,v=(E,R)=>{for(var P in R||(R={}))A.call(R,P)&&d(E,P,R[P]);if(g)for(var P of g(R))h.call(R,P)&&d(E,P,R[P]);return E},M=(E,R)=>f(E,O(R)),S=(E,R,P)=>new Promise((D,L)=>{var N=k=>{try{F(P.next(k))}catch(I){L(I)}},w=k=>{try{F(P.throw(k))}catch(I){L(I)}},F=k=>k.done?D(k.value):Promise.resolve(k.value).then(N,w);F((P=P.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:P}=(0,r.useDeviceDetection)(),D=(0,o.Ul)(),{geolocation:L}=(0,l.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),F=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,G]=(0,t.useState)(!1),[U,B]=(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=>{B(ge);try{w(M(v({},k.current),{locationPermission:ge||i.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?D?.error(xe,"Failed to update query params"):D?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,D]),he=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return yield L.isAvailable()}catch(ge){return ge instanceof Error?D?.error(ge,"Error checking geolocation availability"):D?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[L,D]),ve=(0,t.useCallback)(ge=>S(void 0,null,function*(){const xe=L.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&&D?.error(Ie,"Geolocation timeout or error"),Ie}}),[L,D]),Ae=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(L.checkPermission(),y,"Check permission timed out")}),[L]),Me=(0,t.useCallback)(()=>S(void 0,null,function*(){return u(L.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[L]),J=(0,t.useCallback)(()=>S(void 0,null,function*(){try{if(!(yield he()))return D?.error("Location services not available"),!1;const xe=yield Ae();return xe!==i.Ef.GRANTED&&xe!==i.Ef.PROMPT?(D?.error(`Location permission not granted: ${xe}`),!1):!0}catch(ge){return ge instanceof Error?D?.error(ge,"Error checking location services"):D?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[he,D,Ae]);(0,t.useEffect)(()=>{if(F.current)return;F.current=!0,(()=>S(void 0,null,function*(){const xe=N.locationPermission;if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){B(xe);return}G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}if(xe===i.Ef.GRANTED){try{const Le=yield Ae();if(Le===i.Ef.GRANTED){const ze=yield ve(T);ze&&(q(ze),ne(i.Ef.GRANTED))}else Le===i.Ef.PROMPT?(ne(Le),se(!0)):ne(Le)}catch(Le){Le instanceof Error?D?.error(Le,"Error getting initial location with granted permission"):D?.error(`Error getting initial location with granted permission - ${JSON.stringify(Le)}`),ne(i.Ef.UNAVAILABLE)}return}const Ce=yield Ae();if(ne(Ce),Ce===i.Ef.GRANTED)try{const Le=yield ve(T);Le?q(Le):ne(i.Ef.UNAVAILABLE)}catch(Le){Le instanceof Error?D?.error(Le,"Error getting initial location"):D?.error(`Error getting initial location - ${JSON.stringify(Le)}`),ne(i.Ef.UNAVAILABLE)}else Ce===i.Ef.PROMPT&&se(!0)}catch(Ie){Ie instanceof Error?D?.error(Ie,"Error initializing location permission"):D?.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 Ae();if(ne(xe),xe===i.Ef.GRANTED||xe===i.Ef.PROMPT){if(P==="Android"&&xe===i.Ef.GRANTED)try{xe=yield Me(),ne(xe)}catch(Ie){Ie instanceof Error?D?.error(Ie,"Error re-requesting Android permission"):D?.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?D?.error(ge,"Error refreshing location"):D?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{G(!1)}}),[J,D,P,ne,ve,Ae,Me]),me=(0,t.useCallback)(()=>S(void 0,null,function*(){try{return(yield he())?yield Ae():i.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?D?.error(ge,"Error checking location permission"):D?.error(`Error checking location permission - ${JSON.stringify(ge)}`),i.Ef.UNAVAILABLE}}),[he,D,Ae]),ce=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield Ae();ne(xe)}catch(ge){ge instanceof Error?D?.error(ge,"Error checking and setting location permission"):D?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE)}finally{G(!1)}}),[he,D,ne,Ae]),de=(0,t.useCallback)(()=>S(void 0,null,function*(){G(!0);try{if(!(yield he())){ne(i.Ef.UNAVAILABLE);return}const xe=yield Ae();if(xe===i.Ef.DENIED||xe===i.Ef.BLOCKED||xe===i.Ef.UNAVAILABLE){ne(xe);return}const Ie=yield Me();if(ne(Ie),["granted","prompt"].includes(Ie)){const Ce=yield ve(T);return q(Ce),Ce}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||D?.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")||D?.error(`Error requesting location - ${xe}`)}ne(i.Ef.UNAVAILABLE);return}finally{G(!1)}}),[he,D,ne,ve,Me,Ae]),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),B(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?D?.error(ge,"Error requesting current location"):D?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ne(i.Ef.UNAVAILABLE),ge}finally{G(!1)}}),[he,D,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?D?.error(ge,"Error overriding search settings"):D?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{G(!1)}}),[D,U,oe,w]),re=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:B,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:(Z,s,e)=>{"use strict";e.d(s,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Z,s,e)=>{"use strict";e.d(s,{pc:()=>Dt,GI:()=>Ae,rz:()=>_t,Cq:()=>X,Fp:()=>lt,el:()=>yn,ao:()=>Tn,oA:()=>L,Yt:()=>ut,Nu:()=>un,g4:()=>qt,tn:()=>Te,n4:()=>N,gD:()=>D,Vp:()=>et,Cx:()=>G,bK:()=>k,gi:()=>ct,Z$:()=>de,GT:()=>Qe,hr:()=>le,JL:()=>te,Ck:()=>I,dU:()=>F,wG:()=>Rn,hZ:()=>nn,$e:()=>dn,qT:()=>jt,GQ:()=>Br,q3:()=>wn,D_:()=>or,Uf:()=>B,_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:()=>Dr,PV:()=>Ze,PS:()=>Nr,Iz:()=>Fe,zD:()=>ne,m3:()=>Nt,XP:()=>kt,PM:()=>Ce,cX:()=>re,G6:()=>ge,Us:()=>ze,AA:()=>Ie,G0:()=>Mt,mO:()=>st,HH:()=>Le,PU:()=>Ve,it:()=>Ke,Tl:()=>ft,uH:()=>Ot,c3:()=>xe,rx:()=>P});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 P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,D="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",L="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",F="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",B="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",Ae="check-box",Me="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",Ce="ui-toolkit/Button",Le="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",Tn="http://icanbwell.com/fhir/StructureDefinition/error-title",yn="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",or="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",wn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Rn="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Nr="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Dr="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",Dt="http://icanbwell.com/fhir/StructureDefinition/alert-color",ut="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ue="http://icanbwell.com/fhir/StructureDefinition/placeholder",Oe="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",On="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",Lt={},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:(Z,s,e)=>{"use strict";e.d(s,{$H:()=>N,$O:()=>ft,AT:()=>pr,CP:()=>dn,Fy:()=>_t,GN:()=>ve,J4:()=>Dt,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:()=>F,t7:()=>Mt,u0:()=>S,yQ:()=>On,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"},P="Type your response here...",D=(gt,Bt)=>{const en=gt?.find(Rt=>Rt.url===PLACEHOLDER_EXTENSION_URL);return en?.valueString||Bt&&R[Bt]||P},L=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(", "),F=(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)},B=(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=B(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},Ae=(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))},Me=(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=Me(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(!Ae(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,Lo;return yo.url===m.gD&&((Lo=(Wo=yo.valueCodeableConcept)==null?void 0:Wo.coding)==null?void 0:Lo.some(ii=>ii.system===m.n4&&ii.code===m.GI))}),ur=Kt?.[0],Pr={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 Pr))return"";const jr=Pr[Bt],si={required:()=>en&&(jr==null||jr===""||jr==="NaN"||Number.isNaN(jr)||Bt==="boolean"&&jr!==!0&&Sr)?S(Je,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Rt&&jr!==null&&jr!==void 0&&jr.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&&jr!==null&&jr!==void 0&&jr.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),Lo=Wo??S(Je,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return yo&&Bt==="url"&&jr&&!yo.test(jr)?String(Lo):""},regex:()=>{const yo=I("regex",gt);if(!yo||typeof jr!="string")return"";const Wo=new RegExp(yo),Lo=I("regexError",gt),ii=Lo??S(Je,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Wo&&jr&&!Wo.test(jr)?String(ii):""},dateTime:()=>{if(Bt==="dateTime"&&jr){const yo=jr?.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"||!jr)return"";const yo=jr.replace(/\D/g,"");return yo.length>0&&yo.length<8||isNaN(new Date(jr).getTime())?S(Je,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var yo;if(Bt==="date"){const Lo=U(m.dU,gt),ii=X(Lo??"01/01/1900","01/01/1900"),nr=X(jr,"");if(!ii||!nr)return"";if((0,l.A)(nr,ii)){const dr=(yo=gt?.find(Lr=>Lr.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:Lo??"01/01/1900"})}return""}const Wo=I("minValue",gt);return Wo!=null&&jr!==null&&jr!==void 0&&jr<Wo?S(Je,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Wo}):""},maxValue:()=>{var yo;if(Bt==="date"){const Lo=U(m.bK,gt),ii=X(Lo??"01/01/2100","01/01/2100"),nr=X(jr,"");if(!ii||!nr)return"";if((0,o.A)(nr,ii)){const dr=(yo=gt?.find(Lr=>Lr.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:Lo??"01/01/2100"})}return""}const Wo=I("maxValue",gt);return Wo!=null&&jr!==null&&jr!==void 0&&jr>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))}))},Ce=gt=>{var Bt;return!!((Bt=gt.extension)!=null&&Bt.find(en=>en.url===m.oA&&en.valueBoolean))},Le=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 Pr={linkId:Vt.linkId,text:Vt.text};let jr;if(en===Vt.linkId&&typeof At=="number"&&At===ur&&Kt&&Kt.length>0){const si=Sr?.item||[];jr=[...si],Kt.forEach(yo=>{const Wo=jr.findIndex(Lo=>Lo.linkId===yo.linkId);Wo>=0?jr[Wo]=M(v({},si[Wo]),{answer:yo.answer}):jr.push(yo)})}else Vt.item&&(jr=kt(Vt.item,Sr?.item||[],en,Rt,Kt,ur));en===Vt.linkId&&typeof At=="number"&&At===ur&&Rt?Pr.answer=Rt:Pr.answer=Sr.answer||[{}],jr&&jr.length>0?Pr.item=jr:Sr.item&&(Pr.item=Sr.item),kn.push(Pr)}),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,Pr={linkId:Vt.linkId,text:Vt.text};return en&&Vt.linkId===en&&typeof At!="number"?(Rt||!Rt&&!Kt?Pr.answer=Rt:kn?.answer&&(Pr.answer=kn.answer),Kt?Pr.item=Kt:ur&&(Pr.item=Sr)):(kn?.answer?Pr.answer=kn.answer:Pr.answer=[{}],ur&&(Pr.item=Sr)),Pr}}).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(Ce(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},Tn=(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,Pr]of Object.entries(kn))if(Pr!=null){const jr=hn(Pr);jr!==void 0&&(Sr[ur]=jr)}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 Pr=qt(hn(Sr)),jr=qt(hn(ur));if(!_.isEqual(Pr,jr))return!1}return Rt!==At},yn=(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=yn(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=yn(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,""),or=(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},wn=(gt,Bt)=>{const en={};if(!gt||!gt[Bt])return en;const Rt=gt[Bt];return en[Bt]=Rt[0]||"",en},Rn=gt=>{const Bt=gt.findIndex(At=>!Ce(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},Dr=(gt,Bt,en)=>{if(!gt)return[];const Rt=[],Kt=At=>{At.required===Bt&&ve(At.enableWhen,At.enableBehavior,en)&&!Ce(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||Ce(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 Pr=xe(en,ur.linkId);return!Pr||Ce(Pr)&&ve(Pr.enableWhen,Pr.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),Dt=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}=Rn(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")}},Oe=(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},On=(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??B(gt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Xe=gt=>I(ANALYTICS_EVENT_NAME_EXTENSION_URL,gt.extension),Lt=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=Ce(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},Gr=(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 Lo=Ce(Wo);(Bt.includes(Wo.linkId)||Lo&&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),Pr=Sr.filter(yo=>yo.required!==!0),jr=Wt(ur,gt),si=Pr?.every(yo=>{var Wo;const Lo=(Wo=q(gt,yo.linkId))==null?void 0:Wo.answer;return Lo?!oe(yo,gt,Lo):!0});return!ur?.length||jr&&si},Yr=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(Yr))!=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(Yr);return!Je&&!zt?M(v({},en),{answer:[{}]}):en.item&&en.item.length>0?M(v({},en),{item:Oo(en.item,Kt.item||[])}):en})},2658:(Z,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 eo=hr.text||"",ro=hr.extension||[],gn=Ar=>{var In;return(In=ro.find(mr=>mr.url===Ar))==null?void 0:In.valueString},Nn=gn(i.$7),Yn=gn(i.pc)||"default";return(0,n.jsx)(l.AlertFloating,{title:eo,description:Nn??"",color:Yn})};var c=e(7630),u=e(16212),y=Object.defineProperty,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,O=(hr,eo,ro)=>eo in hr?y(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,g=(hr,eo)=>{for(var ro in eo||(eo={}))p.call(eo,ro)&&O(hr,ro,eo[ro]);if(m)for(var ro of m(eo))f.call(eo,ro)&&O(hr,ro,eo[ro]);return hr};const A=({item:hr})=>{const[eo,ro]=(0,t.useState)(!1),gn=hr.extension||[],Nn=Ho=>{var Fo;return(Fo=gn.find(li=>li.url===Ho))==null?void 0:Fo.valueString},Yn=Nn(i.PS)||hr.text||"",Ar=Nn(i.Iz)||"button",In=Nn(i.VF),mr=Nn(i.PV),Ur=Nn(i.vf),Ct=Ur?i.JP[Ur]:void 0,He=Nn(i.D_)||"",rt=Nn(i.$e),St=Nn(i.GQ),Cn=Nn(i.qT)||"gray",Pn=Nn(i.hZ),Jn=Nn(i.wG),$r=Nn(i.q3),po=St?i.JP[St]:void 0,fo=()=>ro(!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":Yn||He||void 0,children:[Ct&&(0,n.jsx)(Ct,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Yn&&(0,n.jsx)("span",{className:"text-sm",children:Yn})]});default:return(0,n.jsx)(l.Button,{color:In??"secondary",size:mr??"md",iconLeading:Ct,onClick:fo,"aria-label":Yn,children:Yn})}};return(0,n.jsxs)(n.Fragment,{children:[qo(),(0,n.jsx)(l.Modal,g(g(g({id:`modal-${hr.linkId}`,isOpen:eo,onOpenChange:ro,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:()=>ro(!1)}},po?{featuredIcon:{icon:po,color:Cn,size:"lg",className:"bg-white"}}:{}),Pn?{primaryButton:{children:Pn,onClick:()=>{var Ho,Fo;Jn==="open-zendesk"&&((Fo=(Ho=globalThis.zE)==null?void 0:Ho.activate)==null||Fo.call(Ho,{hideOnClose:!0})),ro(!1)}}}:{}),$r?{secondaryButton:{children:$r,onClick:()=>ro(!1)}}:{}))]})};var h=e(18522);const d=({item:hr})=>{var eo,ro,gn,Nn,Yn,Ar,In,mr,Ur,Ct,He,rt;const{hasExternalError:St}=(0,h.c)(),Cn=hr.text||"",Pn=(ro=(eo=hr.extension)==null?void 0:eo.find(Ti=>Ti.url===i.ao))==null?void 0:ro.valueString,Jn=St&&Pn?Pn:Cn,$r=(Nn=(gn=hr.extension)==null?void 0:gn.find(Ti=>Ti.url===i.$7))==null?void 0:Nn.valueString,po=(Ar=(Yn=hr.extension)==null?void 0:Yn.find(Ti=>Ti.url===i.el))==null?void 0:Ar.valueString,fo=St&&po?po:$r,qo=(mr=(In=hr.extension)==null?void 0:In.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",L0=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] ${L0} ${Sa} md:max-w-[352px]`,children:Jn}),(0,n.jsx)("p",{className:`text-md text-secondary ${L0}`,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,eo,ro)=>eo in hr?S(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,E=(hr,eo)=>{for(var ro in eo||(eo={}))x.call(eo,ro)&&C(hr,ro,eo[ro]);if(T)for(var ro of T(eo))z.call(eo,ro)&&C(hr,ro,eo[ro]);return hr};const R=({item:hr})=>{const[eo,ro]=(0,t.useState)(!1),gn=(0,M.T$)(),Nn=hr.extension||[],Yn=Pn=>{var Jn;return(Jn=Nn.find($r=>$r.url===Pn))==null?void 0:Jn.valueString},Ar=hr.text||"",In=Yn(i.PS)||"",mr=Yn(i.D_)||"",Ur=Yn(i.$e),Ct=Yn(i.GQ),He=Yn(i.qT)||"gray",rt=Yn(i.hZ),St=Yn(i.q3),Cn=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})]}),In&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>ro(!0),children:In})]}),(0,n.jsx)(l.Modal,E(E(E({id:`modal-${hr.linkId}`,isOpen:eo,onOpenChange:ro,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:()=>ro(!1)}},Cn?{featuredIcon:{icon:Cn,color:He,size:"lg",className:"bg-white"}}:{}),rt?{primaryButton:{children:rt,onClick:()=>{ro(!1),gn.navigate({id:"profile"})}}}:{}),St?{secondaryButton:{children:St,onClick:()=>ro(!1)}}:{}))]})},P=({item:hr,selectedAnswer:eo,handleInputChange:ro})=>{var gn,Nn,Yn;const Ar=(gn=hr.answerOption)!=null?gn:[],In=(Yn=(Nn=eo?.[0])==null?void 0:Nn.valueCoding)==null?void 0:Yn.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:Ar.map(mr=>{var Ur,Ct,He,rt,St,Cn,Pn;const Jn=(Ct=(Ur=mr.valueCoding)==null?void 0:Ur.code)!=null?Ct:"",$r=(rt=(He=mr.valueCoding)==null?void 0:He.display)!=null?rt:"",po=In===Jn,fo=(St=mr.extension)==null?void 0:St.find(li=>li.url===i.g4),qo=(Cn=mr.extension)==null?void 0:Cn.find(li=>li.url===i.rz),Ho=fo?.valueString?i.JP[fo.valueString]:void 0,Fo=(Pn=qo?.valueString)!=null?Pn:"";return(0,n.jsx)(l.SelectableOption,{icon:Ho,title:$r,description:Fo,isSelected:po,onSelect:()=>{ro(hr,[{valueCoding:{code:Jn,display:$r}}])}},Jn)})})};var D=e(72866),L=e(96814);const N="(###) ###-####",w=(hr,eo)=>{const ro=hr.replace(/\D/g,"");let gn="",Nn=0;for(let Yn=0;Yn<eo.length&&Nn<ro.length;Yn++)eo[Yn]==="#"?(gn+=ro[Nn],Nn++):gn+=eo[Yn];return gn},F=hr=>{if(!hr)return N;const eo=hr.find(ro=>ro.url===i.Md);return eo?.valueString||N},k=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar})=>{var In;const{linkId:mr,text:Ur,required:Ct,prefix:He,readOnly:rt,extension:St}=hr,Cn=F(St),Pn=((In=ro?.[0])==null?void 0:In.valueString)||"",[Jn,$r]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Pn){const Fo=w(Pn,Cn);$r(Fo)}},[Pn,Cn]);const po=Ur?(0,a.nt)(Nn,He,Ur):"",fo=Yn?.[mr]||"",qo=Fo=>{const li=w(Fo,Cn);$r(li),gn(hr,[{valueString:li}])},Ho=()=>{eo&&eo(mr)};return(0,n.jsxs)("div",{"data-testid":mr,children:[po&&(0,n.jsx)(L.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:Jn,onChange:qo,onBlur:Ho,isDisabled:rt||Ar,isRequired:Ct,hint:fo,isInvalid:!!fo,size:"md"},mr)]})},I=({item:hr,questionnaireSchemaItems:eo})=>{var ro;const{isLoading:gn,setCurrentGroupIndex:Nn}=(0,h.c)(),Yn=(ro=hr.extension)==null?void 0:ro.find(Ur=>Ur.url===i.Uf),Ar=Yn?.valueString,In=hr.text||"Save & continue",mr=()=>{if(Ar){const Ur=(0,a.Ue)(eo||[],Ar);Ur!==-1&&Nn(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:In})})},G=({size:hr=24,color:eo="currentColor",...ro})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:eo,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...ro},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 B=({size:hr=24,color:eo="currentColor",...ro})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:eo,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...ro},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"}));B.displayName="UserCircle";var X=e(14711);const q=({size:hr=24,color:eo="currentColor",...ro})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:eo,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...ro},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 eo=hr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!eo)return hr;const[,ro,gn,Nn]=eo;return new Date(Date.UTC(parseInt(ro),parseInt(gn)-1,parseInt(Nn))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return hr}},Ae=hr=>{try{if(hr.includes("AM")||hr.includes("PM"))return hr;const eo=hr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!eo)return hr;const[,ro,gn]=eo,Nn=parseInt(ro),Yn=Nn>=12?"PM":"AM";return`${Nn%12||12}:${gn} ${Yn}`}catch{return hr}},Me=(hr,eo,ro=v.d)=>{var gn;const Nn=(gn=hr.extension)==null?void 0:gn.find(Yn=>Yn.url===i.g4);return Nn?.valueString&&i.JP[Nn.valueString]?i.JP[Nn.valueString]:hr.linkId&&eo[hr.linkId]?eo[hr.linkId]:ro},J={"appointment-review/first-name":G,"appointment-review/last-name":G,"appointment-review/dob":U.V,"appointment-review/gender":B,"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:eo})=>{var ro,gn;const{setCurrentGroupIndex:Nn,setEditReturnGroupIndex:Yn,currentGroupIndex:Ar,isLoading:In}=(0,h.c)(),{trackEvent:mr}=(0,o.st)(),Ur=hr.item||[];if(Ur.length===0)return null;const Ct=(ro=hr.extension)==null?void 0:ro.find(Pn=>Pn.url===i.Uf),He=Ct?.valueString,rt=!!((gn=hr.extension)!=null&&gn.find(Pn=>Pn.url===i.Cq&&Pn.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 Pn=(0,a.Ue)(eo||[],He);Pn!==-1&&(rt&&Yn(Ar),Nn(Pn))}},Cn=Ur.map(Pn=>{let Jn="";if(Pn.initial&&Pn.initial.length>0){const fo=Pn.initial.map(qo=>{var Ho,Fo,li,Ji,Fi,s0,L0,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(Pn.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(Pn.linkId)){const _0=(Sa=(L0=(s0=qo.valueReference)==null?void 0:s0.extension)==null?void 0:L0.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=Ae(Ti)}else Ti=Ae(Ti)}}return Ti}).filter(Boolean);fo.length>1||Pn.repeats&&fo.length>0?Jn=fo:fo.length===1&&(Jn=fo[0])}if(!Jn||Array.isArray(Jn)&&Jn.length===0)return null;let $r;ce.includes(Pn.linkId)?$r="phone":de.includes(Pn.linkId)&&($r="address");let po;return le.includes(Pn.linkId)&&(po="phone"),{Icon:Me(Pn,J),label:Pn.text||Pn.linkId,value:Jn,linkType:$r,displayType:po}}).filter(Boolean);return Cn.length===0?null:(0,n.jsx)("div",{"data-testid":hr.linkId,children:(0,n.jsx)(he.InfoCard,{title:hr.text||"Details",infoDetails:Cn,actionButtonText:He&&!In?"Edit info":void 0,onActionButtonClick:He&&!In?St:void 0})})},re=({size:hr=24,color:eo="currentColor",...ro})=>t.createElement("svg",{viewBox:"0 0 24 24",width:hr,height:hr,stroke:eo,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...ro},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:eo,incrementCustomErrorCount:ro,decrementCustomErrorCount:gn,addErrorLinkId:Nn,removeErrorLinkId:Yn}=(0,h.c)();return(0,t.useEffect)(()=>(eo(!0),ro(),Nn(hr.linkId),()=>{eo(!1),gn(),Yn(hr.linkId)}),[eo,ro,gn,Nn,Yn,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"},Ce=({item:hr})=>{var eo,ro,gn,Nn;const{incrementCustomErrorCount:Yn,decrementCustomErrorCount:Ar,addErrorLinkId:In,removeErrorLinkId:mr,setHideFooterButton:Ur}=(0,h.c)(),[Ct,He]=(0,t.useState)(!1),rt=(eo=hr.extension)==null?void 0:eo.find(po=>po.url===i.gi),St=(gn=(ro=rt?.valueCodeableConcept)==null?void 0:ro.coding)==null?void 0:gn.find(po=>po.system===i.tn),Cn=St?.code||"error",Pn=Ie[Cn]||"error";(0,t.useEffect)(()=>{if(Pn==="error")return Yn(),Ur(!0),He(!0),()=>{Ar(),Ur(!1)};if(Pn==="fatal")return Yn(),In(hr.linkId),Ur(!0),He(!0),()=>{Ar(),mr(hr.linkId),Ur(!1)};He(!0)},[Pn]);const Jn=St?.display||"Error",$r=(Nn=hr.text)!=null?Nn:"";return Ct?(0,n.jsx)("div",{"data-testid":hr.linkId,children:(0,n.jsx)(l.InfoBanner,{type:Pn==="fatal"?"error":Pn,title:Jn,description:$r})}):null};var Le=e(65735);const ze=({configKey:hr,customErrorConfigurations:eo})=>{if(!eo)return null;const ro=eo[hr];if(!ro)return null;const{icon:gn,title:Nn,description:Yn,primaryButton:Ar,secondaryButton:In}=ro;return(0,n.jsx)(l.EmptyState,{className:"mt-5xl",title:Nn,description:Yn,featuredIconProps:{icon:gn,color:"gray"},primaryButton:Ar,secondaryButton:In})},We=10,st=({item:hr,customErrorConfigurations:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar})=>{var In,mr,Ur,Ct;const{trackEvent:He}=(0,o.st)(),{setHideFooterButton:rt}=(0,h.c)(),{linkId:St,text:Cn,required:Pn,answerOption:Jn,prefix:$r,readOnly:po}=hr,fo=hr?.type==="reference",qo=(In=ro?.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?In:[],[Ho,Fo]=(0,t.useState)(qo.length),li=Cn?(0,a.nt)(Nn,$r,Cn):"",Ji=(Ur=(mr=hr.extension)==null?void 0:mr.find(K0=>K0.url===i.Z_))==null?void 0:Ur.valueInteger,Fi=(Ct=Jn?.map(K0=>{var $a,Ks,c1,L1;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)||"":((L1=K0.valueCoding)==null?void 0:L1.display)||"",valueReference:K0.valueReference}}))!=null?Ct:[],s0=Yn?.[St],L0=Fi.length>We,Sa=L0?Fi.slice(0,We):Fi,Ti=L0?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:eo});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 L1=Fi.find(B1=>B1.value===$a);c1=[...(Ks=ro?.filter(B1=>Object.keys(B1).length!==0))!=null?Ks:[],fo?{valueReference:L1?.valueReference}:{valueCoding:{code:$a,display:L1?.label}}],Fo(B1=>B1+1)}else c1=ro?.filter(L1=>{var B1,el;return fo?((B1=L1.valueReference)==null?void 0:B1.display)!==$a:((el=L1.valueCoding)==null?void 0:el.code)!==$a})||[{}],Fo(L1=>L1-1);gn&&gn(hr,c1)};return(0,n.jsxs)("div",{"data-testid":St,children:[li&&(0,n.jsx)(L.W,{text:li,required:Pn||!1,item:hr}),L0&&(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:L1=>h1(L1,K0.value),isDisabled:po||Ar||c1})},$a)})}),L0&&!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"})}),L0&&H0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),L0&&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:L1=>h1(L1,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,eo,ro)=>eo in hr?kt(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,qt=(hr,eo)=>{for(var ro in eo||(eo={}))Ft.call(eo,ro)&&tt(hr,ro,eo[ro]);if(Ye)for(var ro of Ye(eo))ot.call(eo,ro)&&tt(hr,ro,eo[ro]);return hr},Tn=(hr,eo)=>Ot(hr,Ke(eo)),yn=(hr,eo,ro)=>new Promise((gn,Nn)=>{var Yn=mr=>{try{In(ro.next(mr))}catch(Ur){Nn(Ur)}},Ar=mr=>{try{In(ro.throw(mr))}catch(Ur){Nn(Ur)}},In=mr=>mr.done?gn(mr.value):Promise.resolve(mr.value).then(Yn,Ar);In((ro=ro.apply(hr,eo)).next())});const lt=({item:hr,handleInputChange:eo,onCompleteHandler:ro,errors:gn})=>{const{i18n:{t:Nn},loading:Yn}=(0,Nt.E_)({keys:["shared-translations","ui-toolkit-modern"]}),{trackEvent:Ar}=(0,o.st)(),{linkId:In,required:mr,readOnly:Ur}=hr,Ct=gn?.[In]||"",[He,rt]=(0,t.useState)(ft.LocationType.CURRENT_LOCATION),[St,Cn]=(0,t.useState)(""),Pn=(0,t.useRef)({}),[Jn,$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)(),[L0,{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 Cn(""),!1;const Y1=(0,a.zj)(H0.extension,H0.type,!1,H0.maxLength,[{valueString:ja}],void 0,Nn);return Y1?(Cn(He!==ft.LocationType.ZIP_CODE?Nn("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Y1),!1):(Cn(""),!0)},K0=()=>{const{latitude:ja,longitude:Y1,state:uo,zipcode:zr}=Pn.current;return!!(ja&&Y1&&uo&&zr)},$a=(0,t.useCallback)(ja=>{Pn.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},hr.item&&(e0&&eo(e0,[{valueString:""}]),Na&&eo(Na,[{valueDecimal:void 0}]),qs&&eo(qs,[{valueDecimal:void 0}]),H0&&eo(H0,[{valueString:""}])),s0({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:ja,locationPermission:Ji}),qo&&qo(!1),Cn("")},[eo,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=>{Pn.current=qt(qt({},Pn.current),ja),ja.addressDescription&&Ar("address_selected",{value:ja.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),B1(Pn.current.latitude,Pn.current.longitude,Pn.current.state,Pn.current.zipcode,Pn.current.placeId,Pn.current.addressDescription)},c1=ja=>yn(void 0,null,function*(){var Y1,uo,zr;if(Cn(""),Pn.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=(Y1=Rr?.data)==null?void 0:Y1.geocoding,Se=Rr?.error;if(Re){const Ue=Re.stateCode||"",Pt=(uo=Re.latitude)!=null?uo:void 0,tn=(zr=Re.longitude)!=null?zr:void 0;Ks({latitude:Pt,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}),Cn(Nn("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else B1(Pn.current.latitude,Pn.current.longitude,Pn.current.state,ja)}),L1=()=>{const ja=Pn.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&&(Pn.current.addressDescription=Fi.addressDescription,Pn.current.placeId=Fi.placeId))},[]),(0,t.useEffect)(()=>{const ja=[ft.LocationPermissionEnum.DENIED,ft.LocationPermissionEnum.UNAVAILABLE,ft.LocationPermissionEnum.BLOCKED].includes(Fi.locationPermission),Y1=[ft.LocationPermissionEnum.GRANTED,ft.LocationPermissionEnum.PROMPT].includes(Fi.locationPermission);if(ja&&Jn.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 uo=Fi.locationType===ft.LocationType.ZIP_CODE?ft.LocationType.ZIP_CODE:ft.LocationType.ADDRESS;rt(uo),s0(Tn(qt({},Fi),{locationType:uo})),$a(uo)}Cn("")}Y1&&Jn.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,Jn.length,Fi,s0,$a]);const B1=(ja,Y1,uo,zr,Rr,Re)=>{if(!hr.item)return;e0&&eo(e0,[{valueString:uo||""}]),Na&&eo(Na,[{valueDecimal:ja}]),qs&&eo(qs,[{valueDecimal:Y1}]),H0&&eo(H0,[{valueString:zr||""}]),s0(Tn(qt({},Fi),{lat:String(ja),lng:String(Y1),location:`${ja},${Y1}`,zipCode:zr||"",placeId:Rr||"",addressDescription:Re||"",locationPermission:Ji}));const Se=K0()&&h1(zr||"");qo&&qo(Se),ro&&ro(In)};(0,t.useEffect)(()=>{const ja=()=>yn(void 0,null,function*(){var Y1;try{const uo=yield L0({variables:{latitude:String(Fo?.coords.latitude),longitude:String(Fo?.coords.longitude)}}),zr=(Y1=uo?.data)==null?void 0:Y1.geocodingByLatLon,Rr=zr?.stateCode||"",Re=zr?.zipCode||"";(!Re||!Rr)&&Cn(Nn("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 el=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&&Cn(Nn("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||Yn)},[li,Sa,_0,Yn,fo]),(0,t.useEffect)(()=>{Fi.locationType!==He&&s0(Tn(qt({},Fi),{locationType:He}))},[He]),(0,n.jsxs)("div",{"data-testid":hr.linkId,children:[(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:mr||!1,item:hr}),(0,n.jsx)(l.Select,{id:In,"aria-label":In,"data-testid":In,isDisabled:Ur||Sa||_0||po,selectedKey:He,onSelectionChange:ja=>{var Y1;Ar("location_type_input_selected",{choice:(Y1=Jn.find(({id:uo})=>uo===ja))==null?void 0:Y1.label,_event_metadata:{description:"A user changed the location type input."}}),ja!==He&&($a(ja),rt(ja))},hint:Ct,isInvalid:!!Ct,items:Jn,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)},In),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)(L.W,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:mr||!1,item:hr}),(0,n.jsx)(ft.AddressTypeahead,{onValueChange:el,isDisabled:po,setIsLoading:fo,initialValue:{placeId:Pn.current.placeId||"",description:Pn.current.addressDescription||""},errorText:St||Ct})]}),He===ft.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(L.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:`${In}-zipcode`,placeholder:"Type your response here...",value:Pn.current.zipcode||"",onChange:c1,onBlur:L1,isDisabled:Ur||_0||po,hint:St||Ct,isInvalid:!!St||!!Ct,autoComplete:"postal-code"},`${In}-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]:Ce,[i.mO]:d,[i.PM]:I,[i.HH]:k,[i.Us]:xe,[i.Tl]:P,[i.G0]:A,[i.m3]:b,[i.PU]:R,[i.XP]:c.l,[i.uH]:D.v,[i.it]:Le.d};var or=e(81367),Br=e(94043);const jt=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar})=>{var In,mr;const{linkId:Ur,text:Ct,prefix:He,readOnly:rt,required:St,extension:Cn}=hr,{trackQuestionnaireEvent:Pn}=(0,h.c)(),Jn=Ct?(0,a.nt)(Nn,He,Ct):"",$r=Yn?.[Ur];return Cn?.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:(In=ro?.[0])==null?void 0:In.valueBoolean,"aria-label":Ur,label:"",className:"mt-1",onChange:fo=>{Pn(hr.linkId,{value:fo}),gn(hr,[{valueBoolean:fo}]),eo(hr.linkId)}}),Jn&&(0,n.jsx)(L.W,{isLabel:!0,text:Jn,required:St||!1,item:hr})]}),(0,n.jsx)(l.HintText,{isInvalid:!!$r,children:$r})]}):(0,n.jsxs)("div",{"data-testid":Ur,children:[Jn&&(0,n.jsx)(L.W,{isLabel:!0,text:Jn,required:St||!1,item:hr}),(0,n.jsxs)(l.RadioGroup,{size:"md",id:Ur,name:Ur,"aria-label":Ur,value:String((mr=ro?.[0])==null?void 0:mr.valueBoolean)||"",onChange:fo=>{gn(hr,[{valueBoolean:fo==="true"}]),eo(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,wn=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,Dr=(hr,eo,ro)=>eo in hr?nn(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,Wt=(hr,eo)=>{for(var ro in eo||(eo={}))Rn.call(eo,ro)&&Dr(hr,ro,eo[ro]);if(wn)for(var ro of wn(eo))Nr.call(eo,ro)&&Dr(hr,ro,eo[ro]);return hr};const Fe=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur,Ct,He;const{linkId:rt,text:St,required:Cn,answerOption:Pn,prefix:Jn,readOnly:$r}=hr,po=St?(0,a.nt)(Nn,Jn,St):"",fo=Pn?.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=ro?.[0])==null?void 0:Ur.valueCoding)==null?void 0:Ct.code)||((He=ro?.[0])==null?void 0:He.valueString)||"",Ho=Yn?.[rt];return(0,n.jsxs)("div",{children:[po&&(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:po,required:Cn||!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(L0=>L0.value===li),Fi=Ji?Ji.label:"",s0=Boolean(Pn?.find(L0=>L0.valueString===li));gn(hr,[s0?{valueString:li}:{valueCoding:Wt({code:li,display:Fi},Ji?.system?{system:Ji.system}:{}),extension:Ji?.extension||[]}]),eo(hr.linkId)},isInvalid:!!Ho,hint:Ho||mr,items:fo,placeholder:In,isRequired:Cn,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,eo,ro)=>eo in hr?it(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,Dt=(hr,eo)=>{for(var ro in eo||(eo={}))Qe.call(eo,ro)&&ct(hr,ro,eo[ro]);if(Ze)for(var ro of Ze(eo))et.call(eo,ro)&&ct(hr,ro,eo[ro]);return hr};const ut=hr=>{var eo,ro,gn;const{item:Nn,selectedAnswer:Yn,updatedText:Ar,required:In,errorMessage:mr}=hr,Ur=Nn?.type==="reference",Ct=(eo=Yn?.map(Pn=>{var Jn,$r;return Ur?(Jn=Pn.valueReference)==null?void 0:Jn.display:($r=Pn.valueCoding)==null?void 0:$r.code}).filter(Pn=>Pn!==void 0))!=null?eo:[],[He,rt]=(0,t.useState)(Ct.length),St=(gn=(ro=Nn.extension)==null?void 0:ro.find(Pn=>Pn.url===i.Z_))==null?void 0:gn.valueInteger,Cn=(Pn,Jn)=>{var $r,po,fo;let qo;if(Pn){const Ho=hr.options.find(Fo=>Fo.value===Jn);qo=[...(po=($r=hr.selectedAnswer)==null?void 0:$r.filter(Fo=>Object.keys(Fo).length!==0))!=null?po:[],Ur?{valueReference:Ho?.valueReference}:{valueCoding:Dt({code:Jn,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)!==Jn:((li=Ho.valueCoding)==null?void 0:li.code)!==Jn}))||[{}],rt(Ho=>Ho-1);hr.handleInputChange(hr.item,qo)};return(0,n.jsxs)("div",{"data-testid":Nn.linkId,children:[Ar&&(0,n.jsx)(L.W,{isLabel:!0,text:Ar,required:In||!1,item:Nn}),(0,n.jsx)("div",{children:hr.options.map((Pn,Jn)=>(0,n.jsx)(l.Checkbox,{size:"md","data-testid":Pn.value,id:Jn.toString(),className:Jn!==hr.options.length-1?"mb-2xl":"",name:Pn.label,isInvalid:!!mr,isSelected:Ct?.includes(Pn?.value),label:Pn.label,onChange:$r=>Cn($r,Pn.value),isDisabled:hr.readOnly||hr.isLoading||(!Ct?.includes(Pn?.value)&&St?He>=St:!1)},Jn))}),(0,n.jsx)(l.HintText,{isInvalid:!!mr,children:mr})]})},ue=({item:hr,onCompleteHandler:eo,updatedText:ro,options:gn,handleInputChange:Nn,errorMessage:Yn,readOnly:Ar,initialValue:In,selectedAnswer:mr,isLoading:Ur,required:Ct})=>{var He,rt;const St=`${hr.linkId}-label`,Cn=`${hr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":hr.linkId,children:[ro&&(0,n.jsx)(L.W,{id:St,isLabel:!0,text:ro,required:Ct||!1,item:hr}),(0,n.jsx)(l.RadioGroup,{size:"md",id:hr.linkId,name:hr.linkId,"aria-labelledby":ro?St:void 0,"aria-describedby":Yn?Cn: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)||In||"",onChange:Pn=>{const Jn=Pn,$r=gn.find(fo=>fo.value===Jn),po=$r?$r.label:"";Nn(hr,[{valueCoding:{code:Jn,display:po,system:$r?.system||void 0},extension:$r?.extension||[]}]),eo(hr.linkId)},isInvalid:!!Yn,children:gn.map(Pn=>(0,n.jsx)(l.RadioButton,{size:"md","data-testid":Pn.value,isDisabled:Ar||Ur,value:Pn.value,label:Pn.label},Pn.value))},hr.linkId),Yn&&(0,n.jsx)("div",{id:Cn,children:(0,n.jsx)("span",{className:(0,Br.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Yn})})]})};var Oe=Object.defineProperty,Ve=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,Yt=(hr,eo,ro)=>eo in hr?Oe(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,On=(hr,eo)=>{for(var ro in eo||(eo={}))Te.call(eo,ro)&&Yt(hr,ro,eo[ro]);if(Ve)for(var ro of Ve(eo))It.call(eo,ro)&&Yt(hr,ro,eo[ro]);return hr};const qn=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur,Ct,He,rt,St;const{linkId:Cn,text:Pn,required:Jn,answerOption:$r,prefix:po,readOnly:fo}=hr,qo=hr?.type==="reference",Ho=Pn?(0,a.nt)(Nn,po,Pn):"",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=Yn?.[Cn],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 L0=null;const Sa={item:hr,onCompleteHandler:eo,updatedText:Ho,options:Ji,handleInputChange:gn,errorMessage:Fi,required:Jn,readOnly:fo,initialValue:li,selectedAnswer:ro,isLoading:Ar,showQuestionPrefix:Nn,placeholder:In,hintText:mr};switch(s0){case"drop-down":L0=(0,n.jsx)(Fe,On({},Sa));break;case"check-box":L0=(0,n.jsx)(ut,On({},Sa));break;case"radio-button":L0=(0,n.jsx)(ue,On({},Sa));break}return(0,n.jsx)(n.Fragment,{children:L0})};var pr=e(8077),Ht=e(31936),we=e(77806),Xe=e(16681);const Lt=hr=>`${String(hr.month).padStart(2,"0")}/${String(hr.day).padStart(2,"0")}/${hr.year}`,sn=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur,Ct,He;const{linkId:rt,text:St,required:Cn,prefix:Pn,readOnly:Jn}=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)(Nn,Pn,St):"",L0=Yn?.[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=ro?.[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 Pt=Ue.slice(0,2),tn=Ue.slice(2);return tn.length===2?`${Pt}/${tn}/`:`${Pt}/${tn}`},Se=Ue=>{const Pt=Ue.slice(0,2),tn=Ue.slice(2,4),Mn=Ue.slice(4,8);return`${Pt}/${tn}/${Mn}`};return Rr.length<=4?Re(Rr):Se(Rr)},$a=()=>{if(Jn||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,Pt=parseInt(Re,10),tn=parseInt(Se,10);if(Pt>=1&&Pt<=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)},L1=zr=>{var Rr;const Re=((Rr=$r.current)==null?void 0:Rr.selectionStart)||0,Se=h1,Ue=K0(zr),Pt=Ue.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Pt){const[,tn,Mn,zn]=Pt,_r=parseInt(tn,10),En=parseInt(Mn,10),Er=parseInt(zn,10);if(B1(_r,En,Er).isValid){const Dn=`${zn}-${tn}-${Mn}`;Fi(hr.linkId,{value:(0,a.CP)(`${tn}/${Mn}/${zn}`)}),gn(hr,[{valueDate:(0,a.Fy)(Dn)}])}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 zn=Re;Ue===Se&&(zn=Re-1),Mn.length>=tn.length&&Ue!==Se?Ue[Re-1]==="/"?zn=Re+1:zn=Re:Mn.length<tn.length&&(Se[Re-1]==="/"?zn=Math.max(0,Re-1):zn=Re),$r.current.setSelectionRange(zn,zn)}},0)},B1=(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 Pt=(0,pr._U)(_0);if(Ue.compare(Pt)<0){const tn=(0,a.di)(i.Ck,hr.extension);if(tn)return{isValid:!1,error:tn};const Mn=Lt(Pt);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 Pt=(0,pr._U)(H0);if(Ue.compare(Pt)>0){const tn=(0,a.di)(i.Cx,hr.extension);if(tn)return{isValid:!1,error:tn};const Mn=Lt(Pt);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:""}},el=()=>{const zr=h1.replace(/\D/g,"");if(zr.length>0&&zr.length<8){eo(hr.linkId);return}const Rr=h1.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!Rr&&zr.length>=6){eo(hr.linkId);return}if(Rr){const[,Re,Se,Ue]=Rr,Pt=parseInt(Re,10),tn=parseInt(Se,10),Mn=parseInt(Ue,10);if(B1(Pt,tn,Mn).isValid){const zn=`${Ue}-${Re}-${Se}`;gn(hr,[{valueDate:(0,a.Fy)(zn)}])}}eo(hr.linkId)},Y1=(()=>{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,Pt=parseInt(Re,10),tn=parseInt(Se,10),Mn=parseInt(Ue,10),{isValid:zn,error:_r}=B1(Pt,tn,Mn);if(!zn)return Ji&&li(!1),_r||(0,a.u0)(Fo,Xe.p.VALIDATION_INVALID_DATE,"Invalid date")}return""})(),uo=!!L0||!!Y1;return(0,n.jsxs)("div",{children:[s0&&(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:s0,required:Cn||!1,item:hr}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Jn||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",(Jn||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",(Jn||Ar)&&"bg-disabled_subtle")}),(0,n.jsx)(l.Input,{ref:$r,isRequired:Cn,size:"md",type:"text",name:rt,"data-testid":rt,id:rt,value:h1,onChange:L1,placeholder:In,isDisabled:Jn||Ar,onBlur:el,hint:Y1||L0||mr,isInvalid:uo,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:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar})=>{var In;const{linkId:mr,text:Ur,required:Ct,prefix:He,readOnly:rt}=hr,St=Ur?(0,a.nt)(Nn,He,Ur):"",Cn=Yn?.[mr]||"";return(0,n.jsxs)("div",{children:[St&&(0,n.jsx)(L.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:((In=ro?.[0])==null?void 0:In.valueDateTime)||"",onChange:Pn=>{let Jn=Pn;const[$r,po]=Jn.split("T");$r&&po&&(Jn=`${(0,a.Fy)($r)}T${po}:00`),gn(hr,[{valueDateTime:Jn}])},isDisabled:rt||Ar,onBlur:()=>{eo(hr.linkId)},hint:Cn,isInvalid:!!Cn},mr)]})},Jt=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:Cn}=hr,Pn=He?(0,a.nt)(Nn,St,He):"",Jn=Yn?.[Ct]||"",$r=(0,a.a0)(hr),po=(Ur=ro?.[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:[Pn&&(0,n.jsx)(L.W,{isLabel:!0,text:Pn,required:rt||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:rt,size:"md",id:Ct,"aria-label":Ct,"data-testid":Ct,placeholder:In,value:fo,onChange:Ho=>{qo(Ho)},isDisabled:Cn||Ar,onBlur:()=>{const Ho=parseFloat(fo);qo(isNaN(Ho)?"":String(Ho)),gn(hr,[{valueDecimal:isNaN(Ho)?void 0:Ho}]),eo(hr.linkId)},type:"number",hint:Jn||mr,isInvalid:!!Jn,autoComplete:$r},Ct)]})},Fn=({item:hr,showStepper:eo=!1})=>{var ro;const{text:gn,linkId:Nn,type:Yn}=hr,Ar=gn&&(0,a.nt)(!1,"",gn),In=(ro=hr.extension)==null?void 0:ro.find(He=>He.url===i.Yt),mr=In?.valueBoolean===!0,Ur=Yn==="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 Cn=1;Cn<=rt;Cn++){let Pn="incomplete";Cn<He?Pn="complete":Cn===He&&(Pn="current"),St.push({title:"",description:"",status:Pn})}return St};return Ar&&!mr?(0,n.jsxs)("div",{"data-testid":Nn,children:[(0,n.jsx)(L.W,{text:Ar,required:!1,className:""}),eo&&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:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:Cn}=hr,Pn=He?(0,a.nt)(Nn,St,He):"",Jn=Yn?.[Ct]||"",$r=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Pn&&(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:Pn,required:rt||!1,item:hr}),(0,n.jsx)(l.Input,{isRequired:rt,"data-testid":Ct,size:"md",id:Ct,"aria-label":Ct,placeholder:In,value:String((Ur=ro?.[0])==null?void 0:Ur.valueInteger)||"",onChange:po=>{gn(hr,[{valueInteger:Number(po)}])},isDisabled:Cn||Ar,onBlur:()=>{eo(hr.linkId)},type:"number",hint:Jn||mr,isInvalid:!!Jn,autoComplete:$r},Ct)]})},Tr=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur,Ct,He;const{linkId:rt,text:St,extension:Cn,required:Pn,prefix:Jn,readOnly:$r}=hr,po=St?(0,a.nt)(Nn,Jn,St):"",fo=Cn?.find(Fo=>Fo.url.includes("questionnaire-unitOption")),qo=Yn?.[rt],Ho=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[po&&(0,n.jsx)(L.W,{isLabel:!0,text:po,required:Pn||!1,item:hr}),(0,n.jsx)(l.InputGroup,{isRequired:Pn,size:"md",id:rt,"aria-label":rt,"data-testid":rt,value:(Ur=ro?.[0])!=null&&Ur.valueQuantity?String((Ct=ro[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=ro?.[0])!=null&&Fo.valueQuantity?parseFloat(String((Ji=(li=ro?.[0])==null?void 0:li.valueQuantity)==null?void 0:Ji.value)).toFixed(2):"";gn(hr,[{valueQuantity:{value:parseFloat(Fi)}}]),eo(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:In,autoComplete:Ho})},rt)]})},Gr={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},Yr={[Gr.CURRENT_LOCATION]:Xe.p.CURRENT_LOCATION,[Gr.ZIP_CODE]:Xe.p.ZIP_CODE,[Gr.ADDRESS]:Xe.p.ADDRESS},Oo={mi:{singular:Xe.p.MILE,plural:Xe.p.MILES}},gt=({resourceData:hr,handleInputChange:eo,item:ro,questionnaireSchemaItems:gn})=>{var Nn;const{t:Yn}=(0,r.SS)(),{queryParams:Ar}=(0,ft.useSearchQueryParams)(),In=Ar.locationType||"",{setCurrentGroupIndex:mr,handleContinueButtonClick:Ur,setHideFooterButton:Ct}=(0,h.c)(),{trackEvent:He}=(0,o.st)();(0,t.useEffect)(()=>{if(!ro.readOnly)return Ct(!0),()=>{Ct(!1)}},[ro.readOnly,Ct]);const rt=(Nn=ro.extension)==null?void 0:Nn.find(li=>li.url===i.Uf),St=rt?.valueString,Cn=()=>{if(St){const li=(0,a.Ue)(gn||[],St);li!==-1&&mr(li)}},Pn=li=>{const Ji=li.find(Fi=>Fi.url.includes("description"));return Ji?.valueString||""},Jn=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,L0=Fi?.valueString||"";if(!L0||isNaN(s0))return null;const Sa=Math.round(s0);let Ti=L0;return Oo[L0]&&(Ti=Yn(Sa===1?Oo[L0].singular:Oo[L0].plural)),In&&Yr[In]?Yn(Xe.p.LOCATION_DISTANCE,{distance:`${Sa} ${Ti}`,locationType:Yn(Yr[In])}):Yn(Xe.p.LOCATION_DISTANCE_AWAY,{distance:`${Sa} ${Ti}`})},$r=li=>({id:li.id||"",providerName:li.name||"",specialty:"",distance:Jn(li.extension||[])||"",placeholderIcon:l.WalgreensLogo,address:li.address||"",valueReference:li.valueReference||{reference:li.id}}),po=li=>{var Ji,Fi,s0,L0;const Sa=li;return $r({id:Sa.id,name:(Ji=Sa.name)!=null?Ji:"",address:(L0=(s0=(Fi=Sa?.address)==null?void 0:Fi.line)==null?void 0:s0[0])!=null?L0:"",extension:Sa?.extension,valueReference:{reference:Sa.id}})},fo=li=>$r({id:li?.reference,name:li?.display,address:Pn(li?.extension||[]),extension:li?.extension,valueReference:li}),Ho=(()=>hr&&Array.isArray(hr)&&hr.length>0?hr.map(po):ro.initial&&Array.isArray(ro.initial)&&ro.initial.length>0?ro.initial.map(li=>fo(li.valueReference)):ro.answerOption?ro.answerOption.map(li=>fo(li.valueReference)):[])(),Fo=li=>{eo(ro,[{valueReference:li}])};return(0,n.jsx)("div",{className:(0,l.cx)("gap-md flex flex-col",!ro.readOnly&&"pb-4xl"),children:ro.readOnly?Ho.map(({address:li,id:Ji,providerName:Fi,placeholderIcon:s0,distance:L0})=>(0,n.jsx)(ft.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:s0},locationName:Fi,address:li,distance:L0,actionButtonText:St?"Change location":void 0,onActionButtonClick:St?Cn:void 0},Ji)):Ho.map(({address:li,id:Ji,providerName:Fi,placeholderIcon:s0,specialty:L0,valueReference:Sa,distance:Ti})=>(0,n.jsx)(l.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:s0},providerName:{content:Fi},specialty:{content:L0},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,eo,ro)=>eo in hr?zt(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,ur=(hr,eo)=>{for(var ro in eo||(eo={}))hn.call(eo,ro)&&Sr(hr,ro,eo[ro]);if(rn)for(var ro of rn(eo))kn.call(eo,ro)&&Sr(hr,ro,eo[ro]);return hr},Pr=(hr,eo)=>Vt(hr,vn(eo));const si={"ui-toolkit/LocationCard":gt,"ui-toolkit/TimeSlotSelection":({resourceData:hr,item:eo,handleInputChange:ro,selectedAnswer:gn,questionnaireSchemaItems:Nn,formData:Yn,onCompleteHandler:Ar})=>{var In,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},Cn=(0,t.useCallback)(Re=>{var Se;return(Se=Re.find(Ue=>Ue?.url===i.zD||Ue?.url===i.UZ))==null?void 0:Se.valueCode},[]),Pn=(0,t.useCallback)((Re,Se)=>{const Ue=Cn(Se);if(!Ue)return Ae(Re);try{return(0,ne.formatToTimeZone)(Re,"h:mm A",{timeZone:Ue})}catch{return Ae(Re)}},[Cn]),Jn=(0,t.useCallback)((Re,Se)=>{const Ue=Cn(Se);if(!Ue)return St(Re);try{return(0,ne.formatToTimeZone)(Re,"YYYY-MM-DD",{timeZone:Ue})}catch{return St(Re)}},[Cn]),$r=Re=>{const Se=Re.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Se){const[,Ue,Pt,tn]=Se;return new Date(parseInt(Ue),parseInt(Pt)-1,parseInt(tn))}return new Date},fo=(()=>{var Re;if((Re=gn?.[0])!=null&&Re.valueReference){const Se=gn[0].valueReference,Ue=Se.display||"",Pt=Jn(Ue,Se.extension||[]);if(Pt)return{date:$r(Pt),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]),L0=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 L0({display:(Se=Re.start)!=null?Se:"",id:Re.id,start:Re.start,extension:Re.extension,identifier:Re.identifier})},Ti=Re=>L0({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(eo.initial&&Array.isArray(eo.initial)&&eo.initial.length>0)return eo.initial.map(Re=>Ti(Re.valueReference));if(eo.answerOption)return eo.answerOption.map(Re=>Ti(Re.valueReference))},H0=(0,t.useMemo)(()=>_0()||[],[hr,gn,eo]),e0=(0,t.useMemo)(()=>{const Re={};return H0.forEach(Se=>{if(Se.start&&Se.id){const Ue=Jn(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,Jn]),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]),Pt=new Ht.ng(Ue.getFullYear(),Ue.getMonth()+1,Ue.getDate());for(let tn=s0;tn.compare(Pt)<=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)(eo)){const tn=(0,en.Ec)((0,en.Xj)()).add({days:30});let Mn=Pt.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),zn=new Ht.ng(Mn.getFullYear(),Mn.getMonth()+1,Mn.getDate());Se.some(_r=>_r.year===zn.year&&_r.month===zn.month&&_r.day===zn.day)||Se.push(zn)}),Se},[e0,Ji,s0,eo]),qs=(0,t.useMemo)(()=>(0,a.mR)(eo)?l.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[eo]),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,Pt])=>Pr(ur({},Se),{[`${Ue} ${B1}`]:Pt.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),L1=t.useRef(!1);(0,t.useEffect)(()=>{var Re;const Se=Object.keys(e0).sort();Se.length===0||L1.current||(L1.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 Pt=!(Ks.current===null)&&JSON.stringify(Ks.current)!==JSON.stringify(e0);if(Ks.current=e0,!!Pt&&(Fi(new Set),c1.current)){const tn=c1.current;if(!(((Re=e0[tn])==null?void 0:Re.length)>0)){const zn=new Set,_r=(0,Rt.A)(tn),En=(0,Rt.A)(Se[0]);let Er=_r;for(;Er<En;){const Dn=(0,Kt.A)(Er,"yyyy-MM-dd");zn.add(Dn),Er=new Date(Er),Er.setDate(Er.getDate()+1)}Fi(zn),li("")}c1.current=null}},[e0]);const B1=(0,t.useMemo)(()=>{const Re=$a[0];if(!Re?.extension)return"";const Se=Cn(Re.extension);try{return(0,ne.formatToTimeZone)(new Date,"(z)",{timeZone:Se??""})}catch{return""}},[$a,Cn]),el=(0,t.useMemo)(()=>{const Re=Ur(l.Translations.NEXT_AVAILABLE_APPOINTMENTS);return B1?`${Re} ${B1}`:Re},[Ur,B1]),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")}`,Pt=Object.keys(e0).sort().find(tn=>tn>K0&&tn<=Se);if(Pt){const tn=(0,Rt.A)(Pt);return new Ht.ng(tn.getFullYear(),tn.getMonth()+1,tn.getDate())}return null},[e0,K0,qs]),Y1=()=>{if(ja){const Re=ja.toDate((0,en.Xj)());Ho(Re),li("")}},uo=Re=>{if(!Re){li(""),ro(eo,void 0);return}li(Re.id);const Se=[{valueReference:{display:Re.display,reference:Re.id,extension:Re.extension,identifier:Re.identifier,type:Re.type}}];ro(eo,Se)},zr=Re=>{var Se;if(!Re||He||!L1.current)return;const Ue=Object.keys(e0).sort(),Pt=Ue[Ue.length-1],tn=Ue[0],Mn=`${Re.year}-${String(Re.month).padStart(2,"0")}-${String(Re.day).padStart(2,"0")}`;if(Pt&&(Mn>Pt||tn&&Mn<tn)&&(0,a.mR)(eo)&&Nn&&!Na?.some(_r=>_r.compare(Re)===0)){const _r=(0,a.yQ)(eo,Nn);if(_r){c1.current=Mn;let En="-06:00";if((Se=H0[0])!=null&&Se.start){const Qr=H0[0].start.match(/([+-]\d{2}:\d{2})$/);Qr&&(En=Qr[1])}const Dn=[{valueDateTime:`${Mn}T23:59:59${En}`}],Fr=ro(_r,Dn);ro(eo,void 0,(0,a.Nw)(Fr||Yn||[],eo.linkId),void 0,!0),rt(!0),Ar(_r.linkId,!0,!0)}}const zn=Re.toDate((0,en.Xj)());Ho(zn)},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."}}),uo(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:el,onChange:Rr,defaultValue:gn&&((mr=(In=gn[0])==null?void 0:In.valueReference)==null?void 0:mr.reference)||void 0,value:Fo||void 0,items:$a.map(Re=>({label:Pn(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:Y1,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,Lo=Object.getOwnPropertyDescriptors,ii=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,Lr=(hr,eo,ro)=>eo in hr?yo(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,Ro=(hr,eo)=>{for(var ro in eo||(eo={}))nr.call(eo,ro)&&Lr(hr,ro,eo[ro]);if(ii)for(var ro of ii(eo))dr.call(eo,ro)&&Lr(hr,ro,eo[ro]);return hr},Ao=(hr,eo)=>Wo(hr,Lo(eo)),bi=(hr,eo)=>{var ro={};for(var gn in hr)nr.call(hr,gn)&&eo.indexOf(gn)<0&&(ro[gn]=hr[gn]);if(hr!=null&&ii)for(var gn of ii(hr))eo.indexOf(gn)<0&&dr.call(hr,gn)&&(ro[gn]=hr[gn]);return ro};const Ni=(hr,eo)=>hr.answerOption?hr.answerOption.map(ro=>{var gn,Nn;const Yn=(Nn=(gn=ro.valueReference)==null?void 0:gn.reference)==null?void 0:Nn.replace("#","");return eo.find(Ar=>Ar.id===Yn)}).filter(Boolean):[],Wi=hr=>{var eo,ro,gn;const Nn=hr.find(Yn=>{var Ar,In;return Yn.url.includes("questionnaire-itemControl")&&((In=(Ar=Yn.valueCodeableConcept)==null?void 0:Ar.coding)==null?void 0:In.some(mr=>{var Ur;return(Ur=mr.code)==null?void 0:Ur.startsWith("ui-toolkit/")}))});return(gn=(ro=(eo=Nn?.valueCodeableConcept)==null?void 0:eo.coding)==null?void 0:ro.find(Yn=>{var Ar;return(Ar=Yn.code)==null?void 0:Ar.startsWith("ui-toolkit/")}))==null?void 0:gn.code},Qi=hr=>{var{uiToolkitCode:eo,props:ro}=hr,gn=ro,{item:Nn,contained:Yn=[],customErrorConfigurations:Ar}=gn,In=bi(gn,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:mr}=(0,h.c)(),Ur=si[eo];if(!Ur)return(0,n.jsx)(n.Fragment,{});const Ct=Ni(Nn,Yn),He=Ct.length>0;return!(Nn.answerOption&&Nn.answerOption.length>0)&&!He&&!Nn.readOnly?(mr(!0),(0,n.jsx)(ze,{configKey:eo,customErrorConfigurations:Ar})):(0,n.jsx)(Ur,Ao(Ro({},In),{item:Nn,contained:Yn,customErrorConfigurations:Ar,resourceData:Ct,"data-testid":Nn.linkId}))},X0=hr=>{var eo,ro,gn,Nn,Yn;const{setHideFooterButton:Ar}=(0,h.c)(),{item:In,customErrorConfigurations:mr}=hr,Ur=In.extension||[],Ct=Wi(Ur);return Ct?(0,n.jsx)(Qi,{uiToolkitCode:Ct,props:hr}):((Yn=(Nn=(gn=(ro=(eo=In?.extension)==null?void 0:eo.find(rt=>rt.url.includes("questionnaire-itemControl")))==null?void 0:ro.valueCodeableConcept)==null?void 0:gn.coding)==null?void 0:Nn[0])==null?void 0:Yn.code)==="check-box"?In.answerOption&&In.answerOption.length>0?(0,n.jsx)(qn,Ao(Ro({},hr),{item:In})):(Ar(!0),(0,n.jsx)(ze,{configKey:In.linkId,customErrorConfigurations:mr})):null},C0=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:Cn}=hr,Pn=He?(0,a.nt)(Nn,St,He):"",Jn=Yn?.[Ct]||"",$r=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Pn&&(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:Pn,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:In,value:((Ur=ro?.[0])==null?void 0:Ur.valueString)||"",onChange:po=>{gn(hr,[{valueString:po}])},isDisabled:Cn||Ar,onBlur:po=>{const fo=po.target.value,qo=fo.trim();qo!==fo&&gn(hr,[{valueString:qo}]),eo(hr.linkId)},hint:Jn||mr,isInvalid:!!Jn,autoComplete:$r},Ct)]})},ga=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:Cn,maxLength:Pn}=hr,Jn=He?(0,a.nt)(Nn,St,He):"",$r=Yn?.[Ct]||"",po=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Jn&&(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:Jn,required:rt||!1,item:hr}),(0,n.jsx)(l.TextArea,{isRequired:rt,id:Ct,"aria-label":Ct,"data-testid":Ct,rows:3,placeholder:In,value:((Ur=ro?.[0])==null?void 0:Ur.valueString)||"",onChange:fo=>{gn(hr,[{valueString:fo}])},isDisabled:Cn||Ar,onBlur:fo=>{const qo=fo.target.value,Ho=qo.trim();Ho!==qo&&gn(hr,[{valueString:Ho}]),eo(hr.linkId)},hint:$r||mr,counter:!0,isInvalid:!!$r,maxLength:Pn,autoComplete:po},Ct)]})},j0=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar})=>{var In;const{linkId:mr,text:Ur,required:Ct,prefix:He,readOnly:rt}=hr,St=Ur?(0,a.nt)(Nn,He,Ur):"",Cn=Yn?.[mr]||"";return(0,n.jsxs)("div",{children:[St&&(0,n.jsx)(L.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:((In=ro?.[0])==null?void 0:In.valueTime)||"",onChange:Pn=>{gn(hr,[{valueTime:Pn}])},isDisabled:rt||Ar,onBlur:()=>{eo(hr.linkId)},hint:Cn,isInvalid:!!Cn},mr)]})},f0=({item:hr,onCompleteHandler:eo,selectedAnswer:ro,handleInputChange:gn,showQuestionPrefix:Nn,errors:Yn,isLoading:Ar,placeholder:In,hintText:mr})=>{var Ur;const{linkId:Ct,text:He,required:rt,prefix:St,readOnly:Cn}=hr,Pn=He?(0,a.nt)(Nn,St,He):"",Jn=Yn?.[Ct]||"",$r=(0,a.a0)(hr);return(0,n.jsxs)("div",{children:[Pn&&(0,n.jsx)(L.W,{isLabel:!0,className:"mb-sm text-md",text:Pn,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:In,value:((Ur=ro?.[0])==null?void 0:Ur.valueUri)||"",onChange:po=>{gn(hr,[{valueUri:po}])},isDisabled:Cn||Ar,onBlur:po=>{const fo=po.target.value,qo=fo.trim();qo!==fo&&gn(hr,[{valueUri:qo}]),eo(hr.linkId)},hint:Jn||mr,isInvalid:!!Jn,autoComplete:$r},Ct)]})},ji={attachment:or.i,choice:qn,boolean:jt,integer:gr,string:C0,url:f0,text:ga,date:sn,time:j0,dateTime:un,quantity:Tr,decimal:Jt,question:Fn,display:Fn,group:Fn,reference:X0};var m0=(hr,eo,ro)=>new Promise((gn,Nn)=>{var Yn=mr=>{try{In(ro.next(mr))}catch(Ur){Nn(Ur)}},Ar=mr=>{try{In(ro.throw(mr))}catch(Ur){Nn(Ur)}},In=mr=>mr.done?gn(mr.value):Promise.resolve(mr.value).then(Yn,Ar);In((ro=ro.apply(hr,eo)).next())});const Pa=({item:hr,selectedAnswer:eo,showQuestionPrefix:ro})=>{const{text:gn,prefix:Nn,required:Yn}=hr,Ar=gn?getUpdatedQuestionText(ro,Nn,gn):"",[In,mr]=useState(null),[Ur,Ct]=useState(!1),{documentDownload:He,webview:rt}=useNativeBridge(),St=(eo||[]).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)}}),Cn=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]),Pn=useCallback(()=>m0(void 0,null,function*(){!In||(yield He.writeFile(In.fileName,prepareDataUrl(In.base64Data,In.contentType)))}),[In,He]),Jn=useCallback(()=>{Ct(!1),mr(null)},[]);return St.length?jsxs("div",{children:[Ar&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:Ar,required:Yn||!1,item:hr}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:St.map($r=>jsx("button",{type:"button",onClick:()=>Cn($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:Jn,onDownload:Pn,contentType:In?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var cr=Object.defineProperty,rr=Object.defineProperties,qr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,ko=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,Gn=(hr,eo,ro)=>eo in hr?cr(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,Or=(hr,eo)=>{for(var ro in eo||(eo={}))ko.call(eo,ro)&&Gn(hr,ro,eo[ro]);if(Ir)for(var ro of Ir(eo))Sn.call(eo,ro)&&Gn(hr,ro,eo[ro]);return hr},lo=(hr,eo)=>rr(hr,qr(eo));const ir=(hr,eo,ro,gn)=>{var Nn;const Yn=hr.extension||[];if(gn?.[BUTTON_TYPE_EXTERNAL_KEY]&&Yn.some(He=>He.url===BUTTON_TYPE_EXTENSION_URL))return gn[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(hr)||hasParentWithUIToolkitWidget(hr,eo))return null;if(ro&&hr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const Ar=getUIToolkitCode(Yn),In=Yn.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=(Nn=In.find(He=>He.code&&gn[He.code]))==null?void 0:Nn.code);const Ur=gn?.[hr.linkId];return(mr&&gn?gn[mr]:void 0)||Ur||UI_TOOLKIT_WIDGET_MAP[Ar||""]||typeToRenderFunctionMap[hr.type]||null},er=hr=>{var eo;const{item:ro,selectedAnswer:gn,handleInputChange:Nn,showQuestionPrefix:Yn,errors:Ar,questionnaireSchemaItems:In,formData:mr,isNestedRepeatedItem:Ur=!1}=hr,{linkId:Ct,text:He,prefix:rt,required:St,repeats:Cn}=ro,Pn=getMaxOccursFromExtensions(ro.extension),Jn=getPlaceholderFromExtensions(ro.extension,ro.type),[$r,po]=useState(()=>{if(ro.type==="group"&&ro.item&&ro.item.length>0){const Ti=mr?.filter(_0=>_0.linkId===ro.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=Pn!==void 0&&$r.length>=Pn,qo=He?getUpdatedQuestionText(Yn,rt,He):"",Ho=()=>{const Ti=Math.max(...$r,-1)+1,_0=[...$r,Ti];if(po(_0),ro.type==="group"&&ro.item&&ro.item.length>0){const H0=ro.item.map(Na=>({linkId:Na.linkId,text:Na.text,answer:[{}]})),e0={linkId:ro.linkId,text:ro.text,answer:[{}],item:H0};Nn(ro,void 0,[e0])}else{const H0=[...gn||[]];H0.push({}),Nn(ro,H0)}},Fo=Ti=>{if($r.length<=1)return;const _0=$r.filter((H0,e0)=>e0!==$r.length-1);if(po(_0),ro.type==="group"&&ro.item&&ro.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);Nn(ro,void 0,Na,void 0,!0)}}else{const H0=gn?.filter((e0,Na)=>Na!==Ti)||[];Nn(ro,H0.length>0?H0:[{}])}},li=Ti=>{if(!mr||!ro.item)return[];const _0=Na=>{const qs=[];for(const h1 of Na)if(h1.linkId===ro.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||[],ro.linkId,_0))return null;if(Ti.repeats){const K0=findNestedAnswer(H0,Ti.linkId),$a=lo(Or({},hr),{item:Ti,selectedAnswer:K0||[{}],errors:getInstanceErrors(Ar,ro,_0),handleInputChange:(Ks,c1,L1)=>Nn(Ks,c1,L1,_0)});return jsx("div",{children:jsx(er,lo(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||[],ro.linkId,_0))return null;const Ks=ir(K0,In,hr.isLoading,hr.externalComponentRenderMap);if(!Ks)return null;const c1=findNestedAnswer(H0,K0.linkId),L1=lo(Or({},hr),{item:K0,selectedAnswer:c1,placeholder:getPlaceholderFromExtensions(K0.extension,K0.type),errors:getInstanceErrors(Ar,ro,_0),handleInputChange:(B1,el,ja)=>Nn(B1,el,ja,_0)});return createElement(Ks,lo(Or({},L1),{key:K0.linkId}))})})]},Ti.linkId);const Na=ir(Ti,In,hr.isLoading,hr.externalComponentRenderMap);if(!Na)return null;const qs=findNestedAnswer(H0,Ti.linkId),h1=lo(Or({},hr),{item:Ti,selectedAnswer:qs,placeholder:getPlaceholderFromExtensions(Ti.extension,Ti.type),errors:getInstanceErrors(Ar,ro,_0),handleInputChange:(K0,$a,Ks)=>Nn(K0,$a,Ks,_0)});return createElement(Na,lo(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}),L0=ir(ro,In,hr.isLoading,hr.externalComponentRenderMap);return hasRepeatingParent(ro,In)&&!Ur?null:!Cn||Cn&&hasCheckboxExtension(ro)?L0?jsx(L0,lo(Or({},hr),{placeholder:Jn,errors:{[ro.linkId]:((eo=Ar?.[ro.linkId])==null?void 0:eo[0])||""}})):null:ro.type==="group"&&ro.item&&ro.item.length>0&&ro.repeats?jsxs("div",{"data-testid":`${Ct}-repeating`,children:[qo&&jsx(FHIRQuestionnaireQuestionText,{text:qo,required:St||!1,item:ro}),$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=ro.item)==null?void 0:_0.map(H0=>Ji(H0,Ti))})]},`${Ct}-instance-${Ti}`)}),Fi()]}):L0?jsxs("div",{"data-testid":`${Ct}-repeating`,children:[$r.map(Ti=>{const _0=gn?.[Ti]?[gn[Ti]]:void 0,H0=lo(Or({},hr),{item:ro,selectedAnswer:_0,errors:getInstanceErrors(Ar,ro,Ti),handleInputChange:(e0,Na,qs)=>Nn(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(L0,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,Qo=Object.defineProperties,qi=Object.getOwnPropertyDescriptors,G0=Object.getOwnPropertySymbols,$0=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,yi=(hr,eo,ro)=>eo in hr?Wr(hr,eo,{enumerable:!0,configurable:!0,writable:!0,value:ro}):hr[eo]=ro,Mo=(hr,eo)=>{for(var ro in eo||(eo={}))$0.call(eo,ro)&&yi(hr,ro,eo[ro]);if(G0)for(var ro of G0(eo))ea.call(eo,ro)&&yi(hr,ro,eo[ro]);return hr},fa=(hr,eo)=>Qo(hr,qi(eo));const ps=null,Ts=({formId:hr,questionnaireSchema:eo,questionnaireResponseItem:ro,errorConfig:gn,customErrorConfigurations:Nn,showQuestionPrefix:Yn=!0,isAdaptiveFlow:Ar=!1,status:In,hideBackButton:mr=!1,showStepper:Ur=!1,onComplete:Ct,onClearError:He,handleHiddenQuestion:rt,onGoBack:St,onFormDataChange:Cn=()=>{},externalComponentRenderMap:Pn,children:Jn})=>{var $r,po;const{setHandleContinueButtonClick:fo,setHandleBackButtonClick:qo,setHandleEditReturnComplete:Ho,setIsCurrentFormValid:Fo,setCurrentGroupLinkId:li,setCurrentGroupIndex:Ji,editReturnGroupIndex:Fi,setEditReturnGroupIndex:s0,setTotalSteps:L0,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,L1]=useState([]),[B1,el]=useState(new Set),[ja,Y1]=useState([]),[uo,zr]=useState([]),Rr=h1,Re=useRef(new Map),Se=useRef(new Set),[Ue,Pt]=useState({}),[tn,Mn]=useState(!1),[zn,_r]=useState(eo),En=useRef(ro||[]),Er=useRef(!1),Dn=useRef(!1),Fr=useMemo(()=>getTotalStepsFromQuestionnaire(eo),[eo]),[Qr,To]=useState(!1),oi=useRef([]),_o=(_i,n0)=>{var E0,V0,S0,q0,pa,za;if(isCallNextQuestionExtensionPresent(_i))return _i.linkId;const Ta=validateCurrentPage(n0,c1,e0,zn,Rr),us=Cr=>{for(const vr of Cr){if((!vr.enableWhen||isQuestionEnabled(vr.enableWhen,vr.enableBehavior,n0))&&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}},R0=Ga((E0=zn?.item)!=null?E0:[],_i.linkId);if(R0)return R0;const Bs=Rr.current[e0],n1=e0+1,Tt=Rr.current[n1],on=e0===0?0:Bs,yt=(S0=Tt??((V0=zn?.item)==null?void 0:V0.length))!=null?S0:0;let Et=-1;for(let Cr=on;Cr<yt;Cr++){const vr=(q0=zn?.item)==null?void 0:q0[Cr];if(vr?.linkId===_i.linkId){Et=Cr;break}}const an=(Cr,vr=[])=>(Cr.forEach(ht=>{var bo;if((!ht.enableWhen||isQuestionEnabled(ht.enableWhen,ht.enableBehavior,n0))&&isCallNextQuestionExtensionPresent(ht))if(ht.required){const Ri=(bo=findResponseItem(n0,ht.linkId))==null?void 0:bo.answer;(Ri&&Ri.length>0&&Object.keys(Ri[0]).length>0||ht.initial&&ht.initial.length>0&&!B1.has(ht.linkId))&&vr.push(ht.linkId)}else vr.push(ht.linkId);ht.item&&ht.item.length>0&&an(ht.item,vr)}),vr),Qt=[],Bn=Et!==-1?Et+1:yt;for(let Cr=on;Cr<Bn;Cr++){const vr=(pa=zn?.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=zn?.item)!=null?za:[]),bo=ht.findIndex(Ri=>Ri.linkId===Cr),zo=ht.findIndex(Ri=>Ri.linkId===_i.linkId);return bo!==-1&&zo>bo?void 0:Cr}},Vi=_i=>_o(_i,En.current)?!0:_i.item&&_i.item.length>0?_i.item.some(Vi):!1,g0=()=>{var _i,n0;if(!Ar||e0<0||!zn?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const E0=Rr.current[e0],V0=Re.current.get(E0)||[E0],S0=(_i=zn.item)==null?void 0:_i[V0[V0.length-1]],q0=S0?Vi(S0):!1,pa=e0<Rr.current.length-1;let za=!1;if(q0&&pa){const Ta=e0+1,us=Rr.current[Ta],Ga=(n0=zn?.item)==null?void 0:n0[us],R0=!Ga?.enableWhen||isQuestionEnabled(Ga.enableWhen,Ga.enableBehavior,En.current),Bs=Ga?isPageExtensionPresent(Ga):!1;za=R0&&Bs}return{shouldTriggerInlineLoading:q0,canNavigateToNextGroup:za,hasMoreGroups:pa}},b0=(_i,n0,E0,V0)=>{const S0=getUpdatedFormData(zn?.item||[],En.current,_i,n0,E0,V0);return En.current=S0,Cn(S0),S0},h0=(_i,n0,E0,V0,S0)=>{b0(n0,E0,V0,S0),V0.forEach(q0=>{const pa=getValidationError(fa(Mo({},_i),{linkId:q0.linkId}),En.current,q0.answer,Ks);pa&&Pt(za=>fa(Mo({},za),{[q0.linkId]:typeof S0=="number"?fa(Mo({},za[q0.linkId]),{[S0]:pa}):pa}))})},p0=(_i,n0,E0,V0,S0)=>{var q0;const pa=b0(n0,E0,V0,S0),za=(q0=findResponseItem(pa,n0))==null?void 0:q0.answer,Ta=getValidationError(_i,En.current,za,Ks);Pt(us=>fa(Mo({},us),{[n0]:typeof S0=="number"?fa(Mo({},us[n0]),{[S0]:Ta}):Ta}))},x0=(_i,n0)=>{const E0=validateCurrentPage(n0,c1,e0,zn,Rr);if(Fo(E0),zn?.item){const V0=validateAllItemsRecursively(zn.item,n0,Ks);if(Object.keys(V0).length>0)Pt(S0=>Mo(Mo({},S0),V0));else{const S0=zn.item,q0={},pa=za=>{za.forEach(Ta=>{q0[Ta.linkId]={},Ta.item&&pa(Ta.item)})};pa(S0),Pt(za=>Mo(Mo({},za),q0))}}},Ki=(_i,n0,E0,V0,S0=!1)=>{var q0;const{linkId:pa}=_i;if(S0)return En.current=E0||[],x0(pa,E0||[]),En.current;if(E0&&E0.length>0&&_i.type==="group"&&_i.repeats){let Ga=En.current.length;for(let Bs=En.current.length-1;Bs>=0;Bs--)if(En.current[Bs].linkId===pa){Ga=Bs+1;break}const R0=[...En.current.slice(0,Ga),...E0,...En.current.slice(Ga)];return En.current=R0,x0(pa,R0),En.current}if(typeof V0=="number"&&n0){const Ga=hasRepeatingParent(_i,zn?.item||[]);if(Ga){const R0=En.current.filter(n1=>n1.linkId===Ga.linkId);if(V0<R0.length){const n1=En.current.map(Tt=>{if(Tt.linkId===Ga.linkId&&En.current.slice(0,En.current.indexOf(Tt)).filter(yt=>yt.linkId===Ga.linkId).length===V0){const yt=(Qt,Bn)=>{const Cr=new Map(Qt.map(ht=>[ht.linkId,ht])),vr=[];return Bn?.forEach(ht=>{const bo=Cr.get(ht.linkId);if(ht.linkId===pa)vr.push(Mo({linkId:ht.linkId,text:ht.text,answer:n0},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,Bn)=>Qt.some(Cr=>Cr.linkId===Bn||Cr.item&&Et(Cr.item,Bn)),an=yt(Tt.item||[],Ga.item);return fa(Mo({},Tt),{item:an})}return Tt});En.current=n1,Cn(n1)}else{const n1=V0+1,Tt=R0.length;if(Tt<n1||n1===1){const on=[],yt=(Qt,Bn,Cr)=>Qt.map(vr=>{const ht={linkId:vr.linkId,text:vr.text,answer:vr.linkId===Bn?Cr:[{}]};return vr.item&&vr.item.length>0&&(ht.item=yt(vr.item,Bn,Cr)),ht});for(let Qt=Tt;Qt<n1;Qt++){const Bn=Ga.item?yt(Ga.item,pa,n0):[],Cr={linkId:Ga.linkId,text:Ga.text,answer:[{}],item:Bn};on.push(Cr)}let Et=En.current.length;for(let Qt=En.current.length-1;Qt>=0;Qt--)if(En.current[Qt].linkId===Ga.linkId){Et=Qt+1;break}const an=[...En.current.slice(0,Et),...on,...En.current.slice(Et)];En.current=an,Cn(an)}}const Bs=getValidationError(_i,En.current,n0,Ks);return Pt(n1=>fa(Mo({},n1),{[pa]:typeof V0=="number"?fa(Mo({},n1[pa]),{[V0]:Bs}):Bs})),x0(pa,En.current),En.current}}if(typeof V0=="number")return E0&&E0.length>0?h0(_i,pa,n0,E0,V0):p0(_i,pa,n0,E0,V0),En.current;const za=b0(pa,n0,E0),Ta=(q0=findResponseItem(za,pa))==null?void 0:q0.answer,us=getValidationError(_i,za,Ta,Ks);return Pt(Ga=>fa(Mo({},Ga),{[pa]:typeof V0=="number"?fa(Mo({},Ga[pa]),{[V0]:us}):us})),x0(pa,za),En.current},D0=()=>{var _i;for(let n0=e0+1;n0<Rr.current.length;n0++){const E0=Rr.current[n0],V0=(_i=zn?.item)==null?void 0:_i[E0];if(!!V0&&(!V0.enableWhen||isQuestionEnabled(V0.enableWhen,V0.enableBehavior,En.current)))return!0}return!1},A0=()=>{var _i,n0,E0,V0,S0;const q0=(_i=eo?.item)==null?void 0:_i[Rr.current[e0]];if(q0){const Ta=(n0=getAnalyticsEventName(q0))!=null?n0:"questionnaire_form",us=getAnalyticsPageName(q0);if(us){const Ga=(E0=getAnalyticsFormName(eo))!=null?E0:eo.name,R0=collectAnalyticsProperties(q0,En.current),Bs={};Ga&&(Bs.form_name=Ga),Bs.page_name=us,Object.assign(Bs,R0),$a(Ta,Bs)}}const pa=e0<Rr.current.length-1,za=checkCurrentStepDataMatch(En.current,zn,Rr.current,e0,ro,Rr.current.length-1);if(Fi!==null&&za&&Os()){window.scrollTo(0,0);return}if(Ar&&pa){const Ta=e0+1,us=Rr.current[Ta],Ga=(V0=zn?.item)==null?void 0:V0[us],R0=!Ga?.enableWhen||isQuestionEnabled(Ga.enableWhen,Ga.enableBehavior,En.current),Bs=Ga?isPageExtensionPresent(Ga):!1;if(R0&&Bs&&za){Ji(Ta),Fo(!1),window.scrollTo(0,0);return}}if(za&&Rr.current.length>0){D0()?Ji(e0+1):(Ct(removeDisabledItems(En.current,zn?.item||[])),Fo(!1),window.scrollTo(0,0));return}if(e0<Rr.current.length-1){const Ta=(S0=zn?.item)==null?void 0:S0[Rr.current[e0]];if(!Ta){Ct(removeDisabledItems(En.current,zn?.item||[]));return}const us=Ta.linkId,Ga=findLastGroupInstanceIndex(En.current,us),R0=En.current.slice(0,Ga+1);if(!validateCurrentPage(R0,c1,e0,zn,Rr))return;if(Os()){window.scrollTo(0,0);return}Ar?(En.current=R0,Cn(R0),Ct(ensureOptionalGroupsHaveAnswer(En.current,zn?.item||[])),Fo(!1)):Rr.current.length>0&&(D0()?Ji(e0+1):(Ct(removeDisabledItems(En.current,zn?.item||[])),window.scrollTo(0,0)))}else Ct(removeDisabledItems(En.current,zn?.item||[])),Fo(!1),window.scrollTo(0,0)},Os=()=>{var _i,n0,E0;if(Fi===null)return!1;const V0=Rr.current[Fi],S0=(n0=(_i=zn?.item)==null?void 0:_i[V0])==null?void 0:n0.linkId,q0=S0?findFirstGroupInstanceIndex(En.current,S0):-1,pa=q0>=0?En.current.slice(0,q0):En.current,za=q0>=0&&V0!==void 0?(E0=zn?.item)==null?void 0:E0.slice(0,V0):zn?.item;return En.current=pa,Cn(pa),s0(null),Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(pa,zn?.item||[]),zn?.item||[]),void 0,za),Fo(!1),!0};useEffect(()=>{var _i;fo(()=>A0),qo(()=>Fs),Ho(()=>Os),Fo(H0);const n0=(_i=zn?.item)==null?void 0:_i[Rr.current[e0]];n0&&li(n0.linkId)},[H0,e0,Fi]),useEffect(()=>{if(!eo?.item)return;const{groupIndices:_i,itemsToRenderMap:n0}=collectGroupItemIndices(eo.item);Rr.current=_i,Re.current=n0;const E0=Fr??_i.length;L0(E0),Y1(_i),Ar?(Dn.current||Ji(_i.length>0?_i.length-1:0),Ti(!1),Dn.current=!1):e0===-1&&Ji(0)},[eo?.item,Fr]),useEffect(()=>{if(e0<0||!zn?.item)return;const _i=validateCurrentPage(En.current,c1,e0,zn,Rr);if(!_i){Fo(!1);return}const{shouldTriggerInlineLoading:n0,canNavigateToNextGroup:E0,hasMoreGroups:V0}=g0();if(Ar&&n0){if(!V0){Fo(!1);return}if(E0&&_i){Fo(!0);return}else{Fo(!1);return}}Fo(_i)},[e0,zn?.item,qs,Ar,En.current,c1]),useEffect(()=>{if(!eo?.item||Er.current)return;const _i=initializeQuestionnaireItems(eo.item,En.current,eo.item,En.current);if(_i!==En.current){En.current=_i;const E0=(S0=>{const q0=new Set,pa=za=>{za.forEach(Ta=>{var us;const Ga=Ta.initial&&Ta.initial.length>0,R0=(Ta.type==="choice"||Ta.type==="open-choice")&&((us=Ta.answerOption)==null?void 0:us.some(Bs=>Bs.initialSelected===!0));(Ga||R0)&&(!Ta.enableWhen||isQuestionEnabled(Ta.enableWhen,Ta.enableBehavior,En.current))&&q0.add(Ta.linkId),Ta.item&&pa(Ta.item)})};return pa(S0),q0})(zn?.item||[]);el(E0);const V0=validateAllItemsRecursively(zn?.item||[],En.current,Ks);Object.keys(V0).length>0&&Pt(S0=>Mo(Mo({},S0),V0))}Er.current=!0},[zn?.item,eo,Ks]),useEffect(()=>{_r(eo)},[eo]),useEffect(()=>{if(K0.size===0)return;const _i=za=>!za.enableWhen||isQuestionEnabled(za.enableWhen,za.enableBehavior,En.current)?K0.has(za.linkId)?!0:(za.item||[]).some(_i):!1,n0=za=>za.flatMap(Ta=>[Ta.linkId,...n0(Ta.item||[])]),E0=za=>{const Ta=za.findIndex(_i);return Ta===-1?za.flatMap(us=>E0(us.item||[])):za.slice(Ta+1).flatMap(us=>[us.linkId,...n0(us.item||[])])};if(!zn?.item)return;const V0=E0(zn.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):[]]),q0=zn.item,pa=q0.findIndex(za=>S0([za]).some(Ta=>K0.has(Ta.linkId)&&(!Ta.enableWhen||isQuestionEnabled(Ta.enableWhen,Ta.enableBehavior,En.current))));if(pa!==-1){const za=new Set(S0(q0.slice(pa)).map(Ta=>Ta.linkId));oi.current=oi.current.filter(Ta=>!za.has(Ta))}el(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 _i;if(!Ar||Na||K0.size>0||!zn?.item)return;const n0=Rr.current[e0];if(n0===void 0)return;const E0=Re.current.get(n0)||[n0],V0=[];if(E0.forEach(Ta=>{var us;const Ga=(us=zn?.item)==null?void 0:us[Ta];Ga&&hasInitialValue(Ga)&&V0.push(Ga)}),V0.length===0||!V0.some(Ta=>_o(Ta,En.current)&&!oi.current.includes(Ta.linkId)?(oi.current.push(Ta.linkId),!0):!1))return;const q0=validateCurrentPage(En.current,c1,e0,zn,Rr),pa=(_i=zn?.item)==null?void 0:_i[n0],za=isHiddenAnswerInValid(pa,En.current);!q0||za||(Se.current.add(e0),_0(!0),Q0(V0[V0.length-1].linkId))},[e0,c1,Ar,Na,zn]),useEffect(()=>{if(!Ar||Na||!zn?.item)return;const _i=Rr.current[e0];_i===void 0||!(Re.current.get(_i)||[_i]).every(V0=>{var S0;const q0=(S0=zn.item)==null?void 0:S0[V0];return q0?isHiddenExtensionPresent(q0):!0})||Se.current.has(e0)||(Se.current.add(e0),Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(En.current,zn.item),zn.item)))},[e0,zn?.item,Ar,Na]);const Q0=(_i,n0=!1,E0=!1)=>{var V0,S0,q0;if(n0){Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(En.current,zn?.item||[]),zn?.item||[]),E0),Fo(!1);return}const pa=findQuestionByLinkId(zn?.item||[],_i);if(!pa)return;const za=(V0=findResponseItem(En.current,_i))==null?void 0:V0.answer;if(getValidationError(pa,En.current,za,Ks))return;const Ta=getUpdatedFormData(zn?.item||[],En.current,_i,za),us=_o(pa,Ta);if(!us)return;const Ga=(S0=findResponseItem(ro||[],_i))==null?void 0:S0.answer,R0=Ri=>JSON.stringify(Ri,(xi,o0)=>o0??void 0);if(R0(za)===R0(Ga)||_i!==us&&oi.current.includes(us))return;Fo(!1);const Bs=findRootGroupLinkId(zn?.item||[],_i);let n1=Ta,Tt=[];const on=deepTrimFormData(Ta,us,zn?.item||[]);n1=on.trimmedData,Tt=on.trimmedLinkIds;const yt=findQuestionByLinkId(zn?.item||[],Bs||"");En.current=n1;const Et=findGroupPositionByLinkId(zn?.item||[],_i||""),an=Et!==-1?Et:e0;let Qt;const Bn=(()=>{var Ri;const xi=(Ri=zn?.item)!=null?Ri:[],o0=(W1,I1)=>W1.some(wl=>wl.linkId===I1||(wl.item?o0(wl.item,I1):!1)),wi=xi.findIndex(W1=>W1.linkId===us||(W1.item?o0(W1.item,us):!1));if(wi===-1)return[];const va=W1=>W1.flatMap(I1=>[I1.linkId,...I1.item?va(I1.item):[]]),Ha=W1=>W1.flatMap(I1=>[I1,...I1.item?Ha(I1.item):[]]),Ba=Ha(xi),Vs=Ba.findIndex(W1=>W1.linkId===us),wa=new Set;let fs=!0;for(;fs;){fs=!1;for(const W1 of Ba){if(wa.has(W1.linkId)||!W1.enableWhen)continue;W1.enableWhen.some(wl=>{const fu=Ba.findIndex(gi=>gi.linkId===wl.question);return fu!==-1&&fu<=Vs||wa.has(wl.question)})&&(wa.add(W1.linkId),fs=!0)}}const Kl=oi.current.includes(us)?(()=>{const W1=new Set(va([xi[wi]]));return Ba.slice(Vs+1).filter(I1=>W1.has(I1.linkId)&&!wa.has(I1.linkId)&&!isHiddenExtensionPresent(I1)).map(I1=>I1.linkId)})():[],Dl=Ha(xi.slice(wi+1)).filter(W1=>!wa.has(W1.linkId)&&!isHiddenExtensionPresent(W1)).map(W1=>W1.linkId);return[...Kl,...Dl]})();if(Bn.length>0){Qt=removeItemsFromSchema(zn?.item||[],Bn),_r(fa(Mo({},zn),{item:Qt}));const Ri=new Set(Bn);oi.current=oi.current.filter(xi=>!Ri.has(xi))}const Cr=[...Tt,...Bn],vr=validateCurrentPage(n1,c1,an,zn,Rr,Cr);if(vr&&Os()){window.scrollTo(0,0);return}const ht=findQuestionByLinkId(zn?.item||[],us),bo=(q0=findResponseItem(n1,us))==null?void 0:q0.answer,zo=!ht?.required||bo!==void 0&&bo.length>0&&Object.keys(bo[0]).length>0;if(vr&&zo&&!isHiddenAnswerInValid(yt,n1)){Ti(!0),Dn.current=!0;const xi=((o0,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(o0),va})(zn?.item||[],us);xi.length>0&&(oi.current=oi.current.filter(o0=>!xi.includes(o0)),el(o0=>{const wi=new Set(o0);return xi.forEach(va=>wi.delete(va)),wi})),oi.current.push(us),Ct(ensureOptionalGroupsHaveAnswer(removeDisabledItems(n1,zn?.item||[]),zn?.item||[]),!0,Qt||zn.item)}},ds=(_i,n0,E0=!1)=>{const V0=updateItemWithReadOnlyExpression(_i,zn),S0={item:V0,selectedAnswer:n0,handleInputChange:Ki,showQuestionPrefix:Yn,onCompleteHandler:Q0,errors:Ue,isLoading:Na,isCurrentFormValid:H0,contained:zn?.contained,questionnaireSchemaItems:zn?.item,customErrorConfigurations:Nn,formData:En.current,showStepper:Ur,totalStepsFromExtension:Fr,externalComponentRenderMap:Pn,hintText:getHintTextFromExtensions(V0.extension)};if(typeof rt=="function"&&E0)rt(_i,S0,En.current);else if(_i.type in typeToRenderFunctionMap&&!E0)return c1.includes(_i.linkId)||L1(q0=>[...q0,_i.linkId]),jsx(RenderFHIRQuestionnaireItem,Mo({},S0),_i.linkId);return null},es=_i=>{const n0=S0=>!S0.enableWhen||isQuestionEnabled(S0.enableWhen,S0.enableBehavior,En.current)?K0.has(S0.linkId)?!0:(S0.item||[]).some(n0):!1,E0=_i.findIndex(n0),V0=E0!==-1?_i.slice(0,E0+1):_i;return E0!==-1&&_i.slice(E0+1).forEach(S0=>{En.current.some(pa=>pa.linkId===S0.linkId)&&(En.current=removeAnswerFromFormData(En.current,S0.linkId))}),V0.map(S0=>{var q0,pa,za,Ta;const us=isHiddenExtensionPresent(S0);let Ga=(q0=findResponseItem(En.current,S0.linkId))==null?void 0:q0.answer;if((!Ga||Object.keys((pa=Ga?.[0])!=null?pa:{}).length===0)&&!B1.has(S0.linkId)){if(S0.initial&&S0.initial.length>0)Ga=S0.initial,el(R0=>new Set(R0).add(S0.linkId));else if((S0.type==="choice"||S0.type==="open-choice")&&S0.answerOption){const R0=S0.answerOption.filter(Bs=>Bs.initialSelected===!0);R0.length>0&&(Ga=R0.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),el(Bs=>new Set(Bs).add(S0.linkId)))}Ga&&(En.current=getUpdatedFormData(zn?.item||[],En.current,S0.linkId,Ga))}if(!S0?.enableWhen||isQuestionEnabled(S0?.enableWhen,S0.enableBehavior,En.current)){const R0=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 Pn&&(n1=(Ta=Bs.find(Tt=>Tt.code&&Pn[Tt.code]))==null?void 0:Ta.code),jsxs(React.Fragment,{children:[ds(S0,Ga,us),S0.item&&!us&&!n1&&(R0?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 uo.includes(S0.linkId)||(Fr===void 0&&L0(Rr.current.length-1||-1),Rr.current=Rr.current.filter((R0,Bs)=>Bs!==e0),zr(R0=>[...R0,S0.linkId])),null})};if(e0>=0){const _i=[];let n0=0,E0=0;for(;n0<ja.length&&E0<Rr.current.length;){const V0=ja[n0],S0=Rr.current[E0];if(V0<S0){const q0=($r=zn?.item)==null?void 0:$r[V0];(!q0?.enableWhen||isQuestionEnabled(q0.enableWhen,q0.enableBehavior,En.current))&&_i.push(n0),n0++}else V0===S0&&n0++,E0++}for(;n0<ja.length;){const V0=ja[n0],S0=(po=zn?.item)==null?void 0:po[V0];(!S0?.enableWhen||isQuestionEnabled(S0.enableWhen,S0.enableBehavior,En.current))&&_i.push(n0),n0++}if(_i.length>0){Fr===void 0&&L0(Rr.current.length+_i.length),_i.reverse().forEach(S0=>{const q0=ja[S0];let pa=0;for(let za=0;za<Rr.current.length;za++){if(Rr.current[za]>q0){pa=za;break}pa=za+1}Rr.current.splice(pa,0,q0)});const V0=_i.map(S0=>{var q0;const pa=ja[S0],za=(q0=zn?.item)==null?void 0:q0[pa];return za?.linkId}).filter(Boolean);zr(S0=>S0.filter(q0=>!V0.includes(q0)))}ja.forEach(V0=>{var S0;const q0=(S0=zn?.item)==null?void 0:S0[V0];q0?.enableWhen&&!isQuestionEnabled(q0.enableWhen,q0.enableBehavior,En.current)&&En.current.some(za=>za.linkId===q0.linkId)&&(En.current=removeAnswerFromFormData(En.current,q0.linkId))})}const Fs=()=>{var _i;if(gn&&!tn&&e0>0&&In!=="completed")Ji(Rr.current.length-1),Mn(!0),Sa(!1),He?.();else if(e0>0&&In!=="completed"){let n0=e0-1;for(;n0>0;){const E0=Rr.current[n0],V0=(_i=zn?.item)==null?void 0:_i[E0];if(!V0?.enableWhen||isQuestionEnabled(V0.enableWhen,V0.enableBehavior,En.current))break;n0--}Ji(n0),Fo(!0),Sa(!1),He?.()}else St?.()},os=_i=>_i.preventDefault();return useEffect(()=>{const _i=setTimeout(()=>{To(!0)},0);return()=>clearTimeout(_i)},[]),Qr?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:_i=>{(_i.key==="Enter"||_i.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:[!zn?.item&&Na&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),zn?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:es(e0>=0?(()=>{var _i;const n0=Rr.current[e0],E0=Re.current.get(n0)||[n0],V0=(_i=zn.item)==null?void 0:_i[n0];return V0?.enableWhen&&!isQuestionEnabled(V0.enableWhen,V0.enableBehavior,En.current)?[V0]:zn.item.filter((S0,q0)=>E0.includes(q0))})():zn?.item||[])})]})]}),Er.current&&Jn]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Z,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,F;if(!v)return!1;const k=(0,o.MU)(v,N);return((F=(w=k?.answer)==null?void 0:w[0])==null?void 0:F.valueBoolean)===!0},P=(0,t.useMemo)(()=>C.some(N=>R(N.linkId)),[C,v]),D=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(z||C.length===0){D.current&&(T(),D.current=!1);return}!P&&!D.current?(S(),D.current=!0):P&&D.current&&(T(),D.current=!1)},[P,z,C.length,S,T]),(0,t.useEffect)(()=>{E.forEach(N=>{var w,F;const k=v?(0,o.MU)(v,N.linkId):void 0;(!k||((F=(w=k.answer)==null?void 0:w[0])==null?void 0:F.valueBoolean)!==!1)&&d(N,[{valueBoolean:!1}])})},[E]),(0,t.useEffect)(()=>()=>{D.current&&T()},[]);const L=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,F,k,I;const G=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(ae=>ae.url===l.g4),B=(F=N.extension)==null?void 0:F.find(ae=>ae.url===l.rz),X=U?.valueString?l.JP[U.valueString]:void 0,q=(k=B?.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:()=>L(N)},N.linkId)})}))}},72866:(Z,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:(Z,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 B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,X=(u[U[B+0]]+u[U[B+1]]+u[U[B+2]]+u[U[B+3]]+"-"+u[U[B+4]]+u[U[B+5]]+"-"+u[U[B+6]]+u[U[B+7]]+"-"+u[U[B+8]]+u[U[B+9]]+"-"+u[U[B+10]]+u[U[B+11]]+u[U[B+12]]+u[U[B+13]]+u[U[B+14]]+u[U[B+15]]).toLowerCase();if(!c(X))throw TypeError("Stringified UUID is invalid");return X}const p=m;function f(U,B,X){U=U||{};var q=U.random||(U.rng||i)();if(q[6]=q[6]&15|64,q[8]=q[8]&63|128,B){X=X||0;for(var ae=0;ae<16;++ae)B[X+ae]=q[ae];return B}return p(q)}const O=f,g=(U,B="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:B}).size}catch{return 0}},A=(U,B)=>`data:${B};base64,${U}`,h=(U,B,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 Me=0;Me<he.length;Me++)ve[Me]=he.charCodeAt(Me);const Ae=new Uint8Array(ve);ae.push(Ae)}const se=new Blob(ae,{type:B});return URL.createObjectURL(se)},d=U=>{const B=new Date().toISOString().replace(/[:.-]/g,"");return`${U.split(" ").join("-")}_${B}`},v=4e3,M=.8,S=(U,B)=>{var X,q;const ae=(X=B?.maxDimension)!=null?X:v,se=(q=B?.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 Ae=new Image,Me=new FileReader;Me.onload=()=>{const J=Me.result;Ae.onload=()=>{let{width:oe,height:me}=Ae;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(Ae,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)},Ae.onerror=()=>{he(new Error(`Failed to load image: ${U.name}`))},Ae.src=J},Me.onerror=()=>{he(new Error(`Failed to read file: ${U.name}`))},Me.readAsDataURL(U)})},T=50,x=(U,B=T)=>{if(U.length<=B)return U;const X=U.lastIndexOf("."),q=X!==-1?U.slice(X):"",ae=X!==-1?U.slice(0,X):U,se=B-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,P=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,w=(U,B,X)=>B in U?E(U,B,{enumerable:!0,configurable:!0,writable:!0,value:X}):U[B]=X,F=(U,B)=>{for(var X in B||(B={}))L.call(B,X)&&w(U,X,B[X]);if(D)for(var X of D(B))N.call(B,X)&&w(U,X,B[X]);return U},k=(U,B)=>R(U,P(B)),I=(U,B,X)=>new Promise((q,ae)=>{var se=ve=>{try{he(X.next(ve))}catch(Ae){ae(Ae)}},ne=ve=>{try{he(X.throw(ve))}catch(Ae){ae(Ae)}},he=ve=>ve.done?q(ve.value):Promise.resolve(ve.value).then(se,ne);he((X=X.apply(U,B)).next())});const G=({item:U,onCompleteHandler:B,selectedAnswer:X,handleInputChange:q,showQuestionPrefix:ae,errors:se,isLoading:ne,allowMultiple:he=!0})=>{const{linkId:ve,text:Ae,required:Me,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=Ae?(0,z.nt)(ae,J,Ae):"",ge=se?.[ve]||"",[xe,Ie]=(0,t.useState)([]),Ce=(0,t.useRef)(X||[]);(0,t.useEffect)(()=>{X&&(Ce.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 Tn=((Ye=Ot.valueAttachment)==null?void 0:Ye.title)||`attachment-${Ke}`,yn=(Ft=Ot.valueAttachment)==null?void 0:Ft.id,lt=Mt.find(or=>yn&&or.id===yn||!yn&&or.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:yn||lt?.id||`existing-${Ke}`,name:Tn,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 Le=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(Tn=>Tn.id===Nt?k(F({},Tn),{isLoading:!1,failed:!0,disableRetry:!0,errorMessage:`File size exceeds ${tt} MB limit`}):Tn));return}const Ot=yield ft(kt),Ke=kt.name.replace(/\s+/g,"-");Ie(tt=>tt.map(qt=>qt.id===Nt?k(F({},qt),{isLoading:!1,progress:100,failed:!1}):qt));const Ye={valueAttachment:{id:Nt,contentType:kt.type,data:Ot,title:Ke}},ot=[...(Ce.current||[]).filter(tt=>tt.valueAttachment||Object.keys(tt).length>0),Ye];Ce.current=ot,q(U,ot),B(ve)}catch{Ie(Ot=>Ot.map(Ke=>Ke.id===Nt?k(F({},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=(Ce.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);Ce.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(F({},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:Me||!1,item:U}),(0,n.jsx)(r.FileUpload,{files:xe,onDropFiles:Le,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:(Z,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:(Z,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:(Z,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,P]=useState(null),[D,L]=useState(-1),[N,w]=useState(null),[F,k]=useState(!1),[I,G]=useState(-1),[U,B]=useState(!1),[X,q]=useState(0),[ae,se]=useState(!1),[ne,he]=useState(!1),ve=useRef([]),[Ae,Me]=useState(new Set),J=useCallback(ge=>{Me(xe=>{const Ie=new Set(xe);return Ie.add(ge),Ie})},[]),oe=useCallback(ge=>{Me(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 Ce=h[ge];if(!Ce)return;let Le;if(Array.isArray(Ce))if(Ie)Le=Ce.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&&Ce.inputType&&Ce.inputType!==Ie)return;Le=Ce}if(!Le)return;let ze=m({},xe);Le.valueTransform&&(ze=Object.keys(xe).reduce((Mt,Nt)=>{var kt;const Ot=(kt=Le.valueTransform)==null?void 0:kt[Nt];return Mt[Nt]=Ot?applyValueTransform(xe[Nt],Ot):xe[Nt],Mt},{}));let We=m({},ze);Le.propertyMapping&&(We=Object.keys(ze).reduce((Mt,Nt)=>{var kt;const Ot=((kt=Le.propertyMapping)==null?void 0:kt[Nt])||Nt;return Mt[Ot]=ze[Nt],Mt},{}));const st=Le.eventName,ft=Le.description;d(st,p(m(m({},We),Le.properties),{_event_metadata:ft?{description:ft}:void 0}))},[h,d]),re={isCurrentFormValid:C,currentGroupLinkId:R,currentGroupIndex:D,hideFooterButton:F,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:P,setCurrentGroupIndex:L,editReturnGroupIndex:N,setEditReturnGroupIndex:w,setHideFooterButton:k,setTotalSteps:G,setIsLoading:B,setIsInlineNextQuestionTriggered:he,incrementCustomErrorCount:me,decrementCustomErrorCount:de,errorLinkIds:Ae,addErrorLinkId:J,removeErrorLinkId:oe,trackQuestionnaireEvent:te,setHasExternalError:ce,groupItemIndicesRef:ve};return jsx(f.Provider,{value:re,children:A})}},35473:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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=D=>{try{P(x.next(D))}catch(L){C(L)}},R=D=>{try{P(x.throw(D))}catch(L){C(L)}},P=D=>D.done?z(D.value):Promise.resolve(D.value).then(E,R);P((x=x.apply(S,T)).next())});const M=({setLocationUpdating:S,title:T,description:x,isOpen:z,onClose:C})=>{const{locationPermission:E,position:R,requestPosition:P,setLocationPermission:D}=(0,u.GU)(),{trackEvent:L}=(0,l.st)(),{queryParams:N,setQueryParams:w}=(0,b.i)(),[F,k]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),G=z!==void 0?z:F;(0,t.useEffect)(()=>{(G||z)&&L("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[z,G,L]);const U=(0,t.useCallback)(ve=>{w(d(h({},N),{location:ve,locationType:a.iF.CURRENT_LOCATION,locationPermission:E||""}))},[E,N,w]),B=(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)(()=>{B()},[B]);const X=(0,o.Ul)(),q=(0,t.useCallback)(()=>v(void 0,null,function*(){S&&S(!0);let ve;try{ve=yield P(),ve&&U&&U(`${ve.coords.latitude},${ve.coords.longitude}`)}catch(Ae){Ae instanceof Error?X?.error(Ae,"Error requesting location"):X?.error(`Error requesting location - ${JSON.stringify(Ae)}`),z!==void 0&&C?C():k(!1)}return S&&S(!1),!!ve}),[X,U,P,S,z,C]),ae=(0,t.useCallback)(()=>v(void 0,null,function*(){L("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()}),[L,z,C,I,q]),se=(0,t.useCallback)(ve=>{L("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."}}),D(a.Ef.DENIED),w(d(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),z!==void 0&&C?C():k(!1)},[L,D,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:(Z,s,e)=>{"use strict";var n=e(26877)},98741:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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",...Tn})=>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",...Tn},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(yn,lt=v){const{store:_t,subscription:dn,getServerState:or}=qt(),Br=h(dn.addNestedSub,_t.getState,or||_t.getState,yn,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,Tn=null;return{clear(){qt=null,Tn=null},notify(){tt(()=>{let yn=qt;for(;yn;)yn.callback(),yn=yn.next})},get(){let yn=[],lt=qt;for(;lt;)yn.push(lt),lt=lt.next;return yn},subscribe(yn){let lt=!0,_t=Tn={callback:yn,next:null,prev:Tn};return _t.prev?_t.prev.next=_t:qt=_t,function(){!lt||qt===null||(lt=!1,_t.next?_t.next.prev=_t.prev:Tn=_t.prev,_t.prev?_t.prev.next=_t.next:qt=_t.next)}}}}const C={notify(){},get:()=>[]};function E(tt,qt){let Tn,yn=C;function lt(wn){return Br(),yn.subscribe(wn)}function _t(){yn.notify()}function dn(){nn.onStateChange&&nn.onStateChange()}function or(){return Boolean(Tn)}function Br(){Tn||(Tn=qt?qt.addNestedSub(dn):tt.subscribe(dn),yn=z())}function jt(){Tn&&(Tn(),Tn=void 0,yn.clear(),yn=C)}const nn={addNestedSub:lt,notifyNestedSubs:_t,handleChangeWrapper:dn,isSubscribed:or,trySubscribe:Br,tryUnsubscribe:jt,getListeners:()=>yn};return nn}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P=null,D=null;let L=null;const N=tt=>{L=tt},w=null,F=null,k=tt=>{try{return JSON.stringify(tt)}catch{return String(tt)}};function I(tt,qt,Tn){useIsomorphicLayoutEffect(()=>tt(...qt),Tn)}function G(tt,qt,Tn,yn,lt,_t){tt.current=yn,Tn.current=!1,lt.current&&(lt.current=null,_t())}function U(tt,qt,Tn,yn,lt,_t,dn,or,Br,jt,nn){if(!tt)return()=>{};let wn=!1,Rn=null;const Nr=()=>{if(wn||!or.current)return;const Wt=qt.getState();let Fe,it;try{Fe=yn(Wt,lt.current)}catch(Ze){it=Ze,Rn=Ze}it||(Rn=null),Fe===_t.current?dn.current||jt():(_t.current=Fe,Br.current=Fe,dn.current=!0,nn())};return Tn.onStateChange=Nr,Tn.trySubscribe(),Nr(),()=>{if(wn=!0,Tn.tryUnsubscribe(),Tn.onStateChange=null,Rn)throw Rn}}const B=()=>w;function X(tt,qt){return tt===qt}let q=!1;function ae(tt,qt,Tn,{pure:yn,areStatesEqual:lt=X,areOwnPropsEqual:_t=shallowEqual,areStatePropsEqual:dn=shallowEqual,areMergedPropsEqual:or=shallowEqual,forwardRef:Br=!1,context:jt=ReactReduxContext}={}){const nn=jt,wn=mapStateToPropsFactory(tt),Rn=mapDispatchToPropsFactory(qt),Nr=mergePropsFactory(Tn),Dr=Boolean(tt);return Fe=>{const it=Fe.displayName||Fe.name||"Component",Ze=`Connect(${it})`,Qe={shouldHandleStateChanges:Dr,displayName:Ze,wrappedComponentName:it,WrappedComponent:Fe,initMapStateToProps:wn,initMapDispatchToProps:Rn,initMergeProps:Nr,areStatesEqual:lt,areStatePropsEqual:dn,areOwnPropsEqual:_t,areMergedPropsEqual:or};function et(ut){const[ue,Oe,Ve]=useMemo(()=>{const{reactReduxForwardedRef:Rt}=ut,Kt=_objectWithoutPropertiesLoose(ut,D);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),On=Boolean(It)&&Boolean(It.store),qn=Yt?ut.store:It.store,pr=On?It.getServerState:qn.getState,Ht=useMemo(()=>defaultSelectorFactory(qn.dispatch,Qe),[qn]),[we,Xe]=useMemo(()=>{if(!Dr)return F;const Rt=createSubscription(qn,Yt?void 0:It.subscription),Kt=Rt.notifyNestedSubs.bind(Rt);return[Rt,Kt]},[qn,Yt,It]),Lt=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),Gr=useRef();useIsomorphicLayoutEffect(()=>(Tr.current=!0,()=>{Tr.current=!1}),[]);const Yr=useMemo(()=>()=>Jt.current&&Ve===un.current?Jt.current:Ht(qn.getState(),Ve),[qn,Ve]),Oo=useMemo(()=>Kt=>we?U(Dr,qn,we,Ht,un,sn,Fn,Tr,Jt,Xe,Kt):()=>{},[we]);I(G,[un,sn,Fn,Ve,Jt,Xe]);let gt;try{gt=L(Oo,Yr,pr?()=>Ht(pr(),Ve):Yr)}catch(Rt){throw Gr.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.1174.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.1436.1",D="@icanbwell/composite. repo version: 0.1436.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};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1175.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.1437.0",D="@icanbwell/composite. repo version: 0.1437.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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/composite",
3
- "version": "1.1174.1",
3
+ "version": "1.1175.0",
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.1436.1",
47
- "description": "@icanbwell/composite. repo version: 0.1436.1"
46
+ "repoVersion": "0.1437.0",
47
+ "description": "@icanbwell/composite. repo version: 0.1437.0"
48
48
  }