1import{a as K}from"./chunk-JJVE2CBW.js";import{a as X}from"./chunk-LZOYNIL4.js";import{a as U}from"./chunk-SLH3S6HL.js";import"./chunk-JSWI7OU4.js";import"./chunk-ZHND4JXO.js";import"./chunk-ZNC4IUJ3.js";import{I as G,c as J,f as q,k as B,v as H}from"./chunk-5KAM2ZNB.js";import{$a as V,Aa as E,Ba as F,Bb as $,Ca as v,Fa as S,Ga as l,J as y,N as I,O,Pb as Q,Qa as m,Rb as P,Sa as w,T as u,U as _,Va as T,Wa as N,Xa as j,ga as s,ha as x,m as k,o as A,pa as C,ra as g,rb as W,sb as D,tb as z,xa as c,y as R,ya as r,za as b}from"./chunk-HBVT2ZLF.js";import{a as M,b as L}from"./chunk-AS3XJPEZ.js";var ie=n=>({active:n});function ne(n,f){n&1&&(c(0,"div",9)(1,"div",10)(2,"span",11),m(3,"Loading regions..."),r()()())}function oe(n,f){if(n&1){let i=v();c(0,"label")(1,"input",28),S("change",function(){let e=u(i).$implicit,o=l(2).$implicit,d=l(2);return _(d.toggleCitySelection(o,e))}),r(),m(2),r()}if(n&2){let i=f.$implicit,t=l(2).$implicit,e=l(2);s(),g("checked",e.isCitySelected(t,i)),s(),w(" ",i.name," ")}}function re(n,f){if(n&1){let i=v();c(0,"div",23)(1,"div",24),b(2,"img",25),c(3,"input",26),j("ngModelChange",function(e){u(i);let o=l().$implicit;return N(o.searchQuery,e)||(o.searchQuery=e),_(e)}),r()(),c(4,"div",27),C(5,oe,3,2,"label",12),r()()}if(n&2){let i=l().$implicit,t=l(2);s(3),T("ngModel",i.searchQuery),s(2),g("ngForOf",t.getFilteredCitiesForAccordion(i))}}function se(n,f){if(n&1){let i=v();c(0,"div")(1,"div",20)(2,"button",21),S("click",function(){let e=u(i).index,o=l(2);return _(o.toggleAccordion(e))}),m(3),r()(),C(4,re,6,2,"div",22),r()}if(n&2){let i=f.$implicit;s(2),g("ngClass",V(3,ie,i.isActive)),s(),w(" ",i.location_name," "),s(),g("ngIf",i.isActive)}}function ce(n,f){n&1&&(c(0,"div",29)(1,"span",11),m(2,"Loading..."),r()())}function ae(n,f){if(n&1){let i=v();E(0),C(1,se,5,5,"div",12),c(2,"div",13)(3,"div",14)(4,"button",15),S("click",function(){u(i);let e=l();return _(e.previous())}),b(5,"img",16),m(6," Previous "),r(),c(7,"button",17),S("click",function(){u(i);let e=l();return _(e.next())}),C(8,ce,3,0,"div",18),m(9," Next "),b(10,"img",19),r()()(),F()}if(n&2){let i=l();s(),g("ngForOf",i.accordions),s(6),g("disabled",i.loading),s(),g("ngIf",i.loading)}}var Z=(()=>{class n{constructor(i,t,e,o,d){this.router=i,this.toastService=t,this.profileService=e,this.onboardingStateService=o,this.analyticsService=d,this.selectedLocations=[],this.selectedCities=[],this.citiesData=[],this.citiesLoading=!1,this.loading=!1,this.accordions=[]}ngOnInit(){this.scrollToTop(),this.loadSelectedLocations(),this.fetchCitiesForSelectedLocations()}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}loadSelectedLocations(){let i=JSON.parse(localStorage.getItem("selectedLocations")||"[]");this.selectedLocations=[],i.forEach(e=>{e.locations&&e.locations.length>0&&e.locations.forEach(o=>{this.selectedLocations.push({region_name:e.region_name,region_slug:e.region_slug,name:o.name,slug:o.slug})})});let t=JSON.parse(localStorage.getItem("selectedCities")||"[]");Array.isArray(t)&&t.length>0?typeof t[0]=="string"?this.selectedCities=t:this.selectedCities=t.map(e=>e.name||e):this.selectedCities=[]}sortCitiesWithAllFirst(i){return i.sort((t,e)=>{let o=(t.name||"").trim().startsWith("All "),d=(e.name||"").trim().startsWith("All ");return o&&!d?-1:!o&&d?1:0})}fetchCitiesForSelectedLocations(){if(this.selectedLocations.length===0){this.citiesData=[],this.accordions=[];return}this.citiesLoading=!0;let i=this.selectedLocations.map(t=>this.onboardingStateService.getCitiesForLocation(t.name).pipe(k(e=>({location:t.name,region_name:t.region_name,data:e}))));A(i).subscribe({next:t=>{this.citiesData=t.map(e=>{let p=((e.data?.data||[]).find(h=>h.location===e.location)?.regions||[]).map(h=>({name:h,slug:h.toLowerCase().replace(/\s+/g,"-")})),a=`All ${e.location}`;p.some(h=>h.name.trim()===a)||p.push({name:a,slug:a.toLowerCase().replace(/\s+/g,"-")});let te=this.sortCitiesWithAllFirst(p);return{region_name:e.region_name,location_name:e.location,cities:te}}).filter(e=>e.cities&&e.cities.length>0),this.accordions=this.citiesData.map((e,o)=>({region_name:e.region_name,location_name:e.location_name,cities:e.cities,searchQuery:"",isActive:o===0})),this.autoSelectAllRegions(),this.citiesLoading=!1},error:t=>{this.toastService.error(t?.error?.detail?.error||"Failed to load cities."),this.citiesLoading=!1,this.citiesData=[],this.accordions=[]}})}toggleAccordion(i){this.accordions=this.accordions.map((t,e)=>e===i?L(M({},t),{isActive:!t.isActive}):L(M({},t),{isActive:!1}))}autoSelectAllRegions(){let i=this.selectedCities.length;this.citiesData.forEach(t=>
1{t.cities.forEach(e=>{if(e.name&&e.name.trim().startsWith("All ")){let o=e.name.trim();this.selectedCities.includes(o)||(t.cities.forEach(p=>{let a=this.selectedCities.indexOf(p.name.trim());a>-1&&this.selectedCities.splice(a,1)}),this.selectedCities.push(o))}})}),this.selectedCities.length>i&&this.saveSelectedCities()}getFilteredCitiesForAccordion(i){let t=i.searchQuery.trim().toLowerCase();return t?this.sortCitiesWithAllFirst(i.cities.filter(e=>(e.name||"").toLowerCase().includes(t))):this.sortCitiesWithAllFirst([...i.cities])}isCitySelected(i,t){let e=t.name.trim();return this.selectedCities.includes(e)}toggleCitySelection(i,t){let e=t.name.trim(),o=e.startsWith("All "),d=this.selectedCities.indexOf(e);d>-1?this.selectedCities.splice(d,1):o?(i.cities.forEach(p=>{let a=this.selectedCities.indexOf(p.name.trim());a>-1&&this.selectedCities.splice(a,1)}),this.selectedCities.push(e)):(i.cities.forEach(p=>{if(p.name.trim().startsWith("All ")){let a=this.selectedCities.indexOf(p.name.trim());a>-1&&this.selectedCities.splice(a,1)}}),this.selectedCities.push(e)),this.saveSelectedCities()}saveSelectedCities(){localStorage.setItem("selectedCities",JSON.stringify(this.selectedCities))}previous(){this.router.navigate(["/onboard-select-jurisdiction-regions"])}next(){if(this.selectedCities.length===0){this.toastService.error("Please select at least one region to proceed further.");return}this.loading=!0,this.analyticsService.track("onboarding_regions_completed",{onboarding_step:2}),this.profileService.saveOnboardingStep(2).pipe(R(()=>{this.loading=!1})).subscribe(()=>{this.router.navigate(["/onboard-select-industries"])})}static{this.\u0275fac=function(t){return new(t||n)(x(Q),x(G),x(X),x(K),x(U))}}static{this.\u0275cmp=I({type:n,selectors:[["app-onboard-select-location-regions"]],decls:11,vars:2,consts:[[1,"body-content"],[1,"container","align-items-center","justify-content-between"],[1,"col-9","left-section"],[1,"template-title"],[1,"template-subtitle"],["class","mt-5 d-flex justify-content-center",4,"ngIf"],[4,"ngIf"],[1,"right-section","col-3"],["src","assets/sourceHR_images/location.png","alt","",1,"img"],[1,"mt-5","d-flex","justify-content-center"],["role","status",1,"spinner-border"],[1,"visually-hidden"],[4,"ngFor","ngForOf"],[1,"accordion-footer"],[1,"d-flex","justify-content-between","gap-3"],[1,"prev-btn",3,"click"],["src","assets/icons/arrow_to_left.svg",1,"icon"],[1,"next-btn",3,"click","disabled"],["class","spinner-border spinner-border-sm","role","status",4,"ngIf"],["src","assets/icons/arrow_to_right.svg",1,"icon"],[2,"position","relative"],[1,"accordion-button","accordion",3,"click","ngClass"],["class","panel main-search-area","style","display: block;",4,"ngIf"],[1,"panel","main-search-area",2,"display","block"],[1,"mt","form-group","position-relative"],["src","assets/images/icon/search-icon.svg",1,"search-icon"],["type","text","placeholder","Search regions",3,"ngModelChange","ngModel"],[1,"checkbox-group"],["type","checkbox",3,"change","checked"],["role","status",1,"spinner-border","spinner-border-sm"]],template:function(t,e){t&1&&(c(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2",3),m(4,"Select regions for your selected locations"),r(),c(5,"p",4),m(6,"Choose the specific regions within the locations you selected in the previous step."),r(),C(7,ne,4,0,"div",5)(8,ae,11,3,"ng-container",6),r(),c(9,"div",7),b(10,"img",8),r()()()),t&2&&(s(7),g("ngIf",e.citiesLoading),s(),g("ngIf",!e.citiesLoading))},dependencies:[W,D,z,J,q,B],styles:['@charset "UTF-8";.body-content[_ngcontent-%COMP%]{background:#fff;overflow-y:auto;overflow-x:hidden}.accordion[_ngcontent-%COMP%]{background-color:#103533;color:#fff;cursor:pointer;padding:15px;width:100%;border:none;text-align:left;outline:none;font-size:18px;transition:background-color .3s ease;margin-top:10px;border-radius:5px}.accordion[_ngcontent-%COMP%]:hover{background-color:#103533}.panel[_ngcontent-%COMP%]{padding:0 15px;display:none;background-color:#fff;overflow:hidden;border:1px solid #ccc;border-top:none}.checkbox-group[_ngcontent-%COMP%]{padding:10px 0;display:flex;flex-wrap:wrap}label[_ngcontent-%COMP%]{display:inline-flex;padding:8px 16px;color:#333;gap:8px;font-size:14px}.img[_ngcontent-%COMP%]{object-fit:cover;width:100%;height:100vh}.left-section[_ngcontent-%COMP%]{padding:50px 0;min-height:100vh}.right-section[_ngcontent-%COMP%]{position:fixed;height:100vh;
1top:0;right:0}.accordion-button[_ngcontent-%COMP%]:after{background-image:none!important;content:"+";color:#fff;font-size:20px;font-weight:700;margin-left:auto;margin-top:10px;transition:content .3s ease}.accordion-button.active[_ngcontent-%COMP%]:after{content:"\\2212"}.accordion-button.active[_ngcontent-%COMP%]{border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-top:20px}.next-btn[_ngcontent-%COMP%]{background-color:#0cafff;color:#fff;border:none;padding:5px 10px!important;border-radius:50px;font-size:15px!important;cursor:pointer;transition:background-color .3s ease;display:flex!important;align-items:center!important}.next-btn[_ngcontent-%COMP%]:hover{background-color:#0056b3}.next-btn[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.prev-btn[_ngcontent-%COMP%]{background-color:#6c757d;color:#fff;border:none;padding:5px 10px!important;border-radius:50px;font-size:15px!important;cursor:pointer;transition:background-color .3s ease;display:flex!important;align-items:center!important}.prev-btn[_ngcontent-%COMP%]:hover{background-color:#5a6268}.next-btn[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%], .prev-btn[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-left:8px;width:16px;height:16px}input[type=checkbox][_ngcontent-%COMP%]{accent-color:#103533}.main-search-area[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%]{display:flex;gap:10px;margin-bottom:0}.main-search-area[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:44px;padding:15px 15px 15px 35px;position:relative;font-size:14px;width:100%;border-radius:10px;border:1px solid #d0d5dd}.search-icon[_ngcontent-%COMP%]{position:absolute;z-index:9;left:16px;top:18px;width:12px}.mt[_ngcontent-%COMP%]{margin-top:1rem}']})}}return n})();var le=[{path:"",component:Z}],ee=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=O({type:n})}static{this.\u0275inj=y({imports:[P.forChild(le),P]})}}return n})();var ke=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=O({type:n})}static{this.\u0275inj=y({imports:[$,ee,H]})}}return n})();export{ke as OnboardSelectLocationRegionsModule};
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.