/* Minification failed. Returning unminified contents.
(2,303-304): run-time error JS1100: Expected ',': =
(2,18921-18922): run-time error JS1010: Expected identifier: {
(2,18969-18970): run-time error JS1004: Expected ';': :
(2,18972-18973): run-time error JS1195: Expected expression: =
(2,19278-19279): run-time error JS1002: Syntax error: }
(2,19393-19394): run-time error JS1004: Expected ';': {
(2,20120-20121): run-time error JS1195: Expected expression: ,
(2,20201-20202): run-time error JS1004: Expected ';': {
(2,20391-20392): run-time error JS1195: Expected expression: ,
(2,20487-20488): run-time error JS1004: Expected ';': {
(2,20771-20772): run-time error JS1195: Expected expression: ,
(2,20865-20866): run-time error JS1004: Expected ';': {
(2,21359-21360): run-time error JS1195: Expected expression: ,
(2,21465-21466): run-time error JS1004: Expected ';': {
(2,21577-21578): run-time error JS1195: Expected expression: ,
(2,21671-21672): run-time error JS1004: Expected ';': {
(2,21826-21827): run-time error JS1195: Expected expression: ,
(2,21845-21846): run-time error JS1197: Too many errors. The file might not be a JavaScript file: .
(2,21678-21825): run-time error JS1018: 'return' statement outside of function: return $$WPUtil.IsNullOrEmpty(e.OverridePhoneNumber)?$$WPUtil.IsNullOrEmpty(e.PhoneNumber)||(t=" • "+e.PhoneNumber):t=" • "+e.OverridePhoneNumber,t
(2,21568-21576): run-time error JS1018: 'return' statement outside of function: return t
(2,21080-21358): run-time error JS1018: 'return' statement outside of function: return $$WPUtil.IsNullOrEmpty(l)&&e&&e.VisitType&&(l=$$WPUtil.IsNullOrEmpty(i)||$$WPUtil.IsNullOrEmpty(e.VisitType.TelehealthModeDisplayNames)||$$WPUtil.IsNullOrEmpty(e.VisitType.TelehealthModeDisplayNames[i])?e.VisitType.DisplayName:e.VisitType.TelehealthModeDisplayNames[i]),l
(2,20343-20390): run-time error JS1018: 'return' statement outside of function: return t+=Math.round(Date.now()/1e3).toString()
(2,20058-20119): run-time error JS1018: 'return' statement outside of function: return{isBespokeStackedStep:!1,previousVisibleStepIndex:null}
(2,19999-20057): run-time error JS1018: 'return' statement outside of function: return{isBespokeStackedStep:!0,previousVisibleStepIndex:e}
(2,19825-19941): run-time error JS1018: 'return' statement outside of function: return n?{isBespokeStackedStep:!0,previousVisibleStepIndex:e}:{isBackButtonVisible:!1,previousVisibleStepIndex:null}
(2,19599-19660): run-time error JS1018: 'return' statement outside of function: return{isBespokeStackedStep:!1,previousVisibleStepIndex:null}
(2,19422-19483): run-time error JS1018: 'return' statement outside of function: return{isBespokeStackedStep:!1,previousVisibleStepIndex:null}
(2,19267-19278): run-time error JS1018: 'return' statement outside of function: return null
(2,19258-19266): run-time error JS1018: 'return' statement outside of function: return r
(2,19053-19064): run-time error JS1018: 'return' statement outside of function: return null
(2,19035-19043): run-time error JS1018: 'return' statement outside of function: return u
 */
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.AuthenticatedWidgetHelpers=$$WP.Scheduling.AuthenticatedWidgetHelpers||{},$$WP.Scheduling.OnMyWay=$$WP.Scheduling.OnMyWay||{},$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers=$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers||{},$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers.SetUpWidget=function WP$Scheduling$OnMyWay$AuthenticatedWidgetHelpers$SetUpWidget(e){var t=$afe.select("#root");$$WPUtil.canWriteCookies()?($$WPUtil.ShowAjaxSpinner($afe.select(".ajaxspinner")),initLegacyWidgetAuth(e,(function(){$.ajax({url:makeLink("Widget/GetWidgetAuthCode"),type:"POST",cache:!1,data:{apiKey:e},dataType:"json",headers:{Authorization:$$WP.WidgetAccessToken},success:$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers.RedirectToAuthWidget})}))):$$WPUtil.canWriteCookiesAsync().then((function(e){if(!e)return t.hide(),void(window.self===window.top?$afe.select("#noCookiesError").show():$afe.select("#noCookies").show())}))},$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers.RedirectToAuthWidget=function WP$Scheduling$OnMyWay$AuthenticatedWidgetHelpers$RedirectToAuthWidget(e){var t=e.AuthCode;if($$WPUtil.IsNullOrEmpty(t))$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers.RedirectToStandardWidget();else{var i=location.search+"&authcode="+t,n=makeLink("OnMyWay/AuthenticatedWidget")+i;location.assign(n)}},$$WP.Scheduling.OnMyWay.AuthenticatedWidgetHelpers.RedirectToStandardWidget=function WP$Scheduling$OnMyWay$AuthenticatedWidgetHelpers$RedirectToStandardWidget(){var e=new URLSearchParams(location.search);e.delete("apiKey"),location.assign(makeLink("OnMyWay/Widget?"+e.toString()))},$$WP.Scheduling.AuthenticatedWidgetHelpers.RefreshAuthCode=function WP$Scheduling$AuthenticatedWidgetHelpers$RefreshAuthCode(){$.ajax({url:makeLink("Widget/RefreshAuthCode"),type:"POST",cache:!1,success:$$WP.Scheduling.AuthenticatedWidgetHelpers.__onAuthCodeRefreshed})},$$WP.Scheduling.AuthenticatedWidgetHelpers.__onAuthCodeRefreshed=function WP$Scheduling$AuthenticatedWidgetHelpers$__onAuthCodeRefreshed(e){var t=e.AuthCode;if(!$$WPUtil.IsNullOrEmpty(t)){var i=new URLSearchParams(location.search);i.set("authcode",t),location.search="?"+i.toString()}};;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Utilities=$$WP.Scheduling.Utilities||{},$$WPSchedulingUtil=$$WP.Scheduling.Utilities,$$WPSchedulingUtil.PreloginTimeoutSeconds=600,$$WPSchedulingUtil.PreloginTimer=null,$$WPSchedulingUtil.FocusElement=function WP$Scheduling$Utilities$FocusElement(e,t=!1){$$WP.WidgetMode&&!document.hasFocus()||e&&e[0]&&e[0].focus({preventScroll:t})},$$WPSchedulingUtil.AnnounceMessage=function WP$Scheduling$Utilities$AnnounceMessage(e){var t=$afe.select("#announcementcontainer");t.empty();var i=$$WP.SimpleTemplates.Span({id:"announcementtext",class:"offscreen","aria-live":"assertive","aria-atomic":"true",role:"alert"});i.text(e),t.safeAppend(i)},$$WPSchedulingUtil.ScrollToTopOfPageIfEmbeddedInIframe=function WP$Scheduling$Utilities$ScrollToTopOfPageIfEmbeddedInIframe(){(isDataTile()||$$WP.WidgetMode)&&$$WPSchedulingUtil.ScrollToTopOfPage()},$$WPSchedulingUtil.ScrollToTopOfPage=function WP$Scheduling$Utilities$ScrollToTopOfPage(){var e=$afe.jq($afe.select("div.actionNodeWorkflow.active div.nodeTitle")).height(),t=$afe.select("#wrap"),i=!!document.querySelector("#main h1");$$WP.WidgetMode&&!document.hasFocus()||(isDataTile()?scrollTopOfTheIframe(0,!0):$$WP.WidgetMode?$$WPUtil.ScrollTopOfTheIframeCrossDomain():$$WP.Utilities.UI.IsMobile&&e>0?$$WPUtil.SmoothScrollToElementWithOffset($$WPUtil.ScrollableBody(),t,e,300):$$WP.Utilities.UI.IsSmallScreen()&&$$WP.Utilities.UI.IsLoggedIn&&i?($$WP.Utilities.UI.CollapseHeader(),$$WPUtil.SmoothScrollToElementWithOffset($$WPUtil.ScrollableBody(),$afe.select("#main"),-13,300)):$$WPUtil.SmoothScrollToElement($$WPUtil.ScrollableBody(),t,300))},$$WPSchedulingUtil.RemoveDuplicateElementsFromArray=function WP$Scheduling$Utilities$RemoveDuplicateElementsFromArray(e){var t=0,i=null,n=[];for(t=0;t<e.length;t++)i=e[t],-1===n.indexOf(i)&&n.push(i);return n},$$WPSchedulingUtil.IsValueInAllArrays=function WP$Scheduling$Utilities$IsValueInAllArrays(e,t){var i=0;for(i=0;i<t.length;i++)if(-1===t[i].indexOf(e))return!1;return!0},$$WPSchedulingUtil.GetIntersectionOfArrays=function WP$Scheduling$Utilities$GetIntersectionOfArrays(e){var t,i=0,n=[],l=null;for(t=e.shift(),i=0;i<t.length;i++)l=t[i],$$WPSchedulingUtil.IsValueInAllArrays(l,e)&&n.push(l);return n},$$WPSchedulingUtil.GetUnionOfArrays=function WP$Scheduling$Utilities$GetUnionOfArrays(e){var t=0,i=0,n=[],l=[];for(t=0;t<e.length;t++)for(n=e[t],i=0;i<n.length;i++)-1===l.indexOf(n[i])&&l.push(n[i]);return l},$$WPSchedulingUtil.DoAllArraysContainTheSameValues=function WP$Scheduling$Utilities$DoAllArraysContainTheSameValues(e){var t=$$WPSchedulingUtil.GetUnionOfArrays(e),i=$$WPSchedulingUtil.GetIntersectionOfArrays(e);return t.length>0&&t.length===i.length},$$WPSchedulingUtil.ConstructAppointmentStringHtml=function WP$Scheduling$Utilities$ConstructAppointmentStringHtml(e,t,i,n,l){var r,o=$$WP.Strings.getNamespace("Scheduling"),u="",d="",a="",$="",s="",c="",S=null,g=n&&!!e&&!$$WP.Utilities.IsNullOrEmpty(e.Name);return l=!!l,o.addMnemonics({"@MYCHART@DEPARTMENT@":{Value:t.Name,EncodingType:$$WP.Strings.EncodingTypes.HTML},"@MYCHART@REASONFORVISIT@":{Value:i,EncodingType:$$WP.Strings.EncodingTypes.HTML}}),g?l?(S=document.createElement("use"),s=makeStaticImageLink("library.svg#hyperlink"),S.setAttribute("xlink:href",s),c=new Handlebars.SafeString(S.outerHTML),o.addMnemonic("@MYCHART@PROVIDER@",e.Name,$$WP.Strings.EncodingTypes.HTML),a=o.getString("ProviderDetailsTooltip"),$=o.getString("ProviderDetailsLabel"),d='<a class="providerBioLink" href="'+makeLink(e.WebPageUrl)+'" aria-label="'+$+'" target="_blank" title="'+a+'">'+HTMLEncode(e.Name)+'<svg class="jumpArrow" aria-hidden="true">'+c+"</svg></a>",o.addMnemonic("@MYCHART@LINKEDPROVIDER@",d,$$WP.Strings.EncodingTypes.None),u="ConfirmRfvWithLinkedProvider"):(o.addMnemonic("@MYCHART@PROVIDER@",e.Name,$$WP.Strings.EncodingTypes.HTML),u="ConfirmProviderRfv"):(o.addMnemonic("@MYCHART@PROVIDER@","",$$WP.Strings.EncodingTypes.HTML),u="ConfirmRfv"),r=o.getString(u),o.removeMnemonic("@MYCHART@PROVIDER@"),o.removeMnemonic("@MYCHART@LINKEDPROVIDER@"),o.removeMnemonic("@MYCHART@DEPARTMENT@"),o.removeMnemonic("@MYCHART@REASONFORVISIT@"),r},$$WPSchedulingUtil.GetVTMWarningMessages=function WP$Scheduling$Utilities$GetVTMWarningMessages(e){var t=[],i=$$WP.Strings.getNamespace("Scheduling");if(e)for(var n=0;n<e.length;n++)i.addMnemonics({"@MYCHART@MINIMUMAGE1@":{Value:e[n].MinAge1,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@MAXIMUMAGE1@":{Value:e[n].MaxAge1,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@MINIMUMAGE2@":{Value:e[n].MinAge2,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@MAXIMUMAGE2@":{Value:e[n].MaxAge2,EncodingType:$$WP.Strings.EncodingTypes.None}}),t.push(i.getString(e[n].WarningCode)),i.clearMnemonics();return t},$$WPSchedulingUtil.GetVTMWarningBannerModel=function WP$Scheduling$Utilities$GetVTMWarningBannerModel(e){var t=null,i=0,n=$$WPSchedulingUtil.GetVTMWarningMessages(e),l=$$WP.Strings.getNamespace("Scheduling");if(n.length>0)if((t={}).BannerType="informationalType",t.DisableDetailTextHtmlEncoding=!0,1===n.length)t.DetailText="<span>"+HTMLEncode(n[0])+"</span>";else{for(t.DetailText="<span>"+HTMLEncode(l.getString("GenericAgeVTMWarning"))+'</span><ul class="VTMWarningList">',i=0;i<n.length;i++)t.DetailText+="<li>"+HTMLEncode(n[i])+"</li>";t.DetailText+="</ul>"}return t},$$WPSchedulingUtil.BuildProvidersFiltered=function WP$Scheduling$Utilities$BuildProvidersFiltered(e,t,i,n,l,r){var o,u,d={};for(o=0;o<l.length;o++)d[l[o].ID]=!0;return u=$$WPSchedulingUtil.BuildProviderDepartmentPairsFiltered(e,i,n),$$WPSchedulingUtil.AddProvidersFromProviderDepartmentPairs(u,t,d,r)},$$WPSchedulingUtil.BuildProviderDepartmentPairsFiltered=function WP$Scheduling$Utilities$BuildProviderDepartmentsFiltered(e,t,i){var n=[];return i&&(n=e&&t?i.RequestProviderDepartmentPairs:i.AllProviderDepartmentPairs),n},$$WPSchedulingUtil.AddProvidersFromProviderDepartmentPairs=function WP$Scheduling$Utilities$AddProvidersFromProviderDepartmentPairs(e,t,i,n){var l,r=0,o=null,u=null,d=[];for(l=e.length,r=0;r<l;r++)o=e[r],t&&!i[o.DepartmentId]||(u=o.Provider,!n&&u.OtherOption||-1!==d.indexOf(u)||d.push(u));return d},$$WPSchedulingUtil.GetMinutesAndHoursFromMinutes=function $$WPSchedulingUtil$GetMinutesAndHoursFromMinutes(e){var t,i,n=$$WP.Strings.getNamespace("Scheduling"),l=Math.floor(e/60),r=e%60;return!e||e<=0?"":(n.addMnemonics({"@MYCHART@HOURS@":{Value:l,EncodingType:$$WP.Strings.EncodingTypes.HTML},"@MYCHART@MINUTES@":{Value:r,EncodingType:$$WP.Strings.EncodingTypes.HTML}}),i=$$WPSchedulingUtil.GetDurationStringResourceName(l,r),t=n.getString(i),n.removeMnemonic("@MYCHART@HOURS@"),n.removeMnemonic("@MYCHART@MINUTES@"),t)},Handlebars.registerHelper("durationInHoursAndMinutes",$$WPSchedulingUtil.GetMinutesAndHoursFromMinutes),$$WPSchedulingUtil.GetRoughProgressThroughWorkflow=function $$WPSchedulingUtil$GetRoughProgressThroughWorkflow(e,t){return 5*Math.round(20*e/t)},$$WPSchedulingUtil.GetDurationStringResourceName=function $$WPSchedulingUtil$GetDurationStringResourceName(e,t){return e>1?t>0?"DurationHoursAndMinutes":"DurationHours":1===e?t>0?"DurationHourAndMinutes":"DurationOneHour":"DurationMinutes"},$$WPSchedulingUtil.CanUsePermissionsApi=function $$WPSchedulingUtil$CanUsePermissionsApi(){return"object"==typeof navigator.permissions},$$WPSchedulingUtil.CheckIfGeolocationPermissionsAreDenied=function $$WPSchedulingUtil$CheckIfGeolocationPermissionsAreDenied(e){$$WPSchedulingUtil.CanUsePermissionsApi()&&navigator.permissions.query({name:"geolocation"}).then((function(t){"denied"===t.state&&e()}))},$$WPSchedulingUtil.HandleStickyBanner=function $$WPSchedulingUtil$HandleStickyBaner(){setTimeout((function(){$afe.jq(window).trigger("handleStickyBanner")}),0)},$$WPSchedulingUtil.GetDateFieldValidationSettings=function $$WPSchedulingUtil$GetDateFieldValidationSettings(e,t,i){return new $$WP.FormValidation.ValidationSettings({required:i,isDate:!0,minDate:e,maxDate:t})},$$WPSchedulingUtil.FormatDteAsDate=function $$WPSchedulingUtil$FormatDteAsDate(e){var t=null,i="";return $$WPUtil.IsNullOrEmpty(e)||(t=new $$WP.I18N.Date(formatDate(WP.Utils.dte2date(e)),"string"),i=$$WP.I18N.formatPatientGivenDate(t.DateObject)),i},$$WPSchedulingUtil.ShouldTreatAsAnonymous=function $$WPSchedulingUtil$ShouldTreatAsAnonymous(e){return e.IsAnonymous||e.IsFromPrelogin},$$WPSchedulingUtil.SetPreloginTimeout=function $$WPSchedulingUtil$SetPreloginTimeout(){function popupWarning(){var e={positioningFunction:$$WP.WidgetMode?$$WPContain.Positions.InsideNearTop:$$WPContain.Positions.InsideCentered},t={SecondsLeft:30,isPreLogin:!0},i=function getRedirectURL(){for(var e=this.window.location.href,t=["slotuid","slotUid"],i="",n=0;n<t.length;n++)i=t[n],$$WPUtil.IsNullOrEmpty($$WPUtil.GetQueryStringParameterValue(e,i))||(e=$$WPSchedulingUtil.RemoveQueryStringParameter(e,i));return e}();$$WPUtil.IsNullOrEmpty(i)||(t.preLoginRedirectURL=i),$$WPUtil.quickPopup(new $$WPComp.TimeoutWarningComponent(t),e),e.positioningFunction===$$WPContain.Positions.InsideNearTop&&$$WPSchedulingUtil.ScrollToTopOfPage()}function resetTimer(){$$WPSchedulingUtil.ClearPreloginTimeout(),$$WPSchedulingUtil.PreloginTimer=setTimeout(popupWarning,1e3*$$WPSchedulingUtil.PreloginTimeoutSeconds)}$$WP.Utilities.UI.IsLoggedIn||$$WP.WidgetMode&&!document.hasFocus()||(resetTimer(),document.addEventListener("click",resetTimer,!0),document.addEventListener("keydown",resetTimer,!0),document.addEventListener("scroll",resetTimer,!0))},$$WPSchedulingUtil.ClearPreloginTimeout=function $$WPSchedulingUtil$ClearPreloginTimeout(){clearTimeout($$WPSchedulingUtil.PreloginTimer)},$$WPSchedulingUtil.RemoveQueryStringParameter=function $$WPSchedulingUtil$GetQueryStringParameterValue(e,t){var i=e.split("?"),n=i[0],l=new URLSearchParams(i[1]);return l.delete(t),n+"?"+l.toString()},$$WPSchedulingUtil.GetEndpointUrl=function $$WPSchedulingUtil$GetEndpointUrl(e,t){return $$WP.WidgetMode?"Scheduling/Embedded/"+e:$$WPSchedulingUtil.IsWorkflowTreatedAsAnonymous(t)?"Scheduling/Anonymous/"+e:"Scheduling/"+e},$$WPSchedulingUtil.RedirectToLogin=function $$WPSchedulingUtil$RedirectToLogin(e,t,i,n){$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("SchedulingRedirectToLogin",t)),data:$$WPUtil.postify(e),cache:!1,success:i,error:n})},$$WPSchedulingUtil.IsWorkflowTreatedAsAnonymous=function $$WpSchedulingUtil$IsWorkflowTreatedAsAnonymous(e){return e.IsAnonymous},$$WPSchedulingUtil.SetUpInstructions=function $$WPSchedulingUtil$SetUpInstructions(e){var t,i,n=$afe.select("#apptinstructions .visitinstructionscontent"),l=$afe.select("#deptinstructions .visitinstructionscontent");l=l.not(":has(.instructionContent)"),n=n.not(":has(.instructionContent)"),e||(e=$$WPSchedulingUtil.SetUpInstructionsViewModel(n,l)),n.length>0&&new $$WP.Visits.PatientInstructionController(n,e.PatientInstructions),e.CanShowDepartmentDirections&&l.length>0&&($$WP.Strings.setDefaultNamespace("Visits"),t=e.DepartmentDirections.join("</br>"),i=$$WP.Strings.get("ViewFullDirectionsButtonText"),new $$WP.Visits.PatientInstructionController(l,t,null,i))},$$WPSchedulingUtil.SetUpInstructionsViewModel=function $$WPSchedulingUtil$SetUpInstructionsViewModel(e,t){var i={};return e.length>0&&(i.PatientInstructions=e[0].innerHTML),t.length>0&&(i.DepartmentDirections=[t[0].innerHTML],i.DepartmentDirections&&(i.CanShowDepartmentDirections=!0)),i},$$WPSchedulingUtil.ReturnToStep=function $$WPSchedulingUtil$ReturnToStep(e,t,i,n,l){var r;null!==(r=$$WPSchedulingUtil.GetStepModelOfTypeNoAncestor(t,e,l))?(n&&$$WPSchedulingUtil.SetPropertyOnStepAndAncestors(r,t,"ForceShowOnce",!0),$$WPSchedulingUtil.SetPropertyOnStepAndAncestors(r,t,"ActiveStatus",$$WP.Scheduling.SchedulingStep.ActiveEnum.Active)):$.isFunction(i)&&i()},$$WPSchedulingUtil.ReturnToSlotStepAndReloadSlots=function $$WPSchedulingUtil$ReturnToSlotStepAndReloadSlots(e){e.AppointmentBuilder.deselectAllSlots(),$$WPSchedulingUtil.ReturnToStep($$WP.Scheduling.SchedulingStep.StepTypeEnum.Slot,e,null,!1),e.AppointmentBuilder.setProperty("CountOfFailedAttemptsToReviewSlot",e.AppointmentBuilder.CountOfFailedAttemptsToReviewSlot+1)},$$WPSchedulingUtil.CanEditStep=function $$WPSchedulingUtil$CanEditStep(e,t,i,n){var l,r,o;return r=$$WPSchedulingUtil.CanEditIfHidden(t),l=$$WPSchedulingUtil.GetStepModelOfType(e,i),o=$$WPSchedulingUtil.CanEditStepType(e,i),!!l&&o&&(!l.IsHidden||r)&&!n},$$WPSchedulingUtil.CanEditIfHidden=function $$WPSchedulingUtil$CanEditIfHidden(e){return $$WP.Scheduling.Workflow.isWorkflowTypeOpenSchedulingWidget(e)},$$WPSchedulingUtil.CanEditStepType=function $$WPSchedulingUtil$CanEditIfHidden(e,t){switch(t){case $$WP.Scheduling.SchedulingStep.StepTypeEnum.Location:return $$WPSchedulingUtil.CanEditLocation(e);case $$WP.Scheduling.SchedulingStep.StepTypeEnum.Provider:return $$WPSchedulingUtil.CanEditProvider(e);default:return!0}},$$WPSchedulingUtil.CanEditLocation=function $$WPSchedulingUtil$CanEditLocation(e){var t=null,i=null,n=0,l=e.SchedulingSteps.Models,r=e.AppointmentBuilder.getAppointment(e.AppointmentBuilder.getActiveApptIndex()),o=r.VisitType,u=e.AppointmentBuilder.AvailableLocations;for(n=0;n<l.length;n++)(i=l[n]).Type===$$WP.Scheduling.SchedulingStep.StepTypeEnum.Location&&(t=i);return(!u||1!==e.AppointmentBuilder.AvailableLocations[e.AppointmentBuilder.getActiveApptIndex()].length)&&(!(!t||t.IsHidden)||(!!e.AppointmentBuilder.hasMultipleInPersonLocations()||!!(o&&o.ShowLocationStepForTelehealthVisit&&r.hasAValidLocation())))},$$WPSchedulingUtil.CanEditProvider=function $$WPSchedulingUtil$CanEditProvider(e){return e.AppointmentBuilder.hasAppointmentThatAllowsProviderSelection()},$$WPSchedulingUtil.GetStepModelOfType=function $$WPSchedulingUtil$GetStepModelOfType(e,t){for(var i=null,n=0;n<e.SchedulingSteps.Models.length;n++)if(e.SchedulingSteps.Models[n].Type===t)return i=e.SchedulingSteps.Models[n],$$WPSchedulingUtil.GetStepAncestor(i,e);return null},$$WPSchedulingUtil.GetStepModelOfTypeNoAncestor=function $$WPSchedulingUtil$GetStepModelOfTypeNoAncestor(e,t,i){var n=0;for(null==i&&(i=0),n=0;n<e.SchedulingSteps.Models.length;n++)if(e.SchedulingSteps.Models[n].Type===t){if(0===i)return e.SchedulingSteps.Models[n];i--}return null},$$WPSchedulingUtil.SetPropertyOnStepAndAncestors=function $$WPSchedulingUtil$GetStepAncestor(e,t,i,n){for(e.setProperty(i,n);e&&""!==e.StackId;)(e=t.SchedulingSteps.getFromIndex("ID",e.StackId)).setProperty(i,n)},$$WPSchedulingUtil.GetStepAncestor=function $$WPSchedulingUtil$GetStepAncestor(e,t){for(;e&&""!==e.StackId;)e=t.SchedulingSteps.getFromIndex("ID",e.StackId);return e},$$WPSchedulingUtil.GetLocationsSummaryArray=function $$WPSchedulingUtil$GetLocationsSummaryArray(e){var t=0,i=0,n=null,l=[],r=[],o=!0;if($$WPSchedulingUtil.AllowsLocationsSeparate(e)){for(t=0;t<e.AppointmentBuilder.numAppointments();t++)n=e.AppointmentBuilder.getAppointment(t),o=o&&n.IsLocationAnyOptionSelected;for(t=0;t<e.AppointmentBuilder.numAppointments();t++)r=$$WPSchedulingUtil.GetLocationsSummaryArrayForAppt(e,t,l,o),l=l.concat(r)}else i=e.AppointmentBuilder.getActiveApptIndex(),n=e.AppointmentBuilder.getAppointment(i),r=$$WPSchedulingUtil.GetLocationsSummaryArrayForAppt(e,i,l,n.IsLocationAnyOptionSelected),l=l.concat(r);return $$WPSchedulingUtil.TrimViewModelArray(l,1)},$$WPSchedulingUtil.GetLocationsSummaryArrayForAppt=function $$WPSchedulingUtil$GetLocationsSummaryArrayForAppt(e,t,i,n){var l=null,r=[],o=null,u=$$WP.Scheduling.Location.SortMethodEnum.Alphabetically;return l=e.AppointmentBuilder.getAppointment(t),n?(o=e.Locations.getFromIndex("Id","-1"),-1===i.indexOf(o)&&r.push(o)):(r=l.Locations.toArray().slice(),$$WP.Scheduling.Location.sortLocations(r,u)),r},$$WPSchedulingUtil.AllowsLocationsSeparate=function $$WPSchedulingUtil$AllowsLocationsSeparate(e){var t=e.AppointmentBuilder.getFirstAppointment().PanelId,i=!$$WPUtil.IsNullOrEmpty(t),n=!$$WPUtil.IsNullOrEmpty(e.AppointmentBuilder.getFirstAppointment().BundleId);return i?e.VisitTypes.getFromIndex("ID",t).HasSeparateLocationSelectionInPanels:!!n&&e.HasSeparateLocationSelectionInTicketBundles},$$WPSchedulingUtil.GetProvidersSummaryArray=function $$WPSchedulingUtil$GetProvidersSummaryArray(e){var t=0,i=0,n=[],l=[];if(e.AppointmentBuilder.IsSlotStepMultiApptPreGrouped)for(t=0;t<e.AppointmentBuilder.numAppointments();t++)l=$$WPSchedulingUtil.GetProvidersSummaryArrayForAppt(e,t,n),n=n.concat(l);else i=e.AppointmentBuilder.getActiveApptIndex(),l=$$WPSchedulingUtil.GetProvidersSummaryArrayForAppt(e,i,n),n=n.concat(l);return $$WPSchedulingUtil.TrimViewModelArray(n,1)},$$WPSchedulingUtil.GetProvidersSummaryArrayForAppt=function $$WPSchedulingUtil$GetProvidersSummaryArrayForAppt(e,t,i){var n=null,l=[],r=null;return n=e.AppointmentBuilder.getAppointment(t),$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(e.AppointmentBuilder,n)&&(n.IsProviderAnyOptionSelected?(r=e.Providers.getFromIndex("ID","-2"),-1===i.indexOf(r)&&l.push(r)):(l=n.Providers.toArray().slice()).sort($$WP.Scheduling.Provider.sortProviders)),l},$$WPSchedulingUtil.TrimViewModelArray=function $$WPSchedulingUtil$TrimViewModelArray(e,t){var i=0,n=[];return $$WPUtil.IsNullOrEmpty(t)&&(t=3),(n=$$WPSchedulingUtil.RemoveDuplicateElementsFromArray(e)).length>t+1&&(i=n.length,n.splice(t),n.push({Name:i-t+" "+$$WP.Strings.get("MoreLabel","Scheduling")})),n},$$WPSchedulingUtil.GetCondensedFilterString=function $$WPSchedulingUtil$GetCondensedFilterString(e){var t="";return 1===e.length?t=e[0].Name:2===e.length&&($$WP.Strings.addMnemonic("@MYCHART@LOCATION1@",e[0].Name),$$WP.Strings.addMnemonic("@MYCHART@LOCATION2@",e[1].Name),t=$$WP.Strings.getNamespace("Scheduling").getStringForTemplate("SelectedLocations"),$$WP.Strings.removeMnemonic("@MYCHART@LOCATION1@"),$$WP.Strings.removeMnemonic("@MYCHART@LOCATION2@")),t},$$WPSchedulingUtil.ShowWorkflowLoadingIndicator=function $$WPSchedulingUtil$ShowWorkflowLoadingIndicator(){$afe.select("#scheduling-workflow").addClass("faded"),$$WPUtil.ShowAjaxSpinner($afe.select(".schedulingSpinner .ajaxspinner"))},$$WPSchedulingUtil.HideWorkflowLoadingIndicator=function $$WPSchedulingUtil$HideWorkflowLoadingIndicator(){$afe.select("#scheduling-workflow").removeClass("faded"),$$WPUtil.HideAjaxSpinner($afe.select(".schedulingSpinner .ajaxspinner"))},$$WPSchedulingUtil.RegisterConfirmationPartials=function $$WPSchedulingUtil$RegisterConfirmationPartials(){Handlebars.registerPartial("Scheduling.SlotArrivalAndTime",$$WP.Templates.Scheduling.SlotArrivalAndTime),Handlebars.registerPartial("Scheduling.ConfirmationInfoRow",$$WP.Templates.Scheduling.ConfirmationInfoRow),Handlebars.registerPartial("Scheduling.SolutionDetailed",$$WP.Templates.Scheduling.SolutionDetailed),Handlebars.registerPartial("Scheduling.SolutionAlerts",$$WP.Templates.Scheduling.SolutionAlerts),Handlebars.registerPartial("Scheduling.Payment",$$WP.Templates.Scheduling.Payment)},$$WPSchedulingUtil.GetPreviousVisibleStep=function $$WPSchedulingUtil$GetPreviousVisibleStep(e,t,i,n){var l,r=0,{isBespokeStackedStep:o,previousVisibleStepIndex:u}=$$WPSchedulingUtil.TryHandleBespokeStackedSteps(e,t,i,n);if(o)return u;if(0===e)return null;for(l=t[e],i.SchedulingSteps.getFromIndex("ID",l.Id),r=e-1;r>=0;r--)if(l=t[r],i.SchedulingSteps.getFromIndex("ID",l.Id).CompleteStatus!==$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)return r;return null},$$WPSchedulingUtil.TryHandleBespokeStackedSteps=function $$WPSchedulingUtil$TryHandleBespokeStackedSteps(e,t,i,n){var l=t[e];if(!l._isStacked)return{isBespokeStackedStep:!1,previousVisibleStepIndex:null};var r=l._stackedWorkflowController;if(r._mode!==$$WP.Scheduling.StackedWorkflowController.ModesEnum.ShowOneAtATime)return{isBespokeStackedStep:!1,previousVisibleStepIndex:null};if(0!==r._currentStep){if(i.SchedulingSteps.getFromIndex("ID",r._stepControllers[r._currentStep].Id).Type===$$WP.Scheduling.SchedulingStep.StepTypeEnum.Reservation)return n?{isBespokeStackedStep:!0,previousVisibleStepIndex:e}:{isBackButtonVisible:!1,previousVisibleStepIndex:null};if(!r._stepControllers[0].hasAutoSelectedRequestSolution)return{isBespokeStackedStep:!0,previousVisibleStepIndex:e}}return{isBespokeStackedStep:!1,previousVisibleStepIndex:null}},$$WPSchedulingUtil.CreateBrowserId=function $$WPSchedulingUtil$createBrowserId(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",i=0;i<20;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t+=Math.round(Date.now()/1e3).toString()},$$WPSchedulingUtil.OnMyChartLinkClicked=function $$WPSchedulingUtil$OnMyChartLinkClick(e,t,i,n){var l,r=(new Date).toISOString(),o=makeLink(i);l=$$WPUtil.IsNullOrEmpty(n)?function(){$$WPUtil.TryRedirect(o)}:function(){WP.FdiUtils.ExecuteFDILink(n)},$$WP.Scheduling.SchedulingController.logSchedulingViewEvent($$WP.Analytics.ViewEvent.SubmodulesEnum.MyChartLinkStep,r,null,t,e,l)},$$WPSchedulingUtil.GetVisitDisplayName=function $$WPSchedulingUtil$GetVisitDisplayName(e,t,i){var n=0,l="",r=null,o="";if(e&&1===e.AppointmentRequestIds.length&&$$WPUtil.IsNullOrEmpty(e.PanelId)&&t)for(r=t.AppointmentRequests,o=e.AppointmentRequestIds[0],n=0;n<r.length;n++)r[n].ID===o&&(l=r[n].DisplayName);return $$WPUtil.IsNullOrEmpty(l)&&e&&e.VisitType&&(l=$$WPUtil.IsNullOrEmpty(i)||$$WPUtil.IsNullOrEmpty(e.VisitType.TelehealthModeDisplayNames)||$$WPUtil.IsNullOrEmpty(e.VisitType.TelehealthModeDisplayNames[i])?e.VisitType.DisplayName:e.VisitType.TelehealthModeDisplayNames[i]),l},$$WPSchedulingUtil.GetDisplayDepartmentAddress=function $$WPSchedulingUtil$GetDisplayDepartmentAddress(e){var t;for($$WPUtil.IsNullOrEmpty(e.Address)||(t=" • "),i=0;i<e.Address.length;i++)t+=" "+e.Address[i];return t},$$WPSchedulingUtil.GetDisplayPhonenumber=function $$WPSchedulingUtil$GetDisplayPhonenumber(e){var t;return $$WPUtil.IsNullOrEmpty(e.OverridePhoneNumber)?$$WPUtil.IsNullOrEmpty(e.PhoneNumber)||(t=" • "+e.PhoneNumber):t=" • "+e.OverridePhoneNumber,t},$$WPSchedulingUtil.GetVisitDisplayNameFromComponent=function $$WPSchedulingUtil$GetVisitDisplayNameFromComponent(e,t,i){var n=0,l="",r=null,o="";if(e&&1===e.AppointmentRequestIds.length&&!i&&t)for(r=t.AppointmentRequests,o=e.AppointmentRequestIds[0],n=0;n<r.length;n++)r[n].ID===o&&(l=r[n].DisplayName);return $$WPUtil.IsNullOrEmpty(l)&&e&&e.DefaultVisitType&&(l=e.DefaultVisitType.DisplayName),l},$$WPSchedulingUtil.IsStandaloneWidget=function $$WPSchedulingUtil$IsStandaloneWidget(e){return e.isTypeOpenSchedulingWidget()&&!$$WP.WidgetMode},$$WPSchedulingUtil.HideBackButton=function $$WPSchedulingUtil$HideBackButton(){var e=document.querySelector(".md_scheduling_index .previousstep");e&&e.classList.add("hidden")},$$WPSchedulingUtil.NullifyIfFalsy=function $$WPSchedulingUtil$NullifyIfFalsy(e){return e||null},$$WPSchedulingUtil.GetTimePreferenceRangeProps=function $$WPSchedulingUtil$GetTimePreferenceRangeProps(e){return{DayOfWeekIndex:e.data("day-index"),StartTime:$$WPSchedulingUtil.ParseTime(e.data("begin-time")),EndTime:$$WPSchedulingUtil.ParseTime(e.data("end-time")),RangeString:e.data("message-range-value"),RangeElement:e.data("range-element")}},$$WPSchedulingUtil.ParseTime=function $$WPSchedulingUtil$ParseTime(e){var t,i;if(2===(i=e.toUpperCase().split(" ")).length){if("PM"===i[1])t=12;else{if("AM"!==i[1])return;t=0}t+=parseInt(i[0])%12}else{if(1!==i.length)return;t=parseInt(i[0])}if(2===(i=i[0].split(":")).length)return 60*(t+=1*parseInt(i[1])/60)*60},$$WPSchedulingUtil.Reload=function $$WPSchedulingUtil$Reload(e){e?$$WP.Scheduling.AuthenticatedWidgetHelpers.RefreshAuthCode():location.reload()},$$WPSchedulingUtil.IsBundleForceSameDay=function $$WPSchedulingUtil$IsBundleForceSameDay(e){return!!e&&(!(!e.TicketInfo||!e.TicketInfo.IsForceSameDay)||!(!e.OriginalAppointmentInfo||!e.OriginalAppointmentInfo.IsForceSameDay))};;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ReactHelpers=$$WP.Scheduling.ReactHelpers||{},$$WP.Scheduling.ReactHelpers.convertStoreToLowercase=function WP$Scheduling$ReactHelpers$convertStoreToLowercase(e){var c={};return Object.keys(e).reduce((function(r,t){return"object"==typeof e[t]&&(r[$$WP.Scheduling.ReactHelpers.lowercaseProperty(t,c)]=$$WP.Scheduling.ReactHelpers.getLowercaseCollectionCopy(e[t],c)),r}))},$$WP.Scheduling.ReactHelpers.getLowercaseCollectionCopy=function WP$Scheduling$ReactHelpers$getLowercaseCollectionCopy(e,c){var r="";return Object.keys(e).reduce((function(t,l){return r=$$WP.Scheduling.ReactHelpers.lowercaseProperty(l,c),e[l],t[r]=$$WP.Scheduling.ReactHelpers.lowercaseObject(e[l],c),t}))},$$WP.Scheduling.ReactHelpers.lowercaseObject=function WP$Scheduling$ReactHelpers$lowercaseObject(e,c){var r=Object.keys(e),t="";return"string"==typeof e?e:e instanceof Date?e.toISOString():r.reduce((function(r,l){return t=$$WP.Scheduling.ReactHelpers.lowercaseProperty(l,c),Array.isArray(e[l])?r[t]=$$WP.Scheduling.ReactHelpers.lowercaseArray(e[l],c):e[l]instanceof $$WP.Common.ModelCollection?r[t]=$$WP.Scheduling.ReactHelpers.lowercaseArray(e[l].Models,c):e[l]&&"object"==typeof e[l]?r[t]=$$WP.Scheduling.ReactHelpers.lowercaseObject(e[l],c):r[t]=e[l],r}),{})},$$WP.Scheduling.ReactHelpers.lowercaseProperty=function WP$Scheduling$ReactHelpers$lowercaseProperty(e,c){if(!c[e])switch(e){case"ID":c[e]="id";break;case"DateTimeUtc":c[e]="displayDateTimeUtc";break;default:c[e]=e.slice(0,1).toLowerCase()+e.slice(1)}return c[e]},$$WP.Scheduling.ReactHelpers.lowercaseArray=function WP$Scheduling$ReactHelpers$lowercaseArray(e,c){var r=[],t=0;for(t=0;t<e.length;t++)r.push($$WP.Scheduling.ReactHelpers.lowercaseObject(e[t],c));return r};;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SlotReservationHelpers=$$WP.Scheduling.SlotReservationHelpers||{},$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners=$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners||{},$$WP.Scheduling.SlotReservationHelpers.MakeReservation=function WP$Scheduling$SlotReservationHelpers$MakeReservation(e,n,t,r){if(!e.IsSlotSelectionBlocked&&null===e.getFirstApptWithUnselectedSlot()){e.setProperty("IsSlotSelectionBlocked",!0);var i={appointmentBuilder:e.toSparseRawRequestObject(),workflow:n.toRawRequestObject(),clientTimeZoneOffset:(new Date).getTimezoneOffset()};$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("ReserveAppointment",n)),data:$$WPUtil.postify(i),success:t,error:r})}},$$WP.Scheduling.SlotReservationHelpers.DeleteReservationFromSlot=function WP$Scheduling$SlotReservationHelpers$DeleteReservationFromSlot(e,n){$$WPUtil.SendBeacon(makeLink($$WPSchedulingUtil.GetEndpointUrl("DeleteReservationFromSlot",n)),JSON.stringify(e.toRawObject())),$$WP.Scheduling.SlotReservationHelpers.DestroyReservationCleanUpListenerFromSlot(e)},$$WP.Scheduling.SlotReservationHelpers.CleanUpOpenSchedulingSession=function WP$Scheduling$SlotReservationHelpers$CleanUpOpenSchedulingSession(e){$$WPUtil.SendBeacon(makeLink("Scheduling/Anonymous/CleanUpOpenSchedulingSession"),e),$$WP.Scheduling.SlotReservationHelpers.DestroyReservationCleanUpListenerFromToken(e)},$$WP.Scheduling.SlotReservationHelpers.CreateReservationCleanUpListenerFromSlot=function WP$Scheduling$SlotReservationHelpers$CreateReservationCleanUpListenerFromSlot(e,n){var t=$.proxy((function(){$$WP.Scheduling.SlotReservationHelpers.DeleteReservationFromSlot(e,n)}),this);WP.Events.addListener(window,"pagehide",t),$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e.ReservationKey]=t},$$WP.Scheduling.SlotReservationHelpers.CreateReservationCleanUpListenerFromToken=function WP$Scheduling$SlotReservationHelpers$CreateReservationCleanUpListenerFromToken(e){var n=$.proxy((function(){$$WP.Scheduling.SlotReservationHelpers.CleanUpOpenSchedulingSession(e)}),this);WP.Events.addListener(window,"pagehide",n),$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e]=n},$$WP.Scheduling.SlotReservationHelpers.DestroyReservationCleanUpListenerFromSlot=function WP$Scheduling$SlotReservationHelpers$DestroyReservationCleanUpListenerFromSlot(e){var n=$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e.ReservationKey];WP.Events.removeListener(window,"pagehide",n),$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e.ReservationKey]=null},$$WP.Scheduling.SlotReservationHelpers.DestroyReservationCleanUpListenerFromToken=function WP$Scheduling$SlotReservationHelpers$DestroyReservationCleanUpListenerFromToken(e){var n=$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e];WP.Events.removeListener(window,"pagehide",n),$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e]=null},$$WP.Scheduling.SlotReservationHelpers.DestroyAllReservationCleanUpListeners=function WP$Scheduling$SlotReservationHelpers$DestroyAllReservationCleanUpListeners(){var e=null,n=null;for(e in $$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners)n=$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners[e],$$WPUtil.IsNullOrEmpty(n)||WP.Events.removeListener(window,"pagehide",n);$$WP.Scheduling.SlotReservationHelpers.__reservationCleanUpListeners={}};;
!function WP$Scheduling$OriginalAppointmentInfoController$definition(){var t=$$WP.Scheduling.ReactHelpers,n=function WP$Scheduling$OriginalAppointmentInfoController(){this.WP$Controllers$Controller(),this.proxify("__registerReactHandlers","__tryToSetActiveAppointment")},i=null,s_getInstance=function(){return i||(i=new n),i},s_$getRoot=function(){var t=$afe.select("#OriginalAppointmentInfo");return 0===t.length&&(t=$$WP.SimpleTemplates.Div({id:"OriginalAppointmentInfo"})),t};n.prototype={originalApptCount:0,__$parent:null,__isFirstRender:!0,__setActiveAppointment:null,__appointmentDatToActivate:"",__initializeData:function WP$Scheduling$OriginalAppointmentInfoController$__initializeData(n,i){var e={originalAppointments:t.lowercaseArray(n,{}),workflowType:i,register:this.__registerReactHandlers};EpicPx.addReactPortal("@epic-px/scheduling","OriginalAppointmentInfoHost",e,"OriginalAppointmentInfoHost"),this.originalApptCount=n.length},__registerReactHandlers:function WP$Scheduling$OriginalAppointmentInfoController$__registerReactHandlers(t){this.__setActiveAppointment=$.proxy((function(){t(this.__appointmentDatToActivate),this.__appointmentDatToActivate=""}),this),$$WPUtil.IsNullOrEmpty(this.__appointmentDatToActivate)||this.__setActiveAppointment()},__tryToSetActiveAppointment:function WP$Scheduling$OriginalAppointmentInfoController$__tryToSetActiveAppointment(t){this.__appointmentDatToActivate=t,this.__setActiveAppointment&&this.__setActiveAppointment()},__render:function WP$Scheduling$OriginalAppointmentInfoController$__render(t){var n=s_$getRoot();this.__$parent=t,this.__$parent.safeAppend(n),this.__isFirstRender&&(EpicPx.addReactPortal("@epic-px/scheduling","OriginalAppointmentInfo",{},"OriginalAppointmentInfo"),this.__isFirstRender=!1)},__stashPortal:function WP$Scheduling$OriginalAppointmentInfoController$__stashPortal(){var t=s_$getRoot();$afe.select("#OriginalAppointmentInfoHost").safeAppend(t)},__destroy:function WP$Scheduling$OriginalAppointmentInfoController$__destroy(){this.__initializeData([]),EpicPx.removeReactPortal("OriginalAppointmentInfo"),EpicPx.removeReactPortal("OriginalAppointmentInfoHost")}},n.Initialize=function(t,n){s_getInstance().__initializeData(t,n)},n.Update=function(t,n,i){var e=s_getInstance(),o="",r=1===t.AppointmentBuilder.numAppointments()&&e.originalApptCount>1;(i||r)&&(o=function(t){var n=t.AppointmentBuilder.getAppointment(t.AppointmentBuilder.getActiveApptIndex());return n?n.RescheduleDat:""}(t)),e.__tryToSetActiveAppointment(o),e.__render(n)},n.Render=function(t){s_getInstance().__render(t)},n.StashPortal=function(){s_getInstance().__stashPortal()},n.Destroy=function(){s_getInstance().__destroy()},n.extend($$WP.Controllers.Controller,"WP$Scheduling$OriginalAppointmentInfoController"),$$WP.Scheduling.OriginalAppointmentInfoController=n}();;
!function WP$EventManager$definition(){var e=function WP$Scheduling$EventManager(){this.__collectionEventListeners=[],this.__collectionPropertyEventListeners=[],this.__modelPropertyEventListeners=[]};e.prototype={__collectionEventListeners:[],__collectionPropertyEventListeners:[],__modelPropertyEventListeners:[],addCollectionEventListener:function WP$Scheduling$EventManager$addCollectionEventListener(e,t,n,r){var o=e.addCollectionEventListener(t,n,r),i={Collection:e,EventName:t,ListenerId:o};this.__collectionEventListeners.push(i)},addCollectionPropertyListener:function WP$Scheduling$EventManager$addPropertyListener(e,t,n,r){var o=e.addPropertyListener(t,n,r),i={Collection:e,PropertyName:t,ListenerId:o};this.__collectionPropertyEventListeners.push(i)},addModelPropertyListener:function WP$Scheduling$EventManager$addModelPropertyListener(e,t,n,r){var o=e.addPropertyListener(t,n,r),i={Model:e,PropertyName:t,ListenerId:o};this.__modelPropertyEventListeners.push(i)},removelListenersFromModel:function WP$Scheduling$EventManager$removeListenersFromModel(e){var t=null,n=0;for(n=this.__modelPropertyEventListeners.length-1;n>=0;n--)(t=this.__modelPropertyEventListeners[n]).Model===e&&(t.Model.removePropertyListener(t.ListenerId),this.__modelPropertyEventListeners.splice(n,1))},removeAllListeners:function WP$Scheduling$EventManager$removeAllListeners(){var e=null,t=0;for(t=0;t<this.__collectionEventListeners.length;t++)(e=this.__collectionEventListeners[t]).Collection.removeCollectionEventListener(e.EventName,e.ListenerId);for(this.__collectionEventListeners=[],t=0;t<this.__collectionPropertyEventListeners.length;t++)(e=this.__collectionPropertyEventListeners[t]).Collection.removePropertyListener(e.PropertyName,e.ListenerId);for(this.__collectionPropertyEventListeners=[],t=0;t<this.__modelPropertyEventListeners.length;t++)(e=this.__modelPropertyEventListeners[t]).Model.removePropertyListener(e.ListenerId);this.__modelPropertyEventListeners=[]}},$$WP.Scheduling.EventManager=e}();;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Utilities=$$WP.Scheduling.Utilities||{},$$WPSchedulingUtil=$$WP.Scheduling.Utilities,$$WPSchedulingUtil.GetCaptchaLightbox=function WP$Scheduling$Utilities$GetCaptchaLightbox(t){return resetLightbox(),showLightBox('<div class="captchaLightbox"></div>',t),$afe.select("#lightbox").addClass("captchaPopup"),$afe.select(".captchaLightbox")},$$WPSchedulingUtil.InitializeCaptchaLightbox=function WP$Scheduling$Utilities$InitializeCaptchaLightbox(){adjustLightbox(),$$WPSchedulingUtil.__setLightboxAriaProps(),$$WPSchedulingUtil.__addLightboxKeydownListener(),$$WPSchedulingUtil.__addLightboxCloseButton(),$$WPSchedulingUtil.__addLightboxHeader(),$afe.select("#ReservationStepTitle").focus(),$$WPSchedulingUtil.ScrollToTopOfPageIfEmbeddedInIframe(),isDataTile()&&(WP.DOM.Browser.isIPhone||WP.DOM.Browser.isIPad||WP.DOM.Browser.isIPod)&&window.setTimeout((function(){adjustLightbox()}),300)},$$WPSchedulingUtil.IsCaptchaLightboxOpen=function WP$Scheduling$Utilities$IsCaptchaLightboxOpen(){return 0!==$afe.select(".captchaLightbox").length},$$WPSchedulingUtil.__setLightboxAriaProps=function WP$Scheduling$Utilities$__setLightboxAriaProps(){var t=$afe.select("#lightbox"),e=$afe.select("#captchaLightboxLabel"),i=$afe.select(".captchaLightbox > .clearlabel");t.safeAttr("role","dialog"),t.safeAttr("aria-modal","true"),0!==i.length&&i.safeAttr("aria-hidden","true"),0===e.length&&(e=$afe.select("#lightbox .visuallabel")),0!==e.length&&(e.safeAttr("id","captchaLightboxLabel"),t.safeAttr("aria-labelledby","ReservationStepTitle"))},$$WPSchedulingUtil.__addLightboxKeydownListener=function WP$Scheduling$Utilities$__addLightboxKeydownListener(){$afe.select("#lightbox").on("keydown",(function keyDownHandler(t){var e=t.which;27===e?$$WPSchedulingUtil.CloseCaptchaLightbox():9===e&&$$WPSchedulingUtil.__trapCaptchaFocus(t)}))},$$WPSchedulingUtil.CloseCaptchaLightbox=function WP$Scheduling$Utilities$CloseCaptchaLightbox(){resetLightbox()},$$WPSchedulingUtil.__trapCaptchaFocus=function WP$Scheduling$Utilities$__trapCaptchaFocus(t){var e=$afe.select("#lightbox"),i=WP.DOM.Search.getNextFocusable(e.get(0)),a=WP.DOM.Search.getLastFocusable(e.get(0)),l=null;t.shiftKey&&t.target===i?l=a:t.shiftKey||t.target!==a||(l=i),l&&(l.focus(),t.preventDefault())},$$WPSchedulingUtil.__addLightboxCloseButton=function WP$Scheduling$Utilities$__addLightboxCloseButton(){var t=$$WP.Strings.getNamespace("Scheduling"),e=$afe.select("#lightbox"),i=null,a=$$WPSchedulingUtil.__getCaptchaLightboxContainer();0!==e.length&&0===$afe.select("#lightbox .closeLightbox").length&&((i=$afe.jq(document.createElement("button"))).addClass("closeLightbox"),i.safeAttr("tabindex","0"),i.safeAttr("aria-label",t.getString("ClosePopupLabel")),i.safeAttr("role","button"),i.on("click",$$WPSchedulingUtil.CloseCaptchaLightbox),a.safeAfter(i))},$$WPSchedulingUtil.__getCaptchaLightboxContainer=function WP$Scheduling$Utilities$__getCaptchaLightboxContainer(){return $afe.select(".captchaLightbox .captchaContainer")},$$WPSchedulingUtil.__addLightboxHeader=function WP$Scheduling$Utilities$__addLightboxHeader(){if(0!==$afe.select("#lightbox").length){var t=$$WPSchedulingUtil.__getCaptchaLightboxContainer(),e=$afe.jq(document.createElement("h2"));$$WP.Strings.setDisplayText(e,"ReservationStepTitle","Scheduling"),e.safeAttr("id","ReservationStepTitle"),e.safeAttr("tabindex","0"),e.addClass("header center"),e.safeInsertBefore(t)}};;
/*! Copyright (c) Epic Systems Corporation 2016 */
!function WP$Utilities$UI$TimepreferenceWidgetController$definition(){var e=function WP$Utilities$UI$TimepreferenceWidgetController$TimePreferenceWidgetController(t,i,l,s,a,o,g,d,f,c){$$WP.Utilities.IsNullOrEmpty(timePreferenceConfig)?$$WP.Debug.logError("There is no timePreferenceConfig loaded on the page yet. put @Html.Raw(MyChartWebSettings.TimePreferenceConfig.GetScriptTag()) on page.",!1):(this._Id=r++,this.$root=t,this._isSingleSelect=f,this.OnFilePreferences=n(a),this._generateStrings(a,o),$$WP.Utilities.IsNullOrEmpty(s)&&(s=e.LabelValueEnum.AllAvailable),this.proxify("_onToggleButtonClick"),this.$root.on("click",".togglebutton.clearradio.preferencetype",this._onToggleButtonClick),this.proxify("_onToggleButtonDblClick"),this.$root.on("dblclick","label.togglebutton[for*='schedpref']",this._onToggleButtonDblClick),this._viewModel=this._generateViewModel(timePreferenceConfig,i),this.$root.safeAppend($afe.renderTemplate($$WP.Templates.UI.TimePreferenceWidget,this._viewModel)),this._markSelected(s,g,d),this._bindChangeFunction(l),this.__afterToggleButtonClickedCallBack=c)},t={$root:null,OnFilePreferences:null,PreferredDaysString:null,PreferredTimesString:null,_viewModel:null,_Id:null,_isSingleSelect:null,_generateViewModel:function WP$Utilities$UI$TimepreferenceWidgetController$_generateViewModel(e,t){var i,n,r,l,s,a,o,g,d,f,c,h,p,u="";if(!Array.isArray(e.Days))return null;for(r=0,a=[],s={},o=[],l=[],i=0;i<e.Days.length;i++)if(e.Days[i].Ranges.length>0){for(a.push({Display:e.Days[i].Display,DayOfWeek:e.Days[i].DayOfWeek,RangeOption:[]}),l.push({}),l[r].DayDisplay=e.Days[i].Display,l[r].DayIndex=e.Days[i].DayOfWeek,n=0;n<e.Days[i].Ranges.length;n++)l[r][e.Days[i].Ranges[n].Element]=!0,s.hasOwnProperty(e.Days[i].Ranges[n].Element)||(s[e.Days[i].Ranges[n].Element]=e.Days[i].Ranges[n]);r++}if(f={},null!==t)for(f={},i=0;i<t.length;i++)f[t[i].RangeElement]=f[t[i].RangeElement]||[!1,!1,!1,!1,!1,!1,!1],f[t[i].RangeElement][t[i].DayIndex]=!0;for(g in s){for(d={Display:s[g].Display,Abbrev:s[g].Abbrev,DaysOption:[]},h=$$WP.Strings.getNamespace("UI.TimePreferenceWidget"),i=0;i<l.length;i++)c=!(null===t||!Array.isArray(f[g]))&&f[g][l[i].DayIndex],l[i][g]?(h.addMnemonics({"@MYCHART@DAY@":{Value:l[i].DayDisplay,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@TIMERANGE@":{Value:s[g].Display,EncodingType:$$WP.Strings.EncodingTypes.None}}),""===(u=s[g].MessageOverride)&&(u=s[g].Display),p={Showing:!0,DayIndex:l[i].DayIndex,Value:l[i].DayDisplay+" "+s[g].Display,BeginTime:s[g].BeginTime,EndTime:s[g].EndTime,RangeElement:g,Selected:c,OptionTitle:h.getString("OptionTitle"),MessageRangeString:u},d.DaysOption.push(p),p.Abbrev=d.Abbrev,p.Display=d.Display,a[i].RangeOption.push(p),h.clearMnemonics()):d.DaysOption.push({Showing:!1});o.push(d)}return{TitleLine:a,RangeLines:o,Id:this._Id,hasOnFilePreferences:null!==this.OnFilePreferences,DaysString:this.PreferredDaysString,TimesString:this.PreferredTimesString,IsSingleSelect:this._isSingleSelect}},_generateStrings:function WP$Utilities$UI$TimepreferenceWidgetController$_generateStrings(e,t){var i,n,r,l,s,a;if(i=$$WP.Strings.getNamespace("UI.TimePreferenceWidget"),0===e.Days.length)this.PreferredDaysString=i.getString("NoPreferredDay");else for(this.PreferredDaysString=t[e.Days[0]-1],n=1;n<e.Days.length;n++)this.PreferredDaysString+=", "+t[e.Days[n]-1];if(0===e.Times.length)l=[i.getString("NoPreferredTime")];else{for(s=[],n=0;n<e.Times.length;n++)a={startVal:e.Times[n][0],endVal:e.Times[n][1],startText:e.TimeStrings[n][0],endText:e.TimeStrings[n][1]},s.push(a);for(s.sort((function(e,t){return e.startVal-t.startVal})),l=[],n=0;n<s.length;n++)r=0===(a=s[n]).startVal?i.getString("NoPreferredTime"):a.startText,86400===a.endVal?r+=" - "+i.getString("NoPreferredTime"):r+=" - "+a.endText,l.push(r)}this.PreferredTimesString=l.join(", ")},_bindChangeFunction:function WP$Utilities$UI$TimepreferenceWidgetController$_bindChangeFunction(e){var t;t=this.$root,"function"==typeof e&&this.$root.find("input.clearradio, input.radio").change((function(){e(t.find(".timepreferencewidget input[type='checkbox']:checked"),t.find(".timepreferencewidget input.clearradio.preferencetype:checked"),!1,t.find(".daytimetable input.clearradio").index(this))}))},_onToggleButtonClick:function WP$Utilities$UI$TimepreferenceWidgetController$_onToggleButtonClick(e){var t,i;$afe.jq(e.target).is("input.togglebutton")&&(t=e.target,i=$afe.jq(t).val(),this._markSelected(i,!0),$afe.jq(t).trigger("change"),this.__afterToggleButtonClickedCallBack&&this.__afterToggleButtonClickedCallBack())},_onToggleButtonDblClick:function WP$Utilities$UI$TimepreferenceWidgetController$_onToggleButtonDblClick(e){return!1},_markSelected:function WP$Utilities$UI$TimepreferenceWidgetController$_markSelected(e,t,n){var r,l,s;r=this.$root.find("input.clearradio.preferencetype[value="+e+"]"),$$WP.Utilities.UI.ToggleButtonClick(r[0],null,1),(s=r.get(0).value)===i.AllAvailable&&(this.$root.find(".preference").addClass("hidden"),this.$root.find(".timeTable #"+this._Id+"_daytimetable").addClass("hidden")),s===i.OnFile&&(this.$root.find(".preference").removeClass("hidden"),this.$root.find(".timeTable #"+this._Id+"_daytimetable").addClass("hidden")),s===i.Other&&(this.$root.find(".preference").addClass("hidden"),this.$root.find(".timeTable #"+this._Id+"_daytimetable").removeClass("hidden")),r.prop("checked",!0),$.isNumeric(n)&&n>=0&&(l=$afe.jq(this.$root.find(".daytimetable input.clearradio").get(n))),!$$WP.Utilities.IsNullOrEmpty(l)&&l.is("[type=checkbox]")&&t?l.focus():t&&r.focus()}},i={AllAvailable:"1",OnFile:"2",Other:"3"},n=function WP$Scheduling$SlotStepController$s_convertOnFilePreferences(e){var t,i,n;if(0===e.Days.length&&0===e.Times.length)return null;if(t=Array([],[],[],[],[],[],[]),i=[],0===e.Times.length)i.push([0,86400]);else for(n=0;n<e.Times.length;n++)i.push([e.Times[n][0],e.Times[n][1]]);if(0===e.Days.length)for(n=0;n<7;n++)t[n]=i;else for(n=0;n<e.Days.length;n++)t[e.Days[n]-1]=i;return t},r=0;e.prototype=t,e.LabelValueEnum=i,e.extend($$WP.Controllers.Controller,"WP$Utilities$UI$TimePreferenceWidgetController"),$$WP.Utilities.UI.TimePreferenceWidgetController=e}();;
!function WP$SchedulingSecureSessionController$definition(){var e=function WP$Scheduling$SecureSessionController(){this.WP$Controllers$Controller(),this.proxify("__onCaptchaSuccessCallback","__onSecureSessionCreated","__onDemographicVerificationFormSubmit","__onDemographicVerificationCaptchaSuccess","__onError")};e.prototype={__workflow:null,__accessCode:"",__accessCodeFirstName:"",__isDemographicAuthRequired:!1,__captcha:null,__onSessionEstablishedCallback:null,__onErrorCallback:null,__onCaptchaContentRenderedCallback:null,__onContainerUsageCompleteCallback:null,Initialize:function WP$Scheduling$SecureSessionController$Initialize(e,i,n,t){this.__workflow=e,this.__accessCode=i,this.__isDemographicAuthRequired=n,this.__accessCodeFirstName=t},IsContainerRequired:function WP$Scheduling$SecureSessionController$IsContainerRequired(){return!this.__hasActiveSession()&&(!!$$WP.Captcha&&$$WP.Captcha.IsVisible()&&!!$$WP.Settings&&!$$WP.Settings.IsCaptchaDisabled||this.__isDemographicAuthRequired)},EstablishSession:function WP$Scheduling$SecureSessionController$EstablishSession(e,i,n,t,o){this.__onSessionEstablishedCallback=e,this.__onErrorCallback=i,this.__onCaptchaContentRenderedCallback=t,this.__onContainerUsageCompleteCallback=o,this.__hasActiveSession()?this.__tryRunCallback(this.__onSessionEstablishedCallback):this.IsContainerRequired()?this.__drawContentInContainer(n):this.__drawAndSubmitInvisibleCaptcha()},ResetSession:function WP$Scheduling$SecureSessionController$ResetSession(){this.__captcha&&this.__captcha.Reset(),this.__workflow&&(this.__workflow.SecureSessionToken="")},__drawAndSubmitInvisibleCaptcha:function WP$Scheduling$SecureSessionController$__drawAndSubmitInvisibleCaptcha(){var e=$afe.select(".invisibleCaptchaContainer");this.__captcha=new $$WP.Captcha(e),this.__captcha.Render(),this.__showAjaxSpinner(),setTimeout(this.__hideAjaxSpinner,3e3),this.__captcha.GetResponse(this.__onCaptchaSuccessCallback,this.__onError)},__drawContentInContainer:function WP$Scheduling$SecureSessionController$__drawContentInContainer(e){var i={IsDemographicAuthRequired:this.__isDemographicAuthRequired,ValidationSettings:new $$WP.FormValidation.ValidationSettings({required:!0,isDate:!0,maxDate:new Date,minDate:new Date(1900,0,0)}),FirstName:this.__accessCodeFirstName};e.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.SecureSessionContent,i)),$$WP.FormValidation.initializeDOMSubtree(e),this.__drawCaptchaInContainer(e.find(".captchaContainer")),i.IsDemographicAuthRequired&&(e.find(".demographicAuthForm").submit((function(e){e.preventDefault()})),e.find("#captchaConfirm").on("click",this.__onDemographicVerificationFormSubmit))},__drawCaptchaInContainer:function WP$Scheduling$SecureSessionController$__drawCaptchaInContainer(e){this.__captcha=new $$WP.Captcha(e,this.__onCaptchaSuccessCallback),this.__captcha.Render(),this.__tryRunCallback(this.__onCaptchaContentRenderedCallback)},__hasActiveSession:function WP$Scheduling$SecureSessionController$__hasActiveSession(){var e=!$$WP.Utilities.IsNullOrEmpty(this.__workflow.SecureSessionToken);return!$$WPSchedulingUtil.IsWorkflowTreatedAsAnonymous(this.__workflow)||e},__onDemographicVerificationFormSubmit:function WP$Scheduling$SecureSessionController$__onDemographicVerificationFormSubmit(){this.__isDemographicVerificationFormValid()&&this.__captcha.GetResponse(this.__onDemographicVerificationCaptchaSuccess,this.__onError)},__isDemographicVerificationFormValid:function WP$Scheduling$SecureSessionController$__isDemographicVerificationFormValid(){return $afe.select("#DOBVerify").trigger("change"),$$WP.FormValidation.checkIfFormIsValid($afe.select(".demographicAuthForm"),!1)},__onDemographicVerificationCaptchaSuccess:function WP$Scheduling$SecureSessionController$__onDemographicVerificationCaptchaSuccess(e){var i=$afe.select("#DOBVerify").val();this.__createSecureSession(e,this.__accessCode,i)},__onCaptchaSuccessCallback:function WP$Scheduling$SecureSessionController$__onCaptchaSuccessCallback(e){this.__hideAjaxSpinner(),this.__isDemographicAuthRequired||this.__createSecureSession(e)},__createSecureSession:function WP$Scheduling$SecureSessionController$__createSecureSession(e,i,n){this.__showAjaxSpinner(),$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("CreateSecureSession",this.__workflow)),captchaResponse:e,data:{accessCode:i,userEnteredDateOfBirth:n},cache:!1,success:this.__onSecureSessionCreated,error:this.__onError}),$$WP.Captcha.IsVisible()||this.__captcha.Reset()},__onError:function WP$Scheduling$SecureSessionController$__onError(){this.__hideAjaxSpinner(),this.__tryRunCallback(this.__onContainerUsageCompleteCallback),this.__tryRunCallback(this.__onErrorCallback)},__onSecureSessionCreated:function WP$Scheduling$SecureSessionController$__onSecureSessionCreated(e){this.__hideAjaxSpinner(),$$WPUtil.IsNullOrEmpty(e.SessionToken)?e.IsDateOfBirthVerificationFailure?($$WP.FormValidation.addValidationError($afe.select("#DOBVerify"),"IncorrectDateOfBirth"),this.ResetSession()):this.__onError():(this.__workflow.SecureSessionToken=e.SessionToken,this.__tryRunCallback(this.__onContainerUsageCompleteCallback),this.__tryRunCallback(this.__onSessionEstablishedCallback))},__tryRunCallback:function WP$Scheduling$SecureSessionController$__tryRunCallback(e){"function"==typeof e&&e()},__showAjaxSpinner:function WP$Scheduling$SecureSessionController$__showAjaxSpinner(){$$WPUtil.ShowAjaxSpinner($afe.select(".captchaLoadingHeart .ajaxspinner"))},__hideAjaxSpinner:function WP$Scheduling$SecureSessionController$__hideAjaxSpinner(){$$WPUtil.HideAjaxSpinner($afe.select(".captchaLoadingHeart .ajaxspinner"))}},$$WP.Scheduling.SecureSessionController=e,e.extend($$WP.Controllers.Controller,"WP$Scheduling$SecureSessionController")}();;
!function WP$Scheduling$FilterController$definition(){var e="Gender",t="Languages",i="PatientAge",r="IsInNetwork",l=$$WP.Scheduling.Workflow,s=function WP$Scheduling$FilterController(e,t,i,r,s){this.WP$Controllers$Controller(),this.proxify("__onExpandFilters","__onCollapseFilters","__onFilterSelectionChanged"),this.__filterTemplate=$$WP.Templates.Scheduling.Filters,this.__appointmentBuilder=t,this.__appointments=this.__appointmentBuilder.Appointments,this.__setSelectedProviders(),this.__activeAppointmentIndex=this.__appointmentBuilder.getActiveApptIndex(),this.__defaultLanguages=e,this.__isShowingOneAppointment=!this.__appointmentBuilder.IsSlotStepMultiApptPreGrouped,this.__workflow=i,this.__filterSettings=r,this.__preselectedFilters=s||[],this.__initialPreselectedFilterGroups=[],this.__processPreselectedFilters(),this.__checkNetworkFilterByDefault=this.__filterSettings.IsInsuranceSelectionValid&&this.__workflow.Type===l.WorkflowTypesEnum.ProviderFinder,this.__filterProvDeptPairsOnFirstRender=this.__checkNetworkFilterByDefault||this.__preselectedFilters.length>0};s.prototype={__$root:null,__filterTemplate:null,__selectedFilters:[],__availableProviders:[],__availableProviderDepartmentPairs:[],__selectedProviders:[],__expandedFilters:[],__defaultLanguages:null,__appointments:null,__switchedAvailableProviders:!1,__totalFilterSelections:[],__filtersMatrix:[],__activeAppointmentIndex:null,__isShowingOneAppointment:null,__workflow:null,__providerDepartmentFilterListeners:[],__checkNetworkFilterByDefault:!1,__filterSettings:null,__filterProvDeptPairsOnFirstRender:!1,__preselectedFilters:[],__initialPreselectedFilterGroups:[],__setSelectedProviders:function __setSelectedProviders(){this.__selectedProviders=[];for(var e=0;e<this.__appointmentBuilder.numAppointments();e++){var t=this.__appointmentBuilder.getAppointment(e).Providers;this.__selectedProviders[e]=t}},__generateViewModel:function __generateViewModel(e){var l,s,n;if(this.__activeAppointmentIndex=this.__appointmentBuilder.getActiveApptIndex(),this.__isShowingOneAppointment=!this.__appointmentBuilder.IsSlotStepMultiApptPreGrouped,this.__filtersMatrix=this.__getFilters(this.__filterSettings.FiltersToLoad),null!==e&&e.length>0)for(l=0;l<e.length;l++){var o=e[l].GroupIndex,a=e[l].OptionIndex;for(s=0;s<this.__filtersMatrix.length;s++)if(this.__filtersMatrix[s].name==o){for(n=0;n<this.__filtersMatrix[s].options.length;n++)if(this.__filtersMatrix[s].options[n].name===a){this.__filtersMatrix[s].options[n].selected=!0;break}break}}var _=this.__getViewFiltersMatrix(this.__filtersMatrix),d=[];for(l=0;l<this.__defaultLanguages.length;l++)d[l]={languageName:this.__defaultLanguages[l].Title};return{filtersMatrix:_,isProviderFilteringAvailable:this.isProviderFilteringAvailable(),languageGroupName:t,patientAgeName:i,defaultLanguages:d,hasDefaultLanguage:null!==this.__defaultLanguages||0!==this.__defaultLanguages.length,insuranceName:r}},__getViewFiltersMatrix:function __getViewFiltersMatrix(e){var t,i,r=[];for(t=0;t<e.length;t++)if(e[t].options.length<=3)e[t].show=!1,r.push(e[t]);else{e[t].show=!0;var l=!1;for(-1!==this.__expandedFilters.indexOf(e[t].name)&&(l=!0),i=0;i<e[t].options.length;i++)e[t].options[i].hideOption=this.__isFilterOptionHidden(l,i,3);l?(e[t].collapsed=!1,r.push(e[t])):r.push({name:e[t].name,options:e[t].options,title:e[t].title,collapsed:!0,show:!0})}return r},isAnyProviderDepartmentFilterSelected:function isAnyProviderDepartmentFilterSelected(){return this.getListOfSelectedProviderDepartmentFilters().length>0},getListOfSelectedProviderDepartmentFilters:function getListOfSelectedProviderDepartmentFilters(){var e,t,i,r=[],l=this.getSelectedFilters();for(e=0;e<l.length;e++)t=l[e].GroupIndex,i=l[e].OptionIndex,this.__isFilterProviderDepartment(t)&&r.push({GroupIndex:t,OptionIndex:i});return r},updateAvailableProviders:function updateAvailableProviders(e,t){var i=[];this.__areAvailableProvidersEmpty(t)?this.__availableProviders[t]=e:(i=[this.__availableProviders[t],e],$$WPSchedulingUtil.DoAllArraysContainTheSameValues(i)||(this.__availableProviders[t]=e,this.clearAllFilters())),this.__activeAppointmentIndex=this.__appointmentBuilder.getActiveApptIndex()},updateAvailableProviderDepartmentPairs:function updateAvailableProviderDepartmentPairs(e,t){var i=[];this.__areAvailableProviderDepartmentPairsEmpty(t)?this.__availableProviderDepartmentPairs[t]=e:(i=[this.__availableProviderDepartmentPairs[t],e],$$WPSchedulingUtil.DoAllArraysContainTheSameValues(i)||(this.__availableProviderDepartmentPairs[t]=e,this.clearAllFilters())),this.__activeAppointmentIndex=this.__appointmentBuilder.getActiveApptIndex()},__areAvailableProvidersEmpty:function areAvailableProvidersEmpty(e){return this.__hasDataAtAppointmentIndex(this.__availableProviders,e)},__areAvailableProviderDepartmentPairsEmpty:function __areAvailableProviderDepartmentPairsEmpty(e){return this.__hasDataAtAppointmentIndex(this.__availableProviderDepartmentPairs,e)},__hasDataAtAppointmentIndex:function __hasDataAtAppointmentIndex(e,t){return 0===e.length||null===e[t]||void 0===e[t]||""===e[t]},__isFilterOptionHidden:function __isFilterOptionHidden(e,t,i){return!(t<i)&&(t>=i&&!e)},__hasOnlyProviderDepartmentsThatSeeAllAges:function __hasOnlyProviderDepartmentsThatSeeAllAges(){var e,t,i=!0,r=null,l=!0,s=!0;for(e=0;e<this.__availableProviderDepartmentPairs.length;e++){for(t=0;t<this.__availableProviderDepartmentPairs[e].length;t++)if(l=-1!==(r=this.__availableProviderDepartmentPairs[e][t]).PatientAge.indexOf($$WP.Scheduling.FilterController.PatientAgeFilterSeesChildrenValue()),s=-1!==r.PatientAge.indexOf($$WP.Scheduling.FilterController.PatientAgeFilterSeesAdolescentsValue()),!l||!s){i=!1;break}if(!i)break}return i},__isFiltersOptionsStatic:function __isFiltersOptionsStatic(e){switch(e){case i:case r:return!0;default:return!1}},isFiltersOptionsMutuallyExclusive:function isFiltersOptionsMutuallyExclusive(e){return!1},__isFilterProviderDepartment:function __isFilterProviderDepartment(e){switch(e){case i:case r:return!0;default:return!1}},__getDefaultOptionForStatic:function __getDefaultOptionForStatic(e){return filter,""},__getStaticOptions:function __getStaticOptions(e,t){switch(e){case i:t.push({group:"PatientAge",hideOption:!1,name:$$WP.Scheduling.FilterController.PatientAgeFilterSeesChildrenValue(),selected:this.__isFilterPreselected("PatientAge",$$WP.Scheduling.FilterController.PatientAgeFilterSeesChildrenValue()),isMutuallyExclusive:this.isFiltersOptionsMutuallyExclusive(e)},{group:"PatientAge",hideOption:!1,name:$$WP.Scheduling.FilterController.PatientAgeFilterSeesAdolescentsValue(),selected:this.__isFilterPreselected("PatientAge",$$WP.Scheduling.FilterController.PatientAgeFilterSeesAdolescentsValue()),isMutuallyExclusive:this.isFiltersOptionsMutuallyExclusive(e)});break;case r:t.push({group:"IsInNetwork",hideOption:!1,name:$$WP.Strings.get("InsuranceFilterOptionText","Scheduling"),selected:this.__checkNetworkFilterByDefault,isMutuallyExclusive:!1});break;default:return}},__isFilterPreselected:function __isFilterPreselected(e,t){var i,r;for(i=0;i<this.__preselectedFilters.length;i++)if(0===(r=this.__preselectedFilters[i]).FilterGroup.localeCompare(e)&&0===r.FilterValue.localeCompare(t))return!0;return!1},__wasFilterGroupPreselected:function __wasFilterGroupPreselected(e){return 1===this.__initialPreselectedFilterGroups[e]},__getFilters:function __getFilters(e){var i,l,s,n,o=[],a=!1,_=[],d=[];if(this.__isShowingOneAppointment)_=this.__availableProviders[this.__activeAppointmentIndex],d=this.__availableProviderDepartmentPairs[this.__activeAppointmentIndex];else{for(l=0;l<this.__availableProviders.length;l++){var h=this.__availableProviders[l];for(s=0;s<h.length;s++)-1===_.indexOf(h[s])&&_.push(h[s])}for(l=0;l<this.__availableProviderDepartmentPairs.length;l++){var u=this.__availableProviderDepartmentPairs[l];for(s=0;s<u.length;s++)-1===d.indexOf(u[s])&&d.push(u[s])}}if(n=_.length,this.__determineAllProvDeptPairValues(d,this.__appointmentBuilder.getAppointment(this.__activeAppointmentIndex)),n>0){for(i=0;i<e.length;i++){var p=[],c=e[i],v=this.__getNumProvidersWithOptions(c,_);this.__showFilterGroup(v,n,c)&&(this.__addFilterOptions(n,_,c,[],p),(p.length>1||this.__wasFilterGroupPreselected(c)||(0===c.localeCompare(t)||0===c.localeCompare(r))&&p.length>=1)&&(this.__switchedAvailableProviders&&(a=this.__reselectFiltersAfterProviderSwitch(p)),o.push({name:c,options:p,title:$$WP.Strings.get("FilterGroupTitle_"+c,"Scheduling"),collapsed:!0,isMutuallyExclusive:this.isFiltersOptionsMutuallyExclusive(c)})))}a&&this.filterProvidersBySelection()}return this.__switchedAvailableProviders=!1,o},__determineAllProvDeptPairValues:function __determineAllProvDeptPairValues(e,t){var i;if(void 0!==e)for(i=0;i<e.length;i++)e[i].determinePatientAge(t.VisitType.ID),e[i].setNetworkStatusOnProvider()},__addFilterOptions:function __addFilterOptions(e,t,i,r,l){var s,n;if(this.__isFiltersOptionsStatic(i))this.__getStaticOptions(i,l);else{for(s=0;s<e;s++){var o=t[s][i];if(Array.isArray(o))for(n=0;n<o.length;n++){var a=o[n];this.__shouldAddOption(a,r,i)&&(l.push({name:a,group:i,selected:this.__isFilterPreselected(i,a),hideOption:!1,isMutuallyExclusive:this.isFiltersOptionsMutuallyExclusive(i)}),r.push(a))}else this.__shouldAddOption(o,r,i)&&(l.push({name:o,group:i,selected:this.__isFilterPreselected(i,o),hideOption:!1,isMutuallyExclusive:this.isFiltersOptionsMutuallyExclusive(i)}),r.push(o))}l.sort(this.__sortFilterOptions)}},__reselectFiltersAfterProviderSwitch:function __reselectFiltersAfterProviderSwitch(e){var t,i,r,l,s,n;for(t=0;t<this.__totalFilterSelections.length;t++)for(r=this.__totalFilterSelections[t].OptionIndex,l=this.__totalFilterSelections[t].GroupIndex,i=0;i<e.length;i++)s=e[i].name,n=e[i].group,r===s&&l===n&&(e[i].selected=!0,selectedAdditionalFilters=!0,null!==this.__selectedFilters?this.__selectedFilters.push({GroupIndex:l,OptionIndex:r}):this.__selectedFilters=[{GroupIndex:l,OptionIndex:r}]);return!1},__shouldAddOption:function __shouldAddOption(e,t,i){return""!==e&&-1===t.indexOf(e)&&!this.__isDefaultLanguage(i,e)&&(this.__isShowingOneAppointment||this.__isFilterOptionInAllAppointments(i,e))},__isFilterOptionInAllAppointments:function __isFilterOptionInAllAppointments(e,t){var i,r,l,s,n,o=this.__appointmentBuilder.numAppointments(),a=!0;if(o<2)return!0;for(i=0;i<o;i++){for(s=this.__availableProviders[i],n=!1,r=0;r<s.length;r++){var _=s[r][e];if(Array.isArray(_)){for(l=0;l<_.length;l++)if(0===t.localeCompare(_[l])){n=!0;break}}else 0===t.localeCompare(_)&&(n=!0)}n||(a=!1)}return a},__isDefaultLanguage:function __isDefaultLanguage(e,i){var r;for(r=0;r<this.__defaultLanguages.length;r++)if(0===e.localeCompare(t)&&0===i.localeCompare(this.__defaultLanguages[r].Title))return!0;return!1},__canShowFilterWhenLessThanThreshold:function __canShowFilterWhenLessThanThreshold(l){switch(l){case e:case t:case i:case r:return!0;default:return this.__wasFilterGroupPreselected(l)}},__showFilterGroup:function __showFilterGroup(e,t,l){if(t<2&&!this.__filterSettings.IsInsuranceSelectionValid||e/t<.8&&!this.__canShowFilterWhenLessThanThreshold(l))return!1;switch(l){case i:return this.__workflow.isTypeOpenScheduling()&&$$WPSchedulingUtil.ShouldTreatAsAnonymous(this.__workflow)&&(this.__wasFilterGroupPreselected(l)||!this.__hasOnlyProviderDepartmentsThatSeeAllAges());case r:return this.__filterSettings.IsInsuranceSelectionValid;default:return!0}},__bindChangeFunctions:function __bindChangeFunction(){this.__$root.find(".filter-option").off().on("change",this.__onFilterSelectionChanged),this.__$root.find(".expand-filter-group").off().on("click",this.__onExpandFilters),this.__$root.find(".collapse-filter-group").off().on("click",this.__onCollapseFilters)},clearAllFilters:function clearAllFilters(e){this.__selectedFilters=null,e&&(this.__checkNetworkFilterByDefault=!1,this.__preselectedFilters=[]),this.__clearSelectedFiltersOnDOM()},filterProviderDepartments:function filterProviderDepartments(e){var t,i=0,l=[],s=this.getListOfSelectedProviderDepartmentFilters();if(0===s.length)return e;for(t=0;t<e.length;t++){var n=!0;for(providerDepartment=e[t],i=0;i<s.length;i++)filterName=s[i].GroupIndex,filterName===r?providerDepartment.IsInNetwork||(n=!1):(selectedOption=s[i].OptionIndex,filterName in providerDepartment&&-1!==providerDepartment[filterName].indexOf(selectedOption)||(n=!1));n&&l.push(e[t])}return l},isProviderFilteringAvailable:function isProviderFilteringAvailable(){return null!==this.__availableProviders&&0!==this.__availableProviders.length&&null!==this.__availableProviderDepartmentPairs&&0!==this.__availableProviderDepartmentPairs.length&&this.__checkIfEnoughFiltersToShow()},__getProvidersToRemove:function __getProvidersToRemove(){var e,t,i,r=[];if(this.__hasSelectedFilters())if(this.__isShowingOneAppointment)for(i=this.__selectedProviders[this.__activeAppointmentIndex].toArray(),e=0;e<i.length;e++)this.__isProviderFiltered(i[e],this.__activeAppointmentIndex)&&r.push(i[e]);else for(e=0;e<this.__selectedProviders.length;e++){for(i=this.__selectedProviders[e].toArray(),t=0;t<i.length;t++)this.__isProviderFiltered(i[t],e)&&r.push(i[t])}return r},__checkIfProviderInArray:function __checkIfProviderInArray(e,t){var i,r=e.ID;for(i=0;i<t.length;i++){if(t[i].ID===r)return!0}return!1},__getProvidersToAdd:function __getProvidersToAdd(){var e,t,i=[];if(this.__isShowingOneAppointment)0!==(t=this.__getProvidersToAddForAppt(this.__activeAppointmentIndex)).length&&(i[this.__activeAppointmentIndex]=t);else for(e=0;e<this.__selectedProviders.length;e++)0!==(t=this.__getProvidersToAddForAppt(e)).length&&(i[e]=t);return i},__getProvidersToAddForAppt:function __getProvidersToAddForAppt(e){var t,i=[],r=this.__selectedProviders[e].toArray(),l=this.__availableProviders[e],s=this.getSelectedFilters();for(t=0;t<l.length;t++)this.__checkIfProviderInArray(l[t],r)||this.__isProviderFiltered(l[t],e)||this.__isProviderManuallyDeselected(l[t])||i.push(l[t]);return 0===s.length&&0===r.length&&0===i.length&&l.length>0&&(i=l.filter((e=>!this.__isProviderManuallyDeselected(e)))),i},__isProviderFiltered:function __isProviderFiltered(e,t){if(!this.__hasSelectedFilters())return!1;if(!this.__checkIfProviderInArray(e,this.__availableProviders[t]))return!1;var i=this.__generateLogicTable(e);for(var l in i){var s=!0,n=i[l];if(0!==l.localeCompare(r))for(option in n){n[option].shouldFilterOption||(s=!1)}else s=!e.IsInNetwork;n.shouldFilterGroup=s}var o=!1;for(var l in i){(n=i[l]).shouldFilterGroup&&(o=!0)}return o},__isProviderManuallyDeselected:function __isProviderManuallyDeselected(e){return e.IsManuallyDeselected},__generateLogicTable:function __generateLogicTable(e){var t,i,r={},l=this.getSelectedFilters();for(t=0;t<l.length;t++){var s=l[t].GroupIndex,n=l[t].OptionIndex;if(r[s]=r[s]||{},r[s][n]=r[s][n]||{},Array.isArray(e[s])){var o=e[s];for(r[s][n].shouldFilterOption=!0,i=0;i<o.length;i++)if(o[i]===n){r[s][n].shouldFilterOption=!1;break}}else r[s][n].shouldFilterOption=!0,e[s]===n&&(r[s][n].shouldFilterOption=!1)}return r},__sortFilterOptions:function __sortFilterOptions(e,t){var i=e.name,r=t.name;return i.localeCompare(r)},__hasSelectedFilters:function __hasSelectedFilters(){var e=this.getSelectedFilters();return!(null===e||0===e.length)},__getNumProvidersWithOptions:function __getNumProvidersWithOptions(e,t){var i,r=0;for(i=0;i<t.length;i++){var l=t[i][e];if(Array.isArray(l)){for(n=0;n<l.length;n++)if(""!==l[n]){r++;break}}else""!==l&&r++}return r},__render:function __render(){var e,t=$afe.jq(document.activeElement);if(e=this.__generateViewModel(this.getSelectedFilters()),this.__$root.empty().safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.Filters,e)),this.__bindChangeFunctions(),t.hasClass("filter-option")){var i=t.safeAttr("id");this.__$root.find("#"+$.escapeSelector(i)).focus()}},__onExpandFilters:function WP$Scheduling$SlotStepController$__onExpandFilters(){var e=$afe.jq(event.target).data("group"),t="#"+e+"-group ul";-1===this.__expandedFilters.indexOf(e)&&this.__expandedFilters.push(e);var i=$afe.select(t),r=i.find(".filterOption.hidden").first();this.__render();var l=[...r[0].classList].find((e=>e.endsWith("-option")));(i=$afe.select(t)).find("."+l+" input").focus()},__onCollapseFilters:function WP$Scheduling$SlotStepController$__onCollapseFilters(){var e=$afe.jq(event.target).data("group");-1!==this.__expandedFilters.indexOf(e)&&this.__expandedFilters.splice(this.__expandedFilters.indexOf(e),1),this.__render(),$afe.select("#"+e+"-show-more").focus()},resetSelectedProviders:function WP$Scheduling$FilterController$resetSelectedProviders(){null!==this.__selectedFilters&&0!==this.__selectedFilters.length&&(this.__totalFilterSelections=this.__selectedFilters.slice(0),this.__switchedAvailableProviders=!0),this.clearAllFilters(),this.filterProvidersBySelection()},__onFilterSelectionChanged:function WP$Scheduling$SlotStepController$__onFilterSelectionChanged(){var e;(e=$afe.jq(event.target)).data("groupIndex")===r?this.__checkNetworkFilterByDefault&&(this.__checkNetworkFilterByDefault=!1):this.__togglePreselectedFilter(e.data("groupIndex"),e.data("optionIndex")),this.__selectedFilters=this.getSelectedFiltersFromDOM(),this.__shouldAuditProviderFilterUse(this.__selectedFilters)&&this.__appointmentBuilder.setProperty("DidUseProviderFilters",!0),this.__shouldAuditPatientAgeFilterUse(this.__selectedFilters)&&this.__appointmentBuilder.setProperty("DidUsePatientAgeFilter",!0),this.filterProvidersBySelection(),this.notifyProviderDepartmentFilterListeners(),this.__render()},__togglePreselectedFilter:function __togglePreselectedFilter(e,t){var i,r;for(i=0;i<this.__preselectedFilters.length;i++)if(0===(r=this.__preselectedFilters[i]).FilterGroup.localeCompare(e)&&0===r.FilterValue.localeCompare(t))return void this.__preselectedFilters.splice(i,1);this.__preselectedFilters.push({FilterGroup:e,FilterValue:t})},__processPreselectedFilters:function __processPreselectedFilters(){var e;for(e=0;e<this.__preselectedFilters.length;e++){if(preselectedFilter=this.__preselectedFilters[e],0===preselectedFilter.FilterGroup.localeCompare(i)){var t=preselectedFilter.FilterValue;"0"===t?preselectedFilter.FilterValue=$$WP.Scheduling.FilterController.PatientAgeFilterSeesChildrenValue():"1"===t&&(preselectedFilter.FilterValue=$$WP.Scheduling.FilterController.PatientAgeFilterSeesAdolescentsValue())}this.__initialPreselectedFilterGroups[preselectedFilter.FilterGroup]=1}},notifyProviderDepartmentFilterListeners:function notifyProviderDepartmentFilterListeners(){var e;for(e=0;e<this.__providerDepartmentFilterListeners.length;e++)(0,this.__providerDepartmentFilterListeners[e])()},addProviderDepartmentFilterListener:function WP$Scheduling$FilterController$addProviderDepartmentFilterListener(e){this.__providerDepartmentFilterListeners.push(e)},clearProviderDepartmentFilterListener:function WP$Scheduling$FilterController$clearProviderDepartmentFilterListener(){this.__providerDepartmentFilterListeners=[]},__shouldAuditProviderFilterUse:function __shouldAuditProviderFilterUse(e){var t,i=0;if(null!==e)for(t=0;t<e.length;t++)if("PatientAge"!==e[t].GroupIndex){i=1;break}return i},__shouldAuditPatientAgeFilterUse:function __shouldAuditProviderFilterUse(e){var t,i=0;if(null!==e)for(t=0;t<e.length&&!(i="PatientAge"===e[t].GroupIndex);t++);return i},filterProvidersBySelection:function filterProvidersBySelection(e){if(this.isProviderFilteringAvailable()){this.__isShowingOneAppointment=!this.__appointmentBuilder.IsSlotStepMultiApptPreGrouped;var t=this.__getProvidersToRemove();this.__removeProviders(t);var i=this.__getProvidersToAdd();this.__addProviders(i),0===t.length&&0===i.length&&!e&&this.onFiltersChangedSameResults&&this.onFiltersChangedSameResults(),this.__filterProvDeptPairsOnFirstRender&&(this.__filterProvDeptPairsOnFirstRender=!1,this.notifyProviderDepartmentFilterListeners())}else this.__resetFilteredOutProviders()},__removeProviders:function __removeProviders(e){var t;if(this.__isShowingOneAppointment)this.__selectedProviders[this.__activeAppointmentIndex].removeRange(e);else for(t=0;t<this.__selectedProviders.length;t++)this.__selectedProviders[t].removeRange(e)},__addProviders:function __addProviders(e){var t,i,r;if(0!==e.length)if(this.__isShowingOneAppointment)i=this.__selectedProviders[this.__activeAppointmentIndex],r=e[this.__activeAppointmentIndex],i.addRange(r);else for(t=0;t<e.length;t++)i=this.__selectedProviders[t],r=e[t],i.addRange(r)},__checkIfEnoughFiltersToShow:function __checkIfEnoughFiltersToShow(){return 0!==this.__filtersMatrix.length},__resetFilteredOutProviders:function __resetFilteredOutProviders(){var e;this.__setSelectedProviders(),e=this.__getProvidersToAdd(),this.__addProviders(e)},getSelectedFiltersFromDOM:function getSelectedFiltersFromDOM(){var e,t,i,r,l;if(null===this.__$root)return[];if(null===(e=this.__$root.find(":checked"))||0===e.length)return[];var s=[];for(i=0;i<e.length;i++)!1===(t=$afe.jq(e[i])).prop("disabled")&&(r=t.data("group-index"),l=t.data("option-index"),s.push({GroupIndex:r,OptionIndex:l}));return s},__clearSelectedFiltersOnDOM:function __clearSelectedFiltersOnDOM(){var e,t,i;if(null!==this.__$root&&null!==(e=this.__$root.find(":checked"))&&0!==e.length)for(i=0;i<e.length;i++)!1===(t=$afe.jq(e[i])).prop("disabled")&&t.prop("checked",!1)},clearNetworkFilter:function clearNetworkFilter(){null!==this.__$root&&(this.__$root.find("input[data-group-index=IsInNetwork]").prop("checked",!1),this.__checkNetworkFilterByDefault=!1,this.filterProvidersBySelection(),this.notifyProviderDepartmentFilterListeners())},draw:function draw(e){this.__$root=e,this.__setSelectedProviders(),this.__render(),this.filterProvidersBySelection(!0)},onFiltersChangedSameResults:function WP$Scheduling$FilterController$onFiltersChangedSameResults(){},getSelectedFilters:function getSelectedFilters(){return null===this.__selectedFilters||0===this.__selectedFilters.length?this.getSelectedFiltersFromDOM():this.__selectedFilters},getListOfSelectedProviders:function WP$Scheduling$FilterController$getListOfSelectedProviders(){return this.__selectedProviders[this.__activeAppointmentIndex].toArray()},updateFilterSettings:function WP$Scheduling$FilterController$updateFilterSettings(e){this.__filterSettings=e},hasNetworkFilterBeenCleared:function WP$Scheduling$FilterController$hasNetworkFilterBeenCleared(){return!this.__checkNetworkFilterByDefault}},$$WP.Scheduling.FilterController=s,s.extend($$WP.Controllers.Controller,"WP$Scheduling$FilterController")}(),$$WP.Scheduling.FilterController.PatientAgeFilterSeesChildrenValue=function WP$Scheduling$FilterController$PatientSeesChildrenFilterAnyValue(){return $$WP.Strings.get("FilterPatientAgeOptions_Children","Scheduling")},$$WP.Scheduling.FilterController.PatientAgeFilterSeesAdolescentsValue=function WP$Scheduling$FilterController$PatientAgeFilterSeesAdolescentsValue(){return $$WP.Strings.get("FilterPatientAgeOptions_Adolescents","Scheduling")},$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$FilterController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$TelehealthModeController$definition(){var e=function WP$Scheduling$TelehealthModeController(e,t){this.WP$Controllers$Controller(),this.proxify("__onTelehealthModeChanged"),this.carousel=t,this.template=$$WP.Templates.Scheduling.TelehealthToggle,this._appointmentBuilder=e};e.prototype={template:null,carousel:null,_appointmentBuilder:null,render:function render(e){e.length>0&&(this.__setupTelehealthModeCallbacks(e),this.__selectTelehealthChipsOnLoad(e))},__selectTelehealthChipsOnLoad:function __selectTelehealthChipsOnLoad(e){var t=0;this._appointmentBuilder.IsSlotStepMultiApptPreGrouped?this._appointmentBuilder.isSelectedTelehealthModeSameForAppts()&&this.__selectTelehealthChipForAppointmentOnLoad(0,e):(t=this._appointmentBuilder.getActiveApptIndex(),this.__selectTelehealthChipForAppointmentOnLoad(t,e))},__selectTelehealthChipForAppointmentOnLoad:function __selectTelehealthChipForAppointmentOnLoad(e,t){var l,n=null,h=null;l=this._appointmentBuilder.getAppointment(e),!$$WPUtil.IsNullOrEmpty(l)&&l.SelectedTelehealthMode&&(n=l.SelectedTelehealthMode,(h=t.find(".telehealthChip"+n).find("input")).length>0&&this.carousel.selectChip(h))},__setupTelehealthModeCallbacks:function __setupTelehealthModeCallbacks(e){var t,l=null,n=0;for(t=this._appointmentBuilder.getAllowedTelehealthModes(),n=0;n<t.length;n++)l=t[n],e.find(".telehealthChip"+l).find("input").on("click",this.__onTelehealthModeChanged)},__onTelehealthModeChanged:function __onTelehealthModeChanged(e){var t=$afe.jq(e.target),l=0,n=null,h=null,i=0;if(t.length>0)if(h=parseInt(t.safeAttr("data-telehealthmode")),this.carousel.__chipScrollSearchString=".telehealthChip"+h,this.carousel.selectChip(t),this._appointmentBuilder.IsSlotStepMultiApptPreGrouped)for(i=0;i<this._appointmentBuilder.numAppointments();i++)n=this._appointmentBuilder.getAppointment(i),h&&n.SelectedTelehealthMode!==h&&(n.setProperty("SelectedTelehealthMode",h),n.setProperty("HasUsedTelehealthToggles",!0));else this._appointmentBuilder.setProperty("UpdateAvailableProviders",!0),l=this._appointmentBuilder.getActiveApptIndex(),n=this._appointmentBuilder.getAppointment(l),h&&n.SelectedTelehealthMode!==h&&(n.setProperty("SelectedTelehealthMode",h),n.setProperty("HasUsedTelehealthToggles",!0))}},$$WP.Scheduling.TelehealthModeController=e,e.extend($$WP.Controllers.Controller,"WP$Scheduling$TelehealthModeController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$TelehealthModeController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$TieredSchedulingController$definition(){var e=$$WP.Scheduling.Workflow,i=$$WP.Scheduling.Location,t=$$WP.Scheduling.Provider,r=$$WP.Scheduling.Department,o=$$WP.Scheduling.ProviderDepartmentPair,n=$$WP.Scheduling.SchedulingOverride,d=function WP$Scheduling$TieredSchedulingController(e,i,t,r){this.WP$Controllers$Controller(),this.$root=e,this.Data=t,this._workflow=i,this.__tieredSchedulingSettings=r,this.proxify("__onTieredDataLoaded","__toggleTieredSchedulingMode"),this.$root.on("click","#expandSearchButton",this.__toggleTieredSchedulingMode),this.$root.on("click","#noAvailabilityShowMoreProvidersButton",this.__toggleTieredSchedulingMode),this.$root.on("change",'input[name="toggleTieredScheduling"]',this.__toggleTieredSchedulingMode)},l={__isBestMatchToggleSelected:!0,__resetForNextAppointment:function WP$Scheduling$TieredSchedulingController$__resetForNextAppointment(){this.__isBestMatchToggleSelected=!0,this.__setIsUsingTieredDataProperty(!1),this.__setHasAlreadyLoadedTieredSchedulingSlotsProperty(!1),this.__setHasViewedTieredSchedulingOptionProperty(!1),this.__deselectTieredDataOnActiveAppointment()},__toggleTieredSchedulingMode:function WP$Scheduling$TieredSchedulingController$__toggleTieredSchedulingMode(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),i=this.Data.AppointmentBuilder.getAppointment(e);!$$WPUtil.IsNullOrEmpty(i.VisitType)&&i.VisitType.HasAlreadyLoadedTieredData?(this.__isBestMatchToggleSelected=!this.__isBestMatchToggleSelected,this.__setIsUsingTieredDataProperty(!this.__isBestMatchToggleSelected),i.IsUsingTieredData?(this.__includeOtherPossibleProviders(!0),this.__selectTieredDataOnActiveAppointment()):(this.__includeOtherPossibleProviders(!1),this.__deselectTieredDataOnActiveAppointment())):(this.__isBestMatchToggleSelected=!1,this.__getTieredSchedulingData())},__includeOtherPossibleProviders:function WP$Scheduling$TieredSchedulingController$__includeOtherPossibleProviders(e){this.__tieredSchedulingSettings.CanAlsoLoadAdditionalProviders&&this.Data.AppointmentBuilder.setProperty("DidIncludeAdditionalProvidersInSearch",e),this.__tieredSchedulingSettings.CanAlsoLoadTeamProviders&&this.Data.AppointmentBuilder.setProperty("UseTeams",e)},__getTieredSchedulingData:function WP$Scheduling$TieredSchedulingController$__getTieredSchedulingData(){var e,i=null,t=this.Data.AppointmentBuilder,r=t.getActiveApptIndex(),o=t.getAppointment(r),d=null,l=$$WPUtil.IsNullOrEmpty(t.Specialty)?null:t.Specialty.Id,s=this.__tieredSchedulingSettings.csn,a=this._workflow.SchedulingControllerParams.ticketId,p=this._workflow.IsGuest;this.__isTicketWorkflow()||(d=$$WPUtil.IsNullOrEmpty(t.ReasonForVisit)?null:t.ReasonForVisit.Id),e=$$WPSchedulingRfvsCore.BuildSchedulingParameters(d,l,s,a,p),i=$$WPUtil.IsNullOrEmpty(o.SchedulingOverride)?new n:o.SchedulingOverride,$$WP.Scheduling.LqfStepController.addDecisionTreeNodeOverrides(i,this._workflow),i.IsLoadingRemainingTiers=!0,this.__addOverridesForTicketWorkflows(i),this.__addOverridesForBundlesAndPanels(i),this.__setIsLoadingTieredDataProperty(!0),this.__logTieredSchedulingExpanded(),$$WPSchedulingRfvsCore.LoadReasonForVisitData(e,this._workflow,this.__onTieredDataLoaded,!1,!0,i,[i]),this.__includeOtherPossibleProviders(!0)},__logTieredSchedulingExpanded:function WP$Scheduling$TieredSchedulingController$__logTieredSchedulingExpanded(){var e={workflow:this._workflow.toRawRequestObject(),appointmentBuilder:this.Data.AppointmentBuilder.toRawRequestObject(),appointmentIndex:this.Data.AppointmentBuilder.getActiveApptIndex()};$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("LogTieredSchedulingExpanded",this._workflow)),data:$$WPUtil.postify(e),cache:!1})},__addOverridesForTicketWorkflows:function WP$Scheduling$TieredSchedulingController$__addOverridesForTicketWorkflows(e){var i=this.Data.AppointmentBuilder,t=i.getActiveApptIndex(),r=i.getAppointment(t);this.__isTicketWorkflow()&&($$WPUtil.IsNullOrEmpty(this._workflow.TicketInfo)||(e.OriginalTicketId=this._workflow.TicketInfo.TicketId,e.OriginalAppointmentRequestIds=r.AppointmentRequestIds,e.IsLoadingSpecificTicket=!0,e.TicketKey=this._workflow.TicketInfo.TicketKey))},__addOverridesForBundlesAndPanels:function WP$Scheduling$TieredSchedulingController$__addOverridesForBundlesAndPanels(e){var i=this.Data.AppointmentBuilder,t=i.getActiveApptIndex(),r=i.getAppointment(t),o=!$$WPUtil.IsNullOrEmpty(i.getFirstAppointment().PanelId),n=!$$WPUtil.IsNullOrEmpty(i.getFirstAppointment().BundleId);$$WPUtil.IsNullOrEmpty(r.VisitType)||!n&&!o||(e.IsLoadingSpecificComponent=!0,e.ComponentKey=r.VisitType.ID,e.OriginalAppointmentRequestIds=r.AppointmentRequestIds)},__onTieredDataLoaded:function WP$Scheduling$TieredSchedulingController$__onTieredDataLoaded(e){var i=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(i);$$WPUtil.IsNullOrEmpty(t.VisitType)||(t.VisitType.HasAlreadyLoadedTieredData=!0),this.__setIsUsingTieredDataProperty(!0),this.__updateAppointmentPoolData(t,e),this.__addTieredDataToDataPool(e),this.__selectTieredDataOnActiveAppointment(),this.Data.SlotLoader.loadRequestSolutions(this.Data.ReasonsForVisit)},__updateAppointmentPoolData:function WP$Scheduling$TieredSchedulingController$__updateAppointmentPoolData(e,i){var t,r,o,n,d,l;if(!$$WPUtil.IsNullOrEmpty(i.SchedulingViewModel)&&!$$WPUtil.IsNullOrEmpty(i.SchedulingViewModel.VisitTypes)){for(r=i.SchedulingViewModel.ProviderDepartmentPairs.slice()||[],o=0;o<r.length;o++)d=r[o],l=d.ProviderId+"^"+d.DepartmentId,n=this.Data.ProviderDepartmentPairs.getFromIndex("Id",l),$$WPUtil.IsNullOrEmpty(n)||(n.PoolLine=d.PoolLine,n.PoolTier=d.PoolTier),n=e.ProviderDepartmentPairs.find((e=>e.Id===l)),$$WPUtil.IsNullOrEmpty(n)||(n.PoolLine=d.PoolLine,n.PoolTier=d.PoolTier);t=i.SchedulingViewModel.VisitTypes.find((i=>i.ID===e.VisitType.ID)),e.VisitType.MaxPoolLine=t.PoolLine,e.VisitType.MaxPoolTier=t.Tier}},__addTieredDataToDataPool:function WP$Scheduling$TieredSchedulingController$__addTieredDataToDataPool(e){var i,n,d,l,s=e.SchedulingViewModel.ProviderDepartmentPairs||[],a=e.SchedulingViewModel.Providers||[],p=e.SchedulingViewModel.Locations||[],c=e.SchedulingViewModel.Departments||[],u=r.createDepartmentsCollection(),h=this.Data.AppointmentBuilder.getActiveApptIndex(),g=this.Data.AppointmentBuilder.getAppointment(h);this.__removeAvailableProviders(a),this.__removeAvailableDepartments(c),this.__removeAvailableProviderDepartmentPairs(s),n=o.convertRawProviderDepartmentPairs(s,this.Data.ProviderDepartmentPairs),i=this.__getRequestProviderDepartmentPairsFromResponse(e),d=t.convertRawProviders(a,this.Data.Providers),u.addRange(r.convertRawDepartments(c,this.Data.Departments)),l=this.__appendRawTieredLocationsToCollection(p,this.Data.Locations,u),r.dereferenceIds(this.Data.Departments,this.Data.Specialties),o.dereferenceIds(this.Data.ProviderDepartmentPairs,this.Data.Providers,this.Data.Departments),this.__addTieredModelsToAppointment(g,n,i,d,l)},__getRequestProviderDepartmentPairsFromResponse:function WP$Scheduling$TieredSchedulingController$__getRequestProviderDepartmentPairsFromResponse(e){var i,t,r=null,o=[],n=[],d=this.Data.AppointmentBuilder.getActiveApptIndex(),l=this.Data.AppointmentBuilder.getAppointment(d);if(!l.ReasonForVisit||!e.SchedulingViewModel||!e.SchedulingViewModel.ReasonsForVisit[0])return[];for(o=l.ReasonForVisit.RequestProviderDepartmentPairIDs,t=e.SchedulingViewModel.ReasonsForVisit[0].RequestProviderDepartmentPairIDs,i=0;i<t.length;i++)r=t[i],o.includes(r)||n.push(this.Data.ProviderDepartmentPairs.getFromIndex("Id",r));return n},__addTieredModelsToAppointment:function WP$Scheduling$TieredSchedulingController$__addTieredModelsToAppointment(e,i,r,o,n){var d=this.Data.AppointmentBuilder.getActiveApptIndex();e=this.Data.AppointmentBuilder.getAppointment(d);$$WPUtil.IsNullOrEmpty(e.VisitType)||($$WPSchedulingUtil.AllowsLocationsSeparate(this.Data)||1==this.Data.AppointmentBuilder.Appointments.toArray().length?(e.VisitType.TieredProviderDepartmentPairsCollection.addRange(i),e.VisitType.TieredRequestProviderDepartmentPairs=r,e.VisitType.TieredProvidersCollection.addRange(o),t.removeAnyProviderOption(e.VisitType.TieredProvidersCollection),e.VisitType.TieredLocationsCollection.addRange(n)):(e.VisitType.TieredProviderDepartmentPairsCollection.addRange(i),e.VisitType.TieredRequestProviderDepartmentPairs=r,e.VisitType.TieredProvidersCollection.addRange(o)))},__selectTieredDataOnActiveAppointment:function WP$Scheduling$TieredSchedulingController$__selectTieredDataOnActiveAppointment(){var e=[],i=[],t=[],r=[],o=this.Data.AppointmentBuilder.getActiveApptIndex(),n=this.Data.AppointmentBuilder.getAppointment(o);this.__setIsLoadingTieredDataProperty(!0),$$WPUtil.IsNullOrEmpty(n.VisitType)||(e=n.VisitType.TieredProviderDepartmentPairsCollection.toArray(),i=n.VisitType.TieredRequestProviderDepartmentPairs,t=n.VisitType.TieredLocationsCollection.toArray(),r=n.VisitType.TieredProvidersCollection.toArray()),n.Locations.addRange(t),this.__appendProviderDepartmentPairs(n.ReasonForVisit.AllProviderDepartmentPairs,e),this.__appendProviderDepartmentPairs(n.ReasonForVisit.DirectProviderDepartmentPairs,e),this.__appendProviderDepartmentPairs(n.ReasonForVisit.RequestProviderDepartmentPairs,i),this.__appendProviderDepartmentPairs(n.ProviderDepartmentPairs,e),n.Providers.addRange(r),n.IsProviderAnyOptionSelected=!0,this.__removeLocationsExcludedByGeolocationFilter(n),this.__setIsLoadingTieredDataProperty(!1)},__deselectTieredDataOnActiveAppointment:function WP$Scheduling$TieredSchedulingController$__deselectTieredDataOnActiveAppointment(){var e,i=[],t=[],r=this.Data.AppointmentBuilder.getActiveApptIndex(),o=this.Data.AppointmentBuilder.getAppointment(r);this.__setIsLoadingTieredDataProperty(!0),$$WPUtil.IsNullOrEmpty(o.VisitType)||(tieredProviderDepartmentPairs=o.VisitType.TieredProviderDepartmentPairsCollection.toArray(),tieredRequestProviderDepartmentPairs=o.VisitType.TieredRequestProviderDepartmentPairs,i=o.VisitType.TieredLocationsCollection.toArray(),t=o.VisitType.TieredProvidersCollection.toArray()),e=o.Locations.toArray().slice(),o.Locations.removeRange(i),o.Providers.removeRange(t),this.__removeProviderDepartmentPairs(o.ReasonForVisit.DirectProviderDepartmentPairs,tieredProviderDepartmentPairs),this.__removeProviderDepartmentPairs(o.ReasonForVisit.RequestProviderDepartmentPairs,tieredRequestProviderDepartmentPairs),0===o.Locations.size()&&o.Locations.addRange(e),this.__setIsLoadingTieredDataProperty(!1)},__addProviderToAppointment:function WP$Scheduling$TieredSchedulingController$__addProviderToAppointment(e,i){e.Providers.getFromIndex("ID",i.ID)||e.Providers.add(i)},__addLocationToAppointment:function WP$Scheduling$TieredSchedulingController$__addLocationToAppointment(e,i){e.Locations.getFromIndex("Id",i.Id)||e.Locations.add(i)},__appendProviderDepartmentPairs:function WP$Scheduling$TieredSchedulingController$__appendProviderDepartmentPairs(e,i){var t=null,r=0;for(r=0;r<i.length;r++)t=i[r],s(e,t.ProviderId,t.DepartmentId)||e.push(t)},__removeProviderDepartmentPairs:function WP$Scheduling$TieredSchedulingController$__removeProviderDepartmentPairs(e,i){var t=null,r=0,o=0;for(r=0;r<i.length;r++)t=i[r],s(e,t.ProviderId,t.DepartmentId)&&(o=e.indexOf(t),e.splice(o,1),r--)},__appendRawTieredLocationsToCollection:function WP$Scheduling$TieredSchedulingController$__appendRawTieredLocationsToCollection(e,t,r){for(var o=[],n=this.__tieredSchedulingSettings.LocationGroupingBehavior===c.AlwaysGroup,d=i.convertAdditionalRawLocations(e,t,r,n),l=this.Data.AppointmentBuilder.getActiveApptIndex(),s=this.Data.AppointmentBuilder.AvailableLocations[l],p=0;p<d.length;p++){var u=d[p];if("object"==typeof u&&void 0!==u.Id){if(a(s,u.Id))continue;t.getFromIndex("Id",u.Id)||t.add(u),o.push(u)}}return o},__setIsUsingTieredDataProperty:function WP$Scheduling$TieredSchedulingController$__setIsUsingTieredDataProperty(e){var i=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(i);t.IsUsingTieredData!==e&&t.setProperty("IsUsingTieredData",e)},__setHasViewedTieredSchedulingOptionProperty:function WP$Scheduling$TieredSchedulingController$__setHasViewedTieredSchedulingOptionProperty(e){var i=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(i);t.HasViewedTieredSchedulingOption!==e&&t.setProperty("HasViewedTieredSchedulingOption",e)},__setHasAlreadyLoadedTieredSchedulingSlotsProperty:function WP$Scheduling$TieredSchedulingController$__setHasAlreadyLoadedTieredSchedulingSlotsProperty(e){var i=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(i);t.HasAlreadyLoadedTieredSchedulingSlots!==e&&t.setProperty("HasAlreadyLoadedTieredSchedulingSlots",e)},__setIsLoadingTieredDataProperty:function WP$Scheduling$TieredSchedulingController$__setIsLoadingTieredDataProperty(e){this.Data.AppointmentBuilder.IsLoadingTieredData!==e&&this.Data.AppointmentBuilder.setProperty("IsLoadingTieredData",e)},__removeAvailableDepartments:function WP$Scheduling$TieredSchedulingController$__removeAvailableDepartments(e){var i,t=this.Data.AppointmentBuilder,r=t.__getAppointmentAvailableDepartmentIds(t.getActiveApptIndex());for(i=0;i<e.length;i++)r.includes(e[i].ID)&&e.splice(i--,1)},__removeAvailableProviders:function WP$Scheduling$TieredSchedulingController$__removeAvailableProviders(e){var i,t=this.Data.AppointmentBuilder.getActiveApptIndex(),r=this.Data.AppointmentBuilder.getAppointment(t),o=[];for(o=this.__isProviderFirstWorkflow()?r.Providers.toArray():r.ReasonForVisit.AllProviderDepartmentPairs.map((e=>e.Provider)),i=0;i<e.length;i++)p(o,e[i].ID)&&e.splice(i--,1)},__removeAvailableProviderDepartmentPairs:function WP$Scheduling$TieredSchedulingController$__removeAvailableProviderDepartmentPairs(e){var i,t=this.Data.AppointmentBuilder.getActiveApptIndex(),r=this.Data.AppointmentBuilder.getAppointment(t),o=[];for(o=this.__isProviderFirstWorkflow()?r.ProviderDepartmentPairs:r.ReasonForVisit.AllProviderDepartmentPairs,i=0;i<e.length;i++)s(o,e[i].ProviderId,e[i].DepartmentId)&&e.splice(i--,1)},__removeLocationsExcludedByGeolocationFilter:function WP$TieredSchedulingController$__removeLocationsExcludedByGeolocationFilter(e){var i,t,r=e.VisitType.TieredLocationsCollection.toArray();for(e.Locations.openChangeBatch(),i=0;i<r.length;i++)t=r[i],a(e.Locations.Models,t.Id)&&!t.IsIncludedByFilter&&e.Locations.remove(t);e.Locations.closeChangeBatch()},__isTicketWorkflow:function WP$Scheduling$TieredSchedulingController$__isTicketWorkflow(){return this._workflow.Type===e.WorkflowTypesEnum.Ticket},__isRescheduleWorkflow:function WP$Scheduling$TieredSchedulingController$__isRescheduleWorkflow(){return this._workflow.Type===e.WorkflowTypesEnum.Reschedule},__isDecisionTreeNodeWorkflow:function WP$Scheduling$TieredSchedulingController$__isDecisionTreeNodeWorkflow(){return this._workflow.Type===e.WorkflowTypesEnum.DecisionTreeNode},__isNewProviderWorkflow:function WP$Scheduling$TieredSchedulingController$__isNewProviderWorkflow(){return this._workflow.Type===e.WorkflowTypesEnum.NewProvider},__isWidgetWorkflow:function WP$Scheduling$TieredSchedulingController$__isWidgetWorkflow(){return this._workflow.isTypeOpenSchedulingWidget()},__isOpenSchedulingWorkflow:function WP$Scheduling$TieredSchedulingController$__isOpenSchedulingWorkflow(){return this._workflow.isTypeOpenScheduling()},__isProviderFirstWorkflow:function WP$Scheduling$TieredSchedulingController$__isProviderFirstWorkflow(){return this._workflow.Type===e.WorkflowTypesEnum.ExistingProvider}},s=function WP$Scheduling$TieredSchedulingController$s_isProviderDepartmentPairInList(e,i,t){var r=0;for(r=0;r<e.length;r++)if(e[r].ProviderId===i&&e[r].DepartmentId===t)return!0;return!1},a=function WP$Scheduling$TieredSchedulingController$s_isLocationInList(e,i){var t=0;for(t=0;t<e.length;t++)if(e[t].Id===i)return!0;return!1},p=function WP$Scheduling$TieredSchedulingController$s_isProviderInList(e,i){var t=0;for(t=0;t<e.length;t++)if(e[t].ID===i)return!0;return!1},c={AlwaysGroup:0,GroupForMultipleAppointmentsOnly:1};d.prototype=l,d.LocationGroupingBehaviorEnum=c,d.isLocationFromFirstTier=function WP$Scheduling$TieredSchedulingController$isLocationFromFirstTier(e,i){var t=!0;return!!$$WPUtil.IsNullOrEmpty(i)||($$WPUtil.IsNullOrEmpty(e)||$$WPUtil.IsNullOrEmpty(e.VisitType)||(t=!e.VisitType.TieredLocationsCollection.getFromIndex("Id",i.Id)),t)},d.isProviderFromFirstTier=function WP$Scheduling$TieredSchedulingController$isProviderFromFirstTier(e,i){var t=!0;return!!$$WPUtil.IsNullOrEmpty(i)||($$WPUtil.IsNullOrEmpty(e)||$$WPUtil.IsNullOrEmpty(e.VisitType)||(t=!e.VisitType.TieredProvidersCollection.getFromIndex("ID",i.ID)),t)},d.isProviderDepartmentPairFromFirstTier=function WP$Scheduling$TieredSchedulingController$isProviderDepartmentPairFromFirstTier(e,i){var t=!0;return!!$$WPUtil.IsNullOrEmpty(i)||($$WPUtil.IsNullOrEmpty(e)||$$WPUtil.IsNullOrEmpty(e.VisitType)||(t=!e.VisitType.TieredProviderDepartmentPairsCollection.getFromIndex("Id",i.Id)),t)},$$WP.Scheduling.TieredSchedulingController=d,d.extend($$WP.Controllers.Controller,"WP$Scheduling$TieredSchedulingController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$TieredSchedulingController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SlotSelectionSummaryController$definition(){var e=function WP$Scheduling$SlotSelectionSummaryController(e,t,n,l){this.WP$Controllers$Controller(),this._$parentContainer=e,this._schedulingDataPool=t,this._workflow=l,this._appointmentClickCallback=n,this.proxify("render","_buildViewModel","__onSummaryAppointmentClicked","__addEventListeners"),this._slotSelectionSummaryTemplate=$$WP.Templates.Scheduling.SlotSelectionSummary};e.prototype={_$parentContainer:null,_slotSelectionSummaryTemplate:null,_schedulingDataPool:null,_workflow:null,render:function WP$Scheduling$SlotSelectionSummaryController$render(){var e=null,t=this._buildViewModel();(e=this.findContainer()).length>0&&(e.empty(),e.safeAppend($afe.renderTemplate(this._slotSelectionSummaryTemplate,t)),this.__addEventListeners(e))},findContainer:function WP$Scheduling$SlotSelectionSummaryController$findContainer(){return this._$parentContainer.find(".slotSelectionSummaryContainer")},focusOnSummaryHeader:function WP$Scheduling$SlotSelectionSummaryController$focusOnSummaryHeader(e){var t=this._$parentContainer.find('[data-appointment-index="'+e+'"]');0!==t.length&&$$WPSchedulingUtil.FocusElement(t[0])},_buildViewModel:function WP$Scheduling$SlotSelectionSummaryController$_buildViewModel(){return{CurrentApptBeingSelected:this._schedulingDataPool.AppointmentBuilder.getActiveApptIndex(),AppointmentViewModels:this.__buildAppointmentViewModels(),CanAnimate:this.__canAnimate()}},__buildAppointmentViewModels:function WP$Scheduling$SlotSelectionSummaryController$__buildAppointmentViewModels(){var e,t=[],n=null,l=null;e=this._schedulingDataPool.AppointmentBuilder.Appointments.toArray();for(var o=0;o<e.length;o++)n=e[o],l=new $$WP.Scheduling.AppointmentViewModel,n.Slot?l.populateFromSlot(n.Slot,this._schedulingDataPool.AppointmentBuilder,n,this._schedulingDataPool,true,this._workflow):l.populateFromEmptyAppointment(n,this._workflow),t.push(l);return t},__canAnimate:function WP$Scheduling$SlotSelectionSummaryController$__canAnimate(){return 0===this._schedulingDataPool.SlotLoader.numIncrementalLoadsCompleted()},__onSummaryAppointmentClicked:function WP$Scheduling$SlotStepController$__onSummaryAppointmentClicked(e){var t;(t=e.target.dataset.appointmentIndex)<this._schedulingDataPool.AppointmentBuilder.getActiveApptIndex()&&this._appointmentClickCallback(t)},__addEventListeners:function WP$Scheduling$SlotStepController$__addEventListeners(e){e.on("click",".slotSelectionSummaryInput",this.__onSummaryAppointmentClicked)}},$$WP.Scheduling.SlotSelectionSummaryController=e,e.extend($$WP.Controllers.Controller,"WP$Scheduling$SlotSelectionSummaryController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SlotSelectionSummaryController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SchedulingInstructionsController$definition(){var n=function WP$Scheduling$SchedulingInstructionsController(n,t){this.WP$Controllers$Controller(),this._$parentContainer=n,this._schedulingDataPool=t,this.proxify("render","_buildViewModel"),this._schedulingInstructionsTemplate=$$WP.Templates.Scheduling.SchedulingInstructions};n.prototype={_$parentContainer:null,_schedulingInstructionsTemplate:null,_schedulingDataPool:null,render:function WP$Scheduling$SchedulingInstructionsController$render(n){var t=null,e=this._buildViewModel(n);(t=this.findContainer()).length>0&&e.CanShowSchedulingInstructions&&(t.empty(),t.safeAppend($afe.renderTemplate(this._schedulingInstructionsTemplate,e)))},findContainer:function WP$Scheduling$SchedulingInstructionsController$findContainer(){return this._$parentContainer.find(".schedulingInstructionsContainer")},_buildViewModel:function WP$Scheduling$SchedulingInstructionsController$_buildViewModel(n){var t={Instructions:null,CanShowSchedulingInstructions:!1};return t.Instructions=this._schedulingDataPool.AppointmentBuilder.getSchedulingInstructions(this._schedulingDataPool.VisitTypes,n),t.CanShowSchedulingInstructions=0!==t.Instructions.join("").length,t}},$$WP.Scheduling.SchedulingInstructionsController=n,n.extend($$WP.Controllers.Controller,"WP$Scheduling$SchedulingInstructionsController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SchedulingInstructionsController(n){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$PromotedActionBannerController$definition(){var e=0,n=1,t=function WP$Scheduling$PromotedActionBannerController$(e,n){this.WP$Controllers$Controller(),this.$root=e,this.Data=n,this.proxify("render"),this.templates=[$$WP.Templates.Scheduling.TieredSchedulingProvidersAddedBanner,$$WP.Templates.Scheduling.TieredSchedulingLimitedAvailabilityBanner]};t.prototype={$root:null,templates:[],__currentBannerTemplate:null,render:function WP$Scheduling$PromotedActionBannerController$render(e){var n=this.__getContainer();this.__setCurrentTemplate(e),n.length>0&&this.__currentBannerTemplate&&(n.empty(),n.safeAppend($afe.renderTemplate(this.__currentBannerTemplate,e)))},__getContainer:function WP$Scheduling$PromotedActionBannerController$__getContainer(){return this.$root.find(".promotedActionBannerContainer")},__setCurrentTemplate:function WP$Scheduling$PromotedActionBannerController$__setCurrentTemplate(t){this.__canShowProvidersAddedBanner(t)?this.__currentBannerTemplate=this.templates[e]:this.__canShowLimitedAvailabilityBanner(t)?this.__currentBannerTemplate=this.templates[n]:this.__currentBannerTemplate=null},__canShowProvidersAddedBanner:function WP$Scheduling$PromotedActionBannerController$__canShowProvidersAddedBanner(e){return e.HasAlreadyLoadedTieredData&&(e.ShowFullSolutionsButtonMidSlots||1===e.Appointments.length)},__canShowLimitedAvailabilityBanner:function WP$Scheduling$PromotedActionBannerController$__canShowLimitedAvailabilityBanner(e){return e.CanShowLimitedAvailabilityBanner}},$$WP.Scheduling.PromotedActionBannerController=t,t.extend($$WP.Controllers.Controller,"WP$Scheduling$PromotedActionBannerController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$PromotedActionBannerController(e){$$WP.Debug.UnitTest.assert}));;
/*! Copyright (c) Epic Systems Corporation 2016-2017 */
$$WP.Utilities.UI.Cards=function $$WP$Utilities$UI$Cards(e){$$WP.Utilities.UI.IsMobile||("echeckin"===$$WP.Utilities.queryString("src")||$afe.select("html").hasClass("respquestionnaire"))&&WP.DOM.Browser.isMobile||("load"===e.type&&($afe.select(".cardlist.hoverable").each($$WP.Utilities.UI.Cards.HandleHoverable),$afe.select("body").on("cardLoad",".cardlist",$$WP.Utilities.UI.Cards.LoadCardlist).on("matchCardHeights",".cardlist.matchHeights",$$WP.Utilities.UI.Cards.MatchHeights)),$afe.select(".cardlist.matchHeights").each($$WP.Utilities.UI.Cards.MatchHeights))},$$WP.Utilities.UI.Cards.LoadCardlist=function $$WP$Utilities$UI$Cards$LoadCardlist(e){var i=$afe.jq(this);isDataTile()&&i.is(".cardlist.column_3, .cardlist.column_4")&&i.removeClass("column_3 column_4").addClass("column_2"),i.hasClass("hoverable")&&$.proxy($$WP.Utilities.UI.Cards.HandleHoverable,i)(),i.hasClass("matchHeights")&&$.proxy($$WP.Utilities.UI.Cards.MatchHeights,i)()},$$WP.Utilities.UI.Cards.HandleHoverable=function $$WP$Utilities$UI$Cards$HandleHoverable(){var e=$afe.jq(this);e.hasClass("hoverable")&&e.find(".card").each((function(){var e=$afe.jq(this);e.prop("hoverable")||(e.hover((function(e){"mouseenter"===e.type?$afe.jq(this).addClass("hover"):$afe.jq(this).removeClass("hover")})),e.find(".button, [data-id='additem']").on("focus blur",(function(e){"focus"===e.type?$afe.jq(this).parentsUntil(".card").addBack().parent(".card").addClass("hover"):$afe.jq(this).parentsUntil(".card").addBack().parent(".card").removeClass("hover")})),e.prop("hoverable",!0))}))},$$WP.Utilities.UI.Cards.MatchHeights=function $$WP$Utilities$UI$Cards$MatchHeights(){if(!($$WP.Utilities.UI.IsMobile||78===$$WP.ApplicationContext||("echeckin"===$$WP.Utilities.queryString("src")||$afe.select("html").hasClass("respquestionnaire"))&&WP.DOM.Browser.isMobile)){var e,i,s,a,t=$afe.jq(this),r=t.prop("class");if(r=parseInt(r.substr(r.indexOf("column_")+7)),!isNaN(r))for(e=t.find(".card, .innercard").css("minHeight",""),i=0;i<e.length;i+=r){for(a=e.eq(i).outerHeight(),s=1;s<r;s++)a=Math.max(a,e.eq(i+s).outerHeight());for(s=0;s<r;s++)e.eq(i+s).css("minHeight",a)}}},$$WP.Utilities.UI.Map.Support.cards=$$WP.Utilities.UI.Cards;;
/*! Copyright (c) Epic Systems Corporation 2019 */
$$WP.ThirdPartyUsageTracking=$$WP.ThirdPartyUsageTracking||{},$$WP.ThirdPartyUsageTracking.LogViewEvent=function WP$ThirdPartyUsageTracking$LogViewEvent(a,r,i){};;
!function ClassDefinition(){var t=0,e=1,i=function PatientInstructionController(t,e,i,n){this.WP$Controllers$Controller(),this.$container=t,null!=i&&(this._maxHeight=i),$$WPUtil.IsNullOrEmpty(n)&&($$WP.Strings.setDefaultNamespace("Visits"),n=$$WP.Strings.get("ViewFullInstructionsButtonText")),null!=e&&this.$container.empty().safeAppend($afe.renderTemplate($$WP.Templates.Visits.PatientInstruction,{PatientInstructionsHTML:e,ExpandText:n})),this.$container.find(".readmore a").html(n),this.$readmore=this.$container.find(".readmore"),this.$readless=this.$container.find(".readless"),this.proxify("_collapseOrExpand","_setupInstructionDiv","_afterTransition","_fitTablesInsideContainer"),this.$container.on("click",".readmore",this._collapseOrExpand),this.$container.on("click",".readless a",this._collapseOrExpand),$afe.jq(window).on("resize",this._setupInstructionDiv),$afe.jq(window).on("resize",this._fitTablesInsideContainer),this.$container.on("transitionend webkitTransitionEnd oTransitionEnd",this._afterTransition),this._setupInstructionDiv(),this._fitTablesInsideContainer()};i.prototype={$container:null,_state:t,_maxHeight:300,$readmore:null,$readless:null,_afterTransition:function _afterTransition(e){if(null==e||"height"===e.originalEvent.propertyName){var i=null;this._state===t?(this.$readmore.find("a").focus(),this.$container.safeAttr("aria-expanded","false")):(i=$afe.jq(window).scrollTop(),this.$container.find(".instructionContent").focus(),$afe.jq(window).scrollTop(i),this.$container.safeAttr("aria-expanded","true"))}},_setupInstructionDiv:function _setupInstructionDiv(){this.$container.contentHeight()>this._maxHeight&&(this.$readmore.hasClass("hidden")&&this.$readless.hasClass("hidden")?(this._state=t,this.$container.safeAttr("aria-expanded","false"),this._setTabIndexForLinksInside(-1),this.$container.height(this._maxHeight+"px"),this.$readmore.removeClass("hidden")):this.$readless.hasClass("hidden")||(this._state=e,this.$container.safeAttr("aria-expanded","true"),this._setTabIndexForLinksInside(0),this.$container.height(""),this.$container.height(this.$container.contentHeight()+"px")))},_fitTablesInsideContainer:function fitTablesInsideContainer(){var t,e,i,n;for(i=this.$container.find(".fmtConv table"),n=this.$container.width(),t=0;t<i.length;t++)(e=$afe.jq(i[t])).css("word-break",""),e.width()>n&&e.css("word-break","break-all")},_setTabIndexForLinksInside:function setTabIndexForLinksInside(t){this.$container.find(".instructionContent a").safeAttr("tabindex",t)},_collapseOrExpand:function collapseOrExpand(){if(this._state===t)this._state=e,this._setTabIndexForLinksInside(0),this.$readmore.addClass("hidden"),this.$readless.removeClass("hidden"),this.$container.height(this.$container.contentHeight()+"px");else{this._state=t,this._setTabIndexForLinksInside(-1),this.$readmore.removeClass("hidden"),this.$readless.addClass("hidden"),this.$container.height(this._maxHeight+"px");var i=$afe.select("#header").contentHeight();$$WPUtil.SmoothScrollToElementWithOffset($$WPUtil.ScrollableBody(),this.$container,i,300)}}},$$WPUtil.guaranteeExistence($$WP,"Visits.PatientInstructionController"),$$WP.Visits.PatientInstructionController=i,i.extend($$WP.Controllers.Controller,"WP$PatientInstructionController$Controller")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$PatientInstructionController(t){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$StepController$definition(){var e=function WP$Scheduling$StepController(e,t,o,s,l,r,h,a,d){var c;for(this.WP$Controllers$Controller(),this.SchedulingStringsNamespace=this.SchedulingStringsNamespace||$$WP.Strings.getNamespace("Scheduling"),this.Id=n++,this.$root=e,this.Data=t,this.template=r||$$WP.dudFunction,this.collapsedTemplate=h||r,this._defaultStepSettings=new i(l),this.stepSettings=Object.create(this._defaultStepSettings),this.Active=!1,this._isStacked=a||!1,this._onErrorCallback=d,this.SkipAfterRenderRefocus=!1,o=o||[],this.allowedIds={},c=0;c<o.length;c++)this.allowedIds[o[c]]=!0;for(this.allowedIds.size=o.length,s=s||[],this.preselectedIds={},c=0;c<s.length;c++)this.preselectedIds[s[c]]=!0;this.preselectedIds.size=s.length,this._viewEventListeners=[]},t={SchedulingStringsNamespace:null,Id:null,$root:null,allowedIds:null,preselectedIds:null,_defaultStepSettings:null,stepSettings:null,Data:null,ViewBinder:null,ViewModel:null,template:null,_reactSubcomponents:{},collapsedTemplate:null,_firstRender:!0,Active:!1,SkipAfterRenderRefocus:!1,_renderHidden:!0,_isStacked:!1,_onErrorCallback:null,_timerId:null,_viewEventListeners:null,_workflow:null,schedulingProgress:null,filterByAllowedIds:function WP$Scheduling$StepController$filterModelArray(e,t,i){var n,o,s;if(o=e||[],t=t||"ID",this.allowedIds.size>0){for(s=[],n=0;n<e.length;n++)this.allowedIds[e[n][t]]&&s.push(e[n]);s.length>0?o=s:i&&(o=[])}else if(i)return[];return o},filterIdArrayByAllowedIds:function WP$Scheduling$StepController$_filterDepartmentIds(e){var t,i,n;if(t=e||[],this.allowedIds.size>0){for(i=[],n=0;n<e.length;n++)this.allowedIds[e[n]]&&i.push(e[n]);i.length>0&&(t=i)}return t},getModelsToPreSelect:function WP$Scheduling$StepController$getModelsToPreSelect(e,t){return e&&1===e.length?e:this.getPreSelectedModelsOnly(e,t)},getPreSelectedModelsOnly:function WP$Scheduling$StepController$getPreSelectedModelsOnly(e,t){if(e=e||[],t=t||"ID",0===this.preselectedIds.size)return[];for(var i=[],n=0;n<e.length;n++)this.preselectedIds[e[n][t]]&&i.push(e[n]);return i},hasPreselectedIds:function WP$Scheduling$StepController$hasPreselectedIds(){return this.preselectedIds.size>0},isModelPreselected:function WP$Scheduling$StepController$isModelPreselected(e){return this.preselectedIds[e]},isStepMarkedAsHidden:function WP$Scheduling$StepController$isStepMarkedAsHidden(){return this.stepSettings.Hide||this.stepSettings.HideIfOne&&1===this.ViewModel.Count},isHidden:function WP$Scheduling$StepController$isHidden(){return this.isStepMarkedAsHidden()&&!this._isStepForceShown()},shouldRenderCollapsed:function WP$Scheduling$StepController$shouldRenderCollapsed(){return this.stepSettings.Collapse||this.stepSettings.CollapseIfOne&&1===this.ViewModel.Count||this.renderCollapsed},scrollToStep:function WP$Scheduling$StepController$scrollToStep(){var e=$afe.select("#header").height();$$WPUtil.IsNullOrEmpty(e)&&(e=0),isDataTile()&&null!=window.frameElement&&(e-=$afe.jq(window.frameElement).offset().top),this.scrollToElement(this.$root,e)},scrollToElement:function WP$Scheduling$StepController$scrollElement(e,t){$$WPUtil.SmoothScrollToElementWithOffset($$WPUtil.ScrollableBody(),e,t,600)},scrollToElementIfOffsceen:function WP$Scheduling$StepController$scrollToElementIfOffsceen(e){var t=0;if(this.isElementOffScreen(e)){t=window.innerHeight/2;this.scrollToElement(e,t)}},isElementOffScreen:function WP$Scheduling$StepController$isElementOffScreen(e){var t=e[0].getBoundingClientRect(),i=this.$root.find(".stickybanner").height();return t.top<0||t.bottom>window.innerHeight-i},show:function show(){this._renderHidden=!1,this.$root.show(),this.updateStep(),this._workflow&&this._setSafeToRedirectOverrides()},_setSafeToRedirectOverrides:function WP$Scheduling$StepController$_setSafeToRedirectOverrides(){$$WPUtil.SafeToRedirectOverrideSettings={TitleText:this.SchedulingStringsNamespace.getString("SchedulingRedirectTitle"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button(this.SchedulingStringsNamespace.getString("SchedulingRedirectCancel"),null,"","stay"),new $$WPComp.ComplexObjects.Button(this.SchedulingStringsNamespace.getString("SchedulingRedirectConfirm"),null,"inlinedelete","leave")]},this._workflow&&this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule?$$WPUtil.SafeToRedirectOverrideSettings.Html=this.SchedulingStringsNamespace.getString("ReschedulingRedirectMessage"):$$WPUtil.SafeToRedirectOverrideSettings.Html=this.SchedulingStringsNamespace.getString("SchedulingRedirectMessage")},__updateRootHeightBeforeDOMDestroyed:function __updateRootHeightBeforeDOMDestroyed(){var e=this.$root.height(),t=$afe.jq(window),i=t.scrollTop();return e>0&&this.$root.css({"min-height":e}),function(){this.$root.css({"min-height":""}),t.scrollTop(i)}.bind(this)},hide:function hide(e){this.__updateRootHeightBeforeDOMDestroyed(),this.$root.hide(),this._renderHidden=!0,void 0!==e&&this.setComplete(e)},getComplete:function getComplete(){return this.Data.SchedulingSteps.getFromIndex("ID",this.Id).CompleteStatus},setComplete:function setComplete(e){this.Data.SchedulingSteps.getFromIndex("ID",this.Id).setProperty("CompleteStatus",e)},resetStepSettings:function WP$Scheduling$StepController$resetStepSettings(){this.stepSettings=Object.create(this._defaultStepSettings)},updateStep:function WP$Scheduling$StepController$updateStep(){clearTimeout(this._timerId),this._timerId=setTimeout($.proxy(this._updateStepImmediately,this),0)},_updateStepImmediately:function WP$Scheduling$StepController$_updateStepImmediately(){var e,t,i,n,o,s,l;if(this.resetStepSettings(),this.arePrerequisitesComplete()?(this.updateViewModel(),this.ViewModel=this.ViewModel||{}):this.ViewModel={StepShouldBeActive:!1},this._isStepForceShown()&&(this._renderHidden=!1),this.ViewModel.StepShouldBeActive&&!this._renderHidden){if(this.Active||(this.$root.show(),this.Active=!0),this._firstRender&&(this.beforeFirstRender(),this._firstRender=!1,!this.Active))return;if(this.beforeRender(),!this.Active||!this._isStepOrStackActive())return;if(e=!this._isStepForceShown()&&this.isHidden(),t=this.shouldRenderCollapsed(),e)this.$root.hide(),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired);else{if(0===this.ViewModel.Count&&"function"==typeof this._onErrorCallback)return void this.showError(this.ViewModel);l=this.__updateRootHeightBeforeDOMDestroyed(),this._isStacked||(i=(o=this.$root.find(":focus")).safeAttr("data-model-id"),$$WP.Utilities.IsNullOrEmpty(i)&&(n=o.safeAttr("id")),this.$root.empty()),this.$root.show(),null!==this.ViewBinder&&(this.ViewModel.ViewBinderId=this.ViewBinder.ViewBinderId),t?(this.$root.safeAppend($afe.renderTemplate(this.collapsedTemplate,this.ViewModel)),this.$root.css({"min-height":""})):(this._isStacked||(this.$root.safeAppend($afe.renderTemplate(this.template,this.ViewModel)),$afe.select("body").hasClass("isPrelogin")||$$WP.Utilities.IsNullOrEmpty(this._reactSubcomponents)||(this._updateReactSubcomponents(),this._renderReactSubcomponents())),l(),this.stepSettings.ReadOnly?this.$root.addClass("readonly"):this.$root.removeClass("readonly"),null!==this.ViewBinder&&this.ViewBinder.syncModelsToDOM()),s=$afe.jq($afe.select("#header-accessible-text")).text(),$afe.jq($afe.select("span.header-accessible-span")).text(s),!this._workflow||this._workflow.isTypeOpenScheduling()&&this._workflow.IsAnonymous||$afe.jq($afe.select("div.dtStep span.header-accessible-span")).empty(),this.afterRender(),this.triggerViewEvent(),this.SkipAfterRenderRefocus||($$WP.Utilities.IsNullOrEmpty(i)?$$WP.Utilities.IsNullOrEmpty(n)||this.$root.find("#"+$.escapeSelector(n)).focus():this.$root.find("[data-model-id='"+i+"']").focus()),this.SkipAfterRenderRefocus=!1}}else this.inactivate()},_renderReactSubcomponents:function WP$Scheduling$StepController$renderReactSubcomponents(){var e,t,i;for(e in this._reactSubcomponents)t=this._reactSubcomponents[e].props||{},i=this._reactSubcomponents[e].id||e,EpicPx.removeReactPortal(i),EpicPx.addReactPortal("@epic-px/scheduling",e,t,i)},_updateReactSubcomponents:function WP$Scheduling$StepController$_updateReactSubcomponents(){},showError:function WP$Scheduling$StepController$showError(e){"function"==typeof this._onErrorCallback&&(WP.Events.cancelBeforeUnload(),this._onErrorCallback(e))},_isStepOrStackActive:function WP$Scheduling$StepController$_isStepOrStackActive(){var e=null,t=null,i=null,n=null;if(this.Data&&this.Data.SchedulingSteps&&!$$WPUtil.IsNullOrEmpty(this.Id)){if(""!==(e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id)).StackId&&(t=this.Data.SchedulingSteps.getFromIndex("ID",e.StackId)),t&&""!==t.StackId&&(i=this.Data.SchedulingSteps.getFromIndex("ID",t.StackId)),(n=this.Data.SchedulingSteps.getFromIndex("ActiveStatus",$$WP.Scheduling.SchedulingStep.ActiveEnum.Active))&&n.IsAdHoc)return this.__isStepActive(e)||this._isStepHostingAdHocStep(e,n)||this._isStepHostingAdHocStep(t,n)||this._isStepHostingAdHocStep(i,n);if(!this.__isStepActive(e)&&!this.__isStepActive(t)&&!this.__isStepActive(i))return!1}return!0},_isStepHostingAdHocStep:function WP$Scheduling$StepController$_isStepHostingAdHocStep(e,t){return!!e&&t.HostId===e.ID},__isStepActive:function WP$Scheduling$StepController$__isStepActive(e){return!!e&&e.ActiveStatus===$$WP.Scheduling.SchedulingStep.ActiveEnum.Active},_isStepForceShown:function WP$Scheduling$StepController$_isStepForceShown(){var e=null;return!(!this.Data||!this.Data.SchedulingSteps||$$WPUtil.IsNullOrEmpty(this.Id))&&(null!==(e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id))&&e.ForceShowOnce)},inactivate:function WP$Scheduling$StepController$inactivate(){this.$root.hide(),this._workflow&&this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule&&0!==this.$root.find("#OriginalAppointmentInfo").length&&$$WP.Scheduling.OriginalAppointmentInfoController.StashPortal(),this._isStacked||this.$root.empty(),this.Active&&(this.Active=!1,this.afterInactivated())},arePrerequisitesComplete:function WP$Scheduling$StepController$arePrerequisitesComplete(){return!0},updateViewModel:function WP$Scheduling$StepController$updateViewModel(){$$WP.Debug.logError(this._constructor.name+" did not override the virtual updateViewModel method from StepController.")},beforeFirstRender:function WP$Scheduling$StepController$beforeFirstRender(){},beforeRender:function WP$Scheduling$StepController$beforeRender(){},afterRender:function WP$Scheduling$StepController$afterRender(){},afterInactivated:function WP$Scheduling$StepController$afterInactivated(){},beforeNavigateBack:function WP$Scheduling$StepController$beforeNavigateBack(){},onNavigateBack:function WP$Scheduling$StepController$onNavigateBack(){},setViewBinder:function WP$Scheduling$StepController$setViewBinder(e){this.ViewBinder=e,e.setBindingRoot(this.$root)},addViewEventListener:function WP$Scheduling$StepController$addViewEventListener(e){this._viewEventListeners.push(e)},triggerViewEvent:function WP$Scheduling$StepController$triggerViewEvent(){var e,t,i;(e=this._getViewEventSubmodule())&&(t=(new Date).toISOString(),i=this._getStepSpecificViewEventData(),this._invokeViewEventListeners(e,t,i))},_getViewEventSubmodule:function WP$Scheduling$StepController$_getViewEventSubmodule(){return null},_getStepSpecificViewEventData:function WP$Scheduling$StepController$_getStepSpecificViewEventData(){return null},_invokeViewEventListeners:function WP$Scheduling$StepController$invokeViewEventListeners(e,t,i){var n;for(n=0;n<this._viewEventListeners.length;n++)"function"==typeof this._viewEventListeners[n]&&(0,this._viewEventListeners[n])(e,t,i,this.Data)},dispose:function WP$Scheduling$StepController$dispose(){this.inactivate(),this.$root.empty()},_openChangeBatch:function WP$Scheduling$StepController$__openChangeBatch(){this.Data.Providers.openChangeBatch(),this.Data.ReasonsForVisit.openChangeBatch(),this.Data.Departments.openChangeBatch(),this.Data.ProviderDepartmentPairs.openChangeBatch(),this.Data.ReasonForVisitDepartmentOverrides.openChangeBatch(),this.Data.Locations.openChangeBatch(),this.Data.VisitTypes.openChangeBatch(),this.Data.VisitTypeDepartmentOverrides.openChangeBatch(),this.Data.Solutions.openChangeBatch(),this.Data.SchedulingSteps.openChangeBatch(),this.__openAppointmentsChangeBatch()},__openAppointmentsChangeBatch:function WP$Scheduling$StepController$__openAppointmentsChangeBatch(){var e=0,t=null;for(this.Data.AppointmentBuilder.Appointments.openChangeBatch(),e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)(t=this.Data.AppointmentBuilder.getAppointment(e)).Providers.openChangeBatch(),t.Locations.openChangeBatch()},_closeChangeBatch:function WP$Scheduling$StepController$__closeChangeBatch(){this.Data.Providers.closeChangeBatch(),this.Data.ReasonsForVisit.closeChangeBatch(),this.Data.Departments.closeChangeBatch(),this.Data.ProviderDepartmentPairs.closeChangeBatch(),this.Data.ReasonForVisitDepartmentOverrides.closeChangeBatch(),this.Data.Locations.closeChangeBatch(),this.Data.VisitTypes.closeChangeBatch(),this.Data.VisitTypeDepartmentOverrides.closeChangeBatch(),this.Data.Solutions.closeChangeBatch(),this.Data.AppointmentBuilder.Appointments.closeChangeBatch(),this.Data.SchedulingSteps.closeChangeBatch(),this.__closeAppointmentsChangeBatch()},__closeAppointmentsChangeBatch:function WP$Scheduling$StepController$__closeAppointmentsChangeBatch(){var e=0,t=null;for(this.Data.AppointmentBuilder.Appointments.closeChangeBatch(),e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)(t=this.Data.AppointmentBuilder.getAppointment(e)).Providers.closeChangeBatch(),t.Locations.closeChangeBatch()},onWorkflowDestroyed:function WP$Scheduling$StepController$onWorkflowDestroyed(){},shouldRemainOnStep:function WP$Scheduling$StepController$shouldRemainOnStep(){return!1},hasStickyBanner:function WP$Scheduling$StepController$hasStickyBanner(){return!1},getSchedulingContinueBanner:function WP$Scheduling$StepController$getSchedulingContinueBanner(){var e=this.$root.parent(),t=".continueBanner";return e.hasClass("scheduling-embedded")?e.find(t):$afe.select(t)},setCurrentSelectionCountInBanner:function WP$Scheduling$StepController$getCurrentSelectionCount(){},getContinueButton:function WP$Scheduling$StepController$getContinueButton(e){return e.find("#scheduling-continue")},isUsingWorkflowNavigation:function WP$Scheduling$StepController$isUsingWorkflowNavigation(){return!0}},i=function WP$Scheduling$StepController$StepSettings(e){"object"===$.type(e)&&(this.ReadOnly=e.ReadOnly,this.Hide=e.Hide,this.HideIfOne=e.HideIfOne,this.HideIfPreselected=e.HideIfPreselected,this.Collapse=e.Collapse,this.CollapseIfOne=e.CollapseIfOne,this.PreselectAllModels=e.PreselectAllModels)};i.prototype={ReadOnly:!1,Hide:!1,HideIfOne:!1,HideIfPreselected:!1,Collapse:!1,CollapseIfOne:!1,PreselectAllModels:!1};var n=0;e.prototype=t,e.StepSettings=i,e.$scrollable=null,e.extend($$WP.Controllers.Controller,"WP$Scheduling$StepController"),$$WP.Scheduling.StepController=e,$$WP.dudFunction=$$WP.dudFunction||function WP$dudFunction(){}}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$StepController(e){$$WP.Debug.UnitTest.assert}));;
!function definition(){var t=function WP$Scheduling$SingleAppointmentStepController(t,e,n,i,l,o,S,p,r){this.WP$Scheduling$StepController(t,e,n,i,l,o,S,p,r),this.__viewStatePropertyName="ViewState-Step"+this.Id,this.__eventManager=new $$WP.Scheduling.EventManager};t.prototype={__eventManager:null,_appointment:null,__viewStatePropertyName:"",linkAppointment:function WP$Scheduling$SingleAppointmentStepController$linkAppointment(t){this._appointment!==t&&(this.__eventManager.removeAllListeners(),this.__attachAppointmentListeners(t,this.__eventManager),this._appointment=t)},hasMultipleLinkedAppointments:function WP$Scheduling$SingleAppointmentStepController$hasMultipleLinkedAppointments(){return!1},isNeeded:function WP$Scheduling$SingleAppointmentStepController$isNeeded(){return!0},__attachAppointmentListeners:function WP$Scheduling$SingleAppointmentStepController$__attachAppointmentListeners(t,e){$$WP.Debug.logError(this._constructor.name+" did not override the virtual __attachAppointmentListeners method from SingleAppointmentStepController.")},dispose:function(){this.__eventManager.removeAllListeners(),this.WP$Scheduling$StepController$dispose()},updateViewModel:function WP$Scheduling$SingleAppointmentStepController$updateViewModel(t){t=!!t,this.ViewModel={IsStacked:this.__isStacked(),IsFirstOnPage:!this.__isStacked()||this.__isFirstInStack(t),PositionInStack:this.__indexInStack()+1,StackLength:this.__stackLength()}},__indexInStack:function WP$Scheduling$SingleAppointmentStepController$__indexInStack(t){var e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id),n=null,i=0;for(n=(t=!!t)?this.__getVisibleStackSteps():this.__getAllStackSteps(),i=0;i<n.length;i++)if(n[i]===e)return i},__stackLength:function WP$Scheduling$SingleAppointmentStepController$__stackLength(){return this.__getAllStackSteps().length},__isStacked:function WP$Scheduling$SingleAppointmentStepController$__isStacked(){return this.__getAllStackSteps().length>1},__isFirstInStack:function WP$Scheduling$__isFirstInStack(t){return t=!!t,0===this.__indexInStack(t)},__getVisibleStackSteps:function WP$Scheduling$SingleAppointmentStepController$__getVisibleStackSteps(){var t=this.Data.SchedulingSteps.getFromIndex("ID",this.Id),e=null===t?[]:this.Data.SchedulingSteps.getFromIndex("StackId",t.StackId),n=[],i=null,l=0;for(l=0;l<e.length;l++)(i=e[l]).IsHidden||""===i.StackId||n.push(i);return n},__getAllStackSteps:function WP$Scheduling$SingleAppointmentStepController$__getAllStackSteps(){var t=this.Data.SchedulingSteps.getFromIndex("ID",this.Id),e=null===t?[]:this.Data.SchedulingSteps.getFromIndex("StackId",t.StackId),n=[],i=null,l=0;for(l=0;l<e.length;l++)""!==(i=e[l]).StackId&&n.push(i);return n},isTheLastIncompleteStep:function WP$Scheduling$SingleAppointmentStepController$isTheLastIncompleteStep(){var t=0,e=null,n=this.__getAllStackSteps(),i=this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete,l=!0,o=this.__indexInStack();for(t=0;t<n.length;t++)t!==o&&(e=n[t],l=l&&e.CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete);return i&&l}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SingleAppointmentStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$SingleAppointmentStepController")}();;
!function WP$Scheduling$ReasonForVisitStepController$definition(){var e=$$WP.Scheduling.ReasonForVisit,t=$$WP.Scheduling.TelehealthLocation,i=$$WP.Scheduling.Appointment,n=$$WP.Scheduling.SchedulingSelectableViewBinder,s=$$WP.Scheduling.TelehealthFilters,o=$$WP.Scheduling.Workflow,a={NoFiltering:0,FilterOnSelectedProviders:1,Request:2,OnDemandTelehealth:3,FilterOnSelectedSpecialty:4},r=0,l=1,d=2,h=function WP$Scheduling$ReasonForVisitStepController(t,i,s,o,r,l,d,h,u,c,p,S){switch(null==o&&(o=[]),this.WP$Scheduling$StepController(t,i,s,o,r,$$WP.Templates.Scheduling.ReasonForVisitStep,null,!1,d),this.proxify("updateStep","_onReasonForVisitChanged","_onAncillaryDataChanged","_onViewModelChanged","_onRoutingDestinationValidated","__onReasonsForVisitDataLoaded"),this._mode=l||a.NoFiltering,this._stopSchedulingCallback=d,this._defaultToNoRFVs=h,this._appointment=this.Data.AppointmentBuilder.getFirstAppointment(),this._canShowStepPretext=u,this._isAnonymous=c,this._workflow=p,this.__isLoadingRfvData=!1,this.__hasPatientLocationRule=S,this.setViewBinder(new n("ViewState",e.StatesEnum.Selected,e.StatesEnum.Unselected)),this.Data.ReasonsForVisit.addPropertyListener("ViewState",this._onViewModelChanged),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this._onReasonForVisitChanged),this.Data.ReasonsForVisit.addCollectionEventListener("add",this._onAncillaryDataChanged),this._mode){case a.FilterOnSelectedProviders:this._appointment.Providers.addCollectionEventListener("add",this._onAncillaryDataChanged),this._appointment.Providers.addCollectionEventListener("remove",this._onAncillaryDataChanged);break;case a.OnDemandTelehealth:this.Data.TelehealthLocations.addPropertyListener("State",this._onAncillaryDataChanged);break;case a.FilterOnSelectedSpecialty:this.Data.AppointmentBuilder.addPropertyListener("Specialty",this._onAncillaryDataChanged)}};h.prototype={_appointment:null,_mode:null,_stopSchedulingCallback:null,_defaultToNoRFVs:!1,_canShowStepPretext:!1,_isAnonymous:!1,__isLoadingRfvData:!1,_onDemandBackupArray:null,__hasPatientLocationRule:!1,updateViewModel:function WP$Scheduling$ReasonForVisitStepController$updateViewModel(){var e=this._getAvailableReasonsForVisit();this._setViewModelSelectedStates(e);var i=!1,n=this.Data.TelehealthLocations.getFirstInIndex("State",t.StatesEnum.Selected),o=null,h=!1;null!==n&&(o=n.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected)),this.Data.TelehealthData.setProperty("SelectedWorkflow",null);var u=this._mode===a.OnDemandTelehealth;if(u){var c,p=e.length,S=!1;for(c=0;c<p;c++)if(h=s.AreProvidersLicensedAtLocation(e[c].AllProviderDepartmentPairs,n,o),e[c].EnabledForQuickSchedule=!!h,s.IsInLicensedLocation(e[c].AllowedTelemedicineLocations,n,o,null,!0)||h){S=!0;break}(e=s.FilterRFVsByLicensure(e)).sort($$WP.Scheduling.ReasonForVisit.sortReasonsForOnDemand),i=!S,(null===this._onDemandBackupArray||n!==this._onDemandBackupArray[r]||null!==o&&o!==this._onDemandBackupArray[l]||0!==e.length&&e.length!==this._onDemandBackupArray[d].length)&&(this._onDemandBackupArray=[n,o,e]),0===e.length&&(e=this._onDemandBackupArray[d])}else e.sort($$WP.Scheduling.ReasonForVisit.sortReasons);this.ViewModel={ReasonsForVisit:e,Count:e.length,StepShouldBeActive:!0,IsOnDemandTelehealth:u,HasNoLicensedTelehealthProviders:i,ReasonForVisitLoadingMessage:this.SchedulingStringsNamespace.getString("LoadingMessage"),RfvListAdditionalData:{ViewBinderId:this.ViewBinder.ViewBinderId,ListLabelledById:"ReasonForVisitStepHeader",ListDescribedById:"ReasonForVisitPretext"}}},_getAvailableReasonsForVisit:function WP$Scheduling$ReasonForVisitStepController$_getAvailableReasonsForVisit(){var e,t,i;switch(this._mode){case a.NoFiltering:e=this._getUnfilteredReasonsForVisit(!0,!0);break;case a.FilterOnSelectedProviders:e=this._getReasonsForVisitFilterOnProvider();break;case a.Request:e=this._getUnfilteredReasonsForVisit(!1,!0);break;case a.OnDemandTelehealth:e=this.__getTelehealthReasonsForVisit();break;case a.FilterOnSelectedSpecialty:e=this._getReasonsForVisitFilterOnSpecialty()}return this._mode===a.FilterOnSelectedSpecialty?(t=this.filterByAllowedIds(e,"DefaultVisitTypeId",this._defaultToNoRFVs),this.Data.AppointmentBuilder.OriginalReasonForVisit&&(i=this.__getReasonForVisitFromArrayById(e,this.Data.AppointmentBuilder.OriginalReasonForVisit.Id),this.__isOriginalReasonForVisitAnAllowedId(i)&&t.push(i))):t=this.filterByAllowedIds(e,"Id",this._defaultToNoRFVs),t},__isOriginalReasonForVisitAnAllowedId:function WP$Scheduling$ReasonForVisitStepController$__isOriginalReasonForVisitAnAllowedId(e){return!(!e||!e.DefaultVisitTypeId)&&this.allowedIds[this.Data.AppointmentBuilder.OriginalReasonForVisit.DefaultVisitTypeId]},__getReasonForVisitFromArrayById:function WP$Scheduling$ReasonForVisitStepController$__getReasonForVisitFromArrayById(e,t){return e.find((e=>e.Id===t))},arePrerequisitesComplete:function WP$Scheduling$ReasonForVisitStepController$arePrerequisitesComplete(){switch(this._mode){case a.OnDemandTelehealth:return this._isTelehealthLocationSelected();case a.FilterOnSelectedProviders:return this._appointment.Providers.size()>0;case a.FilterOnSelectedSpecialty:return null!==this.Data.AppointmentBuilder.Specialty;default:return!0}},beforeFirstRender:function WP$Scheduling$ReasonForVisitStepController$beforeFirstRender(){var e=[],t=this.ViewModel.ReasonsForVisit;this.__registerHandlebarsHelpers(),(e=this._mode===a.FilterOnSelectedSpecialty?this.getPreSelectedModelsOnly(t,"DefaultVisitTypeId"):this.getPreSelectedModelsOnly(t,"Id")).length>0&&(this.stepSettings.HideIfPreselected&&(this.stepSettings.Hide=!0),this.__selectFirstRfvFromList(e))},__registerHandlebarsHelpers:function WP$Scheduling$ReasonForVisitStepController$__registerHandlebarsHelpers(){Handlebars.registerHelper("canDisplaySoloTitle",(function(e,t,i){return 1!==e.length||$$WPUtil.IsNullOrEmpty(t.SoloTitle)?i.inverse(this):i.fn(this)}))},beforeRender:function WP$Scheduling$ReasonForVisitStepController$beforeRender(){this.isHidden()&&!this.hasPreselectedIds()&&this.__autoSelectRfvIfHidden(),$afe.select("#AnonymousSchedulingBanner").safeReplaceWith($$WP.SimpleTemplates.Div({id:"telehealthBannerWeb"})),$afe.select("#EmergencyWarningBanner").safeReplaceWith($$WP.SimpleTemplates.Div({id:"telehealthBannerWeb"}))},__autoSelectRfvIfHidden:function WP$Scheduling$ReasonForVisitStepController$__autoSelectRfvIfHidden(){this.isHidden()&&!this.hasPreselectedIds()&&(this.__selectFirstRfvFromList(this.ViewModel.ReasonsForVisit),this.Data.AppointmentBuilder.ReasonForVisit||this.showError())},__selectFirstRfvFromList:function WP$Scheduling$ReasonForVisitStepController$__selectFirstRfvFromList(e){var t=e[0];t&&this.Data.AppointmentBuilder.setProperty("ReasonForVisit",t)},afterRender:function WP$Scheduling$ReasonForVisitStepController$afterRender(){this.__setupPretext(),$$WPSchedulingUtil.HandleStickyBanner(),$$WPSchedulingUtil.FocusElement(this.$root.find("h2.header")),this.__isLoadingRfvData&&$$WPSchedulingRfvsCore.ShowAjaxSpinner(this.$root)},beforeNavigateBack:function WP$Scheduling$ReasonForVisitStepController$beforeNavigateBack(){this.Data.AppointmentBuilder.setProperty("ReasonForVisit",null)},__setupPretext:function __setupPretext(){var e,t,i;this._canShowStepPretext&&(e=this.$root.find(".reasonforvisitstep .pretext"),t=$$WP.Strings.getForTemplate("StepPretextHeader","Scheduling.Fixed"),(i=$$WP.Strings.getForTemplate("ReasonForVisitStepPretextExpanded","Scheduling"))&&!$$WPUtil.IsNullOrEmpty(i.string)&&new $$WP.UI.ProgressiveDisclosureController(e,t,i,$$WP.UI.ProgressiveDisclosureTypeEnum.Info))},_getViewEventSubmodule:function WP$Scheduling$ReasonForVisitStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.ReasonForVisitStep},_onViewModelChanged:function WP$Scheduling$ReasonForVisitStepController$_onViewModelChanged(t){var i,n;for(i in t)switch(n=t[i].model||$$WP.Common.Model.getInstance(i),t[i].to){case e.StatesEnum.Selected:this.Data.AppointmentBuilder.setProperty("ReasonForVisit",null),this.Data.AppointmentBuilder.setProperty("ReasonForVisit",n);break;case e.StatesEnum.Unselected:this.Data.AppointmentBuilder.ReasonForVisit===n&&this.Data.AppointmentBuilder.setProperty("ReasonForVisit",null)}},_onReasonForVisitChanged:function WP$Scheduling$ReasonForVisitStepController$_onReasonForVisitChanged(){var e=this.Data.AppointmentBuilder.ReasonForVisit,n=$$WPUtil.IsNullOrEmpty(e)?null:e.DefaultVisitType,s=null,o=null;if(null!==e){if(e.HasIncompleteSchedulingData&&!e.DefaultVisitType.hasNonAnonymousLqf())return this.Data.AppointmentBuilder.Specialty&&(s=this.Data.AppointmentBuilder.Specialty.Id),this.__isLoadingRfvData=!0,$$WPSchedulingRfvsCore.ShowAjaxSpinner(this.$root),o=$$WPSchedulingRfvsCore.BuildSchedulingParameters(e.Id,s),void $$WPSchedulingRfvsCore.LoadReasonForVisitData(o,this._workflow,this.__onReasonsForVisitDataLoaded);if(this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped=!1,this.Data.AppointmentBuilder.updateAppointmentsCollectionForReasonForVisit(e,i.VisitTypeSourceEnum.Default,this._workflow,this.__hasPatientLocationRule),this._mode===a.OnDemandTelehealth&&this.Data.TelehealthData){this.Data.TelehealthData.resetData();var r=this.Data.TelehealthLocations.getFirstInIndex("State",t.StatesEnum.Selected),l=r.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected),d=null!==l?l.Id:null;return void t.checkRoutingDestinationForLocation(r.Id,d,e.OnDemandRFV,e.LineInWDF40040,this._isAnonymous,this._workflow.IsGuest,this._onRoutingDestinationValidated)}}else this.Data.AppointmentBuilder.resetAppointmentsCollection();$$WPUtil.IsNullOrEmpty(e)||$$WPUtil.IsNullOrEmpty(n)||!n.isVisitTypeMyChartLink()?this._updateViewOnRFVChanged():$$WPSchedulingUtil.OnMyChartLinkClicked(this._workflow,this.Data,n.MenuLinkCompleteUri,n.DataAttributes)},__onReasonsForVisitDataLoaded:function WP$Scheduling$ReasonForVisitStepController$__onReasonsForVisitDataLoaded(e){var t,i=this.Data.AppointmentBuilder.Specialty;this._openChangeBatch(),$$WPSchedulingRfvsCore.UpdateDataPoolReasonsForVisit(this.Data,e.SchedulingViewModel),i&&this.Data.ReasonsForVisit.getFromIndex("Id",e.ReasonForVisitLineId).setProperty("SpecialtyGroupId",i.Id),this._closeChangeBatch(),this.__isLoadingRfvData=!1,$$WPSchedulingRfvsCore.HideAjaxSpinner(this.$root),t=this.Data.ReasonsForVisit.getFromIndex("Id",e.ReasonForVisitLineId),this.Data.AppointmentBuilder.setProperty("ReasonForVisit",t),this.Data.prepForWorkflowAgain()},_updateViewOnRFVChanged:function WP$Scheduling$ReasonForVisitStepController$_updateViewOnRFVChanged(){this._updateStepStatus(),this._setViewModelSelectedStates(this._getAvailableReasonsForVisit()),this.ViewBinder.syncModelsToDOM(),$$WPSchedulingUtil.HandleStickyBanner()},_onRoutingDestinationValidated:function WP$Scheduling$ReasonForVisitStepController$_onRoutingDestinationValidated(e){""!==e.EstimatedWaitTime&&null!==this.Data.AppointmentBuilder.ReasonForVisit.OnDemandOrganization&&(this.Data.AppointmentBuilder.ReasonForVisit.OnDemandOrganization.EstimatedWaitTime=e.EstimatedWaitTime,this.Data.AppointmentBuilder.ReasonForVisit.OnDemandOrganization._processWaitTime()),e.HasValidRoutingDestination?this._updateViewOnRFVChanged():this.Data.AppointmentBuilder.ReasonForVisit&&(this.Data.AppointmentBuilder.ReasonForVisit.EnabledForQuickSchedule||this.Data.AppointmentBuilder.ReasonForVisit.ExternallyAvailableForTelehealth)?(this.Data.AppointmentBuilder.ReasonForVisit.InternallyAvailableForTelehealth=!1,this._updateViewOnRFVChanged()):(this.ViewModel.HasNoLicensedTelehealthProviders=!0,this.showError(this.ViewModel))},_onAncillaryDataChanged:function WP$Scheduling$ReasonForVisitStepController$_onAncillaryDataChanged(){this._isSelectedReasonForVisitValid()||this.Data.AppointmentBuilder.IsLoadingTieredData||this.Data.AppointmentBuilder.setProperty("ReasonForVisit",null),this.updateStep()},_isSelectedReasonForVisitValid:function WP$Scheduling$ReasonForVisitStepController$_isSelectedReasonForVisitValid(){var e,t,i;for(t=this.Data.AppointmentBuilder.ReasonForVisit,i=this._getAvailableReasonsForVisit(),e=0;e<i.length;e++)if(i[e]===t)return!0;return!1},_updateStepStatus:function WP$Scheduling$ReasonForVisitStepController$_updateStepStatus(){this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),null!==this.Data.AppointmentBuilder.ReasonForVisit&&(this.isHidden()?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete))},_setViewModelSelectedStates:function(t){var i,n,s;for(i=this.Data.AppointmentBuilder.ReasonForVisit,s=0;s<t.length;s++)(n=t[s]).ViewState=n===i?e.StatesEnum.Selected:e.StatesEnum.Unselected},_getUnfilteredReasonsForVisit:function WP$Scheduling$ReasonForVisitStepController$_getUnfilteredReasonsForVisit(e,t){var i=this.Data.ReasonsForVisit.toArray();return $$WP.Scheduling.Workflow.buildReasonsForVisitNoFiltering(i,e,t,this._isAnonymous,this._workflow.IsGuest,this._workflow.IsFromPrelogin)},_getReasonsForVisitFilterOnProvider:function WP$Scheduling$ReasonForVisitStepController$_getReasonsForVisitFilterOnProvider(){var e,t=0,i=0,n=[],s=[],a=null,r=null,l=this.Data.AppointmentBuilder.ReasonForVisit;for(s=this._appointment.Providers.toArray(),e=this.Data.ReasonsForVisit.toArray(),t=0;t<e.length;t++)if(a=e[t],o.isReasonForVisitAvailableProviderFirst(a))for(i=0;i<a.AllProviderDepartmentPairs.length;i++)if(r=a.AllProviderDepartmentPairs[i],-1!==s.indexOf(r.Provider)&&r.Provider.IsStandardProvider){n.push(a);break}return l&&-1===n.indexOf(l)&&s.length>0&&n.push(l),n},_getReasonsForVisitFilterOnSpecialty:function WP$Scheduling$ReasonForVisitStepController$_getReasonsForVisitFilterOnSpecialty(){var e,t,i,n,s,o,a,r,l=[],d=null,h=null;if(null===(s=this.Data.AppointmentBuilder.Specialty))return[];if((a=this.Data.ReasonsForVisit.getFromIndex("SpecialtyGroupId",s.Id)).length>0)return a;for(o=this.Data.Departments.getFromIndex("SpecialtyGroupId",s.Id),r=this.Data.ReasonsForVisit.toArray(),e=0;e<r.length;e++)for(d=r[e],t=0;t<d.AllProviderDepartmentPairs.length;t++){for(n=!1,h=d.AllProviderDepartmentPairs[t],i=0;i<o.length;i++)if(o[i].ID===h.DepartmentId){n=!0;break}if(n){l.push(d);break}}return l},__getTelehealthReasonsForVisit:function WP$Scheduling$ReasonForVisitStepController$__getTelehealthReasonsForVisit(){var e,i,n,o,a,r;i=[];var l,d={};if(null===(a=this.Data.TelehealthLocations.getFirstInIndex("State",t.StatesEnum.Selected)))return[];for(r=a.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected),n=this.Data.ReasonsForVisit.toArray(),e=0;e<n.length;e++){(o=n[e]).IsNotAvailableForPatientsLocation=!1,(l=$$WP.Utilities.UI.IsMobile?$$WP.Scheduling.TelehealthFilters.IsInLicensedLocation(o.AllowedTelemedicineLocations,a,r,s.PlatformFilterValueEnum.Mobile):$$WP.Scheduling.TelehealthFilters.IsInLicensedLocation(o.AllowedTelemedicineLocations,a,r,null,!0))&&o.ExternallyAvailableForTelehealth&&this.Data.TelehealthData.IsXOrgEnabled||s.DoesRFVHaveAnyAvailablePlatforms(o)&&(!$$WP.Utilities.UI.IsMobile||s.IsRFVEnabledForPlatform(o,s.PlatformFilterValueEnum.Mobile,this.Data.TelehealthData.IsXOrgEnabled));var h=s.IsRFVInLicensedLocationForQuickSchedule(o,a,r),u=o.EnabledForOnDemandVideoVisits,c=this.Data.TelehealthData.AutoSelectedWorkflow!==$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing&&h&&o.CategoryValue;if(u||c){var p=u&&!l,S=c&&!h;if((p&&S||p&&!c||S&&!u)&&(o.IsNotAvailableForPatientsLocation=!0),r)if(void 0===d[o.OnDemandRFV])i.push(o),d[o.OnDemandRFV]=i.length-1;else{var g=i[d[o.OnDemandRFV]],F=s.GetDuplicateLinePriority(g,a,r);s.GetDuplicateLinePriority(o,a,r)>F&&(i[d[o.OnDemandRFV]]=o)}else i.push(o)}}return i},_isTelehealthLocationSelected:function WP$Scheduling$ReasonForVisitStepController$_isTelehealthLocationSelected(){var e;return!!(e=this.Data.TelehealthLocations.getFirstInIndex("State",t.StatesEnum.Selected))&&(!!e.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected)||0===e.SubLocations.size())},hasStickyBanner:function WP$Scheduling$ReasonForVisitStepController$hasStickyBanner(){return!0}},h.ModesEnum=a,$$WP.Scheduling.ReasonForVisitStepController=h,h.extend($$WP.Scheduling.StepController,"WP$Scheduling$ReasonForVisitStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$ReasonForVisitStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$ProviderReasonForVisitStepController$definition(){var e=$$WP.Scheduling.ReasonForVisit.PatientTypeEnum,t=function WP$Scheduling$ProviderReasonForVisitStepController(e,t,i,n,o,r,s,l,a,d,g,h){this.WP$Scheduling$ReasonForVisitStepController(e,t,i,n,r,$$WP.Scheduling.ReasonForVisitStepController.ModesEnum.NoFiltering,s,!1,!1,l,a),this.template=$$WP.Templates.Scheduling.ProviderReasonForVisitStep,this.proxify("updateStep","__onPatientTypeToggleChanged","__onPatientTypeChanged","__onReasonForVisitChanged"),this.__allowedProviderIds=d||[],this.__allowedDepartmentIds=g||[],this.__preselectedPatientType=o,this.__allowMobileSchedulingInlineRedirects=h,this.$root.on("change","input[type='radio']",this.__onPatientTypeToggleChanged),this.Data.AppointmentBuilder.addPropertyListener("PatientType",this.__onPatientTypeChanged),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.__onReasonForVisitChanged)};t.prototype={__allowedProviderIds:[],__allowedDepartmentIds:[],__isInitialRenderComplete:!1,__preselectedPatientType:null,updateViewModel:function WP$Scheduling$ProviderReasonForVisitStepController$updateViewModel(){this.WP$Scheduling$ReasonForVisitStepController$updateViewModel(),this.ViewModel.PatientTypeOptions=this.__buildPatientTypeOptions(this.ViewModel.ReasonsForVisit,this.__getCanLoginToSchedule()),this.ViewModel.ProviderContextViewModel=$$WP.Scheduling.ProvidersCore.GetProviderContextViewModel(this.__getPrimaryProvider()),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@PROVIDER@",this.ViewModel.ProviderContextViewModel.Name,$$WP.Strings.EncodingTypes.HTML),this.ViewModel.StepTitle=$$WP.Strings.getForTemplate("FirstVisitLabel","Scheduling.fixed"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@PROVIDER@"),1===this.ViewModel.PatientTypeOptions.length&&(this.ViewModel.StepTitle=this.ViewModel.PatientTypeOptions[0].Title,this.ViewModel.Emblem=this.ViewModel.PatientTypeOptions[0].Emblem,this.ViewModel.PatientTypeOptions[0].Title=null)},__buildPatientTypeOptions:function WP$Scheduling$ProviderReasonForVisitStepController$__buildPatientTypeOptions(t,i){var n=[];return this.__isPatientTypePreselected()?n.push(this.__buildPatientTypeSchedulingOption(this.__preselectedPatientType,t,this.__preselectedPatientType===e.EstablishedPatient&&i)):(n.push(this.__buildPatientTypeSchedulingOption(e.NewPatient,t,!1)),n.push(this.__buildPatientTypeSchedulingOption(e.EstablishedPatient,t,i))),n},__buildPatientTypeSchedulingOption:function WP$Scheduling$ProviderReasonForVisitStepController$__buildPatientTypeSchedulingOption(e,t,i){var n=this.__getRfvToPreselect(),o=!!n&&n.ExpectedPatientType===e,r=!!n&&n.ExpectedPatientType!==e,s=i&&!o,l=this.__filterRfvsForPatientType(e,t,n),a=0===l.length||1===l.length&&!s,d="workflow=ExistingProvider&selProv="+this.__allowedProviderIds[0],g={PatientType:e,IsSelected:e===this.Data.AppointmentBuilder.PatientType,IsDeviationFromDeepLink:r,ReasonsForVisit:l.sort($$WP.Scheduling.ReasonForVisit.sortReasons),IsRfvListHidden:a,CanLoginToSchedule:s,LoginUrl:$$WP.Utilities.UI.IsLoggedIn?$$WP.Utilities.UI.IsMobile&&!this.__allowMobileSchedulingInlineRedirects?makeLink("epichttp://scheduling?"+d):makeLink("Scheduling?"+d):makeLink("Home/LogOut?skipAbandonCurrent=1&postloginmode=schedulingproxysel&destination=1&"+d),RfvListAdditionalData:{ViewBinderId:this.ViewBinder.ViewBinderId,ListLabelledById:"PatientTypeHeader_"+e}};return this.__setPatientTypeOptionStrings(e,g),g},__filterRfvsForPatientType:function WP$Scheduling$ProviderReasonForVisitStepController$__filterRfvsForPatientType(t,i,n){var o=null,r=e.Unknown,s=[];if(n&&n.ExpectedPatientType===t)s=[n];else for(var l=0;l<i.length;l++)(r=(o=i[l]).ExpectedPatientType)!==t&&r!==e.Unknown&&r!==e.Both||s.push(o);return s},beforeFirstRender:function WP$Scheduling$ProviderReasonForVisitStepController$beforeFirstRender(){var e,t=this.ViewModel.ReasonsForVisit;this.WP$Scheduling$ReasonForVisitStepController$__registerHandlebarsHelpers(),this.__isPatientTypePreselected()&&this.Data.AppointmentBuilder.setProperty("PatientType",this.__preselectedPatientType),e=this.getPreSelectedModelsOnly(t,"Id"),this.__canPreselectRfv(e)&&this.WP$Scheduling$ReasonForVisitStepController$beforeFirstRender()},__canPreselectRfv:function WP$Scheduling$ProviderReasonForVisitStepControllrer$__canPreselectRfv(t){var i,n=e.Unknown;return 0!==t.length&&(!(i=(n=t[0].ExpectedPatientType)===e.NewPatient||n===e.EstablishedPatient)||i&&this.__isPatientTypePreselected())},__isPatientTypePreselected:function WP$Scheduling$ProviderReasonForVisitStepController$__isPatientTypePreselected(){return this.__preselectedPatientType===e.NewPatient||this.__preselectedPatientType===e.EstablishedPatient},beforeRender:function WP$Scheduling$ProviderReasonForVisitStepController$beforeRender(){if(this.WP$Scheduling$ReasonForVisitStepController$beforeRender(),1===this.ViewModel.PatientTypeOptions.length){var e=this.ViewModel.PatientTypeOptions[0];0!==e.ReasonsForVisit.length||!e.CanLoginToSchedule||$$WPUtil.IsNullOrEmpty(e.LoginUrl)||$$WP.Utilities.UI.IsMobile?1!==e.ReasonsForVisit.length||e.CanLoginToSchedule||(this.stepSettings.Hide=!0,this.Data.AppointmentBuilder.setProperty("ReasonForVisit",e.ReasonsForVisit[0])):(this.stepSettings.Hide=!0,window.location.replace(this.ViewModel.PatientTypeOptions[0].LoginUrl))}},__onPatientTypeToggleChanged:function WP$Scheduling$ProviderReasonForVisitStepController$__onPatientTypeToggleChanged(e){var t=parseInt(e.currentTarget.value,10);this.Data.AppointmentBuilder.setProperty("PatientType",t)},__onPatientTypeChanged:function WP$Scheduling$ProviderReasonForVisitStepController$__onPatientTypeChanged(){this.Data.AppointmentBuilder.setProperty("ReasonForVisit",null),this.updateStep()},__onReasonForVisitChanged:function WP$Scheduling$ProviderReasonForVisitStepController$__onReasonForVisitChanged(){this.__isInitialRenderComplete=!0},__getDepartmentLookbackDays:function WP$Scheduling$ProviderReasonForVisitStepController$__getDepartmentLookbackDays(){for(var e=this.Data.Departments.toArray(),t=0,i=0;i<e.length;i++)t=Math.max(e[i].LookbackDays,t);return t},__getDepartmentPhone:function WP$Scheduling$ProviderReasonForVisitStepController$__getDepartmentPhone(){var e=this.__getPrimaryDepartment();return e?e.PhoneNumber:""},__getCanLoginToSchedule:function WP$Scheduling$ProviderReasonForVisitStepController$__getCanLoginToSchedule(){for(var e=this.Data.ProviderDepartmentPairs.toArray(),t=this.__getPrimaryProvider(),i=null,n=0;n<e.length;n++)if((i=e[n]).Provider===t&&i.CanLoginToSchedule)return!0;return!1},__getPrimaryDepartment:function WP$Scheduling$ProviderReasonForVisitStepController$__getPrimaryDepartment(){var e=this.Data.Departments,t=e.toArray();return 1===this.__allowedDepartmentIds.length?e.getFromIndex("ID",this.__allowedDepartmentIds[0]):1===t.length?t[0]:null},__getPrimaryProvider:function WP$Scheduling$ProviderReasonForVisitStepController$__getPrimaryProvider(){return 1===this.__allowedProviderIds.length?this.Data.Providers.getFromIndex("ID",this.__allowedProviderIds[0]):null},__getRfvToPreselect:function WP$Scheduling$ProviderReasonForVisitStepController$__getRfvToPreselect(){var e=null,t=this._getAvailableReasonsForVisit(),i=this.getPreSelectedModelsOnly(t,"Id");return i.length>0&&(e=i[0]),this.__isInitialRenderComplete?null:e},__setPatientTypeOptionStrings:function WP$Scheduling$ProviderReasonForVisitStepController$__setPatientTypeOptionStrings(t,i){var n=this.__getDepartmentPhone();switch(t){case e.NewPatient:this.__setNewPatientOptionStrings(i,n);break;case e.EstablishedPatient:this.__setEstablishedPatientOptionStrings(i,n)}},__setNewPatientOptionStrings:function WP$Scheduling$ProviderReasonForVisitStepController$__setNewPatientOptionStrings(e,t){e.RadioLabel=$$WP.Strings.getForTemplate("FirstVisitRadioButtonText","Scheduling.fixed"),e.Warning=e.IsDeviationFromDeepLink?{Title:$$WP.Strings.getForTemplate("PatientTypeWarningTitle","Scheduling.fixed"),Description:$$WP.Strings.getForTemplate("NewPatientWarning","Scheduling")}:null,e.IsRfvListHidden?0===e.ReasonsForVisit.length&&(e.Title=$$WP.Strings.getForTemplate("CallToScheduleHeader","Scheduling.fixed"),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DEPARTMENTPHONE@",t,$$WP.Strings.EncodingTypes.HTML),e.Instructions=$$WPUtil.IsNullOrEmpty(t)?$$WP.Strings.getForTemplate("NewPatientNoSchedulingCallSchedulingPhoneInstructions","Scheduling"):$$WP.Strings.getForTemplate("NewPatientNoSchedulingCallDepartmentInstructions","Scheduling"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@DEPARTMENTPHONE@"),e.Emblem="library.svg#_emblem_blankphone"):e.Title=$$WP.Strings.getForTemplate("ReasonForVisitStepHeader","Scheduling")},__setEstablishedPatientOptionStrings:function WP$Scheduling$ProviderReasonForVisitStepController$__setEstablishedPatientOptionStrings(e,t){e.RadioLabel=this.__getEstablishedPatientRadioButtonText(this.__getDepartmentLookbackDays()),e.Warning=e.IsDeviationFromDeepLink?{Title:$$WP.Strings.getForTemplate("PatientTypeWarningTitle","Scheduling.fixed"),Description:$$WP.Strings.getForTemplate("EstablishedPatientWarning","Scheduling")}:null,this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DEPARTMENTPHONE@",t,$$WP.Strings.EncodingTypes.HTML),e.IsRfvListHidden?e.CanLoginToSchedule?(e.Title=$$WP.Utilities.UI.IsLoggedIn?"":$$WP.Strings.getForTemplate("ScheduleInMyChartHeader","Scheduling.fixed"),e.Instructions=$$WP.Utilities.UI.IsLoggedIn?$$WP.Strings.getForTemplate("LookbackProviderInstructions","Scheduling"):$$WPUtil.IsNullOrEmpty(t)?$$WP.Strings.getForTemplate("EstablishedPatientNoSchedulingLoginOrCallSchedulingPhoneInstructions","Scheduling"):$$WP.Strings.getForTemplate("EstablishedPatientNoSchedulingLoginOrCallDepartmentInstructions","Scheduling"),e.LoginButtonText=$$WP.Utilities.UI.IsLoggedIn?$$WP.Strings.getForTemplate("ScheduleInDirectButtonText","Scheduling"):$$WP.Strings.getForTemplate("LogInButtonText","Scheduling.fixed"),e.Emblem="library.svg#_emblem_calendarwitharrow"):0===e.ReasonsForVisit.length&&(e.Title=$$WP.Strings.getForTemplate("CallToScheduleHeader","Scheduling"),e.Instructions=$$WPUtil.IsNullOrEmpty(t)?$$WP.Strings.getForTemplate("EstablishedPatientNoSchedulingCallSchedulingPhoneInstructions","Scheduling"):$$WP.Strings.getForTemplate("EstablishedPatientNoSchedulingCallDepartmentInstructions","Scheduling"),e.Emblem="library.svg#_emblem_blankphone"):(e.Title=$$WP.Strings.getForTemplate("ReasonForVisitStepHeader","Scheduling"),e.CanLoginToSchedule&&(e.Instructions=$$WPUtil.IsNullOrEmpty(t)?$$WP.Utilities.UI.IsLoggedIn?$$WP.Strings.getForTemplate("EstablishedPatientGoToDirectOrCallSchedulingPhoneInstructions","Scheduling"):$$WP.Strings.getForTemplate("EstablishedPatientLoginOrCallSchedulingPhoneInstructions","Scheduling"):$$WP.Utilities.UI.IsLoggedIn?$$WP.Strings.getForTemplate("EstablishedPatientGoToDirectOrCallDepartmentInstructions","Scheduling"):$$WP.Strings.getForTemplate("EstablishedPatientLoginOrCallDepartmentInstructions","Scheduling"),e.LoginButtonText=$$WP.Utilities.UI.IsLoggedIn?$$WP.Strings.getForTemplate("ScheduleInDirectButtonText","Scheduling"):$$WP.Strings.getForTemplate("LogInButtonText","Scheduling.fixed"))),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@DEPARTMENTPHONE@")},__getEstablishedPatientRadioButtonText:function WP$Scheduling$ProviderReasonForVisitStepController$__getEstablishedPatientRadioButtonText(e){return e>=150&&e<=210?$$WP.Strings.getForTemplate("EstablishedVisitRadioButtonTextSixMonths","Scheduling.fixed"):e>=211&&e<=400?$$WP.Strings.getForTemplate("EstablishedVisitRadioButtonTextOneYear","Scheduling.fixed"):e>=401&&e<=800?$$WP.Strings.getForTemplate("EstablishedVisitRadioButtonTextTwoYears","Scheduling.fixed"):e>=801&&e<=1200?$$WP.Strings.getForTemplate("EstablishedVisitRadioButtonTextThreeYears","Scheduling.fixed"):$$WP.Strings.getForTemplate("EstablishedVisitRadioButtonText","Scheduling.fixed")}},$$WP.Scheduling.ProviderReasonForVisitStepController=t,t.extend($$WP.Scheduling.ReasonForVisitStepController,"WP$Scheduling$ProviderReasonForVisitStepController")}();;
!function WP$SchedulingLqfStepController$definition(){var e=$$WP.Scheduling.VisitType,t=$$WP.Scheduling.Lqf,i=$$WP.Scheduling.SchedulingOverride,n=$$WP.Scheduling.Appointment,o=Epic.PatientEngagement.Questionnaire.Ui,r=$$WP.Scheduling.Workflow,l=function WP$Scheduling$LqfStepController(e,t,i,n,o,l,s){if(this.WP$Scheduling$StepController(e,t,l),this.proxify("updateStep","__onQuestionnaireAnswersEvaluated","_onAncillaryDataChanged","decisionTreeCallback","decisionTreeStepOnRenderCallback","questionnaireOnRenderCallback","_onResetLqfClicked","_onLqfDataChanged","_onResetClientStateLoadCompleted","__onAppointmentsChanged"),this._mode=i||a.Standard,this._workflow=o,this._ticketInfo=o.TicketInfo,this.__originalAppointmentInfo=o.OriginalAppointmentInfo,this._favoriteAppointmentInfo=o.FavoriteAppointmentInfo,this._stopSchedulingCallback=n,this._allowedProviderIds=l,this.__hasPatientLocationRule=s,this.__eventManager=new $$WP.Scheduling.EventManager,this.__addReasonForVisitListener(),this._mode===a.DepartmentOverride)for(var d=0;d<this.Data.SchedulingSteps.Models.length;d++)this.Data.SchedulingSteps.Models[d].Type===$$WP.Scheduling.SchedulingStep.StepTypeEnum.StandardLqf&&(this._prerequisiteStep=this.Data.SchedulingSteps.Models[d]);this._workflow.Type!==r.WorkflowTypesEnum.DecisionTreeNode&&this._workflow.Type!==r.WorkflowTypesEnum.Ticket||""!==this._workflow.SchedulingControllerParams.decisionTreeNodeCSN&&""!==this._workflow.SchedulingControllerParams.decisionTreeNodeID&&""!==this._workflow.SchedulingControllerParams.rootDecisionTreeID&&(this._workflow.decisionTreeNodeCSN=this._workflow.SchedulingControllerParams.decisionTreeNodeCSN,this._workflow.decisionTreeNodeID=this._workflow.SchedulingControllerParams.decisionTreeNodeID,this._workflow.rootDecisionTreeID=this._workflow.SchedulingControllerParams.rootDecisionTreeID),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("add",this.__onAppointmentsChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("remove",this.__onAppointmentsChanged),this.__onAppointmentsChanged(),this.$root.on("click","#reset-lqf",this._onResetLqfClicked),$$WPUtil.FixScrollingForIOS(this.$root)},s={__eventManager:null,_mode:null,renderCollapsed:null,_stopSchedulingCallback:null,_ticketInfo:null,__originalAppointmentInfo:null,_favoriteAppointmentInfo:null,_pendingResult:null,_questionnaireController:null,_questionnaireControllerLqfId:null,_decisionTreeController:null,_decisionTreeLqfId:null,_dataWasReloaded:!1,_lqfWasFiled:!1,_lastSelectedRfv:null,_lastSelectedDep:null,_prerequisiteStep:null,_isReloading:!1,_providersUpdatedViewModel:null,__reasonForVisitPropertyListenerId:null,__savedReasonForVisitFromReload:null,__hadAnyQuestions:!1,__currentVisitIndex:0,__isAskForEachAppointment:!1,__initialRfv:null,__hasPatientLocationRule:null,updateViewModel:function WP$Scheduling$LqfStepController$updateViewModel(){var e=this.Data.AppointmentBuilder.getFirstAppointment();$$WPUtil.IsNullOrEmpty(e.BundleId)||(this.__isAskForEachAppointment=!0);var t=this._getCurrentLqf();this.ViewModel={StepShouldBeActive:!0,Count:0,LqfId:t.LqfId,LqfType:t.LqfType,stepId:this.Id,ProvidersUpdated:this._providersUpdatedViewModel,HadAnyQuestions:this.__hadAnyQuestions,ProviderContextViewModel:this.__getProviderContextViewModel()},$$WPUtil.IsNullOrEmpty(this.ViewModel.LqfId)?this._lqfWasFiled?(this.stepSettings.Hide=!1,this.renderCollapsed=!0):this._isReloading?(this.stepSettings.Hide=!1,this.renderCollapsed=!1):(this.stepSettings.Hide=!0,this.renderCollapsed=!1):(this.stepSettings.Hide=!1,this.renderCollapsed=!1,null===this.__initialRfv&&this._workflow.Type!==r.WorkflowTypesEnum.ExistingProvider&&(this.__initialRfv=e.ReasonForVisit))},arePrerequisitesComplete:function WP$Scheduling$LqfStepController$arePrerequisitesComplete(){var e=this.Data.AppointmentBuilder.allAppointmentsHaveAVisitTypeSpecified(),t=this.Data.AppointmentBuilder.allAppointmentsHaveALocationSelected();switch(this._mode){case a.Standard:return e;case a.DepartmentOverride:return e&&t&&this._isPrerequisiteStepComplete()}},arePrerequisitesCompleteForStatusChange:function WP$Scheduling$LqfStepController$arePrerequisitesCompleteForStatusChange(){return this.arePrerequisitesComplete()&&!this._isReloading},_isPrerequisiteStepComplete:function WP$Scheduling$LqfStepController$_isPrerequisiteStepComplete(){return!this._prerequisiteStep||this._prerequisiteStep.CompleteStatus!==$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete},beforeFirstRender:function WP$Scheduling$LqfStepController$beforeFirstRender(){this._updateStepStatus()},beforeRender:function WP$Scheduling$LqfStepController$beforeRender(){switch(this.ViewModel.LqfType){case t.LqfTypeEnum.Questionnaire:this.template=$$WP.Templates.Scheduling.Questionnaire,this.collapsedTemplate=$$WP.Templates.Scheduling.QuestionnaireCollapsed;break;case t.LqfTypeEnum.DecisionTree:default:this.template=$$WP.Templates.Scheduling.DecisionTree,this.collapsedTemplate=$$WP.Templates.Scheduling.QuestionnaireCollapsed}},afterRender:function WP$Scheduling$LqfStepController$afterRender(){var e=this.ViewModel.LqfId;if($$WPUtil.IsNullOrEmpty(e))this._isReloading&&this.__showLoadingSpinner();else switch(this.ViewModel.LqfType){case t.LqfTypeEnum.Questionnaire:this._showQuestionnaire(e);break;case t.LqfTypeEnum.DecisionTree:this._showDecisionTree(e)}this.Data.AppointmentBuilder.OriginallySelectedProviders||this._workflow.Type!==$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider||(this.Data.AppointmentBuilder.OriginallySelectedProviders=this.Data.AppointmentBuilder.getFirstAppointment().Providers.toArray().slice()),this.__setInitialFocus(),this._providersUpdatedViewModel=null,this.renderCollapsed&&(this.getContinueButton(this.$root.parent()).parent().addClass("stickybanner"),$$WPSchedulingUtil.HandleStickyBanner())},onNavigateBack:function WP$Scheduling$LqfStepController$onNavigateBack(){this.__initialRfv=null},__setInitialFocus:function WP$Scheduling$LqfStepController$__setInitialFocus(){var e=null;(e=this.$root.find(".providersUpdatedSubheader")).length<1&&(e=this.$root.find("h2.header")),$$WPSchedulingUtil.FocusElement(e)},_getViewEventSubmodule:function WP$Scheduling$LqfStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.LQFStep},_updateStepStatus:function WP$Scheduling$LqfStepController$_updateStepStatus(){this.arePrerequisitesCompleteForStatusChange()&&$$WPUtil.IsNullOrEmpty(this._getCurrentLqf().LqfId)?this._lqfWasFiled&&this.__hadAnyQuestions?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},shouldRemainOnStep:function WP$Scheduling$LqfStepController$shouldRemainOnStep(){return!!this._providersUpdatedViewModel},__onAppointmentsChanged:function WP$Scheduling$LqfStepController$__onAppointmentsChanged(){var e=0,t=null;for(this.__eventManager.removeAllListeners(),e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)t=this.Data.AppointmentBuilder.getAppointment(e),this.__eventManager.addCollectionEventListener(t.Lqfs,"add",this._onLqfDataChanged),this.__eventManager.addCollectionEventListener(t.Lqfs,"remove",this._onLqfDataChanged),this._mode===a.DepartmentOverride&&(this.__eventManager.addCollectionEventListener(t.Locations,"add",this._onAncillaryDataChanged),this.__eventManager.addCollectionEventListener(t.Locations,"remove",this._onAncillaryDataChanged))},_onAncillaryDataChanged:function WP$Scheduling$LqfStepController$_onAncillaryDataChanged(){switch(this._mode){case a.Standard:this._resetClientStateIfRfvChanged();break;case a.DepartmentOverride:this._resetClientStateIfRfvChanged(),this._resetClientStateIfDepChanged()}this._updateStepStatus(),this.getComplete()!==$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired&&this.getComplete()!==$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete||this._removeOldContent(),this.updateStep()},_removeOldContent:function WP$Scheduling$LqfStepController$_removeOldContent(){$$WPUtil.IsNullOrEmpty(this._questionnaireController)||this._removeQuestionnaire(),$$WPUtil.IsNullOrEmpty(this._decisionTreeController)||this._removeDecisionTree()},_removeQuestionnaire:function WP$Scheduling$LqfStepController$_removeQuestionnaire(){this._questionnaireController.destroy(),this._questionnaireController=null,this._questionnaireControllerLqfId=""},_removeDecisionTree:function WP$Scheduling$LqfStepController$_removeDecisionTree(){this._decisionTreeController.destroy(),this._decisionTreeController=null,this._decisionTreeLqfId=""},_onLqfDataChanged:function WP$Scheduling$LqfStepController$_onLqfDataChanged(){this._updateStepStatus(),this.updateStep(),$$WPSchedulingUtil.HandleStickyBanner()},_onResetLqfClicked:function WP$Scheduling$LqfStepController$_onResetLqfClicked(){this._showResetLqfPopup()},_showResetLqfPopup:function WP$Scheduling$LqfStepController$_showResetLqfPopup(){var e,t,i;e=new $$WPComp.ComplexObjects.Button($$WP.Strings.getForTemplate("RetakeQuestionnairePopupConfirmation","Scheduling")),t=new $$WPComp.ComplexObjects.Button($$WP.Strings.getForTemplate("RetakeQuestionnairePopupCancel","Scheduling")),i=new $$WPComp.ConfirmComponent({IsClosable:!0,TitleText:$$WP.Strings.getForTemplate("RetakeQuestionnairePopupTitle","Scheduling"),Html:$$WP.Strings.getForTemplate("RetakeQuestionnairePopupBody","Scheduling"),ToolbarButtons:[e,t],callback:$.proxy(this._resetLqfCallback,this)}),$$WPUtil.quickPopup(i)},_resetLqfCallback:function WP$Scheduling$LqfStepController$_resetLqfCallback(e){!1!==e&&(this._canResetLqfInline()?this._resetClientState():($$WP.Utilities.IsMobile||WP.Events.cancelBeforeUnload(),$$WPSchedulingUtil.Reload(this._workflow.IsAuthenticatedWidget)))},_canResetLqfInline:function WP$Scheduling$LqfStepController$_canResetLqfInline(){var e,t=0;if(this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule||this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode||this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Ticket)return!1;for(e=this.Data.AppointmentBuilder.getFirstAppointment().Lqfs.toArray(),t=0;t<e.length;t++)if(e[t].CompletingStep!==this.Id)return!1;return!0},_resetClientStateIfRfvChanged:function WP$Scheduling$LqfStepController$_resetClientStateIfRfvChanged(){var e=this.Data.AppointmentBuilder.ReasonForVisit;!this._lastSelectedRfv||e&&e.Id===this._lastSelectedRfv.Id||this._resetClientState(),this._lastSelectedRfv=e},_resetClientStateIfDepChanged:function WP$Scheduling$LqfStepController$_resetClientStateIfDepChanged(){var e,t;(e=this.Data.AppointmentBuilder.getFirstAppointment().Locations.toArray()[0])&&(t=e.Departments[0]),!t||this._lastSelectedDep&&t.ID===this._lastSelectedDep.ID||this._resetClientState(),this._lastSelectedDep=t},_resetClientState:function WP$Scheduling$LqfStepController$_resetClientState(){this._lqfWasFiled&&(this._isReloading=!0,this.Data.NumStepsReloading++,this.__hadAnyQuestions=!1,this._lqfWasFiled=!1,this._resetLqfStatuses(),this._resetVisitType(),this.__clearSelectionsToTheRight(),this._dataWasReloaded?(this._dataWasReloaded=!1,this._reloadWorkflowData(this._onResetClientStateLoadCompleted,!0)):$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("ResetQuestionnaires",this._workflow)),cache:!1,success:this._onResetClientStateLoadCompleted}))},_reloadWorkflowData:function WP$Scheduling$LqfStepController$_reloadWorkflowData(e,t,i,n,o){var r,l=null,s=null;this._workflow&&this._workflow.isTypeNewProvider()?$$WPUtil.IsNullOrEmpty(this._workflow.SchedulingDataPool.AppointmentBuilder.Specialty)?this._onResetClientStateLoadCompleted():$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("GetSpecialtyData",this._workflow)),data:$$WPUtil.postify({SpecialtyId:this._workflow.SchedulingDataPool.AppointmentBuilder.Specialty.Id,ServiceAreas:this._workflow.ServiceAreas,isFirstLoad:t,schedulingOverridesString:JSON.stringify(i)}),cache:!1,success:e}):(this._workflow&&this._workflow.SchedulingControllerParams?(r=this._workflow.SchedulingControllerParams.workflow,this._workflow.SchedulingControllerParams.workflow=this._workflow.Type):(r=this._workflow.Type,this._workflow.SchedulingControllerParams={},this._workflow.SchedulingControllerParams.workflow=this._workflow.Type),this.__canReloadSingleRfv(o)?(this.Data.AppointmentBuilder.Specialty&&(l=this.Data.AppointmentBuilder.Specialty.Id),s=$$WPSchedulingRfvsCore.BuildSchedulingParameters(this.__getCurrentReasonForVisit().Id,l,this._workflow.SchedulingControllerParams.csn),$$WPSchedulingRfvsCore.LoadReasonForVisitData(s,this._workflow,e,!1,!1,i,n)):($$WP.Scheduling.LqfStepController.logWorkflowStart(this._workflow,t),$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("ReloadSchedulingWorkflowData",this._workflow)),data:{schedulingParameters:this._workflow.SchedulingControllerParams,isFirstLoad:t,schedulingOverridesString:JSON.stringify(i),schedulingOverridesListString:JSON.stringify(n)},cache:!1,success:e})),this._workflow.SchedulingControllerParams.workflow=r)},__clearSelectionsToTheRight:function WP$Scheduling$LqfStepController$__clearSelectionsToTheRight(){this._mode===a.Standard&&this.__clearLocationSelections(),this._workflow.Type!==$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider&&this.__clearProviderSelections()},__clearProviderSelections:function WP$Scheduling$LqfStepController$__clearProviderSelections(){for(var e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)this.Data.AppointmentBuilder.getAppointment(t).clearProviderSelections(),this.Data.AppointmentBuilder.setProperty("HasResetProviders",!0)},__clearLocationSelections:function WP$Scheduling$LqfStepController$__clearLocationSelections(){for(var e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)this.Data.AppointmentBuilder.getAppointment(t).clearLocationSelections(),this.Data.AppointmentBuilder.setProperty("HasResetLocations",!0)},_onResetClientStateLoadCompleted:function WP$Scheduling$LqfStepController$_onResetClientStateLoadCompleted(e){this._isReloading=!1,$$WPUtil.IsNullOrEmpty(e)||this._onDataLoaded(e,!1,[],!1),this.Data.NumStepsReloading--,this.updateStep()},_resetLqfStatuses:function WP$Scheduling$LqfStepController$_resetLqfStatuses(){var e=null,t=null,i=0,n=0,o=[];for(i=0;i<this.Data.AppointmentBuilder.numAppointments();i++){for((e=this.Data.AppointmentBuilder.getAppointment(i)).Lqfs.openChangeBatch(),o=e.Lqfs.toArray().slice(),n=0;n<o.length;n++)(t=o[n]).CompletingStep===this.Id&&(t.Reset(),e.Lqfs.remove(t));e.SchedulingOverride=null,e.IsLqfChainStopped=!1,e.Lqfs.closeChangeBatch()}},_resetVisitType:function WP$Scheduling$LqfStepController$_resetVisitType(){var e=null;(e=this._ticketInfo?this._ticketInfo.ReasonForVisit:this.Data.AppointmentBuilder.ReasonForVisit)&&this.Data.AppointmentBuilder.updateAppointmentsCollectionForReasonForVisit(e,n.VisitTypeSourceEnum.Default,this._workflow,this.__hasPatientLocationRule),this.__setOriginalVisitTypeIdOnAllAppointments("")},decisionTreeCallback:function WP$Scheduling$LqfStepController$decisionTreeCallback(e,i){e===$$WP.DecisionTrees.Enums.TraversalStatus.Error?this._showErrorAndExit():this._evaluateLqfAnswers(this._decisionTreeLqfId,t.LqfTypeEnum.DecisionTree,i)},decisionTreeStepOnRenderCallback:function WP$Scheduling$LqfStepController$decisionTreeStepRenderedCallback(){this.getSchedulingContinueBanner().addClass("stickybanner"),$$WPSchedulingUtil.HandleStickyBanner()},questionnaireCallback:function WP$Scheduling$LqfStepController$questionnaireCallback(e,i,n){$$WPUtil.IsNullOrEmpty(n)?this._evaluateLqfAnswers(this._questionnaireControllerLqfId,t.LqfTypeEnum.Questionnaire,i):this._showErrorAndExit()},questionnaireOnRenderCallback:function WP$Scheduling$LqfStepController$questionnaireRenderedCallback(e,t){o.defaultAfterViewLoadCallback(e),this.getSchedulingContinueBanner().addClass("stickybanner"),$$WPSchedulingUtil.HandleStickyBanner()},_showErrorAndExit:function WP$Scheduling$LqfStepController$_showErrorAndExit(){var e;null!==this._stopSchedulingCallback&&(e={LqfInstructions:$$WP.Strings.get("ScheduleErrorMessage","Scheduling")},this._stopSchedulingCallback(e))},_evaluateLqfAnswers:function WP$Scheduling$LqfStepController$_evaluateLqfAnswers(e,n,o){var r,l,s,p,h=null,u=null,c=null,_={},f=null,S=[],g=[],m=[],P=0,v=0;for(this._lqfWasFiled=!0,h=this.Data.AppointmentBuilder.getAppointment(this.__currentVisitIndex),r=$$WPSchedulingLqfCore.GetVisitTypeFromAppointment(h,this.Data.VisitTypes),f=this.Data.Lqfs.getFromIndex(["Id","AppointmentIndex"],[e,this.__currentVisitIndex]),$$WPUtil.IsNullOrEmpty(f)&&(_={Id:e,Type:n,AppointmentIndex:this.__currentVisitIndex},f=new t(_),this.Data.Lqfs.add(f)),s=(l=h.Lqfs.toArray()).length,v=0;v<s;v++)S.push(l[v].Id);if(S.push(e),h.SchedulingOverride&&h.SchedulingOverride.HqaIds)for(P=(m=h.SchedulingOverride.HqaIds).length,v=0;v<P;v++)g.push(m[v]);g.push(o),c=new i({LqfIds:S,HqaIds:g,OriginalPrcId:r.ID}),$$WPUtil.IsNullOrEmpty(this._ticketInfo)?(u=this.Data.AppointmentBuilder.ReasonForVisit,c.OriginalRfv=u.CategoryValue,c.OriginalRfvLine=u.Id,this._mode===a.DepartmentOverride&&(currentLqfInfo=this._getCurrentLqf(),c.SourceOverrideDepartmentId=currentLqfInfo.Department.ID),this._workflow.OriginalAppointmentInfo&&0!==h.AppointmentRequestIds.length&&(c.OriginalAppointmentRequestIds=h.AppointmentRequestIds)):(c.OriginalTicketId=this._ticketInfo.TicketId,c.OriginalAppointmentRequestIds=h.AppointmentRequestIds),d(c,this._workflow),this.Data.SchedulingOverrides.add(c),this.__setOriginalVisitTypeIdOnAppropriateAppointments(r.ID),f.SchedulingOverride=c,p={workflow:this._workflow.toRawRequestObject(),schedulingOverridesString:JSON.stringify(c),termIds:this.Data.AppointmentBuilder.TermIds,nonce:$$WPUtil.GetPageNonce()},this.__showLoadingSpinner(),$afe.select("#refresh-area"+this.Id).hide(),$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("EvaluateQuestionnaireAnswers",this._workflow)),data:$$WPUtil.postify(p),cache:!1,success:this.__onQuestionnaireAnswersEvaluated,traditional:!0})},__addReasonForVisitListener:function WP$Scheduling$LqfStepController$__addReasonForVisitListener(){null===this.__reasonForVisitPropertyListenerId&&(this.__reasonForVisitPropertyListenerId=this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this._onAncillaryDataChanged),this.__savedReasonForVisitFromReload=null)},__removeReasonForVisitListener:function WP$Scheduling$LqfStepController$__removeReasonForVisitListener(){this.Data.AppointmentBuilder.removePropertyListener(this.__reasonForVisitPropertyListenerId),this.__reasonForVisitPropertyListenerId=null,this.__savedReasonForVisitFromReload=this.Data.AppointmentBuilder.ReasonForVisit},__showLoadingSpinner:function WP$Scheduling$LqfStepController$__showLoadingSpinner(){this.template===$$WP.Templates.Scheduling.DecisionTree?$$WPUtil.ShowAjaxSpinner(this.$root.find(".dt-spinner .ajaxspinner")):this.template===$$WP.Templates.Scheduling.Questionnaire&&($$WPUtil.ShowAjaxSpinner(this.$root.find(".qnr-spinner .ajaxspinner")),this.$root.find(".qnr-spinner").safeAttr("style","display:block"))},__hideLoadingSpinner:function WP$Scheduling$LqfStepController$__hideLoadingSpinner(){this.template===$$WP.Templates.Scheduling.DecisionTree?$$WPUtil.HideAjaxSpinner(this.$root.find(".dt-spinner .ajaxspinner")):this.template===$$WP.Templates.Scheduling.Questionnaire&&($$WPUtil.HideAjaxSpinner(this.$root.find(".qnr-spinner .ajaxspinner")),this.$root.find(".qnr-spinner").safeAttr("style","display:none"))},__setOriginalVisitTypeIdOnAppropriateAppointments:function WP$Scheduling$LqfStepController$__setOriginalVisitTypeIdOnAllAppointments(e){this.__isAskForEachAppointment?this.Data.AppointmentBuilder.getAppointment(this.__currentVisitIndex).setProperty("OriginalVisitTypeId",e):this.__setOriginalVisitTypeIdOnAllAppointments(e)},__setOriginalVisitTypeIdOnAllAppointments:function WP$Scheduling$LqfStepController$__setOriginalVisitTypeIdOnAllAppointments(e){var t=0;for(t=0;t<this.Data.AppointmentBuilder.numAppointments();t++)this.Data.AppointmentBuilder.getAppointment(t).setProperty("OriginalVisitTypeId",e)},__onQuestionnaireAnswersEvaluated:function WP$Scheduling$LqfStepController$__onQuestionnaireAnswersEvaluated(e){var t=null,i=null,n=null,o=null,r=[],l=null,s=null,a=null;if("object"!==$.type(e))this.__hideLoadingSpinner(),t=new $$WPComp.MessageComponent({TitleText:$$WP.Strings.get("ErrorTitle","Scheduling"),Message:$$WP.Strings.get("QuestionnaireEvaluationErrorMessage","Scheduling"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("RequestErrorButtonLabel","Scheduling"),null,"cancelworkflow","")]}),$$WPUtil.quickPopup(t);else if(i=this.Data.Lqfs.getFromIndex(["Id","AppointmentIndex"],[e.LqfId,this.__currentVisitIndex]),this.__hadAnyQuestions=this.__hadAnyQuestions||this.__currentLqfHasAnyQuestions(),e.ReloadDynamicData){this._pendingResult=e,this.Data.AppointmentBuilder.setProperty("HasPendingDecisionTree",!$$WPUtil.IsNullOrEmpty(this._pendingResult));for(var d=0;d<this.Data.AppointmentBuilder.numAppointments();d++)(l=this.Data.AppointmentBuilder.getAppointment(d))&&l.SchedulingOverride&&r.push(l.SchedulingOverride);i&&(n=i.SchedulingOverride,r.push(n)),this.__showLoadingSpinner(),this.__removeReasonForVisitListener(),o=$.proxy((function(t){this._onDataLoaded(t,!0,e.ProvidersToSelect,!0,e.ReloadDynamicData)}),this),this._reloadWorkflowData(o,!1,n,r,e.ReloadDynamicData),this._dataWasReloaded=!0}else this.__getCurrentReasonForVisit().HasIncompleteSchedulingData?(o=$.proxy((function(t){this.__onReasonsForVisitDataLoaded(t,e)}),this),this.__showLoadingSpinner(),this.__removeReasonForVisitListener(),this.Data.AppointmentBuilder.Specialty&&(s=this.Data.AppointmentBuilder.Specialty.Id),a=$$WPSchedulingRfvsCore.BuildSchedulingParameters(this.__getCurrentReasonForVisit().Id,s,this._workflow.SchedulingControllerParams.csn),$$WPSchedulingRfvsCore.LoadReasonForVisitData(a,this._workflow,o),this._dataWasReloaded=!0):(this._handleResult(e),this.updateStep())},__onReasonsForVisitDataLoaded:function WP$Scheduling$LqfStepController$__onReasonsForVisitDataLoaded(e,t){var i=this.__getCurrentReasonForVisit(),n=this.__getAppointmentSelections(),o=this.Data.AppointmentBuilder.Specialty;this._openChangeBatch(),$$WPSchedulingRfvsCore.UpdateDataPoolReasonsForVisit(this.Data,e.SchedulingViewModel),o&&this.Data.ReasonsForVisit.getFromIndex("Id",e.ReasonForVisitLineId).setProperty("SpecialtyGroupId",o.Id),this.__updateAppointments(null,n,i,!1),this._closeChangeBatch(),this.__hideLoadingSpinner(),this._handleResult(t),this.updateStep()},_onDataLoaded:function WP$Scheduling$LqfStepController$_onDataLoaded(e,t,i,n,o){var r,l,s={};s.NetRemoved={},s.NetAdded={},s.ToSelect={},s.ToDeselect={},l=this.__getCurrentReasonForVisit(),r=this.__getAppointmentSelections(),this.Data.AppointmentBuilder.OriginalReasonForVisit=l,t&&(this.__appendPreexistingProvDifferences(s),this.__handleIneligibleSelectedProvider(s)),this._openChangeBatch(),this.__updateSchedulingData(e,o),l&&this.__updateProviderDifferences(s,r,l,i,n),(this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider||this._workflow.isTypeOpenScheduling()&&$$WPSchedulingProvidersCore.IsProviderSpecifiedInQueryString(this._workflow)||this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule)&&this.__updateAppointmentSelections(r,s),this.__updateAppointments(s,r,l,t),this._closeChangeBatch(),this.__areSelectionsStillValid(l,r)||this._showErrorAndExit(),this.__resolvePendingResults(l),this._onAncillaryDataChanged()},__updateProviderDifferences:function WP$Scheduling$LqfStepController$__updateProviderDifferences(e,t,i,n,o){var r;r=this.__getProviderIdsAvailableForSelection(i,t,o),this.__appendNewProvDifferences(e,n,r),this.__removeProviderIntersections(e),this.__handleReaddedProviders(e,r),this.__handleRemovedProviders(e)},__updateAppointments:function WP$Scheduling$LqfStepController$__updateAppointments(e,t,i,n){var o,r,l;r=this.__canShowAddedProvidersInUpdatedViewModel(i),l=this.__canShowRemovedProvidersInUpdatedViewModel(),o=t[0].Providers.length>0&&this.__areAllProvidersReplaced(e,t)||!!this._providersUpdatedViewModel&&this._providersUpdatedViewModel.WereAllProvidersEverReplaced,this.__canShowProviderUpdates(e)&&this.__setProviderUpdatedViewModel(e,o,n,r,l),n&&this.__flagModifiedProviders(e),this.__reapplyAppointmentSelections(t),this.__addReasonForVisitListener(),this.__updateAppointmentReasonForVisit(i)},__setProviderUpdatedViewModel:function WP$Scheduling$LqfStepController$__setProviderUpdatedViewModel(e,t,i,n,o){this._providersUpdatedViewModel=$$WP.Scheduling.ProvidersUpdatedViewModel.buildViewModel(e,this.__hadAnyQuestions,t,i,n,o)},__getProviderContextViewModel:function WP$Scheduling$LqfStepController$__getProviderContextViewModel(){var e,t,i;return t=this.__getCurrentReasonForVisit(),i=this.__getReasonForVisit(t),$$WPUtil.IsNullOrEmpty(this.ViewModel)||$$WPUtil.IsNullOrEmpty(this.ViewModel.ProviderContextViewModel)?($$WPSchedulingUtil.IsStandaloneWidget(this._workflow)&&i.DefaultVisitType.AllowProviderSelect&&!$$WPUtil.IsNullOrEmpty(this._allowedProviderIds)&&1===this._allowedProviderIds.length&&(e=this.Data.Providers.getFromIndex("ID",this._allowedProviderIds[0])),$$WP.Scheduling.ProvidersCore.GetProviderContextViewModel(e)):this.ViewModel.ProviderContextViewModel},__canShowProviderUpdates:function WP$Scheduling$LqfStepController$__canShowProviderUpdates(e){return!$$WPUtil.IsNullOrEmpty(this._workflow)&&(this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider||(!!(this._workflow.isTypeOpenScheduling()&&$$WPSchedulingProvidersCore.IsProviderSpecifiedInQueryString(this._workflow)&&this.__canShowOriginallySelectedProviderInUpdatedViewModel())||!!(this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule&&e.NetRemoved&&Object.keys(e.NetRemoved).length>0)))},__canShowAddedProvidersInUpdatedViewModel:function WP$Scheduling$LqfStepController$__canShowAddedProvidersInUpdatedViewModel(e){var t=this.__getReasonForVisit(e),i=null;if(this.__isVisitTypeChanged(e,t))return t.DefaultVisitType.AllowProviderSelect;if(this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider&&t)return t.AllowProviderSelect;if(e){if(null!==e.AllowProviderSelect&&void 0!==e.AllowProviderSelect)return e.AllowProviderSelect;if(i=e.DefaultVisitType)return i.AllowProviderSelect}return!0},__canShowRemovedProvidersInUpdatedViewModel:function WP$Scheduling$LqfStepController$__canShowRemovedProvidersInUpdatedViewModel(){var e=null;if(this._workflow.Type===r.WorkflowTypesEnum.ExistingProvider)return!0;if(this.__initialRfv){if(e=this.__initialRfv.DefaultVisitType,"boolean"==typeof this.__initialRfv.AllowProviderSelect)return this.__initialRfv.AllowProviderSelect;if(e)return e.AllowProviderSelect}return!0},__canShowOriginallySelectedProviderInUpdatedViewModel:function WP$Scheduling$LqfStepController$__canShowOriginalkySelectedProvider(){var e,t,i;return t=this.__getCurrentReasonForVisit(),i=this.__getAppointmentSelections(),e=this.__getProviderIdsAvailableForSelection(t,i,!0),!this.__canShowAddedProvidersInUpdatedViewModel(t)||!$$WPSchedulingProvidersCore.IsSingleAllowedProviderStillElligibleForScheduling(e,this._allowedProviderIds)},__updateAppointmentReasonForVisit:function WP$Scheduling$LqfStepController$__updateAppointmentReasonForVisit(e){var t=null;e&&(t=this.__getReasonForVisit(e),this.__setLastSelectedReasonForVisit(t),this.Data.AppointmentBuilder.setProperty("ReasonForVisit",t))},__getVisitTypeSource:function WP$Scheduling$LqfStepController$__getVisitTypeSource(e,t){return this.__isVisitTypeChanged(e,t)?this._mode===a.DepartmentOverride?n.VisitTypeSourceEnum.DepartmentOverrideLqf:n.VisitTypeSourceEnum.StandardLqf:n.VisitTypeSourceEnum.Default},__isVisitTypeChanged:function WP$Scheduling$LqfStepController$__isVisitTypeChanged(e,t){return!!(e&&t&&e.DefaultVisitType&&t.DefaultVisitType)&&e.DefaultVisitType.ID!==t.DefaultVisitType.ID},__areAllProvidersReplaced:function WP$Scheduling$LqfStepController$__areAllProvidersReplaced(e,t){var i=0;return e&&(i=Object.keys(e.ToSelect).length),0!==i&&i===t[0].Providers.length},__currentLqfHasAnyQuestions:function WP$Scheduling$LqfStepController$__currentLqfHasAnyQuestions(){var e=!1;return(this._questionnaireController&&this._questionnaireController.lqfId===this.ViewModel.LqfId||this._decisionTreeController&&this._decisionTreeController.hadAnyQuestions())&&(e=!0),e},__updateSchedulingData:function WP$Scheduling$LqfStepController$__updateSchedulingData(e,t){var i=null;this.__canReloadSingleRfv(t)?(i=this.Data.AppointmentBuilder.Specialty,$$WPSchedulingRfvsCore.UpdateDataPoolReasonsForVisit(this.Data,e.SchedulingViewModel),i&&this.Data.ReasonsForVisit.getFromIndex("Id",response.ReasonForVisitLineId).setProperty("SpecialtyGroupId",i.Id),this.Data.prepForWorkflowAgain()):(this.Data.clearSchedulingData(),this.__setSchedulingData(e))},__canReloadSingleRfv:function WP$Scheduling$LqfStepController$__canUpdateSingleRfvForWorkflow(e){var i=e===t.ReloadDynamicDataEnum.RfvReload;return!(!this._workflow||this._workflow.isTypeTicket()||this._workflow.isTypeNewProvider()||this._workflow.isTypeOpenSchedulingWidget()||this._workflow.IsGuest)&&i},__flagModifiedProviders:function WP$Scheduling$LqfStepController$__flagModifiedProviders(e){var t=null,i=null;for(i in e.NetAdded)(t=this.Data.Providers.getFirstInIndex("ID",i))&&(t.LqfProviderAction=$$WP.Scheduling.Provider.LqfActionEnum.Added);for(i in e.NetRemoved)(t=this.Data.Providers.getFirstInIndex("ID",i))&&(t.LqfProviderAction=$$WP.Scheduling.Provider.LqfActionEnum.Removed)},__appendNewProvDifferences:function WP$Scheduling$LqfStepController$__appendNewProvDifferences(e,t,i){var n,o,r=[],l={},s=this.Data.AppointmentBuilder.Appointments.Models[0],a=this.Data.AppointmentBuilder.getOriginalAppointment(s,this.__originalAppointmentInfo);0===(r=s.Providers.Models).length&&this._workflow.isTypeOpenScheduling()&&this.__getProvidersFromReasonForVisit(r),0===r.length&&this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule&&a.VisitTypes[0].AllowProviderSelect&&(r=a.Providers.Models),o=this.__getRemovedProviders(r,i),n=this.__areAllProvidersRemoved(r.length,o),l=this.__shouldSelectAllProviders(n,t,this._workflow.Type)?this.__getAddedProviders(r,i,i):this.__getAddedProviders(r,t,i),this.__assign(l,e.ToSelect),this.__assign(o,e.ToDeselect),this.__assign(l,e.NetAdded),this.__assign(o,e.NetRemoved)},__getProvidersFromReasonForVisit:function WP$Scheduling$LqfStepController$__getProvidersFromReasonForVisit(e){if(this.Data.AppointmentBuilder.ReasonForVisit&&this.Data.AppointmentBuilder.ReasonForVisit.DirectProviderDepartmentPairs)for(var t=this.Data.AppointmentBuilder.ReasonForVisit.DirectProviderDepartmentPairs.length,i=0;i<t;i++)e.push(this.Data.AppointmentBuilder.ReasonForVisit.DirectProviderDepartmentPairs[i].Provider)},__assign:function WP$Scheduling$LqfStepController$__assign(e,t){Object.assign(t,e)},__appendPreexistingProvDifferences:function WP$Scheduling$LqfStepController$__appendPreexistingProvDifferences(e){var t,i=0,n=null;for(t=this.Data.Providers.toArray(),i=0;i<t.length;i++)(n=t[i]).LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Added?e.NetAdded[n.ID]=n:n.LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Removed&&(e.NetRemoved[n.ID]=n)},__removeProviderIntersections:function WP$Scheduling$LqfStepController$__removeProviderIntersections(e){var t,i=0,n=null;for(t=Object.keys(e.NetRemoved),i=0;i<t.length;i++)n=t[i],e.NetAdded[n]&&(delete e.NetAdded[n],delete e.NetRemoved[n])},__handleReaddedProviders:function WP$Scheduling$LqfStepController$__handleReaddedProviders(e,t){var i,n=0,o=null;for(i=Object.keys(e.NetRemoved),n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0&&(e.ToSelect[o]=e.NetRemoved[o],delete e.NetRemoved[o])},__handleRemovedProviders:function WP$Scheduling$LqfStepController$__handleRemovedProviders(e){var t=null,i="";for(i in e.NetRemoved)t=e.NetRemoved[i],this.Data.Providers.getFromIndex("ID",i)||this.Data.Providers.add(t)},__handleIneligibleSelectedProvider:function WP$Scheduling$LqfStepController$__handleIneligibleSelectedProvider(e){var t,i=null,n=this.__getCurrentReasonForVisit(),o=this.__getAppointmentSelections(),r=this.__getProviderIdsAvailableForSelection(n,o,!0);$$WPUtil.IsNullOrEmpty(this._allowedProviderIds)||$$WPUtil.IsNullOrEmpty(e)||(t=this._allowedProviderIds[0],!$$WPUtil.IsNullOrEmpty(t)&&!$$WPSchedulingProvidersCore.IsSingleAllowedProviderStillElligibleForScheduling(r,this._allowedProviderIds)&&e.NetRemoved&&Object.keys(e.NetRemoved).indexOf(t)<0&&(i=this.Data.Providers.getFromIndex("ID",t))&&(e.NetRemoved[t]=i))},__shouldSelectAllProviders:function WP$Scheduling$LqfStepController$__shouldSelectAllProviders(e,t,i){var n=this._pendingResult?this.Data.VisitTypes.getFirstInIndex("ID",this._pendingResult.VisitTypeId):null;if(i===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider&&n&&!n.AllowProviderSelect)return!0;var o=t.length>0;return e&&!o},__getAddedProviders:function WP$Scheduling$LqfStepController$__getAddedProviders(e,t,i){var n=0,o=null,r=!1,l=!1,s=[],a={};for(n=0;n<e.length;n++)s.push(e[n].ID);for(n=0;n<t.length;n++)(o=this.Data.Providers.getFirstInIndex("ID",t[n]))&&(r=-1!==s.indexOf(o.ID),l=-1!==i.indexOf(o.ID),!r&&l&&(a[o.ID]=o));return a},__getRemovedProviders:function WP$Scheduling$LqfStepController$__getRemovedProviders(e,t){var i=null,n=0,o={};for(n=0;n<e.length;n++)i=e[n],-1===t.indexOf(i.ID)&&(o[i.ID]=i);return o},__areAllProvidersRemoved:function WP$Scheduling$LqfStepController$__areAllProvidersRemoved(e,t){var i;return i=Object.keys(t).length,e>0&&e===i},__getProviderIdsAvailableForSelection:function WP$Scheduling$LqfStepController$__getProviderIdsAvailableForSelection(e,t,i){var n,o,r=0,l=[],s=[],d=[];for(o=this._mode===a.DepartmentOverride,n=this.__getReasonForVisit(e),o&&(s=this.__getDepartmentsFromSelections(t)),d=$$WPSchedulingUtil.BuildProvidersFiltered(!0,o,!1,n,s,!1),i||(d=d.filter((function(e){return e.IsStandardProvider}),this)),r=0;r<d.length;r++)l.push(d[r].ID);return l},__getDepartmentsFromSelections:function WP$Scheduling$LqfStepController$__getDepartmentsFromSelections(e){for(var t=[],i=[],n=[],o=0;o<e.length;o++){t=e[o].Locations;for(var r=0;r<t.length;r++)i=t[r].Departments,n=n.concat(i)}return $$WPSchedulingUtil.RemoveDuplicateElementsFromArray(n),n},__updateAppointmentSelections:function WP$Scheduling$LqfStepController$__updateAppointmentSelections(e,t){this.__removeMissingProviders(e,t.ToDeselect),this.__addNewProviders(e,t.ToSelect)},__removeMissingProviders:function WP$Scheduling$LqfStepController$__removeMissingProviders(e,t){var i=null,n=0,o=null;for(i in t)for(n=0;n<e.length;n++)(o=e[n]).Providers=this.__removeProviderFromList(o.Providers,i)},__removeProviderFromList:function WP$Scheduling$LqfStepController$__removeProviderFromList(e,t){var i=0;for(i=e.length-1;i>=0;i--)t===e[i].ID&&e.splice(i,1);return e},__addNewProviders:function WP$Scheduling$LqfStepController$__addNewProviders(e,t){var i=null,n=null,o=0;for(i in t)for(n=t[i],o=0;o<e.length;o++)e[o].Providers.push(n)},__getReasonForVisit:function WP$Scheduling$LqfStepController$__getReasonForVisit(e){var t=null;return e?(t=$$WPUtil.IsNullOrEmpty(this._ticketInfo)?this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode?this.Data.ReasonsForVisit.Models[0]:this.Data.ReasonsForVisit.getFirstInIndex("Id",e.Id):this._ticketInfo.ReasonForVisit,$$WPUtil.IsNullOrEmpty(t)&&(t=null),t):null},__getCurrentReasonForVisit:function WP$Scheduling$LqfStepController$__getCurrentReasonForVisit(){return this.__savedReasonForVisitFromReload?this.__savedReasonForVisitFromReload:this.Data.AppointmentBuilder.ReasonForVisit},__setLastSelectedReasonForVisit:function WP$Scheduling$LqfStepController$__setLastSelectedReasonForVisit(e){$$WPUtil.IsNullOrEmpty(this._ticketInfo)?this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode&&(this._lastSelectedRfv=e):this._lastSelectedRfv=e},__getAppointmentSelections:function WP$Scheduling$LqfStepController$__getAppointmentSelections(){var e=[],t=0,i=null;for(t=0;t<this.Data.AppointmentBuilder.numAppointments();t++)i=this.Data.AppointmentBuilder.getAppointment(t),e.push({VisitType:i.VisitType,Providers:i.Providers.toArray().slice(),Locations:i.Locations.toArray().slice()});return e},__setSchedulingData:function WP$Scheduling$LqfStepController$__setSchedulingData(e){$$WPUtil.IsNullOrEmpty(this._ticketInfo)?this.Data.populateWithRawSchedulingData(e):this.Data.populateForTicket(this._ticketInfo,e,!0),this.Data.prepForWorkflowAgain()},__resolvePendingResults:function WP$Scheduling$LqfStepController$__resolvePendingResults(e){var t;t=this.__getReasonForVisit(e),this._pendingResult&&(this._pendingResult.ReasonForVisit=t,this.Data.AppointmentBuilder.setProperty("HasPendingDecisionTree",!1),this.Data.AppointmentBuilder.setProperty("ReplacedAllOriginalProviders",this._pendingResult.ReplacedAllOriginalProviders),this._pendingResult.VisitTypeSource=this.__getVisitTypeSource(e,t),this._handleResult(this._pendingResult),this._pendingResult=null)},__reapplyAppointmentSelections:function WP$Scheduling$LqfStepController$__reapplyAppointmentSelections(e){var t=null,i=null,n=null,o=[],r=null,l=[],s=null,a=0,d=0;for(a=0;a<this.Data.AppointmentBuilder.numAppointments();a++)if(!this.__isAskForEachAppointment||a===this.__currentVisitIndex){for(t=this.Data.AppointmentBuilder.getAppointment(a),i=e[a].VisitType,o=e[a].Providers,l=e[a].Locations,i&&((n=this.Data.VisitTypes.getFirstInIndex("ID",i.ID))?t.setVisitTypeWithSource(n,t.VisitTypeSource,t.PanelId):t.setVisitTypeWithSource(null,t.VisitTypeSource,"")),t.Providers.empty(),d=0;d<o.length;d++)r=this.Data.Providers.getFirstInIndex("ID",o[d].ID),this.__canAddProviderToAppt(r,i)&&t.Providers.add(r);for(0===t.Providers.size()&&this.__selectOriginalProvider(t.Providers),t.Locations.empty(),d=0;d<l.length;d++)(s=this.Data.Locations.getFirstInIndex("Id",l[d].Id))&&t.Locations.add(s)}},__canAddProviderToAppt:function WP$Scheduling$LqfStepController$__shouldAddProviderToAppt(e,t){var i=this.filterByAllowedIds(this.Data.Providers.toArray(),"ID",!1);return null!=e&&(!!t||(i&&0!==i.length?e.IsStandardProvider&&-1!==i.indexOf(e):e.IsStandardProvider))},__selectOriginalProvider:function WP$Scheduling$LqfStepController$__selectOriginalProvider(e){var t=null,i=null,n=0;if(this.Data.AppointmentBuilder.OriginallySelectedProviders)for(n=0;n<this.Data.AppointmentBuilder.OriginallySelectedProviders.length;n++)t=this.Data.AppointmentBuilder.OriginallySelectedProviders[n],(i=this.Data.Providers.getFirstInIndex("ID",t.ID))&&e.add(i)},__areSelectionsStillValid:function WP$Scheduling$LqfStepController$__areSelectionsStillValid(e,t){var i=this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider;return!!this.__isRfvSelectionStillValid(e)&&(!(i&&!this.__isProviderSelectionStillValid(t))&&!(this._mode===a.DepartmentOverride&&!this.__isLocationSelectionStillValid(t)))},__isRfvSelectionStillValid:function WP$Scheduling$LqfStepController$__isRfvSelectionStillValid(e){var t=this.Data.AppointmentBuilder.ReasonForVisit;return!e||!!t},__isProviderSelectionStillValid:function WP$Scheduling$LqfStepController$__isProviderSelectionStillValid(e){var t=[],i={},n=0;for(n=0;n<this.Data.AppointmentBuilder.numAppointments();n++)if(t=this.Data.AppointmentBuilder.getAppointment(n).Providers.toArray(),((i=e[n])?i.Providers:[]).length>0&&0===t.length)return!1;return!0},__isLocationSelectionStillValid:function WP$Scheduling$LqfStepController$__isLocationSelectionStillValid(e){var t=[],i={},n=0;for(n=0;n<this.Data.AppointmentBuilder.numAppointments();n++)if(t=this.Data.AppointmentBuilder.getAppointment(n).Locations.toArray(),((i=e[n])?i.Locations:[]).length>0&&0===t.length)return!1;return!0},_handleResult:function WP$Scheduling$LqfStepController$_handleResult(e){var t=null,i={},n=0,o=null;if(e.ReasonForVisit&&this.Data.AppointmentBuilder.updateAppointmentsCollectionForReasonForVisit(e.ReasonForVisit,e.VisitTypeSource,this._workflow,!1),e.StopLqfChain&&this.__stopLqfChainForAppropriateAppointments(),(t=this.Data.Lqfs.getFromIndex(["Id","AppointmentIndex"],[e.LqfId,this.__currentVisitIndex])).Result=e,t.CompletingStep=this.Id,this.__isAskForEachAppointment)(o=this.Data.AppointmentBuilder.getAppointment(this.__currentVisitIndex)).Lqfs.add(t),o.SchedulingOverride=t.SchedulingOverride;else for(n=0;n<this.Data.AppointmentBuilder.numAppointments();n++)(o=this.Data.AppointmentBuilder.getAppointment(n)).Lqfs.add(t),o.SchedulingOverride=t.SchedulingOverride;!$$WPUtil.IsNullOrEmpty(this.Data.AppointmentBuilder.ReasonForVisit)&&this.__hasPatientLocationRule&&this.Data.AppointmentBuilder.evaluatePatientLocationRule(this._workflow),this.__setOriginalVisitTypeIdOnAppropriateAppointments(t.SchedulingOverride.OriginalPrcId),this.__hideLoadingSpinner(),e.StopScheduling?null!==this._stopSchedulingCallback&&(i={VisitTypeInstructions:this._getCurrentVisitType().SchedulingInstructions,LqfInstructions:e.Instructions},this._stopSchedulingCallback(i)):this.__canWorkflowHandleCurrentAppointmentCount()||this._showErrorAndExit()},__stopLqfChainForAllAppoinments:function WP$Scheduling$LqfStepController$__stopLqfChainForAllAppointments(){var e=0;for(e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)this.Data.AppointmentBuilder.getAppointment(e).IsLqfChainStopped=!0},__stopLqfChainForAppropriateAppointments:function WP$Scheduling$LqfStepController$__stopLqfChainForAppropriateAppointments(){this.__isAskForEachAppointment?this.Data.AppointmentBuilder.getAppointment(this.__currentVisitIndex).IsLqfChainStopped=!0:this.__stopLqfChainForAllAppoinments()},__canWorkflowHandleCurrentAppointmentCount:function WP$Scheduling$LqfStepController$__canWorkflowHandleCurrentAppointmentCount(){return this._workflow.Type!==$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider||1===this.Data.AppointmentBuilder.numAppointments()},_getCurrentVisitType:function WP$Scheduling$LqfStepController$_getCurrentVisitType(){var t={},i=null;switch(i=this.__isAskForEachAppointment?this.Data.AppointmentBuilder.getAppointment(this.__currentVisitIndex):this.Data.AppointmentBuilder.getFirstAppointment(),this._mode){case a.Standard:return $$WPSchedulingLqfCore.GetVisitTypeFromAppointment(i,this.Data.VisitTypes);case a.DepartmentOverride:return t=this._getCurrentLqf(),e.getVisitTypeForDepartment(this.Data,i,t.Department)}},_showQuestionnaire:function WP$Scheduling$LqfStepController$_showQuestionnaire(e){var t,i,n,r;t=o.getDomElementsForQuestionnaireView(this.Id),(i=new Epic.PatientEngagement.Questionnaire.WorkflowSettings).hideSummaryPage=!0,i.defaultAnswersFromDAT=$$WPUtil.IsNullOrEmpty(this._favoriteAppointmentInfo)?"":this._favoriteAppointmentInfo.Dat,i.wipeProgressTrail=!0,n=new Epic.PatientEngagement.Questionnaire.QuestionnaireWorkflowInformation(this,Epic.PatientEngagement.Questionnaire.QuestionnaireContextType.Scheduling,"",{shouldDisplayQuestionnaireName:!1,showBottomBackButton:!0,disableUnsavedChangesPopup:!0},null,i),r={afterViewLoadCallback:this.questionnaireOnRenderCallback},this._questionnaireControllerLqfId=e,this._questionnaireController=new Epic.PatientEngagement.Questionnaire.MyChart.QuestionnaireController(this._questionnaireControllerLqfId,t,n,r),this._questionnaireController.start()},_showDecisionTree:function WP$Scheduling$LqfStepController$_showDecisionTree(e){var t,i,n,o,r=null,l=[],s=null,a="";o=this._getCurrentVisitType(),n=this.$root.find(".dt-main-container"),t=new $$WP.DecisionTrees.Models.TraversalSettings({AllowBack:!1,AllowFinishLater:!1,AllowCancel:!1,OnStepRender:this.decisionTreeStepOnRenderCallback,DisableUnsavedChangesPopup:!0}),this.__isAskForEachAppointment?(r=this.Data.AppointmentBuilder.getAppointment(this.__currentVisitIndex),(s=this.Data.AppointmentBuilder.getOriginalAppointment(r,this.__originalAppointmentInfo))&&(a=s.Dat),l=r.AppointmentRequestIds):(l=$$WPUtil.IsNullOrEmpty(this._ticketInfo)?[]:$$WP.Scheduling.Appointment.prototype.ordersToRawRequestObject(this._ticketInfo.AppointmentRequests),this.__originalAppointmentInfo&&(a=this.__originalAppointmentInfo.Dat)),i=new $$WP.DecisionTrees.Models.TraversalAdditionalContext({VisitTypeID:o.ID,TicketID:$$WPUtil.IsNullOrEmpty(this._ticketInfo)?"":this._ticketInfo.TicketId,AppointmentRequestIds:l,OriginalApptDAT:a,FavoriteApptDAT:$$WPUtil.IsNullOrEmpty(this._favoriteAppointmentInfo)?"":this._favoriteAppointmentInfo.Dat,OrdersString:this.__generateOrdersStringForAllAppointments(),IsGuest:this._workflow.IsGuest,SchedulingWorkflowType:this._workflow.Type,TermIds:this.Data.AppointmentBuilder.TermIds,SchedGrouperIds:this.Data.AppointmentBuilder.SchedGrouperIds,IsAuthenticatedWidget:this._workflow.IsAuthenticatedWidget}),this._decisionTreeLqfId=e,this._decisionTreeController=new $$WP.DecisionTrees.Controllers.DecisionTreeTraversalController(n,e,$$WP.DecisionTrees.Enums.TraversalSourceWorkflow.Scheduling,t,!0,this.decisionTreeCallback,i)},__generateOrdersStringForAllAppointments:function WP$Scheduling$LqfStepController$__generateOrdersStringForAllAppointments(){var e=0,t="";if(this.__isAskForEachAppointment)t=this.__generateOrdersStringForOneAppointment("",this.__currentVisitIndex);else for(e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)t=this.__generateOrdersStringForOneAppointment(t,e);return t},__generateOrdersStringForOneAppointment:function WP$Scheduling$LqfStepController$__generateOrdersStringForOneAppointment(e,t){var i,n=0;for(i=this.Data.AppointmentBuilder.getAppointment(t),n=0;n<i.Orders.length;n++)""!==e&&(e+="^"),e+=i.Orders[n].ID;return e},_getCurrentLqf:function WP$Scheduling$LqfStepController$_getCurrentLqf(){var e;return this.__isAskForEachAppointment?this._getCurrentLqfBundle():(e=this.Data.AppointmentBuilder.getFirstAppointment(),this._getCurrentAppointmentLqf(e))},_getCurrentLqfBundle:function WP$Scheduling$LqfStepController$_getCurrentLqf(){var e,t,i={};for(t=this.__currentVisitIndex;t<this.Data.AppointmentBuilder.numAppointments();t++)if(e=this.Data.AppointmentBuilder.getAppointment(t),i=this._getCurrentAppointmentLqf(e,t),!$$WPUtil.IsNullOrEmpty(i.LqfId)){this.__currentVisitIndex=t;break}return i},_getCurrentAppointmentLqf:function WP$Scheduling$LqfStepController$_getCurrentAppointmentLqf(e,t){var i=null;if(!e.IsLqfChainStopped&&this.arePrerequisitesCompleteForStatusChange())switch(this._mode){case a.Standard:if(e.VisitTypeSource!==n.VisitTypeSourceEnum.DepartmentOverrideLqf)return i=$$WPSchedulingLqfCore.GetVisitTypeFromAppointment(e,this.Data.VisitTypes),$$WPSchedulingLqfCore.GetCurrentLqfFromVisitType(this.Data,i,"",t,this._workflow);break;case a.DepartmentOverride:return $$WPSchedulingLqfCore.GetDepartmentLqfData(this.Data)}return{}},getSchedulingContinueBanner:function WP$Scheduling$LqfStepController$getSchedulingContinueBanner(){return this.$root.parent().find(".qnr-actions")},getContinueButton:function WP$Scheduling$LqfStepController$getContinueButton(e){var t="";return t=this.stepSettings.Hide||this.renderCollapsed?"#scheduling-continue":".questionnaire",e.find(t)},isUsingWorkflowNavigation:function WP$Scheduling$LqfStepController$isUsingWorkflowNavigation(){return!1},onWorkflowDestroyed:function WP$Scheduling$ReservationStepController$onWorkflowDestroyed(){this._removeOldContent()}},a={Standard:1,DepartmentOverride:2},d=function WP$Scheduling$lqfStepController$addDecisionTreeNodeOverrides(e,t){t.Type!==r.WorkflowTypesEnum.DecisionTreeNode&&t.Type!==r.WorkflowTypesEnum.Ticket||(e.WorkflowType=t.Type,e.RootDecisionTreeId=t.rootDecisionTreeID,e.DecisionTreeNodeId=t.decisionTreeNodeID,e.DecisionTreeNodeCsn=t.decisionTreeNodeCSN)};l.prototype=s,l.ModesEnum=a,l.addDecisionTreeNodeOverrides=d,l.logWorkflowStart=function WP$Scheduling$lqfStepController$logWorkflowStart(e,t){var i,n;i="1"===$$WPUtil.GetQueryStringParameterValue(window.location.search,"isGuestTicket"),t&&!$$WP.WidgetMode&&e.Type!==r.WorkflowTypesEnum.ProviderFinder&&$$WPUtil.IsNullOrEmpty(e.SchedulingControllerParams.reasonForVisitId)&&!i&&(n=r.getPatientFacingWorkflowType(e.Type,e.IsAnonymous),$$WP.Analytics.UsageTrackingController.logWorkflowStartEvent(n))},$$WP.Scheduling.LqfStepController=l,l.extend($$WP.Scheduling.StepController,"WP$Scheduling$LqfStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$LqfStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$OnboardingStepController$definition(){var e=function WP$Scheduling$OnboardingStepController(e,t,n,i){this.WP$Scheduling$StepController(e,t),this.proxify("__onConfirmClick","__onAppointmentsChanged","__onAncillaryDataChanged","__onBundleReasonForVisitSelected"),this.__eventManager=new $$WP.Scheduling.EventManager,this._workflow=n,this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.__onAncillaryDataChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("add",this.__onAppointmentsChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("remove",this.__onAppointmentsChanged),this.__onAppointmentsChanged(),this.$root.on("click","[data-id='panelconfirm']",this.__onConfirmClick),this.$root.on("click","[data-bundle-reschedule]",this.__onBundleReasonForVisitSelected),this.__hasPatientLocationRule=i};e.prototype={__eventManager:null,_workflow:null,__hasPatientLocationRule:!1,updateViewModel:function WP$Scheduling$OnboardingStepController$updateViewModel(){var e=!1,t=this._workflow.isBundleRescheduling(),n=!$$WPUtil.IsNullOrEmpty(this.__getFirstAppointmentBundleId()),i=this.__isFirstAppointmentPartOfMultiApptGroup();t||!n&&i?(e=!!n||this.Data.AppointmentBuilder.showAsMultipleVisits(this.Data.VisitTypes),this.ViewModel={StepShouldBeActive:!0,Count:1,ShowAsMultipleVisits:e,SolutionViewModel:this.__getSolutionViewModel(),BundleReschedulingCommandOptions:this.__getBundleReschedulingCommandOptions(),CanRescheduleFullBundle:this._workflow.canRescheduleFullBundle()},this.stepSettings.Hide=!1,this.template=t?$$WP.Templates.Scheduling.OnboardingBundleRescheduleStep:$$WP.Templates.Scheduling.OnboardingPanelStep):(this.ViewModel={},this.stepSettings.Hide=!0,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired))},__getSolutionViewModel:function WP$Scheduling$OnboardingStepController$__getSolutionViewModel(){var e=new $$WP.Scheduling.SolutionViewModel,t=null,n=!1,i="";return $$WPUtil.IsNullOrEmpty(this.__getFirstAppointmentPanelId())||(n=!0),this._workflow.isBundleRescheduling()?(i=this._workflow.OriginalAppointmentInfo.BundleReasonForVisitId,t=this.Data.ReasonsForVisit.getFromIndex("Id",i),e.populateFromOriginalAppointmentInfo(this._workflow.OriginalAppointmentInfo)):(t=this.Data.AppointmentBuilder.ReasonForVisit,e.populateFromReasonForVisit(t,this._workflow,n)),e},__getBundleReschedulingCommandOptions:function WP$Scheduling$OnboardingStepController$__getBundleReschedulingCommandOptions(){var e=null;return this._workflow.isBundleRescheduling()&&(e={All:{Id:"bundleRescheduleAllCommand",DataAttrs:{"bundle-reschedule":"all"}},Single:{Id:"bundleRescheduleSingleCommand",DataAttrs:{"bundle-reschedule":"single"}}}),e},afterRender:function WP$Scheduling$LocationStepController$afterRender(){this.$root.find("h2").focus()},_getViewEventSubmodule:function WP$Scheduling$OnboardingStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.OnboardingStep},__onBundleReasonForVisitSelected:function WP$Scheduling$OnboardingStepController$__onBundleReasonForVisitSelected(e){var t="all"===$afe.jq(e.target).safeAttr("data-bundle-reschedule");this.__selectBundleRfv(t)},__selectBundleRfv:function WP$Scheduling$OnboardingStepController$__selectBundleRfv(e){var t=null;t=e?this.Data.ReasonsForVisit.getFromIndex("Id",this._workflow.OriginalAppointmentInfo.BundleReasonForVisitId):this.Data.ReasonsForVisit.getFromIndex("Id",this._workflow.OriginalAppointmentInfo.SingleReasonForVisitId),this.Data.AppointmentBuilder.setProperty("ReasonForVisit",t),this.Data.AppointmentBuilder.updateAppointmentsCollectionForReasonForVisit(t,Appointment.VisitTypeSourceEnum.Default,this._workflow,this.__hasPatientLocationRule),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},__onConfirmClick:function WP$Scheduling$OnboardingStepController$__onConfirmClick(){this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},__onAppointmentsChanged:function WP$Scheduling$SlotStepController$__onAppointmentsChanged(){var e=0,t=null;for(this.__eventManager.removeAllListeners(),e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)t=this.Data.AppointmentBuilder.getAppointment(e),this.__eventManager.addModelPropertyListener(t,"VisitType",this.__onAncillaryDataChanged)},__onAncillaryDataChanged:function WP$Scheduling$OnboardingStepController$__onAncillaryDataChanged(){this.__updateStepStatus()},__updateStepStatus:function WP$Scheduling$OnboardingStepController$__updateStepStatus(){this._workflow.isBundleRescheduling()&&this.getComplete()==$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):this.__isFirstAppointmentPartOfMultiApptGroup()||this._workflow.isBundleRescheduling()?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},__isFirstAppointmentPartOfMultiApptGroup:function WP$Scheduling$OnboardingStepController$__isFirstAppointmentPartOfMultiApptGroup(){return!$$WPUtil.IsNullOrEmpty(this.__getFirstAppointmentPanelId())||!$$WPUtil.IsNullOrEmpty(this.__getFirstAppointmentBundleId())},__getFirstAppointmentPanelId:function WP$Scheduling$OnboardingStepController$__getFirstAppointmentPanelId(){return this.Data.AppointmentBuilder.getFirstAppointment().PanelId},__getFirstAppointmentBundleId:function WP$Scheduling$OnboardingStepController$__getFirstAppointmentBundleId(){return this.Data.AppointmentBuilder.getFirstAppointment().BundleId}},$$WP.Scheduling.OnboardingStepController=e,e.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnboardingStepController")}();;
/*! Copyright Epic Systems Corporation 2016-2017 */
!function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$definition(){var e=$$WP.Scheduling.TelehealthLocation,t=$$WP.Scheduling.ReasonForVisit,n=$$WP.Common.SelectableViewBinder,o=$$WP.Scheduling.Workflow,i=3,a=function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController(t,o,i,a){this.WP$Scheduling$StepController(t,o,null,null,null,$$WP.Templates.Scheduling.OnDemandTelehealth.PatientLocationStep),this.proxify("updateStep","_onLocationStateChanged","_onCardFocus","_onCardBlur","_onButtonClicked","_onLocationSelect","_onSubLocationSelect","_onAncillaryDataChanged"),this.setViewBinder(new n("State",e.StatesEnum.Selected,e.StatesEnum.Unselected)),this.Data.TelehealthLocations.addPropertyListener("State",this._onLocationStateChanged),this._isAnonymous=i,this._workflow=a,this.Data.AppointmentBuilder.addPropertyListener("HasConfirmedPatientLocation",this._onAncillaryDataChanged),this.Data.AppointmentBuilder.addPropertyListener("CanSkipPatientLocationStep",this._onAncillaryDataChanged)};a.prototype={_mode:null,_prerequisiteSteps:null,_selectedPrimaryIndex:-1,_viewMode:0,_idPrefix:"",_isAnonymous:!1,_hasProvidersListener:null,_shouldDoInitialFocus:!0,_selectedSubIndices:{},_onAncillaryDataChanged:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onAncillaryDataChanged(){this._updateStepStatus()},_updateStepStatus:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_updateStepStatus(){this._isStepRequired()?this._isFullLocationSelected()&&this.Data.AppointmentBuilder.HasConfirmedPatientLocation?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},_isStepRequired:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_isStepRequired(){return!(!this._isTelehealthWorkflow()&&!this._isStepForceShown())||!this.Data.AppointmentBuilder.CanSkipPatientLocationStep&&!this.Data.AppointmentBuilder.HasConfirmedPatientLocation},updateViewModel:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$updateViewModel(){var t,n;this._firstRender&&this.Data.TelehealthData.setProperty("TelehealthLoaded",!0),t=this._buildTelehealthLocationArray(),-1===this._selectedPrimaryIndex&&this._findSelectedLocationIndex(),n=this._buildTelehealthSubLocationArray(),this._getSelectedSubIndexForCountry(this._selectedPrimaryIndex)===e.FakeLocationId&&this._findSelectedSubLocationIndex(),this._idPrefix="PatientLocationStep_"+(this.Id||""),this.Data.TelehealthData.setProperty("SelectedWorkflow",null),this.ViewModel={TelehealthLocations:t,TelehealthSubLocations:n,StepShouldBeActive:t.length>0,IdPrefix:this._idPrefix,SelectedPrimaryIndex:this._selectedPrimaryIndex,SelectedSubIndex:this._getSelectedSubIndexForCountry(this._selectedPrimaryIndex),AlreadyComplete:this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete,ViewMode:this._viewMode,ValidationGroup:new $$WP.FormValidation.ValidationGroup({}),SubLocationValidation:new $$WP.FormValidation.ValidationSettings({required:!0,nullValue:e.FakeLocationId}),IsMobile:$$WP.Utilities.UI.IsMobile,IsAnonymous:this._isAnonymous,CanUseSchedulingStrings:!this._isTelehealthWorkflow(),HasSlot:this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected(),CanShowPretext:this._workflow.Type===o.WorkflowTypesEnum.OnDemandTelehealth}},_isTelehealthWorkflow:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_isTelehealthWorkflow(){return this._workflow.Type===o.WorkflowTypesEnum.OnDemandTelehealth||this._workflow.Type===o.WorkflowTypesEnum.EVisit},beforeRender:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$beforeRender(){var t=this.Data.TelehealthLocations.Models;if(t&&1===t.length){var n=t[0].SubLocations.Models;if(n&&1===n.length)return t[0].setProperty("State",e.StatesEnum.Selected),n[0].setProperty("State",e.StatesEnum.Selected),void(this.stepSettings.ReadOnly=!0)}null===this.Data.TelehealthLocations.getFirstInIndex("State",e.StatesEnum.Selected)&&(this.stepSettings.Hide=!1,this.stepSettings.HideIfOne=!1,this.stepSettings.Collapse=!1,this.stepSettings.CollapseIfOne=!1,this.stepSettings.ReadOnly=!1)},afterRender:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$afterRender(){var t=this.Data.TelehealthLocations.Models[this._selectedPrimaryIndex],n=this._getSelectedSubIndexForCountry(this._selectedPrimaryIndex);t&&(-1!==n&&t.SubLocations.Models[n]&&t.SubLocations.Models[n].Id===e.FakeLocationId||n===e.FakeLocationId)&&$$WP.FormValidation.addValidationError(this.$root.find(".selectSubLocation")),document.getElementById("scheduling-workflow").style.minHeight="0vh",$$WP.Utilities.UI.IsMobile&&this._isTelehealthWorkflow()&&this._addHowToVideo(),this._addDomHandlers(),this._renderEmergencyWarningBanner(),this._shouldDoInitialFocus&&($$WP.Utilities.UI.IsMobile?this.$root.find("h2.header").focus():0!==$afe.select(".button.completeworkflow").length&&this._workflow.Type===o.WorkflowTypesEnum.OnDemandTelehealth||$$WPSchedulingUtil.FocusElement($afe.select(".standardBanner.criticalType"))),this._shouldDoInitialFocus=!1},_addHowToVideo:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_addHowToVideo(){var e;if(e=$afe.select("#mobile-video-card-container")){new $$WP.UI.VideoViewModel("VideoVisitHowTo",null,(function videoViewModelCallback(t){var n,o;n=new Array,null!==t.Url&&n.push(t),n.length>0&&((o={}).VideoCard="TalkToADoctor",o.Videos=n,new $$WP.UI.VideoController(e,o,1))}))}},_addDomHandlers:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_addDomHandlers(){this.$root.find(".button").on("click",this._onButtonClicked),this.$root.find("select.selectLocation").on("change",this._onLocationSelect),this.$root.find("select.selectSubLocation").on("change",this._onSubLocationSelect),this.$root.find(".card").on("focus",this._onCardFocus),this.$root.find(".card").on("blur",this._onCardBlur)},_getViewEventSubmodule:function WP$Scheduling$PatientLocationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.PatientLocationStep},_buildTelehealthLocationArray:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_buildLocationArray(){for(var e=[],t=0;t<this.Data.TelehealthLocations.size();t++)e.push(this.Data.TelehealthLocations.Models[t]);return e},_buildTelehealthSubLocationArray:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_buildTelehealthSubLocationArray(){var e=this.Data.TelehealthLocations.Models[this._selectedPrimaryIndex];if(!e)return[];for(var t=[],n=0;n<e.SubLocations.size();n++)t.push(e.SubLocations.Models[n]);return t},_onButtonClicked:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onButtonClicked(e){if(void 0!==$afe.jq(e.target).data("id")&&(!$afe.jq(e.target).hasClass("disabled")&&"confirm"===$afe.jq(e.target).data("id").split("-")[0]))this._selectCurrentLocation(),this._updateStepStatus(),this.updateStep()},_selectCurrentLocation:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_selectCurrentLocation(){var t=this._findSelectedLocationIndex(),n=this.Data.TelehealthLocations.Models[t],o=this._findSelectedSubLocationIndex(),i=n.SubLocations.Models[o];i&&i.setProperty("State",e.StatesEnum.Selected),n.setProperty("State",e.StatesEnum.Selected),this.Data.AppointmentBuilder.setProperty("HasConfirmedPatientLocation",!0)},_setSelectionInAppointmentBuilder:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_setSelectionInAppointmentBuilder(e,t){this.Data.AppointmentBuilder.setProperty("PatientLocation",e),this.Data.AppointmentBuilder.setProperty("PatientSublocation",t)},_onLocationSelect:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onLocationSelect(e){var t=this.$root.find("select.selectSubLocation")[0];t&&(t.selectedIndex=0),this._findSelectedLocationIndex(),this._updateStepStatus(),WP.DOM.Browser.isMobile&&this.$root.find("select.selectLocation").blur(),this.updateStep()},_findSelectedLocationIndex:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_findSelectedLocationIndex(){var t,n,o,i;return(n=this.Data.TelehealthLocations.getFirstInIndex("State",e.StatesEnum.Selected))&&n.setProperty("State",e.StatesEnum.Unselected),(o=this.$root.find("select.selectLocation")[0])?t=o.selectedIndex:this.Data.AppointmentBuilder.PatientLocation?(i=this.Data.AppointmentBuilder.PatientLocation,t=this.Data.TelehealthLocations.Models.indexOf(i)):t=this._getDefaultLocationIndex(),this._selectedPrimaryIndex=t,t},_getDefaultLocationIndex:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_getDefaultLocationIndex(){var e;for(e=0;e<this.Data.TelehealthLocations.size();e++)if(this.Data.TelehealthLocations.Models[e].SelectedByDefault)return e;return-1},_onSubLocationSelect:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onSubLocationSelect(e){this._findSelectedSubLocationIndex(),this._updateStepStatus(),WP.DOM.Browser.isMobile&&this.$root.find("select.selectSubLocation").blur(),this.updateStep()},_findSelectedSubLocationIndex:function WP$Scheduldung$PatientLocationStepController$_findSelectedSubLocationIndex(){var t,n,o;if(!(n=this.Data.TelehealthLocations.Models[this._selectedPrimaryIndex]))return-1;var i=n.SubLocations.getFirstInIndex("State",e.StatesEnum.Selected);i&&i.setProperty("State",e.StatesEnum.Unselected),t=-1;try{t=this.$root.find("select.selectSubLocation")[0].selectedIndex}catch(e){this.Data.AppointmentBuilder.PatientSublocation?(o=this.Data.AppointmentBuilder.PatientSublocation,t=n.SubLocations.Models.indexOf(o)):t=this._getDefaultSublocationIndex(n)}return-1!==t&&this._setSelectedSubIndexForCountry(this._selectedPrimaryIndex,t),t},_getDefaultSublocationIndex:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_getDefaultSublocationIndex(e){for(var t=0;t<e.SubLocations.size();t++)if(e.SubLocations.Models[t].SelectedByDefault)return t;return-1},_onLocationStateChanged:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onLocationStateChanged(n){var o,a=null,l=null,d=null;o=this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected(),this.Data.TelehealthData.resetData(),a=this.Data.AppointmentBuilder.ReasonForVisit,this._isTelehealthWorkflow()&&null!==a&&a.setProperty("State",t.StatesEnum.Unselected),this._isFullLocationSelected()?((l=this.Data.TelehealthLocations.getFirstInIndex("State",e.StatesEnum.Selected))&&(d=l.SubLocations.getFirstInIndex("State",e.StatesEnum.Selected),l.setLocationName()),this.$root.addClass("selectionmade"),WP&&WP.DOM&&WP.DOM.Browser&&!WP.DOM.Browser.isMobile&&(this._viewMode=i),this._setSelectionInAppointmentBuilder(l,d),o&&!this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected()&&$$WPSchedulingUtil.ReturnToSlotStepAndReloadSlots(this.Data)):this.$root.removeClass("selectionmade"),this._updateStepStatus()},_isFullLocationSelected:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_isFullLocationSelected(){var t=this.Data.TelehealthLocations.getFirstInIndex("State",e.StatesEnum.Selected);return!!t&&(!!t.SubLocations.getFirstInIndex("State",e.StatesEnum.Selected)||0===t.SubLocations.size())},_onCardFocus:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onCardFocus(){this.$root.addClass("active")},_onCardBlur:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_onCardBlur(){this.$root.removeClass("active")},_renderEmergencyWarningBanner:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_renderEmergencyWarningBanner(){if(this._isTelehealthWorkflow()){var e,t=this._workflow.IsAnonymous&&!this._workflow.SchedulingControllerParams.rootDecisionTreeID;if((e={HeaderText:t?$$WP.Strings.get("SplashPageBannerHeader","ondemandtelehealth"):$$WP.Strings.get("EmergencyWarningBannerHeader","ondemandtelehealth"),DetailText:t?$$WP.Strings.get("SplashPageBannerDetails","ondemandtelehealth"):$$WP.Strings.get("EmergencyWarningBannerDetails","ondemandtelehealth"),BannerType:"criticalType",DisableDetailTextHtmlEncoding:!0,ButtonLabel:t?$$WP.Strings.get("SplashPageBannerButtonCaption","ondemandtelehealth"):null,ButtonUrl:t?$$WP.Strings.get("SplashPageBannerButtonUrl","ondemandtelehealth"):null,BannerID:t?"AnonymousSchedulingBanner":"EmergencyWarningBanner"}).HeaderText||e.DetailText||e.ButtonLabel){var n=$afe.renderTemplate($$WP.Templates.Core.Banner,e,{});$afe.select($$WP.Utilities.UI.IsMobile?"#telehealthBannerMobile":"#telehealthBannerWeb").safeReplaceWith(n),t&&$afe.select("#AnonymousSchedulingBanner").addClass("anonymousSchedulingBanner")}}},_setSelectedSubIndexForCountry:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_setSelectedSubIndexForCountry(e,t){this._selectedSubIndices[e]=t},_getSelectedSubIndexForCountry:function WP$Scheduling$OnDemandTelehealth$PatientLocationStepController$_setSelectedSubIndexForCountry(t){return t in this._selectedSubIndices?this._selectedSubIndices[t]:e.FakeLocationId}},$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.PatientLocationStepController=a,a.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnDemandTelehealth$PatientLocationStepController")}();;
!function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$definition(){var e=$$WP.Common.Model,t=$$WP.Common.SelectableViewBinder,a=$$WP.Scheduling.TelehealthOrganization,i=$$WP.Scheduling.TelehealthData,n=$$WP.Scheduling.TelehealthLocation,l=$$WP.Scheduling.TelehealthFilters,o=function WP$Scheduling$OnDemandTelehealth$OrganizationStepController(e,i,n){this.WP$Scheduling$StepController(e,n,null,null,null,$$WP.Templates.Scheduling.OnDemandTelehealth.OrganizationStep),this.proxify("updateStep","_onOrganizationStateChanged","_onCardFocus","_onCardBlur","updateOrgs","clearModel","_orgChooseCallbackSuccess","_onFilterSelect","_dataUpdated"),this._workflow=i,this.setViewBinder(new t("State",a.StatesEnum.Selected,a.StatesEnum.Unselected)),this.Data.TelehealthOrganizations.addPropertyListener("State",this._onOrganizationStateChanged),this.Data.TelehealthLocations.addPropertyListener("State",this.updateStep),this.Data.TelehealthData.addPropertyListener("",this._dataUpdated),this.$root.on("click","input.togglebutton",this._onFilterSelect),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.updateOrgs),this.Data.ReasonsForVisit.addCollectionEventListener("add",this.clearModel),this.Data.ReasonsForVisit.addCollectionEventListener("remove",this.clearModel),this.Data.TelehealthOrganizations.addCollectionEventListener("add",this.updateStep),this.Data.TelehealthOrganizations.addCollectionEventListener("remove",this.updateStep),this.$root.on("focus",".card",this._onCardFocus),this.$root.on("blur",".card",this._onCardBlur)},s={_mode:null,_prerequisiteSteps:null,_selectionMade:!1,_selectedIndex:0,_isLoading:!1,_selectedFilter:null,_isReviewResultLoaded:!1,_isLoadingReviewData:!1,_reviewResult:null,updateViewModel:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$updateViewModel(){var e=this.Data.AppointmentBuilder.ReasonForVisit,t=this.Data.TelehealthLocations.getFirstInIndex("State",n.StatesEnum.Selected);this._selectedFilter=this._selectedFilter||l.Filters[0].Value;var o=l.BuildTelehealthOrganizationArray(this.Data,this._selectedFilter,null,!e||e.InternallyAvailableForTelehealth),s=this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected),h=[];if(this.Data.TelehealthData.IsXOrgEnabled){if(this.Data.AppointmentBuilder.getAppointment(0).Slot&&null===this.Data.TelehealthData.QuickScheduleSlot)return this.Data.TelehealthData.QuickScheduleSlot=this.Data.AppointmentBuilder.getAppointment(0).Slot,void this._orgNotRequired(o);if(null===e)return this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),void(this.ViewModel={StepShouldBeActive:!1});if(1===o.length&&o[0].IsLocal||!e.ExternallyAvailableForTelehealth||this.Data.TelehealthData.SelectedWorkflow===i.TelehealthWorkflow.QuickSchedule||this.Data.TelehealthData.SelectedWorkflow===i.TelehealthWorkflow.SlotSelection||t&&"233"!==t.Id)this._orgNotRequired(o);else if(null===this.Data.TelehealthData.SelectedWorkflow)this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.ViewModel={StepShouldBeActive:!1};else if(s&&!s.ConsentCaptured())this.$root.hide();else{var r,d;for(this.Data.TelehealthOrganizations.openChangeBatch(),r=0;r<o.length;r++)(d=o[r]).State===a.StatesEnum.Selected&&d.setProperty("State",a.StatesEnum.SelectedUnavailable);if(this._reviewResult&&this._reviewResult.Success){var g=this.Data.AppointmentBuilder.getFirstAppointmentIndex(),u=this._reviewResult.Appointments[g];if($$WPUtil.IsNullOrEmpty(u))return;var c=u.VisitPayment;c&&""!==c.Amount&&0!==c.Type&&o[0].IsLocal?(o[0].CostDisplayString=c.Amount,o[0].MaxCost=c.RawAmount):o[0].IsLocal&&(o[0].CostDisplayString="",o[0].MaxCost="",o[0].CrossOrgShowCost=!1)}for(this._onOrganizationDisplay(o),h=this._updateFilterList(o,l.Filters,h),this.ViewModel={StepShouldBeActive:!0,Count:o.length,TelehealthOrganizations:o,Filter:this._selectedFilter,Filters:h,SelectedIndex:"",SelectedValue:"",HadConnectionFailure:this.Data.TelehealthData.HadConnectionFailure,ViewMode:this._viewMode,IsLoading:this._isLoading,LoadingClasses:"organizationstep",AdminLogin:this.Data.IsAdminLoginFromHyperspace},r=0;r<o.length;r++)(d=o[r]).State===a.StatesEnum.SelectedUnavailable&&d.setProperty("State",a.StatesEnum.Selected);this.Data.TelehealthOrganizations.closeChangeBatch()}}else this._orgNotRequired(o)},_orgNotRequired:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_orgNotRequired(e){this.Data.TelehealthData.setProperty("IsOrgSelectionComplete",!0),this.ViewModel={StepShouldBeActive:!1};var t=this._getLocalOrgIndex(e);t>-1&&e[t].setProperty("State",a.StatesEnum.Selected),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},_onFilterSelect:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_onFilterSelect(e){var t=e.target.value;t&&this._selectedFilter!==t&&(this._selectedFilter=t,this._showFilter(t,!0))},_updateFilterList:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_updateFilterList(e,t,a){var i=this._getLocalOrgIndex(e),n=!1;if(e.length<=2)return a;for(var l=0;l<e.length;l++)if(l!==i){n=e[l].CrossOrgShowCost;break}if(n)a=t;else for(l=0;l<t.length;l++)"cost"!==t[l].Value&&a.push(t[l]);return a},_onOrganizationDisplay:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_onOrganizationDisplay(e){var t=this._getLocalOrgIndex(e),a=0,i=!1,n=!1,l=!1,o=!1,s=-1!=t,h=!1,r=!1,d=!1;if(!(null==e||e.length<2)){for(var g=0;g<e.length;g++)if(g!==t){a=g,h=!0;break}s&&e[t].CostDisplayString&&(r=!0,e[t].CrossOrgShowCost=!0),h&&e[a].CrossOrgShowCost&&(d=!0),s&&d&&!r&&(l=!0),!d&&r&&(o=!0),d&&r&&(i=!0),d&&(!s||r||e.length>2)&&(n=!0);for(g=0;g<e.length;g++)g==t?(e[g].ShowCostComparisons=i,e[g].ShowDisclaimer=l):(e[g].ShowCostComparisons=n,e[g].ShowDisclaimer=o)}},_showFilter:function WP$Scheduling$OnDemandTelehealth$TelehealthOrganizationStepController$_showFilter(e,t){var i=this.Data.AppointmentBuilder.ReasonForVisit,n=l.BuildTelehealthOrganizationArray(this.Data,e,null,!i||i.InternallyAvailableForTelehealth);this._onOrganizationDisplay(n);var o=this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected);null===o||$.inArray(n,o)||(o.State=a.StatesEnum.Unselected,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)),this.ViewModel.Count=n.length,this.ViewModel.TelehealthOrganizations=n,this.ViewModel.Filter=e;var s=$afe.renderTemplate($$WP.Templates.Scheduling.OnDemandTelehealth.OrganizationList,this.ViewModel),h=this.$root.find(".telehealthContainer > div");t?h.fadeOut("fast",$.proxy(this._replaceOrgList,this,h,s)):(h.safeReplaceWith(s),this._fixCards())},_replaceOrgList:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_replaceOrgList(e,t){t.hide(),e.safeReplaceWith(t),t.fadeIn("fast"),this._fixCards()},_fixCards:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_fixCards(){for(index in this.$root.find(".cardlist.matchHeights").each((function(){$$WP.Utilities.UI.Cards.MatchHeights.apply(this,arguments)})),this.ViewModel.TelehealthOrganizations)model=this.ViewModel.TelehealthOrganizations[index],model.Disabled?this.ViewBinder.unbindElement(this.ViewBinder.getBoundElements(model)):this.ViewBinder.bindModel(model);this.ViewBinder.syncModelsToDOM()},_getLocalOrgIndex:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_getLocalOrgIndex(e){if(1===e.length)return 0;for(var t=0;t<e.length;t++)if(e[t].IsLocal)return t;return-1},beforeRender:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$beforeRender(){this._isReviewResultLoaded||this.Data.TelehealthData.SelectedWorkflow!==i.TelehealthWorkflow.Queueing||this._loadReviewData();var e=this.ViewModel.TelehealthOrganizations;this._onOrganizationDisplay(e),1===e.length&&e[0].IsLocal?(e[0].setProperty("State",a.StatesEnum.Selected),this.stepSettings.ReadOnly=!0):null===this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected)&&(this.stepSettings.Hide=!1,this.stepSettings.HideIfOne=!1,this.stepSettings.Collapse=!1,this.stepSettings.CollapseIfOne=!1,this.stepSettings.ReadOnly=!1)},afterRender:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$afterRender(){var e=!1,t=this.ViewModel.TelehealthOrganizations,a=this._getLocalOrgIndex(t);this._showFilter(this._selectedFilter,!1),this._isOrgSelectedWithoutConsent()&&this.$root.hide(),this._isLoadingReviewData&&$$WPUtil.ShowAjaxSpinner(this.$root.find(".telehealthLoadingOverlay.organizationstep .ajaxspinner")),this._isReviewResultLoaded=!1,this._onOrganizationDisplay(t);for(var i=0;i<t.length;i++)if(i!==a){e=t[i].CrossOrgShowCost;break}var n=this.Data.AppointmentBuilder.ReasonForVisit;"1"===this.Data.TelehealthData.UseInsuranceForVisit&&n.InternallyAvailableForTelehealth&&n.ExternallyAvailableForTelehealth&&e&&this._renderEstimatedCostInfoBanner(),this.$root.find("h2.header").focus()},_isOrgSelectedWithoutConsent:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_isOrgSelectedWithoutConsent(){var e=this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected);return!(!e||e.ConsentCaptured())},triggerViewEvent:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$triggerViewEvent(){this._isOrgSelectedWithoutConsent()||this.WP$Scheduling$StepController$triggerViewEvent()},_getViewEventSubmodule:function WP$Scheduling$OrganizationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.OrganizationStep},updateOrgs:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$updateOrgs(){null===this.Data.AppointmentBuilder.ReasonForVisit?this.clearModel():(this._isLoading=this._loadOrgs(),this.updateStep())},clearModel:function WP$Scheduling$OnDemandTelehealth$clearModel(){this._isLoading=!1,this.Data.TelehealthOrganizationLoader.CancelRequest()},_loadOrgs:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_loadOrgs(){var e,t=this.Data.AppointmentBuilder.ReasonForVisit,a=this.Data.TelehealthLocations.getFirstInIndex("State",n.StatesEnum.Selected);return a&&(e=a.SubLocations.getFirstInIndex("State",n.StatesEnum.Selected)),this.Data.TelehealthOrganizations.openChangeBatch(),this.Data.TelehealthOrganizations.empty(),this.Data.TelehealthOrganizations.closeChangeBatch(),!(!t||!a||!e&&0!==a.SubLocations.size())&&(this.Data.TelehealthOrganizationLoader.LoadOrganizations(t,a,e,this._orgChooseCallbackSuccess),!0)},_orgChooseCallbackSuccess:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_orgChooseCallbackSuccess(e,t){this.clearModel();var a=this.Data.AppointmentBuilder.ReasonForVisit;if(a&&a===t){var i=this.Data.TelehealthOrganizations.Models.length;this._processRelevantOrganizations(e,a);var n=this.Data.TelehealthOrganizations.Models.length;0===i&&0===n&&this.updateStep()}},_processRelevantOrganizations:function(e,t){this.Data.TelehealthOrganizations.openChangeBatch(),this.Data.TelehealthOrganizations.empty(),$$WP.Scheduling.TelehealthOrganization.convertRawTelehealthOrganizations(e,this.Data.TelehealthOrganizations),t.OnDemandOrganization&&this.Data.TelehealthOrganizations.add(t.OnDemandOrganization),l.FindNotableOrganizations(this.Data.TelehealthOrganizations.Models),this.Data.TelehealthOrganizations.closeChangeBatch()},_dataUpdated:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_dataUpdated(e){switch(e.propertyName){case"TelehealthLoaded":this.Data.TelehealthData.IsXOrgEnabled||this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired);break;case"UseInsuranceForVisit":case"TelehealthSelectedPlatform":var t=this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected);t&&t.setProperty("State",a.StatesEnum.Unselected),this.updateStep();break;case"SelectedWorkflow":this.Data.TelehealthData.SelectedWorkflow===i.TelehealthWorkflow.Queueing&&this.Data.TelehealthData.IsXOrgEnabled?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete):(this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired),this.ViewModel={StepShouldBeActive:!1}),this.Data.TelehealthData.setProperty("ReviewApptCalledOnOrgStep",!1),this.updateStep()}},_onOrganizationStateChanged:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_onOrganizationStateChanged(e){var t=this.Data.TelehealthOrganizations.getFromIndex("State",a.StatesEnum.Selected),i=this.Data.TelehealthOrganizations.getFromIndex("State",a.StatesEnum.SelectedUnavailable);t.size>0||i.size>0?(this.$root.addClass("selectionmade"),$afe.select(".content").trigger("resize"),this.Data.TelehealthData.setProperty("IsOrgSelectionComplete",!1),this.Data.TelehealthData.setProperty("IsOrgSelectionComplete",!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep(),this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected).IsUnconnected()&&this.$root.hide()):(this.Data.TelehealthData.setProperty("ReviewApptCalledOnOrgStep",!1),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.updateStep());this._updateCardStatus(e)},_updateCardStatus:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_updateCardStatus(t){var i,n,l,o;for(i in t)n=e.getInstance(i),(o=t[i]).to!==o.from&&(l=this.ViewBinder.getBoundElements(n).closest(".card"),o.to===a.StatesEnum.Selected?l.addClass("selected"):o.from===a.StatesEnum.Selected&&l.removeClass("selected"))},_loadReviewData:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_loadReviewData(){var e,t;this._isLoadingReviewData||this.Data.AppointmentBuilder.ReasonForVisit.InternallyAvailableForTelehealth&&((t=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildAppointmentBuilderForSlot(this.Data,null)).getAppointment(0).Slot=new $$WP.Scheduling.Slot(t.getAppointment(0).Slot),t.getAppointment(0).Slot&&(e={workflow:this._workflow.toRawRequestObject(),appointmentBuilder:t.toRawRequestObject(),nonce:$$WPUtil.GetPageNonce()},$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("ReviewAppointment",this._workflow)),data:$$WPUtil.postify(e),cache:!1,success:$.proxy(this._onReviewDataLoaded,this),error:$.proxy(this._onScheduleError,this)}),this._isLoading=!0,this._isLoadingReviewData=!0,this.updateStep()))},_onReviewDataLoaded:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_onReviewDataLoaded(e){this._reviewResult=e,this._isReviewResultLoaded=!0,this._isLoadingReviewData=!1,this._isLoading=!1,this.Data.TelehealthData.setProperty("ReviewApptCalledOnOrgStep",!0),this.updateStep()},_renderEstimatedCostInfoBanner:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_renderEstimatedCostInfoBanner(){var e={HeaderText:$$WP.Strings.get("EstimatedCostInfoBannerHeader","ondemandtelehealth"),DetailText:$$WP.Strings.get("EstimatedCostInfoBannerDetails","ondemandtelehealth"),BannerType:"informationalType",DisableDetailTextHtmlEncoding:!0,BannerID:"EstimatedCostInfoBanner",UseH3Header:!0};if(e.HeaderText||e.DetailText||e.ButtonLabel){var t=$afe.renderTemplate($$WP.Templates.Core.Banner,e,{});$afe.select("#estimatedCostInfoBanner").safeReplaceWith(t),$afe.select("#EstimatedCostInfoBanner").addClass("estimatedCostInfoBanner")}},_onCardFocus:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_onCardFocus(){this.$root.addClass("active")},_onCardBlur:function WP$Scheduling$OnDemandTelehealth$OrganizationStepController$_onCardBlur(){this.$root.removeClass("active")}};o.prototype=s,$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.OrganizationStepController=o,o.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnDemandTelehealth$OrganizationStepController")}();;
/*! Copyright Epic Systems Corporation 2016-2017 */
!function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$definition(){var e=$$WP.Scheduling.ReasonForVisit,t=$$WP.Scheduling.TelehealthOrganization,n=$$WP.Scheduling.TelehealthLocation,a=$$WP.Scheduling.TelehealthData,i=0,o=1,l=function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController(e,t,n){this.WP$Scheduling$StepController(e,t,null,null,null,$$WP.Templates.Scheduling.OnDemandTelehealth.OrganizationAuthStep),this.proxify("updateStep","_onOrgStateChanged","_onCardFocus","_onCardBlur","_onClick","_onConsentChanged","_tryEstablishLinkSuccess","_processProxyWorkflow","_dataUpdated"),this.$root.on("click",this._onClick),this.Data.TelehealthOrganizations.addPropertyListener("State",this._onOrgStateChanged),this.Data.TelehealthOrganizations.addPropertyListener("NeedsH2GConsent",this._onConsentChanged),this.Data.TelehealthData.addPropertyListener("",this._dataUpdated),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.updateStep),this.Data.ReasonsForVisit.addCollectionEventListener("add",this.updateStep),this.Data.ReasonsForVisit.addCollectionEventListener("remove",this.updateStep),this.$root.on("focus",".card",this._onCardFocus),this.$root.on("blur",".card",this._onCardBlur)};l.prototype={updateViewModel:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$updateViewModel(){var t=this.Data.TelehealthOrganizations.getFirstInIndex("State",e.StatesEnum.Selected);if(this.Data.TelehealthData.IsOrgSelectionComplete&&!t||!this.Data.TelehealthData.IsXOrgEnabled||t&&t.ConsentCaptured()||this.Data.TelehealthData.SelectedWorkflow===a.TelehealthWorkflow.QuickSchedule)return this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired),void(this.ViewModel={StepShouldBeActive:!1});null===t?(this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.ViewModel={StepShouldBeActive:!1}):(this.ViewModel={Count:1,StepShouldBeActive:!0,SelectedValue:t,HomeOrganizationName:this.Data.HomeOrganizationName,OrganizationName:t.OrganizationName,IsMobile:$$WP.Utilities.UI.IsMobile,IsProxy:this.Data.IsProxy,PatientName:this.Data.ProxyContextName},this.Data.TelehealthData.IsOrgSelectionComplete||this._onConsentChanged())},afterRender:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$afterRender(){$afe.select(".cardlist.matchHeights").each($$WP.Utilities.UI.Cards.MatchHeights),this.$root.find(".jqHidden").fadeIn("slow"),this._isOrganizationSelected()&&$$WPUtil.HideAjaxSpinner(this.$root.find(".telehealthLoadingOverlay .ajaxspinner")),this.$root.find("h2.header").focus()},_getViewEventSubmodule:function WP$Scheduling$OrganizationAuthStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.OrganizationAuthStep},_isOrganizationSelected:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_isOrganizationSelected(){return!!this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected)},triggerViewEvent:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$triggerViewEvent(){this._isOrganizationSelected()&&this.WP$Scheduling$StepController$triggerViewEvent()},_dataUpdated:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_dataUpdated(e){if("TelehealthLoaded"===e.propertyName)this.Data.TelehealthData.IsXOrgEnabled||this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired);else this.updateStep()},_onClick:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_onClick(e){if(void 0!==$afe.jq(e.target).data("id")&&!$afe.jq(e.target).hasClass("disabled"))switch($afe.jq(e.target).data("id").split("-")[0]){case"continue":e.preventDefault(),this._linkAndContinue();break;case"reselect":case"cancel":e.preventDefault();var n=this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected);n&&(n.setProperty("State",t.StatesEnum.Unselected),this.updateStep())}},_onOrgStateChanged:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_onOrgStateChanged(e){this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected)?$$WPUtil.HideAjaxSpinner(this.$root.find(".telehealthLoadingOverlay .ajaxspinner")):this._onConsentChanged()},_onConsentChanged:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_onConsentChanged(){var e=this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected);e?(this.Data.TelehealthData.setProperty("IsOrgSelectionComplete",e.ConsentCaptured()),e.ConsentCaptured()&&(this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired),this.updateStep())):this._setIncomplete()},_setIncomplete:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_setIncomplete(){this.Data.TelehealthData.setProperty("IsOrgSelectionComplete",!1),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.updateStep()},_linkAndContinue:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_linkAndContinue(){this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected)&&this._tryEstablishLink()},_tryEstablishLink:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_tryEstablishLink(){var e,a=this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected),i=this.Data.AppointmentBuilder.ReasonForVisit,o=this.Data.TelehealthLocations.getFirstInIndex("State",n.StatesEnum.Selected);o&&(e=o.SubLocations.getFirstInIndex("State",n.StatesEnum.Selected)),a&&i&&o&&(e||0===o.SubLocations.size())&&($$WPUtil.ShowAjaxSpinner(this.$root.find(".telehealthLoadingOverlay .ajaxspinner")),$.post({url:makeLink("Scheduling/TryEstablishLink"),data:{orgId:a.ReceivingOrgDxo,rfvId:i.OnDemandRFV,locationId:o.Id,sublocationId:e?e.Id:""},cache:!1,async:!0,success:this._tryEstablishLinkSuccess,failure:$.proxy(this._preH2GConnectionProblem,this,a)}))},_tryEstablishLinkSuccess:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_tryEstablishLinkSuccess(e){var n=this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected);e.LinkFailed||e.Error||!e.LinkEstablished?this._preH2GConnectionProblem(n):this.Data.IsProxy?$.post({url:makeLink("Scheduling/DetermineProxyWorkflow"),cache:!1,async:!0,data:{orgId:n.OrganizationId},success:this._processProxyWorkflow}):this._formH2GLink(n)},_preH2GConnectionProblem:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_preH2GConnectionProblem(e){var t,n,a;$$WP.Strings.addMnemonic("@MYCHART@OrganizationName@",e.OrganizationName,!1,"ondemandtelehealth"),t=$$WP.Strings.get("TimeoutErrorMessage","ondemandtelehealth"),$$WP.Strings.removeMnemonic("@MYCHART@OrganizationName@","ondemandtelehealth"),n=$$WP.Strings.get("ErrorTitle","ondemandtelehealth"),a=this._getErrorPopup(t,n),$$WPUtil.quickPopup(a),this._connectionProblem(e)},_getErrorPopup:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_getErrorPopup(e,t){var n;return n={ToolbarButtons:[{Text:$$WP.Strings.get("DismissErrorPopupButtonText","ondemandtelehealth"),Class:"otherbutton"}],TitleText:t,Html:e,IsClosable:!0,callback:function(){}},new $$WPComp.ConfirmComponent(n,{Size:$$WP.Containers.Popup.SizeEnum.SMALL})},_processProxyWorkflow:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_processProxyWorkflow(e){var n=this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected);if(null!==e&&e.Success&&!e.Error)switch(e.Workflow){case i:n.setProperty("HasPatientAccess",!1),this._sendToUnverifiedWorkflow(n);break;case o:this._formH2GLink(n);break;default:this._preH2GConnectionProblem(n)}else this._preH2GConnectionProblem(n)},_sendToUnverifiedWorkflow:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_doUnverifiedProxyThings(e){$$WPUtil.HideAjaxSpinner(this.$root.find(".telehealthLoadingOverlay .ajaxspinner")),e.setProperty("NeedsH2GConsent",!1),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep()},_formH2GLink:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_formH2GLink(e){e&&($$WPUtil.HideAjaxSpinner(this.$root.find(".telehealthLoadingOverlay .ajaxspinner")),new $$WP.Community.CommunityController(null,!0).CreateLinkToOrganization(e.OrganizationId,$.proxy(this._h2gLinkSuccess,this,e),$.proxy(this._connectionProblem,this,e),$.proxy(this._notMyAccount,this,e)))},_h2gLinkSuccess:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_h2gLinkSuccess(e,n){var a=this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected);n&&n.CanScheduleCrossOrgVideoVisit?a&&a===e&&(this._clearConnectionProblem(e),a.setProperty("NeedsH2GConsent",!1),a.setProperty("HasPatientAccess",!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep()):this._connectionProblem(e)},_connectionProblem:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_connectionProblem(e){this.Data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected)===e&&(e.setProperty("Disabled",!0),this.Data.TelehealthData.setProperty("HadConnectionFailure",!0),e.setProperty("State",t.StatesEnum.Unselected))},_clearConnectionProblem:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_clearConnectionProblem(e){e.setProperty("Disabled",!1)},_notMyAccount:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_notMyAccount(e){this._connectionProblem(e)},_onCardFocus:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_onCardFocus(){this.$root.addClass("active")},_onCardBlur:function WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController$_onCardBlur(){this.$root.removeClass("active")}},$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.OrganizationAuthStepController=l,l.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnDemandTelehealth$OrganizationAuthStepController")}();;
!function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$definition(){var e=$$WP.Scheduling.Provider,t=$$WP.Common.SelectableViewBinder,l=$$WP.Scheduling.TelehealthData,i=$$WP.Scheduling.TelehealthFilters,a=$$WP.Scheduling.TelehealthOrganization,o=$$WP.Scheduling.TelehealthLocation,n=function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController(l,i,a,o,n,h,s,d,r){this.WP$Scheduling$StepController(l,i,a,o,n,$$WP.Templates.Scheduling.OnDemandTelehealth.QuickScheduleStep),this.proxify("updateStep","_onClick","clearModel","_dataUpdated","_onSlotsLoaded","_matchHeights","_organizationsUpdated"),this.$root.on("click",this._onClick),this.setViewBinder(new t("State",e.StatesEnum.Selected,e.StatesEnum.Unselected)),this.Data.TelehealthData.addPropertyListener("",this._dataUpdated),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.clearModel),this.Data.ReasonsForVisit.addCollectionEventListener("add",this.clearModel),this.Data.TelehealthLocations.addPropertyListener("State",this.updateStep),this.Data.TelehealthOrganizations.addCollectionEventListener("add",this._organizationsUpdated),this._workflowSettings=s,this._hasProviderDetailsSecurity=this._workflowSettings.HasProviderDetailsSecurity,this._isAnonymous=d,this._isGuest=r,this._stepSettings=n,window.addEventListener("resize",this._matchHeights)};n.prototype={$root:null,_mode:null,_rfvStateListenerId:null,_allowSelectProvider:!1,_errorCount:0,_csn:null,_timerFinished:!1,_hardwareTested:!1,_hasProviderDetailsSecurity:!1,_isAnonymous:!1,_isGuest:!1,_stepSettings:null,updateViewModel:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$updateViewModel(){var e;if(e=this.Data.AppointmentBuilder.ReasonForVisit,(this._isAnonymous||this._isGuest)&&(this.Data.TelehealthData.TelehealthSelectedPlatform=i.PlatformFilterValueEnum.Web),null===e||this.Data.TelehealthData.ShouldShowHardwareTest&&!this.Data.TelehealthData.IsHardwareTestComplete||!this.Data.TelehealthData.TelehealthSelectedPlatform)this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.ViewModel={StepShouldBeActive:!1};else if(this._allowSelectProvider=e.AllowProviderSelect,!this.ViewModel||!this.ViewModel.Slots||WP.DOM.Browser.isMobile&&this.ViewModel.NoneAvailable&&this.ViewModel.HasLoadedSlotsCount<2&&this.ViewModel.AvailableExternally){$afe.select(".isPrelogin>.ajaxspinner").empty();var t=this.Data.TelehealthLocations.getFirstInIndex("State",o.StatesEnum.Selected),l=null,a=this.Data.Providers.getFromIndex("ID","-2");null===t||$$WPUtil.IsNullOrEmpty(a)||(l=t.SubLocations.getFirstInIndex("State",o.StatesEnum.Selected)),$$WP.Utilities.UI.IsMobile&&(this.Data.TelehealthData.TelehealthSelectedPlatform=i.PlatformFilterValueEnum.Mobile);var n=$$WP.Scheduling.TelehealthFilters.IsRFVEnabledForOnDemand(e,this.Data.TelehealthData.TelehealthSelectedPlatform,this.Data.TelehealthData.IsXOrgEnabled)&&i.IsInLicensedLocation(e.AllowedTelemedicineLocations,t,l,null,!0),h=$$WP.Scheduling.TelehealthFilters.IsRFVEnabledForQuickSchedule(e,this.Data.TelehealthData.TelehealthSelectedPlatform);this.ViewModel={Slots:null,StepShouldBeActive:!0,LoadingClasses:"quickschedulestep",HasOnDemandVideoVisitSecurity:this._workflowSettings.HasOnDemandVideoVisitSecurity,HasQuickScheduleSecurity:this._workflowSettings.HasQuickScheduleSecurity,HasAppointmentDetailsSecurity:this._workflowSettings.HasAppointmentDetailsSecurity,HasProviderDetailsSecurity:this._workflowSettings.HasProviderDetailsSecurity&&!$$WP.Utilities.UI.IsMobile&&!this._isGuest,EnableLinkToDirectScheduling:!0,EnabledForOnDemandVideoVisits:n,EnabledForQuickSchedule:h,NoneAvailable:!1,NoneAvailableData:this._getNoneAvailableData(),HasLoadedSlotsCount:0,Organization:null,AvailableExternally:e.ExternallyAvailableForTelehealth,IsIE:WP.DOM.Browser.isIE,IsAnonymous:this._isAnonymous},this.ViewModel.Providers=this.Data.Providers.Models,this._setTelehealthOrganizationDisplayingWait(),this._loadSlots()}else this.ViewBinder.bindAllModels(this.ViewModel.Slots),this.ViewModel.LoadingClasses="quickschedulestep jqHidden",this.ViewModel.SelectedWorkflow=this.Data.TelehealthData.SelectedWorkflow,this.ViewModel.QuickScheduleSlotIndex=parseInt(this.Data.TelehealthData.QuickScheduleSlotIndex,10),this.ViewModel.HasLoadedSlotsCount=this.ViewModel.HasLoadedSlotsCount+1},clearModel:function WP$Scheduling$OnDemandTelehealth$ClearModel(){null!==this.ViewModel&&(this.ViewModel.Slots=null),this.updateStep()},_onSlotsLoaded:function WP$Scheduling$OnDemandTelehealth$OnSlotsLoaded(e){var t,l,a,n,h;this.ViewModel.Slots=[],this.ViewModel.AllowProviderSelect=this._allowSelectProvider,l=!this._allowSelectProvider&&e.length>0?1:e.length;var s=0;for(t=0;t<l;t++)a=this._getProviderById(e[t].ProviderId),h=(n=this.Data.TelehealthLocations.getFirstInIndex("State",o.StatesEnum.Selected)).SubLocations.getFirstInIndex("State",o.StatesEnum.Selected),i.IsProviderEnabledAtLocation(a,n,h)&&(this.ViewModel.Slots.push(new $$WP.Scheduling.Slot(e[t])),this.ViewModel.Slots[s].Provider=a,s+=1);this._setNoneAvailable(),this.ViewModel.HasLoadedData=!0,this.ViewModel.HasLoadedSlotsCount=this.ViewModel.HasLoadedSlotsCount+1,0===this._errorCount?(this.updateStep(),setTimeout($.proxy((function(){$$WPUtil.HideAjaxSpinner(this.__getLoadingOverlay())}),this),500)):this._reloadSlots()},_reloadSlots:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_reloadSlots(){this.updateStep(),setTimeout((function(){$afe.select(".content").trigger("resize")}),500)},_getProviderById:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_getProviderById(e){var t,l=this.ViewModel.Providers;if(l)for(t=0;t<l.length;t++)if(e===l[t].ID)return l[t];return null},_onClick:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_onClick(e){if(void 0!==$afe.jq(e.target).data("id")&&!$afe.jq(e.target).hasClass("disabled")){var t=$afe.jq(e.target).data("id").split("-"),i=t[0],a=t[1];if(("joinqueue"===i||"joinqueuephoto"===i)&&this.Data.TelehealthData.SelectedWorkflow===l.TelehealthWorkflow.Queueing||"schedule"===i&&this.Data.TelehealthData.SelectedWorkflow===l.TelehealthWorkflow.QuickSchedule&&this.Data.TelehealthData.QuickScheduleSlotIndex===a)return this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),void this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete);switch(i){case"joinqueue":case"joinqueuephoto":this._isAnonymous&&!this._isGuest||(this.Data.TelehealthData.setProperty("IsOrgSelectionComplete",!1),e.preventDefault()),this.Data.TelehealthData.setProperty("SelectedWorkflow",l.TelehealthWorkflow.Queueing),this.Data.TelehealthData.setProperty("QuickScheduleSlotIndex",""),this.__clearSelectedOrg(),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep();break;case"schedule":this.Data.TelehealthData.setProperty("QuickScheduleSlot",this.ViewModel.Slots[a]),this.Data.TelehealthData.SelectedProviderName=this.ViewModel.Slots[a].Provider.Name,this.Data.TelehealthData.setProperty("QuickScheduleSlotIndex",a),this.Data.TelehealthData.setProperty("SelectedWorkflow",l.TelehealthWorkflow.QuickSchedule),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep();break;case"provider":case"providerphoto":if(this._hasProviderDetailsSecurity&&!this._isGuest)if(this._isAnonymous){var o=makeLink("publicforms.asp?mode=provider&widgetmode=1&id="+encodeURIComponent(this.ViewModel.Slots[a].ProviderId));window.open(o,null,"width=1024,height=600,resizable,status,scrollbars").focus()}else{o=$$WP.Utilities.UI.IsMobile?makeLink("app/providers/details?id="+encodeURIComponent(this.ViewModel.Slots[a].ProviderId)+"&isIdEncrypted=1"):makeLink("app/providers/details?id="+encodeURIComponent(this.ViewModel.Slots[a].ProviderId)),window.open(o,null,"width=1024,height=600,resizable,status,scrollbars").focus()}break;case"moretimes":this.__onMoreTimesClicked(a)}}},__onMoreTimesClicked:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$__onMoreTimesClicked(e){var t=this.ViewModel.Slots[e],i=this.Data.AppointmentBuilder.getFirstAppointment(),a=new $$WP.Scheduling.ProviderDepartmentPair({ProviderId:t.ProviderId,DepartmentId:t.DepartmentId});this.Data.TelehealthData.setProperty("QuickScheduleSlot",null),this.Data.TelehealthData.setProperty("QuickScheduleSlotIndex",e),this._openChangeBatch(),i.Providers.empty(),i.Providers.add(t.Provider),i.Locations.empty(),i.Locations.addRange(this.Data.Locations.toArray()),this.Data.TelehealthData.setProperty("SelectedProviderName",t.Provider.Name),i.Slot=null,i.ProviderDepartmentPairs=[],i.ProviderDepartmentPairs.push(a),i.setProperty("SelectedTelehealthMode",VisitType.TelehealthModeEnum.Video),this._closeChangeBatch(),this.Data.TelehealthData.setProperty("SelectedWorkflow",null),this.Data.TelehealthData.setProperty("SelectedWorkflow",l.TelehealthWorkflow.SlotSelection),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)},_loadSlots:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_loadSlots(){var e=this.Data.AppointmentBuilder.ReasonForVisit;$$WP.Scheduling.TelehealthFilters.IsRFVEnabledForQuickSchedule(e,this.Data.TelehealthData.TelehealthSelectedPlatform)?$$WP.Scheduling.SlotLoader.LoadQuickScheduleSlots(e,1,$.proxy(this._onSlotsLoaded,this),this._isAnonymous,this._isGuest):this._stepSettings&&this._stepSettings.HideIfOne?(this.ViewModel.Slots=[],this.Data.TelehealthData.setProperty("SelectedWorkflow",l.TelehealthWorkflow.Queueing),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep()):this._onSlotsLoaded({})},_setNoneAvailable:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_setNoneAvailable(){var e=this.ViewModel.HasQuickScheduleSecurity,t=this.ViewModel.EnabledForQuickSchedule,l=this.ViewModel.Slots,i=!1;e&&t&&null!=l&&l.length>0&&(i=!0);var a=this.ViewModel.HasOnDemandVideoVisitSecurity,o=this.ViewModel.EnabledForOnDemandVideoVisits,n=this.ViewModel.Organization,h=!1;a&&o&&n&&(h=!0),this.ViewModel.NoneAvailable=!i&&!h},_getNoneAvailableData:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_setNoneAvailable(){return{SchedulingStoppedTitle:$$WP.Strings.get("TelehealthUnavailableTitle","OnDemandTelehealth"),SchedulingStoppedPretext:$$WP.Strings.get("TelehealthUnavailablePretext","OnDemandTelehealth"),HideButton:!0}},_setTelehealthOrganizationDisplayingWait:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_setTelehealthOrganizationDisplayingWait(){var e=this._getTelehealthOrganizationsLeastWait(),t=this.ViewModel.AvailableExternally,l=this.Data.AppointmentBuilder.ReasonForVisit.OnDemandOrganization;t&&e?this.ViewModel.Organization=e:l&&this.Data.AppointmentBuilder.ReasonForVisit.InternallyAvailableForTelehealth?this.ViewModel.Organization=l:this.ViewModel.Organization=null},_organizationsUpdated:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_organizationsUpdated(e){this._setTelehealthOrganizationDisplayingWait(),this.updateStep()},_dataUpdated:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_dataUpdated(e){switch(e.propertyName){case"SelectedWorkflow":case"TelehealthSelectedPlatform":this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)}},afterRender:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$afterRender(){this.ViewModel&&this.ViewModel.Slots||($$WPUtil.ShowAjaxSpinner(this.__getLoadingOverlay()),null===this.ViewModel.Organization?this.__makeLoadingOverlayInline():this.__makeLoadingOverlayNotInline()),$afe.select(".content").trigger("resize"),this._matchHeights(),this.$root.find("h2.header").focus()},_getViewEventSubmodule:function WP$Scheduling$QuickScheduleStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.QuickScheduleStep},_matchHeights:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_matchHeights(){var e,t,l=$afe.select("div.providerinfo"),i=0;for(t=0;t<l.length;t++)(e=$afe.jq(l[t])).height("auto"),e.height()>i&&(i=e.height());for(t=0;t<l.length;t++)(e=$afe.jq(l[t])).height(i)},_getTelehealthOrganizationsLeastWait:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_getTelehealthOrganizationsLeastWait(){var e=this.Data.AppointmentBuilder.ReasonForVisit,t=i.BuildTelehealthOrganizationArray(this.Data,i.Filters[1].Value,null,!e||e.InternallyAvailableForTelehealth);return 0==t.length?null:1==t.length?t[0]:i.FindNotableOrganizations(t).shortestWaitOrg},__clearSelectedOrg:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$__clearSelectedOrg(){var e=this.Data.TelehealthOrganizations.getFirstInIndex("State",a.StatesEnum.Selected);null!==e&&e.setProperty("State",a.StatesEnum.Unselected)},__getLoadingOverlay:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$__getLoadingOverlay(){return this.$root.find(".telehealthLoadingOverlay.quickschedulestep .ajaxspinner")},__makeLoadingOverlayInline:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$__makeLoadingOverlayInline(){this.__getLoadingOverlay().removeClass("defaultajaxoverlay"),this.__getLoadingOverlay().addClass("defaultajaxinline")},__makeLoadingOverlayNotInline:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$__makeLoadingOverlayNotInline(){this.__getLoadingOverlay().addClass("defaultajaxoverlay"),this.__getLoadingOverlay().removeClass("defaultajaxinline")}},$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.QuickScheduleStepController=n,n.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController")}();;
/*! Copyright Epic Systems Corporation 2016-2017 */
!function WP$Scheduling$OnDemandTelehealth$PlatformStepController$definition(){var e=$$WP.Scheduling.TelehealthFilters,t=$$WP.Scheduling.TelehealthLocation,l=0,a=1,o=2,i=function WP$Scheduling$OnDemandTelehealth$PlatformStepController(e,t,l){this.WP$Scheduling$StepController(e,t,null,null,null,$$WP.Templates.Scheduling.OnDemandTelehealth.PlatformStep),this.proxify("updateStep","_onCardFocus","_onCardBlur","_onClick","_dataUpdated","_onPlatformFilterSelect"),this.$root.on("click",this._onClick),this._isAnonymous=l,this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.updateStep),this.Data.TelehealthLocations.addPropertyListener("State",this.updateStep),this.Data.ReasonsForVisit.addCollectionEventListener("add",this.updateStep),this.Data.TelehealthData.addPropertyListener("",this._dataUpdated),this.$root.on("click","input.platformFilter",this._onPlatformFilterSelect),this.$root.on("focus",".card",this._onCardFocus),this.$root.on("blur",".card",this._onCardBlur)};i.prototype={_mode:null,_prerequisiteSteps:null,_viewMode:l,_selectedPlatformFilter:null,_isAnonymous:!1,_dataUpdated:function WP$Scheduling$OnDemandTelehealth$QuickScheduleStepController$_dataUpdated(t){switch(t.propertyName){case"ShouldShowHardwareTest":case"ShouldShowMobileInfo":this._viewMode=l,this.Data.TelehealthData.setProperty("IsHardwareTestComplete",!1),null===this.Data.TelehealthData.AutoSelectedWorkflow&&this.Data.TelehealthData.setProperty("SelectedWorkflow",null);var a=null;this.Data.TelehealthData.ShouldShowMobileInfo?a=e.PlatformFilterValueEnum.Mobile:this.Data.TelehealthData.ShouldShowHardwareTest&&(a=e.PlatformFilterValueEnum.Web),this._selectedPlatformFilter!==a&&(this._selectedPlatformFilter=a)}},_onPlatformFilterSelect:function WP$Scheduling$OnDemandTelehealth$TelehealthOrganizationStepController$_onPlatformFilterSelect(e){var t=e.target.value;this._onPlatformFilterSelectHelper(t)},_onPlatformFilterSelectHelper:function WP$Scheduling$OnDemandTelehealth$TelehealthOrganizationStepController$_onPlatformFilterSelectHelper(t){var l=!!WP.DOM.Browser.isMobile,a=$$WP.Utilities.UI.IsMobile,o=!a,i=a||l;if(this.Data.TelehealthData.setProperty("ShowPlatformToggle",o),this.Data.TelehealthData.setProperty("ShouldShowMobileHardwareImage",i),t&&this._selectedPlatformFilter!==t){if(this._selectedPlatformFilter=t,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),a)this.Data.TelehealthData.setProperty("ShouldShowHardwareTest",!0),this.Data.TelehealthData.setProperty("ShouldShowMobileInfo",!1);else switch(this._selectedPlatformFilter){case e.PlatformFilterValueEnum.Web:this.Data.TelehealthData.setProperty("ShouldShowHardwareTest",!0),this.Data.TelehealthData.setProperty("ShouldShowMobileInfo",!1);break;case e.PlatformFilterValueEnum.Mobile:this.Data.TelehealthData.setProperty("ShouldShowMobileInfo",!0),this.Data.TelehealthData.setProperty("ShouldShowHardwareTest",!1)}this._updateViewModelHelper(),this._updatePlatformContent()}},_updatePlatformContent:function WP$Scheduling$OnDemandTelehealth$TelehealthOrganizationStepController$_updatePlatformContent(){var e=this.$root.find(".platformStepContainer > div");if(e){var t=$afe.renderTemplate($$WP.Templates.Scheduling.OnDemandTelehealth.PlatformContainer,this.ViewModel);e.safeReplaceWith(t)}},updateViewModel:function WP$Scheduling$OnDemandTelehealth$PlatformStepController$updateViewModel(){this._updateViewModelHelper()},_updateViewModelHelper:function WP$Scheduling$OnDemandTelehealth$PlatformStepController$_updateViewModelHelper(){if(!this._selectedPlatformFilter){var a=WP.DOM.Browser.isMobile?e.PlatformFilterValueEnum.Mobile:e.PlatformFilterValueEnum.Web;this._onPlatformFilterSelectHelper(a)}this.Data.TelehealthData.setProperty("TelehealthSelectedPlatform",this._selectedPlatformFilter),this.Data.TelehealthData.setProperty("TelehealthSelectedPlatformString",e.GetPlatformString(this._selectedPlatformFilter)),this.Data.TelehealthData.setProperty("SelectedWorkflow",null);var o=this.Data.AppointmentBuilder.ReasonForVisit,i=this.Data.TelehealthLocations.getFirstInIndex("State",t.StatesEnum.Selected);if(null===o||null===i)this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.ViewModel={StepShouldBeActive:!1};else{var r=!1;this._isAnonymous||(r=5===parseInt(o.ScheduledTelemedicineVendorId,10)||5===parseInt(o.OnDemandTelemedicineVendorId));var h=$$WP.Utilities.UI.IsMobile,n=r||!h&&null!=o.TelemedicineHardwareTestFdiId&&""!=o.TelemedicineHardwareTestFdiId||h&&null!=o.TelemedicineMobileHardwareTestFdiId&&""!=o.TelemedicineMobileHardwareTestFdiId;this.Data.TelehealthData.ShouldShowHardwareTest&&!this.Data.TelehealthData.IsHardwareTestComplete&&(this._viewMode=l,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete));var d=i.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected);$$WP.Utilities.UI.IsMobile&&(this.Data.TelehealthData.TelehealthSelectedPlatform=e.PlatformFilterValueEnum.Mobile);var s=e.IsRFVEnabledForPlatformAtLocation(o,this.Data.TelehealthData.TelehealthSelectedPlatform,i,d,this.Data.TelehealthData.IsXOrgEnabled);this.ViewModel={IsVidyoWeb:r,ViewMode:this._viewMode,StepShouldBeActive:!0,SupportsHardwareTest:n,PlatformFilters:e.PlatformFilters,PlatformFilter:this._selectedPlatformFilter,ShouldShowMobileHardwareImage:this.Data.TelehealthData.ShouldShowMobileHardwareImage,ShowPlatformToggle:this.Data.TelehealthData.ShowPlatformToggle,ShouldShowMobileInfo:this.Data.TelehealthData.ShouldShowMobileInfo,ShouldShowHardwareTest:this.Data.TelehealthData.ShouldShowHardwareTest,IsMobileApp:$$WP.Utilities.UI.IsMobile,ShouldPlatformBeEnabled:s,AlreadyComplete:this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete}}},_onClick:function WP$Scheduling$OnDemandTelehealth$PlatformStepController$_onClick(e){if(void 0!==$afe.jq(e.target).data("id")&&!$afe.jq(e.target).hasClass("disabled")){var t,l=$afe.jq(e.target).data("id").split("-")[0],i=$$WP.Utilities.UI.IsMobile;switch(l){case"testhardware":if(t=this.Data.AppointmentBuilder.ReasonForVisit,5===parseInt(t.ScheduledTelemedicineVendorId)||5===parseInt(t.OnDemandTelemedicineVendorId)){var r=5===parseInt(t.ScheduledTelemedicineVendorId)?t.DefaultVisitTypeId:t.TelemedicineVisitTypeId;WP.TelehealthUtils.telemedPopup(makeLink("TelemedicineHome/StartTelemedSession?mode=TestOnly&prcId="+encodeURIComponent(r)))}else(!i&&null!=t.TelemedicineHardwareTestFdiId&&""!=t.TelemedicineHardwareTestFdiId||i&&null!=t.TelemedicineMobileHardwareTestFdiId&&""!=t.TelemedicineMobileHardwareTestFdiId)&&WP.TelehealthUtils.telemedExecuteFDI(i?t.TelemedicineMobileHardwareTestFdiId:t.TelemedicineHardwareTestFdiId,null,t.UseDeepLinkForHardwareTest);this._viewMode=a,this.Data.TelehealthData.setProperty("IsHardwareTestComplete",!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep();break;case"skiptesthardware":case"nohardwaretest":this._viewMode=o,this.Data.TelehealthData.setProperty("IsHardwareTestComplete",!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep();break;case"useweb":this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.Data.TelehealthData.setProperty("ShouldShowHardwareTest",!0),this.Data.TelehealthData.setProperty("ShouldShowMobileInfo",!1),this.updateStep();break;case"usemobile":this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.Data.TelehealthData.setProperty("ShouldShowMobileInfo",!0),this.Data.TelehealthData.setProperty("ShouldShowHardwareTest",!1),this.updateStep();break;case"verifyhasapp":this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.updateStep()}}},_onCardFocus:function WP$Scheduling$OnDemandTelehealth$PlatformStepController$_onCardFocus(){this.$root.addClass("active")},_onCardBlur:function WP$Scheduling$OnDemandTelehealth$TelehealthLocationStepController$_onCardBlur(){this.$root.removeClass("active")},afterRender:function WP$Scheduling$OnDemandTelehealth$PlatformStepController$afterRender(){$afe.select(".content").trigger("resize"),this.$root.find("h2.header").focus()},_getViewEventSubmodule:function WP$Scheduling$PlatformStepStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.PlatformStep}},$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.PlatformStepController=i,i.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnDemandTelehealth$PlatformStepController")}();;
/*! Copyright Epic Systems Corporation 2016-2018 */
!function WP$Scheduling$OnDemandTelehealth$definition(){var e=$$WP.Scheduling.TelehealthData,t=$$WP.Scheduling.TelehealthLocation,n=$$WP.Scheduling.TelehealthOrganization,i=function WP$Scheduling$OnDemandTelehealth$SummaryStepController(e,t,n,i,l,o,a,r,h){this.WP$Scheduling$StepController(e,n,null,null,null,$$WP.Templates.Scheduling.OnDemandTelehealth.SummaryStep),this.proxify("updateStep","_onCardFocus","_onCardBlur","_onKeyDown","_dataUpdated","_hideStep","_onClick","_onChange","_loadCallToAction","_loadCallToActionCallback","_continueRedirect","_onPersonalInfoCollectionChange","_loginUrlLoaded","_onScheduleError","_kickoffLogin"),this.$root.on("click",this._onClick),this._workflow=t,this.Data.TelehealthData.addPropertyListener("",this._dataUpdated),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this._hideStep),this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this._loadCallToAction),this._workflow.SchedulingControllerParams.rootDecisionTreeID&&(this._fromSelfTriage=!0,this.Data.AppointmentBuilder.addPropertyListener("IsInsuranceCollectionComplete",this._onPersonalInfoCollectionChange),this.Data.AppointmentBuilder.addPropertyListener("SkipInsuranceForVisitType",this._onPersonalInfoCollectionChange)),this._workflowSettings=i,this._onWorkflowCompleteCallback=l,this._onStopSchedulingCallback=h,this._isAnonymous=o,this._isGuest=a,this._fromSelfTriageForAll=this._fromSelfTriage&&this._isGuest,this._anonymousSettings=r,this._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.Initial,this.$root.on("focus",".card",this._onCardFocus),this.$root.on("blur",".card",this._onCardBlur),this.$root.on("keydown",this._onKeyDown)};i.prototype={_workflow:null,_workflowSettings:null,_viewMode:0,_notificationOptions:null,_timerFinished:!1,_redirectCallbackId:null,_isAnonymous:!1,_idPrefix:null,_isGuest:!1,_anonymousSettings:null,_reviewResult:null,_isReviewResultLoaded:!1,_isCurrentlyLoadingReviewResult:!1,_fromSelfTriage:!1,_fromSelfTriageForAll:!1,updateViewModel:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$updateViewModel(){(this._isAnonymous||this._isGuest)&&null!=this.Data.AppointmentBuilder.ReasonForVisit&&(this.Data.TelehealthOrganizations=n.createTelehealthOrganizationCollection(),n.convertRawTelehealthOrganizations([this.Data.AppointmentBuilder.ReasonForVisit.OnDemandOrganization],this.Data.TelehealthOrganizations),this.Data.TelehealthOrganizations.Models[0].setProperty("State",n.StatesEnum.Selected),this.Data.TelehealthOrganizations.Models[0].setProperty("IsLocal",!0)),this._fromSelfTriageForAll&&this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete);var t=this.Data.TelehealthData.SelectedWorkflow,i=this.Data.TelehealthOrganizations.getFirstInIndex("State",n.StatesEnum.Selected),l=this.Data.AppointmentBuilder.ReasonForVisit;if(null!==t&&null!==l&&(t!==e.TelehealthWorkflow.Queueing||this._isAnonymous||this._isGuest||null!==i&&i.ConsentCaptured())){if(null===this._notificationOptions)return void this._getNotificationOptions();if(this.ViewModel=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(this,this.Data,this._workflowSettings,this._isAnonymous||this._fromSelfTriageForAll,!1,this._isGuest&&!this._fromSelfTriageForAll,this._anonymousSettings),this.ViewModel.IsLoadingReviewResult=this._isCurrentlyLoadingReviewResult,this._reviewResult&&this._reviewResult.Success){var o=this.Data.AppointmentBuilder.getFirstAppointmentIndex(),a=this._reviewResult.Appointments[o];if($$WPUtil.IsNullOrEmpty(a))return;var r=a.VisitPayment;null!==r&&""!==r.Amount&&0!==r.Type||($$WP.Strings.setDefaultNamespace("OnDemandTelehealth"),r={Amount:$$WP.Strings.get("TelehealthEstimatedCostNotAvailable"),Type:0},$$WP.Strings.clearDefaultNamespace()),r.IsPrepay=3===r.Type,r.IsHidden=!!this.ViewModel.SelectedOrg&&this.ViewModel.SelectedOrg.ODVVHideCost,t!==e.TelehealthWorkflow.Queueing||this.Data.TelehealthData.ReviewApptCalledOnOrgStep||i.IsLocal&&(i.CostDisplayString=r.Amount),this.ViewModel.VisitPayment=r}this._shouldHideStep=!1}else this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.ViewModel={StepShouldBeActive:!1}},_getID:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getID(e){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetID(e,this)},_getIDPrefix:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getIDPrefix(){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetIDPrefix(this)},_getComments:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getComments(){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetComments(this.$root)},_onClick:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onClick(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnClick(e,this,this.Data,this.$root)},_signUp:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_signUp(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SignUp(this.$root,this,this.Data,this._isGuest)},_saveEmail:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_saveEmail(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SaveEmail(this.$root,this)},_savePhone:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_savePhone(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SavePhone(this.$root,this)},_enqueuePatient:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_enqueuePatient(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.EnqueuePatient(this.$root,this,this.Data,this._isAnonymous)},_scheduleAppointment:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_scheduleAppointment(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ScheduleAppointment(this.$root,this,this.Data,this._isGuest,this._isAnonymous)},_buildRedirectionParameters:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$buildRedirectionParameters(e){var i=this.Data.TelehealthLocations.getFirstInIndex("State",t.StatesEnum.Selected),l=null;if(i){l={Number:i.Id,Title:i.Name};var o=i.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected);if(o){var a={Number:o.Id,Title:o.Name};l.SubLocations=[a]}}var r=null;this.Data.TelehealthData.QuickScheduleSlot&&(r=this.Data.Providers.getFromIndex("ID",this.Data.TelehealthData.QuickScheduleSlot.ProviderId));var h=this.Data.TelehealthData.toRawRequestObject(this._workflow.SchedulingControllerParams,this.Data.AppointmentBuilder.HasMatchingRecord,r),s=this.Data.AppointmentBuilder.ReasonForVisit.toRawRequestObject(),u=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetSourceWorkflowFromUrl();return{telehealthData:h,workflowSettings:this._workflowSettings,appointmentBuilder:{ReasonForVisit:s},telehealthLocation:l,telehealthOrganization:this.Data.TelehealthOrganizations.getFirstInIndex("State",n.StatesEnum.Selected),isForSomeoneElse:null!=e&&e,sourceWorkflow:u}},_loginUrlLoaded:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$loginUrlLoaded(e){WP.Events.cancelBeforeUnload(),window.location=makeLink(e.Url)},_kickoffLogin:function _kickoffLogin(){var e=this._buildRedirectionParameters(this._anonymousSettings&&this._anonymousSettings.SchedulingForSomeoneElse);this._changeOverlayText(!0,!0),$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ShowOverlay(this.$root,this.Data,this._isAnonymous),$.post({url:makeLink("Scheduling/Anonymous/TelehealthRedirectTologin"),data:$$WPUtil.postify(e),cache:!1,success:this._loginUrlLoaded,error:this._onScheduleError})},_continue:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$continue(){this._anonymousSettings&&this._anonymousSettings.DisableScheduleAsGuest?this._kickoffLogin():this._fromSelfTriageForAll&&!1===this.Data.AppointmentBuilder.IsInsuranceCollectionComplete?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete):this._continueRedirect()},_continueRedirect:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$continueRedirect(){var e=this._buildRedirectionParameters(this._anonymousSettings&&this._anonymousSettings.SchedulingForSomeoneElse);this._changeOverlayText(!0,!0),$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ShowOverlay(this.$root,this.Data,this._isAnonymous),$.post({url:makeLink("Scheduling/Anonymous/TelehealthRedirectToSelfSignup"),data:$$WPUtil.postify(e),cache:!1,success:$.proxy(this._selfSignupUrlLoaded,this),error:$.proxy(this._onScheduleError,this)})},_onPersonalInfoCollectionChange:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onPersonalInfoCollectionChange(){(this.Data.AppointmentBuilder.SkipInsuranceForVisitType||this.Data.AppointmentBuilder.IsInsuranceCollectionComplete&&this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)&&(this.Data.AppointmentBuilder.RequestedLogin?this._kickoffLogin():this._continueRedirect())},_selfSignupUrlLoaded:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$selfSignupUrlLoaded(e){var t=e.Url,n="";if($$WPUtil.IsNullOrEmpty(t)){if($$WPUtil.IsNullOrEmpty(e.Token))return;if(n="skipAbandonCurrent=1&postlogoutmode=signup&postloginmode=schedulingproxysel&schedulingSession="+e.Token,100===this._workflow.SchedulingControllerParams.parentWorkflow){if($$WPUtil.IsNullOrEmpty(e.SelfSignupToken))return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay(this.$root,this.Data,this._isAnonymous),void this._onStopSchedulingCallback();if(e.DoesNotMeetMinSignupAge)return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay(this.$root,this.Data,this._isAnonymous),void this._onStopSchedulingCallback(null,$$WP.Scheduling.SchedulingController.NotScheduledReasonEnum.DoesNotMeetMinSignupAge);t="Signup?"+n,t+="&workflow=100",e.SelfSignupToken&&(t+="&token="+encodeURIComponent(e.SelfSignupToken))}else t="Home/LogOut?"+n;e.IsForSomeoneElse&&(t+="&signupOption=2&workflow=300"),e.SignupMethod&&(t+="&signupOption="+e.SignupMethod),this._fromSelfTriage&&(t+="&fromselftriage=1"),t=makeLink(t)}100===this._workflow.SchedulingControllerParams.parentWorkflow&&this.Data.AppointmentBuilder.HasMatchingRecord?$$WP.SelfTriage.Utilities.ReconcileSessionForSignup(t,this._onScheduleError,!$$WPUtil.IsNullOrEmpty(e.Url)):(WP.Events.cancelBeforeUnload(),$$WPUtil.IsNullOrEmpty(e.Url)?$$WPUtil.TryRedirect(t):window.top.location.href=t)},_onScheduled:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onScheduled(e,t,i,l,o,a,r,h,s){const u=this.Data.TelehealthOrganizations.getFirstInIndex("State",n.StatesEnum.Selected);$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnScheduled(e,t,i,l,o,a,r,this.$root,this,this.Data,this._workflowSettings,!1,null,h,this._isAnonymous,s,u)},_onScheduleError:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onScheduleError(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnScheduleError(this.$root,this,this.Data,this._isAnonymous)},_checkRedirectFromOverlay:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_checkRedirectFromOverlay(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.CheckRedirectFromOverlay(e,this)},_redirectToVisitDetails:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_redirectToVisitDetails(e,t){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RedirectToVisitDetails(e,t,this._csn,this.ViewModel.SelectedOrg?this.ViewModel.SelectedOrg.OrganizationId:null)},_onEnqueued:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onEnqueued(e,t,n,i){var l=t.CSN,o=t.DxoId,a=t.IsECheckInAvailable,r=t.DidRefreshH2GLink,h=t.URL,s=t.Error;this._onScheduled(l,!0,e,o,a,r,s,null,h)},_onQuickScheduled:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onQuickScheduled(e,t,n){var i=null,l="",o="",a=!1,r=e.Error;e.Appointments.length>0&&(l=(i=e.Appointments[0]).CSN,a=i.IsECheckInAvailable,o=i.UCI),this._onScheduled(l,!1,!0,"",a,!1,r,o)},_changeOverlayText:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_changeOverlayText(e,t){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ChangeOverlayText(e,t,this.$root,this._workflowSettings)},_onCardFocus:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onCardFocus(){this.$root.addClass("active")},_onCardBlur:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onCardBlur(e){this.$root.removeClass("active"),$afe.jq(e.target).hasClass("comments")&&WP.DOM.Browser.isMobile&&window.scrollTo(document.body.scrollLeft,document.body.scrollTop+1)},_dataUpdated:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_dataUpdated(e){"SelectedWorkflow"!==e.propertyName&&"QuickScheduleSlot"!==e.propertyName&&"IsOrgSelectionComplete"!==e.propertyName||this.updateStep()},_loadReviewData:function WP$Scheduling$ConfirmationStepController$_loadReviewData(){var e,t;this._isCurrentlyLoadingReviewResult||(this.Data.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection?t=this.Data.AppointmentBuilder:(t=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildAppointmentBuilderForSlot(this.Data,this._getComments())).getAppointment(0).Slot=new $$WP.Scheduling.Slot(t.getAppointment(0).Slot),t.getAppointment(0).Slot&&(e={workflow:this._workflow.toRawRequestObject(),appointmentBuilder:t.toRawRequestObject(),nonce:$$WPUtil.GetPageNonce()},$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("ReviewAppointment",this._workflow)),data:$$WPUtil.postify(e),cache:!1,success:$.proxy(this._onReviewDataLoaded,this),error:$.proxy(this._onScheduleError,this)}),this._isCurrentlyLoadingReviewResult=!0,this.updateStep()))},_onReviewDataLoaded:function WP$Scheduling$ConfirmationStepController$_onReviewDataLoaded(e){this._reviewResult=e,this._isReviewResultLoaded=!0,this._isCurrentlyLoadingReviewResult=!1,this.updateStep()},_updateViewModelWithError:function WP$Scheduling$ConfirmationStepController$__updateViewModelWithError(){this.ViewModel={SchedulingStoppedTitle:this.__reviewResult.Error.PatientFriendlyErrorMessageTitle,SchedulingStoppedPretext:this.__reviewResult.Error.PatientFriendlyErrorMessage.join(" "),SchedulingStoppedButtontext:this.__reviewResult.Error.PatientFriendlyErrorMessageButtonText,HideButton:!this.__reviewResult.Error.IsPatientFriendlyErrorMessageRecoverable,HideStoppedIcon:this.__reviewResult.Error.IsPatientFriendlyErrorMessageIconHidden},this.ViewModel.StepShouldBeActive=!0,this.ViewModel.IsLoading=!1,this.template=$$WP.Templates.Scheduling.SchedulingStopped},_hideStep:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_hideStep(e){this._shouldHideStep=!0,this.updateStep()},_loadCallToAction:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_loadCallToAction(e){if(e.to&&e.to.OnDemandRFV&&!this._isAnonymous){var t={rfvId:e.to.OnDemandRFV};$.post({url:makeLink("TelemedicineHome/GetOnDemandCallToAction"),data:t,cache:!1,async:!0,success:$.proxy(this._loadCallToActionCallback,this)})}},_loadCallToActionCallback:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_loadCallToActionCallback(e){this.Data.TelehealthData.TelehealthNotificationSettings.CallToAction=e.CallToAction,this.Data.TelehealthData.TelehealthNotificationSettings.TermsLink=e.TermsLink,this.Data.TelehealthData.TelehealthNotificationSettings.PrivacyLink=e.PrivacyLink},beforeFirstRender:function WP$Scheduling$ConfirmationStepController$beforeFirstRender(){$$WPSchedulingUtil.RegisterConfirmationPartials()},beforeRender:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$beforeRender(){var t=this.Data.TelehealthData.SelectedWorkflow,i=this.Data.TelehealthOrganizations.getFirstInIndex("State",n.StatesEnum.Selected);this._skipReviewAppt=this._isReviewResultLoaded||this.Data.TelehealthData.ReviewApptCalledOnOrgStep||t===e.TelehealthWorkflow.Queueing&&!i.IsLocal,this._skipReviewAppt||this._loadReviewData()},afterRender:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$afterRender(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.AfterRender(this.$root,this,this.Data,this._isAnonymous),this.$root.on("click",this._onClick),this.$root.on("keydown",this._onKeyDown),this._isCurrentlyLoadingReviewResult&&$$WPUtil.ShowAjaxSpinner(this.$root.find(".loadingReviewDataSpinner .ajaxspinner")),this._isReviewResultLoaded=!1},_getViewEventSubmodule:function WP$Scheduling$StepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.SummaryStep},_renderNotifications:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_renderNotifications(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RenderNotifications(e,this.$root,this,this.Data,this._isGuest)},_getNotificationOptions:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getNotificationOptions(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetNotificationOptions(this,this.Data),this.updateStep()},_onChange:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onChange(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnChange(e,this.$root,this)},_resetFocus:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_resetFocus(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ResetFocus(e,this.$root)},_onKeyDown:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_onKeyDown(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnKeyDown(e,this.$root,this)}},$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.SummaryStepController=i,i.extend($$WP.Scheduling.StepController,"WP$Scheduling$OnDemandTelehealth$SummaryStepController")}();;
!function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$definition(){$$WP.Utilities.guaranteeExistence($$WP,"SelfTriage.Enums");var e=$$WP.Scheduling.TelehealthLocation,t=$$WP.Scheduling.TelehealthOrganization,n=$$WP.SelfTriage.Enums.ActionNodeStatus,a=function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController(n,a,l,o,i,h,r){this.WP$Controllers$Controller(),WP.Events.beforeUnload(),this.proxify("_onKeyDown","_onClick","_onChange","_onCancelPopupClosed"),this._data=a,this.$root=n,this.$root.on("mousedown",this._onClick),this._workflowSettings=l,this._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.Initial,$$WPSchedulingUtil.RegisterConfirmationPartials(),this.$root.on("keydown",this._onKeyDown),$afe.select("#main > .title").hide(),this._data.TelehealthLocations=e.createTelehealthLocationCollection(),e.convertRawTelehealthLocations(o,this._data.TelehealthLocations);var d=0;if(this._data.TelehealthLocations.Models[0].SubLocations.Models&&this._data.TelehealthLocations.Models[0].SubLocations.Models[0].Id==e.FakeLocationId&&(d=1),this._data.TelehealthLocations.Models[0].SubLocations.Models?this._data.TelehealthLocations.Models[0].SubLocations.Models[d].setProperty("State",e.StatesEnum.Selected):this._data.TelehealthLocations.Models[0].SubLocations=e.createTelehealthLocationCollection(),this._data.TelehealthLocations.Models[0].setProperty("State",e.StatesEnum.Selected),this._data.TelehealthOrganizations=t.createTelehealthOrganizationCollection(),t.convertRawTelehealthOrganizations(i,this._data.TelehealthOrganizations),this._data.TelehealthOrganizations.Models[0].setProperty("State",t.StatesEnum.Selected),this._data.TelehealthOrganizations.Models[0].setProperty("IsLocal",!0),this._data.TelehealthData.QuickScheduleSlot){var s=new $$WP.Scheduling.Slot(this._data.TelehealthData.QuickScheduleSlot);s.Provider=this._data.TelehealthData.QuickScheduleSlot.Provider,this._data.TelehealthData.QuickScheduleSlot=s,this._data.TelehealthData.QuickScheduleSlot.setProperty("State",$$WP.Scheduling.Slot.StatesEnum.Unselected)}this._data.TelehealthData.ShowCancelButton=!0,this._errorUrlOverride=h,this._isGuest=r,this._hasGuestNotifications=r,this._updateViewModel(),this._onWorkflowCompleteCallback=this._schedulingComplete;var S=$afe.renderTemplate($$WP.Templates.Scheduling.OnDemandTelehealth.SummaryStep,this.ViewModel);$afe.select("#telehealthSummary").safeReplaceWith(S),this._afterRender()};a.prototype={$root:null,ViewModel:null,_workflowSettings:null,_viewMode:0,_notificationOptions:null,_timerFinished:!1,_redirectCallbackId:null,_onWorkflowCompleteCallback:null,_data:null,_csn:"",_errorCount:0,_idPrefix:null,_errorUrlOverride:"",_hasGuestNotifications:!1,_isGuest:!1,_updateViewModel:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$updateViewModel(){null===this._notificationOptions&&this._getNotificationOptions(),this.ViewModel=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(this,this._data,this._workflowSettings,!1,!0,this._hasGuestNotifications)},_getID:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getID(e){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetID(e,this)},_getIDPrefix:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getIDPrefix(){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetIDPrefix(this)},_getComments:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getComments(){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetComments(this.$root)},_afterRender:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$afterRender(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.AfterRender(this.$root,this,this._data,!1)},_onClick:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onClick(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnClick(e,this,this._data,this.$root)},_signUp:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_signUp(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SignUp(this.$root,this,this._data,this._hasGuestNotifications)},_saveEmail:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_saveEmail(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SaveEmail(this.$root,this)},_savePhone:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_savePhone(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SavePhone(this.$root,this)},_enqueuePatient:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_enqueuePatient(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.EnqueuePatient(this.$root,this,this._data,!1)},_scheduleAppointment:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_scheduleAppointment(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ScheduleAppointment(this.$root,this,this._data,this._hasGuestNotifications,!1)},_onScheduled:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onScheduled(e,n,a,l,o,i,h,r,d){const s=this._data.TelehealthOrganizations.getFirstInIndex("State",t.StatesEnum.Selected);$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnScheduled(e,n,a,l,o,i,h,this.$root,this,this._data,this._workflowSettings,!0,this._errorUrlOverride,r,!1,d,s)},_onScheduleError:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onScheduleError(e){var t=new $$WPComp.MessageComponent({TitleText:$$WP.Strings.get("ScheduleErrorTitle","Scheduling"),Message:$$WP.Strings.get("ErrorMessage","Scheduling"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("ScheduleErrorButtonLabel","Scheduling"),null,"cancelworkflow","")]});$$WPUtil.quickPopup(t),WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink("Scheduling/OnDemandTelehealth"))},_checkRedirectFromOverlay:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_checkRedirectFromOverlay(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.CheckRedirectFromOverlay(e,this)},_redirectToVisitDetails:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_redirectToVisitDetails(e,t){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RedirectToVisitDetails(e,t,this._csn,this.ViewModel.SelectedOrg?this.ViewModel.SelectedOrg.OrganizationId:null)},_onEnqueued:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onEnqueued(e,t,n,a){var l=t.CSN,o=t.DxoId,i=t.IsECheckInAvailable,h=t.DidRefreshH2GLink,r=t.URL,d=t.Error;this._onScheduled(l,!0,e,o,i,h,d,null,r)},_onQuickScheduled:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onQuickScheduled(e,t,n){var a=null,l="",o=!1,i=e.Error;e.Appointments.length>0&&(l=(a=e.Appointments[0]).CSN,o=a.IsECheckInAvailable),this._onScheduled(l,!1,!0,"",o,!1,i)},_schedulingComplete:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_schedulingComplete(e){WP.Events.cancelBeforeUnload(),this._data.TelehealthData.RootDecisionTreeID?(this._saveActionNodes(e),this._redirectToSelfTriage(this._data.TelehealthData.RootDecisionTreeID,this._data.TelehealthData.DecisionTreeAnswerID,this._data.TelehealthData.IsFromSelfTriageLandingPage)):$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RedirectToVisitDetails("1",!0,this._csn,"")},_changeOverlayText:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_changeOverlayText(e,t){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ChangeOverlayText(e,t,this.$root,this._workflowSettings)},_getNotificationOptions:function WP$Scheduling$OnDemandTelehealth$SummaryStepController$_getNotificationOptions(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetNotificationOptions(this,this._data)},_renderNotifications:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_renderNotifications(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RenderNotifications(e,this.$root,this,this._data,this._hasGuestNotifications)},_onChange:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onChange(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnChange(e,this.$root,this)},_resetFocus:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_resetFocus(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ResetFocus(e,this.$root)},_onKeyDown:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onKeyDown(e){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnKeyDown(e,this.$root,this)},_onCancel:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onCancel(){confirmComponent=new $$WPComp.MessageComponent({TitleText:$$WP.Strings.get("CancelSchedulingTitle","ondemandtelehealth"),Message:$$WP.Strings.get("CancelSchedulingMessage","ondemandtelehealth"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button($$WP.Strings.getForTemplate("StayButtonText","Core.SafeToRedirectPopup"),null,"previousstep",""),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("CancelSchedulingCaption","ondemandtelehealth"),null,"cancelworkflow","")],callback:this._onCancelPopupClosed}),$$WPUtil.quickPopup(confirmComponent)},_onCancelPopupClosed:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_onCancelPopupClosed(e){"toolbar0"!==e&&"close"!==e&&($.post({url:makeLink("Scheduling/CancelSchedulingAppointment")}),WP.Events.cancelBeforeUnload(),this._redirectSafely("inside.asp"))},_redirectSafely:function WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController$_redirectSafely(e){this._errorUrlOverride?$$WP.Utilities.TryRedirect(makeLink(this._errorUrlOverride)):$$WP.Utilities.TryRedirect(makeLink(e))},_saveActionNodes:function _saveActionNodes(e){var t={ID:this._data.TelehealthData.RootDecisionTreeID,AnswerID:this._data.TelehealthData.DecisionTreeAnswerID},a={ID:this._data.TelehealthData.DecisionTreeNodeID,CSN:this._data.TelehealthData.DecisionTreeNodeCSN,Type:25,EncounterCSN:e[0].CSN,EncounterUCI:e[0].UCI,Status:n.Completed};$.ajax({url:makeLink("SymptomChecker/ActionNode/SaveActionNodes"),type:"POST",data:$$WPUtil.postify({tree:t,node:a})})},_redirectToSelfTriage:function _redirectToSelfTriage(e,t,n){var a="";$.ajax({url:makeLink("SymptomChecker/ActionNode/SetAutoStart"),type:"POST",success:function(){t?(a="SymptomChecker/SelfTriage/Load?AnswerID="+encodeURIComponent(t),a+="&onrecommendationspage=1",n&&(a+="&fromList=1")):e?(a="SymptomChecker/SelfTriage/Load?TreeID="+encodeURIComponent(e),n&&(a+="&fromList=1")):a="SymptomChecker",$$WP.Utilities.TryRedirect(makeLink(a))}})}},$$WP.Scheduling.OnDemandTelehealth.StandaloneSummaryStepController=a,a.extend($$WP.Controllers.Controller,"WP$Scheduling$OnDemandTelehealth$StandaloneSummaryStepController")}();;
var Epic;!function(e){!function(e){!function(e){!function(e){e.SplashPageController=class SplashPageController{constructor(e,a){this.__$root=e,this.__schedulingControllerParameters=a,this.__$root.on("keydown",$.proxy(this.__onKeyDown,this)),this.__$root.on("click",$.proxy(this.__onClick,this))}Render(a,t,l){this.__continueCallback=l;const n=e.AnonymousTelehealthHelpers.GetTelehealthSplashPageViewModel(t,this.__schedulingControllerParameters),s=$afe.renderTemplate($$WP.Templates.Scheduling.OnDemandTelehealth.SplashPage,n,{});a.safeReplaceWith(s),this.__detailsExpanded=this.__schedulingControllerParameters.expandByDefault;const r={HeaderText:$$WP.Strings.get("SplashPageBannerHeader","ondemandtelehealth"),DetailText:$$WP.Strings.get("SplashPageBannerDetails","ondemandtelehealth"),BannerType:"criticalType",DisableDetailTextHtmlEncoding:!0,ButtonLabel:$$WP.Strings.get("SplashPageBannerButtonCaption","ondemandtelehealth"),ButtonUrl:$$WP.Strings.get("SplashPageBannerButtonUrl","ondemandtelehealth")};if(r.HeaderText||r.DetailText||r.ButtonLabel){const e=$afe.renderTemplate($$WP.Templates.Core.Banner,r,{});$afe.select("#anonymousSchedulingBanner").safeReplaceWith(e),$afe.select(".standardBanner").addClass("anonymousSchedulingBanner")}}__onClick(e){if(void 0===$afe.jq(e.target).data("id"))return;if($afe.jq(e.target).hasClass("disabled"))return;const a=$afe.jq(e.target).data("id").split("-")[0],t=window.location.href;switch(a){case"login":$.post({url:makeLink("Scheduling/Anonymous/RedirectToLoginStartWorkflow"),data:{workflow:this.__schedulingControllerParameters.workflow,sourceUrl:t},cache:!1,success:this.__onRedirectUrl});break;case"scheduleSelf":this.__schedulingControllerParameters.anonymousWorkflowForProxy=!1,this.__continueCallback(this.__schedulingControllerParameters);break;case"scheduleProxy":this.__schedulingControllerParameters.anonymousWorkflowForProxy=!0,this.__continueCallback(this.__schedulingControllerParameters);break;case"expandCollapseDetails":case"expandCollapseDetailsIcon":case"expandCollapseDetailsHeader":if(!this.__schedulingControllerParameters.outsideBusinessHours){const e=this.__$root.find("#iconExpandDetails"),a=e.parent();this.__detailsExpanded?(e.removeClass("splashPageCollapsible"),e.addClass("splashPageExpandable"),a.safeAttr("aria-expanded","false"),this.__$root.find("#splashPageDetails").hide(),this.__detailsExpanded=!1):(e.removeClass("splashPageExpandable"),e.addClass("splashPageCollapsible"),a.safeAttr("aria-expanded","true"),this.__$root.find("#splashPageDetails").show(),this.__detailsExpanded=!0)}}}__onKeyDown(e){void 0!==$afe.jq(e.target).data("id")&&($afe.jq(e.target).hasClass("disabled")||13!==e.which&&32!==e.which||(e.preventDefault(),this.__onClick(e)))}__onRedirectUrl(e){e.Url&&$$WP.Utilities.TryRedirect(makeLink(e.Url))}}}(e.OnDemandTelehealth||(e.OnDemandTelehealth={}))}(e.Scheduling||(e.Scheduling={}))}(e.PatientEngagement||(e.PatientEngagement={}))}(Epic||(Epic={}));;
$$WP.Scheduling.OnDemandTelehealth=$$WP.Scheduling.OnDemandTelehealth||{},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore||{},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildLink=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$BuildLink(e){return'<a tabindex="0" class="'+e.cssClass+'" data-id="'+e.dataId+'" role="link" title="'+e.title+'"aria-label="'+e.title+" "+e.content+'">'+e.content+'<img class="testimage" data-id="'+e.dataId+'" src="'+makeStaticLink("images/edit_pencil.svg")+'" alt="" aria-hidden="true" /></a>'},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode={Initial:0,EditEmail:1,EditPhone:2,TogglePhone:3,CloseEditPhone:4,ToggleEmail:5,CloseEditEmail:6},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$UpdateViewModel(e,t,i,n,a,o,l){var r,d,s,m,h,c,u=t.AppointmentBuilder.ReasonForVisit,S=i.MaxCommentsLength,$=!0,p=!0,g=t.ProxyContextName;return t.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing&&(c=t.TelehealthOrganizations.getFirstInIndex("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected)),n?(r=!1,d=!1,s=!1):(r=!(!c||c.IsLocal)||i.RequireODVVComments,d=i.AllowODVVComments||r,s=r||(t.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing||o)&&!!c),m=new $$WP.FormValidation.ValidationSettings({required:r,maxLength:S,showCharacterCounter:!0}),t.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection&&t.AppointmentBuilder.getFirstAppointment&&(t.TelehealthData.QuickScheduleSlot=t.AppointmentBuilder.getFirstAppointment().Slot),!(h=t.TelehealthData.Provider)&&t.TelehealthData.QuickScheduleSlot&&(h=t.Providers.getFromIndex("ID",t.TelehealthData.QuickScheduleSlot.ProviderId)),e._idPrefix="OnDemandSummaryStep_"+(e.Id||""),l&&($=i.AllowSelfSignup&&l.AdultWorkflowEnabled,p=l.ProxyWorkflowEnabled),{ReasonForVisit:u.Title,Workflow:t.TelehealthData.SelectedWorkflow,Slot:t.TelehealthData.QuickScheduleSlot,Provider:h,DayString:t.TelehealthData.QuickScheduleSlot?t.TelehealthData.QuickScheduleSlot.DateString:"",HasProviderDetailsSecurity:i.HasProviderDetailsSecurity&&!$$WP.Utilities.UI.IsMobile&&!e._isGuest,AllowComments:d,RequireComments:r,ShowRequiredIndicator:s,Comments:e._getComments(),CommentsValidationSettings:m,CommentsInitiallyInvalid:!0,StepShouldBeActive:!0,LoadingClasses:"summarystep jqHidden",SelectedOrg:c,HideNotifications:$$WP.Utilities.UI.IsMobile&&t.TelehealthData.TelehealthNotificationSettings.IsPushNotificationEnabled&&!!c&&c.HasPatientAccess||n||t.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection&&!o,IsAnonymous:n,AllowSelfSignup:$||p,ShowCancelButton:t.TelehealthData.ShowCancelButton,ShowOrganization:!n&&!a,ProxyOnly:p&&!$,IsStandalone:a,PatientName:g,IdPrefix:e._getIDPrefix(),CommentsTextId:e._getID("comments")}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnClick=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$OnClick(e,t,i,n){if(void 0!==$afe.jq(e.target).data("id"))if($afe.jq(e.target).hasClass("disabled")||$afe.jq(e.target).safeAttr("disabled"))e.preventDefault();else if(!i.IsSchedulingCompleting)switch($afe.jq(e.target).data("id").split("-")[0]){case"signup":t._signUp();break;case"continue":t._continue();break;case"provider":case"providerphoto":if(t._workflowSettings.HasProviderDetailsSecurity&&!t._isGuest)if(this._isAnonymous){var a=makeLink("publicforms.asp?mode=provider&widgetmode=1&id="+encodeURIComponent(i.TelehealthData.QuickScheduleSlot.ProviderId));window.open(a,null,"width=1024,height=600,resizable,status,scrollbars").focus()}else{a=$$WP.Utilities.UI.IsMobile?makeLink("app/providers/details?id="+encodeURIComponent(i.TelehealthData.QuickScheduleSlot.ProviderId)+"&isIdEncrypted=1"):makeLink("app/providers/details?id="+encodeURIComponent(i.TelehealthData.QuickScheduleSlot.ProviderId)),window.open(a,null,"width=1024,height=600,resizable,status,scrollbars").focus()}break;case"smsNotificationSelect":t._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditPhone,n.find('[data-id="signup"]').addClass("disabled"),t._renderNotifications(!0);break;case"emailNotificationSelect":t._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditEmail,n.find('[data-id="signup"]').addClass("disabled"),t._renderNotifications(!0);break;case"saveEmail":t._saveEmail(),n.find('[data-id="signup"]').removeClass("disabled");break;case"savePhone":t._savePhone(),n.find('[data-id="signup"]').removeClass("disabled");break;case"cancelPhone":t._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.CloseEditPhone,n.find('[data-id="signup"]').removeClass("disabled"),t._renderNotifications(!0);break;case"cancelEmail":t._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.CloseEditEmail,n.find('[data-id="signup"]').removeClass("disabled"),t._renderNotifications(!0);break;case"cancel":t._onCancel();break;case"startOver":WP.Events.cancelBeforeUnload(),location.reload()}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetID=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$GetID(e,t){return $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetIDPrefix(t)+"_"+e},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetIDPrefix=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$GetIDPrefix(e){return null===e._idPrefix&&(e._idPrefix="OnDemandSummaryStep_"+(e.Id||"")),e._idPrefix},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetComments=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$GetComments(e){var t="",i=e.find('[data-id="comments"]');return i&&(void 0===(t=i.val())||$$WPUtil.IsNullOrEmpty(t))&&(t=""),t},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SignUp=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$SignUp(e,t,i,n){i.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing?($$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ParseNotificationsForSaving(e,t,i),t._enqueuePatient()):(n&&$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ParseNotificationsForSaving(e,t,i),t._scheduleAppointment())},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ParseNotificationsForSaving=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$ParseNotificationsForSaving(e,t,i){i.TelehealthData.ShouldSaveNotifications=!0,i.TelehealthData.NotificationSelection=new $$WP.Scheduling.TelehealthNotificationSelection(e.find("#"+t._getID("smsNotificationCheckbox")).is(":checked"),e.find("#"+t._getID("emailNotificationCheckbox")).is(":checked"),t._notificationOptions.PhoneNumber,t._notificationOptions.EmailAddress)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SaveEmail=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$SaveEmail(e,t){var i=e.find('[data-id="emailEntry"]')[0].value;""===i?t._notificationOptions.CheckEmailOption=!1:i!==t._notificationOptions.EmailAddress&&(t._notificationOptions.CheckEmailOption=!0),t._notificationOptions.EmailAddress=i,t._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.CloseEditEmail,t._renderNotifications(!0)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.SavePhone=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$SavePhone(e,t){for(var i=e.find('[data-id="textEntry"]')[0].value;"#"===i.substring(0,1);)i=i.substring(1);""===i?t._notificationOptions.CheckSMSOption=!1:i!==t._notificationOptions.PhoneNumber&&(t._notificationOptions.CheckSMSOption=!0),t._notificationOptions.PhoneNumber=i,t._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.CloseEditPhone,t._renderNotifications(!0)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.EnqueuePatient=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$EnqueuePatient(e,t,i,n){var a,o,l=i.AppointmentBuilder.ReasonForVisit,r=i.TelehealthLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected),d=!1;if(r&&(a=r.SubLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected)),d=!!n||!!(o=i.TelehealthOrganizations.getFirstInIndex("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected))&&o.IsLocal,l&&r){var s,m="",h=!1;null==t._notificationOptions||$$WPUtil.IsNullOrEmpty(t._notificationOptions.PhoneNumber)||(s=new RegExp("[-. ()]","g"),m=t._notificationOptions.PhoneNumber.replace(s,"")),!d&&i.IsProxy&&(h=!o.HasPatientAccess);var c=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetSourceWorkflowFromUrl(),u={rfvId:l.OnDemandRFV,locationId:r.Id,subLocationId:a?a.Id:"",comments:t._getComments(),sendSMS:!!t._notificationOptions&&t._notificationOptions.CheckSMSOption,sendEmail:!!t._notificationOptions&&t._notificationOptions.CheckEmailOption,phoneNumber:m,emailAddress:t._notificationOptions?t._notificationOptions.EmailAddress:"",shouldSaveNotifications:i.TelehealthData.ShouldSaveNotifications,isLocal:d,flagshipOrgId:d?"":o.OrganizationId,intendedOrgId:d?"":o.ReceivingOrgDxo,sendAsUnverifiedProxy:h,completedInsuranceVerificationStep:!0===i.AppointmentBuilder.CompletedInsuranceVerificationStep,completedDemographicVerificationStep:!0===i.AppointmentBuilder.CompletedDemographicVerificationStep,sourceWorkflow:c,useInsuranceForVisit:i.AppointmentBuilder.UseInsuranceForVisit,lineInWDF40040:l.LineInWDF40040};e.find('[data-id="signup"]').addClass("disabled"),$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ShowOverlay(e,i,n),t._redirectCallbackId=setTimeout($.proxy(t._checkRedirectFromOverlay,t,u.isLocal),5e3),$.post({url:makeLink("TelemedicineHome/EnqueuePatient"),data:JSON.stringify(u),cache:!1,async:!0,success:$.proxy(t._onEnqueued,t,u.isLocal),contentType:"application/json"})}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetSourceWorkflowFromUrl=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$GetSourceWorkflowFromUrl(){var e=new URL(window.location.href).searchParams.get("sourceWorkflow"),t=$$WP.Scheduling.Workflow.getWorkflowTypesEnumName($$WP.Scheduling.Workflow.WorkflowTypesEnum.OnMyWay);return($$WP.Utilities.IsNullOrEmpty(e)||e!==t)&&(e=$$WP.Scheduling.Workflow.getWorkflowTypesEnumName($$WP.Scheduling.Workflow.WorkflowTypesEnum.OnDemandTelehealth)),e},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ScheduleAppointment=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$ScheduleAppointment(e,t,i,n,a){var o,l=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildWorkflowObject(t),r=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildAppointmentBuilderForSlot(i,t._getComments());selectedNotificationOptions=n?{SendSMS:!!t._notificationOptions&&t._notificationOptions.CheckSMSOption,SendEmail:!!t._notificationOptions&&t._notificationOptions.CheckEmailOption,PhoneNumber:t._notificationOptions?t._notificationOptions.PhoneNumber:"",EmailAddress:t._notificationOptions?t._notificationOptions.EmailAddress:"",ShouldSaveNotifications:i.TelehealthData.ShouldSaveNotifications}:{ShouldSaveNotifications:!1};var d=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetSourceWorkflowFromUrl();o={workflow:l.toRawRequestObject(),appointmentBuilder:r.toRawRequestObject(),selectedNotificationOptions:selectedNotificationOptions,sourceWorkflow:d,nonce:$$WPUtil.GetPageNonce()},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ShowOverlay(e,i,a),$.post({url:makeLink("Scheduling/ScheduleAppointment"),data:$$WPUtil.postify(o),cache:!1,success:$.proxy(t._onQuickScheduled,t),error:$.proxy(t._onScheduleError,t)})},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildWorkflowObject=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$BuildWorkflowObject(e){return e._workflow&&e._workflow.DecisionTreeAnswerId?new $$WP.Scheduling.Workflow({Type:$$WP.Scheduling.Workflow.WorkflowTypesEnum.OnDemandTelehealth,DecisionTreeAnswerId:e._workflow.DecisionTreeAnswerId}):new $$WP.Scheduling.Workflow({Type:$$WP.Scheduling.Workflow.WorkflowTypesEnum.OnDemandTelehealth})},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildAppointmentBuilderForSlot=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$BuildAppointmentBuilderForSlot(e,t){var i;i=e.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing?e.AppointmentBuilder.ReasonForVisit.OnDemandSlot:e.TelehealthData.QuickScheduleSlot;var n,a,o=null,l=null,r=e.AppointmentBuilder.ReasonForVisit.OnDemandRFV,d=e.AppointmentBuilder.ReasonForVisit.LineInWDF40040,s=e.TelehealthLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected);s&&(a=s.SubLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected));var m=e.AppointmentBuilder.CompletedInsuranceVerificationStep,h=e.AppointmentBuilder.CompletedDemographicVerificationStep;return o=new $$WP.Scheduling.AppointmentBuilder({ReasonForVisit:new $$WP.Scheduling.ReasonForVisit({Id:e.AppointmentBuilder.ReasonForVisit.LineInWDF15000,CategoryValue:e.AppointmentBuilder.ReasonForVisit.CategoryValue}),OnDemandReasonForVisitValue:r,OnDemandReasonForVisitLine:d,PatientLocation:s,PatientSublocation:a,SchedulingComments:t,UseInsuranceForVisit:e.TelehealthData.UseInsuranceForVisit,CompletedInsuranceVerificationStep:m,CompletedDemographicVerificationStep:h}),l=new $$WP.Scheduling.Appointment({VisitType:new $$WP.Scheduling.VisitType({ID:i.VisitTypeId,AllowedProviderDepartmentPairs:[]})}),n=new $$WP.Scheduling.ProviderDepartmentPair({ProviderId:i.ProviderId,DepartmentId:i.DepartmentId}),l.Slot=i,l.ProviderDepartmentPairs.push(n),o.Appointments.empty(),o.Appointments.add(l),o},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnScheduled=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$OnScheduled(e,t,i,n,a,o,l,r,d,s,m,h,c,u,S,$,p){if(l&&!$$WPUtil.IsNullOrEmpty(l.ErrorCode)||$$WPUtil.IsNullOrEmpty(e)&&$$WPUtil.IsNullOrEmpty(u)&&$$WPUtil.IsNullOrEmpty($))this.handleSchedulingProblems(r,s,d,l,c,e,i,n,S,h,$);else{var g;if($$WPUtil.IsNullOrEmpty(p)||(g=p.OrganizationId),d._csn=e,null!==d._onWorkflowCompleteCallback&&!0===m.IsEmbedded){var f;return f=[{CSN:e,UCI:u,isLocal:i,isOnDemand:t,dxoId:g}],void d._onWorkflowCompleteCallback(f)}WP.Events.cancelBeforeUnload(),u?$$WP.Utilities.TryRedirect(makeLink("Visits/VisitDetails?uci="+encodeURIComponent(u))):i||!$?i&&m.RequireECheckInForTelemedicine&&a?$$WP.Utilities.TryRedirect(makeLink("echeckin?csn="+encodeURIComponent(e))):t?this.handleOnDemandRedirection(d,o,i):d._redirectToVisitDetails("1",i):this.handleXOrgUnverifiedProxyRedirection(r,s,$,S)}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.handleSchedulingProblems=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$handleSchedulingProblems(e,t,i,n,a,o,l,r,d,s,m){var h;$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay(e,t,d),i._changeOverlayText(!1),h=l?$$WP.Strings.get("TelehealthErrorMessage","ondemandtelehealth"):$$WP.Strings.get("TelehealthAnywhereErrorMessage","ondemandtelehealth"),null!==i._redirectCallbackId&&(clearTimeout(i._redirectCallbackId),i._redirectCallbackId=null,i._timerFinished=!1),!n||$$WPUtil.IsNullOrEmpty(n.ErrorCode)?this.createErrorPopup(i,h,null):this.handleSchedulingError(e,t,i,n.ErrorCode,a,h,o,l,r,s,m)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.handleSchedulingError=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$handleSchedulingError(e,t,i,n,a,o,l,r,d,s,m){var h,c=o,u=t.TelehealthOrganizations.getFirstInIndex("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected);switch(n){case"13":return i._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditEmail,i._renderNotifications(!0),$$WP.FormValidation.addValidationError(e.find('[data-id="emailEntry"]'),"InputNotEmail"),void $afe.select('[data-id="signup"]').removeClass("disabled");case"14":return i._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditPhone,i._renderNotifications(!0),$$WP.FormValidation.addValidationError(e.find('[data-id="textEntry"]'),"InputNotPhoneNumber"),void $afe.select('[data-id="signup"]').removeClass("disabled");case"ALREADY-IN-QUEUE":var S=t.IsProxy&&!u.HasPatientAccess;return void this.handleAlreadyInQueue(t,i,c,u,l,d,s,r,S,m);case"ALREADY-IN-QUEUE-VISITS":S=t.IsProxy&&!u.HasPatientAccess;return void this.handleAlreadyInQueueVisits(i,c,u,l,d,S,m);case"NO-WPR-SECURITY":var $;c=$$WP.Strings.get("NoSecurityText","SelfTriage.AddOnDemandVideoVisitNode"),$=a?makeLink(a):makeLink("inside.asp"),h=function(){WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect($)};break;case"UNKNOWN-ERROR":h=function(){WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink("Scheduling/AnonymousTelehealth"))};break;default:s&&(h=function(){WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink("Scheduling/AnonymousTelehealth"))})}this.createErrorPopup(i,c,h)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.handleAlreadyInQueue=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$handleAlreadyInQueue(e,t,i,n,a,o,l,r,d,s){var m;if($$WP.Utilities.IsNullOrEmpty(n))this.createErrorPopup(t,i,m);else{if(l&&!$$WPUtil.IsNullOrEmpty(a)){var h=r,c=n;return $$WPUtil.IsNullOrEmpty(o)||(h=!1,c=o),WP.Events.cancelBeforeUnload(),void $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RedirectToVisitDetails("1",h,a,c)}if(d&&!$$WP.Utilities.IsNullOrEmpty(s)){var u=$$WP.Telemedicine.Helpers.UnverifiedProxyPopupMode.ALREADY_SCHEDULED,S=$$WP.Strings.getForTemplate("XOrgPopupViewDetails","ondemandtelehealth");return WP.Events.cancelBeforeUnload(),void $$WP.Telemedicine.Helpers.unvProxyPopupHelper(s,t.Data.ProxyContextName,n.OrganizationName,u,S,"","inside.asp")}var $=e.TelehealthOrganizations.getFirstInIndex("OrganizationId",o);if(!$$WP.Utilities.IsNullOrEmpty(o)&&$$WP.Utilities.IsNullOrEmpty($))return $$WP.Strings.addMnemonic("@MYCHART@OrganizationName@",n.OrganizationName,null,"ondemandtelehealth"),i=$$WP.Strings.get("AlreadyInQueueUnknownOrg","ondemandtelehealth"),$$WP.Strings.removeMnemonic("@MYCHART@OrganizationName@"),void this.createErrorPopup(t,i,m);var p=$$WP.Utilities.IsNullOrEmpty($)?n.OrganizationName:$.OrganizationName;$$WP.Strings.addMnemonic("@MYCHART@OrganizationName@",p,null,"ondemandtelehealth"),i=$$WP.Strings.get("AlreadyInQueueNoVisits","ondemandtelehealth"),$$WP.Strings.removeMnemonic("@MYCHART@OrganizationName@"),this.createErrorPopup(t,i,m)}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.handleAlreadyInQueueVisits=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$handleAlreadyInQueueVisits(e,t,i,n,a,o,l){var r;if($$WP.Utilities.IsNullOrEmpty(i))this.createErrorPopup(e,t,r);else{var d,s;if(o&&!$$WP.Utilities.IsNullOrEmpty(l))return $$WP.Utilities.UI.IsMobile?(s=$$WP.Strings.getForTemplate("SubjectHasExistingXOrgVideoVisitUnverifiedProxy","Scheduling"),d=$afe.renderTemplate($$WP.Templates.Core.Banner,{BannerType:"informationalType",DetailText:s}),$afe.select("#scheduling-workflow-container").safeReplaceWith(d),WP.Events.cancelBeforeUnload(),void(window.location=l+"&mobile=0")):(WP.Events.cancelBeforeUnload(),void $$WP.Utilities.TryRedirect(makeLink("Visits/visitslist?redirecttoodvv=true")));$$WP.Strings.addMnemonic("@MYCHART@OrganizationName@",i.OrganizationName,null,"ondemandtelehealth"),t=$$WP.Strings.get("AlreadyInQueueVisits","ondemandtelehealth"),$$WP.Strings.removeMnemonic("@MYCHART@OrganizationName@");var m=a||i.OrganizationId;$$WP.Utilities.UI.IsMobile?(t=$$WP.Strings.get("AlreadyInQueueVisitsXOrgUrl","ondemandtelehealth"),r=function(){WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink("Home/LogOut?mode=OnDemandTelehealth&skipCommunityLogout=1&workflowcomplete=1&eCSN="+encodeURIComponent(n)+"&xorgid="+encodeURIComponent(m)))}):r=function(){WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink("Visits/visitslist"))},this.createErrorPopup(e,t,r)}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.createErrorPopup=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$createErrorPopup(e,t,i){var n,a;a=$$WP.Strings.get("DismissErrorPopupButtonText","ondemandtelehealth"),n=new $$WPComp.MessageComponent({TitleText:$$WP.Strings.get("ErrorTitle","ondemandtelehealth"),Message:t,ToolbarButtons:[new $$WPComp.ComplexObjects.Button(a,null,"cancelworkflow","")],callback:i}),$$WPUtil.quickPopup(n),$afe.select('[data-id="joinqueue"]').removeClass("disabled"),0===e._errorCount&&e._loadSlots&&e._loadSlots(),e._errorCount++},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.handleXOrgUnverifiedProxyRedirection=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$handleXOrgUnverifiedProxyRedirection(e,t,i,n){var a;if(a=t.TelehealthOrganizations.getFirstInIndex("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected),$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay(e,t,n),$$WP.Utilities.UI.IsMobile){var o=t.ProxyContextName;$$WP.Strings.addMnemonic("@MYCHART@OrganizationName@",a.OrganizationName,null,"ondemandtelehealth"),$$WP.Strings.addMnemonic("@MYCHART@PatientName@",o,null,"ondemandtelehealth");var l=$afe.renderTemplate($$WP.Templates.Core.Banner,{BannerType:"successType",HeaderText:$$WP.Strings.get("XOrgUnverifiedProxyDoneSchedulingHeader","ondemandtelehealth"),DetailText:$$WP.Strings.get("XOrgUnverifiedProxyDoneSchedulingDetail","ondemandtelehealth")});$$WP.Strings.removeMnemonic("@MYCHART@PatientName@"),$$WP.Strings.removeMnemonic("@MYCHART@OrganizationName@"),$afe.select("#scheduling-workflow-container").safeReplaceWith(l);var r=$afe.select("#scheduling-startover");return r.parents("#hasLinks").removeClass("hasLinks"),r.parent().remove(),i+="&mobile=0",void(window.location=i)}$$WP.Utilities.TryRedirect(makeLink("Visits/visitslist?fromscheduling=true&redirecttoodvv=true"))},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.handleOnDemandRedirection=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$handleOnDemandRedirection(e,t,i){e._timerFinished?t?e._redirectCallbackId=setTimeout($.proxy(e._checkRedirectFromOverlay,e,i),3e3):e._redirectToVisitDetails("0",i):(t&&(null!==e._redirectCallbackId&&clearTimeout(e._redirectCallbackId),e._redirectCallbackId=setTimeout($.proxy(e._checkRedirectFromOverlay,e,i),3e3)),e._timerFinished=!0)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnScheduleError=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$OnScheduleError(e,t,i,n){var a;$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay(e,i,n),t._changeOverlayText(!1),a=new $$WPComp.MessageComponent({TitleText:$$WP.Strings.get("ErrorTitle","ondemandtelehealth"),Message:$$WP.Strings.get("TelehealthSchedulingErrorMessage","ondemandtelehealth"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button("Okay",null,"cancelworkflow","")]}),$$WPUtil.quickPopup(a),$afe.select('[data-id="joinqueue"]').removeClass("disabled"),0===t._errorCount&&t._loadSlots(),t._errorCount++},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetErrorMessage=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$GetErrorMessage(e){return"POOL-EMPTY"===e?$$WP.Strings.get("TelehealthEmptyPoolErrorMessage","ondemandtelehealth"):$$WP.Strings.get("TelehealthErrorMessage","ondemandtelehealth")},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.CheckRedirectFromOverlay=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$CheckRedirectFromOverlay(e,t){t._timerFinished?t._redirectToVisitDetails("0",e):t._timerFinished=!0},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RedirectToVisitDetails=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$RedirectToVisitDetails(e,t,i,n){$$WP.Utilities.UI.IsMobile?t?$$WP.Utilities.TryRedirect(makeLink("Home/LogOut?mode=OnDemandTelehealth&skipCommunityLogout=1&workflowcomplete=1&eCSN="+encodeURIComponent(i))):$$WP.Utilities.TryRedirect(makeLink("Home/LogOut?mode=OnDemandTelehealth&skipCommunityLogout=1&workflowcomplete=1&eCSN="+encodeURIComponent(i)+"&xorgid="+encodeURIComponent(n))):t?$$WP.Utilities.TryRedirect(makeLink("Visits/VisitDetails?csn="+encodeURIComponent(i)+"&scheduled="+e)):$$WP.Utilities.TryRedirect(makeLink("Visits/visitslist?xorgcsn="+encodeURIComponent(i))+"&xorgid="+encodeURIComponent(n))},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ChangeOverlayText=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$ChangeOverlayText(e,t,i,n){var a=$$WP.Strings.get("LoadingMessage","Scheduling");e&&(a=n.RequireECheckInForTelemedicine&&t?n.MultiPhaseECheckInOn?$$WP.Strings.get("OnDemandLoadingMessageWithEcheckinTasks","ondemandtelehealth"):$$WP.Strings.containsGlobalMnemonic("BrandECheckIn")?$$WP.Strings.get("OnDemandLoadingMessageWithEcheckin","ondemandtelehealth"):$$WP.Strings.get("OnDemandLoadingMessageWithEcheckinNoMnemonic","ondemandtelehealth"):$$WP.Strings.get("OnDemandLoadingMessageNoEcheckin","ondemandtelehealth")),i.find('[data-id="loadingmessage"]').text(a)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.AfterRender=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$AfterRender(e,t,i,n){$$WP.FormValidation.initializeDOMSubtree(e),t._renderNotifications(t._autoFocus),setTimeout($.proxy((function(){$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay(e,i,n)}),t),500),$afe.select(".content").trigger("resize"),e.find("h2.header").focus()},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.RenderNotifications=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$RenderNotifications(e,t,i,n,a){var o,l,r,d,s,m,h=n.TelehealthOrganizations.getFirstInIndex("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected);if((i.ViewModel.Workflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing||a)&&h){if(s=a?$$WP.Strings.get("TelehealthNotificationsGuestProxyPretext","ondemandtelehealth"):$$WP.Strings.get("TelehealthNotificationsPretext","ondemandtelehealth"),o={NotificationGroup:new $$WP.FormValidation.ValidationGroup({}),ShowEmailOption:i._notificationOptions.ShowEmailOption,ShowSMSOption:i._notificationOptions.ShowSMSOption,CheckEmailOption:i._notificationOptions.CheckEmailOption,CheckSMSOption:i._notificationOptions.CheckSMSOption,EmailAddress:i._notificationOptions.EmailAddress,PhoneNumber:i._notificationOptions.PhoneNumber,CallToAction:i._notificationOptions.CallToAction,TermsLink:i._notificationOptions.TermsLink,PrivacyLink:i._notificationOptions.PrivacyLink,HasTermsLink:!!i._notificationOptions.TermsLink,HasPrivacyLink:!!i._notificationOptions.PrivacyLink,ViewMode:i._viewMode,IsEmailEmpty:$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.IsNullOrEmpty(i._notificationOptions.EmailAddress),IsPhoneEmpty:$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.IsNullOrEmpty(i._notificationOptions.PhoneNumber),IdPrefix:i._getIDPrefix(),HasGuestNotifications:a,Pretext:s,NoEmailMessage:$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildLink({cssClass:"notificationSelect",dataId:"emailNotificationSelect",title:$$WP.Strings.get("TelehealthEditEmailTooltip","ondemandtelehealth"),content:$$WP.Strings.get("TelehealthNotificationsNoEmail","ondemandtelehealth")}),NoPhoneMessage:$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildLink({cssClass:"notificationSelect",dataId:"smsNotificationSelect",title:$$WP.Strings.get("TelehealthEditPhoneTooltip","ondemandtelehealth"),content:$$WP.Strings.get("TelehealthNotificationsNoPhone","ondemandtelehealth")}),TextEditLink:$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildLink({cssClass:"notificationSelect",dataId:"smsNotificationSelect",title:$$WP.Strings.get("TelehealthEditPhoneTooltip","ondemandtelehealth"),content:i._notificationOptions.PhoneNumber}),EmailEditLink:$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.BuildLink({cssClass:"notificationSelect",dataId:"emailNotificationSelect",title:$$WP.Strings.get("TelehealthEditEmailTooltip","ondemandtelehealth"),content:i._notificationOptions.EmailAddress}),Validation:{Required:new $$WP.FormValidation.ValidationSettings({atLeastOneChecked:!0}),Email:new $$WP.FormValidation.ValidationSettings({isEmail:!0,required:!1}),Phone:new $$WP.FormValidation.ValidationSettings({required:!1})}},i.ViewModel.HideNotifications)return;l=$afe.renderTemplate($$WP.Templates.Scheduling.OnDemandTelehealth.NotificationStep,o),t.find(".notificationContainer > :first-child").safeReplaceWith(l),t.find(".button.confirmNotifications.completeworkflow"),r=!(o.CheckSMSOption&&!o.IsPhoneEmpty||o.CheckEmailOption&&!o.IsEmailEmpty),d=i._viewMode===$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditEmail||i._viewMode===$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditPhone,r&&!d?$$WP.FormValidation.addValidationError(t.find(".fakeValidation > input").first()):d||((m=t.find(".summaryinfo")).removeAttr("data-invalid"),$$WP.FormValidation.checkIfFormIsValid(m,!0))}t.find("fieldset.notificationStep input").on("change",i._onChange),e&&!i.ViewModel.HideNotifications&&$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.FocusInputElement(t,i._viewMode)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.FocusInputElement=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$FocusInputElement(e,t){var i,n,a=!1;switch(t){case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditEmail:i=e.find('input[data-id="emailEntry"]'),a=!0;break;case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.EditPhone:i=e.find('input[data-id="textEntry"]'),a=!0;break;case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.Initial:i=e.find("textarea"),a=!0;break;case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.TogglePhone:i=e.find('input[data-id="smsToggle"]');break;case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.ToggleEmail:i=e.find('input[data-id="emailToggle"]');break;case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.CloseEditPhone:i=e.find('a[data-id="smsNotificationSelect"]');break;case $$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.CloseEditEmail:i=e.find('a[data-id="emailNotificationSelect"]')}i&&i.length>0&&(i.focus(),n=i.val().length,a&&i.get(0).setSelectionRange(n,n))},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.IsNullOrEmpty=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$IsNullOrEmpty(e){return!(e&&e.length>0)},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.GetNotificationOptions=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$GetNotificationOptions(e,t){e._notificationOptions={ShowEmailOption:t.TelehealthData.TelehealthNotificationSettings.ShowEmailOption,ShowSMSOption:t.TelehealthData.TelehealthNotificationSettings.ShowSMSOption,CheckEmailOption:t.TelehealthData.TelehealthNotificationSettings.CheckEmailOption,CheckSMSOption:t.TelehealthData.TelehealthNotificationSettings.CheckSMSOption,EmailAddress:t.TelehealthData.TelehealthNotificationSettings.EmailAddress,PhoneNumber:t.TelehealthData.TelehealthNotificationSettings.PhoneNumber,CallToAction:t.TelehealthData.TelehealthNotificationSettings.CallToAction,TermsLink:t.TelehealthData.TelehealthNotificationSettings.TermsLink,PrivacyLink:t.TelehealthData.TelehealthNotificationSettings.PrivacyLink}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnChange=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$OnChange(e,t,i){e.target.id!==i._getID("smsNotificationCheckbox")&&e.target.id!==i._getID("emailNotificationCheckbox")||(i._notificationOptions.CheckEmailOption=t.find("#"+i._getID("emailNotificationCheckbox")).is(":checked"),i._notificationOptions.CheckSMSOption=t.find("#"+i._getID("smsNotificationCheckbox")).is(":checked"),e.target.id===i._getID("smsNotificationCheckbox")?i._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.TogglePhone:i._viewMode=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ViewMode.ToggleEmail,i._renderNotifications(!0))},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ResetFocus=function WWP$Scheduling$OnDemandTelehealth$SummaryStepCore$ResetFocus(e,t){switch(e){case"smsNotificationLabel":case"emailNotificationLabel":t.find('[data-id="'+e+'"]').focus();break;case"textEntry":case"cancelPhone":case"savePhone":t.find('[data-id="smsNotificationSelect"]').focus();break;case"emailEntry":case"cancelEmail":case"saveEmail":t.find('[data-id="emailNotificationSelect"]').focus()}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.OnKeyDown=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$OnKeyDown(e,t,i){var n;if(void 0!==$afe.jq(e.target).data("id")&&!$afe.jq(e.target).hasClass("disabled"))switch(n=$afe.jq(e.target).data("id").split("-")[0]){case"comments":return;case"textEntry":if(13!==e.which)return;e.preventDefault(),i._savePhone(),i._resetFocus(n);break;case"emailEntry":if(13!==e.which||t.find('[data-id="saveEmail"]').safeAttr("disabled"))return;e.preventDefault(),i._saveEmail(),i._resetFocus(n);break;case"smsNotificationLabel":13!==e.which&&32!==e.which||(t.find("#"+i._getID("smsNotificationCheckbox")).click(),i._resetFocus(n));break;case"emailNotificationLabel":13!==e.which&&32!==e.which||(t.find("#"+i._getID("emailNotificationCheckbox")).click(),i._resetFocus(n));break;case"signup":case"redirectToLogin":case"selfSignup":case"emailNotificationSelect":case"smsNotificationSelect":case"cancelEmail":case"cancelPhone":case"saveEmail":case"savePhone":case"startOver":case"cancel":13!==e.which&&32!==e.which||(e.preventDefault(),i._onClick(e),i._resetFocus(n))}},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.ShowOverlay=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$ShowOverlay(e,t,i){t.IsSchedulingCompleting=!0,e.find(".telehealthLoadingOverlay.summarystep").show(),i?$$WPUtil.ShowAjaxSpinner($afe.select(":not(.telehealthLoadingOverlay, .rfvLoadingHeart) > .ajaxspinner.defaultajaxoverlay")):$$WPUtil.ShowAjaxSpinner(e.find(".telehealthLoadingOverlay.summarystep .ajaxspinner"))},$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.HideOverlay=function WP$Scheduling$OnDemandTelehealth$SummaryStepCore$HideOverlay(e,t,i){t.IsSchedulingCompleting=!1,e.find(".telehealthLoadingOverlay.summarystep").hide(),i?$$WPUtil.HideAjaxSpinner($afe.select(":not(.telehealthLoadingOverlay, .rfvLoadingHeart) > .ajaxspinner.defaultajaxoverlay")):$$WPUtil.HideAjaxSpinner(e.find(".telehealthLoadingOverlay.summarystep .ajaxspinner"))},$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$$WP$Scheduling$OnDemandTelehealth$SummaryStep(e){var t,i,n,a,o,l,r,d,s;t=$$WP.Debug.UnitTest.assert,i=$$WP.Debug.UnitTest.assertValue,(n={})._idPrefix="",n.Id="testId",n._getComments=function(){return"comments"},n._getIDPrefix=function(){return this._idPrefix},n._getID=function(e){return this._idPrefix+e},(a={}).Title="title",(o={}).ReasonForVisit=a,(l=new $$WP.Scheduling.TelehealthData).SelectedWorkflow=$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection,l.QuickScheduleSlot={},l.QuickScheduleSlot.DateString="Monday",l.Provider="testProvider",l.TelehealthNotificationSettings={},l.TelehealthNotificationSettings.IsPushNotificationEnabled=!1,l.ShowCancelButton=!0,r=$$WP.Scheduling.TelehealthOrganization.createTelehealthOrganizationCollection(),$$WP.Scheduling.TelehealthOrganization.convertRawTelehealthOrganizations([{OrganizationId:"1"}],r),r.Models[0].setProperty("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected),r.Models[0].setProperty("IsLocal",!0),(d={}).AppointmentBuilder=o,d.TelehealthOrganizations=r,d.TelehealthData=l,(s={}).MaxCommentsLength=500,s.RequireODVVComments=!1,s.AllowODVVComments=!0,s.AllowSelfSignup=!0,s.HasProviderDetailsSecurity=!1;var m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!1,!1,!1,null);i(m.ReasonForVisit,"title","Incorrect title for summary step view model"),i(m.Workflow,$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection,"Incorrect workflow for summary step view model scheduling"),t(null!=m.Slot&&null!=m.Slot,"Slot not found for summary step view model"),i(m.Provider,"testProvider","Incorrect provider for summary step view model"),i(m.DayString,"Monday","Day string not set for summary step view model"),i(m.HasProviderDetailsSecurity,!1,"Provider details security not correct for summary step view model"),t(m.AllowComments,"Comments incorrectly disallowed for summary step view model"),i(m.RequireComments,!1,"Comments incorrectly required for summary step view model"),i(m.ShowRequiredIndicator,!1,"Not showing indicates required value div"),i(m.Comments,"comments","Comments set incorrectly for summary step view model"),i(m.CommentsValidationSettings.required,!1,"Comment validation settings incorrectly required for summary step view model"),i(m.CommentsValidationSettings.maxLength,500,"Comment validation settings have incorrect length for summary step view model"),t(m.CommentsValidationSettings.showCharacterCounter,"Comment validation settings have incorrect character counter setting for summary step view model"),t(m.HideNotifications,"Notifications incorrectly shown for summary step view model scheduling"),i(m.IsAnonymous,!1,"IsAnonymous incorrectly set for summary step view model"),t(m.ShowCancelButton,"Cancel button incorrectly hidden for summary step view model"),t(m.ShowOrganization,"Organization incorrectly hidden for summary step view model"),i(m.IdPrefix,"OnDemandSummaryStep_testId","Id prefix incorrect for summary step view model"),i(m.CommentsTextId,"OnDemandSummaryStep_testIdcomments","Comments element ID incorrectly set for summary step view model"),l.SelectedWorkflow=$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing,i((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!1,!1,!1,null)).Workflow,$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing,"Incorrect workflow for summary step view model queueing"),i(m.HideNotifications,!1,"Notifications incorrectly shown for summary step view model queueing"),i(m.SelectedOrg.OrganizationId,"1","Can't read organization properly for summary step view model"),anonymousSettings={AdultWorkflowEnabled:!0,ProxyWorkflowEnabled:!0},t((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!0,!1,!1,anonymousSettings)).HideNotifications,"Notifications incorrectly shown for anonymous summary step view model"),t(m.AllowSelfSignup,"AllowSelfSignup incorrectly set for anonymous summary step view model with adult and proxy enabled"),i(m.ProxyOnly,!1,"ProxyOnly incorrectly set for anonymous summary step view model with adult and proxy enabled"),t(m.IsAnonymous,"IsAnonymous incorrectly set for anonymous summary step view model"),i(m.ShowOrganization,!1,"Organization incorrectly shown for anonymous summary step view model"),i(m.AllowComments,!1,"Comments incorrectly allowed for anonymous summary step view model"),s.AllowSelfSignup=!1,t((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!0,!1,!1,anonymousSettings)).AllowSelfSignup,"AllowSelfSignup incorrectly set for anonymous summary step view model with adult and proxy enabled, self signup disabled"),t(m.ProxyOnly,"ProxyOnly incorrectly set for anonymous summary step view model with adult and proxy enabled, self signup disabled"),anonymousSettings.AdultWorkflowEnabled=!0,anonymousSettings.ProxyWorkflowEnabled=!1,i((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!0,!1,!1,anonymousSettings)).AllowSelfSignup,!1,"AllowSelfSignup incorrectly set for anonymous summary step view model with adult only, self signup disabled"),i(m.ProxyOnly,!1,"ProxyOnly incorrectly set for anonymous summary step view model with adult only, self signup disabled"),s.AllowSelfSignup=!0,anonymousSettings.AdultWorkflowEnabled=!1,anonymousSettings.ProxyWorkflowEnabled=!0,t((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!0,!1,!1,anonymousSettings)).AllowSelfSignup,"AllowSelfSignup incorrectly set for anonymous summary step view model with proxy only"),t(m.ProxyOnly,"ProxyOnly incorrectly set for anonymous summary step view model with proxy only"),i((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!1,!0,!1)).IsAnonymous,!1),i(m.ShowOrganization,!1,"Organization incorrectly shown for not-yet-patient postlogin summary step view model"),i(m.HideNotifications,!1,"Notifications incorrectly hidden for not-yet-patient postlogin summary step view model queueing"),l.SelectedWorkflow=$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection,t((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!1,!0,!1)).HideNotifications,"Notifications incorrectly shown for not-yet-patient postlogin summary step view model scheduling"),i((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!1,!0,!0)).IsAnonymous,!1),i(m.ShowOrganization,!1,"Organization incorrectly shown for not-yet-proxy postlogin summary step view model"),i(m.HideNotifications,!1,"Notifications incorrectly hidden for not-yet-proxy postlogin summary step view model scheduling"),l.SelectedWorkflow=$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing,i((m=$$WP.Scheduling.OnDemandTelehealth.SummaryStepCore.UpdateViewModel(n,d,s,!1,!0,!0)).HideNotifications,!1,"Notifications incorrectly hidden for not-yet-proxy postlogin summary step view model queueing")}));;
var Epic;!function(e){!function(e){!function(e){!function(e){e.SplashPageViewModel=class SplashPageViewModel{};e.AnonymousTelehealthHelpers=class AnonymousTelehealthHelpers{static GetTelehealthSplashPageViewModel(e,a){const t=a.outsideBusinessHours?!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageOffHoursPretext","ondemandtelehealth")):!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPagePretext","ondemandtelehealth")),l=a.outsideBusinessHours?!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageOffHoursPosttext","ondemandtelehealth")):!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPagePosttext","ondemandtelehealth")),n=a.outsideBusinessHours&&(!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageOffHoursMessage","ondemandtelehealth"))||!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageOffHoursDetails","ondemandtelehealth"))),r=!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageHardwareTitle","ondemandtelehealth"))||!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageHardwareDetails","ondemandtelehealth")),s=!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPagePaymentTitle","ondemandtelehealth"))||!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPagePaymentDetails","ondemandtelehealth")),u=a.adultWorkflowEnabled&&(!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageAccountTitle","ondemandtelehealth"))||!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageAccountDetails","ondemandtelehealth"))),i=!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageCustomRequirementTitle","ondemandtelehealth"))||!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageCustomRequirementDetails","ondemandtelehealth"))||!$$WP.Utilities.IsNullOrEmpty($$WP.Strings.get("SplashPageCustomRequirementImage","ondemandtelehealth"));let o=0,d="";return r&&o++,s&&o++,u&&o++,i&&(o++,d=$$WP.Strings.get("SplashPageCustomRequirementImage","ondemandtelehealth"),$$WP.Utilities.IsNullOrEmpty(d)||"http://"!==d.substr(0,7)&&"https://"!==d.substr(0,8)&&(d=makeStaticImageLink(d))),{MinimumAge:e.MinimumAge,LogoUrl:e.LogoUrl,HasPretext:t,HasPosttext:l,HasOutsideBusinessHoursWarning:n,ColType:o>0?12/o:0,HasHardwareRequirement:r,HasPaymentRequirement:s,HasAccountRequirement:u,HasCustomRequirement:i,CustomRequirementImage:d,CustomRequirementHeader:$$WP.Strings.get("SplashPageCustomRequirementTitle","ondemandtelehealth"),CustomRequirementText:$$WP.Strings.get("SplashPageCustomRequirementDetails","ondemandtelehealth"),OutsideBusinessHours:a.outsideBusinessHours,AdultWorkflowEnabled:a.adultWorkflowEnabled,ProxyWorkflowEnabled:a.proxyWorkflowEnabled,Expanded:a.expandByDefault||a.outsideBusinessHours,DisableScheduleAsGuest:a.disableScheduleAsGuest}}}}(e.OnDemandTelehealth||(e.OnDemandTelehealth={}))}(e.Scheduling||(e.Scheduling={}))}(e.PatientEngagement||(e.PatientEngagement={}))}(Epic||(Epic={})),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$Telehealth$SplashPageController(e){const a=$$WP.Debug.UnitTest.assertValue;let t=new Epic.PatientEngagement.Scheduling.AnonymousSchedulingSettings,l=new Epic.PatientEngagement.Scheduling.AnonymousSchedulingControllerParameters;const n=Epic.PatientEngagement.Scheduling.OnDemandTelehealth.AnonymousTelehealthHelpers,r=$$WP.Strings.getNamespace("ondemandtelehealth");t.MinimumAge=12,l.adultWorkflowEnabled=!0,l.proxyWorkflowEnabled=!0,l.outsideBusinessHours=!1,l.expandByDefault=!1;let s=n.GetTelehealthSplashPageViewModel(t,l);a(s.AdultWorkflowEnabled,!0,"Adult workflow incorrectly disabled when adult and proxy are on"),a(s.ProxyWorkflowEnabled,!0,"Proxy workflow incorrectly disabled when adult and proxy are on"),a(s.OutsideBusinessHours,!1,"Outside business hourse incorrectly set when adult and proxy are on"),a(s.Expanded,!1,"Expanded incorrectly set when adult and proxy are on"),a(s.HasAccountRequirement,!0,"Account requirement not set when adult and proxy are on"),l.adultWorkflowEnabled=!0,l.proxyWorkflowEnabled=!1,l.outsideBusinessHours=!1,l.expandByDefault=!1,s=n.GetTelehealthSplashPageViewModel(t,l),a(s.AdultWorkflowEnabled,!0,"Adult workflow incorrectly disabled when adult only"),a(s.ProxyWorkflowEnabled,!1,"Proxy workflow incorrectly enabled when adult only"),a(s.OutsideBusinessHours,!1,"Outside business hourse incorrectly set when adult only"),a(s.Expanded,!1,"Expanded incorrectly set when adult only"),a(s.HasAccountRequirement,!0,"Account requirement not set when adult only"),l.adultWorkflowEnabled=!1,l.proxyWorkflowEnabled=!0,l.outsideBusinessHours=!1,l.expandByDefault=!1,s=n.GetTelehealthSplashPageViewModel(t,l),a(s.AdultWorkflowEnabled,!1,"Adult workflow incorrectly disabled when proxy only"),a(s.ProxyWorkflowEnabled,!0,"Proxy workflow incorrectly enabled when proxy only"),a(s.OutsideBusinessHours,!1,"Outside business hourse incorrectly set when proxy only"),a(s.Expanded,!1,"Expanded incorrectly set when proxy only"),a(s.HasAccountRequirement,!1,"Account requirement set when proxy only"),l.adultWorkflowEnabled=!0,l.proxyWorkflowEnabled=!0,l.outsideBusinessHours=!0,l.expandByDefault=!1,s=n.GetTelehealthSplashPageViewModel(t,l),a(s.AdultWorkflowEnabled,!0,"Adult workflow incorrectly disabled when outside business hours"),a(s.ProxyWorkflowEnabled,!0,"Proxy workflow incorrectly disabled when outside business hours"),a(s.OutsideBusinessHours,!0,"Outside business hourse incorrectly set when outside business hours"),a(s.Expanded,!0,"Expanded incorrectly set when outside business hours"),l.adultWorkflowEnabled=!0,l.proxyWorkflowEnabled=!0,l.outsideBusinessHours=!1,l.expandByDefault=!0,s=n.GetTelehealthSplashPageViewModel(t,l),a(s.AdultWorkflowEnabled,!0,"Adult workflow incorrectly disabled when expanded by default"),a(s.ProxyWorkflowEnabled,!0,"Proxy workflow incorrectly disabled when expanded by default"),a(s.OutsideBusinessHours,!1,"Outside business hours workflow incorrectly set when expanded by default"),a(s.Expanded,!0,"Expanded incorrectly set when expanded by default"),l.adultWorkflowEnabled=!0,l.proxyWorkflowEnabled=!0,l.outsideBusinessHours=!1,l.expandByDefault=!1;const u=$$WP.Strings.get("SplashPageHardwareTitle","ondemandtelehealth"),i=$$WP.Strings.get("SplashPageHardwareDetails","ondemandtelehealth"),o=$$WP.Strings.get("SplashPagePaymentTitle","ondemandtelehealth"),d=$$WP.Strings.get("SplashPagePaymentDetails","ondemandtelehealth"),h=$$WP.Strings.get("SplashPageAccountTitle","ondemandtelehealth"),m=$$WP.Strings.get("SplashPageAccountDetails","ondemandtelehealth"),c=$$WP.Strings.get("SplashPageCustomRequirementTitle","ondemandtelehealth"),p=$$WP.Strings.get("SplashPageCustomRequirementDetails","ondemandtelehealth"),g=$$WP.Strings.get("SplashPageCustomRequirementImage","ondemandtelehealth");r.SplashPageHardwareTitle.value="a",r.SplashPageHardwareDetails.value="a",r.SplashPagePaymentTitle.value="a",r.SplashPagePaymentDetails.value="a",r.SplashPageAccountTitle.value="a",r.SplashPageAccountDetails.value="a",r.SplashPageCustomRequirementTitle.value="",r.SplashPageCustomRequirementDetails.value="",r.SplashPageCustomRequirementImage.value="",r.SplashPageHardwareTitle.value="",r.SplashPageHardwareDetails.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,6,"Incorrect col type when hardware requirement card disabled"),a(s.HasHardwareRequirement,!1,"Hardware requirement not hidden when hardware requirement card disabled"),r.SplashPageHardwareTitle.value="a",r.SplashPageHardwareDetails.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when hardware requirement card enabled"),a(s.HasHardwareRequirement,!0,"Hardware requirement hidden when hardware requirement card enabled"),r.SplashPageHardwareTitle.value="",r.SplashPageHardwareDetails.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when hardware requirement card enabled"),a(s.HasHardwareRequirement,!0,"Hardware requirement hidden when hardware requirement card enabled"),r.SplashPageHardwareTitle.value="a",r.SplashPageHardwareDetails.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when hardware requirement card enabled"),a(s.HasHardwareRequirement,!0,"Hardware requirement hidden when hardware requirement card enabled"),r.SplashPagePaymentTitle.value="",r.SplashPagePaymentDetails.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,6,"Incorrect col type when payment requirement card disabled"),a(s.HasPaymentRequirement,!1,"Payment requirement not hidden when payment requirement card disabled"),r.SplashPagePaymentTitle.value="a",r.SplashPagePaymentDetails.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when payment requirement card enabled"),a(s.HasPaymentRequirement,!0,"Payment requirement hidden when payment requirement card enabled"),r.SplashPagePaymentTitle.value="",r.SplashPagePaymentDetails.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when payment requirement card enabled"),a(s.HasPaymentRequirement,!0,"Payment requirement hidden when payment requirement card enabled"),r.SplashPagePaymentTitle.value="a",r.SplashPagePaymentDetails.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when payment requirement card enabled"),a(s.HasPaymentRequirement,!0,"Payment requirement hidden when payment requirement card enabled"),r.SplashPageAccountTitle.value="",r.SplashPageAccountDetails.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,6,"Incorrect col type when account requirement card disabled"),a(s.HasAccountRequirement,!1,"Account requirement not hidden when account requirement card disabled"),r.SplashPageAccountTitle.value="a",r.SplashPageAccountDetails.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when account requirement card enabled"),a(s.HasAccountRequirement,!0,"Account requirement hidden when account requirement card enabled"),r.SplashPageAccountTitle.value="",r.SplashPageAccountDetails.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when account requirement card enabled"),a(s.HasAccountRequirement,!0,"Account requirement hidden when account requirement card enabled"),r.SplashPageAccountTitle.value="a",r.SplashPageAccountDetails.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when account requirement card enabled"),a(s.HasAccountRequirement,!0,"Account requirement hidden when account requirement card enabled"),r.SplashPageCustomRequirementTitle.value="",r.SplashPageCustomRequirementDetails.value="",r.SplashPageCustomRequirementImage.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,4,"Incorrect col type when custom requirement card disabled"),a(s.HasCustomRequirement,!1,"Custom requirement not hidden when custom requirement card disabled"),r.SplashPageCustomRequirementTitle.value="a",r.SplashPageCustomRequirementDetails.value="",r.SplashPageCustomRequirementImage.value="",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,3,"Incorrect col type when custom requirement card enabled"),a(s.HasCustomRequirement,!0,"Custom requirement hidden when custom requirement card enabled"),r.SplashPageCustomRequirementTitle.value="",r.SplashPageCustomRequirementDetails.value="",r.SplashPageCustomRequirementImage.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,3,"Incorrect col type when custom requirement card enabled"),a(s.HasCustomRequirement,!0,"Custom requirement hidden when custom requirement card enabled"),r.SplashPageCustomRequirementTitle.value="",r.SplashPageCustomRequirementDetails.value="",r.SplashPageCustomRequirementImage.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,3,"Incorrect col type when custom requirement card enabled"),a(s.HasCustomRequirement,!0,"Custom requirement hidden when custom requirement card enabled"),r.SplashPageCustomRequirementTitle.value="a",r.SplashPageCustomRequirementDetails.value="a",r.SplashPageCustomRequirementImage.value="a",s=n.GetTelehealthSplashPageViewModel(t,l),a(s.ColType,3,"Incorrect col type when custom requirement card enabled"),a(s.HasCustomRequirement,!0,"Custom requirement hidden when custom requirement card enabled"),r.SplashPageHardwareTitle.value=u,r.SplashPageHardwareDetails.value=i,r.SplashPagePaymentTitle.value=o,r.SplashPagePaymentDetails.value=d,r.SplashPageAccountTitle.value=h,r.SplashPageAccountDetails.value=m,r.SplashPageCustomRequirementTitle.value=c,r.SplashPageCustomRequirementDetails.value=p,r.SplashPageCustomRequirementImage.value=g}));;
!function WP$Scheduling$ProviderStepController$definition(){var e=$$WP.Scheduling.Provider,t=$$WP.Scheduling.SchedulingSelectableViewBinder,i=$$WP.Scheduling.Workflow,r=$$WP.Scheduling.OriginalAppointmentInfoController,o=function WP$Scheduling$ProviderStepController(i,r,o,n,d,h,a,p,c){this.WP$Scheduling$SingleAppointmentStepController(i,r,o,n,d,$$WP.Templates.Scheduling.ProviderStep,$$WP.Templates.Scheduling.ProviderStepCollapsed,!1,c),this.proxify("_onProviderAdded","_onProviderRemoved","_onAncillaryDataChanged","_onViewModelChanged","updateStep","__onChangeProviderClicked","__isProviderNotAnyOption","__isProviderNotAnyOrOtherOption","__onProviderSelectionToggled"),this._providersToUse=a||l.Standard,this._mode=h||s.NoFiltering,this._workflow=p,this._onStopSchedulingCallback=c,this._allowedProviderIds=o,p.IsFavorite&&(this.__isFromFavorite=!0,this.__isFirstTimeThroughFromPreselections=!0),this._preselectedProviders=[],this._mode===s.NoFiltering&&this.Data.Providers.addCollectionEventListener("add",this._onAncillaryDataChanged),this.setViewBinder(new t(this.__viewStatePropertyName,e.StatesEnum.Selected,e.StatesEnum.Unselected)),this.Data.Providers.addMonitoredProperty(this.__viewStatePropertyName),this.linkAppointment(this.Data.AppointmentBuilder.getFirstAppointment()),this.$root.on("click","[data-id='editstep']",this.__onChangeProviderClicked),this.$root.on("change","input[type='radio']",this.__onProviderSelectionToggled),this._autoFocus=$$WP.Utilities.UI.IsMobile||this._mode===s.Request||this._mode===s.FilterOnSelectedReasonForVisitAndLocation,this.__originalAppointmentInfo=d.OriginalAppointmentInfo},n={_mode:null,_providersToUse:null,_onStopSchedulingCallback:null,_preselectedProviders:null,__isFromFavorite:!1,__isStepCollapsed:!1,__isStepCollapsing:!1,__$spacer:null,__isFirstTimeThroughFromPreselections:!1,__preselectedProviderNotAvailable:!1,__originalAppointmentInfo:null,__attachAppointmentListeners:function WP$Scheduling$ProviderStepController$__attachAppointmentListeners(e,t){switch(t.addCollectionPropertyListener(this.Data.Providers,this.__viewStatePropertyName,this._onViewModelChanged),this._mode){case s.Request:case s.FilterOnSelectedReasonForVisitAndLocation:t.addModelPropertyListener(this.Data.AppointmentBuilder,"ReasonForVisit",this._onAncillaryDataChanged)}t.addCollectionEventListener(e.Lqfs,"add",this._onAncillaryDataChanged),t.addCollectionEventListener(e.Lqfs,"remove",this._onAncillaryDataChanged),t.addCollectionEventListener(e.Providers,"add",this._onProviderAdded),t.addCollectionEventListener(e.Providers,"remove",this._onProviderRemoved),this._mode!==s.FilterOnSelectedReasonForVisitAndLocation&&this._mode!==s.FilterOnSelectedLocation||(t.addCollectionEventListener(e.Locations,"add",this._onAncillaryDataChanged),t.addCollectionEventListener(e.Locations,"remove",this._onAncillaryDataChanged)),t.addModelPropertyListener(this.Data.AppointmentBuilder,"DidIncludeAdditionalProvidersInSearch",this._onAncillaryDataChanged)},updateViewModel:function WP$Scheduling$ProviderStepController$updateViewModel(){var e,t,r;this.ViewModel={},this.WP$Scheduling$SingleAppointmentStepController$updateViewModel(),this.__syncUIElements(),e=this.__getViewModelAvailableProviders(),t=this.__shouldIncludeAnyOption(e)&&this._workflow.Type===i.WorkflowTypesEnum.Procedure,this.__preselectedProviderNotAvailable=this.hasPreselectedIds()&&0===this._preselectedProviders.length,r=$$WPSchedulingUtil.GetVisitDisplayName(this._appointment,this._workflow.TicketInfo),this.ViewModel.Providers=e,this.ViewModel.SelectedProviders=this._appointment.Providers.toArray(),this.ViewModel.ShowOptionsToggle=t,this.ViewModel.IsAnyProviderSelected=this._appointment.IsProviderAnyOptionSelected,this.ViewModel.Count=e.length,this.ViewModel.StepShouldBeActive=!0,this.ViewModel.ShowSmallCard=e.length>11,this.ViewModel.PreselectedProviderNotAvailable=this.__preselectedProviderNotAvailable,this.ViewModel.IsFromFavorite=this.__isFromFavorite,this.ViewModel.VisitType=this._appointment.VisitType,this.ViewModel.OtherProvider=this.__getOtherProvider(),this.ViewModel.MultiSelectable=this.__isStepMultiselect(),this.ViewModel.AppointmentDisplayName=r,this.ViewModel.ShowOriginalAppts=!!this.__originalAppointmentInfo,this.ViewModel.IsProviderSelectEnabled=this._allowProviderSelect(),this.ViewModel.ModelId=this._appointment.ModelId},__getViewModelAvailableProviders:function WP$Scheduling$ProviderStepController$__getViewModelAvailableProviders(){var e=[],t=null;return e=this._getAvailableProviders(),this.__shouldIncludeAnyOption(e)&&(t=this.Data.Providers.getFromIndex("ID","-2"),e.push(t)),this._setViewModelSelectedStates(e),e=e.sort($$WP.Scheduling.Provider.sortProvidersByListDisplayName)},__getAvailableProvidersCountWithoutOtherOption:function WP$Scheduling$ProviderStepController$__getAvailableProvidersCountWithoutOtherOption(){var e=this.__getViewModelAvailableProviders().length;return this.__getOtherProvider()&&(e-=1),e},__getOtherProvider:function WP$Scheduling$ProviderStepController$__getOtherProvider(){var e,t=0,i=(e=this._getAvailableProviders()).length;for(t=0;t<i;t++)if(e[t].OtherOption)return e[t];return null},arePrerequisitesComplete:function WP$Scheduling$ProviderStepController$arePrerequisitesComplete(){var e=this.Data.AppointmentBuilder.ReasonForVisit,t=this._appointment.Locations.toArray();return this._mode===s.NoFiltering||this._mode!==s.FilterOnSelectedReasonForVisitAndLocation&&null!==e||this._mode===s.FilterOnSelectedReasonForVisitAndLocation&&t.length>0&&null!==e||this._mode===s.FilterOnSelectedLocation&&t.length>0},_setViewModelSelectedStates:function WP$Scheduling$ProviderStepController$_setViewModelSelectedStates(t){var i,r,o,n;for(r=this._appointment.Providers,o=this._appointment.IsProviderAnyOptionSelected,i=0;i<t.length;i++)n=t[i],o&&!n.OtherOption||!o&&r.contains(n)?n[this.__viewStatePropertyName]=e.StatesEnum.Selected:n[this.__viewStatePropertyName]=e.StatesEnum.Unselected},beforeFirstRender:function WP$Scheduling$ProviderStepController$beforeFirstRender(){this.__shouldAttemptToPreselectProvidersBeforeFirstRenderOrReset()&&this.__preselectProviders()},__preselectProviders:function WP$Scheduling$ProviderStepController$__preselectProviders(){var e,t;t=this.ViewModel.Providers,0===(e=this.getModelsToPreSelect(t,"ID")).length&&this.stepSettings.PreselectAllModels&&(t.length>1&&(this._appointment.IsProviderAnyOptionSelected=!0),e=t.filter(this.__isProviderNotAnyOrOtherOption)),e.length>0?(this.stepSettings.Hide=this.__getStepSettingsHideValue(this.stepSettings),this.__isFirstTimeThroughFromPreselections=!0,this._preselectedProviders=e,this._appointment.Providers.addRange(e),this.updateStep()):this.__shouldIncludeAnyOption(t)&&(this.__setAnyProviderSelected(this._appointment),this.updateStep())},__isProviderNotAnyOption:function WP$Scheduling$ProviderStepController$__isProviderNotAnyOption(e){return!e.AnyOption},__isProviderNotOtherOption:function WP$Scheduling$ProviderStepController$__isProviderNotOtherOption(e){return!e.OtherOption},__isProviderNotAnyOrOtherOption:function WP$Scheduling$ProviderStepController$__isProviderNotAnyOrOtherOption(e){return this.__isProviderNotAnyOption(e)&&this.__isProviderNotOtherOption(e)},__getStepSettingsHideValue:function WP$Scheduling$ProviderStepController$__getStepSettingsHideValue(e){return e.Hide||!this._allowProviderSelect()||this.__doesSelectedVisitTypeHideStep()},__doesSelectedVisitTypeHideStep:function __doesSelectedVisitTypeHideStep(){return this._workflow.Type===i.WorkflowTypesEnum.Procedure&&this._appointment.VisitType&&!this._appointment.VisitType.AllowProviderStepInDirectSched},__shouldAttemptToPreselectProvidersBeforeFirstRenderOrReset:function WP$Scheduling$ProviderStepController$__shouldAttemptToPreselectProvidersBeforeFirstRenderOrReset(){var e=this.ViewModel.Providers;return!(1===e.length&&this.hasPreselectedIds()&&!this.isModelPreselected(e[0].ID))&&(!(this._appointment.Providers.size()>0)&&!(0==this._appointment.Providers.size()&&this.Data.AppointmentBuilder.AreProvidersFilteredBySlotStep))},beforeRender:function WP$Scheduling$ProviderStepController$beforeRender(){this.stepSettings.Hide=this.__getStepSettingsHideValue(this.stepSettings),this.renderCollapsed=this.__isStepCollapsed,this._appointment.Providers.Models.length<1&&this.__autoSelectProvidersIfHidden(),this.Data.AppointmentBuilder.HasResetProviders&&this.hasPreselectedIds()&&this.__shouldAttemptToPreselectProvidersBeforeFirstRenderOrReset()?(this.__preselectProviders(),this.Data.AppointmentBuilder.setProperty("HasResetProviders",!1)):this.Data.AppointmentBuilder.HasResetProviders&&this.Data.AppointmentBuilder.setProperty("HasResetProviders",!1),this._workflow&&this._workflow.Type===i.WorkflowTypesEnum.Reschedule&&0!==this.$root.find("#OriginalAppointmentInfo").length&&r.StashPortal()},__shouldPreselectAllowedProvider:function WP$Scheduling$ProviderStepController$__shouldPreselectAllowedProvider(){var e;return e=this._getAvailableProviders().map((function(e){return e.ID})),$$WPSchedulingProvidersCore.IsSingleAllowedProviderStillElligibleForScheduling(e,this._allowedProviderIds)&&this._workflow.isTypeOpenSchedulingWidget()&&this._allowProviderSelect()&&!this.Data.AppointmentBuilder.DidIncludeAdditionalProvidersInSearch},__autoSelectProvidersIfHidden:function WP$Scheduling$ProviderStepController$__autoSelectProvidersIfHidden(){var e="",t=this._getAvailableProviders(),i=this.getModelsToPreSelect(t,"ID"),r=this._appointment.VisitType&&this._appointment.VisitType.HasAlreadyLoadedTieredData;(this.isHidden()||this.__doesSelectedVisitTypeHideStep())&&(r&&this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired),this.__shouldPreselectAllowedProvider()&&(e=this.Data.Providers.getFromIndex("ID",this._allowedProviderIds[0]),i.push(e)),!this.hasPreselectedIds()||this.hasPreselectedIds()&&!this._appointment.hasAProviderSelected()?i.length>0&&!this._appointment.IsUsingTieredData?(this.__selectProviders(i),this._preselectedProviders=i):(this._appointment.IsProviderAnyOptionSelected=!0,this.__selectProviders(t)):this.Data.AppointmentBuilder.DidIncludeAdditionalProvidersInSearch&&(this._appointment.IsProviderAnyOptionSelected=!0,this.__selectProviders(t)),!this._appointment.hasAProviderSelected()&&t.length>0&&this.showError())},__selectProviders:function WP$Scheduling$ProviderStepController$__selectProviders(e){var t=[],i=0;if(e&&1===e.length&&e[0].OtherOption)t.push(e[0]);else for(i=0;i<e.length;i++)e[i].OtherOption||e[i].AnyOption||this._appointment.Providers.contains(e[i])||-1!==t.indexOf(e[i])||t.push(e[i]);this._appointment.Providers.addRange(t)},afterRender:function WP$Scheduling$ProviderStepController$afterRender(){$$WPSchedulingUtil.HandleStickyBanner(),$$WPSchedulingUtil.FocusElement(this.$root.find("h2.header")),this.__isStepCollapsing&&($$WPSchedulingUtil.ScrollToTopOfPage(),this.__collapseSpacer()),this._workflow&&this._workflow.Type===i.WorkflowTypesEnum.Reschedule&&this.ViewModel.IsFirstOnPage&&r.Update(this.Data,$afe.select("#ProviderStepOriginalAppointmentInfo"))},__isStepMultiselect:function WP$Scheduling$StepController$__isStepMultiselect(){return this.__getAvailableProvidersCountWithoutOtherOption()>1&&!(this.__isStacked()&&this.__isIncomplete())},__makeStyleAutoAdvance:function WP$Scheduling$StepController$__makeStyleAutoAdvance(){var e=this.$root.find(".providerlist"),t=e.find(".card");e.removeClass("multiselect"),e.addClass("autoadvance"),t.removeAttr("role")},_getViewEventSubmodule:function WP$Scheduling$StepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.ProviderStep},__initializeSpacer:function WP$Scheduling$ProviderStepController$__initializeSpacer(){this.__$spacer=$afe.jq(document.createElement("div"));var e=this.$root.find(".providerlist").height();this.__$spacer.height(e),this.__isStepCollapsing=!0},__collapseSpacer:function WP$Scheduling$ProviderStepController$__collapseSpacer(){this.$root.append(this.__$spacer),this.__$spacer.slideUp(500,(function(){$$WPSchedulingUtil.HandleStickyBanner(),this.__isStepCollapsed=!0,this.__isStepCollapsing=!1}))},__onChangeProviderClicked:function WP$Scheduling$ProviderStepController$__onChangeProviderClicked(){this.__isStepCollapsed=!1,this.updateStep()},__onProviderSelectionToggled:function WP$Scheduling$ProviderStepController$__onProviderSelectionToggled(){"1"===event.target.value?(this.$root.find(".specificProviderSelection").fadeOut("fast"),setTimeout(function(){this.__setAnyProviderSelected(this._appointment)}.bind(this),200)):(this.__setAnyProviderUnselected(this._appointment,!0),this.$root.find(".specificProviderSelection").fadeIn(500))},_onViewModelChanged:function WP$Scheduling$ProviderStepController$_onViewModelChanged(t){var i,r;for(r in this._appointment.Providers.openChangeBatch(),this._appointment.IsProviderAnyOptionSelected&&this._appointment.Providers.size()!==this._getAvailableProviders().length&&this.__setAnyProviderSelected(this._appointment),t)if((i=t[r].model).AnyOption)t[r].to===e.StatesEnum.Selected?this.__setAnyProviderSelected(this._appointment):this.__setAnyProviderUnselected(this._appointment,!0);else switch(this._appointment.IsProviderAnyOptionSelected&&this.__setAnyProviderUnselected(this._appointment,!1),t[r].to){case e.StatesEnum.Selected:i.IsManuallyDeselected=!1,this._appointment.Providers.add(i);break;case e.StatesEnum.Unselected:i.IsManuallyDeselected=!0,this._appointment.Providers.remove(i)}this._appointment.Providers.closeChangeBatch(),this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider&&this.__setOriginallySelectedProviders()},__setOriginallySelectedProviders:function WP$Scheduling$ProviderStepController$__setOriginallySelectedProviders(){var e,t,i=this.Data.AppointmentBuilder.getFirstAppointment().Providers.toArray().slice(),r=[],o=$$WP.Scheduling.SingleAppointmentStepController.prototype.filterByAllowedIds.call(this,this.Data.Providers.toArray(),"ID",!1);for(e=0;e<i.length;e++)(t=i[e]).IsStandardProvider&&-1!==o.indexOf(t)&&r.push(i[e]);r.length>0&&(this.Data.AppointmentBuilder.OriginallySelectedProviders=r)},__setAnyProviderSelected:function WP$Scheduling$ProviderStepController$__setAnyProviderSelected(t){var i=0,r=[],o=null;for(t.IsProviderAnyOptionSelected=!0,i=0;i<this.ViewModel.Providers.length;i++)(o=this.ViewModel.Providers[i]).AnyOption?o[this.__viewStatePropertyName]=e.StatesEnum.Selected:(o[this.__viewStatePropertyName]=e.StatesEnum.Selected,o.IsManuallyDeselected=!1,o.OtherOption?o[this.__viewStatePropertyName]=e.StatesEnum.Unselected:r.push(o));t.Providers.empty(),t.Providers.addRange(r)},__setAnyProviderUnselected:function WP$Scheduling$ProviderStepController$__setAnyProviderUnselected(t,i){var r=0,o=null,n=[];for(t.IsProviderAnyOptionSelected=!1,r=0;r<this.ViewModel.Providers.length;r++)((o=this.ViewModel.Providers[r]).AnyOption||i)&&(o[this.__viewStatePropertyName]=e.StatesEnum.Unselected,o.IsManuallyDeselected=!0,n.push(o));t.Providers.removeRange(n)},_onAncillaryDataChanged:function WP$Scheduling$ProviderStepController$__onAncillaryDataChanged(){var e,t,i,r,o;if(this.__isAppointmentIncludedInBuilder()){for(r=[],t=this._getAvailableProviders(),i=this._appointment.Providers.toArray(),e=0;e<i.length;e++)o=i[e],-1===t.indexOf(o)&&r.push(o);this._appointment.Providers.removeRange(r),(r.length>0||this.__getAvailableProvidersCountWithoutOtherOption()!==i.length||!this.__shouldIncludeAnyOption(t))&&(this._appointment.IsProviderAnyOptionSelected=!1),this.__autoSelectProvidersIfHidden(),this.Data.SchedulingSteps.getFromIndex("ID",this.Id).IsHidden=this.isHidden()||!this._allowProviderSelect(),this.updateStep()}},__isAppointmentIncludedInBuilder:function WP$Scheduling$ProviderStepController$__isAppointmentIncludedInBuilder(){return this.Data.AppointmentBuilder.Appointments.contains(this._appointment)},__removeProviderArray:function WP$Scheduling$ProviderStepController$__removeProviderArray(e,t){return e.filter((function(e){return!d(t,e.ID)}))},_onProviderAdded:function WP$Scheduling$ProviderStepController$_onProviderAdded(){var e,t,i,r;e=(t=this._appointment.Providers.toArray())[t.length-1],i=this._canMultiselectProviders(),e&&(this._appointment.Providers.openChangeBatch(),e.OtherOption?i=!1:this.__deselectOtherProvider(),!i&&t.length>1&&(this._appointment.Providers.empty(),this._appointment.Providers.add(e)),this._appointment.Providers.closeChangeBatch()),r=this.__isStepCollapsed,this._updateStepStatus(),r||this.__isStepCollapsed?this.updateStep():this.__syncUIElements()},__deselectOtherProvider:function WP$Scheduling$ProviderStepController$__deselectOtherProvider(){var e=this.Data.Providers.getFromIndex("ID",-1);this._appointment.Providers.remove(e)},_onProviderRemoved:function WP$Scheduling$ProviderStepController$_onProviderRemoved(){this._updateStepStatus(),this.__syncUIElements()},__syncUIElements:function WP$Scheduling$ProviderStepController$__syncUIElements(){this.ViewBinder.syncModelsToDOM(),this.setCurrentSelectionCountInBanner(),$$WPSchedulingUtil.HandleStickyBanner()},_updateStepStatus:function WP$Scheduling$ProviderStepController$_updateStepStatus(){if(this._appointment.Providers.size()>0||this.Data.AppointmentBuilder.AreProvidersFilteredBySlotStep){var e=this.__isIncomplete(),t=this.isStepMarkedAsHidden()?$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired:$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete;this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.setComplete(t),this.__isStacked()&&e&&(this.__isStepCollapsed=!0,this.__initializeSpacer())}else this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.__isStepCollapsed=!1,this.__isStacked()&&this.__makeStyleAutoAdvance()},__isIncomplete:function WP$Scheduling$ProviderStepController$__isIncomplete(){return this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete},_allowProviderSelect:function WP$Scheduling$ProviderStepController$_allowProviderSelect(){return this._mode===s.NoFiltering||i.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,this._appointment)},_canMultiselectProviders:function WP$Scheduling$ProviderStepController$_canMultiselectProviders(){return this._mode!==s.Request},_getAvailableProviders:function WP$Scheduling$ProviderStepController$_getAvailableProviders(){var e=[],t=!1,i=!1,r=!1,o=!1;if(this.arePrerequisitesComplete())if(this._mode===s.NoFiltering)e=this._buildProvidersNoFiltering();else{switch(this._mode){case s.Request:t=!0,i=!1,r=!0,o=!0;break;case s.FilterOnSelectedLocation:t=!1,i=!0,r=!1,o=!1;break;case s.FilterOnSelectedReasonForVisitAndLocation:t=!0,i=!0,r=!1,o=!0}e=this.__buildProvidersFiltered(t,i,r,o)}return this._appointment.VisitType&&!this._appointment.IsUsingTieredData&&(e=this.__removeProviderArray(e,this._appointment.VisitType.TieredProvidersCollection.toArray())),e=this.filterByAllowedIds(e,"ID")},filterByAllowedIds:function WP$Scheduling$ProviderStepController$filterByAllowedIds(e,t,i){var r,o=[],n=[];return e?(r=e.filter((function(e){return e.LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Added})),this._workflow.isTypeOpenSchedulingWidget()&&$$WPSchedulingProvidersCore.IsProviderSpecifiedInQueryString(this._workflow)&&(o=e),n=(n=(n=$$WP.Scheduling.SingleAppointmentStepController.prototype.filterByAllowedIds.call(this,e,t,i)).concat(r)).concat(o),n=$$WPSchedulingUtil.RemoveDuplicateElementsFromArray(n)):[]},__shouldIncludeAnyOption:function WP$Scheduling$ProviderStepController$__shouldIncludeAnyOption(e){var t,r,o,n,s=this._workflow.Type;if(!!$$WPUtil.IsNullOrEmpty(this.Data.Providers.getFromIndex("ID","-2")))return!1;for(r=this._appointment.VisitType,n=[],o=0;o<e.length;o++)e[o].OtherOption||e[o].AnyOption||n.push(e[o]);return t=n.length>1,s!==i.WorkflowTypesEnum.Request&&((s===i.WorkflowTypesEnum.Ticket||s===i.WorkflowTypesEnum.Reschedule||s===i.WorkflowTypesEnum.NewProvider||!$$WPUtil.IsNullOrEmpty(r)&&r.IsAdvanced||!$$WPUtil.IsNullOrEmpty(r))&&t)},_buildProvidersNoFiltering:function WP$Scheduling$ProviderStepController$_buildProvidersNoFiltering(){var e,t,i=[],r=null,o=null,n=null;if(this._providersToUse===l.All)for(e=0;e<this.Data.Providers.toArray().length;e++)(r=this.Data.Providers.toArray()[e]).AnyOption||i.push(r);else for(o=this.Data.ReasonsForVisit.Models,e=0;e<o.length;e++)for(n=o[e],t=0;t<n.AllProviderDepartmentPairs.length;t++)r=n.AllProviderDepartmentPairs[t].Provider,this.__tryIncludeProvider(r,i);return i},__tryIncludeProvider:function WP$Scheduling$ProviderStepController$__canShowProviderOnLandingPage(e,t){var i=e.LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Added;-1===t.indexOf(e)&&(e.IsStandardProvider||i)&&t.push(e)},__buildProvidersFiltered:function WP$Scheduling$ProviderStepController$__buildProvidersFiltered(e,t,i,r){var o=this._appointment.ReasonForVisit,n=this._appointment.getSelectedDepartmentsCollection().toArray();return $$WPSchedulingUtil.BuildProvidersFiltered(e,t,i,o,n,r)},shouldRemainOnStep:function WP$Scheduling$ProviderStepController$shouldRemainOnStep(){return!!this.ViewModel&&(!this.Data.AppointmentBuilder.IsUsingProviderDropdown&&(!this.__isFirstTimeThroughFromPreselections||this.__isFromFavorite&&0===this._preselectedProviders.length?!(this.ViewModel.SelectedProviders&&this.ViewModel.SelectedProviders.length>0&&this.ViewModel.SelectedProviders[0].OtherOption)&&(1!==this.__getAvailableProvidersCountWithoutOtherOption()&&!this.isHidden()):(this.__isFirstTimeThroughFromPreselections=!1,!1)))},setCurrentSelectionCountInBanner:function WP$Scheduling$ProviderStepController$setCurrentSelectionCountInBanner(){var e,t=this.getSchedulingContinueBanner().find(".selected-count");this.Active&&this.ViewModel&&this.$root.is(":visible")&&!this.stepSettings.Hide&&(e=this.__getCurrentSelectionCountString(),t.text(e))},__getCurrentSelectionCountString:function WP$SchedulingProviderStepController$__getCurrentSelectionCountString(){var e=this.Data.AppointmentBuilder.getAppointment(0),t=this._appointment.Providers.toArray().length,i=this.__getAvailableProvidersCountWithoutOtherOption(),r="";return 0===t||i<2||this.__isStacked()||e.IsProviderAnyOptionSelected?r="":1===t?r=this.SchedulingStringsNamespace.getString("ProvidersSelectedCount_Singular"):(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@PROVIDERSCOUNT@",t,$$WP.Strings.EncodingTypes.HTML),r=this.SchedulingStringsNamespace.getString("ProvidersSelectedCount_Plural"),this.SchedulingStringsNamespace.clearMnemonics()),r},hasStickyBanner:function WP$Scheduling$ProviderStepController$hasStickyBanner(){return!0},isStepMarkedAsHidden:function WP$Scheduling$StepController$isStepMarkedAsHidden(){var e,t=this.Data.SchedulingSteps.getFromIndex("ID",this.Id);return""!==t.StackId&&(e=this.Data.SchedulingSteps.getFromIndex("ID",t.StackId)),!(this._allowProviderSelect()&&e&&e.ForceShowOnce)&&((0!=this._appointment.Providers.size()||!this.Data.AppointmentBuilder.AreProvidersFilteredBySlotStep)&&this.WP$Scheduling$StepController$isStepMarkedAsHidden())}},s={NoFiltering:0,Request:2,FilterOnSelectedReasonForVisitAndLocation:3,FilterOnSelectedLocation:4},l={Standard:0,All:1},d=function WP$Scheduling$ProviderStepController$s_isProviderInList(e,t){var i=0;for(i=0;i<e.length;i++)if(e[i].ID===t)return!0;return!1};o.prototype=n,o.ModesEnum=s,o.ProvidersToUseEnum=l,$$WP.Scheduling.ProviderStepController=o,o.extend($$WP.Scheduling.SingleAppointmentStepController,"WP$Scheduling$ProviderStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$ProviderStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$LocationStepController$definition(){var e=$$WP.Scheduling.Location,t=$$WP.Scheduling.SchedulingSelectableViewBinder,i=$$WP.Scheduling.ReasonForVisitDepartmentOverride,o=$$WP.Geo.Coordinates,n=$$WP.Geo.Coordinates.Helpers,r=$$WP.Scheduling.OriginalAppointmentInfoController,s=function WP$Scheduling$LocationStepController(i,o,n,r,s,l,c,d,h,_,p,u){this.WP$Scheduling$SingleAppointmentStepController(i,n,r,s,l,$$WP.Templates.Scheduling.LocationStep,$$WP.Templates.Scheduling.LocationStepCollapsed,!1,h),this.proxify("_onViewModelChanged","updateStep","_onSelectProviderClicked","_onProviderSelected","_onAncillaryDataChanged","_onRFVchanged","_onLocationAdded","_onLocationRemoved","_onGeolocationChanged","__anyDepartmentHasInPersonVTOverride","__onGetBrowserCoordinatesSuccess","__onGetBrowserCoordinatesFailure","__onZipEntered","__onZipInputFocused","__setFocusInZipInput","__onShowNearBrowserClicked","__onShowNearHomeClicked","__onShowAllLocationsClicked","__onGetZipSuccess","__onGetZipFailure","__filterByGeolocation","__onChangeLocationClicked","__anyAppointmentHasLocationStepTelehealthOverride","__onUserEnteredZipCoordinatesChanged","__setAvailableProvidersDisplayString","__filterNearHomeIfGeolocationEnabled","__checkInvalidLocations"),this._mode=c||a.FilterOnSelectedReasonForVisitAndProviders,this.__locationGroupingBehavior=d,this._fromFavorite=_,this.__isFirstTimeThroughFromPreselections=_,this._preselectedLocations=[],this._workflow=o,this.setViewBinder(new t(this.__viewStatePropertyName,e.StatesEnum.Selected,e.StatesEnum.Unselected)),this.Data.Locations.addMonitoredProperty(this.__viewStatePropertyName),this._registerHandlebarsHelpers(),this.__geolocationSettings=p,$$WPSchedulingUtil.CheckIfGeolocationPermissionsAreDenied(this.__onGetBrowserCoordinatesFailure),this.linkAppointment(this.Data.AppointmentBuilder.getFirstAppointment()),this.__carouselController=new $$WP.UI.ChipCarouselController($$WP.Templates.Scheduling.GeolocationToggle),$$WPUtil.FixScrollingForIOS(this.$root),this.$root.on("click","[data-id='editstep']",this.__onChangeLocationClicked),this.__originalAppointmentInfo=u},l={_mode:null,_preselectedLocations:null,_fromFavorite:!1,__locationGroupingBehavior:null,__coordinatesOfUserEnteredZip:null,__coordinatesOfBrowser:null,__isGeolocationEnabled:!1,__geolocationSettings:null,__geolocationErrorMessage:null,__hasBrowserDeniedGeoSecurity:!1,__carouselController:null,__previousGeolocationMethod:null,__isFirstTimeThroughFromPreselections:!1,__isStepCollapsed:!1,__isStepCollapsing:!1,__$spacer:null,__hasCollapsedBefore:!1,__telehealthTypeString:"None",__$preRedrawFocusedElement:null,__originalAppointmentInfo:null,__shouldGroupByLocation:!1,updateViewModel:function WP$Scheduling$LocationStepController$updateViewModel(){var e,t,i,o;this.__isGeolocationEnabled=this.__shouldEnableGeolocationAndResetMethodIfNot(),t=this._isCheckboxAndNotArrow(),e=this._getAvailableLocations(),this.Data.AppointmentBuilder.AvailableLocations=this._getAvailableLocationsByAppointment(),this.Data.AppointmentBuilder.recalculateDepartmentGrouperAddresses(this.Data.AppointmentBuilder.ReasonForVisit),this._shouldIncludeAnyOption(e)&&(i=this.Data.Locations.getFromIndex("Id","-1"),this.__includeLocationInFilter(i),e.push(i)),this.__isFilteringByGeolocation()||this.Data.AppointmentBuilder.IsLoadingTieredData||this.__includeEachLocationInFilter(e),this.__sortLocations(e,null),this._setViewModelSelectedStates(e),this.ViewModel={},this.WP$Scheduling$SingleAppointmentStepController$updateViewModel(!0),o=$$WPSchedulingUtil.GetVisitDisplayName(this._appointment,this._workflow.TicketInfo),this.__registerClearLabelDisplayNameFunction(o);var n={Locations:e,Count:e.length,SelectedLocations:this._appointment.Locations.toArray(),StepShouldBeActive:!0,MultiSelectable:t,ShowSmallCards:e.length>11,AvailableProviders:this._getAvailableProvidersForLocationStep(),ProviderDropdownValidationSettings:$$WP.FormValidation.ValidationSettings.Required,FavoritedLocationNotAvailable:this._fromFavorite&&0===this._preselectedLocations.length,ZipCodeSearchValue:this.Data.AppointmentBuilder.UserEnteredZip,HasInvalidZipCodeError:this.__hasInvalidZipCodeError(),HasDeclinedGeoSecurity:this.__hasBrowserDeniedGeoSecurity,HasHomeCoordinates:this.__doesAnyAvailableLocationHaveDistanceFromHome(),ShouldSeparateLocationsByGeolocation:this.__isGeolocationEnabled&&this.__isAtLeastOneLocationFilteredOut(e),ShouldShowDistanceOnCard:null===this.__geolocationErrorMessage||!this.__isFilteringNearZip(),GeolocationError:this.__getGeolocationError(),ShouldShowStreetAddress:this.__isFilteringNearHome()&&this.__geolocationSettings.GeolocationStreetAddress.length>0,VisitType:this._appointment.VisitType,isShown:!this.isHidden()&&this.__isNeeded(),hasCollapsedBefore:this.__hasCollapsedBefore,isNotTelehealthCollapsed:!this.isCollapsedToShowTelehealth()||this._appointment.VisitType.ShowLocationStepForTelehealthVisit,IsVideoVisit:this.__isVideoVisit(),IsTelephoneVisit:this.__isTelephoneVisit(),TelehealthLocationWarningBannerViewModel:this.__getTelehealthLocationWarningViewModel(),ShouldShowLocationStepBanner:this.__anyAppointmentHasLocationStepTelehealthOverride()&&!this.__anyDepartmentHasInPersonVTOverride(),AppointmentDisplayName:o,ShowOriginalAppts:!!this.__originalAppointmentInfo};$.extend(this.ViewModel,n)},__attachAppointmentListeners:function WP$Scheduling$ProviderStepController$__attachAppointmentListeners(e,t){t.addCollectionPropertyListener(this.Data.Locations,this.__viewStatePropertyName,this._onViewModelChanged),t.addCollectionEventListener(e.Locations,"add",this._onLocationAdded,e),t.addCollectionEventListener(e.Locations,"remove",this._onLocationRemoved,e),this.__stepShouldListenForProviderChanges()?(t.addCollectionEventListener(e.Providers,"add",this._onAncillaryDataChanged,e),t.addCollectionEventListener(e.Providers,"remove",this._onAncillaryDataChanged,e)):(t.addCollectionEventListener(e.Providers,"add",this.__checkInvalidLocations,e),t.addCollectionEventListener(e.Providers,"remove",this.__checkInvalidLocations,e)),t.addModelPropertyListener(this.Data.AppointmentBuilder,"Specialty",this._onAncillaryDataChanged),t.addModelPropertyListener(this.Data.AppointmentBuilder,"ReasonForVisit",this._onRFVchanged),t.addModelPropertyListener(this.Data.AppointmentBuilder,"GeolocationFilterMethod",this._onGeolocationChanged),t.addModelPropertyListener(e,"SelectedTelehealthMode",this._onAncillaryDataChanged),t.addModelPropertyListener(this.Data.AppointmentBuilder,"UserEnteredZipCoordinates",this.__onUserEnteredZipCoordinatesChanged)},arePrerequisitesComplete:function WP$Scheduling$LocationStepController$arePrerequisitesComplete(){var e=this.Data.AppointmentBuilder.ReasonForVisit,t=this.Data.AppointmentBuilder.allAppointmentsHaveAProviderSelected(),i=this.Data.AppointmentBuilder.allAppointmentsHaveAVisitTypeSpecified();switch(this._mode){case a.FilterOnSelectedReasonForVisit:return!!e&&i;case a.FilterOnSelectedProviders:return t;case a.FilterOnSelectedReasonForVisitAndProviders:return!!e&&t&&i;case a.FilterOnSelectedSpecialtyAndReasonForVisit:return!!e&&i&&null!==this.Data.AppointmentBuilder.Specialty;case a.Request:return!!e&&t;default:return!1}},_setViewModelSelectedStates:function WP$Scheduling$LocationStepController$_setViewModelSelectedStates(t){var i,o,n,r,s;if(null!==t){for(s=(r=this.hasMultipleLinkedAppointments()?this.Data.AppointmentBuilder.getFirstAppointment():this._appointment).IsLocationAnyOptionSelected,o=r.Locations.toArray(),i=0;i<t.length;i++)n=t[i],s&&n.IsAnyOption||-1!==o.indexOf(n)?n[this.__viewStatePropertyName]=e.StatesEnum.Selected:n[this.__viewStatePropertyName]=e.StatesEnum.Unselected;r.IsOnlyLocationAnyOptionSelected=this.__isOnlyAnyLocationAndAllFilteredLocationsSelected()}},beforeFirstRender:function WP$Scheduling$LocationStepController$beforeFirstRender(){this.__preselectLocations(),this.__setDistanceToHomeOnEachLocation(),this.renderCollapsed=this.__isStepCollapsed||this.isCollapsedForSingleLocation()||this.isCollapsedToShowTelehealth(),this.__filterNearHomeIfGeolocationEnabled(),$$WPSchedulingUtil.RegisterConfirmationPartials()},isCollapsedToShowTelehealth:function WP$Scheduling$LocationStepController$isCollapsedToShowTelehealth(){return!this.__isHiddenBasedOnInPersonStatus()&&this.__isNonInPersonVisitTypeSelected()},isCollapsedForSingleLocation:function WP$Scheduling$LocationStepController$isCollapsedForSingleLocation(){return 1===this._getAvailableLocations().length&&this.__currentAppointmentAssociationStatus()===h.MultiApptToMultiSelector},__preselectLocations:function WP$Scheduling$LocationStepController$__preselectLocations(){var e,t=this._getAssociatedAppointments();for(e=0;e<t.length;e++)this.__shouldAttemptToPreselectLocationsBeforeFirstRenderOrReset(t[e])&&this.__preselectAllAvailableLocationsForAppointment(t[e])},__shouldAttemptToPreselectLocationsBeforeFirstRenderOrReset:function WP$Scheduling$LocationStepController$__shouldAttemptToPreselectLocationsBeforeFirstRenderOrReset(e){var t=this.ViewModel.Locations;return!(1===t.length&&this.hasPreselectedIds()&&!this._doesLocationContainAtLeastOnePreselectedDepartmentId(t[0]))&&!e.hasALocationSelected()},_doesLocationContainAtLeastOnePreselectedDepartmentId:function WP$Scheduling$LocationStepController$_doesLocationContainAtLeastOnePreselectedDepartmentId(e){for(var t=0;t<e.Departments.length;t++)if(this.isModelPreselected(e.Departments[t].ID))return!0;return!1},__preselectAllAvailableLocationsForAppointment:function WP$Scheduling$LocationStepController$__preselectAllAvailableLocationsForAppointment(t){var i,o=0,n=0,r=[];for(i=this.ViewModel.Locations,o=0;o<i.length;o++)for(n=0;n<i[o].Departments.length;n++)if(this.preselectedIds[i[o].Departments[n].ID]){r.push(i[o]);break}if(1===i.length&&0===r.length&&r.push(i[0]),0===r.length&&this.stepSettings.PreselectAllModels&&(i.length>1&&this.ViewModel.MultiSelectable?this.__setAnyLocationSelected(t):1===i.length&&r.push(i[0])),r.length>0&&(1===r.length||this.ViewModel.MultiSelectable)){for(this.__isFirstTimeThroughFromPreselections=!0,this._preselectedLocations=r,t.Locations.empty(),t.Locations.addRange(r),o=0;o<r.length;o++)r[o][this.__viewStatePropertyName]=e.StatesEnum.Selected;this.updateStep()}},beforeRender:function WP$Scheduling$LocationStepController$beforeRender(){this.Data.AppointmentBuilder.HasResetLocations&&this.hasPreselectedIds()?(this.__preselectLocations(),this.Data.AppointmentBuilder.setProperty("HasResetLocations",!1)):this.Data.AppointmentBuilder.HasResetLocations&&this.Data.AppointmentBuilder.setProperty("HasResetLocations",!1),this.__autoSelectLocationsIfHidden(),this.renderCollapsed=this.__isRenderCollapsed(),this.__isStepCollapsed&&(this.__hasCollapsedBefore=!0),this.__$preRedrawFocusedElement=$afe.jq(document.activeElement),this._workflow&&this._workflow.Type===Workflow.WorkflowTypesEnum.Reschedule&&0!==this.$root.find("#OriginalAppointmentInfo").length&&r.StashPortal()},__isRenderCollapsed:function WP$Scheduling$LocationStepController$__isRenderCollapsed(){return this.__isStepCollapsed&&!this.__hasCollapsedBefore||this.isCollapsedForSingleLocation()&&!this.__hasCollapsedBefore||this.isCollapsedToShowTelehealth()&&!this.__anyAppointmentHasLocationStepTelehealthOverride()},__autoSelectLocationsIfHidden:function WP$Scheduling$LocationStepController$__autoSelectLocationsIfHidden(){var e,t,i;if(i=this.ViewModel.Locations,this.isHidden()||this.isCollapsedForSingleLocation()&&!this.__hasCollapsedBefore||this.isCollapsedToShowTelehealth()&&!this.__anyAppointmentHasLocationStepTelehealthOverride()){for(t=this._getAssociatedAppointments(),e=0;e<t.length;e++)(!this.hasPreselectedIds()||this.hasPreselectedIds()&&!t[e].hasALocationSelected())&&this.__selectLocationsForAppointment(t[e],i,this._allowMultiselect());for(t=this._getAssociatedAppointments(),e=0;e<t.length;e++)t[e].Locations.toArray().length<1&&this.showError()}},__selectLocationsForAppointment:function WP$Scheduling$LocationStepController$__selectLocationsForAppointment(e,t,i){var o=0,n=null,r=[],s=null;if(null!==t&&0!==t.length)if(i){for(o=0;o<t.length;o++)n=t[o],e.Locations.contains(n)||n.IsAnyOption||r.push(n);e.Locations.addRange(r)}else s=e.Locations.toArray()[0],-1===t.indexOf(s)&&e.Locations.add(t[0])},afterRender:function WP$Scheduling$LocationStepController$afterRender(){var e,t=this.$root.find("#streetAddress"),i=Handlebars.helpers.GetStreetAddressWithLabel();this.__isGeolocationEnabled&&this.ViewModel.IsFirstOnPage&&(this.__carouselController.render(this.$root.find(".geolocationContainer"),this.ViewModel),this.__bindGeolocationElements()),this.__isStepCollapsing&&(this.__collapseSpacer(),this.__hasCollapsedBefore=!0),$$WPSchedulingUtil.HandleStickyBanner(),$$WPSchedulingUtil.FocusElement(this.$root.find("h2.header")),this.$root.find("#providerselect").click(this._onSelectProviderClicked),this.Data.AppointmentBuilder.IsUsingProviderDropdown&&(this.Data.AppointmentBuilder.IsUsingProviderDropdown=!1),(e=this.__$preRedrawFocusedElement.safeAttr("class"))&&e.includes("geolocation")&&$$WPSchedulingUtil.FocusElement(this.$root.find("."+e)),this.__syncUIElements(),this._workflow&&this._workflow.Type===Workflow.WorkflowTypesEnum.Reschedule&&this.ViewModel.IsFirstOnPage&&r.Update(this.Data,$afe.select("#LocationStepOriginalAppointmentInfo")),t.length>0&&setTimeout((function(){$streetAddress=$afe.renderTemplate($$WP.Templates.Scheduling.StreetAddress,i),t.safeAppend($streetAddress)}),100)},_getViewEventSubmodule:function WP$Scheduling$LocationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.LocationStep},_onSelectProviderClicked:function WP$Scheduling$LocationStepController$_onSelectProviderClicked(){this.$root.find(".card.helptip").addClass("expanded"),this.$root.find("#providerSelectButton").click(this._onProviderSelected),$$WPSchedulingUtil.FocusElement(this.$root.find("#locationProviderList")),$$WP.UI.Dropdown.bindOnChange(this.$root.find("#locationProviderList")),$$WP.FormValidation.initializeDOMSubtree(this.$root)},_onProviderSelected:function WP$Scheduling$LocationStepController$_onProviderSelected(){var e,t,i,o="",n=[],r=null,s=!1,l=0,a=null;if(e=this.$root.find(".card.helptip select").val(),!$$WPUtil.IsNullOrEmpty(e)&&(t=this.Data.Providers.getFromIndex("ID",e),!$$WPUtil.IsNullOrEmpty(t)&&!($$WPUtil.IsNullOrEmpty(this.ViewModel.Locations)||this.ViewModel.Locations.length<1))){for(i=this._getAssociatedAppointments(),l=0;l<i.length;l++)(a=i[l]).Locations.empty(),this.Data.AppointmentBuilder.IsUsingProviderDropdown=!0,o=(r=this.Data.AppointmentBuilder.ReasonForVisit)?this._getDepartmentIdsFilterOnSelectedReasonForVisitAndProviders(r,[t],a):this._getDepartmentIdsFilterOnSelectedProviders([t]),s=this._isLocationArrayGrouped(this.ViewModel.Locations),n=this._getLocationsForDepartments(o,s),a.Locations.addRange(n),a.Providers.empty(),a.IsProviderAnyOptionSelected=!1,a.Providers.add(t);this.$root.find(".card.helptip").hide()}},_onViewModelChanged:function WP$Scheduling$LocationStepController$_onViewModelChanged(t){var i=0,o="",n=null,r=null,s=[];for(o in t){if(t[o].to,n=t[o].model,$$WP.Utilities.IsNullOrEmpty(n))break;for(s=this._getAssociatedAppointments(),i=0;i<s.length;i++){if((r=s[i]).Locations.openChangeBatch(),n.IsAnyOption)t[o].to===e.StatesEnum.Selected?this.__setAnyLocationSelected(r):this.__setAnyLocationUnselected(r,!0);else switch(r.IsLocationAnyOptionSelected&&n.IsIncludedByFilter&&this.__setAnyLocationUnselected(r,!1),t[o].to){case e.StatesEnum.Selected:r.Locations.add(n);break;case e.StatesEnum.Unselected:r.Locations.remove(n)}r.Locations.closeChangeBatch()}}},__setAnyLocationSelected:function WP$Scheduling$LocationStepController$__setAnyLocationSelected(t){var i=0,o=[],n=null;for(t.IsLocationAnyOptionSelected=!0,i=0;i<this.ViewModel.Locations.length;i++)(n=this.ViewModel.Locations[i]).IsAnyOption?n[this.__viewStatePropertyName]=e.StatesEnum.Selected:(n.IsIncludedByFilter&&(n[this.__viewStatePropertyName]=e.StatesEnum.Selected),n.OtherOption||n.IsIncludedByFilter&&o.push(n));t.Locations.removeRange(o),t.Locations.addRange(o),this._updateStepStatus()},__setAnyLocationUnselected:function WP$Scheduling$LocationStepController$__setAnyLocationUnselected(t,i){var o=0,n=null,r=[];if(this.ViewModel){for(t.IsLocationAnyOptionSelected=!1,o=0;o<this.ViewModel.Locations.length;o++)((n=this.ViewModel.Locations[o]).IsAnyOption||n.IsIncludedByFilter&&i)&&(n[this.__viewStatePropertyName]=e.StatesEnum.Unselected,r.push(n));t.Locations.removeRange(r)}},__setAnyLocationName:function WP$Scheduling$LocationStepController$__setAnyLocationName(){var e=this.Data.Locations.getFromIndex("Id","-1"),t="",i="";this.__isFilteringByGeolocation()?this.__isFilteringNearBrowser()?(t=this.SchedulingStringsNamespace.getString("AnyLocationNearMeHeader"),i=this.SchedulingStringsNamespace.getString("AnyLocationNearMeDescription")):this.__isFilteringNearHome()?(t=this.SchedulingStringsNamespace.getString("AnyLocationNearHomeHeader"),i=this.SchedulingStringsNamespace.getString("AnyLocationNearHomeDescription")):(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@ZIPCODE@",this.Data.AppointmentBuilder.UserEnteredZip,$$WP.Strings.EncodingTypes.HTML),t=this.SchedulingStringsNamespace.getString("AnyLocationNearZipHeader"),i=this.SchedulingStringsNamespace.getString("AnyLocationNearZipDescription"),this.SchedulingStringsNamespace.clearMnemonics()):(t=this.SchedulingStringsNamespace.getString("AnyLocationHeader"),i=this.SchedulingStringsNamespace.getString("AnyLocationDescription")),e.Name=t,e.Address[0]=i},__stepShouldListenForProviderChanges:function WP$Scheduling$LocationStepController$__stepShouldListenForProviderChanges(){return this._mode===a.FilterOnSelectedProviders||this._mode===a.FilterOnSelectedReasonForVisitAndProviders||this._mode===a.Request},__stepShouldListenForRfvChanges:function WP$Scheduling$LocationStepController$__stepShouldListenForRfvChanges(){return this._mode===a.FilterOnSelectedReasonForVisitAndProviders||this._mode===a.FilterOnSelectedReasonForVisit||this._mode===a.FilterOnSelectedSpecialtyAndReasonForVisit||this._mode===a.Request},__checkInvalidLocations:function WP$Scheduling$LocationStepController$__checkInvalidLocations(){var e=this._allowMultiselect();this.__isGeolocationEnabled=this.__shouldEnableGeolocationAndResetMethodIfNot(),this.__isFilteringByGeolocation()?this.__setDistanceToUserOnEveryLocation():this.__setDistanceToHomeOnEachLocation(),this.__filterByGeolocation(),this._deselectInvalidLocations(e),this.updateViewModel()},_onAncillaryDataChanged:function WP$Scheduling$LocationStepController$_onAncillaryDataChanged(){var e,t=0,i=null,o=this._getAssociatedAppointments();if(e=this._allowMultiselect(),this.updateViewModel(),this._updateStepStatus(),this.updateStep(),this.__isGeolocationEnabled=this.__shouldEnableGeolocationAndResetMethodIfNot(),this._deselectInvalidLocations(e),this.hasMultipleLinkedAppointments()&&!this.__doAllAppointmentsHaveTheSameLocationsSelected())for(t=0;t<o.length;t++)(i=o[t]).IsLocationAnyOptionSelected=!1,i.Locations.empty();null!==this.__getGeolocationFilterMethod()&&this.__isGeolocationEnabled?this.__setGeolocationFilterMethod(this.__getGeolocationFilterMethod(),!0):(this.__clearGeolocationErrorMessage(),this.__clearDistanceToUserOnEveryLocation()),this.__isFilteringByGeolocation()||this.__setDistanceToHomeOnEachLocation()},_onRFVchanged:function WP$Scheduling$LocationStepController$_onRFVchanged(){this._onAncillaryDataChanged(),this.__resetOtherLocationSelection(),this.__filterNearHomeIfGeolocationEnabled()},__resetOtherLocationSelection:function WP$Scheduling$LocationStepController$__resetOtherLocationSelection(){var e=null;this.__isOtherLocationSelected()&&(e=this._appointment.Locations).remove(e.toArray()[0])},_deselectInvalidLocations:function WP$Scheduling$LocationStepController$_deselectInvalidLocations(e){var t=0,i=0,o=[],n=[],r=[],s=null,l=null,a=!1,c=!1,d=!1,h=!1,_=this._getAssociatedAppointments();for(t=0;t<_.length;t++){for(l=_[t],r=[],o=this._getAvailableLocations(),n=l.Locations.toArray(),a=this._isLocationArrayGrouped(o),c=this._isLocationArrayGrouped(n),d=a&&!c,h=!e&&n.length>1,i=0;i<n.length;i++)s=n[i],(-1===o.indexOf(s)||h)&&(d&&this._selectGroupedLocationThatContainsDepartmentIfAvailable(l,s,o),r.push(s));l.Locations.removeRange(r),l.IsLocationAnyOptionSelected&&(r.length>0||this.__isTheAnyLocationInvalid(l,o,n))&&this.__setAnyLocationUnselected(l,!1)}},__isTheAnyLocationInvalid(e,t,i){return!this.__isAllFilteredLocationsSelected()&&!this.__isAtLeastOneLocationFilteredOut(t)||!this._shouldIncludeAnyOption(t)||this.__hasSwitchingToZIPfilteringInvalidatedTheAnyLocation(e)||this.Data.AppointmentBuilder.IsLoadingTieredData&&!this.__shouldSelectTheAnyLocationForTieredScheduling(e)},__hasSwitchingToZIPfilteringInvalidatedTheAnyLocation:function WP$Scheduling$LocationStepController$__hasSwitchingToZIPfilteringInvalidatedTheAnyLocation(e){var t,i,o;if(!this.__isFilteringNearZip())return!1;for(o=e.Locations.toArray(),t=0;t<o.length;t++)if(!(i=o[t]).IsIncludedByFilter&&!i.IsAnyOption)return!0;return!1},_isLocationArrayGrouped:function WP$Scheduling$LocationStepController$_isLocationArrayGrouped(e){var t=0,i=null;for(t=0;t<e.length;t++)if(!(i=e[t]).IsAnyOption&&!i.OtherOption)return!i.IsSingleDepartment;return!1},_selectGroupedLocationThatContainsDepartmentIfAvailable:function WP$Scheduling$LocationStepController$_selectGroupedLocationThatContainsDepartmentIfAvailable(e,t,i){var o,n;t.IsSingleDepartment&&(o=t.DepartmentIds[0],n=this._getLocationsForDepartments(o,!0)[0],-1!==i.indexOf(n)&&e.Locations.add(n))},__doAllAppointmentsHaveTheSameLocationsSelected:function WP$Scheduling$LocationStepController$__doAllAppointmentsHaveTheSameLocationsSelected(){var e=[],t=0,i=this.Data.AppointmentBuilder.numAppointments(),o=!1;if(1===i)o=!0;else{for(t=0;t<i;t++)e.push(this.Data.AppointmentBuilder.getAppointment(t).Locations.toArray());o=$$WPSchedulingUtil.DoAllArraysContainTheSameValues(e)}return o},_onLocationAdded:function WP$Scheduling$LocationStepController$_onLocationAdded(t){var i=this.Data.AppointmentBuilder,o=t.Locations.toArray(),n=o[o.length-1],r=$$WP.Scheduling.TieredSchedulingController.isLocationFromFirstTier(t,n),s=this._allowMultiselect(),l=this.__isStepCollapsed,a=null,c=0;if(n){if(t.Locations.openChangeBatch(),t.VisitType&&t.VisitType.HasAlreadyLoadedTieredData&&i.IsLoadingTieredData)this.__shouldSelectTheAnyLocationForTieredScheduling(t)&&(t.IsLocationAnyOptionSelected=!0);else if(!s&&o.length>1&&r)for(t.Locations.empty(),t.Locations.add(n),c=0;c<this.ViewModel.Locations.length;c++)(a=this.ViewModel.Locations[c])!==n&&(a[this.__viewStatePropertyName]=e.StatesEnum.Unselected);t.Locations.closeChangeBatch()}this._updateStepStatus(),l||this.__isStepCollapsed?this.updateStep():this.__syncUIElements()},__shouldSelectTheAnyLocationForTieredScheduling:function WP$Scheduling$LocationStepController$__shouldSelectTheAnyLocationForTieredScheduling(e){return!!this.Data.AppointmentBuilder.IsLoadingTieredData&&(!(!this.__isFilteringByGeolocation()&&e.Locations.size()!==this.__getNumberOfViewModelLocationsIncludedByFilter())&&this.__isAllFilteredLocationsSelected())},_onLocationRemoved:function WP$Scheduling$LocationStepController$_onLocationRemoved(e){this._updateStepStatus(),this.__syncUIElements()},__syncUIElements:function WP$Scheduling$LocationStepController$__syncUIElements(){this.ViewBinder.syncModelsToDOM(),this.__syncProviderSelectionDropdown(),this.setCurrentSelectionCountInBanner(),$$WPSchedulingUtil.HandleStickyBanner()},_updateStepStatus:function WP$Scheduling$LocationStepController$_updateStepStatus(){var e=this._appointment.hasALocationSelected(),t=this.__isIncomplete(),i=!1;e?!this.isStepMarkedAsHidden()&&!this.__isOtherLocationSelected()&&this.__isNeeded()||this.__canForceLocationStepRequired()?(this.shouldSkipStep()&&this.isTheLastIncompleteStep()&&(i=!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),t&&this.__currentAppointmentAssociationStatus()===h.MultiApptToMultiSelector&&!this.__hasCollapsedBefore&&(this.__isStepCollapsed=!0,this.__initializeSpacer(),this.updateStep(),i&&(this.__hasCollapsedBefore=!0))):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):(this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.__removeCollapse())},__isNeeded:function WP$Scheduling$LocationStepController$__isNeeded(){return!(this._appointment!==this.Data.AppointmentBuilder.getFirstAppointment()&&this.hasMultipleLinkedAppointments())},__isIncomplete:function WP$Scheduling$LocationStepController$__isIncomplete(){return this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete},__isOtherLocationSelected:function WP$Scheduling$LocationStepController$__isOtherLocationSelected(){var e=null;return 1===(e=this._appointment.Locations).size()&&e.toArray()[0].OtherOption},__isOnlyAnyLocationAndAllFilteredLocationsSelected:function WP$Scheduling$LocationStepController$__isOnlyAnyLocationAndAllFilteredLocationsSelected(){var e=this._appointment;return e.IsLocationAnyOptionSelected&&e.Locations.size()===this.__getNumberOfViewModelLocationsIncludedByFilter()},__isAllFilteredLocationsSelected:function WP$Scheduling$LocationStepController$__isAllFilteredLocationsSelected(){this._appointment;var t,i=this.__getViewModelLocationsIncludedByFilter();for(t=0;t<i.length;t++)if(!(i[t][this.__viewStatePropertyName]===e.StatesEnum.Selected)&&!i[t].IsAnyOption)return!1;return!0},shouldRemainOnStep:function WP$Scheduling$LocationStepController$shouldRemainOnStep(){return this.shouldSkipForPreselections()?(this.__isFirstTimeThroughFromPreselections=!1,!1):!this.shouldSkipStep()},shouldSkipStep:function WP$Scheduling$LocationStepController$shouldSkipStep(){return this.shouldSkipForPreselections()||this.shouldSkipForOtherReasons()},shouldSkipForPreselections:function WP$Scheduling$LocationStepController$shouldSkipForPreselections(){return this.__isFirstTimeThroughFromPreselections&&!(this._fromFavorite&&0===this._preselectedLocations.length)},shouldSkipForOtherReasons:function WP$Scheduling$LocationStepController$shouldSkipForOtherReasons(){return!(this.ViewModel&&this.ViewModel.Locations&&1!==this.ViewModel.Locations.length&&this._isCheckboxAndNotArrow()&&!this.Data.AppointmentBuilder.IsUsingProviderDropdown&&!this.isHidden()&&!this.__isStepCollapsed)},setCurrentSelectionCountInBanner:function WP$Scheduling$LocationStepController$setCurrentSelectionCountInBanner(){var e,t=this.getSchedulingContinueBanner().find(".selected-count");this.Active&&this.ViewModel&&this.$root.is(":visible")&&(e=this.__getCurrentSelectionCountString(),t.text(e))},__getCurrentSelectionCountString:function WP$Scheduling$LocationStepController$__getCurrentSelectionCountString(){var e=this._getAssociatedAppointments()[0].Locations.toArray().length,t="";return 0===e||this.ViewModel.Count<2||!this._isCheckboxAndNotArrow()||this.__currentAppointmentAssociationStatus()===h.MultiApptToMultiSelector?t="":this.__isOnlyAnyLocationAndAllFilteredLocationsSelected()?t=this.Data.Locations.getFromIndex("Id","-1").Name:1===e?t=this.SchedulingStringsNamespace.getString("LocationsSelectedCount_Singular"):(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@LOCATIONSCOUNT@",e,$$WP.Strings.EncodingTypes.HTML),t=this.SchedulingStringsNamespace.getString("LocationsSelectedCount_Plural"),this.SchedulingStringsNamespace.clearMnemonics()),t},hasStickyBanner:function WP$Scheduling$LocationStepController$hasStickyBanner(){return!0},isStepMarkedAsHidden:function WP$Scheduling$LocationStepController$isStepMarkedAsHidden(){var e;return!this.__canForceLocationStepRequired()&&(this.resetStepSettings(),this.stepSettings.Hide=this.__getStepSettingsHideValue(this.stepSettings),null!==(e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id))&&(e.IsHidden=this.stepSettings.Hide),this.WP$Scheduling$StepController$isStepMarkedAsHidden())},__getStepSettingsHideValue:function WP$Scheduling$LocationStepController$__getStepSettingsHideValue(e){return this.stepSettings.Hide||this.stepSettings.HideIfOne&&1===this._getAvailableLocations().length||this.__isHiddenBasedOnInPersonStatus()||this.__isOtherLocationTheOnlyAvailableLocation()},__isHiddenBasedOnInPersonStatus:function WP$Scheduling$LocationStepController$__getStepSettingsHideValue(e){return!this.__anyAppointmentHasLocationStepTelehealthOverride()&&this.__isNonInPersonVisitTypeSelected()&&!(this.__currentAppointmentAssociationStatus()===h.MultiApptToMultiSelector)},__isOtherLocationTheOnlyAvailableLocation:function WP$Scheduling$LocationStepController$__isHiddenBasedOnInPersonStatus(){var e=[];return this.ViewModel&&(e=this.ViewModel.Locations),!!e&&(1===e.length&&e[0].OtherOption)},__canForceLocationStepRequired:function WP$Scheduling$LocationStepController$__canForceLocationStepRequired(){var e=!1,t=!1,i=this.Data.AppointmentBuilder.getActiveApptIndex(),o=this.Data.AppointmentBuilder.getAppointment(i);return o&&o.VisitType&&(t=o.VisitType.ShowLocationStepForTelehealthVisit,e=o.VisitType.CanLoadMoreTiers),e&&t},_getAvailableLocations:function WP$Scheduling$LocationStepController$_getAvailableLocations(){var e=[],t=[],i=0,o=this._getAssociatedAppointments();for(i=0;i<o.length;i++)t=this._getAvailableLocationsForAppointment(o[i]),e.push(t);return 0===e.length&&(e=[[]]),$$WPSchedulingUtil.GetIntersectionOfArrays(e)},_getAvailableLocationsByAppointment:function WP$Scheduling$LocationStepController$_getAvailableLocationsByAppointment(){var e=[],t=[],i=0,o=this.Data.AppointmentBuilder.Appointments.toArray();for(i=0;i<o.length;i++)t=this._getAvailableLocationsForAppointment(o[i]),e[i]=t;return 0===e.length&&(e=[[]]),e},_getAvailableLocationsForAppointment:function WP$Scheduling$LocationStepController$_getAvailableLocationsForAppointment(e){var t=this._getAvailableDepartmentIds(e),i=this._shouldGroupByLocation(t);return this._getLocationsForDepartments(t,i)},_getAvailableLocationsGlobal:function WP$Scheduling$LocationStepController$_getAvailableLocationsGlobal(){var e=[],t=null,i=!1,o=[],n=0,r=this.Data.AppointmentBuilder.Appointments.toArray();for(n=0;n<r.length;n++)t=this._getAvailableDepartmentIds(r[n]),i=this._shouldGroupByLocation(t),o=this._getLocationsForDepartments(t,i),e.push(o);return 0===e.length&&(e=[[]]),$$WPSchedulingUtil.RemoveDuplicateElementsFromArray($$WPSchedulingUtil.GetUnionOfArrays(e))},_getAvailableDepartmentIds:function WP$Scheduling$LocationStepController$_getAvailableDepartmentIds(e){var t=e.ReasonForVisit,i=e.Providers.toArray(),o=[];if(this.arePrerequisitesComplete())switch(this._mode){case a.Request:o=this._getDepartmentIdsForRequest(t,i);break;case a.FilterOnSelectedReasonForVisitAndProviders:o=this._getDepartmentIdsFilterOnSelectedReasonForVisitAndProviders(t,i,e);break;case a.FilterOnSelectedProviders:o=this._getDepartmentIdsFilterOnSelectedProviders(i);break;case a.FilterOnSelectedReasonForVisit:o=this._getDepartmentIdsFilterOnSelectedReasonForVisit(t,e);break;case a.FilterOnSelectedSpecialtyAndReasonForVisit:o=this._getDepartmentIdsFilterOnSelectedSpecialtyAndReasonForVisit(t,this.Data.AppointmentBuilder.Specialty,e)}return o=this.filterIdArrayByAllowedIds(o)},_getLocationsForDepartments:function WP$Scheduling$LocationStepController$_getLocationsForDepartments(e,t){var i,o,n,r,s;for(i=[],r=this.Data.Locations.toArray(),o=0;o<r.length;o++)if(!(s=r[o]).IsAnyOption&&s.IsSingleDepartment!==t)for(n=0;n<s.Departments.length;n++)if(-1!==e.indexOf(s.Departments[n].ID)){i.push(s);break}return i},_isCheckboxAndNotArrow:function WP$Scheduling$LocationStepController$_isCheckboxAndNotArrow(){return this.__currentAppointmentAssociationStatus()===h.MultiApptToMultiSelector?this.__hasCollapsedBefore:this._getAvailableLocations().length>1&&this._directOptionsExistForAssociatedAppointments()&&!this._hasMultipleLqfs()},_allowMultiselect:function WP$Scheduling$LocationStepController$_allowMultiselectForAny(){return(this._getAvailableLocations().length>1||this.Data.AppointmentBuilder.IsLoadingTieredData)&&this._directOptionsExistForAssociatedAppointments()&&!this._hasMultipleLqfs()},_shouldIncludeAnyOption:function WP$Scheduling$LocationStepController$_shouldIncludeAnyOption(e){return!(e.length<2||this.__getNumberOfViewModelLocationsIncludedByFilter()<2||!this._allowMultiselect())},_hasMultipleLqfs:function WP$Scheduling$LocationStepController$_hasMultipleLqfs(){var e,t,o,n=0,r=null,s=null,l=null,a=0,c=[],d=null,h=null,_=[];if(!(o=this.Data.AppointmentBuilder.ReasonForVisit))return!1;for(n=0;n<this.Data.AppointmentBuilder.numAppointments();n++)r=this.Data.AppointmentBuilder.getAppointment(n),_.push(this._getAvailableDepartmentIds(r));for(e=$$WPSchedulingUtil.GetUnionOfArrays(_),t=this._getLocationsForDepartments(e,!0),n=0;n<t.length;n++)d=t[n],c=c.concat(d.Departments);for(n=0;n<c.length;n++)s=c[n],(h=i.getOverride(o,s.ID,this.Data.ReasonForVisitDepartmentOverrides))&&(!(l=h.VisitType)||$$WPUtil.IsNullOrEmpty(l.QuestionnaireId)&&$$WPUtil.IsNullOrEmpty(l.DecisionTreeId)||a++);return c.length>1&&a>0},__anyDepartmentHasInPersonVTOverride:function WP$Scheduling$LocationStepController$__anyDepartmentHasInPersonVTOverride(){var e,t,o,n=0,r=null,s=null,l=null,a=[],c=null,d=null,h=[];if(!(o=this.Data.AppointmentBuilder.ReasonForVisit))return!1;for(n=0;n<this.Data.AppointmentBuilder.numAppointments();n++)r=this.Data.AppointmentBuilder.getAppointment(n),h.push(this._getAvailableDepartmentIds(r));for(e=$$WPSchedulingUtil.GetUnionOfArrays(h),t=this._getLocationsForDepartments(e,!0),n=0;n<t.length;n++)c=t[n],a=a.concat(c.Departments);for(n=0;n<a.length;n++)if(s=a[n],(d=i.getOverride(o,s.ID,this.Data.ReasonForVisitDepartmentOverrides))&&(l=d.VisitType)&&l.isInPerson())return!0;return!1},_directOptionsExistForAssociatedAppointments:function WP$Scheduling$LocationStepController$_directOptionsExistForAssociatedAppointments(){var e=0,t=null,i=[],o=null,n=this._getAssociatedAppointments();for(e=0;e<n.length;e++)if(o=(t=this.Data.AppointmentBuilder.getAppointment(e)).ReasonForVisit,i=t.Providers.toArray(),this._directOptionsExist(o,i))return!0;return!1},_directOptionsExist:function WP$Scheduling$LocationStepController$_directOptionsExist(e,t){var i,o,n=null;if(this._mode===a.FilterOnSelectedProviders||this._mode===a.FilterOnSelectedReasonForVisit||this._mode===a.FilterOnSelectedSpecialtyAndReasonForVisit)return!0;if(!e)return!1;for(o=e.DirectProviderDepartmentPairs,i=0;i<o.length;i++)if(n=o[i].Provider,-1!==t.indexOf(n))return!0;return!1},_getDepartmentIdsFilterOnSelectedReasonForVisit:function WP$Scheduling$LocationStepController$_getDepartmentIdsFilterOnSelectedReasonForVisit(e,t){return this._getDepartmentIdsFilterOnSelectedSpecialtyAndReasonForVisit(e,null,t)},_getDepartmentIdsFilterOnSelectedSpecialtyAndReasonForVisit:function WP$Scheduling$LocationStepController$_getDepartmentIdsFilterOnSelectedSpecialtyAndReasonForVisit(e,t,i){var o,n,r,s=[],l=[],a=null,c=!1,d=null;if(null===e)return s;for(n=e.DirectProviderDepartmentPairs,r=e.RequestProviderDepartmentPairs,$$WPUtil.IsNullOrEmpty(i.VisitType)||(l=i.VisitType.TieredProviderDepartmentPairsCollection.toArray()),o=0;o<n.length;o++)d=(a=n[o]).DepartmentId,this._isDepartmentValidForSpecialty(s,d,a,t,e,!0,!1)&&s.push(d);for(o=0;o<r.length;o++)"-1"!==(d=(a=r[o]).DepartmentId)?this._isDepartmentValidForSpecialty(s,d,a,t,e,!1,!0)&&s.push(d):c=!0;for(o=0;o<l.length;o++)d=(a=l[o]).DepartmentId,this._isDepartmentValidForSpecialty(s,d,a,t,e,!1,!1)&&s.push(d);return 0===s.length&&c&&s.push("-1"),s},_isDepartmentValidForSpecialty:function WP$Scheduling$LocationStepController$_isDepartmentValidForSpecialty(e,t,i,o,n,r,s){return!(!this._isReasonForVisitAllowedWithOverride(n,t,r,s)||-1!==e.indexOf(t)||o&&n.SpecialtyGroupId!==o.Id&&o!==i.Department.Specialty)},_isReasonForVisitAllowedWithOverride:function WP$Scheduling$LocationStepController$_isReasonForVisitAllowedWithOverride(e,t,o,n){var r;return null===(r=i.getOverride(e,t,this.Data.ReasonForVisitDepartmentOverrides))||!(o&&!1===r.CanDirectSchedule||n&&!1===r.CanRequest)},_getDepartmentIdsFilterOnSelectedReasonForVisitAndProviders:function WP$Scheduling$LocationStepController$_getDepartmentIdsFilterOnSelectedReasonForVisitAndProviders(e,t,o){var n,r,s=null,l=[],a=[],c=null,d=[],h=null;for(r=e.AllProviderDepartmentPairs,n=0;n<r.length;n++)if(!a[h=r[n].DepartmentId]){if(null!==(c=i.getOverride(e,h,this.Data.ReasonForVisitDepartmentOverrides))&&!1===c.CanDirectSchedule&&!1===c.CanRequest)continue;if(s=r[n].Provider,-1===t.indexOf(s))continue;l.push(h),a[h]=!0}for($$WPUtil.IsNullOrEmpty(o.VisitType)||(d=o.VisitType.TieredProviderDepartmentPairsCollection.toArray()),n=0;n<d.length;n++)h=d[n].DepartmentId,l.push(h);return l},_getDepartmentIdsFilterOnSelectedProviders:function WP$Scheduling$LocationStepController$_getDepartmentIdsFilterOnSelectedProviders(e){var t,i,o,n=[],r={},s=[],l=null;for(o=this.Data.ReasonsForVisit.Models,t=0;t<o.length;t++)for(s=o[t].AllProviderDepartmentPairs,i=0;i<s.length;i++)l=s[i],-1===e.indexOf(l.Provider)||r[l.DepartmentId]||(n.push(l.DepartmentId),r[l.DepartmentId]=!0);return n},_getDepartmentIdsForRequest:function WP$Scheduling$LocationStepController$_getDepartmentIdsForRequest(e,t){var i,o,n=[],r=null;for(o=e.RequestProviderDepartmentPairs,i=0;i<o.length;i++)r=o[i],-1!==t.indexOf(r.Provider)&&n.push(r.DepartmentId);return n},_shouldGroupByLocation:function WP$Scheduling$LocationStepController$_shouldGroupByLocation(t){return this._canPreserveGroupingMethod()||(this.__shouldGroupByLocation=this.__shouldDepartmentsBeGroupedBasedOnGroupingBehavior(),this._mode===a.Request?this.__shouldGroupByLocation=!1:e.areAllDepartmentsGrouped(this.Data.Locations,this.Data.Departments)?this._hasMultipleLqfs(t)&&(this.__shouldGroupByLocation=!1):this.__shouldGroupByLocation=!1),this.__shouldGroupByLocation},_canPreserveGroupingMethod:function WP$Scheduling$LocationStepController$_canPreserveGroupingMethod(){var e=!1,t=this.Data.AppointmentBuilder.getActiveApptIndex(),i=this.Data.AppointmentBuilder.getAppointment(t).VisitType;return this.Data.AppointmentBuilder.IsLoadingTieredData&&(e=!0),i&&i.HasAlreadyLoadedTieredData&&(e=!0),e},__shouldDepartmentsBeGroupedBasedOnGroupingBehavior:function WP$Scheduling$LocationStepController$__shouldDepartmentsBeGroupedBasedOnGroupingBehavior(){switch(this.__locationGroupingBehavior){case c.AlwaysGroup:return!0;case c.GroupForMultipleAppointmentsOnly:return this.Data.AppointmentBuilder.numAppointments()>1&&this.hasMultipleLinkedAppointments()}},_getAvailableProvidersForLocationStep:function WP$Scheduling$LocationStepController$_getAvailableProvidersForLocationStep(){var e=null,t=null,i=[],o=[],n=!1;return this.__shouldShowProviderSelection()&&(e=this.Data.AppointmentBuilder.getFirstAppointment(),t=this.Data.AppointmentBuilder.ReasonForVisit,o=e.getSelectedDepartmentsCollection().toArray(),n=!!t,i=(i=$$WPSchedulingUtil.BuildProvidersFiltered(n,!1,!1,t,o,!1)).sort($$WP.Scheduling.Provider.sortProvidersByLastName)),i.forEach(this.__setAvailableProvidersDisplayString),i},__setAvailableProvidersDisplayString:function WP$Scheduling$LocationStepController$__setAvailableProvidersDisplayString(e,t,i){var o=e.Name;e.IsPCP&&(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@PROVIDER@",e.Name,$$WP.Strings.EncodingTypes.HTML),o=this.SchedulingStringsNamespace.getString("PcpProviderLabel"),this.SchedulingStringsNamespace.clearMnemonics()),i[t].DisplayString=o},__isNonInPersonVisitTypeSelected:function WP$Scheduling$LocationStepController$__isNonInPersonVisitTypeSelected(){var e=0,t=null,i=null,o=!0,n=this._getAssociatedAppointments();for(e=0;e<n.length;e++)i=(t=n[e]).VisitType,o=o&&!!i&&!t.isAppointmentInPerson();return o},__anyAppointmentHasLocationStepTelehealthOverride:function WP$Scheduling$LocationStepController$__anyAppointmentHasLocationStepTelehealthOverride(){var e=0,t=null,i=null,o=!1,n=this._getAssociatedAppointments();if(this.VisitType&&!this.VisitType.MultiSelectable)return!0;for(e=0;e<n.length&&!o;e++)(i=(t=n[e]).VisitType)&&t.isAppointmentInPerson()||(o=o||!!i&&i.ShowLocationStepForTelehealthVisit);return o},__getTelehealthLocationWarningViewModel:function WP$Scheduling$LocationStepController$__getTelehealthLocationWarningViewModel(){var e={},t=$$WP.Strings.getNamespace("Scheduling");return!this.__anyAppointmentHasLocationStepTelehealthOverride()||this.__anyDepartmentHasInPersonVTOverride()?{}:(e.BannerType="warningType",e.DisableDetailTextHtmlEncoding=!0,e.DetailText="<span>"+t.getString("TelehealthPhysicalLocationInstructions")+"</span>",e)},__isVideoVisit:function WP$Scheduling$LocationStepController$__isVideoVisit(){var e=0,t=null,i=!0,o=this._getAssociatedAppointments();for(e=0;e<o.length;e++)t=o[e],i=i&&t.isVideoVisit();return i},__isTelephoneVisit:function WP$Scheduling$LocationStepController$__isTelephoneVisit(){var e=0,t=null,i=!0,o=this._getAssociatedAppointments();for(e=0;e<o.length;e++)t=o[e],i=i&&t.isTelephoneVisit();return i},__shouldShowProviderSelection:function WP$Scheduling$LocationStepController$__shouldShowProviderSelection(){if(this._mode===a.FilterOnSelectedSpecialtyAndReasonForVisit)return!1;var e=this.Data.AppointmentBuilder.getFirstAppointment();return!(e.hasAProviderSelected()||e.hasALocationSelected()||1!==this.Data.AppointmentBuilder.numAppointments()||this._workflow.isTypeOpenSchedulingWidget())&&$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,e)},__setGeolocationFilterMethod:function WP$Scheduling$LocationStepController$__setGeolocationFilterMethod(e,t){if(e!==this.__getGeolocationFilterMethod()||t){if(this.__saveLastGeolocationMethod(),this.__clearGeolocationErrorMessage(),null===e)return this.Data.AppointmentBuilder.setProperty("GeolocationFilterMethod",e),this.__setAnyLocationName(),void this.__clearAllSelectedLocations();this.Data.AppointmentBuilder.setProperty("GeolocationFilterMethod",e),t||this.__clearAllSelectedLocations(),this.__setAnyLocationName(),this.__isFilteringByGeolocation()&&this.__setDistanceToUserOnEveryLocation(),this.__filterByGeolocation(),this.__isFilteringNearZip()?$$WPSchedulingUtil.FocusElement(this.$root.find(".geolocation_nearZip_search")):(this.__getCurrentlySelectedGeolocationFilterElement().closest(".chip").addClass("selected"),$$WPSchedulingUtil.FocusElement(this.__getCurrentlySelectedGeolocationFilterElement())),this.updateStep()}},__setDistanceToHomeOnEachLocation:function WP$Scheduling$LocationStepController$__setDistanceToHomeOnEachLocation(){this.__doesAnyAvailableLocationHaveDistanceFromHome()&&this.__isGeolocationEnabled&&(this.Data.AppointmentBuilder.setProperty("GeolocationFilterMethod",d.NearHome),this.__setDistanceToUserOnEveryLocation(),this.__previousGeolocationMethod=d.NearHome,this.Data.AppointmentBuilder.setProperty("GeolocationFilterMethod",d.DoNotFilter),this.updateStep())},__saveLastGeolocationMethod:function WP$Scheduling$LocationStepController$__saveLastGeolocationMethod(){if(this.__isFilteringByGeolocation()){if(this.__isFilteringNearZip()&&!this.__areCoordinatesValid(this.__coordinatesOfUserEnteredZip))return;this.__previousGeolocationMethod=this.Data.AppointmentBuilder.GeolocationFilterMethod}},__getGeolocationFilterMethod:function WP$Scheduling$LocationStepController$__getGeolocationFilterMethod(){return this.Data.AppointmentBuilder.GeolocationFilterMethod},__clearGeolocationErrorMessage:function WP$Scheduling$LocationStepController$__clearGeolocationErrorMessage(){this.__setGeolocationError(null)},__hasGeolocationError:function WP$Scheduling$LocationStepController$__hasGeolocationError(){return(this.ViewModel.IsFirstOnPage||!this.Data.AppointmentBuilder.HasFatalGeolocationError)&&null!==this.__geolocationErrorMessage},__setGeolocationError:function WP$Scheduling$LocationStepController$__setGeolocationError(e,t){this.ViewModel&&this.ViewModel.IsFirstOnPage&&this.Data.AppointmentBuilder.setProperty("HasFatalGeolocationError",!0===t),this.__geolocationErrorMessage=e},__getGeolocationError:function WP$Scheduling$LocationStepController$__getGeolocationError(){return this.__hasGeolocationError()?this.__geolocationErrorMessage:null},__hasInvalidZipCodeError:function WP$Scheduling$LocationStepController$__hasInvalidZipCodeError(){return!!this.Data.AppointmentBuilder.HasFatalGeolocationError&&this.__getGeolocationFilterMethod()===d.NearZip},__onGetBrowserCoordinatesSuccess:function WP$Scheduling$LocationStepController$__onGetBrowserCoordinatesSuccess(e,t){var i;i=new o({Latitude:e,Longitude:t}),this.__coordinatesOfBrowser=i,this.__setGeolocationFilterMethod(d.NearBrowser)},__onGetBrowserCoordinatesFailure:function WP$Scheduling$LocationStepController$__onGetBrowserCoordinatesFailure(){this.__hasBrowserDeniedGeoSecurity=!0,this.updateStep()},__onGetZipSuccess:function WP$Scheduling$LocationStepController$__onGetZipSuccess(e,t){this.__coordinatesOfUserEnteredZip=new o({Latitude:e,Longitude:t}),this.Data.AppointmentBuilder.setProperty("UserEnteredZipCoordinates",this.__coordinatesOfUserEnteredZip),this.__setGeolocationFilterMethod(d.NearZip,!0)},__onGetZipFailure:function WP$Scheduling$LocationStepController$__onGetZipFailure(){this.__coordinatesOfUserEnteredZip={Latitude:null,Longitude:null},this.Data.AppointmentBuilder.setProperty("UserEnteredZipCoordinates",this.__coordinatesOfUserEnteredZip),this.__setGeolocationFilterMethod(d.NearZip,!0)},__onUserEnteredZipCoordinatesChanged:function WP$Scheduling$LocationStepController$__onGetZipFailure(){this.__coordinatesOfUserEnteredZip=this.Data.AppointmentBuilder.UserEnteredZipCoordinates,this.__setGeolocationFilterMethod(d.NearZip,!0)},__onShowNearBrowserClicked:function WP$Scheduling$LocationStepController$___onShowNearBrowserClicked(){this.__carouselController.__chipScrollSearchString=".chip.nearMe",this.__areCoordinatesValid(this.__coordinatesOfBrowser)?this.__setGeolocationFilterMethod(d.NearBrowser):(n.getCoordinatesFromBrowser(this.__onGetBrowserCoordinatesSuccess,this.__onGetBrowserCoordinatesFailure,3e4),this.$root.find(".loadingIcon").delay(250).show(0))},__onShowNearHomeClicked:function WP$Scheduling$LocationStepController$___onShowNearHomeClicked(){this.__carouselController.__chipScrollSearchString=".chip.nearHome",this.__setGeolocationFilterMethod(d.NearHome)},__onShowAllLocationsClicked:function WP$Scheduling$LocationStepController$__onShowAllLocationsClicked(){this.__carouselController.__chipScrollSearchString=".chip.allLocations",this.__setGeolocationFilterMethod(d.DoNotFilter)},__onZipEntered:function WP$Scheduling$LocationStepController$__onZipEntered(){var e=this.$root.find(".geolocation_nearZip_input").val();""!==e&&(this.Data.AppointmentBuilder.setProperty("UserEnteredZip",e),n.lookUpCoordinatesFromDatabase(this.Data.AppointmentBuilder.UserEnteredZip,this.__onGetZipSuccess,this.__onGetZipFailure))},__filterByGeolocation:function WP$Scheduling$LocationStepController$__filterByGeolocation(){var e,t,i,r;for(i=this._getAvailableLocations(),this.__clearGeolocationErrorMessage(),this.__sortLocations(i,null),r=0;r<i.length;r++)i[r].IsIncludedByFilter=!1;this.__isFilteringByGeolocation()?this.__isFilteringNearHome()?this.__filterLocationsNearHome(i):(e=this.__getCoordinatesFromGeolocationMethod(),this.__isFilteringNearZip()&&!this.__areCoordinatesValid(e)?(this.__clearDistanceToUserOnEveryLocation(),this.__setGeolocationError(this.SchedulingStringsNamespace.getString("InvalidZipCodeErrorMessage"),!0)):this.__filterLocationsNearCoordinates(i,e)):this.Data.AppointmentBuilder.IsLoadingTieredData?(t=this.__getLocationsNotFromFirstTier(appointment.Locations.toArray()).map((e=>e.Coordinates)),e=new o(n.getSimpleAverageOfCoordinates(t)),this.__sortLocations(i,e),this.__filterLocationsNearCoordinates(i,e)):this.__includeEachLocationInFilter(i)},__filterLocationsNearHome:function WP$Scheduling$LocationStepController$__filterLocationsNearHome(e){var t,i;if(this.__isAtLeastOneLocationNearHome(e)){for(i=0;i<e.length;i++)this.__isLocationNearHome(e[i])||e.splice(i--,1);this.__applyGeolocationFilter(e,null)}else t=this.SchedulingStringsNamespace.getString("DistanceUnits_"+this.__geolocationSettings.GeolocationDistanceUnits),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DISTANCE@",this.__geolocationSettings.GeolocationOuterRadius,$$WP.Strings.EncodingTypes.HTML),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DISTANCEUNITS@",t,$$WP.Strings.EncodingTypes.HTML),this.__setGeolocationError(this.SchedulingStringsNamespace.getString("NoLocationsNearHome")),this.SchedulingStringsNamespace.clearMnemonics()},__filterLocationsNearCoordinates:function WP$Scheduling$LocationStepController$__filterLocationsNearCoordinates(e,t){var i;if(this.__areCoordinatesValid(t))if(this.__isAtLeastOneLocationNearCoordinates(e,t)){for(var o=0;o<e.length;o++)this.__isLocationNearCoordinates(e[o],t)||e.splice(o--,1);this.__applyGeolocationFilter(e,t)}else i=this.SchedulingStringsNamespace.getString("DistanceUnits_"+this.__geolocationSettings.GeolocationDistanceUnits),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DISTANCE@",this.__geolocationSettings.GeolocationOuterRadius,$$WP.Strings.EncodingTypes.HTML),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DISTANCEUNITS@",i,$$WP.Strings.EncodingTypes.HTML),this.__isFilteringNearZip()?(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@ZIPCODE@",this.Data.AppointmentBuilder.UserEnteredZip,$$WP.Strings.EncodingTypes.HTML),this.__setGeolocationError(this.SchedulingStringsNamespace.getString("NoLocationsNearZip"))):this.__isFilteringNearBrowser()&&this.__setGeolocationError(this.SchedulingStringsNamespace.getString("NoLocationsNearBrowser")),this.SchedulingStringsNamespace.clearMnemonics()},__getCoordinatesFromGeolocationMethod:function WP$Scheduling$LocationStepController$__getCoordinatesFromGeolocationMethod(){switch(this.__getGeolocationFilterMethod()){case d.NearZip:return this.__coordinatesOfUserEnteredZip;case d.NearBrowser:return this.__coordinatesOfBrowser;default:return null}},__getStreetAddressFormattedWithHTML:function WP$Scheduling$LocationStepController$__getStreetAddressFormattedWithHTML(){return this.__geolocationSettings.GeolocationStreetAddress.length<1?"":'<span class="bold">'+HTMLEncode(this.__geolocationSettings.GeolocationStreetAddress.join(" "))+"</span>"},__registerClearLabelDisplayNameFunction:function WP$Scheduling$LocationStepController$__registerClearLabelDisplayName(e){Handlebars.registerHelper("GetClearLabelForLocationWithVisitType",(function(){var t;return $$WP.Strings.addMnemonic("@MYCHART@VisitTypeForClearLabelLocation@",e,!1,"Scheduling",$$WP.Strings.EncodingTypes.None),t=$$WP.Strings.getForTemplate("ClearLabelForLocationWithVisitType"),$$WP.Strings.removeMnemonic("@MYCHART@VisitTypeForClearLabelLocation@"),t}))},__sortLocations:function WP$Scheduling$LocationStepController$__sortLocations(t,i){var o=this.__geolocationSettings.GeolocationDistanceUnits;this.__isFilteringByGeolocation()?e.sortLocations(t,e.SortMethodEnum.ByDistance):this.Data.AppointmentBuilder.IsLoadingTieredData&&this.__areCoordinatesValid(i)?t.sort(((e,t)=>n.getHaversineDistance(e.Coordinates,i,o)-n.getHaversineDistance(t.Coordinates,i,o))):e.sortLocations(t,e.SortMethodEnum.Alphabetically)},__setDistanceToUserOnEveryLocation:function WP$Scheduling$LocationStepController$__setDistanceToUserOnEveryLocation(){var t,i,o,r,s=null;if(i=this.Data.Locations.Models,t=this.__getCoordinatesFromGeolocationMethod(),this.Data.Locations.openChangeBatch(),this.__isFilteringNearHome())for(r=0;r<i.length;r++)(o=i[r]).IsAnyOption||o.setProperty("DistanceToUser",o.DistanceFromHome);else if(this.__areCoordinatesValid(t))for(r=0;r<i.length;r++)o=i[r],e.doesLocationHaveCoordinates(o)&&(s=n.getHaversineDistance(o.Coordinates,t,this.__geolocationSettings.GeolocationDistanceUnits),o.setProperty("DistanceToUser",s));this.Data.Locations.closeChangeBatch()},__clearDistanceToUserOnEveryLocation:function WP$Scheduling$LocationStepController$__clearDistanceToUserOnEveryLocation(){var e;for(this.Data.Locations.openChangeBatch(),e=0;e<this.Data.Locations.Models.length;e++)this.Data.Locations.Models[e].setProperty("DistanceToUser",null);this.Data.Locations.closeChangeBatch()},__clearAllSelectedLocations:function WP$Scheduling$LocationStepController$__clearAllSelectedLocations(){var t=0,i=this._getAvailableLocations(),o=this.Data.AppointmentBuilder.Appointments.toArray();for(t=0;t<i.length;t++)i[t][this.__viewStatePropertyName]=e.StatesEnum.Unselected;for(t=0;t<o.length;t++)o[t].IsLocationAnyOptionSelected=!1,o[t].Locations.empty()},__isAtLeastOneLocationFilteredOut:function WP$Scheduling$LocationStepController$__isAtLeastOneLocationFilteredOut(e){if(!e)return!1;if(!this.__isFilteringByGeolocation()&&!this.Data.AppointmentBuilder.IsLoadingTieredData)return!1;var t=null;for(t=0;t<e.length;t++)if(!e[t].IsIncludedByFilter)return!0;return!1},__includeLocationWithinInnerRadius:function WP$Scheduling$LocationStepController$__includeLocationWithinInnerRadius(e,t){return!$$WPUtil.IsNullOrEmpty(t)&&(t<=this.__geolocationSettings.GeolocationInnerRadius&&(this.__includeLocationInFilter(e),!0))},__includeAdditionalLocationWithinOuterRadius:function WP$Scheduling$LocationStepController$__includeAdditionalLocationWithinOuterRadius(e,t,i){return!$$WPUtil.IsNullOrEmpty(t)&&(!(i>=this.__geolocationSettings.GeolocationNumLocationsToSelect)&&(t<=this.__geolocationSettings.GeolocationOuterRadius&&(this.__includeLocationInFilter(e),!0)))},__includeLocationWithinOuterRadius:function WP$Scheduling$LocationStepController$__includeLocationWithinOuterRadius(e,t,i){return!(i>=this.__geolocationSettings.GeolocationNumLocationsToSelect)&&(!!($$WPUtil.IsNullOrEmpty(t)||t<=this.__geolocationSettings.GeolocationOuterRadius)&&(this.__includeLocationInFilter(e),!0))},__getLocationsNotFromFirstTier:function WP$Scheduling$LocationStepController$__getLocationsNotFromFirstTier(e){var t=this.Data.AppointmentBuilder.getActiveApptIndex(),i=this.Data.AppointmentBuilder.getAppointment(t).VisitType.TieredLocationsCollection;return e.filter((function(e){return!i.getFromIndex("Id",e.Id)}))},__applyGeolocationFilter:function WP$Scheduling$LocationStepController$__applyGeolocationFilter(e,t){(this.__isFilteringByGeolocation()||this.Data.AppointmentBuilder.IsLoadingTieredData)&&(this.__addEveryLocationWithinInnerRadius(e,t),this.__addSomeLocationsWithinOuterRadius(e,t))},__addEveryLocationWithinInnerRadius:function WP$Scheduling$LocationStepController$__addLocationsWithinInnerRadius(t,i){for(var o,r,s=0;s<t.length;s++){if(o=t[s],this.__isFilteringNearHome()){if(!e.doesLocationHaveDistanceFromHome(o))continue;r=o.DistanceFromHome}else r=n.getHaversineDistance(o.Coordinates,i,this.__geolocationSettings.GeolocationDistanceUnits);this.__includeLocationWithinInnerRadius(o,r)&&t.splice(s--,1)}},__addSomeLocationsWithinOuterRadius:function WP$Scheduling$LocationStepController$__addLocationsWithinOuterRadius(e,t){for(var i,o,r=this.Data.AppointmentBuilder.getActiveApptIndex(),s=this.Data.AppointmentBuilder.getAppointment(r),l=this.Data.AppointmentBuilder.IsLoadingTieredData?this.__getNumberOfAppointmentLocationsIncludedByFilter(s):this.__getNumberOfViewModelLocationsIncludedByFilter(),a=0;a<e.length;a++){if(l>=this.__geolocationSettings.GeolocationNumLocationsToSelect)return;i=e[a],o=this.__isFilteringNearHome()?i.DistanceFromHome:n.getHaversineDistance(i.Coordinates,t,this.__geolocationSettings.GeolocationDistanceUnits),this.__includeLocationWithinOuterRadius(i,o,l)&&(e.splice(a--,1),l++)}},__includeLocationInFilter:function WP$Scheduling$LocationStepController$__includeLocationInFilter(e){e.IsIncludedByFilter=!0},__includeEachLocationInFilter:function WP$Scheduling$LocationStepController$__includeEachLocationInFilter(e){var t=null,i=null;for(t=0;t<e.length;t++)i=e[t],this.__includeLocationInFilter(i)},__getNumberOfViewModelLocationsIncludedByFilter:function WP$Scheduling$LocationStepController$__getNumberOfViewModelLocationsIncludedByFilter(){var e=this.__getViewModelLocationsIncludedByFilter(),t=0;if($$WPUtil.IsNullOrEmpty(e))return 0;if(0===e.length)return 0;for(t=0;t<e.length;t++)if(e[t].IsAnyOption)return e.length-1;return e.length},__getNumberOfAppointmentLocationsIncludedByFilter:function WP$Scheduling$LocationStepController$__getNumberOfAppointmentLocationsIncludedByFilter(e){var t,i=0,o=e.Locations.toArray();for(t=0;t<o.length;t++)o[t].IsIncludedByFilter&&!o[t].IsAnyOption&&i++;return i},__getViewModelLocationsIncludedByFilter:function WP$Scheduling$LocationStepController$__getViewModelLocationsIncludedByFilter(){var e,t=0,i=null,o=[];if(!this.ViewModel)return[];if(e=this.ViewModel.Locations,!this.__isFilteringByGeolocation())return e;for(t=0;t<e.length;t++)(i=e[t]).IsIncludedByFilter&&o.push(i);return o},__isAtLeastOneLocationNearHome:function WP$Scheduling$LocationStepController$__isAtLeastOneLocationNearHome(e){for(var t,i=0;i<e.length;i++)if(t=e[i],this.__isLocationNearHome(t))return!0;return!1},__isLocationNearHome:function WP$Scheduling$LocationStepController$__isLocationNearHome(e){return!!$$WPUtil.IsNullOrEmpty(e.DistanceFromHome)||e.DistanceFromHome<=this.__geolocationSettings.GeolocationOuterRadius},__isAtLeastOneLocationNearCoordinates:function WP$Scheduling$LocationStepController$__isAtLeastOneLocationNearCoordinates(e,t){for(var i,o=0;o<e.length;o++)if(i=e[o],this.__isLocationNearCoordinates(i,t))return!0;return!1},__isLocationNearCoordinates:function WP$Scheduling$LocationStepController$__isLocationNearCoordinates(e,t){return n.getHaversineDistance(e.Coordinates,t,this.__geolocationSettings.GeolocationDistanceUnits)<=this.__geolocationSettings.GeolocationOuterRadius},__isLocationWithinRange:function WP$Scheduling$LocationStepController$__isLocationWithinRange(e){return e.DistanceToUser<=this.__geolocationSettings.GeolocationOuterRadius},__areCoordinatesValid:function WP$Scheduling$LocationStepController$__areCoordinatesValid(e){return null!=e&&(null!==e.Latitude&&!isNaN(e.Latitude)&&(null!==e.Longitude&&!isNaN(e.Longitude)))},__isFilteringByGeolocation:function WP$Scheduling$LocationStepController$__isFilteringByGeolocation(){return this.__isFilteringNearZip()||this.__isFilteringNearBrowser()||this.__isFilteringNearHome()},__isFilteringNearBrowser:function WP$Scheduling$LocationStepController$__isFilteringNearBrowser(){return this.__getGeolocationFilterMethod()===d.NearBrowser},__isFilteringNearHome:function WP$Scheduling$LocationStepController$__isFilteringNearHome(){return this.__getGeolocationFilterMethod()===d.NearHome},__isFilteringNearZip:function WP$Scheduling$LocationStepController$__isFilteringNearZip(){return this.__getGeolocationFilterMethod()===d.NearZip},__filterNearHomeIfGeolocationEnabled:function WP$Scheduling$LocationStepController$__filterNearHomeIfGeolocationEnabled(){this.__isGeolocationEnabled&&this.__doesAnyAvailableLocationHaveDistanceFromHome()&&this.__setGeolocationFilterMethod(d.NearHome,!0)},__isReadOnly:function WP$Scheduling$LocationStepController$__isReadOnly(){return this.stepSettings.ReadOnly},__shouldEnableGeolocationAndResetMethodIfNot:function WP$Scheduling$LocationStepController$__shouldEnableGeolocationAndResetMethodIfNot(){var t=null,i=this._getAvailableLocationsGlobal(),o=0;if(this.__isReadOnly())return!1;for(var n=0;n<i.length;n++)e.doesLocationHaveCoordinates(i[n])&&o++;return!(t=!(o<2)&&o/i.length>=.8)&&this.__isFilteringByGeolocation()&&this.__setGeolocationFilterMethod(d.DoNotFilter,!0),t},__bindGeolocationElements:function WP$Scheduling$LocationStepController$__bindGeolocationElements(){var e;this.$root.find(".geolocation_nearZip_input").on("keydown",$.proxy((function(e){"Enter"===e.key&&this.__onZipEntered()}),this)),this.$root.find(".geolocation_nearZip_input").on("focus",this.__onZipInputFocused),this.$root.find(".geolocation_nearZip_search").on("click",this.__onZipEntered),this.__getGeolocationElementFromMethod(d.NearZip).on("click",this.__setFocusInZipInput),this.__getGeolocationElementFromMethod(d.NearBrowser).on("click",this.__onShowNearBrowserClicked),this.__getGeolocationElementFromMethod(d.NearHome).on("click",this.__onShowNearHomeClicked),this.__getGeolocationElementFromMethod(d.DoNotFilter).on("click",this.__onShowAllLocationsClicked),(e=this.__getCurrentlySelectedGeolocationFilterElement())&&e.length>0&&this.__carouselController.selectChip(e)},__getCurrentlySelectedGeolocationFilterElement:function WP$SchedulingLocationStepController$__getCurrentlySelectedGeolocationFilterElement(){return this.__getGeolocationElementFromMethod(this.__getGeolocationFilterMethod())},__getGeolocationElementFromMethod:function __getGeolocationElementFromMethod(e){var t="",i=null;switch(e){case d.DoNotFilter:t=".geolocation_showAll";break;case d.NearZip:t=".geolocation_nearZip_radio";break;case d.NearBrowser:t=".geolocation_nearMe";break;case d.NearHome:t=".geolocation_nearHome"}return t&&(i=this.$root.find(t)),i},__getDefaultGeolocationFilter:function WP$Scheduling$LocationStepController$__getDefaultGeolocationFilter(){return d.DoNotFilter},__setFocusInZipInput:function WP$Scheduling$LocationStepController$__setFocusInZipInput(){this.__carouselController.__chipScrollSearchString=".chip.nearHome";var e=this.$root.find(".geolocation_nearZip").parent().find("input[type='text']"),t=e.val();$$WPSchedulingUtil.FocusElement(e),e.val("").val(t)},__onZipInputFocused:function WP$Scheduling$LocationStepController$__onZipInputFocused(){var e=this.$root.find(".geolocation_nearZip").parent();this.__carouselController.scrollChipIntoView(e)},__doesAnyAvailableLocationHaveDistanceFromHome:function WP$Scheduling$LocationStepController$__doesAnyAvailableLocationHaveDistanceFromHome(){var t=this._getAvailableLocations(),i=0,o=null;for(i=0;i<t.length;i++)if(o=t[i],e.doesLocationHaveDistanceFromHome(o))return!0;return!1},__syncProviderSelectionDropdown:function WP$Scheduling$LocationStepController$__syncProviderSelectionDropdown(){0===this.Data.AppointmentBuilder.getAppointment(0).Locations.size()?this.$root.find(".providerDropdown").show():this.$root.find(".providerDropdown").hide()},__getDistanceToUserRoundedWithUnits:function WP$Scheduling$LocationStepController$__getDistanceToUserRoundedWithUnits(e){var t;return null===e?null:(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DISTANCE@",$$WP.I18N.formatNumber(e,1),$$WP.Strings.EncodingTypes.HTML),t=this.SchedulingStringsNamespace.getString("DistanceAway_"+this.__geolocationSettings.GeolocationDistanceUnits),this.SchedulingStringsNamespace.clearMnemonics(),t)},_registerHandlebarsHelpers:function WP$Scheduling$LocationStepController$_registerHandlebarsHelpers(){var e=$$WP.Strings.getNamespace("Scheduling"),t=this;Handlebars.registerHelper("DistanceToUserRoundedWithMethod",(function(i){var o,n="",r=null;return o=t.__geolocationErrorMessage===e.getString("InvalidZipCodeErrorMessage"),null===(i=t.__getDistanceToUserRoundedWithUnits(i))?"":(e.addMnemonic("@MYCHART@DISTANCEWITHUNITS@",i,$$WP.Strings.EncodingTypes.HTML),e.addMnemonic("@MYCHART@ZIPCODE@",t.Data.AppointmentBuilder.UserEnteredZip,$$WP.Strings.EncodingTypes.HTML),r=t.__isFilteringByGeolocation()?t.__getGeolocationFilterMethod():t.__previousGeolocationMethod,o&&(r=d.DoNotFilter),r===d.NearHome?n=e.getString("DistanceFromHomeLabel"):r===d.NearBrowser?n=e.getString("DistanceFromMeLabel"):r===d.NearZip&&(n=e.getString("DistanceFromZipLabel")),e.clearMnemonics(),n)})),Handlebars.registerHelper("GetStreetAddressWithLabel",(function(){var e,i=t.__getStreetAddressFormattedWithHTML();return $$WP.Strings.addMnemonic("@MYCHART@STREETADDRESS@",i,!1,"Scheduling",$$WP.Strings.EncodingTypes.None),e=$$WP.Strings.getForTemplate("ShowingLocationsNearHomeAddressLabel"),$$WP.Strings.removeMnemonic("@MYCHART@STREETADDRESS"),e}))},_onGeolocationChanged:function WP$Scheduling$LocationStepController$_onGeolocationChanged(){this.__isFilteringByGeolocation()&&this.__setDistanceToUserOnEveryLocation(),this.__filterByGeolocation(),this._deselectInvalidLocations(this._allowMultiselect()),this.updateStep()},_getAssociatedAppointments:function WP$Scheduling$LocationStepController$_getAssociatedAppointments(){var e=[];return this.hasMultipleLinkedAppointments()?e=this.Data.AppointmentBuilder.Appointments.toArray():e.push(this._appointment),e},hasMultipleLinkedAppointments:function WP$Scheduling$LocationStepController$hasMultipleLinkedAppointments(){return!$$WPSchedulingUtil.AllowsLocationsSeparate(this.Data)&&this.Data.AppointmentBuilder.Appointments.toArray().length>1},__initializeSpacer:function WP$Scheduling$LocationStepController$__initializeSpacer(){this.__$spacer=$afe.jq(document.createElement("div"));var e=this.$root.find(".locationlist").height();this.__$spacer.height(e),this.__isStepCollapsing=!0},__collapseSpacer:function WP$Scheduling$LocationStepController$__collapseSpacer(){this.$root.append(this.__$spacer),this.__$spacer.slideUp(500,(function(){$$WPSchedulingUtil.HandleStickyBanner(),this.__isStepCollapsed=!0,this.__isStepCollapsing=!1}))},__onChangeLocationClicked:function WP$Scheduling$LocationStepController$__onChangeLocationClicked(){this.__hasCollapsedBefore=!0,this.__removeCollapse()},__removeCollapse:function WP$Scheduling$LocationStepController$__removeCollapse(){var e;e=this.__isStepCollapsed,this.__isStepCollapsed=!1,e&&this.updateStep()},__currentAppointmentAssociationStatus:function WP$Scheduling$LocationStepController$__currentAppointmentAssociationStatus(){return 1===this.Data.AppointmentBuilder.Appointments.toArray().length?h.OneApptToOneSelector:this.hasMultipleLinkedAppointments()?h.MultiApptToOneSelector:this.Data.AppointmentBuilder.Appointments.toArray().length>1&&!this.hasMultipleLinkedAppointments()?h.MultiApptToMultiSelector:null}},a={FilterOnSelectedReasonForVisitAndProviders:0,FilterOnSelectedProviders:1,Request:2,FilterOnSelectedReasonForVisit:3,FilterOnSelectedSpecialtyAndReasonForVisit:4},c={AlwaysGroup:0,GroupForMultipleAppointmentsOnly:1},d={DoNotFilter:0,NearZip:1,NearBrowser:2,NearHome:3},h={OneApptToOneSelector:0,MultiApptToOneSelector:1,MultiApptToMultiSelector:2};s.prototype=l,s.ModesEnum=a,s.LocationGroupingBehaviorEnum=c,s.GeolocationFilterMethod=d,$$WP.Scheduling.LocationStepController=s,s.extend($$WP.Scheduling.SingleAppointmentStepController,"WP$Scheduling$LocationStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$LocationStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SpecialtyStepController$definition(){var e=$$WP.Scheduling.Specialty,t=$$WP.Scheduling.SchedulingSelectableViewBinder,i={NoFiltering:0},n=function WP$Scheduling$SpecialtyStepController(n,l,s,a,o,S,c,d){this.WP$Scheduling$StepController(n,s,o,[S],c,$$WP.Templates.Scheduling.SpecialtyStep,null,!1,null),this.proxify("updateStep","_onSpecialtyChanged","_onViewModelChanged","_onLoadSpecialtiesSuccess"),this._mode=a||i.NoFiltering,this.__specialtyToPreselect=null,this.__isHidden=!1,this._workflow=l,this.__canShowStepPretext=d,this.setViewBinder(new t("ViewState",e.StatesEnum.Selected,e.StatesEnum.Unselected)),this.Data.Specialties.addPropertyListener("ViewState",this._onViewModelChanged),this.Data.AppointmentBuilder.addPropertyListener("Specialty",this._onSpecialtyChanged),$$WP.Analytics.UsageTrackingController.logFormFactor(l.IsAnonymous)};n.prototype={_mode:null,__specialtyToPreselect:null,__isHidden:!1,__canShowStepPretext:!1,updateViewModel:function WP$Scheduling$SpecialtyStepController$updateViewModel(){var e=this.__getAvailableSpecialties();e.sort($$WP.Scheduling.Specialty.sortSpecialties),this.ViewModel={Specialties:e,Count:e.length,StepShouldBeActive:!0}},__getAvailableSpecialties:function WP$Scheduling$SpecialtyStepController$__getAvailableSpecialties(){var e;return e=this.__getUnfilteredSpecialties(),this.filterByAllowedIds(e,"Id")},beforeFirstRender:function WP$Scheduling$SpecialtyStepController$beforeFirstRender(){var e,t;e=this.ViewModel.Specialties,t=this.getModelsToPreSelect(e,"Id"),this.__cacheSettingsBeforeFirstRender(t)},__cacheSettingsBeforeFirstRender:function WP$Scheduling$SpecialtyStepController$__cacheSettingsBeforeFirstRender(e){0!==e.length&&null!==e[0]?(this.__specialtyToPreselect=e[0],(this.stepSettings.Hide||this.stepSettings.HideIfOne)&&this.__cacheHideStepSetting()):this.stepSettings.ReadOnly||this.__disableHideAndReadOnlyStepSettings()},__cacheHideStepSetting:function WP$Scheduling$SpecialtyStepController$__cacheHideStepSetting(){this.__isHidden=!0,this.stepSettings.HideIfOne=!1,this.stepSettings.Hide=!1},__disableHideAndReadOnlyStepSettings:function WP$Scheduling$SpecialtyStepController$__disableHideAndReadOnlyStepSettings(){this.stepSettings.ReadOnly=!1,this.stepSettings.HideIfOne=!1,this.stepSettings.Hide=!1},afterRender:function WP$Scheduling$SpecialtyStepController$afterRender(){this.__setupPretext(),this.__setInitialFocus(),this.__selectPreselectedSpecialty()},__setupPretext:function __setupPretext(){var e,t,i;this.__canShowStepPretext&&(e=this.$root.find(".specialtystep .pretext"),t=$$WP.Strings.getForTemplate("StepPretextHeader","Scheduling.Fixed"),(i=$$WP.Strings.getForTemplate("SpecialtyStepPretextExpanded","Scheduling"))&&!$$WPUtil.IsNullOrEmpty(i.string)&&new $$WP.UI.ProgressiveDisclosureController(e,t,i,$$WP.UI.ProgressiveDisclosureTypeEnum.Info))},__setInitialFocus:function WP$Scheduling$SpecialtyStepController$__setInitialFocus(){var e;0===(e=$afe.select("#workflow-help .banner-header-text h4")).length&&(e=$afe.select("#workflow-help .mainText")),0===e.length&&(e=this.$root.find("h2.header")),e.focus()},__selectPreselectedSpecialty:function WP$Scheduling$SpecialtyStepController$__selectPreselectedSpecialty(){null!==this.__specialtyToPreselect&&(this.Data.AppointmentBuilder.setProperty("Specialty",this.__specialtyToPreselect),this._setViewModelSelectedStates(this.ViewModel.Specialties),this.ViewBinder.syncModelsToDOM(),this.__specialtyToPreselect=null)},_getViewEventSubmodule:function WP$Scheduling$SpecialtyStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.SpecialtyStep},_onViewModelChanged:function WP$Scheduling$SpecialtyStepController$_onViewModelChanged(t){var i,n;for(i in t)switch(n=t[i].model||$$WP.Common.Model.getInstance(i),t[i].to){case e.StatesEnum.Selected:this.Data.AppointmentBuilder.setProperty("Specialty",n);break;case e.StatesEnum.Unselected:this.Data.AppointmentBuilder.Specialty===n&&this.Data.AppointmentBuilder.setProperty("Specialty",null)}},_onSpecialtyChanged:function WP$Scheduling$SpecialtyStepController$_onSpecialtyChanged(){var e=this.Data.AppointmentBuilder.Specialty;this._updateStepStatus(),null!=e?e.IsDataLoaded?(this._setViewModelSelectedStates(this.__getAvailableSpecialties()),this.ViewBinder.syncModelsToDOM()):(this.__showLoadingSpinner(),this.__isHidden&&this.__hideStepContents(),$$WPSchedulingSpecialtiesCore.LoadSpecialtyData(this._workflow,e.Id,this._onLoadSpecialtiesSuccess)):this.ViewBinder.syncModelsToDOM()},__hideStepContents:function WP$Scheduling$SpecialtyStepController$__hideStepContents(){this.$root.find(".cardlist").hide(),this.$root.find("h2.header").hide()},_onLoadSpecialtiesSuccess:function WP$Scheduling$SpecialtyStepController$_onLoadSpecialtiesSuccess(e){this._updateAfterSpecialtiesLoaded(e),this.__hideLoadingSpinner()},_updateAfterSpecialtiesLoaded:function WP$Scheduling$SpecialtyStepController$_updateAfterSpecialtiesLoaded(e){$$WPSchedulingSpecialtiesCore.UpdateDataPoolSpecialties(this.Data,e,this.Data.AppointmentBuilder.Specialty.Id),this.__isHidden&&(this.stepSettings.Hide=!0),this._updateStepStatus(),this._setViewModelSelectedStates(this.__getAvailableSpecialties()),this.ViewBinder.syncModelsToDOM()},__showLoadingSpinner:function WP$Scheduling$SpecialtyStepController$__showLoadingSpinner(){$$WPUtil.ShowAjaxSpinner(this.$root.find(".specialtystep .ajaxspinner"))},__hideLoadingSpinner:function WP$Scheduling$SpecialtyStepController$__hideLoadingSpinner(){$$WPUtil.HideAjaxSpinner(this.$root.find(".specialtystep .ajaxspinner"))},_updateStepStatus:function WP$Scheduling$SpecialtyStepController$_updateStepStatus(){var e=this.Data.AppointmentBuilder.Specialty;this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),null!==e&&e.IsDataLoaded&&(this.isHidden()?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete))},_setViewModelSelectedStates:function(t){var i,n,l;for(i=this.Data.AppointmentBuilder.Specialty,l=0;l<t.length;l++)(n=t[l]).ViewState=n===i?e.StatesEnum.Selected:e.StatesEnum.Unselected},__getUnfilteredSpecialties:function WP$Scheduling$SpecialtyStepController$__getUnfilteredSpecialties(){return this.Data.Specialties.toArray()},hasStickyBanner:function WP$Scheduling$SpecialtyStepController$hasStickyBanner(){return!0}},n.ModesEnum=i,$$WP.Scheduling.SpecialtyStepController=n,n.extend($$WP.Scheduling.StepController,"WP$Scheduling$SpecialtyStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SpecialtyStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SlotStepController$definition(){var e={Standard:0,RequestOnly:1},t={Dropdown:0,LeftSidebar:1,RightSidebar:2},i=function WP$Scheduling$SlotStepController$s_getFirstNonNullRow(e){var t,i;for(t=0;t<e.length;t++)for(i=0;i<e[t].length;i++)if(null!==e[t][i])return e[t];return null},o=function WP$Scheduling$SlotStepController$s_createGroupKeyFromArrayOfIds(e){return e.sort().join("|")+"|"},n=function WP$Scheduling$SlotStepController$s_buildViewModelForSolution(e,t,i){var o=new $$WP.Scheduling.SolutionViewModel;return o.populateFromSolution(e,t,i),o},l=function WP$Scheduling$SlotStepController$s_isValidTeamProviderPair(e,t,i,o){return!!e&&!!t&&(i.contains(t)||o)},r=function WP$Scheduling$SlotStepController$s_getFirstProviderInProviderGroup(e){return e.Providers.Models[0]},s=function WP$Scheduling$SlotStepController$s_getFirstLocationInLocationGroup(e){return e.Locations.Models[0]},a=function WP$Scheduling$SlotStepController$s_getFirstSlotInLocationGroup(e){return e.SlotGroups[0][0].Slots[0]},d=function WP$Scheduling$SlotStepController$s_isProviderDepartmentPairInList(e,t,i){var o=0;for(o=0;o<e.length;o++)if(e[o].ProviderId===t&&e[o].DepartmentId===i)return!0;return!1},h=makeStaticLink("images/calendar.svg"),_=$$WP.Common.Model,S=$$WP.Scheduling.VisitType,u=$$WP.Scheduling.Slot,p=$$WP.Scheduling.Solution,c=$$WP.Scheduling.Workflow,g=$$WP.Scheduling.Location,m=$$WP.Scheduling.Provider,P=($$WP.Scheduling.Department,$$WP.Utilities.UI.TimePreferenceWidgetController),A=$$WP.Scheduling.FilterController,f=$$WP.Scheduling.TelehealthModeController,w=$$WP.Scheduling.SlotSelectionSummaryController,D=$$WP.Scheduling.SchedulingInstructionsController,v=$$WP.Scheduling.PromotedActionBannerController,C=$$WP.Scheduling.TelehealthFilters,T=$$WP.Scheduling.OriginalAppointmentInfoController,F=$$WP.Scheduling.TieredSchedulingController,W=function WP$Scheduling$SlotStepController(t,i,o,n,l,r,s,a,d){var h;this._workflow=i,this.__slotStepSettings=n,this.__mode=l||e.Standard,this.__queryStringPreferences=this.__slotStepSettings.TimePreferences,this.__focusOnTimePreferenceLabel=!1,this.__workflowEventCallbacks=r,this.__preselectedSlotUID=s,this.__allowScrollLoading=!isDataTile()&&!$$WP.WidgetMode,this.__originalAppointmentInfo=n.OriginalAppointmentInfo,null!==n.StartDate?(this.__firstDteToShow=WP.Utils.date2dte(new Date(n.StartDate)),this.__firstDteToShow<u.todaysDte&&(this.__firstDteToShow=u.todaysDte)):this.__firstDteToShow=u.todaysDte,this.WP$Scheduling$StepController(t,o,n.AllowedProviderIds,n.PreselectedProviderIds,null,$$WP.Templates.Scheduling.SlotStep,(function(){return""})),this.proxify("__closePopupCallback","__onAncillaryDataChanged","__onVisitTypeChanged","__onTelehealthDataChanged","__onLqfsChanged","__onSlotChanged","updateStep","__onCalendarDatePicked","__onDateInputChanged","__onLoadAnotherBatchKeyDown","__onScroll","__onLoadAnotherBatchClicked","__onRequestOptionClicked","__onExpandRequestClicked","__onHideRequestClicked","__onClearTimeFiltersClicked","__onTimePreferenceChanged","__onUseTeamsCheckboxClicked","__onUseTeamsButtonClicked","__onSelectOneApptAtATimeClicked","__onPickFullSolutionClicked","__changeMultiApptView","__editSlot","__onSlotsLoaded","__onFilterToggleClicked","__onFilterCollapseClicked","__onFilterTabPressed","__onSolutionClicked","__onAppointmentsChanged","__onRetryClick","__onApptsDetailsToggleClicked","__onTelehealthWorkflowSelected","__onTelehealthLoaded","__onDateInputKeydown","__afterSolutionPreviewSlide","__onStartOverFromWarning","__onContinueFromWarning","__onRequestFromHardStop","__getSortProviderDepartmentPairsForDisplay","__sortProviderForDisplay","__sortByAvailability","__sortProviderGroupsForDisplay","__sortProviderLocationObjectsForDisplay","__onEditLocationClicked","__onEditProviderClicked","__onClearFiltersClicked","__onResetCalendarFilterClicked","__sortLocationGroupsByAvailability","__onChangeLocationButtonClicked","__onAddVideoVisitProvidersClicked","__onShowAllProvidersClicked","__onShowOutOfNetworkProvidersClicked","__onOptInToTicketWaitListClicked","__onLoadTieredData","__onTieredSchedulingCheckboxClicked","__onSearchPriorityCheckboxClicked"),this.$root.on("keydown",'input[name="'+this.__fromDateFieldId()+'"]',this.__onDateInputKeydown),$afe.select("body").on("change","input#"+this.__fromDateFieldId(),this.__onDateInputChanged),this.$root.on("keydown",".loadanotherbatchbutton",this.__onLoadAnotherBatchKeyDown),this.$root.on("click",".loadanotherbatchbutton",this.__onLoadAnotherBatchClicked),this.$root.on("click",".request .departmentbutton",this.__onRequestOptionClicked),this.$root.on("click",".requestheader .expandrequestoptions",this.__onExpandRequestClicked),this.$root.on("click",".hiderequestoptions",this.__onHideRequestClicked),this.$root.on("change",'input[name="toggleTeams"]',this.__onUseTeamsCheckboxClicked),this.$root.on("click","#useTeamsButton",this.__onUseTeamsButtonClicked),this.$root.on("change",'input[name="searchPriorityOptionGroup"]',this.__onSearchPriorityCheckboxClicked),this.$root.on("click",".oneApptAtATimeSelectbutton",this.__onSelectOneApptAtATimeClicked),this.$root.on("click",".pickFullSolutionbutton",this.__onPickFullSolutionClicked),this.$root.on("click",".filtertogglesection",this.__onFilterToggleClicked),this.$root.on("keydown",".filtersContainerFull",this.__onFilterTabPressed),this.$root.on("click",".filtercollapsesection",this.__onFilterCollapseClicked),this.$root.on("click","#clear-filters-button",this.__onClearFiltersClicked),this.$root.on("click","#clear-filters-no-providers-button",this.__onClearFiltersClicked),this.$root.on("click",".cleartimefiltersbutton",this.__onClearTimeFiltersClicked),this.$root.on("click","#clear-filters-mid-slots",this.__onClearFiltersClicked),this.$root.on("click",".resetcalendarfilterbutton",this.__onResetCalendarFilterClicked),this.$root.on("click",".slotsData",this.__onSolutionClicked),this.$root.on("click",".retryButton",this.__onRetryClick),this.$root.on("click",".apptsDetailsToggle",this.__onApptsDetailsToggleClicked),this.$root.on("click",".changeLocationBtn",this.__onChangeLocationButtonClicked),this.$root.on("click",".addVideoVisitProviders",this.__onAddVideoVisitProvidersClicked),this.$root.on("click","#showAllProvidersButton",this.__onShowAllProvidersClicked),this.$root.on("click","#showOutOfNetworkProvidersButton",this.__onShowOutOfNetworkProvidersClicked),this.$root.on("click","#optInToTicketWaitListButton",this.__onOptInToTicketWaitListClicked),this.$root.on("change",'input[name="toggleTieredScheduling"]',this.__onTieredSchedulingCheckboxClicked),this.__eventManager=new $$WP.Scheduling.EventManager,this.Data.AppointmentBuilder.addPropertyListener("UseTeams",this.__onAncillaryDataChanged),this.Data.AppointmentBuilder.addPropertyListener("CountOfFailedAttemptsToReviewSlot",this.__onAncillaryDataChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("add",this.__onAppointmentsChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("remove",this.__onAppointmentsChanged),this.Data.AppointmentBuilder.Appointments.addPropertyListener("VisitType",this.__onVisitTypeChanged),this.Data.AppointmentBuilder.Appointments.addPropertyListener("IsUsingTieredData",this.__onAncillaryDataChanged),this.__onAppointmentsChanged(),this.Data.TelehealthData.addPropertyListener("SelectedWorkflow",this.__onTelehealthWorkflowSelected),this.Data.TelehealthData.addPropertyListener("TelehealthLoaded",this.__onTelehealthLoaded),this.Data.AppointmentBuilder.addPropertyListener("PatientLocation",this.__onTelehealthDataChanged),this.Data.AppointmentBuilder.addPropertyListener("PatientSublocation",this.__onAncillaryDataChanged),this.Data.AppointmentBuilder.addPropertyListener("CanSearchAllLicensedVideoProviders",this.__onAncillaryDataChanged),this.Data.AppointmentBuilder.addPropertyListener("IsPatientLocationRuleRunning",this.__onAncillaryDataChanged),this.Data.AppointmentBuilder.addPropertyListener("IsLoadingTieredData",this.__onLoadTieredData),this.Data.AppointmentBuilder.addPropertyListener("SearchPriority",this.__onAncillaryDataChanged),navigator.userAgent.match(/Trident\/7./)&&this.$root.on("mousewheel",".slotsData",(function(e){e.stopPropagation()})),this.__distanceUnits=n.GeolocationDistanceUnits,this.__preselectedFilters=a||[],this.__forceShowFilters=this.__canForceShowFilters(),this.__availableFilters=d||[],h={IsInsuranceSelectionValid:this.isInsuranceSelectionValid(),IsAnyProviderSelectedInAllActiveAppointments:this.__isAnyProviderSelectedInAllActiveAppointments(),forceShowFilters:this.__forceShowFilters,ShowingAddAllProviders:this.__shouldShowAddAllProvidersOption(),FiltersToLoad:this.__getProviderFiltersToLoad()},this.FilterController=new A(this.__slotStepSettings.DefaultProviderLanguages,this.Data.AppointmentBuilder,i,h,this.__preselectedFilters),this.FilterController.onFiltersChangedSameResults=this.updateStep,this.FilterController.clearProviderDepartmentFilterListener(),this.FilterController.addProviderDepartmentFilterListener(this.__onAncillaryDataChanged),this.ChipCarouselController=new $$WP.UI.ChipCarouselController($$WP.Templates.Scheduling.SlotStepToggleCarousel),this.TelehealthModeController=new f(this.Data.AppointmentBuilder,this.ChipCarouselController),this.SlotSelectionSummaryController=new w(this.$root,this.Data,this.__editSlot,i),this.SchedulingInstructionsController=new D(this.$root,this.Data),this.PromotedActionBannerController=new v(this.$root,this.Data);var _={LocationGroupingBehavior:this.__slotStepSettings.LocationGroupingBehavior,CanAlsoLoadAdditionalProviders:this.__shouldShowAddAllProvidersOption(),CanAlsoLoadTeamProviders:this.__getIsTeamSchedulingAllowed(),csn:this.__slotStepSettings.Csn};this.TieredSchedulingController=new F(this.$root,this._workflow,this.Data,_)};W.prototype={$root:null,TimePreferenceWidget:null,FilterController:null,TelehealthModeController:null,TieredSchedulingController:null,SlotSelectionSummaryController:null,SchedulingInstructionsController:null,PromotedActionBannerController:null,hasAutoSelectedRequestSolution:!1,__selectedTimePreferenceFilterTimes:null,__selectedTimePreferenceFilterLabel:null,__checkedBox:null,__focusOnTimePreferenceLabel:null,__handleFocusAfterRedrawingSlotStep:!1,__queryStringPreferences:null,__slotStepSettings:null,__mode:null,__renderHidden:!0,__isDirty:!0,__areFiltersCollapsed:!0,__isWPPopupOpen:!1,__minDte:0,__maxDte:0,__maxCalendarDte:0,__latestUserSelectedDte:0,__firstDteToShow:0,__eventManager:null,__currentPreviewedSolution:null,__currentWarningSolution:null,__distanceUnits:null,__isSimpleMultiApptWorkflow:!1,__isComplexMultiApptWorkflow:!1,__showDetailedSolutionsView:!1,__showSingleApptSelectSolutionsView:!1,__midSlotsMultiApptViewBannerDaysBeforeContent:0,$preRedrawFocusedElement:null,__preRedrawLastDTE:0,__shouldTryFocusOnNextDTE:!1,__isTeamSchedulingAllowed:!1,__isLoadingTeams:!1,__isLoadingAdditionalProviders:!1,__workflowEventCallbacks:{},__shouldMoveOverlayDown:!1,__shouldAnimateFilters:!1,__allowScrollLoading:!0,__preselectedSlotUID:null,__hasNewFilteredSlots:!1,__adHocJoinWaitListStepController:null,__adHocPatientLocationStepController:null,__showSlotsWhenLoading:!1,__focusSlotPreview:!0,__forceShowFilters:!1,__isUserSelectingSlots:!1,__preselectedFilters:[],__isTieredSchedulingAllowed:!1,__numConsecutiveEmbeddedSlotLoads:0,__minimumNewSlotsNeededEachEmbeddedLoad:20,__runningCountSlotsLoadedPerEmbeddedSlotLoad:0,__selectAdditionalProvidersAddedBanner:!1,__onAppointmentsChanged:function WP$Scheduling$SlotStepController$__onAppointmentsChanged(){var e,t=0,i=null;for(this.__eventManager.removeAllListeners(),e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)i=this.Data.AppointmentBuilder.getAppointment(t),this.__eventManager.addCollectionEventListener(i.Providers,"add",this.__onAncillaryDataChanged),this.__eventManager.addCollectionEventListener(i.Providers,"remove",this.__onAncillaryDataChanged),this.__eventManager.addCollectionEventListener(i.Locations,"add",this.__onAncillaryDataChanged),this.__eventManager.addCollectionEventListener(i.Locations,"remove",this.__onAncillaryDataChanged),this.__eventManager.addCollectionEventListener(i.Lqfs,"add",this.__onLqfsChanged),this.__eventManager.addCollectionEventListener(i.Lqfs,"remove",this.__onLqfsChanged),this.__eventManager.addModelPropertyListener(i,"Slot",this.__onSlotChanged),this.__eventManager.addModelPropertyListener(i,"SelectedTelehealthMode",this.__onTelehealthDataChanged),this.__eventManager.addModelPropertyListener(i,"CanSkipLicensureCheck",this.__onAncillaryDataChanged)},updateViewModel:function WP$Scheduling$SlotStepController$updateViewModel(){this.__initializeDateRange(),this.__isSlotsStepHiddenForFullPageReservations()?this.stepSettings.Collapse=!0:this.__isDirty?this.__resetAndLoad():(this.__buildViewModel(),this.ViewModel.StepShouldBeActive=!0)},__isSlotsStepHiddenForFullPageReservations:function WP$Scheduling$SlotStepController$__isSlotsStepHiddenForFullPageReservations(){return this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected()&&(this.Data.AppointmentBuilder.getFirstAppointment().Slot.IsPreselected||$$WP.WidgetMode)},arePrerequisitesComplete:function WP$Scheduling$SlotStepController$arePrerequisitesComplete(){var e,t=0;if($$WPSchedulingLqfCore.CanWorkflowSupportLqf(this._workflow.Type)&&$$WPSchedulingLqfCore.HasUnansweredQuestions(this.Data,this._workflow)||this.Data.AppointmentBuilder.IsPatientLocationRuleRunning)return!1;for(e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)if(!this.__arePrerequisitesCompleteForSingleAppointment(this.Data.AppointmentBuilder.getAppointment(t)))return!1;return!0},__arePrerequisitesCompleteForSingleAppointment:function WP$Scheduling$SlotStepController$__arePrerequisitesCompleteForSingleAppointment(e){var t=e.Locations,i=this.Data.AppointmentBuilder.ReasonForVisit;return(this.__isRescheduleWorkflow()||this.__isTicketWorkflow()||this.__isDecisionTreeNodeWorkflow()||!!i||!!e.VisitType&&e.VisitType.HasAlreadyLoadedTieredData)&&t.size()>0},show:function WP$Scheduling$SlotStepController$show(){this.__deselectAllSlots(),this.Data.AppointmentBuilder.getFirstAppointment().IsUsingTieredData||this.TieredSchedulingController.__resetForNextAppointment(),this.Data.AppointmentBuilder.setProperty("IsUsingProviderFilter",!1),this.__renderHidden=!1,this.WP$Scheduling$StepController$show(),this.__focusStepHeader()},hide:function WP$Scheduling$SlotStepController$hide(){this.__renderHidden=!0,this.WP$Scheduling$StepController$hide()},beforeFirstRender:function WP$Scheduling$SlotStepController$beforeFirstRender(){var e,t=null;Handlebars.registerPartial("Scheduling.Solution",$$WP.Templates.Scheduling.Solution),Handlebars.registerPartial("Scheduling.SolutionDetailed",$$WP.Templates.Scheduling.SolutionDetailed),Handlebars.registerPartial("Scheduling.SolutionAlerts",$$WP.Templates.Scheduling.SolutionAlerts),Handlebars.registerHelper("hasValue",(function(e,t){return $$WPUtil.IsNullOrEmpty(e)?t.inverse(this):t.fn(this)})),e=this.__getIsTeamSchedulingAllowed(),2===this.__slotStepSettings.ShowTeamBeforeSearch&&!this.__isOpenSchedulingWorkflow()&&e&&this.Data.AppointmentBuilder.setProperty("UseTeams",!0),this.TieredSchedulingController.__tieredSchedulingSettings.CanAlsoLoadTeamProviders=e,this.__preselectedSlotUID&&(t=p.createSolutionFromUid(this.__preselectedSlotUID),this.__isPreselectedSolutionValid(t)&&(t.Slots[0].IsPreselected=!0,this.__selectSolution(t),this.stepSettings.Hide=!0))},__isPreselectedSolutionValid:function WP$Scheduling$SlotStepController$__isPreselectedSolutionValid(e){return!!e&&1===e.Slots.length&&this.__isSlotValidForAppointment(e.Slots[0],this.Data.AppointmentBuilder.getFirstAppointment())},beforeRender:function WP$Scheduling$SlotStepController$beforeRender(){var e=[],t=!1,i=null;this.$preRedrawFocusedElement=$afe.jq(document.activeElement),this.__preRedrawLastDTE=this.$root.find(".day").last().safeAttr("data-dte");var o=null;this.ViewModel.CanEditLocations=$$WPSchedulingUtil.CanEditStep(this.Data,this._workflow.Type,$$WP.Scheduling.SchedulingStep.StepTypeEnum.Location,this.__slotStepSettings.IsDepartmentStepHiddenByQueryParams),this.__filtersScrollPosition=$afe.select(".filtersSectionContainer").scrollTop(),this.hasAutoSelectedRequestSolution=!1,1===this.Data.AppointmentBuilder.numAppointments()&&(i=this.Data.AppointmentBuilder.getFirstAppointment(),e=this.__getAvailableRequestSolutions(i),t=i.ProviderDepartmentPairs.length>0,null!==(o=this.__getSingleLocationRequestSolution(e))&&this.__canShowRequestWorkflow(t)&&!this.__isAtLeastOneProviderFilterSelected()&&(i.setProperty("Slot",o.Slots[0]),this.hasAutoSelectedRequestSolution=!0)),this.ViewModel.ShowSingleApptSelectSolutionsView&&this.__setupSlotStepHeader(),(this.__renderHidden||!this.__isSlotStepStackActive())&&(this.Active=!1,this.$root.hide()),this._workflow&&this._workflow.Type===c.WorkflowTypesEnum.Reschedule&&0!==this.$root.find("#OriginalAppointmentInfo").length&&T.StashPortal(),this.__logTieredSchedulingAvailableIfAllowed()},__logTieredSchedulingAvailableIfAllowed:function WP$Scheduling$SlotStepController$__logTieredSchedulingAvailableIfAllowed(){var e=null,t=1===this.__slotStepSettings.ShowTeamBeforeSearch,i=this.Data.AppointmentBuilder.getActiveApptIndex(),o=this.Data.AppointmentBuilder.getAppointment(i);o.VisitType&&this.__getIsTieredSchedulingAllowed(o)&&!o.HasViewedTieredSchedulingOption&&(t&&(this.__setUseTeamsProperty(!0),this.__isLoadingTeams=!0),e={workflow:this._workflow.toRawRequestObject(),appointmentBuilder:this.Data.AppointmentBuilder.toRawRequestObject(),appointmentIndex:i},$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("LogTieredSchedulingAvailable",this._workflow)),data:$$WPUtil.postify(e),cache:!1}),o.HasViewedTieredSchedulingOption=!0,t&&(this.__setUseTeamsProperty(!1),this.__isLoadingTeams=!0))},__isSlotStepStackActive:function WP$Scheduling$SlotStepController$__isSlotStepStackActive(){var e,t=null,i=null;return(e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id))&&(t=this.Data.SchedulingSteps.getFromIndex("ID",e.StackId)),this.__adHocPatientLocationStepController&&(i=this.Data.SchedulingSteps.getFromIndex("ID",this.__adHocPatientLocationStepController.stepId)),this.__isStepActive(e)||this.__isStepActive(t)||this.__isStepActive(i)},__setupSlotStepHeader:function WP$Scheduling$SlotStepController$__setupSlotStepHeader(){var e,t,i,o,n="",l="",r="";switch(i=this.Data.AppointmentBuilder.getActiveApptIndex(),o=(e=this.Data.AppointmentBuilder.getAppointment(i)).SelectedTelehealthMode,t=$$WPSchedulingUtil.GetVisitDisplayName(e,this._workflow.TicketInfo,o),i){case 0:l="FirstSlotStepTitleWithVisitType",n="@MYCHART@CURRENTVISITTYPEBEINGSELECTEDFORFIRST@",r="SlotStepTitleScreenReaderHelperForFirst";break;case 1:l="SecondSlotStepTitleWithVisitType",n="@MYCHART@CURRENTVISITTYPEBEINGSELECTEDFORSECOND@",r="SlotStepTitleScreenReaderHelperForSecondOrMore";break;case 2:l="ThirdSlotStepTitleWithVisitType",n="@MYCHART@CURRENTVISITTYPEBEINGSELECTEDFORTHIRD@",r="SlotStepTitleScreenReaderHelperForSecondOrMore";break;case 3:l="FourthSlotStepTitleWithVisitType",n="@MYCHART@CURRENTVISITTYPEBEINGSELECTEDFORFOURTH@",r="SlotStepTitleScreenReaderHelperForSecondOrMore";break;default:l="FifthOrMoreSlotStepTitleWithVisitType",n="@MYCHART@CURRENTVISITTYPEBEINGSELECTEDFORFIFTHORMORE@",r="SlotStepTitleScreenReaderHelperForSecondOrMore"}this.ViewModel.SlotStepTitleWithVisitType=l,this.SchedulingStringsNamespace.addMnemonic(n,"<span class='bold'>"+HTMLEncode(t)+"</span>",$$WP.Strings.EncodingTypes.None),this.ViewModel.SlotStepTitleScreenReaderHelper=r},__filterProvidersByAllowedIds:function WP$Scheduling$SlotStepController$__filterProvidersByAllowedIds(e,t,i){var o,n=[];return e?(o=e.filter((function(e){return e.LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Added})),n=(n=this.filterByAllowedIds(e,t,i)).concat(o),n=$$WPSchedulingUtil.RemoveDuplicateElementsFromArray(n)):[]},afterRender:function WP$Scheduling$SlotStepController$afterRender(){var e=null,i=this.Data.AppointmentBuilder.getActiveApptIndex();this.Data.AppointmentBuilder.getAppointment(i);this.__afterRenderHandleSlotVisibilityBehavior(),this.__setupStartDateField(),this.__allowScrollLoading&&$afe.jq(window).on("scroll",this.__onScroll),this.__isTimePreferencesWidgetVisible()&&this.__setupTimePreferencesWidget(),this.__shouldRenderProviderFilters()&&(this.__setupProviderFilters(),this.FilterController.draw(this.$root.find(".filtercontainerparent"))),this.__shouldClearFilterSelectionsAfterRender()&&this.FilterController.clearAllFilters(),this.__shouldAnimateFilters=!1,this.ViewModel.ShouldAnimateFilters=!1,this.__setupEmergencyMessage(),this.__renderChipCarousel(),this.SlotSelectionSummaryController.render(),this.SchedulingInstructionsController.render(this._workflow),this.PromotedActionBannerController.render(this.ViewModel),this._workflow.Type===c.WorkflowTypesEnum.Reschedule&&T.Update(this.Data,this.$root.find("#SlotStepOriginalAppointmentInfo"),this.__showSingleApptSelectSolutionsView),this.__setFocusAfterRender(),this.__renderOpenPreviewOrWarning(),this.__handleFocusAfterRedrawingSlotStep=!1,this.$preRedrawFocusedElement=null,this.__preRedrawLastDTE=0,this.__shouldTryFocusOnNextDTE=!1,this.__isLoadingTeams=!1,this.__isLoadingAdditionalProviders=!1,this.__focusSlotPreview=!0,this.__isFullPageFilters()||this.$root.find(".filtertogglesection").safeAttr("aria-expanded",!this.__areFiltersCollapsed),(e=this.$root.find(".filtersContainerFull")).siblings().filter(":not([aria-hidden])").safeAttr("data-hide-during-modal",!0),e.parentsUntil("body > *").siblings().filter(":not([aria-hidden])").safeAttr("data-hide-during-modal",!0),this.__setupSelectionFilters(),this.__setAriaHiddenForFullPageFilters(),this.ViewModel.FilterPosition!==t.Dropdown||this.__areFiltersCollapsed||$afe.select(".filtersSectionContainer").scrollTop(this.__filtersScrollPosition),this.ViewModel.FilterPosition!==t.RightSidebar&&this.ViewModel.FilterPosition!==t.LeftSidebar||this.__areFiltersCollapsed||this.__showBodyElementsNoOverlay(),this.__areFiltersCollapsed||this.ViewModel.FilterPosition!==t.Dropdown||!$afe.select("body, #wrap").hasClass("scrollDisabled")&&this.__isFullPageFilters()&&$afe.select("body, #wrap").addClass("scrollDisabled")},__shouldRenderProviderFilters:function WP$Scheduling$SlotStepController$__shouldRenderProviderFilters(){return this.__shouldShowGranularProviderFilters()&&this.__doesAnyAppointmentAllowProviderSelection()&&(this.__isAnyProviderSelectedInAllActiveAppointments()||this.__canForceShowFilters())},__shouldClearFilterSelectionsAfterRender:function WP$Scheduling$SlotStepController$__shouldClearFilterSelectionsAfterRender(){return!this.__isAnyProviderSelectedInAllActiveAppointments()&&!this.__canForceShowFilters()&&this.Data.AppointmentBuilder.AreProvidersFilteredBySlotStep},__canForceShowFilters:function WP$Scheduling$SlotStepController$__canForceShowFilters(){var e=this.Data.AppointmentBuilder.getActiveApptIndex();return this.Data.AppointmentBuilder.getAppointment(e).IsUsingTieredData||!this.__isAnyProviderSelectedInAllActiveAppointments()&&(this.isInsuranceSelectionValid()||this.__preselectedFilters.length>0)},__afterRenderHandleSlotVisibilityBehavior:function WP$Scheduling$SlotStepController$__afterRenderHandleSlotVisibilityBehavior(){var e,t=this.$root,i=null;e=this.__getLoadingOverlay(),i=t.find(".nodata"),this.Data.SlotLoader.isLoading()?(this.__showSlotsWhenLoading||this.__hideSlots(),$$WPUtil.ShowAjaxSpinner(e),i.hide(),this.__handleLoadingHeartBasedOnLoadContext()):(this.__showSlotsWhenLoading||this.__showSlots(),$$WPUtil.HideAjaxSpinner(e),i.show())},__handleLoadingHeartBasedOnLoadContext:function WP$Scheduling$SlotStepController$__handleLoadingHeartBasedOnLoadContext(){this.__getFilterPosition()===t.Dropdown&&!this.__areFiltersCollapsed||this.ViewModel.ShowExpandedRequestOptions?this.__lockLoadOverlayPosition():this.ViewModel.Days&&this.ViewModel.Days.length>0&&this.__showSlotsWhenLoading?this.__releaseLoadOverlayPosition():this.__lockLoadOverlayPosition()},onNavigateBack:function WP$Scheduling$SlotStepController$onNavigateBack(){this.__areFiltersFullScreenExpanded()&&this.__collapseFilters()},__showSlots:function WP$Scheduling$SlotStepController$__showSlots(){this.$root.find(".day").removeClass("hidden"),this.$root.find(".loadmorecontainer").removeClass("hidden"),this.__getFilterNoSlotsLoaded().removeClass("hidden")},__hideSlots:function WP$Scheduling$SlotStepController$__hideSlots(){this.$root.find(".slotsData > .day").addClass("hidden"),this.$root.find(".loadmorecontainer").addClass("hidden"),this.__getFilterNoSlotsLoaded().addClass("hidden")},__isAnyProviderSelectedInAllActiveAppointments:function WP$Scheduling$SlotStepController$__isAnyProviderSelectedInAllActiveAppointments(){var e,t=this.Data.AppointmentBuilder.Appointments.Models;if(this.__showSingleApptSelectSolutionsView)return t[this.Data.AppointmentBuilder.getActiveApptIndex()].IsProviderAnyOptionSelected;for(e=0;e<t.length;e++)if(!t[e].IsProviderAnyOptionSelected)return!1;return!0},__isFullPageFilters:function WP$Scheduling$SlotStepController$__isFullPageFilters(){return!($$WP.WidgetMode||isDataTile())},__hideBodyElementsForOverlay:function WP$Scheduling$SlotStepController$__hideBodyElementsForOverlay(){var e,t=$afe.select("body");this.__isFullPageFilters()&&(this.$root.find(".summaryBannerContainer").hide(),t.find("#sidebar").hide(),t.find("#footer").hide(),$afe.select(".summary-back").addClass("invisible"),t.css("overflow-y","hidden"),t.css("touch-action","none"),t.css("position","fixed"),$afe.select("body, #wrap").addClass("scrollDisabled"),(e=$afe.select(".button.startover")).addClass("invisible"),e.prop("disabled",!0),this._workflow.IsAnonymous&&this._workflow.Type!==c.WorkflowTypesEnum.OnDemandTelehealth?this.__shouldMoveOverlayDown=!1:($afe.select("#header").addClass("compact"),$afe.select(".summaryBannerContainer").addClass("invisible"),$afe.select("#startOverMobile").addClass("invisible"),this.__shouldMoveOverlayDown=!0))},__showBodyElementsNoOverlay:function WP$Scheduling$SlotStepController$__showBodyElementsNoOverlay(){var e,t=$afe.select("body");this.__isFullPageFilters()&&(this.$root.find(".summaryBannerContainer").show(),t.find("#sidebar").show(),t.find("#footer").show(),$afe.select(".summary-back").removeClass("invisible"),t.css("overflow-y","scroll"),t.css("touch-action","auto"),t.css("position","relative"),$afe.select("body, #wrap").removeClass("scrollDisabled"),(e=$afe.select(".button.startover")).removeClass("invisible"),e.prop("disabled",!1),$afe.select("#header").removeClass("compact"),$afe.select(".summaryBannerContainer").removeClass("invisible"),$afe.select("#startOverMobile").removeClass("invisible"))},__setupProviderFilters:function __setupProviderFilters(){var e,t,i,o,n,l=this.Data.AppointmentBuilder.numAppointments();for(e=0;e<l;e++)t=this.Data.AppointmentBuilder.getAppointment(e),this.__showSingleApptSelectSolutionsView&&e!==this.Data.AppointmentBuilder.getActiveApptIndex()||(i=this.__getAllAvailableProviders(t),this.FilterController.updateAvailableProviders(i,e),o=this.__getAllAvailableProviderDepartmentPairs(t),this.FilterController.updateAvailableProviderDepartmentPairs(o,e));n={IsInsuranceSelectionValid:this.isInsuranceSelectionValid(),IsAnyProviderSelectedInAllActiveAppointments:this.__isAnyProviderSelectedInAllActiveAppointments(),forceShowFilters:this.__canForceShowFilters(),ShowingAddAllProviders:this.__shouldShowAddAllProvidersOption(),FiltersToLoad:this.__getProviderFiltersToLoad()},this.FilterController.updateFilterSettings(n)},__getProviderFiltersToLoad:function __getProviderFiltersToLoad(){var e,t,i=[];if(this._workflow.Type===c.WorkflowTypesEnum.ProviderFinder)for(i=["IsInNetwork"],e=0;e<this.__availableFilters.length;e++)t=this.__availableFilters[e].FilterGroup,i.push(t);else i=["IsInNetwork","Gender","Languages","ClinicalInterests","Credentials","PatientAge"];return i},__getAllAvailableProviders:function __getAllAvailableProviders(e){var t,i,o,n,l,r,s,a=e.getSelectedDepartmentsCollection(),d=$$WPSchedulingUtil.BuildProvidersFiltered(!0,!0,!1,e.ReasonForVisit,e.getSelectedDepartmentsCollection().toArray(),!1);if(t=d.slice(0),e.VisitType&&!e.IsUsingTieredData&&(t=this.__removeProviderArray(t,e.VisitType.TieredProvidersCollection.toArray())),this.Data.AppointmentBuilder.UseTeams)for(r=0;r<d.length;r++)for(i=d[r].TeamProviderDepartmentPairs,o=$$WPSchedulingUtil.AddProvidersFromProviderDepartmentPairs(i,!1,!0,!1),s=0;s<o.length;s++)-1===t.indexOf(o[s])&&a.contains(i[s].Department)&&t.push(o[s]);if(this.Data.AppointmentBuilder.CanSearchAllLicensedVideoProviders&&e.isVideoVisit())for(n=this.__getAvailablePairsForPatientLocation(e),l=$$WPSchedulingUtil.AddProvidersFromProviderDepartmentPairs(n,!1,!0,!1),s=0;s<l.length;s++)-1===t.indexOf(l[s])&&t.push(l[s]);return this.Data.AppointmentBuilder.UseTeams?t:this.__filterProvidersByAllowedIds(t,"ID")},__removeProviderArray:function WP$Scheduling$SlotStepController$__removeProviderArray(e,t){return e.filter((function(e){return!function WP$Scheduling$SlotStepController$s_isProviderInList(e,t){var i=0;for(i=0;i<e.length;i++)if(e[i].ID===t)return!0;return!1}(t,e.ID)}))},__getAllAvailableProviderDepartmentPairs:function __getAllAvailableProviderDepartmentPairs(e){var t,i,o;if(i=$$WPSchedulingUtil.BuildProviderDepartmentPairsFiltered(!0,!1,e.ReasonForVisit).slice(0),this.Data.AppointmentBuilder.CanSearchAllLicensedVideoProviders&&e.isVideoVisit())for(o=this.__getAvailablePairsForPatientLocation(e),t=0;t<o.length;t++)-1===i.indexOf(o[t])&&i.push(o[t]);return this.__filterProviderDepartmentPairsToAvailableDepartments(e,i)},__filterProviderDepartmentPairsToAvailableDepartments:function __filterProviderDepartmentPairsToAvailableDepartments(e,t){var i,o,n,l;if(void 0===t)return t;for(n=e.getSelectedDepartmentsCollection(),o=[],i=0;i<t.length;i++)l=t[i],n.contains(l.Department)&&o.push(l);return o},__setupTimePreferencesWidget:function __setupTimePreferencesWidget(){var e,t=this.$root,i="",o=!1;($$WP.Utilities.UI.IsMobile||this.__handleFocusAfterRedrawingSlotStep)&&(this.__focusOnTimePreferenceLabel=!1),this.__shouldShowSimpleTimePreferences()?(i=P.LabelValueEnum.Other,o=!0):(i=this.__selectedTimePreferenceFilterLabel,o=!1),(e=t.find(".timepreferencecontainer")).length>0&&(this.TimePreferenceWidget=new P(e,this.__selectedTimePreferenceFilterTimes,this.__onTimePreferenceChanged,i,this.__slotStepSettings.OnFileSchedulePreferences,this.__slotStepSettings.DaysOfWeekList,this.__focusOnTimePreferenceLabel,this.__checkedBox,o),null===i&&"1"!==this.$root.find("input.clearradio:checked").val()&&this.__onTimePreferenceChanged(t.find(".timepreferencewidget input.radio:checked"),t.find(".timepreferencewidget input.clearradio:checked"),!0),$$WP.Strings.setDefaultNamespace("Scheduling"))},__setupSelectionFilters:function __setupSelectionFilters(){this.__shouldShowGranularProviderFilters()&&(this.$root.find("#editLocation").click(this.__onEditLocationClicked),this.$root.find("#editProvider").click(this.__onEditProviderClicked))},__setupEmergencyMessage:function __setupEmergencyMessage(){var e=this.$root.find(".slotsstep .disclaimerContainer"),t=$$WP.Strings.getForTemplate("EmergencyDisclaimer","Scheduling"),i=$$WP.Strings.getForTemplate("EmergencyDisclaimerExpanded","Scheduling");t&&!$$WPUtil.IsNullOrEmpty(t.string)&&new $$WP.UI.ProgressiveDisclosureController(e,t,i,$$WP.UI.ProgressiveDisclosureTypeEnum.Emergency)},__renderChipCarousel:function WP$Scheduling$SlotStepController$__renderChipCarousel(){this.__canShowTelehealthToggle()&&(this.ChipCarouselController.render(this.$root.find(".slotStepChipCarousel"),this.ViewModel),this.TelehealthModeController.render(this.$root.find(".slotStepChipCarousel")))},__renderOpenPreviewOrWarning:function WP$Scheduling$SlotStepController$__renderOpenPreviewOrWarning(){var e=null,t=null;this.__currentWarningSolution?(e=this.__currentWarningSolution,this.__currentWarningSolution=null,this.__showSlotWarning(e,!0)):this.__currentPreviewedSolution&&(t=this.__currentPreviewedSolution,this.__currentPreviewedSolution=null,this.__openSolutionPreview(t,!0))},__setFocusAfterRender:function __setFocusAfterRender(){if(this.__isWPPopupOpen||$$WPSchedulingUtil.IsCaptchaLightboxOpen());else{if(this.ViewModel.ShowExpandedRequestOptions)return void this.__focusStepHeader();this.__handleFocusAfterRedrawingSlotStep?this.__afterSlotStepRedrawFocusHandler():this.__focusOnStepHeaderOrFilterPopup()}this.__tryLoadOnScroll()},__focusOnFilterPopup:function __focusOnFilterPopup(){var e=this.__getFirstFocusableElementInPopup();e&&this.__focusElementRespectingFilterModalDialog(e)},__focusOnStepHeaderOrFilterPopup:function __focusOnStepHeaderOrFilterPopup(){this.__areFiltersCollapsed?this.__focusStepHeader():this.__focusOnFilterPopup()},__focusStepHeader:function WP$Scheduling$SlotStepController$__focusStepHeader(){var e=this.$root.find("h2.header");this.__focusElementRespectingFilterModalDialog(e,!1)},__setupStartDateField:function WP$Scheduling$SlotStepController$__setupStartDateField(){null!==this.__slotStepSettings.DateRangeSettings&&this.__slotStepSettings.DateRangeSettings.ReadOnly?this.$root.find("#"+this.__fromDateFieldId()).safeAttr("disabled"):writeCalendar(this.__fromDateFieldId(),"range",h,this.__minDte,this.__maxCalendarDte,this.__onCalendarDatePicked,null,this.__fromDateFieldId()+"_calendar"),$$WP.FormValidation.initializeDOMSubtree(this.$root)},triggerViewEvent:function WP$Scheduling$SlotStepController$triggerViewEvent(){this.__hasFinishedLoadingABatch()&&this.WP$Scheduling$StepController$triggerViewEvent()},_getViewEventSubmodule:function WP$Scheduling$StepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.SlotStep},__hasFinishedLoadingABatch:function WP$Scheduling$SlotStepController$__hasFinishedLoadingABatch(){return this.Data.SlotLoader.numIncrementalLoadsCompleted()>0||!this.Data.SlotLoader.isLoading()},__afterSlotStepRedrawFocusHandler:function WP$Scheduling$SlotStepController$__afterSlotStepRedrawFocusHandler(){this.Data.SlotLoader.hasVerboseError()?this.__focusElementRespectingFilterModalDialog(this.__getVerboseError()):this.__shouldTryFocusOnNextDTE?this.__tryFocusOnNextDTE():this.__setFocusBasedOnPrevious(),this.SkipAfterRenderRefocus=!0},__setFocusBasedOnPrevious:function WP$Scheduling$SlotStepController$__setFocusBasedOnPrevious(){var e=null;1===this.$root.find(this.$preRedrawFocusedElement).length?this.$preRedrawFocusedElement.focus():this.$preRedrawFocusedElement.hasClass("slot")?this.__focusOnSlot():this.$preRedrawFocusedElement.hasClass("daterangeinput")?this.__setFocusAfterDateSelection():this.$preRedrawFocusedElement.hasClass("searchPriorityOption")?(e=this.$root.find(".searchPriorityOption[value='"+this.$preRedrawFocusedElement.val()+"']"),this.__focusElementRespectingFilterModalDialog(e)):this.$preRedrawFocusedElement.hasClass("preferenceType")?(e=this.$root.find(".timepreferencewidget input.togglebutton[value='"+this.$preRedrawFocusedElement.val()+"']"),this.__focusElementRespectingFilterModalDialog(e)):this.$preRedrawFocusedElement.hasClass("toggleTeams")||this.$preRedrawFocusedElement.hasClass("expandSearchBtn")?this.__setFocusAfterMidSlotBannerSelection():this.$preRedrawFocusedElement.hasClass("telehealthInput")?(e=this.$root.find("[data-telehealthmode="+this.$preRedrawFocusedElement.safeAttr("data-telehealthmode")+"]"),this.__focusElementRespectingFilterModalDialog(e)):this.$preRedrawFocusedElement.hasClass("changeLocationBtn")?this.__setFocusAfterChangeLocationButton():this.$preRedrawFocusedElement.hasClass("slotSelectionSummaryInput")||this.$preRedrawFocusedElement.hasClass("slotSelectionSummary")?this.__focusOnSummaryHeader():this.$preRedrawFocusedElement.hasClass("pickFullSolutionbutton")||this.$preRedrawFocusedElement.hasClass("oneApptAtATimeSelectbutton")?this.__focusStepHeader():this.__setDefaultFocus()},__setFocusAfterMidSlotBannerSelection:function WP$Scheduling$SlotStepController$__setFocusAfterMidSlotBannerSelection(){var e=null;if(this.$preRedrawFocusedElement.hasClass("toggleTeams")){e=this.$root.find("#toggleTeams_"+this.Id);var t=!1;this.__focusElementRespectingFilterModalDialog(e,t)}else if(this.$preRedrawFocusedElement.hasClass("expandSearchBtn")&&this.__isTieredSchedulingAllowed){e=this.$root.closest(".additionalProvidersAddedBanner").children(".expandSearchBtn");t=!1;this.__focusElementRespectingFilterModalDialog(e,t)}else this.$preRedrawFocusedElement.hasClass("expandSearchBtn")&&this.__isLoadingAdditionalProviders&&this.__focusStepHeader()},__focusOnSlot:function WP$Scheduling$SlotStepController$__focusOnSlot(){var e;e=this.$root.find("[data-model-id='"+this.$preRedrawFocusedElement.safeAttr("data-model-id")+"']"),$$WPUtil.IsElementInView(e)&&this.__focusElementRespectingFilterModalDialog(e)},__setFocusAfterDateSelection:function WP$Scheduling$SlotStepController$__setFocusAfterDateSelection(){var e=null;e=this.$root.find("#"+this.__fromDateFieldId()),$$WPUtil.IsElementInView(e)&&e.length>0&&(this.__focusElementRespectingFilterModalDialog(e),e[0].selectionStart=e[0].selectionEnd=e.val().length)},__setFocusAfterChangeLocationButton:function WP$Scheduling$SlotStepController$__setFocusAfterChangeLocationButton(){var e,t,i;e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e).SelectedTelehealthMode,i=this.$root.find("[data-telehealthmode="+t+"]"),this.__focusElementRespectingFilterModalDialog(i)},__focusOnSummaryHeader:function WP$Scheduling$SlotStepController$__focusOnSummaryHeader(){var e;e=this.$root.find(".slotSelectionSummary"),$$WPUtil.IsElementInView(e)&&this.SlotSelectionSummaryController.focusOnSummaryHeader(this.$preRedrawFocusedElement.safeAttr("data-appointment-index"))},__setDefaultFocus:function WP$Scheduling$SlotStepController$__setDefaultFocus(){var e,t=null,i=null,o=this.Data.AppointmentBuilder.getActiveApptIndex(),n=this.Data.AppointmentBuilder.getAppointment(o);if(i=this.__areFiltersCollapsed?this.$root.find("h2.header"):this.__getFirstFocusableElementInPopup(),e=this.__getEquivalentElementAfterRedraw(this.$preRedrawFocusedElement))$$WPUtil.IsElementInView(e)&&this.__focusElementRespectingFilterModalDialog(e);else if(this.$preRedrawFocusedElement.hasClass("header")&&this.SlotSelectionSummaryController.findContainer().length>0&&this.Data.AppointmentBuilder.getActiveApptIndex()>0)this.__focusStepHeader();else if(n.VisitType&&n.VisitType.HasAlreadyLoadedTieredData&&this.__selectAdditionalProvidersAddedBanner)t=this.$root.find(".additionalProvidersAddedBanner").children(".expandSearchBtn"),this.__focusElementRespectingFilterModalDialog(t),this.__selectAdditionalProvidersAddedBanner=!1;else{if(!i||0===i.length||!$$WPUtil.IsElementInView(i))return;this.__focusStepHeader()}},__getEquivalentElementAfterRedraw:function WP$Scheduling$SlotStepController$__getEquivalentElementAfterRedraw(e){var t=null,i=e.safeAttr("data-model-id"),o=e.safeAttr("id");return $$WP.Utilities.IsNullOrEmpty(i)?$$WP.Utilities.IsNullOrEmpty(o)||(t=this.$root.find("#"+$.escapeSelector(o))):t=this.$root.find("[data-model-id='"+i+"']"),($$WP.Utilities.IsNullOrEmpty(t)||0===t.length)&&(t=null),t},__focusElementRespectingFilterModalDialog:function WP$Scheduling$SlotStepController$__focusElementRespectingFilterModalDialog(e,t=!0){this.__areFiltersFullScreenExpanded()?this.$root.find(".filtersContainerFull").has(e).length>0&&$$WPSchedulingUtil.FocusElement(e,t):$$WPSchedulingUtil.FocusElement(e,t)},__tryFocusOnNextDTE:function WP$Scheduling$SlotStepController$__tryFocusOnNextDTE(){var e,t=this.$root.find("[data-dte='"+this.__preRedrawLastDTE+"']").next();t&&t.length>0&&(e=t.find(".slot").first())&&e.length>0&&$$WPUtil.IsElementInView(e)?this.__focusElementAndDisableFocusSlotPreview(e):this.__tryFocusOnLoadMore()},__tryFocusOnLoadMore:function WP$Scheduling$SlotStepController$__tryFocusOnLoadMore(){$$WPUtil.IsElementInView(this.$preRedrawFocusedElement)?this.__focusElementAndDisableFocusSlotPreview(this.$preRedrawFocusedElement):this.__tryFocusOnLastDTE()},__tryFocusOnLastDTE:function WP$Scheduling$SlotStepController$__tryFocusOnLastDTE(){var e,t=this.$root.find("[data-dte='"+this.__preRedrawLastDTE+"']");t&&t.length>0&&(e=t.find(".slot").last(),$$WPUtil.IsElementInView(e)&&this.__focusElementAndDisableFocusSlotPreview(e))},__focusElementAndDisableFocusSlotPreview:function WP$Scheduling$SlotStepController$__focusElementAndDisableFocusSlotPreview(e){this.__focusElementRespectingFilterModalDialog(e),this.__focusSlotPreview=!1},__isTimePreferencesWidgetVisible:function WP$Scheduling$SlotStepController$__isTimePreferencesWidgetVisible(){return this.__isTimePreferencesFilteringEnabled()&&!this.__queryStringPreferences},__isTimePreferencesFilteringEnabled:function WP$Scheduling$SlotStepController$__isTimePreferencesFilteringEnabled(){return!this.__slotStepSettings.DateRangeSettings.ReadOnly&&!this.__slotStepSettings.UseOnFileTimePreferences&&!this.__showDetailedSolutionsView},__tryLoadOnScroll:function WP$Scheduling$SlotStepController$__tryLoadOnScroll(){this.__isOkToLoadByScroll()&&(this.__showSlotsWhenLoading=!0,this.__handleFocusAfterRedrawingSlotStep=!0,this.__loadNextSlotsBatch())},__isOkToLoadByScroll:function WP$Scheduling$SlotStepController$__isOkToLoadByScroll(){return this.__allowScrollLoading&&this.__isSlotStepStackActive()&&this.__canSearchMoreDates()&&!this.Data.SlotLoader.isLoading()&&this.Data.SlotLoader.isLastLoadSuccess()&&this.__isWithinScrollLoadLimit()&&this.__isBottomOfSlotsInView()&&!this.Data.AppointmentBuilder.IsLoadingTieredData},__canSearchMoreDates:function WP$Scheduling$SlotStepController$__canSearchMoreDates(){return this.Data.SlotLoader.getSearchRangeEndDte()<this.__maxDte&&!this.Data.SlotLoader.isStopSearch()||this.Data.SlotLoader.isSearchRangeEndDtePartiallyLoaded()},__isWithinScrollLoadLimit:function WP$Scheduling$SlotStepController$__isWithinScrollLoadLimit(){return this.Data.SlotLoader.numIncrementalDateRangeLoadsCompleted()<4},__isBottomOfSlotsInView:function WP$Scheduling$SlotStepController$__isBottomOfSlotsInView(){var e=this.$root.find(".slotsData");if(e.length<1)return!1;var t=window.innerHeight+$afe.jq(window).scrollTop();return e.offset().top+e.outerHeight()-2*parseInt(e.find(".day").last().css("padding-bottom"),10)<=t},__isOkToShowLoadMoreLink:function WP$Scheduling$SlotStepController$__isOkToShowLoadMoreLink(){return this.__canSearchMoreDates()&&!this.Data.SlotLoader.isLoading()&&!this.__slotStepSettings.DateRangeSettings.NoIncremental&&(this.Data.SlotLoader.canAttemptToRecoverFromError()||!this.__isWithinScrollLoadLimit()||!this.__allowScrollLoading||this.ViewModel.NoSlotsShown)},__onSolutionClicked:function WP$Scheduling$SlotStepController$__onSolutionClicked(e){var t=$afe.jq(e.target).closest("[data-model-id]"),i=t.safeAttr("data-model-id"),o=_.getInstance(i);this.Data.AppointmentBuilder.IsSlotSelectionBlocked||0!==t.length&&(!o||o.Slots.length!==this.Data.AppointmentBuilder.numAppointments()||o.IsRequest?$afe.jq(e.target).closest("#solutionpreview").length>0||this.__closeSolutionPreview(this.__currentPreviewedSolution):this.__shouldShowSlotWarning(o)?this.__showSlotWarning(o,!1,t):this.__shouldPreviewSolution(o,t)?this.__previewSolution(o):this.__selectSolution(o))},__shouldShowSlotWarning:function WP$Scheduling$SlotStepController$__shouldShowSlotWarning(e){var t=this.Data.AppointmentBuilder.getActiveApptIndex();return e.Slots[t].IsAllowedDuplicate&&!this.__hasShownAllowedDuplicateWarning(e)||e.Slots[t].IsDisallowedDuplicate},__hasShownAllowedDuplicateWarning:function WP$Scheduling$SlotStepController$__hasShownAllowedDuplicateWarning(e){var t=0,i=this.Data.AppointmentBuilder.getActiveApptIndex();for(t=0;t<i;t++)if(e.Slots[t].IsAllowedDuplicate)return!0;return!1},__shouldPreviewSolution:function WP$Scheduling$SlotStepController$__shouldPreviewSolutions(e,t){return e.Slots.length>1&&this.__isSimpleMultiApptWorkflow&&!this.__showSingleApptSelectSolutionsView&&t.hasClass("slot")},__previewSolution:function WP$Scheduling$SlotStepController$__previewSolution(e){this.__currentPreviewedSolution===e?this.__closeSolutionPreview(this.__currentPreviewedSolution):this.__currentPreviewedSolution?(this.__closeSolutionPreview(this.__currentPreviewedSolution,!0),this.__openSolutionPreview(e,!0)):this.__currentWarningSolution?(this.__removeSlotWarning(this.__currentWarningSolution,!0),this.__openSolutionPreview(e,!0)):this.__openSolutionPreview(e)},__showSlotWarning:function WP$Scheduling$SlotStepController$__showSlotWarning(e,t,i){var o=null,n=null,l=null,r=null;if(this.__currentPreviewedSolution!==e)if(this.__currentWarningSolution!==e){if(this.__currentWarningSolution&&this.__removeSlotWarning(this.__currentWarningSolution,!0),this.__currentPreviewedSolution&&this.__closeSolutionPreview(this.__currentPreviewedSolution,!0),this.__currentWarningSolution=e,o=this.$root.find(".slot[data-model-id='"+e.ModelId+"']"),(r=this.$root.find("#slotwarning")).empty().safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.SlotWarning,this.__buildWarningViewModel(e))),o.length>0)n=this.__findLastSlotGroupElementInRow(o.parent()),this.__grayOutOtherSlots(),this.__expandSelectedSlot(o),this.__addSlotsWarningAfterElement(r,o.parent(),n,t);else{if((l=this.$root.find("a[data-model-id='"+e.ModelId+"']").closest(".card.solution")).length<1)return;this.__addSlotsWarningAfterElement(r,l.find(".solutiondetails "))}this.__bindSlotWarningEvents()}else this.__removeSlotWarning(e);else this.__shouldPreviewSolution(e,i)?this.__closeSolutionPreview(e):this.__selectSolution(e)},__addSlotsWarningAfterElement:function(e,t,i,o){var n=o?0:400,l=void 0!==i;l&&this.__addSolutionPreviewOrWarningSpacer(e,i,n),e.safeInsertAfter(t).slideDown(n,"",this.__afterSolutionPreviewSlide).addClass(l?"withSpacer":""),this.__shouldFocusSlotPreview(e)&&this.__focusElementRespectingFilterModalDialog(e.find(".warningMessage"))},__addSolutionPreviewOrWarningSpacer:function __addSolutionPreviewOrWarningSpacer(e,t,i){var o=this.__getContainerHeight(e),n=$afe.renderTemplate($$WP.Templates.Scheduling.SlotWarningSpacer);n.height(o),n.safeInsertAfter(t).slideDown(i),this.__startListenAndReactToScreenSizeChange()},__bindSlotWarningEvents:function WP$Scheduling$SlotStepController$__bindSlotWarningEvents(){this.$root.find("#slotwarning .warningStartOver").on("click",this.__onStartOverFromWarning),this.$root.find("#slotwarning .warningContinue").on("click",this.__onContinueFromWarning),this.$root.find("#slotwarning .warningRequest").on("click",this.__onRequestFromHardStop)},__onStartOverFromWarning:function(){this.__workflowEventCallbacks.onNavigateBack()},__onContinueFromWarning:function(){var e=this.__currentWarningSolution;this.__currentWarningSolution.Slots.length>1&&!this.__shouldShowDetailedSolutionView()&&!this.__showSingleApptSelectSolutionsView?(this.__removeSlotWarning(e,!0),this.__previewSolution(e)):this.__selectSolution(this.__currentWarningSolution)},__onRequestFromHardStop:function(){var e=this.__getRequestSlotFromTimeSlot(this.__currentWarningSolution),t=this.Data.AppointmentBuilder.getActiveApptIndex();this.Data.AppointmentBuilder.getFirstAppointment().setProperty("Slot",e),this.Data.AppointmentBuilder.DidRequestFromHardStop=this.__currentWarningSolution.Slots[t].IsDisallowedDuplicate,this.Data.AppointmentBuilder.DidContinueFromSoftStop=!1,this.__renderHidden=!0,this.$root.hide()},__getRequestSlotFromTimeSlot:function(e){var t=e.Slots[0].ProviderId,i=e.Slots[0].DepartmentId,o=this.ViewModel.ProvidersForRequest.map((function(e){return e.Provider.ID})).indexOf(t);if(-1===o)return null;var n=this.ViewModel.ProvidersForRequest[o].Solutions.map((function(e){return e.DepartmentId})).indexOf(i);return-1===n?null:this.ViewModel.ProvidersForRequest[o].Solutions[n]},__shouldShowRequestOnHardStop:function(e){return null!==this.__getRequestSlotFromTimeSlot(e)},__buildWarningViewModel:function(e){var t,i="",o=this.Data.AppointmentBuilder.getActiveApptIndex(),n=e.Slots[o].IsAllowedDuplicate,l=e.Slots[o].IsDisallowedDuplicate,r=$$WPSchedulingUtil.FormatDteAsDate(e.Slots[o].DuplicateEncounterDte),s=e.Slots[o].DuplicateVisitTypeName,a="",d=l&&this.__shouldShowRequestOnHardStop(e);return this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DUPLICATEVISITTYPENAME@",s),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@DUPLICATEAPPOINTMENTDATE@",r),$$WP.Strings.setDefaultNamespace("Scheduling"),n?(i=$$WP.Strings.getForTemplate("DuplicateAppointmentsWarning"),a="library.svg#scheduling_warning"):l&&(i=d?$$WP.Strings.getForTemplate("DuplicateAppointmentsErrorRequest"):$$WP.Strings.getForTemplate("DuplicateAppointmentsErrorHardStop"),a="library.svg#scheduling_error"),t={IsAllowedDuplicate:n,IsDisallowedDuplicate:l,IconKey:a,DisplayString:i,ShowRequestButton:d},this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@DUPLICATEVISITTYPENAME@"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@DUPLICATEAPPOINTMENTDATE@"),$$WP.Strings.clearDefaultNamespace(),t},__startListenAndReactToScreenSizeChange:function WP$Scheduling$SlotStepController$__startListenAndReactToScreenSizeChange(){$afe.jq(window).off("resize").resize(this.__reactToScreenSizeChange.bind(this))},__reactToScreenSizeChange:function WP$Scheduling$SlotStepController$__reactToScreenSizeChange(){setTimeout(function(){var e=this.$root.find("#solutionpreview");(e.length<1||e.children().length<1)&&(e=this.$root.find("#slotwarning"));var t=this.__getContainerHeight(e),i=this.$root.find(".slotWarningSpacer, .solutionPreviewSpacer");i.height(t);var o=this.__currentPreviewedSolution||this.__currentWarningSolution;if(null!==o){i.hide();var n=this.$root.find(".slot[data-model-id='"+o.ModelId+"']"),l=this.__findLastSlotGroupElementInRow(n.parent()),r=l.find(".slot").safeAttr("data-model-id"),s=i.prev(".slotgroup").find(".slot").safeAttr("data-model-id");if(s&&r!==s){i.remove();var a=l.hasClass("preview")?l.next():l;this.__addSolutionPreviewOrWarningSpacer(e,a,0)}else i.show()}}.bind(this),0)},__getContainerHeight:function WP$Scheduling$SlotStepController$__getContainerHeight(e){return e.outerHeight()},__stopListenToScreenSizeChange:function WP$Scheduling$SlotStepController$__stopListenToScreenSizeChange(){$afe.jq(window).off("resize")},__removeSlotWarning:function WP$Scheduling$SlotStepController$__removeSlotWarning(e,t){if(e){var i,o=null,n=t?0:400;i=this.$root.find(".slot[data-model-id='"+e.ModelId+"']"),o=this.$root.find("#slotwarning"),this.__ungrayOutOtherSlots(),this.__shrinkPreviouslySelectedSlot(i),this.$root.find(".slotWarningSpacer").slideUp(n,"",(function(){$afe.jq(this).remove()})),o.slideUp(n,"",this.__afterSolutionPreviewSlide),this.__stopListenToScreenSizeChange(),this.__currentWarningSolution=null}},__openSolutionPreview:function WP$Scheduling$SlotStepController$__openSolutionPreview(e,t){var i=null,o=null,l=null,r={},s=t?0:400;(i=this.$root.find(".slot[data-model-id='"+e.ModelId+"']")).length>0&&(l=this.$root.find("#solutionpreview"),o=this.__findLastSlotGroupElementInRow(i.parent()),r={Solution:e,SolutionViewModel:n(this.Data,e,this._workflow)},l.empty().safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.SolutionPreview,r)),this.__addSolutionPreviewOrWarningSpacer(l,o,s),this.__grayOutOtherSlots(),this.__expandSelectedSlot(i),l.safeInsertAfter(i.parent()).slideDown(s,"",this.__afterSolutionPreviewSlide).addClass("withSpacer"),this.__shouldFocusSlotPreview(l)&&this.__focusElementRespectingFilterModalDialog(l.find(".verticalSubwayStop:first-child")),this.__currentPreviewedSolution=e)},__shouldFocusSlotPreview:function WP$Scheduling$SlotStepController$__shouldFocusSlotPreview(e){return this.__focusSlotPreview&&$$WPUtil.IsElementInView(e)},__closeSolutionPreview:function WP$Scheduling$SlotStepController$__closeSolutionPreview(e,t){var i=null,o=null,n=t?0:400;e&&(i=this.$root.find(".slot[data-model-id='"+e.ModelId+"']"),o=this.$root.find("#solutionpreview"),this.__ungrayOutOtherSlots(),this.__shrinkPreviouslySelectedSlot(i),o.slideUp(n,"",this.__afterSolutionPreviewSlide),this.$root.find(".solutionPreviewSpacer").slideUp(n,"",(function(){$afe.jq(this).remove(),o.removeClass("withSpacer"),o.empty()})),this.__stopListenToScreenSizeChange()),this.__currentPreviewedSolution=null},__grayOutOtherSlots:function WP$Scheduling$SlotStepController$__grayOutOtherSLots(){this.$root.find(".slotsData").addClass("previewmode")},__ungrayOutOtherSlots:function WP$Scheduling$SlotStepController$__grayOutOtherSLots(){this.$root.find(".slotsData").removeClass("previewmode")},__expandSelectedSlot:function WP$Scheduling$SlotStepController$__expandSelectedSlot(e){e.parent().addClass("preview"),e.safeAttr("aria-expanded",!0)},__shrinkPreviouslySelectedSlot:function WP$Scheduling$SlotStepController$__expandSelectedSlot(e){e.parent().removeClass("preview"),e.safeAttr("aria-expanded",!1).blur()},__afterSolutionPreviewSlide:function WP$Scheduling$SlotStepController$__afterSolutionPreviewSlide(){this.__reactToScreenSizeChange()},__findLastSlotGroupElementInRow:function WP$Scheduling$SlotStepController$__findLastSlotGroupElementInRow(e){var t=null,i=null,o=0;for(t=e,o=0;o<e.siblings(".slotgroup").length;o++){if(0===(i=t.nextAll(".slotgroup").first()).length||i.position().top>t.position().top)return t;t=i}return t},__selectSolution:function WP$Scheduling$SlotStepController$__selectSolution(e){this.__isUserSelectingSlots=!0,this.__showSingleApptSelectSolutionsView?this.__selectSingleSlot(e):this.__selectAllSlots(e)},__selectSingleSlot:function WP$Scheduling$SlotStepController$__selctSingleSlot(e){var t=this.Data.AppointmentBuilder.getActiveApptIndex(),i=this.Data.AppointmentBuilder.getAppointment(t),o=null;this.Data.AppointmentBuilder.DidContinueFromSoftStop=e.Slots[t].IsAllowedDuplicate,this.__addSlotToAppointment(t,e),t+1<this.Data.AppointmentBuilder.numAppointments()&&this.__setNextApptSearchDte(t+1,e),this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected()||(this.__focusStepHeader(),o=i.Slot.Dte,this.__firstDteToShow===o?(this.__lockLoadOverlayPosition(),this.__resetAndLoad()):this.__changeSlotDateRange(o),this.$root.find('input[name = "'+this.__fromDateFieldId()+'"]').val($$WPSchedulingUtil.FormatDteAsDate(this.__firstDteToShow)),this.updateStep())},__selectAllSlots:function WP$Scheduling$SlotStepController$__selectAllSlots(e){var t=0,i=this.Data.AppointmentBuilder.numAppointments();for(this.Data.AppointmentBuilder.DidContinueFromSoftStop=e.Slots[0].IsAllowedDuplicate,t=0;t<i;t++)this.__addSlotToAppointment(t,e)},__deselectAllSlots:function WP$Scheduling$SlotStepController$__deselectAllSlots(){this.__isUserSelectingSlots=!1,this.Data.AppointmentBuilder.deselectAllSlots()},__addSlotToAppointment:function WP$Scheduling$SlotStepController$__addSlotToAppointment(e,t){var i=this.Data.AppointmentBuilder.getAppointment(e),o=t.Slots[e];o.IsApptSrchHeld=!o.IsRequest,i.setProperty("Slot",null),i.setProperty("Slot",o),i.setProperty("SearchStartDte",this.__firstDteToShow)},__setNextApptSearchDte:function WP$Scheduling$SlotStepController$__setNextApptSearchDte(e,t){var i=this.Data.AppointmentBuilder.getAppointment(e),o=t.Slots[e];null!==i&&null!==o&&i.setProperty("SearchStartDte",o.Dte)},__onSlotChanged:function WP$Scheduling$SlotStepController$__onSlotChanged(e){var t=e.from,i=e.to,o=this.Data.AppointmentBuilder.getActiveApptIndex(),n=this.Data.AppointmentBuilder.getAppointment(o);this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected()?(this.Data.AppointmentBuilder.DidIncludeAdditionalProvidersInSearch&&1===this.__slotStepSettings.AllowedProviderIds.length&&this.Data.AppointmentBuilder.setProperty("DidScheduleWithAddedProvider",!this.__slotStepSettings.AllowedProviderIds.includes(i.ProviderId)),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this._workflow.MultiApptSlotStepSelectionView=this.__determineMultiApptSlotStepView(),this.updateStep(),this.__isSlotsStepHiddenForFullPageReservations()&&this.$root.hide()):(t&&this.__showSingleApptSelectSolutionsView&&(this.__shouldResetPatientLocation()&&(this._workflow.ResetPatientLocationToDefault(),this.__adHocPatientLocationStepController=null),this.__isDirty=!0,this.__initializeDateRange(),this.__changeSlotDateRange(this.__latestUserSelectedDte),this.__eventManager.removelListenersFromModel(t)),this.getComplete()!==$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete||this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped||(this.FilterController.clearAllFilters(),this.TieredSchedulingController.__resetForNextAppointment(),this.__isTieredSchedulingAllowed=this.__getIsTieredSchedulingAllowed(n)),!this.__isUserSelectingSlots&&t&&this.getComplete()===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete&&(this.__isDirty=!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.updateStep()),this.Data.AppointmentBuilder.DidRequestFromHardStop=!1},__determineMultiApptSlotStepView:function WP$Scheduling$SlotStepController$__determineMultiApptSlotStepView(){if(this.Data.AppointmentBuilder.numAppointments()>1){if(this.__isSimpleMultiApptWorkflow&&!this.__showSingleApptSelectSolutionsView)return c.MultiApptSlotStepViewTypeEnum.SimpleSlotsView;if(this.__showSingleApptSelectSolutionsView)return c.MultiApptSlotStepViewTypeEnum.OneApptAtATimeView;if(this.__isComplexMultiApptWorkflow&&!this.__showSingleApptSelectSolutionsView)return c.MultiApptSlotStepViewTypeEnum.DetailedPreGroupedView}},__onTieredSchedulingCheckboxClicked:function WP$Scheduling$SlotStepcontroller$__onTieredSchedulingCheckboxClicked(e){this.ViewModel.IsUsingTieredData=e.currentTarget.checked},__onLoadTieredData:function WP$Scheduling$SlotStepController$__onLoadTieredData(){this.Data.AppointmentBuilder.IsLoadingTieredData?(this.__hideSlots(),$$WPUtil.ShowAjaxSpinner(this.__getLoadingOverlay()),this.__lockLoadOverlayPosition()):(this.__isSimpleMultiApptWorkflow=!1,this.__isComplexMultiApptWorkflow=!1,$$WPUtil.HideAjaxSpinner(this.__getLoadingOverlay()),this.__releaseLoadOverlayPosition())},__onVisitTypeChanged:function WP$Scheduling$SlotStepController$__onVisitTypeChanged(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e);this.__showSingleApptSelectSolutionsView=this.Data.AppointmentBuilder.showAsMultipleVisits(this.Data.VisitTypes),this.__isSimpleMultiApptWorkflow=!1,this.__isComplexMultiApptWorkflow=!1,this.__showDetailedSolutionsView=!1,this.Data.AppointmentBuilder.setProperty("CanSearchAllLicensedVideoProviders",!1),!this.__showSingleApptSelectSolutionsView&&this.Data.AppointmentBuilder.numAppointments()>1&&(this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped=!0),this.__isTieredSchedulingAllowed=this.__getIsTieredSchedulingAllowed(t),this.__isTieredSchedulingAllowed||t.setProperty("IsUsingTieredData",!1),this.__onAncillaryDataChanged()},__onTelehealthDataChanged:function WP$Scheduling$SlotStepController$__onTelehealthDataChanged(){this.__handleFocusAfterRedrawingSlotStep=!0,this.__onAncillaryDataChanged()},__onLqfsChanged:function WP$Scheduling$SlotStepController$__onLqfsChanged(){this.TieredSchedulingController.__resetForNextAppointment(),this.__onAncillaryDataChanged()},__onAncillaryDataChanged:function WP$Scheduling$SlotStepController$__onAncillaryDataChanged(){var e=!1;this.Data.AppointmentBuilder.setProperty("AreProvidersFilteredBySlotStep",this.__isAtLeastOneProviderFilterSelected()),this.Data.AppointmentBuilder.CanUpdateAvailableProviders&&(this.FilterController.resetSelectedProviders(),this.Data.AppointmentBuilder.setProperty("CanUpdateAvailableProviders",!1)),this.__isTeamSchedulingAllowed=this.__getIsTeamSchedulingAllowed(),null!==this.ViewModel&&(e=this.ViewModel.TeamSchedulingDefaultChecked),this.__isTeamSchedulingAllowed||e||this.Data.AppointmentBuilder.setProperty("UseTeams",!1),this.__recalculateProvDepPairs(),this.__areAllSelectedSlotsValid()||this.__deselectAllSlots(),(this.__isSimpleMultiApptWorkflow&&!this.Data.AppointmentBuilder.hasAllSameSingleLocationSelected()||this.__isComplexMultiApptWorkflow&&this.Data.AppointmentBuilder.hasAllSameSingleLocationSelected())&&(this.__isSimpleMultiApptWorkflow=!1,this.__isComplexMultiApptWorkflow=!1),this.__isDirty=!0,this.__firstDteToShow===this.__minDte&&(this.__firstDteToShow=0),this.__setupProviderFilters(),this.updateStep(),this.Data.AppointmentBuilder.setProperty("CanSkipPatientLocationStep",this.__canSkipPatientLocationStep())},__getSortProviderDepartmentPairsForDisplay:function WP$Scheduling$SlotStepController$__getSortProviderDepartmentPairsForDisplay(e){var t=e.areLocationsGrouped(),i=this.Data.Locations,o=this.__sortProviderLocationObjectsForDisplay;return function sortProviderDepartmentPairsForDisplay(e,n){var l,r;return l=g.getLocationFromDepartment(e.Department,i,t),r=g.getLocationFromDepartment(n.Department,i,t),o(e.Provider,l,n.Provider,r,null,null)}},__sortProviderGroupsForDisplay:function WP$Scheduling$SlotStepController$__sortProviderGroupsForDisplay(e,t){var i,o,n,l,d,h;return this.__shouldShowLocationHeaders()&&(this.__canSortByAvailability()?(e.LocationGroups.sort(this.__sortLocationGroupsByAvailability),t.LocationGroups.sort(this.__sortLocationGroupsByAvailability)):(e.LocationGroups.sort(this.__sortLocationGroupsForDisplay),t.LocationGroups.sort(this.__sortLocationGroupsForDisplay))),i=r(e),o=r(t),n=s(e.LocationGroups[0]),l=s(t.LocationGroups[0]),d=a(e.LocationGroups[0]),h=a(t.LocationGroups[0]),this.__sortProviderLocationObjectsForDisplay(i,n,o,l,d,h)},__sortProviderLocationObjectsForDisplay:function WP$Scheduling$SlotStepController$__sortProviderDepartmentObjectsForDisplay(e,t,i,o,n,l){return this.__canSortLocationsByDistance()?g.doLocationsHaveSameRoundedDistanceToUser(t,o)?this.__sortProviderForDisplay(n,l,e,i):g.sortLocationPairByDistance(t,o):this.__sortProviderForDisplay(n,l,e,i)},__canSortLocationsByDistance:function WP$Scheduling$SlotStepController$__canSortLocationsByDistance(){var e=0,t=null,i=!1;return this.__showSingleApptSelectSolutionsView?(e=this.Data.AppointmentBuilder.getActiveApptIndex(),(t=this.Data.AppointmentBuilder.getAppointment(e)).VisitType&&t.isAppointmentInPerson()&&t.Locations.toArray().length>1&&(i=!0)):i=this.__doesAnyAppointmentWithMultipleLocationsDisplayLocationInformation(),i&&!this.__canSortByAvailability()},__sortProviderForDisplay:function WP$Scheduling$SlotStepController$__sortProviderForDisplay(e,t,i,o){var n=0;return this.__canSortByAvailability()&&(n=this.__sortByAvailability(e,t)),0===n&&(n=m.sortProviderPair(i,o,m.SortMethodEnum.NameLastFirst)),n},__canSortByAvailability:function WP$Scheduling$SlotStepController$_canSortByAvailability(){return!this.__isNewProviderWorkflow()&&this.__slotStepSettings.IsSortingByAvailability},__sortLocationGroupsByAvailability:function WP$Scheduling$SlotStepController$__sortLocationGroupsByAvailability(e,t){var i=a(e),o=a(t);return u.slotSortFunction(i,o)},__sortByAvailability:function WP$Scheduling$SlotStepController$__sortProviders(e,t){return e&&t?u.slotSortFunction(e,t):0},__sortLocationGroupsForDisplay:function WP$Scheduling$SlotStepController$__sortLocationsInLocationGroup(e,t){var i=s(e),o=s(t);return g.sortLocationPairByDistance(i,o)},__areAllSelectedSlotsValid:function WP$Scheduling$SlotStepController$__areAllSelectedSlotsValid(){var e,t=null,i=0,o=null,n=!0;for(e=this.Data.AppointmentBuilder.numAppointments(),i=0;i<e;i++)(t=(o=this.Data.AppointmentBuilder.getAppointment(i)).Slot)&&(n=n&&this.__isSlotValidForAppointment(t,o));return n},__isSlotValidForAppointment:function WP$Scheduling$SlotStepController$__isSlotValidForAppointment(e,t){var i,o,n,l,r,s=[],a=[],d=null,h="",_=!1,u=[],p=[],c=!1,g=0;if(i=this.Data.Providers.getFromIndex("ID",e.ProviderId),o=this.Data.Departments.getFromIndex("ID",e.DepartmentId),s=t.getSelectedDepartmentsCollection(),a=t.Providers,$$WPUtil.IsNullOrEmpty(e.SlotKey)?_=!!(d=this.Data.AppointmentBuilder.ReasonForVisit)&&d.DefaultVisitTypeId===e.VisitTypeId:(h=this.__getSlotKeyForCurrentSelections(),_=e.slotKey===h),this.Data.AppointmentBuilder.CanSearchAllLicensedVideoProviders)for(u=this.__getAvailablePairsForPatientLocation(t),p=$$WPSchedulingUtil.AddProvidersFromProviderDepartmentPairs(u,!1,!0,!1),g=0;g<u.length;g++)if(u[g].DepartmentId===e.DepartmentId){c=!0;break}return n=!!s.getFromIndex("ID",o.ID)||c,l=this.__isProviderAvailableForSlots(i,t)&&(!!a.getFromIndex("ID",i.ID)||p.includes(i)),r=(e.TelehealthMode||S.TelehealthModeEnum.NotDefined)===(t.SelectedTelehealthMode||S.TelehealthModeEnum.NotDefined),(_||this.Data.AppointmentBuilder.numAppointments()>1)&&n&&l&&r},__onTelehealthWorkflowSelected:function WP$Scheduling$SlotStepController$__onTelehealthWorkflowSelected(){this.Data.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing||this.Data.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.QuickSchedule||null===this.Data.TelehealthData.SelectedWorkflow?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):(this.__isDirty=!0,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)),this.__isTeamSchedulingAllowed=this.__getIsTeamSchedulingAllowed(),this.updateStep()},__onTelehealthLoaded:function WP$Scheduling$SlotStepController$__onTelehealthLoaded(){this._workflow.Type===c.WorkflowTypesEnum.OnDemandTelehealth&&this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired),this.updateStep()},__isProviderAvailableForSlots:function WP$Scheduling$SlotStepController$__isProviderAvailableForSlots(e,t){var i,o,n=0;if(!e||!t)return!1;if(!(i=t.ProviderDepartmentPairs))return!1;for(o=i.length,n=0;n<o;n++)if(i[n].ProviderId===e.ID)return!0;return!1},__getIsTeamSchedulingAllowed:function WP$Scheduling$SlotStepController$__getIsTeamSchedulingAllowed(){var e;return e=this.Data.AppointmentBuilder.getFirstAppointment(),this.__getTeamOnlyProviders(e).length>0},__getIsTieredSchedulingAllowed:function WP$Scheduling$SlotStepController$__getIsTieredSchedulingAllowed(e){return!(this.Data.AppointmentBuilder.numAppointments()>1&&!this.__showSingleApptSelectSolutionsView)&&this.__getIsTieredSchedulingEnabled(e)},__getIsTieredSchedulingEnabled:function WP$Scheduling$SlotStepController$__getIsTieredSchedulingEnabled(e){return!this.Data.AppointmentBuilder.ReplacedAllOriginalProviders&&(!!this.__canWorkflowSupportTieredScheduling()&&(!!e.VisitType&&e.VisitType.CanLoadMoreTiers))},__getTeamOnlyProviders:function WP$Scheduling$SlotStepController$__getTeamOnlyProviders(e){var t,i=[],o=[],n=[],l=[];return t=this.__getAvailableDirectTeamProviderDepartmentPairs(e),this._workflow.Type===c.WorkflowTypesEnum.ExistingProvider?l=t:(n=this.__getInitialAvailableDirectProviderDepartmentPairs(e),o=(n=this.__filterPairsByFilterSelections(n,e)).slice(),this.__appendProviderDepartmentPairs(o,t),i=$$WPSchedulingUtil.BuildProviderDepartmentPairsFiltered(!0,!1,e.ReasonForVisit),e.VisitType&&(i=this.__removeProviderDepartmentPairsArray(i,e.VisitType.TieredProviderDepartmentPairsCollection.toArray())),l=this.__removeProviderDepartmentPairsArray(o,i)),l},__removeProviderDepartmentPairsArray:function WP$Scheduling$SlotStepController$__removeProviderDepartmentPairsArray(e,t){return e.filter((function(e){return!d(t,e.ProviderId,e.DepartmentId)}))},__buildViewModelForMidSlotsMultiApptBanner:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsMultiApptBanner(){var e=0,t=!1,i=0;this.__showDetailedSolutionsView&&0===this.__midSlotsMultiApptViewBannerDaysBeforeContent?this.__midSlotsMultiApptViewBannerDaysBeforeContent=1:0===this.__midSlotsMultiApptViewBannerDaysBeforeContent&&(this.__midSlotsMultiApptViewBannerDaysBeforeContent=3),0!==this.__midSlotsMultiApptViewBannerDaysBeforeContent&&(e=this.__getMidSlotsShowBeforeDte(this.__midSlotsMultiApptViewBannerDaysBeforeContent,this.__firstDteToShow+730)),0!==e||this.__canSearchMoreDates()&&!this.ViewModel.ShowLoadAnotherBatch||(t=!0,this.ViewModel.Days.length>0&&(i=this.ViewModel.Days.length,this.__midSlotsMultiApptViewBannerDaysBeforeContent=i)),this.ViewModel.MultiApptViewBannerShowBeforeDte=e,this.ViewModel.MultiApptViewBannerShowAfterSlots=t},__buildViewModelForMidSlotsTeams:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsTeams(){var e=this.SchedulingStringsNamespace.getString("SeeMoreTimesHeading"),t=this.SchedulingStringsNamespace.getString("TeamsHelpText"),i=this.SchedulingStringsNamespace.getString("UseTeamsCheckbox");this.__buildViewModelForMidSlotsActionBanner("useTeamsButton",e,t,i)},__buildViewModelForMidSlotsTierExpansion:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsTierExpansion(){var e,t,i,o,n;this.__buildViewModelForLimitedAvailabilityBanner(),this.ViewModel.CanShowLimitedAvailabilityBanner||("expandSearchButton",n=this.__shouldShowProviderHeaders()?"":"NoProviderSelect",t=(e=$$WP.Strings.getNamespace("Scheduling.Fixed")).getString("ExpandSearchCardHeader"),i=e.getString("ExpandSearchCardHelpText"+n),o=e.getString("ExpandSearchCardButtonLabel"+n),this.__buildViewModelForMidSlotsActionBanner("expandSearchButton",t,i,o))},__buildViewModelForLimitedAvailabilityBanner:function WP$Scheduling$SlotStepController$__buildViewModelForLimitedAvailabilityBanner(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e),i=this.ViewModel.Days[0]?this.ViewModel.Days[0].Dte:0;t&&t.VisitType&&t.VisitType.TierSearchRange&&(this.ViewModel.CanShowLimitedAvailabilityBanner=i>this.__firstDteToShow+t.VisitType.TierSearchRange,this.ViewModel.TierSearchRange=t.VisitType.TierSearchRange)},__buildViewModelForMidSlotsShowAllProviders:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsShowAllProviders(){var e=this.SchedulingStringsNamespace.getString("ShowAllProvidersHeader"),t=this.SchedulingStringsNamespace.getString("ShowAllProvidersHelpText"),i=this.SchedulingStringsNamespace.getString("ShowAllProvidersButton");this.__buildViewModelForMidSlotsActionBanner("showAllProvidersButton",e,t,i)},__buildViewModelForMidSlotsShowOutOfNetworkProviders:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsShowOutOfNetworkProviders(){var e=this.SchedulingStringsNamespace.getString("ShowOutOfNetworkProvidersHeader"),t=this.SchedulingStringsNamespace.getString("ShowOutOfNetworkProvidersHelpText"),i=this.SchedulingStringsNamespace.getString("ShowOutOfNetworkProvidersButton");this.__buildViewModelForMidSlotsActionBanner("showOutOfNetworkProvidersButton",e,t,i)},__buildViewModelForMidSlotsActionBanner:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsActionBanner(e,t,i,o){var n,l=!1;0!==(n=this.__getMidSlotsShowBeforeDte(3,this.__firstDteToShow+28))||this.__canSearchMoreDates()||(l=!0),this.ViewModel.ShowMidSlotsActionBanner=!0,this.ViewModel.MidSlotsActionBannerViewModel={MidSlotsActionBannerShowBeforeDte:n,MidSlotsActionBannerShowAfterSlots:l,MidSlotsActionBannerButtonId:e,MidSlotsActionBannerHeader:t,MidSlotsActionBannerHelpText:i,MidSlotsActionBannerButtonText:o},this.ViewModel.ShowMidSlotsActionBanner&&this.ViewModel.ProvidersForRequest.length>0&&(this.ViewModel.CanShowCombinedActionBanner=!0)},__getMidSlotsShowBeforeDte:function WP$Scheduling$SlotStepController$__getMidSlotsShowBeforeDte(e,t){var i=0,o=0;if(this.ViewModel.Days.length>0)for(var n=0;n<this.ViewModel.Days.length;n++)if((i=this.ViewModel.Days[n].Dte)>t||n>=e||this.__showDetailedSolutionsView&&1===this.ViewModel.Days.length){o=i;break}return o},__buildViewModelForMidSlotsFilters:function WP$Scheduling$SlotStepController$__buildViewModelForMidSlotsFilters(){var e;this.ViewModel.Days.length>1&&(e=this.ViewModel.Days[1].Dte,this.ViewModel.FiltersHelperShowBeforeDte=e,this.ViewModel.FiltersHelperShowMidSlots=!0)},__isDteFourWeeksAway:function WP$Scheduling$SlotStepController$__isDteFourWeeksAway(e){return e>this.__firstDteToShow+28},__getAllowTeamScheduling:function WP$Scheduling$SlotStepController$__getAllowTeamScheduling(e,t){var i,o;return e.IsConditionalPanel&&(o=S.AllowTeamSchedulingEnum.NoTeamScheduling),i=this.Data.VisitTypeDepartmentOverrides.getFromIndex("Id",e.ID+"^"+t.ID),$$WP.Utilities.IsNullOrEmpty(o)&&!$$WPUtil.IsNullOrEmpty(i)&&(o=i.AllowTeamScheduling),$$WP.Utilities.IsNullOrEmpty(o)&&(o=t.AllowTeamScheduling),$$WP.Utilities.IsNullOrEmpty(o)&&(o=e.AllowTeamScheduling),$$WP.Utilities.IsNullOrEmpty(o)&&(o=this.__slotStepSettings.AllowTeamScheduling||S.AllowTeamSchedulingEnum.NoTeamScheduling),o},__onCalendarDatePicked:function WP$Scheduling$SlotStepController$__onCalendarDatePicked(e,t,i,o){var n,l;o&&(n=new Date(e,t,i),l=new $$WP.I18N.Date(formatDate(n),"string"),o.value=$$WP.I18N.formatPatientGivenDate(l.DateObject),this.__latestUserSelectedDte=WP.Utils.date2dte(n),this.__changeSlotDateRange(WP.Utils.date2dte(n)))},__onUseTeamsCheckboxClicked:function WP$Scheduling$SlotStepController$__onUseTeamsCheckboxClicked(e){this.__setUseTeamsProperty(e.currentTarget.checked),$$WPSchedulingUtil.FocusElement(e.currentTarget),this.__isLoadingTeams=!0},__onUseTeamsButtonClicked:function WP$Scheduling$SlotStepController$__onUseTeamsButtonClicked(){this.__setUseTeamsProperty(!0),this.__isLoadingTeams=!0},__setUseTeamsProperty:function WP$Scheduling$SlotStepController$__setUseTeamsProperty(e){this.Data.AppointmentBuilder.setProperty("UseTeams",e),this.ViewModel.TeamSchedulingDefaultChecked=this.Data.AppointmentBuilder.UseTeams},__onSelectOneApptAtATimeClicked:function WP$Scheduling$SlotStepController$__onSelectOneApptAtATimeClicked(){this.__changeMultiApptView()},__onSearchPriorityCheckboxClicked:function WP$Scheduling$SlotStepController$__onSearchPriorityCheckboxClicked(){var e=$$WP.Scheduling.AppointmentBuilder.SearchPriorityEnum;this.__showDetailedSolutionsView||this.__showSingleApptSelectSolutionsView||!this.__isSimpleMultiApptWorkflow?this.__showSingleApptSelectSolutionsView||(this.__showDetailedSolutionsView=!1,this.__isSimpleMultiApptWorkflow=!1,this.__isComplexMultiApptWorkflow=!1):(this.__showDetailedSolutionsView=!0,this.__isSimpleMultiApptWorkflow=!1,this.__isComplexMultiApptWorkflow=!1),"1"===this.$root.find("input[name='searchPriorityOptionGroup']:checked").val()?this.Data.AppointmentBuilder.setProperty("SearchPriority",e.SameDay):this.Data.AppointmentBuilder.setProperty("SearchPriority",e.Earliest),this.ViewModel.SearchPriority=this.Data.AppointmentBuilder.SearchPriority,this.__lockLoadOverlayPosition(),this.__resetAndLoad(),this.updateStep()},__onPickFullSolutionClicked:function WP$Scheduling$SlotStepController$__onPickFullSolutionClicked(){this.__changeMultiApptView()},__changeMultiApptView:function WP$Scheduling$SlotStepController$__changeMultiApptView(){var e=0,t=this.Data.AppointmentBuilder.getActiveApptIndex(),i=this.Data.AppointmentBuilder.getAppointment(t);this.__shouldShowGranularProviderFilters()&&this.__isAnyProviderSelectedInAllActiveAppointments()&&(this.FilterController.clearAllFilters(),this.FilterController.filterProvidersBySelection()),this.__showSingleApptSelectSolutionsView=!this.__showSingleApptSelectSolutionsView,this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped=!this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped,this.__isComplexMultiApptWorkflow&&(this.__showDetailedSolutionsView=!this.__showDetailedSolutionsView,this.__isTieredSchedulingAllowed=this.__getIsTieredSchedulingAllowed(i)),this.__closeSolutionPreview(this.__currentPreviewedSolution),this.__removeSlotWarning(this.__currentWarningSolution,!0),this.__focusStepHeader(),this.Data.AppointmentBuilder.isContainingSelectedSlots()?(this.__showSingleApptSelectSolutionsView?(this.Data.AppointmentBuilder.holdSelectedSlots(),this.Data.AppointmentBuilder.setTelehealthModesForSelectedSlots(),0===(e=this.__latestUserSelectedDte)&&(t=this.Data.AppointmentBuilder.getActiveApptIndex(),e=(i=this.Data.AppointmentBuilder.getAppointment(t-1)).Slot.Dte)):(this.Data.AppointmentBuilder.unholdSelectedSlots(),e=this.__latestUserSelectedDte),this.__changeSlotDateRange(e),this.__lockLoadOverlayPosition(),this.__resetAndLoad()):this.__isSimpleMultiApptWorkflow?($$WPUtil.ShowAjaxSpinner(this.__getLoadingOverlay()),this.__lockLoadOverlayPosition(),this.__generateSolutionGroupKeys(this.Data.Solutions.toArray())):this.__generateSolutionGroupKeys(this.Data.Solutions.toArray()),this.updateStep()},__editSlot:function WP$Scheduling$SlotStepController$__editSlot(e){this.__isUserSelectingSlots=!0,this.Data.AppointmentBuilder.deselectSlotAndAllFollowingSlots(e),this.SlotSelectionSummaryController.focusOnSummaryHeader(0),this.updateStep()},__canSkipLicensureCheckForActiveAppointment:function WP$Scheduling$SlotStepController$__canSkipLicensureCheckForActiveAppointment(){var e,t;if(this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped){for(e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)if((t=this.Data.AppointmentBuilder.getAppointment(e)).isVideoVisit()&&!t.CanSkipLicensureCheck)return!1;return!0}return this.Data.AppointmentBuilder.getAppointment(this.Data.AppointmentBuilder.getActiveApptIndex()).CanSkipLicensureCheck},__shouldResetPatientLocation:function WP$Scheduling$SlotStepController$__shouldResetPatientLocation(){var e=0;if(this.__showSingleApptSelectSolutionsView){for(e=0;e<=this.Data.AppointmentBuilder.getActiveApptIndex();e++)if(this.Data.AppointmentBuilder.getAppointment(e).isVideoVisit())return!1;return!0}return!1},__onDateInputKeydown:function WP$Scheduling$SlotStepController$__onDateInputKeydown(e){13===e.which&&(e.preventDefault(),WP.Events.fireEvent(e.target,"change"))},__onDateInputChanged:function WP$Scheduling$SlotStepController$__onDateInputChanged(e){var t=null;$$WP.FormValidation.checkIfFormIsValid(this.$root.find("form.daterangecontainer"),!1)&&(t=parseDate(e.target.value,!0),this.__changeSlotDateRange(WP.Utils.date2dte(t)),$$WPSchedulingUtil.FocusElement(this.$root.find(".datechooserAnchor")))},__areFiltersFullScreenExpanded:function WP$Scheduling$SlotStepController$__areFiltersFullScreenExpanded(){return!!this.__isFullPageFilters()&&!this.__areFiltersCollapsed},__setAriaHiddenForFullPageFilters:function WP$Scheduling$SlotStepController$__setAriaHiddenForFullPageFilters(){var e=this.__areFiltersFullScreenExpanded();this.$root.find("[data-hide-during-modal='true']").safeAttr("aria-hidden",e)},__onFilterToggleClicked:function WP$Scheduling$SlotStepController$__onFilterToggleClicked(){this.__areFiltersCollapsed?this.__expandFilters():this.__collapseFilters()},__onFilterCollapseClicked:function WP$Scheduling$SlotStepController$__onFilterCollapseClicked(){this.__collapseFilters()},__expandFilters:function WP$Scheduling$SlotStepController$__expandFilters(){var e,t="0";this.__shouldAnimateFilters=this.__isFullPageFilters(),this.__shouldAnimateFilters||(t="1"),this.__hideBodyElementsForOverlay(),this.$root.find(".filtertogglecontent").show(),this.$root.find(".filtertogglecontent").css("opacity",t),this.__isFullPageFilters()||this.$root.find(".filtertogglesection").safeAttr("aria-expanded",!0),(e=this.__getFirstFocusableElementInPopup())&&this.__isFullPageFilters()&&($$WPSchedulingUtil.FocusElement(e),this.__handleFocusAfterRedrawingSlotStep=!1),this.__areFiltersCollapsed=!1,this.updateStep()},__getFirstFocusableElementInPopup:function WP$Scheduling$SlotStepController$__getFirstFocusableElementInPopup(){var e,t;return t=this.$root.find(".filtersContainerFull"),(e=this.__getFocusableElements(t)).length>2?$afe.jq(e[0]):null},__collapseFilters:function WP$Scheduling$SlotStepController$__collapseFilters(){this.__showBodyElementsNoOverlay(),this.$root.find(".filtertogglecontent").hide(),this.__isFullPageFilters()||this.$root.find(".filtertogglesection").safeAttr("aria-expanded",!1),this.__handleFocusAfterRedrawingSlotStep=!0,$$WPSchedulingUtil.FocusElement(this.$root.find(".filtertogglesection")),this.__areFiltersCollapsed=!0,this.updateStep()},__onFilterTabPressed:function WP$Scheduling$SlotStepController$__onFilterTabPressed(){if(this.__areFiltersFullScreenExpanded()){var e=this.$root.find(".filtersContainerFull"),t=this.__getFocusableElements(e),i=this.$root.find(".filtercollapsesection"),o=$afe.jq(t[1]);switch(event.keyCode){case 9:event.shiftKey?function handleBackwardTab(){document.activeElement===o[0]&&(event.preventDefault(),$$WPSchedulingUtil.FocusElement(i))}():handleForwardTab();break;case 27:e.find(".filtercollapsesection").trigger("click");break;case 40:handleForwardTab()}}function handleForwardTab(){document.activeElement===i[0]&&(event.preventDefault(),$$WPSchedulingUtil.FocusElement(o))}},__onApptsDetailsToggleClicked:function WP$Scheduling$SlotStepController$__onApptsDetailsToggleClicked(){this.$root.find(".detailsIcon").toggleClass("selected"),this.$root.find(".apptsDetailsecontent").slideToggle(400)},__onRetryClick:function WP$Scheduling$SlotStepController$__onRetryClick(){this.__resetAndLoad()},__fromDateFieldId:function WP$Scheduling$SlotStepController$__fromDateFieldId(){return"fromDate_"+this.Id},__changeSlotDateRange:function WP$Scheduling$SlotStepController$__changeSlotDateRange(e){var t=this.__getValidSlotDte(e);this.__firstDteToShow!==t&&(this.__lockLoadOverlayPosition(),this.__firstDteToShow=t,this.__resetAndLoad(),this.$root.find('input[name="'+this.__fromDateFieldId()+'"]').val($$WPSchedulingUtil.FormatDteAsDate(this.__firstDteToShow)))},__onScroll:function WP$Scheduling$SlotStepController$__onScroll(e){this.__tryLoadOnScroll()},__onLoadAnotherBatchKeyDown:function WP$Scheduling$SlotStepController$__onLoadAnotherBatchKeyDown(e){13===e.which&&(this.__getLoadAnotherBatchButton().click(),e.preventDefault())},__onLoadAnotherBatchClicked:function WP$Scheduling$SlotStepController$__onLoadAnotherBatchClicked(e){this.__shouldTryFocusOnNextDTE=!0,this.__showSlotsWhenLoading=!0,this.__loadNextSlotsBatch(),this.__handleFocusAfterRedrawingSlotStep=!0,this.__getFilterNoSlotsLoaded().css("visibility","hidden"),this.__getLoadAnotherBatchButton().css("visibility","hidden"),this.__getVerboseError().hide(),e.preventDefault()},__onRequestOptionClicked:function WP$Scheduling$SlotStepController$__onRequestOptionClicked(e){var t,i;t=$afe.jq(e.target).closest(".departmentbutton").safeAttr("data-model-id"),i=_.getInstance(t),this.__addSlotToAppointment(0,i),this.$root.find(".expandedrequestsection").hide(),this.__renderHidden=!0,this.$root.hide()},__onExpandRequestClicked:function WP$Scheduling$SlotStepController$__onExpandRequestClicked(){this.$root.find(".expandedrequestsection").show(),this.$root.find("button.expandrequestoptions").hide(),this.$root.find(".hiderequestsection").show(),$$WPSchedulingUtil.FocusElement(this.$root.find(".expandedrequestsection a").first())},__onHideRequestClicked:function WP$Scheduling$SlotStepController$__onHideRequestClicked(){this.$root.find(".hiderequestsection").hide(),this.$root.find(".expandedrequestsection").hide(),this.$root.find("button.expandrequestoptions").show()},__onTimePreferenceChanged:function WP$Scheduling$SlotStepController$__onTimePreferenceChanged(e,t,i,o){var n,l,r,s,a,d,h;switch(this.__focusOnTimePreferenceLabel=!i,this.__handleFocusAfterRedrawingSlotStep=!i,this.__selectedTimePreferenceFilterLabel=null===t?P.LabelValueEnum.AllAvailable:t.safeAttr("value"),this.__checkedBox=o,this.__selectedTimePreferenceFilterLabel){case P.LabelValueEnum.AllAvailable:this.__slotStepSettings.TimePreferences=null,this.__selectedTimePreferenceFilterTimes=[];break;case P.LabelValueEnum.OnFile:this.__slotStepSettings.TimePreferences=this.TimePreferenceWidget.OnFilePreferences;break;case P.LabelValueEnum.Other:if(this.__selectedTimePreferenceFilterTimes=[],0===e.length)this.__slotStepSettings.TimePreferences=null;else for(this.__slotStepSettings.TimePreferences=Array([],[],[],[],[],[],[]),n=0;n<e.length;n++)l=$afe.jq(e[n]),r=(d=$$WPSchedulingUtil.GetTimePreferenceRangeProps(l)).DayOfWeekIndex,s=d.StartTime,a=d.EndTime,h=d.RangeElement,this.__slotStepSettings.TimePreferences[r]=this.__slotStepSettings.TimePreferences[r]||[],this.__slotStepSettings.TimePreferences[r].push([s,a]),this.__selectedTimePreferenceFilterTimes.push({DayIndex:r,RangeElement:h})}this.__hasNewFilteredSlots=!1,this.updateStep()},__onClearFiltersClicked:function WP$Scheduling$SlotStepController$__onClearFiltersClicked(){this.__isAtLeastOneFilterSelected()&&(this.FilterController.clearAllFilters(!0),this._workflow.Type===c.WorkflowTypesEnum.OnDemandTelehealth&&this.Data.TelehealthData.SelectedWorkflow===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection?this.__onResetCalendarFilterClicked():(this.FilterController.filterProvidersBySelection(),this.FilterController.notifyProviderDepartmentFilterListeners()),this.__onClearTimeFiltersClicked()),this.Data.AppointmentBuilder.setProperty("SearchPriority",$$WP.Scheduling.AppointmentBuilder.SearchPriorityEnum.Earliest),this.ViewModel.SearchPriority=this.Data.AppointmentBuilder.SearchPriority},__onClearTimeFiltersClicked:function WP$Scheduling$SlotStepController$__onClearTimeFiltersClicked(){this.__onTimePreferenceChanged(null,null,!0,null)},__onResetCalendarFilterClicked:function WP$Scheduling$SlotStepController$__onResetCalendarFilterClicked(){this.__latestUserSelectedDte=this.__minDte,this.__changeSlotDateRange(this.__minDte)},__resetAndLoad:function WP$Scheduling$SlotStepController$__resetAndLoad(){0===this.Data.NumStepsReloading&&(this.__isDirty=!1,this.__midSlotsMultiApptViewBannerDaysBeforeContent=0,this.Data.SlotLoader.initialize(this.__firstDteToShow,this._workflow,this.Data.AppointmentBuilder,this.__slotStepSettings.UseOnFileTimePreferences),this.__hasNewFilteredSlots=!1,this.__loadNextSlotsBatch())},__loadNextSlotsBatch:function WP$Scheduling$SlotStepController$__loadNextSlotsBatch(){this.__announceSlotsLoadAlert(),this.Data.SlotLoader.loadNextSlots(this.__onSlotsLoaded),this.Active?this.Data.SlotLoader.isLoading()?(this.__handleFocusAfterRedrawingSlotStep=!0,$$WPUtil.ShowAjaxSpinner(this.__getLoadingOverlay()),this.$root.find(".nodata").hide(),this.__showSlotsWhenLoading||this.__hideSlots(),this.__getFilterPosition()!==t.Dropdown||this.__areFiltersCollapsed||this.__lockLoadOverlayPosition()):(this.__getFilterNoSlotsLoaded().show(),this.__getLoadAnotherBatchButton().show()):(this.__handleFocusAfterRedrawingSlotStep=!1,this.updateStep())},__recalculateProvDepPairs:function WP$Scheduling$SlotStepController$__recalculateProvDepPairs(){var e,t,i=this.Data.AppointmentBuilder.numAppointments();for(e=0;e<i;e++)(t=this.Data.AppointmentBuilder.getAppointment(e)).ProviderDepartmentPairs=this.__getAvailableDirectProviderDepartmentPairs(t),t.ProviderDepartmentPairs.sort(this.__getSortProviderDepartmentPairsForDisplay(t))},__onSlotsLoaded:function WP$Scheduling$SlotStepController$__onSlotsLoaded(e){this.__generateSolutionViewModelProperties(e),this.__generateSolutionGroupKeys(e),this.__releaseLoadOverlayPosition(),this.__handleFocusAfterRedrawingSlotStep=!0,this.__hasNewFilteredSlots=this.__checkHasNewFilteredSlots(e),this.__showSlotsWhenLoading=!1,this.__tryLoadNextBatchForEmbeddedWorkflow(e),this.__checkIfFirstSlotLoadForTieredScheduling(),this.updateStep()},__checkIfFirstSlotLoadForTieredScheduling:function WP$Scheduling$SlotStepController$__checkIfFirstSlotLoadForTieredScheduling(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e);t.VisitType&&t.VisitType.HasAlreadyLoadedTieredData&&!t.HasAlreadyLoadedTieredSchedulingSlots&&(this.__selectAdditionalProvidersAddedBanner=!0,t.HasAlreadyLoadedTieredSchedulingSlots=!0)},__tryLoadNextBatchForEmbeddedWorkflow:function WP$Scheduling$SlotStepController$__tryLoadNextBatchForEmbeddedWorkflow(e){this.__allowScrollLoading||(this.__numConsecutiveEmbeddedSlotLoads>=this.__slotStepSettings.EmbeddedConsecutiveSlotLoadLimit-1||this.__runningCountSlotsLoadedPerEmbeddedSlotLoad>=this.__minimumNewSlotsNeededEachEmbeddedLoad||this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected()?(this.__numConsecutiveEmbeddedSlotLoads=0,this.__runningCountSlotsLoadedPerEmbeddedSlotLoad=0):(this.__numConsecutiveEmbeddedSlotLoads=this.__numConsecutiveEmbeddedSlotLoads+1,this.__runningCountSlotsLoadedPerEmbeddedSlotLoad=this.__runningCountSlotsLoadedPerEmbeddedSlotLoad+e.length,this.__showSlotsWhenLoading=!0,this.__loadNextSlotsBatch()))},__announceSlotsLoadAlert:function WP$Scheduling$SlotStepController$__announceSlotsLoadAlert(){this._firstRender||$$WPSchedulingUtil.AnnounceMessage($$WP.Strings.getForTemplate("SlotsLoadAccessibilityAlert"))},__generateSolutionGroupKeys:function WP$Scheduling$SlotStepController$__generateSolutionGroupKeys(e){var t=0,i=null;for(t=0;t<e.length;t++)(i=e[t]).setProperty("DateKey",this.__getSolutionDateKey(i)),i.setProperty("ProviderGroupKey",this.__getSolutionProviderGroupKey(i)),i.setProperty("LocationGroupKey",this.__getSolutionLocationGroupKey(i)),i.setProperty("EffectiveApptTimeKey",this.__getSolutionApptTimeKey(i))},__getSolutionDateKey:function WP$Scheduling$SlotStepController$__getSolutionDateKey(e){var t=this.Data.AppointmentBuilder.getActiveApptIndex();return e.Slots[t].DisplayDte},__getSolutionProviderGroupKey:function WP$Scheduling$SlotStepController$__getSolutionProviderGroupKey(e){return o(this.__getVisibleSolutionProviderIds(e))},__checkHasNewFilteredSlots:function WP$Scheduling$SlotStepController$__checkHasNewFilteredSlots(e){var t,i,o,n,l,r;if(null===e||0===e.length)return!1;if(!Array.isArray(this.__slotStepSettings.TimePreferences))return!0;for(l=0;l<e.length;l++)if((t=e[l])&&t.Slots)for(r=0;r<t.Slots.length;r++)if((!this.__showSingleApptSelectSolutionsView||r===this.Data.AppointmentBuilder.getActiveApptIndex())&&(i=t.Slots[r])&&(o=u.Dte2Date(i.Dte).getDay(),n=i.StartTime,this.__isSlotInSelectedPreferences(n,this.__slotStepSettings.TimePreferences[o])))return!0;return!1},__isCalendarSetToEarliestDte:function WP$Scheduling$SlotStepController$__isCalendarSetToEarliestDte(){return this.__firstDteToShow===this.__minDte},__getVisibleSolutionProviderIds:function WP$Scheduling$SlotStepController$__getVisibleSolutionProviderIds(e){var t=[],i=0;for(i=0;i<e.Slots.length;i++)this.__showSingleApptSelectSolutionsView&&i!==this.Data.AppointmentBuilder.getActiveApptIndex()||$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,this.Data.AppointmentBuilder.getAppointment(i))&&t.push(e.Slots[i].ProviderId);return t},__getSolutionLocationGroupKey:function WP$Scheduling$SlotStepController$__getSolutionLocationGroupKey(e){return o(this.__getVisibleSolutionLocationIds(e))},__getVisibleSolutionLocationIds:function WP$Scheduling$SlotStepController$__getVisibleSolutionLocationIds(e){var t=[],i=[],o=0,n=null;for(o=0;o<e.Slots.length;o++)this.__showSingleApptSelectSolutionsView&&o!==this.Data.AppointmentBuilder.getActiveApptIndex()||(n=this.Data.AppointmentBuilder.getAppointment(o),this.__canAppointmentDisplayLocationInformation(n)&&(t=[e.Slots[o].DepartmentId],i.push(this.__getLocationIdsFromDepartmentIds(t,n))));return i},__getLocationIdsFromDepartmentIds:function WP$Scheduling$SlotStepController$__getLocationIdsFromDepartmentIds(e,t){var i=0,o=[],n=null,l=null,r=t.areLocationsGrouped();for(i=0;i<e.length;i++)n=this.Data.Departments.getFromIndex("ID",e[i]),(l=g.getLocationFromDepartment(n,this.Data.Locations,r))&&o.push(l.Id);return o},__getSolutionApptTimeKey:function WP$Scheduling$SlotStepController$__getSolutionApptTimeKey(e){var t=this.Data.AppointmentBuilder.getActiveApptIndex();return e.Slots[t].EffectiveApptTime},__generateSolutionViewModelProperties:function WP$Scheduling$SlotStepController$__generateSolutionViewModelProperties(e){var t=0,i=null;for(t=0;t<e.length;t++)(i=e[t]).Slots.length>1&&(this.__doesSolutionRequireComplexMultiApptView(i)||this.__isSimpleMultiApptWorkflow||this.__isComplexMultiApptWorkflow?this.__doesSolutionRequireComplexMultiApptView(i)&&!this.__isSimpleMultiApptWorkflow&&(this.__isComplexMultiApptWorkflow=!0,this.__showDetailedSolutionsView||(this.__showSingleApptSelectSolutionsView=!0,this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped=!1,this._workflow.MultiApptSlotStepStartingView=c.MultiApptSlotStepViewTypeEnum.OneApptAtATimeView)):(this.__isSimpleMultiApptWorkflow=!0,this._workflow.MultiApptSlotStepStartingView=c.MultiApptSlotStepViewTypeEnum.SimpleSlotsView))},__doesSolutionRequireComplexMultiApptView:function WP$Scheduling$SlotStepController$__doesSolutionRequireComplexMultiApptView(e){return!(e.areAllSlotsOnTheSameDay()&&this.Data.AppointmentBuilder.hasAllSameSingleLocationSelected()&&1===this.Data.AppointmentBuilder.SearchPriority)},__getAvailableDirectProviderDepartmentPairs:function WP$Scheduling$SlotStepController$__getAvailableDirectProviderDepartmentPairs(e){var t,i=[],o=[],n=[],l=[],r=this.Data.AppointmentBuilder.getActiveApptIndex(),s=this.Data.AppointmentBuilder.getAppointment(r);for(i=this.__getInitialAvailableDirectProviderDepartmentPairs(e),this.Data.AppointmentBuilder.UseTeams&&(o=this.__getAvailableDirectTeamProviderDepartmentPairs(e),this.__appendProviderDepartmentPairs(i,o)),e.IsUsingTieredData&&(n=this.__getAvailableDirectTieredProviderDepartmentPairs(e),this.__appendProviderDepartmentPairs(i,n)),this.Data.AppointmentBuilder.CanSearchAllLicensedVideoProviders&&e.isVideoVisit()&&(l=this.__getAvailablePairsForPatientLocation(e),this.__appendProviderDepartmentPairs(i,l)),e.isVideoVisit()&&this.__canLoadProvidersWithTelehealthLocations()&&!e.CanSkipLicensureCheck&&(i=C.GetPairsLicensedInLocation(i,this.Data.AppointmentBuilder.PatientLocation,this.Data.AppointmentBuilder.PatientSublocation)),this.__isAtLeastOneProviderFilterSelected()&&(i=this.__filterPairsByFilterSelections(i,e)),t=0;t<i.length;t++)i[t].determinePatientAge(s.VisitType.ID),i[t].setNetworkStatusOnProvider();return i=this.FilterController.filterProviderDepartments(i)},__filterPairsByFilterSelections:function WP$Scheduling$SlotStepController$__filterPairsByFilterSelections(e,t){var i,o=[];for(i=0;i<e.length;i++){var n=e[i].Provider;t.Providers.contains(n)&&o.push(e[i])}return o},__getAvailablePairsForPatientLocation:function WP$Scheduling$SlotStepController$__getAvailablePairsForPatientLocation(t){var i=[];return this.__mode!==e.RequestOnly&&this.arePrerequisitesComplete()&&(i=t.CanSkipLicensureCheck?t.ReasonForVisit.DirectProviderDepartmentPairs:C.GetPairsLicensedInLocation(t.ReasonForVisit.DirectProviderDepartmentPairs,this.Data.AppointmentBuilder.PatientLocation,this.Data.AppointmentBuilder.PatientSublocation)),t.VisitType&&!t.IsUsingTieredData&&(i=this.__removeProviderDepartmentPairsArray(i,t.VisitType.TieredProviderDepartmentPairsCollection.toArray())),i},__appendProviderDepartmentPairs:function WP$Scheduling$SlotStepController$__appendProviderDepartmentPairs(e,t){var i=null,o=0;for(o=0;o<t.length;o++)i=t[o],d(e,i.ProviderId,i.DepartmentId)||e.push(i)},__isProviderDepartmentPairInList:function WP$Scheduling$SlotStepController$__isProviderDepartmentPairInList(e,t,i){var o=0;for(o=0;o<e.length;o++)if(e[o].ProviderId===t&&e[o].DepartmentId===i)return!0;return!1},__getInitialAvailableDirectProviderDepartmentPairs:function WP$Scheduling$SlotStepController$__getInitialAvailableDirectProviderDepartmentPairs(t){var i,o=[],n=(t.VisitType,[]),l=0,r=null,s=null,a=null;if(this.__mode===e.RequestOnly||!this.arePrerequisitesComplete())return o;if(i=t.ReasonForVisit,n=t.getSelectedDepartmentsCollection(),$$WPUtil.IsNullOrEmpty(i))return[];for(l=0;l<i.DirectProviderDepartmentPairs.length;l++)r=i.DirectProviderDepartmentPairs[l],s=this.Data.Providers.getFromIndex("ID",r.ProviderId),a=this.Data.Departments.getFromIndex("ID",r.DepartmentId),F.isProviderDepartmentPairFromFirstTier(t,r)&&(t.IsProviderAnyOptionSelected&&n.contains(a)||t.Providers.contains(s)&&n.contains(a))&&o.push(r);return o},__getAvailableDirectTeamProviderDepartmentPairs:function WP$Scheduling$SlotStepController$__getAvailableDirectTeamProviderDepartmentPairs(e){var t,i,o,n,r=0,s=0,a=null,d=null,h=null,_=null,u=null,p=[],c=null,g=null;if(t=this.__getInitialAvailableDirectProviderDepartmentPairs(e),i=e.VisitType,o=e.getSelectedDepartmentsCollection(),n=!!i&&!e.isAppointmentInPerson(),!this.arePrerequisitesComplete()||this.__isTicketWorkflow()||this.__isRescheduleWorkflow())return[];for(r=0;r<t.length;r++)if(a=this.Data.Providers.getFromIndex("ID",t[r].ProviderId),d=this.Data.Departments.getFromIndex("ID",t[r].DepartmentId),u=S.getVisitTypeForDepartment(this.Data,e,d),(_=this.__getAllowTeamScheduling(u,d))!==S.AllowTeamSchedulingEnum.NoTeamScheduling&&(_!==S.AllowTeamSchedulingEnum.PcpOnly||a.IsPCP))for(s=0;s<a.TeamProviderDepartmentPairs.length;s++)g=a.TeamProviderDepartmentPairs[s],c=this.Data.Providers.getFromIndex("ID",g.ProviderId),h=this.Data.Departments.getFromIndex("ID",g.DepartmentId),l(c,h,o,n)&&p.push(g);return p},__getAvailableDirectTieredProviderDepartmentPairs:function WP$Scheduling$SlotStepController$__getAvailableDirectTieredProviderDepartmentPairs(e){var t,i=0,o=[],n=e.getSelectedDepartmentsCollection();if(!this.arePrerequisitesComplete())return[];var l=e.ReasonForVisit;if($$WPUtil.IsNullOrEmpty(l))return[];for(t=e.VisitType.TieredProviderDepartmentPairsCollection.toArray(),i=0;i<t.length;i++)currentPair=t[i],currentProvider=this.Data.Providers.getFromIndex("ID",currentPair.ProviderId),currentDepartment=this.Data.Departments.getFromIndex("ID",currentPair.DepartmentId),(e.IsProviderAnyOptionSelected&&!$$WPUtil.IsNullOrEmpty(n.getFromIndex("ID",currentDepartment.ID))||e.Providers.contains(currentProvider)&&!$$WPUtil.IsNullOrEmpty(n.getFromIndex("ID",currentDepartment.ID)))&&o.push(currentPair);return o},__initializeDateRange:function WP$Scheduling$SlotStepController$__initializeDateRange(){var e,t,o=null,n=[],l=null,r=0,s=0,a=0,d=0,h=null,_=null,p=null;for(t=this.__getDefaultOffsets(),e=this.Data.AppointmentBuilder.numAppointments(),a=0;a<e;a++)for(n=(o=this.Data.AppointmentBuilder.getAppointment(a)).getSelectedDepartmentsCollection().toArray(),d=0;d<n.length;d++)(h=n[d])&&"-1"===h.ID||(_=null,(l=$$WPUtil.IsNullOrEmpty(o.PanelId)?S.getVisitTypeForDepartment(this.Data,o,h):this.Data.VisitTypes.getFromIndex("ID",o.PanelId))&&(_=this.Data.VisitTypeDepartmentOverrides.getFromIndex("Id",l.ID+"^"+h.ID)),p=i([[_&&_.FromMinutesOffset,_&&_.FromDaysOffset,_&&_.ToDaysOffset],[h.FromMinutesOffset,h.FromDaysOffset,h.ToDaysOffset],[l&&l.FromMinutesOffset,l&&l.FromDaysOffset,l&&l.ToDaysOffset],[this.__slotStepSettings.FromMinutesOffset,this.__slotStepSettings.FromDaysOffset,this.__slotStepSettings.ToDaysOffset],t]),$$WP.Utilities.IsNullOrEmpty(p[1])&&(p[1]=t[1]),$$WP.Utilities.IsNullOrEmpty(p[2])&&(p[2]=t[2]),this.__setNewProviderOffsetOverrides(p),0===a&&0===d?(r=p[1],s=p[2]):(r=Math.min(r,p[1]),s=Math.max(s,p[2])));this.__minDte=u.todaysDte+r,this.__maxDte=u.todaysDte+s,this.__maxCalendarDte=u.todaysDte+s,(this.__isTicketWorkflow()||this.__isRescheduleWorkflow())&&this.__adjustDatesForTickets(),this.__firstDteToShow=this.__getValidSlotDte(this.__firstDteToShow)},__adjustDatesForTickets:function WP$Scheduling$SlotStepController$__adjustDatesForTickets(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=null,i=0,o=0;this.__showSingleApptSelectSolutionsView?(i=(t=this.Data.AppointmentBuilder.getAppointment(e)).ReasonForVisit.ApptComponentItems.FromDte,(o=t.ReasonForVisit.ApptComponentItems.ExpirationDte)>0&&(this.__maxCalendarDte=Math.min(this.__maxCalendarDte,o)),!$$WP.Utilities.IsNullOrEmpty(this.__slotStepSettings.ToDte)&&this.__slotStepSettings.ToDte>0&&(this.__maxCalendarDte=Math.min(this.__maxCalendarDte,this.__slotStepSettings.ToDte))):$$WP.Utilities.IsNullOrEmpty(this.__slotStepSettings.BundleId)?!$$WP.Utilities.IsNullOrEmpty(this.__slotStepSettings.ToDte)&&this.__slotStepSettings.ToDte>0&&(this.__maxCalendarDte=Math.min(this.__maxCalendarDte,this.__slotStepSettings.ToDte)):!$$WP.Utilities.IsNullOrEmpty(this.__slotStepSettings.ExpirationDte)&&this.__slotStepSettings.ExpirationDte>0&&(this.__maxCalendarDte=Math.min(this.__maxCalendarDte,this.__slotStepSettings.ExpirationDte)),$$WP.Utilities.IsNullOrEmpty(this.__slotStepSettings.FromDte)||(this.__minDte=Math.max(this.__minDte,this.__slotStepSettings.FromDte,i)),!$$WP.Utilities.IsNullOrEmpty(this.__slotStepSettings.ToDte)&&this.__slotStepSettings.ToDte>0&&(this.__maxDte=Math.min(this.__maxDte,this.__slotStepSettings.ToDte))},__isAtLeastOneFilterSelected:function WP$Scheduling$SlotStepController$__isAtLeastOneFilterSelected(){return this.__isAtLeastOneProviderFilterSelected()||this.__isAtLeastOneTimeFilterSelected()},__isAtLeastOneProviderFilterSelected:function WP$Scheduling$SlotStepController$__isAtLeastOneProviderFilterSelected(){var e=this.FilterController.getSelectedFilters();return null!==e&&e.length>0},__isAtLeastOneTimeFilterSelected:function WP$Scheduling$SlotStepController$__isAtLeastOneTimeFilterSelected(){return null!==this.__selectedTimePreferenceFilterTimes&&this.__selectedTimePreferenceFilterTimes.length>0||null!==this.__selectedTimePreferenceFilterLabel&&this.__selectedTimePreferenceFilterLabel===P.LabelValueEnum.OnFile},__shouldRenderRefineSearch:function WP$Scheduling$SlotStepController$__shouldRenderRefineSearch(){return this.__shouldShowGranularProviderFilters()&&(this.__isTimePreferencesWidgetVisible()||this.__shouldShowSearchPriorityFilterInSidebar()||(this.__forceShowFilters||this.__isAnyProviderSelectedInAllActiveAppointments())&&this.__doesAnyAppointmentAllowProviderSelection()&&this.FilterController.isProviderFilteringAvailable())},__getDefaultOffsets:function WP$Scheduling$SlotStepController$__getDefaultOffsets(){return this.__isOpenSchedulingWorkflow()?[null,this.__slotStepSettings.NewProvFromDaysOffset,this.__slotStepSettings.NewProvToDaysOffset]:[null,5,30]},__setNewProviderOffsetOverrides:function WP$Scheduling$SlotStepController$__setNewProviderOffsetOverrides(e){this.__isOpenSchedulingWorkflow()&&(e[1]=Math.max(e[1],this.__slotStepSettings.NewProvFromDaysOffset),e[2]=Math.min(e[2],this.__slotStepSettings.NewProvToDaysOffset))},__getValidSlotDte:function WP$Scheduling$SlotStepController$__getValidSlotDte(e){var t=e;return t=Math.max(t,this.__minDte),t=Math.min(t,this.__maxDte)},__buildViewModel:function WP$Scheduling$SlotStepController$__buildViewModel(){var e,i,o;i=$$WP.Utilities.UI.IsSmallScreen(),o=$$WP.Utilities.UI.IsMobile;var n=this.Data.SlotLoader.getError(this.SchedulingStringsNamespace),l=this.__getAnotherBatchButtonLabels(),r=this.Data.AppointmentBuilder.getActiveApptIndex(),s=this.Data.AppointmentBuilder.getAppointment(r);this.ViewModel={StepControllerId:this.Id,Days:[],ShowLocationHeaders:!1,ShowProviderHeaders:!1,ShowGranularFilters:this.__shouldShowGranularProviderFilters(),ShowProviderFilters:this.__shouldShowGranularProviderFilters()&&this.__isAnyProviderSelectedInAllActiveAppointments()&&this.__doesAnyAppointmentAllowProviderSelection(),forceShowFilters:this.__forceShowFilters,StepSelections:this.__getStepSelectionsViewModel(),IsLocationSummaryVisible:this.__shouldShowLocationSummary(),CanEditLocations:$$WPSchedulingUtil.CanEditStep(this.Data,this._workflow.Type,$$WP.Scheduling.SchedulingStep.StepTypeEnum.Location,this.__slotStepSettings.IsDepartmentStepHiddenByQueryParams),IsProviderSummaryVisible:this.__shouldShowProviderSummary(),CanEditProviders:$$WPSchedulingUtil.CanEditStep(this.Data,this._workflow.Type,$$WP.Scheduling.SchedulingStep.StepTypeEnum.Provider,this.__slotStepSettings.IsProviderStepHiddenByQueryParams),ShowLoadAnotherBatch:!1,ShowNoNewFilteredSlotsMessage:!this.__hasNewFilteredSlots,NoSlotsShown:!1,IsCalendarSetToEarliestDte:this.__isCalendarSetToEarliestDte(),FromDate:$$WPSchedulingUtil.FormatDteAsDate(this.__firstDteToShow),FromDateFieldId:this.__fromDateFieldId(),ProvidersForRequest:[],ShowDirectRequestLink:!1,TeamSchedulingDefaultChecked:this.Data.AppointmentBuilder.UseTeams,TeamSchedulingShowInSidebar:this.__shouldShowTeamSchedulingInSidebar(),MidSlotsActionBannerViewModel:null,ShowMidSlotsActionBanner:!1,FiltersHelperShowBeforeDte:0,FiltersHelperShowMidSlots:!1,FilterPosition:this.__getFilterPosition(),FilterPositionEnum:t,AreFiltersCollapsed:this.__areFiltersCollapsed,IsFullPageFilters:this.__isFullPageFilters(),ShowRequestsInSidebar:!(i||o),SlotsLoadingMoreMessage:this.SchedulingStringsNamespace.getString("SlotsLoadingMoreMessage"),ShowRetryButton:this.Data.SlotLoader.isLastLoadTemporaryFail(),ShowVerboseError:this.Data.SlotLoader.hasVerboseError(),ScheduledAppointmentName:this.Data.AppointmentBuilder.TicketName,RelatedScheduledAppts:this.Data.AppointmentBuilder.RelatedAppointments,HasFutureAppointment:this.Data.AppointmentBuilder.HasFutureAppointment,VerboseErrorDescription:n.Description,VerboseErrorInstructions:n.Instructions,AnotherBatchButtonLabel:l.Label,AnotherBatchButtonLabelDetailed:l.DetailedLabel,ShowSolutionDetails:!1,ShowSingleApptSelectSolutionsView:!1,CurrentApptBeingSelected:this.__getCurrentApptBeingSelected(),SearchPriority:this.Data.AppointmentBuilder.SearchPriority,IsSearchPrioritySameDay:1===this.Data.AppointmentBuilder.SearchPriority,ShowSearchPriorityFilterInSidebar:!1,SlotStepTitleWithVisitType:"",SlotStepTitleScreenReaderHelper:"",ShowOneApptAtATimeButtonMidSlots:!1,ShowFullSolutionsButtonMidSlots:!1,MultiApptViewBannerShowBeforeDte:0,MultiApptViewBannerShowAfterSlots:!1,ShowTicketWaitListOptInMessage:this.__shouldShowTicketWaitListOptions(),ShowTimePreferences:this.__isTimePreferencesWidgetVisible(),StartDateValidationSettings:$$WPSchedulingUtil.GetDateFieldValidationSettings(WP.Utils.dte2date(this.__minDte),WP.Utils.dte2date(this.__maxDte),!0),PhoneNumberToDisplayForNoSlots:"",IsAtLeastOneFilterSelected:this.__isAtLeastOneFilterSelected(),IsAtLeastOneTimeFilterSelected:this.__isAtLeastOneTimeFilterSelected(),ViewResultsText:this.__getViewResultsText(),NoProvidersFound:0===this.__getSelectedProviderCount(),ShouldMoveOverlayDown:this.__shouldMoveOverlayDown,ShouldAnimateFilters:this.__shouldAnimateFilters,StepHeader:this.__getStepHeaderText(),UseAnonymousOSFiltersButton:!$$WP.WidgetMode&&this.__isOpenSchedulingWorkflow()&&this._workflow.IsAnonymous,CanShowInPersonTelehealthMode:!1,CanShowVideoTelehealthMode:!1,CanShowTelephoneTelehealthMode:!1,CanShowProviderTelehealthBadges:!1,CanShowTelehealthToggles:this.__canShowTelehealthToggle(),IsEmbedded:this._workflow.SchedulingControllerParams.embedded,hasApptRequest:this.Data.AppointmentBuilder.ReasonForVisit.AppointmentRequestIds.length>0,ShouldRenderRefineSearch:this.__shouldRenderRefineSearch(),ShowOriginalAppts:!!this.__originalAppointmentInfo,ViewModelApptIndex:this.Data.AppointmentBuilder.getActiveApptIndex(),IsBundled:""!=this.Data.AppointmentBuilder.getBundleID(),IsRescheduleWorkflow:this.__isRescheduleWorkflow(),IsCurrentDteGreaterThanMaxCalendarDte:this.Data.SlotLoader.getSearchRangeStartDte()>=this.__maxCalendarDte,HasOnlyOneAppointment:1===this.Data.AppointmentBuilder.numAppointments(),HasSlots:this.Data.Solutions.Models.length>0,HasAlreadyLoadedTieredData:s.VisitType.HasAlreadyLoadedTieredData,IsUsingTieredData:s.IsUsingTieredData,CanShowCombinedActionBanner:!1,CanShowRequestSection:!1},this.arePrerequisitesComplete()&&(e=this.__getSlotKeyForCurrentSelections(),this.__buildViewModelForTelehealthMode(),this.__buildViewModelForAllSlots(e),this.__buildViewModelForProvidersForRequest(),(this.__shouldShowFullSolutionsButtonMidSlots()||this.__shouldShowOneApptAtATimeButtonMidSlots())&&this.__buildViewModelForMidSlotsMultiApptBanner(),this.__shouldShowExpandSearchOptionMidSlots()?this.__buildViewModelForMidSlotsTierExpansion():this.__shouldShowAddAllProvidersOption()?this.__buildViewModelForMidSlotsShowAllProviders():this.__shouldShowAddOutOfNetworkProvidersOption()?this.__buildViewModelForMidSlotsShowOutOfNetworkProviders():this.__shouldShowTeamsMidSlots()&&this.__buildViewModelForMidSlotsTeams(),this.__isAtLeastOneProviderFilterSelected()&&this.Data.AppointmentBuilder.UseTeams&&this.__buildViewModelForMidSlotsFilters(),this.__buildViewModelForRedirectionPhoneNumber(),this.__buildViewModelForPatientLocation(),this.__buildSlotsLoadingMessage())},__buildSlotsLoadingMessage:function WP$Scheduling$SlotStepController$__buildSlotsLoadingMessage(){this.ViewModel.Days.length>0&&this.__isViewModelTieredDataRemoved()?this.ViewModel.SlotsLoadingMessage=this.SchedulingStringsNamespace.getString("SlotsLoadingMoreMessage"):this.ViewModel.SlotsLoadingMessage=this.__getSlotLoadingMessage()},__isViewModelTieredDataRemoved:function WP$Scheduling$SlotStepController$__isViewModelTieredDataRemoved(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e),i=t.VisitType;return!(!t||!i)&&!(this.__isTieredSchedulingAllowed&&i.HasAlreadyLoadedTieredData&&t.IsUsingTieredData)},__shouldShowFilterHelperMidSlots:function WP$Scheduling$SlotStepController$__shouldShowFilterHelperMidSlots(){return this.__isAtLeastOneProviderFilterSelected()&&(this.Data.AppointmentBuilder.UseTeams||this.Data.AppointmentBuilder.CanSearchAllLicensedVideoProviders)},__getStepHeaderText:function WP$Scheduling$SlotStepController$__getStepHeaderText(){var e="",t=null,i="";return this.__isOpenSchedulingWorkflow()?(t=this.Data.AppointmentBuilder.getFirstAppointment(),i=$$WPSchedulingUtil.GetVisitDisplayName(t,null,t.SelectedTelehealthMode),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@REASONFORVISITTITLE@",i,$$WP.Strings.EncodingTypes.None),$$WPUtil.IsNullOrEmpty(this.__slotStepSettings.WidgetStringKey)||(e=this.SchedulingStringsNamespace.getString("OpenSchedulingSlotStepTitle_"+this.__slotStepSettings.WidgetStringKey)),$$WPUtil.IsNullOrEmpty(e)&&(e=this.SchedulingStringsNamespace.getString("OpenSchedulingSlotStepTitle")),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@REASONFORVISITTITLE@")):e=this.__shouldShowMultiApptDetailedSlotView()?this.SchedulingStringsNamespace.getString("MultipleAppointmentDetailedSlotStepTitle"):this.__shouldShowMultiApptSimpleSlotView()?this.SchedulingStringsNamespace.getString("MultipleAppointmentSimpleSlotStepTitle"):this.SchedulingStringsNamespace.getString("SlotStepTitle"),e},__getFilterPosition:function WP$Scheduling$SlotStepController$__getFilterPosition(){return $$WP.Utilities.UI.IsLargePhoneOrSmaller()||$$WP.Utilities.UI.IsMobile?t.Dropdown:t.RightSidebar},__getStepSelectionsViewModel:function WP$Scheduling$SlotStepController$__getStepSelectionsViewModel(){var e,t;return t=$$WPSchedulingUtil.GetLocationsSummaryArray(this.Data),e=$$WPSchedulingUtil.GetProvidersSummaryArray(this.Data),{Locations:$$WPSchedulingUtil.GetCondensedFilterString(t),Providers:$$WPSchedulingUtil.GetCondensedFilterString(e)}},__getCurrentApptBeingSelected:function WP$Scheduling$SlotStepController$__getCurrentApptBeingSelected(){return this.__showSingleApptSelectSolutionsView?this.Data.AppointmentBuilder.getActiveApptIndex():0},__buildViewModelForRedirectionPhoneNumber:function WP$Scheduling$SlotStepController$__buildViewModelForRedirectionPhoneNumber(){var e,t=0,i=0,o=null,n=[],l=null,r="",s="",a=0;for(e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)for(o=this.Data.AppointmentBuilder.getAppointment(t),a=(n=this.__getAvailableDirectProviderDepartmentPairs(o)).length,i=0;i<a;i++){if(null===(l=n[i]).Department)return;if(r=l.Department.IsUsingOverridePhoneNumber?l.Department.OverridePhoneNumber:l.Department.PhoneNumber,$$WPUtil.IsNullOrEmpty(r))return;if(""!==s&&s!==r)return;s=r}this.ViewModel.PhoneNumberToDisplayForNoSlots=s},__buildViewModelForPatientLocation:function WP$Scheduling$SlotStepController$__buildViewModelForPatientLocation(){var e=null;this.__canShowPatientLocationBanner()&&((e=this.Data.AppointmentBuilder.PatientLocation)?(this.__setPatientLocationMnemonics(e),this.ViewModel.NoVideoProvidersHeading=this.SchedulingStringsNamespace.getString("NoVideoProvidersHeading")):this.ViewModel.NoVideoProvidersHeading=this.SchedulingStringsNamespace.getString("SlotsNoVideoProvidersMessage"),this.ViewModel.NoVideoVisitProviders=!this.Data.AppointmentBuilder.hasVideoVisitLicensedProviders()&&!this.__isAtLeastOneFilterSelected(),this.ViewModel.CanAddVideoVisitProviders=this.__canShowAddVideoVisitProviders(),this.__buildViewModelForPatientLocationBanner(),this.ViewModel.NoVideoProvidersHelpText=this.__getNoVideoProvidersHelpText(e),this.SchedulingStringsNamespace.clearMnemonics())},__canShowAddVideoVisitProviders:function WP$Scheduling$SlotStepController$__canShowAddVideoVisitProviders(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e);return this.__canAddVideoVisitProviders()&&!this.__getIsTieredSchedulingAllowed(t)},__setPatientLocationMnemonics:function WP$Scheduling$SlotStepController$__setPatientLocationMnemonics(e){this.SchedulingStringsNamespace.addMnemonic("@MYCHART@PATIENTLOCATION@",e.LocationName,$$WP.Strings.EncodingTypes.None)},__canShowPatientLocationBanner:function WP$Scheduling$SlotStepController$__canShowPatientLocationBanner(){var e,t;return!this.Data.AppointmentBuilder.IsPatientLocationRuleRunning&&!this.__canSkipLicensureCheckForActiveAppointment()&&(e=this.Data.AppointmentBuilder.numAppointments(),t=this.__isActiveSolutionVideoVisit(),!this.__showSingleApptSelectSolutionsView&&e>1&&(0!==this.Data.SlotLoader.numIncrementalLoadsCompleted()||!this.Data.SlotLoader.isLoading()&&!this.Data.SlotLoader.isLastLoadSuccess())&&(t=this.Data.AppointmentBuilder.hasVideoVisit()),this._workflow.Type!==c.WorkflowTypesEnum.OnDemandTelehealth&&t&&this.__canLoadProvidersWithTelehealthLocations())},__canLoadProvidersWithTelehealthLocations:function WP$Scheduling$SlotStepController$__canLoadProvidersWithTelehealthLocations(){return this.__hasTelehealthLocations()&&this.Data.AppointmentBuilder.hasProvidersWithTelehealthLocations()&&!this.__isOtherProviderSelected()},__canSkipPatientLocationStep:function WP$Scheduling$SlotStepController$__canSkipPatientLocationStep(){return!(!this.Data.AppointmentBuilder.canSkipLicensureForAllVideoVisits()&&this.__hasTelehealthLocations())||(this.__slotStepSettings.IsPatientLocationStepRequiredBySetting?!this.__isActiveSolutionVideoVisit():!this.__canShowPatientLocationBanner())},__isActiveSolutionVideoVisit:function WP$Scheduling$SlotStepController$__isActiveSolutionVideoVisit(){var e=0,t=this.Data.AppointmentBuilder.numAppointments();return!(!this.__showSingleApptSelectSolutionsView||(e=this.Data.AppointmentBuilder.getActiveApptIndex(),!this.Data.AppointmentBuilder.getAppointment(e).isVideoVisit()))||1===t&&this.Data.AppointmentBuilder.hasVideoVisit()},__hasTelehealthLocations:function WP$Scheduling$SlotStepController$__hasTelehealthLocations(){return 0!==this.Data.TelehealthLocations.size()},__isOtherProviderSelected:function WP$Scheduling$SlotStepController$__isOtherProviderSelected(){return 0!==this.Data.AppointmentBuilder.getFirstAppointment().Providers.size()&&"-1"===this.Data.AppointmentBuilder.getFirstAppointment().Providers.Models[0].ID},__canAddVideoVisitProviders:function WP$Scheduling$SlotStepController$__canAddVideoVisitProviders(){var e,t=this.Data.AppointmentBuilder.PatientLocation,i=this.Data.AppointmentBuilder.PatientSublocation,o=0,n=null;if(o=this.Data.AppointmentBuilder.getActiveApptIndex(),e=(n=this.Data.AppointmentBuilder.getAppointment(o)).SelectedTelehealthMode,!this.Data.AppointmentBuilder.IsSlotStepMultiApptPreGrouped&&e!==S.TelehealthModeEnum.Video)return n.CanSkipLicensureCheck||C.HasAtLeastOnePairLicensedInLocation(n.ReasonForVisit.DirectProviderDepartmentPairs,t,i);for(o=0;o<this.Data.AppointmentBuilder.numAppointments();o++)if(!(n=this.Data.AppointmentBuilder.getAppointment(o)).CanSkipLicensureCheck&&!C.HasAtLeastOnePairLicensedInLocation(n.ReasonForVisit.DirectProviderDepartmentPairs,t,i))return!1;return!0},__onAddVideoVisitProvidersClicked:function WP$Scheduling$SlotStepController$__onAddVideoVisitProvidersClicked(){this.Data.AppointmentBuilder.setProperty("CanSearchAllLicensedVideoProviders",!0)},__buildViewModelForPatientLocationBanner:function WP$Scheduling$SlotStepController$__buildViewModelForPatientLocationBanner(){this.ViewModel.PatientLocationBanner={BannerType:"informationalType",HeaderText:this.__getPatientLocationBannerHeaderText(),DetailText:this.__getPatientLocationBannerDetailText(),DisableDetailTextHtmlEncoding:!0}},__onShowAllProvidersClicked:function WP$Scheduling$SlotStepController$__onShowAllProvidersClicked(){this.__isLoadingAdditionalProviders=!0,this.Data.AppointmentBuilder.setProperty("DidIncludeAdditionalProvidersInSearch",!0),this.__isTeamSchedulingAllowed&&(this.__isLoadingTeams=!0,this.Data.AppointmentBuilder.setProperty("UseTeams",!0))},__onShowOutOfNetworkProvidersClicked:function WP$Scheduling$SlotStepController$__onShowOutOfNetworkProvidersClicked(){this.FilterController.clearNetworkFilter()},__getPatientLocationBannerHeaderText:function WP$Scheduling$SlotStepController$__getPatientLocationBannerHeaderText(){return null===this.Data.AppointmentBuilder.PatientLocation?this.SchedulingStringsNamespace.getString("PatientLocationBannerHeaderNoLocation"):this.SchedulingStringsNamespace.getString("PatientLocationBannerHeader")},__getPatientLocationBannerDetailText:function WP$Scheduling$SlotStepController$__getPatientLocationBannerDetailText(){return null===this.Data.AppointmentBuilder.PatientLocation?this.SchedulingStringsNamespace.getString("PatientLocationBannerDetailTextNoLocation"):this.SchedulingStringsNamespace.getString("PatientLocationBannerDetailText")},__getNoVideoProvidersHelpText:function WP$Scheduling$SlotStepController$__getNoVideoProvidersHelpText(e){return this.__canShowAddVideoVisitProviders()?e?this.SchedulingStringsNamespace.getString("NoVideoProvidersHelpTextCanAdd"):this.SchedulingStringsNamespace.getString("NoVideoProvidersHelpTextCanAddNoLocation"):e?this.SchedulingStringsNamespace.getString("NoVideoProvidersHelpText"):this.SchedulingStringsNamespace.getString("NoVideoProvidersHelpTextNoLocation")},__getViewResultsText:function WP$Scheduling$SlotStepController$__getViewResultsText(){var e,t=this.__getSelectedProviderCount();return this.SchedulingStringsNamespace.addMnemonic("@MYCHART@PROVIDERRESULTSCOUNT@",t,$$WP.Strings.EncodingTypes.None),e=this.SchedulingStringsNamespace.getString("ViewResultsLabel"),this.SchedulingStringsNamespace.clearMnemonics(),e},__getSelectedProviderCount:function WP$Scheduling$SlotStepController$__getSelectedProviderCount(){var e,t,i=0,o=null,n=[],l=null;for(e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e).ProviderDepartmentPairs,i=0;i<t.length;i++)o=t[i],l=this.Data.Providers.getFromIndex("ID",o.ProviderId),-1===n.indexOf(l)&&n.push(l);return n.length},__getSlotLoadingMessage:function WP$Scheduling$SlotStepController$__getSlotLoadingMessage(){return this.SchedulingStringsNamespace.getString("SlotsLoadingMessage")},__getAnotherBatchButtonLabels:function WP$Scheduling$SlotStepController$__getAnotherBatchButtonLabels(){var e={},t="",i="";return this.Data.SlotLoader.hasVerboseError()?(t="RetryButtonLabel",i="RetryButtonLabelForScreenReader"):(t="AnotherBatchButton",i="AnotherBatchButtonDetailed"),e.Label=this.SchedulingStringsNamespace.getString(t),e.DetailedLabel=this.SchedulingStringsNamespace.getString(i),e},__getSlotKeyForCurrentSelections:function WP$Scheduling$SlotStepController$__getSlotKeyForCurrentSelections(){return u.getSlotKeyForBuilder(this._workflow,this.Data.AppointmentBuilder)},__buildViewModelForAllSlots:function WP$Scheduling$SlotStepController$__buildViewModelForAllSlots(e){var t,i=null,o=0,n=0,l=null,r=null;if(t=this.Data.Solutions.getIndex(["SlotKey","DateKey","ProviderGroupKey","LocationGroupKey","EffectiveApptTimeKey"])[e],this.__isTypeObject(t)){for(this.ViewModel.ShowLocationHeaders=this.__shouldShowLocationHeaders(),this.ViewModel.ShowProviderHeaders=this.__shouldShowProviderHeaders(),null!==this.ViewModel.RelatedScheduledAppts&&0!==this.ViewModel.RelatedScheduledAppts.length&&(this.ViewModel.ScheduleAppointmentTitle=this.__getScheduledAppointmentsTitle(),this.ViewModel.StandingOrderAppointments=this.__buildStandingOrderAppointments(),this.__focusStepHeader()),this.ViewModel.Appointments=this.Data.AppointmentBuilder.Appointments.toArray(),o=Math.min(this.Data.SlotLoader.getSearchRangeEndDte(),this.__maxDte),n=this.__firstDteToShow;n<=o;n++)r=u.Dte2Date(n),this.__isDateIncludedInSelectedPreferences(r)&&this.__isDateEqualToSlotDteFromPreviousAppointments(n)&&(i=t[n],(l=this.__buildViewModelForDay(i,n))&&this.ViewModel.Days.push(l));this.ViewModel.NoSlotsShown=0===this.ViewModel.Days.length,this.ViewModel.ShowLoadAnotherBatch=this.__isOkToShowLoadMoreLink()}this.ViewModel.ShowSearchPriorityFilterInSidebar=this.__shouldShowSearchPriorityFilterInSidebar(),this.ViewModel.ShowOneApptAtATimeButtonMidSlots=this.__shouldShowOneApptAtATimeButtonMidSlots(),this.ViewModel.ShowFullSolutionsButtonMidSlots=this.__shouldShowFullSolutionsButtonMidSlots(),this.ViewModel.ShowSolutionDetails=this.__shouldShowDetailedSolutionView(),this.ViewModel.ShowSingleApptSelectSolutionsView=this.__shouldShowOneApptAtATimeSolutionsView()},__isDateEqualToSlotDteFromPreviousAppointments:function WP$Scheduling$SlotStepController$__isDateEqualToSlotDteFromPreviousAppointments(e){var t,i,o=this.Data.AppointmentBuilder;if(1!==o.SearchPriority)return!0;if(1===o.numAppointments())return!0;if(o.getActiveApptIndex()<1)return!0;for(t=0;t<o.getActiveApptIndex()+1;t++)if((i=o.getAppointment(t).Slot)&&i.Dte===e)return!0;return!1},__shouldShowSearchPriorityFilterInSidebar:function WP$Scheduling$SlotStepController$__shouldShowSearchPriorityFilterInSidebar(){var e=this.Data.AppointmentBuilder.numAppointments()>1,t=$$WPSchedulingUtil.IsBundleForceSameDay(this._workflow);return e&&!t},__shouldShowOneApptAtATimeButtonMidSlots:function WP$Scheduling$SlotStepController$__shouldShowOneApptAtATimeButtonMidSlots(){return this.Data.AppointmentBuilder.numAppointments()>1&&!this.__showSingleApptSelectSolutionsView},__shouldShowFullSolutionsButtonMidSlots:function WP$Scheduling$SlotStepController$__shouldShowFullSolutionsButtonMidSlots(){return this.Data.AppointmentBuilder.numAppointments()>1&&this.__showSingleApptSelectSolutionsView},__shouldShowDetailedSolutionView:function WP$Scheduling$SlotStepController$__shouldShowDetailedSolutionView(){return this.Data.AppointmentBuilder.numAppointments()>1&&!this.__showSingleApptSelectSolutionsView&&this.__showDetailedSolutionsView&&!this.__isSimpleMultiApptWorkflow},__shouldShowOneApptAtATimeSolutionsView:function WP$Scheduling$SlotStepController$__shouldShowOneApptAtATimeSolutionsView(){return this.Data.AppointmentBuilder.numAppointments()>1&&this.__showSingleApptSelectSolutionsView&&!this.__showDetailedSolutionsView},__shouldShowMultiApptSimpleSlotView:function WP$Scheduling$SlotStepController$__shouldShowMultiApptSimpleSlotView(){return this.Data.AppointmentBuilder.numAppointments()>1&&!this.__showSingleApptSelectSolutionsView&&!this.__showDetailedSolutionsView},__shouldShowMultiApptDetailedSlotView:function WP$Scheduling$SlotStepController$__shouldShowMultiApptDetailedSlotView(){return this.Data.AppointmentBuilder.numAppointments()>1&&!this.__showSingleApptSelectSolutionsView&&this.__showDetailedSolutionsView},__shouldShowLocationHeaders:function WP$Scheduling$SlotStepController$__shouldShowLocationHeaders(){var e=null,t=null;return this._workflow.Type!==c.WorkflowTypesEnum.OnDemandTelehealth&&(!($$WP.WidgetMode&&this.__slotStepSettings.AllowedDepartmentIds&&1===this.__slotStepSettings.AllowedDepartmentIds.length&&(t=(e=this.Data.AppointmentBuilder.getAppointment(this.__getCurrentApptBeingSelected())).Locations.toArray()[0])&&1===e.Locations.size()&&t.DepartmentIds[0]===this.__slotStepSettings.AllowedDepartmentIds[0])&&this.__canAnyAppointmentDisplayLocationInformation())},__shouldShowLocationSummary:function WP$Scheduling$SlotStepController$__shouldShowLocationSummary(){var e,t;return this.ViewModel.CanEditLocations=$$WPSchedulingUtil.CanEditStep(this.Data,this._workflow.Type,$$WP.Scheduling.SchedulingStep.StepTypeEnum.Location,this.__slotStepSettings.IsDepartmentStepHiddenByQueryParams),!(!this.ViewModel.CanEditLocations||this._workflow.Type===c.WorkflowTypesEnum.OnDemandTelehealth)&&(this.__showSingleApptSelectSolutionsView?!!(e=(t=this.Data.AppointmentBuilder.getAppointment(this.Data.AppointmentBuilder.getActiveApptIndex())).VisitType)&&(t.isAppointmentInPerson()||e.ShowLocationStepForTelehealthVisit)&&this.Data.AppointmentBuilder.AvailableLocations[this.Data.AppointmentBuilder.getActiveApptIndex()].length>1:this.ViewModel.CanEditLocations)},__shouldShowProviderSummary:function WP$Scheduling$SlotStepController$__shouldShowProviderSummary(){var e=this.Data.AppointmentBuilder.ReasonForVisit;return this.__doesAnyAppointmentAllowProviderSelection()&&!!e&&e.hasMultipleProviders()&&this._workflow.Type!==c.WorkflowTypesEnum.OnDemandTelehealth&&!this.isInsuranceSelectionValid()&&this.__preselectedFilters&&this.__preselectedFilters.length<1},__shouldShowGranularProviderFilters:function WP$Scheduling$SlotStepController$__shouldShowGranularProviderFilters(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e);return this._workflow.Type!==c.WorkflowTypesEnum.ExistingProvider||!!t.VisitType&&t.VisitType.HasAlreadyLoadedTieredData&&t.IsUsingTieredData},__shouldShowSimpleTimePreferences:function WP$Scheduling$SlotStepController$__shouldShowSimpleTimePreferences(){return this._workflow.IsAnonymous},__getAppointmentsWithDisplayedLocations:function WP$Scheduling$SlotStepController$__getAppointmentsWithDisplayedLocations(){var e,t=0,i=null,o=[];for(e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)i=this.Data.AppointmentBuilder.getAppointment(t),this.__canAppointmentDisplayLocationInformation(i)&&o.push(i);return o},__canAppointmentDisplayLocationInformation:function WP$Scheduling$SlotStepController$__canAppointmentDisplayLocationInformation(e){var t=e.VisitType;return e.isAppointmentInPerson()||!!t&&t.ShowLocationStepForTelehealthVisit},__canAnyAppointmentDisplayLocationInformation:function WP$Scheduling$SlotStepController$__canAnyAppointmentDisplayLocationInformation(){return this.__getAppointmentsWithDisplayedLocations().length>0},__doesAnyAppointmentWithMultipleLocationsDisplayLocationInformation:function WP$Scheduling$SlotStepController$__doesAnyAppointmentWithMultipleLocationsDisplayLocationInformation(){var e=this.__getAppointmentsWithDisplayedLocations(),t=0;for(t=0;t<e.length;t++)if(e[t].Locations.toArray().length>1)return!0;return!1},__shouldShowProviderHeaders:function WP$Scheduling$SlotStepController$__shouldShowProviderHeaders(){var e=null,t=[];if($$WP.WidgetMode&&this.__slotStepSettings.AllowedProviderIds&&1===this.__slotStepSettings.AllowedProviderIds.length){if(this.Data.AppointmentBuilder.DidIncludeAdditionalProvidersInSearch)return!0;if(e=this.Data.AppointmentBuilder.getAppointment(this.__getCurrentApptBeingSelected()),(t=this.__getAllAvailableProviders(e))&&1===t.length&&t[0].ID===this.__slotStepSettings.AllowedProviderIds[0])return!1}return this.__doApptsBeingSelectedHaveMultipleSelectedProviders()||this.__doesMoreThanOneApptBeingSelectedAllowProviderSelection()||this.Data.AppointmentBuilder.UseTeams||this.Data.AppointmentBuilder.CanSearchAllLicensedVideoProviders||this.__isAtLeastOneProviderFilterSelected()||this.__doesAnyAppointmentAllowProviderSelection()},__doApptsBeingSelectedHaveMultipleSelectedProviders:function WP$Scheduling$SlotStepController$__doApptsBeingSelectedHaveMultipleSelectedProviders(){var e,t=0,i=null;for(e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)if((!this.__showSingleApptSelectSolutionsView||t===this.Data.AppointmentBuilder.getActiveApptIndex())&&(i=this.Data.AppointmentBuilder.getAppointment(t),$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,i)&&i.Providers.toArray().length>1))return!0;return!1},__doesMoreThanOneApptBeingSelectedAllowProviderSelection:function WP$Scheduling$SlotStepController$__doesMoreThanOneApptBeingSelectedAllowProviderSelection(){var e,t=0,i=0,o=null;for(e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)this.__showSingleApptSelectSolutionsView&&t!==this.Data.AppointmentBuilder.getActiveApptIndex()||(o=this.Data.AppointmentBuilder.getAppointment(t),$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,o)&&i++);return i>1},__doesAnyAppointmentAllowProviderSelection:function WP$Scheduling$SlotStepController$__doesMoreThanOneAppointmentAllowProviderSelection(){var e=null;if(this.__showSingleApptSelectSolutionsView){var t=this.Data.AppointmentBuilder.getActiveApptIndex();return e=this.Data.AppointmentBuilder.getAppointment(t),$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,e)}return this.Data.AppointmentBuilder.hasAppointmentThatAllowsProviderSelection()},__isDateIncludedInSelectedPreferences:function WP$Scheduling$SlotStepController$__isDateIncludedInSelectedPreferences(e){var t=!(Array.isArray(this.__slotStepSettings.TimePreferences)&&Array.isArray(this.__slotStepSettings.TimePreferences[e.getDay()])&&Array.isArray(this.__slotStepSettings.TimePreferences[e.getDay()][0])&&-1===this.__slotStepSettings.TimePreferences[e.getDay()][0][0]);return!this.__isTimePreferencesFilteringEnabled()||t},__buildStandingOrderAppointments:function WP$Scheduling$SlotStepController$__buildStandingOrderAppointments(){var e=[],t="",i=this.__sortScheduledAppts(this.ViewModel.RelatedScheduledAppts);for(var o in i)t=this.__buildAppointmentDateString(i[o]),e.push(t);return e},__sortScheduledAppts:function WP$Scheduling$SlotStepController$__sortScheduledAppts(e){return e.sort((function(e,t){return new Date(e.DateTimeISO)-new Date(t.DateTimeISO)}))},__buildAppointmentDateString:function WP$Scheduling$SlotStepController$__buildAppointmentDateString(e){var t,i=new Date(e.DateTimeISO);return this.SchedulingStringsNamespace.addMnemonic("@MYCHART@APPOINTMENTYEAR@",i.getFullYear()),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@APPOINTMENTMONTH@",getMonthName(i.getMonth()+1)),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@APPOINTMENTDAYNUMBER@",i.getDate()),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@APPOINTMENTDAY@",getDayName(i.getDay())),t=this.SchedulingStringsNamespace.getString("AppointmentDate"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@APPOINTMENTYEAR@"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@APPOINTMENTMONTH@"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@APPOINTMENTDAYNUMBER@"),this.SchedulingStringsNamespace.removeMnemonic("@MYCHART@APPOINTMENTDAY@"),t},__getScheduledAppointmentsTitle:function WP$Scheduling$SlotStepController$__getScheduledAppointmentsTitle(){var e,t,i="";return e=this.ViewModel.RelatedScheduledAppts.length,t=this.ViewModel.ScheduledAppointmentName,this.SchedulingStringsNamespace.addMnemonic("@MYCHART@SCHEDULEDAPPOINTMENTNAME@",t,$$WP.Strings.EncodingTypes.None),1===e?(this.ViewModel.HasFutureAppointment?this.ViewModel.ScheduledAppointmentSubTitle=this.SchedulingStringsNamespace.getString("UpcomingAppointmentSubTitle"):this.ViewModel.ScheduledAppointmentSubTitle=this.SchedulingStringsNamespace.getString("PastAppointmentSubTitle"),i=this.SchedulingStringsNamespace.getString("ScheduledAppointmentTitleSingular")):(this.ViewModel.ScheduledAppointmentSubTitle=this.SchedulingStringsNamespace.getString("ScheduledAppointmentSubTitle"),this.SchedulingStringsNamespace.addMnemonic("@MYCHART@SCHEDULEDAPPOINTMENTCOUNT@",e,$$WP.Strings.EncodingTypes.None),i=this.SchedulingStringsNamespace.getString("ScheduledAppointmentTitlePlural"),$$WP.Strings.removeMnemonic("@MYCHART@SCHEDULEDAPPOINTMENTCOUNT@")),$$WP.Strings.removeMnemonic("@MYCHART@SCHEDULEDAPPOINTMENTNAME@"),i},__buildViewModelForDay:function WP$Scheduling$SlotStepController$__buildViewModelForDay(e,t){var i=null,o=null,n="";if(!this.__isTypeObject(e))return null;for(n in i={Dte:t,DayString:u.Dte2DateString[t],ProviderGroups:[]},e)""!==n&&(o=this.__buildViewModelForProviders(e[n]))&&i.ProviderGroups.push(o);return 0===i.ProviderGroups.length?null:(i.ProviderGroups.sort(this.__sortProviderGroupsForDisplay),i)},__buildViewModelForProviders:function WP$Scheduling$SlotStepController$__buildViewModelForProviders(e){var t={},i=null,o="";if(!this.__isTypeObject(e))return null;for(o in t={Providers:{},LocationGroups:[],HasUnfilteredSolution:!1},e)$$WPUtil.IsNullOrEmpty(o)||null!==(i=this.__buildViewModelForLocations(e[o]))&&(t.LocationGroups.push(i),i.HasUnfilteredSolution&&(t.HasUnfilteredSolution=!0));return t.LocationGroups.length>0&&(t.Providers=this.__getProviderHeaderViewModel(t.LocationGroups[0].SlotGroups[0][0])),t.LocationGroups.length>0?t:null},__getProviderHeaderViewModel:function WP$Scheduling$SlotStepController$__getProviderHeaderViewModel(e){var t,i=0,o=null,n={},l=[],r=[],s="",a=this.FilterController.getSelectedFilters(),d=this.Data.AppointmentBuilder.getActiveApptIndex(),h=this.Data.AppointmentBuilder.getAppointment(d);for(t=this.__getVisibleSolutionProviderIds(e),i=0;i<t.length;i++)o=this.Data.Providers.getFromIndex("ID",t[i]),-1===l.indexOf(o)&&(o.IsFromFirstTier=F.isProviderFromFirstTier(h,o),l.push(o),r.push(o.Name)),null!==a&&(s=this.__buildProviderMoreInfoString(o,this.__slotStepSettings.DefaultProviderLanguages,a));return n.Models=l,n.Names=r.join(this.SchedulingStringsNamespace.getString("SolutionListSeparator")),n.MatchString=s,n},__buildProviderMoreInfoString:function WP$Scheduling$SlotStepController$__buildProviderMoreInfoString(e,t,i){var o={},n=[],l=0,r=0;for(l=0;l<i.length;l++){var s=i[l].GroupIndex,a=i[l].OptionIndex;if(!this.FilterController.isFiltersOptionsMutuallyExclusive(s))if(Array.isArray(e[s]))-1!==e[s].indexOf(a)&&(null!==o[s]&&void 0!==o[s]?o[s].push(a):o[s]=[a]);else e[s]===a&&(null!==o[s]&&void 0!==o[s]?o[s].push(a):o[s]=[a])}if((null!==t||0!==t.length)&&void 0!==o.Languages&&0!==o.Languages.length)for(r=0;r<t.length;r++)o.Languages.push(t[r].Title);for(var d in o){var h=$$WP.Strings.get("FilterGroupTitle_"+d,"Scheduling");n.push(h+o[d].join(this.SchedulingStringsNamespace.getString("SolutionListSeparator")))}return n.join(this.SchedulingStringsNamespace.getString("ProviderFilterGroupSeparator"))},__buildViewModelForLocations:function WP$Scheduling$SlotStepController$__buildViewModelForLocations(e){var t={},i="",o=[],l=null,r=0,s=0,a=null,d={},h=0;if(!this.__isTypeObject(e))return null;for(i in t={Locations:{},SlotGroups:[],HasUnfilteredSolution:!1},this.__showSingleApptSelectSolutionsView&&(h=this.Data.AppointmentBuilder.getActiveApptIndex()),e)for(o=e[i],i=Number(i),a=u.Dte2Date(o[0].Slots[h].Dte).getDay(),r=0;r<o.length;r++)l=o[r],Array.isArray(this.__slotStepSettings.TimePreferences)&&!this.__isSlotInSelectedPreferences(i,this.__slotStepSettings.TimePreferences[a])||(d[l.Slots[h].EffectiveApptTime]=l);for(t.SlotGroups=function WP$Scheduling$SlotStepController$s_numericKeyMapToOrderedArray(e){var t,i,o,n;for(t in i=[],e)i.push(Number(t));for(i.sort((function(e,t){return e-t})),o=[],n=0;n<i.length;n++)o.push(e[i[n]]);return o}(d),r=0;r<t.SlotGroups.length;r++)t.SlotGroups[r]=[t.SlotGroups[r]],t.SlotGroups[r][0].HasPassedFilterCheck&&(t.HasUnfilteredSolution=!0);if(this.__showDetailedSolutionsView||this.__showSingleApptSelectSolutionsView)for(r=0;r<t.SlotGroups.length;r++)for(s=0;s<t.SlotGroups[r].length;s++)(l=t.SlotGroups[r][s]).SolutionViewModel||(l.SolutionViewModel=n(this.Data,l,this._workflow));return t.SlotGroups.length>0&&(t.Locations=this.__getLocationHeaderViewModel(t.SlotGroups[0][0])),t.SlotGroups.length>0?t:null},__getLocationHeaderViewModel:function WP$Scheduling$SlotStepController$__getLocationHeaderViewModel(e){var t,i=0,o=null,n=null,l=null,r=[],s=[],a=[],d=[],h=[],_={},S=0,u=this.Data.AppointmentBuilder.getActiveApptIndex(),p=this.Data.AppointmentBuilder.getAppointment(u);for(t=this.__getVisibleSolutionLocationIds(e),i=0;i<t.length;i++)l=this.Data.Locations.getFromIndex("Id",t[i]),-1===h.indexOf(l)&&(S++,h.push(l),r.push(l.Name),o=e.Slots[0],n=this.Data.Departments.getFromIndex("ID",o.DepartmentId),slotProvider=this.Data.Providers.getFromIndex("ID",o.ProviderId),null!==l.Address&&s.push(l.Address.join(" ")),null!==l.DistanceToUser&&a.push(l.DistanceToUser),this.__shouldShowAlternateLocationBadge(p,slotProvider,n,l)&&d.push(!0));return _.Models=h,_.Name=r.join(this.SchedulingStringsNamespace.getString("SolutionListSeparator")),1===S&&(1===s.length&&(_.Address=s[0]),1===a.length&&(_.DistanceToUser=a[0]),1===d.length&&(_.IsAlternateDepartment=!0)),_},__shouldShowAlternateLocationBadge:function WP$Scheduling$SlotStepController$__shouldShowAlternateLocationBadge(e,t,i,o){return!F.isLocationFromFirstTier(e,o)||F.isProviderFromFirstTier(e,t)&&e.VisitType.TieredProviderDepartmentPairsCollection.getFromIndex("Id",t.ID+"^"+i.ID)},__isSlotInSelectedPreferences:function WP$Scheduling$SlotStepController$__isSlotInSelectedPreferences(e,t){var i=0,o=!1;for(i=0;i<t.length;i++)if(e>=t[i][0]&&e<t[i][1]){o=!0;break}return!this.__isTimePreferencesFilteringEnabled()||o},__getAvailableRequestSolutions:function WP$Scheduling$SlotStepController$__getAvailableRequestSolutions(e){var t,i,o,n=0,l=0,r=null,s=null,a=null,d=null,h=[],_=null,S=[];if(null===(t=this.Data.AppointmentBuilder.ReasonForVisit)||this.Data.AppointmentBuilder.numAppointments()>1)return h;for(1===(o=e.Providers.toArray().slice(0)).length&&(this.__isProviderFirstWorkflow()||this.Data.AppointmentBuilder.IsUsingProviderDropdown)||this.__tryAddOtherProvider(o),i=u.getRequestSlotKey(t.Id),(r=e.getSelectedDepartmentsCollection()).Models.length>1&&this.__addOtherDepartmentLocally(r),n=0;n<o.length;n++)for(_=o[n],S=this.Data.Solutions.getFromIndex(["SlotKey","ProviderId"],[i,_.ID]),l=0;l<S.length;l++)s=(d=S[l]).Slots[0],a=this.Data.Departments.getFromIndex("ID",s.DepartmentId),r.contains(a)&&!this.__isRequestSolutionAlreadyInArray(h,s)&&h.push(d);return h},__isRequestSolutionAlreadyInArray:function WP$Scheduling$SlotStepController$__isRequestSolutionAlreadyInArray(e,t){var i,o=null,n=e.map((e=>e.Slots[0]));for(i=0;i<n.length;i++)if(o=n[i],t.ProviderId===o.ProviderId&&t.DepartmentId===o.DepartmentId)return!0;return!1},__tryGetOtherProvider:function WP$Scheduling$SlotStepController$__tryGetOtherProvider(){var e=0,t=this.Data.AppointmentBuilder.getFirstAppointment(),i=$$WPSchedulingUtil.BuildProvidersFiltered(!0,!0,!1,t.ReasonForVisit,t.getSelectedDepartmentsCollection().toArray(),!0),o=null;for(e=0;e<i.length;e++){"-1"===i[e].ID&&(o=i[e])}return o},__tryAddOtherProvider:function WP$Scheduling$SlotStepController$__tryAddOtherProvider(e){var t=this.__tryGetOtherProvider();null!==t&&-1===e.indexOf(t)&&e.push(t)},__buildViewModelForProvidersForRequest:function WP$Scheduling$SlotStepController$__buildViewModelForProvidersForRequest(){var e,t=[],i=0,o=null,n=[],l=!1;for(this.ViewModel.ProvidersForRequest=[],e=this.Data.AppointmentBuilder.numAppointments(),i=0;i<e;i++)o=this.Data.AppointmentBuilder.getAppointment(i),n=this.__getAvailableRequestSolutions(o),l=o.ProviderDepartmentPairs.length>0,1===(t=o.Providers.toArray().slice(0)).length&&(this.__isProviderFirstWorkflow()||this.Data.AppointmentBuilder.IsUsingProviderDropdown)||this.__tryAddOtherProvider(t),this.__buildAvailableProviderRequestSolutions(n,t);this.__buildViewModelForRequestBanner(n,e,l)},__buildAvailableProviderRequestSolutions:function WP$Scheduling$SlotStepController$__buildAvailableProviderRequestSolutions(e,t){var i=0,o=0,n=null,l=null,r=null,s=null,a=[];for(i=0;i<t.length;i++){for(n=t[i],a=[],o=0;o<e.length;o++)(s=(r=e[o]).Slots[0]).ProviderId===n.ID&&("-1"===s.DepartmentId?r.DepartmentLink=this.SchedulingStringsNamespace.getString("OtherDepartmentRequestString"):(l=this.Data.Departments.getFromIndex("ID",s.DepartmentId),this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@DEPARTMENT@":{Value:l.Name,EncodingType:$$WP.Strings.EncodingTypes.None}}),r.DepartmentLink=this.SchedulingStringsNamespace.getString("DepartmentRequestString"),this.SchedulingStringsNamespace.clearMnemonics()),a.push(r));a.length>0&&this.ViewModel.ProvidersForRequest.push({Provider:n,Solutions:a})}},__buildViewModelForRequestBanner:function WP$Scheduling$SlotStepController$__buildViewModelForRequestBanner(e,t,i){var o=0,n=0,l=!1;this.__canShowRequestWorkflow(i)?1===t&&this.__getSingleLocationRequestSolution(e)&&!this.__isAtLeastOneProviderFilterSelected()?this.stepSettings.Hide=!0:e.length>0&&(this.ViewModel.ShowExpandedRequestOptions=!0,this.stepSettings.Hide=!1):(n=this.Data.AppointmentBuilder.getActiveApptIndex(),this.Data.AppointmentBuilder.getAppointment(n).SelectedTelehealthMode===S.TelehealthModeEnum.Video&&this.Data.AppointmentBuilder.getAppointment(n).VisitType.AllowedTelehealthModes.length>1&&!this.ViewModel.IsAtLeastOneFilterSelected&&(this.ViewModel.NoProvidersAvailableForTelehealthMode=!0),1===e.length?(this.ViewModel.ShowSingleRequestLink=!0,this.ViewModel.SingleRequestLink=!0,this.ViewModel.RequestModelId=e[0].ModelId,this.stepSettings.Hide=!1):e.length>1&&(this.ViewModel.ShowExpandableRequestLink=!0,this.ViewModel.MultipleRequestLink=!0,this.ViewModel.RequestOptionId="requestoption_"+this.Id,this.stepSettings.Hide=!1),e.length>=1&&(this.ViewModel.RequestTitle=this.SchedulingStringsNamespace.getString("RequestableProvidersTitle"),0!==(o=this.__getMidSlotsShowBeforeDte(3,this.__firstDteToShow+28))||this.__canSearchMoreDates()||(l=!0),this.ViewModel.CanShowRequestSection=!this.Data.SlotLoader.isLoading(),this.ViewModel.ShowRequestCardBeforeDte=o,this.ViewModel.ShowRequestCardAfterSlots=l))},__canShowRequestWorkflow:function WP$Scheduling$SlotStepController$__canShowRequestWorkflow(e){return!e&&(!(this.__canShowPatientLocationBanner()&&!this.__isProviderFirstWorkflow())&&(!this.__getIsTeamSchedulingAllowed()&&!this.__isTieredSchedulingAllowed))},__buildViewModelForTelehealthMode:function WP$Scheduling$SlotStepController$__buildViewModelForTelehealthMode(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e).SelectedTelehealthMode,i=this.Data.AppointmentBuilder.getAllowedTelehealthModes();$$WPUtil.IsNullOrEmpty(i)||(this.ViewModel.CanShowInPersonTelehealthMode=i.includes(S.TelehealthModeEnum.InPerson),this.ViewModel.CanShowVideoTelehealthMode=i.includes(S.TelehealthModeEnum.Video),this.ViewModel.CanShowTelephoneTelehealthMode=i.includes(S.TelehealthModeEnum.Telephone)),t===S.TelehealthModeEnum.InPerson?this.ViewModel.IsInPersonTelehealthMode=!0:t===S.TelehealthModeEnum.Video?this.ViewModel.IsVideoTelehealthMode=!0:t===S.TelehealthModeEnum.Telephone&&(this.ViewModel.IsTelephoneTelehealthMode=!0),this.ViewModel.CanShowProviderTelehealthBadges=!$$WPUtil.IsNullOrEmpty(i)&&i.length>1&&(this.Data.AppointmentBuilder.isSelectedTelehealthModeSameForAppts()||this.__showSingleApptSelectSolutionsView)},__getSingleLocationRequestSolution:function WP$Scheduling$SlotStepController$__getSingleLocationRequestSolution(e){return 1===e.length?e[0]:null},__getOtherSolution:function WP$Scheduling$SlotStepController$__getOtherSolution(e){var t=0;for(t=0;t<e.length;t++)if("-1"===e[t].Slots[0].DepartmentId)return e[t];return null},__addOtherDepartmentLocally:function WP$Scheduling$SlotStepController$__addOtherDepartmentLocally(e){var t;(t=this.Data.Departments.getFromIndex("ID","-1"))&&!e.contains(t)&&e.add(t)},__shouldShowTicketWaitListOptions:function WP$Scheduling$SlotStepController$__shouldShowTicketWaitListOptions(){return this.__isTicketWorkflow()&&!this.Data.SlotLoader.isLoading()&&0===this.Data.Solutions.Models.length&&this._workflow.TicketInfo.CanBeSentOffers&&!this._workflow.TicketInfo.IsOptedInToOffers&&!this.Data.AppointmentBuilder.hasVirtualVisit()},__shouldShowTeamSchedulingInSidebar:function WP$Scheduling$SlotStepController$__shouldShowTeamSchedulingInSidebar(){return this.__isTeamSchedulingAllowed&&(1===this.__slotStepSettings.ShowTeamBeforeSearch||2===this.__slotStepSettings.ShowTeamBeforeSearch)},__shouldShowTeamsMidSlots:function WP$Scheduling$SlotStepController$__shouldShowTeamsMidSlots(){var e=this.ViewModel.Days.length,t=null,i=null;return!this.ViewModel.TeamSchedulingDefaultChecked&&(!!this.__isTeamSchedulingAllowed&&(e>0?(t=this.ViewModel.Days[0],i=this.ViewModel.Days[e-1],0===this.__slotStepSettings.ShowTeamBeforeSearch&&this.__isDteFourWeeksAway(t.Dte)||this.ViewModel.TeamSchedulingShowInSidebar&&this.__isReadyToShowTeamsMidSlots(i)):this.__shouldOfferTeamsOnNoData()))},__shouldOfferTeamsOnNoData:function WP$Scheduling$SlotStepController$__shouldOfferTeamsOnNoData(){return this.__isTeamSchedulingAllowed&&!this.Data.SlotLoader.isLoading()&&!this.Data.AppointmentBuilder.UseTeams},__isReadyToShowTeamsMidSlots:function WP$Scheduling$SlotStepController$__isReadyToShowTeamsMidSlots(e){return!this.__canSearchMoreDates()||this.ViewModel.Days.length>2||this.__isDteFourWeeksAway(e.Dte)},__shouldShowAddAllProvidersOption:function WP$Scheduling$SlotStepController$__shouldShowAddAllProvidersOption(){var e,t;return e=this.Data.AppointmentBuilder.getFirstAppointment(),t=this.__getAllAvailableProviders(e).map((function(e){return e.ID})),$$WPSchedulingProvidersCore.IsSingleAllowedProviderStillElligibleForScheduling(t,this.__slotStepSettings.AllowedProviderIds)&&!this.Data.AppointmentBuilder.DidIncludeAdditionalProvidersInSearch&&this._workflow.isTypeOpenSchedulingWidget()&&this.__doesAnyAppointmentAllowProviderSelection()&&!$$WPSchedulingProvidersCore.AreAllProvidersSelected(e)&&!this.__isAtLeastOneProviderFilterSelected()&&!this.__getIsTieredSchedulingAllowed(e)},__shouldShowAddOutOfNetworkProvidersOption:function WP$Scheduling$SlotStepController$__shouldShowAddOutOutNetworkProvidersOption(){return appointment=this.Data.AppointmentBuilder.getFirstAppointment(),this._workflow.isTypeOpenSchedulingWidget()&&this.__doesAnyAppointmentAllowProviderSelection()&&!$$WPSchedulingProvidersCore.AreAllProvidersSelected(appointment)&&!this.__shouldShowAddAllProvidersOption()&&!this.FilterController.hasNetworkFilterBeenCleared()},__shouldShowExpandSearchOptionMidSlots:function WP$Scheduling$SlotStepController$__shouldShowExpandSearchOptionMidSlots(){var e=this.Data.AppointmentBuilder.getActiveApptIndex(),t=this.Data.AppointmentBuilder.getAppointment(e);return this.__getIsTieredSchedulingAllowed(t)&&!t.IsUsingTieredData&&!t.VisitType.HasAlreadyLoadedTieredData&&!this.Data.SlotLoader.isLoading()},__getLoadingOverlay:function WP$Scheduling$SlotStepController$__getLoadingOverlay(){return this.ViewModel.ShowExpandedRequestOptions?this.$root.find(".requestList .ajaxspinner"):this.$root.find(".slotsData .ajaxspinner")},__lockLoadOverlayPosition:function WP$Scheduling$SlotStepController$__lockLoadOverlayPosition(){this.__getLoadingOverlay().addClass("defaultajaxoverlay"),this.__getLoadingOverlay().removeClass("defaultajaxinline")},__releaseLoadOverlayPosition:function WP$Scheduling$SlotStepController$__releaseLoadOverlayPosition(){this.__getLoadingOverlay().removeClass("defaultajaxoverlay"),this.__getLoadingOverlay().addClass("defaultajaxinline")},__getLoadAnotherBatchButton:function WP$Scheduling$SlotStepController$__getLoadAnotherBatchButton(){return this.$root.find(".loadanotherbatchbutton")},__getFilterNoSlotsLoaded:function WP$Scheduling$SlotStepController$__getFilterNoSlotsLoaded(){return this.$root.find(".filterNoSlotsLoaded")},__getVerboseError:function WP$Scheduling$SlotStepController$__getVerboseError(){return this.$root.find(".verboseError")},__isTicketWorkflow:function WP$Scheduling$SlotStepController$__isTicketWorkflow(){return this._workflow.Type===c.WorkflowTypesEnum.Ticket},__isRescheduleWorkflow:function WP$Scheduling$SlotStepController$__isRescheduleWorkflow(){return this._workflow.Type===c.WorkflowTypesEnum.Reschedule},__isDecisionTreeNodeWorkflow:function WP$Scheduling$SlotStepController$__isDecisionTreeNodeWorkflow(){return this._workflow.Type===c.WorkflowTypesEnum.DecisionTreeNode},__isNewProviderWorkflow:function WP$Scheduling$SlotStepController$__isNewProviderWorkflow(){return this._workflow.Type===c.WorkflowTypesEnum.NewProvider},__isWidgetWorkflow:function WP$Scheduling$SlotStepController$__isWidgetWorkflow(){return this._workflow.isTypeOpenSchedulingWidget()},__isOpenSchedulingWorkflow:function WP$Scheduling$SlotStepController$__isOpenSchedulingWorkflow(){return this._workflow.isTypeOpenScheduling()},__isProviderFinderWorkflow:function WP$Scheduling$SlotStepController$__isProviderFinderWorkflow(){return this._workflow.Type===c.WorkflowTypesEnum.ProviderFinder},__isDirectSchedulingWorkflow:function WP$Scheduling$SlotStepController$__isDirectSchedulingWorkflow(){return this.__isProviderFirstWorkflow()||this._workflow.Type===c.WorkflowTypesEnum.Procedure},__isProviderFirstWorkflow:function WP$Scheduling$SlotStepController$__isProviderFirstWorkflow(){return this._workflow.Type===c.WorkflowTypesEnum.ExistingProvider},__isSelfTriageWorkflow:function WP$Scheduling$SlotStepController$__isSelfTriageWorkflow(){return!!this._workflow.SchedulingControllerParams&&!!this._workflow.SchedulingControllerParams.rootDecisionTreeID},__isSelfTriagePostLoginWorkflow:function WP$Scheduling$SlotStepController$__isSelfTriagePostLoginWorkflow(){return!this._workflow.IsFromShopperState&&this.__isSelfTriageWorkflow()},__canWorkflowSupportTieredScheduling:function WP$Scheduling$SlotStepController$__canWorkflowSupportTieredScheduling(){return!this.__isProviderFinderWorkflow()&&(!!this.__isDirectSchedulingWorkflow()||(!!this.__isSelfTriagePostLoginWorkflow()||(!!this.__isRescheduleWorkflow()||(!!this.__isTicketWorkflow()||!!this.__isOpenSchedulingWorkflow()))))},__canShowTelehealthToggle:function WP$Scheduling$SlotStepController$__canShowTelehealthToggle(){var e=this.Data.AppointmentBuilder.getAllowedTelehealthModes();return!this.ViewModel.ShowExpandedRequestOptions&&!this.__isRescheduleWorkflow()&&this._workflow.Type!==c.WorkflowTypesEnum.OnDemandTelehealth&&!$$WPUtil.IsNullOrEmpty(e)&&e.length>1},__isTypeObject:function WP$Scheduling$SlotStepController$__isTypeObject(e){return"object"===$.type(e)},hasStickyBanner:function WP$Scheduling$CustomStepController$hasStickyBanner(){return!1},__getFocusableElements:function WP$Scheduling$SlotStepController$__getFocusableElements(e){return e.find($afe.select("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), *[tabindex]"))},__onOptInToTicketWaitListClicked:function WP$Scheduling$SlotStepController$__onOptInToTicketWaitListClicked(){this.__renderAdHocJoinWaitListStep(),this.__isWPPopupOpen=!0},__renderAdHocJoinWaitListStep:function WP$Scheduling$SlotStepController$__renderAdHocJoinWaitListStep(){this.__adHocJoinWaitListStepController||this.__createAdHocJoinWaitListStep(),this.__adHocJoinWaitListStepController.renderInPopup(this.SchedulingStringsNamespace.getString("JoinTicketWaitListStepHeader"))},__createAdHocJoinWaitListStep:function WP$Scheduling$SlotStepController$__createAdHocJoinWaitListStep(){var e={type:$$WP.Scheduling.SchedulingStep.StepTypeEnum.JoinWaitList},t=this.Data.SchedulingSteps.getFromIndex("ID",this.Id).StackId,i={SchedulePreferences:this.__slotStepSettings.OnFileSchedulePreferences,DaysOfWeekList:this.__slotStepSettings.DaysOfWeekList};this.__adHocJoinWaitListStepController=new $$WP.Scheduling.AdHocStepWorkflowController(e,t,this.Data,this._workflow,i,this.__workflowEventCallbacks,this.__closePopupCallback)},__onChangeLocationButtonClicked:function WP$Scheduling$SlotStepController$__onChangeLocationButtonClicked(e){this.__renderAdHocPatientLocationStep(),this.__isWPPopupOpen=!0},__renderAdHocPatientLocationStep:function WP$Scheduling$SlotStepController$__renderAdHocPatientLocationStep(){this.__adHocPatientLocationStepController||this.__createAdHocPatientLocationStep(),this.__adHocPatientLocationStepController.renderInPopup(this.SchedulingStringsNamespace.getString("ChangeLocationTitle"))},__createAdHocPatientLocationStep:function WP$Scheduling$SlotStepController$__createAdHocPatientLocationStep(){var e,t;t=this.Data.SchedulingSteps.getFromIndex("ID",this.Id).StackId,e={type:$$WP.Scheduling.SchedulingStep.StepTypeEnum.TelehealthLocation},this.__adHocPatientLocationStepController=new $$WP.Scheduling.AdHocStepWorkflowController(e,t,this.Data,this._workflow,null,this.__workflowEventCallbacks,this.__closePopupCallback)},__closePopupCallback:function __closePopupCallback(){this.__isWPPopupOpen=!1},__onEditLocationClicked:function __onEditLocationClicked(){this.__areFiltersCollapsed||this.__onFilterCollapseClicked(),this.__setAriaHiddenForFullPageFilters(),$$WPSchedulingUtil.ReturnToStep($$WP.Scheduling.SchedulingStep.StepTypeEnum.Location,this.Data,this.__workflowEventCallbacks.onNavigateBack,!0,this.ViewModel.ViewModelApptIndex)},__onEditProviderClicked:function __onEditProviderClicked(){this.__areFiltersCollapsed||this.__onFilterCollapseClicked(),this.Data.AppointmentBuilder.setProperty("CanSearchAllLicensedVideoProviders",!1),this.__setAriaHiddenForFullPageFilters(),$$WPSchedulingUtil.ReturnToStep($$WP.Scheduling.SchedulingStep.StepTypeEnum.Provider,this.Data,this.__workflowEventCallbacks.onNavigateBack,!0,this.ViewModel.ViewModelApptIndex)},onWorkflowDestroyed:function WP$Scheduling$ReservationStepController$onWorkflowDestroyed(){removeCalendarExternal()},isInsuranceSelectionValid:function WP$Scheduling$SlotStepController$isInsuranceSelectionValid(){var e=this._workflow.SchedulingControllerParams.insuranceId;return!$$WPUtil.IsNullOrEmpty(e)&&"-2"!==e&&"-3"!==e}},W.ModesEnum=e,W.FilterPositionEnum=t,$$WP.Scheduling.SlotStepController=W,W.extend($$WP.Scheduling.StepController,"WP$Scheduling$SlotStepController")}();;
!function WP$SchedulingConfirmationStepController$definition(){var e=$$WP.Scheduling.Workflow,t=$$WP.Scheduling.VisitType,i=$$WP.Scheduling.OnMyWay.ChiefComplaint,n=function WP$Scheduling$ConfirmationStepController(t,i,n,o,s,l,r,a,d,h,u,c,_,m){this.WP$Scheduling$StepController(t,n,null,null,null,$$WP.Templates.Scheduling.ConfirmationStep),this.proxify("updateStep","_onClickSchedule","_onScheduled","_loadReviewData","_onReviewDataLoaded","_onCommentsModified","_onFavoriteCheckboxChanged","_onWaitListCheckboxChanged","__returnToSlotStep","__onSchedulingStopButtonClicked","__onRedirectUrlReceived","__onClickLogin","__onClickScheduleAsGuest","__onEditLocationClicked","__onSchedulingErrorCallback","__onChangeLocationButtonClicked","__isInSelfTriageForAll","__isCondensedScheduling","__isLoggedIn","__isInSelfTriage","_onChiefComplaintChanged","_onRequestReasonChanged"),this._workflow=i,this.__isRescheduling=this._workflow.Type===e.WorkflowTypesEnum.Reschedule,this.__rescheduleReasons=l||[],this.__requireRescheduleReason=r||!1,this.__onSchedulingCompleteCallback=o,this.__onErrorCallback=s,this.__disableFavoriteAppointments=a||!1,this.__disableAddToWaitList=d||!1,this.__isLoginEnabled=h||!1,this.__isScheduleAsGuestDisabled=u,this.__isDepartmentStepHiddenByQueryParams=c,this.__isDemoMode=_||!1,this.__requestReasons=m||[]};n.prototype={__comments:null,__disableFavoriteAppointments:null,__disableAddToWaitList:null,__requireRescheduleReason:null,__rescheduleReasons:null,__selectedRescheduleReason:null,__onSchedulingCompleteCallback:null,__onErrorCallback:null,__previouslySelectedSlot:null,__reviewResult:null,__isLoaded:!1,__isCurrentlyLoading:!1,__favoriteCheckboxValue:!1,__waitListCheckboxValue:!1,__isRescheduling:!1,__isLoginEnabled:!1,__isScheduleAsGuestDisabled:!1,__isDepartmentStepHiddenByQueryParams:!1,__isDemoMode:!1,__requestReasons:null,__selectRequestReason:null,updateViewModel:function WP$Scheduling$ConfirmationStepController$updateViewModel(){var e,n,o,s,l,r,a,d,h,u,c=!1,_=!1,m=-1,p=null,g=null,C=null,S="",$=!1,f=null,P=[],A=!1,w=!1,W=!1,R=!1,v="",T=null;e=new $$WP.FormValidation.ValidationSettings({required:this.__doesStepRequireComments(),maxLength:this.__getMaxCommentsLength(),showCharacterCounter:!0,stringsNamespace:"Core.FormValidation.Scheduling.ConfirmationStep"}),n=new $$WP.FormValidation.ValidationSettings({required:this.__requireRescheduleReason,stringsNamespace:"Core.FormValidation.Scheduling.ConfirmationStep"}),u=new $$WP.FormValidation.ValidationSettings({required:this.__isChiefComplaintAllowed(),stringsNamespace:"Core.FormValidation.Scheduling.ConfirmationStep"}),this.template=$$WP.Templates.Scheduling.ConfirmationStep,this.__selectedRescheduleReason=this._getSelectedRescheduleReasonFromDom(),this.__selectRequestReason=this._getSelectedFastPassReasonFromDom(),this.__isLoaded?this.__reviewResult.Success?(m=this.Data.AppointmentBuilder.getFirstAppointmentIndex(),p=this.__reviewResult.Appointments[m],$=this.__shouldShowSolutionDetails(),g=this.__getProviderToUseForPhoto(),(C=new $$WP.Scheduling.SolutionViewModel).populateFromReviewResult(this.Data,this.__reviewResult,this._workflow),C.HasPatientLocation=!$$WPUtil.IsNullOrEmpty(this.Data.AppointmentBuilder.PatientLocation)&&this.Data.AppointmentBuilder.hasProvidersWithTelehealthLocations(),f=this.__getPrimaryAppointmentViewModel(C),S=this.__getCompiledInstructionsFromReviewResult(this.__reviewResult),o=p.TelehealthMode===$$WP.Scheduling.VisitType.TelehealthModeEnum.Video,s=t.isInPersonTelehealthMode(p.TelehealthMode),h=p.TelehealthMode===$$WP.Scheduling.VisitType.TelehealthModeEnum.Telephone,c=p.DepartmentInstructions.length>0&&s&&!$,_=""!==S,A=0!==(P=this.Data.AppointmentBuilder.getSchedulingInstructions(this.Data.VisitTypes,this._workflow)).join("").length&&!this.__didPatientSeeSchedulingInstructionsOnSlotsStep(),l=_||c||A,r=this._canFavoriteAppointment(),a=this._canAddToWaitList(),d=this._getAddToWaitListByDefault(),w=this.__isLoginEnabled&&!this.Data.AppointmentBuilder.ReasonForVisit.IsDemographicAuthRequired,R=(W=!this.__isScheduleAsGuestDisabled)||!W&&!this.__isLoginEnabled,(T=this.__reviewResult.ChiefComplaints).length>0&&(this.__chiefComplaintList=i.createChiefComplaintsCollection(),i.convertRawChiefComplaints(T,this.__chiefComplaintList)),this.ViewModel={StepShouldBeActive:!0,IsLoading:!1,PrimaryAppointmentViewModel:f,ShowProvider:!!g&&!$,Provider:g,Warnings:this.__reviewResult.Warnings,ShowWarnings:this.__reviewResult.Warnings.length>0,VTMWarningBannerViewModel:$$WPSchedulingUtil.GetVTMWarningBannerModel(this.__reviewResult.VTMWarnings),AllowComments:this.__doesStepAllowComments(),RequireComments:this.__doesStepRequireComments(),CommentsValidationSettings:e,Comments:this.__comments,RescheduleReasons:this.__rescheduleReasons,RequestReasons:this.__requestReasons,RequireRescheduleReason:this.__requireRescheduleReason,RescheduleReasonsValidationSettings:n,HasRightColumnContent:l,CanShowDepartmentDirections:c,DepartmentDirections:p.DepartmentInstructions,CanShowSchedulingInstructions:A,Instructions:P,PatientInstructions:S,IsVideoVisit:o,IsInPersonVisit:s,IsTelephoneVisit:h,CommentsElementId:"schedulingConfirmationComments_"+this.Id,WaitListElementId:"waitListCheckbox_"+this.Id,FavoritesElementId:"favoritesCheckbox_"+this.Id,IsMobile:$$WP.Utilities.UI.IsMobile,IsRescheduling:this.__isRescheduling,CanFavoriteAppointment:r,CanAddToWaitList:a,AddToWaitListByDefault:d,ShowExtraOptions:r||a,HasMultipleAppointments:this.Data.AppointmentBuilder.numAppointments()>1,SolutionViewModel:C,CanShowSolutionDetails:$,IsBundle:this.__isBundle(),IsEmbedded:$$WP.WidgetMode,IsCustomBranded:isCustomBranded(),IsLoggedIn:this.__isLoggedIn(),IsAuthenticatedWidget:this._workflow.IsAuthenticatedWidget,HasPatientLocation:!$$WPUtil.IsNullOrEmpty(this.Data.AppointmentBuilder.PatientLocation)&&this.Data.AppointmentBuilder.hasProvidersWithTelehealthLocations()&&!this.Data.AppointmentBuilder.canSkipLicensureForAllVideoVisits(),IsCondensedScheduling:this.__isCondensedScheduling(),CanEditLocations:$$WPSchedulingUtil.CanEditStep(this.Data,this._workflow.Type,$$WP.Scheduling.SchedulingStep.StepTypeEnum.Location,this.__isDepartmentStepHiddenByQueryParams),CanShowCaptchaDeclaration:this._workflow.IsAnonymous&&!!this._workflow.SecureSessionToken&&!$$WP.Captcha.IsVisible(),IsLoginEnabled:w,CanContinueToLoginOrScheduleAsGuest:R,ReservationBlurbViewModel:{IsSlotReserved:!!this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationKey},CaptchaDeclaration:this.__getCaptchaDeclaration(),HasSchedulingReason:this.__doesStepAllowComments()||this.__rescheduleReasons.length||this.__isChiefComplaintAllowed(),IsDemoMode:this.__isDemoMode,IsChiefComplaintAllowed:this.__isChiefComplaintAllowed(),ChiefComplaintList:T,ChiefComplaintValidationSettings:u},$$WPUtil.IsNullOrEmpty(this.Data.AppointmentBuilder.PatientLocation)||(v=this.Data.AppointmentBuilder.PatientLocation.LocationName),this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@DEPARTMENT@":{Value:f.Department.Name,EncodingType:$$WP.Strings.EncodingTypes.HTML},"@MYCHART@RESERVATIONEXPIRATIONTIME@":{Value:this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationExpirationTimeString,EncodingType:$$WP.Strings.EncodingTypes.HTML},"@MYCHART@PATIENTLOCATION@":{Value:v,EncodingType:$$WP.Strings.EncodingTypes.HTML}})):this.__updateViewModelWithError():(this.ViewModel={StepShouldBeActive:!0,IsLoading:!0},this._loadReviewData())},__isLoggedIn:function WP$Scheduling$ConfirmationStepController$__isLoggedIn(){return!(this.__isInSelfTriageForAll()&&!this._workflow.SchedulingControllerParams.isInsuranceCollectionComplete)&&!this._workflow.IsAnonymous},__isCondensedScheduling:function __isCondensedScheduling(){return!(!this.__isInSelfTriageForAll()||this._workflow.SchedulingControllerParams.isInsuranceCollectionComplete)||this._workflow.isTypeOpenScheduling()},__didPatientSeeSchedulingInstructionsOnSlotsStep:function WP$Scheduling$ConfirmationStepController$__didPatientSeeSchedulingInstructionsOnSlotsStep(){return!this.Data.AppointmentBuilder.getFirstAppointment().Slot.IsPreselected},__getCaptchaDeclaration:function WP$Scheduling$ConfirmationStepController$__getCaptchaDeclaration(){if("undefined"==typeof $$WP||void 0===$$WP.Captcha||"function"!=typeof $$WP.Captcha.GetProvider||void 0===$$WP.Captcha.ProviderType)return"";var e,t=null,i=null,n="",o="",s=$$WP.Strings.getNamespace("Scheduling.Fixed");return(t=document.createElement("a")).innerText=s.getString("PrivacyPolicy"),(i=document.createElement("a")).innerText=s.getString("TermsOfService"),$$WP.Captcha.GetProvider()===$$WP.Captcha.ProviderType.Google?(t.href="https://policies.google.com/privacy",i.href="https://policies.google.com/terms",n=s.getString("GoogleCompanyName"),o=s.getString("ReCaptchaName")):(t.href="https://www.hcaptcha.com/privacy",i.href="https://www.hcaptcha.com/terms",n=s.getString("IntuitionMachinesName"),o=s.getString("HCaptchaName")),s.addMnemonics({"@MYCHART@PRIVACYPOLICYMNEMONIC@":{Value:t.outerHTML,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@TERMSOFSERVICEMNEMONIC@":{Value:i.outerHTML,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@CAPTCHAPROVIDER@":{Value:n,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@CAPTCHATITLE@":{Value:o,EncodingType:$$WP.Strings.EncodingTypes.None}}),e=s.getString("CaptchaBlurb"),s.clearMnemonics(),e},__updateViewModelWithError:function WP$Scheduling$ConfirmationStepController$__updateViewModelWithError(){this.ViewModel={SchedulingStoppedTitle:this.__reviewResult.Error.PatientFriendlyErrorMessageTitle,SchedulingStoppedPretext:this.__reviewResult.Error.PatientFriendlyErrorMessage.join(" "),SchedulingStoppedButtontext:this.__reviewResult.Error.PatientFriendlyErrorMessageButtonText,HideButton:!this.__reviewResult.Error.IsPatientFriendlyErrorMessageRecoverable,HideStoppedIcon:this.__reviewResult.Error.IsPatientFriendlyErrorMessageIconHidden},this.ViewModel.StepShouldBeActive=!0,this.ViewModel.IsLoading=!1,this.template=$$WP.Templates.Scheduling.SchedulingStopped},__getPrimaryAppointmentViewModel:function WP$Scheduling$ConfirmationStepController$__getPrimaryAppointmentViewModel(e){var t=e.Appointments[0],i=new $$WP.Scheduling.AppointmentViewModel(t.toRawObject());return i.TitleHtml=this.__getCardTitleHtml(),this.__shouldShowDuration()?i.LengthInMinutes=this.Data.AppointmentBuilder.getTotalLengthInMinutes():i.LengthInMinutes=0,i},__getCompiledInstructionsFromReviewResult:function WP$Scheduling$ConfirmationStepController$__getCompiledInstructionsFromReviewResult(e){var t=this.__getSortedInstructions(e,this.Data.AppointmentBuilder),i=[],n=0,o=this.Data.AppointmentBuilder.numAppointments(),s=o>1,l=null,r="",a=null;for(null!==e.PatientInstructionsHtml&&e.PatientInstructionsHtml.length>0&&this.__appendInstructionsToArray(e.PatientInstructionsHtml,this.__getAppointmentNameForCardTitle(),s,i),n=0;n<o;n++)a=this.Data.AppointmentBuilder.getAppointment(n),r=t[n].InstructionsHtml,l=$$WPSchedulingUtil.GetVisitDisplayName(a,this._workflow.TicketInfo),null!==r&&r.length>0&&this.__appendInstructionsToArray(r,l,s,i);return i.join("")},__getSortedInstructions:function WP$Scheduling$ConfirmationStepController$__getSortedInstructions(e,t){var i=0,n=null,o=null,s=null,l={},r=[];for(i=0;i<t.numAppointments();i++)o=(n=t.getAppointment(i)).Slot,s=e.Appointments[i],l={DateTimeUtc:o.DateTimeUtc,InstructionsHtml:s.PatientInstructionsHTML,DisplayName:s.DisplayName||n.VisitType.DisplayName},r.push(l);return r.sort($$WP.Scheduling.Slot.slotSortFunction),r},__appendInstructionsToArray:function WP$Scheduling$ConfirmationStepController$__appendInstructionsToArray(e,t,i,n){i&&n.push("<section><div class='bold'>"+HTMLEncode(t)+"</div>"),n.push(e),i&&n.push("</section>")},arePrerequisitesComplete:function WP$Scheduling$ConfirmationStepController$arePrerequisitesComplete(){var e=0,t=null,i=!1;for(e=0;e<this.Data.AppointmentBuilder.numAppointments();e++)if(i=null!==(t=this.Data.AppointmentBuilder.getAppointment(e).Slot)&&t.IsRequest,!t||i)return!1;return!0},__getProviderToUseForPhoto:function WP$Scheduling$ConfirmationStepController$__getProviderToUseForPhoto(){var t=0,i=null,n=null,o=[];for(t=0;t<this.Data.AppointmentBuilder.numAppointments();t++)i=this.Data.AppointmentBuilder.getAppointment(t),e.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,i)&&(n=this.Data.Providers.getFromIndex("ID",i.Slot.ProviderId),-1===o.indexOf(n)&&o.push(n));return 1===o.length?o[0]:null},__shouldShowDuration:function WP$Scheduling$ConfirmationStepController$__shouldShowDuration(){return this.__reviewResult.Appointments[0].AppointmentLength>0},__getCardTitleHtml:function WP$Scheduling$ConfirmationStepController$__getCardTitleHtml(){var t,i,n,o=null,s=!0;return i=this.Data.AppointmentBuilder.getFirstAppointment(),t=this.__getAppointmentNameForCardTitle(),n=this.Data.Departments.getFromIndex("ID",i.Slot.DepartmentId),1===this.Data.AppointmentBuilder.numAppointments()?(o=this.Data.Providers.getFromIndex("ID",i.Slot.ProviderId),s=e.allowProviderSelectForAppointment(this.Data.AppointmentBuilder,i)):o=this.__getProviderToUseForPhoto(),$$WPSchedulingUtil.ConstructAppointmentStringHtml(o,n,t,s)},__getAppointmentNameForCardTitle:function WP$Scheduling$ConfirmationStepController$__getAppointmentNameForCardTitle(){var t=this.Data.AppointmentBuilder.getFirstAppointmentIndex(),i=this.Data.AppointmentBuilder.getFirstAppointment();switch(this._workflow.Type){case e.WorkflowTypesEnum.Ticket:return this.__isBundle()?this._workflow.Title:this._workflow.TicketInfo.DisplayName;case e.WorkflowTypesEnum.Reschedule:case e.WorkflowTypesEnum.DecisionTreeNode:return this.__reviewResult.Appointments[t].DisplayName||i.VisitType.DisplayName;default:return this.Data.AppointmentBuilder.numAppointments()>1?this.Data.AppointmentBuilder.ReasonForVisit.Title:this.__reviewResult.Appointments[t].DisplayName||i.VisitType.DisplayName}},beforeFirstRender:function WP$Scheduling$ConfirmationStepController$beforeFirstRender(){$$WPSchedulingUtil.RegisterConfirmationPartials()},afterRender:function WP$Scheduling$ConfirmationStepController$afterRender(){var e,t,i="#"+this.ViewModel.WaitListElementId,n="#"+this.ViewModel.FavoritesElementId;$$WP.FormValidation.initializeDOMSubtree(this.$root),this.$root.find("#reschedulereason_label_"+this.__selectedRescheduleReason).trigger("click"),$afe.select(".cardlist.matchHeights").each($$WP.Utilities.UI.Cards.MatchHeights),this.SchedulingStringsNamespace.clearMnemonics(),$$WP.Utilities.UI.IsMobile&&$$WP.Utilities.Mobile.Optimization.ChangeToFlexboxLayout(),this.__isLoaded?($$WPUtil.HideAjaxSpinner(this.$root.find(".confirmationstep .ajaxspinner")),this.triggerViewEvent($$WP.Analytics.ViewEvent.SubmodulesEnum.ConfirmationStep),null===(e=this.Data.AppointmentBuilder.getFirstAppointment().Slot)||this.__previouslySelectedSlot===e||e.IsRequest||this.$root.find("h2.header").focus(),this.__previouslySelectedSlot=e,this.$root.find("[data-id='schedule']").on("click",this._onClickSchedule),this.$root.find("[data-id='schedule-login']").on("click",this.__onClickLogin),this.__isInSelfTriageForAll()&&!this._workflow.SchedulingControllerParams.isInsuranceCollectionComplete?(this.$root.find("[data-id='schedule-guest']").on("click",this._onClickSchedule),this.$root.find("[data-id='schedule-condensed']").on("click",this._onClickSchedule),this.$root.find("[data-id='schedule-condensed']").on("auxclick",this._onClickSchedule)):(this.$root.find("[data-id='schedule-guest']").on("click",this.__onClickScheduleAsGuest),this.$root.find("[data-id='schedule-condensed']").on("click",this.__onClickScheduleAsGuest),this.$root.find("[data-id='schedule-condensed']").on("auxclick",this.__onAuxClickSchedule)),this.$root.find("textarea[name='comments']").on("change",this._onCommentsModified),this.$root.find(n).on("change",this._onFavoriteCheckboxChanged),this.$root.find(i).on("change",this._onWaitListCheckboxChanged),this.$root.find("#schedulingstop-button").click(this.__onSchedulingStopButtonClicked),this.$root.find("#editSlot").click(this.__returnToSlotStep),this.$root.find("#editLocationConfirmation").click(this.__onEditLocationClicked),$$WPSchedulingUtil.SetUpInstructions(this.ViewModel),this.$root.find(".schedulebutton").addClass("stickybanner"),this.$root.find(".changeLocationBtn").click(this.__onChangeLocationButtonClicked),this.$root.find("#chiefComplaint").on("change",this._onChiefComplaintChanged),this.$root.find("#requestreason").on("change",this._onRequestReasonChanged),(isCustomBranded()||$$WP.WidgetMode)&&this.__addConfirmationStepMyChartBranding()):(t=this.$root.find(".confirmationstep .ajaxspinner"),$$WPUtil.ShowAjaxSpinner(t)),this.__isLoaded=!1,this.__waitListCheckboxValue=this._getAddToWaitListByDefault(),this.__setAddToWaitListForAllAppointments(this.__waitListCheckboxValue),$$WPSchedulingUtil.HandleStickyBanner()},__addConfirmationStepMyChartBranding:function WP$Scheduling$ConfirmationStepController$__addConfirmationStepMyChartBranding(){var e;e=$afe.select("#footer .sidebarStyle").clone(),this.$root.find(".card.differentHeights").safeAppend(e)},triggerViewEvent:function WP$Scheduling$ConfirmationStepController$triggerViewEvent(){this.__isLoaded&&this.WP$Scheduling$StepController$triggerViewEvent()},_getViewEventSubmodule:function WP$Scheduling$ConfirmationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.ConfirmationStep},_canFavoriteAppointment:function WP$Scheduling$ConfirmationStepController$_canFavoriteAppointment(){if(this.__isGuestOrAnonymousContext())return!1;if(!this.__reviewResult||!this.__reviewResult.Appointments[0].CanSaveAsFavorite)return!1;if(this.__disableFavoriteAppointments)return!1;var t=this._workflow.Type;return t===e.WorkflowTypesEnum.Standard||t===e.WorkflowTypesEnum.Procedure||t===e.WorkflowTypesEnum.ExistingProvider},_canAddToWaitList:function WP$Scheduling$ConfirmationStepController$_canAddToWaitList(){return!this.__isBundle()&&(!this.__disableAddToWaitList&&(!!this.__reviewResult&&this.__reviewResult.Appointments[0].CanAddToWaitListWithFastPass))},_getAddToWaitListByDefault:function WP$Scheduling$ConfirmationStepController$_getAddToWaitListByDefault(){return!this.__disableAddToWaitList&&(!!this.__reviewResult&&this.__reviewResult.Appointments[0].AddToWaitListByDefault)},__isGuestOrAnonymousContext:function WP$Scheduling$ConfirmationStepController$__isGuestOrAnonymousContext(){return this._workflow.IsAnonymous||this._workflow.IsGuest},_loadReviewData:function WP$Scheduling$ConfirmationStepController$_loadReviewData(){var e;this.__isCurrentlyLoading||(e=this.__getAjaxParameters(!1),$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("ReviewAppointment",this._workflow)),data:$$WPUtil.postify(e),cache:!1,success:this._onReviewDataLoaded,error:this.__onErrorCallback}),this.__isCurrentlyLoading=!0)},_onReviewDataLoaded:function WP$Scheduling$ConfirmationStepController$_onReviewDataLoaded(e){this.__reviewResult=e,this.__isLoaded=!0,this.__isCurrentlyLoading=!1,this.updateStep()},_onClickSchedule:function WP$Scheduling$ConfirmationStepController$_onClickSchedule(e){e.preventDefault(),this.__validateForm()&&($afe.select(".startover").prop("disabled",!0),this.__isInSelfTriageForAll()&&!this._workflow.SchedulingControllerParams.isInsuranceCollectionComplete?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete):this.__schedulePostlogin())},__isInSelfTriage:function __isInSelfTriage(){return!!this._workflow.SchedulingControllerParams&&this._workflow.SchedulingControllerParams.rootDecisionTreeID},__isInSelfTriageForAll:function __isInSelfTriageForAll(){return this.__isInSelfTriage()&&this._workflow.IsGuest},__validateForm:function WP$Scheduling$ConfirmationStepController$__validateForm(){return!!(this._areCommentsValid()&&this._isSelectedRescheduleReasonValid()&&this._isChiefComplaintValid())||(this.__updateChiefComplaintValidationUI(),this.__updateRescheduleReasonValidationUI(),this.scrollToElementIfOffsceen(this.__getInvalidElement()),!1)},__schedulePostlogin:function __schedulePostlogin(){var e,t;this.Data.IsSchedulingCompleting||(t=this.$root.find(".confirmationstep .ajaxspinner"),$$WPUtil.ShowAjaxSpinner(t),$afe.select("#schedulingoverlay").css("z-index",1e3),this.Data.IsSchedulingCompleting=!0,e=this.__getAjaxParameters(!1),$.post({url:makeLink("Scheduling/ScheduleAppointment"),data:$$WPUtil.postify(e),cache:!1,success:this._onScheduled,error:this.__onSchedulingErrorCallback}))},__onSchedulingErrorCallback:function __onSchedulingErrorCallback(e,t,i){return $afe.select(".startover").prop("disabled",!1),this.__onErrorCallback(e,t,i)},__schedulePostSelfTriageReconciliation:function __schedulePostSelfTriageReconciliation(){var e,t;this.Data.IsSchedulingCompleting||(t=this.$root.find(".confirmationstep .ajaxspinner"),$$WPUtil.ShowAjaxSpinner(t),$afe.select("#schedulingoverlay").css("z-index",1e3),e=this.__getAjaxParameters(!0),$$WP.SelfTriage.Utilities.ReconcileSession(this._workflow.SchedulingControllerParams.rootDecisionTreeID,this._workflow.SchedulingControllerParams.decisionTreeAnswerID,e,this.__onErrorCallback))},__getInvalidElement:function WP$Scheduling$ConfirmationStepController$__getInvalidElement(){return this._isSelectedRescheduleReasonValid()?this._isChiefComplaintValid()?$afe.select(".commentssection"):this.$root.find("#chiefComplaint"):this.$root.find("#reschedulereason")},__onClickLogin:function WP$Scheduling$ConfirmationStepController$__onClickLogin(e){var t={};e.preventDefault(),this.__validateForm()&&(t=this.__getAjaxParameters(!0),$$WPSchedulingUtil.RedirectToLogin(t,this._workflow,this.__onRedirectUrlReceived,this.__onErrorCallback))},__onRedirectUrlReceived:function WP$Scheduling$ConfirmationStepController$__onRedirectUrlReceived(e){$$WP.Scheduling.SlotReservationHelpers.DestroyAllReservationCleanUpListeners(),WP.Events.cancelBeforeUnload();var t=e.Url;if($$WP.WidgetMode){var i=$$WP.Analytics.UsageTrackingController.getAnalyticsGuidFromWidget();i&&(t=$$WPUtil.addUrlParameter(t,"analyticsSessionId",i),t=$$WPUtil.addUrlParameter(t,"isRedirect","1"),$$WP.Analytics.UsageTrackingController.logPotentialSessionRedirectEvent(i))}window.top.location.href=makeLink(t)},__onClickScheduleAsGuest:function WP$Scheduling$ConfirmationStepController$__onClickScheduleAsGuest(e){e.preventDefault(),this.__validateForm()&&this.__redirectToScheduleAsGuest()},__onAuxClickSchedule:function WP$Scheduling$ConfirmationStepController$__onAuxClickSchedule(e){e.preventDefault()},__redirectToScheduleAsGuest:function WP$Scheduling$ConfirmationStepController$__redirectToScheduleAsGuest(e){var t=this.__getAjaxParameters(!0);$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("SchedulingRedirectToScheduleAsGuest",this._workflow)),data:$$WPUtil.postify(t),cache:!1,success:this.__onRedirectUrlReceived,error:this.__onErrorCallback})},__getAjaxParameters:function WP$Scheduling$ConfirmationStepController$__getAjaxParameters(e){this.Data.AppointmentBuilder.SchedulingComments=this.__comments,this.Data.AppointmentBuilder.RescheduleReason=this._getSelectedRescheduleReasonFromDom(),this.Data.AppointmentBuilder.ChiefComplaintId=this._getChiefComplaintIdFromDom(),this.Data.AppointmentBuilder.RequestReason=this._getSelectedFastPassReasonFromDom();var t={};return t.workflow=this._workflow.toRawRequestObject(),t.appointmentBuilder=e?this.Data.AppointmentBuilder.toRawRequestObject():this.Data.AppointmentBuilder.toSparseRawRequestObject(),t.nonce=$$WPUtil.GetPageNonce(),t},_areCommentsValid:function WP$Scheduling$ConfirmationStepController$_areCommentsValid(){return this.__updateCommentsValidationUI(),!((this.__comments||"").length>0&&!this.__doesStepAllowComments()&&!this.__isOtherChiefComplaintSelected)&&!(this.$root.find("textarea[name='comments'][data-invalid]").length>0)},__doesStepRequireComments:function WP$Scheduling$ConfirmationStepController$__doesStepRequireComments(){if(this.__reviewResult&&this.__reviewResult.CommentsSettings)return this.__reviewResult.CommentsSettings.AreCommentsRequired},__doesStepAllowComments:function WP$Scheduling$ConfimrationStepController$__doesStepAllowComments(){if(this.__reviewResult&&this.__reviewResult.CommentsSettings)return this.__reviewResult.CommentsSettings.AreCommentsAllowed},__getMaxCommentsLength:function WP$Scheduling$ConfirmationStepController$__getMaxCommentsLength(){if(this.__reviewResult&&this.__reviewResult.CommentsSettings)return this.__reviewResult.CommentsSettings.MaxCommentsLength},__updateCommentsValidationUI:function WP$Scheduling$ConfirmationStepController$__updateCommentsValidationUI(){this.$root.find("[name='comments']").trigger("change")},_getSelectedFastPassReasonFromDom:function WP$Scheduling$ConfirmationStepController$_getSelectedFastPassReasonFromDom(){return this.__getAvailableFastPassReasonsFromDom().filter(":checked").val()||""},__getAvailableFastPassReasonsFromDom:function WP$Scheduling$ConfirmationStepController$__getAvailableFastPassReasonsFromDom(){return this.$root.find("input[name='requestreason']")},_onRequestReasonChanged:function WP$Scheduling$ConfirmationStepController$_onRequestReasonChanged(){var e=this.$root.find("input[name='requestreason']");e.on("change",(function(){this.checked&&e.not(this).prop("checked",!1)}))},_getSelectedRescheduleReasonFromDom:function WP$Scheduling$ConfirmationStepController$_getSelectedRescheduleReasonFromDom(){return this.__getAvailableRescheduleReasonsFromDom().filter(":checked").val()||""},__getAvailableRescheduleReasonsFromDom:function WP$Scheduling$ConfirmationStepController$__getAvailableRescheduleReasonsFromDom(){return this.$root.find("input[name='reschedulereason']")},__updateRescheduleReasonValidationUI:function WP$Scheduling$ConfirmationStepController$__updateRescheduleReasonValidationUI(){this.__getAvailableRescheduleReasonsFromDom().trigger("change"),this.$root.find("#reschedulereason").focus()},_isSelectedRescheduleReasonValid:function WP$Scheduling$ConfirmationStepController$_isSelectedRescheduleReasonValid(){var e=this._getSelectedRescheduleReasonFromDom();return(0!==e.length||!this.__requireRescheduleReason)&&!(e.length>0&&0===this.__rescheduleReasons.length)},_onScheduled:function WP$Scheduling$ConfirmationStepController$_onScheduled(e,t,i){var n,o;this.Data.IsSchedulingCompleting=!1,$afe.select(".startover").prop("disabled",!1),$$WPUtil.IsNullOrEmpty(e)?($$WP.Debug.log("Error scheduling appointment. No response from web server."),o=$$WP.Strings.get("ErrorMessage","Scheduling")):e.Success?($$WP.Scheduling.SlotReservationHelpers.DestroyAllReservationCleanUpListeners(),null!==this.__onSchedulingCompleteCallback&&this.__onSchedulingCompleteCallback(e.Appointments,this.__shouldShowSolutionDetails(),e.HasMobileLoginToken)):o=e.Error.PatientFriendlyErrorMessage.join(" "),$$WPUtil.IsNullOrEmpty(o)||(this.$root.find(".loadingoverlay").hide(),n=new $$WPComp.MessageComponent({TitleText:$$WP.Strings.get("ScheduleErrorTitle","Scheduling"),Message:o,ToolbarButtons:[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("ScheduleErrorButtonLabel","Scheduling"),null,"cancelworkflow","")],callback:this.__returnToSlotStep}),$$WPUtil.quickPopup(n),$afe.select("#schedulingoverlay").css("z-index",-1e3))},_onCommentsModified:function _onCommentsModified(){this.__comments=this._getCommentsFromDOM()},_getCommentsFromDOM:function WP$Scheduling$ConfirmationStepController$_getCommentsFromDOM(){return this.$root.find("textarea[name='comments']").val()||""},_onFavoriteCheckboxChanged:function _onFavoriteCheckboxChanged(e){var t=$afe.jq(e.target);this.__favoriteCheckboxValue=t.is(":checked"),this.Data.AppointmentBuilder.SaveAsFavorite=this.__favoriteCheckboxValue},_onWaitListCheckboxChanged:function _onWaitListCheckboxChanged(e){var t=$afe.jq(e.target);this.__waitListCheckboxValue=t.is(":checked"),this.__setAddToWaitListForAllAppointments(this.__waitListCheckboxValue)},__setAddToWaitListForAllAppointments:function WP$Scheduling$ConfirmationStepController$__setAddToWaitListForAllAppointments(e){var t=0;for(t=0;t<this.Data.AppointmentBuilder.numAppointments();t++)this.Data.AppointmentBuilder.getAppointment(t).setProperty("AddToWaitList",e);$requestReasonsElement=this.$root.find("fieldset[name='requestreasonssection']"),e?$requestReasonsElement.removeClass("hidden"):$requestReasonsElement.addClass("hidden")},__onSchedulingStopButtonClicked:function WP$Scheduling$ConfirmationStepController$__onSchedulingStopButtonClicked(){this.__returnToSlotStep()},__returnToSlotStep:function WP$Scheduling$ConfirmationStepController$__returnToSlotStep(){$$WPSchedulingUtil.ReturnToSlotStepAndReloadSlots(this.Data)},__onChangeLocationButtonClicked:function WP$Scheduling$ConfirmationStepController$__onChangeLocationButtonClicked(){$$WPSchedulingUtil.ReturnToStep($$WP.Scheduling.SchedulingStep.StepTypeEnum.TelehealthLocation,this.Data,null,!0)},__onEditLocationClicked:function __onEditLocationClicked(){$$WPSchedulingUtil.ReturnToStep($$WP.Scheduling.SchedulingStep.StepTypeEnum.Location,this.Data,null,!0)},getSchedulingContinueBanner:function WP$Scheduling$StepController$getSchedulingContinueBanner(){return this.$root.parent().find(".schedulebutton")},getContinueButton:function WP$Scheduling$ConfirmationStepController$getContinueButton(e){if(this.ViewModel){if(this.ViewModel.IsLoggedIn)return e.find("[data-id='schedule']");if(this.ViewModel.CanContinueToLoginOrScheduleAsGuest)return e.find("[data-id='schedule-condensed']")}return e.find("[data-id='schedule-login']")},isUsingWorkflowNavigation:function WP$Scheduling$ConfirmationStepController$isUsingWorkflowNavigation(){return!1},__shouldShowSolutionDetails:function WP$Scheduling$ConfirmationStepController$__shouldShowSolutionDetails(){return!!this.__isBundle()||(this.Data.AppointmentBuilder.numAppointments()>1&&!this.Data.AppointmentBuilder.hasAllSameSlotDepartmentsSelected()||(this.Data.AppointmentBuilder.numAppointments()>1&&!this.Data.AppointmentBuilder.isSelectedTelehealthModeSameForAppts()||this.Data.AppointmentBuilder.showAsMultipleVisits(this.Data.VisitTypes)))},__isBundle:function WP$Scheduling$ConfirmationStepController$__isBundle(){return!!this.Data.AppointmentBuilder.getFirstAppointment().BundleId},__isChiefComplaintAllowed:function WP$Scheduling$ConfimrationStepController$__isChiefComplaintAllowed(){return!!this.__reviewResult&&this.__reviewResult.IsChiefComplaintAllowed},__updateChiefComplaintValidationUI:function WP$Scheduling$ConfirmationStepController$__updateChiefComplaintValidationUI(){this.$root.find("[name='chiefComplaint']").trigger("change")},_isChiefComplaintValid:function WP$Scheduling$ConfirmationStepController$_isChiefComplaintValid(){return!this.$root.find("select[name='chiefComplaint'][data-invalid]").length>0},_getChiefComplaintIdFromDom:function WP$Scheduling$ConfirmationStepController$_getChiefComplaintIdFromDom(){return this.$root.find("select[name='chiefComplaint']").val()},__createHighAcuityWarning:function WP$Scheduling$ConfirmationStepController$__createHighAcuityWarning(){var e=document.createElement("span"),t=$afe.jq(e),i=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=$afe.jq(i),o=document.createElementNS("http://www.w3.org/2000/svg","use"),s=$afe.jq(o),l=document.createElement("span");dangerou$.setHtml(l,$$WP.Strings.get("HighAcuityWarning","Scheduling"));var r=$afe.jq(l),a=makeStaticLink("/images/library.svg#scheduling_highacuitywarning");return t.safeAttr("class","alert"),n.safeAttr("class","yield"),n.safeAttr("id","highAcuityYieldIcon"),n.safeAttr("focusable","false"),s.safeAttr("href",a),n.safeAppend(s),t.safeAppend(n),t.safeAppend(r),t},__onUrgentChiefComplaintToggled:function WP$Scheduling$ConfirmationStepController$__onUrgentChiefComplaintToggled(){var e="",t=this.$root.find("#highAcuity");this.__isUrgentChiefComplaintSelected?(e=this.__createHighAcuityWarning(),t.empty().safeAppend(e)):t.empty()},__getCommentValidationSettings:function WP$Scheduling$ConfirmationStepController$__getCommentsValidationSettings(e){return new $$WP.FormValidation.ValidationSettings({required:e,maxLength:this.__getMaxCommentsLength(),showCharacterCounter:!0,stringsNamespace:"Core.FormValidation.Scheduling.ConfirmationStep"})},__onOtherChiefComplaintToggled:function WP$Scheduling$ConfirmationStepController$__onOtherChiefComplaintToggled(){var e=this.$root.find(".commentssection"),t="#schedulingConfirmationComments_"+this.Id,i=this.$root.find("#commentsLabel"),n=this.$root.find(t);if(this.__isOtherChiefComplaintSelected){n.safeAttr("disabled",!1),i.addClass("required"),e.removeClass("hidden");var o=this.__getCommentValidationSettings(!0);n.safeAttr("data-validation-settings",o.toJSON()),$$WP.FormValidation.initializeDOMSubtree(this.$root)}else{this.__doesStepAllowComments()||(e.addClass("hidden"),i.removeClass("required"),n.val(""),n.safeAttr("disabled",!0)),this.__doesStepRequireComments()||i.removeClass("required");o=this.__getCommentValidationSettings(this.__doesStepRequireComments());n.safeAttr("data-validation-settings",o.toJSON()),$$WP.FormValidation.initializeDOMSubtree(this.$root),this.__updateCommentsValidationUI()}},_onChiefComplaintChanged:function WP$Scheduling$ConfirmationStepController$_onChiefComplaintChanged(){var e=!1,t=!1,i=this._getChiefComplaintIdFromDom(),n=this.__chiefComplaintList.getFirstInIndex("ID",i);n&&(e=n.IsUrgent,t=n.IsOther),this.Data.AppointmentBuilder.ChiefComplaintName=n?n.DisplayName:"",this.__isUrgentChiefComplaintSelected=e,this.__isOtherChiefComplaintSelected=t,this.__onUrgentChiefComplaintToggled(),this.__onOtherChiefComplaintToggled()}},$$WP.Scheduling.ConfirmationStepController=n,n.extend($$WP.Scheduling.StepController,"WP$Scheduling$ConfirmationStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$ConfirmationStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$SchedulingRequestStepController$definition(){var e=$$WP.Utilities.UI.TimePreferenceWidgetController,t=function WP$Scheduling$RequestStepController(e,t,i,n,s,r,o,l,a,d){var u=0;if(this.WP$Scheduling$StepController(e,i,null,null,null,$$WP.Templates.Scheduling.RequestStep),this.proxify("__onClickLogin","__onClickRequest","_onRequestCompleted","_onCommentsModified","_onCalendarDatePicked","_onDateInputChanged","_onViewersModified","__onSlotChanged"),this._workflow=t,this._appointment=this.Data.AppointmentBuilder.getFirstAppointment(),this._onRequestCompletedCallback=s,this.__onErrorCallback=r,this.__isLoginEnabled=o||!1,this.__isScheduleAsGuestDisabled=l,this.__isDemoMode=a||!1,this.__requestReasons=d||[],this._viewers=n.Viewers||[],this._viewersString="",this._topicNames=n.TopicNames||"",this._allowSelectViewers=n.AllowSelectViewers||!1,this._showViewers=n.ShowViewers||!1,this._drawViewersSection=(this._allowSelectViewers||this._showViewers)&&!(1===this._viewers.length&&this._viewers[0].IsSelf),!this._allowSelectViewers&&this._showViewers)for(u=0;u<this._viewers.length;u++)$$WP.Utilities.IsNullOrEmpty(this._viewers[u].Name)||(""!==this._viewersString&&(this._viewersString=this._viewersString+this.SchedulingStringsNamespace.getString("RequestViewersListDelimiter")),this._viewers[u].IsSelf?this._viewersString=this._viewersString+this.SchedulingStringsNamespace.getString("RequestViewerButtonSelf"):this._viewersString=this._viewersString+this._viewers[u].Name);this._onFilePreferences=n.SchedulePreferences||null,this._daysOfWeekList=n.DaysOfWeekList||["","","","","","",""],this._requireComments=n.RequireRequestComments,this._maxCommentsLength=n.MaxCommentsLength,null!==n.StartDate&&(this._startDte=WP.Utils.date2dte(new Date(n.StartDate))),null!==n.EndDate&&(this._endDte=WP.Utils.date2dte(new Date(n.EndDate))),this._appointment.addPropertyListener("Slot",this.__onSlotChanged),this.$root.on("click","[data-id='request-login']",this.__onClickLogin),this.$root.on("click","[data-id='request']",this.__onClickRequest),$afe.select("body").on("change","input[name='"+this.__fromDateFieldId()+"'],input[name='"+this.__toDateFieldId()+"']",this._onDateInputChanged),this.$root.on("change","textarea[name='comments']",this._onCommentsModified),this.$root.on("change","input[name='otherprovider']",this._onCommentsModified),this.$root.on("change","input[name='otherrfv']",this._onCommentsModified),this.$root.on("click","[data-id='viewers']",this._onViewersModified),this.$root.find(".requestViewerCheckbox").on("click",(function(){$$WP.Utilities.UI.ToggleButtonClick(this,event,0)}))};t.prototype={_appointment:null,TimePreferenceWidget:null,_startDte:null,_endDte:null,_drawViewersSection:!1,_viewers:null,_viewersString:null,_allowSelectViewers:!1,_showViewers:!1,_otherProviderText:null,_otherRfvText:null,_comments:null,_requireComments:null,_maxCommentsLength:null,_maxOtherLength:200,_onRequestCompletedCallback:null,__onErrorCallback:null,_onFilePreferences:null,_daysOfWeekList:null,_previouslySelectedSlot:null,__isLoginEnabled:!1,__isScheduleAsGuestDisabled:!1,__isDemoMode:!1,__requestReasons:null,__selectRequestReason:null,updateViewModel:function WP$Scheduling$RequestStepController$updateViewModel(){var e,t,i,n,s,r,o,l,a,d;s=new $$WP.FormValidation.ValidationSettings({required:this.__doesStepRequireComments(),maxLength:this._maxCommentsLength,showCharacterCounter:!0}),r=new $$WP.FormValidation.ValidationSettings({required:!0,maxLength:this._maxOtherLength}),t=(n=this._getCurrentRequestSelections()).ReasonForVisit,e=n.Provider,i=n.Department,o=WP.Utils.dte2date(this.__getNearestFutureDteAllowed()),l=WP.Utils.dte2date(this.__getFurthestFutureDteAllowed()),d=(a=!this.__isScheduleAsGuestDisabled)||!a&&!this.__isLoginEnabled,this.__selectRequestReason=this._getSelectedFastPassReasonFromDom(),this.ViewModel={StepControllerId:this.Id,Provider:e,ReasonForVisit:t,Department:i,StepShouldBeActive:!0,Viewers:this._viewers,ViewersString:this._viewersString,AllowSelectViewers:this._allowSelectViewers,ShowViewers:this._showViewers,DrawViewersSection:this._drawViewersSection,Comments:this._comments,FromDate:$$WPSchedulingUtil.FormatDteAsDate(this._startDte),FromDateFieldId:this.__fromDateFieldId(),ToDate:$$WPSchedulingUtil.FormatDteAsDate(this._endDte),ToDateFieldId:this.__toDateFieldId(),DateValidationSettings:$$WPSchedulingUtil.GetDateFieldValidationSettings(o,l,!1),RequireComments:this.__doesStepRequireComments(),CommentsValidationSettings:s,CommentsInitiallyInvalid:!$$WPUtil.IsNullOrEmpty(this._comments),CommentsElementId:"requestComments_"+this.Id,IsMobile:$$WP.Utilities.UI.IsMobile,OtherProviderValidationSettings:r,OtherRfvValidationSettings:r,IsLoggedIn:!this._workflow.IsAnonymous,IsLoginEnabled:this.__isLoginEnabled,CanContinueToLoginOrScheduleAsGuest:d,TopicNames:this._topicNames,IsDemoMode:this.__isDemoMode,RequestReasons:this.__requestReasons,IsEmbedded:$$WP.WidgetMode,IsCustomBranded:isCustomBranded()},this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@PROVIDER@":{Value:e.Name,EncodingType:$$WP.Strings.EncodingTypes.HTML},"@MYCHART@REASONFORVISIT@":{Value:t.Title,EncodingType:$$WP.Strings.EncodingTypes.HTML}})},arePrerequisitesComplete:function WP$Scheduling$RequestStepController$arePrerequisitesComplete(){return null!==this._getCurrentRequestSelections()},beforeFirstRender:function WP$Scheduling$RequestStepController$beforeFirstRender(){$$WPSchedulingUtil.RegisterConfirmationPartials()},afterRender:function WP$Scheduling$RequestStepController$afterRender(){var t;this.SchedulingStringsNamespace.clearMnemonics(),this.TimePreferenceWidget=new e(this.$root.find(".timepreferencecontainer"),null,null,null,this._onFilePreferences,this._daysOfWeekList,!1,null),$$WP.Strings.setDefaultNamespace("Scheduling"),this.__setupDateRangeFields(),t=this._appointment.Slot,this.$root.find("h2.header").focus(),this._previouslySelectedSlot=t,$$WP.FormValidation.initializeDOMSubtree(this.$root),$afe.select(".requestbutton").addClass("stickybanner"),$$WPUtil.SafeToRedirectOverrideSettings={},$$WPSchedulingUtil.HandleStickyBanner(),$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("LogRequestConfirmationStep",this._workflow)),data:$$WPUtil.postify(this.__getAjaxParameters()),cache:!1})},_getViewEventSubmodule:function WP$Scheduling$StepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.RequestStep},__onSlotChanged:function WP$Scheduling$RequestStepController$__onSlotChanged(){var e=this._appointment.Slot;$$WPUtil.IsNullOrEmpty(e)||e.IsRequest?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired),this.Data.AppointmentBuilder.RequestPreferences=null,this.updateStep()},_getCurrentRequestSelections:function WP$Scheduling$RequestStepController$_getCurrentRequestSelections(){var e;return null!==(e=this._appointment.Slot)&&e.IsRequest?{Slot:e,ReasonForVisit:this.Data.AppointmentBuilder.ReasonForVisit,Provider:this.Data.Providers.getFromIndex("ID",e.ProviderId),ChildProviderIds:e.RequestChildProviderIds,Department:this.Data.Departments.getFromIndex("ID",e.DepartmentId),VisitTypeId:this._appointment.VisitType.ID,SchedulingOverride:this._appointment.SchedulingOverride}:null},__getSelectedViewers:function WP$Scheduling$RequestStepController$__getSelectedViewers(){var e=0,t=[];if(this._drawViewersSection)for($viewers=this.$root.find("[name='viewers']:checked"),e=0;e<$viewers.length;e++)t.push($afe.jq($viewers.get(e)).val());else if(this._allowSelectViewers)for(e=0;e<this._viewers.length;e++)t.push(this._viewers[e].WprId);return t},_getPreferredTimes:function WP$Scheduling$RequestStepController$_getPreferredTimes(){var t=null,i=null,n=null,s=0,r=0,o=[],l=null;switch(this.$root.find(".timepreferencewidget input.clearradio:checked").safeAttr("value")){case e.LabelValueEnum.AllAvailable:t=this.__buildPreferredTimesObject(!0,!1);break;case e.LabelValueEnum.OnFile:t=this.__buildPreferredTimesObject(!1,!0);break;case e.LabelValueEnum.Other:if(0===(i=this.$root.find(".timepreferencewidget input[type='checkbox']:checked")).length)t=this.__buildPreferredTimesObject(!0,!1);else{for(s=0;s<7;s++)for(i=this.$root.find(".timepreferencewidget input[type='checkbox']:checked[data-day-index='"+s+"']"),r=0;r<i.length;r++)n=$afe.jq(i[r]),l=$$WPSchedulingUtil.GetTimePreferenceRangeProps(n),o.push(l);t=this.__buildPreferredTimesObject(!1,!1,o)}}return t},__buildPreferredTimesObject:function WP$Scheduling$RequestStepController$__buildPreferredTimesObject(e,t,i){return{IsAllAvailable:e,IsUseOnFile:t,PreferredDays:i}},__setupDateRangeFields:function WP$Scheduling$RequestStepController$__setupDateRangeField(){var e,t;e=makeStaticLink("images/calendar.svg"),t=WP.Utils.date2dte(new Date),clearCalendarDateRange(),writeCalendar(this.__fromDateFieldId(),"range",e,t,"",this._onCalendarDatePicked),writeCalendar(this.__toDateFieldId(),"range",e,t,"",this._onCalendarDatePicked)},__onClickLogin:function WP$Scheduling$RequestStepController$__onClickLogin(e){var t={};e.preventDefault(),this.__isRequestFormValid()&&(t=this.__getAjaxParameters(),$$WPSchedulingUtil.RedirectToLogin(t,this._workflow,this.__onRedirectUrlReceived,this.__onErrorCallback))},__onClickRequest:function WP$Scheduling$RequestStepController$__onClickRequest(e){var t={};e.preventDefault(),this.__isRequestFormValid()&&(t=this.__getAjaxParameters(),this._workflow.IsAnonymous?this.__redirectToRequestAsGuest(t):this.__requestAppointment(t))},__getAjaxParameters:function WP$Scheduling$RequestStepController$__getAjaxParameters(){var e=this._getCurrentRequestSelections(),t={};return this.Data.AppointmentBuilder.RequestReason=this._getSelectedFastPassReasonFromDom(),this.Data.AppointmentBuilder.RequestPreferences={Comments:this._comments,Viewers:this.__getSelectedViewers(),StartDte:this._startDte,EndDte:this._endDte,PreferredTimes:this._getPreferredTimes(),OtherProvider:e.Provider.OtherOption?this._otherProviderText:null,OtherRfv:e.ReasonForVisit.IsOtherRfv?0===this._topicNames.length?this._otherRfvText:this.SchedulingStringsNamespace.getString("HealthMaintenanceTopicsOtherDefaultRFV"):""},t.workflow=this._workflow.toRawRequestObject(),t.appointmentBuilder=this.Data.AppointmentBuilder.toRawRequestObject(),t},__isRequestFormValid:function WP$Scheduling$RequestStepController$__isRequestFormValid(){var e=this._getCurrentRequestSelections();return null!==e&&(e.Provider.OtherOption&&($$WPUtil.IsNullOrEmpty(this._otherProviderText)||this._otherProviderText.length>this._maxOtherLength)?(this.$root.find("[name='otherprovider']").trigger("change"),this.scrollToElementIfOffsceen(this.$root.find(".otherprovidersection")),!1):e.ReasonForVisit.IsOtherRfv&&($$WPUtil.IsNullOrEmpty(this._otherRfvText)||this._otherRfvText.length>this._maxOtherLength)&&0===this._topicNames.length?(this.$root.find("[name='otherrfv']").trigger("change"),this.scrollToElementIfOffsceen(this.$root.find(".otherrfvsection")),!1):(comments=this._comments||"",0===comments.length&&this.__doesStepRequireComments()||comments.length>this._maxCommentsLength?(this.$root.find("[name='comments']").trigger("change"),this.scrollToElementIfOffsceen(this.$root.find(".commentssection")),!1):!!this.__areDateInputsProperlyFormatted()||(this.scrollToElementIfOffsceen(this.$root.find(".datesection")),this.__getInvalidDateInputs().trigger("change"),!1)))},__requestAppointment:function WP$Scheduling$RequestStepController$__requestAppointment(e){this.Data.IsSchedulingCompleting||($$WPUtil.ShowAjaxSpinner(this.$root.find(".requeststep .ajaxspinner")),this.Data.IsSchedulingCompleting=!0,$.post({url:makeLink("Scheduling/RequestAppointment"),data:$$WPUtil.postify(e),cache:!1,success:this._onRequestCompleted,traditional:!0}))},__redirectToRequestAsGuest:function WP$Scheduling$RequestStepController$__redirectToRequestAsGuest(e){$.post({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("SchedulingRedirectToScheduleAsGuest",this._workflow)),data:$$WPUtil.postify(e),cache:!1,success:this.__onRedirectUrlReceived,error:this.__onErrorCallback})},__onRedirectUrlReceived:function WP$Scheduling$RequestStepController$__onRedirectUrlReceived(e){WP.Events.cancelBeforeUnload();var t=e.Url;if($$WP.WidgetMode){var i=$$WP.Analytics.UsageTrackingController.getAnalyticsGuidFromWidget();i&&(t=$$WPUtil.addUrlParameter(t,"analyticsSessionId",i),t=$$WPUtil.addUrlParameter(t,"isRedirect","1"),$$WP.Analytics.UsageTrackingController.logPotentialSessionRedirectEvent(i))}window.top.location.href=makeLink(t)},_getSelectedFastPassReasonFromDom:function WP$Scheduling$RequestStepController$_getSelectedFastPassReasonFromDom(){return this.__getAvailableFastPassReasonsFromDom().filter(":checked").val()||""},__getAvailableFastPassReasonsFromDom:function WP$Scheduling$RequestStepController$__getAvailableFastPassReasonsFromDom(){var e=this.$root.find("input[name='requestreason']");return e.on("change",(function(){this.checked&&e.not(this).prop("checked",!1)})),e},__doesStepRequireComments:function WP$Scheduling$RequestStepController$__doesStepRequireComments(){return this._requireComments||this.Data.AppointmentBuilder.DidRequestFromHardStop},_onRequestCompleted:function WP$Scheduling$RequestStepController$_onRequestCompleted(e){var t;this.Data.IsSchedulingCompleting=!1,$$WPUtil.HideAjaxSpinner($afe.select(".schedulingSpinner .ajaxspinner")),e.Success?this._onRequestCompletedCallback&&this._onRequestCompletedCallback(e.HasMobileLoginToken):(t=new $$WPComp.MessageComponent({TitleText:this.SchedulingStringsNamespace.getString("RequestErrorTitle"),Message:this.SchedulingStringsNamespace.getString("RequestErrorMessage"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button(this.SchedulingStringsNamespace.getString("RequestErrorButtonLabel"),null,"cancelworkflow","")]}),$$WPUtil.quickPopup(t))},_onCommentsModified:function WP$Scheduling$RequestStepController$_onCommentsModified(){var e,t;this._comments=this.$root.find("textarea[name='comments']").val()||"",(e=this.$root.find("input[name='otherprovider']")).length>0?this._otherProviderText=e.val().trim():this._otherProviderText="",(t=this.$root.find("input[name='otherrfv']")).length>0?this._otherRfvText=t.val().trim():this._otherRfvText=""},_onCalendarDatePicked:function WP$Scheduling$RequestStepController$_onCalendarDatePicked(e,t,i,n){var s,r;void 0!==n&&(s=new Date(e,t,i),r=WP.Utils.date2dte(s),n.name===this.__fromDateFieldId()?(this._startDte=r,this.$root.find(".daterangeinput[name="+this.__toDateFieldId()+"]").focus()):(this._endDte=r,this.$root.find(".timeTable .togglebutton:checked").focus()),this.__swapDatesIfBackwards(),this._updateDateFields())},_onDateInputChanged:function WP$Scheduling$RequestStepController$_onDateInputChanged(e){var t,i,n;t=e.target.value,n=null,this.__areDateInputsProperlyFormatted()&&(""===t?n=null:(i=parseDate(t,!0),n=WP.Utils.date2dte(i)),e.target.name===this.__fromDateFieldId()?this._startDte=n:this._endDte=n,this.__swapDatesIfBackwards(),this._updateDateFields())},__areDateInputsProperlyFormatted:function WP$Scheduling$RequestStepController$__areDateInputsProperlyFormatted(){return 0===this.__getInvalidDateInputs().length},__getInvalidDateInputs:function WP$Scheduling$RequestStepController$__getInvalidDateInput(){return this.$root.find(".daterangeinput[data-invalid='true']")},__swapDatesIfBackwards:function WP$Scheduling$RequestStepController$__swapDatesIfBackwards(){var e,t,i;e=this._startDte,t=this._endDte,i=null,e&&t&&e>t&&(i=t,t=e,e=i),this._startDte=e,this._endDte=t},__getNearestFutureDteAllowed:function WP$Scheduling$RequestStepController$__getNearFutureDteAllowed(){return WP.Utils.date2dte(new Date)},__getFurthestFutureDteAllowed:function WP$Scheduling$RequestStepController$__getFurthestFutureDteAllowed(){return this.__getNearestFutureDteAllowed()+3650},_updateDateFields:function WP$Scheduling$RequestStepController$_updateDateFields(){var e,t;e=$$WPSchedulingUtil.FormatDteAsDate(this._startDte),t=$$WPSchedulingUtil.FormatDteAsDate(this._endDte),this.$root.find("input[name='"+this.__fromDateFieldId()+"']").val(e),this.$root.find("input[name='"+this.__toDateFieldId()+"']").val(t)},__fromDateFieldId:function WP$Scheduling$RequestStepController$__fromDateFieldId(){return"fromDate_"+this.Id},__toDateFieldId:function WP$Scheduling$RequestStepController$__toDateFieldId(){return"toDate_"+this.Id},_onViewersModified:function WP$Scheduling$RequestStepController$_onViewersModified(){var e;for(e=0;e<this._viewers.length;e++)this._viewers[e].Selected=this.$root.find("input[name='viewers'][value='"+this._viewers[e].WprId+"']").get(0).checked},getSchedulingContinueBanner:function WP$Scheduling$RequestStepController$getSchedulingContinueBanner(){return this.$root.parent().find(".requestbutton")},getContinueButton:function WP$Scheduling$RequestStepController$getContinueButton(e){return e.find("[data-id='request']")},isUsingWorkflowNavigation:function WP$Scheduling$RequestStepController$isUsingWorkflowNavigation(){return!1}},$$WP.Scheduling.RequestStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$RequestStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$RequestStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$SchedulingCustomStepController$definition(){var t=function WP$Scheduling$CustomStepController(t,e,i,n){this.WP$Scheduling$StepController(t,e,null,null,null,$$WP.Templates.Scheduling.CustomStep),this.__isLandingStep=i,this.__customStringsKey=n,this.__schedulingStringsNamespace=$$WP.Strings.getNamespace("Scheduling"),this.proxify("updateStep","_onClick","clearStepStatus"),this.__isLandingStep||this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this.clearStepStatus),this.$root.on("click","[data-id='custom']",this._onClick)};t.prototype={__isLandingStep:!1,__customStringsKey:null,__schedulingStringsNamespace:null,updateViewModel:function WP$Scheduling$CustomStepController$updateViewModel(){this.ViewModel={Count:0,StepShouldBeActive:!1,IsLandingStep:this.__isLandingStep},this.__isLandingStep?this.__updateViewModelForLandingPage():this.__updateViewModelForVisitType()},__updateViewModelForVisitType:function WP$Scheduling$CustomStepController$updateViewModelForVisitType(){var t,e=this.__getCustomStepVisitType();null===e||$$WPUtil.IsNullOrEmpty(e.CustomStepBodyKey)?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):(t=this.__schedulingStringsNamespace.getString("CustomStepStrings_"+e.CustomStepBodyKey),this.__updateViewModelFromStrings(e.CustomStepHeader,t,e.CustomStepBodyKey,e.CustomStepContinueButtonText))},__updateViewModelForLandingPage:function WP$Scheduling$CustomStepController$updateViewModelForLandingPage(){if($$WPUtil.IsNullOrEmpty(this.__customStringsKey))this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired);else{var t=this.__schedulingStringsNamespace.getString("CustomLandingPageTitle_"+this.__customStringsKey),e=this.__schedulingStringsNamespace.getString("CustomLandingPageBody_"+this.__customStringsKey),i=this.__schedulingStringsNamespace.getString("CustomLandingPageButtonText_"+this.__customStringsKey);$$WPUtil.IsNullOrEmpty(e)?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):this.__updateViewModelFromStrings(t,e,this.__customStringsKey,i)}},__updateViewModelFromStrings:function WP$Scheduling$CustomStepController$updateViewModelFromStrings(t,e,i,n){this.ViewModel={Count:0,StepShouldBeActive:!0,CustomStepHeader:t,CustomStepBody:e,CustomStepBodyKey:i,CustomStepContinueButtonText:n,IsLandingStep:this.__isLandingStep}},__getCustomStepVisitType:function WP$Scheduling$CustomStepController$__getCustomStepVisitType(){var t;return t=this.Data.AppointmentBuilder.getFirstAppointment(),$$WPUtil.IsNullOrEmpty(t.PanelId)?t.VisitType:this.Data.VisitTypes.getFirstInIndex("ID",t.PanelId)},afterRender:function WP$Scheduling$CustomStepController$afterRender(){$$WPSchedulingUtil.FocusElement(this.$root.find("h2.header")),this.getSchedulingContinueBanner().addClass("stickybanner"),$$WPSchedulingUtil.HandleStickyBanner()},_getViewEventSubmodule:function WP$Scheduling$CustomStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.CustomStep},clearStepStatus:function WP$Scheduling$CustomStepController$clearStepStatus(){this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},_onClick:function WP$Scheduling$CustomStepController$onClick(t){this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},getContinueButton:function WP$Scheduling$CustomStepController$getContinueButton(t){return t.find("[data-id='custom']")},isUsingWorkflowNavigation:function WP$Scheduling$CustomStepController$isUsingWorkflowNavigation(){return!1},getSchedulingContinueBanner:function WP$Scheduling$CustomStepController$getSchedulingContinueBanner(){return this.$root.parent().find(".customstepbutton")}},$$WP.Scheduling.CustomStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$CustomStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$CustomStepController(t){$$WP.Debug.UnitTest.assert}));;
!function WP$SchedulingReservationStepController$definition(){var e=function WP$Scheduling$ReservationStepController(e,t,o,n,i){this.WP$Scheduling$StepController(e,o,null,null,null,$$WP.Templates.Scheduling.ReservationStep),this.proxify("__onSlotChanged","__onSlotReservationChanged","__onAppointmentsChanged","__makeReservation","__onMakeReservationCallback","__onMakeReservationError","__returnToSlotsStep","__onRfvChanged"),this._workflow=t,this.__isReservationAllowed=n,this.__stopSchedulingCallback=i,this.__secureSessionController=new $$WP.Scheduling.SecureSessionController,this.__eventManager=new $$WP.Scheduling.EventManager,this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("add",this.__onAppointmentsChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("remove",this.__onAppointmentsChanged),this.__onAppointmentsChanged()};e.prototype={__secureSessionController:null,__eventManager:null,__isReservationAllowed:!1,__stopSchedulingCallback:null,arePrerequisitesComplete:function WP$Scheduling$ReservationStepController$arePrerequisitesComplete(){return this.Data.AppointmentBuilder.allAppointmentsHaveASlotSelected()},updateViewModel:function WP$Scheduling$ReservationStepController$updateViewModel(){this.__isReservationAllowed&&!this.Data.AppointmentBuilder.allAppointmentsHaveASlotReserved()?this.ViewModel={Count:1,StepShouldBeActive:!0,IsFullPageMode:this.Data.AppointmentBuilder.getFirstAppointment().Slot.IsPreselected||$$WP.WidgetMode,IsCaptchaVisible:this.__secureSessionController.IsContainerRequired(),IsSlotsStepLinkVisible:$$WP.WidgetMode}:(this.stepSettings.Hide=!0,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired))},afterRender:function WP$Scheduling$ReservationStepController$afterRender(){this.ViewModel.IsFullPageMode&&($$WPSchedulingUtil.FocusElement(this.$root.find("h2.header")),$$WPSchedulingUtil.ScrollToTopOfPage(),this.ViewModel.IsSlotsStepLinkVisible&&($afe.select(".summary-back").addClass("invisible"),this.$root.find(".slots-step-link").on("click",this.__returnToSlotsStep))),this.__isReservationAllowed&&!this.Data.AppointmentBuilder.allAppointmentsHaveASlotReserved()&&this.__establishSecureSessionAndMakeReservation()},__onAppointmentsChanged:function WP$Scheduling$ReservationStepController$__onAppointmentsChanged(){var e,t=0,o=null;for(this.__eventManager.removeAllListeners(),this.__eventManager.addModelPropertyListener(this.Data.AppointmentBuilder,"ReasonForVisit",this.__onRfvChanged),e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)o=this.Data.AppointmentBuilder.getAppointment(t),this.__eventManager.addModelPropertyListener(o,"Slot",this.__onSlotChanged)},hide:function hide(e){this.WP$Scheduling$StepController$hide(e),this.ViewModel&&this.ViewModel.IsSlotsStepLinkVisible&&$afe.select(".summary-back").removeClass("invisible")},__onRfvChanged:function WP$Scheduling$ReservationStepController$__onRfvChanged(e){var t=e.to;t&&this.__secureSessionController.Initialize(this._workflow,t.AccessCode,t.IsDemographicAuthRequired,t.AccessCodeFirstName)},__onSlotChanged:function WP$Scheduling$ReservationStepController$__onSlotChanged(e){var t=e.from,o=e.to;t&&(this.__deleteSlotReservationIfPresent(t),this.__eventManager.removelListenersFromModel(t)),o&&(this.__eventManager.addModelPropertyListener(o,"ReservationKey",this.__onSlotReservationChanged),this.__eventManager.addModelPropertyListener(o,"IsIneligibleForReservation",this.__onSlotReservationChanged),o.IsRequest&&o.setProperty("IsIneligibleForReservation",!0))},__onSlotReservationChanged:function WP$Scheduling$ReservationStepController$__onSlotReservationChanged(){this.Data.AppointmentBuilder.allAppointmentsHaveASlotReserved()?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},__deleteSlotReservationIfPresent:function WP$Scheduling$ReservationStepController$__deleteSlotReservationIfPresent(e){this.__canDeleteSlotReservation(e)&&this.__deleteSlotReservation(e),e.setProperty("ReservationExpirationTimeString",""),e.setProperty("ReservationKey",""),e.setProperty("IsIneligibleForReservation",!1)},__canDeleteSlotReservation:function WP$Scheduling$ReservationStepController$__canDeleteSlotReservation(e){var t=!$$WPUtil.IsNullOrEmpty(e.ReservationKey),o=!this._workflow.IsAnonymous||!$$WPUtil.IsNullOrEmpty(this._workflow.SecureSessionToken);return t&&o},__deleteSlotReservation:function WP$Scheduling$ReservationStepController$__deleteSlotReservation(e){$$WP.Scheduling.SlotReservationHelpers.DestroyReservationCleanUpListenerFromSlot(e),$$WP.Scheduling.SlotReservationHelpers.DeleteReservationFromSlot(e,this._workflow)},__makeReservation:function WP$Scheduling$ReservationStepController$__makeReservation(){$$WP.Scheduling.SlotReservationHelpers.MakeReservation(this.Data.AppointmentBuilder,this._workflow,this.__onMakeReservationCallback,this.__onMakeReservationError)},__onMakeReservationCallback:function WP$Scheduling$ReservationStepController$__onMakeReservationCallback(e){if(this.Data.AppointmentBuilder.setProperty("IsSlotSelectionBlocked",!1),e.IsSuccess)this.__updateDataModelWithReserveResult(e);else if("SessionExpired"===e.Error.ErrorCode)this.__secureSessionController.ResetSession(),this.updateStep();else if("ValidationError"===e.Error.ErrorCode)this.__stopSchedulingCallback();else{resetLightbox();var t=new $$WPComp.MessageComponent({TitleText:this.SchedulingStringsNamespace.getString("ReserveSlotFailTitle"),Message:this.SchedulingStringsNamespace.getString("ReserveSlotFailMessage"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button(this.SchedulingStringsNamespace.getString("RefreshSlotsButtonCaption"),null,"previousstep","")],callback:this.__returnToSlotsStep});$$WPUtil.quickPopup(t)}},__onMakeReservationError:function WP$Scheduling$ReservationStepController$__onMakeReservationError(){this.Data.AppointmentBuilder.setProperty("IsSlotSelectionBlocked",!1);var e=new $$WPComp.MessageComponent({TitleText:this.SchedulingStringsNamespace.getString("ReserveSlotFailTitle"),Message:this.SchedulingStringsNamespace.getString("ReserveSlotFailMessage"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button(this.SchedulingStringsNamespace.getString("RefreshSlotsButtonCaption"),null,"previousstep","")],callback:this.__returnToSlotsStep});$$WPUtil.quickPopup(e)},__returnToSlotsStep:function WP$Scheduling$ReservationStepController$__returnToSlotsStep(){$$WPSchedulingUtil.ReturnToSlotStepAndReloadSlots(this.Data)},__updateDataModelWithReserveResult:function WP$Scheduling$ReservationStepController$__updateDataModelWithReserveResult(e){for(var t=null,o=null,n=null,i=null,s=0;s<this.Data.AppointmentBuilder.numAppointments();s++)t=this.Data.AppointmentBuilder.getAppointment(s).Slot,(o=e.Reservations[s])&&(n=o.ReservationKey,i=o.ReservationExpirationTimeString,$$WPUtil.IsNullOrEmpty(n)||(t.setProperty("ReservationKey",n),t.setProperty("ReservationExpirationTimeString",i)),$$WP.Scheduling.SlotReservationHelpers.CreateReservationCleanUpListenerFromSlot(t,this._workflow)),"Ineligible for reservation"===e.Error.ErrorCode&&t.setProperty("IsIneligibleForReservation",!0)},__establishSecureSessionAndMakeReservation:function WP$Scheduling$ReservationStepController$__establishSecureSessionAndMakeReservation(){if(this.__secureSessionController.IsContainerRequired())if(this.ViewModel.IsFullPageMode)this.__secureSessionController.EstablishSession(this.__makeReservation,this.__stopSchedulingCallback,this.$root.find(".captchaContainer"));else{var e=$$WPSchedulingUtil.GetCaptchaLightbox(this.__onCaptchaLightboxClosedCallback),t=$$WPSchedulingUtil.InitializeCaptchaLightbox,o=$$WPSchedulingUtil.CloseCaptchaLightbox;this.__secureSessionController.EstablishSession(this.__makeReservation,this.__stopSchedulingCallback,e,t,o)}else this.__secureSessionController.EstablishSession(this.__makeReservation,this.__stopSchedulingCallback)},__onCaptchaLightboxClosedCallback:function WP$Scheduling$ReservationStepController$__onCaptchaLightboxClosedCallback(){$$WPSchedulingUtil.ScrollToTopOfPageIfEmbeddedInIframe()},_getViewEventSubmodule:function WP$Scheduling$ReservationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.ReservationStep},onWorkflowDestroyed:function WP$Scheduling$ReservationStepController$onWorkflowDestroyed(){var e,t=0,o=null;for($$WPSchedulingUtil.CloseCaptchaLightbox(),e=this.Data.AppointmentBuilder.numAppointments(),t=0;t<e;t++)(o=this.Data.AppointmentBuilder.getAppointment(t)).Slot&&this.__deleteSlotReservationIfPresent(o.Slot);this.__secureSessionController.ResetSession()}},$$WP.Scheduling.ReservationStepController=e,e.extend($$WP.Scheduling.StepController,"WP$Scheduling$ReservationStepController")}();;
!function WP$SchedulingJoinWaitListStepController$definition(){var e=$$WP.Utilities.UI.TimePreferenceWidgetController,t=function WP$Scheduling$JoinWaitListStepController(e,t,i,n,r){this.WP$Scheduling$StepController(e,i,null,null,null,$$WP.Templates.Scheduling.JoinWaitListStep),this.proxify("_onClickOptIn","_onClickCancel","_onClickOptOut","_onClickUpdatePreferences","__onSetTicketWaitListPreferencesSuccess","__onPopupResized"),this._workflow=t,this.__daysOfWeekList=n.DaysOfWeekList||["","","","","","",""],this.__onFilePreferences=n.SchedulePreferences||null,this.__onTicketWaitListPreferencesUpdated=r};t.prototype={_appointment:null,_workflow:null,__daysOfWeekList:null,__onFilePreferences:null,__onTicketWaitListPreferencesUpdated:null,__shouldRemainOnStep:null,__timePreferenceWidget:null,__popup:null,afterRender:function WP$Scheduling$JoinWaitListStepController$afterRender(){var t=this._workflow.TicketInfo.WaitListPreferences,i=t.PreferredDays?this.__convertPreferredDaysToSelectedTimes(t.PreferredDays,timePreferenceConfig):null,n=null;t.IsAllAvailable?n=e.LabelValueEnum.AllAvailable:t.IsUseOnFile&&null!==this.__onFilePreferences?n=e.LabelValueEnum.OnFile:t.PreferredDays.length>0&&(n=e.LabelValueEnum.Other),this.__timePreferenceWidget=new e(this.$root.find(".timepreferencecontainer"),i,null,n,this.__onFilePreferences,this.__daysOfWeekList,!1,null,null,this.__onPopupResized),this.__addDomListeners()},updateViewModel:function WP$Scheduling$JoinWaitListStepController$updateViewModel(){this.ViewModel={StepShouldBeActive:!0,IsOptedInToOffers:this._workflow.TicketInfo.IsOptedInToOffers}},shouldRemainOnStep:function WP$Scheduling$JoinWaitListStepController$shouldRemainOnStep(){return this.__shouldRemainOnStep},__addDomListeners:function WP$Scheduling$JoinWaitListStepController$__addDomListeners(){this.$root.on("click","button#opt-in",this._onClickOptIn),this.$root.on("click","button#opt-out",this._onClickOptOut),this.$root.on("click","button#update-preferences",this._onClickUpdatePreferences),this.$root.on("click","button#cancel",this._onClickCancel)},_onClickOptIn:function WP$Scheduling$JoinWaitListStepController$_onClickOptIn(e){$$WPUtil.preventEvent(e),this.__shouldRemainOnStep=!0,this.__setTicketWaitListPreferences(!0)},_onClickOptOut:function WP$Scheduling$JoinWaitListStepController$_onClickOptOut(){this.__shouldRemainOnStep=!1,this.__setTicketWaitListPreferences(!1)},_onClickUpdatePreferences:function WP$Scheduling$JoinWaitListStepController$_onClickUpdatePreferences(){this.__shouldRemainOnStep=!1,this.__setTicketWaitListPreferences(!0)},__onPopupResized:function WP$Scheduling$JoinWaitListStepController$__onPopupResized(){this.__popup._resizePopup()},__showAjaxSpinner:function WP$Scheduling$JoinWaitListStepController$__showAjaxSpinner(){this.$root.safeAppend($afe.renderTemplate($$WP.Templates.UI.AjaxSpinner)),$$WPUtil.ShowAjaxSpinner(this.$root.find(".ajaxspinner"))},__getPreferredTimes:function WP$Scheduling$JoinWaitListStepController$__getPreferredTimes(){switch(this.$root.find(".timepreferencewidget input.clearradio:checked").safeAttr("value")){case e.LabelValueEnum.AllAvailable:return this.__buildPreferredTimesObject(!0,!1);case e.LabelValueEnum.OnFile:return this.__buildPreferredTimesObject(!1,!0);case e.LabelValueEnum.Other:return this.__getAppointmentLevelPreferences()}},__getAppointmentLevelPreferences:function WP$Scheduling$JoinWaitListStepController$__getAppointmentLevelPreferences(){var e=0,t=0,i=this.$root.find(".timepreferencewidget input[type='checkbox']:checked"),n=null,r=[],o=null;if(0===i.length)return this.__buildPreferredTimesObject(!0,!1);for(e=0;e<7;e++)for(i=this.$root.find(".timepreferencewidget input[type='checkbox']:checked[data-day-index='"+e+"']"),t=0;t<i.length;t++)n=$afe.jq(i[t]),o=$$WPSchedulingUtil.GetTimePreferenceRangeProps(n),r.push(o);return this.__buildPreferredTimesObject(!1,!1,r)},__buildPreferredTimesObject:function WP$Scheduling$JoinWaitListStepController$__buildPreferredTimesObject(e,t,i){return{IsAllAvailable:e,IsUseOnFile:t,PreferredDays:i}},__convertPreferredDaysToSelectedTimes:function WP$Scheduling$JoinWaitListStepController$__convertPreferredDaysToSelectedTimes(e,t){for(var i=[],n=0;n<e.length;n++)i.push({DayIndex:e[n].DayOfWeekIndex,RangeElement:this.__convertRangeStringToElement(e[n].RangeString,this.__findRangesForDay(e[n].DayOfWeekIndex,t))});return i},__findRangesForDay:function WP$Scheduling$JoinWaitListStepController$__findRangesForDay(e,t){for(var i=0;i<t.Days.length;i++)if(t.Days[i].DayOfWeek===e)return t.Days[i].Ranges;return[]},__convertRangeStringToElement:function WP$Scheduling$JoinWaitListStepController$__convertRangeStringToElement(e,t){for(var i=0;i<t.length;i++)if(t[i].Display===e)return t[i].Element;return""},_onClickCancel:function WP$Scheduling$JoinWaitListStepController$_onClickCancel(){this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},__setTicketWaitListPreferences:function WP$Scheduling$JoinWaitListStepController$__setTicketWaitListPreferences(e){this.__showAjaxSpinner();var t={isOptingIn:e,appointmentRequestId:this._workflow.TicketInfo.AppointmentRequestIds[0],preferredTimes:this.__getPreferredTimes()};$.post({url:makeLink("Scheduling/SetTicketWaitListPreferences"),data:$$WPUtil.postify(t),success:$.proxy((function(t){this.__onSetTicketWaitListPreferencesSuccess(t,e)}),this)})},__onSetTicketWaitListPreferencesSuccess:function WP$Scheduling$JoinWaitListStepController$__onSetTicketWaitListPreferencesSuccess(e,t){e.Success?(this._workflow.TicketInfo.IsOptedInToOffers=t,this._workflow.TicketInfo.WaitListPreferences=this.__getPreferredTimes(),this.__onTicketWaitListPreferencesUpdated&&this.__onTicketWaitListPreferencesUpdated(this._workflow.TicketInfo.IsOptedInToOffers),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)):($$WPUtil.HideAjaxSpinner(this.$root.find(".ajaxspinner")),this.$root.find(".warningBannerContainer").show())}},$$WP.Scheduling.JoinWaitListStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$JoinWaitListStepController")}();;
!function WP$Scheduling$InsuranceVerificationStepController$definition(){var e=$$WP.Scheduling.Workflow,t=function WP$Scheduling$InsuranceVerificationStepController(e,t,n,i,o){this.proxify("updateStep","_onClick","_onSelectionChange","_onCoverageChange","_onRFVSelected","_onTelehealthWorkflowSelected"),this.WP$Scheduling$StepController(e,t,null,null,null,$$WP.Templates.Scheduling.InsuranceVerificationStep,$$WP.Templates.Scheduling.InsuranceVerificationStep),this._showStep=n,this._isAlwaysSelfPay=i,this._workflowSettings=o,this.Data.AppointmentBuilder.addPropertyListener("ReasonForVisit",this._onRFVSelected),this.Data.TelehealthData.addPropertyListener("SelectedWorkflow",this._onTelehealthWorkflowSelected)};t.prototype={_showStep:!1,updateViewModel:function WP$Scheduling$InsuranceVerificationStepController$updateViewModel(){this.ViewModel={Count:0,StepShouldBeActive:!1},this._showStep?(this.ViewModel={Count:0,StepShouldBeActive:!0,StepControllerId:this.Id,Settings:{ShowInsurance:!0,ShowUseInsuranceForVisitQuestion:!this._isAlwaysSelfPay,VerifyCallback:this._onClick,ChangeCallback:this._onCoverageChange,CacheNewCoveragesForScheduling:!0,IsFromScheduling:!0},ReservationBlurbViewModel:{IsSlotReserved:!!this.Data.AppointmentBuilder.getAppointment(0).Slot&&!!this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationKey}},this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@RESERVATIONEXPIRATIONTIME@":{Value:this.Data.AppointmentBuilder.getAppointment(0).Slot?this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationExpirationTimeString:null,EncodingType:$$WP.Strings.EncodingTypes.HTML}})):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},afterRender:function WP$Scheduling$InsuranceVerificationStepController$afterRender(){var e,t;t=(e=this.Data.TelehealthData.SelectedWorkflow)===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing?this.Data.AppointmentBuilder.ReasonForVisit.OnDemandSlot:e===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.QuickSchedule?this.Data.TelehealthData.QuickScheduleSlot:this.Data.AppointmentBuilder.getAppointment(0).Slot,new $$WP.Insurance.CoveragesController(this.$root.find(".insuranceVerificationContainer"),!1,null,null,t.DepartmentId,t.Dte).render(this.ViewModel),this.Data.BlockDemographicInsuranceVerification=!1,this.$root.find("h2.header, .schedulingStepBanners .standardBanner").first().focus(),this.$root.find("[data-id='custom']").on("click",this._onClick),$$WPSchedulingUtil.HandleStickyBanner()},beforeRender:function WP$Scheduling$InsuranceVerificationStepController$beforeRender(){null!==this.Data.TelehealthData.SelectedWorkflow&&this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},_getViewEventSubmodule:function WP$Scheduling$InsuranceVerificationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.InsuranceVerificationStep},_onSelectionChange:function WP$Scheduling$InsuranceVerificationStepController$_onSelectionChange(e){this.Active||this.updateStep()},_onClick:function WP$Scheduling$InsuranceVerificationStepController$onClick(e){if(!this.Data.BlockDemographicInsuranceVerification){var t=this.$root.find("input[name='useInsuranceForVisitButton']:checked");t.length>0&&(this.Data.AppointmentBuilder.UseInsuranceForVisit=t.val(),this.Data.TelehealthData.setProperty("UseInsuranceForVisit",t.val())),this.Data.AppointmentBuilder.setProperty("CompletedInsuranceVerificationStep",!0),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)}},_onCoverageChange:function WP$Scheduling$InsuranceVerificationStepController$onCoverageChange(e){this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},_onRFVSelected:function WP$Scheduling$InsuranceVerificationStepController$_onRFVSelected(){var t=this.Data.AppointmentBuilder.ReasonForVisit;null!==t&&this._workflowSettings.WorkflowType===e.WorkflowTypesEnum.OnDemandTelehealth&&(t.InternallyAvailableForTelehealth||t.EnabledForQuickSchedule||t.CanDirectSchedule||!this.Data.TelehealthData.HideInsuranceStepForXOrg?this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete):(this.Data.AppointmentBuilder.setProperty("CompletedInsuranceVerificationStep",!1),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)),this.updateStep())},_onTelehealthWorkflowSelected:function WP$Scheduling$InsuranceVerificationStepController$_onTelehealthWorkflowSelected(){var e=this.Data.AppointmentBuilder.ReasonForVisit,t=this.Data.TelehealthData.SelectedWorkflow;null!==t&&(t===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing&&!e.InternallyAvailableForTelehealth&&this.Data.TelehealthData.HideInsuranceStepForXOrg?(this.Data.AppointmentBuilder.setProperty("CompletedInsuranceVerificationStep",!1),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.updateStep())},getContinueButton:function WP$Scheduling$InsuranceVerificationStepController$getContinueButton(e){return e.find("[data-id='buttonNext']")}},$$WP.Scheduling.InsuranceVerificationStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$InsuranceVerificationStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$InsuranceVerificationStepController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$EVC$definition(){var t=function WP$EVC(t,e){this.WP$Controllers$Controller(),"function"!=typeof e&&$$WP.Debug.logError("EditableViewController subclass did not provide the Handlebars template needed to render this view."),this.$root=t,this._template=e,this.loadData(),this.proxify("onEditClicked","onSaveClicked","onCancelClicked"),this.$root.on("click",".editButton",this.onEditClicked),this.$root.on("click",".saveButton",this.onSaveClicked),this.$root.on("click",".cancelButton",this.onCancelClicked)};t.prototype={$root:null,ViewModel:null,_template:null,focusAfterRender:!0,onEditClicked:function WP$EVC$OEC(t){this.$root.find(".button").remove(),this.render(!0),t.preventDefault()},onSaveClicked:function WP$EVC$OSC(t){this.$root.find(".button").remove(),this.$root.find("input, select, textarea").prop("disabled",!0),this.saveData(),t.preventDefault()},onCancelClicked:function WP$EVC$OCC(t){this.$root.find(".button").remove(),this.render(!1),t.preventDefault()},loadData:function WP$EVC$LD(){$$WP.Debug.logError("EditableViewController subclass did not override the virtual loadData method.")},saveData:function WP$EVC$SD(){$$WP.Debug.logError("EditableViewController subclass did not override the virtual saveData method.")},render:function WP$EVC$R(t){if(this.$root.empty(),this.ViewModel=this.ViewModel||{},this.ViewModel.DisplayEditable=t,this.$root.safeAppend($afe.renderTemplate(this._template,this.ViewModel)),!t&&this.focusAfterRender){var e=this.$root.find(".editButton");e&&e.focus()}this.afterRender()},afterRender:function WP$EVC$AR(){0===$afe.select(":focus").length&&this.focusAfterRender&&this.$root.find("input, select, textarea, button").filter(":visible:enabled").first().focus()},dispose:function WP$EVC$D(){this.$root.empty()}},t.getValIfExists=function WP$EVC$GVIE(t){return 1===t.length?t.val():null},$$WPUtil.guaranteeExistence($$WP,"Controllers"),$$WP.Controllers.EditableViewController=t,t.extend($$WP.Controllers.Controller,"WP$Controllers$EditableViewController")}();;
!function WP$PI$AC$definition(){var e={},t={},i="",o=!1,r=!1,s=function AddressController(e,t,i,o,r,s){this._prefix=e,this._requiredFields=i||[],this._isPatientAddress=!0===o,this._vrkFields=r||[],this._isViewOnly=s||!1,this.WP$Controllers$Controller(),this.proxify("_onCountryChanged","_onStateChanged","_autoFillSuggestion"),this.setViewModel(t)},n={ViewModel:{},_isPatientAddress:!1,_prefix:"",_requiredFields:[],_vrkFields:[],_lastFocusedElementId:"",_isViewOnly:!1,_saytController:null,_onCountryChanged:function _onCountryChanged(e){this.ViewModel.AddressConfiguration.Counties=this.ViewModel.AddressConfiguration.AllCounties,this.updateViewModel(),this.render()},_onStateChanged:function _onStateChanged(e){this._handleState(e.target.value)&&(this._trueRender(),this._lastFocusedElementId=e.target.id,this._refocusLastElement())},_onAddressConfigurationLoadSuccess:function _onAddressConfigurationLoadSuccess(t){e[t.DefaultCountryCat]=t,this.ViewModel.AddressConfiguration=t,this.ViewModel.AddressConfiguration.AllCounties=t.Counties,this._trueRender(),this.onDataLoadEnd()},_autoFillSuggestion:function _autoFillSuggestion(e){var{houseNumber:t,street:i,streetOtherLines:o,city:r,county:s,state:n,zip:d,country:a,district:l,building:u,floor:c,unit:g}=this._getInputs();h(a,e.country),h(n,e.state),h(s,e.county),h(l,e.district),h(r,e.city),h(d,e.zip);var C=f(e.street);h(i,C[0]),h(o,C[1]),h(t,e.houseNumber),h(u,e.building),h(c,e.floor),h(g,e.unit),this.updateViewModel();var{geocodeScore:m,geocodeLatitude:V,geocodeLongitude:_,geocodeGranularity:w}=e;this.setViewModelGeocodeItems({geocodeScore:m,geocodeLatitude:V,geocodeLongitude:_,geocodeGranularity:w}),$$WP.FormValidation.initializeDOMSubtree(this.$root)},onDataLoadStart:function onDataLoadStart(){},onDataLoadEnd:function onDataLoadEnd(){},_getInputs:function _getInputs(){var e,t,i;return this._isPatientAddress?(e=$afe.select("#"+this._prefix+"_Building",this.$root),t=$afe.select("#"+this._prefix+"_Floor",this.$root),i=$afe.select("#"+this._prefix+"_Unit",this.$root)):(e="",t="",i=""),{houseNumber:$afe.select("#"+this._prefix+"_HouseNumber",this.$root),street:$afe.select("#"+this._prefix+"_Street",this.$root),streetOtherLines:$afe.select("#"+this._prefix+"_StreetOtherLines",this.$root),city:$afe.select("#"+this._prefix+"_City",this.$root),county:$afe.select("#"+this._prefix+"_County",this.$root),state:$afe.select("#"+this._prefix+"_State",this.$root),zip:$afe.select("#"+this._prefix+"_Zip",this.$root),country:$afe.select("#"+this._prefix+"_Country",this.$root),district:$afe.select("#"+this._prefix+"_District",this.$root),building:e,floor:t,unit:i}},_handleAddressConfiguration:function _handleAddressConfiguration(){var t=this.ViewModel.Country.Number,i=e[t];i&&!$.isEmptyObject(i)?(this.ViewModel.AddressConfiguration=$.extend(!0,{},i),this.ViewModel.AddressConfiguration.AllCounties=i.Counties,this._trueRender()):(this.onDataLoadStart(),this.$root.find("textarea,input,select").prop("disabled",!0),this.$root.addClass("loading").safePrepend($$WP.SimpleTemplates.Div({class:"loadingIndicator"}).safeAppend($$WP.SimpleTemplates.Div({class:"indicator"}))),$.ajax({type:"POST",url:makeLink("PersonalInformation/GetAddressConfiguration"),data:{countryId:t},dataType:"json",success:$.proxy(this._onAddressConfigurationLoadSuccess,this)}))},_handleAddressFilter:function _handleAddressFilter(){var e=this.ViewModel.Country.Number;if(t[e]||l(e),this.$root){var i=u($afe.select("#"+this._prefix+"_State",this.$root));i&&this._handleState(i)&&this._trueRender()}},_handleState:function _handleState(i){this.updateViewModel();var o=this.ViewModel.Country.Number;if(!t[o])return!1;if(!e[o])return!1;var r=t[o].StateToCounties;return!$.isEmptyObject(r)&&(i?r.hasOwnProperty(i)?this.ViewModel.AddressConfiguration.Counties=r[i]:this.ViewModel.AddressConfiguration.Counties=[]:this.ViewModel.AddressConfiguration.Counties=this.ViewModel.AddressConfiguration.AllCounties,!0)},_refocusLastElement:function _refocusLastElement(){var e=$afe.select("#"+this._lastFocusedElementId);0!==e.length&&e.trigger("focus"),this._lastFocusedElementId=""},setViewModel:function setViewModel(e){var t,i,o;if(o=this.getCurrentCountryFromViewModel(e),e){var r=f(e.Street);this.ViewModel={HouseNumber:e.HouseNumber,Street:e.street,StreetMainLine:r.length>0?r[0]:"",StreetOtherLines:r.length>1?r[1]:"",City:e.City,County:{Number:e.County?e.County.Number:null},State:{Number:e.State?e.State.Number:null},Zip:e.Zip,Country:{Number:o},District:{Number:e.District?e.District.Number:null},Building:this._isPatientAddress?e.Building:"",Floor:this._isPatientAddress?e.Floor:"",Unit:this._isPatientAddress?e.Unit:""}}else this.ViewModel={HouseNumber:"",Street:"",StreetMainLine:"",StreetOtherLines:"",City:"",County:{Number:null},State:{Number:null},Zip:"",Country:{Number:o},District:{Number:null},Building:"",Floor:"",Unit:""};for(this.ViewModel.Prefix=this._prefix,t={},i=0;i<this._requiredFields.length;i++)this._vrkFields[this._requiredFields[i]]||(t[this._requiredFields[i]]=!0);this.ViewModel.RequiredFieldNames=t,this.ViewModel.VRKFieldNames=this._vrkFields,this.ViewModel.IsViewOnly=this._isViewOnly,this.ViewModel.Validation={Required:$$WP.FormValidation.ValidationSettings.Required},this.ViewModel.Validation.StreetAddress=new $$WP.FormValidation.ValidationSettings({required:this.ViewModel.RequiredFieldNames.Street,maxLength:254}),this.ViewModel.Validation.StreetOtherLines=new $$WP.FormValidation.ValidationSettings({required:!1,maxLength:254}),this.ViewModel.Validation.City=new $$WP.FormValidation.ValidationSettings({required:this.ViewModel.RequiredFieldNames.City,maxLength:50}),this.ViewModel.Validation.HouseNumber=new $$WP.FormValidation.ValidationSettings({required:this.ViewModel.RequiredFieldNames.HouseNumber,maxLength:254}),this.ViewModel.Validation.Building=new $$WP.FormValidation.ValidationSettings({required:this.ViewModel.RequiredFieldNames.Building,maxLength:254}),this.ViewModel.Validation.Floor=new $$WP.FormValidation.ValidationSettings({required:this.ViewModel.RequiredFieldNames.Floor,maxLength:254}),this.ViewModel.Validation.Unit=new $$WP.FormValidation.ValidationSettings({required:this.ViewModel.RequiredFieldNames.Unit,maxLength:18})},getCurrentCountryFromViewModel:function getCurrentCountryFromViewModel(e){return e&&null!==e.Country&&e.Country.Number?e.Country.Number:o?"":i},setViewModelGeocodeItems:function setViewModelGeocodeItems(e){var{geocodeScore:t,geocodeLatitude:i,geocodeLongitude:o,geocodeGranularity:r}=e;this.ViewModel.GeocodeScore=t,this.ViewModel.GeocodeLatitude=i,this.ViewModel.GeocodeLongitude=o,this.ViewModel.GeocodeGranularity=r},updateViewModel:function updateViewModel(){if(this.$root){var{houseNumber:e,street:t,streetOtherLines:i,city:o,county:r,state:s,zip:n,country:d,district:a,building:l,floor:h,unit:f}=this._getInputs();this.ViewModel=this.ViewModel||{},this.ViewModel.HouseNumber=u(e),this.ViewModel.Street=c(t,i),this.ViewModel.StreetMainLine=u(t),this.ViewModel.StreetOtherLines=u(i),this.ViewModel.City=u(o),this.ViewModel.County.Number=u(r),this.ViewModel.State.Number=u(s),this.ViewModel.Zip=u(n),this.ViewModel.Country.Number=u(d),this.ViewModel.District.Number=u(a),this.ViewModel.Building=u(l),this.ViewModel.Floor=u(h),this.ViewModel.Unit=u(f)}},getViewModel:function getViewModel(){return this.updateViewModel(),{HouseNumber:this.ViewModel.HouseNumber,Street:this.ViewModel.Street,StreetMainLine:this.ViewModel.StreetMainLine,StreetOtherLines:this.ViewModel.StreetOtherLines,City:this.ViewModel.City,County:{Number:this.ViewModel.County.Number},State:{Number:this.ViewModel.State.Number},Zip:this.ViewModel.Zip,Country:{Number:this.ViewModel.Country.Number},District:{Number:this.ViewModel.District.Number},Building:this.ViewModel.Building,Floor:this.ViewModel.Floor,Unit:this.ViewModel.Unit,GeocodeScore:this.ViewModel.GeocodeScore,GeocodeLatitude:this.ViewModel.GeocodeLatitude,GeocodeLongitude:this.ViewModel.GeocodeLongitude,GeocodeGranularity:this.ViewModel.GeocodeGranularity}},_trueRender:function _trueRender(){if(this.$root.empty(),this.$root.safeAppend($afe.renderTemplate($$WP.Templates.PersonalInformation.BaseAddress,this.ViewModel)).removeClass("loading"),$afe.select("#"+this._prefix+"_streetAddressInputContainer").safeAppend($afe.renderTemplate($$WP.Templates.PersonalInformation.StreetAddress,this.ViewModel)),r){var e=$afe.select("#"+this._prefix+"_saytSuggestionsContainer");e.safeAppend($afe.renderTemplate($$WP.Templates.PersonalInformation.SAYTSuggestions,{prefix:this._prefix})),this._saytController.renderTo(e)}this._refocusLastElement(),this.afterRender()},render:function render(){this.$root&&0!==this.$root.length&&(null!==document.activeElement&&document.activeElement.id&&(this._lastFocusedElementId=document.activeElement.id),this.$root.off("change.addressCountryChange").on("change.addressCountryChange","#"+this._prefix+"_Country",this._onCountryChanged),this.$root.off("change.addressStateChange").on("change.addressStateChange","#"+this._prefix+"_State",this._onStateChanged),r&&(this._saytController=this._saytController||new $$WP.PersonalInformation.SAYTController("#"+this._prefix+"_Street",this._prefix,this._isPatientAddress),this._saytController.onSuggestionFound=this._autoFillSuggestion),this._handleAddressConfiguration(),this._handleAddressFilter())},renderTo:function renderTo(e){this.$root=e,this.render()},afterRender:function afterRender(){}},d=function addAddressFilter(e){e&&($.isEmptyObject(e.StateToCounties)||$.isEmptyObject(t[e.DefaultCountryCat])&&(t[e.DefaultCountryCat]=e))},a=function addAddressConfiguration(t){t&&(e[t.DefaultCountryCat]={},i!=t.LocaleCountryCat&&(i=t.LocaleCountryCat),o!=t.AddressHxEnabled&&(o=t.AddressHxEnabled),r!=t.AddressSearchEnabled&&(r=t.AddressSearchEnabled),$.isEmptyObject(e[t.DefaultCountryCat])&&(e[t.DefaultCountryCat]=t))},l=function createAddressFilterRequest(e){e&&!t.hasOwnProperty(e)&&(t[e]={},$.ajax({type:"POST",url:makeLink("PersonalInformation/GetAddressFilter"),data:{countryId:e},dataType:"json",success:$.proxy(d,this)}))},u=function s_getValIfExists(e){return 1===e.length?e.val():null},h=function s_setValIfExists(e,t){e&&("string"==typeof t?e.val(t):t&&t.number?e.val(t.number):e.val(""))},c=function s_combineStreetLines(e,t){var i=u(e),o=u(t);return i||o?o?i+"\n"+o:i:""},f=function s_splitStreetLines(e){if(!e)return[];if(r){var t=e.split("\n");return[t[0],t.slice(1).join("\n")]}return[e,""]};s.prototype=n,s.getAddressConfiguration=function getAddressConfiguration(t){var i=e[t];return!i||$.isEmptyObject(i)?null:i},s.addAddressFilter=d,s.addAddressConfiguration=a,s.createAddressConfigurationRequest=function createAddressConfigurationRequest(t){e.hasOwnProperty(t)||(e[t]={},$.ajax({type:"POST",url:makeLink("PersonalInformation/GetAddressConfiguration"),async:!1,data:{countryId:t},dataType:"json",success:$.proxy(a,this)}))},s.createAddressFilterRequest=l,$$WP.PersonalInformation=$$WP.PersonalInformation||{},$$WP.PersonalInformation.AddressController=s,s.extend($$WP.Controllers.Controller,"WP$PersonalInformation$Controllers$AddressController")}();;
!function WP$PI$SAYTC$definition(){var e={},t={},s=function cancelDelayedCallback(e){e&&clearTimeout(e)},n=function SAYTController(e,t,s){this._streetInputId=e,this._prefix=t,this._shouldGeocode=s,this._timeout=null,this._focusedIndex=null,this._loadingRenderTimeout=null,this.WP$Controllers$Controller(),this.proxify("_onTextChange","_onSuggestionClick","_onSuggestionMouseEnter","_onKeyDown","_onBlur","_renderCountResultsMessage","_updateCountResultMessage"),this.initViewModel()};n.prototype={ViewModel:{},_streetInputId:"",_prefix:"",_shouldGeocode:!1,_timeout:null,_focusedIndex:null,_loadingRenderTimeout:null,_drawFocusedSuggestion:function _drawFocusedSuggestion(){var e=$afe.select(this._streetInputId),t=$afe.select("._ComboBoxSuggestions").children();if(t.removeClass("focused"),t.removeAttr("aria-selected"),e.removeAttr("aria-activedescendant"),null!==this._focusedIndex){var s=t.eq(this._focusedIndex);s.addClass("focused"),s.safeAttr("aria-selected","true"),e.safeAttr("aria-activedescendant",s.safeAttr("id"))}},_updateCountResultMessage:function _updateCountResultMessage(){$$WP.Strings.setDefaultNamespace("react.clientsdk");var e=$afe.select(this._streetInputId),t=$afe.select("#"+this._prefix+"_AddressSuggestionsStatusMessage"),s=this.ViewModel.addressSuggestions;e.val()&&s&&this.ViewModel.isOpen?1===s.length?$$WP.Strings.setDisplayText(t,"SingleSuggestionAvailable"):($$WP.Strings.addMnemonic("@MYCHART@NUMSUGGESTIONS@",s.length),$$WP.Strings.setDisplayText(t,"CountSuggestionsAvailable"),$$WP.Strings.removeMnemonic("@MYCHART@NUMSUGGESTIONS@")):t.text(""),$$WP.Strings.clearDefaultNamespace()},_renderCountResultsMessage:function _renderCountResultsMessage(){requestAnimationFrame($.proxy((function(){requestAnimationFrame(this._updateCountResultMessage)}),this))},_hideLoadingIndicator:function _hideLoadingIndicator(){var e=$afe.select(this._streetInputId).next("#"+this._prefix+"_saytLoadingIndicator"),t=e.find(".spinningLoadWheel"),s=e.find("#"+this._prefix+"_saytLoadingStatusMessage");t.addClass("hidden"),s.text("")},_renderLoadingIndicator:function _renderLoadingIndicator(){s(this._loadingRenderTimeout);var e=$afe.select(this._streetInputId).next("#"+this._prefix+"_saytLoadingIndicator"),t=e.find(".spinningLoadWheel"),n=e.find("#"+this._prefix+"_saytLoadingStatusMessage");t.removeClass("hidden"),$$WP.Strings.setDefaultNamespace("react.clientsdk"),$$WP.Strings.setDisplayText(n,"AsyncPlaceholderInFlight"),$$WP.Strings.clearDefaultNamespace(),this._loadingRenderTimeout=window.setTimeout((()=>{this._hideLoadingIndicator()}),12e3)},_handleClose:function _handleClose(){this.ViewModel.isOpen=!1,this.ViewModel.addressSuggestions=[],this._focusedIndex=null,this._trueRender()},_onTextChange:function _onTextChange(t){var n=t.target.value;s(this._timeout),n||this._handleClose();var i=e[n];if(i&&i.length>0)return this.ViewModel.addressSuggestions=i,void this._trueRender();this._renderLoadingIndicator(),this._timeout=window.setTimeout((()=>{n.length>=2?this._getSuggestions(n):this._hideLoadingIndicator()}),500)},_onSuggestionsLoadSuccess:function _onSuggestionsLoadSuccess(s,n){var i=n.addressSuggestions;!function addHighlightRangesToSuggestion(e,t){var s=t.toLowerCase();for(var n of e){var i=-1,o=-1;n.name.toLowerCase().startsWith(s)&&(i=0,o=t.length),n.ranges=[{start:i,end:o}]}}(i,s),e[s]=i,function addSuggestionsToIdMap(e){for(var s of e)t[s.uniqueKey]=s}(i),this.ViewModel.addressSuggestions=i,this._focusedIndex>=i.length&&(this._focusedIndex=null),this._trueRender()},_onFindAddressLoadSuccess:function _onFindAddressLoadSuccess(e){this.onSuggestionFound(e),this._handleClose()},_onSuggestionClick:function _onSuggestionClick(e){var s=e.currentTarget.getAttribute("data-value"),n=t[s];void 0!==n&&$.ajax({type:"POST",url:makeLink("/api/address/FindAddress"),data:JSON.stringify({suggestion:n,shouldGeocode:this._shouldGeocode}),dataType:"json",contentType:"application/json; charset=utf-8",success:$.proxy(this._onFindAddressLoadSuccess,this),complete:$.proxy(this._hideLoadingIndicator,this)})},_onSuggestionMouseEnter:function _onSuggestionMouseEnter(e){this._focusedIndex=$afe.jq(e.currentTarget).index(),this._drawFocusedSuggestion()},_triggerSuggestionClick:function _triggerSuggestionClick(){return null!==this._focusedIndex&&($afe.select("._ComboBoxSuggestions").children().eq(this._focusedIndex).trigger("click"),!0)},_onKeyDown:function _onKeyDown(e){if(this.ViewModel.isOpen){var t=!1,s=e.key.toUpperCase();switch(s){case"ARROWDOWN":case"ARROWUP":this._focusedIndex=function updateFocusedIndex(e,t,s){return null===t?"ARROWDOWN"===e?0:s:"ARROWDOWN"===e?t===s?0:t+1:"ARROWUP"===e?0===t?s:t-1:void 0}(s,this._focusedIndex,this.ViewModel.addressSuggestions.length-1),this._drawFocusedSuggestion(),t=!0;break;case"ENTER":case"TAB":t=this._triggerSuggestionClick();break;case"ESCAPE":case"ESC":this._handleClose(),t=!0}t&&e.preventDefault()}},_onBlur:function _onBlur(e){var{relatedTarget:t}=e,s=$afe.jq(t).parent();s&&!s.hasClass("_ComboBoxSuggestions")&&this._handleClose()},onSuggestionFound:function onSuggestionFound(e){},_getSuggestions:function _getSuggestions(e){$.ajax({type:"POST",url:makeLink("api/address/SearchAddress"),data:JSON.stringify({searchText:e}),dataType:"json",contentType:"application/json; charset=utf-8",global:!1,success:$.proxy(this._onSuggestionsLoadSuccess,this,e),complete:$.proxy(this._hideLoadingIndicator,this)})},initViewModel:function initViewModel(){this.ViewModel={addressSuggestions:[],isOpen:!1,prefix:this._prefix}},_trueRender:function _trueRender(){this.$root.empty();var e=this.ViewModel.addressSuggestions;e&&e.length>0?this.ViewModel.isOpen=!0:this.ViewModel.isOpen=!1,this.$root.safeAppend($afe.renderTemplate($$WP.Templates.PersonalInformation.SAYTSuggestions,this.ViewModel)),$afe.select(this._streetInputId).safeAttr("aria-expanded",this.ViewModel.isOpen),this._renderCountResultsMessage(),this._drawFocusedSuggestion(),this.afterRender()},render:function render(){if(this.$root&&0!==this.$root.length){var e=this.ViewModel.addressSuggestions;(!e||e.length<1)&&(this.ViewModel.isOpen=!1);var t=$afe.select(this._streetInputId);t.off("input").on("input",this._onTextChange),t.off("keydown").on("keydown",this._onKeyDown),t.off("blur").on("blur",this._onBlur);var s=$afe.jq(this.$root);s.off("click","._ComboBoxOption").on("click","._ComboBoxOption",this._onSuggestionClick),s.off("mouseenter","._ComboBoxOption").on("mouseenter","._ComboBoxOption",this._onSuggestionMouseEnter)}},renderTo:function renderTo(e){this.$root=e,this.render()},afterRender:function afterRender(){}},$$WP.PersonalInformation=$$WP.PersonalInformation||{},$$WP.PersonalInformation.SAYTController=n,n.extend($$WP.Controllers.Controller,"WP$PersonalInformation$Controllers$SAYTController")}();;
!function WP$PI$CIC$definition(){var e,t,o,i,r,s,d=$$WP.Controllers.EditableViewController,a=new Date(1841,0,1),n=new Date(2114,9,15),l=function ContactInformationController(t,o){this._settings=o||new e,this.WP$Controllers$EditableViewController(t,$$WP.Templates.PersonalInformation.ContactInformation),this.$root.addClass("contact-information-content card"),this._addLoadingHeartToContactInformationContainer(),this.$root.parents(".cardlist").trigger("cardLoad"),this.proxify("_onAddTemporaryAddressClicked","_onRemoveTemporaryAddressClicked","_onPreferredDeviceSelectorClicked","_onStartDateUpdate","_onEndDateUpdate","_onStartDateCalendarClick","_onEndDateCalendarClick","_afterTemporaryAddressRender","_onAddressLoadStart","_onAddressLoadEnd","_addressAfterRender","_onAddressListSelect","_launchContactVerification","abortLoadingAjax"),this.$root.on("click",".addTemporaryAddressLink",this._onAddTemporaryAddressClicked),this.$root.on("click",".removeTemporaryAddressLink",this._onRemoveTemporaryAddressClicked),this.$root.on("click",".preferredDeviceSelector",this._onPreferredDeviceSelectorClicked),this.$root.on("click",".defaultSelect",this._onAddressListSelect),this.$root.on("blur","#ContactInformation_TemporaryStartDate",this._onStartDateUpdate),this.$root.on("blur","#ContactInformation_TemporaryEndDate",this._onEndDateUpdate),this.$root.on("click","#ContactInformation_TemporaryStartDate_Calendar",this._onStartDateCalendarClick),this.$root.on("click","#ContactInformation_TemporaryEndDate_Calendar",this._onEndDateCalendarClick),this.$root.on("keyup",".addressDefaultListItem",(function(e){13===e.keyCode&&e.target.click()})),this.$root.on("click","#launchVerificationButton",this._launchContactVerification)},h={_addressData:null,_initialViewModel:null,_permanentAddressController:null,_temporaryAddressController:null,_pendingAddressLoads:0,_wasJumpedToEditMode:!1,_settings:null,_permanentAddressIndex:-1,_temporaryAddressIndex:-1,_hasTemporaryAddressDefaults:!1,_hasPermanentAddressDefaults:!1,_contactVerificationPopup:null,_contactVerificationSettings:null,_jqXHRForLoadingContactInfo:null,onEditClicked:function onEditClicked(e){this._initialViewModel=$.extend(!0,{},this.ViewModel),this.ViewModel.EditTemporaryAddress=!this.ViewModel.HideTemporaryAddress,this.ViewModel.SecureCommunicationInfo.InfoUpdated=!1,this.WP$Controllers$EditableViewController$onEditClicked(e),this._scrollToTopOfCard(),"function"==typeof this._settings.onEditClickedCallback&&this._settings.onEditClickedCallback()},onSaveClicked:function onSaveClicked(e){if(!0===this._hasTemporaryAddressDefaults?this._hasTemporaryAddressDefaults=!1:this._hasPermanentAddressDefaults=!1,null!=this._addressData&&(this._hasPermanentAddressDefaults||this._hasTemporaryAddressDefaults))return this._moveToNextDefaultScreen(),void e.preventDefault();!0===this.$root.find("#ContactInformation_TemporaryDefaultOverrideCheck").prop("checked")&&(this._temporaryAddressIndex=-2),!0===this.$root.find("#ContactInformation_PermanentDefaultOverrideCheck").prop("checked")&&(this._permanentAddressIndex=-2),this._scrollToTopOfCard(),this.WP$Controllers$EditableViewController$onSaveClicked(e)},onCancelClicked:function onCancelClicked(e){this._resetDefaults(),this.ViewModel=this._initialViewModel,this._permanentAddressController.setViewModel(this._initialViewModel.PermanentAddress),this.ViewModel.IsNonPatientProxyRecord||this.ViewModel.IsTemporaryAddressDisabled||this._temporaryAddressController.setViewModel(this._initialViewModel.TemporaryAddress),this.ViewModel.SecureCommunicationInfo.InfoUpdated=!1,this.WP$Controllers$EditableViewController$onCancelClicked(e),this._scrollToTopOfCard(),"function"==typeof this._settings.onCancelClickedCallback&&this._settings.onCancelClickedCallback();var t=$afe.select("#launchVerificationButton");null!==t&&this._settings.autoLaunchPopup&&(t.removeClass("secondary neutral"),t.addClass("positive primary"))},_onAddTemporaryAddressClicked:function _onAddTemporaryAddressClicked(e){this.ViewModel.DisplayEditable?(this.ViewModel.EditTemporaryAddress=!0,this.ViewModel.HideTemporaryAddress=!1,this.ViewModel.RemoveTemporaryAddress=!1,this._showOrHideTemporaryAddress(),e.preventDefault()):(this._initialViewModel=$.extend(!0,{},this.ViewModel),this.ViewModel.EditTemporaryAddress=!0,this.ViewModel.HideTemporaryAddress=!1,this.ViewModel.RemoveTemporaryAddress=!1,this.WP$Controllers$EditableViewController$onEditClicked(e)),"function"==typeof this._settings.onEditTemporaryAddressCallback&&this._settings.onEditTemporaryAddressCallback(),this._scrollToTopOfCard(),this.$root.find(".temporaryInformation .address").find("input, select, textarea").filter(":visible:enabled").first().focus()},_onRemoveTemporaryAddressClicked:function _onRemoveTemporaryAddressClicked(e){this.ViewModel.EditTemporaryAddress=!1,this.ViewModel.HideTemporaryAddress=!0,this.ViewModel.RemoveTemporaryAddress=!this._initialViewModel.HideTemporaryAddress,this.ViewModel.TemporaryAddress.EndDateDisplay=formatDate(r()),this.ViewModel.TemporaryAddress.StartDateDisplay&&parseDate(this.ViewModel.TemporaryAddress.StartDateDisplay,!0)>r()&&(this.ViewModel.TemporaryAddress.StartDateDisplay=formatDate(r())),this._showOrHideTemporaryAddress(),e.preventDefault(),this._scrollToTopOfCard(),$afe.select(".addTemporaryAddressLink").focus()},_onPreferredDeviceSelectorClicked:function _onPreferredDeviceSelectorClicked(e){var t=$afe.jq(e.currentTarget);$afe.jq(e.target).is("input")||e.preventDefault(),t.hasClass("selected")?(t.removeClass("selected").find("input").prop("checked",!1),$afe.select("#ContactInformation_PreferredDevice").val("")):(this.$root.find(".preferredDeviceSelector").removeClass("selected").find("input").prop("checked",!1),t.addClass("selected"),$afe.select("#ContactInformation_PreferredDevice").val(t.find("input").prop("checked",!0).val())),this._setPreferredDeviceToBeRequired()},_onLoadSuccess:function _onLoadSuccess(e){this._jqXHRForLoadingContactInfo=null;var t,o,i,s,d,l=!1;this.ViewModel=e;var h=this.ViewModel.PermanentAddress.Country.Number;for(this.ViewModel.CurrentHeaderLevel=this._settings.currentHeaderLevel,this.ViewModel.IsNonPatientProxyRecord||this.ViewModel.IsTemporaryAddressDisabled||!this.ViewModel.TemporaryAddress.StartDateDisplay||this.ViewModel.TemporaryAddress.EndDateDisplay&&parseDate(this.ViewModel.TemporaryAddress.EndDateDisplay,!0)<=r()?this.ViewModel.HideTemporaryAddress=!0:(this._initialHideTemporaryAddress=!1,this.ViewModel.EditTemporaryAddress=!0,this.ViewModel.HideTemporaryAddress=!1,this.ViewModel.RemoveTemporaryAddress=!1,this._initialTemporaryAddressEndDate=this.ViewModel.TemporaryAddress?this.ViewModel.TemporaryAddress.EndDateDisplay:""),t={},i=0;i<this.ViewModel.RequiredFieldNames.length;i++)t[this.ViewModel.RequiredFieldNames[i]]=!0;for(this.ViewModel.RequiredFieldNames=t,o={},i=0;i<this.ViewModel.ReadOnlyFieldNames.length;i++)o[this.ViewModel.ReadOnlyFieldNames[i]]=!0;if(this.ViewModel.ReadOnlyFieldNames=o,this.ViewModel.PreferredDeviceOptions={},this.ViewModel.IsNonPatientProxyRecord||((!this.ViewModel.ReadOnlyFieldNames.HomePhone||this.ViewModel.HomePhone.length>0)&&(this.ViewModel.PreferredDeviceOptions.HomePhone=!0),(!this.ViewModel.ReadOnlyFieldNames.MobilePhone||this.ViewModel.SecureCommunicationInfo.MobilePhone.length>0)&&(this.ViewModel.PreferredDeviceOptions.MobilePhone=!0),(!this.ViewModel.ReadOnlyFieldNames.WorkPhone||this.ViewModel.WorkPhone.length>0)&&(this.ViewModel.PreferredDeviceOptions.WorkPhone=!0)),this._settings.fromWorkflow&&(this.ViewModel.SecureCommunicationInfo.DoNeitherNeedAttention=!0),this.ViewModel.VerificationAlert=this._setVerificationAlertViewModel(),this.ViewModel.EditButtonCmdOptions={CssClasses:"button editButton",IconPath:"library.svg#_flat_edit",AriaLabel:$$WP.Strings.get("EditContactInfoButtonScreenReaderLabel","PersonalInformation.ContactInformation")},this.ViewModel.Validation={Required:$$WP.FormValidation.ValidationSettings.Required},this.ViewModel.Validation.Email=new $$WP.FormValidation.ValidationSettings({isEmail:!0,required:!0===this.ViewModel.RequiredFieldNames.Email}),this.ViewModel.IsNonPatientProxyRecord||this.ViewModel.IsTemporaryAddressDisabled||(this.ViewModel.TemporaryAddress.Validation={},this.ViewModel.TemporaryAddress.Validation.StartDate=new $$WP.FormValidation.ValidationSettings({isDate:!0,minDate:a,maxDate:this.ViewModel.TemporaryAddress.EndDateDisplay?parseDate(this.ViewModel.TemporaryAddress.EndDateDisplay,!0):n,required:!0}),this.ViewModel.TemporaryAddress.Validation.EndDate=new $$WP.FormValidation.ValidationSettings({isDate:!0,minDate:this.ViewModel.TemporaryAddress.StartDateDisplay?parseDate(this.ViewModel.TemporaryAddress.StartDateDisplay,!0):a,maxDate:n,required:!0}),-1!==$.inArray("Phone",this.ViewModel.TemporaryAddress.RequiredFieldNames)&&(this.ViewModel.TemporaryAddress.IsPhoneRequired=!0)),$$WP.PersonalInformation.AddressController.createAddressConfigurationRequest(h),(s=$$WP.PersonalInformation.AddressController.getAddressConfiguration(h))||($$WP.PersonalInformation.AddressController.createAddressConfigurationRequest(""),s=$$WP.PersonalInformation.AddressController.getAddressConfiguration("")),this.ViewModel.AddressHxEnabled=s.AddressHxEnabled,this._permanentAddressController=new $$WP.PersonalInformation.AddressController("PermanentAddress",this.ViewModel.PermanentAddress,this.ViewModel.PermanentAddress.RequiredFieldNames,!this.ViewModel.IsNonPatientProxyRecord,null,this.ViewModel.PermanentAddress.IsViewOnly),this._permanentAddressController.onDataLoadStart=this._onAddressLoadStart,this._permanentAddressController.onDataLoadEnd=this._onAddressLoadEnd,this._permanentAddressController.afterRender=this._addressAfterRender,$$WP.PersonalInformation.AddressController.createAddressFilterRequest(h),this.ViewModel.IsNonPatientProxyRecord||this.ViewModel.IsTemporaryAddressDisabled||(this._temporaryAddressController=new $$WP.PersonalInformation.AddressController("TemporaryAddress",this.ViewModel.TemporaryAddress,this.ViewModel.TemporaryAddress.RequiredFieldNames,!0),this._temporaryAddressController.onDataLoadStart=this._onAddressLoadStart,this._temporaryAddressController.onDataLoadEnd=this._onAddressLoadEnd,this._temporaryAddressController.afterRender=this._addressAfterRender),l=this.ViewModel.RequiredFieldNames.HomePhone&&!this.ViewModel.HomePhone||this.ViewModel.RequiredFieldNames.MobilePhone&&!this.ViewModel.SecureCommunicationInfo.MobilePhone||this.ViewModel.RequiredFieldNames.WorkPhone&&!this.ViewModel.WorkPhone||this.ViewModel.RequiredFieldNames.Email&&!this.ViewModel.SecureCommunicationInfo.EmailAddress,this.ViewModel.PermanentAddress.IsViewOnly&&this.ViewModel.HideTemporaryAddress||(d=s_buildAddressFieldsList(s.AddressFieldRows)),!this.ViewModel.PermanentAddress.IsViewOnly){for(t={},i=0;i<this.ViewModel.PermanentAddress.RequiredFieldNames.length;i++)t[this.ViewModel.PermanentAddress.RequiredFieldNames[i]]=!0;l=l||t.HouseNumber&&!this.ViewModel.PermanentAddress.HouseNumber&&d[7]||t.Street&&!this.ViewModel.PermanentAddress.Street&&d[1]||t.City&&!this.ViewModel.PermanentAddress.City&&d[2]||t.County&&!this.ViewModel.PermanentAddress.County.Number&&d[5]||t.State&&!this.ViewModel.PermanentAddress.State.Number&&d[3]||t.Zip&&!this.ViewModel.PermanentAddress.Zip&&d[4]||t.Country&&!this.ViewModel.PermanentAddress.Country.Number&&d[6]||t.District&&!this.ViewModel.PermanentAddress.District.Number&&d[8]||t.Building&&!this.ViewModel.PermanentAddress.Building&&d[10]||t.Floor&&!this.ViewModel.PermanentAddress.Floor&&d[11]||t.Unit&&!this.ViewModel.PermanentAddress.Unit&&d[12]}if(!this.ViewModel.HideTemporaryAddress){for(t={},i=0;i<this.ViewModel.TemporaryAddress.RequiredFieldNames.length;i++)t[this.ViewModel.TemporaryAddress.RequiredFieldNames[i]]=!0;l=l||t.HouseNumber&&!this.ViewModel.TemporaryAddress.HouseNumber&&d[7]||t.Street&&!this.ViewModel.TemporaryAddress.Street&&d[1]||t.City&&!this.ViewModel.TemporaryAddress.City&&d[2]||t.County&&!this.ViewModel.TemporaryAddress.County.Number&&d[5]||t.State&&!this.ViewModel.TemporaryAddress.State.Number&&d[3]||t.Zip&&!this.ViewModel.TemporaryAddress.Zip&&d[4]||t.Country&&!this.ViewModel.TemporaryAddress.Country.Number&&d[6]||t.District&&!this.ViewModel.TemporaryAddress.District.Number&&d[8]||t.Building&&!this.ViewModel.TemporaryAddress.Building&&d[10]||t.Floor&&!this.ViewModel.TemporaryAddress.Floor&&d[11]||t.Unit&&!this.ViewModel.TemporaryAddress.Unit&&d[12]}this._updateViewModel(),this.focusAfterRender=this._settings.focusOnLoad,this.render(l),this.focusAfterRender=!0;var m=$afe.select("#launchVerificationButton");null!==m&&this._settings.autoLaunchPopup&&(m.removeClass("secondary neutral"),m.addClass("positive primary")),"function"==typeof this._settings.onLoadSuccessCallback&&this._settings.onLoadSuccessCallback(),l&&(this._initialViewModel=$.extend(!0,{},this.ViewModel),this.ViewModel.EditTemporaryAddress=!this.ViewModel.HideTemporaryAddress,this.$root.find(".cancelButton").remove(),this._wasJumpedToEditMode=!0,"function"==typeof this._settings.onEditClickedCallback&&this._settings.onEditClickedCallback(),this._settings.fromWorkflow||this.$root.find("input, select, textarea").filter(":visible:enabled").first().focus()),"function"==typeof this._settings.onBothCardsLoadAndEdit&&this._settings.onBothCardsLoadAndEdit(),this._settings.initialLaunchPopup&&!this.ViewModel.SecureCommunicationInfo.DoNeitherNeedAttention&&this._launchContactVerification()},_onSaveSuccess:function _onSaveSuccess(e){var t,o;if(this._resetDefaults(),this.ViewModel.EditTemporaryAddress||delete e.ViewModel.TemporaryAddress,delete e.ViewModel.RequiredFieldNames,delete e.ViewModel.ReadOnlyFieldNames,delete e.ViewModel.IsNonPatientProxyRecord,delete e.ViewModel.IsTemporaryAddressDisabled,this.ViewModel.TemporaryAddress&&delete this.ViewModel.TemporaryAddress.FormattedValues,this.ViewModel.PermanentAddress&&delete this.ViewModel.PermanentAddress.FormattedValues,this.ViewModel=$.extend(!0,{},this.ViewModel,e.ViewModel),this._settings.fromWorkflow?this.ViewModel.SecureCommunicationInfo.DoNeitherNeedAttention=!0:this.ViewModel.VerificationAlert=this._setVerificationAlertViewModel(),e.Success){this._updateViewModel(),(this.ViewModel.EditTemporaryAddress||this.ViewModel.RemoveTemporaryAddress)&&(this.ViewModel.HideTemporaryAddress=this.ViewModel.TemporaryAddress.EndDateDisplay&&parseDate(this.ViewModel.TemporaryAddress.EndDateDisplay,!0)<=r(),this.ViewModel.EditTemporaryAddress=!1,this.ViewModel.RemoveTemporaryAddress=!1),this._showNoMatches(!1,!1,!1),this.render(!1);var i=$afe.select("#launchVerificationButton");null!==i&&this._settings.autoLaunchPopup&&(i.removeClass("secondary neutral"),i.addClass("positive primary")),this._wasJumpedToEditMode=!1,this._permanentAddressController.setViewModel(this.ViewModel.PermanentAddress),this.ViewModel.IsNonPatientProxyRecord||this.ViewModel.IsTemporaryAddressDisabled||this._temporaryAddressController.setViewModel(this.ViewModel.TemporaryAddress),this._settings.autoLaunchPopup&&(this.ViewModel.SecureCommunicationInfo.DoesEmailNeedAttention&&!this.ViewModel.SecureCommunicationInfo.IsEmailDeleted||this.ViewModel.SecureCommunicationInfo.DoesMobileNeedAttention&&!this.ViewModel.SecureCommunicationInfo.IsMobileDeleted)&&this._launchContactVerification(),"function"==typeof this._settings.onSaveSuccessCallback&&this._settings.onSaveSuccessCallback()}else if(null===e.ViewModel.TemporaryAddress&&null===e.ViewModel.PermanentAddress||!e.ViewModel.AllowDefaults?this.render(!0):e.ViewModel.TemporaryAddress&&!e.ViewModel.TemporaryAddress.Success&&0===e.ViewModel.TemporaryDefaults.length||e.ViewModel.PermanentAddress&&!e.ViewModel.PermanentAddress.Success&&0===e.ViewModel.PermanentDefaults.length?(this.render(!0),this._showNoMatches(e.ViewModel.TemporaryAddress&&!e.ViewModel.TemporaryAddress.Success&&0===e.ViewModel.TemporaryDefaults.length,e.ViewModel.PermanentAddress&&!e.ViewModel.PermanentAddress.Success&&0===e.ViewModel.PermanentDefaults.length,e.ViewModel.AllowArbitraryInput)):(this._addressData=e,e.ViewModel.TemporaryAddress&&!e.ViewModel.TemporaryAddress.Success&&e.ViewModel.TemporaryDefaults.length>0&&(this._hasTemporaryAddressDefaults=!0),e.ViewModel.PermanentAddress&&!e.ViewModel.PermanentAddress.Success&&e.ViewModel.PermanentDefaults.length>0&&(this._hasPermanentAddressDefaults=!0),this._moveToNextDefaultScreen()),this._wasJumpedToEditMode&&this.$root.find(".cancelButton").remove(),e.ViewModel.ValidationErrors)for(t=0;t<e.ViewModel.ValidationErrors.length;t++)o=$afe.select(s(e.ViewModel.ValidationErrors[t].ErrorIndex)),$$WP.FormValidation.addValidationError(o,e.ViewModel.ValidationErrors[t].ErrorKey)},_onAddressListSelect:function _onAddressListSelect(e){var t,o;t=$afe.jq(e.target),o=parseInt(t.safeAttr("data-id")),this._hasTemporaryAddressDefaults?o===this._temporaryAddressIndex?($$WP.Utilities.UI.ToggleButtonClick(t,e,0),this._temporaryAddressIndex=-1,o=-1):(-1!==this._temporaryAddressIndex&&$$WP.Utilities.UI.ToggleButtonClick($(this.$root.find("#default"+this._temporaryAddressIndex)),e,0),$$WP.Utilities.UI.ToggleButtonClick(t,e,0),this._temporaryAddressIndex=o):this._hasPermanentAddressDefaults&&(o===this._permanentAddressIndex?($$WP.Utilities.UI.ToggleButtonClick(t,e,0),this._permanentAddressIndex=-1,o=-1):(-1!==this._permanentAddressIndex&&$$WP.Utilities.UI.ToggleButtonClick($(this.$root.find("#default"+this._permanentAddressIndex)),e,0),$$WP.Utilities.UI.ToggleButtonClick(t,e,0),this._permanentAddressIndex=o)),-1!==o?this.$root.find(".saveButton").prop("disabled",!1):this.$root.find(".saveButton").prop("disabled",!0)},_onStartDateUpdate:function _onStartDateUpdate(e){var t=this.ViewModel.TemporaryAddress.Validation.EndDate;t.minDate=e.currentTarget.value?parseDate(e.currentTarget.value,!0):a,$afe.select("#ContactInformation_TemporaryEndDate").safeAttr("data-validation-settings",t.toJSON()),$afe.select("#ContactInformation_TemporaryEndDate.invalid").change()},_onStartDatePicked:function _onStartDatePicked(e,t,o){void 0!==e&&void 0!==t&&void 0!==o&&$afe.select("#ContactInformation_TemporaryStartDate").val(formatDate(new Date(e,t,o))).change().focus()},_onEndDatePicked:function _onEndDatePicked(e,t,o){void 0!==e&&void 0!==t&&void 0!==o&&$afe.select("#ContactInformation_TemporaryEndDate").val(formatDate(new Date(e,t,o))).change().focus()},_onEndDateUpdate:function _onEndDateUpdate(e){var t=this.ViewModel.TemporaryAddress.Validation.StartDate;t.maxDate=e.currentTarget.value?parseDate(e.currentTarget.value,!0):n,$afe.select("#ContactInformation_TemporaryStartDate").safeAttr("data-validation-settings",t.toJSON()),$afe.select("#ContactInformation_TemporaryStartDate.invalid").change()},_onStartDateCalendarClick:function _onStartDateCalendarClick(){var e=$afe.select("#ContactInformation_TemporaryStartDate_Calendar"),o=$afe.select("#ContactInformation_TemporaryStartDate");new DateChooser(e[0],this._onStartDatePicked,t,parseDate(o.val(),!0),o).drawCalendar()},_onEndDateCalendarClick:function _onEndDateCalendarClick(){var e=$afe.select("#ContactInformation_TemporaryEndDate_Calendar"),t=$afe.select("#ContactInformation_TemporaryEndDate");new DateChooser(e[0],this._onEndDatePicked,o,parseDate(t.val(),!0),t).drawCalendar()},_onAddressLoadStart:function _onAddressLoadStart(){this._pendingAddressLoads++,this.$root.find(".saveButton").prop("disabled",!0)},_onAddressLoadEnd:function _onAddressLoadEnd(){this._pendingAddressLoads--},_addressAfterRender:function _addressAfterRender(){$$WP.FormValidation.initializeDOMSubtree(this.$root.find("form")),this._pendingAddressLoads>1&&this.$root.find(".saveButton").prop("disabled",!0),this.ViewModel.PermanentAddress.IsViewOnly&&this.$root.find(".permanentInformation .address").find("input, select, textarea").prop("disabled",!0)},_setPreferredDeviceToBeRequired:function _setPreferredDeviceToBeRequired(){var e,t,o,i,r;i=$$WP.FormValidation.ValidationSettings.Required.toJSON(),r=$$WP.FormValidation.ValidationSettings.noInvalidCharacters.toJSON(),this.ViewModel.RequiredFieldNames.HomePhone||this.ViewModel.ReadOnlyFieldNames.HomePhone||((e=$afe.select("#ContactInformation_HomePhone")).siblings(".preferredDeviceSelector.selected").length?($afe.select("label[for='ContactInformation_HomePhone']").addClass("required"),e.safeAttr("data-validation-settings",i).safeAttr("aria-required",!0).change()):($afe.select("label[for='ContactInformation_HomePhone']").removeClass("required"),e.safeAttr("data-validation-settings",r).safeAttr("aria-required",!1).change())),this.ViewModel.RequiredFieldNames.MobilePhone||this.ViewModel.ReadOnlyFieldNames.MobilePhone||((t=$afe.select("#ContactInformation_MobilePhone")).siblings(".preferredDeviceSelector.selected").length?($afe.select("label[for='ContactInformation_MobilePhone']").addClass("required"),t.safeAttr("data-validation-settings",i).safeAttr("aria-required",!0).change()):($afe.select("label[for='ContactInformation_MobilePhone']").removeClass("required"),t.safeAttr("data-validation-settings",r).safeAttr("aria-required",!1).change())),this.ViewModel.RequiredFieldNames.WorkPhone||this.ViewModel.ReadOnlyFieldNames.WorkPhone||((o=$afe.select("#ContactInformation_WorkPhone")).siblings(".preferredDeviceSelector.selected").length?($afe.select("label[for='ContactInformation_WorkPhone']").addClass("required"),o.safeAttr("data-validation-settings",i).safeAttr("aria-required",!0).change()):($afe.select("label[for='ContactInformation_WorkPhone']").removeClass("required"),o.safeAttr("data-validation-settings",r).safeAttr("aria-required",!1).change()))},_showNoMatches:function _showNoMatches(e,t,o){e?(this.$root.find(".temporaryInformation").addClass("noMatchesContainer"),this.$root.find(".temporaryInformation .noMatchesMessage").removeClass("hidden"),o&&this.$root.find(".temporaryInformation p.buttoncheck").removeClass("hidden checked").addClass("unchecked")):(this.$root.find(".temporaryInformation").removeClass("noMatchesContainer"),this.$root.find(".temporaryInformation .noMatchesMessage").addClass("hidden"),this.$root.find(".temporaryInformation p.buttoncheck").addClass("hidden")),t?(this.$root.find(".permanentInformation").addClass("noMatchesContainer"),this.$root.find(".permanentInformation .noMatchesMessage").removeClass("hidden"),o&&this.$root.find(".permanentInformation p.buttoncheck").removeClass("hidden checked").addClass("unchecked")):(this.$root.find(".permanentInformation").removeClass("noMatchesContainer"),this.$root.find(".permanentInformation .noMatchesMessage").addClass("hidden"),this.$root.find(".permanentInformation p.buttoncheck").addClass("hidden")),(e||t)&&setupButtoncheck(this.$root.find("form"))},_moveToNextDefaultScreen:function _moveToNextDefaultScreen(){var e;(this._hasPermanentAddressDefaults||this._hasTemporaryAddressDefaults)&&null!==this._addressData&&(this.$root.empty(),e=this._hasTemporaryAddressDefaults?{DefaultList:this._addressData.ViewModel.TemporaryDefaults,EnteredAddress:this._addressData.ViewModel.TemporaryAddress,Title:$$WP.Strings.get("TemporaryAddressLabel","PersonalInformation.ContactInformation"),AllowArbitraryInput:this._addressData.ViewModel.AllowArbitraryInput}:{DefaultList:this._addressData.ViewModel.PermanentDefaults,EnteredAddress:this._addressData.ViewModel.PermanentAddress,Title:$$WP.Strings.get("PermanentAddressLabel","PersonalInformation.ContactInformation"),AllowArbitraryInput:this._addressData.ViewModel.AllowArbitraryInput},this.$root.safeAppend($afe.renderTemplate($$WP.Templates.PersonalInformation.AddressDefaultsCard,e)),this.$root.find(".addressList .togglebutton").first().focus())},_resetDefaults:function __resetDefaults(){this._addressData=null,this._hasTemporaryAddressDefaults=!1,this._hasPermanentAddressDefaults=!1,this._temporaryAddressIndex=-1,this._permanentAddressIndex=-1,this.$root.find("#ContactInformation_TemporaryDefaultOverrideCheck").prop("checked",!1),this.$root.find("#ContactInformation_PermanentDefaultOverrideCheck").prop("checked",!1)},_afterTemporaryAddressRender:function _afterTemporaryAddressRender(){$$WP.FormValidation.checkIfFormIsValid(this.$root.find("form"),!0),this._pendingAddressLoads>0&&this.$root.find(".saveButton").prop("disabled",!0)},_showOrHideTemporaryAddress:function _showOrHideTemporaryAddress(){this.ViewModel.EditTemporaryAddress?($afe.select(".permanentHeader").show(),$afe.select(".addTemporaryAddressLinkContainer").hide(),$afe.select(".temporaryAddressContent").slideDown(500,"",this._afterTemporaryAddressRender)):($afe.select(".permanentHeader").hide(),$afe.select(".addTemporaryAddressLinkContainer").show(),$afe.select(".temporaryAddressContent").slideUp(500,this._afterTemporaryAddressRender))},_scrollToTopOfCard:function _scrollToTopOfCard(){$$WPUtil.SmoothScrollToElementWithOffset($$WPUtil.ScrollableBody(),$afe.select("#contact-information-container"),$afe.select("#header").height())},loadData:function loadData(){var e={useLoginUserEpt:this._settings.useLoginUserEpt};this._jqXHRForLoadingContactInfo=$.ajax({type:"POST",url:makeLink("PersonalInformation/GetContactInformation"),data:$$WPUtil.postify(e),dataType:"json",success:$.proxy(this._onLoadSuccess,this)})},saveData:function saveData(){var e,t,o,r;$$WPUtil.ShowAjaxSpinner(this.$root.find(".ajaxspinner")),$afe.select(".addTemporaryAddressLinkContainer").hide(),$afe.select(".removeTemporaryAddressLinkContainer").hide(),this.updateViewModel(),t=null,(this.ViewModel.EditTemporaryAddress||this.ViewModel.RemoveTemporaryAddress)&&(this.ViewModel.EditTemporaryAddress&&this.ViewModel.AddressHxEnabled&&!this.ViewModel.TemporaryAddress.StartDateDisplay&&(this.ViewModel.TemporaryAddress.StartDateDisplay=formatDate(new Date)),this.ViewModel.TemporaryAddress.StartDateISO=i(this.ViewModel.TemporaryAddress.StartDateDisplay),this.ViewModel.TemporaryAddress.EndDateISO=i(this.ViewModel.TemporaryAddress.EndDateDisplay),-1===this._temporaryAddressIndex||null===this._addressData?t=$.extend(!0,{},this.ViewModel.TemporaryAddress):-2===this._temporaryAddressIndex?((t=this._addressData.ViewModel.TemporaryAddress).StartDateISO=this.ViewModel.TemporaryAddress.StartDateISO,t.EndDateISO=this.ViewModel.TemporaryAddress.EndDateISO):((t=this._addressData.ViewModel.TemporaryDefaults[this._temporaryAddressIndex]).StartDateISO=this.ViewModel.TemporaryAddress.StartDateISO,t.EndDateISO=this.ViewModel.TemporaryAddress.EndDateISO),delete t.Validation),o=-1===this._permanentAddressIndex||null===this._addressData?this.ViewModel.PermanentAddress:-2===this._permanentAddressIndex?this._addressData.ViewModel.PermanentAddress:this._addressData.ViewModel.PermanentDefaults[this._permanentAddressIndex],r={EmailAddress:this.ViewModel.SecureCommunicationInfo.EmailAddress,MobilePhone:this.ViewModel.SecureCommunicationInfo.MobilePhone},e={PermanentAddress:o,TemporaryAddress:t,HomePhone:this.ViewModel.HomePhone,WorkPhone:this.ViewModel.WorkPhone,PreferredDevice:this.ViewModel.PreferredDevice,SecureCommunicationInfo:r},$.ajax({type:"POST",url:makeLink("PersonalInformation/UpdateContactInformation"),data:JSON.stringify({ViewModel:e,UseLoginUserEpt:this._settings.useLoginUserEpt,NeedTempDefault:-2!==this._temporaryAddressIndex,NeedPermDefault:-2!==this._permanentAddressIndex}),contentType:"application/json",dataType:"json",success:$.proxy(this._onSaveSuccess,this)}),this.WP$Controllers$EditableViewController$afterRender()},updateViewModel:function updateViewModel(){var e,t,o,i,r,s,a,n,l,h,m;this.$root.find(".addressDefaults").length>0||(this.ViewModel.EditTemporaryAddress&&(i=$afe.select("#ContactInformation_TemporaryPhoneNumber",this.$root),r=$afe.select("#ContactInformation_TemporaryStartDate",this.$root),s=$afe.select("#ContactInformation_TemporaryEndDate",this.$root),this.ViewModel=this.ViewModel||{},this.ViewModel.TemporaryAddress=this.ViewModel.TemporaryAddress||{},e=this.ViewModel.TemporaryAddress.RequiredFieldNames,o=this.ViewModel.TemporaryAddress.Validation,t=this.ViewModel.TemporaryAddress.FormattedValues,this.ViewModel.TemporaryAddress=this._temporaryAddressController.getViewModel(),this.ViewModel.TemporaryAddress.PhoneNumber=d.getValIfExists(i),this.ViewModel.TemporaryAddress.StartDateDisplay=d.getValIfExists(r),this.ViewModel.TemporaryAddress.EndDateDisplay=d.getValIfExists(s),this.ViewModel.TemporaryAddress.RequiredFieldNames=e,this.ViewModel.TemporaryAddress.Validation=o,this.ViewModel.TemporaryAddress.FormattedValues=t,-1!==$.inArray("Phone",e)&&(this.ViewModel.TemporaryAddress.IsPhoneRequired=!0)),this.ViewModel=this.ViewModel||{},this.ViewModel.PermanentAddress=this.ViewModel.PermanentAddress||{},this.ViewModel.PermanentAddress.IsViewOnly||(e=this.ViewModel.PermanentAddress.RequiredFieldNames,t=this.ViewModel.PermanentAddress.FormattedValues,this.ViewModel.PermanentAddress=this._permanentAddressController.getViewModel(),this.ViewModel.PermanentAddress.RequiredFieldNames=e,this.ViewModel.PermanentAddress.FormattedValues=t),a=$afe.select("#ContactInformation_HomePhone",this.$root),n=$afe.select("#ContactInformation_MobilePhone",this.$root),l=$afe.select("#ContactInformation_WorkPhone",this.$root),h=$afe.select("#ContactInformation_Email",this.$root),m=$afe.select("#ContactInformation_PreferredDevice",this.$root),this.ViewModel=this.ViewModel||{},this.ViewModel.HomePhone=d.getValIfExists(a),this.ViewModel.SecureCommunicationInfo.MobilePhone=d.getValIfExists(n),this.ViewModel.WorkPhone=d.getValIfExists(l),this.ViewModel.SecureCommunicationInfo.EmailAddress=d.getValIfExists(h),this.ViewModel.PreferredDevice=d.getValIfExists(m))},_setVerificationAlertViewModel:function _setVerificationAlertViewModel(){var e={};return this.ViewModel.SecureCommunicationInfo.DoNeitherNeedAttention||($$WP.Strings.setDefaultNamespace("PersonalInformation.ContactInformation"),this.ViewModel.SecureCommunicationInfo.DoBothNeedAttention?this.ViewModel.SecureCommunicationInfo.AreBothDeleted?(e.Text=$$WP.Strings.getForTemplate("BothContactsDeletedAlert"),e.ButtonCaption=$$WP.Strings.getForTemplate("AlertRestoreButtonText")):(e.Text=$$WP.Strings.getForTemplate("BothContactsNeedAttentionAlert"),e.ButtonCaption=$$WP.Strings.getForTemplate("AlertVerifyButtonText")):this.ViewModel.SecureCommunicationInfo.AreNeitherDeleted?this.ViewModel.SecureCommunicationInfo.DoesEmailNeedAttention?(e.Text=$$WP.Strings.getForTemplate("EmailNeedsAttentionAlert"),e.ButtonCaption=$$WP.Strings.getForTemplate("AlertVerifyButtonText")):this.ViewModel.SecureCommunicationInfo.DoesMobileNeedAttention&&(e.Text=$$WP.Strings.getForTemplate("MobileNeedsAttentionAlert"),e.ButtonCaption=$$WP.Strings.getForTemplate("AlertVerifyButtonText")):(this.ViewModel.SecureCommunicationInfo.IsEmailDeleted?e.Text=$$WP.Strings.getForTemplate("EmailDeletedAlert"):this.ViewModel.SecureCommunicationInfo.IsMobileDeleted&&(e.Text=$$WP.Strings.getForTemplate("MobileDeletedAlert")),e.ButtonCaption=$$WP.Strings.getForTemplate("AlertRestoreButtonText")),$$WP.Strings.clearDefaultNamespace()),e},_launchContactVerification:function launchContactVerification(){this._contactVerificationSettings={},this._contactVerificationSettings.SecureCommunicationInfo=this.ViewModel.SecureCommunicationInfo,this._contactVerificationSettings.ControllerReference=this,null!=this._settings.autoSendEmailCode&&(this._contactVerificationSettings.AutoSendEmailCode=this._settings.autoSendEmailCode),null!=this._settings.autoSendMobileCode&&(this._contactVerificationSettings.AutoSendMobileCode=this._settings.autoSendMobileCode),this._settings.autoSendEmailCode=!1,this._settings.autoSendMobileCode=!1;new $$WP.Authentication.SecondaryValidation.Controllers.ContactVerificationController($afe.select("#contact-information-container"),this._contactVerificationSettings)},afterRender:function afterRender(){if(this.ViewModel.DisplayEditable){if(this._permanentAddressController.renderTo(this.$root.find(".permanentAddress")),this.ViewModel.IsNonPatientProxyRecord||this.ViewModel.IsTemporaryAddressDisabled||this._temporaryAddressController.renderTo(this.$root.find(".temporaryAddress")),!this._settings.isEmbedded){var e=this.$root[0];e&&e.addEventListener("change",$.proxy((function(e){WP.Events.beforeUnload()}),this))}}else this._settings.isEmbedded||WP.Events.cancelBeforeUnload();if(this.ViewModel.PermanentAddress.IsViewOnly&&$afe.select(".permanentInformation .address").find("input, select, textarea").prop("disabled",!0),this._showOrHideTemporaryAddress(),this._setPreferredDeviceToBeRequired(),$$WP.FormValidation.initializeDOMSubtree(this.$root),this._pendingAddressLoads>0&&this.$root.find(".saveButton").prop("disabled",!0),this.$root.find(".hideLongContentWithEllipses").each((function(){if(this.getClientRects().length>.97){var e=$afe.jq(this);e.addClass("overflowHiddenWithEllipses").safeAttr("title",e.text())}})),0===$afe.select(":focus").length&&this.focusAfterRender){var t=this.$root.find("#focusHeader");t?t.focus():this.$root.find("input, select, textarea, button").filter(":visible:enabled").first().focus()}},_addLoadingHeartToContactInformationContainer:function _addLoadingHeartToContactInformationContainer(){$afe.renderTemplate($$WP.Templates.UI.AjaxSpinner,{inline:1}).safePrependTo($afe.select("#contact-information-container .loadingIndicator")),$$WPUtil.ShowAjaxSpinner($afe.select("#contact-information-container .ajaxspinner"))},_updateViewModel:function _updateViewModel(){this.ViewModel.HideEmptyFields=this._settings.hideEmptyFields,0!==this.ViewModel.HomePhone.length||0!==this.ViewModel.SecureCommunicationInfo.MobilePhone.length||0!==this.ViewModel.WorkPhone.length?this.ViewModel.HasContactNumber=!0:this.ViewModel.HasContactNumber=!1},abortLoadingAjax:function _abortAjaxCalls(){this._jqXHRForLoadingContactInfo&&(this._jqXHRForLoadingContactInfo.abort(),this._jqXHRForLoadingContactInfo=null)}};t=function s_isStartDateValid(e,t,o){var i,r;return void 0===e||void 0===t||void 0===o||(i=$afe.select("#ContactInformation_TemporaryEndDate").val(),r=new Date(e,t,o),a<=r&&r<=(i?parseDate(i,!0):n))},o=function s_isEndDateValid(e,t,o){var i,r;return void 0===e||void 0===t||void 0===o||(i=$afe.select("#ContactInformation_TemporaryStartDate").val(),r=new Date(e,t,o),(i?parseDate(i,!0):a)<=r&&r<=n)},i=function s_userDateToISO(e){return e?$$WP.I18N.parseDate(e).toISOString().split("T")[0]:""},r=function s_getYesterday(){var e=new Date;return e.setDate(e.getDate()-1),e},s=function s_getFieldIdFromErrorIndex(e){switch(e){case"PermanentAddress.Zip":return"#PermanentAddress_Zip";case"TemporaryAddress.Zip":return"#TemporaryAddress_Zip";case"TemporaryPhone":return"#ContactInformation_TemporaryPhoneNumber";case"HomePhone":case"MobilePhone":case"WorkPhone":return"#ContactInformation_"+e}return""},s_buildAddressFieldsList=function s_buildAddressFieldsList(e){var t,o,i={};for(t=0;t<e.length;t++)for(o=0;o<e[t].AddressFields.length;o++)i[e[t].AddressFields[o].AddressSubField]=!0;return i},e=function WP$PersonalInformation$Controllers$ContactInformationSettings(){};l.prototype=h,e.prototype={onEditClickedCallback:null,onSaveSuccessCallback:null,onCancelClickedCallback:null,onEditTemporaryAddressCallback:null,onLoadSuccessCallback:null,onBothCardsLoadAndEdit:null,useLoginUserEpt:!1,focusOnLoad:!1,isEmbedded:!1,autoLaunchPopup:!1,initialLaunchPopup:!1,hideEmptyFields:!1,currentHeaderLevel:3},$$WP.PersonalInformation=$$WP.PersonalInformation||{},$$WP.PersonalInformation.ContactInformationController=l,$$WP.PersonalInformation.ContactInformationSettings=e,l.extend(d,"WP$PersonalInformation$Controllers$ContactInformationController"),e.extend($$WP.BaseObject,"WP$PersonalInformation$Controllers$ContactInformationSettings")}();;
!function WP$PI$OIC$definition(){var e,i,t=function WP$PI$OIC(i,t){this._settings=t||new e,this.WP$Controllers$EditableViewController(i,$$WP.Templates.PersonalInformation.OtherInformation),this.$root.addClass("other-information-content card"),this._addLoadingHeartToOtherInformationContainer(),this.$root.parents(".cardlist").trigger("cardLoad"),this.$root.on("submit",(function(e){e.preventDefault()}))},o={_settings:null,_initialViewModel:null,_wasJumpedToEditMode:!1,_jqXHRForLoadingOtherInfo:null,_onLoadSuccess:function WP$PI$OIC$_OLS(e){this._jqXHRForLoadingOtherInfo=null;var i,o,s=!1;if(this.ViewModel=e,this.ViewModel.IsMobile=WP.DOM.Browser.isMobile||$$WP.Utilities.UI.IsMobile,this.ViewModel.CurrentHeaderLevel=this._settings.currentHeaderLevel,0===this.ViewModel.Fields.length)return this.$root.hide(),void("function"==typeof this._settings.onLoadSuccessCallback&&this._settings.onLoadSuccessCallback());if(!t.WereRELFieldsShown)for(o=0;o<this.ViewModel.Fields.length;o++)"7"!==this.ViewModel.Fields[o].FieldId&&"8"!==this.ViewModel.Fields[o].FieldId&&"9"!==this.ViewModel.Fields[o].FieldId&&"10"!==this.ViewModel.Fields[o].FieldId||(t.WereRELFieldsShown=!0);this.ViewModel.HideEmptyFields=!!this.ViewModel.HasEditableField&&this._settings.hideEmptyFields,this.ViewModel.NoInformationAlert=!0;var l;for(i=0;i<this.ViewModel.Fields.length;i++)switch(this.ViewModel.Fields[i].DisplayField=!0,1===this.ViewModel.Fields[i].Type&&0===this.ViewModel.Fields[i].Values[0].length&&(this.ViewModel.Fields[i].Values=[]),0===this.ViewModel.Fields[i].Values.length&&this.ViewModel.HideEmptyFields?this.ViewModel.Fields[i].DisplayField=!1:this.ViewModel.NoInformationAlert=!1,this.ViewModel.Fields[i].FieldId){case"1":this.ViewModel.Fields[i].HelpText=$$WP.Strings.get("OtherInformationPreferredNameHelpText","PersonalInformation.OtherInformation");break;case"2":this.ViewModel.Fields[i].HelpText=$$WP.Strings.get("OtherInformationSOGIHelpText","PersonalInformation.OtherInformation");break;case"3":this.ViewModel.Fields[i].HelpText=$$WP.Strings.get("OtherInformationGenderIdentityHelpText","PersonalInformation.OtherInformation");break;case"4":this.ViewModel.Fields[i].HelpText=$$WP.Strings.get("OtherInformationSexAssignedAtBirthHelpText","PersonalInformation.OtherInformation");break;case"5":this.ViewModel.Fields[i].HelpText=$$WP.Strings.get("OtherInformationSexualOrientationHelpText","PersonalInformation.OtherInformation");break;case"12":this.ViewModel.Fields[i].HelpText=$$WP.Strings.get("OtherInformationPronounsHelpText","PersonalInformation.OtherInformation")}for(l=this.ViewModel.NoInformationAlert?"":"library.svg#_flat_edit",this.ViewModel.ProxyContextName?($$WP.Strings.addMnemonic("@MYCHART@PATIENT@",this.ViewModel.ProxyContextName),this.ViewModel.EditButtonCmdOptions={CssClasses:"editButton",IconPath:l,AriaLabel:$$WP.Strings.get("EditDetailsAboutProxyButtonScreenReaderLabel","PersonalInformation.OtherInformation")}):this.ViewModel.EditButtonCmdOptions={CssClasses:"editButton",IconPath:l,AriaLabel:$$WP.Strings.get("EditDetailsAboutMeButtonScreenReaderLabel","PersonalInformation.OtherInformation")},this.ViewModel.ValidationSettings=$$WP.FormValidation.ValidationSettings.Required,o=0;o<this.ViewModel.Fields.length;o++)this.ViewModel.Fields[o].IsRequired&&(1===this.ViewModel.Fields[o].Type&&""===this.ViewModel.Fields[o].Values[0]||0===this.ViewModel.Fields[o].Values.length)&&(s=!0);this.focusAfterRender=this._settings.focusOnLoad,this.render(s),this.focusAfterRender=!0,"function"==typeof this._settings.onLoadSuccessCallback&&this._settings.onLoadSuccessCallback(),s&&(this._initialViewModel=$.extend(!0,{},this.ViewModel),this.$root.find(".cancelButton").remove(),this._wasJumpedToEditMode=!0,"function"==typeof this._settings.onEditClickedCallback&&this._settings.onEditClickedCallback(),this._settings.fromWorkflow||this.$root.find("input, select, textarea").filter(":visible:enabled").first().focus()),"function"==typeof this._settings.onBothCardsLoadAndEdit&&this._settings.onBothCardsLoadAndEdit()},_onSaveSuccess:function WP$PI$OIC$_OSS(e){var t,o;for(t=0;t<e.ViewModel.Fields.length;t++)delete e.ViewModel.Fields[t].IsRequired,delete e.ViewModel.Fields[t].IsReadOnly;this.ViewModel=$.extend(!0,{},this.ViewModel,e.ViewModel),this.ViewModel.HideEmptyFields=!!this.ViewModel.HasEditableField&&this._settings.hideEmptyFields,this.ViewModel.NoInformationAlert=!0;var s="";if(e.Success){for(t=0;t<this.ViewModel.Fields.length;t++)this.ViewModel.Fields[t].DisplayField=!0,1===this.ViewModel.Fields[t].Type&&0===this.ViewModel.Fields[t].Values[0].length&&(this.ViewModel.Fields[t].Values=[]),0===this.ViewModel.Fields[t].Values.length&&this.ViewModel.HideEmptyFields?this.ViewModel.Fields[t].DisplayField=!1:this.ViewModel.NoInformationAlert=!1;s=this.ViewModel.NoInformationAlert?"":"library.svg#_flat_edit",this.ViewModel.ProxyContextName?($$WP.Strings.addMnemonic("@MYCHART@PATIENT@",this.ViewModel.ProxyContextName),this.ViewModel.EditButtonCmdOptions={CssClasses:"editButton",IconPath:s,AriaLabel:$$WP.Strings.get("EditDetailsAboutProxyButtonScreenReaderLabel","PersonalInformation.OtherInformation")}):this.ViewModel.EditButtonCmdOptions={CssClasses:"editButton",IconPath:s,AriaLabel:$$WP.Strings.get("EditDetailsAboutMeButtonScreenReaderLabel","PersonalInformation.OtherInformation")},this.render(!1),this._wasJumpedToEditMode=!1,"function"==typeof this._settings.onSaveSuccessCallback&&this._settings.onSaveSuccessCallback()}else if(this.render(!0),this._wasJumpedToEditMode&&this.$root.find(".cancelButton").remove(),e.ViewModel.ValidationErrors)for(t=0;t<e.ViewModel.ValidationErrors.length;t++)o=$afe.select(i(e.ViewModel.ValidationErrors[t].ErrorIndex)),$$WP.FormValidation.addValidationError(o,e.ViewModel.ValidationErrors[t].ErrorKey)},onEditClicked:function WP$PI$CIC$OEC(e){this._initialViewModel=$.extend(!0,{},this.ViewModel),this.WP$Controllers$EditableViewController$onEditClicked(e),"function"==typeof this._settings.onEditClickedCallback&&this._settings.onEditClickedCallback(),this._scrollToTopOfCard()},onSaveClicked:function WP$PI$CIC$OEC(e){this.WP$Controllers$EditableViewController$onSaveClicked(e),this._scrollToTopOfCard()},onCancelClicked:function WP$PI$CIC$OEC(e){this.ViewModel=this._initialViewModel,this.WP$Controllers$EditableViewController$onCancelClicked(e),"function"==typeof this._settings.onCancelClickedCallback&&this._settings.onCancelClickedCallback(),this._scrollToTopOfCard()},_getPostableViewModel:function WP$PI$OIC$_GPVM(){var e,i,t,o;for(e=[],t=0;t<this.ViewModel.Fields.length;t++){if(1===this.ViewModel.Fields[t].Type)i=this.ViewModel.Fields[t].Values.length?this.ViewModel.Fields[t].Values:[""];else for(i=[],o=0;o<this.ViewModel.Fields[t].Categories.length;o++)this.ViewModel.Fields[t].Categories[o].IsSelected&&i.push(this.ViewModel.Fields[t].Categories[o].Number);e.push({FieldId:this.ViewModel.Fields[t].FieldId,Type:this.ViewModel.Fields[t].Type,Values:i})}return{Fields:e,disableUTF8:this._settings.disableUTF8}},loadData:function WP$PI$OIC$LD(){this._jqXHRForLoadingOtherInfo=$.ajax({type:"POST",url:makeLink("PersonalInformation/GetOtherInformation?checkRELFrequency="+this._settings.checkRELFrequency),data:$$WPUtil.postify({disableUTF8:this._settings.disableUTF8}),dataType:"json",success:$.proxy(this._onLoadSuccess,this)})},saveData:function WP$PI$OIC$SD(){$$WPUtil.ShowAjaxSpinner(this.$root.find(".ajaxspinner")),this.updateViewModel(),$.ajax({type:"POST",url:makeLink("PersonalInformation/UpdateOtherInformation"),data:$$WPUtil.postify(this._getPostableViewModel()),dataType:"json",success:$.proxy(this._onSaveSuccess,this)})},_scrollToTopOfCard:function _scrollToTopOfCard(){$$WPUtil.SmoothScrollToElementWithOffset($$WPUtil.ScrollableBody(),$afe.select("#other-information-container"),$afe.select("#header").height())},afterRender:function WP$PI$OIC$AR(){if(!this._settings.isEmbedded)if(this.ViewModel.DisplayEditable){var e=this.$root[0];e&&e.addEventListener("change",$.proxy((function(e){WP.Events.beforeUnload()}),this))}else WP.Events.cancelBeforeUnload();$$WP.FormValidation.initializeDOMSubtree(this.$root),this.$root.find(".hideLongContentWithEllipses").each((function(){if(this.getClientRects().length>2){var e=$afe.jq(this);e.addClass("overflowHiddenWithEllipses").safeAttr("title",e.text())}})),!0!==this._settings.focusAfterRender&&!this.ViewModel.DisplayEditable||this._settings.launchesWithPopup?this.focusAfterRender=!1:this.focusAfterRender=!0,this.WP$Controllers$EditableViewController$afterRender()},_addLoadingHeartToOtherInformationContainer:function WP$PI$OIC$ALHTOIC(){$afe.renderTemplate($$WP.Templates.UI.AjaxSpinner,{inline:1}).safePrependTo($afe.select("#other-information-container .loadingIndicator")),$$WPUtil.ShowAjaxSpinner($afe.select("#other-information-container .ajaxspinner"))},updateViewModel:function WP$PI$OIC$UVM(){var e,i,t;for(this.$root.find(".button, input, select, textarea").prop("disabled",!1),e=this.$root.find("form").serializeArray(),this.$root.find(".button, input, select, textarea").prop("disabled",!0),i=0;i<this.ViewModel.Fields.length;i++){if(this.ViewModel.Fields[i].Values=[],1!==this.ViewModel.Fields[i].Type)for(t=0;t<this.ViewModel.Fields[i].Categories.length;t++)this.ViewModel.Fields[i].Categories[t].IsSelected=!1;$.each(e,$.proxy((function(e,o){if(this.ViewModel.Fields[i].FieldId!==o.name);else if(1===this.ViewModel.Fields[i].Type)o.value&&this.ViewModel.Fields[i].Values.push(o.value);else for(t=0;t<this.ViewModel.Fields[i].Categories.length;t++)if(this.ViewModel.Fields[i].Categories[t].Number===o.value){this.ViewModel.Fields[i].Categories[t].IsSelected=!0,this.ViewModel.Fields[i].Values.push(this.ViewModel.Fields[i].Categories[t].Title);break}}),this))}},abortLoadingAjax:function abortLoadingAjax(){this._jqXHRForLoadingOtherInfo&&(this._jqXHRForLoadingOtherInfo.abort(),this._jqXHRForLoadingOtherInfo=null)}};i=function s_getFieldIdFromErrorIndex(e){return"#OtherInformation_1"},e=function WP$PersonalInformation$Controllers$OtherInformationSettings(){};t.prototype=o,t.WereRELFieldsShown=t.WereRELFieldsShown||!1,e.prototype={checkRELFrequency:!1,onEditClickedCallback:null,onSaveSuccessCallback:null,onCancelClickedCallback:null,onEditTemporaryAddressCallback:null,onLoadSuccessCallback:null,onBothCardsLoadAndEdit:null,isEmbedded:!1,disableUTF8:!1,hideEmptyFields:!1,launchesWithPopup:!1,currentHeaderLevel:3},$$WP.PersonalInformation=$$WP.PersonalInformation||{},$$WP.PersonalInformation.OtherInformationController=t,$$WP.PersonalInformation.OtherInformationSettings=e,t.extend($$WP.Controllers.EditableViewController,"WP$PersonalInformation$Controllers$OtherInformationController"),e.extend($$WP.BaseObject,"WP$PersonalInformation$Controllers$OtherInformationSettings")}();;
!function WP$PersonalInformation$DemographicVerificationController$definition(){var o=function WP$PersonalInformation$DemographicVerificationController(o,t,n,i){this.WP$Controllers$Controller(),this.proxify("__onContactCardLoaded","__onContactCardEdit","__onContactCardCancel","__onContactCardSaved","__onOtherCardLoaded","__onOtherCardEdit","__onOtherCardCancel","__onOtherCardSaved","__onBothCardsLoadAndEdit","deactivate"),this.$root=o,this.__onIsCompleteChangedCallback=t,this.__disableUTF8=n,this.__hideEmptyFields=i,this.__initializeDom(),this.__initializeControllers()};o.prototype={IsDataModified:!1,IsComplete:!1,__onIsCompleteChangedCallback:null,__disableUTF8:!1,__hideEmptyFields:!1,$root:null,$contactInformationContainer:null,$othertInformationContainer:null,__contactInformationController:null,__otherInformationController:null,__isContactInformationInEditMode:!1,__isOtherInformationInEditMode:!1,__isContactInformationLoaded:!1,__isOtherInformationLoaded:!1,MarkDemographicsAsVerified:function WP$PersonalInformation$DemographicVerificationController$MarkDemographicsAsVerified(o){var t;this.__isLoadingComplete()?this.__isAnyCardInEditMode()?$$WP.Debug.logError("MarkDemographicsAsVerified was called while demographics were being edited."):(t=$$WP.PersonalInformation.OtherInformationController.WereRELFieldsShown,$.post({url:makeLink("PersonalInformation/VerifyPatientInformation"),data:{verifyREL:t},cache:!1,success:o})):$$WP.Debug.logError("MarkDemographicsAsVerified was called before demographics were finished loading.")},__initializeDom:function WP$PersonalInformation$DemographicVerificationController$__initializeDom(){this.$root.safeAppend($afe.renderTemplate($$WP.Templates.PersonalInformation.DemographicVerification)),this.$contactInformationContainer=this.$root.find("#contact-information-container"),this.$othertInformationContainer=this.$root.find("#other-information-container")},__initializeControllers:function WP$PersonalInformation$DemographicVerificationController$__initializeControllers(){var o=null,t=null;(o=new $$WP.PersonalInformation.ContactInformationSettings).onEditClickedCallback=this.__onContactCardEdit,o.onEditTemporaryAddressCallback=this.__onContactCardEdit,o.onCancelClickedCallback=this.__onContactCardCancel,o.onSaveSuccessCallback=this.__onContactCardSaved,o.isEmbedded=!0,o.disableUTF8=this.__disableUTF8,o.onLoadSuccessCallback=this.__onContactCardLoaded,o.hideEmptyFields=this.__hideEmptyFields,o.focusOnLoad=!1,o.fromWorkflow=!0,o.onBothCardsLoadAndEdit=this.__onBothCardsLoadAndEdit,(t=new $$WP.PersonalInformation.OtherInformationSettings).onEditClickedCallback=this.__onOtherCardEdit,t.onCancelClickedCallback=this.__onOtherCardCancel,t.onSaveSuccessCallback=this.__onOtherCardSaved,t.checkRELFrequency=!0,t.isEmbedded=!0,t.disableUTF8=this.__disableUTF8,t.onLoadSuccessCallback=this.__onOtherCardLoaded,t.hideEmptyFields=this.__hideEmptyFields,t.focusOnLoad=!1,t.fromWorkflow=!0,t.onBothCardsLoadAndEdit=this.__onBothCardsLoadAndEdit,this.__contactInformationController=new $$WP.PersonalInformation.ContactInformationController(this.$contactInformationContainer,o),this.__otherInformationController=new $$WP.PersonalInformation.OtherInformationController(this.$othertInformationContainer,t)},__onContactCardLoaded:function(){this.__isContactInformationLoaded=!0,this.__updateIsComplete()},__onContactCardEdit:function(){this.__isContactInformationInEditMode=!0,this.__updateIsComplete()},__onContactCardCancel:function(){this.__isContactInformationInEditMode=!1,this.__updateIsComplete()},__onContactCardSaved:function(){this.__isContactInformationInEditMode=!1,this.IsDataModified=!0,this.__updateIsComplete()},__onOtherCardLoaded:function(){this.__isOtherInformationLoaded=!0,this.__updateIsComplete()},__onOtherCardEdit:function(){this.__isOtherInformationInEditMode=!0,this.__updateIsComplete()},__onOtherCardCancel:function(){this.__isOtherInformationInEditMode=!1,this.__updateIsComplete()},__onOtherCardSaved:function(){this.__isOtherInformationInEditMode=!1,this.IsDataModified=!0,this.__updateIsComplete()},__updateIsComplete:function WP$PersonalInformation$DemographicVerificationController$__updateIsComplete(){this.__isLoadingComplete()&&(this.IsComplete=!this.__isAnyCardInEditMode(),"function"==typeof this.__onIsCompleteChangedCallback&&this.__onIsCompleteChangedCallback(this.IsComplete,this.IsDataModified))},__isLoadingComplete:function WP$PersonalInformation$DemographicVerificationController$__isLoadingComplete(){return this.__isContactInformationLoaded&&this.__isOtherInformationLoaded},__isAnyCardInEditMode:function WP$PersonalInformation$DemographicVerificationController$__isAnyCardInEditMode(){return this.__isContactInformationInEditMode||this.__isOtherInformationInEditMode},__onBothCardsLoadAndEdit:function WP$PersonalInformation$DemographicVerificationController$__onBothCardsLoadAndEdit(){this.__isLoadingComplete()&&this.__isAnyCardInEditMode()&&this.$root.find("input, select, textarea").filter(":visible:enabled").first().focus()},deactivate:function(){this.__contactInformationController&&this.__contactInformationController.abortLoadingAjax(),this.__otherInformationController&&this.__otherInformationController.abortLoadingAjax()}},$$WP.PersonalInformation.DemographicVerificationController=o,o.extend($$WP.Controllers.Controller,"WP$PersonalInformation$DemographicVerificationController")}();;
/*! Copyright (c) Epic Systems Corporation 2018 */
!function ClassDefinition(){var e=$$WP.Strings.getNamespace("Authentication.ContactVerification");$$WP.Utilities.guaranteeExistence($$WP,"Authentication.SecondaryValidation.Controllers");var t=function ContactVerificationController(e,t){this.$container=e,this.proxify("_createPopup","_loadVerification","_bindEvents","_startVerifyEmailWorkflow","_startVerifyMobileWorkflow","_updateEmailSection","_updateMobileSection","_cancelWorkflow","_overwriteMismatchedEmail","_overwriteMismatchedMobile","_overwriteMismatchedCore","_disposePopup"),this._secureCommunicationInfo=t.SecureCommunicationInfo,this._controllerReference=t.ControllerReference,t.AutoSendEmailCode?(this._secureCommunicationInfo.AutoSendCode=!0,this._createPopup(!0,!1)):t.AutoSendMobileCode?(this._secureCommunicationInfo.AutoSendCode=!0,this._createPopup(!1,!0)):(this._secureCommunicationInfo.AutoSendCode=!1,this._createPopup(!1,!1))};t.prototype={$container:null,_context:null,_emailAllowed:!1,_emailEnabled:!1,_phoneAllowed:!1,_phoneEnabled:!1,_secureCommunicationInfo:null,_verificationPopup:null,_secondaryValidationSettings:null,_controllerReference:null,_secondaryValidationController:null,_bindEvents:function(){this.$container.on("click","#sendCodeToEmailButton",this._startVerifyEmailWorkflow),this.$container.on("click","#overwriteEmailButton",this._overwriteMismatchedEmail),this.$container.on("click","#sendCodeToMobileButton",this._startVerifyMobileWorkflow),this.$container.on("click","#overwriteMobileButton",this._overwriteMismatchedMobile),$afe.select("div.Popup").on("click",".previouspage",this._disposePopup);var e=$afe.select("div.Popup").find("#contact_verification_container")[0];void 0!==e&&new MutationObserver($.proxy((function(){null!=this._verificationPopup&&this._verificationPopup._resizePopup()}),this)).observe(e,{subtree:!0,childList:!0})},_loadVerification:function(e,t){var i={SecureCommunicationInfo:this._secureCommunicationInfo,IsEmailUpdated:e,IsMobileUpdated:t};$afe.select("div.Popup").removeClass("small").addClass("medium"),this.$container.parent().empty().safeAppend($afe.renderTemplate($$WP.Templates.SecondaryAuthentication.ContactVerification,i)),this.$container=$afe.select("#contact_verification_container"),this._bindEvents(),e?$afe.select("#emailUpdatedSuccessMessage").focus():t&&$afe.select("#mobileUpdatedSuccessMessage").focus()},_createPopup:function(t,i){var o,n;if(0===window.pageYOffset){var a=$afe.select("#header");a.hasClass("compact")&&a.removeClass("compact")}n=e.getString("BackButtonText"),this._secureCommunicationInfo.DoBothNeedAttention?o=e.getString("ContactVerificationHeader"):this._secureCommunicationInfo.DoesEmailNeedAttention?o=e.getString("EmailVerificationHeader"):this._secureCommunicationInfo.DoesMobileNeedAttention&&(o=e.getString("MobileVerificationHeader"));var r=new $$WPComp.TemplateComponent({template:$$WP.Templates.SecondaryAuthentication.ContactVerification,IsClosable:!0,TitleText:o});r.setData({SecureCommunicationInfo:this._secureCommunicationInfo,IsEmailUpdated:!1,IsMobileUpdated:!1}),this._verificationPopup=$$WPUtil.quickPopup(r,{Size:$$WPContain.Popup.SizeEnum.MEDIUM,BackButtonText:n}),this.$container=$afe.select("#contact_verification_container"),this._secureCommunicationInfo.AutoSendCode&&this._verificationPopup.hide(),this._bindEvents(),$afe.select("div.Popup").addClass("fullscreen"),$afe.select("div.Popup")[0].removeAttribute("aria-live"),t?this._startVerifyEmailWorkflow():i&&this._startVerifyMobileWorkflow()},_startVerifyEmailWorkflow:function(){var t=e.getString("SendEmailStepThreeDescription");this._secondaryValidationSettings={TwoFactorSettings:this._getTwoFactorSettings("email",this._secureCommunicationInfo.EmailAddress),TwoFactorDescriptionSettings:{StepThreeText:t},CallbackSettings:{Success:$.proxy((function(){this._secureCommunicationInfo.SecureEmail=this._secureCommunicationInfo.EmailAddress,this._updateEmailSection()}),this),GoBackFromSecondaryValidation:$.proxy((function(){this._loadVerification(!1,!1)}),this)},RememberMeSettings:{Enabled:!1},SignupSettings:null!=this._templateContext?SignupSettings:null,ValidationSettings:new $$WP.FormValidation.ValidationSettings({required:!0,nullValue:"default"}),PopupSettings:{IsPopup:!0},Workflow:3,PopupToShow:this._verificationPopup},this._secondaryValidationController=new $$WP.Authentication.SecondaryValidation.Controllers.SecondaryValidationController($afe.select("#contact_review_container"),this._secondaryValidationSettings)},_startVerifyMobileWorkflow:function(){var t=e.getString("SendMobileStepThreeDescription");this._secondaryValidationSettings={TwoFactorSettings:this._getTwoFactorSettings("phone","‪"+this._secureCommunicationInfo.MobilePhone+"‬"),TwoFactorDescriptionSettings:{StepThreeText:t},CallbackSettings:{Success:$.proxy((function(){this._secureCommunicationInfo.SecureMobile=this._secureCommunicationInfo.MobilePhone,this._updateMobileSection()}),this),GoBackFromSecondaryValidation:$.proxy((function(){this._loadVerification(!1,!1)}),this)},RememberMeSettings:{Enabled:!1},SignupSettings:null!=this._templateContext?SignupSettings:null,ValidationSettings:new $$WP.FormValidation.ValidationSettings({required:!0,nullValue:"default"}),PopupSettings:{IsPopup:!0},Workflow:3,PopupToShow:this._verificationPopup},this._secondaryValidationController=new $$WP.Authentication.SecondaryValidation.Controllers.SecondaryValidationController($afe.select("#contact_review_container"),this._secondaryValidationSettings)},_getTwoFactorSettings:function(e,t){var i={Enabled:!0,AllowEmail:!1,AllowSMS:!1,IsPostLogin2FA:!0,ShowIntro:!1,ShowTitle:!1,ShowRecip:!0};switch(e){case"email":i.AllowEmail=!0,i.DisplayEmail=t;break;case"phone":i.AllowSMS=!0,i.DisplayPhone=t,i.ShowIntro=!0}return i},_updateEmailSection:function(){this._secureCommunicationInfo.DoBothNeedAttention=!1,this._secureCommunicationInfo.DoesEmailNeedAttention=!1,this._secureCommunicationInfo.DoNeitherNeedAttention=!this._secureCommunicationInfo.DoesMobileNeedAttention,this._handleInformationUpdate(),this._controllerReference.ViewModel.SecureCommunicationInfo=this._secureCommunicationInfo,this._controllerReference.render(!1);var e=$afe.select("#launchVerificationButton");null!==e&&this._controllerReference._settings.autoLaunchPopup&&(e.removeClass("secondary neutral"),e.addClass("positive primary")),this._secureCommunicationInfo.DoNeitherNeedAttention&&this._disposePopup(),this._loadVerification(!0,!1)},_updateMobileSection:function(){this._secureCommunicationInfo.DoBothNeedAttention=!1,this._secureCommunicationInfo.DoesMobileNeedAttention=!1,this._secureCommunicationInfo.DoNeitherNeedAttention=!this._secureCommunicationInfo.DoesEmailNeedAttention,this._handleInformationUpdate(),this._controllerReference.ViewModel.SecureCommunicationInfo=this._secureCommunicationInfo,this._controllerReference.render(!1);var e=$afe.select("#launchVerificationButton");null!==e&&this._controllerReference._settings.autoLaunchPopup&&(e.removeClass("secondary neutral"),e.addClass("positive primary")),this._secureCommunicationInfo.DoNeitherNeedAttention&&this._disposePopup(),this._loadVerification(!1,!0)},_overwriteMismatchedEmail:function(){var e=$.proxy((function(){this._secureCommunicationInfo.EmailAddress=this._secureCommunicationInfo.SecureEmail,this._secureCommunicationInfo.IsEmailDeleted=!1,this._secureCommunicationInfo.AreBothDeleted=!1,this._secureCommunicationInfo.AreNeitherDeleted=!this._secureCommunicationInfo.IsMobileDeleted,this._updateEmailSection()}),this);this._overwriteMismatchedCore("overwriteEmail",e)},_overwriteMismatchedMobile:function(){var e=$.proxy((function(){this._secureCommunicationInfo.MobilePhone=this._secureCommunicationInfo.SecureMobile,this._secureCommunicationInfo.IsMobileDeleted=!1,this._secureCommunicationInfo.AreBothDeleted=!1,this._secureCommunicationInfo.AreNeitherDeleted=!this._secureCommunicationInfo.IsEmailDeleted,this._updateMobileSection()}),this);this._overwriteMismatchedCore("overwriteMobile",e)},_overwriteMismatchedCore:function(e,t){var i={};i[e]=!0,$.ajax({url:makeLink("Authentication/ContactVerification/OverwriteMismatch"),type:"POST",data:i,dataType:"json",success:t()})},_cancelWorkflow:function(){this._loadVerification(!1,!1)},_disposePopup:function(){this._verificationPopup.dispose()},_handleInformationUpdate:function(){requestAnimationFrame((function(){requestAnimationFrame((function(){var e=$$WP.Strings.getNamespace("PersonalInformation.ContactInformation");$afe.select("#success_alert_title").text(e.getString("ContactsVerifiedTitle")),$afe.select("#success_alert_text").text(e.getString("ContactsVerifiedMessage"))}))})),this._secureCommunicationInfo.InfoUpdated=!0}},$$WP.Authentication.SecondaryValidation.Controllers.ContactVerificationController=t,t.extend($$WP.Controllers.Controller,"WP$Authentication$SecondaryValidation$Controllers$ContactVerificationController")}();;
!function ClassDefinition(){$$WP.Utilities.guaranteeExistence($$WP,"Authentication.SecondaryValidation.Controllers");var t=$$WP.Strings.getNamespace("secondaryvalidation"),e=function SecondaryValidationController(t,e){if(this.proxify("_initializeDefaultSettings","_resendTwoFactorCodeByEmail","_resendTwoFactorCodeByText","_registerBeforeUnloadHandler","_useTwoFactorCodeByTotp","_loadTwoFactorIntro","_loadSecondaryAuthenticationEntry","_bindEvents","_sendTwoFactorCodeByEmail","_sendTwoFactorCodeByText","_sendTwoFactorCodeCore","_submitSecondaryValidationInfo","_showPopup","_renderDescription","_returnToPreviousScreen","_resendTwoFactorCode","_executeReturnCallback","_success","_pushAnswers","_popAnswers","reload","_showReturnDialogue","_logout","_registerPartials","_setupDemographicAndTwoFactorViews","_handleTwoFactorMustLogout"),this.$container=t,this._context=e,this._initializeDefaultSettings(),this._registerPartials(),this._successCallback=this._context.CallbackSettings.Success,this._cancelCallback=this._context.CallbackSettings.Cancel,this._context.PopupSettings.IsPopup&&(this._closePopup=this._context.PopupSettings.Close),this._context.TwoFactorSettings.IsSelfSignupWorkflow){var o=this._createBackToSelfSignupURL();this._context.CallbackSettings.GoBackFromSecondaryValidation=function(){$$WPUtil.TryRedirect(o)},this._setPreloginTimeout()}$$WPUtil.IsNullOrEmpty(this._context.CallbackSettings.GoBackFromSecondaryValidation)||(this._returnCallback=this._context.CallbackSettings.GoBackFromSecondaryValidation,this._context.TwoFactorSettings.HasBackButton=!0),this._context&&this._context&&this._context.SignupSettings&&this._context.SignupSettings.Enabled&&this._context.SignupSettings.UpdateStepCount(this._context,1,"twoFactorEntryLoad"),this._context.DemographicSettings.IsGuestLogin&&WP.Events.cancelBeforeUnload(),this._operationInProgress=!1,this._bindEvents(),this._context.TwoFactorSettings.Enabled?this._prepareIntro():this._loadSecondaryAuthenticationEntry()};e.prototype={$container:null,_context:null,_successCallback:null,_cancelCallback:null,_closePopup:null,_operationInProgress:!1,_reloadCallback:null,_descriptionController:null,_returnCallback:null,_showIntro:!1,_firstDemogAttempt:!0,reload:function(t){null!==this._reloadCallback&&($$WPUtil.IsNullOrEmpty(t)||(this.$container=t),this._reloadCallback(),this._popAnswers())},_initializeDefaultSettings:function(){$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorSettings.IsPostLogin2FA",!1),$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorSettings.ShowTitle",!0),$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorSettings.ShowLearnMore",!0),$$WP.Utilities.guaranteeExistence(this._context,"FormValidation.RequiredSettings",new $$WP.FormValidation.ValidationSettings({required:!0})),$$WP.Utilities.guaranteeExistence(this._context,"FormValidation.CodeEntrySettings",new $$WP.FormValidation.ValidationSettings({required:!0,isNumericString:!0})),$$WP.Utilities.guaranteeExistence(this._context,"FormValidation.DateSettings",new $$WP.FormValidation.ValidationSettings({required:!0,isDate:!0,isDOB:!0,maxDate:(new Date).toISOString().slice(0,10)})),$$WP.Utilities.guaranteeExistence(this._context,"FormValidation.Email",new $$WP.FormValidation.ValidationSettings({required:!0,isEmail:!0})),$$WP.Utilities.guaranteeExistence(this._context,"PopupSettings.IsPopup",!1),$$WP.Utilities.guaranteeExistence(this._context,"PopupSettings.ResetFocus",(function(){})),$$WP.Utilities.guaranteeExistence(this._context,"DemographicSettings.Enabled",!1),this._context.TwoFactorSettings.CanShowSelfSignupDescription=this._context.TwoFactorSettings.IsSelfSignupWorkflow&&10!==this._context.Workflow,$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorDescriptionSettings"),this._context.TwoFactorDescriptionSettings.StepThreeText=10===this._context.Workflow?t.getString("VerifyIdentityOpenSchedulingHelptext"):t.getString("VerifyIdentityHelptext")},_prepareIntro:function(){this._context.TwoFactorSettings.ShowIntro||this._context.TwoFactorSettings.AllowSMS&&this._context.ConsentStrings&&this._context.ConsentStrings.ShowConsent||this._context.TwoFactorSettings.AllowMultiple||this._context.TwoFactorSettings.IsSelfSignupWorkflow?(this._showIntro=!0,this._consentSeemsPopulated()?this._loadTwoFactorIntro():this._tryPopulateConsent(this._loadTwoFactorIntro)):this._context.TwoFactorSettings.AllowEmail?this._sendTwoFactorCodeByEmail():this._context.TwoFactorSettings.AllowSMS?this._sendTwoFactorCodeByText():this._context.TwoFactorSettings.AllowTotp&&this._useTwoFactorCodeByTotp()},_loadTwoFactorIntro:function(t){$$WPUtil.IsNullOrEmpty(t)||(this._showPopup(),"toolbarBack"===t)?(null===this._returnCallback&&(this._context.TwoFactorSettings.HasBackButton=!1),this.$container.empty().safeAppend($afe.renderTemplate($$WP.Templates.SecondaryAuthentication.TwoFactorIntro,this._context)),this._reloadCallback=this._loadTwoFactorIntro,this._context.PopupSettings.IsPopup?this._context.PopupSettings.ResetFocus():WP.DOM.Search.getNextFocusable(this.$container.get(0)).focus()):$afe.select("#secondaryValidationGoBack").focus()},_consentSeemsPopulated:function(){var t=0,e=this._context.ConsentStrings;return null!=e&&(t+=$$WPUtil.IsNullOrEmpty(e.CallToAction)?0:e.CallToAction.length,t+=$$WPUtil.IsNullOrEmpty(e.TermsAndConditionsURL)?0:e.TermsAndConditionsURL.length,(t+=$$WPUtil.IsNullOrEmpty(e.PrivacyPolicyURL)?0:e.PrivacyPolicyURL.length)>0)},_tryPopulateConsent:function(t){getCSRFTokenAsQS($.proxy((function(){$.ajax({url:makeLink("Authentication/SecondaryValidation/GetSMSConsentStrings"),type:"GET",dataType:"json",success:$.proxy((function(e){this._context.ConsentStrings={ShowConsent:!0,CallToAction:e.CallToAction,TermsAndConditionsURL:e.TermsAndConditionsURL,PrivacyPolicyURL:e.PrivacyPolicyURL},t()}),this)})}),this))},_loadSecondaryAuthenticationEntry:function(){var t;this._context.TwoFactorSettings.AllowMultiple?this._context.TwoFactorSettings.HasBackButton=!0:this._context.TwoFactorSettings.AllowEmail||this._context.TwoFactorSettings.AllowSMS||$$WPUtil.IsNullOrEmpty(this._context.CallbackSettings.GoBackFromSecondaryValidation)||this._context.CallbackSettings.GoBackFromSecondaryValidation(),this.$container.empty().safeAppend($afe.renderTemplate($$WP.Templates.SecondaryAuthentication.TwoFactorEntry,this._context)),this._showPopup(),this._reloadCallback=this._loadSecondaryAuthenticationEntry,$afe.select("#twofactorform").length>0&&(this._context.AutoSendToEmail||this._context.AutoSendToSMS)&&this._registerBeforeUnloadHandler(),t=$afe.select("#two-factor-wrapper-form"),$$WP.FormValidation.initializeDOMSubtree(t),this._setupDemographicAndTwoFactorViews(),this._context.PopupSettings.IsPopup&&this._context.PopupSettings.ResetFocus()},_bindEvents:function(){this.$container.on("click","#resendCode",this._resendTwoFactorCode),this.$container.on("click","#twofactorsend #emailCode",this._sendTwoFactorCodeByEmail),this.$container.on("click","#twofactorsend #textCode",this._sendTwoFactorCodeByText),this.$container.on("click","#twofactorsend #totpCode",this._useTwoFactorCodeByTotp),this.$container.on("click","#setExemption",this._setTwoFactorExemption),this.$container.on("submit","#two-factor-wrapper-form",this._submitSecondaryValidationInfo),this.$container.on("click","#submitSecondaryValidation",this._submitSecondaryValidationInfo),this.$container.on("click","#learnMore",this._renderDescription),this.$container.on("click","#secondaryValidationGoBack",this._returnToPreviousScreen),this.$container.on("focus","#twofactorcode",(function(){$afe.select(".Popup").safeAttr("aria-live","off"),$afe.select("#update_twofactor_status_popup_container").safeAttr("aria-live","off")})),this.$container.on("click","#demographicsSignOut",this._logout)},_sendTwoFactorCodeByEmail:function(t){this._context.TwoFactorSettings.SentByEmail=!0,this._context.TwoFactorSettings.SentByText=!1,this._context.TwoFactorSettings.UsedTOTP=!1,this._sendTwoFactorCodeCore(t,"deliveryMethodEmail",!1)},_sendTwoFactorCodeByText:function(t){this._context.TwoFactorSettings.SentByEmail=!1,this._context.TwoFactorSettings.SentByText=!0,this._context.TwoFactorSettings.UsedTOTP=!1,this._sendTwoFactorCodeCore(t,"deliveryMethodSMS",!1)},_useTwoFactorCodeByTotp:function(){this._context.TwoFactorSettings.SentByEmail=!1,this._context.TwoFactorSettings.SentByText=!1,this._context.TwoFactorSettings.UsedTOTP=!0,this._loadSecondaryAuthenticationEntry()},_resendTwoFactorCode:function(t){!0===this._context.TwoFactorSettings.SentByEmail?this._resendTwoFactorCodeByEmail(t):!0===this._context.TwoFactorSettings.SentByText&&this._resendTwoFactorCodeByText(t)},_resendTwoFactorCodeByEmail:function(t){this._sendTwoFactorCodeCore(t,"deliveryMethodEmail",!0)},_resendTwoFactorCodeByText:function(t){this._sendTwoFactorCodeCore(t,"deliveryMethodSMS",!0)},_sendTwoFactorCodeCore:function(e,o,n){if(!this._operationInProgress){this._operationInProgress=!0,void 0!==e&&e.preventDefault();var i,a={};a[o]=!0,a.resendCode=n,a.workflow=this._context.Workflow,$.post({url:makeLink("Authentication/SecondaryValidation/SendCode"),data:a,success:function(t){t.Success||this._handleCodeSendFailure(n,i)}.bind(this),error:function(){this._handleCodeSendFailure(n,i)}.bind(this),complete:function(){this._operationInProgress=!1}.bind(this)}),n?(i=$$WPUtil.quickMessageBox(t.getString("CodeResent"),t.getString("CodeResentHeader"),[new $$WPComp.ComplexObjects.Button(t.getString("ConfirmCodeResent"),null,"otherbutton enrollmentbutton")],null,[],null,!1)).focus():this._loadSecondaryAuthenticationEntry()}},_setTwoFactorExemption:function(t){this._operationInProgress||(this._operationInProgress=!0,void 0!==t&&t.preventDefault(),$.post({url:makeLink("Authentication/SecondaryValidation/SetExemption"),success:function(t){t.Success&&$$WPUtil.TryRedirect(makeLink("Home"))}.bind(this),complete:function(){this._operationInProgress=!1}.bind(this)}))},_handleCodeSendFailure:function(e,o){e&&o.hide(),$$WPUtil.quickMessageBox(t.getString("CodeSendFailure"),t.getString("CodeSendFailureHeader"),[new $$WPComp.ComplexObjects.Button(t.getString("ConfirmCodeSendFailure"),null,"otherbutton enrollmentbutton")],null,[],null,!1).focus()},_handleTwoFactorMustLogout:function(){var e=this;if(this._context.TwoFactorSettings.IsSelfSignupWorkflow)(10==this._context.Workflow?$$WPUtil.quickMessageBox(t.getString("ContactVerificationFailed"),t.getString("ContactVerificationFailedHeader"),[new $$WPComp.ComplexObjects.Button(t.getString("GoBackText"),null,"","btnBackToLoginPage")],(function(){e._executeReturnCallback()})):$$WPUtil.quickMessageBox(t.getString("SignupFailed"),t.getString("SignupFailedHeader"),[new $$WPComp.ComplexObjects.Button(t.getString("BackToLoginPage"),null,"","btnBackToLoginPage")],(function(){$$WPUtil.TryRedirect(makeLink("Authentication/Login"))}))).focus();else{if($$WP.Utilities.UI.IsMobile)return WP.Events.cancelBeforeUnload(),void $$WP.Utilities.TryRedirect("epichttp://logout?contactverification=1");WP.Events.cancelBeforeUnload();var o=!0===this._context.TwoFactorSettings.IsPostLogin2FA?"failedentryattempts":"failedentryattemptslocked";$$WPUtil.logoutAndShowError(o)}},_submitSecondaryValidationInfo:function(e){e.preventDefault();var o=$afe.select("#twofactorcode").first().val();if(!this._operationInProgress&&$$WP.FormValidation.checkIfFormIsValid($afe.select("#two-factor-wrapper-form"),!1)){this._operationInProgress=!0;var n,i=$.proxy((function(t){var e=!0;if($afe.select("#twofactorcode").first().val(o),t.Success)this._context.SignupSettings&&this._context.SignupSettings.Enabled&&this._context.SignupSettings.UpdateStepCount(this._context,1),this._setDeviceInStorageIfEmpty(t.RememberDeviceId),WP.Events.cancelBeforeUnload(),e=!1,this._context.TwoFactorSettings&&this._context.TwoFactorSettings.Enabled?($afe.select("#twofactorcode").safeAttr("style","background-image: url("+makeStaticImageLink("authentication/wp_two_factor_icon_animated_success.gif?"+Math.random(1e4))+");"),window.setTimeout(this._success,700)):this._success();else{var n=!1;if(t.MustLogout&&this._handleTwoFactorMustLogout(),t.InvalidTwoFactorCode){if($$WP.Strings.addMnemonic("@MYCHART@TWOFACODE@",o),this._context.TwoFactorSettings.UsedTOTP)var i=$$WP.Strings.get("IncorrectTotpTwoFactorCode");else if("codeexpiredtf"===t.TwoFactorCodeFailReason)i=$$WP.Strings.get("ExpiredTwoFactorCode");else i=$$WP.Strings.get("IncorrectTwoFactorCode");$$WP.Strings.removeMnemonic("@MYCHART@TWOFACODE@");var a=$afe.select("#twofactorcode");$$WP.FormValidation.addValidationError(a,void 0,i),a.safeAttr("style","background-image: url("+makeStaticImageLink("authentication/wp_two_factor_icon_animated_failure.gif?"+Math.random(1e4))+");"),n=!0}t.InvalidDemographics?(null!=t.Errors?t.Errors.forEach((function(t){$$WP.FormValidation.addValidationError($afe.select(t.ErrorIndex),t.ErrorKey)})):t.IsEncodingError?this._updateEncodingErrors("SpecialCharError",t.EncodingErrors):($afe.select("#dateOfBirth").first().safeAttr("data-invalid","true"),this._updateInvalidDemographicsError("InvalidDemographicsErrorMessage")),n=!0):$afe.select("#demographics-mismatch-error").first().addClass("hidden"),n&&($$WP.FormValidation.checkIfFormIsValid($afe.select("#two-factor-wrapper-form"),!0),$("input.invalid:first").focus())}e&&window.setTimeout($.proxy((function(){this._operationInProgress=!1}),this),500)}),this),a=$.proxy((function(t){this._operationInProgress=!1}),this);$$WPUtil.isLocalStorageAvailable()&&void 0!==window.localStorage&&(n=localStorage.getItem(getDeviceIdKey()));var s={url:makeLink("Authentication/SecondaryValidation/Validate"),data:{TwoFactorCode:o,RememberMe:!0===$afe.select("#rememberMe").first().is(":checked")?"checked":"",IsPostLogin2FA:this._context.TwoFactorSettings.IsPostLogin2FA,EnrollDeviceTrackingOnRemember:!!this._context.RememberMeSettings.Enabled&&!!this._context.RememberMeSettings.EnrollDeviceTracking,DeviceId:n,Workflow:this._context.Workflow,isTOTP:this._context.TwoFactorSettings.UsedTOTP},success:i,error:a,complete:function(e){200===e.status&&void 0!==e.responseJSON||$$WPUtil.quickMessageBox(t.getString("ValidationFailure"),t.getString("ValidationFailureHeader"),[new $$WPComp.ComplexObjects.Button(t.getString("ValidationFailureOKButton"),null,"otherbutton enrollmentbutton")],null,[],null,!1).focus()}};$afe.select(".demographics-entry").each((function(){s.data[this.id]=this.value})),$.post(s)}},_setDeviceInStorageIfEmpty:function(t){$$WPUtil.isLocalStorageAvailable()&&void 0!==window.localStorage&&(localStorage.getItem(getDeviceIdKey())||localStorage.setItem(getDeviceIdKey(),t))},_updateInvalidDemographicsError:function(t){var e=$afe.select("#demographics-mismatch-error-text").first();function _updateErrorString(){e.text($$WP.Strings.get(t,"secondaryvalidation")),$afe.select("#demographics-mismatch-error").first().removeClass("hidden").removeAttr("role","alert").attr("role","alert")}this._firstDemogAttempt?(_updateErrorString(),this._firstDemogAttempt=!1):e.fadeOut(400,(function(){_updateErrorString(),e.fadeIn(400)})),$("form:first *:input[type!=hidden]:first").focus()},_updateEncodingErrors:function(t,e){for(var o=$$WP.Strings.get(t,"secondaryvalidation"),n=0;n<e.length;n++)$$WP.FormValidation.addValidationError($afe.select("#".concat(e[n])),void 0,o)},_registerBeforeUnloadHandler:function(){$$WPUtil.SafeToRedirectOverrideSettings={TitleText:t.getString("NavigationTitle"),ToolbarButtons:[new $$WPComp.ComplexObjects.Button(t.getString("NavigationCancel"),null,"","stay"),new $$WPComp.ComplexObjects.Button(t.getString("NavigationConfirm"),null,"inlinedelete","leave")],Html:t.getString("NavigationDetails"),IsClosable:!1},WP.Events.registerBeforeUnloadMessage(t.getString("NavigationDetails")),WP.Events.beforeUnload()},_showPopup:function(){null==this._context.PopupToShow||this._context.PopupToShow._isDisposed||($$WP.Debug.UpdateTopMarginForBanners(),this._context.PopupToShow.show(),this._context.PopupToShow.focus())},_pushAnswers:function(){window.sessionStorage.setItem("twoFactorCode",$afe.select("#twofactorcode").val())},_popAnswers:function(){var t;t=window.sessionStorage.getItem("twoFactorCode"),$$WPUtil.IsNullOrEmpty(t)||($afe.select("#twofactorcode").val(t).trigger("change"),window.sessionStorage.removeItem("twoFactorCode"))},_renderDescription:function(t){t.preventDefault(),this._operationInProgress||(this._pushAnswers(),null===this._descriptionController&&(this._descriptionController=new $$WP.Authentication.SecondaryValidation.Controllers.TwoFactorDescriptionController(this.$container,this._context)),this._descriptionController.render(this.reload),this._context.PopupSettings.IsPopup&&this._context.PopupSettings.ResetFocus())},_returnToPreviousScreen:function(t){t.preventDefault(),this._operationInProgress||(this._context.TwoFactorSettings.UsedTOTP?this._loadTwoFactorIntro():this._showIntro&&this._reloadCallback===this._loadSecondaryAuthenticationEntry?this._showReturnDialogue(this._loadTwoFactorIntro):this._reloadCallback===this._loadSecondaryAuthenticationEntry&&null!==this._returnCallback?this._showReturnDialogue(this._executeReturnCallback):null!==this._returnCallback&&this._executeReturnCallback("toolbarBack"))},_showReturnDialogue:function(e){var o=$$WPUtil.quickMessageBox(t.getString("BackConfirmDetails"),t.getString("BackConfirmHeader"),[new $$WPComp.ComplexObjects.Button(t.getString("BackConfirmGoBackButton"),null,"primary negative enrollmentbutton","Back"),new $$WPComp.ComplexObjects.Button(t.getString("BackConfirmReturnButton"),null,"primary neutral enrollmentbutton","Cancel")],e);o.setFocus(),o.focus()},_executeReturnCallback:function(t){$$WPUtil.IsNullOrEmpty(t)||(this._showPopup(),"toolbarBack"===t)?(this._context&&this._context.SignupSettings&&this._context.SignupSettings.Enabled&&this._context.SignupSettings.UpdateStepCount(this._context,-1,"SecondaryAuthenticationBack"),this._returnCallback()):$afe.select("#secondaryValidationGoBack").focus()},_success:function(){this._context&&this._context.SignupSettings&&this._context.SignupSettings.Enabled&&this._context.SignupSettings.UpdateStepCount(this._context,1,"SecondaryAuthenticationComplete"),this._successCallback(),this._context.PopupSettings.IsPopup&&this._context.PopupSettings.ResetFocus()},_logout:function(){window.location=makeLink("Home/Logout?skipabandoncurrent=1")},_registerPartials:function(){var t,e;if(this._context.DemographicSettings.Enabled)for(t=0;t<this._context.DemographicSettings.ConfiguredFields.length;t++)e=this._context.DemographicSettings.Partials[this._context.DemographicSettings.ConfiguredFields[t]],Handlebars.registerPartial(e,$$WP.Templates.SecondaryAuthentication.Partials[e])},_setupDemographicAndTwoFactorViews:function(){var t;if(this._context.TwoFactorSettings.Enabled||$afe.select("#submitSecondaryValidation").children().first().remove(),this._context.DemographicSettings.Enabled){(t=$afe.select("#demographics-desc")).addClass("alignCenter");var e=this._context.DemographicSettings.IsProxyContext?$$WP.Strings.get("DemographicsSectionDescriptionProxy","secondaryvalidation").replace("@MYCHART@PATIENTDISPLAYNAME@",this._context.DemographicSettings.PatientDisplayName):t.text(),o=document.createElement("textarea");o.innerHTML=e,t.text(o.value),(t=$afe.select("#demographics-mismatch-error")).addClass("alignCenter"),(t=$afe.select("#twoFactorHeader")).addClass("alignCenter"),(t=$afe.select("#secondaryValidationGoBack")).removeClass("inlinebutton"),t.addClass("centerBackButton"),(t=$afe.select("#content")).addClass("minHeightZero"),t.addClass("narrow2FA"),(t=$afe.select("#main")).addClass("minHeightZero"),$afe.select("title").first().text($$WP.Strings.get("DemogAuthPageTitle","secondaryvalidation")),this._context.TwoFactorSettings.Enabled&&((t=$afe.select("#code-sent-desc")).removeClass("alignStart"),t.addClass("alignCenter"),(t=$afe.select("#learnMore")).removeClass("linkbutton"),t.addClass("centerButton"),t.css("padding-bottom","1rem"),(t=$afe.select("#resendCode")).addClass("centerButton"));let setSegmentContent=async function(t,e,o,n,i,a,s){t=t.replace(/[^0-9a-zA-Z]/gi,""),i.val(t),n.val[e]=t,o.val(n.val.join("")),t.length==a[e]&&e<a.length?await $afe.select("#"+s+(e+1)).focus():0==t.length&&e>0?await $afe.select("#"+s+(e-1)).focus():(await o.focus(),await i.focus())},resetFocus=async function(t,e,o){await t.focus(),await t.blur(),setSegmentsInvalid(t,e,o)},setSegmentsInvalid=function(t,e,o){if(t.hasClass("invalid"))for(let t=0;t<e;t++)$afe.select("#"+o+t).addClass("invalid");else for(let t=0;t<e;t++)$afe.select("#"+o+t).removeClass("invalid")},setSSNFieldBehavior=function(t,e,o){let n=$afe.select("#"+t);n.css("visibility","hidden"),n.css("position","absolute");let i=o.length,a={val:Array(i)},s=o.reduce(((t,e)=>t+e),0);for(let t=0;t<i;t++){let r=$afe.select("#"+e+t),c=$afe.select("#"+e+"Label"+t);r.css("width",o[t]/s*100+"%"),r.css("min-width","unset"),r.on("input",(i=>setSegmentContent(i.target.value,t,n,a,r,o,e))),r.on("focusout",(()=>resetFocus(n,i,e))),c.html(t+1)}};this._context.DemographicSettings.ConfiguredFields.includes(1)&&this._context.DemographicSettings.CanUseSSNFormat&&setSSNFieldBehavior("SocialSecurityNumber","ssnSegment",this._context.DemographicSettings.SSNSegments),this._context.DemographicSettings.ConfiguredFields.includes(2)&&this._context.DemographicSettings.CanUseSSNFormat&&setSSNFieldBehavior("SocialSecurityNumberLastFour","ssnSegmentLastFour",this._context.DemographicSettings.SSNSegmentsLast4)}else this._context.TwoFactorSettings.Enabled&&!this._context.TwoFactorSettings.HasBackButton&&((t=$afe.select("#twoFactorHeader")).addClass("alignCenter"),(t=$afe.select("#code-sent-desc")).removeClass("alignStart"),t.addClass("alignCenter"),(t=$afe.select("#learnMore")).removeClass("linkbutton"),t.addClass("centerButton"),t.css("padding-bottom","1rem"))},_createBackToSelfSignupURL:function(){var t="Signup";if(window.location.search.length>0){var e=$$WPUtil.removeParamsFromQueryString("SelfSignupToken");e.length>0&&(t=t+"?"+e)}return makeLink(t)},_setPreloginTimeout:function(){this._resetTimer(),document.body.addEventListener("click",$.proxy(this._resetTimer,this),!0),document.body.addEventListener("keypress",$.proxy(this._resetTimer,this),!0),document.body.addEventListener("input",$.proxy(this._resetTimer,this),!0)},_resetTimer:function(){clearTimeout(this._timer),this._timer=setTimeout($.proxy(this._popupWarning,this),6e5)},_popupWarning:function(){$$WPUtil.quickPopup(new $$WPComp.TimeoutWarningComponent({SecondsLeft:30,isPreLogin:!1}))}},$$WP.Authentication.SecondaryValidation.Controllers.SecondaryValidationController=e,e.extend($$WP.Controllers.Controller,"WP$Authentication$SecondaryValidation$Controllers$SecondaryValidationController")}();;
!function ClassDefinition(){$$WP.Utilities.guaranteeExistence($$WP,"Authentication.SecondaryValidation.Controllers");var t=$$WP.Strings.getNamespace("secondaryvalidation"),e=function TwoFactorDescriptionController(t,e){this.$container=t,this._returnCallback=null,this._context=e,this.proxify("render","_return","_initializeDefaultSettings","_bindEvents"),this._initializeDefaultSettings(),this._bindEvents()};e.prototype={$container:null,_returnCallback:null,_context:null,render:function(t){this._context.PopupSettings.IsPopup?($afe.select("div.Popup").removeClass("small").addClass("medium"),this._context.PopupSettings.ResetFocus()):WP.DOM.Search.getNextFocusable(this.$container.get(0)).focus(),$$WPUtil.IsNullOrEmpty(t)||(this._returnCallback=t),this._context.TwoFactorDescriptionSettings.IsRTL="rtl"===$afe.select("html").safeAttr("dir"),this.$container.empty().safeAppend($afe.renderTemplate($$WP.Templates.SecondaryAuthentication.TwoFactorDescription,this._context)),this._context.PopupSettings.IsPopup||this._renderSidebar()},_return:function(){this._context.PopupSettings.IsPopup||this._removeSidebar(),$$WPUtil.IsNullOrEmpty(this._returnCallback)||this._returnCallback()},_renderSidebar:function(){new $$WP.UI.VideoViewModel("TwoFactorHowTo",null,(function videoViewModelCallback(t){if(t){var e,i,n=$afe.select("#content"),o=$afe.select("#main");n.addClass("hasSidebar"),$("<aside id='sidebar'></aside>").insertAfter(o),i=new Array,null!==t.Url&&i.push(t),i.length>0&&((e={}).VideoCard="TwoFactorHowTo",e.Videos=i,new $$WP.UI.VideoController($afe.select("#sidebar"),e,0,1),new $$WP.UI.VideoController($afe.select("#videoFooter"),e,1,0))}}))},_removeSidebar:function(){$afe.select("#sidebar").remove(),$afe.select("#content").removeClass("hasSidebar")},_bindEvents:function(){this.$container.on("click","#returnButton",this._return)},_initializeDefaultSettings:function(){$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorDescriptionSettings.StepOneText",t.getString("SendCodeHelptext")),$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorDescriptionSettings.StepTwoText",t.getString("EnterCodeHelptext")),$$WP.Utilities.guaranteeExistence(this._context,"TwoFactorDescriptionSettings.StepThreeText",t.getString("VerifyIdentityHelptext")),$$WP.Utilities.guaranteeExistence(this._context,"PopupSettings.IsPopup",!1)}},$$WP.Authentication.SecondaryValidation.Controllers.TwoFactorDescriptionController=e,e.extend($$WP.Controllers.Controller,"WP$Authentication$SecondaryValidation$Controllers$TwoFactorDescriptionController")}();;
!function WP$Scheduling$DemographicVerificationStepController$definition(){var e=$$WP.Scheduling.TelehealthOrganization,t=function WP$Scheduling$DemographicVerificationStepController(e,t,i,o){this.WP$Scheduling$StepController(e,t,null,null,null,$$WP.Templates.Scheduling.DemographicsVerification,$$WP.Templates.Scheduling.DemographicsVerification),this.proxify("__onVerifyClick","__onVerifyDemographicsSuccess","__onIsCompleteChanged","_onOrgSelected","_onTelehealthWorkflowSelected"),this.$root=e,this.__isStepConfiguredToDisplay=i,this.__disableUTF8=o,this.Data.TelehealthData.addPropertyListener("SelectedWorkflow",this._onTelehealthWorkflowSelected),this.Data.TelehealthData.addPropertyListener("IsOrgSelectionComplete",this._onOrgSelected)};t.prototype={$root:null,$demographicVerificationContainer:null,__demographicVerificationController:null,__isStepConfiguredToDisplay:!1,__isVerified:!1,__disableUTF8:!1,updateViewModel:function WP$Scheduling$DemographicVerificationStepController$updateViewModel(){var e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id).isComplete===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete;this.ViewModel={Count:0,StepShouldBeActive:!1,Incomplete:!e,IsProxy:this.Data.IsProxy,ProxyContextName:this.Data.ProxyContextName},this.__isStepConfiguredToDisplay?(this.ViewModel={Count:0,ShowOtherInformation:!0,StepShouldBeActive:!0,StepControllerId:this.Id,Incomplete:!e,ReservationBlurbViewModel:{IsSlotReserved:!!this.Data.AppointmentBuilder.getAppointment(0).Slot&&!!this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationKey},IsProxy:this.Data.IsProxy,ProxyContextName:this.Data.ProxyContextName},this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@RESERVATIONEXPIRATIONTIME@":{Value:this.Data.AppointmentBuilder.getAppointment(0).Slot?this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationExpirationTimeString:null,EncodingType:$$WP.Strings.EncodingTypes.HTML}})):this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)},afterRender:function WP$Scheduling$DemographicVerificationStepController$afterRender(){var e;e=this.$root.find(".demographicsVerificationContent"),this.__demographicVerificationController=new $$WP.PersonalInformation.DemographicVerificationController(e,this.__onIsCompleteChanged,this.__disableUTF8),this.__disableVerifyButton(),this.getContinueButton(this.$root).on("click",this.__onVerifyClick),this.$root.find("h2.header, .schedulingStepBanners .standardBanner").first().focus(),$afe.select(".verifyButtons").addClass("stickybanner"),$$WPSchedulingUtil.HandleStickyBanner(),this.__isVerified=!1},_getViewEventSubmodule:function WP$Scheduling$DemographicVerificationStepController$_getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.DemographicVerificationStep},__onIsCompleteChanged:function WP$Scheduling$DemographicVerificationStepController$__onIsCompleteChanged(e){e?(this.__enableVerifyButton(),$$WPSchedulingUtil.HandleStickyBanner()):this.__disableVerifyButton()},__enableVerifyButton:function WP$Scheduling$DemographicVerificationStepController$__enableVerifyButton(){this.getContinueButton(this.$root).removeClass("hidden")},__disableVerifyButton:function WP$Scheduling$DemographicVerificationStepController$__disableVerifyButton(){this.getContinueButton(this.$root).addClass("hidden")},getContinueButton:function WP$Scheduling$DemographicVerificationStepController$getContinueButton(e){return e.find("[data-id='demographicsVerifyButton']")},__onVerifyClick:function WP$Scheduling$DemographicVerificationStepController$__onVerifyClick(){this.__demographicVerificationController.MarkDemographicsAsVerified(this.__onVerifyDemographicsSuccess)},__onVerifyDemographicsSuccess:function WP$Scheduling$DemographicVerificationStepController$__onVerifyDemographicsSuccess(){this.__isVerified||(this.__isVerified=!0,this.__disableVerifyButton(),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete),this.Data.AppointmentBuilder.setProperty("CompletedDemographicVerificationStep",!0))},_onOrgSelected:function WP$Scheduling$DemographicVerificationStepController$_onOrgSelected(){var t=this.Data.TelehealthOrganizations.getFirstInIndex("State",e.StatesEnum.Selected),i=this.Data.TelehealthData.SelectedWorkflow;null===t||i!==$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing||t.IsLocal?this.__isStepConfiguredToDisplay=!0:(this.__isStepConfiguredToDisplay=!1,this.Data.AppointmentBuilder.setProperty("CompletedDemographicVerificationStep",!1)),this.updateStep()},_onTelehealthWorkflowSelected:function WP$Scheduling$DemographicVerificationStepController$_onTelehealthWorkflowSelected(){var e=this.Data.TelehealthData.SelectedWorkflow;null!==e&&(e!==$$WP.Scheduling.TelehealthData.TelehealthWorkflow.QuickSchedule&&e!==$$WP.Scheduling.TelehealthData.TelehealthWorkflow.SlotSelection||(this.__isStepConfiguredToDisplay=!0,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)),this.updateStep())}},$$WP.Scheduling.DemographicVerificationStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$DemographicVerificationStepController")}();;
!function WP$Scheduling$PersonalInfoCollectionStepController$definition(){var e=$$WP.Scheduling.Workflow,t=function WP$Scheduling$PersonalInfoCollectionStepController(e,t,o,n,i,l){this.WP$Scheduling$StepController(e,o,null,null,null,$$WP.Templates.Scheduling.PersonalInfoCollectionStep),this.$root=e,this._workflow=t,this._stopSchedulingCallback=n,this._workflowEventCallbacks=i,this._workflowSettings=l,this.proxify("updateViewModel","afterRender","__onCollectPersonalInfoSuccess","__onCollectPersonalInfoFailure","_getVisitTypeId")};t.prototype={$root:null,PersonalInformationController:null,_stopSchedulingCallback:null,updateViewModel:function WP$Scheduling$PersonalInfoCollectionStepController$updateViewModel(){var e=this.Data.SchedulingSteps.getFromIndex("ID",this.Id).isComplete===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete,t=!!this.Data.AppointmentBuilder.getAppointment(0).Slot&&this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationKey;this.ViewModel={Count:0,ShowOtherInformation:!0,StepShouldBeActive:!0,StepControllerId:this.Id,Incomplete:!e,ReservationBlurbViewModel:{IsSlotReserved:t}},t&&this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@RESERVATIONEXPIRATIONTIME@":{Value:this.Data.AppointmentBuilder.getAppointment(0).Slot.ReservationExpirationTimeString,EncodingType:$$WP.Strings.EncodingTypes.HTML}})},setSchedulingCallbacks:function setSchedulingCallbacks(e,t,o){this._loginCallback=e,this.schedule=t,this.reconSchedule=o},beforeFirstRender:function WP$Scheduling$PersonalInfoCollectionStepController$beforeFirstRender(){},afterRender:function WP$Scheduling$PersonalInfoCollectionStepController$afterRender(){this.getContinueButton(this.$root).on("click",this.__onContinueClick),this.$root.find("h2.header, .schedulingStepBanners .standardBanner").first().focus(),$.ajax({url:makeLink("Personal/PersonalInformation/GetInsuranceConfiguration"),data:$$WPUtil.postify({visitTypeId:this._getVisitTypeId()}),type:"POST",success:$.proxy((function(t){const o=t?.Configuration?.SkipInsuranceForVisitType;$$WP.SelfTriage.Utilities.promoteUser(this.$root.find(".personalInformationContainer"),{skipInsuranceCollection:o}).then($.proxy((function(t){this.Data.AppointmentBuilder.RequestedLogin=t.requestedLogin,this.Data.AppointmentBuilder.setProperty("IsPersonalInfoCollectionComplete",!0),this.Data.AppointmentBuilder.setProperty("HasMatchingRecord",t.hasMatchingRecord),this.Data.AppointmentBuilder.setProperty("IsPromoted",this.Data.AppointmentBuilder.IsPromoted||t.isPromoted),o?this.Data.AppointmentBuilder.setProperty("SkipInsuranceForVisitType",o):this.Data.AppointmentBuilder.setProperty("IsInsuranceCollectionComplete",!0),this._workflow.Type!==e.WorkflowTypesEnum.OnDemandTelehealth&&(t.requestedLogin?this._loginCallback():(t.hasMatchingRecord?this.reconSchedule():this.schedule(),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)))}),this)).catch($.proxy((function(e){this._stopSchedulingCallback()}),this))}),this),error:this._handleInsuranceError})},__onCollectPersonalInfoSuccess:function WP$Scheduling$PersonalInfoCollectionStepController$__onCollectPersonalInfoSuccess(t,o,n,i,l,r){this.Data.AppointmentBuilder.setProperty("IsPersonalInfoCollectionComplete",t),this.Data.AppointmentBuilder.setProperty("HasMatchingRecord",n),this.Data.AppointmentBuilder.setProperty("IsInsuranceCollectionComplete",o),this.Data.AppointmentBuilder.setProperty("IsPromoted",this.Data.AppointmentBuilder.IsPromoted||l),this.Data.AppointmentBuilder.setProperty("SkipInsuranceForVisitType",r),this._workflow.Type!==e.WorkflowTypesEnum.OnDemandTelehealth&&(n?this.reconSchedule():this.schedule(),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete))},__onCollectPersonalInfoFailure:function WP$Scheduling$PersonalInfoCollectionStepController$__onCollectPersonalInfoFailure(e,t,o){this.Data.AppointmentBuilder.setProperty("IsPersonalInfoCollectionComplete",e),this.Data.AppointmentBuilder.setProperty("HasMatchingRecord",o),this.Data.AppointmentBuilder.setProperty("IsInsuranceCollectionComplete",t),this._stopSchedulingCallback()},_getVisitTypeId:function _getVisitTypeId(){return this._workflow.Type===e.WorkflowTypesEnum.DecisionTreeNode&&1===this.Data.AppointmentBuilder.Appointments.Models.length&&this.Data.AppointmentBuilder.getAppointment(0).VisitType.ID?this.Data.AppointmentBuilder.getAppointment(0).VisitType.ID:this._workflow.Type===e.WorkflowTypesEnum.OnDemandTelehealth&&1===this.Data.AppointmentBuilder.Appointments.Models.length&&this.Data.AppointmentBuilder.getAppointment(0).ReasonForVisit.TelemedicineVisitTypeId?this.Data.AppointmentBuilder.getAppointment(0).ReasonForVisit.TelemedicineVisitTypeId:void 0}},$$WP.Scheduling.PersonalInfoCollectionStepController=t,t.extend($$WP.Scheduling.StepController,"WP$Scheduling$PersonalInfoCollectionStepController")}();;
!function WP$SchedulingSidebarController$definition(){var i=$$WP.Scheduling.Workflow,e=function WP$Scheduling$SidebarController(i,e,n){this.WP$Controllers$Controller(),this.proxify("_update"),this._linksSidebarWidget=i,this._workflow=e,this._workflowSettings=n,this._update()};e.prototype={_linksSidebarWidget:null,_workflow:null,_workflowSettings:null,_update:function WP$Scheduling$SidebarController$_update(){var i;if(this._linksSidebarWidget&&this._linksSidebarWidget.update(this._getLinksViewModel()),i=$afe.select("#HowToVideoContainer"),!$$WP.Utilities.IsMobile&&i.length>0){new $$WP.UI.VideoViewModel("VideoVisitHowTo",null,(function videoViewModelCallback(e){var n,t;n=new Array,null!==e.Url&&n.push(e),n.length>0&&((t={}).VideoCard="TalkToADoctor",t.Videos=n,new $$WP.UI.VideoController(i,t))}))}},_getLinksViewModel:function WP$Scheduling$SidebarController$_getLinksViewModel(){var e;return(e={}).NumLinks=0,e.HasVideo=!1,this._workflowSettings.ShowSidebarLinks&&(this._workflow?(this._workflow.Type===i.WorkflowTypesEnum.OnDemandTelehealth&&(e.HasVideo=!0),this._workflow.Type!==i.WorkflowTypesEnum.Reschedule&&this._workflow.Type!==i.WorkflowTypesEnum.OnDemandTelehealth&&this._workflowSettings.ShowVideoVisitSidebar&&(e.VideoVisitQuickLink=makeLink("Scheduling/OnDemandTelehealth"),e.NumLinks++),this._workflow.Type!==i.WorkflowTypesEnum.Reschedule&&this._workflowSettings.ShowEVisitSidebar&&(e.EVisitQuickLink=makeLink("inside.asp?mode=evisit"),e.NumLinks++),this._workflow.Type!==i.WorkflowTypesEnum.Reschedule&&this._workflowSettings.AllowOnMyWay&&(e.OnMyWayLink=makeLink("Scheduling/OnMyWay/PostLogin"),e.NumLinks++),this._workflow.ShowSchedulingHubLink&&(e.HubLink=makeLink("Scheduling"),e.NumLinks++)):(this._workflowSettings.ShowVideoVisitSidebar&&(e.VideoVisitQuickLink=makeLink("Scheduling/OnDemandTelehealth"),e.NumLinks++),this._workflowSettings.ShowEVisitSidebar&&(e.EVisitQuickLink=makeLink("inside.asp?mode=evisit"),e.NumLinks++),this._workflowSettings.AllowOnMyWay&&(e.OnMyWayLink=makeLink("Scheduling/OnMyWay/PostLogin"),e.NumLinks++))),e.EVisitQuickLink&&($$WP.Strings.containsGlobalMnemonic("BrandEVisit")?(e.EVisitQuickLinkString=$$WP.Strings.get("SidebarEVisitLink","Scheduling"),e.EVisitQuickLinkTooltip=$$WP.Strings.get("SidebarEVisitButtonToolTip","Scheduling")):(e.EVisitQuickLinkString=$$WP.Strings.get("SidebarEVisitLinkNoMnemonic","Scheduling"),e.EVisitQuickLinkTooltip=$$WP.Strings.get("SidebarEVisitButtonToolTipNoMnemonic","Scheduling"))),e.VideoVisitQuickLink&&($$WP.Strings.containsGlobalMnemonic("BrandVideoVisits")?e.VideoVisitQuickLinkString=$$WP.Strings.get("SidebarVideoVisitLink","Scheduling"):e.VideoVisitQuickLinkString=$$WP.Strings.get("SidebarVideoVisitLinkNoMnemonic","Scheduling")),e}},$$WP.Scheduling.SidebarController=e,e.extend($$WP.Controllers.Controller,"WP$Scheduling$SidebarController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SidebarController(i){$$WP.Debug.UnitTest.assert}));;
!function definition(){var e=$$WP.Common.Model,t=$$WP.Scheduling.Workflow,o={LandingPage:"LandingPage"},r={Workflow:"workflow",Provider:"provider",ReasonForVisit:"rfv",Slot:"slot",Specialty:"specialty"},n=function LandingPageController(e,t,i,r,n){this.WP$Scheduling$StepController(e,null,i.AllowedSpecialtyIds,null,null,$$WP.Templates.Scheduling.LandingPage),this.proxify("updateStep","_onWorkflowElementClick","_onRemoveFavoriteButtonClicked","_onRemoveFavoriteButtonKeyPress","_onRemoveFavoritePopupButtonClicked","_onSpecialtyLoadSuccess","_onDeclineTicketButtonClicked","_onSelectRfv","_onSelectNewProviderRfv","_onSelectProviderFinder","_onSelectProvider","_onSelectRecentProviders","_onSelectTicket","_onSelectFavorite","_onSelectSpecialtyGrouper","_onRemoveFavorite","_onDeclineTicket","_onSelectNewProvider","__onSelectUpdateTicketWaitListPreferences"),this._workflows=t,this._workflowSettings=i,this.__banners=i.Banners,this._isMobile=$$WP.Utilities.UI.IsMobile,this._isGuest=r,this._preselectedTicketId=i.TicketId,this.__workflowEventCallbacks=n,this._providerWorkflow=this._workflows.getFromIndex("Id","ExistingProvider"),this._newProviderWorkflow=this._workflows.getFromIndex("Id","NewProvider"),this._reasonWorkflow=this._workflows.getFromIndex("Id","Procedure"),this.__promotedSpecialtyIds=i.PromotedSpecialtyIds,this.__allowedSpecialtyIDs=i.AllowedSpecialtyIds,this.__specialtyStepSettings=i.SpecialtyStepSettings,this.__allowMobileSchedulingInlineRedirects=i.AllowMobileSchedulingInlineRedirects,this.$root.on("click","[data-type]",this._onWorkflowElementClick),this._workflows.addCollectionEventListener("remove",this.updateStep),this.$root.on("click",".card.favorite .removeButton",this._onRemoveFavoriteButtonClicked),this.$root.on("keypress",".card.favorite .removeButton",this._onRemoveFavoriteButtonKeyPress),this.$root.on("click",".card.ticket [data-id='declineTicket']",this._onDeclineTicketButtonClicked);var l="",s="";for(l in o)s=o[l],this._reactSubcomponents[s]={};var a=document.getElementsByClassName("previousstep")[0];!$$WP.Utilities.UI.IsLoggedIn||$$WP.Utilities.UI.IsWorkflowRestricted||this._isGuest||a&&a.classList.remove("hidden"),this._isGuest&&a.remove()};n.prototype={_updateReactSubcomponents:function WP$Scheduling$LandingPageController$_updateReactSubcomponents(){var e={dataPool:this._getKeyValueDataStore(),handlers:this._getReactHandlers()};this._reactSubcomponents[o.LandingPage].props=e},_getReactHandlers:function WP$Scheduling$LandingPageController$_getReactHandlers(){return this._reactHandlers||(this._reactHandlers={},this._reactHandlers.onSelectRfv=this._onSelectRfv,this._reactHandlers.onSelectProvider=this._onSelectProvider,this._reactHandlers.onSelectRecentProviders=this._onSelectRecentProviders,this._reactHandlers.onSelectTicket=this._onSelectTicket,this._reactHandlers.onSelectFavorite=this._onSelectFavorite,this._reactHandlers.onRemoveFavorite=this._onRemoveFavorite,this._reactHandlers.onDeclineTicket=this._onDeclineTicket,this._reactHandlers.onSelectNewProvider=this._onSelectNewProvider,this._reactHandlers.onSelectSpecialtyGrouper=this._onSelectSpecialtyGrouper,this._reactHandlers.onSelectNewProviderRfv=this._onSelectNewProviderRfv,this._reactHandlers.onSelectProviderFinder=this._onSelectProviderFinder,this._reactHandlers.onSelectUpdateTicketWaitListPreferences=this.__onSelectUpdateTicketWaitListPreferences,this._reactHandlers.onTicketWaitListPreferencesUpdatedJSCallback=this.__workflowEventCallbacks.onTicketWaitListPreferencesUpdated),this._reactHandlers},__onSelectUpdateTicketWaitListPreferences:function WP$Scheduling$LandingPageController$__onSelectUpdateTicketWaitListPreferences(e,t){var i={type:$$WP.Scheduling.SchedulingStep.StepTypeEnum.JoinWaitList},o=this._getWorkflowForTicket(e),r={onTicketWaitListPreferencesUpdated:t};new $$WP.Scheduling.AdHocStepWorkflowController(i,"-1",o.SchedulingDataPool,o,this._workflowSettings,r).renderInPopup(this.SchedulingStringsNamespace.getString("EditAppointmentPreferencesLabel"))},_getKeyValueDataStore:function WP$Scheduling$LandingPageController$getKeyValueDatapool(){var e=this._workflows.getFromIndex("Id","React").SchedulingDataPool;return store={favoriteAppointments:this.__getFavoriteAppointmentKeyValueDataStore(),providerDepartmentPairs:e.ProviderDepartmentPairs.getKeyValueFormat("Id"),providers:e.Providers.getKeyValueFormat("ID"),reasonsForVisit:this.__getReasonForVisitKeyValueDataStore(),schedulingMenus:e.SchedulingMenus.getKeyValueFormat("ID"),schedulingMenuReasonForVisits:e.SchedulingMenuReasonsForVisit.getKeyValueFormat("Id"),specialties:e.Specialties.getKeyValueFormat("Id"),tickets:this.__getTicketKeyValueDataStore(),orderMap:e.OrderMap,visitTypes:e.VisitTypes.getKeyValueFormat("ID"),canSelectOtherRfv:e.ShowOtherRfvOption,canFindNewProvider:e.ShowNewProviderWorkflow,canShowProviderFinderDefaultLink:e.ShowProviderFinderDefaultLink,banners:this.__banners,preselectedTicketStatus:e.PreselectedTicketStatus,hideBackNavigation:e.HideBackNavigation},this.__lowercaseStore(store),store},__lowercaseStore:function __lowercaseStore(e){for(var t={},i=Object.keys(e),o=null,r=0;r<i.length;r++)"object"==typeof(o=e[i[r]])&&(e[i[r]]=this.__getLowercaseCollectionCopy(o,t))},__getLowercaseCollectionCopy:function __getLowercaseCollectionCopy(e,t){var i,o=null,r=[];i=Object.keys(e);for(var n=0;n<i.length;n++)"object"==typeof(o=e[i[n]])?(newObject=this.__lowercaseObject(o,t),r[i[n]]=newObject):r[i[n]]=o;return r},__lowercaseObject:function __lowercaseObject(e,t){for(var i=null,o=Object.keys(e),r={},n=0;n<o.length;n++)i=o[n],this.__isObjectObjectProperty(i)?r[this.__lowercaseProperty(i,t)]=this.__lowercaseObject(e[i],t):this.__isObjectArrayProperty(i)?r[this.__lowercaseProperty(i,t)]=this.__lowercaseObjectArray(e[i],t):r[this.__lowercaseProperty(i,t)]=e[i];return r},__isObjectObjectProperty:function __isObjectObjectProperty(e){return"ReasonForVisit"===e},__isObjectArrayProperty:function __isObjectArrayProperty(e){switch(e){case"Specialties":case"ApptComponents":case"RawApptComponents":return!0;default:return!1}},__lowercaseObjectArray:function __lowercaseObjectArray(e,t){var i=[];if(null==e)return[];for(var o=0;o<e.length;o++)i[o]=this.__lowercaseObject(e[o],t);return i},__lowercaseProperty:function __lowercaseProperty(e,t){var i=t[e];return i||(i="ID"===e?"id":e.slice(0,1).toLowerCase()+e.slice(1),t[e]=i),i},__getReasonForVisitKeyValueDataStore:function __getReasonForVisitKeyValueDataStore(){var e=this._workflows.getFromIndex("Id","React").SchedulingDataPool.ReasonsForVisit.getKeyValueFormat("Id");return this.__filterUnavailableRfvs(e),this.__appendTicketRfvs(e,this._workflows),this.__appendBundledRfvs(e),e},__filterUnavailableRfvs:function __filterUnavailableRfvs(e){for(var t="",i=Object.keys(e),o=0;o<i.length;o++)t=i[o],$$WP.Scheduling.Workflow.shouldIncludeReasonForVisit(e[t],!0,!0)||delete e[t]},__appendTicketRfvs:function _appendTicketRfvs(e,t){for(var i=null,o=null,r=0;r<t.Models.length;r++)null!==(i=t.Models[r]).TicketInfo&&null!==i.TicketInfo.ReasonForVisit&&(e[(o=i.TicketInfo.ReasonForVisit).Id]=o)},__appendBundledRfvs:function __appendBundledRfvs(e){var t=null,i=null,o=[];for(key in e)o.push(e[key]);for(var r=0;r<o.length;r++)if((t=o[r]).ApptComponents)for(var n=0;n<t.ApptComponents.length;n++)e[(i=t.ApptComponents[n]).Id]=i},__getFavoriteAppointmentKeyValueDataStore:function WP$LandingPageController$getFavoriteAppointmenttKeyValueDataStore(){var e,t={},o=this._workflows.getFromIndex("IsFavorite",!0);for(i=0;i<o.length;i++)(e=o[i].FavoriteAppointmentInfo).Title=this.__getFavoriteWorkflowTitle(e.ReasonForVisitTitle,e.ProviderName,e.HideProviderName),e.Id=e.Csn,t[e.Csn]=e;return t},__getTicketKeyValueDataStore:function WP$LandingPageController$getTicketKeyValueDataStore(){var e,t,i={};for(e=0;e<this._workflows.Models.length;e++)t=this._workflows.Models[e],$.extend(i,t.getTicketKeyValueStore());return i},_reactHandlers:null,$root:null,_workflows:null,_workflowSettings:null,_providerWorkflow:null,_newProviderWorkflow:null,_reasonWorkflow:null,__banners:null,__promotedSpecialtyIds:null,_isMobile:!1,_isFirstRender:!0,_preselectedTicketId:!0,__workflowEventCallbacks:null,_loadOneClickSlots:function WP$Scheduling$LandingPageController$_loadOneClickSlots(){var e,i,o;if((e=this._workflows.getFromIndex("Type",t.WorkflowTypesEnum.Ticket))&&0!==e.length)for(o=0;o<e.length;o++)(i=e[o]).SchedulingDataPool.SlotLoader.loadOneClickTicketSlots(i.TicketInfo.TicketId,this.updateStep)},updateViewModel:function updateViewModel(){this.ViewModel={Workflows:null,Count:0,StepShouldBeActive:!0,HasDirectOptions:!1,Providers:null,ReasonsForVisit:null,CardColumns:null,SideBySide:!1,HasTickets:!1,TicketWorkflows:null,HasFavorites:!1,FavoriteAppointmentWorkflows:null,HasTicketsOrFavorites:!1,ShouldShowProviderWorkflow:!1,ShouldShowReasonForVisitWorkflow:!1,ShouldShowNewProviderWorkflow:!1,ShouldFadeIn:!1,DataTypes:null,HasPreselectedTicket:!$$WPUtil.IsNullOrEmpty(this._preselectedTicketId),PreselectedTicketWorkflow:null};var e=$afe.select("body").hasClass("isPrelogin");this.ViewModel.IsPrelogin=e,this.ViewModel.ShouldFadeIn=this._isFirstRender,this.ViewModel.Banners=this.__banners,e?this.__updateOpenSchedViewModel():this.__updateDirectSchedViewModel()},__updateOpenSchedViewModel:function __updateOpenSchedViewModel(){this.__updateNewProviderWorkflowViewModel(),this.__setCount(),this.ViewModel.ShowOpenSchedulingHeader=!0},__updateDirectSchedViewModel:function __updateDirectSchedViewModel(){this.__updateProvidersWorkflowViewModel(),this.__updateNewProviderWorkflowViewModel(),this.__updateReasonsForVisitWorkflowViewModel(),this.ViewModel.ShouldShowNewProviderWorkflow&&!this.ViewModel.ShouldShowProviderWorkflow&&(this.ViewModel.ShouldShowProviderWorkflow=!0),(this.ViewModel.ShouldShowProviderWorkflow||this.ViewModel.ShouldShowReasonForVisitWorkflow)&&(this.ViewModel.HasDirectOptions=!0,this.__updateFavoriteAppointmentWorkflowsViewModel()),this.__updateTicketWorkflowsViewModel(),this.ViewModel.HasTicketsOrFavorites=this.ViewModel.HasTickets||this.ViewModel.HasFavorites,this.ViewModel.DataTypes=r,this.__setCount(),this.__updateCardDisplay()},__updateProvidersWorkflowViewModel:function __updateProvidersWorkflowViewModel(){var e=[];this._providerWorkflow&&(e=this._buildProviderArray(),this.ViewModel.Providers=e,e.length>0&&(this.ViewModel.ShouldShowProviderWorkflow=!0),this.ViewModel.ProvidersWorkflow=this._providerWorkflow)},__updateReasonsForVisitWorkflowViewModel:function __updateReasonsForVisitWorkflowViewModel(){var e=[];this._reasonWorkflow&&(e=this._getUnfilteredReasonsForVisit(),this.ViewModel.ReasonsForVisit=e,e.length>0&&(this.ViewModel.ShouldShowReasonForVisitWorkflow=!0),this.ViewModel.ReasonsForVisitWorkflow=this._reasonWorkflow)},__updateNewProviderWorkflowViewModel:function __updateNewProviderWorkflowViewModel(){var e,t,i=!1,o=!1,r=this.ViewModel.IsPrelogin;void 0!==this._newProviderWorkflow&&null!==this._newProviderWorkflow&&(this.ViewModel.NewProviderWorkflow=this._newProviderWorkflow,e=this.ViewModel.NewProviderWorkflow.SchedulingDataPool,this.ViewModel.NewProviderWorkflow&&(i=e.Specialties.Models.length>0,o=e.ShowNewProviderWorkflow,this.ViewModel.ShouldShowNewProviderWorkflow=i&&o,i&&(t=this.filterByAllowedIds(e.Specialties.toArray(),"Id"),$$WPSchedulingSpecialtiesCore.SetSpecialtiesViewModel(this.ViewModel,t,this.__promotedSpecialtyIds,r))))},__updateCardDisplay:function __updateCardDisplay(){var e=this.ViewModel.ShouldShowProviderWorkflow,t=this.ViewModel.ShouldShowReasonForVisitWorkflow;e&&t&&!isDataTile()?(this.ViewModel.CardColumns=6,this.ViewModel.SideBySide=!0):e&&t&&isDataTile()?(this.ViewModel.CardColumns=12,this.ViewModel.SideBySide=!0):(this.ViewModel.CardColumns=4,this.ViewModel.SideBySide=!1)},__updateTicketWorkflowsViewModel:function __updateTicketWorkflowsViewModel(){var e,i,o,r;if((e=this._workflows.getFromIndex("Type",t.WorkflowTypesEnum.Ticket))&&0!==e.length){for(this.ViewModel.HasTickets=!0,o=0;o<e.length;o++)(i=e[o]).TicketInfo.BundleId&&(i.TicketInfo.GroupOrdersIntoVisits=!0),i.IsPreselectedTicket&&(r=i),i.ExpireDateString=i.getTicketExpireDateString(),i.AvailableDateString=i.getTicketAvailableDateString(),this.__organizeOrders(i.TicketInfo),this._buildOneClickSlots(i);(e=e.filter((function(e){return e!==r}))).sort(this.__sortTickets),this.ViewModel.TicketWorkflows=e,this.ViewModel.PreselectedTicketWorkflow=r}},__setCount:function __setCount(){this.ViewModel.HasTickets&&this.ViewModel.Count++,this.ViewModel.HasFavorites&&this.ViewModel.Count++,this.ViewModel.ShouldShowProviderWorkflow&&this.ViewModel.Count++,this.ViewModel.ShouldShowReasonForVisitWorkflow&&this.ViewModel.Count++,this.ViewModel.ShouldShowNewProviderWorkflow&&!this.ViewModel.ShouldShowProviderWorkflow&&this.ViewModel.Count++},__sortTickets:function __sortTickets(e,t){return e.IsCurrentlyAvailable&&!t.IsCurrentlyAvailable?-1:!e.IsCurrentlyAvailable&&t.IsCurrentlyAvailable?1:0},__updateFavoriteAppointmentWorkflowsViewModel:function __updateFavoriteAppointmentWorkflowsViewModel(){var e,t,i,o;if((e=this._workflows.getFromIndex("IsFavorite",!0))&&0!==e.length)for(this.ViewModel.HasFavorites=!0,this.ViewModel.FavoriteAppointmentWorkflows=e,o=0;o<e.length;o++)i=(t=e[o]).FavoriteAppointmentInfo,t.Title=this.__getFavoriteWorkflowTitle(i.ReasonForVisitTitle,i.ProviderName,i.HideProviderName)},__getFavoriteWorkflowTitle:function __getFavoriteWorkflowTitle(e,t,i){if($$WPUtil.IsNullOrEmpty(t)||i)return e;this.SchedulingStringsNamespace.addMnemonics({"@MYCHART@REASONFORVISIT@":{Value:e,EncodingType:$$WP.Strings.EncodingTypes.None},"@MYCHART@PROVIDER@":{Value:t,EncodingType:$$WP.Strings.EncodingTypes.None}});var o=this.SchedulingStringsNamespace.getString("WorkflowProviderRfvTitle");return this.SchedulingStringsNamespace.clearMnemonics(),o},beforeRender:function beforeRender(){this.__hasOnlyOneSpecialty()&&this.__selectOnlySpecialtyAndAdvance()},__hasOnlyOneSpecialty:function WP$Scheduling$LandingPageController$__hasOnlyOneSpecialty(){return!!this.__allowedSpecialtyIDs&&1==this.__allowedSpecialtyIDs.length},__selectOnlySpecialtyAndAdvance:function WP$Scheduling$LandingPageController$__selectOnlySpecialtyAndAdvance(){var e=this.ViewModel.NewProviderWorkflow,t=this.__getOnlyPreselectedSpecialty();t&&(e.SchedulingDataPool.AppointmentBuilder.setProperty("Specialty",t),$$WPSchedulingUtil.ShowWorkflowLoadingIndicator(),$$WPSchedulingSpecialtiesCore.LoadSpecialtyData(e,e.SchedulingDataPool.AppointmentBuilder.Specialty.Id,this._onSpecialtyLoadSuccess(e,null)),this._onAdvancePastLandingPage())},afterRender:function afterRender(){this._isFirstRender=!1,this.ViewModel.IsPrelogin&&this.ViewModel.ShouldShowNewProviderWorkflow&&($$WPSchedulingSpecialtiesCore.SetUpPretext("centered"),this.$root.find(".landingPage, .LandingPageReact").toggleClass("hidden"),$(document).find(".title:has(h1)").toggleClass("hidden")),this.ViewModel.ShowOpenSchedulingHeader&&this.__setUpPretext(),$afe.select(".cardlist.matchHeights").each($$WP.Utilities.UI.Cards.MatchHeights),this.__setInitialFocus()},__getOnlyPreselectedSpecialty:function __getOnlyPreselectedSpecialty(){return this._newProviderWorkflow.SchedulingDataPool.Specialties.getFromIndex("Id",this.__allowedSpecialtyIDs[0])},__setInitialFocus:function __setInitialFocus(){$afe.select("#announcementBanner").hasClass("jqHidden")?this.$root.find("h2.header, h4.header").first().focus():$afe.select("#announcementBanner").focus()},__setUpPretext:function __setUpPretext(){var e=$afe.select(".schedulingPretext"),t=$$WP.Strings.get("OpenSchedulingPretext","Scheduling"),i=$$WP.Strings.get("OpenSchedulingPretextExpanded","Scheduling");$$WPUtil.IsNullOrEmpty(t)||new $$WP.UI.ProgressiveDisclosureController(e,t,i,null,"centered")},_getViewEventSubmodule:function _getViewEventSubmodule(){return $$WP.Analytics.ViewEvent.SubmodulesEnum.LandingPage},_onWorkflowElementClick:function _onWorkflowElementClick(t){var i,o,n,l,s,a,d,c,u,h;switch(t.preventDefault(),l=$afe.jq(t.target).closest("[data-workflow-model-id]").safeAttr("data-workflow-model-id"),h=(s=e.getInstance(l)).SchedulingDataPool.AppointmentBuilder.getAppointment(0),i=$afe.jq(t.target).closest("[data-type]").safeAttr("data-type"),o=$afe.jq(t.target).closest("[data-type]").safeAttr("data-model-id"),n=e.getInstance(o),i){case r.Workflow:s.IsTicket&&this._onSelectTicket(s.TicketInfo.AppointmentRequests[0].ID),s.IsFavorite&&this._onSelectFavorite(s.Id),s.Type==$$WP.Scheduling.Workflow.WorkflowTypesEnum.NewProvider&&this._onSelectNewProvider();break;case r.Slot:c=n,a=s.SchedulingDataPool.Providers.getFromIndex("ID",c.ProviderId),d=this._getLocationForSlot(c,s),s.setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),h.Providers.add(a),h.Locations.add(d),h.setProperty("Slot",c);break;case r.Provider:this._onSelectProvider(n.ID);break;case r.ReasonForVisit:this._onSelectRfv(n.Id);break;case r.Specialty:u=n,s.SchedulingDataPool.AppointmentBuilder.setProperty("Specialty",u),$$WPSchedulingUtil.ShowWorkflowLoadingIndicator(),$$WPSchedulingSpecialtiesCore.LoadSpecialtyData(s,s.SchedulingDataPool.AppointmentBuilder.Specialty.Id,this._onSpecialtyLoadSuccess(s))}this._onAdvancePastLandingPage()},_onSelectRfv:function _onSelectRfv(e,t){var i=this._workflows.getFromIndex("Type",$$WP.Scheduling.Workflow.WorkflowTypesEnum.Procedure)[0],o=i.SchedulingDataPool.ReasonsForVisit.getFromIndex("Id",e);o.DefaultVisitType.isVisitTypeMyChartLink()?(i.SchedulingDataPool.AppointmentBuilder.setProperty("ReasonForVisit",o),$$WPSchedulingUtil.OnMyChartLinkClicked(i,i.SchedulingDataPool,o.DefaultVisitType.MenuLinkCompleteUri,o.DefaultVisitType.DataAttributes)):(i.setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),i.SchedulingDataPool.AppointmentBuilder.setProperty("ReasonForVisit",o),i.SchedulingDataPool.AppointmentBuilder.setProperty("SchedGrouperIds",t)),this._onAdvancePastLandingPage()},_onSelectProviderFinder:function _onSelectProviderFinder(){this._isMobile&&!this.__allowMobileSchedulingInlineRedirects?$$WPUtil.TryRedirect(makeLink("epichttp://app/providers/search")):$$WP.Utilities.TryRedirect(makeLink("app/providers/search"))},_onSelectNewProviderRfv:function _onSelectNewProviderRfv(e,t){var i=this._workflows.getFromIndex("Type",$$WP.Scheduling.Workflow.WorkflowTypesEnum.NewProvider)[0],o=i.SchedulingDataPool.ReasonsForVisit.getFromIndex("Id",e),r=i.SchedulingDataPool.Specialties.getFromIndex("Id",o.SpecialtyGroupId);i.setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),i.SchedulingDataPool.AppointmentBuilder.setProperty("Specialty",r),i.SchedulingDataPool.AppointmentBuilder.setProperty("ReasonForVisit",o),i.SchedulingDataPool.AppointmentBuilder.setProperty("SchedGrouperIds",t),this._onAdvancePastLandingPage()},_onSelectProvider:function _onSelectProvider(e){var t,i,o;i=(t=this._workflows.getFromIndex("Type",$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider)[0]).SchedulingDataPool.Providers.getFromIndex("ID",e),o=t.SchedulingDataPool.AppointmentBuilder.getAppointment(0),t.setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),o.Providers.add(i),this._onAdvancePastLandingPage()},_onSelectRecentProviders:function _onSelectRecentProviders(){this._workflows.getFromIndex("Type",$$WP.Scheduling.Workflow.WorkflowTypesEnum.ExistingProvider)[0].setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),this._onAdvancePastLandingPage()},_onSelectTicket:function WP$Scheduling$LandingPageController$_onSelectTicket(e){this._getWorkflowForTicket(e).setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),this._onAdvancePastLandingPage()},_onSelectFavorite:function WP$Scheduling$LandingPageController$_onSelectFavorite(e){this._workflows.getFromIndex("Id",e).setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),this._onAdvancePastLandingPage()},_onSelectNewProvider:function WP$Scheduling$LandingPageController$_onSelectNewProvider(){this._workflows.getFromIndex("Type",$$WP.Scheduling.Workflow.WorkflowTypesEnum.NewProvider)[0].setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),this._onAdvancePastLandingPage()},_onSelectSpecialtyGrouper:function WP$Scheduling$LandingPageController$_onSelectSpecialtyGrouper(e,t){var i=this._newProviderWorkflow,o=i.SchedulingDataPool.ReasonsForVisit.Models,r=this._getUnloadedSpecialtyIds(e),n=0,onOneSpecialtyLoaded=function(e,l){$$WPSchedulingSpecialtiesCore.UpdateDataPoolSpecialties(i.SchedulingDataPool,l,e),(n+=1)===r.length&&t(this.__getLowercaseCollectionCopy(o,{}))};if(0!==r.length)for(var l=0;l<r.length;l++)$$WPSchedulingSpecialtiesCore.LoadSpecialtyData(i,r[l],onOneSpecialtyLoaded.bind(this,r[l]))},_getUnloadedSpecialtyIds:function WP$Scheduling$LandingPageController$_getUnloadedSpecialtyIds(e){for(var t=[],i=0;i<e.length;i++){var o=this._newProviderWorkflow.SchedulingDataPool.Specialties.getFromIndex("Id",e[i]);o&&o.IsDataLoaded||t.push(e[i])}return t},_onRemoveFavorite:function WP$Scheduling$LandingPageController$_onRemoveFavorite(e){var t=this._workflows.getFromIndex("Id",e);this._removeFavoriteFromDatabase(e),this._workflows.remove(t)},_onAdvancePastLandingPage:function WP$Scheduling$LandingPageController$_onAdvancePastLandingPage(){$afe.select("#announcementBanner").addClass("hidden"),$$WPSchedulingUtil.HideBackButton()},_getWorkflowForTicket:function WP$Scheduling$LandingPageController$_getWorkflowForTicket(e){for(var t,i,o=0;o<this._workflows.Models.length;o++)if((i=this._workflows.Models[o]).IsTicket){if(e===i.TicketInfo.TicketId)return i;t=i.TicketInfo.AppointmentRequests;for(var r=0;r<t.length;r++)if(t[r].ID===e)return i}return null},_onSpecialtyLoadSuccess:function(e){return function(t){$$WPSchedulingSpecialtiesCore.UpdateDataPoolSpecialties(e.SchedulingDataPool,t,e.SchedulingDataPool.AppointmentBuilder.Specialty.Id),e.setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),$$WPSchedulingUtil.HideWorkflowLoadingIndicator()}},_getLocationForSlot:function _getLocationForSlot(e,t){var i,o,r;for(o=t.SchedulingDataPool.Locations.toArray(),i=0;i<o.length;i++)if(-1!==(r=o[i]).DepartmentIds.indexOf(e.DepartmentId)&&!r.IsSingleDepartment)return r},__organizeOrders:function __organizeOrders(e){var t,i,o=this.SchedulingStringsNamespace;e.OrderingProviderString="",e.HasMultipleOrders=!1,t=this.__getTicketOrderList(e),(i=this.__getTicketLinkedOrders(e)).length>0?(this.__organizeOrderList(e,i,t,o),1===i.length&&(e.OrderDisplayName=i[0].DisplayName)):Array.isArray(t)&&this.__organizeOrderList(e,t,t,o),o.clearMnemonics()},__organizeOrderList:function __organizeOrderList(e,t,i,o){e.BundleId?(e.OrderGroups=this.__buildBundleOrderGroup(i,e.ReasonForVisit,o),e.HasMultipleOrders=!0):1===t.length?(e.OrderingProviderString=this.__buildOrderingProviderString(t[0].ProviderName,o),t[0].IsStanding&&(e.StandingOccurrences=this.__buildStandingOrderString(t[0],o))):t.length>1&&(e.OrderGroups=this.__buildOrderGroups(t,o),e.HasMultipleOrders=!0)},__getTicketLinkedOrders:function __getTicketLinkedOrders(e){var t=this.__getLinkedOrdersFromOrders(e.Orders);return t=t.concat(this.__getLinkedOrdersFromOrders(e.AppointmentRequests))},__getLinkedOrdersFromOrders:function __getLinkedOrdersFromOrders(e){var t=[],i=0;if(Array.isArray(e))for(i=0;i<e.length;i++)order=e[i],Array.isArray(order.LinkedOrders)&&(t=t.concat(order.LinkedOrders));return t},__getTicketOrderList:function __getTicketOrderList(e){var t;return Array.isArray(e.Orders)&&e.Orders.length>0?t=e.Orders:Array.isArray(e.AppointmentRequests)&&e.AppointmentRequests.length>0&&(t=e.AppointmentRequests),t},__buildOrderingProviderString:function __buildOrderingProviderString(e,t){var i="";return $$WPUtil.IsNullOrEmpty(e)||(t.addMnemonics({"@MYCHART@ORDERINGPROVIDER@":{Value:e,EncodingType:$$WP.Strings.EncodingTypes.None}}),i=t.getString("TicketOrderingProvider")),i},__buildTwoOrderingProvidersString:function __buildTwoOrderingProvidersString(e,t,i){var o="";return $$WPUtil.IsNullOrEmpty(e)||$$WPUtil.IsNullOrEmpty(t)||(i.addMnemonics({"@MYCHART@ORDERINGPROVIDER1@":{Value:e,EncodingType:$$WP.Strings.EncodingTypes.None}}),i.addMnemonics({"@MYCHART@ORDERINGPROVIDER2@":{Value:t,EncodingType:$$WP.Strings.EncodingTypes.None}}),o=i.getString("TicketTwoOrderingProviders")),o},__buildTwoPlusOrderingProvidersString:function __buildTwoPlusOrderingProvidersString(e,t,i){var o="";return $$WPUtil.IsNullOrEmpty(e)||(i.addMnemonics({"@MYCHART@FIRSTORDERINGPROVIDER@":{Value:e,EncodingType:$$WP.Strings.EncodingTypes.None}}),i.addMnemonics({"@MYCHART@ADDITIONALORDERINGPROVIDERCOUNT@":{Value:t.toString(),EncodingType:$$WP.Strings.EncodingTypes.None}}),o=i.getString("TicketTwoPlusOrderingProviders")),o},__buildStandingOrderString:function __buildStandingOrderString(e,t){var i="";return $$WPUtil.IsNullOrEmpty(e.IsStanding)||("1"!==e.StandingOccurrences?e.IsInfinite?i=t.getString("TicketStandingInfiniteMedicationOrder"):(t.addMnemonics({"@MYCHART@STANDINGOCCURRENCES@":{Value:e.StandingOccurrences,EncodingType:$$WP.Strings.EncodingTypes.None}}),i=t.getString("TicketStandingOrderOccurrencesPlural"),$$WP.Strings.removeMnemonic("@MYCHART@STANDINGOCCURRENCES@")):i=t.getString("TicketStandingOrderOccurrencesSingle")),i},__buildOrderGroups:function __buildOrderGroups(e,t){var i,o=0,r=null,n="",l=null,s=[],a=[];for(i=e.length,o=0;o<i;o++)(l=s[n=(r=e[o]).ProviderName])||((l={}).Orders=[],l.ProviderName=n,l.OrderingProviderString=this.__buildOrderingProviderString(n,t),s[n]=l,a.push(l)),l.Orders.push(r);return a},__buildBundleOrderGroup:function __buildBundleOrderGroup(e,t,i){var o=null,r={},n=null,l=null,s=0;for(o={Orders:[]},s=0;s<e.length;s++)r[e[s].ID]=e[s];for(s=0;s<t.ApptComponents.length;s++)(n=t.ApptComponents[s]).AppointmentRequestIds.length>1?o.Orders.push({DisplayName:n.DefaultVisitType.DisplayName}):(l=r[n.AppointmentRequestIds[0]])&&o.Orders.push(this.__getOrderDetails(l));return o.OrderingProviderString=this.__buildBundleOrderingProviderString(e,i),[o]},__getOrderDetails:function __getOrderDetails(e){var t=0,i={DisplayName:e.DisplayName,LinkedOrders:[]};for(t=0;t<e.LinkedOrders.length;t++)linkedOrder=e.LinkedOrders[t],i.LinkedOrders.push({DisplayName:linkedOrder.DisplayName});return i},__buildBundleOrderingProviderString:function __buildBundleOrderingProviderString(e,t){var i,o,r="",n=[];return o=(i=(n=e.map((function(e){return e.ProviderName}))).filter((function(e,t){return n.indexOf(e)===t})))[0],2===i.length?r=this.__buildTwoOrderingProvidersString(o,i[1],t):i.length>2?r=this.__buildTwoPlusOrderingProvidersString(o,i.length-1,t):$$WPUtil.IsNullOrEmpty(o)||(r=this.__buildOrderingProviderString(o,t)),r},_buildOneClickSlots:function _buildOneClickSlots(e){var i,o,r,n,l,s;if(e.Slots=e.getOneClickSlots(),e.Slots.length>0){for(s=t.allowProviderSelect(t.WorkflowTypesEnum.Ticket,"",e.TicketInfo.VisitType),e.AllowProviderSelect=s,e.SlotGroups=[],i=null,o=0;o<e.Slots.length;o++)r=e.Slots[o],s&&(n=e.SchedulingDataPool.Providers.getFromIndex("ID",r.ProviderId)),l=e.SchedulingDataPool.Departments.getFromIndex("ID",r.DepartmentId),($$WPUtil.IsNullOrEmpty(i)||r.ProviderId!==i.ProviderId||r.DepartmentId!==i.DepartmentId||r.Dte!==i.Dte)&&(i={ProviderId:r.ProviderId,Provider:n,DepartmentId:r.DepartmentId,Department:l,Dte:r.Dte,DateString:r.DateString,Slots:[]},e.SlotGroups.push(i)),i.Slots.push(r);e.HasOneClickSlots=!0}},_onRemoveFavoriteButtonClicked:function _onRemoveFavoriteButtonClicked(e){var t;t=$afe.jq(e.target).closest("[data-model-id]").safeAttr("data-model-id"),this._promptToRemoveFavorite(t)},_onRemoveFavoriteButtonKeyPress:function _onRemoveFavoriteButtonKeyPress(e){var t;" "!==e.key&&"Enter"!==event.key||(t=$afe.jq(e.target).closest("[data-model-id]").safeAttr("data-model-id"),this._promptToRemoveFavorite(t))},_promptToRemoveFavorite:function _promptToRemoveFavorite(e){var t,i;t=$$WPUtil.createRemoveGoBackButtons(),i=[e],$$WPUtil.quickMessageBox($$WP.Strings.get("RemoveSchedulingFavoriteConfirmation","Scheduling"),$$WP.Strings.get("RemoveSchedulingFavoritePopupTitle","Scheduling"),t,this._onRemoveFavoritePopupButtonClicked,i)},_onRemoveFavoritePopupButtonClicked:function _onRemoveFavoritePopupButtonclicked(t,i){var o;"toolbarcontinue"===i&&(o=e.getInstance(t),this._onRemoveFavorite(o.FavoriteAppointmentInfo.Csn))},_removeFavoriteFromDatabase:function _removeFavoriteFromDatabase(e){$.post({url:makeLink("api/Scheduling/RemoveFavoriteAppointment"),data:{csn:e}})},_onDeclineTicketButtonClicked:function _onDeclineTicketButtonClicked(t){var i,o,r;i=$afe.jq(t.target).closest("[data-workflow-model-id]").safeAttr("data-workflow-model-id"),r=(o=e.getInstance(i)).TicketInfo.TicketId,o.TicketInfo.AppointmentRequests.length>0&&(r=o.TicketInfo.AppointmentRequests[0].ID),this._onDeclineTicket(r)},_onDeclineTicket:function _onDeclineTicket(e){var i="app/scheduling/decline-appointment?ticketId="+e+"&isGuest="+(this._workflows.getFromIndex("Type",t.WorkflowTypesEnum.Ticket)[0].IsGuest?1:0)+"&fromScheduling=1";this._isMobile&&(i="epichttp://"+i),$$WPUtil.TryRedirect(makeLink(i))},_buildProviderArray:function _buildProviderArray(){var e,t,i,o=[];for(t=(e=this._providerWorkflow.SchedulingDataPool.ReasonsForVisit.Models).length,i=0;i<t;i++)this._addProvidersFromReasonForVisit(e[i],o);return o=(o=this.filterByAllowedIds(o,"ID")).sort($$WP.Scheduling.Provider.sortProvidersByListDisplayName)},_addProvidersFromReasonForVisit:function _addProvidersFromReasonForVisit(e,i){var o,r,n=[],l=null;if(t.isReasonForVisitAvailableProviderFirst(e))for(o=(n=e.AllProviderDepartmentPairs).length,r=0;r<o;r++)(l=n[r].Provider).IsStandardProvider&&-1===i.indexOf(l)&&i.push(l)},_getUnfilteredReasonsForVisit:function _getUnfilteredReasonsForVisit(){var e=this._reasonWorkflow.SchedulingDataPool.ReasonsForVisit.Models;return $$WP.Scheduling.Workflow.buildReasonsForVisitNoFiltering(e,!0,!0)}},n.LandingPageDataTypesEnum=r,$$WP.Scheduling.LandingPageController=n,n.extend($$WP.Scheduling.StepController,"WP$Scheduling$LandingPageController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$CombinedWorkflowSelectionStepController(e){$$WP.Debug.UnitTest.assert}));;
!function definition(){var WorkflowController=function(t,e,n,o){this.WP$Controllers$Controller(),this.$root=t,this._stepControllers=[],this._stepMapById={},this.proxify("showPrevStep","startover","__onViewEventTriggered"),!0===e&&(this._promptUnsavedChanges=!1),this._workflow=n||{},this.__onBeforeUnloadChanged=o};WorkflowController.prototype={$root:null,_stepControllers:null,_stepMapById:null,_currentStep:0,_continueButton:null,_cancelButton:null,_promptUnsavedChanges:!0,_workflow:null,__onBeforeUnloadChanged:null,showStep:function showStep(t){void 0!==this._stepMapById[t]&&this._stepMapById[t]!==this._currentStep&&this._showStepInArray(this._stepMapById[t])},_showStepInArray:function _showStepInArray(t){var e;t<this._stepControllers.length&&(this.deactivateStep(this._stepControllers[this._currentStep]),this._currentStep=t,this.activateStep(this._stepControllers[t])),this._continueButton&&(this.isComplete(this._stepControllers[this._currentStep].Id)?(this.$root.addClass("hasFloatingNavigation"),this._continueButton.css("display","inline-block").removeClass("hidden")):(this._continueButton.addClass("hidden"),this.$root.removeClass("hasFloatingNavigation"),this._stepControllers[t].getSchedulingContinueBanner().removeClass("stickybanner"))),(e=$afe.select("#workflow-help"))&&t>0&&e.slideUp(300)},showNextStep:function showNextStep(t){this._currentStep<this._stepControllers.length&&(this._showStepInArray(this._currentStep+1),t&&(t.stopPropagation(),t.preventDefault()))},showPrevStep:function showPrevStep(t){this._currentStep>0&&(this._showStepInArray(this._currentStep-1),t&&(t.stopPropagation(),t.preventDefault()))},getStep:function getStep(t){return this._stepControllers[t]},getCurrentStep:function getCurrentStep(){return this.getStep(this._currentStep)},deactivateRange:function deactivateRange(t){var e=0,n=this._stepMapById[t];for(e=n+1;e<this._stepControllers.length;e++)this.deactivateStep(this._stepControllers[e],!0);this._currentStep>n&&(this._currentStep=n)},activateAllSteps:function activateAllSteps(){this.activateRange(0,this._stepControllers.length-1)},activateUpToCurrentStep:function activateUpToCurrentStep(){this.activateRange(0,this._currentStep)},activateRange:function activateRange(t,e){var n=0;for(n=t;n<=e;n++)this.activateStep(this._stepControllers[n])},hookupNavigationButtons:function hookupNavigationButtons(t,e,n,o){this._continueButton=t,this._cancelButton=e,t&&"function"==typeof n&&this._continueButton.click(n),e&&"function"==typeof o&&this._cancelButton.click(o)},startover:function startover(){this.clearBeforeUnload(),$$WPSchedulingUtil.Reload(this._workflow.IsAuthenticatedWidget)},setBeforeUnload:function setBeforeUnload(){this._promptUnsavedChanges&&(this.__onBeforeUnloadChanged?this.__onBeforeUnloadChanged(!0):WP.Events.beforeUnload())},clearBeforeUnload:function clearBeforeUnload(){this._promptUnsavedChanges&&(this.__onBeforeUnloadChanged?this.__onBeforeUnloadChanged(!1):WP.Events.cancelBeforeUnload())},addStep:function addStep(t){this._stepControllers.push(t),this._stepMapById[t.Id]=this._stepControllers.length-1},removeStep:function removeStep(t){t.dispose(),this._stepControllers.splice(this._stepControllers.indexOf(t),1)},render:function render(){this._currentStep=-1,this.showNextStep()},destroy:function destroy(){$$WP.Debug.logError("Virtual method destroy must be overridden")},activateStep:function activateStep(t){$$WP.Debug.logError("Virtual method activateStep must be overridden")},deactivateStep:function deactivateStep(t,e){$$WP.Debug.logError("Virtual method deactivateStep must be overridden")},isComplete:function isComplete(t){$$WP.Debug.logError("Virtual method isComplete must be overridden")},__onViewEventTriggered:function __onViewEventTriggered(t,e,n,o){$$WP.Scheduling.SchedulingController.logSchedulingViewEvent(t,e,n,o,this._workflow)}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.WorkflowController=WorkflowController,WorkflowController.extend($$WP.Controllers.Controller,"WP$Scheduling$WorkflowController")}();;
!function definition(){var e=$$WP.Scheduling.SchedulingStep,t=$$WP.Scheduling.Workflow,VerificationStepController=function(o,n,i,r){var l,s,a;this.WP$Scheduling$WorkflowController(o,!1,n),this.$root.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.VerificationStep,{})),this.proxify("_onStepCompleteChanged","_update"),this.$root=o,this._dataPool=n.SchedulingDataPool,this._stackId=this.Id,this._summarySteps=[],this._stepContainers=[],this._isMobile=$$WP.Utilities.UI.IsMobile,this._isEmbedded=i.IsEmbedded,r=$$WPUtil.IsNullOrEmpty(r)?new $$WP.Scheduling.StepFactory(n,i):r,i.ShowDemographicVerificationStep&&(l=r.createStep(e.StepTypeEnum.Demographics),e.addSchedulingStepToCollection(this._dataPool.SchedulingSteps,l.Id,!0,this._stackId),this._stepContainers.push(l.$root),this.addStep(l),l.addViewEventListener(this.__onViewEventTriggered),this._summarySteps.push({type:"Demographic",Id:l.Id})),i.ShowInsuranceVerificationStep&&i.WorkflowType!==t.WorkflowTypesEnum.OnDemandTelehealth&&(l=r.createStep(e.StepTypeEnum.Insurance),e.addSchedulingStepToCollection(this._dataPool.SchedulingSteps,l.Id,!0,this._stackId),this._stepContainers.push(l.$root),this.addStep(l),l.addViewEventListener(this.__onViewEventTriggered),this._summarySteps.push({type:"Insurance",Id:l.Id})),i.WorkflowType===t.WorkflowTypesEnum.OnDemandTelehealth?(s=e.StepTypeEnum.TelehealthSummary,a="TelehealthSummary"):(s=e.StepTypeEnum.Confirmation,a="Confirmation"),l=r.createStep(s),e.addSchedulingStepToCollection(this._dataPool.SchedulingSteps,l.Id,!0,this._stackId),this._stepContainers.push(l.$root),this.addStep(l),l.addViewEventListener(this.__onViewEventTriggered),this._summarySteps.push({type:a,Id:l.Id}),this._dataPool.AppointmentBuilder.setProperty("IsPersonalInfoCollectionComplete",this._workflow.SchedulingControllerParams.isPersonalInfoCollectionComplete),this._dataPool.AppointmentBuilder.setProperty("HasMatchingRecord",this._workflow.SchedulingControllerParams.hasMatchingRecord),this._dataPool.AppointmentBuilder.setProperty("IsInsuranceCollectionComplete",this._workflow.SchedulingControllerParams.isInsuranceCollectionComplete),this._dataPool.AppointmentBuilder.setProperty("IsPromoted",this._dataPool.AppointmentBuilder.IsPromoted||this._workflow.SchedulingControllerParams.isPromoted),this.__canShowPersonalInfoCollectionStep(n,i)&&(this.reviewStep=l,this.__addPersonalInfoCollectionStep(r,s)),this._dataPool.SchedulingSteps.addPropertyListener("CompleteStatus",this._onStepCompleteChanged),$$WPUtil.FixScrollingForIOS(this.$root)};VerificationStepController.prototype={$root:null,Id:"verification_step",_dataPool:null,_stackId:null,_summarySteps:null,_stepContainers:null,_isMobile:!1,_isEmbedded:!1,show:function show(){this._update(),this.render(),this.$root.parent().css({"min-height":""})},hide:function hide(e){this.$root.hide(),void 0!==e&&this.setComplete(e),this.deactivateRange(this._summarySteps[0].Id,!0)},activateStep:function activateStep(e){e.show(),this._isEmbedded||$$WPSchedulingUtil.ScrollToTopOfPage(),this._dataPool.BlockDemographicInsuranceVerification=!1},deactivateStep:function deactivateStep(e){e&&(e.hide($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.getSchedulingContinueBanner().removeClass("stickybanner"),this.$root.parent().find(".startover").removeClass("fixToTop"))},onWorkflowDestroyed:function WP$Scheduling$VerificationStepController$onWorkflowDestroyed(){var e=0;for(e=0;e<this._stepControllers.length;e++)this._stepControllers[e].onWorkflowDestroyed()},_update:function _update(){this.$root.show(),this.$root.empty().safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.VerificationStep));for(var e=0;e<this._stepContainers.length;e++)this.$root.find(".verificationContent").safeAppend(this._stepContainers[e]);this._isMobile&&($afe.select(".verificationContent .formbuttons").addClass("floatingButtonContainer"),$afe.select(".verificationContent .button").addClass("floating"))},_onStepCompleteChanged:function _onStepCompleteChanged(t){var o,n,i,r;for(o in t)n=t[o].from,i=t[o].to,(r=t[o].model||$$WP.Common.Model.getInstance(o)).IsStacked&&r.StackId===this._stackId&&(n===i||i!==e.CompleteEnum.Complete&&i!==e.CompleteEnum.NotRequired?n!==i&&i===e.CompleteEnum.Incomplete&&this.deactivateRange(r.ID):(this.showNextStep(),this._update()))},hasStickyBanner:function WP$Scheduling$VerificationStepController$hasStickyBanner(){return!1},setCurrentSelectionCountInBanner:function WP$Scheduling$StepController$setCurrentSelectionCountInBanner(){},getSchedulingContinueBanner:function WP$Scheduling$StepController$getSchedulingContinueBanner(){return this.$root.parent().find(".verifyButtons")},getContinueButton:function WP$Scheduling$VerificationStepController$getContinueButton(e){return this.__getCurrentVerificationStepController().getContinueButton(e)},isUsingWorkflowNavigation:function WP$Scheduling$VerificationStepController$isUsingWorkflowNavigation(){return!1},onNavigateBack:function WP$Scheduling$VerificationStepController$onNavigateBack(){},__getCurrentVerificationStepController:function WP$Scheduling$VerificationStepController$__getCurrentVerificationStepController(){var e=this._currentStep;return this._stepControllers[e]},__canShowPersonalInfoCollectionStep:function WP$Scheduling$VerificationStepController$__canShowPersonalInfoCollectionStep(e,o){return!!e.IsGuest&&(!(!e.SchedulingControllerParams||void 0===e.SchedulingControllerParams.isPersonalInfoCollectionComplete||void 0===e.SchedulingControllerParams.isInsuranceCollectionComplete)&&(!!(e.Type===t.WorkflowTypesEnum.DecisionTreeNode||o.WorkflowType===t.WorkflowTypesEnum.OnDemandTelehealth&&e.SchedulingControllerParams.rootDecisionTreeID||e.Type===t.WorkflowTypesEnum.Ticket&&void 0!==e.decisionTreeNodeID)&&(!e.SchedulingControllerParams.isPersonalInfoCollectionComplete||!e.SchedulingControllerParams.isInsuranceCollectionComplete)))},__addPersonalInfoCollectionStep:function WP$Scheduling$VerificationStepController$__addPersonalInfoCollectionStep(t,o){var n=t.createStep(e.StepTypeEnum.PersonalInfoCollection);o===e.StepTypeEnum.TelehealthSummary?n.setSchedulingCallbacks(this.reviewStep._kickoffLogin):(this.reviewStep.storeSelfTriageSessionSuccessCallback=t.__workflowEventCallbacks.storeSelfTriageSessionSuccessCallback,n.setSchedulingCallbacks($.proxy(this.personalInformationLoginCallback,this.reviewStep),$.proxy(this.reviewStep.__schedulePostlogin,this.reviewStep),$.proxy(this.reviewStep.__schedulePostSelfTriageReconciliation,this.reviewStep))),e.addSchedulingStepToCollection(this._dataPool.SchedulingSteps,n.Id,!0,this._stackId),this._stepContainers.push(n.$root),this.addStep(n),n.addViewEventListener(this.__onViewEventTriggered),this._summarySteps.push({type:"PersonalInfo",Id:n.Id})},personalInformationLoginCallback:function personalInformationLoginCallback(){var e=this.__getAjaxParameters(!0);$.ajax({url:makeLink("SymptomChecker/SelfTriage/StoreSelfTriageSession"),type:"POST",data:$$WPUtil.postify({session:{TreeID:this._workflow.SchedulingControllerParams.rootDecisionTreeID,AnswerID:this._workflow.SchedulingControllerParams.decisionTreeAnswerID,InProgressActionNodeID:this._workflow.SchedulingControllerParams.decisionTreeNodeID,SchedulingWorkflow:e.workflow,AppointmentBuilder:e.appointmentBuilder,FromList:this._workflow.SchedulingControllerParams.FromList}}),success:this.storeSelfTriageSessionSuccessCallback})}},$$WP.Scheduling.VerificationStepController=VerificationStepController,VerificationStepController.extend($$WP.Scheduling.WorkflowController,"WP$Scheduling$VerificationStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$ConfirmationStepController(e){$$WP.Debug.UnitTest.assert}));;
!function definition(){var e=function StackedStepController(e,t,o,l,n,r){this.WP$Scheduling$StepController(e,o.SchedulingDataPool,null,null,null,$$WP.Templates.Scheduling.StackedStep,$$WP.Templates.Scheduling.StackedStep,!0),this.proxify("_onStepCompleteChanged"),this.stackId=this.Id,this._dataPool=o.SchedulingDataPool,this._stackedWorkflowController=new $$WP.Scheduling.StackedWorkflowController(e,t,o,l,n,this.stackId,r),this._dataPool.SchedulingSteps.addPropertyListener("CompleteStatus",this._onStepCompleteChanged)};e.prototype={_stackedWorkflowController:null,stackId:null,_dataPool:null,_isComplete:!1,updateViewModel:function updateViewModel(){this.ViewModel={Count:1,StepShouldBeActive:!0}},beforeFirstRender:function beforeFirstRender(){this._stackedWorkflowController.render(),this._stackedWorkflowController.showNextIncompleteStep(),(this._isComplete||this._dataPool.SchedulingSteps.getFromIndex("ID",this.Id).CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)&&(this.Active=!1)},_onStepCompleteChanged:function _onStepCompleteChanged(e){var t,o,l,n,r;for(l in n=0,r=0,e)if((e[l].model||$$WP.Common.Model.getInstance(l)).StackId===this.stackId&&e[l].to!==e[l].from){for(t=this._dataPool.SchedulingSteps.getFromIndex("StackId",this.stackId),o=0;o<t.length;o++)if(t[o].CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)n++;else if(t[o].CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)r++;else if(t[o].CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)return this._isComplete=!1,void this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete);n>0?(this._isComplete=!0,this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Complete)):r===t.length&&this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired)}},afterRender:function afterRender(){var e=this._dataPool.SchedulingSteps.getFromIndex("ID",this.Id);this._dataPool.SchedulingSteps.openChangeBatch(),this._stackedWorkflowController.activateStack(),this._dataPool.SchedulingSteps.closeChangeBatch(),e.CompleteStatus!==$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired||e.ForceShowOnce||(this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete),this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired))},onNavigateBack:function onNavigateBack(){var e=0;for(e=0;e<this._stackedWorkflowController._stepControllers.length;e++)this._stackedWorkflowController._stepControllers[e].onNavigateBack()},beforeNavigateBack:function beforeNavigateBack(){var e=0;for(e=0;e<this._stackedWorkflowController._stepControllers.length;e++)this._stackedWorkflowController._stepControllers[e].beforeNavigateBack()},shouldRemainOnStep:function shouldRemainOnStep(){var e=0;for(e=0;e<this._stackedWorkflowController._stepControllers.length;e++)if(this._stackedWorkflowController._stepControllers[e].shouldRemainOnStep())return!0;return!1},setCurrentSelectionCountInBanner:function setCurrentSelectionCountInBanner(){if(this.hasStickyBanner()){var e=0,t=null;for(e=0;e<this._stackedWorkflowController._stepControllers.length;e++)if((t=this._stackedWorkflowController._stepControllers[e]).hasStickyBanner())return void t.setCurrentSelectionCountInBanner()}},hasStickyBanner:function hasStickyBanner(){var e=0;for(e=0;e<this._stackedWorkflowController._stepControllers.length;e++)if(this._stackedWorkflowController._stepControllers[e].hasStickyBanner())return!0;return!1},getContinueButton:function WP$Scheduling$StackedStepController$getContinueButton(e){return this.__getCurrentChildStepController().getContinueButton(e)},isUsingWorkflowNavigation:function WP$Scheduling$StackedStepController$isUsingWorkflowNavigation(){return this.__getCurrentChildStepController().isUsingWorkflowNavigation()},__getCurrentChildStepController:function WP$Scheduling$StackedStepController$__getCurrentChildStepController(){var e=this._stackedWorkflowController._currentStep;return this._stackedWorkflowController._stepControllers[e]},hide:function WP$Scheduling$StackedStepController$__hide(e){var t=0;for(t=0;t<this._stackedWorkflowController._stepControllers.length;t++)this._stackedWorkflowController._stepControllers[t].hide(e);this.WP$Scheduling$StepController$hide(e)},onWorkflowDestroyed:function WP$Scheduling$StackedStepController$onWorkflowDestroyed(){var e=0;for(e=0;e<this._stackedWorkflowController._stepControllers.length;e++)this._stackedWorkflowController._stepControllers[e].onWorkflowDestroyed()}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.StackedStepController=e,e.extend($$WP.Scheduling.StepController,"WP$Scheduling$StackedStepController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$StackedStepController(e){$$WP.Debug.UnitTest.assert}));;
!function definition(){var t=function WP$Scheduling$MultiAppointmentStepController(t,e,n,o,i){this.WP$Scheduling$StackedStepController(t,[e],n,o,$$WP.Scheduling.StackedWorkflowController.ModesEnum.ShowAllAtOnce,i),this.__stepDefinition=e,this.proxify("__onAppointmentsChanged"),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("add",this.__onAppointmentsChanged),this.Data.AppointmentBuilder.Appointments.addCollectionEventListener("remove",this.__onAppointmentsChanged)};t.prototype={__stepDefinition:null,__onAppointmentsChanged:function _onAppointmentsChanged(){var t=0,e=null;for(this.__resetSteps(),t=0;t<this.Data.AppointmentBuilder.numAppointments();t++)e=this.Data.AppointmentBuilder.getAppointment(t),this._stackedWorkflowController.createStepAndAddToDom(this.__stepDefinition).linkAppointment(e);this.setComplete($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},__resetSteps:function __resetSteps(){var t,e=0,n=null;if((t=this._stackedWorkflowController._stepControllers).length>0){for(e=t.length-1;e>=0;e--)n=t[e],this._stackedWorkflowController.destroyStepAndRemoveFromDom(n);this._stackedWorkflowController._currentStep=0}}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.MultiAppointmentStepController=t,t.extend($$WP.Scheduling.StackedStepController,"WP$Scheduling$MultiAppointmentStepController")}();;
!function definition(){var e=$$WP.Scheduling.SchedulingStep.StepTypeEnum,t=$$WP.Scheduling.Workflow,o=$$WP.Scheduling.ProviderStepController,i=$$WP.Scheduling.LocationStepController,n=$$WP.Scheduling.SpecialtyStepController,s=$$WP.Scheduling.SlotStepController,r=$$WP.Scheduling.LqfStepController,l=$$WP.Scheduling.StackedStepController,a=$$WP.Scheduling.CustomStepController,w=$$WP.Scheduling.DemographicVerificationStepController,S=$$WP.Scheduling.InsuranceVerificationStepController,h=$$WP.Scheduling.JoinWaitListStepController,c=$$WP.Scheduling.ConfirmationStepController,f=$$WP.Scheduling.RequestStepController,_=$$WP.Scheduling.VerificationStepController,d=$$WP.Scheduling.ReasonForVisitStepController,g=$$WP.Scheduling.ProviderReasonForVisitStepController,k=$$WP.Scheduling.OnDemandTelehealth.QuickScheduleStepController,u=$$WP.Scheduling.OnDemandTelehealth.PatientLocationStepController,p=$$WP.Scheduling.OnDemandTelehealth.OrganizationStepController,P=$$WP.Scheduling.OnDemandTelehealth.OrganizationAuthStepController,m=$$WP.Scheduling.OnDemandTelehealth.PlatformStepController,C=$$WP.Scheduling.OnDemandTelehealth.SummaryStepController,D=$$WP.Scheduling.PersonalInfoCollectionStepController,E=function StepFactory(e,t,o,i){this._workflow=e,this._workflowSettings=t,this.__workflowEventCallbacks=o,this.__disableUTF8=i};E.prototype={_workflow:null,_workflowSettings:null,__workflowEventCallbacks:null,__disableUTF8:!1,createStep:function createStep(t,o){var i;switch(t){case e.Provider:i=this._getProviderStep();break;case e.Location:i=this._getLocationStep();break;case e.Slot:i=this._getSlotStep();break;case e.JoinWaitList:i=this._getJoinWaitListStep();break;case e.Reservation:i=this._getReservationStep();break;case e.ReasonForVisit:i=this._getReasonForVisitStep();break;case e.StandardLqf:i=this._getStandardLqfStep();break;case e.Stacked:i=this._getStackedStep(o);break;case e.DepartmentLqf:i=this._getDepartmentLqfStep();break;case e.Custom:i=this._getCustomStep();break;case e.CustomLanding:i=this._getCustomLandingStep();break;case e.Demographics:i=this._getDemographicStep();break;case e.Insurance:i=this._getInsuranceStep();break;case e.Confirmation:i=this._getConfirmationStep();break;case e.Request:i=this._getRequestStep();break;case e.QuickSchedule:i=this._getQuickScheduleStep();break;case e.Verification:i=this._getVerificationStep();break;case e.TelehealthLocation:i=this._getPatientLocationStep();break;case e.TelehealthSummary:i=this._getTelehealthSummaryStep();break;case e.TelehealthOrganization:i=this._getTelehealthOrganizationStep();break;case e.TelehealthAuth:i=this._getTelehealthAuthStep();break;case e.PlatformStep:i=this._getTelehealthPlatformStep();break;case e.MultiAppointment:i=this._getMultiAppointmentStep(o[0]);break;case e.Onboarding:i=this._getOnboardingStep();break;case e.Specialty:i=this._getSpecialtyStep();break;case e.PersonalInfoCollection:i=this._getPersonalInfoCollectionStep()}return i},_getTelehealthSummaryStep:function _getTelehealthSummaryStep(){return new C(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings,this.__workflowEventCallbacks.onSchedulingComplete,this._workflow.IsAnonymous,this._workflow.IsGuest,this._workflow.AnonymousSettings,this.__workflowEventCallbacks.onStopScheduling)},_getPatientLocationStep:function _getPatientLocationStep(){return new u(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflow.IsAnonymous,this._workflow)},_getVerificationStep:function _getVerificationStep(){return new _(this._createStepContainer(),this._workflow,this._workflowSettings,this)},_getTelehealthOrganizationStep:function _getTelehealthOrganizationStep(){return new p(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings)},_getTelehealthAuthStep:function _getTelehealthAuthStep(){return new P(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings)},_getTelehealthPlatformStep:function _getTelehealthPlatformStep(){return new m(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflow.IsAnonymous)},_getQuickScheduleStep:function _getQuickScheduleStep(){return new k(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedProviderIds,this._workflowSettings.PreselectedProviderIds,this._workflowSettings.QuickScheduleStepSettings,this._workflowSettings.RequireECheckInForTelemedicine,this._workflowSettings,this._workflow.IsAnonymous,this._workflow.IsGuest)},_getRequestStep:function _getRequestStep(){return new f(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings,this.__workflowEventCallbacks.onRequestComplete,this.__workflowEventCallbacks.onError,this._workflowSettings.IsLoginEnabled,this._workflowSettings.DisableScheduleAsGuest,this._workflowSettings.IsDemoMode,this._workflowSettings.RequestReasons)},_getConfirmationStep:function _getConfirmationStep(){switch(this._workflow.Type){case t.WorkflowTypesEnum.Reschedule:return new c(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this.__workflowEventCallbacks.onSchedulingComplete,this.__workflowEventCallbacks.onError,this._workflowSettings.RescheduleReasons,this._workflowSettings.RequireRescheduleReason,this._workflowSettings.DisableFavoriteAppointments||this._workflow.IsFavorite,!0,"",this._workflowSettings.DisableScheduleAsGuest,this._workflowSettings.DepartmentStepSettings.Hide,this._workflowSettings.IsDemoMode);case t.WorkflowTypesEnum.NewProvider:case t.WorkflowTypesEnum.ProviderFinder:case t.WorkflowTypesEnum.Widget:return new c(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this.__workflowEventCallbacks.onSchedulingComplete,this.__workflowEventCallbacks.onError,null,!1,this._workflowSettings.DisableFavoriteAppointments||this._workflow.IsFavorite,!1,this._workflowSettings.IsLoginEnabled,this._workflowSettings.DisableScheduleAsGuest,this._workflowSettings.DepartmentStepSettings.Hide,this._workflowSettings.IsDemoMode,this._workflowSettings.RequestReasons);default:return new c(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this.__workflowEventCallbacks.onSchedulingComplete,this.__workflowEventCallbacks.onError,null,!1,this._workflowSettings.DisableFavoriteAppointments||this._workflow.IsFavorite,!1,this._workflowSettings.IsLoginEnabled,!1,this._workflowSettings.DepartmentStepSettings.Hide,this._workflowSettings.IsDemoMode,this._workflowSettings.RequestReasons)}},_getInsuranceStep:function _getInsuranceStep(){return new S(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.ShowInsuranceVerificationStep,this._workflowSettings.IsAlwaysSelfPay,this._workflowSettings)},_getDemographicStep:function _getDemographicStep(){return new w(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.ShowDemographicVerificationStep,this.__disableUTF8)},_getPersonalInfoCollectionStep:function _getPersonalInfoCollectionStep(){return new D(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this.__workflowEventCallbacks.onStopScheduling,this.__workflowEventCallbacks,this._workflowSettings)},_getCustomStep:function _getCustomStep(){return this._workflow.Type,t.WorkflowTypesEnum.Reschedule,new a(this._createStepContainer(),this._workflow.SchedulingDataPool,!1)},_getCustomLandingStep:function _getCustomLandingStep(){switch(this._workflow.Type){case t.WorkflowTypesEnum.ProviderFinder:case t.WorkflowTypesEnum.Widget:return new a(this._createStepContainer(),this._workflow.SchedulingDataPool,!0,this._workflowSettings.StringKey);default:return new a(this._createStepContainer(),this._workflow.SchedulingDataPool,!0)}},_getMultiAppointmentStep:function _getMultiAppointmentStep(e){return new $$WP.Scheduling.MultiAppointmentStepController(this._createStepContainer(),e,this._workflow,this._workflowSettings,this.__workflowEventCallbacks)},_getOnboardingStep:function _getOnboardingStep(){return new $$WP.Scheduling.OnboardingStepController(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflow,this._workflowSettings.HasPatientLocationRule)},_getStackedStep:function _getStackedStep(e){return new l(this._createStepContainer(),e,this._workflow,this._workflowSettings,$$WP.Scheduling.StackedWorkflowController.ModesEnum.ShowOneAtATime,this.__workflowEventCallbacks)},_getStandardLqfStep:function _getStandardLqfStep(){return new r(this._createStepContainer(),this._workflow.SchedulingDataPool,r.ModesEnum.Standard,this.__workflowEventCallbacks.onStopScheduling,this._workflow,this._workflowSettings.AllowedProviderIds,this._workflowSettings.HasPatientLocationRule)},_getDepartmentLqfStep:function _getDepartmentLqfStep(){return new r(this._createStepContainer(),this._workflow.SchedulingDataPool,r.ModesEnum.DepartmentOverride,this.__workflowEventCallbacks.onStopScheduling,this._workflow,this._workflowSettings.AllowedProviderIds,this._workflowSettings.HasPatientLocationRule)},_getReasonForVisitStep:function _getReasonForVisitStep(){switch(this._workflow.Type){case t.WorkflowTypesEnum.ExistingProvider:return new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.FilterOnSelectedProviders,this.__workflowEventCallbacks.onStopScheduling,null,null,null,this._workflow,this._workflowSettings.HasPatientLocationRule);case t.WorkflowTypesEnum.NewProvider:return new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.FilterOnSelectedSpecialty,this.__workflowEventCallbacks.onStopScheduling,!1,!0,this._workflow.IsAnonymous,this._workflow,this._workflowSettings.HasPatientLocationRule);case t.WorkflowTypesEnum.Request:return new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.Request,this.__workflowEventCallbacks.onStopScheduling,null,null,null,this._workflow,this._workflowSettings.HasPatientLocationRule);case t.WorkflowTypesEnum.OnDemandTelehealth:return new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.OnDemandTelehealth,this.__workflowEventCallbacks.onStopScheduling,this._workflowSettings.IsEmbedded&&(!this._workflow.IsAnonymous||!!this._workflow.SchedulingControllerParams.rootDecisionTreeID),!1,this._workflow.IsAnonymous,this._workflow,!1);case t.WorkflowTypesEnum.ProviderFinder:return this._workflowSettings.ReasonForVisitStepSettings.HideIfPreselected=!0,!$$WPUtil.IsNullOrEmpty(this._workflowSettings.PreselectedSlotUID)&&$$WPUtil.IsNullOrEmpty(this._workflowSettings.PreselectedReasonForVisitIds)&&(this._workflowSettings.PreselectedReasonForVisitIds=[this.__findRfvForSlotUid(this._workflowSettings.PreselectedSlotUID,this._workflow.SchedulingDataPool.ReasonsForVisit.toArray())]),this.__isExpectedPatientTypeSet(this._workflow.SchedulingDataPool.ReasonsForVisit)?new g(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,parseInt(this._workflowSettings.PreselectedPatientType,10),this._workflowSettings.ReasonForVisitStepSettings,this.__workflowEventCallbacks.onStopScheduling,this._workflow.IsAnonymous,this._workflow,this._workflowSettings.AllowedProviderIds,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.AllowMobileSchedulingInlineRedirects):(this._workflowSettings.ReasonForVisitStepSettings.HideIfOne=!0,new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.NoFiltering,this.__workflowEventCallbacks.onStopScheduling,!1,!0,this._workflow.IsAnonymous,this._workflow));case t.WorkflowTypesEnum.Widget:return this._workflowSettings.ReasonForVisitStepSettings.HideIfOne=!0,new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.NoFiltering,this.__workflowEventCallbacks.onStopScheduling,!1,!0,this._workflow.IsAnonymous,this._workflow,this._workflowSettings.HasPatientLocationRule);default:return new d(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedReasonForVisitIds,this._workflowSettings.PreselectedReasonForVisitIds,this._workflowSettings.ReasonForVisitStepSettings,d.ModesEnum.NoFiltering,this.__workflowEventCallbacks.onStopScheduling,null,null,null,this._workflow,this._workflowSettings.HasPatientLocationRule)}},__findRfvForSlotUid:function __findRfvForSlotUid(e,t){for(var o=null,i=$$WP.Scheduling.Solution.createSolutionFromUid(e).Slots[0].VisitTypeId,n=0;n<t.length;n++)if((o=t[n]).DefaultVisitTypeId===i)return o.Id;return""},__isExpectedPatientTypeSet:function __isExpectedPatientTypeSet(e){for(var t=e.toArray(),o=$$WP.Scheduling.ReasonForVisit.PatientTypeEnum.Unknown,i=0;i<t.length;i++)if((o=t[i].ExpectedPatientType)===$$WP.Scheduling.ReasonForVisit.PatientTypeEnum.NewPatient||o===$$WP.Scheduling.ReasonForVisit.PatientTypeEnum.EstablishedPatient)return!0;return!1},_getReservationStep:function _getReservationStep(){return new $$WP.Scheduling.ReservationStepController(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.IsReservationAllowed,this.__workflowEventCallbacks.onStopScheduling)},_getSlotStep:function _getSlotStep(){var e;(e={FromMinutesOffset:this._workflowSettings.FromMinutesOffset,FromDaysOffset:this._workflowSettings.FromDaysOffset,ToDaysOffset:this._workflowSettings.ToDaysOffset,StartDate:this._workflowSettings.StartDate,EndDate:this._workflowSettings.EndDate,DateRangeSettings:this._workflowSettings.DateRangeSettings,TimePreferences:this._workflowSettings.TimePreferences,UseOnFileTimePreferences:this._workflowSettings.UseOnFileTimePreferences,ShowTeamBeforeSearch:this._workflowSettings.ShowTeamBeforeSearch,AllowTeamScheduling:this._workflowSettings.AllowTeamScheduling,OnFileSchedulePreferences:this._workflowSettings.SchedulePreferences,DaysOfWeekList:this._workflowSettings.DaysOfWeekList,GeolocationDistanceUnits:this._workflowSettings.GeolocationDistanceUnits,MaxOpenSchedulingApptCount:this._workflowSettings.MaxOpenSchedulingApptCount,CurrentDTE:this._workflowSettings.CurrentDTE,FallbackSchedulingPhone:this._workflowSettings.FallbackSchedulingPhone,DefaultProviderLanguages:this._workflowSettings.DefaultProviderLanguages,IsSortingByAvailability:this._workflowSettings.IsSortingByAvailability,WidgetStringKey:this._workflowSettings.StringKey,AllowedProviderIds:this._workflowSettings.AllowedProviderIds,AllowedDepartmentIds:this._workflowSettings.AllowedDepartmentIds,PreselectedProviderIds:this._workflowSettings.PreselectedProviderIds,IsProviderStepHiddenByQueryParams:this._workflowSettings.ProviderStepSettings.Hide,IsDepartmentStepHiddenByQueryParams:this._workflowSettings.DepartmentStepSettings.Hide,IsPatientLocationStepRequiredBySetting:this._workflowSettings.IsPatientLocationStepRequired,LocationGroupingBehavior:this._workflowSettings.LocationGroupingBehavior,EmbeddedConsecutiveSlotLoadLimit:this._workflowSettings.EmbeddedConsecutiveSlotLoadLimit,Csn:this._workflowSettings.Csn}).DateRangeSettings=e.DateRangeSettings||{ReadOnly:!1,NoIncremental:!1,NoMinimum:!1};var o=null;switch(this._workflow.Type){case t.WorkflowTypesEnum.Ticket:e.FromDte=this._workflow.TicketInfo.FromDte,e.ToDte=this._workflow.TicketInfo.ToDte,e.BundleId=this._workflow.TicketInfo.BundleId,e.ExpirationDte=this._workflow.TicketInfo.ExpirationDte;break;case t.WorkflowTypesEnum.Request:o=s.ModesEnum.RequestOnly;break;case t.WorkflowTypesEnum.Reschedule:e.FromDte=this._workflow.OriginalAppointmentInfo.FromDte,e.ToDte=this._workflow.OriginalAppointmentInfo.ToDte,e.OriginalAppointmentInfo=this._workflow.OriginalAppointmentInfo;break;case t.WorkflowTypesEnum.NewProvider:case t.WorkflowTypesEnum.ProviderFinder:case t.WorkflowTypesEnum.Widget:case t.WorkflowTypesEnum.SimpleWidget:e.NewProvFromDaysOffset=this._workflowSettings.NewProvFromDaysOffset,e.NewProvToDaysOffset=this._workflowSettings.NewProvToDaysOffset}return new s(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,e,o,this.__workflowEventCallbacks,this._workflowSettings.PreselectedSlotUID,this._workflowSettings.PreselectedFilters,this._workflowSettings.AvailableFilters)},_getLocationStep:function _getLocationStep(){var e={GeolocationNumLocationsToSelect:this._workflowSettings.GeolocationNumLocationsToSelect,GeolocationInnerRadius:this._workflowSettings.GeolocationInnerRadius,GeolocationOuterRadius:this._workflowSettings.GeolocationOuterRadius,GeolocationDistanceUnits:this._workflowSettings.GeolocationDistanceUnits,GeolocationStreetAddress:this._workflowSettings.GeolocationStreetAddress},o={};switch($.extend(o,this._workflowSettings.DepartmentStepSettings),this._workflow.Type){case t.WorkflowTypesEnum.Reschedule:return o.HideIfOne=!0,new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.PreselectedDepartmentIds,o,i.ModesEnum.FilterOnSelectedReasonForVisit,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,null,e,this._workflow.OriginalAppointmentInfo);case t.WorkflowTypesEnum.DecisionTreeNode:case t.WorkflowTypesEnum.Ticket:return new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.PreselectedDepartmentIds,o,i.ModesEnum.FilterOnSelectedReasonForVisit,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,null,e,null);case t.WorkflowTypesEnum.Request:return new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.PreselectedDepartmentIds,o,i.ModesEnum.Request,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,null,e,null);case t.WorkflowTypesEnum.NewProvider:return new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.PreselectedDepartmentIds,o,i.ModesEnum.FilterOnSelectedSpecialtyAndReasonForVisit,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,this._workflow.IsFavorite,e,null);case t.WorkflowTypesEnum.Procedure:return new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.PreselectedDepartmentIds,o,i.ModesEnum.FilterOnSelectedReasonForVisit,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,this._workflow.IsFavorite,e,null);case t.WorkflowTypesEnum.ProviderFinder:case t.WorkflowTypesEnum.Widget:return o.Hide=!0,o.PreselectAllModels=!0,new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,[],this._workflowSettings.PreselectedDepartmentIds,o,i.ModesEnum.FilterOnSelectedReasonForVisit,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,this._workflow.IsFavorite,e,null);default:return new i(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings.AllowedDepartmentIds,this._workflowSettings.PreselectedDepartmentIds,o,null,this._workflowSettings.LocationGroupingBehavior,this.__workflowEventCallbacks.onStopScheduling,this._workflow.IsFavorite,e,null)}},_getProviderStep:function _getProviderStep(){var e={};$.extend(e,this._workflowSettings.ProviderStepSettings);var i=o.ModesEnum.NoFiltering,n=o.ProvidersToUseEnum.Standard;switch(this._workflow.Type){case t.WorkflowTypesEnum.ProviderFinder:case t.WorkflowTypesEnum.Widget:e.Hide=!0,e.PreselectAllModels=!0,i=o.ModesEnum.FilterOnSelectedReasonForVisitAndLocation;break;case t.WorkflowTypesEnum.Procedure:e.Hide=this._workflowSettings.ProviderStepSettings.Hide,e.PreselectAllModels=!1,i=o.ModesEnum.FilterOnSelectedReasonForVisitAndLocation;break;case t.WorkflowTypesEnum.NewProvider:e.Hide=!0,e.PreselectAllModels=!0,i=o.ModesEnum.FilterOnSelectedReasonForVisitAndLocation;break;case t.WorkflowTypesEnum.ExistingProvider:n=o.ProvidersToUseEnum.Standard;break;case t.WorkflowTypesEnum.Ticket:e={ReadOnly:this._workflowSettings.ProviderStepSettings.ReadOnly,Collapse:this._workflowSettings.ProviderStepSettings.Collapse,CollapseIfOne:this._workflowSettings.ProviderStepSettings.CollapseIfOne,PreselectAllModels:!0,Hide:!0},i=o.ModesEnum.FilterOnSelectedLocation,n=o.ProvidersToUseEnum.All;break;case t.WorkflowTypesEnum.DecisionTreeNode:e={ReadOnly:this._workflowSettings.ProviderStepSettings.ReadOnly,Collapse:this._workflowSettings.ProviderStepSettings.Collapse,CollapseIfOne:this._workflowSettings.ProviderStepSettings.CollapseIfOne,Hide:!0,PreselectAllModels:!0},i=o.ModesEnum.FilterOnSelectedReasonForVisitAndLocation,n=o.ProvidersToUseEnum.All;break;case t.WorkflowTypesEnum.Request:i=o.ModesEnum.Request;break;case t.WorkflowTypesEnum.Reschedule:e.Hide=!0,e.HideIfOne=!0,e.PreselectAllModels=!0,i=o.ModesEnum.FilterOnSelectedReasonForVisitAndLocation,n=o.ProvidersToUseEnum.All,i=o.ModesEnum.FilterOnSelectedLocation,e.OriginalAppointmentInfo=this._workflow.OriginalAppointmentInfo;break;default:n=o.ProvidersToUseEnum.All}return new o(this._createStepContainer(),this._workflow.SchedulingDataPool,this._workflowSettings.AllowedProviderIds,this._workflowSettings.PreselectedProviderIds,e,i,n,this._workflow,this.__workflowEventCallbacks.onStopScheduling,this._workflow)},_getSpecialtyStep:function _getSpecialtyStep(){return new n(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,n.ModesEnum.NoFiltering,this._workflowSettings.AllowedSpecialtyIds,this._workflowSettings.PreselectedSpecialtyId,this._workflowSettings.SpecialtyStepSettings,!0)},_getJoinWaitListStep:function _getJoinWaitListStep(){return new h(this._createStepContainer(),this._workflow,this._workflow.SchedulingDataPool,this._workflowSettings,this.__workflowEventCallbacks.onTicketWaitListPreferencesUpdated)},_createStepContainer:function _createStepContainer(){return $$WP.SimpleTemplates.Div({class:"jqHidden stepcontainer"})}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.StepFactory=E,E.extend($$WP.Controllers.Controller,"WP$Scheduling$StepFactory")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SchedulingWorkflowController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SchedulingWorkflowController$definition(){var e=$$WP.Scheduling.SchedulingStep,t=$$WP.Scheduling.SidebarController,i=function WP$Scheduling$SchedulingWorkflowController(t,i,o,n,l,r,s){var a,d,h,u,c,S,g,$;for(this.$root=t,this._workflow=o,this._workflowSettings=n||{},this._dataPool=o.SchedulingDataPool||{},this._summarySteps=[],this.__onNavigateBack=l.onNavigateBack,this._isEmbeddedInAnotherMyChartWorkflow=n.IsEmbedded,this.__canReturnToPreviousPage=s,this.WP$Scheduling$WorkflowController(t,!1,o,l.onBeforeUnloadChanged),this.proxify("_onStepActiveChanged","_onStepCompleteChanged","showNextStep","__handleStickyBanner","__onBackButtonClick","__onMobileBack","__onMobileClose"),d=new $$WP.Scheduling.StepFactory(this._workflow,this._workflowSettings,l,r),a=0;a<i.length;a++)i[a].isReadOnly?u="-1":(h=d.createStep(i[a].type,i[a].stackedSteps),this.addStep(h),$$WP.Scheduling.StepController.isInstance(h)&&h.addViewEventListener(this.__onViewEventTriggered),u=h.Id,h.$root.addClass("fadeIn delay"),this.$root.safeAppend(h.$root)),this._summarySteps.push({Id:u,summaryType:i[a].summaryType}),stepModel=e.addSchedulingStepToCollection(this._dataPool.SchedulingSteps,u,!1,"",i[a].type,i[a].isReadOnly,"",this._workflow.Type);Handlebars.registerPartial("Scheduling.EditLinkInline",$$WP.Templates.Scheduling.EditLinkInline),window.EpicPx=window.EpicPx||{},window.EpicPx.MobileIntegration=window.EpicPx.MobileIntegration||{},this.$root.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.NavigationButtons,{IsStartOverButtonIncluded:this.__isStartOverButtonIncluded()})),c=this.$root.find(".startover"),S=$afe.select("body").find("#scheduling-startover"),g=c.add(S),$=this.$root.find("#scheduling-continue"),this._isEmbeddedInAnotherMyChartWorkflow||o.isTypeOpenSchedulingWidget()?(g.remove(),this.hookupNavigationButtons($,null,this.showNextStep)):(S.removeClass("hidden"),this.hookupNavigationButtons($,g,this.showNextStep,this.startover)),this.__setUpSummaryHeader(o),this.__setUpSidebar(),$$WP.Utilities.UI.IsLoggedIn||this.__setUpPrelogin(),this._startListening(),$afe.jq(window).on("resize scroll click handleStickyBanner orientationchange",this.__handleStickyBanner)};i.prototype={$root:null,_workflow:null,_workflowSettings:null,_dataPool:null,_summarySteps:null,_stepActiveListenerId:null,_stepCompleteListenerId:null,_sidebarController:null,__onNavigateBack:null,_isEmbeddedInAnotherMyChartWorkflow:!1,__canReturnToPreviousPage:!1,activateStep:function WP$Scheduling$SchedulingWorkflowController$activateStep(t){var i=this._dataPool.SchedulingSteps.getFromIndex("ID",t.Id);i.CompleteStatus!==e.CompleteEnum.NotRequired||i.ForceShowOnce?(this._stopListening(),i.setProperty("ActiveStatus",e.ActiveEnum.Active),this._startListening(),(!this._isEmbeddedInAnotherMyChartWorkflow||$$WP.Utilities.UI.IsMobile&&!this._workflow.SchedulingControllerParams.decisionTreeAnswerID)&&$$WPSchedulingUtil.ScrollToTopOfPage(),t.show()):this.showNextStep(),t.hasStickyBanner()?t.getSchedulingContinueBanner().addClass("stickybanner"):$afe.select(".continueBanner").css({left:"",width:""}),this.__canStartOver()?$afe.select(".startover").removeClass("hidden"):$afe.select(".startover").addClass("hidden"),$$WP.Utilities.UI.IsSelfTriageForAll||this.__setBeforeUnloadIfNotOnFirstStep(),$$WPSchedulingUtil.SetPreloginTimeout()},__setBeforeUnloadIfNotOnFirstStep:function WP$Scheduling$SchedulingWorkflowController__setBeforeUnloadIfNotOnFirstStep(){null!==this.__getPreviousVisibleStep()?this.setBeforeUnload():this.clearBeforeUnload()},__canStartOver:function WP$Scheduling$SchedulingWorkflowController$__canStartOver(){return this.__canReturnToPreviousPage||null!==this.__getPreviousVisibleStep()},deactivateStep:function WP$Scheduling$SchedulingWorkflowController$deactivateStep(t){var i=null;t&&(this._stopListening(),this.setPropertyOnStepAndChildren(t,"ActiveStatus",e.ActiveEnum.Active),this.setPropertyOnStepAndChildren(t,"ActiveStatus",e.ActiveEnum.Inactive),this._startListening(),(i=t.getSchedulingContinueBanner()).removeClass("stickybanner"),this.$root.parent().find(".startover").removeClass("fixToTop"),i.find(".selected-count").empty(),this.setPropertyOnStepAndChildren(t,"ForceShowOnce",!1),t.hide())},setPropertyOnStepAndChildren:function WP$Scheduling$SchedulingWorkflowController$setPropertyOnStepAndChildren(t,i,o){var n=0,l=this._dataPool.SchedulingSteps.getFromIndex("ID",t.Id);if(l.Type===e.StepTypeEnum.MultiAppointment||l.Type===e.StepTypeEnum.Stacked)for(l.setProperty(i,o),n=0;n<t._stackedWorkflowController._stepControllers.length;n++)this.setPropertyOnStepAndChildren(t._stackedWorkflowController._stepControllers[n],i,o);else l.setProperty(i,o)},destroy:function WP$Scheduling$SchedulingWorkflowController$destroy(e){var t=0;for(e||this.deactivateStep(this.getCurrentStep()),t=0;t<this._stepControllers.length;t++)this._stepControllers[t].onWorkflowDestroyed();this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule&&$$WP.Scheduling.OriginalAppointmentInfoController.Destroy(),this.clearBeforeUnload(),$$WPSchedulingUtil.ClearPreloginTimeout(),this._stopListening(),this.$root.off("click","a.summary-back",this.__onBackButtonClick),window.EpicPx.MobileIntegration.onMobileBack=null,window.EpicPx.MobileIntegration.onMobileClose=null,e||(this.$root.empty(),this._sidebarController&&this._sidebarController._linksSidebarWidget.remove())},startOver:function WP$Scheduling$SchedulingWorkflowController$startOver(){"function"==typeof this.__onNavigateBack&&this.__onNavigateBack()},isComplete:function WP$Scheduling$SchedulingWorkflowController$isComplete(t){return this._dataPool.SchedulingSteps.getFromIndex("ID",t).CompleteStatus===e.CompleteEnum.Complete||this._dataPool.SchedulingSteps.getFromIndex("ID",t).CompleteStatus===e.CompleteEnum.NotRequired},__setUpSummaryHeader:function WP$Scheduling$SchedulingWorkflowController$__setUpSummaryHeader(e){var t=$$WP.SimpleTemplates.Div({class:"summaryBannerContainer"}),i=0,o=!1;e.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.NewProvider&&e.IsAnonymous||e.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.ProviderFinder&&e.IsAnonymous?(i=$$WP.Scheduling.SummaryHeader.DisplayModeEnum.Condensed,o=!0):e.isTypeOpenSchedulingWidget()?(i=$$WP.Scheduling.SummaryHeader.DisplayModeEnum.NoSubway,o=!0):i=$$WP.Scheduling.SummaryHeader.DisplayModeEnum.Standard,this.$root.safePrepend(t),new $$WP.Scheduling.SummaryHeader(i,t,this._summarySteps,this._dataPool,this._workflow),o&&this.__setUpBackButton(t),window.EpicPx.MobileIntegration.onMobileBack=this.__onMobileBack,window.EpicPx.MobileIntegration.onMobileClose=this.__onMobileClose,$$WP.Utilities.UI.IsMobile||e.Type!==$$WP.Scheduling.Workflow.WorkflowTypesEnum.OnDemandTelehealth||this.$root.safePrepend($$WP.SimpleTemplates.Div({id:"telehealthBannerWeb"}))},__setUpBackButton:function WP$Scheduling$SchedulingWorkflowController$__setupBackButton(e){$summaryNavBar=$afe.renderTemplate($$WP.Templates.Scheduling.SummaryNavigationBar),$summaryNavBar.safeInsertAfter(e),this.$root.on("click","a.summary-back",null,this.__onBackButtonClick)},__setUpSidebar:function WP$Scheduling$SchedulingWorkflowController$__setUpSidebar(){var e;!this._isEmbeddedInAnotherMyChartWorkflow&&$$WP.Utilities.UI.IsLoggedIn&&(e=$$WP.Utilities.UI.SidebarManager.addWidget($$WP.Templates.Scheduling.SchedulingSidebarLinks,{},3,!1),this._sidebarController=new t(e,this._workflow,this._workflowSettings))},__setUpPrelogin:function WP$Scheduling$SchedulingWorkflowController$__setUpPrelogin(){$afe.jq(document).off("ajaxStart ajaxEnd"),$afe.select(".startover,.backbutton").addClass("hidden")},_onStepCompleteChanged:function WP$Scheduling$SchedulingWorkflowController$_onStepCompleteChanged(t){var i="",o=0,n=0,l=null,r=null;for(i in t){if(o=t[i].from,n=t[i].to,l=t[i].model,r=this.getCurrentStep(),!l)return;o===n||n!==e.CompleteEnum.Complete&&n!==e.CompleteEnum.NotRequired||l.IsStacked||l.IsAdHoc||r.Id!==l.ID?n!==e.CompleteEnum.Incomplete||l.IsStacked||l.IsAdHoc||l.ID!==r.Id||(this.$root.find("#scheduling-continue").addClass("hidden"),this.$root.removeClass("hasFloatingNavigation"),r.getSchedulingContinueBanner().removeClass("stickybanner"),this.$root.find(".startover").removeClass("fixToTop")):(r.shouldRemainOnStep()?(this.$root.find("#scheduling-continue").removeClass("hidden"),r.getSchedulingContinueBanner().addClass("stickybanner")):this.showNextRequiredStep(),this.__canStartOver()&&$afe.select(".startover,.backbutton").removeClass("hidden"))}this.__handleBackButtonVisibility()},__handleBackButtonVisibility:function WP$Scheduling$SchedulingWorkflowController$__handleBackButtonVisibility(){setTimeout($.proxy((function(){var e=this._currentStep,t=this.$root.find(".summary-back"),i=!t.hasClass("hidden");t.length>0&&(this.__shouldShowBackButton(e,i)?t.removeClass("hidden"):t.addClass("hidden"))}),this),0)},__shouldShowBackButton:function __shouldShowBackButton(e,t){var i=this._stepControllers[0].Data;return this.__canReturnToPreviousPage||null!==$$WPSchedulingUtil.GetPreviousVisibleStep(e,this._stepControllers,i,t)},showNextRequiredStep:function WP$Scheduling$SchedulingWorkflowController$showNextRequiredStep(){do{this.showNextStep()}while(this.__stepIsNotRequired())},__stepIsNotRequired:function WP$Scheduling$SchedulingWorkflowController$__stepIsNotRequired(){return this._currentStep<this._stepControllers.length-1&&this._dataPool.SchedulingSteps.getFromIndex("ID",this.getCurrentStep().Id).CompleteStatus===e.CompleteEnum.NotRequired},__onMobileBack:function WP$Scheduling$SchedulingWorkflowController$__onMobileBack(){this.showPrevVisibleStep()},__onMobileClose:function WP$Scheduling$SchedulingWorkflowController$__onMobileClose(){$$WPUtil.TryRedirect(makeLink("inside.asp?moworkflow=completeandclose"))},__onBackButtonClick:function WP$Scheduling$SchedulingWorkflowController$__onBackButtonClick(e){e.preventDefault(),this.showPrevVisibleStep()},onNavigateBack:function WP$Scheduling$SchedulingWorkflowController$onNavigateBack(){this._stepControllers[this._currentStep].onNavigateBack()},showPrevVisibleStep:function WP$Scheduling$SchedulingWorkflowController$showPrevVisibleStep(){var e;e=this.__getPreviousVisibleStep(),this.onNavigateBack(),e||0===e?(this._stepControllers[e].beforeNavigateBack(),this._showStepInArray(e)):!$$WP.Utilities.UI.IsMobile||this.__canReturnToPreviousPage||this._isEmbeddedInAnotherMyChartWorkflow?this.startOver():$$WPUtil.TryRedirect(makeLink("inside.asp?moworkflow=completeandclose"))},__getPreviousVisibleStep:function WP$Scheduling$SchedulingWorkflowController$__getPreviousVisibleStep(){return $$WPSchedulingUtil.GetPreviousVisibleStep(this._currentStep,this._stepControllers,this._dataPool)},_onStepActiveChanged:function WP$Scheduling$SchedulingWorkflowController$_onStepActiveChanged(t){var i,o,n,l;for(i in t)o=t[i].from,n=t[i].to,l=t[i].model,n===o||n!==e.ActiveEnum.Active||l.IsStacked||this.showStep(l.ID,l.IsStacked)},_startListening:function WP$Scheduling$SchedulingWorkflowController$_startListening(){this._stepActiveListenerId=this._dataPool.SchedulingSteps.addPropertyListener("ActiveStatus",this._onStepActiveChanged),this._stepCompleteListenerId=this._dataPool.SchedulingSteps.addPropertyListener("CompleteStatus",this._onStepCompleteChanged)},_stopListening:function WP$Scheduling$SchedulingWorkflowController$_stopListening(){this._dataPool.SchedulingSteps.removePropertyListener("ActiveStatus",this._stepActiveListenerId),this._dataPool.SchedulingSteps.removePropertyListener("CompleteStatus",this._stepCompleteListenerId)},__handleStickyBanner:function WP$Scheduling$SchedulingWorkflowController$__handleStickyBanner(){var e=this.getCurrentStep(),t=e.getContinueButton(this.$root),i=t.is(":hidden"),o=t.is("[disabled]"),n=t.closest(".stickybanner"),l=null,r="rtl"===$afe.select("html").safeAttr("dir"),s=window.innerHeight||document.documentElement.clientHeight;if(n.length){if(this.__toggleStartOverButtonVisibility(n),i||isDataTile()||isCustomBranded()||$$WP.WidgetMode||o||this._isEmbeddedInAnotherMyChartWorkflow&&this.$root[0].getBoundingClientRect().top>s)return n.addClass("static"),n.addClass("continueHidden"),n.css({left:"",width:""}),n.css({}),void this.__toggleStartOverButtonVisibility(n);if(n.removeClass("continueHidden"),this._isEmbeddedInAnotherMyChartWorkflow){if(this.__isOneOfMultipleEmbedded())return;$$WP.Utilities.UI.IsMobile||(n.css({left:this.$root[0].getBoundingClientRect().left}),n.innerWidth(this.$root.innerWidth()))}else l=$afe.select("#main"),$$WP.Utilities.UI.IsMobile||(n.css({left:l.offset().left}),n.innerWidth(l.innerWidth()),r&&n.css({right:"auto"}));n.hasClass("static")&&!this.__isBannerOnScreen(n)?n.removeClass("static"):!n.hasClass("static")&&0!==this.$root[0].getBoundingClientRect().bottom&&this.__isButtonInNaturalPosition(n)&&(n.addClass("static"),$afe.jq(window).trigger("resize")),n.hasClass("static")&&n.css({left:"",width:""}),this.__toggleStartOverButtonVisibility(n),e.setCurrentSelectionCountInBanner()}},__isBannerOnScreen:function WP$Scheduling$SchedulingWorkflowController$__isBannerOnScreen(e){var t=e.find(".schedulebutton-separator");return(0==t.length||t.is(":hidden"))&&(t=e),t[0].getBoundingClientRect().bottom<=window.innerHeight},__isButtonInNaturalPosition:function WP$Scheduling$SchedulingWorkflowController$__isButtonInNaturalPosition(e){var t=null;return(0==(t=e.siblings(".sentinelDiv")).length?this.$root[0].getBoundingClientRect().bottom:t[0].getBoundingClientRect().top)<=e[0].getBoundingClientRect().top},__isStartOverButtonIncluded:function WP$Scheduling$SchedulingWorkflowController$__isStartOverButtonIncluded(){var e=this._workflow.Type===$$WP.Scheduling.Workflow.WorkflowTypesEnum.NewProvider&&this._workflow.IsAnonymous,t=$$WP.Utilities.UI.IsMobile,i=this._workflow.isTypeOpenSchedulingWidget();return!e&&!t&&!i},__toggleStartOverButtonVisibility:function WP$Scheduling$SchedulingWorkflowController$__toggleStartOverButtonVisibility(e){var t=null;this.getCurrentStep().isUsingWorkflowNavigation()||(t=this.$root.find(".startover"),e.hasClass("static")?t.removeClass("fixToTop"):t.addClass("fixToTop"))},__isOneOfMultipleEmbedded:function WP$Scheduling$SchedulingWorkflowController$__isOneOfMultipleEmbedded(){return $afe.select(".actionNode.container").length>1}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SchedulingWorkflowController=i,i.extend($$WP.Scheduling.WorkflowController,"WP$Scheduling$SchedulingWorkflowController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SchedulingWorkflowController(e){$$WP.Debug.UnitTest.assert}));;
!function definition(){var t=$$WP.Scheduling.SchedulingStep,AdHocStepWorkflowController=function(t,e,o,i,l,n,s){var p=$$WP.SimpleTemplates.Div({class:"stepcontainer"});this.__dataPool=o,this.__workflowEventCallbacks=n,this.__onCloseCallback=s,this.__step=t,this.__hostId=e,this.__workflowSettings=l,this.WP$Scheduling$WorkflowController(p,!0,i),this.proxify("__onStepCompleteChanged","__onClosePopupClicked")};AdHocStepWorkflowController.prototype={stepId:"",__dataPool:null,__workflowEventCallbacks:null,__onCloseCallback:null,__step:null,__hostId:null,__stepCompleteListenerId:"",__$stepContainer:null,__stepController:null,__workflowSettings:null,__popupComponent:null,renderInPopup:function WP$Scheduling$AdHocStepWorkflowController$renderInPopup(e){var o;this.__$stepContainer||this.__createStep(),(o=this.__createPopup(e)).$container.safeAppend(this.$root),$afe.select(".adHocStep").safeAppend(this.__$stepContainer),this.__stopListening(),this._stepControllers[0].setComplete(t.CompleteEnum.Incomplete),this.__startListening(),this.render(),setTimeout($.proxy((function(){o.reposition(!0),this.__showPopupRoot(),$$WPSchedulingUtil.FocusElement($afe.select("button.cancelworkflow"))}),this),0)},__onClosePopupClicked:function WP$Scheduling$AdHocStepWorkflowController$__onClosePopupClicked(){this.destroy(),"function"==typeof this.__onCloseCallback&&this.__onCloseCallback()},__createStep:function WP$Scheduling$AdHocStepWorkflowController$__createStep(){var e=null;e=new $$WP.Scheduling.StepFactory(this._workflow,this.__workflowSettings,this.__workflowEventCallbacks),this.__stepController=e.createStep(this.__step.type,this.__step.stackedSteps),this.addStep(this.__stepController),$$WP.Scheduling.StepController.isInstance(this.__stepController)&&this.__stepController.addViewEventListener(this.__onViewEventTriggered),this.stepId=this.__stepController.Id,this.__$stepContainer=this.__stepController.$root,t.addSchedulingStepToCollection(this.__dataPool.SchedulingSteps,this.stepId,!1,"",this.__step.type,this.__step.isReadOnly,this.__hostId)},__createPopup:function WP$Scheduling$AdHocStepWorkflowController$__createPopup(t){var e,o;return this.__hidePopupRoot(),this.__popupComponent=new $$WPComp.ConfirmComponent({IsClosable:!0,TitleText:t,forcePrompt:!0,Html:'<div class="adHocStep"></div>',callback:this.__onClosePopupClicked,ToolbarButtons:[]}),e={Size:$$WPContain.Popup.SizeEnum.MEDIUM,canResetFocusOnKeydown:!0},quickPopup=$$WPUtil.quickPopup(this.__popupComponent,e),this.__addPopupToController(quickPopup),o="[data-id='"+$$WPComp.TITLEBARIDENTIFIER+"close']",quickPopup.$container.on("click",o,this.__onClosePopupClicked),$afe.select(".lightbox_overlay").on("click",this.__onClosePopupClicked),quickPopup},__addPopupToController:function WP$Scheduling$AdHocStepWorkflowController$__addPopupToController(t){this.__stepController&&void 0!==this.__stepController.__popup&&(this.__stepController.__popup=t)},__hidePopupRoot:function WP$Scheduling$AdHocStepWorkflowController$__hidePopupRoot(){this.__setPopupRootVisibility("hidden")},__showPopupRoot:function WP$Scheduling$AdHocStepWorkflowController$__showPopupRoot(){this.__setPopupRootVisibility("visible")},__setPopupRootVisibility:function WP$Scheduling$AdHocStepWorkflowController$__togglePopupRootVisibility(t){$afe.select("#classicPopupRoot").safeAttr("style","visibility: "+t)},__startListening:function WP$Scheduling$AdHocStepWorkflowController$__startListening(){this.__stepCompleteListenerId=this.__dataPool.SchedulingSteps.addPropertyListener("CompleteStatus",this.__onStepCompleteChanged)},__onStepCompleteChanged:function WP$Scheduling$AdHocStepWorkflowController$__onStepCompleteChanged(e){var o,i,l,n,s;for(o in e)i=e[o].from,l=e[o].to,n=e[o].model,s=this.getCurrentStep(),n&&n.IsAdHoc&&(i===l||l!==t.CompleteEnum.Complete&&l!==t.CompleteEnum.NotRequired||s.Id!==n.ID||s.shouldRemainOnStep()||this.destroy())},__stopListening:function WP$Scheduling$AdHocStepWorkflowController$__stopListening(){this.__dataPool.SchedulingSteps.removePropertyListener("CompleteStatus",this.__stepCompleteListenerId)},destroy:function WP$Scheduling$AdHocStepWorkflowController$destroy(){this.clearBeforeUnload(),this.__stopListening(),this.$root.detach(),this.__activateHostStep()},__activateHostStep:function WP$Scheduling$AdHocStepWorkflowController$__activateHostStep(){hostStep=this.__dataPool.SchedulingSteps.getFromIndex("ID",this.__hostId),hostStep&&hostStep.setProperty("ActiveStatus",$$WP.Scheduling.SchedulingStep.ActiveEnum.Active),this.__popupComponent.dispose()},activateStep:function WP$Scheduling$AdHocStepWorkflowController$activateStep(e){var o=this.__dataPool.SchedulingSteps.getFromIndex("ID",e.Id);this.__stopListening(),o.setProperty("ForceShowOnce",!0),o.setProperty("ActiveStatus",t.ActiveEnum.Active),this.__startListening(),e.show()},deactivateStep:function WP$Scheduling$AdHocStepWorkflowController$deactivateStep(e){if(e){this.__stopListening();var o=this.__dataPool.SchedulingSteps.getFromIndex("ID",e.Id);o.setProperty("ActiveStatus",t.ActiveEnum.Active),o.setProperty("ActiveStatus",t.ActiveEnum.Inactive),this.__startListening(),o.setProperty("ForceShowOnce",!1),e.hide()}},isComplete:function WP$Scheduling$AdHocStepWorkflowController$isComplete(e){return this.__dataPool.SchedulingSteps.getFromIndex("ID",e).CompleteStatus===t.CompleteEnum.Complete||this.__dataPool.SchedulingSteps.getFromIndex("ID",e).CompleteStatus===t.CompleteEnum.NotRequired}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.AdHocStepWorkflowController=AdHocStepWorkflowController,AdHocStepWorkflowController.extend($$WP.Scheduling.WorkflowController,"WP$Scheduling$AdHocStepWorkflowController")}();;
/*! Copyright (c) Epic Systems Corporation 2017 */
!function definition(){var e=$$WP.Scheduling.StepFactory,t=$$WP.Scheduling.SchedulingStep,o=$$WP.Scheduling.Workflow,n=function StackedWorkflowController(t,n,l,d,r,s,c){var a=0;for(this.$root=t,this._dataPool=l.SchedulingDataPool||{},this._stackId=s,this._mode=r||i.ShowOneAtATime,this.WP$Scheduling$WorkflowController(t,l.Type===o.WorkflowTypesEnum.OnDemandTelehealth,l),this.proxify("_onStepCompleteChanged"),this._stepFactory=new e(l,d,c),a=0;a<n.length;a++)this.createStepAndAddToDom(n[a]);this._dataPool.SchedulingSteps.addPropertyListener("CompleteStatus",this._onStepCompleteChanged)},l={$root:null,_dataPool:null,_stackId:null,_stepFactory:null,_mode:0,createStepAndAddToDom:function WP$Scheduling$StackedWorkflowController$createStepAndAddToDom(e){var o=null;return o=this._stepFactory.createStep(e.type,e.stackedSteps),this.addStep(o),o.addViewEventListener(this.__onViewEventTriggered),t.addSchedulingStepToCollection(this._dataPool.SchedulingSteps,o.Id,!0,this._stackId,e.type),this.$root.safeAppend(o.$root),o},destroyStepAndRemoveFromDom:function WP$Scheduling$StackedWorkflowController$destroyStepAndRemoveFromDom(e){this.removeStep(e),this._dataPool.SchedulingSteps.remove(this._dataPool.SchedulingSteps.getFromIndex("ID",e.Id)),e.$root.remove()},activateStack:function WP$Scheduling$StackedWorkflowController$activateStack(){switch(this._mode){case i.ShowOneAtATime:this.activateUpToCurrentStep();break;case i.ShowAllAtOnce:this.activateAllSteps()}},activateStep:function(e){e.show()},deactivateStep:function(e,t){e&&t&&e.hide($$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)},showNextIncompleteStep:function WP$Scheduling$StackedWorkflowController$showNextIncompleteStep(){for(;this._currentStep<this._stepControllers.length-1&&this._dataPool.SchedulingSteps.getFromIndex("ID",this.getCurrentStep().Id).CompleteStatus!==t.CompleteEnum.Incomplete;)this.showNextStep()},_onStepCompleteChanged:function(e){var o,n,l,d;for(o in e)n=e[o].from,l=e[o].to,(d=e[o].model||$$WP.Common.Model.getInstance(o))&&d.IsStacked&&d.StackId===this._stackId&&(n===l||l!==t.CompleteEnum.Complete&&l!==t.CompleteEnum.NotRequired?n!==l&&l===t.CompleteEnum.Incomplete&&this._mode===i.ShowOneAtATime&&this.deactivateRange(d.ID):this.showNextIncompleteStep())}},i={ShowOneAtATime:0,ShowAllAtOnce:1};n.prototype=l,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.StackedWorkflowController=n,$$WP.Scheduling.StackedWorkflowController.ModesEnum=i,n.extend($$WP.Scheduling.WorkflowController,"WP$Scheduling$StackedWorkflowController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$StackedWorkflowController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$SchedulingSummaryHeader$definition(){var e={None:0,ReasonForVisit:1,Location:2,Time:3,Provider:4,Questionnaire:5,Confirmation:6,Request:7,TelehealthLocation:8,QuickSchedule:9,TelehealthOrganization:10,TelehealthSummary:11,Ticket:12,TelehealthPlatform:13,Specialty:14,InsuranceVerification:15},t={Incomplete:0,Complete:1,Inactive:2},i={Standard:0,Condensed:1,NoSubway:2},n=function WP$Scheduling$SummaryHeader(e,t,i,n,o){this.WP$Controllers$Controller(),this.$root=t,this._steps=i,this._dataPool=n,this._workflow=o,this._summaryTemplate=$$WP.Templates.Scheduling.SummaryHeader,this._displayMode=e,this.proxify("_update","_onSummaryClick","_updateBuffer","_onAppointmentsChanged","_matchHeights"),this._eventManager=new $$WP.Scheduling.EventManager,this._dataPool.AppointmentBuilder.Appointments.addCollectionEventListener("add",this._onAppointmentsChanged),this._dataPool.AppointmentBuilder.Appointments.addCollectionEventListener("remove",this._onAppointmentsChanged),this._dataPool.AppointmentBuilder.addPropertyListener("ReasonForVisit",this._updateBuffer),this._dataPool.AppointmentBuilder.addPropertyListener("Specialty",this._updateBuffer),this._dataPool.SchedulingSteps.addPropertyListener("CompleteStatus",this._updateBuffer),this._dataPool.SchedulingSteps.addPropertyListener("ActiveStatus",this._updateBuffer),this.$root.click(this._onSummaryClick),$afe.jq(window).on("resize",this._matchHeights),this._onAppointmentsChanged(),this._update()};n.prototype={$root:null,_steps:null,_dataPool:null,_workflow:null,_summaryTemplate:null,_previouslyActiveStepId:null,_previouslyActiveStepIndex:null,_timerId:null,_eventManager:null,_displayMode:null,_currentStepNumber:0,_onAppointmentsChanged:function _onAppointmentsChanged(){var e=0,t=null;for(this._eventManager.removeAllListeners(),e=0;e<this._dataPool.AppointmentBuilder.numAppointments();e++)t=this._dataPool.AppointmentBuilder.getAppointment(e),this._eventManager.addCollectionEventListener(t.Providers,"add",this._updateBuffer),this._eventManager.addCollectionEventListener(t.Providers,"remove",this._updateBuffer),this._eventManager.addCollectionEventListener(t.Locations,"add",this._updateBuffer),this._eventManager.addCollectionEventListener(t.Locations,"remove",this._updateBuffer)},_update:function _update(){var e,t,i,n,o;if(this.$root.empty(),e=this._getViewModel(),this._displayMode!==$$WP.Scheduling.SummaryHeader.DisplayModeEnum.NoSubway&&(t=$afe.renderTemplate(this._summaryTemplate,e),this.$root.safeAppend(t)),i=this._getFirstActiveStep(e.Steps))for(this._previouslyActiveStepId=i.Id,this._previouslyActiveStepIndex=0,this._currentStepNumber=i.Index,n=0;n<this._steps.length;n++)if(this._steps[n].Id===i.Id){this._previouslyActiveStepIndex=n;break}o=$afe.jq($afe.select("#header-accessible-text")).text(),$afe.jq($afe.select("span.header-accessible-span")).text(o),this._matchHeights()},_updateBuffer:function _updateBuffer(){clearTimeout(this._timerId),this._timerId=setTimeout(this._update,0)},_getViewModel:function _getViewModel(){var e={},t=this._dataPool.AppointmentBuilder.ReasonForVisit,n=this._getSlotsViewModel(),o=this._getHeaderComponentsViewModel(),l=this._getLocationsViewModel(),s=this._getProvidersViewModel(),a=this._getSpecialtyViewModel(),r=1===n.length&&n[0].IsRequest;e={ShouldShow:o.length>0&&this._displayMode!==i.NoSubway,Steps:o,Locations:l,ReasonForVisit:t,Providers:s,Specialty:a,Slots:n,numSteps:o.length,Title:this._workflow.Title,TicketInfo:this._workflow.TicketInfo,TelehealthSelectedPlatformString:this._dataPool.TelehealthData.TelehealthSelectedPlatformString,IsAnonymous:this._workflow.IsAnonymous,IsRequestWorkflow:r,IsCondensed:this._displayMode===i.Condensed,UseInsuranceForVisit:"0"!==this._dataPool.AppointmentBuilder.UseInsuranceForVisit,SchedulingWorkflowProgress:this.getProgressEstimate(o)};var d=this._dataPool.TelehealthData.SelectedWorkflow;if(this._dataPool.TelehealthLocations&&this._dataPool.TelehealthLocations.Models&&this._dataPool.TelehealthLocations.Models.length>0){var u=this._dataPool.TelehealthLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected),h=this._dataPool.TelehealthOrganizations.getFirstInIndex("State",$$WP.Scheduling.TelehealthOrganization.StatesEnum.Selected),p=d===$$WP.Scheduling.TelehealthData.TelehealthWorkflow.Queueing;e.TelehealthLocation=u,e.TelehealthOrganization=h,p?e.ProviderName=$$WP.Strings.get("NextProvider","ondemandtelehealth"):this._dataPool.TelehealthData.SelectedProviderName&&(e.ProviderName=this._dataPool.TelehealthData.SelectedProviderName)}return e},_getHeaderComponentsViewModel:function _getHeaderComponentsViewModel(){var e,i=[],n=0,o=null,l=null,s=0;for(s=-1,reasonForVisit=this._dataPool.AppointmentBuilder.ReasonForVisit,e=this._dataPool.AppointmentBuilder.getFirstAppointment().Slot,n=0;n<this._steps.length;n++)o=this._dataPool.SchedulingSteps.getFromIndex("ID",this._steps[n].Id),(l=this._steps[n]).IsActive=!1,l.Animate=!1,l.AnimateBack=!1,l.CanBeSelected=!1,this.__isStepIncludedInHeaderEvaluation(o,l,e)&&(s>-1?l.Status=t.Inactive:this._isStepOrChildActive(o)||o.CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete?(s=n,l.Status=t.Incomplete,o.IsReadOnly||(l.CanBeSelected=!0)):(l.Status=t.Complete,o.IsReadOnly||(l.CanBeSelected=!0)),this._isStepOrChildActive(o)&&(l.IsActive=!0,this._previouslyActiveStepIndex>n?l.AnimateBack=!0:(this._previouslyActiveStepIndex<n||null===this._previouslyActiveStepIndex)&&(l.Animate=!0)),this.__isStepIncludedInHeaderDisplay(l)&&i.push(l));return i},__isStepIncludedInHeaderEvaluation:function __isStepIncludedInHeaderEvaluation(t,i,n){var o=!0;return(t.CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.NotRequired&&!t.ForceShowOnce||i.summaryType===e.Confirmation&&n&&!0===n.IsRequest||i.summaryType===e.Provider&&!this.__showProviderStepInSubway())&&(o=!1),o},__showProviderStepInSubway:function __showProviderStepInSubway(){return this._allowProviderSelectForAnyAppointment()&&this.__canVisitTypeShowProvStep()},__canVisitTypeShowProvStep:function __canVisitTypeShowProvStep(){var e=0,t=null,i=this._dataPool.AppointmentBuilder,n=!1;if(this._workflow.Type!==$$WP.Scheduling.Workflow.WorkflowTypesEnum.Procedure)return!0;for(e=0;e<i.numAppointments();e++)(t=i.getAppointment(e).VisitType)&&t.AllowProviderStepInDirectSched&&(n=!0);return n},__isStepIncludedInHeaderDisplay:function __isStepIncludedInHeaderDisplay(t){var n=!1,o=this._dataPool.SchedulingSteps.getFromIndex("ID",t.Id);return(t.summaryType&&t.summaryType!==e.None||t.IsActive&&this._displayMode===i.Condensed)&&(n=!0),t.IsActive||$$WPUtil.IsNullOrEmpty(o)||!o.IsHiddenUntilActive||o.CompleteStatus!==$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete||(n=!1),t.IsActive||$$WPUtil.IsNullOrEmpty(o)||!o.IsHiddenAfterCompletion||o.CompleteStatus!==$$WP.Scheduling.SchedulingStep.CompleteEnum.Complete||(n=!1),n},_allowProviderSelectForAnyAppointment:function _allowProviderSelectForAnyAppointment(){var e=0,t=null,i=!1,n=this._dataPool.AppointmentBuilder;for(e=0;e<n.numAppointments();e++)t=n.getAppointment(e),i=i||$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(n,t);return i},_getLocationsViewModel:function _getLocationsViewModel(){return $$WPSchedulingUtil.GetLocationsSummaryArray(this._dataPool)},_getProvidersViewModel:function _getProvidersViewModel(){return $$WPSchedulingUtil.GetProvidersSummaryArray(this._dataPool)},_getSpecialtyViewModel:function _getSpecialtyViewModel(){return this._dataPool.AppointmentBuilder.Specialty},_getFirstActiveStep:function _getFirstActiveStep(e){var t=null,i=0;for(i=0;i<e.length;i++)if((t=e[i]).IsActive)return t.Index=i,t;return null},_getSlotsViewModel:function _getSlotsViewModel(){var e=[],t=0,i=null;for(t=0;t<this._dataPool.AppointmentBuilder.numAppointments();t++)(i=this._dataPool.AppointmentBuilder.getAppointment(t)).Slot&&e.push(i.Slot);return $$WPSchedulingUtil.TrimViewModelArray(e,1)},_isStepOrChildActive:function _isStepOrChildActive(e){var t;return e.ActiveStatus===$$WP.Scheduling.SchedulingStep.ActiveEnum.Active||(t=this._dataPool.SchedulingSteps.getFirstInIndex("ActiveStatus",$$WP.Scheduling.SchedulingStep.ActiveEnum.Active),!($$WPUtil.IsNullOrEmpty(t)||t.StackId!==e.ID&&t.HostId!==e.ID))},_matchHeights:function _matchHeights(){var e,t;(e=$afe.select(".summaryInfo")).css("minHeight"),t=0,e.css("minHeight",""),e.each((function(){$afe.jq(this).outerHeight()>t&&(t=$afe.jq(this).outerHeight())})),e.css("minHeight",t)},_onSummaryClick:function _onSummaryClick(e){var t,i=0;WP.Events.preventDefault(e),this._dataPool.IsSchedulingCompleting||(t=parseInt($afe.jq(e.target).closest("[data-model-id]").safeAttr("data-model-id")),this.__isStepSelectable(t)&&(t!==this._previouslyActiveStepId&&(this._dataPool.BlockDemographicInsuranceVerification=!0),i=this.__getRequiredStepIdBetweenActiveAndClicked(t),this._dataPool.SchedulingSteps.getFromIndex("ID",i).setProperty("ActiveStatus",$$WP.Scheduling.SchedulingStep.ActiveEnum.Active)))},__getRequiredStepIdBetweenActiveAndClicked:function WP$Scheduling$SummaryHeader$__getRequiredStepBetweenActiveAndClicked(e){var t=0,i=0,n=0,o=0;for(n=0;n<this._steps.length;n++)(o=this._steps[n].Id)===this._previouslyActiveStepId&&(t=n),o===e&&(i=n);for(n=t;n<i;n++)if(o=this._steps[n].Id,this._dataPool.SchedulingSteps.getFromIndex("ID",o).CompleteStatus===$$WP.Scheduling.SchedulingStep.CompleteEnum.Incomplete)return o;return e},__isStepSelectable:function WP$Scheduling$SummaryHeader$__isStepSelectable(e){var t,i=0,n=null;for(t=this._getHeaderComponentsViewModel(),i=0;i<t.length;i++)if((n=t[i]).Id===e)return n.CanBeSelected;return!1},getProgressEstimate:function WP$Scheduling$SummaryHeader$getProgressEstimate(e){var i=0,n=0,o=0;for($$WPUtil.IsNullOrEmpty(e)&&(e=this._getHeaderComponentsViewModel()),n=e.length,i=0;i<e.length;i++)e[i].Status===t.Complete&&o++;return this._workflow.isTypeOpenScheduling()&&this._workflow.IsAnonymous&&(o++,n++),$$WPSchedulingUtil.GetRoughProgressThroughWorkflow(o,n)}},$$WP.Scheduling.SummaryHeader=n,$$WP.Scheduling.SummaryHeader.SummaryComponentEnum=e,$$WP.Scheduling.SummaryHeader.StatusEnum=t,$$WP.Scheduling.SummaryHeader.DisplayModeEnum=i,n.extend($$WP.Controllers.Controller,"WP$Scheduling$SummaryHeader")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$SummaryHeader(e){$$WP.Debug.UnitTest.assert}));;
var Epic;!function(n){!function(n){!function(n){n.AnonymousSchedulingControllerParameters=class AnonymousSchedulingControllerParameters{};n.AnonymousSchedulingSettings=class AnonymousSchedulingSettings{}}(n.Scheduling||(n.Scheduling={}))}(n.PatientEngagement||(n.PatientEngagement={}))}(Epic||(Epic={}));;
var Epic;!function(e){!function(o){!function(o){class AnonymousSchedulingController extends $$WP.Controllers.Controller{constructor(e,o){super(),this.__$root=e,this.__schedulingControllerParameters=o}Render(){if($afe.select(AnonymousSchedulingController.schedulingWorkflowContainerSelector).hide(),!$$WPUtil.canWriteCookies())return this.__$root.hide(),self===top?$afe.select("#noCookiesError").show():$afe.select("#noCookies").show(),void $afe.select("#splashPage").hide();if("OnDemandTelehealth"===this.__schedulingControllerParameters.workflow)this.__splashPageImplementation=new e.PatientEngagement.Scheduling.OnDemandTelehealth.SplashPageController(this.__$root,this.__schedulingControllerParameters);this.__splashPageImplementation&&(this.proxify("__SettingsLoaded"),$.post({url:makeLink("Scheduling/Anonymous/GetAnonymousSchedulingSettings"),cache:!1,success:this.__SettingsLoaded}))}__SettingsLoaded(e){this.__splashPageImplementation.Render($afe.select("#splashText"),e,$.proxy(this.__ContinueCallback,this))}__ContinueCallback(e){e&&(this.__schedulingControllerParameters=e),this.__schedulingControllerParameters.embedded=!0,this.__schedulingControllerParameters.isAnonymous=!0,$.post({url:makeLink("Scheduling/Anonymous/LogAnonymousUsage"),data:{workflow:this.__schedulingControllerParameters.workflow},cache:!1}),this.__$root.hide();const o=$afe.select(".back");o&&o.hide(),$afe.select("#anonymous-scheduling-startover").removeClass("hidden"),$afe.select("#startOverMobile").removeClass("hidden"),$afe.select(AnonymousSchedulingController.schedulingWorkflowContainerSelector).show(),new $$WP.Scheduling.SchedulingController($afe.select(AnonymousSchedulingController.schedulingWorkflowContainerSelector),this.__schedulingControllerParameters)}}AnonymousSchedulingController.schedulingWorkflowContainerSelector="#scheduling-workflow-container",o.AnonymousSchedulingController=AnonymousSchedulingController}(o.Scheduling||(o.Scheduling={}))}(e.PatientEngagement||(e.PatientEngagement={}))}(Epic||(Epic={}));;
!function WP$Scheduling$SchedulingController$definition(){var e=$$WP.Controllers.Controller,t=$$WP.Scheduling.Workflow,i=$$WP.Scheduling.SchedulingStep.StepTypeEnum,n=$$WP.Scheduling.SchedulingWorkflowController,o=$$WP.Scheduling.SummaryHeader.SummaryComponentEnum,r=$$WP.Analytics.ViewEvent,l=$$WP.Analytics.ThirdPartyViewEvent,s=$$WP.Analytics.UserActionEvent,a=function WP$Scheduling$SchedulingController(e,t,i,n,o){var r="Scheduling/GetSchedulingWorkflowData";if(this.WP$Controllers$Controller(),this.__addQueryStringParamsData(t),this.__parseInputParams(t),this.__isAnonymous){if(!$$WPUtil.canWriteCookies()&&!$$WP.WidgetMode)return void this.__showCookieErrorToUser();r="Scheduling/Anonymous/GetSchedulingWorkflowData",this.__parseAnonymousSettings(t),this.__removePreloginSpinnerForWorkflowsThatBringTheirOwnFromHome(t)}if(this.$schedulingContainer=e,this.$schedulingContainer.safeAppend(this.__createAnnouncementContainer()),this.$root=this.__createContainer(),this.$schedulingContainer.safeAppend(this.$root),this.$root.show(),this.$root.safeAttr("id","scheduling-workflow"),this.$root.addClass("section"),this.$root.empty(),this.proxify("__onWorkflowSelected","__onRequestCompleted","__onTicketWaitListPreferencesUpdated","__onStopScheduling","__onDataLoaded","__onSchedulingComplete","__onStartOver","__onError","__onWorkflowStepError","__onReturn","__onViewEventTriggered","__getSchedulingCompleteParams"),this.__externalWorkflowEventCallbacks=o||{},this.__externalWorkflowEventCallbacks.onSchedulingComplete=this.__externalWorkflowEventCallbacks.onSchedulingComplete||i,this.__workflowEventCallbacks=this.__buildWorkflowEventCallbacks(this.__externalWorkflowEventCallbacks),this.__setSpinnerMember(),this.__isEmbedded)$$WP.Utilities.UI.IsMobile||this.$root.addClass("scheduling-embedded");else{var l=document.getElementsByClassName("previousstep")[0];l&&l.classList.add("hidden"),$$WP.Utilities.UI.IsMobile&&$$WP.Utilities.Mobile.Optimization.SetMobileBG()}"OnDemandTelehealth"===t.workflow&&this.__hasDenyJoiningVideoVisitSecPoint?this.__showLackOfVideoVisitSecurityError():n?this.__onDataLoaded(n):($$WPSchedulingUtil.HideBackButton(),$$WP.Scheduling.SchedulingController.logWorkflowStart(t,this.__isAnonymous),$$WPUtil.ShowAjaxSpinner(this.$workflowAjaxSpinner),this.__getSchedulingWorkflowDataLoader=$.post({url:makeLink(r),data:{schedulingParameters:t,disableUTF8:t.disableUTF8,nonce:$$WPUtil.GetPageNonce()},cache:!1,error:this.__onError,success:this.__onDataLoaded}))},c={VisitScheduled:0,VisitRequested:1,NotScheduled:2},d={HasNoLicensedTelehealthProviders:0,DoesNotMeetMinSignupAge:1},h={$schedulingContainer:null,$root:null,__getSchedulingWorkflowDataLoader:null,__schedulingControllerParams:null,__workflowSettings:null,__workflows:null,__workflowSelectionListenerId:null,__landingPageController:null,$workflowsContainer:null,$schedulingStoppedContainer:null,$workflowAjaxSpinner:null,__schedulingWorkflowController:null,__sidebarController:null,__linksSidebarWidget:null,__preventAppendingErrorMessageOnStop:!1,__isEmbedded:!1,__isAnonymous:!1,__isGuest:!1,__hasDenyJoiningVideoVisitSecPoint:!1,__anonymousSettings:null,__mobileCloseURL:"Home/LogOut",__workflowEventCallbacks:{},__externalWorkflowEventCallbacks:{},Destroy:function WP$Scheduling$SchedulingController$Destroy(){this.__getSchedulingWorkflowDataLoader&&this.__getSchedulingWorkflowDataLoader.abort(),this.__schedulingWorkflowController&&(this.__schedulingWorkflowController.destroy(),this.__schedulingWorkflowController=null),this.$schedulingContainer.empty(),this.__closeAllPopups()},__closeAllPopups:function WP$Scheduling$SchedulingController$__closeAllPopups(){var e=[],t=0,i=null;for(e=document.querySelectorAll(".Popup.component"),t=0;t<e.length;t++)null!==(i=$$WPComp.getInstance(e[t].getAttribute("data-component-id")))&&$$WPComp.isComponent(i)&&i.dispose(!1)},__setSpinnerMember:function WP$Scheduling$SchedulingController$__setSpinnerMember(){this.$workflowAjaxSpinner=$afe.select(".ajaxspinner.defaultajaxoverlay"),0===this.$workflowAjaxSpinner.length&&(this.$workflowAjaxSpinner=$afe.select(".ajaxspinner")),this.$workflowAjaxSpinner.length>1&&(this.$workflowAjaxSpinner=this.$workflowAjaxSpinner.first())},__onDataLoaded:function WP$Scheduling$SchedulingController$__onDataLoaded(e){if($$WPUtil.IsNullOrEmpty(e)&&"OnDemandTelehealth"===this.__schedulingControllerParams.workflowType&&this.__onError(),this.__workflowSettings=e.WorkflowSettings,this.__workflowSettings.IsEmbedded=this.__isEmbedded,this.__getSchedulingWorkflowDataLoader=null,$$WPUtil.IsNullOrEmpty(e))this.__onStopScheduling();else if(e.LoadError)this.__handleLoadError(e.LoadError.ErrorCode);else if(this.__workflowSettings.WorkflowType===$$WP.Scheduling.Workflow.WorkflowTypesEnum.NewProvider&&0===e.Specialties.length)this.__onError();else{if($$WPUtil.HideAjaxSpinner(this.$workflowAjaxSpinner),this.__setUpMobileCloseUrl(),this.__workflowSettings.WorkflowType===t.WorkflowTypesEnum.OnDemandTelehealth&&(!$$WPUtil.IsNullOrEmpty(e.OnDemandTelehealthData.OnDemandVideoVisitCSN)||e.OnDemandTelehealthData.InXOrgQueue||e.OnDemandTelehealthData.OnDemandVideoVisitError))return void this.__launchScheduledTelemedicine(e);this.__workflowSettings.WorkflowType!==t.WorkflowTypesEnum.OnDemandTelehealth||$$WPUtil.IsNullOrEmpty(e.OnDemandTelehealthData.ExistingVideoVisitCSN)||this.__schedulingControllerParams.isFromSelfTriageLandingPage||this.__showExistingVideoVisitPopup(e),this.__launchSchedulingWorkflow(e)}},__showExistingVideoVisitPopup:function WP$Scheduling$SchedulingController$__showExistingVideoVisitPopup(e){this.__trackNumOfPatientsInODVVWithSchVideoVisits();var t=e.OnDemandTelehealthData.ExistingVideoVisitProviders||[],i=t.length;switch(i){case 1:$$WP.Strings.addMnemonic("@MYCHART@EXISTINGVVPROVIDER1@",t[0],!1,"Scheduling");var n=$$WP.Strings.get("PatientHasExistingVideoVisitContentOneProv","Scheduling");$$WP.Strings.removeMnemonic("@MYCHART@EXISTINGVVPROVIDER1@","Scheduling");break;case 2:$$WP.Strings.addMnemonic("@MYCHART@EXISTINGVVPROVIDER1@",t[0],!1,"Scheduling"),$$WP.Strings.addMnemonic("@MYCHART@EXISTINGVVPROVIDER2@",t[1],!1,"Scheduling");n=$$WP.Strings.get("PatientHasExistingVideoVisitContentTwoProv","Scheduling");$$WP.Strings.removeMnemonic("@MYCHART@EXISTINGVVPROVIDER1@","Scheduling"),$$WP.Strings.removeMnemonic("@MYCHART@EXISTINGVVPROVIDER2@","Scheduling");break;case 0:n=$$WP.Strings.get("PatientHasExistingVideoVisitContentNoInfo","Scheduling");break;default:$$WP.Strings.addMnemonic("@MYCHART@EXISTINGVVPROVIDER1@",t[0],!1,"Scheduling"),$$WP.Strings.addMnemonic("@MYCHART@EXISTINGVVPROVIDERCOUNT@",i-1,!1,"Scheduling");n=$$WP.Strings.get("PatientHasExistingVideoVisitContentMultipleProv","Scheduling");$$WP.Strings.removeMnemonic("@MYCHART@EXISTINGVVPROVIDER1@","Scheduling"),$$WP.Strings.removeMnemonic("@MYCHART@EXISTINGVVPROVIDERCOUNT@","Scheduling")}var o=$$WP.Strings.get("PatientHasExistingVideoVisitTitle","Scheduling"),r=$$WP.Strings.get("ExistingVideoVisitJumpButton","Scheduling"),l=$$WP.Strings.get("ExistingVideoVisitDismissButton","Scheduling"),s=[new $$WPComp.ComplexObjects.Button(r,null,"completeworkflow","redirect"),new $$WPComp.ComplexObjects.Button(l,null,"previousstep","continue")],a=$.proxy((function(t){if(t.indexOf("redirect")>0)if(this.__trackPatientsRedirectedToSchVideoVisits(),$$WPUtil.ShowAjaxSpinner($afe.select(".telehealthLoadingOverlay .ajaxspinner.defaultajaxoverlay")),$afe.select(".quickschedule.hardwaretest.cardlist").addClass("hidden"),$afe.select(".header.stepHeader").addClass("hidden"),$$WP.Utilities.UI.IsMobile){var i=this.__mobileCloseURL+"?mode=OnDemandTelehealth&workflowcomplete=1&skipCommunityLogout=1&eCSN="+e.OnDemandTelehealthData.ExistingVideoVisitCSN;$$WP.Utilities.TryRedirect(makeLink(i))}else{var n="Visits/VisitDetails?csn="+e.OnDemandTelehealthData.ExistingVideoVisitCSN;$$WP.Utilities.TryRedirect(makeLink(n))}}),this);new $$WPUtil.quickMessageBox(n,o,s,a)},__handleLoadError:function WP$Scheduling$SchedulingController$__handleLoadError(e){e===m.ThrottleError?this.__showGraphicalError("HighDemandFirstLoadDescription","HighDemandFirstLoadInstructions",!0):e===m.AccessCodeRequeued?this.__showGraphicalError("ExpiredAccessCodeError"):e===m.AccessCodeInvalid?this.__showGraphicalError("InvalidAccessCodeError"):this.__onError()},__showGraphicalError:function WP$Scheduling$SchedulingController$__showGraphicalError(e,t,i){var n={};$$WPUtil.HideAjaxSpinner(this.$workflowAjaxSpinner),n.HasRetryButton=i,$$WPUtil.IsNullOrEmpty(e)||(n.VerboseErrorDescription=$$WP.Strings.get(e,"Scheduling")),$$WPUtil.IsNullOrEmpty(t)||(n.VerboseErrorInstructions=$$WP.Strings.get(t,"Scheduling")),this.$root.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.VerboseErrorMessage,n)),i&&this.$root.find(".retryButton").click(this.__onStartOver)},__launchSchedulingWorkflow:function WP$Scheduling$SchedulingController$__launchSchedulingWorkflow(e){var i,n,o,r=null,l=!1;this.$workflowsContainer=this.__createContainer(),this.$root.safeAppend(this.$workflowsContainer),this.$workflowsContainer.show(),this.$schedulingStoppedContainer=this.__createContainer(),this.$root.safeAppend(this.$schedulingStoppedContainer),i=e,n=e.FavoriteAppointments,o=e.OriginalAppointmentInfo,this.__workflows=$$WP.Scheduling.Workflow.createWorkflowCollection(this.__workflowSettings.WorkflowType,i,n,o,this.__workflowSettings.ShowOtherProviderOption,this.__workflowSettings.ShowOtherRfvOption,this.__workflowSettings.RootDecisionTreeId,this.__workflowSettings.DecisionTreeAnswerId,this.__workflowSettings.DecisionTreeNodeId,this.__workflowSettings.DecisionTreeNodeCsn,this.__isAnonymous,this.__isGuest,this.__workflowSettings.IsFromPrelogin,this.__anonymousSettings,this.__schedulingControllerParams,this.__workflowSettings.IsFromShopperState,this.__workflowSettings.ServiceAreas),this.__shouldUsePredeterminedWorkflow(this.__schedulingControllerParams.isFromVisitDetails)&&((r=$$WP.Scheduling.Workflow.getWorkflowFromType(this.__workflows,this.__workflowSettings.WorkflowType,this.__workflowSettings.TicketId))||this.__addDeepLinkFailureBanner(this.__workflowSettings)),this.__preventAppendingErrorMessageOnStop=!1,!r||this.__workflowSettings.WorkflowType===t.WorkflowTypesEnum.NewProvider&&this.__isAnonymous&&null===r.SchedulingDataPool.Specialties.getFromIndex("Id",this.__workflowSettings.PreselectedSpecialtyId)?this.__runWorkflowSelectionStep():(l=!!this.__externalWorkflowEventCallbacks.onNavigateBack,this.__runWorkflow(r,l))},__shouldUsePredeterminedWorkflow:function WP$Scheduling$SchedulingController$__shouldUsePredeterminedWorkflow(e){var i=this.__workflowSettings.WorkflowType,n=!1;return i!==t.WorkflowTypesEnum.DecisionTreeNode&&i!==t.WorkflowTypesEnum.Ticket||(n=!$$WPUtil.IsNullOrEmpty(this.__schedulingControllerParams.decisionTreeNodeCSN)&&!$$WPUtil.IsNullOrEmpty(this.__schedulingControllerParams.decisionTreeNodeID)&&!$$WPUtil.IsNullOrEmpty(this.__schedulingControllerParams.rootDecisionTreeID)),!(!i||i===t.WorkflowTypesEnum.Standard||!e&&!n&&i===t.WorkflowTypesEnum.Ticket)&&(i!==t.WorkflowTypesEnum.NewProvider||!this.__isAnonymous||!(!this.__workflowSettings.PreselectedSpecialtyId&&!this.__canPreselectOnlyAvailableSpecialty()))},__addDeepLinkFailureBanner:function WP$Scheduling$SchedulingController$__addDeepLinkFailureBanner(e){e.WorkflowType===t.WorkflowTypesEnum.ExistingProvider&&e.PreselectedProviderIds&&1===e.PreselectedProviderIds.length&&e.Banners.push({bannerTypeReact:"warning",headerText:$$WP.Strings.get("SelectedProviderNotAvailableTitle","Scheduling.Fixed"),detailText:$$WP.Strings.get("SelectedProviderNotAvailableLandingPage","Scheduling")})},__parseInputParams:function WP$Scheduling$SchedulingController$__parseInputParams(e){this.__isAnonymous=!!e.isAnonymous&&!0===e.isAnonymous,this.__isGuest=!!e.isGuest&&"1"===e.isGuest.toString(),this.__hasDenyJoiningVideoVisitSecPoint=!!e.hasDenyJoiningVideoVisitSecPoint&&"1"===e.hasDenyJoiningVideoVisitSecPoint.toString(),this.__isEmbedded=!!e.embedded,this.__schedulingControllerParams=e},__addQueryStringParamsData:function WP$Scheduling$SchedulingController$__addQueryStringParamsData(e){var t,i=this.__getQueryStringParams();for(t in i)e.hasOwnProperty(t)||(e[t]=i[t])},__getQueryStringParams:function WP$Scheduling$SchedulingController$__getQueryStringParams(){var e={};return new URLSearchParams(window.location.search).forEach((function(t,i){e[i]=t})),e},__parseAnonymousSettings:function WP$Scheduling$SchedulingController$__parseAnonymousSettings(e){this.__anonymousSettings=new $$WP.Scheduling.AnonymousSettings,this.__anonymousSettings.AdultWorkflowEnabled=e.adultWorkflowEnabled,this.__anonymousSettings.ProxyWorkflowEnabled=e.proxyWorkflowEnabled,this.__anonymousSettings.SchedulingForSomeoneElse=e.anonymousWorkflowForProxy,this.__anonymousSettings.DisableScheduleAsGuest=e.disableScheduleAsGuest},__removePreloginSpinnerForWorkflowsThatBringTheirOwnFromHome:function WP$Scheduling$SchedulingController$__removePreloginSpinnerForWorkflowsThatBringTheirOwnFromHome(e){"OnDemandTelehealth"!==e.workflow&&"ProviderFinder"!==e.workflow&&$afe.select("#main > .ajaxspinner").remove()},__showCookieErrorToUser:function WP$Scheduling$SchedulingController$__showCookieErrorToUser(){$root.hide(),self===top?$afe.select("#noCookiesError").show():$afe.select("#noCookies").show()},__setUpMobileCloseUrl:function WP$Scheduling$SchedulingController$__setUpMobileCloseUrl(){(this.__workflowSettings.SkipMobileLogout||this.__schedulingControllerParams.skipmobilelogout&&"1"===this.__schedulingControllerParams.skipmobilelogout.toString())&&(this.__mobileCloseURL="inside.asp")},__canPreselectOnlyAvailableSpecialty:function WP$Scheduling$SchedulingController$__canPreselectOnlyAvailableSpecialty(){return this.__workflowSettings.SpecialtyStepSettings.HideIfOne&&this.__workflowSettings.AllowedSpecialtyIds&&this.__workflowSettings.AllowedSpecialtyIds.length<2},__launchScheduledTelemedicine:function WP$Scheduling$SchedulingController$__launchScheduledTelemedicine(e){e.OnDemandTelehealthData.OnDemandVideoVisitError?$$WP.Utilities.TryRedirect(makeLink("Scheduling/AnonymousTelehealth")):e.OnDemandTelehealthData.InXOrgQueue?$$WP.Utilities.UI.IsMobile?$$WP.Telemedicine.Helpers.getOrganizationAndVerifyVisit(e.OnDemandTelehealthData.XOrgId,e.OnDemandTelehealthData.XOrgCSN,"","",!0,$.proxy(this.__handleXOrgMobileRedirect,this)):$$WP.Utilities.TryRedirect(makeLink("Visits/visitslist?fromscheduling=true&xorgcsn="+encodeURIComponent(e.OnDemandTelehealthData.XOrgCSN)+"&xorgid="+encodeURIComponent(e.OnDemandTelehealthData.XOrgId))):$$WP.Utilities.UI.IsMobile?$$WP.Utilities.TryRedirect(makeLink(this.__mobileCloseURL+"?mode=OnDemandTelehealth&skipCommunityLogout=1&workflowcomplete=1&eCSN="+encodeURIComponent(e.OnDemandTelehealthData.OnDemandVideoVisitCSN))):this.__redirectToWebDetails("csn="+encodeURIComponent(e.OnDemandTelehealthData.OnDemandVideoVisitCSN))},__handleXOrgMobileRedirect:function WP$Scheduling$SchedulingController$__handleXOrgMobileRedirect(e){if(!$$WP.Telemedicine.Helpers.findAndHandleXOrgRedirectFailureScheduling(e,this.__showError,this.__showInfoPopup)){var t,i;if(e.URL)return i=$$WP.Strings.getForTemplate("SubjectHasExistingXOrgVideoVisitUnverifiedProxy","Scheduling"),t=$afe.renderTemplate($$WP.Templates.Core.Banner,{BannerType:"informationalType",DetailText:i}),$afe.select("#scheduling-workflow-container").safeReplaceWith(t),void(window.location=e.URL+"&mobile=0");var n=encodeURIComponent(e.CSN),o=encodeURIComponent(e.Organization.OrganizationId);$$WP.Utilities.TryRedirect(makeLink(this.__mobileCloseURL+"?mode=OnDemandTelehealth&workflowcomplete=1&skipCommunityLogout=1&eCSN="+n+"&xorgid="+o))}},__showError:function(e){$$WP.Strings.setDefaultNamespace("Visits");var t=$$WP.Strings.getForTemplate("ErrorTitle"),i=$$WP.Strings.getForTemplate("ErrorClose");$$WP.Strings.clearDefaultNamespace();var n=[new $$WPComp.ComplexObjects.Button(i,null,"cancelworkflow","")],o=$.proxy((function(e){$$WP.Utilities.TryRedirect(makeLink("inside.asp?moworkflow=completeandclose"))}),this);new $$WPUtil.quickMessageBox(e,t,n,o)},__showInfoPopup:function(e,t){var i=$$WP.Strings.getForTemplate("MessageBoxOK","global"),n=[new $$WPComp.ComplexObjects.Button(i,null,"otherbutton","continue")],o=$.proxy((function(e){$$WP.Utilities.TryRedirect(makeLink("inside.asp?moworkflow=completeandclose"))}),this);new $$WPUtil.quickMessageBox(e,t,n,o)},__getWorkflowStepDefinitions:function WP$Scheduling$SchedulingController$__getWorkflowStepDefinitions(e,i){var n=[];switch(e){case t.WorkflowTypesEnum.ExistingProvider:n=[this.__createProviderStepDefinition(),this.__createReasonForVisitStepDefinition(),this.__createStandardLqfStepDefinition(),this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location),this.__createDepartmentLqfStepDefinition(),this.__createCustomWorkflowStepDefinition(),this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition(),this.__createRequestStepDefinition()],o.Time),this.__createTelehealthLocationStepDefinition(),this.__createVerificationStepDefinition()];break;case t.WorkflowTypesEnum.NewProvider:n=this.__getNewProviderSteps(i);break;case t.WorkflowTypesEnum.Procedure:n=[this.__createReasonForVisitStepDefinition(),this.__createStandardLqfStepDefinition(),this.__createOnboardingStepDefinition(),this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location),this.__createDepartmentLqfStepDefinition(),this.__createMultiAppointmentStepDefinition(this.__createProviderStepDefinition(),o.Provider),this.__createCustomWorkflowStepDefinition(),this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition(),this.__createRequestStepDefinition()],o.Time),this.__createTelehealthLocationStepDefinition(),this.__createVerificationStepDefinition()];break;case t.WorkflowTypesEnum.Ticket:n=this.__getTicketSteps();break;case t.WorkflowTypesEnum.Request:n=[this.__createReasonForVisitStepDefinition(),this.__createProviderStepDefinition(),this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location),this.__createCustomWorkflowStepDefinition(),this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createRequestStepDefinition()],o.Request)];break;case t.WorkflowTypesEnum.Reschedule:n=[this.__createOnboardingStepDefinition(),this.__createStandardLqfStepDefinition(),this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location),this.__createMultiAppointmentStepDefinition(this.__createProviderStepDefinition()),this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition()],o.Time),this.__createTelehealthLocationStepDefinition(),this.__createConfirmationStepDefinition()];break;case t.WorkflowTypesEnum.DecisionTreeNode:n=this.__getDecisionTreeSteps();break;case t.WorkflowTypesEnum.ProviderFinder:case t.WorkflowTypesEnum.Widget:n=[this.__createCustomLandingStepDefinition(),this.__createStackedWorkflowStepDefinition([this.__createReasonForVisitStepDefinition()],o.ReasonForVisit),this.__createStandardLqfStepDefinition(),this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location),this.__createMultiAppointmentStepDefinition(this.__createProviderStepDefinition()),this.__createCustomWorkflowStepDefinition(),this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition(),this.__createRequestStepDefinition()],o.Time),this.__createTelehealthLocationStepDefinition()],$$WP.Utilities.UI.IsLoggedIn&&!$$WP.Utilities.UI.IsWorkflowRestricted?n.push(this.__createVerificationStepDefinition()):n.push(this.__createConfirmationStepDefinition());break;case t.WorkflowTypesEnum.OnDemandTelehealth:n=this.__getOnDemandTelehealthSteps();break;default:n=[this.__createHeaderlessProviderStepDefinition(),this.__createHeaderlessStackedWorkflowStepDefinition([this.__createReasonForVisitStepDefinition()]),this.__createHeaderlessSlotStepDefinition(),this.__createHeaderlessStackedWorkflowStepDefinition([this.__createDemographicsVerificationStepDefinition(),this.__createInsuranceVerificationStepDefinition(),this.__createConfirmationStepDefinition()])]}return n},__getNewProviderSteps:function WP$Scheduling$SchedulingController$__getNewProviderSteps(e){var t=[];return!$$WP.Utilities.UI.IsLoggedIn&&e||t.push(this.__createSpecialtyStepDefinition()),t.push(this.__createReasonForVisitStepDefinition()),t.push(this.__createStandardLqfStepDefinition()),t.push(this.__createOnboardingStepDefinition()),t.push(this.__createLocationStepDefinition()),t.push(this.__createMultiAppointmentStepDefinition(this.__createProviderStepDefinition(),null)),t.push(this.__createCustomWorkflowStepDefinition()),t.push(this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition()],o.Time)),t.push(this.__createTelehealthLocationStepDefinition()),$$WP.Utilities.UI.IsLoggedIn&&!$$WP.Utilities.UI.IsWorkflowRestricted?t.push(this.__createVerificationStepDefinition()):t.push(this.__createConfirmationStepDefinition()),t},__getTicketSteps:function WP$Scheduling$SchedulingController$__getTicketSteps(){var e=[];return e.push(this.__createTicketStepDefinition()),e.push(this.__createStandardLqfStepDefinition()),e.push(this.__createOnboardingStepDefinition()),e.push(this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location)),e.push(this.__createMultiAppointmentStepDefinition(this.__createProviderStepDefinition(),null)),e.push(this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition()],o.Time)),e.push(this.__createTelehealthLocationStepDefinition()),$$WP.Utilities.UI.IsLoggedIn&&!$$WP.Utilities.UI.IsWorkflowRestricted?e.push(this.__createVerificationStepDefinition()):$$WPUtil.IsNullOrEmpty(this.__workflowSettings.DecisionTreeNodeId)?e.push(this.__createConfirmationStepDefinition()):e.push(this.__createVerificationStepDefinition()),e},__getDecisionTreeSteps:function WP$Scheduling$SchedulingController$__getDecisionTreeSteps(){var e=[];return e.push(this.__createStandardLqfStepDefinition()),e.push(this.__createMultiAppointmentStepDefinition(this.__createLocationStepDefinition(),o.Location)),e.push(this.__createDepartmentLqfStepDefinition()),e.push(this.__createMultiAppointmentStepDefinition(this.__createProviderStepDefinition(),null)),e.push(this.__createCustomWorkflowStepDefinition()),e.push(this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition(),this.__createReservationStepDefinition(),this.__createRequestStepDefinition()],o.Time)),e.push(this.__createTelehealthLocationStepDefinition()),e.push(this.__createVerificationStepDefinition()),e},__getOnDemandTelehealthSteps:function WP$Scheduling$SchedulingController$__getOnDemandTelehealthSteps(){var e=[this.__createStackedWorkflowStepDefinition([this.__createTelehealthLocationStepDefinition()],o.TelehealthLocation),this.__createStackedWorkflowStepDefinition([this.__createReasonForVisitStepDefinition()],o.ReasonForVisit)];return this.__isAnonymous||this.__isGuest||e.push(this.__createStackedWorkflowStepDefinition([this.__createTelehealthPlatformStepDefinition()],o.TelehealthPlatform)),this.__workflowSettings.QuickScheduleStepSettings&&!0===this.__workflowSettings.QuickScheduleStepSettings.Hide||(e.push(this.__createStackedWorkflowStepDefinition([this.__createTelehealthQuickScheduleStepDefinition()],o.QuickSchedule)),e.push(this.__createStackedWorkflowStepDefinition([this.__createSlotStepDefinition()],o.Time))),this.__isAnonymous||this.__isGuest?this.__isGuest&&this.__schedulingControllerParams.rootDecisionTreeID?e.push(this.__createTelehealthVerificationStepDefinition()):e.push(this.__createStackedWorkflowStepDefinition([this.__createTelehealthSummaryStepDefinition()],o.TelehealthSummary)):(this.__workflowSettings.ShowInsuranceVerificationStep&&e.push(this.__createStackedWorkflowStepDefinition([this.__createInsuranceVerificationStepDefinition()],o.InsuranceVerification)),e.push(this.__createStackedWorkflowStepDefinition([this.__createTelehealthOrganizationStepDefinition(),this.__createTelehealthAuthorizationStepDefinition()],o.TelehealthOrganization)),e.push(this.__createTelehealthVerificationStepDefinition())),e},__runWorkflowSelectionStep:function WP$Scheduling$SchedulingController$__runWorkflowSelectionStep(){var e;e=this.__createContainer(),this.$workflowsContainer.safeAppend(e),e.show(),this.__workflowSelectionListenerId=this.__workflows.addPropertyListener("State",this.__onWorkflowSelected),this.__landingPageController=new $$WP.Scheduling.LandingPageController(e,this.__workflows,this.__workflowSettings,this.__isGuest,this.__workflowEventCallbacks),this.__landingPageController.addViewEventListener(this.__onViewEventTriggered),this.__landingPageController.show(),$(document).find(".title:has(h1)").addClass("hidden")},__onViewEventTriggered:function WP$Scheduling$SchedulingController$__onViewEventTriggered(e,t,i){$$WP.Scheduling.SchedulingController.logSchedulingViewEvent(e,t,i)},__runWorkflow:function WP$Scheduling$SchedulingController$__runWorkflow(e,t){var i;e.setProperty("State",$$WP.Scheduling.Workflow.StatesEnum.Selected),$(document).find(".title:has(h1)").removeClass("hidden"),this.$workflowsContainer.hide(),this.__linksSidebarWidget&&this.__linksSidebarWidget.remove(),e.IsFavorite&&(this.__setFavoritePreselections(e),this.__auditFavoriteAppointmentUse(e.FavoriteAppointmentInfo.Csn)),this.__isWorkflowEmpty(e)&&!this.__canWorkflowRunWhenEmpty(e)?this.__onStopScheduling({HideButton:!t}):!e.SchedulingControllerParams||$$WPUtil.IsNullOrEmpty(e.SchedulingControllerParams.rfvId)||this.__isAnyTargetRfvSchedulable(e.SchedulingControllerParams.workflow,e.SchedulingControllerParams.rfvId,e.SchedulingDataPool.ReasonsForVisit)?(i=this.__getWorkflowStepDefinitions(e.Type,t),this.__schedulingWorkflowController=new n(this.$root,i,e,this.__workflowSettings,this.__workflowEventCallbacks,this.__schedulingControllerParams.disableUTF8,t),this.__schedulingWorkflowController.render(),this.__loadBrowserIdIntoWorkflow(e),e.start(this.__workflowSettings)):this.__onStopScheduling({HideButton:!0})},__isWorkflowEmpty:function WP$SchedulingController$__isWorkflowEmpty(e){return 0===e.SchedulingDataPool.ProviderDepartmentPairs.Models.length},__canWorkflowRunWhenEmpty:function WP$SchedulingController$__canWorkflowRunWhenEmpty(e){var i=e.Type;return i===t.WorkflowTypesEnum.OnDemandTelehealth||i===t.WorkflowTypesEnum.Procedure||i===t.WorkflowTypesEnum.Ticket||i===t.WorkflowTypesEnum.NewProvider||i===t.WorkflowTypesEnum.Widget||i===t.WorkflowTypesEnum.ProviderFinder},__isAnyTargetRfvSchedulable:function WP$Scheduling$SchedulingController$__isAnyTargetRfvSchedulable(e,t,i){var n=[],o=0,r=0;if(this.__isWorkflowWithRfvsInDataPool(e)){if(!i||0===i.length)return!1;for(n=t.split(","),r=0;r<n.length;r++)if(o=n[r],this.__isRfvCatSchedulable(o,i))return!0;return!1}return!0},__isRfvCatSchedulable:function WP$Scheduling$SchedulingController$__isRfvCatSchedulable(e,t){var i;return!!(i=t.getFirstInIndex("CategoryValue",e))&&(!(!i.DefaultVisitType||!i.DefaultVisitType.IsPlaceholder)||$$WP.Scheduling.Workflow.doesRfvHaveMatchingProviderDepartmentPair(i,!0,!0))},__isWorkflowWithRfvsInDataPool:function WP$Scheduling$SchedulingController$__isWorkflowWithRfvsInDataPool(e){return"OnDemandTelehealth"!==e&&"NewProvider"!==e},__setFavoritePreselections:function WP$Scheduling$SchedulingController$__setFavoritePreselections(e){var t,i,n,o;t=e.FavoriteAppointmentInfo.ReasonForVisitCategoryValue,i=e.SchedulingDataPool.ReasonsForVisit.getFirstInIndex("CategoryValue",t).Id,this.__workflowSettings.PreselectedReasonForVisitIds=[i],n=e.FavoriteAppointmentInfo.ProviderId,$$WPUtil.IsNullOrEmpty(n)||(this.__workflowSettings.PreselectedProviderIds=[n]),o=e.FavoriteAppointmentInfo.DepartmentId,this.__workflowSettings.PreselectedDepartmentIds=[o]},__auditFavoriteAppointmentUse:function WP$Scheduling$SchedulingController$__auditFavoriteAppointmentUse(e){$.post({url:makeLink("Scheduling/AuditFavoriteAppointmentUse"),data:{csn:e}})},__trackNumOfPatientsInODVVWithSchVideoVisits:function WP$Scheduling$SchedulingController$__trackNumOfPatientsInODVVWithSchVideoVisits(){$.post({url:makeLink("Scheduling/AuditODVVPatientsWithExistingVisit")})},__trackPatientsRedirectedToSchVideoVisits:function WP$Scheduling$SchedulingController$__trackPatientsRedirectedToSchVideoVisits(){$.post({url:makeLink("Scheduling/AuditODVVReroutedToExistingVisit")})},__buildWorkflowEventCallbacks:function WP$Scheduling$SchedulingController$__buildWorkflowEventCallbacks(e){var t={};return t.onBeforeUnloadChanged=e.onBeforeUnloadChanged,t.onPromoted=e.onPromoted,t.onRecordMatched=e.onRecordMatched,t.storeSelfTriageSessionSuccessCallback=e.storeSelfTriageSessionSuccessCallback,t.onSchedulingComplete=this.__onSchedulingComplete,t.onRequestComplete=this.__onRequestCompleted,t.onTicketWaitListPreferencesUpdated=this.__onTicketWaitListPreferencesUpdated,t.onStopScheduling=this.__onStopScheduling,t.onNavigateBack=this.__onStartOver,t.onError=this.__onWorkflowStepError,t},__onWorkflowSelected:function WP$Scheduling$SchedulingController$__onWorkflowSelected(e){var i=this.__workflows.getFirstInIndex("State",t.StatesEnum.Selected);this.__runWorkflow(i,!0)},__onRequestCompleted:function WP$Scheduling$SchedulingController$__onRequestCompleted(e){this.__externalWorkflowEventCallbacks.onSchedulingComplete?this.__externalWorkflowEventCallbacks.onSchedulingComplete(c.VisitRequested,null,null,[]):($$WPUtil.IsNullOrEmpty(this.__schedulingWorkflowController)||(this.__schedulingWorkflowController.destroy(),this.__schedulingWorkflowController=null),e?$$WP.Utilities.TryRedirect(makeLink(this.__mobileCloseURL+"?mode=apptsched&workflowcomplete=1")):$$WP.Utilities.TryRedirect(makeLink("scheduling/requestconfirmation")))},__onTicketWaitListPreferencesUpdated:function WP$Scheduling$SchedulingController$__onTicketWaitListPreferencesUpdated(e){e&&(WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink("Scheduling/WaitListConfirmation")))},__onSchedulingComplete:function WP$Scheduling$SchedulingController$__onSchedulingComplete(e,t,i){var n=[];$$WPUtil.IsNullOrEmpty(this.__schedulingWorkflowController)||(this.__schedulingWorkflowController.destroy(!0),this.__schedulingWorkflowController=null),this.__externalWorkflowEventCallbacks.onSchedulingComplete?(n=this.__getSchedulingCompleteParams(),this.__externalWorkflowEventCallbacks.onSchedulingComplete(c.VisitScheduled,e,null,n)):i?this.__redirectToMobileDetails(e,t):this.__redirectToWebDetailsForScheduledAppointments(e,t)},__redirectToMobileDetails:function WP$Scheduling$SchedulingController$__redirectToMobileDetails(e,t){var i="",n="";1!==e.length&&t?n=this.__mobileCloseURL+"?mode=apptmake&workflowcomplete=1&apptcount="+e.length.toString():(i=e[0].CSN,n=this.__mobileCloseURL+"?mode=apptmake&workflowcomplete=1&eCSN="+encodeURIComponent(i)+"&apptcount="+e.length.toString()),WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink(n))},__redirectToWebDetailsForScheduledAppointments:function WP$Scheduling$SchedulingController$__redirectToWebDetailsForScheduledAppointments(e,i){var n="",o=this.__getSelectedWorkflow(),r=t.isWorkflowTypeOpenScheduling(o.Type);n=this.__getVisitDetailsPageParamsForAppointments(e,i),$$WPUtil.IsNullOrEmpty(n)||(n+="&"),n+="scheduled=1",r&&o.IsFromPrelogin&&(n+="&fromOpenScheduling=1"),this.__redirectToWebDetails(n)},__getVisitDetailsPageParamsForAppointments:function WP$Scheduling$SchedulingController$__getVisitDetailsPageParamsForAppointments(e,t){var i=[],n=[],o=0,r=null;if(1===e.length||!t)return(r=e[0]).WasScheduledOnRemoteDeployment?"uci="+encodeURIComponent(r.UCI):"csn="+encodeURIComponent(r.CSN);for(o=0;o<e.length;o++)(r=e[o]).WasScheduledOnRemoteDeployment?n.push(r.UCI):n.push(r.CSN);return n.length>0?"ucilist="+encodeURI(n.join(",")):i.length>0?"csnlist="+encodeURIComponent(i.join(",")):""},__redirectToWebDetails:function WP$Scheduling$SchedulingController$__redirectToWebDetails(e){var t="";t="Visits/VisitDetails",$$WPUtil.IsNullOrEmpty(e)||(t=t+"?"+e),WP.Events.cancelBeforeUnload(),$$WP.Utilities.TryRedirect(makeLink(t))},__onStopScheduling:function WP$Scheduling$SchedulingController$__onStopScheduling(e,i){var n=null,o=null,l=[];$$WPUtil.IsNullOrEmpty(this.__schedulingWorkflowController)||(this.__schedulingWorkflowController.destroy(),this.__schedulingWorkflowController=null),e=$$WPUtil.IsNullOrEmpty(e)?{}:e,this.__externalWorkflowEventCallbacks.onSchedulingComplete?(e.HasNoLicensedTelehealthProviders&&(i=d.HasNoLicensedTelehealthProviders),l=this.__getSchedulingCompleteParams(),this.__externalWorkflowEventCallbacks.onSchedulingComplete(c.NotScheduled,null,i,l)):this.__preventAppendingErrorMessageOnStop||(n=this.__getSelectedWorkflow(),e.IsOnDemandTelehealth?e=this.__setTelehealthStopSchedulingMessage(e):$$WPUtil.IsNullOrEmpty(n)||n.Type!==t.WorkflowTypesEnum.Ticket||(e.SchedulingStoppedPretext=$$WP.Strings.get("SchedulingTicketStoppedPretext","Scheduling")),$$WPUtil.IsNullOrEmpty(e.SchedulingStoppedTitle)&&(e.SchedulingStoppedTitle=$$WP.Strings.get("SchedulingStoppedTitle","Scheduling")),$$WPUtil.IsNullOrEmpty(e.SchedulingStoppedPretext)&&(e.SchedulingStoppedPretext=$$WP.Strings.get("SchedulingStoppedPretext","Scheduling")),$$WPUtil.IsNullOrEmpty(e.SchedulingStoppedButtontext)&&(e.SchedulingStoppedButtontext=$$WP.Strings.get("StartOverButton","Scheduling")),this.$root.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.SchedulingStopped,e)),this.$root.find("#schedulingstop-button").click(this.__onStartOver),this.__canStartOverFromStopScheduling(n.Type)||($afe.select("#scheduling-startover").off("click").addClass("hidden"),$afe.select("#schedulingstop-button").off("click").addClass("hidden")),this.$schedulingStoppedContainer.fadeIn(),$$WPSchedulingUtil.FocusElement(this.$root.find("h2")),this.__preventAppendingErrorMessageOnStop=!0,o=(new Date).toISOString(),u(r.SubmodulesEnum.StopScheduling,o,null,n.SchedulingDataPool,n))},__getSchedulingCompleteParams:function WP$Scheduling$SchedulingController$__getSchedulingCompleteParams(){var e=this.__getSelectedWorkflow(),t=null,i=[];return $$WPUtil.IsNullOrEmpty(e)||(i={isPersonalInfoCollectionComplete:!!(t=this.__getSelectedWorkflow().SchedulingDataPool.AppointmentBuilder).IsPersonalInfoCollectionComplete,isInsuranceCollectionComplete:!!t.IsInsuranceCollectionComplete,hasMatchingRecord:!!t.hasMatchingRecord,isPromoted:!!t.isPromoted}),i},__canStartOverFromStopScheduling:function WP$Scheduling$SchedulingController$__canStartOverFromStopScheduling(e){return!(e===t.WorkflowTypesEnum.Reschedule||e===t.WorkflowTypesEnum.Ticket&&$$WP.Utilities.UI.IsWorkflowRestricted)},__getSelectedWorkflow:function WP$Scheduling$SchedulingController$__getSelectedWorkflow(){var e,i;return i=1===(e=this.__workflows.size())?this.__workflows.Models[0]:this.__workflows.getFirstInIndex("State",t.StatesEnum.Selected),$$WPUtil.IsNullOrEmpty(i)&&e>1&&(i=this.__getDeeplinkedTicketWorkflow(e)),i},__getDeeplinkedTicketWorkflow:function WP$Scheduling$SchedulingController$__getDeeplinkedTicketWorkflow(e){var t,i,n;if(this.__workflows.Models[0].SchedulingControllerParams&&(this.__workflows.Models[0].SchedulingControllerParams.tktId?i=this.__workflows.Models[0].SchedulingControllerParams.tktId:this.__workflows.Models[0].SchedulingControllerParams.ticketId&&(i=this.__workflows.Models[0].SchedulingControllerParams.ticketId)),!$$WPUtil.IsNullOrEmpty(i))for(var o=0;o<=e;o++)if(this.__workflows.Models[o].TicketInfo&&this.__workflows.Models[o].TicketInfo.AppointmentRequests&&this.__workflows.Models[o].TicketInfo.AppointmentRequests[0].ID&&(n=this.__workflows.Models[o].TicketInfo.AppointmentRequests[0].ID),n===i){t=this.__workflows.Models[o];break}return t},__setTelehealthStopSchedulingMessage:function WP$Scheduling$SchedulingController$__renderTelehealthStopSchedulingMessage(e){return(e=$$WPUtil.IsNullOrEmpty(e)?{}:e).HasNoLicensedTelehealthProviders?(e.SchedulingStoppedTitle=$$WP.Strings.get("VideoVisitStoppedTitle","Scheduling"),e.SchedulingStoppedPretext=$$WP.Strings.get("VideoVisitNoLicensureStoppedPretext","Scheduling"),e.SchedulingStoppedButtontext=$$WP.Strings.get("StartOverButton","Scheduling")):(e.SchedulingStoppedTitle=$$WP.Strings.get("VideoVisitStoppedTitle","Scheduling"),e.SchedulingStoppedPretext=$$WP.Strings.get("VideoVisitStoppedPretext","Scheduling"),e.SchedulingStoppedButtontext=$$WP.Strings.get("StartOverButton","Scheduling")),e},__onError:function WP$Scheduling$SchedulingController$__onError(){var e,t=null;e={SchedulingStoppedTitle:$$WP.Strings.get("LandingPageErrorTitle","Scheduling"),SchedulingStoppedPretext:$$WP.Strings.get("LandingPageErrorMessage","Scheduling"),SchedulingStoppedButtontext:$$WP.Strings.get("LandingPageErrorButtonLabel","Scheduling")},this.$root.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.SchedulingStopped,e)),t=this.$root.find("#schedulingstop-button"),this.__isGuest?t.click(this.__onGuestBackButtonClicked):t.click(this.__onReturn),$$WPUtil.HideAjaxSpinner(this.$workflowAjaxSpinner)},__onWorkflowStepError:function WP$Scheduling$SchedulingController$__onWorkflowStepError(e){e||(e={SchedulingStoppedTitle:$$WP.Strings.get("WorkflowStepErrorTitle","Scheduling"),SchedulingStoppedPretext:$$WP.Strings.get("WorkflowStepErrorMessage","Scheduling"),SchedulingStoppedButtontext:$$WP.Strings.get("WorkflowStepErrorButtonLabel","Scheduling")}),this.__onStopScheduling(e)},__onStartOver:function WP$Scheduling$SchedulingController$__onStartOver(){if($$WPUtil.IsNullOrEmpty(this.__schedulingWorkflowController)||this.__schedulingWorkflowController.clearBeforeUnload(),this.__externalWorkflowEventCallbacks.onNavigateBack)this.__externalWorkflowEventCallbacks.onNavigateBack();else if(this.__workflows){var e=this.__workflows.getFirstInIndex("State",t.StatesEnum.Selected);$$WPSchedulingUtil.Reload(e.IsAuthenticatedWidget)}else location.reload()},__onReturn:function WP$Scheduling$SchedulingController$__onReturn(){window.history.back()},__onGuestBackButtonClicked:function WP$Scheduling$SchedulingController$__onGuestBackButtonClicked(){$$WP.Utilities.TryRedirect(makeLink("Home/Logout?postlogoutmode=openscheduling"))},__createContainer:function WP$Scheduling$SchedulingController$__createContainer(){return $$WP.SimpleTemplates.Div({class:"jqHidden stepcontainer"})},__createAnnouncementContainer:function WP$Scheduling$SchedulingController$__createAnnouncementContainer(){return $$WP.SimpleTemplates.Div({id:"announcementcontainer",class:"offscreen"})},__createTicketStepDefinition:function WP$Scheduling$SchedulingController$__createTicketStepDefinition(){return this.__createReadOnlyWorkflowStepDefinition(o.Ticket)},__createSpecialtyStepDefinition:function WP$Scheduling$SchedulingController$__createSpecialtyStepDefinition(){return this.__createWorkflowStepDefinition(i.Specialty,o.Specialty)},__createProviderStepDefinition:function WP$Scheduling$SchedulingController$__createProviderStepDefinition(){return this.__createWorkflowStepDefinition(i.Provider,o.Provider)},__createLocationStepDefinition:function WP$Scheduling$SchedulingController$__createLocationStepDefinition(){return this.__createWorkflowStepDefinition(i.Location,o.Location)},__createVerificationStepDefinition:function WP$Scheduling$SchedulingController$__createVerificationStepDefinition(){return this.__createWorkflowStepDefinition(i.Verification,o.Confirmation)},__createConfirmationStepDefinition:function WP$Scheduling$SchedulingController$__createConfirmationStepDefinition(){return this.__createWorkflowStepDefinition(i.Confirmation,o.Confirmation)},__createStandardLqfStepDefinition:function WP$Scheduling$SchedulingController$__createStandardLqfStepDefinition(){return this.__createWorkflowStepDefinition(i.StandardLqf,o.Questionnaire)},__createDepartmentLqfStepDefinition:function WP$Scheduling$SchedulingController$__createDepartmentLqfStepDefinition(){return this.__createWorkflowStepDefinition(i.DepartmentLqf,o.Questionnaire)},__createSlotStepDefinition:function WP$Scheduling$SchedulingController$__createSlotStepDefinition(){return this.__createWorkflowStepDefinition(i.Slot,o.Time)},__createReservationStepDefinition:function WP$Scheduling$SchedulingController$__createReservationStepDefinition(){return this.__createWorkflowStepDefinition(i.Reservation,null)},__createRequestStepDefinition:function WP$Scheduling$SchedulingController$__createRequestStepDefinition(){return this.__createWorkflowStepDefinition(i.Request,null)},__createReasonForVisitStepDefinition:function WP$Scheduling$SchedulingController$__createReasonForVisitStepDefinition(){return this.__createWorkflowStepDefinition(i.ReasonForVisit,o.ReasonForVisit)},__createHeaderlessProviderStepDefinition:function WP$Scheduling$SchedulingController$__createHeaderlessProviderStepDefinition(){return this.__createWorkflowStepDefinition(i.Provider,null)},__createHeaderlessSlotStepDefinition:function WP$Scheduling$SchedulingController$__createHeadlerlessSlotStepDefinition(){return this.__createWorkflowStepDefinition(i.Slot,null)},__createTelehealthLocationStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthLocationStepDefinition(){return this.__createWorkflowStepDefinition(i.TelehealthLocation,null)},__createTelehealthPlatformStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthPlatformStepDefinition(){return this.__createWorkflowStepDefinition(i.PlatformStep,null)},__createTelehealthQuickScheduleStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthQuickScheduleStepDefinition(){return this.__createWorkflowStepDefinition(i.QuickSchedule,null)},__createTelehealthOrganizationStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthOrganizationStepDefinition(){return this.__createWorkflowStepDefinition(i.TelehealthOrganization,null)},__createTelehealthAuthorizationStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthAuthorizationStepDefinition(){return this.__createWorkflowStepDefinition(i.TelehealthAuth,null)},__createTelehealthSummaryStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthSummaryStepDefinition(){return this.__createWorkflowStepDefinition(i.TelehealthSummary,null)},__createTelehealthVerificationStepDefinition:function WP$Scheduling$SchedulingController$__createTelehealthSummaryStepDefinition(){return this.__createWorkflowStepDefinition(i.Verification,o.TelehealthSummary)},__createInsuranceVerificationStepDefinition:function WP$Scheduling$SchedulingController$__createInsuranceVerificationStepDefinition(){return this.__createWorkflowStepDefinition(i.Insurance,null)},__createDemographicsVerificationStepDefinition:function WP$Scheduling$SchedulingController$__createDemographicsVerificationStepDefinition(){return this.__createWorkflowStepDefinition(i.Demographics,null)},__createMultiAppointmentStepDefinition:function WP$Scheduling$SchedulingController$__createMultiAppointmentStepDefinition(e,t){return{type:i.MultiAppointment,stackedSteps:[e],summaryType:t}},__createOnboardingStepDefinition:function WP$Scheduling$SchedulingController$__createOnboardingStepDefinition(){return this.__createWorkflowStepDefinition(i.Onboarding,null)},__createStackedWorkflowStepDefinition:function WP$Scheduling$SchedulingController$__createStackedWorkflowStepDefinition(e,t){return{type:i.Stacked,stackedSteps:e,summaryType:t}},__createHeaderlessStackedWorkflowStepDefinition:function WP$Scheduling$SchedulingController$__createHeaderlessStackedWorkflowStepDefinition(e){return this.__createStackedWorkflowStepDefinition(e,null)},__createCustomWorkflowStepDefinition:function WP$Scheduling$SchedulingController$__createCustomWorkflowStepDefinition(){return this.__createWorkflowStepDefinition(i.Custom)},__createCustomLandingStepDefinition:function WP$Scheduling$SchedulingController$__createCustomLandingStepDefinition(){return this.__createWorkflowStepDefinition(i.CustomLanding)},__createWorkflowStepDefinition:function WP$Scheduling$SchedulingController$__createWorkflowStepDefinition(e,t){return this.__createRawWorkflowStepDefinition(e,t,!1)},__createReadOnlyWorkflowStepDefinition:function WP$Scheduling$SchedulingController$__createWorkflowStepDefinition(e){return this.__createRawWorkflowStepDefinition("",e,!0)},__createRawWorkflowStepDefinition:function WP$Scheduling$SchedulingController$__createRawWorkflowStepDefinition(e,t,i){return{type:e,summaryType:t,isReadOnly:i}},__showLackOfVideoVisitSecurityError:function WP$Scheduling$SchedulingController$__showLackOfVideoVisitSecurityError(){var e={SchedulingStoppedTitle:$$WP.Strings.get("LandingPageErrorTitle","Scheduling"),SchedulingStoppedPretext:$$WP.Strings.get("LandingPageVideoVisitSecurityErrorMessage","Scheduling"),SchedulingStoppedButtontext:$$WP.Strings.get("LandingPageErrorButtonLabel","Scheduling")};this.$root.safeAppend($afe.renderTemplate($$WP.Templates.Scheduling.SchedulingStopped,e)),this.$root.find("#schedulingstop-button").click(this.__onReturn)},__loadBrowserIdIntoWorkflow:function WP$Scheduling$SchedulingController$__loadBrowserIdIntoWorkflow(e){$$WP.WidgetMode?this.__loadBrowserIdIntoWorkflowForEmbedded(e):this.__loadBrowserIdIntoWorkflowForStandalone(e)},__loadBrowserIdIntoWorkflowForStandalone:function WP$Scheduling$SchedulingController$__loadBrowserIdIntoWorkflowForStandalone(e){var t=null,i="OSCountToken",n=new Date;t=getCookie(i),$$WPUtil.IsNullOrEmpty(t)&&(t=$$WPSchedulingUtil.CreateBrowserId(),n.setTime(n.getTime()+864e5),setCookie(i,t,!1,n)),e.BrowserId=t},__loadBrowserIdIntoWorkflowForEmbedded:function WP$Scheduling$SchedulingController$__loadBrowserIdIntoWorkflowForEmbedded(e){$$WPUtil.GetCrossDomainData("OSCountToken").then(function(e,t){if(null===t){t=$$WPSchedulingUtil.CreateBrowserId();var i={};i.OSCountToken=t,$$WPUtil.SetCrossDomainData(i)}e.BrowserId=t}.bind(this,e))}},u=function WP$Scheduling$SchedulingController$logSchedulingViewEvent(e,t,i,n,o,r){var l,s,a;e&&(_(e)||(s=V(e,o),$$WP.Analytics.UsageTrackingController.logThirdPartyViewEvent(s),o&&(l=g(e,t,i,n,o)),l&&!o.IsAnonymous&&$$WP.Analytics.UsageTrackingController.logViewEvent(l,r),$$WP.Analytics.UsageTrackingController.getIsSessionAnalyticsEnabled()&&(a=p(e,i,n,o,l),$$WP.Analytics.UsageTrackingController.logSessionEvent(a)),S.Submodule=e))},_=function WP$Scheduling$SchedulingController$s_isDuplicateStep(e){return e!==$$WP.Analytics.ViewEvent.SubmodulesEnum.MyChartLinkStep&&e===S.Submodule},S={},g=function WP$Scheduling$SchedulingController$s_getSchedulingViewEvent(e,i,n,o,l){var s,a,c,d,h,u,_=[],S=[],g=[],p=[],f=null,$=null,m=null;for(a=new r(r.ModulesEnum.Scheduling,e,i),l&&(c=l.Type,a.addEntryToExtraInfo(0,"Workflow",c,!1)),s=0;s<o.AppointmentBuilder.Appointments.Models.length;s++)c!==t.WorkflowTypesEnum.OnDemandTelehealth&&o&&o.AppointmentBuilder&&(null,null,f=null,$=null,m=null,_=[],S=[],g=[],p=[],d=W(o.AppointmentBuilder),_=P(s,o.AppointmentBuilder),S=D(s,o.AppointmentBuilder),g=y(s,o.AppointmentBuilder),p=T(s,o.AppointmentBuilder),h="-1"===_[0],a.addEntryToExtraInfo(s,"SelectedProviders",_,!h),a.addEntryToExtraInfo(s,"SelectedLocations",S,!0),a.addEntryToExtraInfo(s,"SelectedSlots",g,!1),a.addEntryToExtraInfo(s,"SelectedLqfIds",p,!0),a.addEntryToExtraInfo(s,"ProviderLqfAction",$$WP.Scheduling.ProvidersUpdatedViewModel.getAppointmentProviderLqfAction(o),!1),t.isWorkflowTypeOpenScheduling(c)?($=k(o.AppointmentBuilder),f=w(o.AppointmentBuilder),u="-1"===$,a.addEntryToExtraInfo(s,"SelectedSpecialty",f,!0),a.addEntryToExtraInfo(s,"SelectedVisitType",$,!u)):a.addEntryToExtraInfo(s,"SelectedRFV",d,!1),c===t.WorkflowTypesEnum.Ticket&&(m=E(s,o.AppointmentBuilder),a.addEntryToExtraInfo(s,"BundleId",m,!0))),n&&a.addEntryToExtraInfo(s,n.Key,n.Values,n.AreValuesEncrypted);return a},p=function WP$Scheduling$SchedulingController$s_getSchedulingUserActionEvent(e,i,n,o,l){var a,c,d;if(a=new s(s.ActionsEnum.SchedulingViewEvent),e&&a.addDataEntry(s.RelationTypesEnum.Submodule,e,-1,!1),i)for(c=0;c<i.Values.length;c++)a.addDataEntry(s.RelationTypesEnum[i.Key],i.values[valuesindex],-1,i.AreValuesEncrypted);if(l&&f(l,n,a),e===r.SubmodulesEnum.SlotStep&&(d=I(n.Solutions.Models),a.addDataEntry(s.RelationTypesEnum.HasSlotsAvailable,d,-1,!1)),o){var h=t.getPatientFacingWorkflowType(o.Type,o.IsAnonymous);h&&a.addDataEntry(s.RelationTypesEnum.PatientFacingWorkflow,h,-1,!1)}return a},f=function WP$Scheduling$SchedulingController$s_wrapViewEvent(e,t,i){var n,o,r,l,a,c,d,h,u;if(e&&e.ExtraInfoEntries)for(n=0;n<e.ExtraInfoEntries.length;n++){if(a=(o=e.ExtraInfoEntries[n]).Key,l=o.Values,c=o.AreValuesEncrypted,r=o.Index,"SelectedLocations"===a)for(d=C(r,t.AppointmentBuilder),h=0;h<d.length;h++)i.addDataEntry(s.RelationTypesEnum.Departments,d[h],r,!0);if(null!=a)for(u=0;u<l.length;u++)i.addDataEntry(s.RelationTypesEnum[a],l[u],r,c)}},m={ThrottleError:"ConnectionThrottled",AccessCodeRequeued:"AccessCodeRequeued",AccessCodeInvalid:"AccessCodeInvalid"},W=function WP$Scheduling$SchedulingController$s_getSelectedRfvCategoryValue(e){var t,i;return(t=e.getReasonForVisit())&&(i=t.CategoryValue),i},w=function WP$Scheduling$SchedulingController$s_getSelectedSpecialtyId(e){var t,i=null;return(t=e.getSpecialty())&&(i=t.Id),i},k=function s_getFirstSelectedVisitTypeId(e){var t,i;return null===(t=e.getFirstAppointment())||null===(i=t.VisitType)?null:i.ID},P=function WP$Scheduling$SchedulingController$s_getSelectedProviderIds(e,t){var i,n,o={};for(n=t.getAppointmentProviders(e),i=0;i<n.length;i++)n[i].AnyOption||(o[n[i].ID]=!0);return v(o)},D=function WP$Scheduling$SchedulingController$s_getSelectedLocationIds(e,t){var i,n,o,r,l,s={},a=t.getAppointmentLocations(e),c=t.AvailableLocations,d=$$WPUtil.IsNullOrEmpty(c)?[]:c[e];for(i=0;i<a.length;i++)if(r=(o=a[i]).getNonprefixedId(),o.IsSingleDepartment)for(n=0;n<d.length;n++)(l=d[n]).Id===o.Id?s[r]=!0:l.DepartmentIds.includes(r)&&(s[l.Id]=!0);else s[r]=!0;return v(s)},C=function WP$Scheduling$SchedulingController$s_getSelectedDepartmentIds(e,t){var i,n,o,r,l={};for(o=t.getAppointmentLocations(e),i=0;i<o.length;i++)for(r=o[i],n=0;n<r.DepartmentIds.length;n++)"-1"!==r.DepartmentIds[n]&&(l[r.DepartmentIds[n]]=!0);return v(l)},T=function WP$Scheduling$SchedulingController$s_getSelectedLqfIds(e,t){var i,n,o={};for(n=t.getAppointmentLqfs(e),i=0;i<n.length;i++)o[n[i].Id]=!0;return v(o)},y=function WP$Scheduling$SchedulingController$s_getSelectedSlotInstants(e,t){var i,n,o=[];for(n=t.getAppointmentSlots(e),i=0;i<n.length;i++)null!==n[i].DateTimeUtc&&o.push(n[i].DateTimeUtc.toISOString());return o},E=function WP$Scheduling$SchedulingController$s_getBundleId(e,t){return t.getBundleId(e)},I=function WP$Scheduling$SchedulingController$s_hadSchedulingAvailability(e){var t,i=0;for(t=e.length-1;t>=0;t--)if(!1===e[t].IsRequest){i=1;break}return i},v=function WP$Scheduling$SchedulingController$s_convertIndexToArray(e){var t=[];for(var i in e)t.push(i);return t},V=function WP$Scheduling$SchedulingController$s_getThirdPartySchedulingViewEvent(e,i){var n,o,s,a;return o="/Scheduling/"+(n=r.getNameFromSubmodule(e)),s="Scheduling - "+n,i&&(a={Workflow:t.getThirdPartyWorkflowNameFromWorkflowType(i.Type)}),new l(o,s,a)};a.prototype=h,a.SchedulingStatusEnum=c,a.NotScheduledReasonEnum=d,a.logSchedulingViewEvent=u,a.logWorkflowStart=function WP$Scheduling$SchedulingController$logWorkflowStart(e,i){var n,o,r;n="1"===$$WPUtil.GetQueryStringParameterValue(window.location.search,"isGuestTicket"),o=t.tryParseWorkflowType(e.workflow),$$WP.WidgetMode||o===t.WorkflowTypesEnum.ProviderFinder||!$$WPUtil.IsNullOrEmpty(e.reasonForVisitId)||n||(o=$$WPUtil.IsNullOrEmpty(o)?t.WorkflowTypesEnum.Standard:o,r=t.getPatientFacingWorkflowType(o,i),$$WP.Analytics.UsageTrackingController.logWorkflowStartEvent(r))},$$WP.Scheduling.SchedulingController=a,a.extend(e,"WP$Scheduling$SchedulingController")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$$WP$Scheduling$SchedulingController(e){$$WP.Debug.UnitTest.assert}));;
!function WP$UI$ChipCarouselController$definition(){var t=function WP$UI$ChipCarouselController(t){this.WP$Controllers$Controller(),this.proxify("__animateCarouselScrolling"),this.template=t};t.prototype={$container:null,$carousel:null,$chipCurrentlyScrolling:null,template:null,__isFirstRender:!0,__lastScrollPosition:0,__chipScrollSearchString:null,render:function render(t,e){t.length>0&&(this.$container=t,this.__updateCarousel(e))},__updateCarousel:function __updateCarousel(t){this.__renderCarousel(t),this.$carousel.on("scroll",$.proxy(this.__onCarouselScrolled,this)),this.$carousel.find("input").on("focus",this.__onChipInputFocused),this.$carousel.find("input").on("blur",this.__onChipInputBlurred),this.__setCurrentScrollPosition(this.__lastScrollPosition),this.__animateCarouselIntoView()},selectChip:function selectChip(t){t.prop("checked",!0),t.closest(".chip").addClass("selected"),this.scrollChipIntoView(this.$carousel.find(this.__chipScrollSearchString))},deselectAllChips:function deselectAllChips(){this.$carousel.find(".chip").removeClass("selected")},scrollChipIntoView:function scrollChipIntoView(t){null!==t&&t.length&&t!==this.$chipCurrentlyScrolling&&(this.__isFirstRender||(this.$chipCurrentlyScrolling=t,setTimeout(this.__animateCarouselScrolling,0,t)))},__animateCarouselScrolling:function __animateCarouselScrolling(t){this.__setCurrentScrollPosition(this.__lastScrollPosition);var e=t.offset().left,l=t.outerWidth(),i=this.$carousel.innerWidth(),o=this.__getCurrentScrollPosition(),r=(i-l)/2;this.$carousel.animate({scrollLeft:o+e-r},500)},__setCurrentScrollPosition:function __setCurrentScrollPosition(t){this.$carousel.scrollLeft(t)},__getCurrentScrollPosition:function __getCurrentScrollPosition(){return this.$carousel.scrollLeft()},__animateCarouselIntoView:function __animateCarouselIntoview(){var t,e=this.$carousel.find(".chip").last();0!==e.length&&(this.__isFirstRender?(e.offset().left+e.width()-(t=$afe.jq(window).width())>t?this.$carousel.addClass("easeCarousel"):this.$carousel.addClass("defaultMargin"),this.__onCarouselScrolled(),setTimeout($.proxy((function(){this.__isFirstRender=!1}),this),750)):this.$carousel.addClass("defaultMargin"))},__renderCarousel:function __renderCarousel(t){this.$container.empty(),this.$container.safeAppend($afe.renderTemplate(this.template,t)),this.$carousel=this.$container.find(".chipContainer")},__getCurrentlySelectedChip:function __getCurrentlySelectedChip(){return this.$carousel.find(".chip.selected")},__onCarouselScrolled:function __onCarouselScrolled(){var t=this.$carousel.find(".hasInput :text"),e=t.val();this.__lastScrollPosition=this.__getCurrentScrollPosition(),t.val(" ").val(e)}},$$WP.UI=$$WP.UI||{},$$WP.UI.ChipCarouselController=t,t.extend($$WP.Controllers.Controller,"WP$UI$ChipCarouselController")}();;
/* @preserve
 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var e,i,n=1,o=arguments.length;n<o;n++)for(e in i=arguments[n])t[e]=i[e];return t}var R=Object.create||function(t){return N.prototype=t,new N};function N(){}function a(t,e){var i,n=Array.prototype.slice;return t.bind?t.bind.apply(t,n.call(arguments,1)):(i=n.call(arguments,2),function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)})}var D=0;function h(t){return"_leaflet_id"in t||(t._leaflet_id=++D),t._leaflet_id}function j(t,e,i){var n,o,s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)};return r}function H(t,e,i){var n=e[1],e=e[0],o=n-e;return t===n&&i?t:((t-e)%o+o)%o+e}function u(){return!1}function i(t,e){return!1===e?t:(e=Math.pow(10,void 0===e?6:e),Math.round(t*e)/e)}function W(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return W(t).split(/\s+/)}function c(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?R(t.options):{}),e)t.options[i]=e[i];return t.options}function U(t,e,i){var n,o=[];for(n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var V=/\{ *([\w_ -]+) *\}/g;function q(t,i){return t.replace(V,function(t,e){e=i[e];if(void 0===e)throw new Error("No value provided for variable "+t);return e="function"==typeof e?e(i):e})}var d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function G(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var K="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Y(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function J(t){var e=+new Date,i=Math.max(0,16-(e-X));return X=e+i,window.setTimeout(t,i)}var $=window.requestAnimationFrame||Y("RequestAnimationFrame")||J,Q=window.cancelAnimationFrame||Y("CancelAnimationFrame")||Y("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function x(t,e,i){if(!i||$!==J)return $.call(window,a(t,e));t.call(e)}function r(t){t&&Q.call(window,t)}var tt={__proto__:null,extend:l,create:R,bind:a,get lastId(){return D},stamp:h,throttle:j,wrapNum:H,falseFn:u,formatNum:i,trim:W,splitWords:F,setOptions:c,getParamString:U,template:q,isArray:d,indexOf:G,emptyImageUrl:K,requestFn:$,cancelFn:Q,requestAnimFrame:x,cancelAnimFrame:r};function et(){}et.extend=function(t){function e(){c(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var i,n=e.__super__=this.prototype,o=R(n);for(i in(o.constructor=e).prototype=o,this)Object.prototype.hasOwnProperty.call(this,i)&&"prototype"!==i&&"__super__"!==i&&(e[i]=this[i]);if(t.statics&&l(e,t.statics),t.includes){var s=t.includes;if("undefined"!=typeof L&&L&&L.Mixin){s=d(s)?s:[s];for(var r=0;r<s.length;r++)s[r]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}l.apply(null,[o].concat(t.includes))}return l(o,t),delete o.statics,delete o.includes,o.options&&(o.options=n.options?R(n.options):{},l(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},et.include=function(t){var e=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},et.mergeOptions=function(t){return l(this.prototype.options,t),this},et.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var e={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=F(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}else delete this._events;return this},_on:function(t,e,i,n){"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1===this._listens(t,e,i)&&(e={fn:e,ctx:i=i===this?void 0:i},n&&(e.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e))},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=u;delete this._events[t]}else"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1!==(e=this._listens(t,e,i))&&(i=n[e],this._firingCount&&(i.fn=u,this._events[t]=n=n.slice()),n.splice(e,1))},fire:function(t,e,i){if(this.listens(t,i)){var n=l({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s],h=a.fn;a.once&&this.off(t,h,a.ctx),h.call(a.ctx||this,n)}this._firingCount--}}i&&this._propagateEvent(n)}return this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e,s=("function"!=typeof e&&(n=!!e,i=o=void 0),this._events&&this._events[t]);if(s&&s.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var r in this._eventParents)if(this._eventParents[r].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(this._events){var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,s=n.length;o<s;o++)if(n[o].fn===e&&n[o].ctx===i)return o}return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[h(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[h(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}},it=(e.addEventListener=e.on,e.removeEventListener=e.clearAllEventListeners=e.off,e.addOneTimeEventListener=e.once,e.fireEvent=e.fire,e.hasEventListeners=e.listens,et.extend(e));function p(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var nt=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function m(t,e,i){return t instanceof p?t:d(t)?new p(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new p(t.x,t.y):new p(t,e,i)}function f(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function _(t,e){return!t||t instanceof f?t:new f(t,e)}function s(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function g(t,e){return t instanceof s?t:new s(t,e)}function v(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function w(t,e,i){return t instanceof v?t:d(t)&&"object"!=typeof t[0]?3===t.length?new v(t[0],t[1],t[2]):2===t.length?new v(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new v(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new v(t,e,i)}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(t){return this.clone()._add(m(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(m(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new p(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new p(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=nt(this.x),this.y=nt(this.y),this},distanceTo:function(t){var e=(t=m(t)).x-this.x,t=t.y-this.y;return Math.sqrt(e*e+t*t)},equals:function(t){return(t=m(t)).x===this.x&&t.y===this.y},contains:function(t){return t=m(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+i(this.x)+", "+i(this.y)+")"}},f.prototype={extend:function(t){var e,i;if(t){if(t instanceof p||"number"==typeof t[0]||"x"in t)e=i=m(t);else if(e=(t=_(t)).min,i=t.max,!e||!i)return this;this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone())}return this},getCenter:function(t){return m((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return m(this.min.x,this.max.y)},getTopRight:function(){return m(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t=("number"==typeof t[0]||t instanceof p?m:_)(t))instanceof f?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.x<i.x,t=t.y>e.y&&n.y<i.y;return o&&t},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,t=Math.abs(e.y-i.y)*t;return _(m(e.x-n,e.y-t),m(i.x+n,i.y+t))},equals:function(t){return!!t&&(t=_(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},s.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof v)i=e=t;else{if(!(t instanceof s))return t?this.extend(w(t)||g(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new v(e.lat,e.lng),this._northEast=new v(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,t=Math.abs(e.lng-i.lng)*t;return new s(new v(e.lat-n,e.lng-t),new v(i.lat+n,i.lng+t))},getCenter:function(){return new v((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new v(this.getNorth(),this.getWest())},getSouthEast:function(){return new v(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t=("number"==typeof t[0]||t instanceof v||"lat"in t?w:g)(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof s?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.lat<i.lat,t=t.lng>e.lng&&n.lng<i.lng;return o&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=g(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var ot={latLngToPoint:function(t,e){t=this.projection.project(t),e=this.scale(e);return this.transformation._transform(t,e)},pointToLatLng:function(t,e){e=this.scale(e),t=this.transformation.untransform(t,e);return this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){var e;return this.infinite?null:(e=this.projection.bounds,t=this.scale(t),new f(this.transformation.transform(e.min,t),this.transformation.transform(e.max,t)))},infinite:!(v.prototype={equals:function(t,e){return!!t&&(t=w(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+i(this.lat,t)+", "+i(this.lng,t)+")"},distanceTo:function(t){return st.distance(this,w(t))},wrap:function(){return st.wrapLatLng(this)},toBounds:function(t){var t=180*t/40075017,e=t/Math.cos(Math.PI/180*this.lat);return g([this.lat-t,this.lng-e],[this.lat+t,this.lng+e])},clone:function(){return new v(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?H(t.lng,this.wrapLng,!0):t.lng;return new v(this.wrapLat?H(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,e=e.lng-i.lng;return 0==n&&0==e?t:(i=t.getSouthWest(),t=t.getNorthEast(),new s(new v(i.lat-n,i.lng-e),new v(t.lat-n,t.lng-e)))}},st=l({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),e=Math.sin((e.lng-t.lng)*i/2),t=s*s+Math.cos(n)*Math.cos(o)*e*e,i=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*i}}),rt=6378137,rt={R:rt,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,i=Math.max(Math.min(i,t.lat),-i),i=Math.sin(i*e);return new p(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new v((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new f([-(rt=rt*Math.PI),-rt],[rt,rt])};function at(t,e,i,n){d(t)?(this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3]):(this._a=t,this._b=e,this._c=i,this._d=n)}function ht(t,e,i,n){return new at(t,e,i,n)}at.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new p((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var lt=l({},st,{code:"EPSG:3857",projection:rt,transformation:ht(lt=.5/(Math.PI*rt.R),.5,-lt,.5)}),ut=l({},lt,{code:"EPSG:900913"});function ct(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,e){for(var i,n,o,s,r="",a=0,h=t.length;a<h;a++){for(i=0,n=(o=t[a]).length;i<n;i++)r+=(i?"L":"M")+(s=o[i]).x+" "+s.y;r+=e?b.svg?"z":"x":""}return r||"M0 0"}var _t=document.documentElement.style,pt="ActiveXObject"in window,mt=pt&&!document.addEventListener,n="msLaunchUri"in navigator&&!("documentMode"in document),ft=y("webkit"),gt=y("android"),vt=y("android 2")||y("android 3"),yt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),yt=gt&&y("Google")&&yt<537&&!("AudioNode"in window),xt=!!window.opera,wt=!n&&y("chrome"),bt=y("gecko")&&!ft&&!xt&&!pt,Pt=!wt&&y("safari"),Lt=y("phantom"),o="OTransition"in _t,Tt=0===navigator.platform.indexOf("Win"),Mt=pt&&"transition"in _t,zt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vt,_t="MozPerspective"in _t,Ct=!window.L_DISABLE_3D&&(Mt||zt||_t)&&!o&&!Lt,Zt="undefined"!=typeof orientation||y("mobile"),St=Zt&&ft,Et=Zt&&zt,kt=!window.PointerEvent&&window.MSPointerEvent,Ot=!(!window.PointerEvent&&!kt),At="ontouchstart"in window||!!window.TouchEvent,Bt=!window.L_NO_TOUCH&&(At||Ot),It=Zt&&xt,Rt=Zt&&bt,Nt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Dt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,e),window.removeEventListener("testPassiveEventSupport",u,e)}catch(t){}return t}(),jt=!!document.createElement("canvas").getContext,Ht=!(!document.createElementNS||!ct("svg").createSVGRect),Wt=!!Ht&&((Wt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='<v:shape adj="1"/>',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Ft=b.msPointer?"MSPointerDown":"pointerdown",Ut=b.msPointer?"MSPointerMove":"pointermove",Vt=b.msPointer?"MSPointerUp":"pointerup",qt=b.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return"touchstart"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn("wrong event specified:",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener("dblclick",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener("click",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function _e(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||"",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else ve(t,e)||ye(t,((i=xe(t))?i+" ":"")+e)}function z(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,W((" "+xe(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function xe(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function C(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}}function we(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function be(t,e,i){e=e||new p(0,0);t.style[ue]=(b.ie3d?"translate("+e.x+"px,"+e.y+"px)":"translate3d("+e.x+"px,"+e.y+"px,0)")+(i?" scale("+i+")":"")}function Z(t,e){t._leaflet_pos=e,b.any3d?be(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Pe(t){return t._leaflet_pos||new p(0,0)}function Le(){S(window,"dragstart",O)}function Te(){k(window,"dragstart",O)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),le=(he=t).style.outlineStyle,t.style.outlineStyle="none",S(window,"keydown",ze))}function ze(){he&&(he.style.outlineStyle=le,le=he=void 0,k(window,"keydown",ze))}function Ce(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}ae="onselectstart"in document?(re=function(){S(window,"selectstart",O)},function(){k(window,"selectstart",O)}):(se=we(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),re=function(){var t;se&&(t=document.documentElement.style,oe=t[se],t[se]="none")},function(){se&&(document.documentElement.style[se]=oe,oe=void 0)});pt={__proto__:null,TRANSFORM:ue,TRANSITION:ce,TRANSITION_END:de,get:_e,getStyle:pe,create:P,remove:T,empty:me,toFront:fe,toBack:ge,hasClass:ve,addClass:M,removeClass:z,setClass:ye,getClass:xe,setOpacity:C,testProp:we,setTransform:be,setPosition:Z,getPosition:Pe,get disableTextSelection(){return re},get enableTextSelection(){return ae},disableImageDrag:Le,enableImageDrag:Te,preventOutline:Me,restoreOutline:ze,getSizedParentNode:Ce,getScale:Ze};function S(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)ke(t,o,e[o],i);else for(var s=0,r=(e=F(e)).length;s<r;s++)ke(t,e[s],i,n);return this}var E="_leaflet_events";function k(t,e,i,n){if(1===arguments.length)Se(t),delete t[E];else if(e&&"object"==typeof e)for(var o in e)Oe(t,o,e[o],i);else if(e=F(e),2===arguments.length)Se(t,function(t){return-1!==G(e,t)});else for(var s=0,r=e.length;s<r;s++)Oe(t,e[s],i,n);return this}function Se(t,e){for(var i in t[E]){var n=i.split(/\d/)[0];e&&!e(n)||Oe(t,n,null,null,i)}}var Ee={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function ke(e,t,i,n){var o,s,r=t+h(i)+(n?"_"+h(n):"");e[E]&&e[E][r]||(s=o=function(t){return i.call(n||e,t||window.event)},!b.touchNative&&b.pointer&&0===t.indexOf("touch")?o=Jt(e,t,o):b.touch&&"dblclick"===t?o=ne(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ee[t]||t,o,!!b.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?e.addEventListener(Ee[t],o=function(t){t=t||window.event,We(e,t)&&s(t)},!1):e.addEventListener(t,s,!1):e.attachEvent("on"+t,o),e[E]=e[E]||{},e[E][r]=o)}function Oe(t,e,i,n,o){o=o||e+h(i)+(n?"_"+h(n):"");var s,r,i=t[E]&&t[E][o];i&&(!b.touchNative&&b.pointer&&0===e.indexOf("touch")?(n=t,r=i,Gt[s=e]?n.removeEventListener(Gt[s],r,!1):console.warn("wrong event specified:",s)):b.touch&&"dblclick"===e?(n=i,(r=t).removeEventListener("dblclick",n.dblclick),r.removeEventListener("click",n.simDblclick)):"removeEventListener"in t?t.removeEventListener(Ee[e]||e,i,!1):t.detachEvent("on"+e,i),t[E][o]=null)}function Ae(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Be(t){return ke(t,"wheel",Ae),this}function Ie(t){return S(t,"mousedown touchstart dblclick contextmenu",Ae),t._leaflet_disable_click=!0,this}function O(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Re(t){return O(t),Ae(t),this}function Ne(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function De(t,e){var i,n;return e?(n=(i=Ze(e)).boundingClientRect,new p((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)):new p(t.clientX,t.clientY)}var je=b.linux&&b.chrome?window.devicePixelRatio:b.mac?3*window.devicePixelRatio:0<window.devicePixelRatio?2*window.devicePixelRatio:1;function He(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function We(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var mt={__proto__:null,on:S,off:k,stopPropagation:Ae,disableScrollPropagation:Be,disableClickPropagation:Ie,preventDefault:O,stop:Re,getPropagationPath:Ne,getMousePosition:De,getWheelDelta:He,isExternalTarget:We,addListener:S,removeListener:k},Fe=it.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){t=this._startPos.add(this._offset.multiplyBy(t));e&&t._round(),Z(this._el,t),this.fire("step")},_complete:function(){r(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),A=it.extend({options:{crs:lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=c(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(w(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ce&&b.any3d&&!b.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),S(this._proxy,de,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if((e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(w(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=l({animate:i.animate},i.zoom),i.pan=l({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),t=(t instanceof p?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),n=this.containerPointToLatLng(o.add(t));return this.setView(n,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():g(t);var i=m(e.paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));return(o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0?{center:t.getCenter(),zoom:o}:(e=n.subtract(i).divideBy(2),n=this.project(t.getSouthWest(),o),i=this.project(t.getNorthEast(),o),{center:this.unproject(n.add(i).divideBy(2).add(e),o),zoom:o})},fitBounds:function(t,e){if((t=g(t)).isValid())return t=this._getBoundsCenterZoom(t,e),this.setView(t.center,t.zoom,e);throw new Error("Bounds are not valid.")},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){var i;return e=e||{},(t=m(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate?(M(this._mapPane,"leaflet-pan-anim"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend")},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!b.any3d)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),e=this.getSize(),a=this._zoom,h=(n=w(n),o=void 0===o?a:o,Math.max(e.x,e.y)),i=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,u=1.42,c=u*u;function d(t){t=(i*i-h*h+(t?-1:1)*c*c*l*l)/(2*(t?i:h)*c*l),t=Math.sqrt(t*t+1)-t;return t<1e-9?-18:Math.log(t)}function _(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);function f(t){return h*(p(m)*(_(t=m+u*t)/p(t))-_(m))/c}var g=Date.now(),v=(d(1)-m)/u,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var e=(Date.now()-g)/y,i=(1-Math.pow(1-e,1.5))*v;e<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(i)/l)),a),this.getScaleZoom(h/(e=i,h*(p(m)/p(m+u*e))),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){t=this._getBoundsCenterZoom(t,e);return this.flyTo(t.center,t.zoom,e)},setMaxBounds:function(t){return t=g(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),"geolocation"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable()),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("pagehide"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pe(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;s<i.length;s++)i[s].listens(e,!0)&&o.push(i[s]);n=o.concat(n)}if(n.length){"contextmenu"===e&&O(t);var r,a=n[0],h={originalEvent:t};for("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(r=a.getLatLng&&(!a._radius||a._radius<=10),h.containerPoint=r?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=r?a.getLatLng():this.layerPointToLatLng(h.layerPoint)),s=0;s<n.length;s++)if(n[s].fire(e,h,!0),h.originalEvent._stopped||!1===n[s].options.bubblingMouseEvents&&-1!==G(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Pe(this._mapPane)||new p(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){i=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,i){i=this._getNewPixelOrigin(i,e);return _([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){var n,o;return!i||(n=this.project(t,e),o=this.getSize().divideBy(2),o=new f(n.subtract(o),n.add(o)),o=this._getBoundsOffset(o,i,e),Math.abs(o.x)<=1&&Math.abs(o.y)<=1)?t:this.unproject(n.add(o),e)},_limitOffset:function(t,e){var i;return e?(i=new f((i=this.getPixelBounds()).min.add(t),i.max.add(t)),t.add(this._getBoundsOffset(i,e))):t},_getBoundsOffset:function(t,e,i){e=_(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),i=e.min.subtract(t.min),e=e.max.subtract(t.max);return new p(this._rebound(i.x,-e.x),this._rebound(i.y,-e.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){z(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){t=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(t))&&(this.panBy(t,e),!0)},_createAnimProxy:function(){var t=this._proxy=P("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ue,i=this._proxy.style[e];be(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("pagehide",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){T(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();be(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(!this._animatingZoom){if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ue(t){return new B(t)}var B=et.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("pagehide",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("pagehide",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),Ve=(A.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var i=this._controlCorners={},n="leaflet-",o=this._controlContainer=P("div",n+"control-container",this._container);function t(t,e){i[t+e]=P("div",n+t+" "+n+e,o)}t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)T(this._controlCorners[t]);T(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),B.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in c(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return B.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);t=this._getLayer(h(t));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){M(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(M(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):z(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return z(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=P("div",t),i=this.options.collapsed,n=(e.setAttribute("aria-haspopup",!0),Ie(e),Be(e),this._section=P("section",t+"-list")),o=(i&&(this._map.on("click",this.collapse,this),S(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this)),this._layersLink=P("a",t+"-toggle",e));o.href="#",o.title="Layers",o.setAttribute("role","button"),S(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){O(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=P("div",t+"-base",n),this._separator=P("div",t+"-separator",n),this._overlaysList=P("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&h(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(a(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(this._container){me(this._baseLayersList),me(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,o=0;o<this._layers.length;o++)i=this._layers[o],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?"":"none"),this._separator.style.display=e&&t?"":"none"}return this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(h(t.target)),t=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;t&&this._map.fire(t,e)},_createRadioElement:function(t,e){t='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",e=document.createElement("div");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,"click",O),this.expand(),this);setTimeout(function(){k(t,"click",O),e._preventClick=!1})}})),qe=B.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=P("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P("a",i,n);return i.innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Ie(i),S(i,"click",Re),S(i,"click",o,this),S(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=P("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P("div",e,i)),t.imperial&&(this._iScale=P("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280<t?(i=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,i+" mi",i/e)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+" ft",i/t))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),t=t/e;return e*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ke=B.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(b.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P("div","leaflet-control-attribution"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?"touchstart mousedown":"mousedown",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&!this._moving&&(this._moved=!1,ve(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i="mousedown"===t.type,S(document,i?"mousemove":"touchmove",this._onMove,this),S(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(e=new p((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,O(t),this._moved||(this.fire("dragstart"),this._moved=!0,M(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),M(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Z(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){z(document.body,"leaflet-dragging"),this._lastTarget&&(z(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),k(document,"mousemove touchmove",this._onMove,this),k(document,"mouseup touchend touchcancel",this._onUp,this),Te(),ae();var e=this._moved&&this._moving;this._moving=!1,Xe._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Je(t,e,i){for(var n,o,s,r,a,h,l,u=[1,4,2,8],c=0,d=t.length;c<d;c++)t[c]._code=si(t[c],e);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(d=t.length)-1;c<d;o=c++)r=t[c],a=t[o],r._code&h?a._code&h||((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)):(a._code&h&&((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)),n.push(r));t=n}return t}function $e(t,e){var i,n,o,s,r,a,h;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var l=w([0,0]),u=g(t),c=(u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(l=Qe(t)),t.length),d=[],_=0;_<c;_++){var p=w(t[_]);d.push(e.project(w([p.lat-l.lat,p.lng-l.lng])))}for(_=r=a=h=0,i=c-1;_<c;i=_++)n=d[_],o=d[i],s=n.y*o.x-o.y*n.x,a+=(n.x+o.x)*s,h+=(n.y+o.y)*s,r+=3*s;u=0===r?d[0]:[a/r,h/r],u=e.unproject(m(u));return w([u.lat+l.lat,u.lng+l.lng])}function Qe(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var s=w(t[o]);e+=s.lat,i+=s.lng,n++}return w([e/n,i/n])}var ti,gt={__proto__:null,clipPolygon:Je,polygonCenter:$e,centroid:Qe};function ei(t,e){if(e&&t.length){var i=t=function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,e){var i=e.x-t.x,e=e.y-t.y;return i*i+e*e})(t[n],t[o])>e&&(i.push(t[n]),o=n);o<s-1&&i.push(t[s-1]);return i}(t,e=e*e),n=i.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);o[0]=o[n-1]=1,function t(e,i,n,o,s){var r,a,h,l=0;for(a=o+1;a<=s-1;a++)h=ri(e[a],e[o],e[s],!0),l<h&&(r=a,l=h);n<l&&(i[r]=1,t(e,i,n,o,r),t(e,i,n,r,s))}(i,o,e,0,n-1);var s,r=[];for(s=0;s<n;s++)o[s]&&r.push(i[s]);return r}return t.slice()}function ii(t,e,i){return Math.sqrt(ri(t,e,i,!0))}function ni(t,e,i,n,o){var s,r,a,h=n?ti:si(t,i),l=si(e,i);for(ti=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=si(r=oi(t,e,s=h||l,i,o),i),s===h?(t=r,h=a):(e=r,l=a)}}function oi(t,e,i,n,o){var s,r,a=e.x-t.x,e=e.y-t.y,h=n.min,n=n.max;return 8&i?(s=t.x+a*(n.y-t.y)/e,r=n.y):4&i?(s=t.x+a*(h.y-t.y)/e,r=h.y):2&i?(s=n.x,r=t.y+e*(n.x-t.x)/a):1&i&&(s=h.x,r=t.y+e*(h.x-t.x)/a),new p(s,r,o)}function si(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0<a&&(1<(a=((t.x-o)*s+(t.y-e)*r)/a)?(o=i.x,e=i.y):0<a&&(o+=s*a,e+=r*a)),s=t.x-o,r=t.y-e,n?s*s+r*r:new p(o,e)}function I(t){return!d(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ai(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),I(t)}function hi(t,e){var i,n,o,s,r,a;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var h=w([0,0]),l=g(t),u=(l.getNorthWest().distanceTo(l.getSouthWest())*l.getNorthEast().distanceTo(l.getNorthWest())<1700&&(h=Qe(t)),t.length),c=[],d=0;d<u;d++){var _=w(t[d]);c.push(e.project(w([_.lat-h.lat,_.lng-h.lng])))}for(i=d=0;d<u-1;d++)i+=c[d].distanceTo(c[d+1])/2;if(0===i)a=c[0];else for(n=d=0;d<u-1;d++)if(o=c[d],s=c[d+1],i<(n+=r=o.distanceTo(s))){a=[s.x-(r=(n-i)/r)*(s.x-o.x),s.y-r*(s.y-o.y)];break}l=e.unproject(m(a));return w([l.lat+h.lat,l.lng+h.lng])}var vt={__proto__:null,simplify:ei,pointToSegmentDistance:ii,closestPointOnSegment:function(t,e,i){return ri(t,e,i)},clipSegment:ni,_getEdgeIntersection:oi,_getBitCode:si,_sqClosestPointOnSegment:ri,isFlat:I,_flat:ai,polylineCenter:hi},yt={project:function(t){return new p(t.lng,t.lat)},unproject:function(t){return new v(t.y,t.x)},bounds:new f([-180,-90],[180,90])},xt={R:6378137,R_MINOR:6356752.314245179,bounds:new f([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,o=Math.sqrt(1-o*o),s=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),n=-i*Math.log(Math.max(s,1e-10));return new p(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new v(a*i,t.x*i/n)}},wt={__proto__:null,LonLat:yt,Mercator:xt,SphericalMercator:rt},Pt=l({},st,{code:"EPSG:3395",projection:xt,transformation:ht(bt=.5/(Math.PI*xt.R),.5,-bt,.5)}),li=l({},st,{code:"EPSG:4326",projection:yt,transformation:ht(1/180,1,-1/180,.5)}),Lt=l({},ot,{projection:yt,transformation:ht(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,e=e.lat-t.lat;return Math.sqrt(i*i+e*e)},infinite:!0}),o=(ot.Earth=st,ot.EPSG3395=Pt,ot.EPSG3857=lt,ot.EPSG900913=ut,ot.EPSG4326=li,ot.Simple=Lt,it.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[h(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[h(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once("remove",function(){i.off(e,this)},this)),this.onAdd(i),this.fire("add"),i.fire("layeradd",{layer:this}))}})),ui=(A.include({addLayer:function(t){var e;if(t._layerAdd)return e=h(t),this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this;throw new Error("The provided object is not a Layer.")},removeLayer:function(t){var e=h(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return h(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?d(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[h(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=h(t);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers)var o=this._zoomBoundLayers[t].options,e=void 0===o.minZoom?e:Math.min(e,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom);this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),o.extend({initialize:function(t,e){var i,n;if(c(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){t=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:h})),ci=ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ui.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ui.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t,e=new s;for(t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),di=et.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){c(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(i)return i=this._createImg(i,e&&"IMG"===e.tagName?e:null),this._setIconStyles(i,t),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i;if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"],n=m(n="number"==typeof n?[n,n]:n),o=m("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return b.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var _i=di.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof _i.imagePath&&(_i.imagePath=this._detectIconPath()),(this.options.imagePath||_i.imagePath)+di.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function e(t,e,i){return(e=e.exec(t))&&e[i]}return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=P("div","leaflet-default-icon-path",document.body),e=pe(t,"background-image")||pe(t,"backgroundImage");return document.body.removeChild(t),(e=this._stripUrl(e))?e:(t=document.querySelector('link[href$="leaflet.css"]'))?t.href.substring(0,t.href.length-"leaflet.css".length-1):""}}),pi=n.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Xe(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),M(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&z(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Pe(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),a=_(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));a.contains(s)||(o=m((Math.max(a.max.x,s.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,s.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,s.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,s.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),i.panBy(o,{animate:!1}),this._draggable._newPos._add(o),this._draggable._startPos._add(o),Z(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(r(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Pe(e._icon),o=e._map.layerPointToLatLng(n);i&&Z(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){r(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),mi=o.extend({options:{icon:new _i,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){c(this,e),this._latlng=w(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1,i=(i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),M(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&S(i,"focus",this._panOnFocus,this),t.icon.createShadow(this._shadow)),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(M(i,e),i.alt=""),this._shadow=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&k(this._icon,"focus",this._panOnFocus,this),T(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&T(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Z(this._icon,t),this._shadow&&Z(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(M(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),pi&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new pi(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&C(this._icon,t),this._shadow&&C(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,e,i=this._map;i&&(t=(e=this.options.icon.options).iconSize?m(e.iconSize):m(0,0),e=e.iconAnchor?m(e.iconAnchor):m(0,0),i.panInside(this._latlng,{paddingTopLeft:e,paddingBottomRight:t.subtract(e)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var fi=o.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return c(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),gi=fi.extend({options:{fill:!0,radius:10},initialize:function(t,e){c(this,e),this._latlng=w(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return fi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),t=[t+i,e+i];this._pxBounds=new f(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var vi=gi.extend({initialize:function(t,e,i){if(c(this,e="number"==typeof e?l({},i,{radius:e}):e),this._latlng=w(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new s(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:fi.prototype.setStyle,_project:function(){var t,e,i,n,o,s=this._latlng.lng,r=this._latlng.lat,a=this._map,h=a.options.crs;h.distance===st.distance?(n=Math.PI/180,o=this._mRadius/st.R/n,t=a.project([r+o,s]),e=a.project([r-o,s]),e=t.add(e).divideBy(2),i=a.unproject(e).lat,n=Math.acos((Math.cos(o*n)-Math.sin(r*n)*Math.sin(i*n))/(Math.cos(r*n)*Math.cos(i*n)))/n,!isNaN(n)&&0!==n||(n=o/Math.cos(Math.PI/180*r)),this._point=e.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:e.x-a.project([i,s-n]).x,this._radiusY=e.y-t.y):(o=h.unproject(h.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(o).x),this._updateBounds()}});var yi=fi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){c(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=ri,o=0,s=this._parts.length;o<s;o++)for(var r=this._parts[o],a=1,h=r.length;a<h;a++){var l,u,c=n(t,l=r[a-1],u=r[a],!0);c<e&&(e=c,i=n(t,l,u))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(this._map)return hi(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=w(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new s,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return I(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=I(t),n=0,o=t.length;n<o;n++)i?(e[n]=w(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new f;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),t=new p(t,t);this._rawPxBounds&&(this._pxBounds=new f([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof v,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,i,n,o,s=this._parts,r=0,a=0,h=this._rings.length;r<h;r++)for(e=0,i=(o=this._rings[r]).length;e<i-1;e++)(n=ni(o[e],o[e+1],t,e,!0))&&(s[a]=s[a]||[],s[a].push(n[0]),n[1]===o[e+1]&&e!==i-2||(s[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=ei(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,h=this._clickTolerance();if(this._pxBounds&&this._pxBounds.contains(t))for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&ii(t,a[o],a[n])<=h)return!0;return!1}});yi._flat=ai;var xi=yi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(this._map)return $e(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},_convertLatLngs:function(t){var t=yi.prototype._convertLatLngs.call(this,t),e=t.length;return 2<=e&&t[0]instanceof v&&t[0].equals(t[e-1])&&t.pop(),t},_setLatLngs:function(t){yi.prototype._setLatLngs.call(this,t),I(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(I(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,e=new p(e,e),t=new f(t.min.subtract(e),t.max.add(e));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,n=0,o=this._rings.length;n<o;n++)(i=Je(this._rings[n],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(e=this._parts[o]).length)-1;s<h;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s,r=this.options;return(!r.filter||r.filter(t))&&(s=bi(t,r))?(s.feature=Zi(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function bi(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,u=e&&e.coordsToLatLng||Li;if(!a&&!r)return null;switch(r.type){case"Point":return Pi(l,t,i=u(a),e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=u(a[o]),h.push(Pi(l,t,i,e));return new ci(h);case"LineString":case"MultiLineString":return n=Ti(a,"LineString"===r.type?0:1,u),new yi(n,e);case"Polygon":case"MultiPolygon":return n=Ti(a,"Polygon"===r.type?1:2,u),new xi(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=bi({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);c&&h.push(c)}return new ci(h);case"FeatureCollection":for(o=0,s=r.features.length;o<s;o++){var d=bi(r.features[o],e);d&&h.push(d)}return new ci(h);default:throw new Error("Invalid GeoJSON object.")}}function Pi(t,e,i,n){return t?t(e,i):new mi(i,n&&n.markersInheritOptions&&n)}function Li(t){return new v(t[1],t[0],t[2])}function Ti(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?Ti(t[s],e-1,i):(i||Li)(t[s]),o.push(n);return o}function Mi(t,e){return void 0!==(t=w(t)).alt?[i(t.lng,e),i(t.lat,e),i(t.alt,e)]:[i(t.lng,e),i(t.lat,e)]}function zi(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?zi(t[s],I(t[s])?0:e-1,i,n):Mi(t[s],n));return!e&&i&&0<o.length&&o.push(o[0].slice()),o}function Ci(t,e){return t.feature?l({},t.feature,{geometry:e}):Zi(e)}function Zi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}Tt={toGeoJSON:function(t){return Ci(this,{type:"Point",coordinates:Mi(this.getLatLng(),t)})}};function Si(t,e){return new wi(t,e)}mi.include(Tt),vi.include(Tt),gi.include(Tt),yi.include({toGeoJSON:function(t){var e=!I(this._latlngs);return Ci(this,{type:(e?"Multi":"")+"LineString",coordinates:zi(this._latlngs,e?1:0,!1,t)})}}),xi.include({toGeoJSON:function(t){var e=!I(this._latlngs),i=e&&!I(this._latlngs[0]),t=zi(this._latlngs,i?2:e?1:0,!0,t);return Ci(this,{type:(i?"Multi":"")+"Polygon",coordinates:t=e?t:[t]})}}),ui.include({toMultiPoint:function(e){var i=[];return this.eachLayer(function(t){i.push(t.toGeoJSON(e).geometry.coordinates)}),Ci(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(e){var i,n,t=this.feature&&this.feature.geometry&&this.feature.geometry.type;return"MultiPoint"===t?this.toMultiPoint(e):(i="GeometryCollection"===t,n=[],this.eachLayer(function(t){t.toGeoJSON&&(t=t.toGeoJSON(e),i?n.push(t.geometry):"FeatureCollection"===(t=Zi(t)).type?n.push.apply(n,t.features):n.push(t))}),i?Ci(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n})}});var Mt=Si,Ei=o.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=g(e),c(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){T(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=g(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:P("img");M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=a(this.fire,this,"load"),e.onerror=a(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;be(this._image,t,e)},_reset:function(){var t=this._image,e=new f(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Z(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){C(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),ki=Ei.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:P("video");if(M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=a(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=0<i.length?n:[e.src]}else{d(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var r=P("source");r.src=this._url[s],e.appendChild(r)}}}});var Oi=Ei.extend({_initImage:function(){var t=this._image=this._url;M(t,"leaflet-image-layer"),this._zoomAnimated&&M(t,"leaflet-zoom-animated"),this.options.className&&M(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});var Ai=o.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof v||d(t))?(this._latlng=w(t),c(this,e)):(c(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&C(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&C(this._container,1),this.bringToFront(),this.options.interactive&&(M(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(C(this._container,0),this._removeTimeout=setTimeout(a(T,void 0,this._container),200)):T(this._container),this.options.interactive&&(z(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=w(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t){if(!(i=this._source)._map)return!1;if(i instanceof ci){var e,i=null,n=this._source._layers;for(e in n)if(n[e]._map){i=n[e];break}if(!i)return!1;this._source=i}if(!t)if(i.getCenter)t=i.getCenter();else if(i.getLatLng)t=i.getLatLng();else{if(!i.getBounds)throw new Error("Unable to get source layer LatLng.");t=i.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){var t,e,i;this._map&&(e=this._map.latLngToLayerPoint(this._latlng),t=m(this.options.offset),i=this._getAnchor(),this._zoomAnimated?Z(this._container,e.add(i)):t=t.add(e).add(i),e=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=e+"px",this._container.style.left=i+"px")},_getAnchor:function(){return[0,0]}}),Bi=(A.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),o.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(c(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}}),Ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ai.prototype.openOn.call(this,t)},onAdd:function(t){Ai.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof fi||this._source.on("preclick",Ae))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof fi||this._source.off("preclick",Ae))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=P("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=P("div",t+"-content-wrapper",e);this._contentNode=P("div",t+"-content",i),Ie(e),Be(this._contentNode),S(e,"contextmenu",Ae),this._tipContainer=P("div",t+"-tip-container",e),this._tip=P("div",t+"-tip",this._tipContainer),this.options.closeButton&&((i=this._closeButton=P("a",t+"-close-button",e)).setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">&#215;</span>',S(i,"click",function(t){O(t),this.close()},this))},_updateLayout:function(){var t=this._contentNode,e=t.style,i=(e.width="",e.whiteSpace="nowrap",t.offsetWidth),i=Math.min(i,this.options.maxWidth),i=(i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="",t.offsetHeight),n=this.options.maxHeight,o="leaflet-popup-scrolled";(n&&n<i?(e.height=n+"px",M):z)(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Z(this._container,t.add(e))},_adjustPan:function(){var t,e,i,n,o,s,r,a;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning?this._autopanning=!1:(t=this._map,e=parseInt(pe(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+e,a=this._containerWidth,(i=new p(this._containerLeft,-e-this._containerBottom))._add(Pe(this._container)),i=t.layerPointToContainerPoint(i),o=m(this.options.autoPanPadding),n=m(this.options.autoPanPaddingTopLeft||o),o=m(this.options.autoPanPaddingBottomRight||o),s=t.getSize(),r=0,i.x+a+o.x>s.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=P("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:i.x<o.x?(s="right",0):(s="left",r+2*(h.x+l.x)),a/2);t=t.subtract(m(e,i,!0)).add(h).add(l),z(n,"leaflet-tooltip-right"),z(n,"leaflet-tooltip-left"),z(n,"leaflet-tooltip-top"),z(n,"leaflet-tooltip-bottom"),M(n,"leaflet-tooltip-"+s),Z(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&C(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(t)},_getAnchor:function(){return m(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),Ri=(A.include({openTooltip:function(t,e,i){return this._initOverlay(Ii,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),o.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ii,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){var e,i;!t&&this._tooltipHandlersAdded||(e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&(this instanceof ci||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(S(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),S(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){t="function"==typeof t.getElement&&t.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){var e;this._tooltip&&this._map&&(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag?(this._openOnceFlag=!0,(e=this)._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)})):(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)))},_moveTooltip:function(t){var e=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),e=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(e)}}),di.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var t=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;return e.html instanceof Element?(me(t),t.appendChild(e.html)):t.innerHTML=!1!==e.html?e.html:"",e.bgPos&&(e=m(e.bgPos),t.style.backgroundPosition=-e.x+"px "+-e.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}));di.Default=_i;var Ni=o.extend({options:{tileSize:256,opacity:1,updateWhenIdle:b.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){c(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),T(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=j(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof p?t:new p(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!b.ielt9){C(this._container,this.options.opacity);var t,e=+new Date,i=!1,n=!1;for(t in this._tiles){var o,s=this._tiles[t];s.current&&s.loaded&&(o=Math.min(1,(e-s.loaded)/200),C(s.el,o),o<1?i=!0:(s.active?n=!0:this._onOpaqueTile(s),s.active=!0))}n&&!this._noPrune&&this._pruneTiles(),i&&(r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=P("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(T(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=P("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),u(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)T(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var t=Math.floor(t/2),e=Math.floor(e/2),i=i-1,o=new p(+t,+e),o=(o.z=i,this._tileCoordsToKey(o)),o=this._tiles[o];return o&&o.active?o.retain=!0:(o&&o.loaded&&(o.retain=!0),n<i&&this._retainParent(t,e,i,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new p(o,s),r=(r.z=i+1,this._tileCoordsToKey(r)),r=this._tiles[r];r&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e),o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),e=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();b.any3d?be(t.el,e,n):Z(t.el,e)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(i,this._tileZoom),t=e.project(t,this._tileZoom).floor(),e=e.getSize().divideBy(2*i);return new f(t.subtract(e),t.add(e))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n,e=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(e),s=o.getCenter(),r=[],e=this.options.keepBuffer,a=new f(o.getBottomLeft().subtract([e,-e]),o.getTopRight().add([e,-e]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(n in this._tiles){var h=this._tiles[n].coords;h.z===this._tileZoom&&a.contains(new p(h.x,h.y))||(this._tiles[n].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var l=o.min.y;l<=o.max.y;l++)for(var u=o.min.x;u<=o.max.x;u++){var c,d=new p(u,l);d.z=this._tileZoom,this._isValidTile(d)&&((c=this._tiles[this._tileCoordsToKey(d)])?c.current=!0:r.push(d))}if(r.sort(function(t,e){return t.distanceTo(s)-e.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));for(var _=document.createDocumentFragment(),u=0;u<r.length;u++)this._addTile(r[u],_);this._level.el.appendChild(_)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0<e.maxZoom?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return S(i,"load",a(this._tileOnLoad,this,e,i)),S(i,"error",a(this._tileOnError,this,e,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(e.y=t),e["-y"]=t),q(this._url,l(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(a(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return(t=this.options.zoomReverse?e-t:t)+this.options.zoomOffset},_getSubdomain:function(t){t=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,e,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=u,i.onerror=u,i.complete||(i.src=K,e=this._tiles[t].coords,T(i),delete this._tiles[t],this.fire("tileabort",{tile:i,coords:e})))},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",K),Ni.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==K))return Ni.prototype._tileReady.call(this,t,e,i)}});function ji(t,e){return new Di(t,e)}var Hi=Di.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i,n=l({},this.defaultWmsParams);for(i in e)i in this.options||(n[i]=e[i]);var t=(e=c(this,e)).detectRetina&&b.retina?2:1,o=this.getTileSize();n.width=o.x*t,n.height=o.y*t,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[e]=this._crs.code,Di.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,i=_(i.project(e[0]),i.project(e[1])),e=i.min,i=i.max,e=(1.3<=this._wmsVersion&&this._crs===li?[e.y,e.x,i.y,i.x]:[e.x,e.y,i.x,i.y]).join(","),i=Di.prototype.getTileUrl.call(this,t);return i+U(this.wmsParams,i,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+e},setParams:function(t,e){return l(this.wmsParams,t),e||this.redraw(),this}});Di.WMS=Hi,ji.wms=function(t,e){return new Hi(t,e)};var Wi=o.extend({options:{padding:.1},initialize:function(t){c(this,t),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),M(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),n=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?be(this._container,n,i):Z(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new f(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fi=Wi.extend({options:{tolerance:0},getEvents:function(){var t=Wi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");S(t,"mousemove",this._onMouseMove,this),S(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),S(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){r(this._redrawRequest),delete this._ctx,T(this._container),k(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1,Z(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){Wi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);t=(this._layers[h(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,e=e.prev;i?i.prev=e:this._drawLast=e,e?e.next=i:this._drawFirst=i,delete t._order,delete this._layers[h(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<i.length;o++){if(e=Number(i[o]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new f,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e])))},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],h[n?"lineTo":"moveTo"](s.x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var e,i,n,o;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!=o&&i.restore(),this._fillStroke(i,t))},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&(("click"===t.type||"preclick"===t.type)&&this._map._draggableMoved(e)||(i=e));this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(z(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(M(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function Ui(t){return b.canvas?new Fi(t):null}var Vi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),zt={_initContainer:function(){this._container=P("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vi("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Z(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=qi("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("pagehide",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){k(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(T(this._box),z(this._container,"leaflet-crosshair")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,"leaflet-grab"),z(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){var t,e;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit,t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)<Math.abs(n+i)?o:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var e,i,n,o,s=this._map,r=s.options,a=!r.inertia||t.noInertia||this._times.length<2;s.fire("dragend",t),!a&&(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,e=r.easeLinearity,a=(t=t.multiplyBy(e/a)).distanceTo([0,0]),i=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(i/a),n=i/(r.inertiaDeceleration*e),(o=t.multiplyBy(-n/2).round()).x||o.y)?(o=s._limitOffset(o,s.options.maxBounds),x(function(){s.panBy(o,{duration:n,easeLinearity:e,noMoveStart:!0,animate:!0})})):s.fire("moveend")}})),St=(A.addInitHook("addHandler","dragging",Zt),A.mergeOptions({keyboard:!0,keyboardPanDelta:80}),n.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),S(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),k(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){var t,e,i;this._focused||(i=document.body,t=document.documentElement,e=i.scrollTop||t.scrollTop,i=i.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(i,e))},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){for(var e=this._panKeys={},i=this.keyCodes,n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){S(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){k(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i,n=t.keyCode,o=this._map;if(n in this._panKeys)o._panAnim&&o._panAnim._inProgress||(i=this._panKeys[n],t.shiftKey&&(i=m(i).multiplyBy(3)),o.options.maxBounds&&(i=o._limitOffset(m(i),o.options.maxBounds)),o.options.worldCopyJump?(e=o.wrapLatLng(o.unproject(o.project(o.getCenter()).add(i))),o.panTo(e)):o.panBy(i));else if(n in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Re(t)}}})),Et=(A.addInitHook("addHandler","keyboard",St),A.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),n.extend({addHooks:function(){S(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){k(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=He(t),i=this._map.options.wheelDebounceTime,e=(this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),Math.max(i-(+new Date-this._startTime),0));clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),e),Re(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel)),n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,i=i?Math.ceil(n/i)*i:n,n=t._limitZoom(e+(0<this._delta?i:-i))-e;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}})),kt=(A.addInitHook("addHandler","scrollWheelZoom",Et),A.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15}),n.extend({addHooks:function(){S(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){k(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){var e;clearTimeout(this._holdTimeout),1===t.touches.length&&(e=t.touches[0],this._startPos=this._newPos=new p(e.clientX,e.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(S(document,"touchend",O),S(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),S(document,"touchend touchcancel contextmenu",this._cancel,this),S(document,"touchmove",this._onMove,this))},_cancelClickPrevent:function t(){k(document,"touchend",O),k(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),k(document,"touchend touchcancel contextmenu",this._cancel,this),k(document,"touchmove",this._onMove,this)},_onMove:function(t){t=t.touches[0];this._newPos=new p(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});t._simulated=!0,e.target.dispatchEvent(t)}})),Ot=(A.addInitHook("addHandler","tapHold",kt),A.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0}),n.extend({addHooks:function(){M(this._map._container,"leaflet-touch-zoom"),S(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){z(this._map._container,"leaflet-touch-zoom"),k(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),S(document,"touchmove",this._onTouchMove,this),S(document,"touchend touchcancel",this._onTouchEnd,this),O(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{i=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===i.x&&0===i.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(i),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),r(this._animRequest);n=a(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(n,this,!0),O(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,r(this._animRequest),k(document,"touchmove",this._onTouchMove,this),k(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}})),Xi=(A.addInitHook("addHandler","touchZoom",Ot),A.BoxZoom=_t,A.DoubleClickZoom=Ct,A.Drag=Zt,A.Keyboard=St,A.ScrollWheelZoom=Et,A.TapHold=kt,A.TouchZoom=Ot,t.Bounds=f,t.Browser=b,t.CRS=ot,t.Canvas=Fi,t.Circle=vi,t.CircleMarker=gi,t.Class=et,t.Control=B,t.DivIcon=Ri,t.DivOverlay=Ai,t.DomEvent=mt,t.DomUtil=pt,t.Draggable=Xe,t.Evented=it,t.FeatureGroup=ci,t.GeoJSON=wi,t.GridLayer=Ni,t.Handler=n,t.Icon=di,t.ImageOverlay=Ei,t.LatLng=v,t.LatLngBounds=s,t.Layer=o,t.LayerGroup=ui,t.LineUtil=vt,t.Map=A,t.Marker=mi,t.Mixin=ft,t.Path=fi,t.Point=p,t.PolyUtil=gt,t.Polygon=xi,t.Polyline=yi,t.Popup=Bi,t.PosAnimation=Fe,t.Projection=wt,t.Rectangle=Yi,t.Renderer=Wi,t.SVG=Gi,t.SVGOverlay=Oi,t.TileLayer=Di,t.Tooltip=Ii,t.Transformation=at,t.Util=tt,t.VideoOverlay=ki,t.bind=a,t.bounds=_,t.canvas=Ui,t.circle=function(t,e,i){return new vi(t,e,i)},t.circleMarker=function(t,e){return new gi(t,e)},t.control=Ue,t.divIcon=function(t){return new Ri(t)},t.extend=l,t.featureGroup=function(t,e){return new ci(t,e)},t.geoJSON=Si,t.geoJson=Mt,t.gridLayer=function(t){return new Ni(t)},t.icon=function(t){return new di(t)},t.imageOverlay=function(t,e,i){return new Ei(t,e,i)},t.latLng=w,t.latLngBounds=g,t.layerGroup=function(t,e){return new ui(t,e)},t.map=function(t,e){return new A(t,e)},t.marker=function(t,e){return new mi(t,e)},t.point=m,t.polygon=function(t,e){return new xi(t,e)},t.polyline=function(t,e){return new yi(t,e)},t.popup=function(t,e){return new Bi(t,e)},t.rectangle=function(t,e){return new Yi(t,e)},t.setOptions=c,t.stamp=h,t.svg=Ki,t.svgOverlay=function(t,e,i){return new Oi(t,e,i)},t.tileLayer=ji,t.tooltip=function(t,e){return new Ii(t,e)},t.transformation=ht,t.version="1.9.4",t.videoOverlay=function(t,e,i){return new ki(t,e,i)},window.L);t.noConflict=function(){return window.L=Xi,this},window.L=t});
//# sourceMappingURL=leaflet.js.map;
!function WP$UI$VideoController$definition(){var e=function WP$UI$VideoController(e,i,o,t){this.WP$Controllers$Controller(),this.proxify("_openVideo","_finishOpenVideo","_expandCollapseOnClick","_setCardHandled"),this.$root=e,this.template=$$WP.Templates.Core.video,this.videosViewModel={},$.extend(!0,this.videosViewModel,i),this.videosViewModel.isPageHeader=o,this.videosViewModel.hideMobileSidebar=t,this._render()},i={$root:null,template:null,videosViewModel:null,_render:function WP$UI$VideoController$_render(){var e,i=$afe.jq(window).width();this.videosViewModel.videoWidth=i*(5/12),this.videosViewModel.videoHeight=.28*i,(e={}).category=this.videosViewModel.VideoCard,this.videosViewModel.AutoExpand?(this.$root.safeAppend($afe.renderTemplate(this.template,this.videosViewModel,{})),this._setUpEventHandlers()):$.ajax({url:makeLink("Video/GetVideoCard"),type:"POST",cache:!1,data:e,dataType:"json",success:function(e){this.videosViewModel.collapsed=e.Handled,this.videosViewModel.showLinkToFeatureLibrary=e.ShowLinkToFeatureLibrary,this.$root.safeAppend($afe.renderTemplate(this.template,this.videosViewModel,{})),this._setUpEventHandlers()}.bind(this)})},_setUpEventHandlers:function WP$UI$VideoController$_setUpEventHandlers(){$afe.select(".videoCard .individualVideo .mediaType").on("click",this._openVideo),$afe.select(".collapse_expand_button").off("click").on("click",this._expandCollapseOnClick),$afe.select(".collapse_label").on("click",this._setCardHandled)},_openVideo:function WP$UI$VideoController$_openVideo(e){var i,a,l,d,r;e.preventDefault(),e.stopImmediatePropagation(),$afe.select(".mediaType").addClass("disabled"),(i=t(e,this.videosViewModel))&&""!==i?(a=i.VideoID,$.ajax({url:makeLink("Video/LogVideoView"),type:"POST",cache:!1,data:{videoID:a},error:function(){}}),this._setCardHandled(),l=i.Url,r=i.Title,d=i.Horizontal,l&&""!==l?this._finishOpenVideo(a,l,d,r):o()):o()},_finishOpenVideo:function WP$UI$VideoController$_finishOpenVideo(e,i,t,a){var l,d,r,n,s,p,$;i&&""!==i&&e&&""!==e?(headerHeight=$afe.select("#header").outerHeight(),r=$afe.jq(window).width()-2*headerHeight-20,n=$afe.jq(window).height()-2*headerHeight-20,t?(p=Math.min(.8*n,.8*r*(9/16)),s=(p=Math.max(p,180))*(16/9)):(s=Math.min(.8*r,.8*n*(9/16)),p=(s=Math.max(s,180))*(16/9)),l='<iframe class="'+(t&&!headerHeight&&s>r?"videoContainer smallMobileScreen":"videoContainer")+'" referrerpolicy="same-origin" width="'+s+'" height="'+p+'" src="'+(i.includes("?")?i+"&":i+"?")+"w="+s+"&h="+p+'&autoplay=1&cc_load_policy=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',$=$$WP.Strings.getNamespace("Core.Video"),popupTitle=a,d=[new $$WPComp.ComplexObjects.Button($.getString("ClosePopup"),null,null,"close")],classes=t?"videoPopup Popup horizontal":"videoPopup Popup",new $$WPUtil.quickMessageBox(l,popupTitle,d,null,[],classes),$afe.select(".mediaType").removeClass("disabled")):o()},_expandCollapseOnClick:function WP$UI$VideoController$_expandCollapseOnClick(e){var i;e.stopImmediatePropagation(),"true"===(i=$afe.jq(e.currentTarget)).safeAttr("aria-expanded")?(i.safeAttr("aria-expanded","false"),this._hideVideos()):(i.safeAttr("aria-expanded","true"),this._showVideos())},_hideVideos:function WP$UI$VideoController$_hideVideos(){$afe.select(".collapse_label").addClass("expand_label").removeClass("collapse_label"),$afe.select(".videos").addClass("hidden")},_showVideos:function WP$UI$VideoController$_showVideos(){$afe.select(".expand_label").addClass("collapse_label").removeClass("expand_label"),$afe.select(".videos").removeClass("hidden")},_setCardHandled:function WP$UI$VideoController$_setCardHandled(){var e={};e.category=$afe.select(".videoCard")[0].id,$.ajax({url:makeLink("Video/SetVideoCard"),type:"POST",cache:!1,data:e})}},o=function WP$UI$VideoController$handleFailure(){var e,i,o,t=$$WP.Strings.getNamespace("Core.Video");i=t.getString("ErrorPopupTitle"),o=t.getString("ErrorPopupText"),e=[new $$WPComp.ComplexObjects.Button(t.getString("ClosePopup"),null,null,"close")],new $$WPUtil.quickMessageBox(o,i,e)},t=function WP$UI$VideoController$findVideoDetails(e,i){var t,a,l="";if(t=i.Videos,e&&e.currentTarget&&e.currentTarget.parentElement&&((l=e.currentTarget.parentElement.id)&&""!==l||(l=e.currentTarget.id)),""===l)return o(),"";for(a in t)if(t[a].VideoID===l)return t[a];return""};e.prototype=i,e.handleFailure=o,$$WP.UI=$$WP.UI||{},$$WP.UI.VideoController=e,e.extend($$WP.Controllers.Controller,"WP$UI$VideoController")}();;
!function WP$UI$ProgressiveDisclosureController$definition(){var e={Info:1,Emergency:2},r=function WP$UI$ProgressiveDisclosureController(e,r,s,i,t){this.WP$Controllers$Controller(),this.$container=e,this._viewModel=this.buildViewModel(r,s,i,t),this.render(this._viewModel)};r.prototype={$container:null,_viewModel:null,_template:null,buildViewModel:function WP$UI$ProgressiveDisclosureController$buildViewModel(r,s,i,t){var l,n=!0,o="";if(r=$$WPUtil.GetRawString(r),s=$$WPUtil.GetRawString(s),!$$WPUtil.IsNullOrEmpty(r)){switch(r.length>120&&(r=r.substring(0,120)+$$WP.Strings.getForTemplate("Ellipsis","Global")),$$WPUtil.IsNullOrEmpty(s)&&(n=!1),i){case e.Info:o="_flat_circlewithioutline",this._template=$$WP.Templates.UI.ProgressiveDisclosureText;break;case e.Emergency:o="",this._template=$$WP.Templates.UI.EmergencyDisclaimer;break;default:this._template=$$WP.Templates.UI.ProgressiveDisclosureText,o=""}return l=o?"library.svg#"+o:"",{MainText:new Handlebars.SafeString(Handlebars.escapeExpression(r)),ExpandedText:new Handlebars.SafeString(s),CanExpand:n,IconPath:l,Classes:t}}},render:function WP$UI$ProgressiveDisclosureController$render(){this.$container.safeAppend($afe.renderTemplate(this._template,this._viewModel)),this.addListeners()},addListeners:function WP$UI$ProgressiveDisclosureController$addListeners(){this.$container.find(".expandableMainText").on("click",$.proxy(this._onMainTexToggled,this))},_onMainTexToggled:function WP$UI$ProgressiveDisclosureController$_onMainTexToggled(){var e=this.$container.find(".progressiveDisclosureText"),r=e.find(".expandableMainText"),s=e.find(".expandedText");e.hasClass("expanded")?(e.removeClass("expanded"),r.safeAttr("aria-expanded","false")):(e.addClass("expanded"),r.safeAttr("aria-expanded","true")),s.slideToggle(300)}},$$WP.UI=$$WP.UI||{},$$WP.UI.ProgressiveDisclosureController=r,$$WP.UI.ProgressiveDisclosureTypeEnum=e,r.extend($$WP.Controllers.Controller,"WP$UI$ProgressiveDisclosureController")}();;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SpecialtiesCore=$$WP.Scheduling.SpecialtiesCore||{},$$WPSchedulingSpecialtiesCore=$$WP.Scheduling.SpecialtiesCore,Specialty=$$WP.Scheduling.Specialty,$$WPSchedulingSpecialtiesCore.LoadSpecialtyData=function LoadSpecialtyData(e,i,t){var l=$$WPSchedulingUtil.GetEndpointUrl("GetSpecialtyData",e);$.post({url:makeLink(l),data:$$WPUtil.postify({SpecialtyId:i,ServiceAreas:e.ServiceAreas}),cache:!1,success:t})},$$WPSchedulingSpecialtiesCore.UpdateDataPoolSpecialties=function UpdateDataPoolSpecialties(e,i,t){var l=e.Specialties.getFromIndex("Id",t);e.populateWithRawSchedulingData(i),l&&(l.IsDataLoaded=!0)},$$WPSchedulingSpecialtiesCore.SetUpPretext=function SetUpPretext(e){var i=$afe.select(".specialtyPretext"),t=$$WP.Strings.get("StepPretextHeader","Scheduling.Fixed"),l=$$WP.Strings.get("SpecialtyStepPretextExpanded","Scheduling");$$WPUtil.IsNullOrEmpty(l)||new $$WP.UI.ProgressiveDisclosureController(i,t,l,$$WP.UI.ProgressiveDisclosureTypeEnum.Info,e)},$$WPSchedulingSpecialtiesCore.SetSpecialtiesViewModel=function SetSpecialtiesViewModel(e,i,t,l){e.Specialties=i,e.Specialties.sort(this.__sortSpecialtiesAlphabetically),l&&this.__setPromotedSpecialtiesViewModel(e,t)},$$WPSchedulingSpecialtiesCore.__sortSpecialtiesAlphabetically=function __sortSpecialtiesAlphabetically(e,i){return e.Name.localeCompare(i.Name)},$$WPSchedulingSpecialtiesCore.__setPromotedSpecialtiesViewModel=function __setPromotedSpecialtiesViewModel(e,i){if(i&&0!==i.length){e.PromotedSpecialties=[];for(var t=e.Specialties.length-1;t>=0;t--)-1!==i.indexOf(e.Specialties[t].Id)&&e.PromotedSpecialties.unshift(e.Specialties.splice(t,1)[0]);e.PromotedSpecialties&&0!==e.PromotedSpecialties.length||this.__setDefaultPromotedSpecialties(e)}else this.__setDefaultPromotedSpecialties(e);for(t=0;t<e.PromotedSpecialties.length;t++)this.__setPromotedProps(e,e.PromotedSpecialties[t])},$$WPSchedulingSpecialtiesCore.__setDefaultPromotedSpecialties=function __setDefaultPromotedSpecialties(e){var i;i=e.Specialties.length<7?e.Specialties.length:3,e.PromotedSpecialties=e.Specialties.splice(0,i)},$$WPSchedulingSpecialtiesCore.__setPromotedProps=function __setPromotedProps(e,i){i.DataType="specialty",i.DataWorkflowModelId=e.NewProviderWorkflow.ModelId,i.ViewBinderId=e.ViewBinderId,i.PhotoUrl||(i.SvgIcon="library.svg#_flat_stethoscope")};;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.LqfCore=$$WP.Scheduling.LqfCore||{},$$WPSchedulingLqfCore=$$WP.Scheduling.LqfCore,VisitType=$$WP.Scheduling.VisitType,Appointment=$$WP.Scheduling.Appointment,Lqf=$$WP.Scheduling.Lqf,Workflow=$$WP.Scheduling.Workflow,$$WPSchedulingLqfCore.HasUnansweredQuestions=function $$WPSchedulingLqfCore$HasUnansweredQuestions(e,n){var i,t,r=null,o=e.AppointmentBuilder.getFirstAppointment(),l=e.AppointmentBuilder.getFirstAppointmentIndex();return i=this.GetVisitTypeFromAppointment(o,e.VisitTypes),!!this.__visitTypeHasUnansweredLqf(e,i,l,n)||!!((t=this.GetDepartmentLqfData(e))&&t.Department&&(r=VisitType.getVisitTypeForDepartment(e,o,t.Department),this.__visitTypeHasUnansweredLqf(e,r)))},$$WPSchedulingLqfCore.GetVisitTypeFromAppointment=function $$WPSchedulingLqfCore$GetVisitTypeFromAppointment(e,n){return $$WPUtil.IsNullOrEmpty(e.PanelId)?e.VisitType:n.getFromIndex("ID",e.PanelId)},$$WPSchedulingLqfCore.GetDepartmentLqfData=function $$WPSchedulingLqfCore$GetDepartmentLqfData(e){var n,i,t,r,o=e.AppointmentBuilder.getFirstAppointment(),l=o.getSelectedDepartmentsCollection().toArray();for(r=0;r<l.length;r++)if(n=l[r],((i=VisitType.getVisitTypeForDepartment(e,o,n))!==o.VisitType||o.VisitTypeSource===Appointment.VisitTypeSourceEnum.DepartmentOverrideLqf)&&(t=this.GetCurrentLqfFromVisitType(e,i,n),!$$WPUtil.IsNullOrEmpty(t.LqfId)))return t;return{}},$$WPSchedulingLqfCore.GetCurrentLqfFromVisitType=function $$WPSchedulingLqfCore$GetCurrentLqfFromVisitType(e,n,i,t,r){var o=null;return n&&(r&&$$WPSchedulingLqfCore.__canShowAnonymousDecisionTree(r)?o=$$WPSchedulingLqfCore.__tryBuildLqfObject(e,t,n.AnonymousSchedulingDecisionTreeId,Lqf.LqfTypeEnum.DecisionTree):(o=$$WPSchedulingLqfCore.__tryBuildLqfObject(e,t,n.QuestionnaireId,Lqf.LqfTypeEnum.Questionnaire))||(o=$$WPSchedulingLqfCore.__tryBuildLqfObject(e,t,n.DecisionTreeId,Lqf.LqfTypeEnum.DecisionTree))),o||(o={}),o.Department=i,o},$$WPSchedulingLqfCore.__canShowAnonymousDecisionTree=function $$WPSchedulingLqfCore$__canShowAnonymousDecisionTree(e){return!e.IsAuthenticatedWidget&&((e.IsAnonymous||e.IsFromPrelogin)&&e.isTypeOpenScheduling()||e.isTypeUnIdentifiedSelfTriageForAll())},$$WPSchedulingLqfCore.__tryBuildLqfObject=function $$WPSchedulingLqfCore$__tryBuildLqfObject(e,n,i,t){var r=null;return $$WPUtil.IsNullOrEmpty(i)||$$WPSchedulingLqfCore.__wasAlreadyAnswered(e,i,n)||(r={LqfId:i,LqfType:t}),r},$$WPSchedulingLqfCore.__visitTypeHasUnansweredLqf=function $$WPSchedulingLqfCore$__visitTypeHasUnansweredLqf(e,n,i,t){if(n)if(t&&$$WPSchedulingLqfCore.__canShowAnonymousDecisionTree(t)){if(!$$WPUtil.IsNullOrEmpty(n.AnonymousSchedulingDecisionTreeId)&&!this.__wasAlreadyAnswered(e,n.AnonymousSchedulingDecisionTreeId,i))return!0}else{if(!$$WPUtil.IsNullOrEmpty(n.QuestionnaireId)&&!this.__wasAlreadyAnswered(e,n.QuestionnaireId,i))return!0;if(!$$WPUtil.IsNullOrEmpty(n.DecisionTreeId)&&!this.__wasAlreadyAnswered(e,n.DecisionTreeId,i))return!0}return!1},$$WPSchedulingLqfCore.__wasAlreadyAnswered=function WP$Scheduling$LqfStepController$__wasAlreadyAnswered(e,n,i){var t,r=null;return $$WPUtil.IsNullOrEmpty(i)&&(i=0),t=e.Lqfs.getFromIndex(["Id","AppointmentIndex"],[n,i]),!!(r=$$WPUtil.IsNullOrEmpty(i)?e.AppointmentBuilder.getFirstAppointment():e.AppointmentBuilder.getAppointment(i)).IsLqfChainStopped||!$$WPUtil.IsNullOrEmpty(t)&&r.Lqfs.contains(t)},$$WPSchedulingLqfCore.CanWorkflowSupportLqf=function WP$Scheduling$LqfStepController$CanWorkflowSupportLqf(e){return e!==Workflow.WorkflowTypesEnum.NewProvider&&e!==Workflow.WorkflowTypesEnum.Request&&e!==Workflow.WorkflowTypesEnum.Reschedule&&e!==Workflow.WorkflowTypesEnum.OnDemandTelehealth};;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ReasonsForVisitCore=$$WP.Scheduling.ReasonsForVisitCore||{},$$WPSchedulingRfvsCore=$$WP.Scheduling.ReasonsForVisitCore,ReasonForVisit=$$WP.Scheduling.ReasonForVisit,$$WPSchedulingRfvsCore.LoadReasonForVisitData=function LoadReasonForVisitData(e,i,n,r,s,t,a){var o=$$WPSchedulingUtil.GetEndpointUrl("GetDeferredSchedulingData",i),d={schedulingParameters:e,serviceAreas:i.ServiceAreas,workflow:i.toRawRequestObject(),isFirstLoad:r,schedulingOverridesString:JSON.stringify(t),schedulingOverridesListString:JSON.stringify(a),isLoadingRemainingTiers:s};$.post({url:makeLink(o),data:$$WPUtil.postify(d),success:n})},$$WPSchedulingRfvsCore.BuildSchedulingParameters=function BuildSchedulingParameters(e,i,n,r,s){return{reasonForVisitId:e,specialtyId:i,csn:n,ticketId:r,isGuest:s}},$$WPSchedulingRfvsCore.UpdateDataPoolReasonsForVisit=function UpdateDataPoolReasonsForVisit(e,i){e.populateWithRawSchedulingData(i)},$$WPSchedulingRfvsCore.ShowAjaxSpinner=function ShowAjaxSpinner(e){$$WPUtil.ShowAjaxSpinner(this.__getAjaxSpinner(e))},$$WPSchedulingRfvsCore.HideAjaxSpinner=function HideAjaxSpinner(e){$$WPUtil.HideAjaxSpinner(this.__getAjaxSpinner(e))},$$WPSchedulingRfvsCore.__getAjaxSpinner=function __getAjaxSpinner(e){return e.find(".rfvLoadingHeart .ajaxspinner")};;
$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ProvidersCore=$$WP.Scheduling.ProvidersCore||{},$$WPSchedulingProvidersCore=$$WP.Scheduling.ProvidersCore,VisitType=$$WP.Scheduling.VisitType,Workflow=$$WP.Scheduling.Workflow,$$WPSchedulingProvidersCore.IsSingleAllowedProviderStillElligibleForScheduling=function $$WPSchedulingProvidersCore$IsSingleAllowedProviderStillElligibleForScheduling(e,r){if(null==r)return!1;if(1!==r.length)return!1;for(var i=0;i<e.length;i++)if(e[i]===r[0])return!0;return!1},$$WPSchedulingProvidersCore.AreAllProvidersSelected=function $$WPSchedulingProvidersCore$AreAllProvidersSelected(e){var r=e.Providers,i=$$WPSchedulingUtil.BuildProvidersFiltered(!0,!0,!1,e.ReasonForVisit,e.getSelectedDepartmentsCollection().toArray(),!1);if(r.size()!==i.length)return!1;for(var l=0;l<i.length;l++)if(!r.contains(i[l]))return!1;return!0},$$WPSchedulingProvidersCore.GetProviderContextViewModel=function $$WPSchedulingProvidersCore$GetProviderContextViewModel(e){var r={},i=[];return e?(i=e.Specialties.map((function(e){return e.Title})),r.Name=e.Name,r.PhotoUrl=e.PhotoUrl,r.PhotoClass=e.PhotoClass,r.SpecialtiesText=i.join($$WP.Strings.get("SpecialtiesListDelimiter","Scheduling")),r):null},$$WPSchedulingProvidersCore.IsProviderSpecifiedInQueryString=function $$WPSchedulingUtil$Reload(e){var r=e.SchedulingControllerParams;return!$$WPUtil.IsNullOrEmpty(r.id)||!$$WPUtil.IsNullOrEmpty(r.provId)||!$$WPUtil.IsNullOrEmpty(r.prov)};;
/*0*/