1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8868],{78868:function(e,l,t){t.d(l,{default:function(){return I}});var a=t(57437),s=t(2265),n=t(99376),r=t(27648),i=t(14232),o=t(45432),c=t(97539),d=t(32475),x=t(42171),m=e=>{let{classNameLink:l,basketViewClassName:t,basketBtnClassName:s,deleteIcon:m,basketHref:u}=e,h=(0,x.Z)("basket"),g=(0,n.usePathname)(),{totalGoodsPrice:f}=(0,i.C)(e=>{let{basket:l}=e;return null==l?void 0:l.prices})||{},{products_total_count:p,products:v}=(0,i.C)(e=>{let{basket:l}=e;return l})||{};return"/basket/cart"==g?(0,a.jsx)(a.Fragment,{}):(0,a.jsx)(a.Fragment,{children:p?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"px-6 py-3.5",children:(0,a.jsxs)("header",{className:"flex w-full items-center justify-between rounded-md p-3 bg-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h3",{className:"text-sm text-basket-text-6",children:h.your_basket}),(0,a.jsxs)("span",{className:"mr-2 text-xs text-basket-text-6",children:[" ",p," ",h.item_number," "]})]}),(0,a.jsx)(r.default,{href:null!=u?u:"/basket/cart",className:"flex items-center",children:(0,a.jsx)("p",{className:"flex items-center text-xs text-basket-text-4 ".concat(null!=t?t:""),children:h.basket_view})})]})}),(0,a.jsx)("div",{className:"max-h-96 max-w-full flex flex-col overflow-y-auto overflow-x-hidden px-8 dir-ltr mr",children:v&&Array.isArray(v)&&(null==v?void 0:v.map((e,l)=>{var t;return(0,a.jsxs)("div",{className:"w-full pb-6 pt-3 border-b border-b-basket-border-2 last:border-0",children:[(0,a.jsxs)("div",{className:"flex w-full items-stretch flex-row",children:[(0,a.jsx)(r.default,{href:null!==(t=null==e?void 0:e.direct_url)&&void 0!==t?t:"/",className:"w-1/3 pt-3",children:(0,a.jsx)("div",{className:"w-full relative flex justify-center items-center",children:(0,a.jsx)(c.default,{src:null==e?void 0:e.img,alt:null==e?void 0:e.title,height:80,width:80,imgClassName:"object-contain"})})}),(0,a.jsx)("div",{className:"flex w-2/3 flex-col gap-2 items-start",children:(0,a.jsxs)("div",{className:"flex flex-col justify-between pr-4 items-start text-right",children:[(0,a.jsx)("h2",{className:"text-xs text-basket-text-2",children:null==e?void 0:e.title}),(0,a.jsxs)("div",{className:"mt-1 flex w-full flex-col items-start text-right",children:[(null==e?void 0:e.seller_title)&&(0,a.jsx)("div",{className:"mt-3 flex w-full items-center flex-row",children:(0,a.jsx)("p",{className:"text-xs text-basket-text-6",children:null==e?void 0:e.seller_title})}),(null==e?void 0:e.product_unit_lable)&&(0,a.jsx)("div",{className:"mt-2 flex w-full items-center flex-row",children:(0,a.jsx)("p",{className:"text-xs font-medium text-basket-text-6",children:null==e?void 0:e.product_unit_lable})}),(null==e?void 0:e.product_option)&&(0,a.jsx)("div",{className:"mt-3 flex w-full items-center flex-row",children:(0,a.jsx)("p",{className:"text-xs text-basket-text-6",children:null==e?void 0:e.product_option})})]})]})})]}),(0,a.jsx)("div",{className:"mt-3 flex w-full flex-col",children:(0,a.jsxs)("div",{className:"flex w-full flex-row items-center",children:[(0,a.jsx)("div",{className:"relative flex w-1/2 justify-between flex-row pl-2",children:(0,a.jsx)(d.Z,{entity_id:null==e?void 0:e.entity_id,product_id:null==e?void 0:e.product_id,product_option:null==e?void 0:e.product_option,array_key:null==e?void 0:e.array_key,btnClassName:s,deleteIcon:m})}),(0,a.jsx)("div",{className:"flex flex-1 flex-col justify-end",children:(0,a.jsxs)("div",{className:"flex flex-1 flex-col justify-end items-end",children:[(null==e?void 0:e.original_price)!=(null==e?void 0:e.price)&&(0,a.jsxs)("div",{className:"mb-1 mt-2 flex items-center",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-basket-text-6 line-through",children:(0,o.Y)({number:null==e?void 0:e.original_price,isRial:!0})}),(0,a.jsxs)("span",{className:"text-xs font-medium mr-1 text-basket-text-6",children:[" ",h.currency," "]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("p",{className:"text-basket-text-8 text-xl",children:(0,o.Y)({number:null==e?void 0:e.price,isRial:!0})}),(0,a.jsxs)("span",{className:"text-xs font-medium mr-1 text-basket-text-8",children:[" ",h.currency," "]})]})]})})]})})]},l)}))}),(0,a.jsx)("div",{className:"w-full rounded-b-2xl border-t border-t-basket-border-1 px-6 py-4",children:(0,a.jsxs)(r.default,{href:null!=u?u:"/basket/cart",className:"transition-all relative flex items-center justify-center w-full text-basket-text-3 bg-custom-bg-1 p-3 rounded-lg ".concat(null!=l?l:""),children:[(0,a.jsxs)("p",{className:"flex-1 text-center text-md",children:[" ",h.submit_order," "]}),(0,a.jsxs)("span",{className:"flex flex-1 items-center justify-center text-xl",children:[(0,o.Y)({number:f,isRial:!0}),(0,a.jsx)("span",{className:"text-xs mr-1 text-basket-text-3",children:h.currency})]})]})})]}):(0,a.jsxs)("div",{className:"flex justify-center items-center p-6 flex-col gap-5",children:[(0,a.jsx)(c.default,{src:"/assets/images/empty_cart.svg",alt:(null==h?void 0:h.basket_empty)||"",width:80,height:80,imgClassName:"object-contain text-custom-text-1"}),(0,a.jsx)("p",{className:"text-custom-text-1 text-sm",children:null==h?void 0:h.basket_empty})]})})},u=t(24326),h=t(45926),g=t(87798);let f=null;var p=function(e){let{catalog:l,className:t,resultData:r,stickyClass:i,showOption:o=!0,params:d}
1=e,[x,m]=(0,s.useState)(""),[p,v]=(0,s.useState)([]),[j,b]=(0,s.useState)(!0);(0,n.useRouter)();let C=async e=>{var t,a,s,n,i,o,c,m;if((null==e?void 0:e.length)>=2)try{let i=await fetch("".concat("https://www.ketabane.org/callApi","/").concat(l),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({q:e,show_img:1,...d})});i=await i.json(),v(null!==(s=null==i?void 0:null===(t=i.result)||void 0===t?void 0:t.data)&&void 0!==s?s:[]),r&&r(null!==(n=null==i?void 0:null===(a=i.result)||void 0===a?void 0:a.data)&&void 0!==n?n:[])}catch(e){}else if(b(!0),(null==e?void 0:e.length)<=2&&(null==x?void 0:x.length)>=2){let e=await fetch("".concat("https://www.ketabane.org/callApi","/").concat(l),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({show_img:1,...d})});v(null!==(c=null==(e=await e.json())?void 0:null===(i=e.result)||void 0===i?void 0:i.data)&&void 0!==c?c:[]),r&&r(null!==(m=null==e?void 0:null===(o=e.result)||void 0===o?void 0:o.data)&&void 0!==m?m:[])}};return(0,a.jsx)("div",{className:"w-full ".concat(null!=i?i:""),children:(0,a.jsx)("div",{children:(0,a.jsx)(u.hQ,{value:"",onChange:e=>{Number(null==e?void 0:e.is_product)?window.location.href=null==e?void 0:e.direct_url:e&&(window.location.href="/".concat(null!=l?l:"products","?q=").concat(x))},children:(0,a.jsxs)("div",{className:"relative mt-1",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsx)(u.gA,{className:"appearance-none focus:appearance-none ".concat(null!=t?t:"bg-custom-bg-4 w-72 h-10 block px-3 py-2 transition rounded-md focus:border focus:border-custom-border-1 focus:bg-custom-bg-3 mb-1 max-lg:ml-5 max-lg:mb-0"),placeholder:"ÚÙ ÚÛØ²Û Ø§ØØªÛاج Ø¯Ø§Ø±ÛØ",displayValue:e=>e.title,autoComplete:"disabled",onKeyDown:e=>{if("Enter"===e.key){var t;e.preventDefault(),(null==x?void 0:null===(t=x.trim())||void 0===t?void 0:t.length)>0&&(window.location.href="/".concat(null!=l?l:"products","?q=").concat(x))}},onChange:async e=>{try{b(!0),clearTimeout(f),f=setTimeout(async()=>{await C(e.target.value),b(!1)},300)}catch(e){b(!1)}m(e.target.value)}})}),o&&(0,a.jsx)(h.u,{as:s.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>m(""),children:(0,a.jsxs)(u.L5,{className:"absolute mt-0 max-h-60 w-full z-10 overflow-auto rounded-md bg-custom-bg-3 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:[(0,a.jsx)(u.O2,{value:{direct_url:"".concat(l,"/q=").concat(x)}}),j&&(null==x?void 0:x.length)>=2?(0,a.jsx)(g.IconLoading,{size:30}):(0,a.jsx)(a.Fragment,{children:(null==p?void 0:p.length)===0&&""!==x?(0,a.jsx)(a.Fragment,{children:(null==x?void 0:x.length)>=2&&(0,a.jsx)("div",{className:"relative cursor-default select-none py-2 px-4 text-custom-text-2",children:"Ù
ÙØ±Ø¯Û ÛØ§Ùت ÙØ´Ø¯"})}):(0,a.jsx)(a.Fragment,{children:null==p?void 0:p.map(e=>(0,a.jsx)(u.O2,{className:e=>{let{active:l}=e;return"relative select-none py-2 pl-10 pr-4 cursor-pointer ".concat(l?"bg-custom-bg-7 text-custom-text-3":"text-custom-text-1")},value:e,children:l=>{let{selected:t,active:s}=l;return(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.default,{src:(null==e?void 0:e.attach_index_image_md)||"/assets/images/custom/default.png",alt:null==e?void 0:e.title,width:50,height:50,imgClassName:"object-contain"}),(0,a.jsx)("span",{className:"block truncate ".concat(t?"font-medium":"font-normal"),title:null==e?void 0:e.title,children:null==e?void 0:e.title}),t?(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 ".concat(s?"text-custom-text-3":"text-custom-text-4")}):null]})}},null==e?void 0:e.id))})})]})})]})})})})},v=t(80434),j=t(45490);function b(e){let{title:l,icon:t,body:n,btnClassName:r,className:i,panelClassName:o,containerClassName:c}=e;return(0,a.jsx)("div",{className:null!=i?i:"",children:(0,a.jsx)(j.J2,{className:"relative",children:e=>{let{open:i}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(j.J2.Button,{className:"".concat(""," ").concat(null!=r?r:""),children:[l&&(0,a.jsx)("span",{children:"title"}),t&&t]}),(0,a.jsx)(h.u,{as:s.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:(0,a.jsx)(j.J2.Panel,{className:"absolute bg-basket-bg-2 left-0 z-10 mt-3 max-w-sm px-4 sm:px-0 ".concat(null!=o?o:""),children:(0,a.jsx)("div",{className:"overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 w-96 ".concat(null!=c?c:""),children:n&&n})})})]})}})})}var C=t(19636),w=t(96341),N=t(23302),y=t(76417);let k=null;var _=function(e){let{className:l,resultData:t,stickyClass:r,showOption:i=!0}
1=e,[o,d]=(0,s.useState)(""),[x,m]=(0,s.useState)([]),[f,p]=(0,s.useState)(!0),[j,b]=(0,s.useState)({title:"کتاب",catalog:"products"}),C=(0,n.usePathname)(),w=(0,n.useSearchParams)();(0,n.useRouter)(),(0,s.useEffect)(()=>{if(!w.has("q"))return()=>{d(""),b({title:"کتاب",catalog:"products"})}},[C]);let _=async e=>{var l,a;let{title:s,catalog:n}=e;b({title:s,catalog:n});let r=await (0,N.W)({catalogName:null!=n?n:"entity",params:{q:o,show_img:1}});m(null!==(l=null==r?void 0:r.data)&&void 0!==l?l:[]),t&&t(null!==(a=null==r?void 0:r.data)&&void 0!==a?a:[])},L=async e=>{var l,a,s,n,r,i,c,d;if((null==e?void 0:e.length)>=2)try{let r=await fetch("".concat("https://www.ketabane.org/callApi","/").concat(null==j?void 0:j.catalog),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({q:e,show_img:1})});r=await r.json(),m(null!==(s=null==r?void 0:null===(l=r.result)||void 0===l?void 0:l.data)&&void 0!==s?s:[]),t&&t(null!==(n=null==r?void 0:null===(a=r.result)||void 0===a?void 0:a.data)&&void 0!==n?n:[])}catch(e){if("AbortError"===e.name){m([]);return}}else if(p(!0),(null==e?void 0:e.length)<=2&&(null==o?void 0:o.length)>=2){let e=await fetch("".concat("https://www.ketabane.org/callApi","/").concat(null==j?void 0:j.catalog),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({show_img:1})});m(null!==(c=null==(e=await e.json())?void 0:null===(r=e.result)||void 0===r?void 0:r.data)&&void 0!==c?c:[]),t&&t(null!==(d=null==e?void 0:null===(i=e.result)||void 0===i?void 0:i.data)&&void 0!==d?d:[])}};return(0,a.jsx)("div",{className:"w-full ".concat(null!=r?r:""),children:(0,a.jsxs)("form",{className:"flex items-center",onSubmit:e=>{var l,t;e.preventDefault(),(null==o?void 0:null===(l=o.trim())||void 0===l?void 0:l.length)>0&&(window.location.href="/".concat(null!==(t=null==j?void 0:j.catalog)&&void 0!==t?t:"products","?q=").concat(o))},children:[(0,a.jsx)(v.Z,{icon:(0,a.jsxs)("div",{className:"flex items-center justify-center text-custom-text-3 gap-2 p-3 rounded-full bg-custom-bg-1 h-12 -ml-4 relative z-10 max-lg:rounded-lg max-lg:h-[45px]",children:[(0,a.jsx)("span",{className:"text-base",children:null==j?void 0:j.title}),(0,a.jsx)("span",{children:(0,a.jsx)(y.khD,{size:16})})]}),buttonClassName:"!p-0",items:[{title:"کتاب",eventTarget:()=>_({title:"کتاب",catalog:"products"})},{title:"Ø§ÙØªØ´Ø§Ø±Ø§Øª",eventTarget:()=>_({title:"Ø§ÙØªØ´Ø§Ø±Ø§Øª",catalog:"brand"})},{title:"Ø´Ø®ØµÛØª ÙØ§",eventTarget:()=>_({title:"Ø´Ø®ØµÛØª ÙØ§",catalog:"author"})},{title:"Ú©Ù Ø³Ø§ÛØª",eventTarget:()=>_({title:"Ú©Ù Ø³Ø§ÛØª",catalog:"entity"})}]}),(0,a.jsx)(u.hQ,{value:"",onChange:e=>{if(Number(null==e?void 0:e.is_product))window.location.href=null==e?void 0:e.direct_url;else if(e){var l;window.location.href="/".concat(null!==(l=null==j?void 0:j.catalog)&&void 0!==l?l:"products","?q=").concat(o)}},children:(0,a.jsxs)("div",{className:"relative h-12 max-lg:h-[45px] max-lg:w-full",children:[(0,a.jsx)(u.hQ.Input,{className:"appearance-none focus:appearance-none ".concat(null!=l?l:"bg-custom-bg-4 w-[500px] h-12 block pl-3 pr-6 py-2 transition max-lg:mb-0 max-lg:h-[45px] max-lg:w-full"),placeholder:"جستج٠در ".concat(null==j?void 0:j.title),displayValue:e=>e.title,value:o,autoComplete:"disabled",onChange:e=>{let l=e.target.value;if((null==l?void 0:l.length)>=2)try{p(!0),clearTimeout(k),k=setTimeout(async()=>{await L(l),p(!1)},300)}catch(e){p(!1)}else m([]);d(l)}}),i&&(0,a.jsx)(h.u,{as:s.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>d(o),children:(0,a.jsxs)(u.hQ.Options,{className:"absolute mt-0 max-h-60 w-full z-10 overflow-auto rounded-md bg-custom-bg-3 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:[(0,a.jsx)(u.hQ.Option,{value:{direct_url:"".concat(null==j?void 0:j.catalog,"/q=").concat(o)}}),f&&(null==o?void 0:o.length)>=2?(0,a.jsx)(g.IconLoading,{size:30}):(0,a.jsx)(a.Fragment,{children:(null==x?void 0:x.length)===0&&""!==o?(0,a.jsx)(a.Fragment,{children:(null==o?void 0:o.length)>=2&&(0,a.jsx)("div",{className:"relative cursor-default select-none py-2 px-4 text-custom-text-2",children:"Ù
ÙØ±Ø¯Û ÛØ§Ùت ÙØ´Ø¯"})}):(0,a.jsx)(a.Fragment,{children:x&&Array.isArray(x)&&(null==x?void 0:x.map(e=>(0,a.jsx)(u.hQ.Option,{className:e=>{let{active:l}=e;return"relative select-none py-2 pl-10 pr-4 cursor-pointer ".concat(l?"bg-custom-bg-7 text-custom-text-3":"text-custom-text-1")},value:e,children:l=>{let{selected:t,active:s}=l;return(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.default,{src:(null==e?void 0:e.attach_index_image_md)||"/assets/images/custom/default.png",alt:null==e?void 0:e.title,width:50,height:50,imgClassName:"object-contain"}),(0,a.jsx)("span",{className:"block truncate ".concat(t?"font-medium":"font-normal"),children:null==e?void 0:e.title}),t?(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 ".concat(s?"text-custom-text-3":"text-custom-text-4")}):null]})}},null==e?void 0:e.id)))})})]})})]})}),(0,a.jsx)("button",{className:"flex items-center justify-center text-custom-text-1 gap-2 py-3 pr-6 pl-3 rounded-e-full bg-custom-bg-4 h-12 font-light max-lg:h-[45px] max-lg:rounded-e-lg",onClick:()=>{var e,l;(null==o?void 0:null===(e=o.trim())||void 0===e?void 0:e.length)>0&&(window.location.href="/".concat(null!==(l=null==j?void 0:j.catalog)&&void 0!==l?l:"products","?q=").concat(o))},children:(0,a.jsx)(g.IconSearch,{size:28})})]})})};let L=e=>{let{data:l}=e;return l&&Array.isArray(l)&&l.map((e,l)=>(0,a.jsxs)("li",{children:[(0,a.jsx)("a",{href:null==e?void 0:e.link,className:"text-md pl-1.5 my-1 font-light flex text-[#81858b]",children:null==e?void 0:e.title}),(null==e?void 0:e.children)&&(0,a.jsx)("ul",{className:"mr-3",children:(0,a.jsx)(L,{data:null==e?void 0:e.children})})]},l))};var z=e=>{let{data:l}
1=e,[t,n]=(0,s.useState)(0);return(0,a.jsx)("div",{className:"hidden absolute rounded-sm w-full z-[3] min-h-[460px] right-0 left-0 m-0 max-h-[360px] top-[100%] group-hover:flex",children:(0,a.jsx)("div",{className:"container relative px-0 mx-auto border-t border-t-custom-border-1 bg-custom-bg-3 shadow-shadow-1 overflow-hidden group-hover:flex items-start",children:(0,a.jsx)("ul",{className:"flex flex-col list-none py-5 flex-nowrap w-[250px] h-full bg-[#f5f5f5] min-h-[460px] before:absolute before:w-full before:h-[400px] before:-top-[58px] before:z-[1] before:right-0",children:l&&Array.isArray(l)&&l.map((e,l)=>(0,a.jsxs)("li",{className:"p-0 flex w-full m-0 text-custom-text-2 group/sidebar ".concat(t===l?"text-custom-text-1 bg-custom-bg-3":""),onMouseEnter:()=>n(l),children:[(0,a.jsx)("a",{href:e.link,className:"relative z-[3] text-[#424750] font-semiBold border-0 items-center w-full text-right px-5 py-3 transition-all hover:text-custom-text-1 hover:bg-custom-bg-3 lg:group-hover/sidebar:bg-custom-bg-3",children:e.title}),e.children&&(0,a.jsx)("ul",{className:"absolute right-[250px] z-[4] w-[calc(100%-250px)] ".concat(t===l?"flex":"hidden"," px-5 lg:group-hover/sidebar:flex flex-col flex-wrap h-full top-0"),children:e.children.map((e,l)=>(0,a.jsxs)("li",{className:"p-0 flex m-0 text-custom-text-2 items-start flex-col w-[210px] mt-2.5 pr-1",children:[(0,a.jsxs)("a",{href:e.link,className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block font-semiBold border-r-[3px] border-r-[#fc971d] pr-2 text-md text-custom-text-1",children:e.title}),(0,a.jsx)(g.IconChevronLeft,{size:15})]}),e.children&&(0,a.jsx)("ul",{className:"mt-2",children:(0,a.jsx)(L,{data:e.children})})]},l))})]},l))})})})};let S=e=>{let{data:l,onClose:t,classNameListSubmenu:n,icon:i,mainSubsetClassName:o,rotate:c}=e,[d,x]=(0,s.useState)(new Set),m=(0,s.useCallback)(e=>{x(l=>{let t=new Set(l);return t.has(e)?t.delete(e):t.add(e),t})},[]);return(0,a.jsx)(a.Fragment,{children:l.map((e,l)=>(0,a.jsxs)("li",{className:"w-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center py-3",children:[(0,a.jsx)(r.default,{href:e.link||"#",className:"flex items-center hover:text-custom-text-7 gap-1 text-custom-text-2 font-light ".concat(null!=n?n:""),onClick:t,children:(0,a.jsx)("span",{children:e.title})}),e.children&&(0,a.jsx)("span",{className:"mr-auto cursor-pointer w-10 h-5 flex justify-center items-center transition-transform ".concat(d.has(l)?null!=c?c:"-rotate-90":"rotate-0"),onClick:()=>m(l),children:null!=i?i:(0,a.jsx)(g.IconArrowBack,{size:15})})]}),e.children&&d.has(l)&&(0,a.jsx)("ul",{className:"bg-gray-200 pr-3 rounded-sm overflow-hidden ".concat(null!=o?o:""),children:(0,a.jsx)(S,{data:e.children,onClose:t,classNameListSubmenu:n})})]},l))})};var T=e=>{let{data:l,onClose:t,classNameListSubmenu:n,mainListClassName:i,mainSubsetClassName:o,icon:c,rotate:d}=e,[x,m]=(0,s.useState)(()=>new Set((null!=l?l:[]).flatMap((e,l)=>e.children?[l]:[]))),u=(0,s.useCallback)(e=>{m(l=>{let t=new Set(l);return t.has(e)?t.delete(e):t.add(e),t})},[]);return l?(0,a.jsx)("ul",{className:"w-full overflow-y-auto lg:hidden",children:l.map((e,l)=>(0,a.jsxs)("li",{className:"transition-all group w-full ".concat(null!=i?i:""),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center py-3",children:[(0,a.jsx)(r.default,{href:e.link||"#",className:"flex items-center gap-2 hover:text-custom-text-7 text-custom-text-2 font-light ".concat(null!=n?n:""),onClick:()=>{!e.children&&t&&t()},children:(0,a.jsx)("span",{children:e.title})}),e.children&&(0,a.jsx)("span",{className:"mr-auto cursor-pointer w-10 h-5 flex justify-center items-center transition-transform ".concat(x.has(l)?null!=d?d:"-rotate-90":"rotate-0"),onClick:()=>u(l),children:null!=c?c:(0,a.jsx)(g.IconArrowBack,{size:15})})]}),e.children&&x.has(l)&&(0,a.jsx)("ul",{className:"flex items-start flex-col pr-4 w-full bg-gray-100 ".concat(null!=o?o:""),children:(0,a.jsx)(S,{data:e.children,onClose:t,classNameListSubmenu:n,icon:c,mainSubsetClassName:o,rotate:d})})]},l))}):null},I=e=>{var l;let{menu:t,setting:o}=e,{products_total_count:d}=(0,i.C)(e=>{let{basket:l}=e;return l})||{},{settings:x,user:u}
1=(0,s.useContext)(w.H),[h,f]=(0,s.useState)(!1),[j,N]=(0,s.useState)(!1),[y,k]=(0,s.useState)(!1),[L,S]=(0,s.useState)([]),I=(0,n.usePathname)(),F=(0,n.useSelectedLayoutSegments)(),Z=(0,n.useRouter)();(0,s.useEffect)(()=>{j&&N(!1)},[I]);let A="products"===F[0]&&"id"===F[1]||"catalog-id"===F[0]||["/basket/cart","/basket/cart","/basket/cart"].includes(I);return(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"max-lg:mb-6",children:[(0,a.jsxs)("div",{className:"w-full max-lg:flex max-lg:gap-4",children:[(0,a.jsx)("div",{className:"w-full shadow-shadow-4 mb-12 pt-4 max-lg:pt-2 relative bg-custom-bg-3 max-lg:mb-0",children:(0,a.jsxs)("div",{className:"flex container justify-between flex-wrap h-full lg:h-auto lg:flex-nowrap max-lg:items-center lg:flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-8 max-lg:flex-row max-lg:grid max-lg:grid-cols-12 max-lg:w-full max-lg:mb-2",children:[(0,a.jsx)("div",{className:"lg:hidden max-lg:col-span-1 max-lg:order-1 max-lg:flex items-center justify-center bg-custom-bg-4 transition-all text-custom-text-1 hover:bg-custom-bg-9 hover:text-custom-text-3 rounded-2xl h-12 w-14 max-lg:h-[37px] max-lg:w-[39px] max-lg:rounded-lg",onClick:()=>f(e=>!e),children:(0,a.jsx)(c.default,{src:"/assets/images/custom/bar.svg",alt:"mneu bar",width:20,height:20,loading:"eager"})}),(0,a.jsx)(r.default,{href:"/",className:"max-lg:col-span-7 max-lg:order-2 max-lg:mr-3",children:(0,a.jsx)("img",{src:(null==o?void 0:o.logo)?"https://api.ketabane.org/"+(null==o?void 0:o.logo):"/assets/images/custom/logo.png",alt:"",className:"h-9 w-auto object-contain max-lg:h-7 max-lg:mr-3"})}),(0,a.jsx)("div",{className:"max-lg:col-span-12 max-lg:order-4 max-lg:mt-4 max-lg:hidden",children:(0,a.jsx)(_,{settings:x})}),(0,a.jsxs)("div",{className:"flex gap-4 max-lg:col-span-4 max-lg:order-3 max-lg:flex max-lg:justify-end max-lg:gap-1",children:[(null==u?void 0:u.mobile)?(0,a.jsx)(v.Z,{icon:(0,a.jsxs)("div",{className:"flex items-center justify-center transition-all bg-custom-bg-4 hover:bg-custom-bg-9 hover:text-custom-text-3 text-custom-text-7 gap-2 py-3 px-7 rounded-2xl h-12 max-lg:rounded-lg max-lg:py-1 max-lg:px-3 max-lg:h-9",children:[(0,a.jsxs)("svg",{width:"20",height:"19",viewBox:"0 0 20 19",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.2208 12.6643C15.8542 12.7862 15.4581 12.588 15.3359 12.2214C15.2137 11.8546 15.4119 11.4582 15.7786 11.3359L16 12C15.7786 11.3359 15.7789 11.3358 15.7792 11.3357L15.7799 11.3355L15.7814 11.335L15.7853 11.3337L15.7963 11.3302C15.8052 11.3274 15.8169 11.3237 15.8313 11.3194C15.86 11.3107 15.8997 11.2992 15.9488 11.2861C16.0465 11.2601 16.1834 11.2274 16.3468 11.1984C16.6669 11.1418 17.1207 11.0939 17.5942 11.1583C18.0697 11.2228 18.6171 11.4088 19.0436 11.8669C19.4689 12.3237 19.6923 12.9631 19.6998 13.7725C19.8278 14.8901 19.7004 15.772 19.3742 16.4572C19.0397 17.1601 18.524 17.5965 17.9955 17.8555C17.4784 18.1089 16.9568 18.1898 16.5795 18.2116C16.388 18.2226 16.2258 18.2189 16.1088 18.2121C16.0502 18.2087 16.0023 18.2045 15.9671 18.2009C15.9495 18.1991 15.9351 18.1974 15.924 18.196L15.9099 18.1942L15.9048 18.1935L15.9027 18.1932L15.9018 18.1931C15.9014 18.193 15.901 18.193 16 17.5L15.901 18.193C15.5183 18.1383 15.2524 17.7837 15.307 17.401C15.3615 17.0195 15.7141 16.754 16.0954 16.8065C16.0949 16.8065 16.0948 16.8065 16.0952 16.8065M16.0954 16.8065C16.0956 16.8066 16.0958 16.8066 16.0961 16.8066L16.1112 16.8083C16.1271 16.81 16.1539 16.8124 16.19 16.8145C16.2625 16.8187 16.3698 16.8214 16.4987 16.8139C16.762 16.7987 17.0841 16.743 17.3795 16.5983C17.6635 16.4591 17.9291 16.2359 18.1101 15.8555C18.2957 15.4656 18.4191 14.8538 18.3049 13.8981C18.3016 13.8705 18.3 13.8428 18.3 13.815C18.3 13.2371 18.1487 12.9602 18.0189 12.8208C17.8829 12.6747 17.6803 12.5828 17.4058 12.5455C17.1293 12.508 16.8331 12.5342 16.5907 12.577C16.4729 12.5979 16.3753 12.6213 16.309 12.639C16.2761 12.6477 16.2513 12.655 16.2361 12.6596L16.2209 12.6643C16.2207 12.6643 16.2205 12.6644 16.2204 12.6644L16.2204 12.6644L16.2208 12.6643M16.2204 12.6644L16.2197 12.6646L16.2191 12.6648C16.219 12.6649 16.2192 12.6648 16.2197 12.6646C16.2199 12.6646 16.2201 12.6645 16.2204 12.6644Z",fill:"var(--primary)"}),(0,a.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1303 1.09449C13.1223 0.70797 13.4292 0.388162 13.8157 0.380175L13.8302 1.08003C13.8157 0.380175 13.8161 0.380167 13.8165 0.380159L13.8174 0.380143L13.8192 0.38011L13.8236 0.38005L13.8347 0.379975C13.8432
10.379955 13.8538 0.38001 13.8664 0.380226C13.8915 0.380657 13.9247 0.381732 13.9649 0.384148C14.045 0.388967 14.1543 0.399201 14.2837 0.420739C14.54 0.463403 14.8901 0.552841 15.2525 0.743658C16.0175 1.14642 16.7459 1.95701 16.8479 3.42919C16.9501 4.90418 16.3353 5.79138 15.6139 6.27135C15.2752 6.49671 14.9359 6.61805 14.6859 6.68373C14.5595 6.71693 14.4518 6.73699 14.3725 6.749C14.3327 6.75503 14.2998 6.75909 14.2747 6.76178C14.2622 6.76313 14.2517 6.76413 14.2432 6.76488L14.2321 6.7658L14.2278 6.76613L14.2259 6.76627L14.2251 6.76633C14.2246 6.76636 14.2242 6.76638 14.1759 6.06806L14.2242 6.76638C13.8386 6.79311 13.5043 6.50213 13.4775 6.11645C13.4509 5.73277 13.7388 5.39992 14.1215 5.37017C14.123 5.37006 14.1245 5.36994 14.126 5.36984L14.1247 5.36993L14.1227 5.37008L14.1208 5.37024C14.1206 5.37025 14.1208 5.37023 14.1215 5.37017C14.1222 5.3701 14.1234 5.36999 14.125 5.36981C14.1313 5.36913 14.1442 5.36761 14.1627 5.36481C14.2 5.35917 14.2583 5.34854 14.3302 5.32967C14.4767 5.29119 14.6625 5.22278 14.8384 5.10577C15.1462 4.90099 15.5182 4.49295 15.4512 3.52596C15.384 2.55616 14.9527 2.16798 14.6003 1.98246C14.404 1.87914 14.206 1.82706 14.0538 1.80174C13.979 1.78929 13.919 1.78392 13.8809 1.78162C13.8619 1.78049 13.8488 1.78013 13.8423 1.78002C13.8406 1.77999 13.8394 1.77998 13.8387 1.77997C13.8407 1.77995 13.8426 1.77992 13.8446 1.77988M13.1303 1.09449C13.1383 1.47903 13.4548 1.78472 13.8387 1.77997L13.1303 1.09449ZM14.1261 5.36983L14.1267 5.36979C14.1267 5.36979 14.1267 5.36979 14.1267 5.36979C14.1265 5.3698 14.1263 5.36981 14.1261 5.36983Z",fill:"var(--primary)"}),(0,a.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.7304 12.0075C10.652 12.0074 10.4924 12.0187 10.0805 12.0492C9.17544 12.1163 8.20124 12.1667 7.31228 12.1667C6.52952 12.1667 5.71173 12.1276 4.94598 12.0725C4.51905 12.0418 4.3498 12.0301 4.27873 12.0298C3.04946 12.025 2.16283 12.793 1.99213 14.0104C1.98221 14.0811 1.97234 14.2129 1.94769 14.558C1.9285 14.8266 1.92199 14.924 1.92197 14.9994C1.92168 16.2065 2.85461 17.2085 4.05866 17.2942C4.13389 17.2996 4.23149 17.3 4.50084 17.3H10.472C10.7677 17.3 10.8748 17.2995 10.9574 17.293C12.1485 17.1999 13.0701 16.2102 13.0781 15.0154C13.0786 14.9326 13.0715 14.8257 13.0505 14.5308C13.0255 14.1818 13.0156 14.0506 13.0042 13.9727C12.8295 12.7854 11.9305 12.0084 10.7304 12.0075ZM10.0303 10.6491C10.3741 10.6236 10.5925 10.6073 10.7315 10.6075C12.6256 10.6089 14.1136 11.895 14.3892 13.7689C14.4095 13.9064 14.423 14.096 14.4438 14.3879L14.4493 14.4648C14.4671 14.7138 14.479 14.8799 14.478 15.0248C14.4651 16.9469 12.9827 18.539 11.0665 18.6888C10.922 18.7 10.7555 18.7 10.5059 18.7H4.46994C4.2426 18.7 4.09089 18.7 3.95925 18.6907C2.0223 18.5528 0.521502 16.941 0.521973 14.9991C0.522005 14.8671 0.532826 14.7158 0.549042 14.489C0.549766 14.4789 0.5505 14.4687 0.551244 14.4582C0.552303 14.4434 0.553342 14.4288 0.554363 14.4145C0.57493 14.1263 0.588144 13.9411 0.605693 13.816C0.873612 11.9053 2.35473 10.6223 4.28413 10.6298C4.41056 10.6303 4.63298 10.6463 4.98966 10.672C5.00824 10.6733 5.02719 10.6747 5.04651 10.6761C5.79068 10.7297 6.57317 10.7667 7.31228 10.7667C8.15362 10.7667 9.09023 10.7187 9.97702 10.653L10.0303 10.6491Z",fill:"var(--primary)"}),(0,a.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.2998 4.5C3.2998 2.18041 5.18021 0.300003 7.4998 0.300003C9.8194 0.300003 11.6998 2.18041 11.6998 4.5V5C11.6998 7.04346 10.0433 8.7 7.9998 8.7H6.9998C4.95635 8.7 3.2998 7.04346 3.2998 5V4.5ZM7.4998 1.7C5.95341 1.7 4.6998 2.95361 4.6998 4.5V5C4.6998 6.27026 5.72955 7.3 6.9998 7.3H7.9998C9.27006 7.3 10.2998 6.27026 10.2998 5V4.5C10.2998 2.95361 9.0462 1.7 7.4998 1.7Z",fill:"var(--primary)"})]}),(0,a.jsx)("span",{className:"max-lg:hidden",children:(null==u?void 0:null===(l=u.member_label)||void 0===l?void 0:l.trim())?null==u?void 0:u.member_label:"پرÙÙØ§ÛÙ"})]}),buttonClassName:"!p-0",items:[{title:"پرÙÙØ§ÛÙ",eventTarget:()=>Z.push("/profile")},{title:"Ø³ÙØ§Ø±Ø´ ÙØ§Û Ù
Ù",eventTarget:()=>Z.push("/profile/orders")},{title:"Ø®Ø±ÙØ¬",eventTarget:()=>(0,C.lv)()}]}):(0,a.jsxs)(r.default,{href:"/profile",className:"flex items-center justify-center text-custom-text-7 gap-2 py-3 px-7 rounded-2xl transition-all bg-custom-bg-4 hover:bg-custom-bg-9 hover:text-custom-text-3 group h-12 max-lg:h-[37px] max-lg:rounded-lg max-lg:px-3",children:[(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"
1currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M6.5 2.12501C5.70195 2.12501 5.37568 2.12695 5.11263 2.16861C3.59718 2.40863 2.40863 3.59718 2.1686 5.11263C2.12694 5.37569 2.125 5.70195 2.125 6.50001V11.5C2.125 12.2981 2.12694 12.6243 2.1686 12.8874C2.40863 14.4028 3.59718 15.5914 5.11263 15.8314C5.37568 15.8731 5.70195 15.875 6.5 15.875H7.33333C8.13136 15.875 8.86611 15.6118 9.45797 15.1673C9.73397 14.9599 10.1258 15.0156 10.3331 15.2916C10.5404 15.5676 10.4847 15.9594 10.2087 16.1667C9.40779 16.7683 8.41132 17.125 7.33333 17.125L6.43262 17.125C5.72262 17.1251 5.29014 17.1251 4.91708 17.066C2.86677 16.7413 1.25873 15.1332 0.933992 13.0829C0.874907 12.7099 0.874941 12.2774 0.874998 11.5673V6.43267C0.874941 5.72265 0.874907 5.29016 0.933992 4.91709C1.25873 2.86677 2.86677 1.25874 4.91709 0.933999C5.29014 0.874914 5.72262 0.874948 6.43262 0.875003L7.33333 0.875007C8.41132 0.875007 9.4078 1.23173 10.2087 1.83331C10.4847 2.04061 10.5404 2.4324 10.3331 2.7084C10.1258 2.98439 9.73397 3.04007 9.45797 2.83277C8.86611 2.3882 8.13136 2.12501 7.33333 2.12501H6.5Z",fill:"var(--primary)"}),(0,a.jsx)("path",{d:"M7.77836 5.17694C8.04883 4.96248 8.44195 5.00789 8.6564 5.27837C8.87086 5.54884 8.82545 5.94195 8.55498 6.15641L7.08583 7.32128C6.49915 7.78646 6.09748 8.10613 5.8246 8.37501L16.5 8.37501C16.8452 8.37501 17.125 8.65483 17.125 9.00001C17.125 9.34519 16.8452 9.62501 16.5 9.62501L5.8246 9.62501C6.09748 9.89389 6.49915 10.2136 7.08583 10.6787L8.55498 11.8436C8.82545 12.0581 8.87086 12.4512 8.6564 12.7217C8.44195 12.9921 8.04883 13.0375 7.77836 12.8231L6.27934 11.6345C5.71896 11.1902 5.25653 10.8236 4.9271 10.4954C4.58904 10.1587 4.30879 9.78488 4.23269 9.30724C4.21648 9.20548 4.20833 9.10283 4.20833 9.00001C4.20833 8.89719 4.21648 8.79454 4.23269 8.69278C4.30879 8.21514 4.58904 7.84136 4.9271 7.5046C5.25653 7.17644 5.71896 6.8098 6.27936 6.36548L7.77836 5.17694Z",fill:"var(--primary)"})]}),(0,a.jsx)("span",{className:"text-md text-custom-text-7 group-hover:text-custom-text-3 max-lg:hidden",children:"ÙØ±Ùد | ثبت ÙØ§Ù
"}),(0,a.jsx)("span",{className:"text-md text-custom-text-7 group-hover:text-custom-text-3 lg:hidden",children:"ÙØ±Ùد"})]}),(0,a.jsx)(b,{className:"max-lg:hidden",icon:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"flex items-center justify-center bg-custom-bg-4 transition-all text-custom-text-1 hover:bg-custom-bg-9 hover:text-custom-text-3 rounded-2xl h-12 w-14 max-lg:h-[37px] max-lg:w-[39px] max-lg:rounded-lg",children:(0,a.jsxs)("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M11.6666 10.0417C12.0118 10.0417 12.2916 10.3215 12.2916 10.6667C12.2916 11.0118 12.0118 11.2917 11.6666 11.2917H6.6666C6.32142 11.2917 6.0416 11.0118 6.0416 10.6667C6.0416 10.3215 6.32142 10.0417 6.6666 10.0417H11.6666Z",fill:"var(--primary)"}),(0,a.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.5603 0.515067C18.644 0.180195 18.9833 -0.0234053 19.3182 0.0603127C19.6531 0.144031 19.8567 0.483365 19.7729 0.818237L18.8965 4.32405L18.0808 7.72738C17.734 9.17453 17.461 10.3136 17.137 11.1985C16.8047 12.1062 16.3972 12.8109 15.7434 13.3513C15.687 13.3979 15.6295 13.4433 15.571 13.4873C14.8931 13.9971 14.1129 14.2292 13.1527 14.3408C12.2167 14.4496 11.0453 14.4496 9.55723 14.4495H9.06272C7.77518 14.4496 6.76162 14.4496 5.9451 14.367C5.10877 14.2824 4.42063 14.1069 3.80136 13.7192C3.50763 13.5353 3.2347 13.32 2.9874 13.0772C2.46601 12.5654 2.13495 11.9371 1.85779 11.1435C1.58718 10.3687 1.35096 9.38311 1.05089 8.13105L1.03346 8.05833C0.852509 7.30339 0.703365 6.68117 0.645744 6.1771C0.585945 5.65394 0.610348 5.1558 0.871498 4.70098C0.983194 4.50645 1.12285 4.32938 1.28599 4.17542C1.66742 3.81545 2.14615 3.67562 2.66884 3.61184C3.17247 3.55039 3.81229 3.5504 4.58863 3.55042L17.8014 3.55042L18.5603 0.515067ZM16.8745 7.39744L17.4969 4.80042H4.62918C3.8021 4.80042 3.23914 4.80153 2.82024 4.85264C2.41166 4.9025 2.24413 4.98994 2.14392 5.08451C2.06976 5.15449 2.00628 5.23498 1.95551 5.32341C1.8869 5.4429 1.84091 5.62619 1.88766 6.03514C1.93558 6.45442 2.06572 7.00213 2.25849 7.80643
1C2.56828 9.09903 2.79053 10.0232 3.03788 10.7314C3.28106 11.4276 3.53043 11.8587 3.86308 12.1852C4.04588 12.3647 4.2476 12.5238 4.46471 12.6597C4.85981 12.9071 5.3371 13.0491 6.07086 13.1233C6.81722 13.1988 7.7677 13.1995 9.0969 13.1995H9.51748C11.054 13.1995 12.1528 13.1986 13.0084 13.0991C13.8481 13.0015 14.385 12.8152 14.8196 12.4883C14.8629 12.4558 14.9054 12.4223 14.9471 12.3878C15.3663 12.0413 15.6726 11.5627 15.9632 10.7688C16.2593 9.95999 16.5164 8.89166 16.8745 7.39744Z",fill:"var(--primary)"}),(0,a.jsx)("path",{d:"M11.2719 16.4561C11.2719 16.9406 11.6646 17.3333 12.1491 17.3333C12.6335 17.3333 13.0263 16.9406 13.0263 16.4561C13.0263 15.9717 12.6335 15.5789 12.1491 15.5789C11.6646 15.5789 11.2719 15.9717 11.2719 16.4561Z",fill:"var(--primary)"}),(0,a.jsx)("path",{d:"M6.00871 16.4561C6.00871 16.9406 6.40144 17.3333 6.8859 17.3333C7.37036 17.3333 7.76309 16.9406 7.76309 16.4561C7.76309 15.9717 7.37036 15.5789 6.8859 15.5789C6.40144 15.5789 6.00871 15.9717 6.00871 16.4561Z",fill:"var(--primary)"})]})}),!!Number(d)&&(0,a.jsx)("div",{className:"absolute -top-1 -right-2 bg-custom-bg-9 w-4 h-4 rounded-sm flex items-center justify-center text-center",children:(0,a.jsx)("div",{className:"relative w-full",children:(0,a.jsx)("span",{className:"text-custom-text-3 text-sm",children:d})})})]}),body:(0,a.jsx)(m,{})})]})]}),(0,a.jsx)("nav",{className:"w-full flex justify-start",children:(0,a.jsxs)("div",{className:"flex items-center w-max max-lg:transition-all max-lg:duration-500 max-lg:fixed max-lg:max-lg:left-auto\n max-lg:top-[10px] max-lg:bottom-auto max-lg:flex-col max-lg:bg-custom-bg-3 max-lg:z-40 max-lg:h-[calc(100vh-80px)] max-lg:w-[calc(100vw-76px)] max-lg:shadow-shadow-3 max-lg:rounded-lg\n max-lg:items-start max-lg:p-4\n ".concat(h?"max-lg:right-2 max-lg:fixed max-lg:visible":"max-lg:invisible max-lg:-right-full","\n "),children:[(0,a.jsx)(T,{data:t,onClose:()=>f(!1)}),(0,a.jsx)("ul",{className:"flex items-center w-max h-full gap-7 max-xl:gap-6 max-lg:hidden ",children:null==t?void 0:t.map((e,l)=>(0,a.jsx)("li",{className:"h-full max-lg:w-full max-lg:border-b max-lg:border-b-custom-border-3/30 max-lg:flex max-lg:items-center",children:(null==e?void 0:e.children)&&(null==e?void 0:e.type)=="hmenu-mega"?(0,a.jsxs)("div",{onClick:()=>f(!1),className:"flex flex-col items-center justify-center gap-2 h-full max-lg:px-0 max-lg:gap-1 max-lg:flex-row group max-lg:text-black max-lg:w-full ".concat((null==e?void 0:e.children)&&(null==e?void 0:e.type)=="hmenu-mega"?"max-lg:justify-between":"max-lg:justify-start"),children:[(0,a.jsxs)("div",{className:"flex justify-center items-center gap-1",children:[!!(null==e?void 0:e.image1)&&(0,a.jsx)(c.default,{src:null==e?void 0:e.image1,alt:(null==e?void 0:e.title)||"",width:20,height:20}),(0,a.jsx)("span",{className:"after:-left-[12px] after:top-0 after:bottom-0 text-lg text-custom-text-11 font-medium max-lg:text-sm relative after:content-[''] after:h-[15px] after:w-[1px] after:bg-[#e0e0e2] after:absolute after:my-auto",children:null==e?void 0:e.title})]}),(null==e?void 0:e.children)&&(null==e?void 0:e.type)=="hmenu-mega"&&(0,a.jsx)("div",{className:"container",children:(0,a.jsx)(z,{data:null==e?void 0:e.children})})]}):(0,a.jsx)(r.default,{href:e.link,onClick:()=>f(!1),className:"flex flex-col items-center justify-center gap-2 hover:text-custom-text-7 max-lg:gap-1 max-lg:flex-row group\n relative",children:(0,a.jsx)("span",{className:"text-lg text-custom-text-11 font-medium max-lg:text-sm",children:null==e?void 0:e.title})})},l))})]})})]})}),"/"!==I&&(0,a.jsx)("div",{onClick:()=>{f(!1),Z.back()},className:"hidden bg-custom-bg-3 w-14 max-lg:flex max-lg:items-center max-lg:justify-center max-lg:shadow-shadow-1 cursor-pointer mr-auto",children:(0,a.jsx)(g.IconArrowBack,{size:25})})]}),!h&&(0,a.jsxs)("div",{className:"hidden justify-around items-center w-[calc(100%-20px)] mx-auto h-14 fixed right-0 left-0 z-40 bg-custom-bg-3 shadow-shadow-3 rounded-md p-1 max-lg:flex ".concat(A?y?"bottom-2":"-bottom-full":"bottom-2"),children:[(0,a.jsx)(r.default,{href:"/",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:(0,a.jsx)(g.IconHome,{size:25})})}),(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",onClick:()=>{N(!0)},children:(0,a.jsx)(g.IconSearch,{size:25})}),(0,a.jsx)(r.default,{href:"/product",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:(0,a.jsx)(g.IconSquaresFour,{size:25})})}),(0,a.jsx)(r.default,{href:"/basket/cart",className:"relative",children:(0,a.jsxs)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:[(0,a.jsx)(g.IconS
1hop,{size:25}),!!Number(d)&&(0,a.jsx)("div",{className:"absolute -top-1 -right-2 bg-custom-bg-9 w-4 h-4 rounded-sm flex items-center justify-center text-center",children:(0,a.jsx)("div",{className:"relative w-full",children:(0,a.jsx)("span",{className:"text-custom-text-3 text-sm",children:d})})})]})}),(0,a.jsx)(r.default,{href:"/profile",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:(0,a.jsx)(g.IconUser,{size:25})})})]}),h&&(0,a.jsxs)("div",{className:"hidden justify-around items-center w-[calc(100%-20px)] mx-auto h-14 fixed right-0 left-0 bottom-2 z-40 bg-custom-bg-3 shadow-shadow-3 rounded-md p-1 max-lg:flex",children:[(0,a.jsx)(r.default,{href:"/",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",onClick:()=>{f(!1)},children:(0,a.jsx)(g.IconHome,{size:25})})}),(0,a.jsx)(r.default,{href:"/abouus",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",onClick:()=>{f(!1)},children:(0,a.jsx)(g.IconArticle,{size:25})})}),(0,a.jsx)(r.default,{href:"/contactus",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",onClick:()=>{f(!1)},children:(0,a.jsx)(g.IconPhone,{size:25})})})]})]}),(0,a.jsx)("div",{className:"fixed left-3 bottom-[4.4rem] z-40 w-[50px] mr-auto ".concat(h?"max-lg:right-4 max-lg:fixed":" max-lg:-right-full"),children:h&&(()=>{if(x){let{SOCIAL_APARAT:e,SOCIAL_BALE:l,SOCIAL_EITAA:t,SOCIAL_FACEBOOK:s,SOCIAL_GAP:n,SOCIAL_INSTAGRAM:r,SOCIAL_LINKEDIN:i,SOCIAL_SOROUSH:o,SOCIAL_TELEGRAM:d,SOCIAL_TWITTER:m,SOCIAL_WHATSAPP:u,SOCIAL_YOUTUBE:h}=x||{};return(0,a.jsxs)("div",{className:"hidden justify-around items-center bg-custom-bg-3 shadow-shadow-3 rounded-md p-1 max-lg:flex max-lg:flex-col",children:[!!e&&(0,a.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(c.default,{src:"/assets/images/aparat.svg",alt:"آپارات",height:23,width:23})}),!!l&&(0,a.jsx)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(c.default,{src:"/assets/images/bale.svg",alt:"بÙÙ",height:23,width:23})}),!!t&&(0,a.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(c.default,{src:"/assets/images/eitaa.svg",alt:"Ø§ÛØªØ§",height:23,width:23})}),!!n&&(0,a.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(c.default,{src:"/assets/images/gap.svg",alt:"Ú¯Ù¾",height:23,width:23})}),!!o&&(0,a.jsx)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(c.default,{src:"/assets/images/soroush.svg",alt:"Ø³Ø±ÙØ´",height:23,width:23})}),!!s&&(0,a.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconFacebook,{size:23})}),!!r&&(0,a.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconInstagram,{size:23})}),!!i&&(0,a.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconLinkedin,{size:23})}),!!d&&(0,a.jsx)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconTelegram,{size:23})}),!!m&&(0,a.jsx)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconTwitter,{size:23})}),!!u&&(0,a.jsx)("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconWhatsapp,{size:23})}),!!h&&(0,a.jsx)("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(g.IconYoutube,{size:23})})]})}})()}),(0,a.jsx)("div",{className:"backdrop-blur-sm bg-black/30 fixed top-0 right-0 bottom-0 left-0 ".concat(h||j?"z-30 opacity-100 transition-opacity ease-in duration-900":"-z-10 opacity-0"),onClick:()=>{f(!1),N(!1)}}),(0,a.jsxs)("div",{className:"flex items-center gap-12 absolute top-0 bottom-0 right-0 left-0 m-auto w-max max-xl:gap-6 lg:hidden max-lg:transition-all max-lg:duration-500 max-lg:fixed max-lg:max-lg:left-auto\n max-lg:top-[10px] max-lg:bottom-auto max-lg:flex-col max-lg:bg-custom-bg-3 max-lg:z-40 max-lg:h-[calc(100vh-80px)] max-lg:w-[calc(100vw-20px)] max-lg:shadow-shadow-3 max-lg:rounded-lg\n max-lg:items-start max-lg:p-4 overflow-auto\n ".concat(j?"max-lg:right-2 max-lg:fixed max-lg:visible":"max-lg:invisible max-lg:-right-full","\n "),children:[(0,a.jsx)("span",{className:"cursor-pointer p-2 rounded-full shadow-lg sticky top-0",onClick:()=>N(!1),children:(0,a.jsx)(g.IconClose2,{size:15})}),(0,a.jsx)(p,{catalog:"products",className:"appearance-none focus:appearance-none bg-custom-bg-3 w-full h-12 block px-3 py-2 transition rounded-md border border-custom-border-1 focus:bg-custom-bg-3 mb-1 max-lg:ml-5 max-lg:mb-0",showOption:!1,resultData:e=>{S(e)}}),(0,a.jsx)("div",{className:"flex flex-col w-full",children:Array.isArray(L)&&(null==L?void 0:L.map((e,l)=>(0,a.jsx)("div",{className:"w-full border-b last:border-none",onClick:()=>{N(!1)},children:(0,a.jsxs)(r.default,{href:null==e?void 0:e.direct_url,className:"py-2 flex gap-3",children:[(0,a.jsx)(c.default,{src:(null==e?void 0:e.attach_index_image_md)||"/assets/images/custom/default.png",alt:null==e?void 0:e.title,width:40,height:60,imgClassName:"object-contain !w-[40p
1x] !h-[60px] object-left-top"}),(0,a.jsx)("div",{className:"line-clamp-1 w-[calc(100%-60px)] h-[25px]",children:null==e?void 0:e.title})]})},(null==e?void 0:e.product_id)||l)))})]})]})}},80434:function(e,l,t){var a=t(57437),s=t(32471),n=t(45926),r=t(2265),i=t(87798);l.Z=e=>{let{items:l,icon:t,title:o,buttonClassName:c,itemsWrapperClassName:d}=e;return(0,a.jsx)("div",{children:(0,a.jsxs)(s.v2,{as:"div",className:"relative inline-block",children:[(0,a.jsx)("div",{children:(0,a.jsxs)(s.j2,{className:"inline-flex w-full justify-center rounded-md px-2 py-2 text-sm font-medium gap-2 ".concat(null!=c?c:""),"aria-label":"جستجÙ",children:[o," ",null!=t?t:(0,a.jsx)(i.IconOptionsVertical,{size:15})]})}),(0,a.jsx)(n.u,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,a.jsx)(s.sd,{className:"absolute z-10 left-0 mt-2 w-auto origin-top-right divide-y divide-gray-100 rounded-md dropdownMenuItems shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(null!=d?d:""),children:(0,a.jsx)("div",{className:"px-1 py-1",children:null==l?void 0:l.map((e,l)=>(0,a.jsx)(s.sN,{children:l=>{var t,s;let{active:n}=l;return(0,a.jsxs)("button",{onClick:()=>{e.eventTarget&&e.eventTarget()},type:"button",className:"".concat(n?"bg-custom-bg-6":"text-custom-text-1"," group flex w-full items-center rounded-md px-2 py-2 whitespace-nowrap ").concat(null!==(t=e.titleColor)&&void 0!==t?t:""),children:[e.icon&&(0,a.jsx)("span",{className:"ml-2 text-custom-text-3 ".concat(null!==(s=e.iconColor)&&void 0!==s?s:""),children:e.icon}),e.title&&e.title]})}},l))})})})]})})}},23302:function(e,l,t){t.d(l,{W:function(){return n}});var a=t(26070),s=t(64358);async function n(e){let{catalogName:l,params:t,token:n,sellerId:r,clientHostDockerImage:i,hostDockerImage:o}=e;try{let e=!!Number(null==t?void 0:t.revalidate);t._method="GET";let a=await (0,s.Z)({ignoreToken:!((null==t?void 0:t.id)||(null==t?void 0:t.slug)||(null==t?void 0:t.like)||(null==t?void 0:t.bookmark)||(null==t?void 0:t.mine)||(null==t?void 0:t.notify)),serverSideToken:n,sellerId:r,clientHost:e,clientHostDockerImage:i,hostDockerImage:o}).post(e?"/revalidate?route=".concat(l):"/".concat(l),t,{headers:{"content-type":"multipart/form-data"}});if(a.success&&a.result)return a.result;throw Error(a.message||"Failed to fetch catalog")}catch(e){return e instanceof a.Z&&console.error("Validation error:",e.messages),Promise.reject(e)}}}}]);
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.