1import{L as b}from"./Loader-l3cSYZQu.js";import{L as k}from"./LevelNutshellInfo-DjRb3ygr.js";import{B as C}from"./BookableCourse-Dq8fFiga.js";import{D as S}from"./DayNightFilter-CM1waTlp.js";import{R as P}from"./Reviews-BqSxzcvB.js";import{A as F}from"./ActiveViewers-A2_7Tenx.js";import{r as u,o as t,c as o,f as i,a as l,t as n,b as a,g as T,h as g,F as z,e as B,d as L}from"./vue-router-Cc0Ijf1R.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./CourseInfo-BTHkqpJ3.js";import"./SwitchClassModal-Bw6rkU59.js";import"./Modal-CdTST-ss.js";import"./Classs-C6gRJWN2.js";import"./ClassInfo-CBqQ3OYP.js";import"./PriceDisplay-CqRtbCYR.js";import"./index-CNRiTe65.js";import"./_commonjsHelpers-_d1bhYXs.js";const D={components:{Reviews:P,BookableCourse:C,LevelNutshellInfo:k,Loader:b,DayNightFilter:S,ActiveViewers:F},data(){return{level:null,courses:[],timezone:"",pricingOption:null,ready:!1,status:"",currentPage:0,totalPages:0,timeOfDay:"day",referrerSlug:null,previewSlug:null}},mounted(){this.timezone=this.guessTimezone(),this.referrerSlug=window.localStorage.getItem("bergesReferrerSlug"),this.previewSlug=window.localStorage.getItem("bergesPreviewSlug"),this.previewSlug&&window.localStorage.removeItem("bergesPreviewSlug"),axios.get("/levels/"+this.$route.params.level_slug).then(s=>{this.level=s.data.data,this.addTitleAndDescription(this.$t("titleBrowseCourses",{level:this.level.name}),this.$t("descriptionBrowseCourses",{level:this.level.name})),!this.getAuthToken()||this.previewSlug?axios.get("/pricing-options/courses?currency="+this.getCurrency()).then(r=>{this.pricingOption=r.data.data[this.level.slug===this.$t("dealLevelSlug")&&!this.isEnglishClassesWebsite?0:1],this.ready=!0,this.getCourses()}):(this.ready=!0,this.getCourses())})},methods:{getCourses(){this.status||(this.status="loading",axios.get("/all-courses?page="+(this.currentPage+1)+"&level_id="+this.level.id+"&time_of_day="+this.timeOfDay+"&timezone="+encodeURIComponent(this.timezone)).then(s=>{this.currentPage++,this.totalPages=s.data.meta.last_page,s.data.data.forEach(r=>{r.classes.forEach(m=>this.addFrontEndClassProperties(m)),this.courses.push(r)}),this.status=""}).catch(s=>Snackbar.show(this.getErrorMessage(s))))},onFilterChange(s){this.timeOfDay=s,this.courses=[],this.currentPage=0,this.totalPages=0,this.getCourses()}}},I={key:0,class:"pt-4 px-4 pb-2 border-bottom"},E={class:"fw-bold w-100"},N={class:"h4 mb-0"},x={class:"d-flex justify-content-start small mt-3"},A=["innerHTML"],M={key:1,class:"px-4 py-3 border-bottom"},R={key:2,class:"p-4 border-bottom small"},V={class:"h5"},H={key:0,class:"fw-bold"},W={key:1,class:"fw-bold"},j={key:3,class:"py-3 px-4 border-bottom"},U={href:"",class:"small"},Y={key:6,class:"p-4"};function q(s,r,m,G,e,c){const d=u("active-viewers"),p=u("loader"),v=u("reviews"),_=u("level-nutshell-info"),f=u("router-link"),w=u("day-night-filter"),y=u("bookable-course");return t(),o("div",null,[i(d),i(p,{show:!e.ready,class:"mb-5"},null,8,["show"]),e.ready?(t(),o("div",I,[l("div",E,[l("h2",N,n(e.level.name),1)]),l("span",null,[i(v,{reviewable:e.level},null,8,["reviewable"])]),l("div",x,[i(_,{level:e.level},null,8,["level"])]),l("div",{class:"mt-4 mb-3",innerHTML:e.level.description},null,8,A)])):a("",!0),e.ready&&!s.getAuthToken()?(t(),o("div",M,[i(f,{to:s.$path("how-it-works"),class:"fw-bold"},{default:T(()=>[g(n(s.$t("newHereHowItWorks"))+" â ",1)]),_:1},8,["to"])])):a("",!0),e.ready&&(e.previewSlug||e.referrerSlug)?(t(),o("div",R,[l("h2",V,n(s.$t("youveBeenInvited")),1),e.previewSlug?(t(),o("span",H,n(e.previewSlug),1)):e.referrerSlug?(t(),o("span",W,n(e.referrerSlug),1)):a("",!0),g(" "+n(s.$t("wantsYouToTakeCourse")),1)])):a("",!0),e.ready?(t(),o("div",j,[i(w,{onFilterChange:c.onFilterChange},null,8,["onFilterChange"])])):a("",!0),e.ready?(t(!0),o(z,{key:4},B(e.courses,h=>(t(),o("div",null,[i(y,{course:h,level:e.level,timezone:e.timezone,pricingOption:e.pricingOption},null,8,["course","level","timezone","pricingOption"])]))),256)):a("",!0),i(p,{show:e.status,class:"mb-5"},null,8,["show"]),e.ready&&!e.status&&e.courses.length>0&&e.currentPage<e.totalPages?(t(),o("div",{key:5,class:"p-4",onClick:r[0]||(r[0]=L((...h)=>c.getCourses&&c.getCourses(...h),["prevent"]))},[l("a",U,n(s.$t("loadMore")),1)])):a("",!0),e.ready&&!e.status&&e.courses.length===0?(t(),o("div",Y,n(s.$t("noResults")),1)):a("",!0),r[1]||(r[1]=l("div",{class:"pb-5"},null,-1))])}const ce=O(D,[["render",q]]);export{ce 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.