@icanbwell/composite 1.1164.0 → 1.1164.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/native.js +1 -1
- 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)}],Se=["error","loading"],De={error:"error",loading:"loader"},ze=({src:At,elementNameSuffix:Tt,version:Yt,prefetchFeatureApp:St})=>(0,g.__awaiter)(void 0,void 0,void 0,function*(){var Ze,Ke,It,nt,et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln;window.bwell||(window.bwell=new le({metadata:{version:Yt}}));const nr=`bwell-${Tt}`;if(customElements.get(nr)!==void 0)return;class In extends h{constructor(){super(),Ze.add(this),Ke.set(this,(0,T.nanoid)()),It.set(this,void 0),nt.set(this,document.createElement("feature-app-loader")),et.set(this,new k.EventEmitter),Zt.set(this,void 0),xn.set(this,void 0),An.set(this,void 0),at.set(this,void 0),Wt.set(this,void 0),Bt.set(this,void 0),this.attachShadow({mode:"open"});const $r=new he(Ie).attachToShadowRoot(this.shadowRoot);$r.addEventListener("visibilitychange",({visibility:Pt,container:Fe,name:rt})=>{rt==="error"&&Pt==="visible"&&window.bwell._registerEmbeddableContent(Fe),(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=Pt==="hidden"?"unset":"hidden"}),(0,g.__classPrivateFieldSet)(this,Bt,{slots:$r,attributes:new V().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,et,"f")},"f"),(0,g.__classPrivateFieldSet)(this,Zt,(0,g.__classPrivateFieldGet)(this,Ze,"m",On).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,xn,(0,g.__classPrivateFieldGet)(this,Ze,"m",Xn).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,An,(0,g.__classPrivateFieldGet)(this,Ze,"m",Ln).call(this,"error"),"f"),(0,g.__classPrivateFieldSet)(this,at,(0,g.__classPrivateFieldGet)(this,Ze,"m",Ln).call(this,"loading"),"f")}connectedCallback(){return(0,g.__awaiter)(this,void 0,void 0,function*(){(0,g.__classPrivateFieldGet)(this,An,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("error")),(0,g.__classPrivateFieldGet)(this,at,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("loading")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.addEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,xn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}(0,g.__classPrivateFieldSet)(this,Ke,this.id||(0,g.__classPrivateFieldGet)(this,Ke,"f"),"f"),(0,g.__classPrivateFieldSet)(this,It,new x((0,g.__classPrivateFieldGet)(this,Ke,"f")),"f"),(0,g.__classPrivateFieldGet)(this,It,"f").registerDispatcher($r=>this.dispatchEvent($r)),window.bwell.isInitialized?(0,g.__classPrivateFieldGet)(this,Zt,"f").call(this):(window.bwell.once("initialized",(0,g.__classPrivateFieldGet)(this,Zt,"f")),window.bwell.once("error",()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}),St&&(0,M.h)(At).catch(()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}))})}disconnectedCallback(){var $r;(0,g.__classPrivateFieldGet)(this,et,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,xn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),($r=(0,g.__classPrivateFieldGet)(this,It,"f"))===null||$r===void 0||$r.deregister(),(0,g.__classPrivateFieldGet)(this,et,"f").removeAllListeners()}}Ke=new WeakMap,It=new WeakMap,nt=new WeakMap,et=new WeakMap,Zt=new WeakMap,xn=new WeakMap,An=new WeakMap,at=new WeakMap,Wt=new WeakMap,Bt=new WeakMap,Ze=new WeakSet,On=function(){(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("featureAppId",`bwell-embeddable:${nr}`),(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("src",At),(0,g.__classPrivateFieldGet)(this,nt,"f").config={id:(0,g.__classPrivateFieldGet)(this,Ke,"f"),name:Tt,elementName:nr,utils:(0,g.__classPrivateFieldGet)(this,Bt,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,nt,"f"))},Xn=function({visibility:$r,name:Pt}){(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=$r==="hidden"?"unset":"hidden"},on=function($r){(0,g.__classPrivateFieldGet)(this,Wt,"f")(),(0,g.__classPrivateFieldSet)(this,Wt,void 0,"f")},Ln=function($r){return Pt=>{const Fe=Se.findIndex(Ye=>Ye===$r);if(!Se.slice(0,Fe).some(Ye=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Ye)!==null)){if(Pt!==null)(0,g.__classPrivateFieldGet)(this,Wt,"f")&&(0,g.__classPrivateFieldGet)(this,Ze,"m",on).call(this,$r),(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[$r]),"f");else if(Pt===null&&(0,g.__classPrivateFieldGet)(this,Wt,"f")){(0,g.__classPrivateFieldGet)(this,Ze,"m",on).call(this,$r);const Ye=Se.find(Qe=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Qe)!==null);Ye&&(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[Ye]),"f")}}}},customElements.define(nr,In)}),We={rE:"1.1164.0"},ot="composite";var ht=e(67321);ze({src:`https://embeddables.prod.icanbwell.com/${ot}/${We.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ot,version:We.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),a=Object.defineProperty,i=Object.defineProperties,b=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(M,h,f)=>h in M?a(M,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):M[h]=f,p=(M,h)=>{for(var f in h||(h={}))u.call(h,f)&&m(M,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&m(M,f,h[f]);return M},d=(M,h)=>i(M,b(h));const O=(M,h,f)=>{const v=_.cloneDeep(M);if(!v.contained||h<0)return v;const A=v.contained.findIndex(z=>z.resourceType==="Questionnaire");if(A!==-1&&!f){const z=v.contained[A];if(z.item){if(!z.item.some(C=>isPageExtensionPresent(C)))return v;let T=0,S=z.item.length;for(let C=0;C<z.item.length;C++){const E=z.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}z.item=z.item.slice(0,S),v.contained[A]=z}}else f&&A!==-1&&(v.contained[A]=d(p({},v.contained[A]),{item:f}));return v},g=({formId:M,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:v,onGoBack:A,handleHiddenQuestion:z,errorConfig:x,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var N,w,V;const{currentGroupIndex:k,hasCustomError:I}=useFHIRQuestionnaire(),q=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(X=>X.id===q&&X.resourceType==="Questionnaire"),$=(X,G,ie)=>{let ae=_.cloneDeep(h);ae.item=X,ae=trimQuestionnaireItems(ae,k,ie),v(ae,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:M,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:x,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:$,onGoBack:A,onClearError:T,handleHiddenQuestion:z,showStepper:C,hideBackButton:E,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),a=e(56192),i=e(76808),b=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(A,z,x)=>z in A?c(A,z,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[z]=x,g=(A,z)=>{for(var x in z||(z={}))p.call(z,x)&&O(A,x,z[x]);if(m)for(var x of m(z))d.call(z,x)&&O(A,x,z[x]);return A},M=(A,z)=>u(A,y(z)),h=(A,z,x)=>new Promise((T,S)=>{var C=P=>{try{R(x.next(P))}catch(L){S(L)}},E=P=>{try{R(x.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,E);R((x=x.apply(A,z)).next())});const f=10,v=({id:A="location-filter-desktop",initialValue:z,onInputChange:x,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:E,errorText:R})=>{const P=(0,i.Ul)(),{i18n:{t:L},loading:D}=(0,b.E_)({keys:["shared-translations"]}),N=z?.placeId,w=z?.description,[V,k]=(0,t.useState)(""),[I,q]=(0,t.useState)(""),[U,$]=(0,t.useState)(null),[X,G]=(0,t.useState)(null),[ie,ae]=(0,t.useState)(!1),re=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ve,Ce]=(0,t.useState)(he),[ye,ne]=(0,t.useState)(he),[se,{loading:me,error:ce}]=(0,a.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[de,{loading:le,error:te}]=(0,a.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[ee,{loading:ge,error:xe}]=(0,a.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Ce(he)},onCompleted:Yt=>{var St,Ze;const Ke=(Ze=(St=Yt.placeAutocomplete)==null?void 0:St.predictions)==null?void 0:Ze.map(It=>{var nt;return{id:It.placeId,label:(0,s.removeAfterLastComma)(It.description),mainText:It?.mainText||((nt=It.description.split(",")[0])==null?void 0:nt.trim()),secondaryText:(0,s.removeAfterLastComma)(It?.secondaryText||It.description.split(",").slice(1).join(",").trim())}});Ce(Ke?.length?Ke:he)}}),Ie=(0,t.useMemo)(()=>ve.map(Yt=>M(g({},Yt),{displayLabel:(0,r.RZ)(Yt?.label||"",V)})),[V,ve]),Se=Yt=>h(void 0,null,function*(){var St,Ze,Ke,It,nt,et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln;if($(Yt),G(Yt),ae(!1),Yt&&typeof Yt=="string"){const nr=ve.find(Qe=>Qe.id===Yt),In=nr?.label||V;if(!nr)return;k(In),q(In),setTimeout(()=>{const Qe=[{id:nr.id,label:nr.label}];Ce(Qe),ne(Qe)},f);const Ur=yield se({variables:{placeId:Yt}}),$r=(Ze=(St=Ur?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ze.latitude,Pt=(It=(Ke=Ur?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,Fe=((et=(nt=Ur?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",rt=((xn=(Zt=Ur?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:xn.state)||"",Ye=((at=(An=Ur?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if($r&&Pt)if(!Fe||!Ye){const Qe=yield de({variables:{latitude:String($r),longitude:String(Pt)}}),Je=((Bt=(Wt=Qe?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",lt=((Xn=(On=Qe?.data)==null?void 0:On.geocodingByLatLon)==null?void 0:Xn.state)||"",Ct=((Ln=(on=Qe?.data)==null?void 0:on.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:$r,longitude:Pt,zipCode:Je,state:lt,stateCode:Ct,placeId:Yt,description:In,value:Yt})}else T({latitude:$r,longitude:Pt,zipCode:Fe,state:rt,stateCode:Ye,placeId:Yt,description:In,value:Yt});else ae(!0)}}),De=()=>!0,ze=(0,s.useDebounce)(Yt=>h(void 0,null,function*(){return yield ee({variables:{input:Yt,types:"geocode"}})})),We=Yt=>h(void 0,null,function*(){if(ae(!1),k(Yt),x?.(Yt),!Yt||Yt.trim().length===0){$(null),Ce(he),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Yt});return}const St=Yt.trim();St.length>=2?yield ze(St):Ce(he)}),ot=Yt=>{re.current=Yt},ht=()=>{k(I),Ce(ye),$(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var St,Ze,Ke,It,nt,et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln;if(N&&w){Ce([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),$(N),G(N),k(w),q(w),w===V&&k(w);const nr=yield se({variables:{placeId:N}}),In=(Ze=(St=nr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ze.latitude,Ur=(It=(Ke=nr?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,$r=((et=(nt=nr?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",Pt=((xn=(Zt=nr?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:xn.state)||"",Fe=((at=(An=nr?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if(In&&Ur)if(!$r||!Pt||!Fe){const rt=yield de({variables:{latitude:String(In),longitude:String(Ur)}}),Ye=((Bt=(Wt=rt?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",Qe=((Xn=(On=rt?.data)==null?void 0:On.geocodingByLatLon)==null?void 0:Xn.state)||"",Je=((Ln=(on=rt?.data)==null?void 0:on.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:In,longitude:Ur,zipCode:Ye,state:Qe,stateCode:Je,placeId:N,description:w,value:N})}else T({latitude:In,longitude:Ur,zipCode:$r,state:Pt,stateCode:Fe,placeId:N,description:w,value:N})}else $(null),G(null),k(""),q(""),Ce(he),ne(he)}))()},[]);const At=ie||!!ce||!!te||!!xe||!!R,Tt=At?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||D)},[E,me,le,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:A,size:"md",isDisabled:S,inputValue:V,isLoading:ge||me||le,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Ie,selectedKey:U,onSelectionChange:Se,onInputChange:We,defaultFilter:De,onOpenChange:ot,onBlur:ht,isInvalid:At,hint:Tt,autoComplete:"address-line1",className:"w-full",children:Yt=>{const St=Yt,Ze=V.trim().length>=2,Ke=St.mainText||"",It=St.secondaryText||"",nt=Ke.trim().length>0,et=It.trim().length>0,Zt=nt?(0,r.RZ)(Ke,V):{beforePart:"",highlightedPart:"",remainingPart:""},xn=et?(0,r.RZ)(It,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:St.id,supportingText:St.supportingText,isDisabled:St.isDisabled,icon:St.icon,avatarUrl:St.avatarUrl,textValue:St.label,children:Ze&&nt?(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:Zt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Zt.highlightedPart}),(0,n.jsx)("span",{children:Zt.remainingPart})]}),et&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:xn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:xn.highlightedPart}),(0,n.jsx)("span",{children:xn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:St.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:a})=>{const{isSmallScreen:i}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${i?"-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 ${i?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[a,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(62754);const a=({className:i})=>{const{pathname:b}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:m,i18n:{t:p}}=useI18nChild({keys:["shared"]}),d=getPathSegments(b).flatMap(O=>{const g=c.getId(O),M=c.getRouteMeta(g)||{},h=getBreadcrumbTitleKey(g,M,u);if(!h||M.breadcrumbHide)return[];const f=y[g];let v=c.getHref(g),A=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:g,search:f.search})),f.titleKey&&(A=f.titleKey)),[{routeId:g,href:v,label:p(A),onClick:f?.onClick}]});return m||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",i),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),a=e(5380),i=e(87896),b=e(26877);const c=(E,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),E)),u=(E,R,P)=>Promise.race([E,c(R,P)]),y=5e3,m=1e4;var p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(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={}))M.call(R,P)&&f(E,P,R[P]);if(g)for(var P of g(R))h.call(R,P)&&f(E,P,R[P]);return E},A=(E,R)=>d(E,O(R)),z=(E,R,P)=>new Promise((L,D)=>{var N=k=>{try{V(P.next(k))}catch(I){D(I)}},w=k=>{try{V(P.throw(k))}catch(I){D(I)}},V=k=>k.done?L(k.value):Promise.resolve(k.value).then(N,w);V((P=P.apply(E,R)).next())});const x={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:E})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,i.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,q]=(0,t.useState)(!1),[U,$]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[X,G]=(0,t.useState)(),[ie,ae]=(0,t.useState)(!1),re=(0,t.useCallback)(ge=>{$(ge);try{w(A(v({},k.current),{locationPermission:ge||a.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?L?.error(xe,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,L]),he=(0,t.useCallback)(()=>z(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?L?.error(ge,"Error checking geolocation availability"):L?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,L]),ve=(0,t.useCallback)(ge=>z(void 0,null,function*(){const xe=D.getCurrentPosition(ge).then(Ie=>{if(!Ie||!Ie.coords)throw new Error("Location data is invalid or unavailable");return Ie});try{return yield u(xe,y,"Location request timed out. Please check that location services are enabled.")}catch(Ie){throw Ie instanceof Error&&L?.error(Ie,"Geolocation timeout or error"),Ie}}),[D,L]),Ce=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ye=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield he()))return L?.error("Location services not available"),!1;const xe=yield Ce();return xe!==a.Ef.GRANTED&&xe!==a.Ef.PROMPT?(L?.error(`Location permission not granted: ${xe}`),!1):!0}catch(ge){return ge instanceof Error?L?.error(ge,"Error checking location services"):L?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[he,L,Ce]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>z(void 0,null,function*(){const xe=N.locationPermission;if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){$(xe);return}q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}if(xe===a.Ef.GRANTED){try{const De=yield Ce();if(De===a.Ef.GRANTED){const ze=yield ve(x);ze&&(G(ze),re(a.Ef.GRANTED))}else De===a.Ef.PROMPT?(re(De),ae(!0)):re(De)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(De)}`),re(a.Ef.UNAVAILABLE)}return}const Se=yield Ce();if(re(Se),Se===a.Ef.GRANTED)try{const De=yield ve(x);De?G(De):re(a.Ef.UNAVAILABLE)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(De)}`),re(a.Ef.UNAVAILABLE)}else Se===a.Ef.PROMPT&&ae(!0)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(Ie)}`),re(a.Ef.UNAVAILABLE)}finally{q(!1)}}))()},[]);const se=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield ne())){re(a.Ef.UNAVAILABLE);return}q(!0);let xe=yield Ce();if(re(xe),xe===a.Ef.GRANTED||xe===a.Ef.PROMPT){if(P==="Android"&&xe===a.Ef.GRANTED)try{xe=yield ye(),re(xe)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(Ie)}`);return}if(xe!==a.Ef.UNAVAILABLE){const Ie=yield ve(x);return G(Ie),Ie}}return}catch(ge){re(a.Ef.UNAVAILABLE),ge instanceof Error?L?.error(ge,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{q(!1)}}),[ne,L,P,re,ve,Ce,ye]),me=(0,t.useCallback)(()=>z(void 0,null,function*(){try{return(yield he())?yield Ce():a.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?L?.error(ge,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ge)}`),a.Ef.UNAVAILABLE}}),[he,L,Ce]),ce=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}const xe=yield Ce();re(xe)}catch(ge){ge instanceof Error?L?.error(ge,"Error checking and setting location permission"):L?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),re(a.Ef.UNAVAILABLE)}finally{q(!1)}}),[he,L,re,Ce]),de=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}const xe=yield Ce();if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){re(xe);return}const Ie=yield ye();if(re(Ie),["granted","prompt"].includes(Ie)){const Se=yield ve(x);return G(Se),Se}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||L?.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")||L?.error(`Error requesting location - ${xe}`)}re(a.Ef.UNAVAILABLE);return}finally{q(!1)}}),[he,L,re,ve,ye,Ce]),le=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}const xe=yield ve(x);xe&&(G(xe),$(a.Ef.GRANTED),w(A(v({},k.current),{location:`${xe.coords.latitude},${xe.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${xe.coords.latitude}`,lng:`${xe.coords.longitude}`,locationPermission:a.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?L?.error(ge,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ge)}`),re(a.Ef.UNAVAILABLE),ge}finally{q(!1)}}),[he,L,w,re,ve]),te=(0,t.useCallback)(()=>z(void 0,null,function*(){try{q(!0);const ge=yield se();ge&&w(A(v({},k.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||a.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?L?.error(ge,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{q(!1)}}),[L,U,se,w]),ee=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:$,position:X,refreshPosition:se,requestPosition:de,requestCurrentLocation:le,checkAndSetLocationPermission:ce,checkLocaitonPermission:me}),[I,te,U,X,se,de,le,ce,me]);return(0,n.jsxs)(T.Provider,{value:ee,children:[ie&&(0,n.jsx)(b.J,{isOpen:ie,onClose:()=>ae(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>lt,GI:()=>ve,rz:()=>at,Fp:()=>An,el:()=>xn,ao:()=>Zt,oA:()=>D,Yt:()=>Ct,g4:()=>et,tn:()=>Ve,n4:()=>N,gD:()=>L,Vp:()=>Qe,Cx:()=>q,bK:()=>k,gi:()=>Je,Z$:()=>ce,GT:()=>Ye,hr:()=>de,JL:()=>le,Ck:()=>I,dU:()=>V,wG:()=>nr,hZ:()=>on,$e:()=>Wt,qT:()=>Xn,GQ:()=>On,q3:()=>Ln,D_:()=>Bt,Uf:()=>$,_l:()=>ye,Md:()=>ie,V7:()=>G,fe:()=>se,JP:()=>Et,Z_:()=>w,zO:()=>me,UZ:()=>re,$7:()=>Ze,rb:()=>X,_W:()=>It,WS:()=>Ke,VF:()=>Fe,vf:()=>Ur,PV:()=>rt,PS:()=>In,Iz:()=>Pt,zD:()=>ae,m3:()=>At,XP:()=>Tt,PM:()=>Ie,cX:()=>te,G6:()=>ee,Us:()=>De,AA:()=>xe,G0:()=>ht,mO:()=>We,HH:()=>Se,PU:()=>Oe,it:()=>St,Tl:()=>ot,uH:()=>Yt,c3:()=>ge,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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 a=e(8957);const i=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));i.displayName="UserX01";const b=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));p.displayName="Hash01";const d=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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 M=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));M.displayName="CreditCard02";const h=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const v=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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 A=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));A.displayName="ClipboardPlus";const z=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));z.displayName="Route";const x=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));x.displayName="Briefcase01";const T=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));T.displayName="Translate01";const S=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));S.displayName="AnnotationQuestion";const C=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",k="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",q="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",$="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",X="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",ie="http://hl7.org/fhir/StructureDefinition/entryFormat",ae="http://hl7.org/fhir/StructureDefinition/tz-code",re="tz-code",he="footer",ve="check-box",Ce="header",ye="page",ne="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",ce=[{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"}],de={"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"},le={"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"},te="ui-toolkit/CoordinatePicker",ee="ui-toolkit/DetailsInfo",ge="ui-toolkit/ServiceChoice",xe="ui-toolkit/InfoBanner",Ie="ui-toolkit/Button",Se="ui-toolkit/Phone",De="ui-toolkit/ErrorCard",ze="ui-toolkit/FormContainer",We="ui-toolkit/PageHeader",ot="ui-toolkit/SelectableOption",ht="ui-toolkit/Modal",At="ui-toolkit/Alert",Tt="ui-toolkit/AppSectionAccess",Yt="ui-toolkit/SensitiveDataCategory",St="ui-toolkit/QuestCard",Ze="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ke="http://icanbwell.com/fhir/StructureDefinition/text-align",It={LEFT:"left",CENTER:"center"},nt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},et="http://icanbwell.com/fhir/StructureDefinition/icon-name",Zt="http://icanbwell.com/fhir/StructureDefinition/error-title",xn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",An="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",at="http://icanbwell.com/fhir/StructureDefinition/description",Wt="http://icanbwell.com/fhir/StructureDefinition/modal-description",Bt="http://icanbwell.com/fhir/StructureDefinition/modal-title",On="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Xn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",on="http://icanbwell.com/fhir/StructureDefinition/button-text",Ln="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",nr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",In="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Ur="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",$r="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",Pt="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-color",rt="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Ye="http://hl7.org/fhir/StructureDefinition/mimeType",Qe="http://hl7.org/fhir/StructureDefinition/maxSize",Je="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",Ct="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",ue="http://icanbwell.com/fhir/StructureDefinition/hint-text",Oe="ui-toolkit/PrefilledMemberDemographicsAlert",Ve="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",xt="http://icanbwell.com/fhir/StructureDefinition/button-action",Kt="button-type",Cn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",qn="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Sr="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Ft="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Xe={},Et={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":a.f,"user-x":i,"users-01":b,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:m.X,hash:p,"hash-02":d,"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":M,"link-03":h,"search-lg":f.q,"clipboard-check":v,"clipboard-plus":A,route:z,"briefcase-01":x,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":E,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>N,$O:()=>ht,CP:()=>Bt,Fy:()=>Wt,GN:()=>ve,J4:()=>lt,MU:()=>G,Nw:()=>rt,Qr:()=>C,Ue:()=>Ct,Yo:()=>xe,a0:()=>T,cz:()=>E,di:()=>I,eC:()=>st,iI:()=>q,lv:()=>k,mR:()=>Cn,nt:()=>S,od:()=>V,t7:()=>At,u0:()=>z,yQ:()=>Kt,zj:()=>le});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),a=e(27779),i=e.n(a),b=e(45250),c=e.n(b),u=e(16681),y=e(18807),m=e(1053),p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(Lt,dn,cn)=>dn in Lt?p(Lt,dn,{enumerable:!0,configurable:!0,writable:!0,value:cn}):Lt[dn]=cn,v=(Lt,dn)=>{for(var cn in dn||(dn={}))M.call(dn,cn)&&f(Lt,cn,dn[cn]);if(g)for(var cn of g(dn))h.call(dn,cn)&&f(Lt,cn,dn[cn]);return Lt},A=(Lt,dn)=>d(Lt,O(dn));const z=(Lt,dn,cn,Dn)=>{if(Lt){const en=Lt(dn,v({defaultValue:cn},Dn));if(en&&en!==dn)return en}return Dn?Object.entries(Dn).reduce((en,[Ht,wn])=>en.replace(`{{${Ht}}}`,String(wn)),cn):cn},x=Lt=>{var dn;return(dn=Lt.filter(cn=>cn.url.includes("questionnaire-itemControl")).flatMap(cn=>{var Dn,en;return(en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)!=null?en:[]}).find(cn=>{var Dn;return(Dn=cn.code)==null?void 0:Dn.startsWith("ui-toolkit/")}))==null?void 0:dn.code},T=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.V7);return cn?.valueCode||"off"},S=(Lt,dn,cn)=>{const Dn=(0,y.A)(cn);return Lt&&dn&&cn?Dn.replace("<p>",`<span>${dn} `).replace("</p>","</span>").trim():Dn.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Vp);return dn?.valueInteger},E=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Z_);return dn?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Lt,dn)=>{const cn=Lt?.find(Dn=>Dn.url===PLACEHOLDER_EXTENSION_URL);return cn?.valueString||dn&&R[dn]||P},D=Lt=>{const dn=Lt?.find(cn=>cn.url===HINT_TEXT_EXTENSION_URL);return dn?.valueString},N=Lt=>{const dn=Lt?.filter(cn=>cn.url===m.GT&&cn.valueCode).map(cn=>m.hr[cn.valueCode]||cn.valueCode);return dn?.length?dn.join(","):void 0},w=Lt=>Lt.split(",").map(Dn=>Dn.trim()).map(Dn=>m.JL[Dn]||Dn).filter((Dn,en,Ht)=>Ht.indexOf(Dn)===en).join(", "),V=(Lt,dn,cn)=>{const Dn=w(Lt),en=Dn.lastIndexOf(","),Ht=en!==-1?`${Dn.substring(0,en)} or${Dn.substring(en+1)}`:Dn,wn=[dn&&`max. ${parseFloat((dn/(1e3*1e3)).toFixed(1))}MB`,cn&&`upto ${cn} file${cn>1?"s":""}`].filter(Boolean);return wn.length>0?`${Ht} (${wn.join(", ")})`:Ht},k=Lt=>{const dn=Lt?.find(cn=>cn?.url===m.zD||cn?.url===m.UZ);return dn?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Lt,dn)=>{var cn,Dn,en;const Ht=dn?.find(wn=>wn.url.includes(Lt));return(en=(Dn=(cn=Ht?.valueInteger)!=null?cn:Ht?.valueDecimal)!=null?Dn:Ht?.valueString)!=null?en:Ht?.valueDate},q=Lt=>{if(!!Lt){if(/^\d{4}-\d{2}-\d{2}$/.test(Lt))return Lt;try{const dn=(0,a.evaluate)({},Lt);if(Array.isArray(dn)&&dn.length>0){const cn=dn[0];if(cn instanceof Date&&!isNaN(cn.getTime())){const Dn=cn.getFullYear(),en=String(cn.getMonth()+1).padStart(2,"0"),Ht=String(cn.getDate()).padStart(2,"0");return`${Dn}-${en}-${Ht}`}if(typeof cn=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(cn))return cn}}catch{}}},U=(Lt,dn)=>{var cn,Dn;const en=dn?.find(wn=>wn.url===Lt);if(!en)return;const Ht=(cn=en.valueString)!=null?cn:en.valueDate;return Ht||q((Dn=en.valueExpression)==null?void 0:Dn.expression)},$=(Lt,dn)=>{if(!(!Lt||Lt.length===0))for(const cn of Lt){const Dn=I(dn,cn.extension);if(Dn!==void 0)return Dn;if(cn.item&&cn.item.length>0){const en=$(cn.item,dn);if(en!==void 0)return en}}},X=(Lt,dn)=>{try{const cn=String(Lt??dn);let Dn;if(cn.includes("/"))Dn=(0,n.A)(cn,"MM/dd/yyyy",new Date);else{const en=cn.split("T")[0];Dn=(0,t.A)(en)}return(0,r.A)(Dn)}catch(cn){return console.error("Date parsing error:",cn,Lt),null}},G=(Lt,dn)=>{var cn;for(const Dn of Lt){if(Dn.linkId===dn)return Dn;if((cn=Dn.item)!=null&&cn.length){const en=G(Dn.item,dn);if(en!==void 0)return en}}},ie=(Lt,dn)=>{var cn;const Dn=[];for(const en of Lt)if(en.linkId===dn&&Dn.push(en),(cn=en.item)!=null&&cn.length){const Ht=ie(en.item,dn);Dn.push(...Ht)}return Dn},ae=(Lt,dn,cn=0)=>ie(Lt,dn)[cn];function re(Lt){return Lt!=null}const he=(Lt,dn)=>{var cn,Dn,en;if("answerString"in Lt&&re(Lt.answerString)){if(Lt.operator==="=")return dn?.valueString===Lt.answerString;if(Lt.operator==="!=")return dn?.valueString!==Lt.answerString}if("answerBoolean"in Lt&&re(Lt.answerBoolean)){if(Lt.operator==="=")return dn?.valueBoolean===Lt.answerBoolean;if(Lt.operator==="!=")return dn?.valueBoolean!==Lt.answerBoolean}if("answerInteger"in Lt&&re(Lt.answerInteger)||"answerDecimal"in Lt&&re(Lt.answerDecimal)){const Ht=Number(dn?.valueInteger||dn?.valueDecimal),wn=Number(Lt.answerInteger||Lt.answerDecimal);if(Lt.operator==="=")return Ht===wn;if(Lt.operator==="!=")return Ht!==wn;if(Lt.operator===">")return Ht>wn;if(Lt.operator==="<")return Ht<wn;if(Lt.operator===">=")return Ht>=wn;if(Lt.operator==="<=")return Ht<=wn}if("answerQuantity"in Lt&&re(Lt.answerQuantity)){const Ht=dn?.valueQuantity,wn=Lt.answerQuantity;if(Ht?.unit!==wn?.unit)return!1;if(Lt.operator==="=")return Ht.value===wn.value;if(Lt.operator==="!=")return Ht.value!==wn.value;if(Lt.operator===">")return Ht.value>wn.value;if(Lt.operator==="<")return Ht.value<wn.value;if(Lt.operator===">=")return Ht.value>=wn.value;if(Lt.operator==="<=")return Ht.value<=wn.value}if("answerCoding"in Lt&&re(Lt.answerCoding)){const Ht=dn?.valueCoding,wn=Lt.answerCoding;if(Lt.operator==="=")return Ht?.code===wn.code;if(Lt.operator==="!=")return Ht?.code!==wn.code}if("answerReference"in Lt&&re(Lt.answerReference)){const Ht=dn?.valueReference,wn=Lt.answerReference;if(Lt.operator==="=")return Ht?.reference===wn.reference;if(Lt.operator==="!=")return Ht?.reference!==wn.reference}if("answerDate"in Lt&&re(Lt.answerDate)||"answerDateTime"in Lt&&re(Lt.answerDateTime)||"answerTime"in Lt&&re(Lt.answerTime)){const Ht=new Date((en=(Dn=(cn=dn?.valueDate)!=null?cn:dn?.valueDateTime)!=null?Dn:dn?.valueTime)!=null?en:""),wn=new Date(Lt.answerDate||Lt.answerDateTime||Lt.answerTime||"");if(Lt.operator==="=")return Ht.getTime()===wn.getTime();if(Lt.operator==="!=")return Ht.getTime()!==wn.getTime();if(Lt.operator===">")return Ht.getTime()>wn.getTime();if(Lt.operator==="<")return Ht.getTime()<wn.getTime();if(Lt.operator===">=")return Ht.getTime()>=wn.getTime();if(Lt.operator==="<=")return Ht.getTime()<=wn.getTime()}return Lt.operator==="exists"?dn!=null===Lt.answerBoolean:!0},ve=(Lt,dn,cn)=>{const Dn=en=>{const Ht=ie(cn,en.question);return Ht.length===0||Ht.every(wn=>!wn.answer||wn.answer.length===0)?he(en,void 0):Ht.some(wn=>{var sn;return(sn=wn.answer)==null?void 0:sn.some(pn=>he(en,pn&&Object.keys(pn).length>0?pn:void 0))})};return Lt&&Lt?.length>0?dn==="any"?Lt?.some(en=>Dn(en)):Lt?.every(en=>Dn(en)):!0},Ce=(Lt,dn,cn,Dn,en)=>{if(!Lt||Lt.length===0)return!0;const Ht=wn=>{var sn;let pn;if(Dn&&typeof en=="number"){const pt=cn.filter(Dt=>Dt.linkId===Dn)[en];if(pt?.item){const Dt=pt.item.find(jt=>jt.linkId===wn.question);if(Dt?.answer&&Dt.answer.length>0)return(sn=Dt?.answer)==null?void 0:sn.some(jt=>he(wn,jt&&Object.keys(jt).length>0?jt:void 0))}}if(!pn){const Ut=ie(cn,wn.question);if(Ut.length>0)return Ut.some(pt=>{var Dt;return(Dt=pt.answer)==null?void 0:Dt.some(jt=>he(wn,jt&&Object.keys(jt).length>0?jt:void 0))});pn=void 0}return he(wn,pn)};return dn==="any"?Lt.some(wn=>Ht(wn)):Lt.every(wn=>Ht(wn))},ye=(Lt,dn)=>{var cn;if(!!((cn=Lt?.valueExpression)!=null&&cn.expression))try{const Dn=evaluate(dn,Lt.valueExpression.expression);return Array.isArray(Dn)?Dn.some(en=>Boolean(en)):Boolean(Dn)}catch{return}},ne=(Lt,dn)=>{var cn;const Dn=(cn=Lt.extension)==null?void 0:cn.find(Ht=>Ht.url===READ_ONLY_EXPRESSION_EXTENSION_URL),en=ye(Dn,dn);return A(v({},Lt),{readOnly:en??Lt.readOnly})},se=(Lt,dn,cn,Dn)=>{const{required:en,maxLength:Ht,type:wn,extension:sn,enableWhen:pn,enableBehavior:Ut,repeats:pt,answerOption:Dt}=Lt;if(!ve(pn,Ut,dn)||Lt.type==="group"||Lt.type==="display")return"";if(pt)return me(Lt,dn,cn,Dn);const jt=te(Lt,dn);return jt&&ee(jt,Lt)?ge(Lt,dn,cn,jt,Dn):le(sn,wn,en,Ht,cn,Dt,Dn)},me=(Lt,dn,cn,Dn)=>{const{required:en}=Lt;if(en){if(!cn||cn.length===0)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Ht=!1;for(let wn=0;wn<cn.length;wn++){const sn=cn[wn];if(sn&&Object.keys(sn).length>0&&Object.values(sn).some(Ut=>Ut!=null&&Ut!==""&&(Array.isArray(Ut)?Ut.length>0:!0))){Ht=!0;const Ut=le(Lt.extension,Lt.type,!0,Lt.maxLength,[sn],Lt.answerOption,Dn);if(Ut)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:wn+1,error:Ut});if(Lt.item&&Lt.item.length>0){const pt=ce(Lt.item,dn,Lt.linkId,wn,Dn);if(pt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:wn+1,error:pt})}}else return z(Dn,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:wn+1})}if(!Ht)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(cn&&cn.length>0)for(let Ht=0;Ht<cn.length;Ht++){const wn=cn[Ht];if(wn&&Object.keys(wn).length>0&&Object.values(wn).some(pn=>pn!=null&&pn!==""&&(Array.isArray(pn)?pn.length>0:!0))){const pn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[wn],Lt.answerOption,Dn);if(pn)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ht+1,error:pn});if(Lt.item&&Lt.item.length>0){const Ut=ce(Lt.item,dn,Lt.linkId,Ht,Dn);if(Ut)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ht+1,error:Ut})}}}return""},ce=(Lt,dn,cn,Dn,en)=>{var Ht,wn;for(const sn of Lt){if(!Ce(sn.enableWhen,sn.enableBehavior,dn,cn,Dn))continue;const pn=G(dn,cn),Ut=(Ht=pn?.item)==null?void 0:Ht.find(Dt=>Dt.linkId===sn.linkId),pt=(wn=Ut?.answer)!=null&&wn[Dn]?[Ut.answer[Dn]]:void 0;if(sn.required){if(!pt||!pt[0]||!de(pt[0]))return z(en,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:sn.text||sn.linkId});const Dt=le(sn.extension,sn.type,!0,sn.maxLength,pt,sn.answerOption,en);if(Dt)return`${sn.text||sn.linkId}: ${Dt}`}else if(pt&&pt[0]&&de(pt[0])){const Dt=le(sn.extension,sn.type,!1,sn.maxLength,pt,sn.answerOption,en);if(Dt)return`${sn.text||sn.linkId}: ${Dt}`}if(sn.item&&sn.item.length>0){const Dt=ce(sn.item,dn,sn.linkId,Dn,en);if(Dt)return Dt}}return""},de=Lt=>!Lt||Object.keys(Lt).length===0?!1:Object.values(Lt).some(dn=>dn!=null&&dn!==""&&(Array.isArray(dn)?dn.length>0:!0)),le=(Lt,dn,cn,Dn,en,Ht,wn)=>{var sn,pn,Ut,pt,Dt;let jt="";const Mn=!!Lt?.find(Or=>{var Dr,ro;return Or.url===m.gD&&((ro=(Dr=Or.valueCodeableConcept)==null?void 0:Dr.coding)==null?void 0:ro.some(pi=>pi.system===m.n4&&pi.code===m.GI))}),nn=en?.[0],yn={choice:((sn=nn?.valueCoding)==null?void 0:sn.code)||(nn?.valueString&&Ht?.some(Or=>Or.valueString===nn.valueString)?nn.valueString:null),"open-choice":((pn=nn?.valueCoding)==null?void 0:pn.code)||nn?.valueString,boolean:nn?.valueBoolean,string:nn?.valueString,text:nn?.valueString,url:nn?.valueUri,integer:nn?.valueInteger,decimal:nn?.valueDecimal,dateTime:nn?.valueDateTime,date:nn?.valueDate,time:nn?.valueTime,quantity:(Ut=nn?.valueQuantity)==null?void 0:Ut.value,reference:(pt=nn?.valueReference)==null?void 0:pt.display,attachment:(Dt=nn?.valueAttachment)==null?void 0:Dt.title};if(!(dn in yn))return"";const Yn=yn[dn],kr={required:()=>cn&&(Yn==null||Yn===""||Yn==="NaN"||Number.isNaN(Yn)||dn==="boolean"&&Yn!==!0&&Mn)?z(wn,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Dn&&Yn!==null&&Yn!==void 0&&Yn.toString().length>Dn?z(wn,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Dn}):"",minLength:()=>{const Or=I("minLength",Lt);return Or&&Yn!==null&&Yn!==void 0&&Yn.toString().length<Number(Or)?z(wn,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Or}):""},urlRegex:()=>{const Or=new RegExp(m.rx),Dr=I("regexError",Lt),ro=Dr??z(wn,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Or&&dn==="url"&&Yn&&!Or.test(Yn)?String(ro):""},regex:()=>{const Or=I("regex",Lt);if(!Or||typeof Yn!="string")return"";const Dr=new RegExp(Or),ro=I("regexError",Lt),pi=ro??z(wn,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Dr&&Yn&&!Dr.test(Yn)?String(pi):""},dateTime:()=>{if(dn==="dateTime"&&Yn){const Or=Yn?.toString(),Dr=new Date(Or);return isNaN(Dr.getTime())?z(wn,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(dn!=="date"||!Yn)return"";const Or=Yn.replace(/\D/g,"");return Or.length>0&&Or.length<8||isNaN(new Date(Yn).getTime())?z(wn,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Or;if(dn==="date"){const ro=U(m.dU,Lt),pi=X(ro??"01/01/1900","01/01/1900"),Io=X(Yn,"");if(!pi||!Io)return"";if((0,s.A)(Io,pi)){const Xo=(Or=Lt?.find($o=>$o.url===m.Ck))==null?void 0:Or.valueString;return Xo??z(wn,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:ro??"01/01/1900"})}return""}const Dr=I("minValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn<Dr?z(wn,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Dr}):""},maxValue:()=>{var Or;if(dn==="date"){const ro=U(m.bK,Lt),pi=X(ro??"01/01/2100","01/01/2100"),Io=X(Yn,"");if(!pi||!Io)return"";if((0,o.A)(Io,pi)){const Xo=(Or=Lt?.find($o=>$o.url===m.Cx))==null?void 0:Or.valueString;return Xo??z(wn,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:ro??"01/01/2100"})}return""}const Dr=I("maxValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn>Dr?z(wn,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Dr}):""}};return jt=kr.required()||kr.maxLength()||kr.minLength()||kr.urlRegex()||kr.regex()||kr.dateTime()||kr.date()||kr.minValue()||kr.maxValue()||"",jt},te=(Lt,dn)=>{for(const cn of dn)if(cn.item){if(cn.item.find(Ht=>Ht.linkId===Lt.linkId))return cn;const en=te(Lt,cn.item);if(en)return en}return null},ee=(Lt,dn)=>{if(Lt.answer&&Lt.answer.length>1)return!0;if(Lt.item){const cn=Lt.item.find(Dn=>Dn.linkId===dn.linkId);if(cn&&cn.answer&&cn.answer.length>1)return!0}return!1},ge=(Lt,dn,cn,Dn,en)=>{var Ht,wn;const{required:sn}=Lt,pn=(Ht=Dn.item)==null?void 0:Ht.find(Dt=>Dt.linkId===Lt.linkId),Ut=pn?.answer||[],pt=((wn=Dn.answer)==null?void 0:wn.length)||1;for(let Dt=0;Dt<pt;Dt++){const jt=Ut[Dt];if(sn){if(!jt||!de(jt))return z(en,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Dt+1,error:z(en,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Lt.text||Lt.linkId})});const Mn=le(Lt.extension,Lt.type,!0,Lt.maxLength,[jt],Lt.answerOption,en);if(Mn)return z(en,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Dt+1,error:Mn})}else if(jt&&de(jt)){const Mn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[jt],Lt.answerOption,en);if(Mn)return z(en,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Dt+1,error:Mn})}}return""},xe=(Lt,dn)=>{for(const cn of Lt){if(cn?.linkId===dn)return cn;if(cn?.item&&cn.item.length>0){const Dn=xe(cn.item,dn);if(Dn)return Dn}}},Ie=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ht.code===FOOTER_CODE))}))},Se=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===m.oA&&cn.valueBoolean))},De=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ht.code===HEADER_CODE))}))},ze=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===m.gD&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===m.n4&&Ht.code===m._l))}))},We=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&cn.valueBoolean))},ot=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ht.code===CHECKBOX_CODE))}))},ht=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.fe);return cn?.valueInteger},At=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.zO);return cn?.valueInteger},Tt=Lt=>{var dn;const cn=(dn=Lt?.extension)==null?void 0:dn.find(Dn=>Dn.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return cn?.valueInteger},Yt=(Lt,dn,cn,Dn,en,Ht)=>{const wn=pn=>dn.filter(Ut=>Ut.linkId===pn),sn=new Set;return Lt.map(pn=>{if(sn.has(pn.linkId)||Ie(pn))return null;const pt=wn(pn.linkId),Dt=pn.type==="group"&&pn.repeats;if(sn.add(pn.linkId),Dt){const jt=[];if(pt.forEach((Mn,nn)=>{const yn={linkId:pn.linkId,text:pn.text};let Yn;if(cn===pn.linkId&&typeof Ht=="number"&&Ht===nn&&en&&en.length>0){const kr=Mn?.item||[];Yn=[...kr],en.forEach(Or=>{const Dr=Yn.findIndex(ro=>ro.linkId===Or.linkId);Dr>=0?Yn[Dr]=A(v({},kr[Dr]),{answer:Or.answer}):Yn.push(Or)})}else pn.item&&(Yn=Yt(pn.item,Mn?.item||[],cn,Dn,en,nn));cn===pn.linkId&&typeof Ht=="number"&&Ht===nn&&Dn?yn.answer=Dn:yn.answer=Mn.answer||[{}],Yn&&Yn.length>0?yn.item=Yn:Mn.item&&(yn.item=Mn.item),jt.push(yn)}),cn===pn.linkId&&typeof Ht=="number"&&Ht>=pt.length)for(let Mn=pt.length;Mn<=Ht;Mn++){const nn={linkId:pn.linkId,text:pn.text,answer:Mn===Ht&&Dn?Dn:[{}]};Mn===Ht&&en&&en.length>0?nn.item=en:pn.item&&(nn.item=Yt(pn.item,[],void 0,void 0,void 0,void 0)),jt.push(nn)}return jt}else if(pn.repeats&&typeof Ht=="number"&&cn===pn.linkId){const jt=pt[0]||{linkId:pn.linkId,text:pn.text,answer:[]},Mn={linkId:pn.linkId,text:pn.text,answer:[...jt.answer||[]]};if(Dn&&Dn.length>0){for(;Mn.answer.length<=Ht;)Mn.answer.push({});Mn.answer[Ht]=Dn[0]}return Mn}else{const jt=pt[0],Mn=pn.item?Yt(pn.item,jt?.item||[],cn,Dn,en,Ht):void 0,nn=Mn&&Mn.length>0,yn={linkId:pn.linkId,text:pn.text};return cn&&pn.linkId===cn&&typeof Ht!="number"?(Dn||!Dn&&!en?yn.answer=Dn:jt?.answer&&(yn.answer=jt.answer),en?yn.item=en:nn&&(yn.item=Mn)):(jt?.answer?yn.answer=jt.answer:yn.answer=[{}],nn&&(yn.item=Mn)),yn}}).filter(Boolean).flat()},St=(Lt,dn)=>{for(const cn of Lt)if(cn.linkId===dn||cn.item&&St(cn.item,dn))return cn.linkId;return null},Ze=(Lt,dn,cn,Dn)=>{var en;const Ht=(en=Lt?.item)!=null?en:Dn;return!Ht||Ht.length===0?!0:Ht.every(wn=>{var sn;const pn=ie(dn,wn.linkId);if(pn.length===0){const Ut=(sn=G(dn,wn.linkId))==null?void 0:sn.answer;if(se(wn,dn,Ut)&&ve(wn.enableWhen,wn.enableBehavior,dn)&&cn.includes(wn.linkId))return!1}else for(const Ut of pn)if(se(wn,dn,Ut.answer)&&ve(wn.enableWhen,wn.enableBehavior,dn)&&cn.includes(wn.linkId))return!1;return wn.item?Ze(wn,dn,cn):!0})},Ke=(Lt,dn,cn=!0)=>{for(const Dn of Lt)if(Dn.linkId===dn&&Dn.answer&&Dn.answer.length>0||Dn.item&&Dn.item.length>0&&Ke(Dn.item,dn,cn))return!0;return!1},It=(Lt,dn,cn=0)=>{const Dn=Lt.filter(en=>en.linkId===dn);if(Dn.length>cn){const en=Dn[cn];if(en.answer&&en.answer.length>0)return en.answer.some(Ht=>Ht&&Object.keys(Ht).length>0&&Object.values(Ht).some(wn=>wn!=null&&wn!==""));if(en.item&&en.item.length>0)return Ke(en.item,dn,!1)}return Ke(Lt,dn,!1)},nt=(Lt,dn)=>{if(!Lt||!Lt.item)return!1;const cn=Dn=>{var en;if(Se(Dn)&&Dn.required&&ve(Dn.enableWhen,Dn.enableBehavior,dn)){const Ht=G(dn,Dn.linkId),wn=le(Dn.extension,Dn.type,Dn.required,Dn.maxLength,Ht?.answer,Dn.answerOption);if(!((en=Ht?.answer)!=null&&en.length)||wn)return!0}if(Dn.item){for(const Ht of Dn.item)if(cn(Ht))return!0}return!1};for(const Dn of Lt.item)if(cn(Dn))return!0;return!1},et=Lt=>{var dn,cn,Dn;if(Lt.valueString!==void 0)return Lt.valueString;if(Lt.valueBoolean!==void 0)return Lt.valueBoolean;if(Lt.valueInteger!==void 0)return Lt.valueInteger;if(Lt.valueDecimal!==void 0)return Lt.valueDecimal;if(Lt.valueDate!==void 0)return Lt.valueDate;if(Lt.valueDateTime!==void 0)return Lt.valueDateTime;if(((dn=Lt.valueCoding)==null?void 0:dn.code)!==void 0)return Lt.valueCoding.code;if(((cn=Lt.valueReference)==null?void 0:cn.reference)!==void 0)return Lt.valueReference.reference;if(((Dn=Lt.valueQuantity)==null?void 0:Dn.value)!==void 0)return Lt.valueQuantity.value;if(Lt.valueAttachment!==void 0)return Lt.valueAttachment},Zt=Lt=>{const dn={linkId:Lt.linkId};if(Lt.answer&&Lt.answer.length>0){const cn=Lt.answer.map(Dn=>et(Dn)).filter(Dn=>Dn!==void 0);cn.length>0&&(dn.answer=cn)}if(Lt.item&&Lt.item.length>0){const cn=Lt.item.map(Dn=>Zt(Dn)).filter(Dn=>{const en=Object.keys(Dn);return en.length>1||en.length===1&&en[0]!=="linkId"});cn.length>0&&(dn.item=cn)}return dn},xn=(Lt,dn,cn,Dn,en,Ht)=>{var wn;const sn=(wn=dn?.item)==null?void 0:wn[cn[Dn]],pn=sn?.linkId;if(!pn)return!1;const Ut=ie(Lt,pn),pt=ie(en,pn),Dt=jt=>{if(jt!=null){if(Array.isArray(jt)){const Mn=jt.filter(nn=>nn!=null).map(nn=>Dt(nn)).filter(nn=>nn!==void 0);return Mn.length===0||Mn.length===1&&typeof Mn[0]=="object"&&Object.keys(Mn[0]).length===0?void 0:Mn}if(typeof jt=="object"){const Mn={};for(const[nn,yn]of Object.entries(jt))if(yn!=null){const Yn=Dt(yn);Yn!==void 0&&(Mn[nn]=Yn)}return Object.keys(Mn).length===0?void 0:Mn}return jt}};if(Ut.length!==pt.length)return!1;for(let jt=0;jt<Ut.length;jt++){const Mn=Ut[jt],nn=pt[jt];if(!Mn||!nn)return!1;const yn=Zt(Dt(Mn)),Yn=Zt(Dt(nn));if(!_.isEqual(yn,Yn))return!1}return Dn!==Ht},An=(Lt,dn,cn,Dn)=>cn&&cn.length>0&&!(cn.length===1&&Object.keys(cn[0]).length===0)&&se(Lt,dn,cn,Dn)||null,at=(Lt,dn,cn)=>{const Dn={},en=Ht=>{Ht.forEach(wn=>{const sn=ie(dn,wn.linkId);if(Oe(wn,Lt)||wn.repeats)for(let pn=0;pn<sn.length;pn++){const Ut=sn[pn];if(Ut?.answer&&Ut.answer.length>0){const pt=An(wn,dn,Ut.answer,cn);pt&&(Dn[wn.linkId]=A(v({},Dn[wn.linkId]),{[pn]:pt}))}}else{const pn=G(dn,wn.linkId);if(pn?.answer&&pn.answer.length>0){const Ut=An(wn,dn,pn.answer,cn);Ut&&(Dn[wn.linkId]={0:Ut})}}wn.item&&wn.item.length>0&&en(wn.item)})};return en(Lt),Dn},Wt=Lt=>{if(!Lt)return"";const dn=Lt.split("-");if(dn.length===3){const[cn,Dn,en]=dn;return`${cn.slice(-4)}-${Dn}-${en}`}return""},Bt=Lt=>Lt.trim().replace(/[A-Za-z]+/g,""),On=(Lt,dn)=>{const cn=(Dn,en)=>{for(const Ht of Dn){if(Ht.linkId===en)return Ht.answer;if(Ht.item&&Ht.item.length>0){const wn=cn(Ht.item,en);if(wn!==void 0)return wn}}};return cn(Lt,dn)},Xn=(Lt,dn)=>{if(!dn||dn.length===0)return null;const cn=Lt.linkId,Dn=(en,Ht,wn=[])=>{for(const sn of en){const pn=[...wn,sn];if(sn.item){if(sn.item.some(Dt=>Dt.linkId===Ht))return pn.some(Dt=>Dt.repeats===!0)?sn:null;if(Dn(sn.item,Ht,pn))return sn}}return null};return Dn(dn,cn)},on=(Lt,dn)=>{if(!dn||dn.length===0)return!1;const cn=Lt.linkId,Dn=(en,Ht,wn=[])=>{for(const sn of en){const pn=[...wn,sn];if(sn.item){if(sn.item.some(Dt=>Dt.linkId===Ht))return pn.some(Dt=>{const jt=x(Dt.extension||[]);return!!jt&&jt!==UI_TOOLKIT_FORM_CONTAINER});if(Dn(sn.item,Ht,pn))return!0}}return!1};return Dn(dn,cn)},Ln=(Lt,dn,cn)=>{const Dn={};if(!Lt)return Dn;const{linkId:en}=dn;if(Lt[en]){const Ht=Lt[en];Dn[en]=Ht[cn]||""}return dn.item&&dn.item.length>0&&dn.item.forEach(Ht=>{if(Lt[Ht.linkId]){const wn=Lt[Ht.linkId];Dn[Ht.linkId]=wn[cn]||""}}),Dn},nr=(Lt,dn)=>{const cn={};if(!Lt||!Lt[dn])return cn;const Dn=Lt[dn];return cn[dn]=Dn[0]||"",cn},In=Lt=>{const dn=Lt.findIndex(Ht=>!Se(Ht)),cn=dn>=0?[dn]:[],Dn=new Map;let en=null;if(Lt.forEach((Ht,wn)=>{const sn=ze(Ht);if(sn&&Ht.type==="group")wn!==dn&&cn.push(wn),Dn.set(wn,[wn]),en=wn;else if(en!==null&&!sn){const pn=Dn.get(en)||[];Dn.set(en,[...pn,wn])}}),Lt.length>0&&cn.length>0){const Ht=cn[0];if(!Dn.has(Ht)){const wn=cn.find(pn=>pn>Ht),sn=[];for(let pn=Ht;pn<(wn??Lt.length);pn++)sn.push(pn);Dn.set(Ht,sn)}}return{groupIndices:cn,itemsToRenderMap:Dn}},Ur=(Lt,dn,cn,Dn)=>{let en=[...Dn];const Ht=(wn,sn)=>{wn.forEach(pn=>{if((!pn?.enableWhen||ve(pn?.enableWhen,pn.enableBehavior,sn))&&pn.initial&&!Ke(sn,pn.linkId))if(pn.repeats){const Ut=sn.filter(pt=>pt.linkId===pn.linkId);Ut.length>0?Ut.forEach((pt,Dt)=>{It(sn,pn.linkId,Dt)||(en=Yt(cn,en,pn.linkId,pn.initial,void 0,Dt))}):en=Yt(cn,en,pn.linkId,pn.initial)}else en=Yt(cn,en,pn.linkId,pn.initial);pn.item&&Ht(pn.item,sn)})};return Ht(Lt,dn),en},$r=(Lt,dn,cn)=>{if(!Lt)return[];const Dn=[],en=Ht=>{Ht.required===dn&&ve(Ht.enableWhen,Ht.enableBehavior,cn)&&!Se(Ht)&&Ht.type!=="display"&&Dn.push(Ht),Ht.item&&Ht.item.length>0&&Ht.item.forEach(en)};return Lt.forEach(en),Dn},Pt=(Lt,dn)=>Lt.every(cn=>{var Dn;const en=ie(dn,cn.linkId);if(en.length>0)return en.every(Ht=>!se(cn,dn,Ht.answer));{const Ht=(Dn=G(dn,cn.linkId))==null?void 0:Dn.answer;return!se(cn,dn,Ht)}}),Fe=(Lt,dn)=>{let cn=-1;for(let Dn=Lt.length-1;Dn>=0;Dn--)if(Lt[Dn].linkId===dn){cn=Dn;break}return cn},rt=(Lt,dn)=>Lt.filter(cn=>cn.linkId!==dn).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:rt(cn.item,dn)}):cn),Ye=(Lt,dn,cn=Lt)=>Lt.reduce((Dn,en)=>{const Ht=xe(dn,en.linkId);return Ht?.enableWhen&&!ve(Ht.enableWhen,Ht.enableBehavior,cn)||(en.item&&en.item.length>0?Dn.push(A(v({},en),{item:Ye(en.item,dn,cn)})):Dn.push(en)),Dn},[]),Qe=(Lt,dn,cn=[])=>{const Dn=[],en=Ht=>{Ht.forEach(wn=>{Dn.push(wn.linkId),wn.item&&wn.item.length>0&&en(wn.item)})};for(let Ht=0;Ht<Lt.length;Ht++){const wn=Lt[Ht];if(wn.linkId===dn){const sn=Lt.slice(0,Ht+1),pn=Lt.slice(Ht+1),{kept:Ut,removed:pt}=pn.reduce((Dt,jt)=>{const Mn=xe(cn,jt.linkId);return!Mn||Se(Mn)&&ve(Mn.enableWhen,Mn.enableBehavior,sn)?Dt.kept.push(jt):Dt.removed.push(jt),Dt},{kept:[],removed:[]});return en(pt),{trimmedData:[...sn,...Ut],trimmedLinkIds:Dn,found:!0}}if(wn.item&&wn.item.length>0){const sn=Qe(wn.item,dn,cn);if(sn.found){const pn=Lt.slice(0,Ht),Ut=Lt.slice(Ht+1),pt=[...pn,A(v({},wn),{item:sn.trimmedData})],{kept:Dt,removed:jt}=Ut.reduce((Mn,nn)=>{const yn=xe(cn,nn.linkId);return!yn||Se(yn)&&ve(yn.enableWhen,yn.enableBehavior,pt)?Mn.kept.push(nn):Mn.removed.push(nn),Mn},{kept:[],removed:[]});return en(jt),{trimmedData:[...pt,...Dt],trimmedLinkIds:[...sn.trimmedLinkIds,...Dn],found:!0}}}}return{trimmedData:Lt,trimmedLinkIds:[],found:!1}},Je=(Lt,dn)=>Lt.filter(cn=>!dn.includes(cn.linkId)).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:Je(cn.item,dn)}):cn),lt=Lt=>{var dn;if(!Lt)return"empty";const cn=m.Z$.find(({patterns:Dn})=>Dn.some(en=>Lt.includes(en)));return(dn=cn?.type)!=null?dn:"empty"},Ct=(Lt,dn)=>{const{groupIndices:cn}=In(Lt),Dn=Lt.findIndex(en=>en.linkId===dn);return Dn!==-1?cn.indexOf(Dn):-1},st=Lt=>{if(!Lt)return{restriction:null,warning:null};const dn=cn=>{const Dn=Lt.find(Ht=>Ht.url===cn&&Ht.valueString);if(!Dn?.valueString)return null;const en=Dn.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)}],Se=["error","loading"],De={error:"error",loading:"loader"},ze=({src:At,elementNameSuffix:Tt,version:Yt,prefetchFeatureApp:St})=>(0,g.__awaiter)(void 0,void 0,void 0,function*(){var Ze,Ke,It,nt,et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln;window.bwell||(window.bwell=new le({metadata:{version:Yt}}));const nr=`bwell-${Tt}`;if(customElements.get(nr)!==void 0)return;class In extends h{constructor(){super(),Ze.add(this),Ke.set(this,(0,T.nanoid)()),It.set(this,void 0),nt.set(this,document.createElement("feature-app-loader")),et.set(this,new k.EventEmitter),Zt.set(this,void 0),xn.set(this,void 0),An.set(this,void 0),at.set(this,void 0),Wt.set(this,void 0),Bt.set(this,void 0),this.attachShadow({mode:"open"});const $r=new he(Ie).attachToShadowRoot(this.shadowRoot);$r.addEventListener("visibilitychange",({visibility:Pt,container:Fe,name:rt})=>{rt==="error"&&Pt==="visible"&&window.bwell._registerEmbeddableContent(Fe),(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=Pt==="hidden"?"unset":"hidden"}),(0,g.__classPrivateFieldSet)(this,Bt,{slots:$r,attributes:new V().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,et,"f")},"f"),(0,g.__classPrivateFieldSet)(this,Zt,(0,g.__classPrivateFieldGet)(this,Ze,"m",On).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,xn,(0,g.__classPrivateFieldGet)(this,Ze,"m",Xn).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,An,(0,g.__classPrivateFieldGet)(this,Ze,"m",Ln).call(this,"error"),"f"),(0,g.__classPrivateFieldSet)(this,at,(0,g.__classPrivateFieldGet)(this,Ze,"m",Ln).call(this,"loading"),"f")}connectedCallback(){return(0,g.__awaiter)(this,void 0,void 0,function*(){(0,g.__classPrivateFieldGet)(this,An,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("error")),(0,g.__classPrivateFieldGet)(this,at,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("loading")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.addEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,xn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}(0,g.__classPrivateFieldSet)(this,Ke,this.id||(0,g.__classPrivateFieldGet)(this,Ke,"f"),"f"),(0,g.__classPrivateFieldSet)(this,It,new x((0,g.__classPrivateFieldGet)(this,Ke,"f")),"f"),(0,g.__classPrivateFieldGet)(this,It,"f").registerDispatcher($r=>this.dispatchEvent($r)),window.bwell.isInitialized?(0,g.__classPrivateFieldGet)(this,Zt,"f").call(this):(window.bwell.once("initialized",(0,g.__classPrivateFieldGet)(this,Zt,"f")),window.bwell.once("error",()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}),St&&(0,M.h)(At).catch(()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}))})}disconnectedCallback(){var $r;(0,g.__classPrivateFieldGet)(this,et,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,xn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,An,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),($r=(0,g.__classPrivateFieldGet)(this,It,"f"))===null||$r===void 0||$r.deregister(),(0,g.__classPrivateFieldGet)(this,et,"f").removeAllListeners()}}Ke=new WeakMap,It=new WeakMap,nt=new WeakMap,et=new WeakMap,Zt=new WeakMap,xn=new WeakMap,An=new WeakMap,at=new WeakMap,Wt=new WeakMap,Bt=new WeakMap,Ze=new WeakSet,On=function(){(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("featureAppId",`bwell-embeddable:${nr}`),(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("src",At),(0,g.__classPrivateFieldGet)(this,nt,"f").config={id:(0,g.__classPrivateFieldGet)(this,Ke,"f"),name:Tt,elementName:nr,utils:(0,g.__classPrivateFieldGet)(this,Bt,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,nt,"f"))},Xn=function({visibility:$r,name:Pt}){(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=$r==="hidden"?"unset":"hidden"},on=function($r){(0,g.__classPrivateFieldGet)(this,Wt,"f")(),(0,g.__classPrivateFieldSet)(this,Wt,void 0,"f")},Ln=function($r){return Pt=>{const Fe=Se.findIndex(Ye=>Ye===$r);if(!Se.slice(0,Fe).some(Ye=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Ye)!==null)){if(Pt!==null)(0,g.__classPrivateFieldGet)(this,Wt,"f")&&(0,g.__classPrivateFieldGet)(this,Ze,"m",on).call(this,$r),(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[$r]),"f");else if(Pt===null&&(0,g.__classPrivateFieldGet)(this,Wt,"f")){(0,g.__classPrivateFieldGet)(this,Ze,"m",on).call(this,$r);const Ye=Se.find(Qe=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Qe)!==null);Ye&&(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[Ye]),"f")}}}},customElements.define(nr,In)}),We={rE:"1.1164.1"},ot="composite";var ht=e(67321);ze({src:`https://embeddables.prod.icanbwell.com/${ot}/${We.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ot,version:We.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),a=Object.defineProperty,i=Object.defineProperties,b=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(M,h,f)=>h in M?a(M,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):M[h]=f,p=(M,h)=>{for(var f in h||(h={}))u.call(h,f)&&m(M,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&m(M,f,h[f]);return M},d=(M,h)=>i(M,b(h));const O=(M,h,f)=>{const v=_.cloneDeep(M);if(!v.contained||h<0)return v;const A=v.contained.findIndex(z=>z.resourceType==="Questionnaire");if(A!==-1&&!f){const z=v.contained[A];if(z.item){if(!z.item.some(C=>isPageExtensionPresent(C)))return v;let T=0,S=z.item.length;for(let C=0;C<z.item.length;C++){const E=z.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}z.item=z.item.slice(0,S),v.contained[A]=z}}else f&&A!==-1&&(v.contained[A]=d(p({},v.contained[A]),{item:f}));return v},g=({formId:M,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:v,onGoBack:A,handleHiddenQuestion:z,errorConfig:x,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var N,w,V;const{currentGroupIndex:k,hasCustomError:I}=useFHIRQuestionnaire(),q=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(X=>X.id===q&&X.resourceType==="Questionnaire"),$=(X,G,ie)=>{let ae=_.cloneDeep(h);ae.item=X,ae=trimQuestionnaireItems(ae,k,ie),v(ae,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:M,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:x,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:$,onGoBack:A,onClearError:T,handleHiddenQuestion:z,showStepper:C,hideBackButton:E,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),a=e(56192),i=e(76808),b=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(A,z,x)=>z in A?c(A,z,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[z]=x,g=(A,z)=>{for(var x in z||(z={}))p.call(z,x)&&O(A,x,z[x]);if(m)for(var x of m(z))d.call(z,x)&&O(A,x,z[x]);return A},M=(A,z)=>u(A,y(z)),h=(A,z,x)=>new Promise((T,S)=>{var C=P=>{try{R(x.next(P))}catch(L){S(L)}},E=P=>{try{R(x.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,E);R((x=x.apply(A,z)).next())});const f=10,v=({id:A="location-filter-desktop",initialValue:z,onInputChange:x,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:E,errorText:R})=>{const P=(0,i.Ul)(),{i18n:{t:L},loading:D}=(0,b.E_)({keys:["shared-translations"]}),N=z?.placeId,w=z?.description,[V,k]=(0,t.useState)(""),[I,q]=(0,t.useState)(""),[U,$]=(0,t.useState)(null),[X,G]=(0,t.useState)(null),[ie,ae]=(0,t.useState)(!1),re=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ve,Ce]=(0,t.useState)(he),[ye,ne]=(0,t.useState)(he),[se,{loading:me,error:ce}]=(0,a.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[de,{loading:le,error:te}]=(0,a.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[ee,{loading:ge,error:xe}]=(0,a.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Ce(he)},onCompleted:Yt=>{var St,Ze;const Ke=(Ze=(St=Yt.placeAutocomplete)==null?void 0:St.predictions)==null?void 0:Ze.map(It=>{var nt;return{id:It.placeId,label:(0,s.removeAfterLastComma)(It.description),mainText:It?.mainText||((nt=It.description.split(",")[0])==null?void 0:nt.trim()),secondaryText:(0,s.removeAfterLastComma)(It?.secondaryText||It.description.split(",").slice(1).join(",").trim())}});Ce(Ke?.length?Ke:he)}}),Ie=(0,t.useMemo)(()=>ve.map(Yt=>M(g({},Yt),{displayLabel:(0,r.RZ)(Yt?.label||"",V)})),[V,ve]),Se=Yt=>h(void 0,null,function*(){var St,Ze,Ke,It,nt,et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln;if($(Yt),G(Yt),ae(!1),Yt&&typeof Yt=="string"){const nr=ve.find(Qe=>Qe.id===Yt),In=nr?.label||V;if(!nr)return;k(In),q(In),setTimeout(()=>{const Qe=[{id:nr.id,label:nr.label}];Ce(Qe),ne(Qe)},f);const Ur=yield se({variables:{placeId:Yt}}),$r=(Ze=(St=Ur?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ze.latitude,Pt=(It=(Ke=Ur?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,Fe=((et=(nt=Ur?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",rt=((xn=(Zt=Ur?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:xn.state)||"",Ye=((at=(An=Ur?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if($r&&Pt)if(!Fe||!Ye){const Qe=yield de({variables:{latitude:String($r),longitude:String(Pt)}}),Je=((Bt=(Wt=Qe?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",lt=((Xn=(On=Qe?.data)==null?void 0:On.geocodingByLatLon)==null?void 0:Xn.state)||"",Ct=((Ln=(on=Qe?.data)==null?void 0:on.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:$r,longitude:Pt,zipCode:Je,state:lt,stateCode:Ct,placeId:Yt,description:In,value:Yt})}else T({latitude:$r,longitude:Pt,zipCode:Fe,state:rt,stateCode:Ye,placeId:Yt,description:In,value:Yt});else ae(!0)}}),De=()=>!0,ze=(0,s.useDebounce)(Yt=>h(void 0,null,function*(){return yield ee({variables:{input:Yt,types:"geocode"}})})),We=Yt=>h(void 0,null,function*(){if(ae(!1),k(Yt),x?.(Yt),!Yt||Yt.trim().length===0){$(null),Ce(he),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Yt});return}const St=Yt.trim();St.length>=2?yield ze(St):Ce(he)}),ot=Yt=>{re.current=Yt},ht=()=>{k(I),Ce(ye),$(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var St,Ze,Ke,It,nt,et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln;if(N&&w){Ce([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),$(N),G(N),k(w),q(w),w===V&&k(w);const nr=yield se({variables:{placeId:N}}),In=(Ze=(St=nr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ze.latitude,Ur=(It=(Ke=nr?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,$r=((et=(nt=nr?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",Pt=((xn=(Zt=nr?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:xn.state)||"",Fe=((at=(An=nr?.data)==null?void 0:An.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if(In&&Ur)if(!$r||!Pt||!Fe){const rt=yield de({variables:{latitude:String(In),longitude:String(Ur)}}),Ye=((Bt=(Wt=rt?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",Qe=((Xn=(On=rt?.data)==null?void 0:On.geocodingByLatLon)==null?void 0:Xn.state)||"",Je=((Ln=(on=rt?.data)==null?void 0:on.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:In,longitude:Ur,zipCode:Ye,state:Qe,stateCode:Je,placeId:N,description:w,value:N})}else T({latitude:In,longitude:Ur,zipCode:$r,state:Pt,stateCode:Fe,placeId:N,description:w,value:N})}else $(null),G(null),k(""),q(""),Ce(he),ne(he)}))()},[]);const At=ie||!!ce||!!te||!!xe||!!R,Tt=At?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||D)},[E,me,le,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:A,size:"md",isDisabled:S,inputValue:V,isLoading:ge||me||le,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Ie,selectedKey:U,onSelectionChange:Se,onInputChange:We,defaultFilter:De,onOpenChange:ot,onBlur:ht,isInvalid:At,hint:Tt,autoComplete:"address-line1",className:"w-full",children:Yt=>{const St=Yt,Ze=V.trim().length>=2,Ke=St.mainText||"",It=St.secondaryText||"",nt=Ke.trim().length>0,et=It.trim().length>0,Zt=nt?(0,r.RZ)(Ke,V):{beforePart:"",highlightedPart:"",remainingPart:""},xn=et?(0,r.RZ)(It,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:St.id,supportingText:St.supportingText,isDisabled:St.isDisabled,icon:St.icon,avatarUrl:St.avatarUrl,textValue:St.label,children:Ze&&nt?(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:Zt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Zt.highlightedPart}),(0,n.jsx)("span",{children:Zt.remainingPart})]}),et&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:xn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:xn.highlightedPart}),(0,n.jsx)("span",{children:xn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:St.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:a})=>{const{isSmallScreen:i}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${i?"-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 ${i?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[a,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(62754);const a=({className:i})=>{const{pathname:b}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:m,i18n:{t:p}}=useI18nChild({keys:["shared"]}),d=getPathSegments(b).flatMap(O=>{const g=c.getId(O),M=c.getRouteMeta(g)||{},h=getBreadcrumbTitleKey(g,M,u);if(!h||M.breadcrumbHide)return[];const f=y[g];let v=c.getHref(g),A=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:g,search:f.search})),f.titleKey&&(A=f.titleKey)),[{routeId:g,href:v,label:p(A),onClick:f?.onClick}]});return m||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",i),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),a=e(5380),i=e(87896),b=e(26877);const c=(E,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),E)),u=(E,R,P)=>Promise.race([E,c(R,P)]),y=5e3,m=1e4;var p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(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={}))M.call(R,P)&&f(E,P,R[P]);if(g)for(var P of g(R))h.call(R,P)&&f(E,P,R[P]);return E},A=(E,R)=>d(E,O(R)),z=(E,R,P)=>new Promise((L,D)=>{var N=k=>{try{V(P.next(k))}catch(I){D(I)}},w=k=>{try{V(P.throw(k))}catch(I){D(I)}},V=k=>k.done?L(k.value):Promise.resolve(k.value).then(N,w);V((P=P.apply(E,R)).next())});const x={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:E})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,i.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,q]=(0,t.useState)(!1),[U,$]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[X,G]=(0,t.useState)(),[ie,ae]=(0,t.useState)(!1),re=(0,t.useCallback)(ge=>{$(ge);try{w(A(v({},k.current),{locationPermission:ge||a.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?L?.error(xe,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,L]),he=(0,t.useCallback)(()=>z(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?L?.error(ge,"Error checking geolocation availability"):L?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,L]),ve=(0,t.useCallback)(ge=>z(void 0,null,function*(){const xe=D.getCurrentPosition(ge).then(Ie=>{if(!Ie||!Ie.coords)throw new Error("Location data is invalid or unavailable");return Ie});try{return yield u(xe,y,"Location request timed out. Please check that location services are enabled.")}catch(Ie){throw Ie instanceof Error&&L?.error(Ie,"Geolocation timeout or error"),Ie}}),[D,L]),Ce=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ye=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield he()))return L?.error("Location services not available"),!1;const xe=yield Ce();return xe!==a.Ef.GRANTED&&xe!==a.Ef.PROMPT?(L?.error(`Location permission not granted: ${xe}`),!1):!0}catch(ge){return ge instanceof Error?L?.error(ge,"Error checking location services"):L?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[he,L,Ce]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>z(void 0,null,function*(){const xe=N.locationPermission;if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){$(xe);return}q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}if(xe===a.Ef.GRANTED){try{const De=yield Ce();if(De===a.Ef.GRANTED){const ze=yield ve(x);ze&&(G(ze),re(a.Ef.GRANTED))}else De===a.Ef.PROMPT?(re(De),ae(!0)):re(De)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(De)}`),re(a.Ef.UNAVAILABLE)}return}const Se=yield Ce();if(re(Se),Se===a.Ef.GRANTED)try{const De=yield ve(x);De?G(De):re(a.Ef.UNAVAILABLE)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(De)}`),re(a.Ef.UNAVAILABLE)}else Se===a.Ef.PROMPT&&ae(!0)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(Ie)}`),re(a.Ef.UNAVAILABLE)}finally{q(!1)}}))()},[]);const se=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield ne())){re(a.Ef.UNAVAILABLE);return}q(!0);let xe=yield Ce();if(re(xe),xe===a.Ef.GRANTED||xe===a.Ef.PROMPT){if(P==="Android"&&xe===a.Ef.GRANTED)try{xe=yield ye(),re(xe)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(Ie)}`);return}if(xe!==a.Ef.UNAVAILABLE){const Ie=yield ve(x);return G(Ie),Ie}}return}catch(ge){re(a.Ef.UNAVAILABLE),ge instanceof Error?L?.error(ge,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{q(!1)}}),[ne,L,P,re,ve,Ce,ye]),me=(0,t.useCallback)(()=>z(void 0,null,function*(){try{return(yield he())?yield Ce():a.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?L?.error(ge,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ge)}`),a.Ef.UNAVAILABLE}}),[he,L,Ce]),ce=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}const xe=yield Ce();re(xe)}catch(ge){ge instanceof Error?L?.error(ge,"Error checking and setting location permission"):L?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),re(a.Ef.UNAVAILABLE)}finally{q(!1)}}),[he,L,re,Ce]),de=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}const xe=yield Ce();if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){re(xe);return}const Ie=yield ye();if(re(Ie),["granted","prompt"].includes(Ie)){const Se=yield ve(x);return G(Se),Se}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||L?.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")||L?.error(`Error requesting location - ${xe}`)}re(a.Ef.UNAVAILABLE);return}finally{q(!1)}}),[he,L,re,ve,ye,Ce]),le=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield he())){re(a.Ef.UNAVAILABLE);return}const xe=yield ve(x);xe&&(G(xe),$(a.Ef.GRANTED),w(A(v({},k.current),{location:`${xe.coords.latitude},${xe.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${xe.coords.latitude}`,lng:`${xe.coords.longitude}`,locationPermission:a.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?L?.error(ge,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ge)}`),re(a.Ef.UNAVAILABLE),ge}finally{q(!1)}}),[he,L,w,re,ve]),te=(0,t.useCallback)(()=>z(void 0,null,function*(){try{q(!0);const ge=yield se();ge&&w(A(v({},k.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||a.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?L?.error(ge,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{q(!1)}}),[L,U,se,w]),ee=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:$,position:X,refreshPosition:se,requestPosition:de,requestCurrentLocation:le,checkAndSetLocationPermission:ce,checkLocaitonPermission:me}),[I,te,U,X,se,de,le,ce,me]);return(0,n.jsxs)(T.Provider,{value:ee,children:[ie&&(0,n.jsx)(b.J,{isOpen:ie,onClose:()=>ae(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>lt,GI:()=>ve,rz:()=>at,Fp:()=>An,el:()=>xn,ao:()=>Zt,oA:()=>D,Yt:()=>Ct,g4:()=>et,tn:()=>Ve,n4:()=>N,gD:()=>L,Vp:()=>Qe,Cx:()=>q,bK:()=>k,gi:()=>Je,Z$:()=>ce,GT:()=>Ye,hr:()=>de,JL:()=>le,Ck:()=>I,dU:()=>V,wG:()=>nr,hZ:()=>on,$e:()=>Wt,qT:()=>Xn,GQ:()=>On,q3:()=>Ln,D_:()=>Bt,Uf:()=>$,_l:()=>ye,Md:()=>ie,V7:()=>G,fe:()=>se,JP:()=>Et,Z_:()=>w,zO:()=>me,UZ:()=>re,$7:()=>Ze,rb:()=>X,_W:()=>It,WS:()=>Ke,VF:()=>Fe,vf:()=>Ur,PV:()=>rt,PS:()=>In,Iz:()=>Pt,zD:()=>ae,m3:()=>At,XP:()=>Tt,PM:()=>Ie,cX:()=>te,G6:()=>ee,Us:()=>De,AA:()=>xe,G0:()=>ht,mO:()=>We,HH:()=>Se,PU:()=>Oe,it:()=>St,Tl:()=>ot,uH:()=>Yt,c3:()=>ge,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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 a=e(8957);const i=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));i.displayName="UserX01";const b=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));p.displayName="Hash01";const d=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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 M=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));M.displayName="CreditCard02";const h=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const v=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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 A=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));A.displayName="ClipboardPlus";const z=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));z.displayName="Route";const x=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));x.displayName="Briefcase01";const T=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));T.displayName="Translate01";const S=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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"}));S.displayName="AnnotationQuestion";const C=({size:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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:Vt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Vt,height:Vt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},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,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",k="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",q="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",$="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",X="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",ie="http://hl7.org/fhir/StructureDefinition/entryFormat",ae="http://hl7.org/fhir/StructureDefinition/tz-code",re="tz-code",he="footer",ve="check-box",Ce="header",ye="page",ne="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",ce=[{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"}],de={"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"},le={"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"},te="ui-toolkit/CoordinatePicker",ee="ui-toolkit/DetailsInfo",ge="ui-toolkit/ServiceChoice",xe="ui-toolkit/InfoBanner",Ie="ui-toolkit/Button",Se="ui-toolkit/Phone",De="ui-toolkit/ErrorCard",ze="ui-toolkit/FormContainer",We="ui-toolkit/PageHeader",ot="ui-toolkit/SelectableOption",ht="ui-toolkit/Modal",At="ui-toolkit/Alert",Tt="ui-toolkit/AppSectionAccess",Yt="ui-toolkit/SensitiveDataCategory",St="ui-toolkit/QuestCard",Ze="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ke="http://icanbwell.com/fhir/StructureDefinition/text-align",It={LEFT:"left",CENTER:"center"},nt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},et="http://icanbwell.com/fhir/StructureDefinition/icon-name",Zt="http://icanbwell.com/fhir/StructureDefinition/error-title",xn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",An="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",at="http://icanbwell.com/fhir/StructureDefinition/description",Wt="http://icanbwell.com/fhir/StructureDefinition/modal-description",Bt="http://icanbwell.com/fhir/StructureDefinition/modal-title",On="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Xn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",on="http://icanbwell.com/fhir/StructureDefinition/button-text",Ln="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",nr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",In="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Ur="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",$r="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",Pt="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-color",rt="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Ye="http://hl7.org/fhir/StructureDefinition/mimeType",Qe="http://hl7.org/fhir/StructureDefinition/maxSize",Je="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",Ct="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",ue="http://icanbwell.com/fhir/StructureDefinition/hint-text",Oe="ui-toolkit/PrefilledMemberDemographicsAlert",Ve="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",xt="http://icanbwell.com/fhir/StructureDefinition/button-action",Kt="button-type",Cn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",qn="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Sr="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Ft="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Xe={},Et={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":a.f,"user-x":i,"users-01":b,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:m.X,hash:p,"hash-02":d,"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":M,"link-03":h,"search-lg":f.q,"clipboard-check":v,"clipboard-plus":A,route:z,"briefcase-01":x,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":E,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>N,$O:()=>ht,CP:()=>Bt,Fy:()=>Wt,GN:()=>ve,J4:()=>lt,MU:()=>G,Nw:()=>rt,Qr:()=>C,Ue:()=>Ct,Yo:()=>xe,a0:()=>T,cz:()=>E,di:()=>I,eC:()=>st,iI:()=>q,lv:()=>k,mR:()=>Cn,nt:()=>S,od:()=>V,t7:()=>At,u0:()=>z,yQ:()=>Kt,zj:()=>le});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),a=e(27779),i=e.n(a),b=e(45250),c=e.n(b),u=e(16681),y=e(18807),m=e(1053),p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(Lt,dn,cn)=>dn in Lt?p(Lt,dn,{enumerable:!0,configurable:!0,writable:!0,value:cn}):Lt[dn]=cn,v=(Lt,dn)=>{for(var cn in dn||(dn={}))M.call(dn,cn)&&f(Lt,cn,dn[cn]);if(g)for(var cn of g(dn))h.call(dn,cn)&&f(Lt,cn,dn[cn]);return Lt},A=(Lt,dn)=>d(Lt,O(dn));const z=(Lt,dn,cn,Dn)=>{if(Lt){const en=Lt(dn,v({defaultValue:cn},Dn));if(en&&en!==dn)return en}return Dn?Object.entries(Dn).reduce((en,[Ht,wn])=>en.replace(`{{${Ht}}}`,String(wn)),cn):cn},x=Lt=>{var dn;return(dn=Lt.filter(cn=>cn.url.includes("questionnaire-itemControl")).flatMap(cn=>{var Dn,en;return(en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)!=null?en:[]}).find(cn=>{var Dn;return(Dn=cn.code)==null?void 0:Dn.startsWith("ui-toolkit/")}))==null?void 0:dn.code},T=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.V7);return cn?.valueCode||"off"},S=(Lt,dn,cn)=>{const Dn=(0,y.A)(cn);return Lt&&dn&&cn?Dn.replace("<p>",`<span>${dn} `).replace("</p>","</span>").trim():Dn.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Vp);return dn?.valueInteger},E=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Z_);return dn?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Lt,dn)=>{const cn=Lt?.find(Dn=>Dn.url===PLACEHOLDER_EXTENSION_URL);return cn?.valueString||dn&&R[dn]||P},D=Lt=>{const dn=Lt?.find(cn=>cn.url===HINT_TEXT_EXTENSION_URL);return dn?.valueString},N=Lt=>{const dn=Lt?.filter(cn=>cn.url===m.GT&&cn.valueCode).map(cn=>m.hr[cn.valueCode]||cn.valueCode);return dn?.length?dn.join(","):void 0},w=Lt=>Lt.split(",").map(Dn=>Dn.trim()).map(Dn=>m.JL[Dn]||Dn).filter((Dn,en,Ht)=>Ht.indexOf(Dn)===en).join(", "),V=(Lt,dn,cn)=>{const Dn=w(Lt),en=Dn.lastIndexOf(","),Ht=en!==-1?`${Dn.substring(0,en)} or${Dn.substring(en+1)}`:Dn,wn=[dn&&`max. ${parseFloat((dn/(1e3*1e3)).toFixed(1))}MB`,cn&&`upto ${cn} file${cn>1?"s":""}`].filter(Boolean);return wn.length>0?`${Ht} (${wn.join(", ")})`:Ht},k=Lt=>{const dn=Lt?.find(cn=>cn?.url===m.zD||cn?.url===m.UZ);return dn?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Lt,dn)=>{var cn,Dn,en;const Ht=dn?.find(wn=>wn.url.includes(Lt));return(en=(Dn=(cn=Ht?.valueInteger)!=null?cn:Ht?.valueDecimal)!=null?Dn:Ht?.valueString)!=null?en:Ht?.valueDate},q=Lt=>{if(!!Lt){if(/^\d{4}-\d{2}-\d{2}$/.test(Lt))return Lt;try{const dn=(0,a.evaluate)({},Lt);if(Array.isArray(dn)&&dn.length>0){const cn=dn[0];if(cn instanceof Date&&!isNaN(cn.getTime())){const Dn=cn.getFullYear(),en=String(cn.getMonth()+1).padStart(2,"0"),Ht=String(cn.getDate()).padStart(2,"0");return`${Dn}-${en}-${Ht}`}if(typeof cn=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(cn))return cn}}catch{}}},U=(Lt,dn)=>{var cn,Dn;const en=dn?.find(wn=>wn.url===Lt);if(!en)return;const Ht=(cn=en.valueString)!=null?cn:en.valueDate;return Ht||q((Dn=en.valueExpression)==null?void 0:Dn.expression)},$=(Lt,dn)=>{if(!(!Lt||Lt.length===0))for(const cn of Lt){const Dn=I(dn,cn.extension);if(Dn!==void 0)return Dn;if(cn.item&&cn.item.length>0){const en=$(cn.item,dn);if(en!==void 0)return en}}},X=(Lt,dn)=>{try{const cn=String(Lt??dn);let Dn;if(cn.includes("/"))Dn=(0,n.A)(cn,"MM/dd/yyyy",new Date);else{const en=cn.split("T")[0];Dn=(0,t.A)(en)}return(0,r.A)(Dn)}catch(cn){return console.error("Date parsing error:",cn,Lt),null}},G=(Lt,dn)=>{var cn;for(const Dn of Lt){if(Dn.linkId===dn)return Dn;if((cn=Dn.item)!=null&&cn.length){const en=G(Dn.item,dn);if(en!==void 0)return en}}},ie=(Lt,dn)=>{var cn;const Dn=[];for(const en of Lt)if(en.linkId===dn&&Dn.push(en),(cn=en.item)!=null&&cn.length){const Ht=ie(en.item,dn);Dn.push(...Ht)}return Dn},ae=(Lt,dn,cn=0)=>ie(Lt,dn)[cn];function re(Lt){return Lt!=null}const he=(Lt,dn)=>{var cn,Dn,en;if("answerString"in Lt&&re(Lt.answerString)){if(Lt.operator==="=")return dn?.valueString===Lt.answerString;if(Lt.operator==="!=")return dn?.valueString!==Lt.answerString}if("answerBoolean"in Lt&&re(Lt.answerBoolean)){if(Lt.operator==="=")return dn?.valueBoolean===Lt.answerBoolean;if(Lt.operator==="!=")return dn?.valueBoolean!==Lt.answerBoolean}if("answerInteger"in Lt&&re(Lt.answerInteger)||"answerDecimal"in Lt&&re(Lt.answerDecimal)){const Ht=Number(dn?.valueInteger||dn?.valueDecimal),wn=Number(Lt.answerInteger||Lt.answerDecimal);if(Lt.operator==="=")return Ht===wn;if(Lt.operator==="!=")return Ht!==wn;if(Lt.operator===">")return Ht>wn;if(Lt.operator==="<")return Ht<wn;if(Lt.operator===">=")return Ht>=wn;if(Lt.operator==="<=")return Ht<=wn}if("answerQuantity"in Lt&&re(Lt.answerQuantity)){const Ht=dn?.valueQuantity,wn=Lt.answerQuantity;if(Ht?.unit!==wn?.unit)return!1;if(Lt.operator==="=")return Ht.value===wn.value;if(Lt.operator==="!=")return Ht.value!==wn.value;if(Lt.operator===">")return Ht.value>wn.value;if(Lt.operator==="<")return Ht.value<wn.value;if(Lt.operator===">=")return Ht.value>=wn.value;if(Lt.operator==="<=")return Ht.value<=wn.value}if("answerCoding"in Lt&&re(Lt.answerCoding)){const Ht=dn?.valueCoding,wn=Lt.answerCoding;if(Lt.operator==="=")return Ht?.code===wn.code;if(Lt.operator==="!=")return Ht?.code!==wn.code}if("answerReference"in Lt&&re(Lt.answerReference)){const Ht=dn?.valueReference,wn=Lt.answerReference;if(Lt.operator==="=")return Ht?.reference===wn.reference;if(Lt.operator==="!=")return Ht?.reference!==wn.reference}if("answerDate"in Lt&&re(Lt.answerDate)||"answerDateTime"in Lt&&re(Lt.answerDateTime)||"answerTime"in Lt&&re(Lt.answerTime)){const Ht=new Date((en=(Dn=(cn=dn?.valueDate)!=null?cn:dn?.valueDateTime)!=null?Dn:dn?.valueTime)!=null?en:""),wn=new Date(Lt.answerDate||Lt.answerDateTime||Lt.answerTime||"");if(Lt.operator==="=")return Ht.getTime()===wn.getTime();if(Lt.operator==="!=")return Ht.getTime()!==wn.getTime();if(Lt.operator===">")return Ht.getTime()>wn.getTime();if(Lt.operator==="<")return Ht.getTime()<wn.getTime();if(Lt.operator===">=")return Ht.getTime()>=wn.getTime();if(Lt.operator==="<=")return Ht.getTime()<=wn.getTime()}return Lt.operator==="exists"?dn!=null===Lt.answerBoolean:!0},ve=(Lt,dn,cn)=>{const Dn=en=>{const Ht=ie(cn,en.question);return Ht.length===0||Ht.every(wn=>!wn.answer||wn.answer.length===0)?he(en,void 0):Ht.some(wn=>{var sn;return(sn=wn.answer)==null?void 0:sn.some(pn=>he(en,pn&&Object.keys(pn).length>0?pn:void 0))})};return Lt&&Lt?.length>0?dn==="any"?Lt?.some(en=>Dn(en)):Lt?.every(en=>Dn(en)):!0},Ce=(Lt,dn,cn,Dn,en)=>{if(!Lt||Lt.length===0)return!0;const Ht=wn=>{var sn;let pn;if(Dn&&typeof en=="number"){const pt=cn.filter(Dt=>Dt.linkId===Dn)[en];if(pt?.item){const Dt=pt.item.find(jt=>jt.linkId===wn.question);if(Dt?.answer&&Dt.answer.length>0)return(sn=Dt?.answer)==null?void 0:sn.some(jt=>he(wn,jt&&Object.keys(jt).length>0?jt:void 0))}}if(!pn){const Ut=ie(cn,wn.question);if(Ut.length>0)return Ut.some(pt=>{var Dt;return(Dt=pt.answer)==null?void 0:Dt.some(jt=>he(wn,jt&&Object.keys(jt).length>0?jt:void 0))});pn=void 0}return he(wn,pn)};return dn==="any"?Lt.some(wn=>Ht(wn)):Lt.every(wn=>Ht(wn))},ye=(Lt,dn)=>{var cn;if(!!((cn=Lt?.valueExpression)!=null&&cn.expression))try{const Dn=evaluate(dn,Lt.valueExpression.expression);return Array.isArray(Dn)?Dn.some(en=>Boolean(en)):Boolean(Dn)}catch{return}},ne=(Lt,dn)=>{var cn;const Dn=(cn=Lt.extension)==null?void 0:cn.find(Ht=>Ht.url===READ_ONLY_EXPRESSION_EXTENSION_URL),en=ye(Dn,dn);return A(v({},Lt),{readOnly:en??Lt.readOnly})},se=(Lt,dn,cn,Dn)=>{const{required:en,maxLength:Ht,type:wn,extension:sn,enableWhen:pn,enableBehavior:Ut,repeats:pt,answerOption:Dt}=Lt;if(!ve(pn,Ut,dn)||Lt.type==="group"||Lt.type==="display")return"";if(pt)return me(Lt,dn,cn,Dn);const jt=te(Lt,dn);return jt&&ee(jt,Lt)?ge(Lt,dn,cn,jt,Dn):le(sn,wn,en,Ht,cn,Dt,Dn)},me=(Lt,dn,cn,Dn)=>{const{required:en}=Lt;if(en){if(!cn||cn.length===0)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Ht=!1;for(let wn=0;wn<cn.length;wn++){const sn=cn[wn];if(sn&&Object.keys(sn).length>0&&Object.values(sn).some(Ut=>Ut!=null&&Ut!==""&&(Array.isArray(Ut)?Ut.length>0:!0))){Ht=!0;const Ut=le(Lt.extension,Lt.type,!0,Lt.maxLength,[sn],Lt.answerOption,Dn);if(Ut)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:wn+1,error:Ut});if(Lt.item&&Lt.item.length>0){const pt=ce(Lt.item,dn,Lt.linkId,wn,Dn);if(pt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:wn+1,error:pt})}}else return z(Dn,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:wn+1})}if(!Ht)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(cn&&cn.length>0)for(let Ht=0;Ht<cn.length;Ht++){const wn=cn[Ht];if(wn&&Object.keys(wn).length>0&&Object.values(wn).some(pn=>pn!=null&&pn!==""&&(Array.isArray(pn)?pn.length>0:!0))){const pn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[wn],Lt.answerOption,Dn);if(pn)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ht+1,error:pn});if(Lt.item&&Lt.item.length>0){const Ut=ce(Lt.item,dn,Lt.linkId,Ht,Dn);if(Ut)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ht+1,error:Ut})}}}return""},ce=(Lt,dn,cn,Dn,en)=>{var Ht,wn;for(const sn of Lt){if(!Ce(sn.enableWhen,sn.enableBehavior,dn,cn,Dn))continue;const pn=G(dn,cn),Ut=(Ht=pn?.item)==null?void 0:Ht.find(Dt=>Dt.linkId===sn.linkId),pt=(wn=Ut?.answer)!=null&&wn[Dn]?[Ut.answer[Dn]]:void 0;if(sn.required){if(!pt||!pt[0]||!de(pt[0]))return z(en,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:sn.text||sn.linkId});const Dt=le(sn.extension,sn.type,!0,sn.maxLength,pt,sn.answerOption,en);if(Dt)return`${sn.text||sn.linkId}: ${Dt}`}else if(pt&&pt[0]&&de(pt[0])){const Dt=le(sn.extension,sn.type,!1,sn.maxLength,pt,sn.answerOption,en);if(Dt)return`${sn.text||sn.linkId}: ${Dt}`}if(sn.item&&sn.item.length>0){const Dt=ce(sn.item,dn,sn.linkId,Dn,en);if(Dt)return Dt}}return""},de=Lt=>!Lt||Object.keys(Lt).length===0?!1:Object.values(Lt).some(dn=>dn!=null&&dn!==""&&(Array.isArray(dn)?dn.length>0:!0)),le=(Lt,dn,cn,Dn,en,Ht,wn)=>{var sn,pn,Ut,pt,Dt;let jt="";const Mn=!!Lt?.find(Or=>{var Dr,ro;return Or.url===m.gD&&((ro=(Dr=Or.valueCodeableConcept)==null?void 0:Dr.coding)==null?void 0:ro.some(pi=>pi.system===m.n4&&pi.code===m.GI))}),nn=en?.[0],yn={choice:((sn=nn?.valueCoding)==null?void 0:sn.code)||(nn?.valueString&&Ht?.some(Or=>Or.valueString===nn.valueString)?nn.valueString:null),"open-choice":((pn=nn?.valueCoding)==null?void 0:pn.code)||nn?.valueString,boolean:nn?.valueBoolean,string:nn?.valueString,text:nn?.valueString,url:nn?.valueUri,integer:nn?.valueInteger,decimal:nn?.valueDecimal,dateTime:nn?.valueDateTime,date:nn?.valueDate,time:nn?.valueTime,quantity:(Ut=nn?.valueQuantity)==null?void 0:Ut.value,reference:(pt=nn?.valueReference)==null?void 0:pt.display,attachment:(Dt=nn?.valueAttachment)==null?void 0:Dt.title};if(!(dn in yn))return"";const Yn=yn[dn],kr={required:()=>cn&&(Yn==null||Yn===""||Yn==="NaN"||Number.isNaN(Yn)||dn==="boolean"&&Yn!==!0&&Mn)?z(wn,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Dn&&Yn!==null&&Yn!==void 0&&Yn.toString().length>Dn?z(wn,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Dn}):"",minLength:()=>{const Or=I("minLength",Lt);return Or&&Yn!==null&&Yn!==void 0&&Yn.toString().length<Number(Or)?z(wn,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Or}):""},urlRegex:()=>{const Or=new RegExp(m.rx),Dr=I("regexError",Lt),ro=Dr??z(wn,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Or&&dn==="url"&&Yn&&!Or.test(Yn)?String(ro):""},regex:()=>{const Or=I("regex",Lt);if(!Or||typeof Yn!="string")return"";const Dr=new RegExp(Or),ro=I("regexError",Lt),pi=ro??z(wn,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Dr&&Yn&&!Dr.test(Yn)?String(pi):""},dateTime:()=>{if(dn==="dateTime"&&Yn){const Or=Yn?.toString(),Dr=new Date(Or);return isNaN(Dr.getTime())?z(wn,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(dn!=="date"||!Yn)return"";const Or=Yn.replace(/\D/g,"");return Or.length>0&&Or.length<8||isNaN(new Date(Yn).getTime())?z(wn,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Or;if(dn==="date"){const ro=U(m.dU,Lt),pi=X(ro??"01/01/1900","01/01/1900"),Io=X(Yn,"");if(!pi||!Io)return"";if((0,s.A)(Io,pi)){const Xo=(Or=Lt?.find($o=>$o.url===m.Ck))==null?void 0:Or.valueString;return Xo??z(wn,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:ro??"01/01/1900"})}return""}const Dr=I("minValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn<Dr?z(wn,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Dr}):""},maxValue:()=>{var Or;if(dn==="date"){const ro=U(m.bK,Lt),pi=X(ro??"01/01/2100","01/01/2100"),Io=X(Yn,"");if(!pi||!Io)return"";if((0,o.A)(Io,pi)){const Xo=(Or=Lt?.find($o=>$o.url===m.Cx))==null?void 0:Or.valueString;return Xo??z(wn,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:ro??"01/01/2100"})}return""}const Dr=I("maxValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn>Dr?z(wn,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Dr}):""}};return jt=kr.required()||kr.maxLength()||kr.minLength()||kr.urlRegex()||kr.regex()||kr.dateTime()||kr.date()||kr.minValue()||kr.maxValue()||"",jt},te=(Lt,dn)=>{for(const cn of dn)if(cn.item){if(cn.item.find(Ht=>Ht.linkId===Lt.linkId))return cn;const en=te(Lt,cn.item);if(en)return en}return null},ee=(Lt,dn)=>{if(Lt.answer&&Lt.answer.length>1)return!0;if(Lt.item){const cn=Lt.item.find(Dn=>Dn.linkId===dn.linkId);if(cn&&cn.answer&&cn.answer.length>1)return!0}return!1},ge=(Lt,dn,cn,Dn,en)=>{var Ht,wn;const{required:sn}=Lt,pn=(Ht=Dn.item)==null?void 0:Ht.find(Dt=>Dt.linkId===Lt.linkId),Ut=pn?.answer||[],pt=((wn=Dn.answer)==null?void 0:wn.length)||1;for(let Dt=0;Dt<pt;Dt++){const jt=Ut[Dt];if(sn){if(!jt||!de(jt))return z(en,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Dt+1,error:z(en,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Lt.text||Lt.linkId})});const Mn=le(Lt.extension,Lt.type,!0,Lt.maxLength,[jt],Lt.answerOption,en);if(Mn)return z(en,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Dt+1,error:Mn})}else if(jt&&de(jt)){const Mn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[jt],Lt.answerOption,en);if(Mn)return z(en,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Dt+1,error:Mn})}}return""},xe=(Lt,dn)=>{for(const cn of Lt){if(cn?.linkId===dn)return cn;if(cn?.item&&cn.item.length>0){const Dn=xe(cn.item,dn);if(Dn)return Dn}}},Ie=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ht.code===FOOTER_CODE))}))},Se=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===m.oA&&cn.valueBoolean))},De=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ht.code===HEADER_CODE))}))},ze=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===m.gD&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===m.n4&&Ht.code===m._l))}))},We=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&cn.valueBoolean))},ot=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,en;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((en=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:en.some(Ht=>Ht.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ht.code===CHECKBOX_CODE))}))},ht=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.fe);return cn?.valueInteger},At=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.zO);return cn?.valueInteger},Tt=Lt=>{var dn;const cn=(dn=Lt?.extension)==null?void 0:dn.find(Dn=>Dn.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return cn?.valueInteger},Yt=(Lt,dn,cn,Dn,en,Ht)=>{const wn=pn=>dn.filter(Ut=>Ut.linkId===pn),sn=new Set;return Lt.map(pn=>{if(sn.has(pn.linkId)||Ie(pn))return null;const pt=wn(pn.linkId),Dt=pn.type==="group"&&pn.repeats;if(sn.add(pn.linkId),Dt){const jt=[];if(pt.forEach((Mn,nn)=>{const yn={linkId:pn.linkId,text:pn.text};let Yn;if(cn===pn.linkId&&typeof Ht=="number"&&Ht===nn&&en&&en.length>0){const kr=Mn?.item||[];Yn=[...kr],en.forEach(Or=>{const Dr=Yn.findIndex(ro=>ro.linkId===Or.linkId);Dr>=0?Yn[Dr]=A(v({},kr[Dr]),{answer:Or.answer}):Yn.push(Or)})}else pn.item&&(Yn=Yt(pn.item,Mn?.item||[],cn,Dn,en,nn));cn===pn.linkId&&typeof Ht=="number"&&Ht===nn&&Dn?yn.answer=Dn:yn.answer=Mn.answer||[{}],Yn&&Yn.length>0?yn.item=Yn:Mn.item&&(yn.item=Mn.item),jt.push(yn)}),cn===pn.linkId&&typeof Ht=="number"&&Ht>=pt.length)for(let Mn=pt.length;Mn<=Ht;Mn++){const nn={linkId:pn.linkId,text:pn.text,answer:Mn===Ht&&Dn?Dn:[{}]};Mn===Ht&&en&&en.length>0?nn.item=en:pn.item&&(nn.item=Yt(pn.item,[],void 0,void 0,void 0,void 0)),jt.push(nn)}return jt}else if(pn.repeats&&typeof Ht=="number"&&cn===pn.linkId){const jt=pt[0]||{linkId:pn.linkId,text:pn.text,answer:[]},Mn={linkId:pn.linkId,text:pn.text,answer:[...jt.answer||[]]};if(Dn&&Dn.length>0){for(;Mn.answer.length<=Ht;)Mn.answer.push({});Mn.answer[Ht]=Dn[0]}return Mn}else{const jt=pt[0],Mn=pn.item?Yt(pn.item,jt?.item||[],cn,Dn,en,Ht):void 0,nn=Mn&&Mn.length>0,yn={linkId:pn.linkId,text:pn.text};return cn&&pn.linkId===cn&&typeof Ht!="number"?(Dn||!Dn&&!en?yn.answer=Dn:jt?.answer&&(yn.answer=jt.answer),en?yn.item=en:nn&&(yn.item=Mn)):(jt?.answer?yn.answer=jt.answer:yn.answer=[{}],nn&&(yn.item=Mn)),yn}}).filter(Boolean).flat()},St=(Lt,dn)=>{for(const cn of Lt)if(cn.linkId===dn||cn.item&&St(cn.item,dn))return cn.linkId;return null},Ze=(Lt,dn,cn,Dn)=>{var en;const Ht=(en=Lt?.item)!=null?en:Dn;return!Ht||Ht.length===0?!0:Ht.every(wn=>{var sn;const pn=ie(dn,wn.linkId);if(pn.length===0){const Ut=(sn=G(dn,wn.linkId))==null?void 0:sn.answer;if(se(wn,dn,Ut)&&ve(wn.enableWhen,wn.enableBehavior,dn)&&cn.includes(wn.linkId))return!1}else for(const Ut of pn)if(se(wn,dn,Ut.answer)&&ve(wn.enableWhen,wn.enableBehavior,dn)&&cn.includes(wn.linkId))return!1;return wn.item?Ze(wn,dn,cn):!0})},Ke=(Lt,dn,cn=!0)=>{for(const Dn of Lt)if(Dn.linkId===dn&&Dn.answer&&Dn.answer.length>0||Dn.item&&Dn.item.length>0&&Ke(Dn.item,dn,cn))return!0;return!1},It=(Lt,dn,cn=0)=>{const Dn=Lt.filter(en=>en.linkId===dn);if(Dn.length>cn){const en=Dn[cn];if(en.answer&&en.answer.length>0)return en.answer.some(Ht=>Ht&&Object.keys(Ht).length>0&&Object.values(Ht).some(wn=>wn!=null&&wn!==""));if(en.item&&en.item.length>0)return Ke(en.item,dn,!1)}return Ke(Lt,dn,!1)},nt=(Lt,dn)=>{if(!Lt||!Lt.item)return!1;const cn=Dn=>{var en;if(Se(Dn)&&Dn.required&&ve(Dn.enableWhen,Dn.enableBehavior,dn)){const Ht=G(dn,Dn.linkId),wn=le(Dn.extension,Dn.type,Dn.required,Dn.maxLength,Ht?.answer,Dn.answerOption);if(!((en=Ht?.answer)!=null&&en.length)||wn)return!0}if(Dn.item){for(const Ht of Dn.item)if(cn(Ht))return!0}return!1};for(const Dn of Lt.item)if(cn(Dn))return!0;return!1},et=Lt=>{var dn,cn,Dn;if(Lt.valueString!==void 0)return Lt.valueString;if(Lt.valueBoolean!==void 0)return Lt.valueBoolean;if(Lt.valueInteger!==void 0)return Lt.valueInteger;if(Lt.valueDecimal!==void 0)return Lt.valueDecimal;if(Lt.valueDate!==void 0)return Lt.valueDate;if(Lt.valueDateTime!==void 0)return Lt.valueDateTime;if(((dn=Lt.valueCoding)==null?void 0:dn.code)!==void 0)return Lt.valueCoding.code;if(((cn=Lt.valueReference)==null?void 0:cn.reference)!==void 0)return Lt.valueReference.reference;if(((Dn=Lt.valueQuantity)==null?void 0:Dn.value)!==void 0)return Lt.valueQuantity.value;if(Lt.valueAttachment!==void 0)return Lt.valueAttachment},Zt=Lt=>{const dn={linkId:Lt.linkId};if(Lt.answer&&Lt.answer.length>0){const cn=Lt.answer.map(Dn=>et(Dn)).filter(Dn=>Dn!==void 0);cn.length>0&&(dn.answer=cn)}if(Lt.item&&Lt.item.length>0){const cn=Lt.item.map(Dn=>Zt(Dn)).filter(Dn=>{const en=Object.keys(Dn);return en.length>1||en.length===1&&en[0]!=="linkId"});cn.length>0&&(dn.item=cn)}return dn},xn=(Lt,dn,cn,Dn,en,Ht)=>{var wn;const sn=(wn=dn?.item)==null?void 0:wn[cn[Dn]],pn=sn?.linkId;if(!pn)return!1;const Ut=ie(Lt,pn),pt=ie(en,pn),Dt=jt=>{if(jt!=null){if(Array.isArray(jt)){const Mn=jt.filter(nn=>nn!=null).map(nn=>Dt(nn)).filter(nn=>nn!==void 0);return Mn.length===0||Mn.length===1&&typeof Mn[0]=="object"&&Object.keys(Mn[0]).length===0?void 0:Mn}if(typeof jt=="object"){const Mn={};for(const[nn,yn]of Object.entries(jt))if(yn!=null){const Yn=Dt(yn);Yn!==void 0&&(Mn[nn]=Yn)}return Object.keys(Mn).length===0?void 0:Mn}return jt}};if(Ut.length!==pt.length)return!1;for(let jt=0;jt<Ut.length;jt++){const Mn=Ut[jt],nn=pt[jt];if(!Mn||!nn)return!1;const yn=Zt(Dt(Mn)),Yn=Zt(Dt(nn));if(!_.isEqual(yn,Yn))return!1}return Dn!==Ht},An=(Lt,dn,cn,Dn)=>cn&&cn.length>0&&!(cn.length===1&&Object.keys(cn[0]).length===0)&&se(Lt,dn,cn,Dn)||null,at=(Lt,dn,cn)=>{const Dn={},en=Ht=>{Ht.forEach(wn=>{const sn=ie(dn,wn.linkId);if(Oe(wn,Lt)||wn.repeats)for(let pn=0;pn<sn.length;pn++){const Ut=sn[pn];if(Ut?.answer&&Ut.answer.length>0){const pt=An(wn,dn,Ut.answer,cn);pt&&(Dn[wn.linkId]=A(v({},Dn[wn.linkId]),{[pn]:pt}))}}else{const pn=G(dn,wn.linkId);if(pn?.answer&&pn.answer.length>0){const Ut=An(wn,dn,pn.answer,cn);Ut&&(Dn[wn.linkId]={0:Ut})}}wn.item&&wn.item.length>0&&en(wn.item)})};return en(Lt),Dn},Wt=Lt=>{if(!Lt)return"";const dn=Lt.split("-");if(dn.length===3){const[cn,Dn,en]=dn;return`${cn.slice(-4)}-${Dn}-${en}`}return""},Bt=Lt=>Lt.trim().replace(/[A-Za-z]+/g,""),On=(Lt,dn)=>{const cn=(Dn,en)=>{for(const Ht of Dn){if(Ht.linkId===en)return Ht.answer;if(Ht.item&&Ht.item.length>0){const wn=cn(Ht.item,en);if(wn!==void 0)return wn}}};return cn(Lt,dn)},Xn=(Lt,dn)=>{if(!dn||dn.length===0)return null;const cn=Lt.linkId,Dn=(en,Ht,wn=[])=>{for(const sn of en){const pn=[...wn,sn];if(sn.item){if(sn.item.some(Dt=>Dt.linkId===Ht))return pn.some(Dt=>Dt.repeats===!0)?sn:null;if(Dn(sn.item,Ht,pn))return sn}}return null};return Dn(dn,cn)},on=(Lt,dn)=>{if(!dn||dn.length===0)return!1;const cn=Lt.linkId,Dn=(en,Ht,wn=[])=>{for(const sn of en){const pn=[...wn,sn];if(sn.item){if(sn.item.some(Dt=>Dt.linkId===Ht))return pn.some(Dt=>{const jt=x(Dt.extension||[]);return!!jt&&jt!==UI_TOOLKIT_FORM_CONTAINER});if(Dn(sn.item,Ht,pn))return!0}}return!1};return Dn(dn,cn)},Ln=(Lt,dn,cn)=>{const Dn={};if(!Lt)return Dn;const{linkId:en}=dn;if(Lt[en]){const Ht=Lt[en];Dn[en]=Ht[cn]||""}return dn.item&&dn.item.length>0&&dn.item.forEach(Ht=>{if(Lt[Ht.linkId]){const wn=Lt[Ht.linkId];Dn[Ht.linkId]=wn[cn]||""}}),Dn},nr=(Lt,dn)=>{const cn={};if(!Lt||!Lt[dn])return cn;const Dn=Lt[dn];return cn[dn]=Dn[0]||"",cn},In=Lt=>{const dn=Lt.findIndex(Ht=>!Se(Ht)),cn=dn>=0?[dn]:[],Dn=new Map;let en=null;if(Lt.forEach((Ht,wn)=>{const sn=ze(Ht);if(sn&&Ht.type==="group")wn!==dn&&cn.push(wn),Dn.set(wn,[wn]),en=wn;else if(en!==null&&!sn){const pn=Dn.get(en)||[];Dn.set(en,[...pn,wn])}}),Lt.length>0&&cn.length>0){const Ht=cn[0];if(!Dn.has(Ht)){const wn=cn.find(pn=>pn>Ht),sn=[];for(let pn=Ht;pn<(wn??Lt.length);pn++)sn.push(pn);Dn.set(Ht,sn)}}return{groupIndices:cn,itemsToRenderMap:Dn}},Ur=(Lt,dn,cn,Dn)=>{let en=[...Dn];const Ht=(wn,sn)=>{wn.forEach(pn=>{if((!pn?.enableWhen||ve(pn?.enableWhen,pn.enableBehavior,sn))&&pn.initial&&!Ke(sn,pn.linkId))if(pn.repeats){const Ut=sn.filter(pt=>pt.linkId===pn.linkId);Ut.length>0?Ut.forEach((pt,Dt)=>{It(sn,pn.linkId,Dt)||(en=Yt(cn,en,pn.linkId,pn.initial,void 0,Dt))}):en=Yt(cn,en,pn.linkId,pn.initial)}else en=Yt(cn,en,pn.linkId,pn.initial);pn.item&&Ht(pn.item,sn)})};return Ht(Lt,dn),en},$r=(Lt,dn,cn)=>{if(!Lt)return[];const Dn=[],en=Ht=>{Ht.required===dn&&ve(Ht.enableWhen,Ht.enableBehavior,cn)&&!Se(Ht)&&Ht.type!=="display"&&Dn.push(Ht),Ht.item&&Ht.item.length>0&&Ht.item.forEach(en)};return Lt.forEach(en),Dn},Pt=(Lt,dn)=>Lt.every(cn=>{var Dn;const en=ie(dn,cn.linkId);if(en.length>0)return en.every(Ht=>!se(cn,dn,Ht.answer));{const Ht=(Dn=G(dn,cn.linkId))==null?void 0:Dn.answer;return!se(cn,dn,Ht)}}),Fe=(Lt,dn)=>{let cn=-1;for(let Dn=Lt.length-1;Dn>=0;Dn--)if(Lt[Dn].linkId===dn){cn=Dn;break}return cn},rt=(Lt,dn)=>Lt.filter(cn=>cn.linkId!==dn).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:rt(cn.item,dn)}):cn),Ye=(Lt,dn,cn=Lt)=>Lt.reduce((Dn,en)=>{const Ht=xe(dn,en.linkId);return Ht?.enableWhen&&!ve(Ht.enableWhen,Ht.enableBehavior,cn)||(en.item&&en.item.length>0?Dn.push(A(v({},en),{item:Ye(en.item,dn,cn)})):Dn.push(en)),Dn},[]),Qe=(Lt,dn,cn=[])=>{const Dn=[],en=Ht=>{Ht.forEach(wn=>{Dn.push(wn.linkId),wn.item&&wn.item.length>0&&en(wn.item)})};for(let Ht=0;Ht<Lt.length;Ht++){const wn=Lt[Ht];if(wn.linkId===dn){const sn=Lt.slice(0,Ht+1),pn=Lt.slice(Ht+1),{kept:Ut,removed:pt}=pn.reduce((Dt,jt)=>{const Mn=xe(cn,jt.linkId);return!Mn||Se(Mn)&&ve(Mn.enableWhen,Mn.enableBehavior,sn)?Dt.kept.push(jt):Dt.removed.push(jt),Dt},{kept:[],removed:[]});return en(pt),{trimmedData:[...sn,...Ut],trimmedLinkIds:Dn,found:!0}}if(wn.item&&wn.item.length>0){const sn=Qe(wn.item,dn,cn);if(sn.found){const pn=Lt.slice(0,Ht),Ut=Lt.slice(Ht+1),pt=[...pn,A(v({},wn),{item:sn.trimmedData})],{kept:Dt,removed:jt}=Ut.reduce((Mn,nn)=>{const yn=xe(cn,nn.linkId);return!yn||Se(yn)&&ve(yn.enableWhen,yn.enableBehavior,pt)?Mn.kept.push(nn):Mn.removed.push(nn),Mn},{kept:[],removed:[]});return en(jt),{trimmedData:[...pt,...Dt],trimmedLinkIds:[...sn.trimmedLinkIds,...Dn],found:!0}}}}return{trimmedData:Lt,trimmedLinkIds:[],found:!1}},Je=(Lt,dn)=>Lt.filter(cn=>!dn.includes(cn.linkId)).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:Je(cn.item,dn)}):cn),lt=Lt=>{var dn;if(!Lt)return"empty";const cn=m.Z$.find(({patterns:Dn})=>Dn.some(en=>Lt.includes(en)));return(dn=cn?.type)!=null?dn:"empty"},Ct=(Lt,dn)=>{const{groupIndices:cn}=In(Lt),Dn=Lt.findIndex(en=>en.linkId===dn);return Dn!==-1?cn.indexOf(Dn):-1},st=Lt=>{if(!Lt)return{restriction:null,warning:null};const dn=cn=>{const Dn=Lt.find(Ht=>Ht.url===cn&&Ht.valueString);if(!Dn?.valueString)return null;const en=Dn.valueString.replace(/\\n/g,`
|
|
870
870
|
`).split(`
|
|
871
871
|
`).map(Ht=>Ht.trim()).filter(Boolean).map(Ht=>Ht.startsWith("*")?Ht.substring(1).trim():Ht);return en.length===0?null:en.length===1?{isList:!1,items:en}:{isList:!0,items:en}};return{restriction:dn("restriction"),warning:dn("warning")}},ue=(Lt,dn)=>{var cn;switch(dn.type){case"boolean-to-string":return typeof Lt=="boolean"?Lt?dn.trueValue:dn.falseValue:Lt;case"map":return dn.mapping&&Lt in dn.mapping?dn.mapping[Lt]:Lt;case"date-format":return Lt;case"number-format":if(typeof Lt=="number"){let Dn=Lt.toFixed((cn=dn.decimals)!=null?cn:0);return dn.prefix&&(Dn=dn.prefix+Dn),dn.suffix&&(Dn=Dn+dn.suffix),Dn}return Lt;case"passthrough":default:return Lt}},Oe=(Lt,dn)=>{const cn=Lt.linkId,Dn=(Ht,wn,sn=[])=>{for(const pn of Ht){const Ut=[...sn,pn];if(pn.item){if(pn.item.some(jt=>jt.linkId===wn))return Ut.filter(jt=>jt.repeats===!0);const Dt=Dn(pn.item,wn,Ut);if(Dt.length>0)return Dt}}return[]},en=Dn(dn,cn);return en.length>0?en[en.length-1]:null},Ve=(Lt,dn)=>{if(!Lt?.item)return[];const cn=[];for(const Dn of Lt.item){if(Dn.type!=="group")continue;ve(Dn.enableWhen,Dn.enableBehavior,dn||[])&&Dn.linkId&&cn.push(Dn.linkId)}return cn},Te=(Lt,dn)=>{const cn=Ve(Lt,dn||void 0);return cn[cn.length-1]},xt=({questionnaire:Lt,extensionUrl:dn,errorCode:cn})=>{if(!cn||!Lt?.item)return;const Dn=Lt.item.find(en=>{var Ht;return(Ht=en.extension)==null?void 0:Ht.some(wn=>wn.url===dn&&wn.valueString===cn)});return Dn?.linkId},Kt=(Lt,dn)=>{var cn;const Dn=(cn=Lt.extension)==null?void 0:cn.find(Ht=>Ht.url===m.rb);if(!Dn?.valueString)return;const en=Dn.valueString;return xe(dn,en)},Cn=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===m.rb))},qn=(Lt,dn)=>Lt.filter(cn=>cn.linkId!==dn).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:qn(cn.item,dn)}):cn),Sr=Lt=>{const dn=I(ANALYTICS_FORM_NAME_EXTENSION_URL,Lt.extension);return dn??$(Lt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Ft=Lt=>I(ANALYTICS_EVENT_NAME_EXTENSION_URL,Lt.extension),we=Lt=>I(ANALYTICS_PAGE_NAME_EXTENSION_URL,Lt.extension),Xe=Lt=>I(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,Lt.extension),Et=Lt=>I(ANALYTICS_OPTION_NAME_EXTENSION_URL,Lt),Vt=(Lt,dn)=>{var cn,Dn,en;if(!Lt.answerOption)return;const Ht=G(dn,Lt.linkId),wn=(en=(Dn=(cn=Ht?.answer)==null?void 0:cn[0])==null?void 0:Dn.valueCoding)==null?void 0:en.code;if(!wn)return;const sn=Lt.answerOption.find(pn=>{var Ut;return((Ut=pn.valueCoding)==null?void 0:Ut.code)===wn});if(!!sn)return Et(sn.extension)},Qt=(Lt,dn)=>{const cn={},Dn=en=>{if(!!en)for(const Ht of en){const wn=Xe(Ht);if(wn){let sn;switch(Ht.type){case"choice":sn=Vt(Ht,dn);break;default:break}sn&&(cn[wn]=sn)}Ht.item&&Ht.item.length>0&&Dn(Ht.item)}};return Dn(Lt.item),cn},tn=Lt=>!!(Lt.initial&&Lt.initial.length>0),jn=(Lt,dn,cn,Dn)=>{if(!Lt)return[];const en=[],Ht=wn=>{wn.forEach(sn=>{if(cn&&cn.includes(sn.linkId)||Dn&&sn.enableWhen&&!ve(sn.enableWhen,sn.enableBehavior,Dn))return;const pn=Se(sn),Ut=dn.includes(sn.linkId);(Ut||pn&&sn.required)&&en.push(sn),Ut&&sn.item&&sn.item.length>0&&Ht(sn.item)})};return Ht(Lt),en},Vr=(Lt,dn,cn,Dn,en,Ht)=>{var wn;if(cn<0||!Dn?.item)return!0;const sn=en.current[cn],pn=cn+1,Ut=en.current[pn],pt=cn===0?0:sn,Dt=Ut??Dn.item.length,jt=[];for(let kr=pt;kr<Dt;kr++){const Or=(wn=Dn?.item)==null?void 0:wn[kr];if(Or){if(Ht&&Ht.includes(Or.linkId)||Or.enableWhen&&!ve(Or.enableWhen,Or.enableBehavior,Lt))continue;const Dr=Se(Or);(dn.includes(Or.linkId)||Dr&&Or.required)&&jt.push(Or),Or.item&&Or.item.length>0&&jt.push(...jn(Or.item,dn,Ht,Lt))}}const Mn=jt.filter(kr=>kr.required===!0),nn=jt.filter(kr=>kr.required!==!0),yn=Pt(Mn,Lt),Yn=nn?.every(kr=>{var Or;const Dr=(Or=G(Lt,kr.linkId))==null?void 0:Or.answer;return Dr?!se(kr,Lt,Dr):!0});return!Mn?.length||yn&&Yn}},32957:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(44738),s=e(36087),o=e(8322),a=e(1053),i=e(25624);const b=({item:Qn})=>{const Hr=Qn.text||"",qr=Qn.extension||[],Vi=_0=>{var $0;return($0=qr.find(L0=>L0.url===_0))==null?void 0:$0.valueString},Fi=Vi(a.$7),Bi=Vi(a.pc)||"default";return(0,n.jsx)(s.AlertFloating,{title:Hr,description:Fi??"",color:Bi})};var c=e(7630),u=e(16212),y=Object.defineProperty,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(Qn,Hr,qr)=>Hr in Qn?y(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,g=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))p.call(Hr,qr)&&O(Qn,qr,Hr[qr]);if(m)for(var qr of m(Hr))d.call(Hr,qr)&&O(Qn,qr,Hr[qr]);return Qn};const M=({item:Qn})=>{const[Hr,qr]=(0,t.useState)(!1),Vi=Qn.extension||[],Fi=ln=>{var _n;return(_n=Vi.find(dr=>dr.url===ln))==null?void 0:_n.valueString},Bi=Fi(a.PS)||Qn.text||"",_0=Fi(a.Iz)||"button",$0=Fi(a.VF),L0=Fi(a.PV),V0=Fi(a.vf),f0=V0?a.JP[V0]:void 0,Y0=Fi(a.D_)||"",Ma=Fi(a.$e),Lr=Fi(a.GQ),ar=Fi(a.qT)||"gray",hr=Fi(a.hZ),Pe=Fi(a.wG),Ee=Fi(a.q3),$e=Lr?a.JP[Lr]:void 0,vt=()=>qr(!0),Gt=()=>{switch(_0){case"icon-button":return(0,n.jsxs)("button",{onClick:vt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Bi||Y0||void 0,children:[f0&&(0,n.jsx)(f0,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Bi&&(0,n.jsx)("span",{className:"text-sm",children:Bi})]});default:return(0,n.jsx)(s.Button,{color:$0??"secondary",size:L0??"md",iconLeading:f0,onClick:vt,"aria-label":Bi,children:Bi})}};return(0,n.jsxs)(n.Fragment,{children:[Gt(),(0,n.jsx)(s.Modal,g(g(g({id:`modal-${Qn.linkId}`,isOpen:Hr,onOpenChange:qr,title:{content:Y0},description:{content:Ma?(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(Ma)}}):void 0},closeButton:{onCloseClick:()=>qr(!1)}},$e?{featuredIcon:{icon:$e,color:ar,size:"lg",className:"bg-white"}}:{}),hr?{primaryButton:{children:hr,onClick:()=>{var ln,_n;Pe==="open-zendesk"&&((_n=(ln=globalThis.zE)==null?void 0:ln.activate)==null||_n.call(ln,{hideOnClose:!0})),qr(!1)}}}:{}),Ee?{secondaryButton:{children:Ee,onClick:()=>qr(!1)}}:{}))]})};var h=e(18522);const f=({item:Qn})=>{var Hr,qr,Vi,Fi,Bi,_0,$0,L0,V0,f0,Y0,Ma;const{hasExternalError:Lr}=(0,h.c)(),ar=Qn.text||"",hr=(qr=(Hr=Qn.extension)==null?void 0:Hr.find(Tr=>Tr.url===a.ao))==null?void 0:qr.valueString,Pe=Lr&&hr?hr:ar,Ee=(Fi=(Vi=Qn.extension)==null?void 0:Vi.find(Tr=>Tr.url===a.$7))==null?void 0:Fi.valueString,$e=(_0=(Bi=Qn.extension)==null?void 0:Bi.find(Tr=>Tr.url===a.el))==null?void 0:_0.valueString,vt=Lr&&$e?$e:Ee,Gt=(L0=($0=Qn.extension)==null?void 0:$0.find(Tr=>Tr.url===a.g4))==null?void 0:L0.valueString,ln=(f0=(V0=Qn.extension)==null?void 0:V0.find(Tr=>Tr.url===a.Fp))==null?void 0:f0.valueString,_n=Gt?a.JP[Gt]:void 0,dr=ln?a.JP[ln]:void 0,zn=Lr&&dr?dr:_n,tr=((Ma=(Y0=Qn.extension)==null?void 0:Y0.find(Tr=>Tr.url===a.WS))==null?void 0:Ma.valueString)===a._W.LEFT,gn=tr?"items-start":"items-center",gr=tr?"text-left":"text-center",vr=tr?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${gn} gap-4`,children:[zn&&(0,n.jsx)(s.FeaturedIcon,{icon:zn,color:Lr&&dr?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${gn} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${gr} ${vr} md:max-w-[352px]`,children:Pe}),(0,n.jsx)("p",{className:`text-md text-secondary ${gr}`,children:vt})]})]})};var v=e(15297),A=e(17814),z=Object.defineProperty,x=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,C=(Qn,Hr,qr)=>Hr in Qn?z(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,E=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))T.call(Hr,qr)&&C(Qn,qr,Hr[qr]);if(x)for(var qr of x(Hr))S.call(Hr,qr)&&C(Qn,qr,Hr[qr]);return Qn};const R=({item:Qn})=>{const[Hr,qr]=(0,t.useState)(!1),Vi=(0,A.T$)(),Fi=Qn.extension||[],Bi=hr=>{var Pe;return(Pe=Fi.find(Ee=>Ee.url===hr))==null?void 0:Pe.valueString},_0=Qn.text||"",$0=Bi(a.PS)||"",L0=Bi(a.D_)||"",V0=Bi(a.$e),f0=Bi(a.GQ),Y0=Bi(a.qT)||"gray",Ma=Bi(a.hZ),Lr=Bi(a.q3),ar=f0?a.JP[f0]: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:_0})]}),$0&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>qr(!0),children:$0})]}),(0,n.jsx)(s.Modal,E(E(E({id:`modal-${Qn.linkId}`,isOpen:Hr,onOpenChange:qr,title:{content:L0},description:{content:V0?(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(V0)}}):void 0},closeButton:{onCloseClick:()=>qr(!1)}},ar?{featuredIcon:{icon:ar,color:Y0,size:"lg",className:"bg-white"}}:{}),Ma?{primaryButton:{children:Ma,onClick:()=>{qr(!1),Vi.navigate({id:"profile"})}}}:{}),Lr?{secondaryButton:{children:Lr,onClick:()=>qr(!1)}}:{}))]})},P=({item:Qn,selectedAnswer:Hr,handleInputChange:qr})=>{var Vi,Fi,Bi;const _0=(Vi=Qn.answerOption)!=null?Vi:[],$0=(Bi=(Fi=Hr?.[0])==null?void 0:Fi.valueCoding)==null?void 0:Bi.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:_0.map(L0=>{var V0,f0,Y0,Ma,Lr,ar,hr;const Pe=(f0=(V0=L0.valueCoding)==null?void 0:V0.code)!=null?f0:"",Ee=(Ma=(Y0=L0.valueCoding)==null?void 0:Y0.display)!=null?Ma:"",$e=$0===Pe,vt=(Lr=L0.extension)==null?void 0:Lr.find(dr=>dr.url===a.g4),Gt=(ar=L0.extension)==null?void 0:ar.find(dr=>dr.url===a.rz),ln=vt?.valueString?a.JP[vt.valueString]:void 0,_n=(hr=Gt?.valueString)!=null?hr:"";return(0,n.jsx)(s.SelectableOption,{icon:ln,title:Ee,description:_n,isSelected:$e,onSelect:()=>{qr(Qn,[{valueCoding:{code:Pe,display:Ee}}])}},Pe)})})};var L=e(72866),D=e(94043),N=e(94627);const w=({text:Qn,isLabel:Hr,required:qr,className:Vi,id:Fi})=>(0,n.jsxs)("p",{id:Fi,className:Vi??"mb-md text-md",children:[(0,n.jsx)(s.Content,{as:"span",className:(0,D.cx)(Hr&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,N.p)(Qn||"")}}),qr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),V="(###) ###-####",k=(Qn,Hr)=>{const qr=Qn.replace(/\D/g,"");let Vi="",Fi=0;for(let Bi=0;Bi<Hr.length&&Fi<qr.length;Bi++)Hr[Bi]==="#"?(Vi+=qr[Fi],Fi++):Vi+=Hr[Bi];return Vi},I=Qn=>{if(!Qn)return V;const Hr=Qn.find(qr=>qr.url===a.Md);return Hr?.valueString||V},q=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0})=>{var $0;const{linkId:L0,text:V0,required:f0,prefix:Y0,readOnly:Ma,extension:Lr}=Qn,ar=I(Lr),hr=(($0=qr?.[0])==null?void 0:$0.valueString)||"",[Pe,Ee]=(0,t.useState)("");(0,t.useEffect)(()=>{if(hr){const _n=k(hr,ar);Ee(_n)}},[hr,ar]);const $e=V0?(0,i.nt)(Fi,Y0,V0):"",vt=Bi?.[L0]||"",Gt=_n=>{const dr=k(_n,ar);Ee(dr),Vi(Qn,[{valueString:dr}])},ln=()=>{Hr&&Hr(L0)};return(0,n.jsxs)("div",{"data-testid":L0,children:[$e&&(0,n.jsx)(w,{isLabel:!0,text:$e,required:f0||!1}),(0,n.jsx)(s.Input,{id:L0,"aria-label":L0,"data-testid":L0,type:"tel",placeholder:"Enter phone number",value:Pe,onChange:Gt,onBlur:ln,isDisabled:Ma||_0,isRequired:f0,hint:vt,isInvalid:!!vt,size:"md"},L0)]})},U=({item:Qn,questionnaireSchemaItems:Hr})=>{var qr;const{isLoading:Vi,setCurrentGroupIndex:Fi}=(0,h.c)(),Bi=(qr=Qn.extension)==null?void 0:qr.find(V0=>V0.url===a.Uf),_0=Bi?.valueString,$0=Qn.text||"Save & continue",L0=()=>{if(_0){const V0=(0,i.Ue)(Hr||[],_0);V0!==-1&&Fi(V0)}};return(0,n.jsx)("div",{"data-testid":Qn.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(s.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Vi,onClick:L0,isDisabled:Qn.readOnly,children:$0})})},$=({size:Qn=24,color:Hr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Hr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));$.displayName="Passport";var X=e(56327);const G=({size:Qn=24,color:Hr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Hr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));G.displayName="UserCircle";var ie=e(14711);const ae=({size:Qn=24,color:Hr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Hr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));ae.displayName="Mail01";var re=e(31165),he=e(14449),ve=e(59931),Ce=e(27163);const ye=Qn=>{try{const Hr=Qn.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Hr)return Qn;const[,qr,Vi,Fi]=Hr;return new Date(Date.UTC(parseInt(qr),parseInt(Vi)-1,parseInt(Fi))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return Qn}},ne=Qn=>{try{if(Qn.includes("AM")||Qn.includes("PM"))return Qn;const Hr=Qn.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Hr)return Qn;const[,qr,Vi]=Hr,Fi=parseInt(qr),Bi=Fi>=12?"PM":"AM";return`${Fi%12||12}:${Vi} ${Bi}`}catch{return Qn}},se=(Qn,Hr,qr=v.d)=>{var Vi;const Fi=(Vi=Qn.extension)==null?void 0:Vi.find(Bi=>Bi.url===a.g4);return Fi?.valueString&&a.JP[Fi.valueString]?a.JP[Fi.valueString]:Qn.linkId&&Hr[Qn.linkId]?Hr[Qn.linkId]:qr},me={"appointment-review/first-name":$,"appointment-review/last-name":$,"appointment-review/dob":X.V,"appointment-review/gender":G,"appointment-review/phone":ie.b,"appointment-review/email":ae,"appointment-review/vaccines":s.Vaccine,"appointment-review/appointment-date":X.V,"appointment-review/appointment-time":re.z,"appointment-review/facility-name":s.HospitalBuilding,"appointment-review/facility-phone":ie.b,"appointment-review/facility-address":he.X},ce=["appointment-review/appointment-date"],de=["appointment-review/appointment-time"],le=["appointment-review/facility-phone"],te=["appointment-review/facility-address"],ee=["appointment-review/phone","appointment-review/facility-phone"],ge=({item:Qn,questionnaireSchemaItems:Hr})=>{var qr;const{setCurrentGroupIndex:Vi}=(0,h.c)(),{trackEvent:Fi}=(0,o.st)(),Bi=Qn.item||[];if(Bi.length===0)return null;const _0=(qr=Qn.extension)==null?void 0:qr.find(f0=>f0.url===a.Uf),$0=_0?.valueString,L0=()=>{if(Fi("edit_info_clicked",{section:Qn.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),$0){const f0=(0,i.Ue)(Hr||[],$0);f0!==-1&&Vi(f0)}},V0=Bi.map(f0=>{let Y0="";if(f0.initial&&f0.initial.length>0){const ar=f0.initial.map(hr=>{var Pe,Ee,$e,vt,Gt,ln,_n,dr;let zn=((Pe=hr.valueCoding)==null?void 0:Pe.display)||((Ee=hr.valueReference)==null?void 0:Ee.display)||hr.valueString||"";if(zn&&typeof zn=="string"){if(ce.includes(f0.linkId)){const tr=(Gt=(vt=($e=hr.valueReference)==null?void 0:$e.extension)==null?void 0:vt.find(gn=>gn?.url===a.zD||gn?.url===a.UZ))==null?void 0:Gt.valueCode;if(tr)try{zn=(0,ve.formatToTimeZone)(zn,"YYYY-MM-DD",{timeZone:tr})}catch{}zn=ye(zn)}else if(de.includes(f0.linkId)){const tr=(dr=(_n=(ln=hr.valueReference)==null?void 0:ln.extension)==null?void 0:_n.find(gn=>gn?.url===a.zD||gn?.url===a.UZ))==null?void 0:dr.valueCode;if(tr)try{zn=(0,ve.formatToTimeZone)(zn,"h:mm A",{timeZone:tr})}catch{zn=ne(zn)}else zn=ne(zn)}}return zn}).filter(Boolean);ar.length>1||f0.repeats&&ar.length>0?Y0=ar:ar.length===1&&(Y0=ar[0])}if(!Y0||Array.isArray(Y0)&&Y0.length===0)return null;let Ma;le.includes(f0.linkId)?Ma="phone":te.includes(f0.linkId)&&(Ma="address");let Lr;return ee.includes(f0.linkId)&&(Lr="phone"),{Icon:se(f0,me),label:f0.text||f0.linkId,value:Y0,linkType:Ma,displayType:Lr}}).filter(Boolean);return V0.length===0?null:(0,n.jsx)("div",{"data-testid":Qn.linkId,children:(0,n.jsx)(Ce.InfoCard,{title:Qn.text||"Details",infoDetails:V0,actionButtonText:$0&&"Edit info",onActionButtonClick:$0?L0:void 0})})},xe=({size:Qn=24,color:Hr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Hr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));xe.displayName="AlertTriangle";var Ie=e(18807);const Se=({item:Qn})=>{const{setHideFooterButton:Hr,incrementCustomErrorCount:qr,decrementCustomErrorCount:Vi,addErrorLinkId:Fi,removeErrorLinkId:Bi}=(0,h.c)();return(0,t.useEffect)(()=>(Hr(!0),qr(),Fi(Qn.linkId),()=>{Hr(!1),Vi(),Bi(Qn.linkId)}),[Hr,qr,Vi,Fi,Bi,Qn.linkId]),(0,n.jsx)("div",{"data-testid":Qn.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(s.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(s.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,Ie.p)(Qn.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(xe,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"fatal",success:"success"},ze=({item:Qn})=>{var Hr,qr,Vi,Fi;const{incrementCustomErrorCount:Bi,decrementCustomErrorCount:_0,addErrorLinkId:$0,removeErrorLinkId:L0,setHideFooterButton:V0}=(0,h.c)(),[f0,Y0]=(0,t.useState)(!1),Ma=(Hr=Qn.extension)==null?void 0:Hr.find($e=>$e.url===a.gi),Lr=(Vi=(qr=Ma?.valueCodeableConcept)==null?void 0:qr.coding)==null?void 0:Vi.find($e=>$e.system===a.tn),ar=Lr?.code||"error",hr=De[ar]||"error";(0,t.useEffect)(()=>{if(hr==="error")return Bi(),V0(!0),Y0(!0),()=>{_0(),V0(!1)};if(hr==="fatal")return Bi(),$0(Qn.linkId),V0(!0),Y0(!0),()=>{_0(),L0(Qn.linkId),V0(!1)};Y0(!0)},[hr]);const Pe=Lr?.display||"Error",Ee=(Fi=Qn.text)!=null?Fi:"";return f0?(0,n.jsx)("div",{"data-testid":Qn.linkId,children:(0,n.jsx)(s.InfoBanner,{type:hr==="fatal"?"error":hr,title:Pe,description:Ee})}):null};var We=e(65735);const ot=({configKey:Qn,customErrorConfigurations:Hr})=>{if(!Hr)return null;const qr=Hr[Qn];if(!qr)return null;const{icon:Vi,title:Fi,description:Bi,primaryButton:_0,secondaryButton:$0}=qr;return(0,n.jsx)(s.EmptyState,{className:"mt-5xl",title:Fi,description:Bi,featuredIconProps:{icon:Vi,color:"gray"},primaryButton:_0,secondaryButton:$0})},ht=10,At=({item:Qn,customErrorConfigurations:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0})=>{var $0,L0,V0,f0;const{trackEvent:Y0}=(0,o.st)(),{setHideFooterButton:Ma}=(0,h.c)(),{linkId:Lr,text:ar,required:hr,answerOption:Pe,prefix:Ee,readOnly:$e}=Qn,vt=Qn?.type==="reference",Gt=($0=qr?.map(ni=>{var Ui,mi;return vt?(Ui=ni.valueReference)==null?void 0:Ui.display:(mi=ni.valueCoding)==null?void 0:mi.code}).filter(ni=>ni!==void 0))!=null?$0:[],[ln,_n]=(0,t.useState)(Gt.length),dr=ar?(0,i.nt)(Fi,Ee,ar):"",zn=(V0=(L0=Qn.extension)==null?void 0:L0.find(ni=>ni.url===a.Z_))==null?void 0:V0.valueInteger,tr=(f0=Pe?.map(ni=>{var Ui,mi,t0,e0;return{value:vt?((Ui=ni.valueReference)==null?void 0:Ui.display)||"":((mi=ni.valueCoding)==null?void 0:mi.code)||"",label:vt?((t0=ni.valueReference)==null?void 0:t0.display)||"":((e0=ni.valueCoding)==null?void 0:e0.display)||"",valueReference:ni.valueReference}}))!=null?f0:[],gn=Bi?.[Lr],gr=tr.length>ht,vr=gr?tr.slice(0,ht):tr,Tr=gr?tr.slice(ht):[],mo=Tr.some(ni=>Gt?.includes(ni?.value)),[lo,qo]=(0,t.useState)(mo);if(!(Qn.answerOption&&Qn.answerOption.length>0))return Ma(!0),(0,n.jsx)(ot,{configKey:Qn.linkId,customErrorConfigurations:Hr});const ji=tr.filter(ni=>Gt?.includes(ni?.value)).map(ni=>{var Ui;const{restriction:mi,warning:t0}=vt?(0,i.eC)((Ui=ni.valueReference)==null?void 0:Ui.extension):{restriction:null,warning:null};return{label:ni.label,restriction:mi,warning:t0}}).filter(ni=>ni.restriction||ni.warning),Ii=(ni,Ui)=>{var mi;Y0("vaccine_type_checkbox_selected",{on_or_off:ni?"on":"off",vaccine:Ui,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let t0;if(ni){const e0=tr.find(ka=>ka.value===Ui);t0=[...(mi=qr?.filter(ka=>Object.keys(ka).length!==0))!=null?mi:[],vt?{valueReference:e0?.valueReference}:{valueCoding:{code:Ui,display:e0?.label}}],_n(ka=>ka+1)}else t0=qr?.filter(e0=>{var ka,k0;return vt?((ka=e0.valueReference)==null?void 0:ka.display)!==Ui:((k0=e0.valueCoding)==null?void 0:k0.code)!==Ui})||[{}],_n(e0=>e0-1);Vi&&Vi(Qn,t0)};return(0,n.jsxs)("div",{"data-testid":Lr,children:[dr&&(0,n.jsx)(w,{text:dr,required:hr||!1}),gr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:vr.map((ni,Ui)=>{const mi=Gt?.includes(ni?.value),t0=!mi&&zn?ln>=zn:!1;return(0,n.jsx)("div",{className:Ui!==vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":ni.value,id:Ui.toString(),name:ni.label,isInvalid:!!gn,isSelected:mi,label:ni.label,onChange:e0=>Ii(e0,ni.value),isDisabled:$e||_0||t0})},Ui)})}),gr&&!lo&&!mo&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(s.Button,{type:"button",onClick:()=>{qo(!0),Y0("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:$e||_0,children:"See all"})}),gr&&lo&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),gr&&lo&&(0,n.jsx)("div",{children:Tr.map((ni,Ui)=>{const mi=Gt?.includes(ni?.value),t0=!mi&&zn?ln>=zn:!1;return(0,n.jsx)("div",{className:Ui!==Tr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":ni.value,id:(ht+Ui).toString(),name:ni.label,isInvalid:!!gn,isSelected:mi,label:ni.label,onChange:e0=>Ii(e0,ni.value),isDisabled:$e||_0||t0})},ht+Ui)})}),(0,n.jsx)(s.HintText,{isInvalid:!!gn,children:gn}),ji.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:ji.map((ni,Ui)=>(0,n.jsxs)("div",{children:[ni.restriction&&(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Restriction] ${ni.label}`,description:ni.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:ni.restriction.items.map((mi,t0)=>(0,n.jsx)("li",{className:"text-sm",children:mi},t0))}):(0,n.jsx)("p",{className:"text-sm",children:ni.restriction.items[0]})}),ni.warning&&(0,n.jsx)("div",{className:ni.restriction?"mt-2":"",children:(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Warning] ${ni.label}`,description:ni.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:ni.warning.items.map((mi,t0)=>(0,n.jsx)("li",{className:"text-sm",children:mi},t0))}):(0,n.jsx)("p",{className:"text-sm",children:ni.warning.items[0]})})})]},Ui))})]})};var Tt=e(76323),Yt=e(56192),St=e(66267),Ze=Object.defineProperty,Ke=Object.defineProperties,It=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,xn=(Qn,Hr,qr)=>Hr in Qn?Ze(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,An=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))et.call(Hr,qr)&&xn(Qn,qr,Hr[qr]);if(nt)for(var qr of nt(Hr))Zt.call(Hr,qr)&&xn(Qn,qr,Hr[qr]);return Qn},at=(Qn,Hr)=>Ke(Qn,It(Hr)),Wt=(Qn,Hr,qr)=>new Promise((Vi,Fi)=>{var Bi=L0=>{try{$0(qr.next(L0))}catch(V0){Fi(V0)}},_0=L0=>{try{$0(qr.throw(L0))}catch(V0){Fi(V0)}},$0=L0=>L0.done?Vi(L0.value):Promise.resolve(L0.value).then(Bi,_0);$0((qr=qr.apply(Qn,Hr)).next())});const Bt=({item:Qn,handleInputChange:Hr,onCompleteHandler:qr,errors:Vi})=>{const{i18n:{t:Fi},loading:Bi}=(0,St.E_)({keys:["shared-translations","ui-toolkit-modern"]}),{trackEvent:_0}=(0,o.st)(),{linkId:$0,required:L0,readOnly:V0}=Qn,f0=Vi?.[$0]||"",[Y0,Ma]=(0,t.useState)(Tt.LocationType.CURRENT_LOCATION),[Lr,ar]=(0,t.useState)(""),hr=(0,t.useRef)({}),[Pe,Ee]=(0,t.useState)([{id:Tt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:Tt.LocationType.ADDRESS,label:"Address"},{id:Tt.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:$e,setIsLoading:vt,setIsCurrentFormValid:Gt,isCurrentFormValid:ln}=(0,h.c)(),{position:_n,loading:dr,locationPermission:zn}=(0,Tt.useDeviceLocationContext)(),{queryParams:tr,setQueryParams:gn}=(0,Tt.useSearchQueryParams)(),[gr,{loading:vr}]=(0,Yt.qtq)({fetchPolicy:"cache-first"}),[Tr,{loading:mo}]=(0,Yt.YyG)({fetchPolicy:"cache-first"}),lo=Qn.item?(0,i.Yo)(Qn.item,"postal-code"):void 0,qo=Qn.item?(0,i.Yo)(Qn.item,"state"):void 0,Hi=Qn.item?(0,i.Yo)(Qn.item,"latitude"):void 0,ji=Qn.item?(0,i.Yo)(Qn.item,"longitude"):void 0,Ii=i0=>{if(!i0||!lo)return ar(""),!1;const Ea=(0,i.zj)(lo.extension,lo.type,!1,lo.maxLength,[{valueString:i0}],void 0,Fi);return Ea?(ar(Y0!==Tt.LocationType.ZIP_CODE?Fi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ea),!1):(ar(""),!0)},ni=()=>{const{latitude:i0,longitude:Ea,state:cs,zipcode:q0}=hr.current;return!!(i0&&Ea&&cs&&q0)},Ui=(0,t.useCallback)(i0=>{hr.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},Qn.item&&(qo&&Hr(qo,[{valueString:""}]),Hi&&Hr(Hi,[{valueDecimal:void 0}]),ji&&Hr(ji,[{valueDecimal:void 0}]),lo&&Hr(lo,[{valueString:""}])),gn({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:i0,locationPermission:zn}),Gt&&Gt(!1),ar("")},[Hr,Qn.item,Hi,zn,ji,Gt,gn,qo,lo]);(0,t.useEffect)(()=>{if(!L0)return;!ni()&&Gt&&Gt(!1)},[ln,L0,Gt]);const mi=i0=>{hr.current=An(An({},hr.current),i0),i0.addressDescription&&_0("address_selected",{value:i0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),ka(hr.current.latitude,hr.current.longitude,hr.current.state,hr.current.zipcode,hr.current.placeId,hr.current.addressDescription)},t0=i0=>Wt(void 0,null,function*(){var Ea,cs,q0;if(ar(""),hr.current.zipcode=i0,Gt&&Gt(!1),Ii(i0)){_0("zip_code_entered",{value:i0,_event_metadata:{description:"A user entered a zip code."}});const B0=yield Tr({variables:{location:i0}}),si=(Ea=B0?.data)==null?void 0:Ea.geocoding,a0=B0?.error;if(si){const Mi=si.stateCode||"",Ka=(cs=si.latitude)!=null?cs:void 0,ki=(q0=si.longitude)!=null?q0:void 0;mi({latitude:Ka,longitude:ki,state:Mi,zipcode:i0,placeId:void 0,addressDescription:void 0})}else a0&&(mi({latitude:void 0,longitude:void 0,state:void 0,zipcode:i0,placeId:void 0,addressDescription:void 0}),ar(Fi("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else ka(hr.current.latitude,hr.current.longitude,hr.current.state,i0)}),e0=()=>{const i0=hr.current.zipcode||"";!i0||Y0!==Tt.LocationType.ZIP_CODE||Ii(i0)};(0,t.useEffect)(()=>{tr.locationType&&(Ma(tr.locationType),tr.locationType===Tt.LocationType.ZIP_CODE&&tr.zipCode&&t0(tr.zipCode),tr.locationType===Tt.LocationType.ADDRESS&&tr.placeId&&tr.addressDescription&&(hr.current.addressDescription=tr.addressDescription,hr.current.placeId=tr.placeId))},[]),(0,t.useEffect)(()=>{const i0=[Tt.LocationPermissionEnum.DENIED,Tt.LocationPermissionEnum.UNAVAILABLE,Tt.LocationPermissionEnum.BLOCKED].includes(tr.locationPermission),Ea=[Tt.LocationPermissionEnum.GRANTED,Tt.LocationPermissionEnum.PROMPT].includes(tr.locationPermission);if(i0&&Pe.length!==2){if(Ee([{id:Tt.LocationType.ADDRESS,label:"Address"},{id:Tt.LocationType.ZIP_CODE,label:"Zip code"}]),Y0===Tt.LocationType.CURRENT_LOCATION||!tr.locationType||tr.locationType===""){const cs=tr.locationType===Tt.LocationType.ZIP_CODE?Tt.LocationType.ZIP_CODE:Tt.LocationType.ADDRESS;Ma(cs),gn(at(An({},tr),{locationType:cs})),Ui(cs)}ar("")}Ea&&Pe.length!==3&&Ee([{id:Tt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:Tt.LocationType.ADDRESS,label:"Address"},{id:Tt.LocationType.ZIP_CODE,label:"Zip code"}])},[Y0,zn,Pe.length,tr,gn,Ui]);const ka=(i0,Ea,cs,q0,B0,si)=>{if(!Qn.item)return;qo&&Hr(qo,[{valueString:cs||""}]),Hi&&Hr(Hi,[{valueDecimal:i0}]),ji&&Hr(ji,[{valueDecimal:Ea}]),lo&&Hr(lo,[{valueString:q0||""}]),gn(at(An({},tr),{lat:String(i0),lng:String(Ea),location:`${i0},${Ea}`,zipCode:q0||"",placeId:B0||"",addressDescription:si||"",locationPermission:zn}));const a0=ni()&&Ii(q0||"");Gt&&Gt(a0),qr&&qr($0)};(0,t.useEffect)(()=>{const i0=()=>Wt(void 0,null,function*(){var Ea;try{const cs=yield gr({variables:{latitude:String(_n?.coords.latitude),longitude:String(_n?.coords.longitude)}}),q0=(Ea=cs?.data)==null?void 0:Ea.geocodingByLatLon,B0=q0?.stateCode||"",si=q0?.zipCode||"";(!si||!B0)&&ar(Fi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),mi({latitude:_n?.coords.latitude,longitude:_n?.coords.longitude,state:B0,zipcode:si,placeId:void 0,addressDescription:void 0})}catch{Ma(Tt.LocationType.ADDRESS)}});Y0===Tt.LocationType.CURRENT_LOCATION&&_n&&i0()},[Y0,_n]);const k0=i0=>{if(!i0||!i0.latitude||!i0.longitude||!i0.zipCode||!i0.stateCode){mi({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),i0&&typeof i0.value=="string"&&i0.value.trim().length!==0&&ar(Fi("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}mi({latitude:i0.latitude,longitude:i0.longitude,state:i0.stateCode,zipcode:i0.zipCode,placeId:i0.placeId,addressDescription:i0.description})};return(0,t.useEffect)(()=>{vt(dr||vr||mo||Bi)},[dr,vr,mo,Bi,vt]),(0,t.useEffect)(()=>{tr.locationType!==Y0&&gn(at(An({},tr),{locationType:Y0}))},[Y0]),(0,n.jsxs)("div",{"data-testid":Qn.linkId,children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:L0||!1}),(0,n.jsx)(s.Select,{id:$0,"aria-label":$0,"data-testid":$0,isDisabled:V0||vr||mo||$e,selectedKey:Y0,onSelectionChange:i0=>{var Ea;_0("location_type_input_selected",{choice:(Ea=Pe.find(({id:cs})=>cs===i0))==null?void 0:Ea.label,_event_metadata:{description:"A user changed the location type input."}}),i0!==Y0&&(Ui(i0),Ma(i0))},hint:f0,isInvalid:!!f0,items:Pe,placeholder:"Select an option",isRequired:L0,children:i0=>(0,n.jsx)(s.Select.Item,{id:i0.id,"data-testid":i0.id,value:i0,children:i0.label},i0.id)},$0),Y0===Tt.LocationType.CURRENT_LOCATION&&(0,n.jsx)(s.HintText,{isInvalid:!!Lr,children:Lr}),Y0===Tt.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:L0||!1}),(0,n.jsx)(Tt.AddressTypeahead,{onValueChange:k0,isDisabled:$e,setIsLoading:vt,initialValue:{placeId:hr.current.placeId||"",description:hr.current.addressDescription||""},errorText:Lr||f0})]}),Y0===Tt.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:L0||!1}),(0,n.jsx)(s.Input,{isRequired:L0,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${$0}-zipcode`,placeholder:"Type your response here...",value:hr.current.zipcode||"",onChange:t0,onBlur:e0,isDisabled:V0||mo||$e,hint:Lr||f0,isInvalid:!!Lr||!!f0,autoComplete:"postal-code"},`${$0}-zipcode`)]})]})},On=Qn=>(0,n.jsx)(Tt.DeviceLocationProvider,{children:(0,n.jsx)(Bt,An({},Qn))}),Xn={[a.cX]:On,[a.G6]:ge,[a.c3]:At,[a.AA]:ze,[a.mO]:f,[a.PM]:U,[a.HH]:q,[a.Us]:Se,[a.Tl]:P,[a.G0]:M,[a.m3]:b,[a.PU]:R,[a.XP]:c.l,[a.uH]:L.v,[a.it]:We.d};var on,Ln=new Uint8Array(16);function nr(){if(!on&&(on=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!on))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return on(Ln)}const In=/^(?:[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 Ur(Qn){return typeof Qn=="string"&&In.test(Qn)}const $r=Ur;for(var Pt=[],Fe=0;Fe<256;++Fe)Pt.push((Fe+256).toString(16).substr(1));function rt(Qn){var Hr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,qr=(Pt[Qn[Hr+0]]+Pt[Qn[Hr+1]]+Pt[Qn[Hr+2]]+Pt[Qn[Hr+3]]+"-"+Pt[Qn[Hr+4]]+Pt[Qn[Hr+5]]+"-"+Pt[Qn[Hr+6]]+Pt[Qn[Hr+7]]+"-"+Pt[Qn[Hr+8]]+Pt[Qn[Hr+9]]+"-"+Pt[Qn[Hr+10]]+Pt[Qn[Hr+11]]+Pt[Qn[Hr+12]]+Pt[Qn[Hr+13]]+Pt[Qn[Hr+14]]+Pt[Qn[Hr+15]]).toLowerCase();if(!$r(qr))throw TypeError("Stringified UUID is invalid");return qr}const Ye=rt;function Qe(Qn,Hr,qr){Qn=Qn||{};var Vi=Qn.random||(Qn.rng||nr)();if(Vi[6]=Vi[6]&15|64,Vi[8]=Vi[8]&63|128,Hr){qr=qr||0;for(var Fi=0;Fi<16;++Fi)Hr[qr+Fi]=Vi[Fi];return Hr}return Ye(Vi)}const Je=Qe,lt=(Qn,Hr="application/octet-stream")=>{try{const qr=window.atob(Qn),Vi=new Uint8Array(qr.length);for(let Bi=0;Bi<qr.length;Bi++)Vi[Bi]=qr.charCodeAt(Bi);return new Blob([Vi],{type:Hr}).size}catch{return 0}},Ct=(Qn,Hr)=>`data:${Hr};base64,${Qn}`,st=(Qn,Hr,qr=512)=>{const Vi=window.atob(Qn),Fi=[];for(let _0=0;_0<Vi.length;_0+=qr){const $0=Vi.slice(_0,_0+qr),L0=new Array($0.length);for(let f0=0;f0<$0.length;f0++)L0[f0]=$0.charCodeAt(f0);const V0=new Uint8Array(L0);Fi.push(V0)}const Bi=new Blob(Fi,{type:Hr});return URL.createObjectURL(Bi)},ue=Qn=>{const Hr=new Date().toISOString().replace(/[:.-]/g,"");return`${Qn.split(" ").join("-")}_${Hr}`},Oe=4e3,Ve=.8,Te=(Qn,Hr)=>{var qr,Vi;const Fi=(qr=Hr?.maxDimension)!=null?qr:Oe,Bi=(Vi=Hr?.quality)!=null?Vi:Ve;return new Promise((_0,$0)=>{if(!Qn.type.startsWith("image/")){_0(Qn);return}if(Qn.type==="image/heic"||Qn.type==="image/heif"||Qn.name.toLowerCase().endsWith(".heic")||Qn.name.toLowerCase().endsWith(".heif")){_0(Qn);return}const V0=new Image,f0=new FileReader;f0.onload=()=>{const Y0=f0.result;V0.onload=()=>{let{width:Ma,height:Lr}=V0;if(Ma>Fi||Lr>Fi){const $e=Fi/Math.max(Ma,Lr);Ma=Math.round(Ma*$e),Lr=Math.round(Lr*$e)}const ar=document.createElement("canvas");ar.width=Ma,ar.height=Lr;const hr=ar.getContext("2d");if(!hr){_0(Qn);return}hr.drawImage(V0,0,0,Ma,Lr);const Pe=Qn.type==="image/png"?"image/png":"image/jpeg",Ee=Qn.type==="image/png"?void 0:Bi;ar.toBlob($e=>{if(!$e||$e.size>=Qn.size){_0(Qn);return}_0(new File([$e],Qn.name,{type:Pe}))},Pe,Ee)},V0.onerror=()=>{$0(new Error(`Failed to load image: ${Qn.name}`))},V0.src=Y0},f0.onerror=()=>{$0(new Error(`Failed to read file: ${Qn.name}`))},f0.readAsDataURL(Qn)})},xt=50,Kt=(Qn,Hr=xt)=>{if(Qn.length<=Hr)return Qn;const qr=Qn.lastIndexOf("."),Vi=qr!==-1?Qn.slice(qr):"",Fi=qr!==-1?Qn.slice(0,qr):Qn,Bi=Hr-Vi.length-1,_0=Math.ceil(Bi/2),$0=Math.floor(Bi/2);return`${Fi.slice(0,_0)}\u2026${Fi.slice(-$0)}${Vi}`};var Cn=Object.defineProperty,qn=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Et=(Qn,Hr,qr)=>Hr in Qn?Cn(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,Vt=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))we.call(Hr,qr)&&Et(Qn,qr,Hr[qr]);if(Ft)for(var qr of Ft(Hr))Xe.call(Hr,qr)&&Et(Qn,qr,Hr[qr]);return Qn},Qt=(Qn,Hr)=>qn(Qn,Sr(Hr)),tn=(Qn,Hr,qr)=>new Promise((Vi,Fi)=>{var Bi=L0=>{try{$0(qr.next(L0))}catch(V0){Fi(V0)}},_0=L0=>{try{$0(qr.throw(L0))}catch(V0){Fi(V0)}},$0=L0=>L0.done?Vi(L0.value):Promise.resolve(L0.value).then(Bi,_0);$0((qr=qr.apply(Qn,Hr)).next())});const jn=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0})=>{const{linkId:$0,text:L0,required:V0,prefix:f0,readOnly:Y0,repeats:Ma,extension:Lr}=Qn,ar=(0,i.Qr)(Lr),hr=(0,i.cz)(Lr),Pe=(0,i.$H)(Lr)||"image/*,.pdf,.doc,.docx",Ee=L0?(0,i.nt)(Fi,f0,L0):"",$e=Bi?.[$0]||"",[vt,Gt]=(0,t.useState)([]),ln=(0,t.useRef)(qr||[]);(0,t.useEffect)(()=>{qr&&(ln.current=qr)},[qr]),(0,t.useEffect)(()=>{qr?.length&&Gt(gr=>{const vr=gr.filter(mo=>mo.isLoading||mo.failed);return[...qr.filter(mo=>mo.valueAttachment).map((mo,lo)=>{var qo,Hi,ji,Ii,ni;const Ui=((qo=mo.valueAttachment)==null?void 0:qo.title)||`attachment-${lo}`,mi=(Hi=mo.valueAttachment)==null?void 0:Hi.id,t0=gr.find(k0=>mi&&k0.id===mi||!mi&&k0.id===`existing-${lo}`),e0=(ji=mo.valueAttachment)==null?void 0:ji.data,ka=e0?lt(e0,(Ii=mo.valueAttachment)==null?void 0:Ii.contentType):0;return{id:mi||t0?.id||`existing-${lo}`,name:Ui,size:t0?.size||ka,progress:100,failed:!1,type:(0,i.J4)((ni=mo.valueAttachment)==null?void 0:ni.contentType),isLoading:!1}}),...vr]})},[qr]);const _n=gr=>{let vr=Array.from(gr);if(hr!==void 0){const mo=hr-vt.length;if(mo<=0)return;vr=vr.slice(0,mo)}const Tr=vr.map(mo=>{const lo=mo.name.replace(/\s+/g,"-");return{id:Je(),name:lo,size:mo.size,progress:0,type:(0,i.J4)(mo.type),failed:!1,isLoading:!0}});Gt(mo=>[...mo,...Tr]),Tr.forEach(mo=>{const lo=vr.find(qo=>qo.name.replace(/\s+/g,"-")===mo.name);lo&&dr(lo,mo.id)})},dr=(gr,vr)=>tn(void 0,null,function*(){try{const Tr=yield Te(gr);if(ar&&Tr.size>ar){const Ii=parseFloat((ar/1e6).toFixed(1));Gt(ni=>ni.map(Ui=>Ui.id===vr?Qt(Vt({},Ui),{isLoading:!1,failed:!0,disableRetry:!0,errorMessage:`File size exceeds ${Ii} MB limit`}):Ui));return}const mo=yield gn(Tr),lo=Tr.name.replace(/\s+/g,"-");Gt(Ii=>Ii.map(ni=>ni.id===vr?Qt(Vt({},ni),{isLoading:!1,progress:100,failed:!1}):ni));const qo={valueAttachment:{id:vr,contentType:Tr.type,data:mo,title:lo}},ji=[...(ln.current||[]).filter(Ii=>Ii.valueAttachment||Object.keys(Ii).length>0),qo];ln.current=ji,Vi(Qn,ji),Hr($0)}catch{Gt(mo=>mo.map(lo=>lo.id===vr?Qt(Vt({},lo),{isLoading:!1,failed:!0}):lo))}}),zn=gr=>{const vr=vt.find(Tr=>Tr.id===gr);if(Gt(Tr=>Tr.filter(mo=>mo.id!==gr)),vr){const Tr=(ln.current||[]).filter((mo,lo)=>{var qo;if(gr.startsWith("existing-")){const Hi=parseInt(gr.replace("existing-",""));return lo!==Hi}return((qo=mo.valueAttachment)==null?void 0:qo.id)!==gr}).filter(mo=>mo.valueAttachment||Object.keys(mo).length>0);ln.current=Tr,Vi(Qn,Tr.length>0?Tr:[{}])}},tr=gr=>{const vr=vt.find(Tr=>Tr.id===gr);if(vr){Gt(mo=>mo.map(lo=>lo.id===gr?Qt(Vt({},lo),{failed:!1,isLoading:!0,progress:0}):lo));const Tr=new File([""],vr.name,{type:"application/octet-stream"});dr(Tr,gr)}},gn=gr=>new Promise((vr,Tr)=>{const mo=new FileReader;mo.onload=()=>{const qo=mo.result.split(",")[1];vr(qo)},mo.onerror=Tr,mo.readAsDataURL(gr)});return(0,n.jsxs)("div",{children:[Ee&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ee,required:V0||!1}),(0,n.jsx)(s.FileUpload,{files:vt,onDropFiles:_n,onDeleteFile:zn,onRetryFile:tr,onDropUnacceptedFiles:()=>{},hint:(0,i.od)(Pe,ar,hr),accept:Pe,allowsMultiple:Ma!==!1,isDisabled:Y0||_0||hr!==void 0&&vt.length>=hr,className:"w-full",showDisclosureModal:!0}),$e&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:$e})]})},Vr=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0})=>{var $0,L0;const{linkId:V0,text:f0,prefix:Y0,readOnly:Ma,required:Lr,extension:ar}=Qn,{trackQuestionnaireEvent:hr}=(0,h.c)(),Pe=f0?(0,i.nt)(Fi,Y0,f0):"",Ee=Bi?.[V0];return ar?.find(vt=>{var Gt,ln;return vt.url===a.gD&&((ln=(Gt=vt.valueCodeableConcept)==null?void 0:Gt.coding)==null?void 0:ln.some(_n=>_n.system===a.n4&&_n.code===a.GI))})?(0,n.jsxs)("div",{"data-testid":V0,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":V0,children:[(0,n.jsx)(s.Checkbox,{size:"md",id:V0,name:V0,isDisabled:Ma||_0,isSelected:($0=qr?.[0])==null?void 0:$0.valueBoolean,"aria-label":V0,label:"",className:"mt-1",onChange:vt=>{hr(Qn.linkId,{value:vt}),Vi(Qn,[{valueBoolean:vt}]),Hr(Qn.linkId)}}),Pe&&(0,n.jsx)(w,{isLabel:!0,text:Pe,required:Lr||!1})]}),(0,n.jsx)(s.HintText,{isInvalid:!!Ee,children:Ee})]}):(0,n.jsxs)("div",{"data-testid":V0,children:[Pe&&(0,n.jsx)(w,{isLabel:!0,text:Pe,required:Lr||!1}),(0,n.jsxs)(s.RadioGroup,{size:"md",id:V0,name:V0,"aria-label":V0,value:String((L0=qr?.[0])==null?void 0:L0.valueBoolean)||"",onChange:vt=>{Vi(Qn,[{valueBoolean:vt==="true"}]),Hr(Qn.linkId)},isInvalid:!!Ee,children:[(0,n.jsx)(s.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Ma||_0}),(0,n.jsx)(s.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Ma||_0})]},V0),Ee&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Ee})})]})};var Lt=Object.defineProperty,dn=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,en=(Qn,Hr,qr)=>Hr in Qn?Lt(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,Ht=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))cn.call(Hr,qr)&&en(Qn,qr,Hr[qr]);if(dn)for(var qr of dn(Hr))Dn.call(Hr,qr)&&en(Qn,qr,Hr[qr]);return Qn};const wn=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0,f0,Y0;const{linkId:Ma,text:Lr,required:ar,answerOption:hr,prefix:Pe,readOnly:Ee}=Qn,$e=Lr?(0,i.nt)(Fi,Pe,Lr):"",vt=hr?.map(_n=>{var dr,zn,tr,gn;return{id:((dr=_n.valueCoding)==null?void 0:dr.code)||_n.valueString||"",label:((zn=_n.valueCoding)==null?void 0:zn.display)||_n.valueString||"",value:((tr=_n.valueCoding)==null?void 0:tr.code)||_n.valueString||"",extension:_n.extension||[],system:((gn=_n.valueCoding)==null?void 0:gn.system)||void 0}})||[],Gt=((f0=(V0=qr?.[0])==null?void 0:V0.valueCoding)==null?void 0:f0.code)||((Y0=qr?.[0])==null?void 0:Y0.valueString)||"",ln=Bi?.[Ma];return(0,n.jsxs)("div",{children:[$e&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:$e,required:ar||!1}),(0,n.jsx)(s.Select,{id:Ma,"aria-label":Ma,"data-testid":Ma,isDisabled:Ee||_0,selectedKey:Gt,onSelectionChange:_n=>{const dr=String(_n),zn=vt.find(gr=>gr.value===dr),tr=zn?zn.label:"",gn=Boolean(hr?.find(gr=>gr.valueString===dr));Vi(Qn,[gn?{valueString:dr}:{valueCoding:Ht({code:dr,display:tr},zn?.system?{system:zn.system}:{}),extension:zn?.extension||[]}]),Hr(Qn.linkId)},isInvalid:!!ln,hint:ln||L0,items:vt,placeholder:$0,isRequired:ar,children:_n=>(0,n.jsx)(s.Select.Item,{id:_n.id,"data-testid":_n.value,value:_n.value,children:_n.label},_n.id)},Ma)]})};var sn=Object.defineProperty,pn=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,Dt=(Qn,Hr,qr)=>Hr in Qn?sn(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,jt=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))Ut.call(Hr,qr)&&Dt(Qn,qr,Hr[qr]);if(pn)for(var qr of pn(Hr))pt.call(Hr,qr)&&Dt(Qn,qr,Hr[qr]);return Qn};const Mn=Qn=>{var Hr,qr,Vi;const{item:Fi,selectedAnswer:Bi,updatedText:_0,required:$0,errorMessage:L0}=Qn,V0=Fi?.type==="reference",f0=(Hr=Bi?.map(hr=>{var Pe,Ee;return V0?(Pe=hr.valueReference)==null?void 0:Pe.display:(Ee=hr.valueCoding)==null?void 0:Ee.code}).filter(hr=>hr!==void 0))!=null?Hr:[],[Y0,Ma]=(0,t.useState)(f0.length),Lr=(Vi=(qr=Fi.extension)==null?void 0:qr.find(hr=>hr.url===a.Z_))==null?void 0:Vi.valueInteger,ar=(hr,Pe)=>{var Ee,$e,vt;let Gt;if(hr){const ln=Qn.options.find(_n=>_n.value===Pe);Gt=[...($e=(Ee=Qn.selectedAnswer)==null?void 0:Ee.filter(_n=>Object.keys(_n).length!==0))!=null?$e:[],V0?{valueReference:ln?.valueReference}:{valueCoding:jt({code:Pe,display:ln?.label},ln?.system?{system:ln.system}:{}),extension:ln?.extension||[]}],Ma(_n=>_n+1)}else Gt=((vt=Qn.selectedAnswer)==null?void 0:vt.filter(ln=>{var _n,dr;return V0?((_n=ln.valueReference)==null?void 0:_n.display)!==Pe:((dr=ln.valueCoding)==null?void 0:dr.code)!==Pe}))||[{}],Ma(ln=>ln-1);Qn.handleInputChange(Qn.item,Gt)};return(0,n.jsxs)("div",{"data-testid":Fi.linkId,children:[_0&&(0,n.jsx)(w,{isLabel:!0,text:_0,required:$0||!1}),(0,n.jsx)("div",{children:Qn.options.map((hr,Pe)=>(0,n.jsx)(s.Checkbox,{size:"md","data-testid":hr.value,id:Pe.toString(),className:Pe!==Qn.options.length-1?"mb-2xl":"",name:hr.label,isInvalid:!!L0,isSelected:f0?.includes(hr?.value),label:hr.label,onChange:Ee=>ar(Ee,hr.value),isDisabled:Qn.readOnly||Qn.isLoading||(!f0?.includes(hr?.value)&&Lr?Y0>=Lr:!1)},Pe))}),(0,n.jsx)(s.HintText,{isInvalid:!!L0,children:L0})]})},nn=({item:Qn,onCompleteHandler:Hr,updatedText:qr,options:Vi,handleInputChange:Fi,errorMessage:Bi,readOnly:_0,initialValue:$0,selectedAnswer:L0,isLoading:V0,required:f0})=>{var Y0,Ma;const Lr=`${Qn.linkId}-label`,ar=`${Qn.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":Qn.linkId,children:[qr&&(0,n.jsx)(w,{id:Lr,isLabel:!0,text:qr,required:f0||!1}),(0,n.jsx)(s.RadioGroup,{size:"md",id:Qn.linkId,name:Qn.linkId,"aria-labelledby":qr?Lr:void 0,"aria-describedby":Bi?ar:void 0,isRequired:f0,className:Vi.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Ma=(Y0=L0?.[0])==null?void 0:Y0.valueCoding)==null?void 0:Ma.code)||$0||"",onChange:hr=>{const Pe=hr,Ee=Vi.find(vt=>vt.value===Pe),$e=Ee?Ee.label:"";Fi(Qn,[{valueCoding:{code:Pe,display:$e,system:Ee?.system||void 0},extension:Ee?.extension||[]}]),Hr(Qn.linkId)},isInvalid:!!Bi,children:Vi.map(hr=>(0,n.jsx)(s.RadioButton,{size:"md","data-testid":hr.value,isDisabled:_0||V0,value:hr.value,label:hr.label},hr.value))},Qn.linkId),Bi&&(0,n.jsx)("div",{id:ar,children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Bi})})]})};var yn=Object.defineProperty,Yn=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Dr=(Qn,Hr,qr)=>Hr in Qn?yn(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,ro=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))kr.call(Hr,qr)&&Dr(Qn,qr,Hr[qr]);if(Yn)for(var qr of Yn(Hr))Or.call(Hr,qr)&&Dr(Qn,qr,Hr[qr]);return Qn};const pi=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0,f0,Y0,Ma,Lr;const{linkId:ar,text:hr,required:Pe,answerOption:Ee,prefix:$e,readOnly:vt}=Qn,Gt=Qn?.type==="reference",ln=hr?(0,i.nt)(Fi,$e,hr):"",dr=(()=>{var Tr,mo;const lo=Ee?.find(qo=>qo.initialSelected===!0);return lo?Gt?((Tr=lo.valueReference)==null?void 0:Tr.display)||"":((mo=lo?.valueCoding)==null?void 0:mo.code)||"":""})(),zn=(Ee?.map(Tr=>{var mo,lo,qo,Hi,ji;return{label:((mo=Tr?.valueCoding)==null?void 0:mo.display)||((lo=Tr?.valueReference)==null?void 0:lo.display)||"",value:Gt?((qo=Tr.valueReference)==null?void 0:qo.display)||"":((Hi=Tr.valueCoding)==null?void 0:Hi.code)||"",valueReference:Gt?Tr.valueReference:{},extension:Tr.extension||[],system:((ji=Tr.valueCoding)==null?void 0:ji.system)||""}})||[]).filter(Tr=>Tr.label),tr=Bi?.[ar],gn=(Lr=(Ma=(Y0=(f0=(V0=Qn?.extension)==null?void 0:V0.find(Tr=>Tr.url.includes("questionnaire-itemControl")))==null?void 0:f0.valueCodeableConcept)==null?void 0:Y0.coding)==null?void 0:Ma[0])==null?void 0:Lr.code;let gr=null;const vr={item:Qn,onCompleteHandler:Hr,updatedText:ln,options:zn,handleInputChange:Vi,errorMessage:tr,required:Pe,readOnly:vt,initialValue:dr,selectedAnswer:qr,isLoading:_0,showQuestionPrefix:Fi,placeholder:$0,hintText:L0};switch(gn){case"drop-down":gr=(0,n.jsx)(wn,ro({},vr));break;case"check-box":gr=(0,n.jsx)(Mn,ro({},vr));break;case"radio-button":gr=(0,n.jsx)(nn,ro({},vr));break}return(0,n.jsx)(n.Fragment,{children:gr})};var Io=e(8077),Xo=e(31936),$o=e(77806),ui=e(16681);const ir=Qn=>`${String(Qn.month).padStart(2,"0")}/${String(Qn.day).padStart(2,"0")}/${Qn.year}`,yr=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0,f0,Y0;const{linkId:Ma,text:Lr,required:ar,prefix:hr,readOnly:Pe}=Qn,Ee=(0,t.useRef)(null),[$e,vt]=(0,t.useState)(!1),[Gt,ln]=(0,t.useState)(null),{t:_n}=(0,r.SS)(),{setIsCurrentFormValid:dr,isCurrentFormValid:zn,trackQuestionnaireEvent:tr}=(0,h.c)(),gn=Lr?(0,i.nt)(Fi,hr,Lr):"",gr=Bi?.[Ma]||"",vr=(V0=Qn.extension)==null?void 0:V0.find(q0=>q0.url===a.dU),Tr=(f0=Qn.extension)==null?void 0:f0.find(q0=>q0.url===a.bK),mo=(0,t.useMemo)(()=>{var q0;const B0=vr?.valueString||vr?.valueDate;return B0||(0,i.iI)((q0=vr?.valueExpression)==null?void 0:q0.expression)},[vr]),lo=(0,t.useMemo)(()=>{var q0;const B0=Tr?.valueString||Tr?.valueDate;return B0||(0,i.iI)((q0=Tr?.valueExpression)==null?void 0:q0.expression)},[Tr]),qo=(0,t.useMemo)(()=>{if(mo&&/^\d{4}-\d{2}-\d{2}$/.test(mo))try{return(0,Io._U)(mo)}catch{}return(0,Io._U)("1900-01-01")},[mo]),Hi=(0,t.useMemo)(()=>{if(lo&&/^\d{4}-\d{2}-\d{2}$/.test(lo))try{return(0,Io._U)(lo)}catch(q0){console.warn("Failed to parse maxDateStr:",lo,q0)}return(0,Io._U)("2099-12-31")},[lo]),Ii=(q0=>{if(!q0)return"";const B0=q0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!B0)return q0;const[,si,a0,Mi]=B0;return`${a0}/${Mi}/${si}`})(((Y0=qr?.[0])==null?void 0:Y0.valueDate)||""),ni=q0=>{if(!q0)return"";const B0=q0.replace(/\D/g,"");if(B0.length===0)return"";if(B0.length<=2)return B0.length===2?`${B0}/`:B0;const si=Mi=>{const Ka=Mi.slice(0,2),ki=Mi.slice(2);return ki.length===2?`${Ka}/${ki}/`:`${Ka}/${ki}`},a0=Mi=>{const Ka=Mi.slice(0,2),ki=Mi.slice(2,4),Ua=Mi.slice(4,8);return`${Ka}/${ki}/${Ua}`};return B0.length<=4?si(B0):a0(B0)},Ui=()=>{if(Pe||_0)return;if(Ii.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const B0=(0,Io._U)(Ii);ln(B0)}catch{ln(null)}else{const B0=Ii.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(B0){const[,si,a0,Mi]=B0,Ka=parseInt(si,10),ki=parseInt(a0,10);if(Ka>=1&&Ka<=12&&ki>=1&&ki<=31)try{const Ua=(0,Io._U)(`${Mi}-${si}-${a0}`);ln(Ua)}catch{ln(null)}else ln(null)}else ln(null)}vt(!0)},mi=()=>{if(Gt){const q0=`${Gt.year}-${String(Gt.month).padStart(2,"0")}-${String(Gt.day).padStart(2,"0")}`;tr(Qn.linkId,{value:(0,i.CP)(`${String(Gt.month).padStart(2,"0")}/${String(Gt.day).padStart(2,"0")}/${Gt.year}`)}),Vi(Qn,[{valueDate:(0,i.Fy)(q0)}])}vt(!1),ln(null)},t0=()=>{vt(!1),ln(null)},e0=q0=>{var B0;const si=((B0=Ee.current)==null?void 0:B0.selectionStart)||0,a0=Ii,Mi=ni(q0),Ka=Mi.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Ka){const[,ki,Ua,qs]=Ka,Js=parseInt(ki,10),N1=parseInt(Ua,10),E1=parseInt(qs,10);if(ka(Js,N1,E1).isValid){const ta=`${qs}-${ki}-${Ua}`;tr(Qn.linkId,{value:(0,i.CP)(`${ki}/${Ua}/${qs}`)}),Vi(Qn,[{valueDate:(0,i.Fy)(ta)}])}else Vi(Qn,[{valueDate:Mi}])}else Vi(Qn,[{valueDate:Mi}]);setTimeout(()=>{if(Ee.current){const ki=a0.replace(/\D/g,""),Ua=Mi.replace(/\D/g,"");let qs=si;Mi===a0&&(qs=si-1),Ua.length>=ki.length&&Mi!==a0?Mi[si-1]==="/"?qs=si+1:qs=si:Ua.length<ki.length&&(a0[si-1]==="/"?qs=Math.max(0,si-1):qs=si),Ee.current.setSelectionRange(qs,qs)}},0)},ka=(q0,B0,si)=>{if(q0<1||q0>12)return{isValid:!1,error:(0,i.u0)(_n,ui.p.VALIDATION_MONTH_RANGE,"Month must be between 01 and 12")};if(B0<1||B0>31)return{isValid:!1,error:(0,i.u0)(_n,ui.p.VALIDATION_DAY_RANGE,"Day must be between 01 and 31")};const a0=new Date(si,q0,0).getDate();if(B0>a0)return{isValid:!1,error:(0,i.u0)(_n,ui.p.VALIDATION_INVALID_DAY_FOR_MONTH,"Invalid day for the selected month")};if(mo||lo){const Mi=new Xo.ng(si,q0,B0);if(mo&&/^\d{4}-\d{2}-\d{2}$/.test(mo))try{const Ka=(0,Io._U)(mo);if(Mi.compare(Ka)<0){const ki=(0,i.di)(a.Ck,Qn.extension);if(ki)return{isValid:!1,error:ki};const Ua=ir(Ka);return{isValid:!1,error:(0,i.u0)(_n,ui.p.VALIDATION_DATE_ON_OR_AFTER,"Date must be on or after {{minDate}}",{minDate:Ua})}}}catch{}if(lo&&/^\d{4}-\d{2}-\d{2}$/.test(lo))try{const Ka=(0,Io._U)(lo);if(Mi.compare(Ka)>0){const ki=(0,i.di)(a.Cx,Qn.extension);if(ki)return{isValid:!1,error:ki};const Ua=ir(Ka);return{isValid:!1,error:(0,i.u0)(_n,ui.p.VALIDATION_DATE_ON_OR_BEFORE,"Date must be on or before {{maxDate}}",{maxDate:Ua})}}}catch{}}return{isValid:!0,error:""}},k0=()=>{const q0=Ii.replace(/\D/g,"");if(q0.length>0&&q0.length<8){Hr(Qn.linkId);return}const B0=Ii.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!B0&&q0.length>=6){Hr(Qn.linkId);return}if(B0){const[,si,a0,Mi]=B0,Ka=parseInt(si,10),ki=parseInt(a0,10),Ua=parseInt(Mi,10);if(ka(Ka,ki,Ua).isValid){const qs=`${Mi}-${si}-${a0}`;Vi(Qn,[{valueDate:(0,i.Fy)(qs)}])}}Hr(Qn.linkId)},Ea=(()=>{if(!Ii)return"";const q0=Ii.replace(/\D/g,"");if(q0.length>0&&q0.length<8)return"";const B0=Ii.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!B0&&q0.length>=6)return zn&&dr(!1),(0,i.u0)(_n,ui.p.VALIDATION_INVALID_DATE,"Invalid date");if(B0){const[,si,a0,Mi]=B0,Ka=parseInt(si,10),ki=parseInt(a0,10),Ua=parseInt(Mi,10),{isValid:qs,error:Js}=ka(Ka,ki,Ua);if(!qs)return zn&&dr(!1),Js||(0,i.u0)(_n,ui.p.VALIDATION_INVALID_DATE,"Invalid date")}return""})(),cs=!!gr||!!Ea;return(0,n.jsxs)("div",{children:[gn&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:gn,required:ar||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Pe||_0,className:(0,D.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",(Pe||_0)&&"cursor-not-allowed opacity-50"),onClick:Ui,"aria-label":"Open calendar",children:(0,n.jsx)(X.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,D.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Pe||_0)&&"bg-disabled_subtle")}),(0,n.jsx)(s.Input,{ref:Ee,isRequired:ar,size:"md",type:"text",name:Ma,"data-testid":Ma,id:Ma,value:Ii,onChange:e0,placeholder:$0,isDisabled:Pe||_0,onBlur:k0,hint:Ea||gr||L0,isInvalid:cs,className:(0,D.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Ma)]}),(0,n.jsx)(s.Modal,{id:"calendar-date-picker-modal",isOpen:$e,onOpenChange:q0=>{q0||t0()},primaryButton:{children:"Apply",onClick:mi,isDisabled:!Gt},secondaryButton:{children:"Cancel",onClick:t0},children:(0,n.jsx)($o.lr,{value:Gt,onChange:ln,minValue:qo,maxValue:Hi,children:(0,n.jsx)(s.Calendar,{showDateInput:!1,minValue:qo,maxValue:Hi,onYearPickerOpen:()=>{ln(null)}})})})]})},Ir=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0})=>{var $0;const{linkId:L0,text:V0,required:f0,prefix:Y0,readOnly:Ma}=Qn,Lr=V0?(0,i.nt)(Fi,Y0,V0):"",ar=Bi?.[L0]||"";return(0,n.jsxs)("div",{children:[Lr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Lr,required:f0||!1}),(0,n.jsx)(s.Input,{isRequired:f0,size:"md",type:"datetime-local",id:L0,"aria-label":L0,"data-testid":L0,placeholder:"Type your response here...",value:(($0=qr?.[0])==null?void 0:$0.valueDateTime)||"",onChange:hr=>{let Pe=hr;const[Ee,$e]=Pe.split("T");Ee&&$e&&(Pe=`${(0,i.Fy)(Ee)}T${$e}:00`),Vi(Qn,[{valueDateTime:Pe}])},isDisabled:Ma||_0,onBlur:()=>{Hr(Qn.linkId)},hint:ar,isInvalid:!!ar},L0)]})},zo=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0;const{linkId:f0,text:Y0,required:Ma,prefix:Lr,readOnly:ar}=Qn,hr=Y0?(0,i.nt)(Fi,Lr,Y0):"",Pe=Bi?.[f0]||"",Ee=(0,i.a0)(Qn),$e=(V0=qr?.[0])==null?void 0:V0.valueDecimal,[vt,Gt]=(0,t.useState)(String($e??""));return(0,t.useEffect)(()=>{Gt(String($e??""))},[$e]),(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(w,{isLabel:!0,text:hr,required:Ma||!1}),(0,n.jsx)(s.Input,{isRequired:Ma,size:"md",id:f0,"aria-label":f0,"data-testid":f0,placeholder:$0,value:vt,onChange:ln=>{Gt(ln)},isDisabled:ar||_0,onBlur:()=>{const ln=parseFloat(vt);Gt(isNaN(ln)?"":String(ln)),Vi(Qn,[{valueDecimal:isNaN(ln)?void 0:ln}]),Hr(Qn.linkId)},type:"number",hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},f0)]})},bo=({item:Qn,showStepper:Hr=!1})=>{var qr;const{text:Vi,linkId:Fi,type:Bi}=Qn,_0=Vi&&(0,i.nt)(!1,"",Vi),$0=(qr=Qn.extension)==null?void 0:qr.find(Y0=>Y0.url===a.Yt),L0=$0?.valueBoolean===!0,V0=Bi==="group"&&(0,i.$O)(Qn)!==void 0,f0=()=>{const Y0=(0,i.$O)(Qn),Ma=(0,i.t7)(Qn);if(Y0===void 0||Ma===void 0||Ma<=0)return[];const Lr=[];for(let ar=1;ar<=Ma;ar++){let hr="incomplete";ar<Y0?hr="complete":ar===Y0&&(hr="current"),Lr.push({title:"",description:"",status:hr})}return Lr};return _0&&!L0?(0,n.jsxs)("div",{"data-testid":Fi,children:[(0,n.jsx)(w,{text:_0,required:!1,className:""}),Hr&&V0&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(s.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:f0()})})]}):null},Oi=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0;const{linkId:f0,text:Y0,required:Ma,prefix:Lr,readOnly:ar}=Qn,hr=Y0?(0,i.nt)(Fi,Lr,Y0):"",Pe=Bi?.[f0]||"",Ee=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:hr,required:Ma||!1}),(0,n.jsx)(s.Input,{isRequired:Ma,"data-testid":f0,size:"md",id:f0,"aria-label":f0,placeholder:$0,value:String((V0=qr?.[0])==null?void 0:V0.valueInteger)||"",onChange:$e=>{Vi(Qn,[{valueInteger:Number($e)}])},isDisabled:ar||_0,onBlur:()=>{Hr(Qn.linkId)},type:"number",hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},f0)]})},Wi=({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0,f0,Y0;const{linkId:Ma,text:Lr,extension:ar,required:hr,prefix:Pe,readOnly:Ee}=Qn,$e=Lr?(0,i.nt)(Fi,Pe,Lr):"",vt=ar?.find(_n=>_n.url.includes("questionnaire-unitOption")),Gt=Bi?.[Ma],ln=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[$e&&(0,n.jsx)(w,{isLabel:!0,text:$e,required:hr||!1}),(0,n.jsx)(s.InputGroup,{isRequired:hr,size:"md",id:Ma,"aria-label":Ma,"data-testid":Ma,value:(V0=qr?.[0])!=null&&V0.valueQuantity?String((f0=qr[0].valueQuantity)==null?void 0:f0.value):"",onChange:_n=>{Vi(Qn,[{valueQuantity:{value:parseFloat(_n)}}])},isDisabled:Ee||_0,onBlur:()=>{var _n,dr,zn;const tr=(_n=qr?.[0])!=null&&_n.valueQuantity?parseFloat(String((zn=(dr=qr?.[0])==null?void 0:dr.valueQuantity)==null?void 0:zn.value)).toFixed(2):"";Vi(Qn,[{valueQuantity:{value:parseFloat(tr)}}]),Hr(Qn.linkId)},hint:Gt||L0,isInvalid:!!Gt,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:(Y0=vt?.valueCoding)==null?void 0:Y0.display}),children:(0,n.jsx)(s.InputBase,{type:"number",placeholder:$0,autoComplete:ln})},Ma)]})},_i={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},d0={[_i.CURRENT_LOCATION]:ui.p.CURRENT_LOCATION,[_i.ZIP_CODE]:ui.p.ZIP_CODE,[_i.ADDRESS]:ui.p.ADDRESS},J0={mi:{singular:ui.p.MILE,plural:ui.p.MILES}},R0=({resourceData:Qn,handleInputChange:Hr,item:qr,questionnaireSchemaItems:Vi})=>{var Fi;const{t:Bi}=(0,r.SS)(),{queryParams:_0}=(0,Tt.useSearchQueryParams)(),$0=_0.locationType||"",{setCurrentGroupIndex:L0,handleContinueButtonClick:V0,setHideFooterButton:f0}=(0,h.c)(),{trackEvent:Y0}=(0,o.st)();(0,t.useEffect)(()=>{if(!qr.readOnly)return f0(!0),()=>{f0(!1)}},[qr.readOnly,f0]);const Ma=(Fi=qr.extension)==null?void 0:Fi.find(dr=>dr.url===a.Uf),Lr=Ma?.valueString,ar=()=>{if(Lr){const dr=(0,i.Ue)(Vi||[],Lr);dr!==-1&&L0(dr)}},hr=dr=>{const zn=dr.find(tr=>tr.url.includes("description"));return zn?.valueString||""},Pe=dr=>{const zn=dr.find(mo=>mo.url.includes("distance-value")),tr=dr.find(mo=>mo.url.includes("distance-unit")),gn=zn?.valueString?Number(zn.valueString):NaN,gr=tr?.valueString||"";if(!gr||isNaN(gn))return null;const vr=Math.round(gn);let Tr=gr;return J0[gr]&&(Tr=Bi(vr===1?J0[gr].singular:J0[gr].plural)),$0&&d0[$0]?Bi(ui.p.LOCATION_DISTANCE,{distance:`${vr} ${Tr}`,locationType:Bi(d0[$0])}):Bi(ui.p.LOCATION_DISTANCE_AWAY,{distance:`${vr} ${Tr}`})},Ee=dr=>({id:dr.id||"",providerName:dr.name||"",specialty:"",distance:Pe(dr.extension||[])||"",placeholderIcon:s.WalgreensLogo,address:dr.address||"",valueReference:dr.valueReference||{reference:dr.id}}),$e=dr=>{var zn,tr,gn,gr;const vr=dr;return Ee({id:vr.id,name:(zn=vr.name)!=null?zn:"",address:(gr=(gn=(tr=vr?.address)==null?void 0:tr.line)==null?void 0:gn[0])!=null?gr:"",extension:vr?.extension,valueReference:{reference:vr.id}})},vt=dr=>Ee({id:dr?.reference,name:dr?.display,address:hr(dr?.extension||[]),extension:dr?.extension,valueReference:dr}),ln=(()=>Qn&&Array.isArray(Qn)&&Qn.length>0?Qn.map($e):qr.initial&&Array.isArray(qr.initial)&&qr.initial.length>0?qr.initial.map(dr=>vt(dr.valueReference)):qr.answerOption?qr.answerOption.map(dr=>vt(dr.valueReference)):[])(),_n=dr=>{Hr(qr,[{valueReference:dr}])};return(0,n.jsx)("div",{className:(0,s.cx)("gap-md flex flex-col",!qr.readOnly&&"pb-4xl"),children:qr.readOnly?ln.map(({address:dr,id:zn,providerName:tr,placeholderIcon:gn,distance:gr})=>(0,n.jsx)(Tt.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:gn},locationName:tr,address:dr,distance:gr,actionButtonText:Lr?"Change location":void 0,onActionButtonClick:Lr?ar:void 0},zn)):ln.map(({address:dr,id:zn,providerName:tr,placeholderIcon:gn,specialty:gr,valueReference:vr,distance:Tr})=>(0,n.jsx)(s.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:gn},providerName:{content:tr},specialty:{content:gr},location:{address:dr,distance:Tr},actionButton:{children:"Schedule appointment",onClick:()=>{Y0("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:dr,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),_n(vr),V0?.()}}},zn))})};var Ta=e(79079),X0=e(21886),g0=e(43915),Qi=e(36181),C0=e(37234),Na=e(65388),br=Object.defineProperty,or=Object.defineProperties,Zr=Object.getOwnPropertyDescriptors,Nr=Object.getOwnPropertySymbols,Vo=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Gn=(Qn,Hr,qr)=>Hr in Qn?br(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,xr=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))Vo.call(Hr,qr)&&Gn(Qn,qr,Hr[qr]);if(Nr)for(var qr of Nr(Hr))En.call(Hr,qr)&&Gn(Qn,qr,Hr[qr]);return Qn},uo=(Qn,Hr)=>or(Qn,Zr(Hr));const er={"ui-toolkit/LocationCard":R0,"ui-toolkit/TimeSlotSelection":({resourceData:Qn,item:Hr,handleInputChange:qr,selectedAnswer:Vi,questionnaireSchemaItems:Fi,formData:Bi,onCompleteHandler:_0})=>{var $0,L0;const{t:V0}=(0,Ta.S)(),{trackEvent:f0}=(0,o.st)(),{isLoading:Y0,setIsInlineNextQuestionTriggered:Ma}=(0,h.c)(),Lr=si=>{const a0=si.match(/^(\d{4}-\d{2}-\d{2})/);return a0?a0[1]:si},ar=(0,t.useCallback)(si=>{var a0;return(a0=si.find(Mi=>Mi?.url===a.zD||Mi?.url===a.UZ))==null?void 0:a0.valueCode},[]),hr=(0,t.useCallback)((si,a0)=>{const Mi=ar(a0);if(!Mi)return ne(si);try{return(0,ve.formatToTimeZone)(si,"h:mm A",{timeZone:Mi})}catch{return ne(si)}},[ar]),Pe=(0,t.useCallback)((si,a0)=>{const Mi=ar(a0);if(!Mi)return Lr(si);try{return(0,ve.formatToTimeZone)(si,"YYYY-MM-DD",{timeZone:Mi})}catch{return Lr(si)}},[ar]),Ee=si=>{const a0=si.match(/^(\d{4})-(\d{2})-(\d{2})/);if(a0){const[,Mi,Ka,ki]=a0;return new Date(parseInt(Mi),parseInt(Ka)-1,parseInt(ki))}return new Date},vt=(()=>{var si;if((si=Vi?.[0])!=null&&si.valueReference){const a0=Vi[0].valueReference,Mi=a0.display||"",Ka=Pe(Mi,a0.extension||[]);if(Ka)return{date:Ee(Ka),slotId:a0.reference||""}}return{date:new Date,slotId:""}})(),[Gt,ln]=(0,t.useState)(vt.date),[_n,dr]=(0,t.useState)(vt.slotId),[zn,tr]=(0,t.useState)(new Set),gn=(0,t.useMemo)(()=>new Xo.ng(Gt.getFullYear(),Gt.getMonth()+1,Gt.getDate()),[Gt]),gr=si=>({display:si.display||"",id:si.id||"",start:si.start||"",extension:Array.isArray(si.extension)?si.extension:[],identifier:Array.isArray(si.identifier)?si.identifier:[],type:si.type||""}),vr=si=>{var a0;return gr({display:(a0=si.start)!=null?a0:"",id:si.id,start:si.start,extension:si.extension,identifier:si.identifier})},Tr=si=>gr({display:si?.display||"",id:si?.reference,start:si?.display,extension:si?.extension,identifier:si?.identifier,type:si?.type}),mo=()=>{if(Array.isArray(Qn)&&Qn.length>0)return Qn.filter(si=>si.resourceType==="Appointment").map(vr);if(Hr.initial&&Array.isArray(Hr.initial)&&Hr.initial.length>0)return Hr.initial.map(si=>Tr(si.valueReference));if(Hr.answerOption)return Hr.answerOption.map(si=>Tr(si.valueReference))},lo=(0,t.useMemo)(()=>mo()||[],[Qn,Vi,Hr]),qo=(0,t.useMemo)(()=>{const si={};return lo.forEach(a0=>{if(a0.start&&a0.id){const Mi=Pe(a0.start,a0.extension);si[Mi]||(si[Mi]=[]),si[Mi].push({display:a0.display,id:a0.id,start:a0.start,extension:a0.extension})}}),si},[lo,Pe]),Hi=(0,t.useMemo)(()=>{const si=Object.keys(qo).sort(),a0=[];if(si.length===0)return a0.push(gn),zn.forEach(ki=>{const Ua=(0,g0.A)(ki);a0.push(new Xo.ng(Ua.getFullYear(),Ua.getMonth()+1,Ua.getDate()))}),a0;const Mi=(0,g0.A)(si[si.length-1]),Ka=new Xo.ng(Mi.getFullYear(),Mi.getMonth()+1,Mi.getDate());for(let ki=gn;ki.compare(Ka)<=0;ki=ki.add({days:1})){const Ua=`${ki.year}-${String(ki.month).padStart(2,"0")}-${String(ki.day).padStart(2,"0")}`;qo[Ua]||a0.push(ki)}if(!(0,i.mR)(Hr)){const ki=(0,X0.Ec)((0,X0.Xj)()).add({days:30});let Ua=Ka.add({days:1});for(;Ua.compare(ki)<=0;)a0.push(Ua),Ua=Ua.add({days:1})}return zn.forEach(ki=>{const Ua=(0,g0.A)(ki),qs=new Xo.ng(Ua.getFullYear(),Ua.getMonth()+1,Ua.getDate());a0.some(Js=>Js.year===qs.year&&Js.month===qs.month&&Js.day===qs.day)||a0.push(qs)}),a0},[qo,zn,gn,Hr]),ji=(0,t.useMemo)(()=>(0,i.mR)(Hr)?s.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Hr]),Ii=(0,t.useMemo)(()=>Object.keys(qo).map(si=>{const a0=(0,g0.A)(si);return new Xo.ng(a0.getFullYear(),a0.getMonth()+1,a0.getDate())}),[qo]),ni=(0,Qi.A)((0,C0.A)(Gt),"yyyy-MM-dd"),Ui=(0,t.useMemo)(()=>qo[ni]||[],[qo,ni]);(0,t.useEffect)(()=>{const si=Object.entries(qo).sort(([a0],[Mi])=>a0.localeCompare(Mi)).slice(0,3).reduce((a0,[Mi,Ka])=>uo(xr({},a0),{[`${Mi} ${ka}`]:Ka.map(ki=>{var Ua;return(0,Na.YX)({time:ki.start,timeZone:(0,i.lv)((Ua=Ui[0])==null?void 0:Ua.extension)}).time})}),{});f0("slots_returned",{Specialty:"Vaccines",first_three_days_slots:si,_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 mi=t.useRef(null),t0=t.useRef(null),e0=t.useRef(!1);(0,t.useEffect)(()=>{var si;const a0=Object.keys(qo).sort();a0.length===0||e0.current||(e0.current=!0,(si=Vi?.[0])!=null&&si.valueReference||ln((0,g0.A)(a0[0])))},[qo]),(0,t.useEffect)(()=>{var si;const a0=Object.keys(qo).sort();if(a0.length===0)return;const Ka=!(mi.current===null)&&JSON.stringify(mi.current)!==JSON.stringify(qo);if(mi.current=qo,!!Ka&&(tr(new Set),t0.current)){const ki=t0.current;if(!(((si=qo[ki])==null?void 0:si.length)>0)){const qs=new Set,Js=(0,g0.A)(ki),N1=(0,g0.A)(a0[0]);let E1=Js;for(;E1<N1;){const ta=(0,Qi.A)(E1,"yyyy-MM-dd");qs.add(ta),E1=new Date(E1),E1.setDate(E1.getDate()+1)}tr(qs),dr("")}t0.current=null}},[qo]);const ka=(0,t.useMemo)(()=>{const si=Ui[0];if(!si?.extension)return"";const a0=ar(si.extension);try{return(0,ve.formatToTimeZone)(new Date,"(z)",{timeZone:a0??""})}catch{return""}},[Ui,ar]),k0=(0,t.useMemo)(()=>{const si=V0(s.Translations.NEXT_AVAILABLE_APPOINTMENTS);return ka?`${si} ${ka}`:si},[V0,ka]),i0=(0,t.useMemo)(()=>{const si=(0,X0.Ec)((0,X0.Xj)()).add({days:ji}),a0=`${si.year}-${String(si.month).padStart(2,"0")}-${String(si.day).padStart(2,"0")}`,Ka=Object.keys(qo).sort().find(ki=>ki>ni&&ki<=a0);if(Ka){const ki=(0,g0.A)(Ka);return new Xo.ng(ki.getFullYear(),ki.getMonth()+1,ki.getDate())}return null},[qo,ni,ji]),Ea=()=>{if(i0){const si=i0.toDate((0,X0.Xj)());ln(si),dr("")}},cs=si=>{if(!si){dr(""),qr(Hr,void 0);return}dr(si.id);const a0=[{valueReference:{display:si.display,reference:si.id,extension:si.extension,identifier:si.identifier,type:si.type}}];qr(Hr,a0)},q0=si=>{var a0;if(!si||Y0||!e0.current)return;const Mi=Object.keys(qo).sort(),Ka=Mi[Mi.length-1],ki=Mi[0],Ua=`${si.year}-${String(si.month).padStart(2,"0")}-${String(si.day).padStart(2,"0")}`;if(Ka&&(Ua>Ka||ki&&Ua<ki)&&(0,i.mR)(Hr)&&Fi&&!Hi?.some(Js=>Js.compare(si)===0)){const Js=(0,i.yQ)(Hr,Fi);if(Js){t0.current=Ua;let N1="-06:00";if((a0=lo[0])!=null&&a0.start){const rl=lo[0].start.match(/([+-]\d{2}:\d{2})$/);rl&&(N1=rl[1])}const ta=[{valueDateTime:`${Ua}T23:59:59${N1}`}],nl=qr(Js,ta);qr(Hr,void 0,(0,i.Nw)(nl||Bi||[],Hr.linkId),void 0,!0),Ma(!0),_0(Js.linkId,!0,!0)}}const qs=si.toDate((0,X0.Xj)());ln(qs)},B0=si=>{if(!si)return;const a0=Ui.find(Mi=>Mi.id===si);f0("slot_selected",{Specialty:"Vaccines",time_slot:a0?(0,Na.YX)({time:a0.start,timeZone:(0,i.lv)(Ui[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."}}),cs(a0??null)};return(0,n.jsx)(s.TimeSlot,{onChange:q0,disabledDates:Hi,highlightedDates:Ii,loading:Y0,minValue:(0,X0.Ec)((0,X0.Xj)()),maxValue:(0,X0.Ec)((0,X0.Xj)()).add({days:ji}),value:gn,defaultValue:gn,appointmentSlots:{title:k0,onChange:B0,defaultValue:Vi&&((L0=($0=Vi[0])==null?void 0:$0.valueReference)==null?void 0:L0.reference)||void 0,value:_n||void 0,items:Ui.map(si=>({label:hr(si.start,si.extension),value:si.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[V0(s.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),i0&&(0,n.jsx)("button",{onClick:Ea,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:V0(s.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var Br=Object.defineProperty,ti=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,ea=Object.getOwnPropertySymbols,Z0=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,Si=(Qn,Hr,qr)=>Hr in Qn?Br(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,Eo=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))Z0.call(Hr,qr)&&Si(Qn,qr,Hr[qr]);if(ea)for(var qr of ea(Hr))sa.call(Hr,qr)&&Si(Qn,qr,Hr[qr]);return Qn},Ha=(Qn,Hr)=>ti(Qn,Ji(Hr)),vs=(Qn,Hr)=>{var qr={};for(var Vi in Qn)Z0.call(Qn,Vi)&&Hr.indexOf(Vi)<0&&(qr[Vi]=Qn[Vi]);if(Qn!=null&&ea)for(var Vi of ea(Qn))Hr.indexOf(Vi)<0&&sa.call(Qn,Vi)&&(qr[Vi]=Qn[Vi]);return qr};const Ds=(Qn,Hr)=>Qn.answerOption?Qn.answerOption.map(qr=>{var Vi,Fi;const Bi=(Fi=(Vi=qr.valueReference)==null?void 0:Vi.reference)==null?void 0:Fi.replace("#","");return Hr.find(_0=>_0.id===Bi)}).filter(Boolean):[],xs=Qn=>{var Hr,qr,Vi;const Fi=Qn.find(Bi=>{var _0,$0;return Bi.url.includes("questionnaire-itemControl")&&(($0=(_0=Bi.valueCodeableConcept)==null?void 0:_0.coding)==null?void 0:$0.some(L0=>{var V0;return(V0=L0.code)==null?void 0:V0.startsWith("ui-toolkit/")}))});return(Vi=(qr=(Hr=Fi?.valueCodeableConcept)==null?void 0:Hr.coding)==null?void 0:qr.find(Bi=>{var _0;return(_0=Bi.code)==null?void 0:_0.startsWith("ui-toolkit/")}))==null?void 0:Vi.code},ds=Qn=>{var{uiToolkitCode:Hr,props:qr}=Qn,Vi=qr,{item:Fi,contained:Bi=[],customErrorConfigurations:_0}=Vi,$0=vs(Vi,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:L0}=(0,h.c)(),V0=er[Hr];if(!V0)return(0,n.jsx)(n.Fragment,{});const f0=Ds(Fi,Bi),Y0=f0.length>0;return!(Fi.answerOption&&Fi.answerOption.length>0)&&!Y0&&!Fi.readOnly?(L0(!0),(0,n.jsx)(ot,{configKey:Hr,customErrorConfigurations:_0})):(0,n.jsx)(V0,Ha(Eo({},$0),{item:Fi,contained:Bi,customErrorConfigurations:_0,resourceData:f0,"data-testid":Fi.linkId}))},sr={attachment:jn,choice:pi,boolean:Vr,integer:Oi,string:({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0;const{linkId:f0,text:Y0,required:Ma,prefix:Lr,readOnly:ar}=Qn,hr=Y0?(0,i.nt)(Fi,Lr,Y0):"",Pe=Bi?.[f0]||"",Ee=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:hr,required:Ma||!1}),(0,n.jsx)(s.Input,{isRequired:Ma,size:"md","aria-label":f0,"data-testid":f0,id:f0,type:Ee==="tel"?"tel":"text",placeholder:$0,value:((V0=qr?.[0])==null?void 0:V0.valueString)||"",onChange:$e=>{Vi(Qn,[{valueString:$e}])},isDisabled:ar||_0,onBlur:$e=>{const vt=$e.target.value,Gt=vt.trim();Gt!==vt&&Vi(Qn,[{valueString:Gt}]),Hr(Qn.linkId)},hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},f0)]})},url:({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0;const{linkId:f0,text:Y0,required:Ma,prefix:Lr,readOnly:ar}=Qn,hr=Y0?(0,i.nt)(Fi,Lr,Y0):"",Pe=Bi?.[f0]||"",Ee=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:hr,required:Ma||!1}),(0,n.jsx)(s.Input,{isRequired:Ma,size:"md",type:"url",id:f0,"data-testid":f0,"aria-label":f0,placeholder:$0,value:((V0=qr?.[0])==null?void 0:V0.valueUri)||"",onChange:$e=>{Vi(Qn,[{valueUri:$e}])},isDisabled:ar||_0,onBlur:$e=>{const vt=$e.target.value,Gt=vt.trim();Gt!==vt&&Vi(Qn,[{valueUri:Gt}]),Hr(Qn.linkId)},hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},f0)]})},text:({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0,placeholder:$0,hintText:L0})=>{var V0;const{linkId:f0,text:Y0,required:Ma,prefix:Lr,readOnly:ar,maxLength:hr}=Qn,Pe=Y0?(0,i.nt)(Fi,Lr,Y0):"",Ee=Bi?.[f0]||"",$e=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Ma||!1}),(0,n.jsx)(s.TextArea,{isRequired:Ma,id:f0,"aria-label":f0,"data-testid":f0,rows:3,placeholder:$0,value:((V0=qr?.[0])==null?void 0:V0.valueString)||"",onChange:vt=>{Vi(Qn,[{valueString:vt}])},isDisabled:ar||_0,onBlur:vt=>{const Gt=vt.target.value,ln=Gt.trim();ln!==Gt&&Vi(Qn,[{valueString:ln}]),Hr(Qn.linkId)},hint:Ee||L0,counter:!0,isInvalid:!!Ee,maxLength:hr,autoComplete:$e},f0)]})},date:yr,time:({item:Qn,onCompleteHandler:Hr,selectedAnswer:qr,handleInputChange:Vi,showQuestionPrefix:Fi,errors:Bi,isLoading:_0})=>{var $0;const{linkId:L0,text:V0,required:f0,prefix:Y0,readOnly:Ma}=Qn,Lr=V0?(0,i.nt)(Fi,Y0,V0):"",ar=Bi?.[L0]||"";return(0,n.jsxs)("div",{children:[Lr&&(0,n.jsx)(w,{isLabel:!0,text:Lr,required:f0||!1}),(0,n.jsx)(s.Input,{isRequired:f0,size:"md",type:"time",id:L0,"data-testid":L0,"aria-label":L0,placeholder:"Type your response here...",value:(($0=qr?.[0])==null?void 0:$0.valueTime)||"",onChange:hr=>{Vi(Qn,[{valueTime:hr}])},isDisabled:Ma||_0,onBlur:()=>{Hr(Qn.linkId)},hint:ar,isInvalid:!!ar},L0)]})},dateTime:Ir,quantity:Wi,decimal:zo,question:bo,display:bo,group:bo,reference:Qn=>{var Hr,qr,Vi,Fi,Bi;const{setHideFooterButton:_0}=(0,h.c)(),{item:$0,customErrorConfigurations:L0}=Qn,V0=$0.extension||[],f0=xs(V0);return f0?(0,n.jsx)(ds,{uiToolkitCode:f0,props:Qn}):((Bi=(Fi=(Vi=(qr=(Hr=$0?.extension)==null?void 0:Hr.find(Ma=>Ma.url.includes("questionnaire-itemControl")))==null?void 0:qr.valueCodeableConcept)==null?void 0:Vi.coding)==null?void 0:Fi[0])==null?void 0:Bi.code)==="check-box"?$0.answerOption&&$0.answerOption.length>0?(0,n.jsx)(pi,Ha(Eo({},Qn),{item:$0})):(_0(!0),(0,n.jsx)(ot,{configKey:$0.linkId,customErrorConfigurations:L0})):null}};var vo=(Qn,Hr,qr)=>new Promise((Vi,Fi)=>{var Bi=L0=>{try{$0(qr.next(L0))}catch(V0){Fi(V0)}},_0=L0=>{try{$0(qr.throw(L0))}catch(V0){Fi(V0)}},$0=L0=>L0.done?Vi(L0.value):Promise.resolve(L0.value).then(Bi,_0);$0((qr=qr.apply(Qn,Hr)).next())});const Bo=({item:Qn,selectedAnswer:Hr,showQuestionPrefix:qr})=>{const{text:Vi,prefix:Fi,required:Bi}=Qn,_0=Vi?getUpdatedQuestionText(qr,Fi,Vi):"",[$0,L0]=useState(null),[V0,f0]=useState(!1),{documentDownload:Y0,webview:Ma}=useNativeBridge(),Lr=(Hr||[]).filter(Ee=>{var $e,vt;return(($e=Ee.valueAttachment)==null?void 0:$e.data)&&((vt=Ee.valueAttachment)==null?void 0:vt.title)}).map((Ee,$e)=>{var vt,Gt,ln,_n,dr,zn,tr;return{id:((vt=Ee.valueAttachment)==null?void 0:vt.id)||`preview-${$e}`,fileName:((Gt=Ee.valueAttachment)==null?void 0:Gt.title)||`attachment-${$e}`,contentType:((ln=Ee.valueAttachment)==null?void 0:ln.contentType)||"application/octet-stream",base64Data:((_n=Ee.valueAttachment)==null?void 0:_n.data)||"",size:getBase64Size(((dr=Ee.valueAttachment)==null?void 0:dr.data)||"",(zn=Ee.valueAttachment)==null?void 0:zn.contentType),type:getFileTypeFromMimeType((tr=Ee.valueAttachment)==null?void 0:tr.contentType)}}),ar=useCallback(Ee=>{const{fileName:$e,contentType:vt,base64Data:Gt}=Ee;if(Ma.isWithin)L0({fileName:$e,contentType:vt,base64Data:Gt}),f0(!0);else{const ln=base64toObjectUrl(Gt,vt),_n=document.createElement("a");_n.href=ln,_n.download=$e,document.body.appendChild(_n),_n.click(),document.body.removeChild(_n),URL.revokeObjectURL(ln)}},[Ma.isWithin]),hr=useCallback(()=>vo(void 0,null,function*(){!$0||(yield Y0.writeFile($0.fileName,prepareDataUrl($0.base64Data,$0.contentType)))}),[$0,Y0]),Pe=useCallback(()=>{f0(!1),L0(null)},[]);return Lr.length?jsxs("div",{children:[_0&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:_0,required:Bi||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Lr.map(Ee=>jsx("button",{type:"button",onClick:()=>ar(Ee),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(Ee.fileName),size:Ee.size,type:Ee.type})},Ee.id))}),jsx(DownloadDisclosureModal,{opened:V0,onClose:Pe,onDownload:hr,contentType:$0?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var _t=Object.defineProperty,Ge=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Un=Object.prototype.hasOwnProperty,fr=Object.prototype.propertyIsEnumerable,Pr=(Qn,Hr,qr)=>Hr in Qn?_t(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,Ao=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))Un.call(Hr,qr)&&Pr(Qn,qr,Hr[qr]);if(wt)for(var qr of wt(Hr))fr.call(Hr,qr)&&Pr(Qn,qr,Hr[qr]);return Qn},Ho=(Qn,Hr)=>Ge(Qn,dt(Hr));const Go=(Qn,Hr,qr,Vi)=>{var Fi;const Bi=Qn.extension||[];if(Vi?.[BUTTON_TYPE_EXTERNAL_KEY]&&Bi.some(f0=>f0.url===BUTTON_TYPE_EXTENSION_URL))return Vi[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(Qn)||hasParentWithUIToolkitWidget(Qn,Hr))return null;if(qr&&Qn.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const _0=getUIToolkitCode(Bi),$0=Bi.filter(f0=>f0.url.includes("questionnaire-itemControl")).flatMap(f0=>{var Y0,Ma;return(Ma=(Y0=f0.valueCodeableConcept)==null?void 0:Y0.coding)!=null?Ma:[]})||[];let L0;return Vi&&(L0=(Fi=$0.find(f0=>f0.code&&Vi[f0.code]))==null?void 0:Fi.code),(L0&&Vi?Vi[L0]:void 0)||UI_TOOLKIT_WIDGET_MAP[_0||""]||typeToRenderFunctionMap[Qn.type]||null},u0=Qn=>{var Hr;const{item:qr,selectedAnswer:Vi,handleInputChange:Fi,showQuestionPrefix:Bi,errors:_0,questionnaireSchemaItems:$0,formData:L0,isNestedRepeatedItem:V0=!1}=Qn,{linkId:f0,text:Y0,prefix:Ma,required:Lr,repeats:ar}=qr,hr=getMaxOccursFromExtensions(qr.extension),Pe=getPlaceholderFromExtensions(qr.extension,qr.type),[Ee,$e]=useState(()=>{if(qr.type==="group"&&qr.item&&qr.item.length>0){const Tr=L0?.filter(mo=>mo.linkId===qr.linkId)||[];if(Tr.length>0)return Tr.map((mo,lo)=>lo)}else if(Vi&&Vi.length>0)return Vi.map((Tr,mo)=>mo);return[0]}),vt=hr!==void 0&&Ee.length>=hr,Gt=Y0?getUpdatedQuestionText(Bi,Ma,Y0):"",ln=()=>{const Tr=Math.max(...Ee,-1)+1,mo=[...Ee,Tr];if($e(mo),qr.type==="group"&&qr.item&&qr.item.length>0){const lo=qr.item.map(Hi=>({linkId:Hi.linkId,text:Hi.text,answer:[{}]})),qo={linkId:qr.linkId,text:qr.text,answer:[{}],item:lo};Fi(qr,void 0,[qo])}else{const lo=[...Vi||[]];lo.push({}),Fi(qr,lo)}},_n=Tr=>{if(Ee.length<=1)return;const mo=Ee.filter((lo,qo)=>qo!==Ee.length-1);if($e(mo),qr.type==="group"&&qr.item&&qr.item.length>0){const lo=[];if(L0?.forEach((qo,Hi)=>{qo.linkId===f0&&lo.push({item:qo,originalIndex:Hi})}),Tr>=0&&Tr<lo.length){const qo=lo[Tr],Hi=L0?.filter((ji,Ii)=>Ii!==qo.originalIndex);Fi(qr,void 0,Hi,void 0,!0)}}else{const lo=Vi?.filter((qo,Hi)=>Hi!==Tr)||[];Fi(qr,lo.length>0?lo:[{}])}},dr=Tr=>{if(!L0||!qr.item)return[];const mo=Hi=>{const ji=[];for(const Ii of Hi)if(Ii.linkId===qr.linkId&&ji.push(Ii),Ii.item&&Ii.item.length>0){const ni=mo(Ii.item);ji.push(...ni)}return ji},qo=mo(L0)[Tr];return qo?.item?qo.item:[]},zn=(Tr,mo)=>{if(isHiddenExtensionPresent(Tr))return null;const lo=dr(mo);if(!isQuestionEnabledForInstance(Tr.enableWhen,Tr.enableBehavior,L0||[],qr.linkId,mo))return null;if(Tr.repeats){const ni=findNestedAnswer(lo,Tr.linkId),Ui=Ho(Ao({},Qn),{item:Tr,selectedAnswer:ni||[{}],errors:getInstanceErrors(_0,qr,mo),handleInputChange:(mi,t0,e0)=>Fi(mi,t0,e0,mo)});return jsx("div",{children:jsx(u0,Ho(Ao({},Ui),{isNestedRepeatedItem:!0}))},Tr.linkId)}if(Tr.type==="group"&&Tr.item&&!getUIToolkitCode(Tr?.extension||[]))return jsxs("div",{children:[Tr.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:Tr.text}),jsx("div",{className:"space-y-3",children:Tr.item.map(ni=>{if(!isQuestionEnabledForInstance(ni.enableWhen,ni.enableBehavior,L0||[],qr.linkId,mo))return null;const mi=Go(ni,$0,Qn.isLoading,Qn.externalComponentRenderMap);if(!mi)return null;const t0=findNestedAnswer(lo,ni.linkId),e0=Ho(Ao({},Qn),{item:ni,selectedAnswer:t0,placeholder:getPlaceholderFromExtensions(ni.extension,ni.type),errors:getInstanceErrors(_0,qr,mo),handleInputChange:(ka,k0,i0)=>Fi(ka,k0,i0,mo)});return createElement(mi,Ho(Ao({},e0),{key:ni.linkId}))})})]},Tr.linkId);const Hi=Go(Tr,$0,Qn.isLoading,Qn.externalComponentRenderMap);if(!Hi)return null;const ji=findNestedAnswer(lo,Tr.linkId),Ii=Ho(Ao({},Qn),{item:Tr,selectedAnswer:ji,placeholder:getPlaceholderFromExtensions(Tr.extension,Tr.type),errors:getInstanceErrors(_0,qr,mo),handleInputChange:(ni,Ui,mi)=>Fi(ni,Ui,mi,mo)});return createElement(Hi,Ho(Ao({},Ii),{key:`${Tr.linkId}-${mo}`}))},tr=()=>{const Tr=getDirectErrors(_0,f0);return jsxs("div",{className:"flex flex-col gap-2",children:[Tr[f0]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Tr[f0]}),!vt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:ln,className:"mt-4 text-center",isDisabled:Qn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},gn=Tr=>Ee.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>_n(Tr),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${Tr+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:Qn.isLoading}),gr=Go(qr,$0,Qn.isLoading,Qn.externalComponentRenderMap);return hasRepeatingParent(qr,$0)&&!V0?null:!ar||ar&&hasCheckboxExtension(qr)?gr?jsx(gr,Ho(Ao({},Qn),{placeholder:Pe,errors:{[qr.linkId]:((Hr=_0?.[qr.linkId])==null?void 0:Hr[0])||""}})):null:qr.type==="group"&&qr.item&&qr.item.length>0&&qr.repeats?jsxs("div",{"data-testid":`${f0}-repeating`,children:[Gt&&jsx(FHIRQuestionnaireQuestionText,{text:Gt,required:Lr||!1}),Ee.map(Tr=>{var mo;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${Tr>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Tr+1]}),gn(Tr)]}),jsx("div",{className:"space-y-4",children:(mo=qr.item)==null?void 0:mo.map(lo=>zn(lo,Tr))})]},`${f0}-instance-${Tr}`)}),tr()]}):gr?jsxs("div",{"data-testid":`${f0}-repeating`,children:[Ee.map(Tr=>{const mo=Vi?.[Tr]?[Vi[Tr]]:void 0,lo=Ho(Ao({},Qn),{item:qr,selectedAnswer:mo,errors:getInstanceErrors(_0,qr,Tr),handleInputChange:(qo,Hi,ji)=>Fi(qo,Hi,ji,Tr)});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 ",Tr+1]}),gn(Tr)]}),jsx(gr,Ao({},lo))]},`${f0}-instance-${Tr}`)}),jsxs("div",{children:[(()=>{const mo=getDirectErrors(_0,f0)[f0];return mo&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:mo})})(),!vt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:ln,className:"mt-4 text-center",isDisabled:Qn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Ki=Object.defineProperty,p0=Object.defineProperties,F0=Object.getOwnPropertyDescriptors,Ca=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,ma=Object.prototype.propertyIsEnumerable,os=(Qn,Hr,qr)=>Hr in Qn?Ki(Qn,Hr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Hr]=qr,us=(Qn,Hr)=>{for(var qr in Hr||(Hr={}))oa.call(Hr,qr)&&os(Qn,qr,Hr[qr]);if(Ca)for(var qr of Ca(Hr))ma.call(Hr,qr)&&os(Qn,qr,Hr[qr]);return Qn},_a=(Qn,Hr)=>p0(Qn,F0(Hr));const Xs=null,m1=({formId:Qn,questionnaireSchema:Hr,questionnaireResponseItem:qr,errorConfig:Vi,customErrorConfigurations:Fi,showQuestionPrefix:Bi=!0,isAdaptiveFlow:_0=!1,status:$0,hideBackButton:L0=!1,showStepper:V0=!1,onComplete:f0,onClearError:Y0,handleHiddenQuestion:Ma,onGoBack:Lr,onFormDataChange:ar=()=>{},externalComponentRenderMap:hr,children:Pe})=>{var Ee,$e;const{setHandleContinueButtonClick:vt,setHandleBackButtonClick:Gt,setIsCurrentFormValid:ln,setCurrentGroupLinkId:_n,setCurrentGroupIndex:dr,setTotalSteps:zn,setHideFooterButton:tr,setIsInlineNextQuestionTriggered:gn,isCurrentFormValid:gr,currentGroupIndex:vr,isLoading:Tr,hasCustomError:mo,groupItemIndicesRef:lo,errorLinkIds:qo}=useFHIRQuestionnaire(),{trackEvent:Hi}=useAnalytics(),{t:ji}=useUIToolkitTranslations(),[Ii,ni]=useState([]),[Ui,mi]=useState(new Set),[t0,e0]=useState([]),[ka,k0]=useState([]),i0=lo,Ea=useRef(new Map),cs=useRef(new Set),[q0,B0]=useState({}),[si,a0]=useState(!1),[Mi,Ka]=useState(Hr),ki=useRef(qr||[]),Ua=useRef(!1),qs=useRef(!1),Js=useMemo(()=>getTotalStepsFromQuestionnaire(Hr),[Hr]),[N1,E1]=useState(!1),ta=useRef([]),nl=(Do,hi)=>{var Ko,c0,r0,P0,ha,E0;if(isCallNextQuestionExtensionPresent(Do))return Do.linkId;const D0=validateCurrentPage(hi,Ii,vr,Mi,i0),Ns=va=>{for(const e1 of va){if((!e1.enableWhen||isQuestionEnabled(e1.enableWhen,e1.enableBehavior,hi))&&isCallNextQuestionExtensionPresent(e1))return e1.linkId;if(e1.item){const X1=Ns(e1.item);if(X1)return X1}}},Es=(va,e1)=>{for(const Ks of va)if(Ks.item){const X1=Ks.item.findIndex(f1=>f1.linkId===e1);if(X1!==-1)return Ns(Ks.item.slice(X1+1));const l1=Es(Ks.item,e1);if(l1!==void 0)return l1}},R1=Es((Ko=Mi?.item)!=null?Ko:[],Do.linkId);if(R1)return R1;const G1=i0.current[vr],$1=vr+1,bl=i0.current[$1],Kl=vr===0?0:G1,ai=(r0=bl??((c0=Mi?.item)==null?void 0:c0.length))!=null?r0:0;let Hn=-1;for(let va=Kl;va<ai;va++){const e1=(P0=Mi?.item)==null?void 0:P0[va];if(e1?.linkId===Do.linkId){Hn=va;break}}const N0=(va,e1=[])=>(va.forEach(Ks=>{var X1;if((!Ks.enableWhen||isQuestionEnabled(Ks.enableWhen,Ks.enableBehavior,hi))&&isCallNextQuestionExtensionPresent(Ks))if(Ks.required){const f1=(X1=findResponseItem(hi,Ks.linkId))==null?void 0:X1.answer;(f1&&f1.length>0&&Object.keys(f1[0]).length>0||Ks.initial&&Ks.initial.length>0&&!Ui.has(Ks.linkId))&&e1.push(Ks.linkId)}else e1.push(Ks.linkId);Ks.item&&Ks.item.length>0&&N0(Ks.item,e1)}),e1),H0=[],Ja=Hn!==-1?Hn+1:ai;for(let va=Kl;va<Ja;va++){const e1=(ha=Mi?.item)==null?void 0:ha[va];e1&&N0([e1],H0)}if(H0.length>0&&D0){const va=H0[H0.length-1],e1=f1=>f1.flatMap(Vs=>[Vs,...Vs.item?e1(Vs.item):[]]),Ks=e1((E0=Mi?.item)!=null?E0:[]),X1=Ks.findIndex(f1=>f1.linkId===va),l1=Ks.findIndex(f1=>f1.linkId===Do.linkId);return X1!==-1&&l1>X1?void 0:va}},rl=Do=>nl(Do,ki.current)?!0:Do.item&&Do.item.length>0?Do.item.some(rl):!1,zt=()=>{var Do,hi;if(!_0||vr<0||!Mi?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const Ko=i0.current[vr],c0=Ea.current.get(Ko)||[Ko],r0=(Do=Mi.item)==null?void 0:Do[c0[c0.length-1]],P0=r0?rl(r0):!1,ha=vr<i0.current.length-1;let E0=!1;if(P0&&ha){const D0=vr+1,Ns=i0.current[D0],Es=(hi=Mi?.item)==null?void 0:hi[Ns],R1=!Es?.enableWhen||isQuestionEnabled(Es.enableWhen,Es.enableBehavior,ki.current),G1=Es?isPageExtensionPresent(Es):!1;E0=R1&&G1}return{shouldTriggerInlineLoading:P0,canNavigateToNextGroup:E0,hasMoreGroups:ha}},an=(Do,hi,Ko,c0)=>{const r0=getUpdatedFormData(Mi?.item||[],ki.current,Do,hi,Ko,c0);return ki.current=r0,ar(r0),r0},Mt=(Do,hi,Ko,c0,r0)=>{an(hi,Ko,c0,r0),c0.forEach(P0=>{const ha=getValidationError(_a(us({},Do),{linkId:P0.linkId}),ki.current,P0.answer,ji);ha&&B0(E0=>_a(us({},E0),{[P0.linkId]:typeof r0=="number"?_a(us({},E0[P0.linkId]),{[r0]:ha}):ha}))})},Ot=(Do,hi,Ko,c0,r0)=>{var P0;const ha=an(hi,Ko,c0,r0),E0=(P0=findResponseItem(ha,hi))==null?void 0:P0.answer,D0=getValidationError(Do,ki.current,E0,ji);B0(Ns=>_a(us({},Ns),{[hi]:typeof r0=="number"?_a(us({},Ns[hi]),{[r0]:D0}):D0}))},rn=(Do,hi)=>{const Ko=validateCurrentPage(hi,Ii,vr,Mi,i0);if(ln(Ko),Mi?.item){const c0=validateAllItemsRecursively(Mi.item,hi,ji);if(Object.keys(c0).length>0)B0(r0=>us(us({},r0),c0));else{const r0=Mi.item,P0={},ha=E0=>{E0.forEach(D0=>{P0[D0.linkId]={},D0.item&&ha(D0.item)})};ha(r0),B0(E0=>us(us({},E0),P0))}}},Jt=(Do,hi,Ko,c0,r0=!1)=>{var P0;const{linkId:ha}=Do;if(r0)return ki.current=Ko||[],rn(ha,Ko||[]),ki.current;if(Ko&&Ko.length>0&&Do.type==="group"&&Do.repeats){let Es=ki.current.length;for(let G1=ki.current.length-1;G1>=0;G1--)if(ki.current[G1].linkId===ha){Es=G1+1;break}const R1=[...ki.current.slice(0,Es),...Ko,...ki.current.slice(Es)];return ki.current=R1,rn(ha,R1),ki.current}if(typeof c0=="number"&&hi){const Es=hasRepeatingParent(Do,Mi?.item||[]);if(Es){const R1=ki.current.filter($1=>$1.linkId===Es.linkId);if(c0<R1.length){const $1=ki.current.map(bl=>{if(bl.linkId===Es.linkId&&ki.current.slice(0,ki.current.indexOf(bl)).filter(ai=>ai.linkId===Es.linkId).length===c0){const ai=(H0,Ja)=>{const va=new Map(H0.map(Ks=>[Ks.linkId,Ks])),e1=[];return Ja?.forEach(Ks=>{const X1=va.get(Ks.linkId);if(Ks.linkId===ha)e1.push(us({linkId:Ks.linkId,text:Ks.text,answer:hi},X1?.item&&{item:X1.item}));else if(X1)if(Ks.item&&Ks.item.length>0){const l1=ai(X1.item||[],Ks.item);e1.push(_a(us({},X1),{item:l1}))}else e1.push(X1);else if(Ks.item&&Ks.item.length>0){const l1=ai([],Ks.item);l1.some(Vs=>Vs.linkId===ha||Vs.item&&Hn(Vs.item,ha))&&e1.push({linkId:Ks.linkId,text:Ks.text,answer:[{}],item:l1})}va.delete(Ks.linkId)}),va.forEach(Ks=>{e1.push(Ks)}),e1},Hn=(H0,Ja)=>H0.some(va=>va.linkId===Ja||va.item&&Hn(va.item,Ja)),N0=ai(bl.item||[],Es.item);return _a(us({},bl),{item:N0})}return bl});ki.current=$1,ar($1)}else{const $1=c0+1,bl=R1.length;if(bl<$1||$1===1){const Kl=[],ai=(H0,Ja,va)=>H0.map(e1=>{const Ks={linkId:e1.linkId,text:e1.text,answer:e1.linkId===Ja?va:[{}]};return e1.item&&e1.item.length>0&&(Ks.item=ai(e1.item,Ja,va)),Ks});for(let H0=bl;H0<$1;H0++){const Ja=Es.item?ai(Es.item,ha,hi):[],va={linkId:Es.linkId,text:Es.text,answer:[{}],item:Ja};Kl.push(va)}let Hn=ki.current.length;for(let H0=ki.current.length-1;H0>=0;H0--)if(ki.current[H0].linkId===Es.linkId){Hn=H0+1;break}const N0=[...ki.current.slice(0,Hn),...Kl,...ki.current.slice(Hn)];ki.current=N0,ar(N0)}}const G1=getValidationError(Do,ki.current,hi,ji);return B0($1=>_a(us({},$1),{[ha]:typeof c0=="number"?_a(us({},$1[ha]),{[c0]:G1}):G1})),rn(ha,ki.current),ki.current}}if(typeof c0=="number")return Ko&&Ko.length>0?Mt(Do,ha,hi,Ko,c0):Ot(Do,ha,hi,Ko,c0),ki.current;const E0=an(ha,hi,Ko),D0=(P0=findResponseItem(E0,ha))==null?void 0:P0.answer,Ns=getValidationError(Do,E0,D0,ji);return B0(Es=>_a(us({},Es),{[ha]:typeof c0=="number"?_a(us({},Es[ha]),{[c0]:Ns}):Ns})),rn(ha,E0),ki.current},Nn=()=>{var Do;for(let hi=vr+1;hi<i0.current.length;hi++){const Ko=i0.current[hi],c0=(Do=Mi?.item)==null?void 0:Do[Ko];if(!!c0&&(!c0.enableWhen||isQuestionEnabled(c0.enableWhen,c0.enableBehavior,ki.current)))return!0}return!1},Wr=()=>{var Do,hi,Ko,c0,r0;const P0=(Do=Hr?.item)==null?void 0:Do[i0.current[vr]];if(P0){const D0=(hi=getAnalyticsEventName(P0))!=null?hi:"questionnaire_form",Ns=getAnalyticsPageName(P0);if(Ns){const Es=(Ko=getAnalyticsFormName(Hr))!=null?Ko:Hr.name,R1=collectAnalyticsProperties(P0,ki.current),G1={};Es&&(G1.form_name=Es),G1.page_name=Ns,Object.assign(G1,R1),Hi(D0,G1)}}const ha=vr<i0.current.length-1,E0=checkCurrentStepDataMatch(ki.current,Mi,i0.current,vr,qr,i0.current.length-1);if(_0&&ha){const D0=vr+1,Ns=i0.current[D0],Es=(c0=Mi?.item)==null?void 0:c0[Ns],R1=!Es?.enableWhen||isQuestionEnabled(Es.enableWhen,Es.enableBehavior,ki.current),G1=Es?isPageExtensionPresent(Es):!1;if(R1&&G1&&E0){dr(D0),ln(!1),window.scrollTo(0,0);return}}if(E0&&i0.current.length>0){Nn()?dr(vr+1):(f0(removeDisabledItems(ki.current,Mi?.item||[])),ln(!1),window.scrollTo(0,0));return}if(vr<i0.current.length-1){const D0=(r0=Mi?.item)==null?void 0:r0[i0.current[vr]];if(!D0){f0(removeDisabledItems(ki.current,Mi?.item||[]));return}const Ns=D0.linkId,Es=findLastGroupInstanceIndex(ki.current,Ns),R1=ki.current.slice(0,Es+1);if(!validateCurrentPage(R1,Ii,vr,Mi,i0))return;_0?(ki.current=R1,ar(R1),f0(ki.current),ln(!1)):i0.current.length>0&&(Nn()?dr(vr+1):(f0(removeDisabledItems(ki.current,Mi?.item||[])),window.scrollTo(0,0)))}else f0(removeDisabledItems(ki.current,Mi?.item||[])),ln(!1),window.scrollTo(0,0)};useEffect(()=>{var Do;vt(()=>Wr),Gt(()=>To),ln(gr);const hi=(Do=Mi?.item)==null?void 0:Do[i0.current[vr]];hi&&_n(hi.linkId)},[gr,vr]),useEffect(()=>{if(!Hr?.item)return;const{groupIndices:Do,itemsToRenderMap:hi}=collectGroupItemIndices(Hr.item);i0.current=Do,Ea.current=hi;const Ko=Js??Do.length;zn(Ko),e0(Do),_0?(qs.current||dr(Do.length>0?Do.length-1:0),gn(!1),qs.current=!1):vr===-1&&dr(0)},[Hr?.item,Js]),useEffect(()=>{if(vr<0||!Mi?.item)return;const Do=validateCurrentPage(ki.current,Ii,vr,Mi,i0);if(!Do){ln(!1);return}const{shouldTriggerInlineLoading:hi,canNavigateToNextGroup:Ko,hasMoreGroups:c0}=zt();if(_0&&hi){if(!c0){ln(!1);return}if(Ko&&Do){ln(!0);return}else{ln(!1);return}}ln(Do)},[vr,Mi?.item,mo,_0,ki.current,Ii]),useEffect(()=>{if(!Hr?.item||Ua.current)return;const Do=initializeQuestionnaireItems(Hr.item,ki.current,Hr.item,ki.current);if(Do!==ki.current){ki.current=Do;const Ko=(r0=>{const P0=new Set,ha=E0=>{E0.forEach(D0=>{var Ns;const Es=D0.initial&&D0.initial.length>0,R1=(D0.type==="choice"||D0.type==="open-choice")&&((Ns=D0.answerOption)==null?void 0:Ns.some(G1=>G1.initialSelected===!0));(Es||R1)&&(!D0.enableWhen||isQuestionEnabled(D0.enableWhen,D0.enableBehavior,ki.current))&&P0.add(D0.linkId),D0.item&&ha(D0.item)})};return ha(r0),P0})(Mi?.item||[]);mi(Ko);const c0=validateAllItemsRecursively(Mi?.item||[],ki.current,ji);Object.keys(c0).length>0&&B0(r0=>us(us({},r0),c0))}Ua.current=!0},[Mi?.item,Hr,ji]),useEffect(()=>{Ka(Hr)},[Hr]),useEffect(()=>{if(qo.size===0)return;const Do=E0=>!E0.enableWhen||isQuestionEnabled(E0.enableWhen,E0.enableBehavior,ki.current)?qo.has(E0.linkId)?!0:(E0.item||[]).some(Do):!1,hi=E0=>E0.flatMap(D0=>[D0.linkId,...hi(D0.item||[])]),Ko=E0=>{const D0=E0.findIndex(Do);return D0===-1?E0.flatMap(Ns=>Ko(Ns.item||[])):E0.slice(D0+1).flatMap(Ns=>[Ns.linkId,...hi(Ns.item||[])])};if(!Mi?.item)return;const c0=Ko(Mi.item);if(c0.length===0)return;Ka(E0=>E0?.item?_a(us({},E0),{item:removeItemsFromSchema(E0.item,c0)}):E0);const r0=E0=>E0.flatMap(D0=>[D0,...D0.item?r0(D0.item):[]]),P0=Mi.item,ha=P0.findIndex(E0=>r0([E0]).some(D0=>qo.has(D0.linkId)&&(!D0.enableWhen||isQuestionEnabled(D0.enableWhen,D0.enableBehavior,ki.current))));if(ha!==-1){const E0=new Set(r0(P0.slice(ha)).map(D0=>D0.linkId));ta.current=ta.current.filter(D0=>!E0.has(D0))}mi(E0=>{const D0=new Set(E0);return c0.forEach(Ns=>D0.delete(Ns)),D0})},[qo]),useEffect(()=>{vr>=0&&window.scrollTo(0,0)},[vr]),useEffect(()=>{var Do;if(!_0||Ii.length===0||Tr||qo.size>0||!Mi?.item)return;const hi=i0.current[vr];if(hi===void 0)return;const Ko=Ea.current.get(hi)||[hi],c0=[];if(Ko.forEach(D0=>{var Ns;const Es=(Ns=Mi?.item)==null?void 0:Ns[D0];Es&&hasInitialValue(Es)&&c0.push(Es)}),c0.length===0||!c0.some(D0=>nl(D0,ki.current)&&!ta.current.includes(D0.linkId)?(ta.current.push(D0.linkId),!0):!1))return;const P0=validateCurrentPage(ki.current,Ii,vr,Mi,i0),ha=(Do=Mi?.item)==null?void 0:Do[hi],E0=isHiddenAnswerInValid(ha,ki.current);!P0||E0||(cs.current.add(vr),gn(!0),qs.current=!0,Fr(c0[c0.length-1].linkId))},[vr,Ii,_0,Tr,Mi]);const Fr=(Do,hi=!1,Ko=!1)=>{var c0,r0,P0;if(hi){f0(removeDisabledItems(ki.current,Mi?.item||[]),Ko),ln(!1);return}const ha=findQuestionByLinkId(Mi?.item||[],Do);if(!ha)return;const E0=(c0=findResponseItem(ki.current,Do))==null?void 0:c0.answer;if(getValidationError(ha,ki.current,E0,ji))return;const D0=getUpdatedFormData(Mi?.item||[],ki.current,Do,E0),Ns=nl(ha,D0);if(!Ns)return;const Es=(r0=findResponseItem(qr||[],Do))==null?void 0:r0.answer,R1=f1=>JSON.stringify(f1,(Vs,B1)=>B1??void 0);if(R1(E0)===R1(Es)||Do!==Ns&&ta.current.includes(Ns))return;ln(!1);const G1=findRootGroupLinkId(Mi?.item||[],Do);let $1=D0,bl=[];const Kl=deepTrimFormData(D0,Ns,Mi?.item||[]);$1=Kl.trimmedData,bl=Kl.trimmedLinkIds;const ai=findQuestionByLinkId(Mi?.item||[],G1||"");ki.current=$1;const Hn=findGroupPositionByLinkId(Mi?.item||[],Do||""),N0=Hn!==-1?Hn:vr;let H0;const Ja=(()=>{var f1;const Vs=(f1=Mi?.item)!=null?f1:[],B1=(A1,nu)=>A1.some(qu=>qu.linkId===nu||(qu.item?B1(qu.item,nu):!1)),ol=Vs.findIndex(A1=>A1.linkId===Ns||(A1.item?B1(A1.item,Ns):!1));if(ol===-1)return[];const W1=A1=>A1.flatMap(nu=>[nu.linkId,...nu.item?W1(nu.item):[]]),Ml=A1=>A1.flatMap(nu=>[nu,...nu.item?Ml(nu.item):[]]),Jl=Ml(Vs),Au=Jl.findIndex(A1=>A1.linkId===Ns),cl=new Set;let Fu=!0;for(;Fu;){Fu=!1;for(const A1 of Jl){if(cl.has(A1.linkId)||!A1.enableWhen)continue;A1.enableWhen.some(qu=>{const Kc=Jl.findIndex(vc=>vc.linkId===qu.question);return Kc!==-1&&Kc<=Au||cl.has(qu.question)})&&(cl.add(A1.linkId),Fu=!0)}}const Iu=ta.current.includes(Ns)?(()=>{const A1=new Set(W1([Vs[ol]]));return Jl.slice(Au+1).filter(nu=>A1.has(nu.linkId)&&!cl.has(nu.linkId)&&!isHiddenExtensionPresent(nu)).map(nu=>nu.linkId)})():[],Ku=Ml(Vs.slice(ol+1)).filter(A1=>!cl.has(A1.linkId)&&!isHiddenExtensionPresent(A1)).map(A1=>A1.linkId);return[...Iu,...Ku]})();if(Ja.length>0){H0=removeItemsFromSchema(Mi?.item||[],Ja),Ka(_a(us({},Mi),{item:H0}));const f1=new Set(Ja);ta.current=ta.current.filter(Vs=>!f1.has(Vs))}const va=[...bl,...Ja],e1=validateCurrentPage($1,Ii,N0,Mi,i0,va),Ks=findQuestionByLinkId(Mi?.item||[],Ns),X1=(P0=findResponseItem($1,Ns))==null?void 0:P0.answer,l1=!Ks?.required||X1!==void 0&&X1.length>0&&Object.keys(X1[0]).length>0;if(e1&&l1&&!isHiddenAnswerInValid(ai,$1)){gn(!0),qs.current=!0;const Vs=((B1,ol)=>{const W1=[];let Ml=!1;const Jl=Au=>{for(const cl of Au)Ml?(W1.push(cl.linkId),cl.item&&Jl(cl.item)):cl.linkId===ol?Ml=!0:cl.item&&Jl(cl.item)};return Jl(B1),W1})(Mi?.item||[],Ns);Vs.length>0&&(ta.current=ta.current.filter(B1=>!Vs.includes(B1)),mi(B1=>{const ol=new Set(B1);return Vs.forEach(W1=>ol.delete(W1)),ol})),ta.current.push(Ns),f0(removeDisabledItems($1,Mi?.item||[]),!0,H0||Mi.item)}},bt=(Do,hi,Ko=!1)=>{const c0=updateItemWithReadOnlyExpression(Do,Mi),r0={item:c0,selectedAnswer:hi,handleInputChange:Jt,showQuestionPrefix:Bi,onCompleteHandler:Fr,errors:q0,isLoading:Tr,isCurrentFormValid:gr,contained:Mi?.contained,questionnaireSchemaItems:Mi?.item,customErrorConfigurations:Fi,formData:ki.current,showStepper:V0,totalStepsFromExtension:Js,externalComponentRenderMap:hr,hintText:getHintTextFromExtensions(c0.extension)};if(typeof Ma=="function"&&Ko)Ma(Do,r0,ki.current);else if(Do.type in typeToRenderFunctionMap&&!Ko)return Ii.includes(Do.linkId)||ni(P0=>[...P0,Do.linkId]),jsx(RenderFHIRQuestionnaireItem,us({},r0),Do.linkId);return null},Co=Do=>{const hi=r0=>!r0.enableWhen||isQuestionEnabled(r0.enableWhen,r0.enableBehavior,ki.current)?qo.has(r0.linkId)?!0:(r0.item||[]).some(hi):!1,Ko=Do.findIndex(hi),c0=Ko!==-1?Do.slice(0,Ko+1):Do;return Ko!==-1&&Do.slice(Ko+1).forEach(r0=>{ki.current.some(ha=>ha.linkId===r0.linkId)&&(ki.current=removeAnswerFromFormData(ki.current,r0.linkId))}),c0.map(r0=>{var P0,ha;const E0=isHiddenExtensionPresent(r0);let D0=(P0=findResponseItem(ki.current,r0.linkId))==null?void 0:P0.answer;if((!D0||Object.keys((ha=D0?.[0])!=null?ha:{}).length===0)&&!Ui.has(r0.linkId)){if(r0.initial&&r0.initial.length>0)D0=r0.initial,mi(Ns=>new Set(Ns).add(r0.linkId));else if((r0.type==="choice"||r0.type==="open-choice")&&r0.answerOption){const Ns=r0.answerOption.filter(Es=>Es.initialSelected===!0);Ns.length>0&&(D0=Ns.map(Es=>{let R1={};return Es.valueCoding?R1={valueCoding:{code:Es.valueCoding.code,display:Es.valueCoding.display,system:Es.valueCoding.system}}:Es.valueReference&&(R1={valueReference:{reference:Es.valueReference.reference,display:Es.valueReference.display}}),R1}).filter(Es=>Object.keys(Es).length>0),mi(Es=>new Set(Es).add(r0.linkId)))}D0&&(ki.current=getUpdatedFormData(Mi?.item||[],ki.current,r0.linkId,D0))}if(!r0?.enableWhen||isQuestionEnabled(r0?.enableWhen,r0.enableBehavior,ki.current)){const Ns=Xs.includes(r0.linkId)||getUIToolkitCode(r0.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[bt(r0,D0,E0),r0.item&&!E0&&(Ns?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:Co(r0.item)})}):Co(r0.item))]},r0.linkId)}else if(r0.type==="group"&&!E0)return ka.includes(r0.linkId)||(Js===void 0&&zn(i0.current.length-1||-1),i0.current=i0.current.filter((Ns,Es)=>Es!==vr),k0(Ns=>[...Ns,r0.linkId])),null})};if(vr>=0){const Do=[];let hi=0,Ko=0;for(;hi<t0.length&&Ko<i0.current.length;){const c0=t0[hi],r0=i0.current[Ko];if(c0<r0){const P0=(Ee=Mi?.item)==null?void 0:Ee[c0];(!P0?.enableWhen||isQuestionEnabled(P0.enableWhen,P0.enableBehavior,ki.current))&&Do.push(hi),hi++}else c0===r0&&hi++,Ko++}for(;hi<t0.length;){const c0=t0[hi],r0=($e=Mi?.item)==null?void 0:$e[c0];(!r0?.enableWhen||isQuestionEnabled(r0.enableWhen,r0.enableBehavior,ki.current))&&Do.push(hi),hi++}if(Do.length>0){Js===void 0&&zn(i0.current.length+Do.length),Do.reverse().forEach(r0=>{const P0=t0[r0];let ha=0;for(let E0=0;E0<i0.current.length;E0++){if(i0.current[E0]>P0){ha=E0;break}ha=E0+1}i0.current.splice(ha,0,P0)});const c0=Do.map(r0=>{var P0;const ha=t0[r0],E0=(P0=Mi?.item)==null?void 0:P0[ha];return E0?.linkId}).filter(Boolean);k0(r0=>r0.filter(P0=>!c0.includes(P0)))}t0.forEach(c0=>{var r0;const P0=(r0=Mi?.item)==null?void 0:r0[c0];P0?.enableWhen&&!isQuestionEnabled(P0.enableWhen,P0.enableBehavior,ki.current)&&ki.current.some(E0=>E0.linkId===P0.linkId)&&(ki.current=removeAnswerFromFormData(ki.current,P0.linkId))})}const To=()=>{var Do;if(Vi&&!si&&vr>0&&$0!=="completed")dr(i0.current.length-1),a0(!0),tr(!1),Y0?.();else if(vr>0&&$0!=="completed"){let hi=vr-1;for(;hi>0;){const Ko=i0.current[hi],c0=(Do=Mi?.item)==null?void 0:Do[Ko];if(!c0?.enableWhen||isQuestionEnabled(c0.enableWhen,c0.enableBehavior,ki.current))break;hi--}dr(hi),ln(!0),tr(!1),Y0?.()}else Lr?.()},qi=Do=>Do.preventDefault();return useEffect(()=>{const Do=setTimeout(()=>{E1(!0)},0);return()=>clearTimeout(Do)},[]),N1?jsxs(Fragment,{children:[jsxs("form",{id:Qn,className:"w-full","data-testid":"questionnaire-form",onSubmit:qi,children:[!L0&&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:()=>To(),onKeyDown:Do=>{(Do.key==="Enter"||Do.key===" ")&&To()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Vi&&!si?jsx(EmptyState,{className:"mt-5xl",title:Vi.title,description:Vi.description,featuredIconProps:{icon:Vi.icon,color:"gray"},primaryButton:Vi.primaryButton,secondaryButton:Vi.secondaryButton?_a(us({},Vi.secondaryButton),{onClick:To}):void 0}):jsxs(Fragment,{children:[!Mi?.item&&Tr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),Mi?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:Co(vr>=0?Mi.item.filter((Do,hi)=>{const Ko=i0.current[vr];return(Ea.current.get(Ko)||[Ko]).includes(hi)}):Mi?.item||[])})]})]}),Ua.current&&Pe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>M});var n=e(31085),t=e(14041),r=e(36087),s=e(1053),o=e(25624),a=e(18522),i=Object.defineProperty,b=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,p=(h,f,v)=>f in h?i(h,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[f]=v,d=(h,f)=>{for(var v in f||(f={}))y.call(f,v)&&p(h,v,f[v]);if(u)for(var v of u(f))m.call(f,v)&&p(h,v,f[v]);return h},O=(h,f)=>b(h,c(f));const g=({selected:h,onClick:f,icon:v,title:A,description:z,readOnly:x})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:v}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:A})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:z})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",x?"cursor-not-allowed":"cursor-pointer",x?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!x&&!h&&"hover:border-gray-400");return x?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},M=({item:h,handleInputChange:f,formData:v,isLoading:A})=>{const{incrementCustomErrorCount:z,decrementCustomErrorCount:x}=(0,a.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,C=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,o.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),E=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,o.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),R=N=>{var w,V;if(!v)return!1;const k=(0,o.MU)(v,N);return((V=(w=k?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},P=(0,t.useMemo)(()=>C.some(N=>R(N.linkId)),[C,v]),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||C.length===0){L.current&&(x(),L.current=!1);return}!P&&!L.current?(z(),L.current=!0):P&&L.current&&(x(),L.current=!1)},[P,S,C.length,z,x]),(0,t.useEffect)(()=>{E.forEach(N=>{var w,V;const k=v?(0,o.MU)(v,N.linkId):void 0;(!k||((V=(w=k.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[E]),(0,t.useEffect)(()=>()=>{L.current&&x()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},A?{inert:""}:{}),{children:C.map(N=>{var w,V,k,I;const q=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(ie=>ie.url===s.g4),$=(V=N.extension)==null?void 0:V.find(ie=>ie.url===s.rz),X=U?.valueString?s.JP[U.valueString]:void 0,G=(k=$?.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:G,selected:q,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>a});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({selected:i,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",i?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!i&&"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":!!i,children:c})},a=({item:i,handleInputChange:b,formData:c})=>{var u;const y=(u=i.item)!=null?u:[],m=i.readOnly===!0,p=O=>{var g,M;if(!c)return!1;const h=(0,s.MU)(c,O);return((M=(g=h?.answer)==null?void 0:g[0])==null?void 0:M.valueBoolean)===!0},d=O=>{const g=p(O.linkId);b(O,[{valueBoolean:!g}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[i.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(i.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var g;const M=p(O.linkId);return(0,n.jsx)(o,{label:(g=O.text)!=null?g:"",selected:M,readOnly:m,onClick:m?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Y,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(1053);const s=({item:o})=>{var a,i,b,c;const u=o.text||"",y=(i=(a=o.extension)==null?void 0:a.find(d=>d.url===r.rz))==null?void 0:i.valueString,m=(c=(b=o.extension)==null?void 0:b.find(d=>d.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)("p",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),o=Object.defineProperty,a=Object.defineProperties,i=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(M,h,f)=>h in M?o(M,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):M[h]=f,m=(M,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(M,f,h[f]);if(b)for(var f of b(h))u.call(h,f)&&y(M,f,h[f]);return M},p=(M,h)=>a(M,i(h));const d=(0,t.createContext)(void 0),O=()=>{const M=(0,t.useContext)(d);if(!M)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return M},g=({children:M,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[v,A]=useState(null),[z,x]=useState(null),[T,S]=useState(!1),[C,E]=useState(null),[R,P]=useState(-1),[L,D]=useState(!1),[N,w]=useState(-1),[V,k]=useState(!1),[I,q]=useState(0),[U,$]=useState(!1),[X,G]=useState(!1),ie=useRef([]),[ae,re]=useState(new Set),he=useCallback(de=>{re(le=>{const te=new Set(le);return te.add(de),te})},[]),ve=useCallback(de=>{re(le=>{const te=new Set(le);return te.delete(de),te})},[]),Ce=useCallback(()=>{q(de=>de+1)},[]),ye=useCallback(de=>{$(de)},[]),ne=useCallback(()=>{q(de=>Math.max(0,de-1))},[]),se=I>0,me=useCallback((de,le,te)=>{if(!h)return;const ee=h[de];if(!ee)return;let ge;if(Array.isArray(ee))if(te)ge=ee.find(ze=>ze.inputType===te);else{console.warn(`Multiple analytics configs found for linkId "${de}" but no inputType provided. Skipping tracking.`);return}else{if(te&&ee.inputType&&ee.inputType!==te)return;ge=ee}if(!ge)return;let xe=m({},le);ge.valueTransform&&(xe=Object.keys(le).reduce((ze,We)=>{var ot;const ht=(ot=ge.valueTransform)==null?void 0:ot[We];return ze[We]=ht?applyValueTransform(le[We],ht):le[We],ze},{}));let Ie=m({},xe);ge.propertyMapping&&(Ie=Object.keys(xe).reduce((ze,We)=>{var ot;const ht=((ot=ge.propertyMapping)==null?void 0:ot[We])||We;return ze[ht]=xe[We],ze},{}));const Se=ge.eventName,De=ge.description;f(Se,p(m(m({},Ie),ge.properties),{_event_metadata:De?{description:De}:void 0}))},[h,f]),ce={isCurrentFormValid:T,currentGroupLinkId:C,currentGroupIndex:R,hideFooterButton:L,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:X,hasCustomError:se,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:v,handleBackButtonClick:z,setHandleContinueButtonClick:A,setHandleBackButtonClick:x,setIsCurrentFormValid:S,setCurrentGroupLinkId:E,setCurrentGroupIndex:P,setHideFooterButton:D,setTotalSteps:w,setIsLoading:k,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:Ce,decrementCustomErrorCount:ne,errorLinkIds:ae,addErrorLinkId:he,removeErrorLinkId:ve,trackQuestionnaireEvent:me,setHasExternalError:ye,groupItemIndicesRef:ie};return jsx(d.Provider,{value:ce,children:M})}},35473:(Y,l,e)=>{"use strict";var n=e(32957),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var o=e(25624),a=e(1053),i=e(7630),b=e(72866),c=e(65735)},61388:(Y,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:o,onActionButtonClick:a,title:i,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:i}),o&&a&&(0,n.jsx)(t.Button,{color:"link-color",onClick:a,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:b})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const o=({infoDetails:a,className:i})=>{const{redirectToBook:b,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,g)=>{d.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=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},p=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:g=>y(g,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:m(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:m(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",i),children:a.map((d,O)=>{const g=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.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:d.label}),(()=>{const M=Array.isArray(d.value)?d.value:[d.value];return M.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:M.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:p(h,d)},f))}):p(M[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Y,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Y,l,e)=>{"use strict";e.d(l,{J:()=>A});var n=e(31085),t=e(14041);const r=({size:z=24,color:x="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:z,height:z,stroke:x,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),o=e(76808),a=e(92094),i=e(5380),b=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,m=Object.defineProperties,p=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,M=(z,x,T)=>x in z?y(z,x,{enumerable:!0,configurable:!0,writable:!0,value:T}):z[x]=T,h=(z,x)=>{for(var T in x||(x={}))O.call(x,T)&&M(z,T,x[T]);if(d)for(var T of d(x))g.call(x,T)&&M(z,T,x[T]);return z},f=(z,x)=>m(z,p(x)),v=(z,x,T)=>new Promise((S,C)=>{var E=L=>{try{P(T.next(L))}catch(D){C(D)}},R=L=>{try{P(T.throw(L))}catch(D){C(D)}},P=L=>L.done?S(L.value):Promise.resolve(L.value).then(E,R);P((T=T.apply(z,x)).next())});const A=({setLocationUpdating:z,title:x,description:T,isOpen:S,onClose:C})=>{const{locationPermission:E,position:R,requestPosition:P,setLocationPermission:L}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,b.i)(),[V,k]=(0,t.useState)(!1),I=(0,c.s)(i.so.LAST_LOCATION_PROMPT),q=S!==void 0?S:V;(0,t.useEffect)(()=>{(q||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,q,D]);const U=(0,t.useCallback)(ve=>{w(f(h({},N),{location:ve,locationType:i.iF.CURRENT_LOCATION,locationPermission:E||""}))},[E,N,w]),$=(0,t.useCallback)(()=>{S===void 0&&(!E||[i.Ef.GRANTED].includes(E)&&I.get()||[i.Ef.PROMPT].includes(E)&&I.get()&&R||k([i.Ef.PROMPT,i.Ef.GRANTED].includes(E)))},[S,E,I,R]);(0,t.useEffect)(()=>{$()},[$]);const X=(0,o.Ul)(),G=(0,t.useCallback)(()=>v(void 0,null,function*(){z&&z(!0);let ve;try{ve=yield P(),ve&&U&&U(`${ve.coords.latitude},${ve.coords.longitude}`)}catch(Ce){Ce instanceof Error?X?.error(Ce,"Error requesting location"):X?.error(`Error requesting location - ${JSON.stringify(Ce)}`),S!==void 0&&C?C():k(!1)}return z&&z(!1),!!ve}),[X,U,P,z,S,C]),ie=(0,t.useCallback)(()=>v(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&C?C():k(!1),I.set(new Date().toISOString()),yield G()}),[D,S,C,I,G]),ae=(0,t.useCallback)(ve=>{D("location_permissions_cta_clicked",{click:ve==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),L(i.Ef.DENIED),w(f(h({},N),{locationPermission:i.Ef.DENIED})),I.remove(),S!==void 0&&C?C():k(!1)},[D,L,w,N,I,S,C]),re=(0,t.useCallback)(()=>ae("close"),[ae]),he=(0,t.useCallback)(()=>ae("cancel"),[ae]);return(0,n.jsx)(a.Modal,{id:"location-modal",isOpen:q,className:"sm:max-w-md",title:{content:x,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:re},primaryButton:{children:"Use my current location",onClick:ie},secondaryButton:{children:"Search another way",onClick:he}})}},35471:(Y,l,e)=>{"use strict";var n=e(26877)},98741:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(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)&&i(y,p,m[p]);if(s)for(var p of s(m))a.call(m,p)&&i(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 d=b({},p);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=m(d[O]));return d};return m(y)},u=({animationData:y,loop:m=!0,autoplay:p=!0,className:d=""})=>{const O=useRef(null),g=useRef(null);return useEffect(()=>{if(!!O.current){try{const M=c(y);g.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:m,autoplay:p,animationData:M})}catch(M){console.error("Failed to load Lottie animation:",M)}return()=>{var M;(M=g.current)==null||M.destroy()}}},[y,m,p]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const o=y=>y*1609.34;var a=e(27419);const i={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var b=e(92469);const c=({center:y,isLoading:m=!1,searchRadius:p,className:d,height:O="350px",width:g="100%",googleMapsApiKey:M,ariaLabel:h})=>{const f=(0,s.Bd)(),{isLoaded:v}=(0,r.KD)({googleMapsApiKey:M||""}),A={height:typeof O=="number"?`${O}px`:O,width:typeof g=="number"?`${g}px`:g},z=(0,t.useCallback)(T=>{google.maps.event.addListenerOnce(T,"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&&T.fitBounds(C,0)}if(h){const C=T.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,a.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:A,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:f("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,a.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:A,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:f("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:i.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:i.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:i.blue100}]}]};return(0,n.jsx)("div",{className:(0,a.cx)("focus-within:ring-focus-ring overflow-hidden rounded-lg focus-within:ring-2 focus-within:ring-offset-2 [&_iframe]:outline-none",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:A,onLoad:z,options:x,zoom:12,children:(0,n.jsx)(b.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:a,profileUrl:i,subTitle:b,variant:c="default",showChevron:u=!0,onClick:y,pendingText:m})=>{const p=!!m,d=!p&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",p&&"opacity-60"),children:[jsx(Avatar,{src:i,alt:a,size:"md",initials:getInitials(a),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:a}),p?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),m]}):jsx("span",{className:"text-secondary text-sm",children:b})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},o=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Y,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:o,fullImageHeader:a=!1,header:i,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:[a?i:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:i}),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})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:o,icon:a})=>{var i;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:a.icon,color:(i=a.color)!=null?i:"brand",size:"lg",className:a.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},69092:()=>{},33457:(Y,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,l,e)=>{"use strict";e.d(l,{i:()=>nt});var n=e(31085),t=e(36087),r=e(14041);const s=({size:et=24,color:Zt="currentColor",...xn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:et,height:et,stroke:Zt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...xn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var o=e(14449),a=e(14711),i=e(58139),b=e(37121),c=e(43144);function u(et){et()}let y=null;const m=et=>y=et,p=()=>y,d=(0,r.createContext)(null),O=null;function g(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=et=>{h=et},v=(et,Zt)=>et===Zt;function A(et=d){const Zt=et===d?g:()=>(0,r.useContext)(et);return function(An,at=v){const{store:Wt,subscription:Bt,getServerState:On}=Zt(),Xn=h(Bt.addNestedSub,Wt.getState,On||Wt.getState,An,at);return(0,r.useDebugValue)(Xn),Xn}}const z=A();var x=e(75985),T=e(524);function S(){const et=getBatch();let Zt=null,xn=null;return{clear(){Zt=null,xn=null},notify(){et(()=>{let An=Zt;for(;An;)An.callback(),An=An.next})},get(){let An=[],at=Zt;for(;at;)An.push(at),at=at.next;return An},subscribe(An){let at=!0,Wt=xn={callback:An,next:null,prev:xn};return Wt.prev?Wt.prev.next=Wt:Zt=Wt,function(){!at||Zt===null||(at=!1,Wt.next?Wt.next.prev=Wt.prev:xn=Wt.prev,Wt.prev?Wt.prev.next=Wt.next:Zt=Wt.next)}}}}const C={notify(){},get:()=>[]};function E(et,Zt){let xn,An=C;function at(nr){return Xn(),An.subscribe(nr)}function Wt(){An.notify()}function Bt(){Ln.onStateChange&&Ln.onStateChange()}function On(){return Boolean(xn)}function Xn(){xn||(xn=Zt?Zt.addNestedSub(Bt):et.subscribe(Bt),An=S())}function on(){xn&&(xn(),xn=void 0,An.clear(),An=C)}const Ln={addNestedSub:at,notifyNestedSubs:Wt,handleChangeWrapper:Bt,isSubscribed:On,trySubscribe:Xn,tryUnsubscribe:on,getListeners:()=>An};return Ln}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P=null,L=null;let D=null;const N=et=>{D=et},w=null,V=null,k=et=>{try{return JSON.stringify(et)}catch{return String(et)}};function I(et,Zt,xn){useIsomorphicLayoutEffect(()=>et(...Zt),xn)}function q(et,Zt,xn,An,at,Wt){et.current=An,xn.current=!1,at.current&&(at.current=null,Wt())}function U(et,Zt,xn,An,at,Wt,Bt,On,Xn,on,Ln){if(!et)return()=>{};let nr=!1,In=null;const Ur=()=>{if(nr||!On.current)return;const Pt=Zt.getState();let Fe,rt;try{Fe=An(Pt,at.current)}catch(Ye){rt=Ye,In=Ye}rt||(In=null),Fe===Wt.current?Bt.current||on():(Wt.current=Fe,Xn.current=Fe,Bt.current=!0,Ln())};return xn.onStateChange=Ur,xn.trySubscribe(),Ur(),()=>{if(nr=!0,xn.tryUnsubscribe(),xn.onStateChange=null,In)throw In}}const $=()=>w;function X(et,Zt){return et===Zt}let G=!1;function ie(et,Zt,xn,{pure:An,areStatesEqual:at=X,areOwnPropsEqual:Wt=shallowEqual,areStatePropsEqual:Bt=shallowEqual,areMergedPropsEqual:On=shallowEqual,forwardRef:Xn=!1,context:on=ReactReduxContext}={}){const Ln=on,nr=mapStateToPropsFactory(et),In=mapDispatchToPropsFactory(Zt),Ur=mergePropsFactory(xn),$r=Boolean(et);return Fe=>{const rt=Fe.displayName||Fe.name||"Component",Ye=`Connect(${rt})`,Qe={shouldHandleStateChanges:$r,displayName:Ye,wrappedComponentName:rt,WrappedComponent:Fe,initMapStateToProps:nr,initMapDispatchToProps:In,initMergeProps:Ur,areStatesEqual:at,areStatePropsEqual:Bt,areOwnPropsEqual:Wt,areMergedPropsEqual:On};function Je(st){const[ue,Oe,Ve]=useMemo(()=>{const{reactReduxForwardedRef:sn}=st,pn=_objectWithoutPropertiesLoose(st,L);return[st.context,sn,pn]},[st]),Te=useMemo(()=>ue&&ue.Consumer&&isContextConsumer(React.createElement(ue.Consumer,null))?ue:Ln,[ue,Ln]),xt=useContext(Te),Kt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),Cn=Boolean(xt)&&Boolean(xt.store),qn=Kt?st.store:xt.store,Sr=Cn?xt.getServerState:qn.getState,Ft=useMemo(()=>defaultSelectorFactory(qn.dispatch,Qe),[qn]),[we,Xe]=useMemo(()=>{if(!$r)return V;const sn=createSubscription(qn,Kt?void 0:xt.subscription),pn=sn.notifyNestedSubs.bind(sn);return[sn,pn]},[qn,Kt,xt]),Et=useMemo(()=>Kt?xt:_extends({},xt,{subscription:we}),[Kt,xt,we]),Vt=useRef(),Qt=useRef(Ve),tn=useRef(),jn=useRef(!1),Vr=useRef(!1),Lt=useRef(!1),dn=useRef();useIsomorphicLayoutEffect(()=>(Lt.current=!0,()=>{Lt.current=!1}),[]);const cn=useMemo(()=>()=>tn.current&&Ve===Qt.current?tn.current:Ft(qn.getState(),Ve),[qn,Ve]),Dn=useMemo(()=>pn=>we?U($r,qn,we,Ft,Qt,Vt,jn,Lt,tn,Xe,pn):()=>{},[we]);I(q,[Qt,Vt,jn,Ve,tn,Xe]);let en;try{en=D(Dn,cn,Sr?()=>Ft(Sr(),Ve):cn)}catch(sn){throw dn.current&&(sn.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.1164.
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1164.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.1424.1",D="@icanbwell/composite. repo version: 0.1424.1",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/composite",
|
|
3
|
-
"version": "1.1164.
|
|
3
|
+
"version": "1.1164.1",
|
|
4
4
|
"author": "icanbwell",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"optional": true
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"repoVersion": "0.1424.
|
|
47
|
-
"description": "@icanbwell/composite. repo version: 0.1424.
|
|
46
|
+
"repoVersion": "0.1424.1",
|
|
47
|
+
"description": "@icanbwell/composite. repo version: 0.1424.1"
|
|
48
48
|
}
|