PageSourceSearch

https://www.albany.org/dist/ExperienceBuilderAlt-CEoAUa5O.js

js albany.org collected 2026-10-02 02:53:32 UTC 4,430 bytes, 1 lines download raw bytes

1const h="ExperienceBuilderAlt",p="/ajax/experience-builder-api/",d="experience-builder-alt",S=({apiRecommendUrl:n=p,totalSteps:a=2,localStorageKey:o=h,modalName:c=d}={})=>({apiRecommendUrl:n,totalSteps:a,localStorageKey:o,modalName:c,currentStep:0,highestStep:0,selectedScenario:"",selectedInterests:[],recommendationsHtml:"",isRecommendationsLoading:!1,lastQueryKey:"",panels:[],$refs:{},init(){this.collectPanels(),this.restoreState(),this.highestStep=this.maxAllowedStep,this.currentStep=this.scenarioStep,this.selectedInterests.length&&this.fetchRecommendations('<p class="experience-builder-alt__message text--content">Loading your previous recommendations.</p>'),this.goToStep(this.currentStep)},get scenarioStep(){return 0},get resultsStep(){return this.scenarioStep+1},get maxAllowedStep(){return this.selectedScenario?this.selectedInterests.length?this.resultsStep:this.scenarioStep:this.scenarioStep},get currentInnerClasses(){return this.panels.find(t=>t.step===this.currentStep)?.innerClasses??[]},get currentStepIndex(){const e=this.panels.findIndex(t=>t.step===this.currentStep);return e>=0?e:0},goToStep(e){this.currentStep=Math.max(0,Math.min(e,this.maxAllowedStep)),this.highestStep=this.maxAllowedStep,this.persistState(),this.currentStep===this.resultsStep&&this.fetchRecommendations()},next(){this.goToStep(this.currentStep+1)},back(){this.goToStep(this.currentStep-1)},reset(){this.selectedScenario="",this.selectedInterests=[],this.lastQueryKey="",this.recommendationsHtml="",this.highestStep=this.maxAllowedStep,this.goToStep(this.scenarioStep)},onScenarioChange(){this.highestStep=this.maxAllowedStep,this.persistState(),this.currentStep>this.maxAllowedStep&&this.goToStep(this.maxAllowedStep)},onInterestsChange(){if(this.highestStep=this.maxAllowedStep,this.persistState(),this.currentStep>this.maxAllowedStep){this.goToStep(this.maxAllowedStep);return}this.currentStep===this.resultsStep&&this.fetchRecommendations()},async fetchRecommendations(e="<p>Loading your custom recommendations.</p>"){if(!this.selectedScenario||!this.selectedInterests.length)return;const t={interest:this.selectedInterests.join(", "),scenario:this.selectedScenario,city:"",startDate:"",endDate:""},s=JSON.stringify(t);if(s===this.lastQueryKey)return;this.lastQueryKey=s;const i=new URLSearchParams(t).toString();this.isRecommendationsLoading=!0,this.recommendationsHtml=this.wrapMessage(e);try{const r=await fetch(`${this.apiRecommendUrl}?${i}`);if(!r.ok)throw new Error(`Request failed with status ${r.status}`);this.recommendationsHtml=await r.text(),this.$nextTick(()=>{this.$refs.recommendations?.querySelectorAll("[data-aos]").forEach(l=>{l.removeAttribute("data-aos")})})}catch(r){console.error(r),this.recommendationsHtml=this.wrapMessage("<p>Sorry, there was a problem loading your recommendations.</p>")}finally{this.isRecommendationsLoading=!1}},closeModal(){this.$store?.state?.modals&&(this.$store.state.modals[this.modalName]=!1)},collectPanels(){const t=this.$refs.panels?.querySelectorAll("[data-eb-step]"),s=[];t?.forEach(i=>{const r=i.getAttribute("data-eb-step");r&&s.push({step:Number(r),innerClasses:this.getInnerClasses(i)})}),this.panels=s,s.length&&(this.totalSteps=s.length)},getInnerClasses(e){return(e.getAttribute("data-eb-inner-classes")??"").split(" ").map(s=>s.trim()).filter(Boolean)},persistState(){const e={updated:Date.now(),interests:this.selectedInterests,scenarios:this.selectedScenario?[this.selectedScenario]:[],city:"",startDate:"",endDate:""};try{localStorage.setItem(this.localStorageKey,JSON.stringify(e))}catch(t){console.error("Failed to persist experience builder state",t)}},restoreState(){try{const e=localStorage.getItem(this.localStorageKey);if(!e)return;const t=JSON.parse(e);Array.isArray(t.scenarios)&&t.scenarios.length&&(this.selectedScenario=t.scenarios[0]),Array.isArray(t.interests)&&(this.selectedInterests=t.interests)}catch(e){console.error("Failed to restore experience builder state",e)}},focusCurrentPanel(){this.$nextTick(()=>{const e=this.$refs.panels;if(!e)return;const t=e.querySelector(`[data-eb-step='${this.currentStep}']`);if(!t)return;const s=t.querySelector("[data-eb-focus]")??t.querySelector('button, [href], input, select, textarea, [tabindex]:not
1([tabindex="-1"])')??t;try{s.focus({preventScroll:!0})}catch{s.focus()}})},wrapMessage(e=""){return e?`<div class="experience-builder-alt__message text--content">${e}</div>`:""}});export{S as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.