1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="a2e9d6d7-4924-4d13-ade7-1d3dad9df24d",e._sentryDebugIdIdentifier="sentry-dbid-a2e9d6d7-4924-4d13-ade7-1d3dad9df24d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4594],{20960:(e,s,t)=>{t.d(s,{c:()=>i});var l=t(14232),n=t(89099),d=t(48690);let i=()=>{let e=(0,n.useRouter)(),{asPath:s}=e,t=(0,l.useMemo)(()=>(0,d.ng)(s),[s]),i=(0,l.useRef)(e.query);i.current=e.query;let a=(0,l.useRef)(e.push);a.current=e.push;let r=(0,l.useRef)(e.replace);r.current=e.replace;let o=(0,l.useCallback)(function(e,s,t){let{scroll:l=!1,shallow:n=!0}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return("push"===e?a.current:r.current)({pathname:s,query:(0,d.Wl)(i.current,t)},"",{scroll:l,shallow:n})},[]),c=(0,l.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;return o("push",t,e,s)},[o,t]),u=(0,l.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;return o("replace",t,e,s)},[o,t]),m=(0,l.useCallback)(function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return o("push",e,s,t)},[o]);return(0,l.useMemo)(()=>({pushQueryUpdate:c,replaceQueryUpdate:u,pushPath:m}),[c,u,m])}},37760:(e,s,t)=>{t.d(s,{A:()=>b});var l=t(37876),n=t(14232),d=t(96010),i=t(12212),a=t(21468),r=t(97384),o=t(96232),c=t(54331),u=t(1648),m=t(42940),h=t(55513);let b=e=>{let{t:s}=(0,i.B)(),{isInstitutional:t,isInstitutionOwner:b}=(0,u.A)(),{updateCheckoutForm:p,userAddresses:k,setUserAddresses:x,selectedAddress:j,updateSelectedAddress:g,bookstoreMethod:f,updateSelectedBookstore:v,isGuestCheckout:y,isInstantCheckout:_,isCheckoutLoading:N,geoObj:A}=(0,m.A)(),[C,w]=(0,n.useState)(!1),[S,F]=(0,n.useState)(4),[O,I]=(0,n.useState)(!1),[T,E]=(0,n.useState)(null),[R,B]=(0,n.useState)(!1),[D,$]=(0,n.useState)(!1),M=function(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;I(e),E(t),B(s),$(!0)},z=null,P=null;if(P=s(_?"checkout.address.billing":"pickup"===f?"checkout.address.localize":t?"checkout.address.billing":"checkout.address.where"),y)if(null===k||!0===C){let t="";t=s("shipping"===f?"checkout.address.where":"checkout.address.localize"),z=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h4",{className:"headline headline--sub mb-4 me-2",children:t}),e.geoObj&&(0,l.jsx)(r.A,{geoObj:A,addressUpdater:e=>{x([e]),g(e),p({shipping_address:e,billpayer:{...e,email:userDataGuest.email}}).then(e=>{let s="pickup"===f?e.data.bookstores_pickup:e.data.bookstores_shipping;s.length>0&&v(s[0]),w(!1)})},isGuestCheckout:y,type:"shipping",mode:"add",prefillData:y&&k?k[0]:void 0}),(0,l.jsxs)("div",{className:"d-flex justify-content-end",children:[k&&(0,l.jsx)("button",{className:"btn btn--outline btn--outline--forest btn--small me-2",onClick:()=>w(!1),children:s("utils.cancel")}),(0,l.jsx)("button",{className:"btn btn--raised btn--small btn--raised--tomato",type:"submit",form:"add-address-form",children:s("utils.save")})]})]})}else z=k&&!0!==C?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-12",children:(0,l.jsxs)("div",{className:"checkout-selectedshippingaddress",children:[(0,l.jsxs)("div",{className:"checkout-selectedbookstore__head d-flex mb-3 align-items-baseline",children:[(0,l.jsx)("h4",{className:"headline headline--sub mb-0 me-2",children:s("shipping"===f?"checkout.address.where":"checkout.address.localize")}),(0,l.jsx)("button",{className:"link link--c-forestlight link--underline mb-0 link--weight--bold",onClick:()=>w(!0),children:s("utils.modify")})]}),(0,l.jsx)("div",{className:"checkout-selectedshippingaddress__content",children:(0,l.jsx)("p",{className:"p--c-forestlight p",children:(0,l.jsx)(c.A,{address:k[0],geoObj:A})})})]})})})}):(0,l.jsx)(d.A,{count:1,duration:2,height:120,baseColor:"#FFF5F0"});else{let n=[],d=0;null!==k&&(n=k.filter(s=>s.type===e.typeOfAddress),d=k&&null!==k?n.length:0),d>S&&(n=n.slice(0,S));let i=!0;t&&!b&&(i=!1),z=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"checkout-box__head d-flex flex-wrap align-items-center justify-content-between ",children:[(0,l.jsx)("h4",{className:"headline headline--sub mb-2 pe-4",children:P}),i&&(0,l.jsxs)("button",{className:"p-0 link ms-auto link--tomato link--weight--bold mb-2 d-flex align-items-center","aria-label":s(`checkout.address.add${e.typeOfAddress}`),onClick:()=>M("add",e.typeOfAddress),children:[s("checkout.address.add"),"\xa0",(0,l.jsx)(a.A,{value:"plus-bigger"})]})]}),(0,l.jsx)("div",{children:(0,l.jsx)(o.A,{addressQty:d,defaultMax:4,listOfAddresses:n,selectedAddress:j,setMaxShow:F,scope:e.typeOfAddress,geoObj:A,readOnly:N,onChange:s=>{g(s,e.typeOfAddress)},onUpdate:e=>M("update",e.type,e),onRemove:e=>M("remove",e.type,e)})}),(0,l.jsx)("div",{className:`${4!==S&&d>4?"":"d-none"} `,children:(0,l.jsxs)("button",{className:"link link--underline link--forest link--weight--bold d-flex align-items-center mb-2 btn--show-less",onClick:()=>F(e=>e-4),children:[s("checkout.address.seelessaddress"),"\xa0",(0,l.jsx)(a.A,{value:"chevron-up"})]})}),(0,l.jsx)("div",{className:`${d>S?"":"d-none"}`,children:(0,l.jsxs)("button",{className:"link link--underline link--forest link--weight--bold d-flex align-items-center btn--show-more",onClick:()=>F(e=>e+4),children:[s("checkout.address.seemoreaddress"),"\xa0",(0,l.jsx)(a.A,{value:"chevron-down"})]})})]})}return(0,l.jsxs)(l.Fragment,{children:[e.nobox?(0,l.jsx)(l.Fragment,{children:z}):(0,l.jsx)("div",{className:`checkout-box${e.focus?" checkout-box--focused":" "} ${e.className??""}`,id:"address",children:z}),(0,l.jsx)(h.A,{mode:O,address:T,type:R,open:D,onClose:()=>$(!1)})]})}},41695:(e,s,t)=>{t.d(s,{A:()=>j});
1var l=t(37876),n=t(14232),d=t(12212),i=t(25166),a=t(99142),r=t(16095),o=t(96984),c=t(42940),u=t(45625),m=t(21356),h=t(1648),b=t(65626),p=t(21468),k=t(65975),x=t(48992);let j=e=>{let{t:s,locale:t}=(0,d.B)(),{cartSortingOption:j}=(0,u.n)(),{isAuthenticated:g}=(0,m.A)(),{isInstitutional:f}=(0,h.A)(),{getCheckoutObject:v}=(0,c.A)(),y=e.data.items,_=e.allItems,[N,A]=(0,n.useState)(!1),{testBeforeSend:C,removeItem:w,setAlert:S,moveItemToBookmarks:F}=(0,o.U)(e),O=(0,n.useMemo)(()=>"checkoutObj"===e.from?(0,a.HD)(y,null,j,!0):(0,a.HD)(y,_,j,!1),[y,j,e.from,_]),[I,T]=(0,n.useState)(null),[E,R]=(0,n.useState)(null),[B,D]=(0,n.useState)(!1),$=()=>{D(!0)},M=()=>{D(!1)},z=(t,n,d)=>{R((0,l.jsx)("h2",{className:"modal__title",children:s("minicart.popupconfirm",{name:t})})),T((0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mr-2",children:(0,l.jsx)("button",{className:"btn btn--outline btn--small btn--outline--forest",onClick:M,children:s("minicart.popupcancel")})}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{className:"btn btn--raised btn--small btn--raised--tomato",onClick:()=>P(t,n,d,e.inPage),children:s("minicart.popupremove")})})]})),$()},P=(e,l,n)=>{M(),null!==document.getElementById("product-cart-"+l)&&(document.getElementById("product-cart-"+l).style.display="none"),S({name:e,id:l,position:n},"remove","cart",null),w(e,l).then(()=>{v(!0);let e=(0,r.xH)(_).find(e=>void 0!==e.product_type?e.product_id===l:e.id===l);e&&(0,r.RR)({event:r.bk.REMOVE_FROM_CART,clientType:(0,r.oV)(g,f),ecommerce:{currency:"CAD",value:void 0!==e.product_type?e.attributes.value:e.price,items:[e]}},{},void 0,t,s)})},V=async(e,s,t,l)=>{await C(e,s,t,l),setTimeout(()=>v(!0),250)},H="";return H="checkoutObj"===e.from?(0,l.jsxs)(l.Fragment,{children:[O.slice(0,N?O.length:3).map((n,d)=>{let r=n.product_type,o=!0;"giftcard_product"!==r&&"book"===r&&(o=!b.TQ.includes(n.product_attributes?.book_format));let c=(0,a.jA)(r,n,t,s);if("book"===r&&_?.books){let e=_.books.find(e=>e.id===n.product_id);e&&(c={...c,original:e})}let u=null;if(void 0!==e.cartErrors&&0!==e.cartErrors.length){let d=e.cartErrors.find(e=>e.cart_item===n.id);if(void 0!==d){let e=c.is_print_on_demand||!1;u=(0,l.jsx)("div",{className:"cart-error mt-2",children:(0,l.jsx)(k.A,{type:"danger",message:(0,l.jsxs)(l.Fragment,{children:[d.message[t]," ",e&&s("minicart.pod_institutional_contact")," ",s("minicart.errorsplease")]}),size:"small",icon:"danger"})})}}return(0,l.jsx)(i.A,{lockValues:e.lockValues,index:d,itemCartID:n.id,itemToShow:c,inPage:"checkout",canAddMoreThenOne:o,testBeforeSend:V,moveItemToBookmarks:F,removeItemFromCart:z,customError:u,onStatus:e.onStatus,bookstoreId:e.bookstoreId},"checkoutcartitem-"+n.product_id+"-"+n.id)}),(0,l.jsx)("div",{children:O.length>3?(0,l.jsxs)("button",{onClick:()=>{A(!N)},className:"link link--forest link--weight--bold d-flex align-items-center mb-2",children:[N?s("checkout.listitemseeless",{count:O.length}):s("checkout.listitemmoreless",{count:O.length}),(0,l.jsx)("span",{"aria-hidden":"true",children:(0,l.jsx)(p.A,{value:N?"chevron-up":"chevron-down"})})]}):""})]}):(0,l.jsxs)(l.Fragment,{children:[O&&null!==(_&&(_.products||_.books))?O.slice(0,N?O.length:3).map((n,d)=>{let r=n.product_type,o=null,c=null,u=!0;if("giftcard_product"!==r){if("book"===r?c=_.books:"product"===r&&(c=_.products),null==c)return null;o=c.find(e=>e.id===n.product_id),"book"===r&&o&&(u=!b.TQ.includes(o.book_format))}let m=(0,a.k1)(r,o,n,t,s);return(0,l.jsx)(i.A,{lockValues:e.lockValues,itemToShow:m,itemCartID:n.id,index:d,inPage:"checkout",canAddMoreThenOne:u,testBeforeSend:C,moveItemToBookmarks:F,removeItemFromCart:z,customError:null},"checkoutcartitem-"+n.product_id+"-"+n.id)}):null,(0,l.jsx)("div",{children:O.length>3?(0,l.jsxs)("button",{onClick:()=>{A(!N)},className:"link link--forest link--weight--bold d-flex align-items-center mb-2",children:[N?s("checkout.listitemseeless",{count:O.length}):s("checkout.listitemmoreless",{count:O.length}),"\xa0",(0,l.jsx)("span",{"aria-hidden":"true",children:(0,l.jsx)(p.A,{value:N?"chevron-up":"chevron-down"})})]}):""})]}),(0,l.jsxs)("div",{className:"minicart--inpage",children:[(0,l.jsxs)("div",{className:"minicart__content",children:[(0,l.jsx)("div",{className:`checkoutpage-header ${e.isBigTitle?"checkoutpage-header--borderb":""}`,children:e.isBigTitle?(0,l.jsx)("h2",{className:"headline headline--block headline--margin--0",children:O?s("checkout.items",{count:e.itemCount||0}):0}):(0,l.jsx)("h4",{className:"headline headline--sub mb-0 me-2",children:s("checkout.items",{count:e.itemCount})})}),(0,l.jsx)("div",{id:"minicart-content",children:H})]}),(0,l.jsx)(x.A,{show:B,onShow:$,onHide:M,footer:!0,footerContent:I,backdrop:"static",header:!1,headerContent:null,title:!1,className:"modal-dialog modal-dialog--thin",children:E})]})}},54331:(e,s,t)=>{t.d(s,{A:()=>d});
1var l=t(37876),n=t(14232);let d=e=>{let[s,t]=(0,n.useState)(e.short),d=e.address;if(null===d)return;let i="";void 0!==d.country&&"object"==typeof d.country&&void 0!==d.country.id?i=d.country.id:void 0!==d.country&&null!==d.country?i=d.country:void 0!==d.country_id&&null!==d.country_id&&(i=d.country_id);let a="";if(void 0!==d.province&&"object"==typeof d.province&&void 0!==d.province.id)a=d.province.code;else if(void 0!==d.province_id&&null!==d.province_id){let s=e.geoObj.provinces.find(e=>d.province_id===e.id);void 0!==s&&(a=s.code)}return s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{className:"d-block",children:[d.street_address,", ",d.postal_code]}),(0,l.jsx)("span",{className:"d-block",children:(0,l.jsx)("button",{className:"link link--fs-12 p-0 d-block link--underline",onClick:()=>{t(!s)},children:"Voir l'adresse compl\xe8te"})})]}):(0,l.jsxs)(l.Fragment,{children:[(d.given_name||d.family_name)&&(0,l.jsxs)(l.Fragment,{children:[d.given_name,"\xa0",d.family_name,(0,l.jsx)("br",{})]}),void 0!==d.organization&&null!==d.organization&&""!==d.organization?(0,l.jsxs)(l.Fragment,{children:[d.organization,(0,l.jsx)("br",{})]}):"",d.street_address,d.street_address2?", "+d.street_address2:"",(0,l.jsx)("br",{}),d.city,",\xa0","CA"===i?a:null!==d.state?d.state:""," ",(0,l.jsx)("br",{}),i,", ",d.postal_code,null!==d.telephone&&""!==d.telephone&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("br",{}),"Tel : ",d.telephone]})]})}},55513:(e,s,t)=>{t.d(s,{A:()=>p});var l=t(37876),n=t(14232),d=t(93153),i=t(62199),a=t(33850),r=t(42940),o=t(20960),c=t(74474),u=t(12212),m=t(97384),h=t(48992);let b={edit:{type:"string",default:""}},p=e=>{let{mode:s,address:t,type:p,open:k,onClose:x}=e,{t:j}=(0,u.B)(),{edit:g}=(0,c.I)(b),{replaceQueryUpdate:f}=(0,o.c)(),{createAddress:v,updateAddress:y,deleteAddress:_,isSubmitting:N}=(0,a.A)(),{currentStep:A,isInstantCheckout:C,isGuestCheckout:w,geoObj:S,bookstoreMethod:F,updateSelectedAddress:O,applySavedAddress:I,removeSavedAddress:T}=(0,r.A)(),[E,R]=(0,n.useState)(null),[B,D]=(0,n.useState)(null),[$,M]=(0,n.useState)(null),[z,P]=(0,n.useState)(null),[V,H]=(0,n.useState)(k),U=()=>{H(!0)},G=(0,n.useCallback)(()=>{k&&x&&x(),H(!1)},[k,x]),q=(0,n.useCallback)(()=>{G(),A===i.Tq.PICKUP_OR_SHIPPING&&"address"===g&&f({edit:void 0})},[G,A,g,f]),Q=(0,n.useCallback)(e=>{w?O(e,p):I(e,{typeForUpdate:p}),q()},[w,p,O,I,q]),K=(0,n.useCallback)(e=>{if(w)return void q();_(e.id).then(()=>{T(e),d.oR.success(j("checkout.address.actiondeleted"))}).catch(()=>{d.oR.error(j("utils.error"))}),q()},[j,w,_,T,q]);return(0,n.useEffect)(()=>{switch(s){case"add":{let e=p,s=null;C?(e="billing",s=j("account.modal.address.title")):s="pickup"===F?j("account.modal.address.title3"):"billing"===p?j("account.modal.address.title2"):j("account.modal.address.title"),P("modal-dialog--address"),R((0,l.jsx)("h3",{className:"headline headline--sub headline--c-white mb-0",children:s})),M((0,l.jsx)(m.A,{createAddress:v,updateAddress:y,isSubmitting:N,isGuestCheckout:w,onSuccess:Q,geoObj:S,type:e,mode:"add"})),D((0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mr-2",children:(0,l.jsx)("button",{className:"btn btn--outline btn--small btn--outline--forest",onClick:G,children:j("utils.cancel")})}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{className:"btn btn--raised btn--small btn--raised--tomato",type:"submit",form:"add-address-form",children:j("utils.add")})})]}));break}case"update":P("modal-dialog--address"),R((0,l.jsx)("h3",{className:"headline headline--sub headline--c-white mb-0",children:j("account.modal.address.titlemodify")})),M((0,l.jsx)(m.A,{createAddress:v,updateAddress:y,isSubmitting:N,isGuestCheckout:w,onSuccess:Q,geoObj:S,type:p,prefillData:t,mode:"update"})),D((0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mr-2",children:(0,l.jsx)("button",{className:"btn btn--outline btn--small btn--outline--forest",onClick:G,children:j("utils.cancel")})}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{className:"btn btn--raised btn--small btn--raised--tomato",type:"submit",form:"add-address-form",children:j("utils.save")})})]}));break;case"remove":P("modal-dialog--thin"),R(!1),M((0,l.jsx)("p",{children:j("account.modal.address.removeconfirm")})),D((0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mr-2",children:(0,l.jsx)("button",{className:"btn btn--outline btn--small btn--outline--forest",onClick:G,children:j("account.modal.address.cancel")})}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",className:"btn btn--raised btn--small btn--raised--tomato",onClick:()=>K(t),children:j("account.modal.address.confirm")})})]}))}},[j,C,S,F,s,t,p,G,v,y,N,w,Q,K]),(0,n.useEffect)(()=>{k?U():G()}
1,[k,G]),(0,l.jsx)(h.A,{show:V,onShow:U,onHide:G,footer:!0,footerContent:B,backdrop:"static",header:"remove"!==s,headerContent:E,title:!1,className:`modal-dialog ${z}`,children:$})}},96232:(e,s,t)=>{t.d(s,{A:()=>r});var l=t(37876);t(14232);var n=t(12212),d=t(21468),i=t(54331),a=t(1648);let r=e=>{let{t:s}=(0,n.B)(),{isInstitutional:t,isInstitutionOwner:r}=(0,a.A)(),o=3===e.defaultMax?"col-12 col-sm-6 col-md-6 col-lg-4":"col-12 col-sm-6",c=!0;return t&&!r&&(c=!1),(0,l.jsx)("ul",{className:"address-list d-flex flex-wrap",children:0!==e.addressQty?e.listOfAddresses.map((t,n)=>(0,l.jsxs)("li",{className:`${o} mb-4`,children:[(0,l.jsxs)("label",{id:`address-${t.id}`,className:"radio-checkbox",children:[!e.inAccountPage&&(0,l.jsx)("input",{type:"radio",name:e.scope+"_address",value:t.id,checked:null!==e.selectedAddress&&e.selectedAddress?.id===t.id,disabled:e.readOnly??!1,onChange:()=>{e.onChange&&e.onChange(t)}}),(0,l.jsx)("span",{children:(0,l.jsx)(i.A,{address:t,geoObj:e.geoObj})})]}),c&&(0,l.jsxs)("span",{className:"address-action d-flex mt-2 ms-0",children:[(0,l.jsxs)("button",{className:"link link--fs-13 link--underline link--c-forest p-0 m-0 me-2 link--icon","aria-label":s("checkout.address.editaria"),"aria-describedby":`address-${t.id}`,onClick:()=>e.onUpdate(t),children:[(0,l.jsx)("span",{className:"link__icon",children:(0,l.jsx)(d.A,{value:"edit-icon"})}),s("checkout.address.edit")]}),(0,l.jsxs)("button",{className:"link link--fs-13 link--underline link--c-forest p-0 m-0 link--icon","aria-label":s("checkout.address.removearia"),"aria-describedby":`address-${t.id}`,onClick:()=>e.onRemove(t),children:[(0,l.jsx)("span",{className:"link__icon",children:(0,l.jsx)(d.A,{value:"trash-icon"})}),s("checkout.address.remove")]})]})]},t.id)):(0,l.jsx)("li",{children:s("checkout.address.noaddress")})})}}}]);
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.