PageSourceSearch

https://www.sahseh.co/_nuxt/BJ2QTpgx.js

js sahseh.co collected 2026-10-01 23:44:56 UTC 8,075 bytes, 1 lines download raw bytes

1import{ac as V,ad as A,a6 as q,q as T,$ as E,_ as I,a9 as O,af as G,a as J}from"#entry";import{w as P,ae as c,a3 as Q,l as i,i as e,al as o,aq as g,s as r,a as y,af as k,aH as h,r as z,k as F,a7 as l,j as U}from"./BX5cLl_a.js";import W from"./BzVTExE5.js";import $ from"./DMC9WP3d.js";import{a as X}from"./DuvcHjSu.js";import{S as Y}from"./C8toBU3F.js";import Z from"./C_RKdlt4.js";import{b as N}from"./CFNOZVDW.js";import ee from"./BrPofuDw.js";import te from"./NGdVzRzG.js";import{u as D}from"./OvOTQfkN.js";import"./BI_8G9hX.js";import"./YSicwR_q.js";import"./w1piS63L.js";import"./BjiQ9Wte.js";import"./Cgop0VTx.js";import"./b5AUgy-D.js";const se={class:"bg-neutral-50"},oe={class:"mb-7 bg-white pt-28 md:mb-16"},ae={class:"container mx-auto py-8"},le={class:"flex flex-wrap items-center justify-center md:justify-between"},ne={class:"text-neutral-1000"},ie={class:"mb-4 text-header-4 font-bold"},re={class:"text-xl font-normal text-neutral-650"},de={key:0,class:"container mx-auto"},ce={class:"grid grid-cols-1 gap-10 pb-16 md:grid-cols-4"},ue={class:"hidden md:block"},pe={class:"mt-2 text-xl font-bold"},me={class:"md:col-span-3"},ge={class:"flex w-full items-center justify-between"},he={class:"relative"},_e={class:"text-xl font-bold"},ve={class:"hidden md:block"},fe={class:"group relative ml-auto flex w-fit cursor-pointer items-center rounded-full border border-neutral-100 bg-white p-2.5"},xe={class:"ps-2 text-sm"},be={class:"invisible absolute -left-10 top-0 z-50 min-w-[160px] translate-y-0 transform opacity-0 transition duration-500 ease-in-out group-hover:visible group-hover:translate-y-5 group-hover:transform group-hover:opacity-100"},we={class:"relative top-6 w-full rounded-xl bg-white p-6 shadow-xl"},ye={class:"relative z-10"},ke={class:"text-[15px]"},$e=["onClick"],Ce={class:"block md:hidden"},Se=["onClick"],je={class:"mx-auto w-full"},Be={class:"grid grid-cols-1 md:grid-cols-4"},He={class:"px-9 pt-5"},Me={class:"text-gray-900 pb-[26px] text-lg font-medium"},ze={class:"select-none space-y-2 text-sm transition delay-150 duration-300 ease-in-out"},Fe=["onClick"],Ne={class:"mb-[18px] flex items-center"},Pe=["id","checked"],De=["for"],Ke={class:"flex w-full flex-col gap-4 px-4"},Le={class:"flex items-center justify-between border-t border-neutral-50 px-10 py-6"},Re=["onClick"],Ve={key:0,class:"col-span-3 ml-auto grid gap-x-4 xs:grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3"},Ae={key:1,class:"flex h-full flex-col items-center justify-start pt-20"},qe={class:"mb-2 text-xl font-medium text-neutral-1000"},Te={class:"text-center text-sm text-neutral-800"},Ee={key:2,class:"grid grid-cols-1 gap-4 py-2 md:grid-cols-2 lg:grid-cols-3"},Ie={key:0,class:"mb-40 ml-auto mt-16 xs:grid-cols-1 sm:grid-cols-2 md:col-span-3 md:grid-cols-2 lg:grid-cols-3"},Oe=P({__name:"index",setup(K){const{t:d}=D(),{$jsonApi:C}=V(),f=A(),u=c([]),x=c({}),p=c("-discount_value"),S=c(d("pages.stores.Discount value")),b=c([]),j=c(!1),_=c({}),{categories:B}=X(q());Q(()=>{_.value.searchKey=f.params.search,v(),L()});const v=async(t=1)=>{j.value=!0;try{const{data:s,meta:H}=await C.get(T.getCouponSearch({sort:p.value,..._.value},t));u.value=s,x.value=H}catch(s){console.log("🚀 ~ file: index.vue:49 ~ error:",s)}finally{j.value=!1}},L=async()=>{const t=await C.get(E.getAllStores());b.value=t},w=(t,s)=>{_.value[s]=t,v()},M=(t,s)=>{S.value=d(`pages.stores.${s}`),p.value=t,t==="-favourites"&&(p.value="-followers"),t==="-approved_at"&&(p.value="-created_at"),v()},R=()=>{_.value={},_.value.searchKey=f.params.search,S.value=d("pages.stores.Discount value"),p.value="discount_value",v()};return(t,s)=>{const H=I;return l(),i("div",se,[e("div",oe,[e("div",ae,[e("div",le,[e("div",ne,[e("h2",ie,o(t.$t("pages.search.resultsFor"))+' "'+o(g(f).params.search)+'" ',1),e("p",re," +"+o(x.value?.page?.total)+" "+o(t.$t("pages.search.resultsFound")),1)])])])]),g(B)&&b.value?(l(),i("div",de,[e("div",ce,[e("div",ue,[e("div",pe,o(t.$t("pages.search.filterBy")),1),r($,{"list-items":g(B),class:"!mt-12 !bg-white",onSelectionPanelChanged:s[0]||(s[0]=a=>w(a,"categories")),"show-all":!0,"default-status":!0},null,8,["list-items"]),r($,{"list-items":b.value.data,title:"Stores",class:"!bg-white",onSelectionPanelChanged:s[1]||(s[1]=a=>w(a,"store")),"show-all":!0,"default-status":!0},null,8,["list-items"])]),e("div",me,[e("div",ge,[e("div",he,[e("div",_e,o(x.value?.page?.total)+" "+o(t.$t("pages.search.couponsFound")),1)]),e("div",ve,[e("div",fe,[s[5]||(s[5]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e("path",{d:"M4 8H12M2 4H14M6 12H10",stroke:"#061322","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),e("h3",xe,o(t.$t("pages.stores.sortBy"))+" "+o(S.value),1),e("div",be,[e("div",we,[s[4]||(s[4]=e("div",{class:"absolute top-0 z-0 h-10 w-10 -translate-x-4 rotate-45 transform rounded-sm bg-white transition-transform duration-500 ease-in-out group-hover:translate-x-3"},null,-1)),e("div",ye,[e("ul",ke,[(l(!0),i(y,null,k(g(N),a=>(l(),i("li",{key:a.name,class:"py-2",onClick:m=>M(a.key,a.name)},o(t.$t(`pages.stores.${a.name}`)),9,$e))),128))])])])])])]),e("div",Ce,[r(ee,null,{activator:h(({open:a,close:m})=>[e("button",{class:"group relative flex cursor-pointer items-center gap-2 rounded-2xl border border-neutral-100 bg-white p-2",onClick:a},[s[6]||(s[6]=e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M4 8H12M2 4H14M6 12H10",stroke:"#061322","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),z(" "+o(t.$t("pages.stores.filter")),1)],8,Se)]),header:h(({open:a,close:m})=>[e("span",null,o(t.$t("pages.stores.filterStores")),1)]),default:h(({open:a,close:m})=>[e("div",je,[e("div",Be,[e("div",He,[e("div",Me,o(t.$t("pages.stores.sortBy")),1),e("ul",ze,[(l(!0),i(y,null,k(g(N),n=>(l(),i("li",{key:n.name,class:"",onClick:Je=>M(n.key,n.name)},[e("div",Ne,[e("input",{id:`${n.name}-${n.key}`,name:"bordered-radio-sorting",type:"radio",checked:p.value===n.key,class:"bg-gray-100 border-gray-300 focus:ring-none h-5 w-5 border border-neutral-100 text-secondary focus:ring-white"},null,8,Pe),e("label",{for:`${n.name}-${n.key}`,class:"text-gray-900 ms-2 text-base font-normal text-neutral-800"},o(t.$t(`pages.stores.${n.name}`)),9,De)]),s[7]||(s[7]=e("hr",{class:"border-neutral-50"},null,-1))],8,Fe))),128))])]),e("div",Ke,[r($,{"list-items":g(B),"default-status":!0,class:"!w-full !border-none 
1!bg-white","show-all":!0,divider:!0,onSelectionPanelChanged:s[2]||(s[2]=n=>w(n,"categories"))},null,8,["list-items"]),r($,{"list-items":b.value.data,title:"Stores",class:"!w-full !border-none !bg-white",onSelectionPanelChanged:s[3]||(s[3]=n=>w(n,"store")),"default-status":!0,"show-all":!0,divider:!0},null,8,["list-items"])])])])]),footer:h(({open:a,close:m})=>[e("div",Le,[e("button",{class:"font-bold text-danger",onClick:()=>{R(),m()}},o(t.$t("pages.stores.clear")),9,Re),r(te,{size:"medium",variant:"secondary",onClick:()=>{m()}},{default:h(()=>[z(o(t.$t("pages.stores.apply")),1)]),_:1},8,["onClick"])])]),_:1})])]),j.value?(l(),i("div",Ve,[(l(),i(y,null,k(12,a=>r(Y,{class:"!w-full"})),64))])):u.value.length==0?(l(),i("div",Ae,[r(H,{loading:"lazy",class:"h-28 w-28",src:"/assets/file-search.svg",densities:"x1 x2",alt:"search results"}),e("div",qe,o(t.$t("pages.index.noResults")),1),e("div",Te,o(t.$t("pages.index.noResultsDes")),1)])):(l(),i("div",Ee,[(l(!0),i(y,null,k(u.value,a=>(l(),U(W,{key:a.id,coupon:a},null,8,["coupon"]))),128))]))]),u.value.length>10?(l(),i("div",Ie,[r(Z,{meta:x.value.page,onPaginationChanged:v},null,8,["meta"])])):F("",!0)])])):F("",!0)])}}}),Ge=Object.assign(Oe,{__name:"LazySearch"}),ut=P({__name:"[search]",setup(K){const{t:d}=D();return O({title:d("pages.index.meta.title"),meta:[{name:"description",content:d("pages.index.meta.description")}]}),G({title:d("pages.index.meta.title"),description:d("pages.index.meta.description")}),(C,f)=>{const u=J;return l(),i("div",null,[r(u,null,{default:h(()=>[r(Ge)]),_:1})])}}});export{ut 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.