PageSourceSearch

https://www.finkup.com/chunk-YMTWRWY4.js

js finkup.com collected 2026-09-24 13:01:13 UTC 6,201 bytes, 1 lines download raw bytes

1import{a as R}from"./chunk-Z43V3MNR.js";import{a as E}from"./chunk-4UKK7RHX.js";import{g as x}from"./chunk-U2UE3HJQ.js";import{A as m,F as p,P as d,X as j,ba as u,g as a,o as g}from"./chunk-XNPI5QDC.js";import{a as S,b}from"./chunk-EQDQRRRY.js";var l="cityRoute";function L(s){let e=s?.[l];if(!e||typeof e!="object")return null;let t=e;return(t.type==="param"||t.type==="slug")&&typeof t.param=="string"?t:null}function T(s){if(!s)return null;let e=s.split("-in-");return e.length>1?e[e.length-1].toLowerCase():null}function P(s,e){let t=s.split("-in-");return t.length<2?s:(t[t.length-1]=e.toLowerCase(),t.join("-in-"))}function C(s){let e=L(s.data);if(!e)return null;let t=s.params[e.param];return t?e.type==="param"?String(t).toLowerCase():T(String(t)):null}function h(s){let e=null,t=s;for(;t;)L(t.data)&&(e=t),t=t.firstChild;return e}var k=class s{http=u(R);cookieService=u(E);router=u(x);citySubject=new a({cities:[],isLoading:!1,isError:!1});cities=this.citySubject.asObservable();eventModsSubject=new a({mods:[],isLoading:!1,isError:!1,city:null});eventMods$=this.eventModsSubject.asObservable();sportsCategorySubject=new a({sportsCategory:[],isLoading:!1,isError:!1,city:null});sportsCategory$=this.sportsCategorySubject.asObservable();pickerRequestSubject=new a(null);pickerRequest$=this.pickerRequestSubject.asObservable();currentCitySubject=new a(this.cookieService.get("mainCity")?.toLowerCase()??"");currentCity$=this.currentCitySubject.asObservable();loadingInProgress=!1;modsCache=new Map;sportsCategoryCache=new Map;navigationTargetCity=null;get currentCity(){return this.currentCitySubject.value}get snapshot(){return this.citySubject.value}get eventModsSnapshot(){return this.eventModsSubject.value}get pendingNavigationCity(){return this.navigationTargetCity}hasPendingCityNavigation(){return this.navigationTargetCity!=null}isStaleCityNavigation(e){return this.navigationTargetCity!=null&&e!==this.navigationTargetCity}clearPendingCityNavigation(){this.navigationTargetCity=null}loadCities(){if(this.loadingInProgress)return;let e=this.citySubject.value;e.cities.length>0&&!e.isError||(this.loadingInProgress=!0,this.citySubject.next(b(S({},e),{isLoading:!0,isError:!1})),this.http.get("city/").subscribe({next:t=>{this.loadingInProgress=!1,this.citySubject.next({cities:t??[],isLoading:!1,isError:!1})},error:()=>{this.loadingInProgress=!1,this.citySubject.next({cities:[],isLoading:!1,isError:!0})}}))}getCitiesWhenReady(){let e=this.citySubject.value;return!e.isLoading&&(e.cities.length>0||e.isError)?this.cities.pipe(p(1)):this.cities.pipe(m(t=>!t.isLoading&&(t.cities.length>0||t.isError)),p(1))}isValidCity(e){if(!e)return!1;let t=e.toLowerCase();return this.citySubject.value.cities.some(i=>i.city_slug?.toLowerCase()===t)}resolveCitySlug(e){let t=e.toLowerCase();return(this.citySubject.value.cities.find(r=>r.city_slug?.toLowerCase()===t)?.city_slug??t).toLowerCase()}resolveCity(e){return e?this.isValidCity(e)?"valid":"not-found":"needs-picker"}setCity(e){let t=this.resolveCitySlug(e),i=new Date;i.setFullYear(i.getFullYear()+10),this.cookieService.set("mainCity",t,i,"/"),this.currentCitySubject.next(t),this.loadEventMods(t),this.loadSportsCategory(t)}syncCityFromUrl(e){this.setCity(e)}clearCity(){this.cookieService.delete("mainCity","/"),this.currentCitySubject.next("")}requestCityPicker(e){e.mandatory&&this.clearCity(),this.pickerRequestSubject.next(e)}openCityPicker(){this.requestCityPicker({mandatory:!1})}closeCityPicker(){this.pickerRequestSubject.next(null)}selectCity(e){let t=this.resolveCitySlug(e);this.setCity(t),this.navigationTargetCity=t,this.rewriteUrlForCity(t)}rewriteUrlForCity(e){let t=this.router.url.split("?")[0];if(!t||t==="/"){this.router.navigate(["/",e],{queryParamsHandling:"preserve"});return}let i=h(this.router.routerState.snapshot.root);if(!i){this.clearPendingCityNavigation();return}let r=C(i),o=i.data[l];if(!r||!o){this.clearPendingCityNavigation();return}let n=this.buildPathWithCity(t,o,i.params,r,e);if(!n||n===t){this.clearPendingCityNavigation();return}this.router.navigateByUrl(n+this.querySuffix())}
1buildPathWithCity(e,t,i,r,o){let n=e.split("/").filter(Boolean);if(t.type==="param"){let y=String(i[t.param]??r).toLowerCase(),f=n.findIndex(M=>M.toLowerCase()===y);return f<0?null:(n[f]=o,"/"+n.join("/"))}let c=String(i[t.param]??"");if(!c)return null;let w=P(c,o),v=n.findIndex(y=>y===c);return v<0?null:(n[v]=w,"/"+n.join("/"))}querySuffix(){let e=this.router.url,t=e.indexOf("?");return t>=0?e.slice(t):""}normalizeEventMods(e){let t=e.find(i=>i?.slug==="events");if(t){let i=e.filter(r=>r?.slug!=="events");return[t,...i]}return[...e]}loadEventMods(e,t=!0){let i=e.toLowerCase(),r=this.eventModsSubject.value;if(r.city===i&&r.mods.length>0&&!r.isLoading)return;this.eventModsSubject.next({mods:r.city===i?r.mods:[],isLoading:!0,isError:!1,city:i});let o=this.modsCache.get(i);o||(o=this.http.get(`ticketApp/v2/event-mod-v2/?city=${i}`).pipe(g(n=>t?this.normalizeEventMods(n??[]):n??[]),d(1)),this.modsCache.set(i,o)),o.subscribe({next:n=>{this.eventModsSubject.value.city===i&&this.eventModsSubject.next({mods:n,isLoading:!1,isError:!1,city:i})},error:()=>{this.eventModsSubject.value.city===i&&this.eventModsSubject.next({mods:[],isLoading:!1,isError:!0,
1city:i})}})}loadSportsCategory(e){let t=e.toLowerCase(),i=this.sportsCategorySubject.value;if(i.city===t&&i.sportsCategory.length>0&&!i.isLoading)return;this.sportsCategorySubject.next({sportsCategory:i.city===t?i.sportsCategory:[],isLoading:!0,isError:!1,city:t});let r=this.sportsCategoryCache.get(t);r||(r=this.http.getPlayApp(`categories/?city=${t}`).pipe(g(o=>o?.results??[]),d(1)),this.sportsCategoryCache.set(t,r)),r.subscribe({next:o=>{this.sportsCategorySubject.value.city===t&&this.sportsCategorySubject.next({sportsCategory:o,isLoading:!1,isError:!1,city:t})},error:()=>{this.sportsCategorySubject.value.city===t&&this.sportsCategorySubject.next({sportsCategory:[],isLoading:!1,isError:!0,city:t})}})}partitionCities(e){let t=[],i=[];return e.forEach(r=>{r.Popular?t.push(r):i.push(r)}),{popular:t,other:i}}static \u0275fac=function(t){return new(t||s)};static \u0275prov=j({token:s,factory:s.\u0275fac,providedIn:"root"})};export{C as a,k as b};

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.