PageSourceSearch

https://www.booksellers.ca/_next/static/chunks/pages/site/[host]/compte/profil-c0c3f40864cee576.js

js booksellers.ca collected 2026-09-26 08:48:39 UTC 39,646 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="3afa437e-5d47-45e4-af03-173bb1b04436",e._sentryDebugIdIdentifier="sentry-dbid-3afa437e-5d47-45e4-af03-173bb1b04436")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1898,5249],{2126:(e,a,s)=>{"use strict";s.d(a,{A:()=>o});var t,l,n=s(14232);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var t in s)({}).hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e}).apply(null,arguments)}let o=e=>n.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 120 90"},e),t||(t=n.createElement("defs",null,n.createElement("path",{id:"quialu_svg__a",d:"M0 .655h88.625v88.922H0z"}))),l||(l=n.createElement("g",{fill:"none",fillRule:"evenodd"},n.createElement("mask",{id:"quialu_svg__b",fill:"#fff"},n.createElement("use",{xlinkHref:"#quialu_svg__a"})),n.createElement("path",{fill:"#009862",d:"M73.931 78.16c9.02-8.137 14.694-19.93 14.694-33.055 0-24.549-19.839-44.45-44.312-44.45S0 20.556 0 45.105c0 24.548 19.84 44.448 44.313 44.448 6.749 0 13.142-1.52 18.867-4.226l6.553 2.243 5.996 2.007-.932-5.922-.866-5.495z",mask:"url(#quialu_svg__b)"}),n.createElement("path",{fill:"#FFF",d:"M56.352 58 45.303 47.837c-1.522-1.285-1.743-3.597-.493-5.163.154-.194.328-.37.516-.527L56.36 32l2.633 2.17-7.998 10.335c-.023.023-.205.257-.205.484 0 .234.19.475.197.483L59 55.877 56.352 58z"}),n.createElement("path",{fill:"#FFF",d:"M42.358 58 31.303 47.837c-1.524-1.29-1.743-3.607-.488-5.174.15-.19.32-.362.504-.516L42.366 32 45 34.17l-8.01 10.335c-.023.023-.205.257-.205.484 0 .234.198.475.198.483L45 55.877 42.358 58z"}),n.createElement("path",{fill:"#6BDAB3",d:"M92 3C78.745 3 68 13.745 68 27c0 7.517 3.459 14.225 8.868 18.625l-.108.687L76.02 51l4.76-1.59 1.444-.492A23.91 23.91 0 0 0 92 51c13.255 0 24-10.745 24-24S105.255 3 92 3"}),n.createElement("path",{fill:"#FFF",d:"m86.413 20 5.892 5.472c.812.693.93 1.937.263 2.78-.082.105-.175.2-.275.284L86.408 34l-1.404-1.168 4.265-5.565a.468.468 0 0 0 .11-.26.485.485 0 0 0-.106-.261L85 21.143 86.413 20z"}),n.createElement("path",{fill:"#FFF",d:"m93.41 20 5.894 5.472c.814.695.93 1.943.261 2.787a1.95 1.95 0 0 1-.268.277L93.406 34 92 32.832l4.272-5.565a.476.476 0 0 0 .11-.26c0-.127-.106-.257-.106-.261L92 21.143 93.41 20z"}))))},15687:(e,a,s)=>{"use strict";s.d(a,{A:()=>m});var t=s(37876);s(14232);var l=s(2126),n=s(12212),i=s(75975),o=s(37908),r=s(21468),c=s(80998),d=s(45625);let m=e=>{let{t:a,locale:s}=(0,n.B)(),{isPersonalizedRecommendationsEnabled:m}=(0,d.n)(),u="";if("quialu"===e.for){let s={title:a("account.quialu.titlebox"),text:a("account.quialu.textbox"),link:a("account.quialu.linkbox")};"profil"===e.from&&(s={title:a("account.quialu.titleboxshort"),text:a("account.quialu.textboxshort"),link:a("account.quialu.linkbox")}),u=(0,t.jsx)("div",{className:`textimage-box textimage-box--${e.for}`,children:(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("div",{className:"col-md-4 col-lg-3 textimage-box__logo mb-4",children:(0,t.jsx)(l.A,{})}),(0,t.jsxs)("div",{className:"col-md-8 col-lg-9 textimage-box__content mb-4",children:[(0,t.jsx)("h2",{className:"headline headline--block headline--c-quialu",children:s.title}),(0,t.jsx)("p",{className:"p p--fs-15 p--c-whitesmokelight",children:s.text}),(0,t.jsxs)("a",{className:"btn btn--raised btn--raised--quialu btn__icon mt-1",href:"https://www.quialu.ca/questions/go/onboarding",rel:"noreferrer",target:"_blank",children:[s.link,"\xa0",(0,t.jsx)(r.A,{value:"external"})]})]})]})})}else if("recomm"===e.for){if(!m)return null;let s={title:a("account.recomm.titlebox"),text:a("account.recomm.textbox"),link:a("account.recomm.linkbox"),seemy:a("account.recomm.seemy")};u=(0,t.jsx)("div",{className:`textimage-box textimage-box--${e.for}`,children:(0,t.jsx)("div",{className:"row",children:(0,t.jsx)("div",{className:"textimage-box__content mb-4 d-flex align-items-center justify-content-center",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"headline headline--block headline--c-white",children:s.title}),(0,t.jsx)("p",{className:"p p--fs-18 p--c-whitesmokelight",children:s.text}),(0,t.jsxs)(i.A,{href:`/${a("routes.yourfavbooks")}`,className:"btn btn--raised btn--raised--tomato btn__icon mt-3 me-3",children:[s.link,(0,t.jsx)("span",{className:"ms-2",style:{width:"20px"},children:(0,t.jsx)(r.A,{value:"thumb-up"})})]}),e.showPref&&(0,t.jsxs)(i.A,{href:`/${a("routes.quialurecomm")}`,className:"btn btn--raised btn--raised--quialu mt-3",children:[s.seemy,"\xa0\xa0",(0,t.jsx)(r.A,{value:"chevron-right"}),(0,t.jsx)(r.A,{value:"chevron-right"})]})]})})})})}else{let a=e.data,l={title:(0,c.bT)(a.title,s),content:(0,c.bT)(a.content,s),tagline:(0,c.bT)(a.tagline,s),main_image:(0,c.bT)(a.main_image,s),button_link:(0,c.bT)(a.button_link,s),button_text:(0,c.bT)(a.button_text,s),title_color:a.title_color,tagline_color:a.tagline_color,background_color:a.background_color,background_image:(0,c.bT)(a.background_image,s),button_color_text:a.button_color_text,content_color_text:a.content_color_text,button_color_background:a.button_color_background},n=l.button_link.includes("vos-livres-preferes")||l.button_link.includes("your-favorite-books");if(n&&!m||"en"===s&&l.button_link.includes("revue.leslibraires.ca"))return null;
1u=(0,t.jsx)("div",{className:`${e.smaller?"col-sm-6 col-md-4 mb-4":"col-sm-6 mb-4"} flex-grow-1`,children:(0,t.jsx)("div",{className:`textimage-box textimage-box--block ${n?"textimage-box--reco":""}`,style:{backgroundColor:l.background_color,backgroundImage:"url("+l.background_image+")"},children:(0,t.jsxs)("div",{className:"row ",children:[l.main_image?(0,t.jsx)("div",{className:"col-md-12 col-lg-6 textimage-box__logo mb-4",children:(0,t.jsx)(o.A,{src:l.main_image,className:"d-block w-100 h-auto",alt:l.title,title:l.title})}):"",(0,t.jsxs)("div",{className:` textimage-box__content mb-4 ${l.main_image?"col-md-12 col-lg-6":"col-12 ps-2 ps-md-4 pe-2 pe-md-4"}`,children:[l.tagline?(0,t.jsx)("h2",{className:"headline headline--sub mb-2",style:{color:l.tagline_color},dangerouslySetInnerHTML:{__html:l.tagline}}):"",l.title?l.tagline?(0,t.jsx)("h3",{className:"headline headline--block mt-0 mb-3",style:{color:l.title_color},dangerouslySetInnerHTML:{__html:l.title}}):(0,t.jsx)("h2",{className:"headline headline--block mt-0 mb-3",style:{color:l.title_color},dangerouslySetInnerHTML:{__html:l.title}}):"",l.content?(0,t.jsx)("p",{className:"p p--fs-15 p--c-whitesmokelight",style:{color:l.content_color_text},dangerouslySetInnerHTML:{__html:l.content}}):"",l.button_link&&l.button_text?(0,t.jsxs)("a",{className:"btn btn--raised btn--raised--tomato p-2",style:{color:l.button_color_text,backgroundColor:l.button_color_background,borderColor:l.button_color_background},href:l.button_link,rel:"noreferrer",target:"_blank",children:[l.button_text,"\xa0\xa0",(0,t.jsx)(r.A,{value:"chevron-right"})]}):""]})]})})})}return(0,t.jsx)(t.Fragment,{children:u})}},30249:(e,a,s)=>{"use strict";s.d(a,{A:()=>i});var t=s(14232),l=s(7367),n=s(12212);let i=e=>{let{t:a,locale:s}=(0,n.B)(),[i,o]=(0,t.useState)(e),[r,c]=(0,t.useState)({}),[d,m]=(0,t.useState)(!1),u=(0,t.useCallback)(e=>{let{name:a,value:s}=e.target;o(e=>({...e,[a]:s})),c(e=>({...e,[a]:void 0}))},[]),b=(0,t.useCallback)((e,a)=>{o(s=>({...s,[e]:a}))},[]),h=(0,t.useCallback)(()=>{o(e),c({})},[e]),x=(0,t.useCallback)(e=>{c(a=>({...a,...e}))},[]),f=(0,t.useCallback)(e=>{c(a=>({...a,[e]:void 0}))},[]);return{formState:i,handleChange:u,setField:b,resetForm:h,errors:r,setErrors:x,clearError:f,clearErrors:(0,t.useCallback)(()=>{c({})},[]),applyValidationErrors:(0,t.useCallback)((e,t)=>{let n=(0,l.wr)(e,{fieldMap:t,locale:s});return n?(c(n.fieldErrors),{...n,toastMessage:n.message||n.firstError||a("utils.error")}):null},[a,s]),isSubmitting:d,setIsSubmitting:m}}},33280:(e,a,s)=>{"use strict";s.d(a,{A:()=>n});var t=s(14232),l=s(65892);let n=e=>{(0,t.useEffect)(()=>{let a=async()=>{let[a,s,t]=await Promise.all([(0,l.wR)(),(0,l.X6)(),(0,l._m)()]);e.setGeoObj({provinces:a.data,countries:s.data,regions:t.data.filter(e=>"00"!==e.code)})};null===e.geoObj&&a()},[e])}},45764:(e,a,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/site/[host]/compte/profil",function(){return s(60582)}])},53544:(e,a,s)=>{"use strict";s.d(a,{A:()=>o});var t=s(37876),l=s(79564),n=s(89613),i=s(28244);let o=e=>{let{label:a,id:s,name:o,required:r=!1,className:c="",placeholder:d="",maxLength:m,minLength:u,defaultValue:b,value:h,rows:x=4,hintMessage:f,errorMessage:p,onChange:g,disabled:j=!1,readOnly:v=!1}=e,_=`${s}-error`,w=`${s}-hint`,N=[p&&_,f&&w].filter(Boolean).join(" ")||void 0;return(0,t.jsxs)(i.A,{label:a,id:s,required:r,className:c,children:[(0,t.jsx)("textarea",{className:"form-control",id:s,name:o||s,placeholder:d,maxLength:m,minLength:u,...void 0!==h?{value:h}:{defaultValue:b},rows:x,"aria-required":r,"aria-invalid":!!p,"aria-describedby":N,required:r,readOnly:v,disabled:j,onChange:e=>{!j&&g&&g(e)}}),(0,t.jsx)(n.A,{id:w,message:f}),(0,t.jsx)(l.A,{id:_,message:p})]})}},60582:(e,a,s)=>{"use strict";s.r(a),s.d(a,{__N_SSG:()=>W,default:()=>X});var t=s(37876),l=s(14232),n=s(12212),i=s(43361),o=s(63529),r=s(75975),c=s(21468);let d=(0,l.memo)(e=>{let{isEditing:a,onChange:s,className:l="btn btn__icon btn__icon--edit btn__icon--tomato mb-2",title:i=null}=e,{t:o}=(0,n.B)();return(0,t.jsx)("button",{title:i||o("utils.modify"),onClick:e=>{e.preventDefault(),s(!a)},className:l,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.A,{value:"close"}),"\xa0",o("utils.cancel")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.A,{value:"edit-icon"}),"\xa0",o("utils.modify")]})})});var m=s(44563),u=s(89099),b=s(16142),h=s(21356),x=s(30249),f=s(1648),p=s(3038),g=s(49505),j=s(77878),v=s(33934),_=s(14196);let w=(0,l.memo)(e=>{let{geoObj:a,lockPersonnalInfos:s,setLockPersonnalInfos:i}=e,{t:o,locale:r}=(0,n.B)(),d=(0,u.useRouter)(),{currentUser:m,updateCurrentUser:w}=(0,h.A)(),{isInstitutional:N}=(0,f.A)(),y=a?.countries??[],k=a?.provinces??[],[A,C]=(0,l.useState)(!1),[O,I]=(0,l.useState)(!1),{formState:q,handleChange:E,setField:S,resetForm:F,errors:M,setErrors:L,isSubmitting:B,setIsSubmitting:P}=(0,x.A)((e=>
1({firstname:e?.firstname??"",lastname:e?.lastname??"",email:e?.email??"",language:e?.language??"fr",phone:e?.phone??"",countryId:e?.country?.id??"",provinceCode:e?.province?.code??""}))(m)),$=(0,l.useMemo)(()=>s||B,[s,B]),T=(0,l.useMemo)(()=>"CA"===q.countryId,[q.countryId]),D=(0,l.useCallback)(e=>{E(e),"CA"!==e.target.value&&S("provinceCode","")},[E,S]),z=(0,l.useMemo)(()=>(0,j._D)(y,r),[y,r]),H=(0,l.useCallback)(e=>{let a;if(e.preventDefault(),(0,_.xd)(q.email))return void L({email:o("forms.errors.emailnotvalid")});if(P(!0),N)a={firstname:q.firstname,lastname:q.lastname,email:q.email,phone:(0,b.wz)(q.phone),language:q.language};else{let e=q.countryId!==m.country?.id,s=T&&q.provinceCode!==m.province?.code;a={firstname:q.firstname,lastname:q.lastname,email:q.email,language:q.language,country_id:e?q.countryId:m.country?.id,...T?{province_id:s?k.find(e=>e.code===q.provinceCode)?.id??null:m.province?.id??null}:{province_id:null}}}let s=m.language!==q.language;w(a).then(()=>{I(!1),C(!0),s&&(0,v.v)(q.language,d),setTimeout(()=>{C(!1)},4e3),i(!0)}).catch(e=>{I(!0),F(),setTimeout(()=>{I(!1)},4e3)}).finally(()=>{P(!1)})},[o,q,m,N,T,k,d,w,i,L,F,P]);return(0,t.jsxs)("form",{onSubmit:H,children:[(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.user.firstname"),id:"firstname",name:"firstname",required:!0,value:q.firstname,onChange:E,disabled:$,readOnly:$})}),(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.user.lastname"),id:"lastname",name:"lastname",required:!0,value:q.lastname,onChange:E,disabled:$,readOnly:$})})]}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.user.email"),id:"email",name:"email",type:"email",required:!0,value:q.email,onChange:E,disabled:$,readOnly:$,errorMessage:M.email||void 0})}),(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("strong",{className:"mb-3 d-block",children:o("account.modal.user.languages")}),(0,t.jsxs)("div",{className:"d-flex flex-wrap",children:[(0,t.jsxs)("label",{className:"radio-checkbox",children:[(0,t.jsx)("input",{type:"radio",name:"language",value:"fr",checked:"fr"===q.language,onChange:E,disabled:$,readOnly:$}),(0,t.jsx)("span",{className:"me-4",children:(0,t.jsx)("strong",{children:o("account.modal.user.french")})})]}),(0,t.jsxs)("label",{className:"radio-checkbox",children:[(0,t.jsx)("input",{type:"radio",name:"language",value:"en",checked:"en"===q.language,onChange:E,disabled:$,readOnly:$}),(0,t.jsx)("span",{children:(0,t.jsx)("strong",{children:o("account.modal.user.english")})})]})]})]})})]}),N?(0,t.jsx)("div",{className:"row",children:(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.address.phone"),id:"telephone",name:"phone",value:q.phone,onChange:E,disabled:$,readOnly:$,maxLength:16})})}):(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsx)(p.A,{label:o("account.modal.user.country"),id:"country",name:"countryId",required:!0,disabled:$,value:q.countryId,onChange:D,children:z.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))})}),T&&(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsx)(p.A,{label:o("account.modal.user.province"),id:"province",name:"provinceCode",required:!0,disabled:$,value:q.provinceCode,onChange:E,children:k.map(e=>(0,t.jsx)("option",{value:e.code,children:e.name},e.code))})})]}),(0,t.jsx)("div",{className:"row",children:(0,t.jsxs)("div",{className:"col-12 d-flex align-items-start flex-wrap",children:[!s&&(0,t.jsx)("div",{className:"mb-2 me-3",children:(0,t.jsx)("button",{type:"submit",className:"btn btn--outline btn--outline--forest",disabled:B,children:o("account.modal.user.update")})}),A&&(0,t.jsxs)("div",{className:"alert alert--success alert--small mb-0 mt-1 alert--withfade",children:[(0,t.jsx)("div",{className:"alert__icon",children:(0,t.jsx)(c.A,{value:"confirm"})}),(0,t.jsx)("div",{className:"alert__message",children:(0,t.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:o("account.modal.user.updated")})})]}),O&&(0,t.jsxs)("div",{className:"alert alert--danger alert--small mb-0 mt-1 alert--withfade",children:[(0,t.jsx)("div",{className:"alert__icon",children:(0,t.jsx)(c.A,{value:"danger"})}),(0,t.jsx)("div",{className:"alert__message",children:(0,t.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:o("account.modal.user.notupdated")})})]})]})})]})}),N=e=>{let{t:a}=(0,n.B)(),{currentUser:s,updateCurrentUser:i}=(0,h.A)(),[o,r]=(0,l.useState)(!1),[d,m]=(0,l.useState)(!1),[u,b]=(0,l.useState)(""),[x,f]=(0,l.useState)(!1);(0,l.useEffect)(()=>
1{if(e.lockPassword){r(!1),m(!1);let e=document.getElementById("newpassword"),a=document.getElementById("newpasswordconfirm");e.type="password",e.value="",a.type="password",a.value=""}},[e.lockPassword]);let p={disabled:!1,readOnly:!1};return e.lockPassword&&(p={disabled:!0,readOnly:!0}),(0,t.jsxs)("form",{onSubmit:a=>{a.preventDefault();let t=a.target.elements,l=t.btnsubmitformpassword;l.disabled=!0;let n=t.newpassword,o=t.newpasswordconfirm,r={password:n.value,passwordConfirm:o.value};r.password===r.passwordConfirm&&(0,_.n9)(r.password)?i({firstname:s.firstname,lastname:s.lastname,email:s.email,phone:s.phone,language:s.language,password:r.password}).then(()=>{f(!0),setTimeout(()=>{f(!1),l.disabled=!1},4e3),l.disabled=!1,e.setLockPassword(!0)}):l.disabled=!1},id:"password-form",children:[(0,t.jsxs)("div",{className:"row mb-1",children:[(0,t.jsxs)("div",{className:"col-sm-6 mb-2",children:[(0,t.jsxs)("div",{className:"form-group mb-0 position-relative",children:[(0,t.jsx)("label",{htmlFor:"newpassword",children:a("account.modal.user.newpassword")}),(0,t.jsx)("input",{className:"form-control",id:"newpassword",name:"newpassword",defaultValue:"",placeholder:"••••••••••••",type:"password",...p,onChange:e=>{(0,_.n9)(e.target.value)?(e.target.parentNode.parentNode.querySelector(".invalid-feedback").style.display="none",b(e.target.value)):e.target.parentNode.parentNode.querySelector(".invalid-feedback").style.display="block"},required:!0}),(0,t.jsx)("button",{className:"btn-see-password",disabled:e.lockPassword,onClick:e=>{e.preventDefault(),"password"===document.getElementById("newpassword").type?(r(!0),document.getElementById("newpassword").type="inherit"):(r(!1),document.getElementById("newpassword").type="password")},"aria-label":a(o?"forms.institutional.hidepassword":"forms.institutional.showpassword"),children:o?(0,t.jsx)(c.A,{value:"eye-hide"}):(0,t.jsx)(c.A,{value:"eye-show"})})]}),(0,t.jsx)("span",{className:"span--c-forestlight mt-1 d-block span--fs-14",children:a("account.modal.user.passwordlegend")}),(0,t.jsx)("div",{className:"invalid-feedback p-1",children:a("forms.institutional.passwordinvalid")})]}),(0,t.jsx)("div",{className:"col-sm-6 mb-2",children:(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("label",{htmlFor:"newpasswordconfirm",children:a("account.modal.user.newpasswordconfirm")}),(0,t.jsxs)("div",{className:"position-relative",children:[(0,t.jsx)("input",{className:"form-control",id:"newpasswordconfirm",name:"newpasswordconfirm",type:"password",...p,defaultValue:"",placeholder:"••••••••••••",required:!0,onChange:e=>{u!==e.target.value?e.target.parentNode.parentNode.querySelector(".invalid-feedback").style.display="block":u===e.target.value&&(e.target.parentNode.parentNode.querySelector(".invalid-feedback").style.display="none")}}),(0,t.jsx)("button",{className:"btn-see-password",disabled:e.lockPassword,onClick:e=>{e.preventDefault(),"password"===document.getElementById("newpasswordconfirm").type?(m(!0),document.getElementById("newpasswordconfirm").type="inherit"):(m(!1),document.getElementById("newpasswordconfirm").type="password")},"aria-label":a(d?"forms.institutional.hidepassword":"forms.institutional.showpassword"),children:d?(0,t.jsx)(c.A,{value:"eye-hide"}):(0,t.jsx)(c.A,{value:"eye-show"})})]}),(0,t.jsx)("div",{className:"invalid-feedback p-1",children:a("forms.institutional.passwordnotmatching")})]})})]}),(0,t.jsx)("div",{className:"row",children:(0,t.jsxs)("div",{className:"col-12 d-flex align-items-start flex-wrap",children:[!e.lockPassword&&(0,t.jsx)("div",{className:"mb-2 me-3",children:(0,t.jsx)("button",{id:"btnsubmitformpassword",className:"btn btn--outline btn--outline--forest",children:a("account.modal.user.passwordupdate")})}),x&&(0,t.jsxs)("div",{className:"alert alert--success alert--small mb-0 mt-1  alert--withfade",children:[(0,t.jsx)("div",{className:"alert__icon",children:(0,t.jsx)(c.A,{value:"confirm"})}),(0,t.jsx)("div",{className:"alert__message",children:(0,t.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:a("account.modal.user.updated")})})]})]})})]})};var y=s(33280),k=s(75130);let A=e=>{let{t:a}=(0,n.B)(),{currentUser:s,refreshUserData:i}=(0,h.A)(),o=s.institution,[r,d]=(0,l.useState)(!1),m={disabled:!1,readOnly:!1};return e.lockInstitutionalInfos&&(m={disabled:!0,readOnly:!0}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"row",children:(0,t.jsx)("div",{className:"col-12",children:(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("label",{htmlFor:"insti_name",children:a("forms.institutional.yourinsti")}),(0,t.jsx)("input",{className:"form-control",id:"insti_name",name:"insti_name",defaultValue:(0,b.wz)(o.name),readOnly:!0,disabled:!0,required:!0,...m}
1),(0,t.jsx)("div",{className:"invalid-feedback invalid-feedback--instiname",children:a("forms.errors.emptyfield")})]})})}),(0,t.jsx)("div",{className:"row",children:(0,t.jsxs)("div",{className:"col-12 d-flex align-items-start flex-wrap mb-2",children:[!e.lockInstitutionalInfos&&(0,t.jsx)("div",{className:"mb-2 me-3",children:(0,t.jsx)("button",{className:"btn btn--outline btn--outline--forest btn--small",onClick:()=>{let a=document.getElementById("submitbtn_instiname"),s=document.querySelector(".invalid-feedback--instiname"),t=document.getElementById("insti_name").value;if(a.disabled=!0,""===t)return s.style.display="block",a.disabled=!1,null;s.style.display="none",o.name!==t?(0,k.i3)({name:t}).then(s=>{a.disabled=!1,e.setLockInstitutionalInfos(!0),void 0!==s&&200===s.status&&(i(),d(!0),setTimeout(()=>{d(!1)},4e3))}):(e.setLockInstitutionalInfos(!0),a.disabled=!1)},id:"submitbtn_instiname",children:a("account.modal.user.updateinstiname")})}),r&&(0,t.jsxs)("div",{className:"alert alert--success alert--small mb-0  alert--withfade",children:[(0,t.jsx)("div",{className:"alert__icon",children:(0,t.jsx)(c.A,{value:"confirm"})}),(0,t.jsx)("div",{className:"alert__message",children:(0,t.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:a("account.modal.user.updatedinstiname")})})]})]})}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("div",{className:"col-sm-6 col-12 mb-2",children:(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("label",{htmlFor:"province",children:a("account.profile.institution.province")}),(0,t.jsx)("input",{className:"form-control",id:"province",name:"province",defaultValue:o.province.name,readOnly:!0,disabled:!0,required:!0})]})}),"QC"===o.province.code&&(0,t.jsx)("div",{className:"col-sm-6 col-12 mb-2",children:(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("label",{htmlFor:"region",children:a("account.profile.institution.region")}),(0,t.jsx)("input",{className:"form-control",id:"region",name:"region",defaultValue:o.region.name,readOnly:!0,disabled:!0,required:!0})]})})]})]})};var C=s(40050),O=s(39185),I=s(41791),q=s(62808),E=s(93153),S=s(99626),F=s(79881);let M=()=>{let{t:e}=(0,n.B)(),{updateCurrentUser:a}=(0,h.A)(),{isSupported:s,isConsentAccepted:i}=(0,S.A)({needCustomerData:!0}),[o,c]=(0,l.useState)(!0),[m,u]=(0,l.useState)(null),[b,x]=(0,l.useState)(!1),f=(0,l.useCallback)(()=>{u(!(null!==m?m:i))},[m,i]),p=(0,l.useCallback)(()=>{if(null!==m){if(!1===m&&!0===i)return void x(!0);a({gamification_consent:m}),E.oR.success(e("account.profile.gamification.updated")),c(!0),u(null)}},[m,i,a,e]),g=(0,l.useCallback)(()=>{a({gamification_consent:!1}),E.oR.success(e("account.profile.gamification.updated")),c(!0),u(null),x(!1)},[a,e]),j=(0,l.useCallback)(()=>{x(!1)},[]),v=(0,l.useMemo)(()=>null!==m?m:i,[m,i]),_=(0,l.useMemo)(()=>null!==m&&m!==i,[m,i]),w=(0,l.useMemo)(()=>!_,[_]);return s?(0,t.jsxs)("div",{className:"checkout-box",children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block",children:e("account.profile.gamification.title")}),(0,t.jsx)(d,{isEditing:!o,onChange:e=>{c(!e),u(null)}})]}),(0,t.jsx)("div",{children:(0,t.jsx)("p",{children:e("account.profile.gamification.description")})}),(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{children:(0,t.jsx)(r.A,{href:`/${e("routes.gamification-policy")}`,target:"_blank",rel:"noreferrer",children:e("forms.consent.gamification.title")})}),(0,t.jsxs)("label",{className:`filter-checkbox mb-4${o?" disabled":""}`,children:[(0,t.jsx)("input",{id:"gamification_consent",type:"checkbox",checked:v,disabled:o,onChange:f}),(0,t.jsx)("div",{children:e("forms.consent.gamification.text")})]}),!o&&(0,t.jsx)("div",{className:"d-flex align-items-start flex-wrap",children:(0,t.jsx)("div",{className:"mb-2 me-3",children:(0,t.jsx)("button",{className:"btn btn--outline btn--outline--forest",disabled:w,onClick:p,children:e("utils.confirm")})})})]}),(0,t.jsx)(F.A,{isOpen:b,onOpenChange:e=>{e||x(!1)},className:"modal-wrapper--medium modal-dialog--modalite",isDismissable:!1,children:(0,t.jsxs)(F.A.Content,{title:e("gamification.consent.optout_title"),titleIcon:"exclamation",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)("p",{children:e("gamification.consent.optout_message")})}),(0,t.jsxs)(F.A.Buttons,{className:"d-flex gap-2 flex-column",children:[(0,t.jsx)(q.$,{onPress:g,className:"btn btn--raised btn--raised--tomato w-100",children:e("gamification.consent.reject_confirm")}),(0,t.jsx)(q.$,{onPress:j,className:"btn btn--outline btn--outline--forest w-100",children:e("utils.cancel")})]})]})})]}):null};var L=s(25117),B=s(15687),P=s(89097),$=s(34924),T=s(68421),D=s(79564),z=s(53544);let H=["giftcard","direct","paypal"],R="targeted_websites-error",V=(0,l.memo)(e=>{let{edit:a=!1,lockAffInfos:s,setLockAffInfos:i}=e,{t:o}=(0,n.B)(),{currentUser:r}=(0,h.A)(),{affiliateInfos:d,targetedWebsites:m,hasTaxNumbers:u,createAffiliate:f,updateAffiliate:j}=(0,T.A)(),v=(0,l.useRef)(0),w=(0,l.useCallback)(e=>({id:v.current++,value:e}),[]),[N,y]=(0,l.useState)(a),[k,A]=(0,l.useState)(!1),[C,O]=(0,l.useState)(()=>(m.length>0?m:[""]).map(w)),[I,q]=(0,l.useState)(!!u||null),{formState:S,handleChange:F,errors:M,setErrors:L,clearError:B,clearErrors:V,applyValidationErrors:Q,isSubmitting:W,setIsSubmitting:X}=(0,x.A)(((e,a)=>({email:e?.email??a?.email??"",phone_number:e?.phone_number??"",payout_payment_method:e?.payout_payment_method??0,tax_gst_number:e?.tax_gst_number??"",tax_pst_number:e?.tax_pst_number??"",comment:e?.comment??""}))(d,r)),Z=(0,l.useMemo)(()=>!!s,[s]),G=(0,l.useCallback)(e=>{e.preventDefault(),B("targeted_websites"),O(e=>[...e,w("")])},[w,B]),J=(0,l.useCallback)((e,a)=>{B("targeted_websites"),O(s=>s.map(s=>s.id===e?{...s,value:a}:s))},[B]),U=(0,l.useCallback)(e=>{B("targeted_websites"),O(a=>a.filter(a=>a.id!==e))},[B]),K=(0,l.useCallback)(e=>{e.preventDefault(),V();let s=((e,a)=>{let s={};return(!e.email||(0,_.xd)(e.email))&&(s.email=a("forms.errors.emailnotvalid")),H.includes(e.payout_payment_method)||(s.payout_payment_method=a("forms.errors.emptyfield")),s})(S,o);if(Object.keys(s).length>0)return void L(s);let t=C.map(e=>({...e,value:(0,b.pi)(e.value)})).filter(e=>null!==e.value);O(t.length>0?t:[w("")]);let l={phone_number:S.phone_number,email:S.email,targeted_websites:(0,b.pi)(t.map(e=>e.value).join(",")),comment:S.comment,payout_payment_method:S.payout_payment_method,tax_gst_number:I?S.tax_gst_number:null,tax_pst_number:I?S.tax_pst_number:null},n=a?j:f;X(!0),n(l).then(()=>{A(!0),a?i(!0):y(!1),setTimeout(()=>{A(!1)},5e3)}).catch(e=>{let s=Q(e);if(!s){(0,$.vV)("Form","Affiliate submission failed",e,{isEdit:a,status:e?.
1status}),E.oR.error(o("account.modal.affiliate.error"));return}(0,$.JE)("Form","Affiliate submission rejected by validation",{fields:Object.keys(s.fieldErrors),isEdit:a}),E.oR.error(s.toastMessage)}).finally(()=>{X(!1)})},[o,S,C,I,a,j,f,i,L,V,Q,X,w]);return(0,t.jsxs)("form",{onSubmit:K,id:"affiliate-form",children:[!k&&(0,t.jsxs)("div",{className:"row mb-1",children:[a?(0,t.jsx)("div",{className:"col-12 mb-2",children:(0,t.jsx)("div",{className:"form-group mb-0 position-relative",children:(0,t.jsxs)("p",{className:"mb-0 strong--weight--smbold",children:[o("account.modal.affiliate.myid"),o("utils.colon"),"\xa0",d?.id]})})}):(0,t.jsx)("div",{className:"col-12 mb-2",children:(0,t.jsx)("div",{className:"form-group mb-0 position-relative",children:(0,t.jsxs)("label",{className:"filter-checkbox",htmlFor:"affiliate-checkbox",children:[(0,t.jsx)("input",{id:"affiliate-checkbox",type:"checkbox",checked:N,onChange:()=>{y(e=>!e)}}),o("account.modal.affiliate.becomeaffiliate")]})})}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("div",{className:"col-12 col-sm-6",children:N&&!k&&(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.affiliate.email"),id:"email",name:"email",type:"email",required:!0,disabled:Z,readOnly:Z,value:S.email,errorMessage:M.email,onChange:F})})}),(0,t.jsx)("div",{className:"col-12 col-sm-6",children:N&&!k&&(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.affiliate.phone_number"),id:"phone_number",name:"phone_number",maxLength:P.QZ.phone_number,required:!0,disabled:Z,readOnly:Z,value:S.phone_number,errorMessage:M.phone_number,onChange:F})})}),(0,t.jsx)("div",{className:"col-12 col-sm-6",children:N&&!k&&(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsxs)(p.A,{label:o("account.modal.affiliate.payout_payment_method"),id:"payout_payment_method",name:"payout_payment_method",required:!0,disabled:Z,value:S.payout_payment_method,errorMessage:M.payout_payment_method,onChange:F,children:[(0,t.jsx)("option",{value:0,disabled:!0,children:o("account.modal.affiliate.select")}),H.map(e=>(0,t.jsx)("option",{value:e,children:o(`account.modal.affiliate.${e}`)},e))]})})}),N&&(0,t.jsx)("div",{className:"col-12 col-sm-6 mb-2",children:(0,t.jsxs)("fieldset",{className:"form-group mb-0 position-relative",children:[(0,t.jsx)("legend",{children:(0,t.jsx)("strong",{children:o("account.modal.affiliate.websites")})}),C.map((e,a)=>{let{id:s,value:l}=e;return(0,t.jsxs)("div",{className:"form-group mb-2 d-flex",children:[(0,t.jsx)("input",{className:"form-control",id:`websites_${s}`,name:`websites_${s}`,type:"text",disabled:Z,readOnly:Z,value:l,onChange:e=>{J(s,e.target.value)},"aria-invalid":!!M.targeted_websites,"aria-describedby":M.targeted_websites?R:void 0,"aria-label":l?o("account.modal.affiliate.editwebsitesaria",{name:l}):o("account.modal.affiliate.addwebsitesaria",{name:a+1})}),0!==a&&(0,t.jsx)("button",{type:"button",onClick:()=>{U(s)},title:o("account.modal.affiliate.removewebsites"),"aria-label":l?o("account.modal.affiliate.removearia",{name:l}):o("account.modal.affiliate.removearia",{name:a+1}),disabled:Z,className:"btn btn__icon ms-2",children:(0,t.jsx)(c.A,{value:"close"})})]},s)}),(0,t.jsxs)("button",{type:"button",className:"btn btn--small btn--raised btn--raised--tomato",onClick:G,disabled:Z,"aria-label":o("account.modal.affiliate.addwebsitesaria",{name:C.length+1}),children:[o("account.modal.affiliate.addwebsites"),(0,t.jsx)(c.A,{value:"plus",className:"ms-2"})]}),(0,t.jsx)(D.A,{id:R,message:M.targeted_websites})]})})]}),N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"col-12 mb-2",children:(0,t.jsxs)("div",{className:"form-group mb-0 position-relative",children:[(0,t.jsx)("strong",{className:"mb-2 d-block",children:o("account.modal.affiliate.tax_registered")}),(0,t.jsxs)("div",{className:"d-flex flex-wrap gap-3",children:[(0,t.jsxs)("label",{className:"radio-checkbox",children:[(0,t.jsx)("input",{type:"radio",name:"tax_registered",value:"yes",checked:!0===I,disabled:Z,onChange:()=>{q(!0)}}),(0,t.jsx)("span",{className:"me-4",children:(0,t.jsx)("strong",{children:o("account.modal.affiliate.tax_registered_yes")})})]}),(0,t.jsxs)("label",{className:"radio-checkbox",children:[(0,t.jsx)("input",{type:"radio",name:"tax_registered",value:"no",checked:!1===I,disabled:Z,onChange:()=>{q(!1)}}),(0,t.jsx)("span",{children:(0,t.jsx)("strong",{children:o("account.modal.affiliate.tax_registered_no")})})]})]})]})}),I&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"col-12 col-sm-6 mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.affiliate.tax_gst_number"),id:"tax_gst_number",name:"tax_gst_number",maxLength:P.QZ.tax_gst_number,disabled:Z,readOnly:Z,value:S.tax_gst_number,errorMessage:M.tax_gst_number,onChange:F})}),(0,t.jsx)("div",{className:"col-12 col-sm-6 mb-2",children:(0,t.jsx)(g.A,{label:o("account.modal.affiliate.tax_pst_number"),id:"tax_pst_number",name:"tax_pst_number",maxLength:P.QZ.tax_pst_number,disabled:Z,readOnly:Z,value:S.tax_pst_number,errorMessage:M.tax_pst_number,onChange:F})})]}),(0,t.jsx)("div",{className:"col-12 mb-2",children:(0,t.jsx)(z.A,{label:o("account.modal.affiliate.comments"),id:"comment",name:"comment",maxLength:P.QZ.comment,value:S.comment,disabled:Z,readOnly:Z,errorMessage:M.comment,onChange:F})})]})]}),(0,t.jsxs)("div",{className:"row",children:[!s&&(0,t.jsx)("div",{className:"col-12 d-flex align-items-start flex-wrap",children:N&&!k&&(0,t.jsx)("div",{className:"mb-2 me-3 mt-3",children:(0,t.jsx)("button",{id:"submitaffiliate",type:"submit",disabled:W,className:"btn btn--outline btn--outline--forest",children:a?o("account.modal.affiliate.updatesubmit"):o("account.modal.affiliate.submit")})})}),(0,t.jsx)("div",{className:"col-12",children:k&&(0,t.jsxs)("div",{className:"alert alert--success alert--small mb-0 mt-0 alert--withfade",children:[(0,t.jsx)("div",{className:"alert__icon",children:(0,t.jsx)(c.A,{value:"confirm"})}),(0,t.jsx)("div",{className:"alert__message",children:(0,t.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:a?o("account.modal.affiliate.updated"):o("account.modal.affiliate.submitted")})})]})})]})]})});var Q=s(5731);s(63120);var W=!0;let X=e=>{(0,Q.A)();let{t:a}=(0,n.B)(),{isAuthenticated:s,currentUser:c,refreshUserData:u}=(0,h.A)(),{isInstitutional:b,isInstitutionOwner:x}=(0,f.A)();(0,y.A)(e.geoObject);let{currStore:p,allBookstores:g}=(0,L.Z)(),[j,v]=(0,l.useState)(!1),[_,q]=(0,l.useState)(!0),[E,S]=(0,l.useState)(!0),[F,P]=(0,l.useState)(!0),[$,T]=(0,l.useState)(!0),D=async e=>{let a=await (0,k.i3)({bookstore_ids:e});void 0!==a&&200===a.status&&await u(),v(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"section section--pt-80 section--pb-60",children:[(0,t.jsx)(i.A,{title:a("staticpages.account.profile"),route:"account.profile"}),(0,t.jsx)("section",{className:"section section--profil",children:(0,t.jsx)("div",{className:"container",children:(0,t.jsxs)(o.A,{page:b?"profileinsti":"profile",icon:"user",children:[b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-4 checkout-box",children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block headline--margin--10",children:a("account.profile.institution.infos")}),x&&(0,t.jsx)(d,{isEditing:!E,onChange:e=>S(!e)})]}),null!==e.geoObject.geoObj&&(0,t.jsx)(A,{lockInstitutionalInfos:E,setLockInstitutionalInfos:S,geoObj:e.geoObject.geoObj})]}),(0,t.jsxs)("div",{className:"mt-4 checkout-box",children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block mb-2",children:a("account.profile.institution.bookstores")}),x&&(0,t.jsx)(d,{isEditing:j,onChange:e=>{v(e)}})]}),null!==g&&c?.institution?.bookstores&&(0,t.jsx)(I.A,{bookstores:g.filter(e=>c.institution.bookstores.map(e=>e.id).includes(e.id)),displayMode:"full",interactionMode:"static",subdomain:e.subdomain,showLinkToSubdomain:!1,columns:2,className:"row account-mybookstore account-mybookstore--boxed"})]}),(0,t.jsxs)("div",{className:"mt-4 checkout-box",children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block mb-2",children:a("account.profile.institution.administrator")}),(0,t.jsx)(d,{isEditing:!_,onChange:e=>q(!e)})]}),null!==e.geoObject.geoObj&&(0,t.jsx)(w,{lockPersonnalInfos:_,setLockPersonnalInfos:q,geoObj:e.geoObject.geoObj})]})]}):(0,t.jsxs)(t.Fragment,{children:[null===e.organization&&(0,t.jsxs)("div",{className:"account-mybookstore mt-4 checkout-box position-relative",children:[(0,t.jsx)("h2",{className:"headline headline--block headline--margin--10",children:a("header.storeselector.mybookstore")}),null!==p?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"marker-list-item marker-list-item--bigger active",children:(0,t.jsx)(O.A,{bookstore:p,displayMode:"full",interactionMode:"static",showLinkToSubdomain:!1,subdomain:e.subdomain})})}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("p",{className:"p--c-forestlight",children:a("header.storeselector.nobookstore")})}),(0,t.jsx)("br",{}),(0,t.jsx)(m.A,{force:!0,subdomain:e.subdomain,buttonOnly:!0})]}),(0,t.jsxs)("div",{className:`checkout-box ${null!==e.organization?"mt-4":""}`,children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block mb-2",children:a("account.profile.infos")}),(0,t.jsx)(d,{isEditing:!_,onChange:e=>q(!e)})]}),null!==e.geoObject.geoObj&&(0,t.jsx)(w,{geoObj:e.geoObject.geoObj,setLockPersonnalInfos:q,lockPersonnalInfos:_})]})]}),(0,t.jsx)(B.A,{for:"recomm",showPref:s&&null!==c.last_onboarding_at}),(0,t.jsxs)("div",{className:"checkout-box",children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block mb-2",children:a("account.profile.password")}),(0,t.jsx)(d,{isEditing:!F,onChange:e=>P(!e)})]}),(0,t.jsx)(N,{lockPassword:F,setLockPassword:P})]}),(0,t.jsx)(M,{}),(x||!b)&&(0,t.jsxs)("div",{className:"checkout-box",children:[(0,t.jsxs)("div",{className:"d-flex mb-2 justify-content-between",children:[(0,t.jsx)("h2",{className:"headline headline--block ",children:a("account.profile.becomeaffiliate")}),(0,t.jsx)(d,{isEditing:!$,onChange:e=>T(!e)})]}),(0,t.jsx)("div",{className:"d-flex flex-column mb-2",children:(0,t.jsx)("p",{className:"p--fs-15 p--c-forestlight",children:a("account.profile.becomeaffiliate_desc")})}),c&&(()=>{if(!c)return null;let{affiliate:e}=c;if(!e)return(0,t.jsx)(V,{});switch(e.status){case"new":return(0,t.jsx)("p",{children:a("account.profile.affiliatenew")});case"rejected":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{children:a("account.profile.affiliaterejected")}),(0,t.jsx)(V,{})]});case"accepted":return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{children:[a("account.profile.affiliateaccepted"),(0,t.jsx)(r.A,{href:`/${a("routes.affiliation")}`,className:"link link--underline link--tomato",children:a("account.profile.helplink")}),"."]}),(0,t.jsx)(V,{edit:!0,lockAffInfos:$,setLockAffInfos:T})]});default:return(0,t.jsx)(V,{})}})()]})]})})})]}),c&&c.institution&&e.geoObject?.geoObj&&(0,t.jsx)(C.A,{isOpen:j,onOpenChange:v,selectedBookstoreIds:c.institution.bookstores?.map(e=>e.id)||[],provinceId:c.institution.province?.id,regionId:c.institution.region?.id,postalCode:c.institution.delivery_place?.postal_code,onSave:D,isEditing:!0,geoObj:e.geoObject.geoObj})]})}},68421:(e,a,s)=>{"use strict";s.d(a,{A:()=>i});var t=s(14232),l=s(89097),n=s(21356);let i=()=>{let{currentUser:e,isAffiliate:a,refreshUserData:s}=(0,n.A)(),i=(0,t.useMemo)(()=>e?.affiliate??null,[e?.affiliate]),o=(0,t.useMemo)(()=>(e=>e?e.replace(/\r\n\r\n/g,",").replace(/\r\n/g,",").split(",").map(e=>e.trim()).filter(e=>e.length>0):[])(i?.targeted_websites),[i?.targeted_websites]),r=(0,t.useMemo)(()=>!!(i?.tax_gst_number||i?.tax_pst_number),[i?.tax_gst_number,i?.tax_pst_number]);return{affiliateInfos:i,isAffiliate:a,targetedWebsites:o,hasTaxNumbers:r,createAffiliate:(0,t.useCallback)(async e=>{let a=await (0,l.uq)(e);return s(),a},[s]),updateAffiliate:(0,t.useCallback)(async e=>{let a=await (0,l.Xy)(e);return s(),a},[s]),requestAffiliatePayout:l.Hq,getAffiliateItems:l.wE,getAffiliatePayouts:l.lu}}},89097:(e,a,s)=>{"use strict";s.d(a,{Hq:()=>c,QZ:()=>i,Xy:()=>r,lu:()=>m,uq:()=>o,wE:()=>d});var t=s(78365),l=s(7367);let n="affiliate",i={phone_number:20,comment:4096,tax_gst_number:20,tax_pst_number:20},o=async e=>await t.W6.post(n,e,l.qp),r=async e=>await t.W6.put(n,e,l.qp),c=async()=>await t.W6.post(`${n}/request-payout`,{},l.qp),d=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return await t.W6.get(`${n}/items`,{paid:e},l.qp)},m=async()=>await t.W6.get(`${n}/payouts`,{},l.qp)}},e=>{e.O(0,[8153,898,3580,4630,6593,636,8792],()=>e(e.s=45764)),_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.