PageSourceSearch

https://www.booksellers.ca/_next/static/chunks/7134-22c75de58be244ba.js

js booksellers.ca collected 2026-09-26 08:47:51 UTC 44,203 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="16410702-8f7e-4a87-befc-e43e6ac39c0b",e._sentryDebugIdIdentifier="sentry-dbid-16410702-8f7e-4a87-befc-e43e6ac39c0b")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7134],{21044:(e,t,s)=>{s.d(t,{A:()=>a});var i=s(37876),n=s(14232),l=s(12212);let a=(0,n.memo)(e=>{let{title:t,message:s=null}=e,{t:n}=(0,l.B)();return(0,i.jsxs)("section",{className:"section section--pt-80 section--pb-60",children:[(0,i.jsx)("div",{className:"container a-center",children:(0,i.jsx)("h1",{children:t??n("utils.redirecting")})}),(0,i.jsx)("div",{className:"container a-center section-body",children:(0,i.jsx)("p",{children:s})})]})})},29780:(e,t,s)=>{s.d(t,{A:()=>u,b:()=>c});var i=s(37876),n=s(14232),l=s(12212),a=s(21356),r=s(99626),o=s(1648);let c={ACCOUNT:"account",PICKUP:"pickup",ORDER:"order"},d={[c.ACCOUNT]:25,[c.PICKUP]:175,[c.ORDER]:100},u=(0,n.memo)(e=>{let{type:t,inline:s=!1}=e,{t:u}=(0,l.B)(),{isAuthenticated:p}=(0,a.A)(),{isInstitutional:h}=(0,o.A)(),{isConsentAccepted:m}=(0,r.A)(),g=d[t],_=(0,n.useMemo)(()=>g?t===c.PICKUP?u("gamification.points.plus_pickup",{count:g}):u("gamification.points.plus",{count:g}):null,[g,t,u]);return(!p||m)&&g&&(p||t===c.ACCOUNT)&&!h?(0,i.jsxs)("small",{className:`span--c-forestlight${s?" d-inline-block":" d-block"}`,style:{fontStyle:"italic"},children:[s&&"(",_,s&&")"]}):null})},33280:(e,t,s)=>{s.d(t,{A:()=>l});var i=s(14232),n=s(65892);let l=e=>{(0,i.useEffect)(()=>{let t=async()=>{let[t,s,i]=await Promise.all([(0,n.wR)(),(0,n.X6)(),(0,n._m)()]);e.setGeoObj({provinces:t.data,countries:s.data,regions:i.data.filter(e=>"00"!==e.code)})};null===e.geoObj&&t()},[e])}},42940:(e,t,s)=>{s.d(t,{A:()=>x});var i=s(14232),n=s(38248),l=s(48732),a=s(61675),r=s(79131),o=s(78365),c=s(7367);let d="checkout",u=async(e,t)=>await o.W6.post(d,e,{...c.qp,idempotencyKey:t}),p=async(e,t)=>await o.W6.post(`${d}/institutional`,e,{...c.qp,idempotencyKey:t});var h=s(62199),m=s(34924),g=s(16095),_=s(10235),f=s(45625),b=s(21356),k=s(1648),v=s(12212);let x=()=>{let{t:e,locale:t}=(0,v.B)(),{isInstitutional:s}=(0,k.A)(),{isAuthenticated:o,currentUser:d}=(0,b.A)(),{cartSortingOption:x}=(0,f.n)(),{geoObj:y,stepsOrder:j,currentStep:N,isStepBlocked:C,setIsStepBlocked:A,haveDigitalBooks:T,haveDigitalProducts:I,havePhysicalProducts:w,haveGiftCardProducts:P,completeCartItems:O,checkoutObject:R,getCheckoutObject:$,checkoutIdempotencyKey:S,isInstantCheckout:q,isCheckoutLocked:M,setIsCheckoutLocked:E,isCheckoutLoading:F,setIsCheckoutLoading:H,checkoutForm:U,updateCheckoutForm:D,deleteInCheckoutForm:Y,checkoutExtraForm:V,updateCheckoutExtraForm:G,bookstoreMethod:K,setBookstoreMethod:L,updateShippingIntent:B,selectedBookstore:z,updateSelectedBookstore:Z,isGuestCheckout:W,userAddresses:J,setUserAddresses:Q,selectedAddress:X,updateSelectedAddress:ee,refreshUserAddresses:et,applySavedAddress:es,removeSavedAddress:ei,setDefaultOrganization:en,errorInCompletion:el,setErrorInCompletion:ea,errorsLastStepOnCart:er,setErrorsLastStepOnCart:eo,confirmationOrder:ec,setConfirmationOrder:ed}=(0,i.useContext)(a.g),{currentCard:eu,setCurrentCard:ep,customerCards:eh,currentlyViewing:em,setCurrentlyViewing:eg,selectedPaymentMethod:e_,setSelectedPaymentMethod:ef,paymentForm:eb,updatePaymentForm:ek,cleanPaymentForm:ev,postFinalLoading:ex,setPostFinalLoading:ey}=(0,i.useContext)(r.Q),{cart:ej,refreshCart:eN}=(0,i.useContext)(l.M),{refreshDataPurchases:eC}=(0,i.useContext)(_.g),eA=(0,i.useMemo)(()=>R?.deliveries&&R.deliveries.length>1,[R]),eT=(0,i.useCallback)(e=>{let t=j.indexOf(e);return t>=0?t+1:1},[j]),eI=(0,i.useMemo)(()=>eT(N),[N,eT]),ew=(0,i.useMemo)(()=>{let e={[h.Tq.CART]:ej&&!ej.is_empty&&0===ej.errors.length};if(s){let t=!C&&U.bookstore&&null!==V.email&&""!==V.email.trim()&&null!==V.telephone&&""!==V.telephone.trim()&&void 0!==U.billpayer&&void 0!==U.shipping_address;e={...e,[h.Tq.PO]:t,[h.Tq.REVISION]:t}}else e={...e,[h.Tq.PICKUP_OR_SHIPPING]:!C&&null!==U&&null!==X&&null!==K&&null!==z&&U.deliveries.length>0&&!U.deliveries.find(e=>null===e.shipping_method)&&null!==U.bookstore||q,[h.Tq.PAYMENT]:eb&&(void 0!==eb.nonce||1===U.payment_method||null!==U.gift_card&&R&&0===R.total)&&void 0!==U.billpayer&&(U.ship_to_billing_address||!U.ship_to_billing_address&&null!==U.billpayer.email)&&(!T||T&&R&&R.digital_book_consent)};return e},[s,q,ej,U,V,R,X,K,z,eb,T,C]),eP=(0,i.useCallback)((t,s)=>{switch(t){case"processor_declined":case"gateway_rejected":case"failed":return e(`account.modal.creditcard.errors.${t}`);default:return s}},[e]),eO=(0,i.useCallback)(e=>{ea(null),(0,n.getCookie)("affiliate")&&(0,n.deleteCookie)("affiliate");let t=(0,g.xH)(O);(0,g.RR)({event:g.bk.PURCHASE,clientType:(0,g.oV)(o,s),ecommerce:{transaction_id:e,value:R.total,shipping:R.shipping_fee,tax:R.sales_tax.total,currency:"CAD",affiliation:U.bookstore,items:[...t]}},null,U.bookstore),eN(),o&&eC()},[O,R,U.bookstore,o,s,eN,eC,ea]),eR=(0,i.useCallback)(async i=>{let l=!1,a="name"===x?"name":"cart";if(s){H(!0),ey(!0);let s={...U,telephone:V.telephone,billpayer:{...U.billpayer,email:V.email,given_name:d.firstname,family_name:d.lastname},item_sort_order:a};delete s.payment,delete s.deliveries,delete s.payment_method,delete s.voluntary_shipping_fee,await p(s,S).then(s=>{ed(s),ea(null);let i=(0,g.xH)(O);(0,g.RR)({event:g.bk.PURCHASE,clientType:"Institutionnal",ecommerce:{transaction_id:s.orders[0].id,value:R.total,tax:R.sales_tax.total,currency:"CAD",affiliation:"",items:[...i]}},{},void 0,t,e),l=!0}
1).catch(t=>{if(t.status===c.gx.CONFLICT)return void ea({message:e("checkout.errors.duplicate_order")});ea(void 0!==t.status?t.data:{message:e("checkout.errors.network",{contactType:"institutional"})}),(0,m.vV)("Checkout","Institutional checkout completion failed",t,{error:t.data,checkout:(0,h.b)(s)})}).finally(()=>{H(!1),ey(!1),l&&(eN(),eC())})}else if(H(!0),ey(!0),null===ec||ec&&null===ec.payment){let s={...U,payment:{...eb}};if((0,n.getCookie)("affiliate")){let e=JSON.parse((0,n.getCookie)("affiliate"));s="new"===e.type?{...s,affiliate_id:e.id}:{...s,legacy_affiliate_id:e.id}}q&&delete s.deliveries,await u({...s,ship_to_billing_address:void 0,item_sort_order:a},S).then(e=>{ed(e),e.payment?.was_successful?(E(!1),eo([]),eO(e.orders[0].id),l=!0):(E(!0),e.payment&&null!==e.payment.native_status?ea({message:eP(e.payment.native_status,e.payment.message)}):e.payment?.message?ea({message:e.payment.message}):ea({advanced:!0}),ek({nonce:void 0}))}).catch(i=>{if(i.status===c.gx.CONFLICT)return void ea({message:e("checkout.errors.duplicate_order")});"new"===em&&ep(null),void 0===i.status?ea({message:e("checkout.errors.network",{contactType:"other"})}):i.data?.message===void 0?(ea({message:i.data?.errors?.[t]}),i.data?.cart_errors?.length&&eo(i.data.cart_errors)):ea(i.data),(0,m.vV)("Checkout","Checkout completion failed",i,{error:void 0!==i.status?i.data?.message===void 0?i.data?.errors?.[t]:i.data:"network error",locale:t,checkout:(0,h.b)(s)}),"card"===e_&&"new"===em&&null===document.querySelector("#add-creditcard-form .btn")&&null!==document.querySelector(".paymentmethods__accounts--cards #btn-cancel-newcard")&&document.querySelector(".paymentmethods__accounts--cards #btn-cancel-newcard").click(),E(!0),ek({nonce:void 0})}).finally(()=>{H(!1),ey(!1),l&&(eN(),eC())})}else{let t={...eb,payment_id:ec.payment.payment_id};ey(!0),(0,h.vt)(t).catch(e=>{(0,m.vV)("Payment","Payment retry failed",e,{paymentId:ec?.payment?.payment_id}),E(!0),"card"===e_&&"new"===em&&null===document.querySelector("#add-creditcard-form .btn")&&null!==document.querySelector(".paymentmethods__accounts--cards #btn-cancel-newcard")&&document.querySelector(".paymentmethods__accounts--cards #btn-cancel-newcard").click(),ek({nonce:void 0}),ea({message:eP(e?.response?.data?.status,e?.response?.data?.message)})}).then(t=>{eo([]),(0,m.fH)("Payment","Payment retry response received",{status:t?.status,paymentId:ec?.payment?.payment_id}),void 0!==t&&204===t.status?(E(!1),ea(null),eO(ec.orders[0].id),l=!0):void 0!==t&&(t.status===c.gx.BAD_REQUEST||t.status===c.gx.UNPROCESSABLE_ENTITY)?(E(!0),ea({message:t.data.message})):(E(!0),ea({message:e("checkout.final.retry")}))}).finally(()=>{H(!1),ey(!1),l&&(eN(),eC())})}!l&&i&&("function"==typeof i.preventDefault&&i.preventDefault(),"function"==typeof i.stopPropagation&&i.stopPropagation(),i.nativeEvent&&("function"==typeof i.nativeEvent.preventDefault&&i.nativeEvent.preventDefault(),"function"==typeof i.nativeEvent.stopImmediatePropagation&&i.nativeEvent.stopImmediatePropagation()))},[t,e,s,q,U,V,eb,ek,d,em,O,R,S,ec,eO,e_,x,eP,eN,eC,ea,ed,E,H,ey,eo,ep]);return(0,i.useEffect)(()=>{document?.body&&(M?document.body.classList.add("checkout-locked"):document.body.classList.remove("checkout-locked"))},[M]),{stepsOrder:j,currentStep:N,getStepNumber:eT,currentStepNumber:eI,stepsValidity:ew,isStepBlocked:C,setIsStepBlocked:A,checkoutForm:U,updateCheckoutForm:D,deleteInCheckoutForm:Y,checkoutObject:R,getCheckoutObject:$,isCheckoutLoading:F,isInstantCheckout:q,isSplitted:eA,checkoutExtraForm:V,updateCheckoutExtraForm:G,finalizeCheckout:eR,bookstoreMethod:K,setBookstoreMethod:L,updateShippingIntent:B,selectedBookstore:z,updateSelectedBookstore:Z,geoObj:y,isGuestCheckout:W,userAddresses:J,setUserAddresses:Q,selectedAddress:X,updateSelectedAddress:ee,refreshUserAddresses:et,applySavedAddress:es,removeSavedAddress:ei,setDefaultOrganization:en,completeCartItems:O,haveDigitalBooks:T,haveDigitalProducts:I,havePhysicalProducts:w,haveGiftCardProducts:P,currentCard:eu,setCurrentCard:ep,customerCards:eh,currentlyViewing:em,setCurrentlyViewing:eg,selectedPaymentMethod:e_,setSelectedPaymentMethod:ef,paymentForm:eb,updatePaymentForm:ek,cleanPaymentForm:ev,postFinalLoading:ex,setPostFinalLoading:e
1y,errorInCompletion:el,setErrorInCompletion:ea,errorsLastStepOnCart:er,setErrorsLastStepOnCart:eo,confirmationOrder:ec}}},43361:(e,t,s)=>{s.d(t,{A:()=>m});var i=s(37876),n=s(14232),l=s(62867),a=s(80998),r=s(3789),o=s(45625),c=s(25117),d=s(46037),u=s(12212);let p={src:"/_next/static/media/liq-share-en.1091d0ce.png"},h={src:"/_next/static/media/liq-share-fr.6ab958bb.png"},m=(0,n.memo)(e=>{let{title:t="",description:s,route:m,slug:g="",image:_,selfCanonical:f=!1,overwrites:b={}}=e,{t:k}=(0,u.B)(),{domains:v,seoTitle:x,seoDescription:y,canonicalUrls:j,subdomainPrefix:N,image:C}=(e=>{let{title:t="",description:s,route:i,slug:l="",image:m}=e,{t:g,locale:_}=(0,u.B)(),{subdomain:f,organization:b}=(0,c.Z)(),{currentHost:k}=(0,o.n)(),v=(0,n.useMemo)(()=>{if(k){let e=(0,r.Bj)(k);return`https://${e}`}let e=(0,r.HU)(_);return`https://www.${e}`},[k,_]),x=(0,n.useMemo)(()=>{let e=(0,r.KV)(k||window.location.host);return{base:(0,r.HU)(_),current:(0,r.YT)(_,{keepWww:e}),fr:(0,r.YT)(d.YZ.FRENCH,{keepWww:e}),en:(0,r.YT)(d.YZ.ENGLISH,{keepWww:e})}},[_,k]),y=(0,n.useMemo)(()=>{if(!i)return{current:"/",fr:"/",en:"/"};let e=e=>{let t=g(e);return!t||t===e||t.startsWith("routes.")?"/":`/${t}`},t=e(`routes.${i}`),s=_===d.YZ.FRENCH?t:e(`routes.${i}-trans`),n=_===d.YZ.FRENCH?e(`routes.${i}-trans`):t;return{current:t,fr:s,en:n}},[i,_,g]),j=(0,n.useCallback)((e,t,s,i)=>{let n=l;for(let r of("object"==typeof l&&(n=(0,a.bT)(l,e)),[t,s,i].map(e=>e.replace(/^\//,"")))){if(!r)continue;let e=[`/${r}`,r].find(e=>n===e||n.startsWith(`${e}/`));if(e){n=n.substring(e.length);break}}return n.startsWith("/")?n:n?`/${n}`:""},[l]),N=(0,n.useMemo)(()=>{let e=`${g("meta.prefix")}${t}`;if(f&&b){let t=b.name.toLowerCase().includes("librairie")?"":g("meta.sudomain.prefix");e=`${e} | ${t}${b.name}${g("meta.suffixsubdomain")}`}else e=`${e}${g("meta.suffix")}`;return e.startsWith(" | ")?e.substring(3):e},[f,b,t,g]),C=(0,n.useMemo)(()=>s??g("meta.default_description"),[s,g]),A=(0,n.useMemo)(()=>{let e=j(_,y.current,y.fr,y.en),t=j(d.YZ.FRENCH,y.current,y.fr,y.en),s=j(d.YZ.ENGLISH,y.current,y.fr,y.en);return{current:`${y.current}${e}`.replace(/\/\//g,"/"),fr:`${y.fr}${t}`.replace(/\/\//g,"/"),en:`${y.en}${s}`.replace(/\/\//g,"/")}},[y,j,_]),T=(0,n.useMemo)(()=>{if(m&&"string"==typeof m){if(m.startsWith("http")||m.startsWith("//"))return m;let e=m.startsWith("/")?m:`/${m}`;return`${v}${e}`}let e=_!==d.YZ.FRENCH?p.src:h.src;return`${v}${e}`},[m,_,v]);return{domains:x,routes:y,seoTitle:N,seoDescription:C,canonicalUrls:A,processedSlug:j,subdomainPrefix:f?`${f}.`:x.base===x.current?"www.":"",image:T}})({title:t,description:s,route:m,slug:g,image:_}),A=v.base===v.current?"www.":"";return(0,i.jsx)(l.bV,{title:x,description:y,canonical:`https://${f?N:A}${v.current}${j.current}`,languageAlternates:[{hrefLang:"x-default",href:`https://${N}${v.fr}${j.fr}`},{hrefLang:"fr",href:`https://${N}${v.fr}${j.fr}`},{hrefLang:"en",href:`https://${N}${v.en}${j.en}`}],openGraph:{title:x,description:y,images:[{url:C,alt:x,type:"image/png"}],site_name:k("meta.default_title")},...b})})},61675:(e,t,s)=>{s.d(t,{g:()=>x,A:()=>y});var i=s(37876),n=s(14232),l=s(93153),a=s(89099),r=s(12212),o=s(79131),c=s(48732),d=s(57110),u=s(45625),p=s(21356),h=s(1648),m=s(62199),g=s(86702),_=s(69984),f=s(99142),b=s(16095),k=s(86216),v=s(34924);let x=(0,n.createContext)(),y=e=>{let{step:t,geoObj:s,children:y}=e,{t:j,locale:N}=(0,r.B)(),C=(0,a.useRouter)(),{subdomain:A,organization:T,currentBookstore:I}=(0,n.useContext)(d.t),{cart:w}=(0,n.useContext)(c.M),{cartSortingOption:P}=(0,u.n)(),{isCookieActive:O,isAuthenticated:R,currentUser:$}=(0,p.A)(),{isInstitutional:S}=(0,h.A)(),q=(0,n.useMemo)(()=>!!w?.has_digital_books,[w?.has_digital_books]),M=(0,n.useMemo)(()=>!!w?.has_digital_products,[w?.has_digital_products]),E=(0,n.useMemo)(()=>!!w?.has_physical_products,[w?.has_physical_products]),F=(0,n.useMemo)(()=>!!w?.items?.some(e=>{let{product_type:t}=e;return"giftcard_product"===t}),[w?.items]),[H,U]=(0,n.useState)(null),[D,Y]=(0,n.useState)(!1),V=(0,n.useMemo)(()=>R&&M&&!E,[R,M,E]),[G,K]=(0,n.useState)(null),[L,B]=(0,n.useState)(!1),z=(0,n.useRef)({digital_book_consent:!1,ship_to_billing_address:!0,bookstore:null,institution_id:null,telephone:null,po:null,gift_card:null,deliveries:[],bookstore_organization:null,payment_method:0,voluntary_shipping_fee:0,notes:null,shipping_intent:null}
1),[Z,W]=(0,n.useState)(z.current),[J,Q]=(0,n.useState)({email:null,telephone:null}),[X,ee]=(0,n.useState)(null),[et,es]=(0,n.useState)(null),ei=(0,n.useCallback)((e,t)=>e&&0!==e.length?e.map(e=>{let s=e.available_shipping_methods.find(e=>"store-pickup"===e.name),i=e.available_shipping_methods.find(e=>"store-pickup"!==e.name),n=("pickup"===t?s:i)||null;return{shipping_method:n?n.id:null}}):[],[]),[en,el]=(0,n.useState)(null),[ea,er]=(0,n.useState)(null),[eo,ec]=(0,n.useState)(null),[ed,eu]=(0,n.useState)(null),[ep,eh]=(0,n.useState)(null),[em,eg]=(0,n.useState)(null),[e_,ef]=(0,n.useState)([]),eb=(0,n.useMemo)(()=>w?.items?w.items.reduce((e,t)=>("book"===t.product_type?e.booksIDSArray.push(t.product_id):"product"===t.product_type?e.productsIDsArray.push(t.product_id):"giftcard_product"===t.product_type&&e.giftCardsArray.push(t),e),{booksIDSArray:[],productsIDsArray:[],giftCardsArray:[]}):{booksIDSArray:[],productsIDsArray:[],giftCardsArray:[]},[w?.items]),ek=(0,n.useCallback)(e=>{B(!0);let t=S?m._c:m.NC,s="name"===P?"name":"cart",{deliveries:i}=e;return t({...e,...i&&{deliveries:i.filter(e=>null!==e.shipping_method)},item_sort_order:s}).then(e=>{if(e&&200===e.status&&e.data){K(e.data);let t=e.data,s=ei(t.deliveries,t.shipping_intent);if(W(e=>({...e,bookstore:t.bookstore||e.bookstore||null,deliveries:s||e.deliveries||[],shipping_intent:t.shipping_intent||e.shipping_intent})),t.shipping_intent&&el(t.shipping_intent),t.shipping_intent){let e="pickup"===t.shipping_intent?t.bookstores_pickup:t.bookstores_shipping;if(null!==t.bookstore&&e&&e.length>0){let s=e.find(e=>e.id===t.bookstore);s&&er(s)}}}return e}).catch(e=>(0,v.vV)("Checkout","Error updating checkout object",e,{isInstitutional:S,itemSortOrder:P})).finally(()=>{B(!1)})},[S,P,ei]),ev=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={...Z,...e};if(s.deliveries=s.deliveries||[],s.ship_to_billing_address&&!Z.ship_to_billing_address&&(s.billpayer??null)!==null&&(s.shipping_address=s.billpayer),0===s.payment_method&&(s.payment_method=void 0),!t&&(0,k.bN)(Z,s))return Promise.resolve({status:200,data:G});W(e=>({...e,...s}));let i=s.shipping_address||s.billpayer,n=null!==s.shipping_intent;return t||V||S||i&&n?ek({...s,ship_to_billing_address:void 0}):Promise.resolve({status:200,data:G})},[Z,G,ek,V,S]),ex=(0,n.useCallback)(e=>{let t={...Z};delete t[e],W(t)},[Z]),ey=(0,n.useCallback)(e=>{Q({...J,...e})},[J]),ej=(0,n.useCallback)(()=>{W(z.current)},[z]),eN=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(el(e),et&&w){let t=(0,b.xH)(et);(0,b.RR)({event:b.bk.ADD_SHIPPING_INFO,clientType:(0,b.oV)(R,S),ecommerce:{shipping_tier:"pickup"===e?"Pickup":"Shipping",currency:"CAD",value:w.total,items:[...t]}},{},void 0,N,j)}null!==ea||null!==t?(er(t),ev({shipping_intent:e,bookstore:t?t.id:null,deliveries:[]})):ev({shipping_intent:e})},[ev,ea,et,w,R,S]),eC=(0,n.useMemo)(()=>R&&$?.email?$.email:J?.email?J.email:null,[R,$?.email,J?.email]),eA=(0,n.useMemo)(()=>null!==w&&t!==m.Tq.CART,[w,t]),eT=(0,n.useMemo)(()=>eA&&null!==G,[eA,G]),eI=(0,n.useMemo)(()=>!R||eA&&!R,[R,eA]),ew=(0,n.useMemo)(()=>eI?N:null,[eI,N]),eP=e=>({...e,province_id:e.province?.id!==void 0?e.province.id:e?.province_id??null,country_id:e.country?.id!==void 0?e.country.id:e?.country_id??null}),eO=(0,n.useCallback)(function(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];("billing"!==t||"billing"===t&&V||S)&&(e&&e.postal_code?eu(e):eu(null));let i=eP(e);if("billing"!==t||V)ev({shipping_address:i,billpayer:{...i,email:eC,language:ew},bookstore:null,deliveries:[]},s).then(e=>{if(e?.data&&!S&&null!==i.postal_code&&V){let t=null;e.data.bookstores_pickup&&e.data.bookstores_pickup.length>0?t=e.data.bookstores_pickup[0].id:e.data.bookstores_shipping&&e.data.bookstores_shipping.length>0&&(t=e.data.bookstores_shipping[0].id),ev({shipping_address:i,billpayer:{...i,email:eC,language:ew},bookstore:t},s)}else if(e?.data&&null===e.data.bookstore&&e.data.shipping_intent){let t="pickup"===e.data.shipping_intent?e.data.bookstores_pickup:e.data.bookstores_shipping;t&&t.length>0&&ev({shipping_address:i,billpayer:{...i,email:eC,language:ew},bookstore:t[0].id},s)}});else{let e=Z.shipping_address;S&&(Z.ship_to_billing_address||!e)&&(e=i),ev({shipping_address:e,billpayer:{...Z.billpayer,...i,email:eC,language:ew}},s)}},[eC,ew,Z,V,S,ev]),eR=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];er(e);let s={bookstore:e?e.id:null};return null===e&&(s={...s,deliveries:[]}),Z?.shipping_intent==="pickup"&&Z?.voluntary_shipping_fee>0&&(s={...s,voluntary_shipping_fee:0}),ev(s,t).then(t=>{if(t?.data&&null!==t.data.bookstore){let s=ei(t.data.deliveries,Z?.shipping_intent);if(e){let s=(0,b.xH)(et);(0,b.RR)({event:b.bk.SELECT_CHECKOUT_STORE,clientType:(0,b.oV)(R,!1),ecommerce:{store_name:e.name,store_id:e.id,delivery_method:Z?.shipping_intent||"unknown",currency:"CAD",value:t.data.total,items:[...s]}},{},void 0,N,j)}if(s.length>0&&s[0].shipping_method){let[e]=t.data.deliveries,i=e.available_shipping_methods.find(e=>e.id===s[0].shipping_method);if(i){let e=(0,b.xH)(et);(0,b.RR)({event:b.bk.ADD_SHIPPING_INFO,clientType:(0,b.oV)(R,!1),ecommerce:{shipping_tier:i.label[N],currency:"CAD",value:t.data.total,items:[...e]}},{},void 0,N,j)}}}return t})},[N,Z,et,R,ev]),e$=(0,n.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];U(crypto.randomUUID()),B(!0);let t=m.IH;return S?t=m.xZ:null===G||e||(t=m.NC),ej(),t().then(async e=>{if(e&&200===e.status){let t=e.data;K(t),S&&await ev({notes:t.notes,po:t.po,bookstore:t.bookstore},!0),null!==ed&&await eO(ed,ed?.type,!0),null!==ea&&await eR(ea,!0)}return e}).catch(t=>(0,v.vV)("Checkout","Error fetching checkout object",t,{isInstitutional:S,force:e})).finally(()=>{B(!1)})},[G,S,ev,ej,ed,eO,ea,eR]),eS=(0,n.useCallback)(()=>{let e=null;null!=T&&(null===Z.bookstore_organization||Z.bookstore_organization!==T.id)&&(e=T.id),Z.bookstore_organization!==e&&ev({bookstore_organization:e})},[Z.bookstore_organization,T,ev]);(0,n.useEffect)(()=>{!L&&eA&&(w.is_empty||w.errors.length>0)&&null===ep&&t!==m.Tq.CONFIRMATION&&(w.is_empty&&l.oR.error(j("minicart.nothingtoshow")),C.push({pathname:`/${j("routes.cart")}`},"",{scroll:!1,shallow:!1}))},[j,eA,L,t,w,ep,C]),(0,n.useEffect)(()=>{eA&&!w.is_empty&&O&&null===ep&&null===G&&!L?e$():eA||null===G||(eh(null),K(null))},[eA,w,O,ep,G,e$,L]),(0,n.useEffect)(()=>
1{if(eA&&!w.is_empty){let{booksIDSArray:e,productsIDsArray:t,giftCardsArray:s}=eb,i=e.sort().toString()+t.sort().toString();i!==X&&(ee(i),(0,f.wY)(e,t,"cart",{currentBookstore:I,organization:T,subdomain:A}).then(e=>{e.giftcard_product=s,es(e);let t=(0,b.xH)(e);(0,b.RR)({event:b.bk.BEGIN_CHECKOUT,clientType:(0,b.oV)(R,S),ecommerce:{currency:"CAD",value:w.total,items:[...t]}},{},void 0,N,j)}))}},[eA,w,eb,X,I,R,S,T,A]);let eq=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shipping";S||V?"billing"===e.type&&eO(e,"billing"):e.type===t&&("shipping"===t?eO(e,"shipping"):ev({billpayer:{...eP(e),email:eC,language:ew}}))},[V,S,eO,ev,eC,ew]),eM=(0,n.useCallback)(function(){let{skipSelectedUpdate:e=!1,typeForUpdate:t="shipping"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,g.tS)({isInstitutional:S}).then(s=>{if(!Array.isArray(s))return;if(ec(s),0===s.length)return void eu(null);if(e)return;let i=S||V?(0,_.Uk)(s,e=>"billing"===e.type):(0,_.Uk)(s,e=>e.type===t);i&&eq(i,t)}).catch(()=>{})},[S,V,eq]),eE=(0,n.useCallback)(function(e){let{skipSelectedUpdate:t=!1,typeForUpdate:s="shipping"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ec(t=>{let s=t??[];return s.some(t=>t.id===e.id)?s.map(t=>t.id===e.id?e:t):[...s,e]}),t||eq(e,s)},[eq]),eF=(0,n.useCallback)(e=>{let{id:t,type:s}=e,i=(eo??[]).filter(e=>e.id!==t);if(ec(i),eu(e=>e?.id===t?(0,_.Uk)(i,e=>e.type===s)??null:e),Z.billpayer?.id===t){let e=(0,_.Uk)(i,e=>"billing"===e.type);ev({billpayer:e?eP(e):null})}},[eo,Z.billpayer,ev]);(0,n.useEffect)(()=>{eA&&R&&null===eo&&eM()},[eA,R,eo]),(0,n.useEffect)(()=>{eT&&eS()},[eT]);let[eH,eU]=(0,n.useState)(!1),eD=(0,n.useMemo)(()=>S?[m.Tq.CART,m.Tq.PO,m.Tq.REVISION,m.Tq.CONFIRMATION]:V?[m.Tq.CART,m.Tq.PAYMENT,m.Tq.CONFIRMATION]:[m.Tq.CART,m.Tq.PICKUP_OR_SHIPPING,m.Tq.PAYMENT,m.Tq.CONFIRMATION],[S,V]),eY=(0,n.useMemo)(()=>({geoObj:s,currentStep:t,stepsOrder:eD,isStepBlocked:eH,setIsStepBlocked:eU,haveDigitalBooks:q,haveDigitalProducts:M,havePhysicalProducts:E,haveGiftCardProducts:F,completeCartItems:et,isCheckoutLoading:L,setIsCheckoutLoading:B,isInstantCheckout:V,isCheckoutLocked:D,setIsCheckoutLocked:Y,checkoutObject:G,getCheckoutObject:e$,checkoutIdempotencyKey:H,checkoutForm:Z,updateCheckoutForm:ev,deleteInCheckoutForm:ex,checkoutExtraForm:J,updateCheckoutExtraForm:ey,bookstoreMethod:en,setBookstoreMethod:el,updateShippingIntent:eN,selectedBookstore:ea,updateSelectedBookstore:eR,isGuestCheckout:eI,userAddresses:eo,setUserAddresses:ec,selectedAddress:ed,updateSelectedAddress:eO,refreshUserAddresses:eM,applySavedAddress:eE,removeSavedAddress:eF,setDefaultOrganization:eS,errorInCompletion:em,setErrorInCompletion:eg,errorsLastStepOnCart:e_,setErrorsLastStepOnCart:ef,confirmationOrder:ep,setConfirmationOrder:eh}),[t,eD,eH,s,eA,L,V,D,G,Z,J,en,ea,eI,eo,ed,em,e_,ep,et,M,E,F,H]);return(0,i.jsx)(x.Provider,{value:eY,children:(0,i.jsx)(o.A,{currentStep:t,checkoutObject:G,isCheckoutStarted:eA,children:y})})}},62199:(e,t,s)=>{s.d(t,{IH:()=>l,J5:()=>c,NC:()=>a,Sv:()=>p,Tq:()=>n,U8:()=>u,_c:()=>o,b:()=>g,vt:()=>h,wF:()=>d,xZ:()=>r});var i=s(46565);let n={CART:"panier",CONFIRMATION:"confirmation",PICKUP_OR_SHIPPING:"cueillette-ou-livraison",PAYMENT:"paiement",PO:"bon-de-commande",REVISION:"revision"},l=async()=>await i.A.get("checkout",{withCredentials:!0}),a=async e=>await i.A.put("checkout",e,{withCredentials:!0}),r=async()=>await i.A.get("checkout/institutional",{withCredentials:!0}),o=async e=>await i.A.put("checkout/institutional",e,{withCredentials:!0}),c=async()=>await i.A.get("payment/methods",{withCredentials:!0}),d=async()=>await i.A.get("payment/client-token",{withCredentials:!0}),u=async()=>await i.A.get("payment/cards",{withCredentials:!0}),p=async e=>await i.A.delete(`/payment/cards/${e}`,{withCredentials:!0}),h=async e=>await i.A.post("payment/retry",e,{withCredentials:!0}),m=e=>e?{country:e.country_id??null,province:e.province_id??null,language:e.language??null}:null,g=e=>e&&"object"==typeof e?{bookstore:e.bookstore??null,bookstoreOrganization:e.bookstore_organization??null,institutionId:e.institution_id??null,paymentMethod:e.payment_method??null,paymentKind:(e=>e?e.token?"saved-card":e.nonce?"new-card":"none":"none")(e.payment),saveC
1ard:!!e.payment?.save_card_in_braintree,shippingIntent:e.shipping_intent??null,shipToBillingAddress:e.ship_to_billing_address??null,deliveryCount:Array.isArray(e.deliveries)?e.deliveries.length:0,hasGiftCard:!!e.gift_card,hasPurchaseOrder:!!e.po,hasNotes:!!e.notes,digitalBookConsent:!!e.digital_book_consent,voluntaryShippingFee:e.voluntary_shipping_fee??null,affiliateId:e.affiliate_id??e.legacy_affiliate_id??null,billpayerRegion:m(e.billpayer),shippingRegion:m(e.shipping_address)}:null},79131:(e,t,s)=>{s.d(t,{A:()=>p,Q:()=>u});var i=s(37876),n=s(14232),l=s(21356),a=s(1648),r=s(8866),o=s(62199),c=s(34924),d=s(7367);let u=(0,n.createContext)(),p=e=>{let{children:t,checkoutObject:s,isCheckoutStarted:p}=e,{isAuthenticated:h}=(0,l.A)(),{isInstitutional:m}=(0,a.A)(),[g,_]=(0,n.useState)(null),[f,b]=(0,n.useState)([]),[k,v]=(0,n.useState)(!1),[x,y]=(0,n.useState)(),[j,N]=(0,n.useState)(null),[C,A]=(0,n.useState)({save_card_in_braintree:0,nonce:void 0,token:void 0,bin:null}),[T,I]=(0,n.useState)(!1),{setAutoCancelTimeout:w,clearAutoCancelTimeout:P}=(0,r.A)(),O=(0,n.useCallback)(e=>{A(t=>(e.nonce?(void 0===t.nonce||t.nonce!==e.nonce)&&w(()=>{N(null),R()},72e5):P(),{...t,...e}))},[]),R=()=>{P(),A({save_card_in_braintree:0,nonce:void 0,token:void 0,bin:null})};(0,n.useEffect)(()=>{k||null===s||null===p||!h||m||(v(!0),(0,o.U8)().then(e=>{if(void 0!==e&&200===e.status&&e.data&&(b(e.data),e.data.length>0)&&void 0!==s.available_payment_methods.find(e=>"braintree"===e.gateway)){let t=e.data.find(e=>!0===e.default&&!e.expired);void 0!==t&&null===g&&(O({nonce:void 0,token:t.token}),_(t),N(null))}}).catch(e=>{e.response?.status!==d.gx.NOT_FOUND&&(0,c.vV)("Payment","Error fetching saved payment cards",e,{isAuthenticated:h,isInstitutional:m})}))},[s,p,k,g,h,m,O]);let $=(0,n.useMemo)(()=>({currentCard:g,setCurrentCard:_,customerCards:f,currentlyViewing:x,setCurrentlyViewing:y,selectedPaymentMethod:j,setSelectedPaymentMethod:N,paymentForm:C,updatePaymentForm:O,cleanPaymentForm:R,postFinalLoading:T,setPostFinalLoading:I}),[g,f,x,j,C,T]);return(0,i.jsx)(u.Provider,{value:$,children:t})}},97134:(e,t,s)=>{s.d(t,{A:()=>F});var i=s(37876),n=s(14232),l=s(61675),a=s(33280),r=s(12212),o=s(62199),c=s(42940),d=s(1648),u=s(21468),p=s(75975);let h=()=>{let{t:e}=(0,r.B)(),{isInstitutional:t}=(0,d.A)(),{currentStep:s,currentStepNumber:l,getStepNumber:a,isInstantCheckout:h}=(0,c.A)(),m=s===o.Tq.CONFIRMATION,g=(0,n.useMemo)(()=>{let i=`/${e("routes.checkout")}`,n={[o.Tq.CART]:{href:`/${e("routes.cart")}`,icon:"stepper-bag"},[o.Tq.PO]:{href:`${i}/${o.Tq.PO}`,icon:"stepper-store"},[o.Tq.REVISION]:{href:`${i}/${o.Tq.REVISION}`,icon:"stepper-invoice"},[o.Tq.PICKUP_OR_SHIPPING]:{href:`${i}/${o.Tq.PICKUP_OR_SHIPPING}`,icon:"stepper-shipping"},[o.Tq.PAYMENT]:{href:`${i}/${o.Tq.PAYMENT}`,icon:"stepper-card"},[o.Tq.CONFIRMATION]:{href:`${i}/${o.Tq.CONFIRMATION}`,icon:"stepper-confirm"}},r=[{step:o.Tq.CART,...n[o.Tq.CART],title:e("checkout.stepper.bag")}];return t?r=[...r,{step:o.Tq.PO,...n[o.Tq.PO],title:e("checkout.stepper.po")},{step:o.Tq.REVISION,...n[o.Tq.REVISION],title:e("checkout.stepper.revision")}]:(h||r.push({step:o.Tq.PICKUP_OR_SHIPPING,...n[o.Tq.PICKUP_OR_SHIPPING],title:e("checkout.stepper.shipping")}),r.push({step:o.Tq.PAYMENT,...n[o.Tq.PAYMENT],title:e("checkout.stepper.payment")})),r.push({step:o.Tq.CONFIRMATION,...n[o.Tq.CONFIRMATION],title:e("checkout.stepper.confirm")}),r.map((e,t)=>({...e,isActive:l>=a(e.step),isCurrent:e.step===s,index:t+1}))},[e,t,h,s,l,a]),_=(0,n.useCallback)(e=>{m&&e.preventDefault()},[m]),f=(0,n.useMemo)(()=>{let e=["stepper"];return m&&e.push("stepper--disabled"),t&&e.push("stepper--insti"),h&&e.push("stepper--instant"),e.join(" ")},[m,t,h]);return(0,i.jsx)("nav",{className:f,"aria-label":e("checkout.stepper.navigation"),children:(0,i.jsx)("ol",{children:g.map(e=>{let{href:t,title:s,icon:n,isActive:l,isCurrent:a,index:r}=e;return(0,i.jsx)("li",{className:`${l?"active":""}${a?" current":""}`,"aria-current":a?"step":void 0,children:(0,i.jsxs)(p.A,{href:t,title:s,onClick:_,"aria-label":`${r}: ${s}`,tabIndex:m?-1:0,children:[(0,i.jsx)("div",{className:"stepper-icon","aria-hidden":"true",children:(0,i.jsx)(u.A,{value:n})}),(0,i.jsxs)("div",{className:"stepper-title",children:[(0,i.jsxs)("span",{className:"d-none d-sm-inline",children:[r,"."]}),"\xa0",s]})]})},s)})})})};var m=s(98719),g=s(54154),_=s(21356),f=s(25117);let b=function(){let{logoOnly:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{t}=(0,r.B)(),{isLoading:s}=(0,_.A)(),{subdomain:n,organization:l}=(0,f.Z)(),{currentStep:a}=(0,c.A)(),d={};n&&l&&(d={borderTop:`5px solid ${l.color_background}`});let u=(0,i.jsx)(m.A,{});return e?(0,i.jsx)("div",{style:d,children:(0,i.jsx)("header",{className:"checkout-header",children:(0,i.jsxs)("div",{className:"row g-0 w-100 align-items-end justify-content-between",children:[(0,i.jsx)("div",{className:"col-6 col-md-6 col-lg-2",children:u}),(0,i.jsxs)("div",{className:"col-6 col-lg-3 col-md-6  d-flex flex-column flex-sm-row flex-wrap justify-content-end order-2 order-md-2 a-right top-link",children:[(0,i.jsx)(p.A,{href:"/",className:"link link--forest link--underline mb-2 me-0 me-sm-2",children:t("minicart.quitselection")}),(0,i.jsx)("div",{className:"mb-2",children:(0,i.jsx)(g.A,{})})]})]})})}):(0,i.jsx)("div",{style:d,children:(0,i.jsx)("header",{className:"checkout-header",children:(0,i.jsxs)("div",{className:"row g-0 w-100 align-items-end",children:[(0,i.jsx)("div",{className:"col-6 col-md-6 col-lg-2",children:u}),(0,i.jsx)("div",{className:"col-md-12 col-lg-8 order-md-3 order-3 order-lg-2",children:!s&&(0,i.jsx)(h,{})}),(0,i.jsx)("div",{className:"col-6 col-lg-2 col-md-6  d-flex justify-content-end order-2 order-md-2 a-right top-link",children:a!==o.Tq.CONFIRMATION?(0,i.jsx)(p.A,{href:`/${t("routes.catalog")}`,className:"link link--forest link--underline",children:t("minicart.addmoreitems")}):(0,i.jsx)(p.A,{href:"/",className:"link link--forest link--underline",children:t("minicart.gotohomepage")})})]})})})};var k=s(96010),v=s(48732),x=s(8440),y=s(56720),j=s(89099),N=s(93153),C=s(11944),A=s.n(C);let T=(0,n.memo)(e=>{let{name:t,children:s,className:n="",indent:l=!1,linkClassName:a="link link--c-forest link--underline",onClick:r=null}=e,o=e=>{r&&(e.preventDefault(),r(e))},c=()=>r?(0,i.jsx)("a",{className:a,onClick:o,href:"#",role:"button",tabIndex:0,children:t}):t,d=l?(0,i.jsx)("ul",{className:"mb-0",children:(0,i.jsx)("li",{children:c()})}):c();return(0,i.jsxs)("div",{className:`row ${n}`,children:[(0,i.jsx)("div",{className:"col-6 summary-checkout__content__text",children:d}),(0,i.jsx)("div",{className:"col-6 d-flex justify-content-end summary-checkout__content__text",children:s})]})});var I=s(37908),w=s(30402),P=s(29780),O=s(2847),R=s(70396);let $=()=>{let{t:e}=(0,r.B)(),t=(0,j.useRouter)(),{isInstitutional:s}=(0,d.A)(),{checkoutObject:l,checkoutForm:a,bookstoreMethod:h,isInstantCheckout:m,isCheckoutLoading:g,stepsOrder:_,currentStep:f,currentStepNumber:b,getStepNumber:k,stepsValidity:v,finalizeCheckout:C,errorInCompletion:$}=(0,c.A)(),{cart:S,refreshCart:q}
1=(0,R._)(),[M,E]=(0,n.useState)(!1),F=(0,n.useMemo)(()=>l?.deliveries&&l.deliveries.length>1,[l]),H=k(o.Tq.PICKUP_OR_SHIPPING),U=(0,n.useMemo)(()=>!m&&a.deliveries.length>0&&l&&l.deliveries.length>0&&l.deliveries.some((e,t)=>e?.available_shipping_methods.some(e=>a.deliveries[t]&&e.id===a.deliveries[t].shipping_method)&&!e.available_shipping_methods.some(e=>a.deliveries[t]&&"store-pickup"===e.name&&e.id===a.deliveries[t].shipping_method)),[m,l,a]),D=(0,n.useMemo)(()=>v?.[f],[v,f]),Y=(0,n.useCallback)(()=>{E(!0),q(!0).then(s=>{s?.errors?.length===0&&t.push({pathname:`/${e("routes.checkout")}/${_[b]}`})}).catch(()=>{N.oR.error(e("utils.error"))}).finally(()=>{E(!1)})},[q,t,e,_,b]),V=0,G=0,K=0,L=0;null!==S&&(K=S.item_count,V=S.total,G=S.discounted_total);let B=(0,n.useMemo)(()=>b<_.length?_[b]:o.Tq.CONFIRMATION,[_,b]),z=(0,n.useMemo)(()=>f===o.Tq.CART,[f]),Z=(0,n.useMemo)(()=>{let e=S?.items;return!F&&l&&l.deliveries&&l.deliveries.length>0&&(e=l.deliveries[0].items),!!e&&e.length>0&&e.every(e=>"giftcard_product"===e.product_type)},[S,l,F]);!z&&l&&l.sales_tax&&(L=l.sales_tax.total);let W=null;z||(W=(0,i.jsx)(T,{name:(0,i.jsxs)(i.Fragment,{children:[b<=H&&!s?e("checkout.taxesestimated"):e("checkout.taxes"),"\xa0"]}),children:e("utils.price",{price:L})}));let J=null;J=z?(0,i.jsx)("button",{type:"button",className:"btn btn--raised btn--raised--tomato mb-2 w-100",disabled:M,onClick:Y,children:e("checkout.gotonextstep")}):B===o.Tq.CONFIRMATION?(0,i.jsx)(p.A,{href:`/${e("routes.checkout")}/${B}`,passHref:!0,className:`btn btn--raised btn--raised--tomato mb-2 w-100 ${g?"disabled":""}`,onClick:C,children:e("checkout.finalize")}):(0,i.jsx)(p.A,{href:`/${e("routes.checkout")}/${B}`,passHref:!0,className:`btn btn--raised btn--raised--tomato mb-2 w-100 ${g?"disabled":""}`,style:{pointerEvents:g?"none":"all"},children:e("checkout.gotonextstep")});let Q=null;if(l?.coupon&&0!==l.coupon.value){let t=l.coupon.details?.number?` - ${l.coupon.details.number}`:"";Q=(0,i.jsx)(T,{name:(0,i.jsxs)(i.Fragment,{children:[e("account.modal.promo.active"),t]}),children:e("utils.price",{price:l.coupon.value})})}let X=null;l?.giftcard_usage&&0!==l.giftcard_usage.length&&(X=(0,i.jsx)(i.Fragment,{children:l.giftcard_usage.map(t=>{let{id:s,title:n,amount:l}=t;return(0,i.jsx)(T,{name:(0,i.jsxs)(i.Fragment,{children:[e("staticpages.giftcard.title")," - ",n]}),children:e("utils.price",{price:l>0?-1*l:l})},`giftcard-${s}`)})}));let ee=null;if(l&&(f===o.Tq.PICKUP_OR_SHIPPING&&l?.voluntary_shipping_fee>0||b>H)&&U){let t=null;b>H&&(t=()=>(0,O.YJ)("checkout-donation")),ee=(0,i.jsx)(T,{name:e("checkout.contribution"),indent:!F,onClick:t,children:e("utils.price",{price:l?.voluntary_shipping_fee||0})})}let et="",es=D?J:(0,i.jsx)("button",{type:"button",className:"btn btn--raised btn--raised--tomato mb-2 w-100 disabled",disabled:!0,children:B!==o.Tq.CONFIRMATION?e("checkout.gotonextstep"):e("checkout.finalize")});if(z)et=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T,{name:e("checkout.items",{count:K}),children:(0,i.jsx)(w.A,{price:V.toFixed(2),discountedPrice:G})}),W,(0,i.jsxs)("div",{className:"row summary-checkout__subtotal summary-checkout__subtotal--darker",children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)("span",{className:"headline headline--sub",children:"shipping"!==h||U?e("checkout.subtotal"):e("checkout.totalbeforeshipping")})}),(0,i.jsx)("div",{className:"col-6 d-flex justify-content-end",children:(0,i.jsx)("span",{className:"headline headline--sub",children:(0,i.jsx)(w.A,{price:V,discountedPrice:G})})})]})]});else if(null!==l)if(s)et=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T,{name:e("checkout.items",{count:K}),children:(0,i.jsx)(w.A,{price:V.toFixed(2),discountedPrice:G})}),W,(0,i.jsxs)("div",{className:"row summary-checkout__subtotal summary-checkout__subtotal--darker",children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)("span",{className:"headline headline--sub",children:e("checkout.totaltopay")})}),(0,i.jsx)("div",{className:"col-6 d-flex justify-content-end",children:(0,i.jsx)("span",{className:"headline headline--sub",children:e("utils.price",{price:l.total})})})]})]});else{let t=null;
1t="shipping"===h?U?e("checkout.totalwithshipping"):e("checkout.totalbeforeshipping"):f===o.Tq.PICKUP_OR_SHIPPING?e("checkout.subtotal"):e("checkout.totaltopay");let n=l?.deliveries?l.deliveries[0]:void 0;et=(0,i.jsx)(i.Fragment,{children:F?(0,i.jsxs)(i.Fragment,{children:[l.deliveries.map((t,n)=>(0,i.jsxs)("div",{className:"mb-2",children:[(0,i.jsx)(T,{name:(0,i.jsx)("strong",{className:"strong--c-tomato",children:e("utils.bookstore_with_number",{number:n+1})}),className:"summary-checkout__content__logo",children:t?.bookstore?.logo_url&&(0,i.jsx)(I.A,{src:t?.bookstore?.logo_url,alt:t?.bookstore?.name})}),(0,i.jsx)(T,{name:(0,i.jsx)("strong",{className:"strong--c-forest",children:t?.bookstore?.name})}),(0,i.jsx)(T,{name:e("checkout.items",{count:t.items.length}),children:e("utils.price",{price:t.subtotal})}),U&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(T,{name:e("checkout.ship"),children:0===(t.shipping_fee?.value||0)?e("checkout.free",{gender:"feminine"}):e("utils.price",{price:t.shipping_fee?.value})})}),(0,i.jsx)(T,{name:(0,i.jsxs)(i.Fragment,{children:[b<=H&&!s?e("checkout.taxesestimated"):e("checkout.taxes"),"\xa0"]}),children:e("utils.price",{price:t.sales_tax.total})}),(0,i.jsxs)("div",{className:`row summary-checkout__subtotal ${l.deliveries.length-1!==n?"border-bottom pb-1 mb-4":""}`,children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)("span",{className:"headline headline--sub",children:e("checkout.subtotal")})}),(0,i.jsx)("div",{className:"col-6 d-flex justify-content-end",children:(0,i.jsx)("span",{className:"headline headline--sub",children:e("utils.price",{price:Number(t.total)})})})]})]},"row-split-"+n)),null!==Q||null!==X||null!==ee?(0,i.jsxs)("div",{className:"summary-checkout__extra summary-checkout__extra--darker",children:[Q,X,ee]}):null,(0,i.jsxs)("div",{className:"row summary-checkout__subtotal summary-checkout__subtotal--darker",children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)("span",{className:"headline headline--sub",children:t})}),(0,i.jsx)("div",{className:"col-6 d-flex justify-content-end",children:(0,i.jsx)("span",{className:"headline headline--sub",children:void 0===l.deliveries.find(e=>null===e.shipping_method_id)?e("utils.price",{price:l.total}):e("utils.price",{price:l.total_before_shipping})})})]})]}):(0,i.jsxs)(i.Fragment,{children:[n&&!Z&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T,{name:(0,i.jsx)("strong",{className:"strong--c-tomato",children:e("utils.bookstore")}),className:"summary-checkout__content__logo",children:n?.bookstore?.logo_url&&(0,i.jsx)(I.A,{src:n?.bookstore?.logo_url,alt:n?.bookstore?.name})}),(0,i.jsx)(T,{name:(0,i.jsx)("strong",{className:"strong--c-forest",children:n?.bookstore?.name})})]}),(0,i.jsx)(T,{name:e("checkout.items",{count:K}),children:e("utils.price",{price:V})}),Q,U&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(T,{name:e("checkout.ship"),children:0===(n?.shipping_fee?.value||0)?e("checkout.free",{gender:"feminine"}):e("utils.price",{price:n?.shipping_fee?.value})})}),ee,W,X,(0,i.jsxs)("div",{className:"row summary-checkout__subtotal",children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)("span",{className:"headline headline--sub",children:t})}),(0,i.jsx)("div",{className:"col-6 d-flex justify-content-end",children:(0,i.jsx)("span",{className:"headline headline--sub",children:e("utils.price",{price:l.total})})})]})]})})}let ei=null;return!z&&null!==$&&(!0===$.advanced?ei=(0,i.jsxs)("div",{className:"invalid-feedback d-block",children:[e("checkout.errorsubmit1"),(0,i.jsx)(x.A,{placement:"top",overlay:(0,i.jsx)(y.A,{id:"tooltip-top",children:e("checkout.errorsubmitdetails")}),children:(0,i.jsx)("span",{className:"link link--icon d-inline-block",style:{marginLeft:"6px"},children:(0,i.jsx)(u.A,{value:"questionmark"})})}),e("checkout.errorsubmit2")]}):$.message&&(ei=(0,i.jsx)("div",{className:"invalid-feedback d-block",dangerouslySetInnerHTML:{__html:A().sanitize($.message)}}))),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"summary-checkout",children:[(0,i.jsx)("div",{className:"summary-checkout__head",children:(0,i.jsxs)("h3",{className:"headline headline--block headline--margin--0",children:[e("checkout.summary"),g&&(0,i.jsx)("span",{className:"minicart__loading",children:(0,i.jsx)(u.A,{value:"loading"})})]})}),(0,i.jsx)("div",{className:"summary-checkout__content",children:et}),(0,i.jsxs)("div",{className:"summary-checkout__actions",children:[es,ei,f===o.Tq.CONFIRMATION||B===o.Tq.CONFIRMATION&&(0,i.jsxs)("p",{className:"text-center p--fs-15 mt-3",children:[(0,i.jsxs)("span",{children:[e("checkout.confirmationsummary")," "]}),(0,i.jsxs)(p.A,{href:`/${e("routes.conditions")}`,className:"link link--c-forestlight link--underline link--weight--bold",children:[" ",e("checkout.confirmationsummaryterm")]}),(0,i.jsxs)("span",{children:[" ",e("checkout.confirmationsummary2")," "]}),(0,i.jsx)(p.A,{href:`/${e("routes.conditions")}#condition-de-retour-remboursement-et-d-echange`,className:"link link--c-forestlight link--underline link--weight--bold",children:e("checkout.confirmationsummarycond")}),(0,i.jsx)(P.A,{type:U?P.b.ORDER:P.b.PICKUP})]})]})]}),null!==l&&!z&&(0,i.jsx)("div",{className:"mobile_btn_checkout",children:(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-4 d-flex justify-content-center align-items-center flex-shrink-0",children:(0,i.jsxs)("strong",{className:"strong--c-forest",children:[(0,i.jsx)("span",{className:"span--fs-14",children:"Total"}),(0,i.jsx)("br",{}),e("utils.price",{price:l.total})]})}),(0,i.jsxs)("div",{className:"col-8 d-flex align-items-center",children:[es,g&&(0,i.jsx)("span",{className:"minicart__loading",children:(0,i.jsx)(u.A,{value:"loading"})})]})]})})]})};var S=s(21044),q=s(43361);let M=e=>{let t,{children:s}=e,{t:l}=(0,r.B)(),{cart:a}=(0,n.useContext)(v.M),{isInstitutional:u}=(0,d.A)(),{currentStep:h,checkoutObject:m,confirmationOrder:g,postFinalLoading:_,errorInCompletion:f}=(0,c.A)(),b=(0,n.useMemo)(()=>u?null!==g&&null===f:null!==g&&g?.payment?.was_successful&&null===f,[u,g,f]),x=o.Tq.CART;return h!==o.Tq.CART&&(x="checkout",t=`/${h}`),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.A,{title:l("staticpages.checkout.default"),route:x,slug:t}),h===o.Tq.CONFIRMATION||b||_?(0,i.jsx)("div",{className:"container",style:{maxWidth:"1120px"},children:_||h!==o.Tq.CONFIRMATION?(0,i.jsx)(i.Fragment,{children:_?(0,i.jsx)(S.A,{title:l("checkout.final.waittitle"),message:l("checkout.final.waitmessage")}):(0,i.jsx)(k.A,{count:1,duration:2,height:250,baseColor:"#FFF5F0"})}):(0,i.jsx)(i.Fragment,{children:s})}):(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-md-8 order-md-1 order-2",children:(0,i.jsx)("div",{className:"checkout-container",children:null===a||b&&h!==o.Tq.CONFIRMATION||h!==o.Tq.CART&&null===m?(0,i.jsx)(k.A,{count:1,duration:2,height:250,baseColor:"#FFF5F0"}):(0,i.jsx)(i.Fragment,{children:a&&!a.is_empty?(0,i.jsx)(i.Fragment,{children:s}):(0,i.jsxs)("div",{children:[l("minicart.nothingtoshow"),(0,i.jsx)("br",{}),(0,i.jsx)(p.A,{href:`/${l("routes.catalog")}`,prefetch:!1,className:"link link--tomato link--underline",children:l("minicart.addmoreitems")})]})})})}),(0,i.jsx)("div",{className:"col-md-4 order-md-2 order-1",children:null!==a&&(0,i.jsx)($,{})})]})]})};var E=s(40370);let F=e=>{let{children:t,step:s}=e,r=(0,n.useCallback)(()=>{let e=document.body;window.scrollY>=550?e.classList.add("checkout-sticky"):e.classList.remove("checkout-sticky")},[]);(0,n.useEffect)(()=>{let e=new AbortController;return window.addEventListener("scroll",r,{signal:e.signal}),()=>{e.abort()}});
1let[o,c]=(0,n.useState)(null);return(0,a.A)({geoObj:o,setGeoObj:c}),(0,i.jsx)(E.A,{children:(0,i.jsx)("div",{className:"App",children:(0,i.jsxs)(l.A,{step:s,geoObj:o,children:[(0,i.jsx)(b,{}),(0,i.jsx)("section",{className:"section section--checkout",children:(0,i.jsx)("div",{className:"container",children:(0,i.jsx)(M,{children:t})})})]})})})}}}]);

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.