1import{_ as R,C as x,o as $,w,b as o,i as a,f as n,s as V,z as N,e as m,l as B,A as M,F as b,k,t as I,j as g,az as P,r as f,I as D,L as F,ay as T,g as z,h as _,x as A,n as E,B as L}from"./DyKsjnBy.js";import{i as Q}from"./BqVZ7Yex.js";import{c as U}from"./Czjb_y8d.js";import{S as j}from"./Dkof3IgU.js";import{S as H}from"./bf4wTwgU.js";import{P as K}from"./ChalBoUl.js";import{u as G}from"./B19iVaUt.js";import{u as J}from"./Cp1O2d5O.js";import"./Dba53ezs.js";import"./D7fmv842.js";import"./BblRRkEU.js";const W=[{id:"videos",label:"Videos",value:"videos"},{id:"blogs",label:"Blogs",value:"blogs"}],X={class:"d-flex flex-column flex-sm-row"},Y={class:"input-group align-items-center"},Z={key:0,class:"form-group search-type border-secondary ms-2 col-md-2"},O=["value"],ee={key:1,class:"input-group-append"},te={__name:"FormsSearchForm",props:{showSubmitButton:{type:Boolean,default:!0}},emits:["change","submit"],setup(y,{emit:e}){const u=e,r=f(""),d=f("videos"),p=f([]),i=x();$(()=>{r.value=i.query.query||"",d.value=i.query.type||"videos",p.value=W});const S=()=>{l()},t=()=>{l()},l=()=>{const c={value:r.value,type:d.value};u("change",c)},h=c=>{c.preventDefault();const s={value:r.value,type:d.value};u("submit",s)};return w(()=>i.query,c=>{r.value=c.query||"",d.value=c.type||"videos"}),(c,s)=>(o(),a("form",{class:"form-inline",onSubmit:P(h,["prevent"])},[n("div",X,[n("div",Y,[V(n("input",{class:"form-control form-control-lg border-secondary py-3",type:"search","onUpdate:modelValue":s[0]||(s[0]=v=>B(r)?r.value=v:null),placeholder:"Search by title or keyword",onKeyup:S},null,544),[[N,m(r)]]),m(p).length>0?(o(),a("div",Z,[V(n("select",{class:"form-select","onUpdate:modelValue":s[1]||(s[1]=v=>B(d)?d.value=v:null),onChange:t},[(o(!0),a(b,null,k(m(p),v=>(o(),a("option",{value:v.value,key:v.id},I(v.label),9,O))),128))],544),[[M,m(d)]])])):g("",!0),y.showSubmitButton?(o(),a("div",ee,[...s[2]||(s[2]=[n("button",{class:"btn btn-outline-secondary",type:"submit"},[n("i",{class:"fas fa-search"})],-1)])])):g("",!0)])])],32))}},se=R(te,[["__scopeId","data-v-2516feb2"]]);function oe(){D().public;const{$api:y}=F();return{searchQuery:async(u,r=1,d="videos",p=100)=>{const i=(r-1)*p;return await y.request(`/esearch?q=${encodeURIComponent(u)}&type=${d}&from=${i}&size=${p}&version=v2`)}}}const ae={class:"row"},ne={class:"col-12"},re={class:"pt-3"},ie={key:0},le={key:1},ce={class:"row"},ue={class:"row mt-4"},de={key:0,class:"row mt-4"},pe={class:"pt-3"},ye={__name:"SearchResultsView",props:{query:String,type:String},setup(y){const e=y,u=f([]),r=f({totalPages:0}),d=x();T();const{searchQuery:p}=oe(),i=async(t,l,h)=>{const s=await p(t,l,h,50),v=s?.hits?.total?.value??0;r.value.totalPages=Math.ceil(v/50),s?.took>0&&(u.value=s.hits.hits)},S=async t=>{e.query&&await i(e.query,t,e.type)};return $(async()=>{const t=d.query.page||1;e.query&&await i(e.query,t,e.type)}),w(()=>e.query,async(t,l)=>{t&&t!==l&&await i(t,1,e.type)}),w(()=>e.type,async(t,l)=>{t&&t!==l&&await i(e.query,1,t)}),(t,l)=>(o(),a(b,null,[n("div",ae,[n("div",ne,[n("h3",re,[y.type==="videos"?(o(),a("span",ie,"Video")):g("",!0),y.type==="blogs"?(o(),a("span",le,"Blog")):g("",!0),l[0]||(l[0]=z(" results found ",-1))])])]),n("div",ce,[y.type==="videos"?(o(!0),a(b,{key:0},k(m(u),(h,c)=>(o(),a("div",{class:"col-6 col-sm-3 py-3",key:c},[_(j,{video:h},null,8,["video"])]))),128)):g("",!0),y.type==="blogs"?(o(!0),a(b,{key:1},k(m(u),(h,c)=>(o(),a("div",{class:"col-6 col-sm-3 py-3",key:c},[_(H,{blog:h},null,8,["blog"])]))),128)):g("",!0)]),n("div",ue,[_(m(K),{"total-pages":m(r).totalPages,onChange:S},null,8,["total-pages"])]),m(u)===void 0||m(u).length===0?(o(),a("div",de,[n("h3",pe,' No results found for "'+I(y.query)+'" ',1)])):g("",!0)],64))}},ve={class:"container main-content pt-3"},me={key:0},he={key:1},ge={key:0,class:"row"},fe={class:"pt-3"},_e={__name:"index",async setup(y){let e,u;const r=f(!0),{getAllParentCategories:d}=G(),p=f(""),i=f(""),S=([e,u]=A(()=>d()),e=await e,u(),e),t=L(()=>p.value.length>0),l=x(),{getPageMetaData:h,IDENTIFIERS:c}=J(),s=h(c.SEARCH);E({title:s.title,description:s.description,ogTitle:s.title,ogDescription:s.description}),$(()=>{p.value=l.query.query||"",i.value=l.query.type||""});const v=q=>{p.value=q.value||"",i.value=q.type||""};return r.value=!1,(q,C)=>(o(),a("div",ve,[_(se,{"show-submit-button":!1,onChange:v}),t.value?(o(),a("div",me,[_(ye,{query:p.value,type:i.value,"per-page":20},null,8,["query","type"])])):(o(),a("div",he,[r.value?g("",!0):(o(),a("div",ge,[C[0]||(C[0]=n("div",{class:"container-fluid explore pt-3"},[n("h1",null,"Explore"),n("p",null," Not sure what to search for? Check out some of the categories and instructors on Fitmotivation. ")],-1)),_(U,{categories:m(S)},null,8,["categories"]),n("div",fe,[_(Q)])]))]))]))}},Ie=R(_e,[["__scopeId","data-v-7f71190e"]]);export{Ie 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.