1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1135],{8210:function(e,t,l){Promise.resolve().then(l.bind(l,656)),Promise.resolve().then(l.bind(l,2080)),Promise.resolve().then(l.bind(l,4647)),Promise.resolve().then(l.bind(l,4053)),Promise.resolve().then(l.bind(l,224)),Promise.resolve().then(l.bind(l,5253)),Promise.resolve().then(l.bind(l,9646)),Promise.resolve().then(l.bind(l,8353)),Promise.resolve().then(l.bind(l,5377))},656:function(e,t,l){"use strict";l.d(t,{default:function(){return R}});var r=l(7437),a=l(2265),n=l(7192),s=l(9102),i=l(3330),o=l(3486),c=l(121),d=l(4027),u=l(3904),x=l(8734),p=l(4887),m=l(2964),h=l(5025);function f(){return(0,r.jsx)("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})}function b(){return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.8v12.6c4-.3 6.5.2 8 1.6 1.5-1.4 4-1.9 8-1.6V4.8c-4-.3-6.5.2-8 1.7Z"}),(0,r.jsx)("path",{d:"M12 6.5V19"})]})}function g(e){var t;let{order:l,onClose:s}=e,{t:i,dir:o}=(0,n.Q)(),{symbol:c}=(0,m.U8)(),d=!!l,[g,v]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),k=(0,a.useRef)(null);(0,x.Z)(d,k),(0,a.useEffect)(()=>v(!0),[]);let w=(0,a.useRef)(s);(0,a.useEffect)(()=>{w.current=s},[s]);let N=(0,a.useCallback)(()=>{y(!1),setTimeout(()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.call(w)},200)},[]);if((0,a.useEffect)(()=>{if(!d){y(!1);return}let e=setTimeout(()=>y(!0),10),t=e=>"Escape"===e.key&&N();document.addEventListener("keydown",t);let l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{clearTimeout(e),document.removeEventListener("keydown",t),document.body.style.overflow=l}},[d,N]),!d||!g)return null;let C=l.lines||[],S=null!==(t=l.total)&&void 0!==t?t:(l.subtotal||0)+(l.shipping||0),E=Math.max(0,Number(l.discount)||0);return(0,p.createPortal)((0,r.jsxs)("div",{ref:k,className:"fixed inset-0 z-[200] flex items-center justify-center p-4",dir:o,onClick:N,role:"dialog","aria-modal":"true","aria-label":i("account.orderDetailsTitle","פר×× ×××× ×"),tabIndex:-1,children:[(0,r.jsx)("div",{"aria-hidden":"true",className:"absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity ease-out ".concat(j?"opacity-100 duration-300":"opacity-0 duration-200")}),(0,r.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"relative w-[460px] max-w-[94vw] transition will-change-transform ".concat(j?"opacity-100 translate-y-0 scale-100 duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]":"opacity-0 translate-y-3 scale-95 duration-200 ease-[cubic-bezier(0.4,0,1,1)]"),children:[(0,r.jsx)("button",{type:"button","aria-label":i("account.close","ס××ר×"),onClick:N,className:"absolute top-0 left-1/2 z-10 grid h-[74px] w-[74px] -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full bg-brand-green text-black shadow-md transition-transform duration-200 hover:rotate-90 hover:scale-105",children:(0,r.jsx)(f,{})}),(0,r.jsxs)("div",{className:"max-h-[92vh] overflow-y-auto rounded-[18px] bg-white px-6 pb-6 pt-[52px] shadow-[0_30px_80px_rgba(0,0,0,0.35)]",children:[(0,r.jsxs)("h2",{className:"mb-4 text-center text-[22px] font-bold text-black",children:[i("account.orderNumberHeading","×ספר ×××× ×")," ",(0,r.jsx)("span",{dir:"ltr",children:l.number})]}),(0,r.jsx)("div",{className:"flex flex-col gap-3",children:C.map((e,t)=>{var l;
1return(0,r.jsxs)("div",{className:"flex items-center gap-4 rounded-[12px] border border-black/15 p-3",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5 text-start",children:[(0,r.jsx)("h3",{className:"text-[16px] font-bold leading-tight text-black",dir:"auto",children:e.title}),(0,r.jsxs)("span",{className:"flex items-center justify-end gap-1.5 text-[14px] text-neutral-600",children:[(0,r.jsx)("bdi",{dir:"auto",children:e.formatKey?i("account.format_".concat(e.formatKey),e.formatHe):e.formatHe||i("account.formatPrint","×××פס")})," ",(0,r.jsx)(b,{})]}),(0,r.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[e.qty>1&&(0,r.jsxs)("span",{className:"text-[13px] text-neutral-500",children:["\xd7 ",e.qty]}),e.origPrice>e.price&&(0,r.jsx)("span",{className:"text-[13px] text-red-500 line-through",dir:"ltr",children:(0,h.CZ)(e.origPrice,c)}),(0,r.jsx)("span",{className:"text-[16px] font-bold text-black",dir:"ltr",children:(0,h.CZ)(e.price,c)})]})]}),(0,r.jsx)(u.Z,{book:e,className:"h-[92px] w-[64px] shrink-0 rounded-[6px]",captionClassName:"text-[9px] line-clamp-3"})]},null!==(l=e.id)&&void 0!==l?l:t)})}),(0,r.jsxs)("div",{className:"mt-4 flex flex-col gap-1.5 rounded-[12px] border border-brand-green bg-[#DEFDF1] px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-[16px] text-black",children:[(0,r.jsx)("span",{children:i("account.subtotal","ס××× ××× ×××")}),(0,r.jsx)("span",{dir:"ltr",children:(0,h.CZ)(l.subtotal,c)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between text-[16px] text-black",children:[(0,r.jsx)("span",{children:i("account.shipping","×ש×××")}),(0,r.jsx)("span",{dir:"ltr",children:(0,h.CZ)(l.shipping,c)})]}),E>0&&(0,r.jsxs)("div",{className:"flex items-center justify-between text-[16px] text-black",children:[(0,r.jsx)("span",{children:i("account.discount","×× ××")}),(0,r.jsx)("span",{dir:"ltr",children:(0,h.CZ)(-E,c)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between text-[16px] font-bold text-black",children:[(0,r.jsx)("span",{children:i("account.totalDue","ס××´× ×תש×××")}),(0,r.jsx)("span",{dir:"ltr",children:(0,h.CZ)(S,c)})]})]})]})]})]}),document.body)}var v=l(8590),j=l(4041);let y=[{key:"details",tKey:"tabDetails",he:"×פר××× ×©××"},{key:"orders",tKey:"tabOrders",he:"×××× ×ת ××ר×× ×ת"},{key:"favorites",tKey:"tabFavorites",he:"ספר×× ×××¢×פ××"}];function k(e){let{tab:t,onChange:l}=e,{t:a,dir:s}=(0,n.Q)(),{symbol:i}=(0,m.U8)();return(0,r.jsx)("div",{dir:s,className:"grid grid-cols-3 gap-2 px-4 pt-6 lg:flex lg:justify-center lg:gap-[15px] lg:px-[50px] lg:pt-[42px]",children:y.map(e=>{let n=e.key===t;return(0,r.jsx)("button",{type:"button",onClick:()=>l(e.key),"aria-pressed":n,className:"grid h-[48px] w-full place-items-center rounded-[12px] px-1 text-center text-[13px] font-bold leading-tight transition-colors sm:text-[15px] lg:h-[58px] lg:w-[367px] lg:rounded-[16px] lg:px-0 lg:text-[20px] lg:leading-none ".concat(n?"bg-brand-green text-black":"bg-[#DEFDF1] text-black hover:bg-[#cdf6e4]"),children:a("account.".concat(e.tKey),e.he)},e.key)})})}function w(){let{t:e,dir:t}=(0,n.Q)(),{isGlobal:l}=(0,m.mT)();return l?null:(0,r.jsx)("div",{dir:t,className:"mx-auto flex w-full max-w-[1131px] justify-start px-4 pt-3 lg:px-0 lg:pt-4",children:(0,r.jsxs)("a",{href:"https://dash.bookpod.co.il/",target:"_blank",rel:"noopener noreferrer",dir:t,"aria-label":e("account.authorsDashboardAria","××¢×ר ××ש×××¨× ×ס×פר×× (× ×¤×ª× ××ש×× ×ת ××ש×)"),className:"group inline-flex items-center gap-2 rounded-full border border-black/10 bg-white px-3 py-2 text-[13px] font-medium text-neutral-600 transition-colors hover:border-black/20 hover:bg-neutral-50 hover:text-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-black lg:text-[14px]",children:[(0,r.jsx)("span",{children:e("account.authorsDashboardCta","×ס×פר××: ×× ××¡× ××ש××ר×")}),(0,r.jsxs)("svg",{"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-400 transition-colors group-hover:text-black",children:[(0,r.jsx)("path",{d:"M15 3h6v6"}),(0,r.jsx)("path",{d:"M10 14 21 3"}),(0,r.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})]})})}function N(e){let{children:t}=e;return(0,r.jsx)("div",{className:"px-4 py-20 text-center text-[16px] text-neutral-500 lg:px-[50px] lg:py-[120px] lg:text-[18px]",children:t})}
1function C(e){let{label:t,value:l,onChange:a,type:n="text",inputMode:s,className:i="flex-1"}=e,o="email"===n||"tel"===n||["email","tel","numeric","decimal"].includes(s)?"ltr":"auto";return(0,r.jsxs)("label",{className:"flex ".concat(i," flex-col gap-1 rounded-[8px] border border-black/15 bg-white px-4 pb-2 pt-2.5 text-start transition-colors focus-within:border-black/40"),children:[(0,r.jsx)("span",{className:"text-[13px] leading-none text-neutral-500",children:t}),(0,r.jsx)("input",{type:n,inputMode:s,dir:o,value:l,onChange:e=>a(e.target.value),className:"w-full bg-transparent text-start text-[17px] leading-tight text-black outline-none"})]})}function S(e){let{profile:t,user:l,getToken:s,onSaved:i,savedCard:o,onCardRemoved:c}=e,{t:d,dir:u}=(0,n.Q)(),{symbol:x}=(0,m.U8)(),[p,h]=(0,a.useState)({first:"",last:"",street:"",house:"",apartment:"",city:"",country:"",zip:"",phone:"",email:"",marketing:!1}),[f,b]=(0,a.useState)("idle"),g=e=>t=>h(l=>({...l,[e]:t}));(0,a.useEffect)(()=>{let e=(null==t?void 0:t.name)||(null==l?void 0:l.displayName)||"",{firstName:r,lastName:a}=(0,v.cF)(e);h(e=>({...e,first:e.first||r,last:e.last||a,street:e.street||(null==t?void 0:t.street)||"",house:e.house||(null==t?void 0:t.house)||"",city:e.city||(null==t?void 0:t.city)||"",zip:e.zip||(null==t?void 0:t.zip)||"",phone:e.phone||(null==t?void 0:t.phone)||"",email:e.email||(null==t?void 0:t.email)||(null==l?void 0:l.email)||"",country:e.country||(t||l?d("account.defaultCountry","×שר××"):""),marketing:t?!!t.marketing:e.marketing}))},[t,l]);let j=async e=>{var t;if(e.preventDefault(),!l)return;b("saving");let r=null!==(t=await (null==s?void 0:s()))&&void 0!==t?t:null,a=[p.first,p.last].map(e=>e.trim()).filter(Boolean).join(" "),n=p.street.trim(),o=p.house.trim(),c=n?{street:n,house:o}:o?{house:o}:{},d=await (0,v.Ii)(r,{uid:l.uid,name:a,email:p.email,phone:p.phone,city:p.city,zip:p.zip,marketing:p.marketing,...c});d&&(null==i||i({...a?{name:a}:{},...c.street?{street:c.street}:{},...void 0!==c.house?{house:c.house}:{},...p.city.trim()?{city:p.city.trim()}:{},...p.zip.trim()?{zip:p.zip.trim()}:{},...p.phone.trim()?{phone:p.phone.trim()}:{},...p.email.trim()?{email:p.email.trim()}:{},marketing:p.marketing})),b(d?"saved":"error"),setTimeout(()=>b("idle"),d?2500:4e3)};return(0,r.jsxs)("div",{className:"mx-auto w-[590px] max-w-full px-4 pb-4 lg:px-0",children:[(0,r.jsx)("h1",{className:"py-6 text-center text-[24px] font-bold text-black lg:py-[36px] lg:text-[32px]",children:d("account.personalDetailsTitle","פר××× ××ש×××")}),(0,r.jsxs)("form",{className:"flex flex-col gap-3",onSubmit:j,dir:u,children:[(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(C,{label:d("account.firstName","×©× ×¤×¨××"),value:p.first,onChange:g("first")}),(0,r.jsx)(C,{label:d("account.lastName","×©× ×שפ××"),value:p.last,onChange:g("last")})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(C,{label:d("account.streetName","×©× ×ר×××"),value:p.street,onChange:g("street"),className:"flex-[2]"}),(0,r.jsx)(C,{label:d("account.buildingNumber","×ספר ××ת"),value:p.house,onChange:g("house"),inputMode:"numeric"})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(C,{label:d("account.apartmentFloor","××ר×, ×§×××"),value:p.apartment,onChange:g("apartment")}),(0,r.jsx)(C,{label:d("account.city","×¢×ר"),value:p.city,onChange:g("city")})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(C,{label:d("account.country","×××× ×"),value:p.country,onChange:g("country")}),(0,r.jsx)(C,{label:d("account.zip","×××§×× ( ×ש××××× ××××´× ××××)"),value:p.zip,onChange:g("zip"),inputMode:"numeric"})]}),(0,r.jsx)(C,{label:d("account.phone","××פ××"),value:p.phone,onChange:g("phone"),type:"tel",inputMode:"tel"}),(0,r.jsx)(C,{label:d("account.email","××××´×"),value:p.email,onChange:g("email"),type:"email",inputMode:"email"}),(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5 px-1 py-1 text-start",children:[(0,r.jsx)("input",{type:"checkbox",checked:p.marketing,onChange:e=>g("marketing")(e.target.checked),className:"h-[18px] w-[18px] shrink-0 cursor-pointer accent-black"}),(0,r.jsx)("span",{className:"text-[15px] leading-tight text-black",children:d("account.consentMarketing","×× × ××שר/ת ×§××ת ×¢×××× ×× ××××ר×× ×¤×¨×¡×××××")})]}),(0,r.jsx)("button",{type:"submit",disabled:"saving"===f||!l,className:"mt-3 h-[52px] w-full rounded-[8px] bg-black text-[18px] font-bold text-brand-green transition-colors hover:bg-neutral-800 disabled:opacity-60",children:"saving"===f?d("account.saving","ש××רâ¦"):"saved"===f?d("account.saved","× ×©×ר â"):d("account.save","ש××ר×")}),"error"===f&&(0,r.jsx)("p",{role:"alert",className:"text-center text-[14px] text-red-600",children:d("account.saveError","×ש×××¨× × ×ש××, × ×¡× ×©××")})]}),(0,r.jsxs)("p",{className:"mt-5 text-center text-[13px] leading-relaxed text-neutral-500",children:[d("account.detailsNote1","×פר××× ×ש××©× ××צ×רת קשר, תש×××××, ×¢×××× ×× ×××צע××"),(0,r.jsx)("br",{}),d("account.detailsNote2","××ת×× ××רש××ª× ×ש××××©× ××תר")]}),(0,r.jsx)(E,{savedCard:o,getToken:s,onRemoved:c},(null==l?void 0:l.uid)||"anon")]})}function E(e){let{savedCard:t,getToken:l,onRemoved:s}=e,{t:i,dir:o}=(0,n.Q)(),[c,d]=(0,a.useState)("idle"),u=(0,a.useRef)(null),x=(0,a.useRef)(null),p=(0,a.useRef)(null),m=(0,a.useRef)(null),h=(0,a.useRef)("idle"),f=(null==t?void 0:t.hasSavedCard)?String(t.last4||"card"):"";if((0,a.useEffect)(()=>{f&&d("idle")},[f]),(0,a.useEffect)(()=>{var e,t,l,r;let a=h.current;h.current=c,c!==a&&("confirm"===c?null===(e=x.current)||void 0===e||e.focus():"idle"===c?null===(t=u.current)||void 0===t||t.focus():"error"===c?null===(l=p.current)||void 0===l||l.focus():"removed"===c&&(null===(r=m.current)||void 0===r||r.focus()))},[c]),!(null==t?void 0:t.hasSavedCard)&&"removed"!==c)return null;let b=async()=>{d("removing");let e=await Promise.resolve(null==l?void 0:l()).catch(()=>null);if(await (0,v.jG)(e)){d("removed"),null==s||s();return}d("error")};return(0,r.jsxs)("section",{dir:o,className:"mt-9",children:[(0,r.jsx)("h2",{className:"pb-3 text-center text-[20px] font-bold text-black",children:i("account.savedCardTitle","×××¦×¢× ×ª×©××× ×©××ר")}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 rounded-[8px] border border-black/15 bg-white px-4 py-4 text-start",children:["removed"===c?(0,r.jsx)("p",{ref:m,tabIndex:-1,role:"status",className:"text-[15px] text-black",children:i("account.cardRemoved","××ר××ס ××סר â")}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2.5 text-[17px] text-black",children:[(0,r.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"2.5",y:"5",width:"19",height:"14",rx:"3"}),(0,r.jsx)("path",{d:"M2.5 9.5h19"})]}),(0,r.jsxs)("span",{dir:"ltr",className:"font-medium tracking-[0.08em]",children:["â¢â¢â¢â¢ ",t.last4]})]}),"idle"===c&&(0,r.jsx)("button",{ref:u,type:"button",onClick:()=>d("confirm"),className:"rounded-[8px] border border-black/15 px-4 py-2 text-[14px] font-medium text-black transition-colors hover:border-red-300 hover:text-red-600",children:i("account.removeCard","×סרת ××ר××ס")})]}),("confirm"===c||"removing"===c||"error"===c)&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-[8px] bg-[#F3F3F3] px-3 py-2.5",children:[(0,r.jsx)("span",{className:"text-[14px] leading-snug text-black",children:i("account.removeCardConfirm","××ס×ר ×ת ××ר××ס ×ש××ר? ××§× ××× ×××× ×פשר ×ש××ר ×ר××ס ×××ש.")}),(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{ref:x,type:"button",onClick:b,disabled:"removing"===c,className:"rounded-[8px] bg-red-600 px-4 py-2 text-[14px] font-medium text-white transition-colors hover:bg-red-700 disabled:opacity-60",children:"removing"===c?i("account.removeCardRemoving","×ס×רâ¦"):i("account.removeCardYes","××, ××ס×ר")}),(0,r.jsx)("button",{type:"button",onClick:()=>d("idle"),disabled:"removing"===c,className:"rounded-[8px] border border-black/15 px-4 py-2 text-[14px] text-black disabled:opacity-60",children:i("account.removeCardCancel","×××××")})]})]}),"error"===c&&(0,r.jsx)("p",{ref:p,tabIndex:-1,role:"alert",className:"text-[13px] text-red-600",children:i("account.removeCardError","×××¡×¨× × ×ש××, × ×¡× ×©××")})]}),(0,r.jsx)("p",{className:"text-[13px] leading-relaxed text-neutral-500",children:i("account.savedCardNote","××ר××ס ש××ר ××××¤× ×××××× ××¦× ××רת ×ס×××§× ×תש××× ×××ר. ××קפ×× ×× ×©××רת ×ת ×ספר ××ר××ס.")})]})]})}function T(){return(0,r.jsx)("span",{className:"grid h-[28px] w-[28px] place-items-center rounded-full bg-black text-white","aria-hidden":"true",children:(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M12 5v14M5 12h14"})})})}function M(e){let{order:t,variant:l,onView:a}=e,{t:s,dir:i}=(0,n.Q)(),{symbol:o}=(0,m.U8)(),c="return"===l,d=c?s("account.totalCredit","ס××´× ×××××-"):s("account.total","ס××´×"),x=c?s("account.viewCredit","צפ××× ××××××"):s("account.viewOrder","צפ××× ××××× ×"),p=c?s("account.returnStatus","×××ר×"):s("account.status".concat(t.statusKey||"IN_PROCESS"),t.status);
1return(0,r.jsxs)("div",{dir:i,className:"mx-auto flex w-full max-w-full flex-col gap-4 rounded-[12px] bg-[#F3F3F3] px-4 py-5 lg:min-h-[276px] lg:w-[1210px] lg:flex-row lg:items-center lg:justify-between lg:px-[35px] lg:py-[27px]",children:[(0,r.jsxs)("div",{className:"flex flex-col items-end gap-1.5 text-start",children:[(0,r.jsxs)("div",{className:"text-[15px] text-black lg:text-[16px]",children:[s("account.orderNumberLabel","×××× × ×ספר :")," ",(0,r.jsx)("span",{dir:"ltr",children:t.number})]}),(0,r.jsxs)("div",{className:"text-[15px] text-black lg:text-[16px]",children:[s("account.purchasedOn","×§× ××× ×-")," ",(0,r.jsx)("span",{dir:"ltr",children:t.date})]}),(0,r.jsxs)("div",{className:"text-[15px] text-black lg:text-[16px]",children:[d," ",(0,r.jsx)("span",{dir:"ltr",children:(0,h.CZ)(t.total,o)})]}),(0,r.jsx)("span",{className:"text-[15px] text-[#76AAE5]",dir:"auto",children:p}),(0,r.jsx)("button",{type:"button",onClick:()=>a(t),className:"mt-3 rounded-[12px] bg-brand-green px-[28px] py-[13px] text-[16px] font-medium leading-none text-black transition-transform hover:scale-[1.02] lg:text-[18px]",children:x})]}),(0,r.jsx)("div",{className:"-mx-4 flex gap-3 overflow-x-auto px-4 no-scrollbar lg:mx-0 lg:gap-[20px] lg:overflow-visible lg:px-0",children:t.books.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-[9px]",children:[(0,r.jsx)(u.Z,{book:e,className:"h-[130px] w-[92px] rounded-[6px] lg:h-[159px] lg:w-[112px]"}),(0,r.jsx)(T,{})]},"".concat(e.id,"-").concat(t)))})]})}function F(e){let{orders:t,variant:l,onView:a}=e,{t:s}=(0,n.Q)(),{symbol:i}=(0,m.U8)();return null===t?(0,r.jsx)(N,{children:s("account.loading","×××¢×â¦")}):t.length?(0,r.jsx)("div",{className:"flex flex-col gap-4 px-4 pt-6 lg:gap-6 lg:px-[50px] lg:pt-[40px]",children:t.map(e=>(0,r.jsx)(M,{order:e,variant:l,onView:a},e.id))}):(0,r.jsxs)(N,{children:["return"===l?s("account.noReturns","××× ×××ר×ת ×× ×××××××"):s("account.noOrders","×¢×××× ××× ×××× ×ת"),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[15px] text-neutral-400",children:"return"===l?s("account.noReturnsHint","×××ר×ת ×××××××× ××פ××¢× ×××"):s("account.noOrdersHint","××××× ×ת שת××¦×¢× ××פ××¢× ×××")})]})}function P(e){let{books:t,onUnfavorite:l,layout:a="desktop"}=e,{t:s}=(0,n.Q)(),{symbol:i}=(0,m.U8)(),o=(0,r.jsxs)(N,{children:[s("account.noFavorites","×¢×××× ××× ×¡×¤×¨×× ×××¢×פ××"),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[15px] text-neutral-400",children:s("account.noFavoritesHint","ס×× × â¥ ×¢× ×¡×¤×¨×× ××× ×ש××ר ×××ª× ×××")})]});if(null===t)return(0,r.jsx)(N,{children:s("account.loading","×××¢×â¦")});let u=(0,j.D)(t);return u.length?"mobile"===a?(0,r.jsx)("div",{className:"grid grid-cols-2 gap-x-3 gap-y-7 px-4 pb-8 pt-4 sm:grid-cols-3",children:u.map(e=>(0,r.jsx)(d.Z,{book:e},e.id))}):(0,r.jsx)("div",{className:"flex justify-center px-[50px] pt-[40px]",children:(0,r.jsx)("div",{className:"grid grid-cols-5 gap-x-[16px] gap-y-[60px]",children:u.map(e=>(0,r.jsx)(c.Z,{book:e,favorite:!0,onToggleFavorite:(e,t)=>{t||l(e)}},e.id))})}):o}function R(e){let{initialTab:t="details",variant:l="desktop"}=e,n=y.some(e=>e.key===t)?t:"details",[c,d]=(0,a.useState)(n),[u,x]=(0,a.useState)(null),{user:p,authenticated:h,getToken:f,loading:b}=(0,s.a)(),{symbol:j}=(0,m.U8)(),{setFavoriteLocal:N}=(0,i.r)(),{invalidateRecommendations:C}=(0,o.G)(),[E,T]=(0,a.useState)(null),[M,R]=(0,a.useState)(null),[_,z]=(0,a.useState)(null),[L,D]=(0,a.useState)(null),[Z,O]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=window.matchMedia("(min-width: 1024px)"),t=()=>O("desktop"===l?e.matches:!e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[l]),(0,a.useEffect)(()=>{if(!Z||b)return;if(!h){T([]),R([]),z(null),D({hasSavedCard:!1});return}let e=!1;return(async()=>{var t;let l=null!==(t=await (null==f?void 0:f()))&&void 0!==t?t:null,[r,a,n,s]=await Promise.all([(0,v.rt)(l,null==p?void 0:p.uid),(0,v.dJ)(l),(0,v.Ai)(l),(0,v.vs)(l)]);e||(T(r),R(a.map(e=>(0,v.nf)(e,j))),z(n),D(s||{hasSavedCard:!1}))})(),()=>{e=!0}},[Z,h,b,f]);let B=(0,a.useCallback)(async e=>{var t;R(t=>t?t.filter(t=>String(t.id)!==String(e.id)):t),N(e.id,!1);let l=null!==(t=await (null==f?void 0:f()))&&void 0!==t?t:null;if(await (0,v.AB)(e.id,!1,l)){C();return}R(t=>!t||t.some(t=>String(t.id)===String(e.id))?t:[e,...t]),N(e.id,!0)},[f,C,N]),K=null===E?null:E.filter(e=>!e.isReturn);return(0,r.jsxs)("section",{className:"pb-16",children:[(0,r.jsx)(k,{tab:c,onChange:d}),(0,r.jsx)(w,{}),"details"===c&&(0,r.jsx)(S,{profile:_,user:p,getToken:f,onSaved:e=>z(t=>({...t||{},...e})),savedCard:L,onCardRemoved:()=>D({hasSavedCard:!1})}),"orders"===c&&(0,r.jsx)(F,{orders:K,variant:"order",onView:x}),"favorites"===c&&(0,r.jsx)(P,{books:M,onUnfavorite:B,layout:l}),(0,r.jsx)(g,{order:u,onClose:()=>x(null)})]})}},5377:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return c}});var r=l(7437),a=l(2265),n=l(4887),s=l(7192);function i(){return(0,r.jsx)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M7 7l16 16M23 7 7 23",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function o(){return(0,r.jsxs)("div",{className:"relative h-[209px] w-[238px] lg:h-[250px] lg:w-[283px]","aria-hidden":"true",children:[(0,r.jsx)("img",{src:"/brand/newsletter-mark.svg",alt:"",className:"h-full w-full object-contain"}),(0,r.jsx)("img",{src:"/brand/newsletter-star.svg",alt:"",className:"absolute left-[58%] top-[62%] h-auto w-[50px] -translate-x-1/2 -translate-y-1/2 lg:w-[60px]"})]})}function c(e){let{className:t="",label:l}=e,{t:c,dir:d}=(0,s.Q)(),[u,x]=(0,a.useState)(!1),[p,m]=(0,a.useState)(!1),[h,f]=(0,a.useState)(!1),[b,g]=(0,a.useState)(""),[v,j]=(0,a.useState)(null),[y,k]=(0,a.useState)(0),[w,N]=(0,a.useState)(!1),C=(0,a.useRef)(null),S=(0,a.useRef)(null),E=(0,a.useRef)(null),T=(0,a.useRef)(null),M=(0,a.useRef)(null),F=(0,a.useId)();(0,a.useEffect)(()=>(x(!0),()=>
1clearTimeout(M.current)),[]);let P=(0,a.useCallback)(()=>{clearTimeout(M.current),m(!0),requestAnimationFrame(()=>f(!0))},[]);(0,a.useEffect)(()=>{var e;y>0&&(null===(e=T.current)||void 0===e||e.focus())},[y]);let R=(0,a.useCallback)((e,t)=>{j({tone:e,text:t}),k(e=>e+1)},[]),_=(0,a.useCallback)(async e=>{e.preventDefault();let t=b.trim();N(!0);try{let e=await fetch("/api/newsletter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})}),l=await e.json().catch(()=>({}));e.ok?(R("ok",c("footer.newsletterThanks","ת×××! × ×¨×©××ª× ×× ×××××ר.")),g("")):(null==l?void 0:l.error)==="invalid_email"?R("error",c("footer.newsletterBadEmail","×ת××ת ××××´× ×× ×ª×§×× ×, ×××××× [email protected]")):R("error",c("footer.newsletterUnavailable","××רש×× ××× × ×××× × ×ר××¢. ×פשר ××ת×× ×× × ×[email protected] ×× ×ס××£ ×ת××."))}catch(e){R("error",c("footer.newsletterNetwork","ש×××ת תקש×רת. × ×¡× ×©××."))}finally{N(!1)}},[R,b,c]),z=(0,a.useCallback)(()=>{f(!1),clearTimeout(M.current),M.current=setTimeout(()=>{var e;m(!1),null===(e=C.current)||void 0===e||e.focus()},180)},[]);(0,a.useEffect)(()=>{if(!p)return;let e=document.body.style.overflow,t=e=>{if("Escape"===e.key){z();return}if("Tab"!==e.key||!E.current)return;let t=[...E.current.querySelectorAll('button, input, [href], [tabindex]:not([tabindex="-1"])')].filter(e=>!e.disabled&&"true"!==e.getAttribute("aria-hidden"));if(!t.length)return;let l=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===l?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),l.focus())};document.body.style.overflow="hidden",document.addEventListener("keydown",t);let l=setTimeout(()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.focus()},30);return()=>{clearTimeout(l),document.removeEventListener("keydown",t),document.body.style.overflow=e}},[p,z]);let L=u&&p?(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-[250] overflow-y-auto",dir:d,children:[(0,r.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none fixed inset-0 bg-black/65 transition-opacity motion-reduce:transition-none ".concat(h?"opacity-100 duration-300":"opacity-0 duration-150")}),(0,r.jsx)("div",{className:"relative flex min-h-full items-start justify-center px-5 pb-10 pt-[13dvh]",onMouseDown:e=>{e.target===e.currentTarget&&z()},children:(0,r.jsxs)("section",{ref:E,role:"dialog","aria-modal":"true","aria-labelledby":F,onMouseDown:e=>e.stopPropagation(),className:"relative flex min-h-[570px] w-full max-w-[360px] flex-col items-center rounded-[26px] bg-white px-3 pb-8 pt-[42px] text-center text-black shadow-[0_26px_58px_rgba(0,0,0,0.10),0_105px_105px_rgba(0,0,0,0.09)] transition will-change-transform motion-reduce:transition-none motion-reduce:transform-none lg:min-h-[680px] lg:max-w-[500px] lg:rounded-[16px] lg:pt-[48px] ".concat(h?"translate-y-0 scale-100 opacity-100 duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]":"translate-y-3 scale-[0.97] opacity-0 duration-150 ease-out"),children:[(0,r.jsx)("button",{ref:S,type:"button",onClick:z,"aria-label":c("footer.newsletterClose","ס××רת ×××× ××רש××"),className:"absolute left-1/2 top-0 grid h-[54px] w-[54px] -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full bg-brand-green text-black shadow-sm transition-transform hover:rotate-90 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-white/80 lg:h-[58px] lg:w-[58px]",children:(0,r.jsx)(i,{})}),(0,r.jsx)(o,{}),(0,r.jsxs)("h2",{id:F,className:"mt-2 w-full max-w-[286px] text-[28px] font-bold leading-none tracking-normal lg:mt-[14px] lg:max-w-[342px] lg:text-[34px]",children:[c("footer.newsletterTitleStart","× ×¨×©××× ×"),(0,r.jsx)("mark",{className:"rounded-[8px] bg-[#FFE85C] px-1 text-black",children:c("footer.newsletterTitleMark","× ×××××ר")}),(0,r.jsx)("br",{}),c("footer.newsletterTitleEnd","×××× ××§× ×× ×ר×ש×× ×")]}),(0,r.jsx)("p",{className:"mt-[14px] w-full max-w-[220px] text-[18px] font-medium leading-6 lg:mt-[15px] lg:max-w-[250px] lg:text-[20px] lg:leading-[29px]",children:c("footer.newsletterSubtitle","××ת ×× ××× ××ת ××××צע×× ×¨×ש×× ×× ×××××")}),(0,r.jsxs)("form",{className:"mt-3 w-full max-w-[292px] text-start lg:mt-[14px]",onSubmit:_,children:[(0,r.jsx)("label",{htmlFor:"".concat(F,"-email"),className:"mb-[5
1px] block text-[15px] leading-[18px] text-black",children:c("footer.newsletterEmailLabel","×××ר ×××§×ר×× ×")}),(0,r.jsx)("input",{id:"".concat(F,"-email"),type:"email",inputMode:"email",autoComplete:"email",required:!0,dir:b?"ltr":d,value:b,onChange:e=>g(e.target.value),placeholder:c("footer.newsletterEmailPlaceholder","×××ר ×××§×ר×× ×"),className:"h-12 w-full rounded-[7px] border border-black/45 bg-white px-4 text-start text-[15px] outline-none transition placeholder:text-black/40 focus:border-black focus:ring-2 focus:ring-brand-green/45"}),(0,r.jsx)("button",{type:"submit",disabled:w,className:"mt-3 flex h-12 w-full items-center justify-center rounded-[7px] bg-brand-green text-[16px] font-medium text-black transition hover:brightness-95 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-brand-green/35 active:scale-[0.99] disabled:opacity-60",children:w?c("footer.newsletterSending","ש×××â¦"):c("footer.newsletterSubmit","×רש××")}),(0,r.jsx)("p",{ref:T,role:(null==v?void 0:v.tone)==="error"?"alert":"status","aria-atomic":"true",tabIndex:-1,dir:"auto",className:v?"mt-3 text-start text-[14px] font-medium ".concat("error"===v.tone?"text-red-700":"text-black"):"",children:(null==v?void 0:v.text)||""})]})]})})]}),document.body):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:C,type:"button",onClick:P,className:t,children:l||c("footer.newsletter","×רש×× ×× ×××××ר")}),L]})}}},function(e){e.O(0,[2103,3145,1244,9318,5609,3654,7852,8767,2322,6711,2971,2117,1744],function(){return e(e.s=8210)}),_N_E=e.O()}]);
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.