1import{n as e}from"./CU89Zi3L.js";import{T as t,o as n,t as r}from"./Bm3fw_KB.js";var i=e=>({abbreviation:e.abbreviation,facebook:null,gender:null,global_sport_id:null,global_sport_shortname:e.globalSportShortName,global_sport_name_slug:e.globalSportNameSlug,id:e.id,instagram:null,non_sport:!1,pinterest:null,shortname:e.shortName,title:e.title,tickets:null,twitter:null,youtube:null,short_title:e.shortTitle||null,url:null});function a(e,t){return{credit:e.credit,caption:e.caption,image:n({url:e.imageUrl[t],alt_text:e.caption}),id:e.id}}function o(e){return{caption:e.primaryImage?.caption||``,credit:e.primaryImage?.credit||``,date:e.date,gallery_images:e.images?.length?e.images?.map(e=>({small:a(e,`small`),medium:a(e,`medium`),large:a(e,`large`),original:a(e,`original`)})):null,id:e.id,images:{small:a(e.primaryImage,`small`),medium:a(e.primaryImage,`medium`),large:a(e.primaryImage,`large`),original:a(e.primaryImage,`original`)},sport:e.sports?.length?i(e.sports[0]):null,title:e.title,title_slug:e.titleSlug,url:e.url}}var s=e=>{let{props:t}=e,n=new r(t?.start,t?.count);return{params:{$pageIndex:n.pageIndex,$pageSize:n.pageSize,sportId:t?.sport_id,galleryId:`extra`in t&&t?.extra?.gallery_id?t.extra.gallery_id:void 0,imageId:`extra`in t&&t?.extra?.image_id?t.extra.image_id:void 0,includeImages:!0},paginationHandler:n}},c=class{fetch;resource=`/api/v2/ImageGalleries`;constructor({fetch:e}){this.fetch=e}async get(e){let{params:t,paginationHandler:n}=s(e);return this.fetch(this.resource,{params:t}).then(e=>{if(!e)return console.error(`[GalleryRepo] get() fetch Failed`),[];let t=e.map(e=>o(e));return t?.length?n.getData(t):[]}).catch(e=>(console.error(`[GalleryRepo] get() mapping Failed`,e),[]))}async getSettings(){return this.fetch(`${this.resource}/settings`).then(e=>e?t(e):(console.error(`[GalleryRepo] getSettings() fetch Failed`),null)).catch(e=>(console.error(`[GalleryRepo] getSettings() mapping Failed`,e),null))}},l=e(`gallery`,{state:()=>({galleries:{},isLoadingMore:!1,isLoading:!1,moreToLoad:!0}),actions:{async fetchGalleries(e){let{fetch:t,...n}=e;if(!(e.hash in this.galleries)){this.isLoading=!0;let r=await new c({fetch:t}).get(n);this.galleries[e.hash]=r,this.isLoading=!1}},async fetchMoreGalleries(e){let{props:t,fetch:n}=e;this.isLoadingMore=!0;let r=await new c({fetch:n}).get(e);(!r||!r.length||r.length&&t.count&&r.length<t.count)&&(this.moreToLoad=!1),this.galleries[e.hash]=[...this.galleries[e.hash]??[],...r],this.isLoadingMore=!0}},getters:{getGalleries:e=>t=>{let n=t;return n in e.galleries&&e.galleries[n]?e.galleries[n]:[]},getLoadingMoreFlag(e){return e.isLoadingMore},getLoadingFlag(e){return e.isLoading},getMoreToLoad(e){return e.moreToLoad}}});export{l as t};
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.