1import{L as n,B as d,J as m}from"./C_VzGqEg.js";import p from"./BrEk0DBG.js";import{n as o}from"./CTf3eFxt.js";import{u as h,a as c}from"./BhyboY_X.js";const g={data(){return{ArcadeService:m}},computed:{...d(c,["currentFilters","providers","gameTypesArray","themes","features"]),...d(h,["allGamesTypes","allProviders","allThemes","allFeatures","sortingOptions","providerSelected","themeSelected","featureSelected","isAllGamesFilterType","selectedGameType","options"]),translatedSortingOptions(){return this.sortingOptions.map(e=>({...e,label:this.$t(e.label)}))}},watch:{isAllGamesFilterType:{handler(e,t){e&&e!==t&&this.updateGameTypeFilter(this.allGamesTypes[0])}},providers:{immediate:!0,deep:!0,handler(e){e&&e.length&&this.SET_ALL_PROVIDERS([...e.map(t=>({value:t.id,label:t.name,image:this.getProviderImagePath(t?.name)}))])}},themes:{immediate:!0,deep:!0,handler(e){if(e&&e.length){const t=[...e.map(s=>{const i=this.toCamelCase(s.value||"");return{value:s.value,label:this.translateIfExists("themes",i,s.value)}})];this.SET_ALL_THEMES(t.sort((s,i)=>s.label.localeCompare(i.label)))}}},features:{immediate:!0,deep:!0,handler(e){if(e&&e.length){const t=[...e.map(s=>{const i=this.toCamelCase(s.value||"");return{value:s.value,label:this.translateIfExists("features",i,s.value)}})];this.SET_ALL_FEATURES(t.sort((s,i)=>s.label.localeCompare(i.label)))}}},gameTypesArray:{immediate:!0,deep:!0,handler(e){if(e&&e.length){const t=e.map(r=>{const a=this.toCamelCase(r.id||""),l=p[a]||{};return{...r,name:this.translateIfExists("gameTypes",a,r.id),image:l.freeGamesiconPath}}),s=["SLOTS","ROULETTE","BLACKJACK","CRASH_GAMES","CARD_GAMES","TABLE_GAMES"],i=t.sort((r,a)=>{const l=s.indexOf(r.id.toUpperCase()),u=s.indexOf(a.id.toUpperCase());return l!==-1&&u!==-1?l-u:l!==-1?-1:u!==-1?1:r.name.localeCompare(a.name)});this.SET_ALL_GAMES_TYPES([{id:"RECOMMENDED",name:this.$t("gameTypes.recommended"),image:"/images/arcade-game-types/recommended.svg",selected:!1},{id:"ALL",name:this.$t("gameTypes.allGames"),image:"/images/arcade-game-types/all.svg",selected:!1},...i])}}}},methods:{normalizeProviderName:o,translateIfExists(e,t,s){if(!t)return s!=null&&s!==""?String(s):"";const i=`${e}.${t}`;return this.$te(i)?this.$t(i):s!=null&&s!==""?String(s):t},toCamelCase(e){return e.trim().replaceAll("&","And").replaceAll(/[^a-zA-Z0-9_ ]+/g,"").toLowerCase().split(/[\s_]+/).map((t,s)=>s===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join("")},isAllGamesFilter(e){return"sortingFields"in e?!1:Object.entries(e).every(([t,s])=>t==="sortingFields"?!0:Array.isArray(s)&&s?.length===0)},checkAndSwitchGameType(e){this.selectedGameType==="RECOMMENDED"&&(e.providerIds&&e.providerIds.length>0||e.sortingFields&&Object.keys(e.sortingFields).length>0||e.attributes&&e.attributes.length>0||e.name&&e.name.length>0)&&this.updateGameTypeFilter(this.allGamesTypes[1])},setCorrectGameType(){const e=this.currentFilters?.attributes&&this.currentFilters?.attributes?.length,t=this.currentFilters?.providerIds&&this.currentFilters?.providerIds?.length,s=this.currentFilters?.sortingFields&&Object.keys(this.currentFilters?.sortingFields)?.length;(e||t||s&&this.selectedGameType==="RECOMMENDED")&&this.updateGameTypeFilter(this.allGamesTypes[1])},updateProviderIdsFilters(e){const t=e.map(i=>i.value),s={...this.currentFilters,providerIds:[...t]};this.checkAndSwitchGameType(s),this.updateCurrentFilters(s)},updateSortingFilters(e){let t={search_volume:"DESC"};switch(e.value){case"popular":t={search_volume:"DESC"};break;case"newest":t={release_date:"DESC"};break;case"AtoZ":t={name:"ASC"};break;case"ZtoA":t={name:"DESC"};break;default:t={search_volume:"DESC"};break}const s={...this.currentFilters,sortingFields:{...t}};this.checkAndSwitchGameType(s),this.updateCurrentFilters(s)},updateGameNameFilters(e){let t={};if(e&&e?.length)this.selectedGameType==="RECOMMENDED"?(this.updateGameTypeFilter(this.allGamesTypes[1]),t={...this.currentFilters,name:e}):t={...this.currentFilters,name:e},this.$emit("is-all-game-type",!1),this.updateCurrentFilters(t);else{this.updateGameTypeFilter(this.allGamesTypes[0]);const s={...JSON.parse(JSON.stringify(this.currentFilters))};delete s.name,this.updateCurrentFilters(s),this.$emit("is-all-game-type",!0)}},updateThemeFilters(e){const t={attributeType:"Themes",comparisonOperator:"in",value:e.map(a=>a.value)},i=[...this.currentFilters?.attributes?this.currentFilters?.attributes?.filter(a=>a?.attributeType!=="Themes"):[]];let r={...JSON.parse(JSON.stringify(this.currentFilters))};e.length&&i.push(t),i.length?r={...this.currentFilters,attributes:i}:r?.attributes?.length<=1&&r?.attributes[0]?.attributeType==="Themes"?r.attributes=[]:r.attributes=r.attributes.filter(a=>a.attributeType!=="Themes"),this.checkAndSwitchGameType(r),this.updateCurrentFilters(r)},updateFeatureFilters(e){const t={attributeType:"Bonus Game Feature",comparisonOperator:"in",value:e.map(a=>a.value)},i=[...this.currentFilters?.attributes?this.currentFilters?.attributes.filter(a=>a?.attributeType!=="Bonus Game Feature"):[]];let r={...JSON.parse(JSON.stringify(this.currentFilters))};e.length&&i.push(t),i.length?r={...this.currentFilters,attributes:i}:r?.attributes?.length<=1&&r?.attributes[0]?.attributeType==="Bonus Game Feature"?r.attributes=[]:r.attributes=r.attributes.filter(a=>a.attributeType!=="Bonus Game Feature"),this.checkAndSwitchGameType(r),this.updateCurrentFilters(r)},updateGameTypeFilter(e){this.SET_SELECTED_GAME_TYPE(e?.id);let t={};if(e.id!=="ALL"&&e.id!=="RECOMMENDED"){let s=[...this.currentFilters.gameTypes||[]];s.indexOf(e.id)===-1?s=[e.id]:s=[],t={...this.currentFilters,gameTypes:[...s]}}else e.id==="RECOMMENDED"?t={gameTypes:[]}:e.id==="ALL"&&(t={...this.currentFilters,gameTypes:[],sortingFields:{search_volume:"DESC"}});this.updateCurrentFilters(t)},checkIfProviderIsSelected(){this.SET_ALL_PROVIDERS(this.allProviders.map(e=>this.currentFilters.providerIds&&this.currentFilters.providerIds.includes(e.value)?{...e,selected:!0}:{...e,selected:!1})),this.currentFilters.providerIds&&this.currentFilters.providerIds.length?this.SET_PROVIDER_SELECTED(!0):this.SET_PROVIDER_SELECTED(!1)},checkIfThemeIsSelected(){this.SET_ALL_THEMES(this.allThemes.map(e=>this.currentFilters.attributes&&this.currentFilters.attributes.some(t=>t.attributeType==="Themes"&&t?.value?.includes(e.value))?{...e,selected:!0}:{...e,selected:!1})),this.currentFilters.attributes&&this.currentFilters.attributes.some(e=>e.attributeType==="Themes")?this.SET_THEME_SELECTED(!0):this.SET_THEME_SELECTED(!1)},checkIfFeatureIsSelected(){this.SET_ALL_FEATURES(this.allFeatures.map(e=>this.currentFilters.attributes&&this.currentFilters.attributes.some(t=>t.attributeType==="Bonus Game Feature"&&t?.value?.includes(e.value))?{...e,selected:!0}:{...e,selected:!1})),this.currentFilters.attributes&&this.currentFilters.attributes.some(e=>e.attributeType==="Bonus Game Feature")?this.SET_FEATURE_SELECTED(!0):this.SET_FEATURE_SELECTED(!1)},checkIfSortByIsSelected(){this.SET_SORTING_OPTIONS(this.sortingOptions.map(e=>e.value==="popular"&&this.currentFilters.sortingFields&&this.currentFilters.sortingFields.search_volume?{...e,selected:!0}:e.value==="newest"&&this.currentFilters.sortingFields&&this.currentFilters.sortingFields.release_date?{...e,selected:!0}:e.value==="AtoZ"&&this.currentFilters.sortingFields&&this.currentFilters.sortingFields.name&&this.currentFilters.sortingFields.name==="ASC"?{...e,selected:!0}:e.value==="ZtoA"&&this.currentFilters.sortingFields&&this.currentFilters.sortingFields.name&&this.currentFilters.sortingFields.name==="DESC"?{...e,selected:!0}:{...e,selected:!1}))},getProviderImagePath(e){return`/images/logos/badges/game-providers/mini-logos/light/${this.normalizeProviderName(e)}.svg`},...n(c,["updateCurrentFilters"]),...n(h,{SET_ALL_GAMES_TYPES:"setAllGamesTypes",SET_ALL_PROVIDERS:"setAllProviders",SET_ALL_THEMES:"setAllThemes",SET_ALL_FEATURES:"setAllFeatures",SET_SORTING_OPTIONS:"setSortingOptions",SET_PROVIDER_SELECTED:"setProviderSelected",SET_THEME_SELECTED:"setThemeSelected",SET_FEATURE_SELECTED:"setFeatureSelected",SET_IS_ALL_GAMES_FILTER_TYPE:"setIsAllGamesFilterType",SET_SELECTED_GAME_TYPE:"setSelectedGameType",SET_OPTIONS:"setOptions"})}};export{g as f};
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.