1import{C as W,D as G,a as X,u as Z,s as R,r as y,H as k,o as ee,w as te,d as i,e as a,n as m,g as n,t as p,F as q,m as $,h as P,Q as ae,M as oe,R as se,i as le,f as Q,I as ne,T as z,O as re,c as u,J as ie}from"./B2zKXTBA.js";import{g as ue}from"./C9VRpM3s.js";import{u as de}from"./C-El9R_f.js";import{u as ce}from"./DN_qoCjR.js";import{r as ge}from"./gTDIn4Kz.js";import{r as ve}from"./DqIhgBJo.js";import"./CYpY1rdy.js";const ye={class:"font-sans bg-gray-50 min-h-screen"},pe={class:"py-2 mx-8 2xl:mx-40"},he={class:"flex items-center space-x-2 pa-2 py-5"},fe={class:"flex flex-col xl:flex-row items-center justify-between w-full space-y-4 xl:space-y-0 xl:space-x-4"},xe={class:"flex flex-grow-0 flex-shrink-0 whitespace-nowrap md:flex-wrap justify-start overflow-x-auto space-x-2 p-2 w-full xl:w-auto"},_e=["onMouseover","onClick"],me={class:"relative mt-4 xl:mt-0 w-full xl:w-auto xl:flex-1 flex-shrink-0"},we={class:"flex justify-end items-center mt-8 px-4 mb-8"},be={class:"text-gray-600",style:{fontweight:500}},ke={class:"text-orange-700"},Ce={key:0},Se={key:0,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},Te=["onClick"],Le=["src","alt"],qe={class:"p-4"},$e={class:"text-lg font-bold text-gray-800 mb-2 line-clamp-2"},Me={class:"text-sm text-gray-500 mb-3"},De={class:"text-sm text-gray-700 mb-3 line-clamp-2 break-all"},Ve=["innerHTML"],je={key:1},Ae={class:"flex justify-center items-center space-x-2 mt-8 py-4"},Re=["disabled"],Pe=["onClick"],Qe=["disabled"],ze={key:1},et={__name:"list-video",setup(Be){const{fetchAllContentList:h,fetchCategoryVideoList:B}=de(),x=W(),N=re(),l=G(),c=X(),w=Z(),s=ce(),{color:M,hover_color:Y}=R(w),{search_text:v,article_contents:Ne,qty_article_list:Ye,search_text_tag:He,tag_content_list:_,all_content_list:Ie,all_content_cate:Oe,qty_search_tag_list:D,temp_cate_news_list:Ee,temp_cate_article_list:Fe,cate_video_list:H}=R(s),C=y(!1),V=y(null),S=y(!1),I=y({id:"",store_id:N.public.SHOP_ID,content_type:"",category_name:"à¸à¸±à¹à¸à¸«à¸¡à¸",count_no:0,sort_no:0,created_at:null,created_by:null,updated_at:null,updated_by:null,status:!0});let b=y([]);const f=y(""),O=y(9),r=y(1),T=k(()=>Math.ceil(D.value/O.value)),E=k(()=>(_==null?void 0:_.value)??[]),j=k(()=>l.query.category_name??"สิà¸à¸à¹à¸²à¸à¸±à¹à¸à¸«à¸¡à¸"),F=k(()=>(b==null?void 0:b.value)??[]);ee(async()=>{f.value=l.query.category_id;try{let o=await B();await s.updateCateVideoList(o.data);let e=await h(l.query);await s.updateQTYSearchTagList(e.data.count),await s.updateAllVideoContents(e.data.contents),b.value=[I.value,...H.value]}catch(o){console.log("in catch ERROR"),console.log("err >>> ",o)}}),te([()=>r.value],async([o])=>{var e,t;if(o){let d={search:v.value?v.value:"",page:r.value?r.value:"",limit:l.query.limit,content_type:"video",category_id:(e=l==null?void 0:l.query)!=null&&e.category_id?(t=l==null?void 0:l.query)==null?void 0:t.category_id:""};c.changeStateLoading(!0);let g=await h(d);await s.updateQTYSearchTagList(g.data.count),await s.updateAllVideoContents(g.data.contents),c.changeStateLoading(!1)}});const L=o=>{o>=1&&o<=T.value&&(r.value=o)};async function K(){c.changeStateLoading(!0),s.changeSearchText("");let o={search:"",page:"1",limit:l.query.limit,content_type:"video",category_id:""},e=await h(o);await s.updateQTYSearchTagList(e.data.count),await s.updateAllVideoContents(e.data.contents),x.push({path:"/news/list-video",query:o}),r.value=1,c.changeStateLoading(!1)}async function A(){c.changeStateLoading(!0);let o={search:v.value,page:"1",limit:l.query.limit,content_type:"video",category_id:l.query.category_id?l.query.category_id:""},e=await h(o);await s.changeSearchText(v.value),await s.updateQTYSearchTagList(e.data.count),await s.updateAllVideoContents(e.data.contents),x.push({path:"/news/list-video",query:o}),r.value=1,c.changeStateLoading(!1)}function J(o){const e=ue(o.title),t=e?`${e}-${o.id}`:`${o.id}`;x.push({path:`/news/${t}`}).then(()=>{location.reload()})}async function U(o,e){c.changeStateLoading(!0),f.value=o.id;let t={search:"",page:"1",limit:l.query.limit,content_type:"video",category_id:o.id,category_name:e},d={search:"",page:"1",limit:l.query.limit,content_type:"video",category_id:"",category_name:"à¸à¸±à¹à¸à¸«à¸¡à¸"};if(o.content_type==="video"){let g=await h(t);await s.updateQTYSearchTagList(g.data.count),await s.updateAllVideoContents(g.data.contents),x.push({path:"/news/list-video",query:t}),r.value=1,c.changeStateLoading(!1)}else if(o.content_type)console.log("something wrong in content category");else{s.changeSearchText("");let g=await h(d);await s.updateQTYSearchTagList(g.data.count),await s.updateAllVideoContents(g.data.contents),x.push({path:"/news/list-video",query:d}),r.value=1,c.changeStateLoading(!1)}}return(o,e)=>(u(),i("div",ye,[a("div",pe,[a("div",null,[a("ul",he,[a("li",null,[a("a",{href:"/news",onMouseover:e[0]||(e[0]=t=>C.value=!0),onMouseleave:e[1]||(e[1]=t=>C.value=!1),style:m({textDecoration:C.value?"underline":"none"})}," à¸à¸à¸à¸§à¸²à¸¡à¹à¸¥à¸°à¸§à¸´à¸à¸µà¹à¸ ",36)]),e[10]||(e[10]=a("li",null,"/",-1)),a("li",{style:m({color:n(w).color})},p(j.value==="สิà¸à¸à¹à¸²à¸à¸±à¹à¸à¸«à¸¡à¸"?"à¸à¸±à¹à¸à¸«à¸¡à¸":j.value),5)])]),e[16]||(e[16]=a("h1",{class:"text-3xl font-bold text-center text-gray-800 mb
1-8"},p("วิà¸à¸µà¹à¸"),-1)),a("div",fe,[a("div",xe,[(u(!0),i(q,null,$(F.value,t=>(u(),i("button",{onMouseover:d=>V.value=t,onMouseleave:e[2]||(e[2]=d=>V.value=null),key:t,class:"cursor-pointer p-4 transition duration-150 ease-in-out hover:underline whitespace-nowrap",style:m({color:f.value===t.id?n(w).color:"black",borderBottom:f.value===t.id?"2px solid":"1px solid",borderColor:f.value===t.id?n(w).color:"transparent",fontWeight:f.value===t.id?"bold":"normal"}),onClick:d=>U(t,t.category_name)},p(t.category_name==="สิà¸à¸à¹à¸²à¸à¸±à¹à¸à¸«à¸¡à¸"?"à¸à¸±à¹à¸à¸«à¸¡à¸":t.category_name),45,_e))),128))]),e[11]||(e[11]=a("hr",{class:"border-t border-gray-300 my-4 w-full xl:hidden",style:{"border-color":"#D1D1D1"},role:"separator","aria-orientation":"horizontal"},null,-1)),a("div",me,[P(a("input",{type:"text",class:"w-full border px-4 pl-4 pr-10 py-2 border-gray-300 rounded-full focus:outline-none focus:ring-2 focus:ring-orange-700",placeholder:"à¸à¹à¸à¸«à¸²","onUpdate:modelValue":e[3]||(e[3]=t=>se(v)?v.value=t:null),onKeyup:e[4]||(e[4]=oe(t=>A(),["enter"]))},null,544),[[ae,n(v)]]),P(a("button",{onClick:K,class:"cursor-pointer absolute inset-y-0 right-0 pr-10 flex items-center text-gray-500 hover:text-gray-700 focus:outline-none"},[Q(n(ge),{class:"h-5 w-5"})],512),[[le,n(v)]]),a("button",{onMouseover:e[5]||(e[5]=t=>S.value=!0),onMouseleave:e[6]||(e[6]=t=>S.value=!1),class:"cursor-pointer absolute right-1 top-0 h-full flex items-center",onClick:e[7]||(e[7]=t=>A())},[Q(n(ve),{class:"h-8 w-8",style:m({color:S.value?n(Y):n(M)})},null,8,["style"])],32)])]),e[17]||(e[17]=a("hr",{class:"border-t border-gray-300 my-4 w-full hidden xl:block",style:{"border-color":"#D1D1D1"},role:"separator","aria-orientation":"horizontal"},null,-1)),a("div",we,[a("div",be,[e[12]||(e[12]=ne(" à¸à¸¥à¸¥à¸±à¸à¸à¹à¸à¸µà¹à¸à¸ ")),a("span",ke,p(n(D))+" รายà¸à¸²à¸£",1)]),e[13]||(e[13]=a("div",{class:"flex items-center space-x-2"},null,-1))]),E.value.length>0?(u(),i("div",Ce,[n(_).length>0?(u(),i("div",Se,[(u(!0),i(q,null,$(n(_).slice(0,10),(t,d)=>(u(),i("div",{key:d,class:"cursor-pointer bg-white rounded-lg shadow-md overflow-hidden",onClick:g=>J(t)},[a("img",{src:t.img_title,alt:t.img_title,class:"w-full h-48 object-contain"},null,8,Le),a("div",qe,[a("span",{class:"inline-block text-xs font-semibold px-2 py-1 mb-3 rounded-xl",style:m({color:"white",background:n(M)})},p(t.category_name),5),a("h3",$e,p(t.title),1),a("p",Me,p(n(s).formatThaiDatetime(t.updated_at)),1),a("div",De,[a("div",{innerHTML:n(s).cleanContentDescription(t.content)},null,8,Ve)])])],8,Te))),128))])):(u(),i("div",je,e[14]||(e[14]=[z('<div class="font-sans bg-gray-50 min-h-screen flex items-center justify-center p-4 sm:p-6 lg:p-8"><div class="p-8 sm:p-10 lg:p-12 text-center max-w-md w-full"><div class="mb-6 flex justify-center"><svg class="h-20 w-20 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div><h1 class="text-3xl sm:text-4xl font-bold text-gray-800 mb-3"> à¹à¸¡à¹à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥ </h1></div></div>',1)]))),a("div",Ae,[a("button",{onClick:e[8]||(e[8]=t=>L(r.value-1)),disabled:r.value===1,class:"px-3 py-1 rounded-full bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:opacity-50"}," à¸à¹à¸à¸à¸«à¸à¹à¸² ",8,Re),(u(!0),i(q,null,$(T.value,t=>(u(),i("button",{key:t,onClick:d=>L(t),class:ie([{"bg-orange-700 text-white":r.value===t,"bg-gray-200 text-gray-700 hover:bg-gray-300":r.value!==t},"px-3 py-1 rounded-full"])},p(t),11,Pe))),128)),a("button",{onClick:e[9]||(e[9]=t=>L(r.value+1)),disabled:r.value===T.value,class:"px-3 py-1 rounded-full bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:opacity-50"}," à¸à¸±à¸à¹à¸ ",8,Qe)])])):(u(),i("div",ze,e[15]||(e[15]=[z('<div class="font-sans bg-gray-50 min-h-screen flex items-center justify-center p-4 sm:p-6 lg:p-8"><div class="p-8 sm:p-10 lg:p-12 text-center max-w-md w-full"><div class="mb-6 flex justify-center"><svg class="h-20 w-20 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div>
1<h1 class="text-3xl sm:text-4xl font-bold text-gray-800 mb-3"> à¹à¸¡à¹à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥ </h1></div></div>',1)])))])]))}};export{et 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.