1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5249],{7310:function(e,a,r){var i=r(28302),t=r(11121),s=r(6660),l=Math.max,n=Math.min;e.exports=function(e,a,r){var o,d,c,u,f,g,m=0,x=!1,h=!1,b=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(a){var r=o,i=d;return o=d=void 0,m=a,u=e.apply(i,r)}function p(e){var r=e-g,i=e-m;return void 0===g||r>=a||r<0||h&&i>=c}function y(){var e,r,i,s=t();if(p(s))return j(s);f=setTimeout(y,(e=s-g,r=s-m,i=a-e,h?n(i,c-r):i))}function j(e){return(f=void 0,b&&o)?v(e):(o=d=void 0,u)}function N(){var e,r=t(),i=p(r);if(o=arguments,d=this,g=r,i){if(void 0===f)return m=e=g,f=setTimeout(y,a),x?v(e):u;if(h)return clearTimeout(f),f=setTimeout(y,a),v(g)}return void 0===f&&(f=setTimeout(y,a)),u}return a=s(a)||0,i(r)&&(x=!!r.leading,c=(h="maxWait"in r)?l(s(r.maxWait)||0,a):c,b="trailing"in r?!!r.trailing:b),N.cancel=function(){void 0!==f&&clearTimeout(f),m=0,o=g=d=f=void 0},N.flush=function(){return void 0===f?u:j(t())},N}},11121:function(e,a,r){var i=r(74288);e.exports=function(){return i.Date.now()}},10721:function(e,a,r){"use strict";var i=r(57437),t=r(2265),s=r(84772),l=r.n(s),n=r(95390);let o=(0,t.forwardRef)((e,a)=>{let{ariaLabel:r,className:t,error:s,id:o,label:d,name:c,onChange:u,onBlur:f,disabled:g=!1}=e,m=l()("form-check-input float-left mt-1 mr-2 h-4 w-4 cursor-pointer appearance-none rounded-sm border border-gray-900 bg-white bg-contain bg-center bg-no-repeat transition duration-200 checked:border-blue-600 checked:bg-blue-600 focus:outline-none disabled:checked:border-gray-600 disabled:checked:bg-gray-600",{"border-red-600":s}),x=s?"".concat(o,"-error"):void 0;return(0,i.jsxs)(n.cw,{className:"flex flex-col text-base",children:[(0,i.jsxs)("div",{className:"flex items-start",children:[(0,i.jsx)("input",{"aria-label":r,"aria-describedby":s?x:void 0,className:l()(m,t,"mt-1"),id:o,name:c,onChange:u,onBlur:f,ref:a,type:"checkbox",disabled:g}),d&&(0,i.jsx)(n.lX,{className:l()("!mb-0 ml-2",{"text-red-600":s}),disabled:g,htmlFor:o,children:d})]}),(0,i.jsx)(i.Fragment,{children:s&&(0,i.jsx)("span",{id:x,role:"alert","aria-live":"assertive",className:"mt-1 text-sm text-red-600",children:s})})]})});a.Z=o},39114:function(e,a,r){"use strict";var i=r(57437),t=r(2265),s=r(84772),l=r.n(s),n=r(65972),o=r(95390),d=r(15338),c=r(10357);let u=(0,d.vU)({hidePassword:{id:"hidePassword",defaultMessage:"Hide Password"},showPassword:{id:"showPassword",defaultMessage:"Show Password"}}),f=(0,t.forwardRef)((e,a)=>{let{ariaLabel:r,ariaDescribedBy:t,ariaLabelledBy:s,ariaRole:d,autoComplete:f,className:g,disabled:m,error:x,id:h,inputType:b,label:v,maxLength:p,placeHolder:y,onChange:j=()=>{},onBlur:N=()=>{},name:w,setShowPassword:M,showPassword:R=!1}=e,{formatMessage:_}=(0,c.Z)(),C=x?"".concat(h,"-error"):void 0,S=l()("appearance-none shadow-none box-border m-0 !w-full px-3 py-2 bg-white","border border-secondary-highlight rounded","disabled:text-secondary-highlight","disabled:border-secondary-highlight disabled:border","disabled:placeholder:text-secondary-highlight",{"!border-warning-base":!!x},{"outline-0 border-2 border-border-hoopla-blue-light":!!x&&!m});return(0,i.jsxs)(o.cw,{children:[(0,i.jsx)(i.Fragment,{children:v&&(0,i.jsx)(o.lX,{disabled:m,hidden:!v,htmlFor:h,children:v})}),(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("input",{"aria-label":null!=r?r:v,className:(l()(g),S),disabled:null!=m&&m,id:h,maxLength:null!=p?p:250,placeholder:null!=y?y:"",ref:a,type:null!=b?b:"text",onChange:j,onBlur:N,name:w,autoComplete:f,"aria-describedby":x?C:t,"aria-labelledby":s}),M&&(0,i.jsx)("div",{className:"absolute top-2.5 right-3",children:(0,i.jsx)("button",{"aria-label":_(R?u.hidePassword:u.showPassword),className:"cursor-pointer",onClick:()=>M(!R),type:"button",children:R?(0,i.jsx)(n.Yz,{className:"fill-gray-700"}):(0,i.jsx)(n.uC,{className:"fill-gray-700"})})})]}),(0,i.jsx)(i.Fragment,{children:x&&(0,i.jsx)(o.Xq,{id:C,role:d,children:x})})]})});a.Z=f},24119:function(e,a,r){"use strict";r.d(a,{Ed:function(){return t},MP:function(){return s},jA:function(){return n},lV:function(){return c},vd:function(){return d}});var i=r(92433);let t="hoopla:login-splash",s="hoopla:login-splash-done",l="ssr-splash-login",
1n=e=>{let a=Number(e);return Number.isFinite(a)&&a>0?1e3*a:2e3},o=e=>{try{sessionStorage.removeItem("ssr-splash-shown"),sessionStorage.setItem(l,JSON.stringify({durationMs:e,ts:Date.now()}))}catch(e){}if(!window.dispatchEvent(new CustomEvent(t,{detail:{durationMs:e},cancelable:!0})))try{sessionStorage.removeItem(l)}catch(e){}},d=()=>{var e;let a=n(null===(e=i.y.getState().librarySplashSettings)||void 0===e?void 0:e.seconds);return o(a),a},c=()=>{try{let e=sessionStorage.getItem(l);if(!e)return null;sessionStorage.removeItem(l);let a=JSON.parse(e),r=Number(a.ts);if(!Number.isFinite(r)||Date.now()-r>1e4)return null;return{durationMs:a.durationMs&&a.durationMs>0?a.durationMs:2e3}}catch(e){return null}}},4721:function(e,a,r){"use strict";r.d(a,{Z:function(){return h}});var i=r(57437),t=r(2265),s=r(15338),l=r(10357),n=r(90933),o=r(106),d=r(65972),c=r(39114),u=r(70080),f=r(7310),g=r.n(f),m=r(77577);let x=(0,s.vU)({label:{id:"library.finder.label",defaultMessage:"Search by library name, city, state or zip"},placeholder:{id:"library.finder.placeholder",defaultMessage:"Search for your library"},searching:{id:"library.finder.searching",defaultMessage:"Searching for libraries..."},noResults:{id:"library.find.no.results",defaultMessage:"We couldn't find any libraries for that search term."},resultsAvailable:{id:"library.finder.results.available",defaultMessage:"{count, plural, =1 {1 library found} other {# libraries found}}"}});function h(e){let{pageName:a,onChange:r,library:s}=e,n=(0,m.Kx)({page:m.Zp})[1],[d,f]=(0,t.useState)(),[h,p]=(0,t.useState)(),[y,j]=(0,t.useState)(s),[N,w]=(0,t.useState)(!1);(0,t.useEffect)(()=>{n({page:"REGISTRATION_FIND_LIBRARY"},"replace"),o.h.fetchNearbyLibraries().then(e=>{(null==e?void 0:e.data)&&f(null==e?void 0:e.data)})},[]),(0,u.my)({name:a||"REGISTRATION_FIND_LIBRARY"},{category:"REGISTRATION",label:"find_your_library"});let{formatMessage:M}=(0,l.Z)(),R=g()(async function(e){if(e)try{let a=await o.h.fetchAutocompleteLibraryResults(e);setTimeout(()=>{p(null==a?void 0:a.data),w(!1)},50)}catch(e){p([]),w(!1)}else p(void 0),w(!1)},300);function _(e){let a=e.id===(null==y?void 0:y.id)?void 0:e;j(a),r(a)}return(0,i.jsxs)("div",{className:"flex w-full flex-col items-center",children:[(0,i.jsx)(c.Z,{id:"query",name:"query",onChange:function(e){var a;let r=null==e?void 0:null===(a=e.target)||void 0===a?void 0:a.value;r?w(!0):(p(void 0),w(!1)),R(r)},label:M(x.label),placeHolder:M(x.placeholder),ariaDescribedBy:N?void 0:"library-search-status"}),(0,i.jsxs)("div",{id:"library-search-status","data-testid":"library-search-status",className:"w-full text-lg font-semibold","aria-live":"polite","aria-atomic":"true",children:[(null==h?void 0:h.length)===0&&M(x.noResults),h&&h.length>0&&(0,i.jsx)("span",{className:"sr-only",children:M(x.resultsAvailable,{count:h.length})})]}),(0,i.jsx)("div",{className:"mt-2 flex max-h-[300px] w-full flex-col overflow-y-auto",children:function(){let e=h?h.length?v(y,h):h:d?v(y,d):[];return(null==h?void 0:h.length)===0?null:(0,i.jsx)("ul",{className:"flex max-h-[300px] w-full flex-col overflow-y-auto",children:e.map(e=>(0,i.jsx)("li",{className:"flex w-full flex-row items-center justify-between bg-white px-3 py-2 odd:bg-gray-200 hover:bg-hoopla-blue/10 focus:z-10",children:(0,i.jsx)(b,{library:e,selected:e.id===(null==y?void 0:y.id),onSelected:_})},e.id))})}()})]})}function b(e){var a;let{library:r,selected:t,onSelected:s}=e;return(0,i.jsxs)("button",{onClick:()=>s(r),type:"button",className:"flex w-full flex-row items-center justify-between hover:bg-hoopla-blue/10 focus:z-10 focus:bg-hoopla-blue/10",children:[(0,i.jsxs)("div",{className:"flex-auto truncate text-left",children:[(0,i.jsx)("p",{className:"truncate font-semibold",children:r.name}),(0,i.jsxs)("p",{className:"truncate text-sm text-gray-700",children:[(0,i.jsx)("span",{className:"capitalize",children:null==r?void 0:null===(a=r.city)||void 0===a?void 0:a.toLowerCase()}),(0,i.jsx)(n.Z,{id:"library.finder.location.separator",defaultMessage:", "}),(0,i.jsx)("span",{className:"uppercase",children:null==r?void 0:r.state})]})]}),(0,i.jsx)("div",{className:"flex-0 w-[24px]",children:t&&(0,i.jsx)(d.fU,{className:"fill-hoopla-blue",size:24})})]})}function v(e,a){if(!e||a.some(a=>a.id===e.id))return a;{let r=[...a];return r.unshift(e),r}}},95249:function(e,a,r){"use strict";r.r(a),r.d(a,{default:function(){return W}});var i=r(59950),t=r(57437),s=r(2265),l=r(15338),n=r(10357),o=r(23732),d=r(17731),c=r(90933),u=r(70080),f=r(66670),g=r(96738),m=r(54071),x=r(51972),h=r(77577),b=r(24119);function v(){var e,a,r;let{sendRegistrationEvent:i}=(0,u.ZP)(),l=(0,o.TH)(),n=(0,g.a)(e=>e.formData.registrationConfirmation),d=(0,h.Kx)({page:h.Zp})[1],v=(0,g.a)(e=>{var a;return null===(a=e.formData)||void 0===a?void 0:a.provisional}),{trackBranchEvent:p}=(0,x.e)(),y=null==n?void 0:null===(e=n.supportMessage)||void 0===e?void 0:e.replace("(","\n(");(0,s.useEffect)(()=>{d({page:"REGISTRATION_SUCCESS"},"replace")},[]),(0,u.my)({name:"REGISTRATION_SUCCESS"},{category:"REGISTRATION",label:"registration_success"});let j=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{j.current||(p("Registration_success"),j.current=!0)},[]),(0,t.jsxs)("div",{className:"flex h-full w-full flex-col",children:[(0,t.jsx)("img",{alt:"hoopla",className:"mx-auto w-56",src:f.Z.src}),(0,t.jsx)("h1",{className:"mx-auto my-4 text-2xl font-bold sm:text-3xl",children:(0,t.jsx)(c.Z,{id:"registration.intro.welcome",defaultMessage:"Welcome to hoopla!"})}
1),(0,t.jsxs)("div",{className:v?"space-y-3":"space-y-6",children:[(0,t.jsx)("p",{children:(0,t.jsx)(c.Z,{id:"registration.confirmation.fingertips",defaultMessage:"Your library is now at your fingertips!"})}),v?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"whitespace-pre-wrap",children:null==n?void 0:n.borrowMessage}),(0,t.jsx)("p",{children:null==n?void 0:n.kindMessage}),(0,t.jsx)("p",{className:"whitespace-pre-wrap",children:y})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{children:null==n?void 0:n.kindMessage}),(0,t.jsx)("p",{children:null==n?void 0:n.borrowMessage}),(0,t.jsx)("p",{className:"whitespace-pre-wrap",children:y})]})]}),(0,t.jsx)(m.ws,{className:"mx-auto mb-2 mt-auto flex h-12 w-11/12 items-center justify-center",onClick:()=>{i({label:"get_started"}),(0,b.vd)()},to:null!==(r=null==l?void 0:null===(a=l.state)||void 0===a?void 0:a.prevLocation)&&void 0!==r?r:"/my/hoopla",children:(0,t.jsx)(c.Z,{id:"registration.confirmation.getStarted",defaultMessage:"Get Started!"})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:(0,t.jsx)(c.Z,{id:"registration.confirmation.needHelp",defaultMessage:"Need Some Help?"})}),(0,t.jsx)(o.rU,{onClick:()=>i({label:"visit_help"}),to:"/faq",target:"_blank",rel:"noopener",children:(0,t.jsx)(c.Z,{id:"registration.confirmation.helpPages",defaultMessage:"Visit our help pages"})})]})]})}var p=r(72371),y=r(29501),j=r(106),N=r(10721),w=r(39114),M=r(32777),R=r(95390),_=r(22484),C=r(26396);let S=(0,l.vU)({libraryCard:{id:"registration.connect.libraryCard",defaultMessage:"Library Card"},libraryCardRequired:{id:"registration.connect.libraryCard.required",defaultMessage:"Library Card is required"},libraryPin:{id:"registration.connect.libraryPin",defaultMessage:"Library PIN"},libraryPinRequired:{id:"registration.connect.libraryPin.required",defaultMessage:"Library PIN is required"},libraryValidationError:{id:"registration.connect.libraryValidation",defaultMessage:"There was an issue validating your library, please try again."},locationValidationError:{id:"registration.connect.locationValidation",defaultMessage:"Your location is required to register without a library card, please check your location settings and try again."},firstName:{id:"registration.connect.firstName",defaultMessage:"First Name"},firstNameRequired:{id:"registration.connect.firstName.required",defaultMessage:"First Name is required"},lastName:{id:"registration.connect.lastName",defaultMessage:"Last Name"},lastNameRequired:{id:"registration.connect.lastName.required",defaultMessage:"Last Name is required"}}),Z=e=>{switch(e){case"AU":return(0,t.jsx)(c.Z,{id:"registration.country.au",defaultMessage:"Australia"});case"NZ":return(0,t.jsx)(c.Z,{id:"registration.country.nz",defaultMessage:"New Zealand"});default:return(0,t.jsx)(c.Z,{id:"registration.country.ca",defaultMessage:"Canada"})}};function A(e){var a,r,l,o,d;let f,{onBack:x=()=>{},onNext:b=()=>{}}=e,v=(0,h.Kx)({page:h.Zp})[1],{sendRegistrationEvent:A}=(0,u.ZP)(),{formatMessage:I}=(0,n.Z)(),E=(0,g.a)(e=>e.formData),T=(0,_.k)(e=>e.openModal),{getFlag:k}=(0,C.g)(),{register:P,handleSubmit:q,watch:L,setValue:O,setError:U,formState:{errors:F,isSubmitting:D}}=(0,y.cI)({defaultValues:(0,i._)({},E)}),{library:G}=E,[H,Y]=(0,s.useState)(""),B=L("provisional"),z=k("releaseTermsAndPrivacyRegistration");async function W(e){let{libraryCard:a,libraryPin:r,nonUsAgreement:i,provisional:t,firstName:s,lastName:l}=e,n=(null==G?void 0:G.id)||-1;if(B)try{f=(await new Promise((e,a)=>navigator.geolocation.getCurrentPosition(e,a))).coords}catch(e){return Y(I(S.locationValidationError))}try{await j.h.validateLibrary({libraryId:Number(n),libraryCard:a,libraryPin:r,latitude:null==f?void 0:f.latitude,longitude:null==f?void 0:f.longitude}),A({label:"submit_card",value:t?{provisional:!0}:void 0}),Y(""),b({coords:f,libraryCard:a,libraryPin:r,nonUsAgreement:i,provisional:t,firstName:s,lastName:l}),z&&T("review")}catch(r){var o,d,c,u,g,m,x,h;let e=null==r?void 0:null===(d=r.response)||void 0===d?void 0:null===(o=d.data)||void 0===o?void 0:o.reason;
1if(("CARD_EXISTS_ERROR"===e||"CARD_PIN_ERROR"===e)&&("CARD_EXISTS_ERROR"===e||!(null==G?void 0:null===(g=G.settings)||void 0===g?void 0:g.pinRequired)))return U("libraryCard",{message:null==r?void 0:null===(x=r.response)||void 0===x?void 0:null===(m=x.data)||void 0===m?void 0:m.message});let a=null!==(h=null==r?void 0:null===(u=r.response)||void 0===u?void 0:null===(c=u.data)||void 0===c?void 0:c.message)&&void 0!==h?h:I(S.libraryValidationError);return A({label:"card_authentication_error"}),Y(a)}}return(0,s.useEffect)(()=>{v({page:"REGISTRATION_LIBRARY_INFO"},"replace")},[]),(0,s.useEffect)(()=>{O("libraryCard",""),O("libraryPin",""),O("firstName",""),O("lastName","")},[B,O]),(0,u.my)({name:"REGISTRATION_LIBRARY_INFO"},{category:"REGISTRATION",label:"connect_with_your_library"}),(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsx)(M.v,{onBack:()=>x({libraryCard:void 0,libraryPin:void 0,nonUsAgreement:void 0,provisional:void 0,firstName:void 0,lastName:void 0})}),(0,t.jsxs)("form",{className:"flex h-full flex-col",onSubmit:q(W),children:[(0,t.jsx)("h1",{className:"mb-2 text-center text-3xl font-bold",children:(0,t.jsx)(c.Z,{id:"registration.library.connect",defaultMessage:"Connect With Your Library"})}),(null==G?void 0:G.registrationMessage)&&(0,t.jsx)("p",{children:null==G?void 0:G.registrationMessage}),(0,t.jsxs)("div",{className:"mt-4",children:[B&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,(0,i._)({disabled:D,id:"firstName",error:null==F?void 0:null===(a=F.firstName)||void 0===a?void 0:a.message,label:I(S.firstName),placeHolder:I(S.firstName)},P("firstName",{required:I(S.firstNameRequired)}))),(0,t.jsx)(w.Z,(0,i._)({disabled:D,id:"lastName",error:null==F?void 0:null===(r=F.lastName)||void 0===r?void 0:r.message,label:I(S.lastName),placeHolder:I(S.lastName)},P("lastName",{required:I(S.lastNameRequired)})))]}),!B&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,(0,i._)({className:"!mb-0",disabled:D,id:"libraryCard",error:null==F?void 0:null===(l=F.libraryCard)||void 0===l?void 0:l.message,label:I(S.libraryCard),placeHolder:I(S.libraryCard)},P("libraryCard",{required:I(S.libraryCardRequired)}))),(null==G?void 0:G.pinRequired)&&(0,t.jsx)(w.Z,(0,i._)({disabled:D,id:"libraryPin",error:null==F?void 0:null===(o=F.libraryPin)||void 0===o?void 0:o.message,label:I(S.libraryPin),maxLength:50,placeHolder:I(S.libraryPin)},P("libraryPin",{required:I(S.libraryPinRequired)})))]})]}),H&&(0,t.jsx)("p",{id:"form-error",className:"mb-6 text-sm text-red-600",role:"alert",children:H}),(null==G?void 0:G.libraryCardUrl)&&(0,t.jsx)("a",{className:"mx-auto mb-4 text-hoopla-blue hover:text-blue-400",href:G.libraryCardUrl,onClick:()=>A({label:"request_card"}),target:"_blank",rel:"noreferrer",children:(0,t.jsx)(c.Z,{id:"registration.library.needCard",defaultMessage:"Need a library card?"})}),(0,t.jsxs)("div",{className:"space-y-6",children:[(null==G?void 0:G.provisionalSignupAllowed)&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(N.Z,(0,p._)((0,i._)({},P("provisional")),{id:"provisional",label:(0,t.jsx)(c.Z,{id:"registration.library.provisional",defaultMessage:"I don't have a library card but I'd like to try hoopla"})}))}),(null==G?void 0:G.country)!=="US"&&(0,t.jsx)(N.Z,(0,p._)((0,i._)({},P("nonUsAgreement",{required:I({id:"checkbox.nonUsAgreement.required",defaultMessage:"Agreement or acknowledgement is required"})})),{id:"nonUsAgreement",error:null==F?void 0:null===(d=F.nonUsAgreement)||void 0===d?void 0:d.message,label:(0,t.jsx)(c.Z,{id:"registration.library.info.ca.exchange",defaultMessage:"I agree to allow hoopla to verify and exchange my hoopla registration information with my public library. I acknowledge my registration information will be collected, accessed, and stored outside of {country}.",values:{country:Z(null==G?void 0:G.country)}})}))]}),(0,t.jsx)(m.KM,{className:"mx-auto mt-auto h-12 w-11/12",onClick:q(W),type:"submit",disabled:D,children:D?(0,t.jsx)(R.gb,{secondary:!0,width:30,height:30,delay:0}):(0,t.jsx)(c.Z,{id:"registration.button.next",defaultMessage:"Next"})})]})]})}var I=r(4721);function E(e){let{onBack:a=()=>{},onNext:r=()=>{}}=e,i=(0,g.a)(e=>e.formData),{sendRegistrationEvent:l}
1=(0,u.ZP)(),[n,d]=(0,s.useState)(i.library),[f,x]=(0,s.useState)(null);return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col items-center",children:[(0,t.jsx)(M.v,{onBack:function(){a({library:void 0})}}),(0,t.jsx)("h1",{className:"mb-2 text-center text-3xl font-bold",children:(0,t.jsx)(c.Z,{id:"registration.find.library.heading",defaultMessage:"Find Your Library"})}),(0,t.jsx)(I.Z,{onChange:function(e){d(e),x(null)},library:i.library,pageName:"REGISTRATION_FIND_LIBRARY"}),(0,t.jsx)("p",{className:"text-sm text-red-700",role:"alert",children:f}),(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-1",children:[(0,t.jsx)("p",{className:"text-center text-gray-500",id:"library-finder-help-text",children:(0,t.jsx)(c.Z,{id:"registration.find.library.not.found",defaultMessage:"Donât see your library? This may be because they do not offer hoopla yet."})}),(0,t.jsx)(o.rU,{to:"/find-library",onClick:()=>l({label:"request_hoopla_here"}),children:(0,t.jsx)(c.Z,{id:"registration.find.library.request.link",defaultMessage:"Request hoopla here!"})})]})]}),(0,t.jsx)(m.KM,{className:"mt-6 h-12 w-11/12",onClick:function(){n?(l({label:"library_selected",value:{libraryId:n.id}}),r({library:n})):x((0,t.jsx)(c.Z,{id:"registration.library.find.error",defaultMessage:"You must select a library to continue"}))},children:(0,t.jsx)(c.Z,{id:"registration.button.next",defaultMessage:"Next"})})]})}function T(e){var a;let{onBack:r=()=>{},onNext:i=()=>{}}=e,l=null===(a=(0,o.TH)().state)||void 0===a?void 0:a.prevLocation,{sendRegistrationEvent:n}=(0,u.ZP)(),{trackBranchEvent:d}=(0,x.e)(),{getFlag:b}=(0,C.g)(),v=(0,_.k)(e=>e.fetchRegistrationTerms),p=(0,_.k)(e=>e.openModal),y=(0,g.a)(e=>e.stepCount),j=b("releaseTermsAndPrivacyRegistration"),N=(0,h.Kx)({page:h.Zp})[1];return(0,s.useEffect)(()=>{N({page:"REGISTRATION_WELCOME"},"replace"),j&&v()},[]),(0,u.my)({name:"REGISTRATION_WELCOME"},{category:"REGISTRATION",label:"registration_welcome"}),(0,t.jsxs)("div",{className:"flex w-full flex-col items-center",children:[(0,t.jsx)(M.v,{onBack:()=>r()}),(0,t.jsx)("img",{alt:"hoopla",className:"w-56",src:f.Z.src}),(0,t.jsx)("h1",{className:"mb-3 mt-5 text-2xl font-bold sm:text-3xl",children:(0,t.jsx)(c.Z,{id:"registration.intro.welcome",defaultMessage:"Welcome to hoopla!"})}),(0,t.jsxs)("div",{className:"space-y-4 text-gray-700",children:[(0,t.jsx)("p",{children:(0,t.jsx)(c.Z,{id:"registration.intro.withHoopla",defaultMessage:"With hoopla, your library card lets you instantly read, listen, and watch your favorite titles."})}),(0,t.jsx)("p",{children:(0,t.jsx)(c.Z,{id:"registration.intro.quickAndEasy",defaultMessage:"Sign-up is quick and easy. Thanks to participating public libraries, access is FREE."})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{children:(0,t.jsx)(c.Z,{id:"registration.intro.allYouNeed",defaultMessage:"All you need is:"})}),(0,t.jsxs)("ul",{children:[(0,t.jsx)("li",{className:"left-1 list-inside list-disc before:-mr-1",children:(0,t.jsx)("span",{children:(0,t.jsx)(c.Z,{id:"registration.intro.validCard",defaultMessage:"Your valid library card number (and PIN if required)"})})}),(0,t.jsx)("li",{className:"list-inside list-disc before:-mr-1",children:(0,t.jsx)("span",{children:(0,t.jsx)(c.Z,{id:"registration.intro.validEmail",defaultMessage:"A valid email address"})})})]})]})]}),(0,t.jsx)(m.KM,{className:"mt-6 mb-4 h-12 w-11/12",onClick:()=>{n({label:"lets_go"}),d("Start_registration"),i(),2===y&&j&&p("review")},children:(0,t.jsx)(c.Z,{id:"registration.intro.button",defaultMessage:"Let's Go!"})}),!j&&(0,t.jsx)(k,{}),(0,t.jsxs)("p",{className:"mt-4 mb-1 text-center",children:[(0,t.jsx)(c.Z,{id:"registration.intro.alreadyHaveAccount",defaultMessage:"Already have an account? "}),(0,t.jsx)(o.rU,{className:"ml-1",onClick:()=>n({label:"login_clicked"}),to:"/login",state:{prevLocation:l},replace:!0,children:(0,t.jsx)(c.Z,{id:"login.button",defaultMessage:"Login"})})]})]})}let k=()=>{let{sendRegistrationEvent:e}=(0,u.ZP)();return(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-1",children:[(0,t.jsx)("p",{className:"text-center text-gray-500",children:(0,t.jsx)(c.Z,{id:"registration.intro.conditions.privacy",defaultMessage:"By registering, you agree to our terms and conditions and privacy policy"})}),(0,t.jsx)(o.rU,{onClick:()=>e({label:"terms_and_conditions"}),to:"/terms",target:"_blank",rel:"noopener",children:(0,t.jsx)(c.Z,{id:"registration.intro.termsAndConditions",defaultMessage:"Terms and Conditions"})}),(0,t.jsx)(o.rU,{onClick:()=>e({label:"privacy_policy"}),to:"/privacy",target:"_blank",rel:"noopener",children:(0,t.jsx)(c.Z,{id:"registration.intro.privacyPolicy",defaultMessage:"Privacy Policy"})})]})};var P=r(8997),q=r(92150),L=r(19634),O=r(97849);
1let U=(0,l.vU)({email:{id:"registration.account.libraryCard",defaultMessage:"Email"},emailRequired:{id:"registration.account.email.required",defaultMessage:"Email is required"},emailInvalid:{id:"setting.email.invalid",defaultMessage:"Your email appears to be invalid."},password:{id:"registration.account.password",defaultMessage:"Password"},passwordRequired:{id:"registration.account.password.required",defaultMessage:"Password is required"},passwordLength:{id:"registration.account.password.length",defaultMessage:"Your password must be between 8 and 40 characters"},registrationError:{id:"registration.account.registrationError",defaultMessage:"There was an error creating your account, please try again."},registrationSuccessHeader:{id:"registration.success.header",defaultMessage:"Login Success"},registrationSuccessBody:{id:"registration.success.body",defaultMessage:"Your email and password match information we have for an existing hoopla user. You have been logged in to that account."}});function F(e){var a,r,l;let{onBack:d=()=>{},onNext:f=()=>{}}=e,x=(0,O.mC)(),{sendRegistrationEvent:v}=(0,u.ZP)(),{getFlag:j}=(0,C.g)(),S=(0,_.k)(e=>e.docId),Z=j("releaseTermsAndPrivacyRegistration"),{register:A,handleSubmit:I,formState:{errors:E,isSubmitting:T}}=(0,y.cI)({defaultValues:{email:"",emailConsent:!1,password:"",notificationConsent:!1},mode:"onTouched"}),{formatMessage:k}=(0,n.Z)(),F=(0,o.TH)(),D=(0,o.s0)(),{setNotification:G}=(0,L.l)(),{loginUser:H,loginUserV2:Y}=(0,g.E)(),B=(0,h.Kx)({page:h.Zp})[1],z=(0,g.a)(e=>e.formData),W=(0,g.a)(e=>e.formData.library),[V,K]=(0,s.useState)(""),[X,J]=(0,s.useState)(!1),Q=(0,s.useRef)(!1),$=Z?P.h.registerUserV2:P.h.registerUser,ee=Z?Y:H;async function ea(e){var a,r,t,s,l,n,o,d,c,u;let{email:g,emailConsent:m,password:h,notificationConsent:y}=e;try{let e=(null==W?void 0:W.id)||-1,t=(null==W?void 0:null===(a=W.country)||void 0===a?void 0:a.abbrev)==="US"||m,s=(null==W?void 0:null===(r=W.country)||void 0===r?void 0:r.abbrev)==="US"||y,l={email:g,password:h,libraryId:e,emailConsent:t,notificationConsent:s},n=(0,i._)({},z,l),{firstName:o,lastName:d,libraryCard:c,libraryPin:u}=z,b=(0,p._)((0,i._)({},l),{firstName:o,lastName:d,libraryCard:c,libraryPin:u,docId:S,termsOfUseAccepted:!0}),j=(await $(Z?b:n)).data;K(""),v({label:"complete_signup"}),x&&x.track("registration_success");let{token:N}=j;await ee(N),f({email:g,emailConsent:t,password:h,registrationConfirmation:j,notificationConsent:s})}catch(a){let e=null!==(o=null==a?void 0:null===(s=a.response)||void 0===s?void 0:null===(t=s.data)||void 0===t?void 0:t.message)&&void 0!==o?o:k(U.registrationError);if((null===(n=a.response)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.reason)==="PATRON_EXISTS_ERROR"){let{authToken:e}=null==a?void 0:null===(d=a.response)||void 0===d?void 0:d.data;if(e)return await ee(e),G({messageLevel:L.P.success,messageHeader:k(U.registrationSuccessHeader),messageBody:k(U.registrationSuccessBody)}),(0,b.vd)(),D(null!==(u=null==F?void 0:null===(c=F.state)||void 0===c?void 0:c.prevLocation)&&void 0!==u?u:"/my/hoopla")}K(e)}}return(0,s.useEffect)(()=>{B({page:"REGISTRATION_ACCOUNT_INFO"},"replace"),x&&!Q.current&&(x.track("registration_intent"),Q.current=!0)},[]),(0,u.my)({name:"REGISTRATION_ACCOUNT_INFO"},{category:"REGISTRATION",label:"almost_done"}),(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[Z&&(0,t.jsx)(q.Z,{}),(0,t.jsx)(M.v,{onBack:()=>d()}),(0,t.jsxs)("form",{className:"flex h-full w-full flex-col",onSubmit:I(ea),children:[(0,t.jsx)("h1",{className:"mb-2 text-center text-3xl font-bold",children:(0,t.jsx)(c.Z,{id:"registration.account.almost",defaultMessage:"Almost Done!"})}),(0,t.jsx)("div",{className:"flex flex-col items-center space-y-1",children:(0,t.jsx)("p",{className:"text-left text-gray-500",children:(0,t.jsx)(c.Z,{id:"registration.account.emailConsent.info",defaultMessage:"We promise not to flood your inboxâwe will only use your email address for essential communications."})})}),(0,t.jsxs)("div",{className:"my-4",children:[(0,t.jsx)(w.Z,(0,i._)({autoComplete:"email",disabled:T,id:"email",error:null==E?void 0:null===(a=E.email)||void 0===a?void 0:a.message,label:k(U.email),maxLength:75,placeHolder:k(U.email)},A("email",{required:k(U.emailRequired),pattern:{value:/\S+@\S+\.\S+/,message:k(U.emailInvalid)}}))),(0,t.jsx)(w.Z,(0,p._)((0,i._)({autoComplete:"new-password",disabled:T,id:"password",error:null==E?void 0:null===(r=E.password)||void 0===r?void 0:r.message,inputType:X?"text":"password",label:k(U.password),maxLength:40,"aria-describedby":"password-format",placeHolder:k(U.password)},A("password",{required:k(U.passwordRequired),minLength:{value:8,message:k(U.passwordLength)},maxLength:{value:40,message:k(U.passwordLength)}})),{showPassword:X,setShowPassword:J})),(0,t.jsx)("p",{id:"password-format",className:"-mt-4 text-text-2-light dark:text-text-2-dark",children:(0,t.jsx)(c.Z,{id:"registration.account.password.info",defaultMessage:"Must be 8 to 40 characters long"})})]}),(null==W?void 0:null===(l=W.country)||void 0===l?void 0:l.abbrev)!=="US"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.Z,(0,p._)((0,i._)({},A("emailConsent")),{id:"emailConsent",label:(0,t.jsx)(c.Z,{id:"registration.account.emailConsent",defaultMessage:"Please email me about new hoopla content and features"})})),(0,t.jsx)(N.Z,(0,p._)((0,i._)({},A("notificationConsent")),{id:"notificationConsent",label:(0,t.jsx)(c.Z,{id:"registration.account.notificationConsent",defaultMessage:"Please send me push notifications about new hoopla content and features"})}))]}),V&&(0,t.jsx)("p",{id:"form-error",className:"text-sm text-red-600",role:"alert",children:V}),(0,t.jsx)(m.KM,{className:"mx-auto mt-auto h-12 w-11/12",type:"submit",disabled:T,children:T?(0,t.jsx)(R.gb,{secondary:!0,width:30,height:30,delay:0}):(0,t.jsx)(c.Z,{id:"registration.button.complete",defaultMessage:"Complete Registration"})})]})]})}
1var D=r(80108),G=r(65972);function H(e){let{onBack:a=()=>{}}=e,r=(0,g.a)(e=>e.formData.library),i=(0,D.A)(e=>e.setSSORegistrationPending),{sendRegistrationEvent:l}=(0,u.ZP)();return(0,s.useEffect)(()=>{l({label:"sso_signup_started",value:{partnerId:null==r?void 0:r.partnerId}})},[]),(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col items-center",children:[(0,t.jsx)(M.v,{onBack:function(){a({library:void 0})}}),(0,t.jsx)("h1",{className:"mb-2 text-center text-3xl font-bold",children:(0,t.jsx)(c.Z,{id:"registration.sso.intro.heading",defaultMessage:"Log In Through Your Organization"})}),(0,t.jsx)("div",{className:"flex flex-col items-center space-y-1",children:(0,t.jsx)("p",{className:"text-center text-gray-500",id:"library-finder-help-text",children:(0,t.jsx)(c.Z,{id:"registration.sso.intro.description",defaultMessage:"Your organizationâs credentials are how you'll access Hoopla."})})}),(0,t.jsxs)("div",{className:"flex flex-row items-center space-y-1 bg-[#2050DD1F] rounded-3xl border border-1 border-hoopla-blue p-4 mt-5",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(G.ER,{className:"mb-0.5 fill-hoopla-blue",size:24})}),(0,t.jsx)("p",{className:"text-left text-hoopla-blue flex-1 pl-4 font-semibold",children:(0,t.jsx)(c.Z,{id:"registration.sso.intro.login.explanation",defaultMessage:'After sign up, you can use this account on other devices by tapping "Log in through your organization" on the login screen.'})})]})]}),(0,t.jsx)(m.KM,{className:"mt-6 h-12 w-11/12",onClick:function(){(null==r?void 0:r.startUrl)&&(i(!0),window.location.href=r.startUrl)},children:(0,t.jsx)(c.Z,{id:"registration.button.continue",defaultMessage:"Continue"})})]})}var Y=r(88162),B=r(53334);let z=(0,l.vU)({register:{id:"hoopla.registration.title",defaultMessage:"Register"}});function W(){let{formatMessage:e}=(0,n.Z)(),{libraryUrlRegistrationId:a}=(0,o.UO)(),{setupRegistration:r,formData:l,loading:c,steps:u,step:f,registrationSuccess:m,onNext:x,onBack:h,teardown:b}=(0,g.E)(),{isSSOPhase2Enabled:p}=(0,Y.K)();return(0,s.useEffect)(()=>{r(a)},[a,r]),(0,s.useEffect)(()=>b,[]),(0,t.jsx)(M.g,{children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.q,{title:"".concat(e(z.register)," | hoopla"),meta:[{name:"title",description:e(z.register)}]}),function(){if(c)return(0,t.jsx)(R.gb,{});if(m)return(0,t.jsx)(v,{});let e=null==u?void 0:u[f];if(!e)return null;let a={onNext:x,onBack:h};switch(e.componentName){case"Introduction":return(0,t.jsx)(T,(0,i._)({},a));case"FindLibrary":return(0,t.jsx)(E,(0,i._)({},a));case"ConnectLibrary":return(0,B.qF)(p,l.library)?(0,t.jsx)(H,(0,i._)({},a)):(0,t.jsx)(A,(0,i._)({},a));case"SetupAccount":return(0,t.jsx)(F,(0,i._)({},a));default:return null}}()]})})}},19634:function(e,a,r){"use strict";r.d(a,{P:function(){return t},l:function(){return n}});var i,t,s=r(89148);(i=t||(t={})).error="ERROR",i.success="SUCCESS",i.info="INFO";let l=(0,s.Z)(e=>({notificationMessage:void 0,clearNotification:()=>e({notificationMessage:void 0}),setNotification:a=>e({notificationMessage:a})})),n=()=>({clearNotification:l(e=>e.clearNotification),notificationMessage:l(e=>e.notificationMessage),setNotification:l(e=>e.setNotification)})},66670:function(e,a){"use strict";a.Z={src:"/_next/static/media/hoopla_logo_no_r.6bf2db23.png",height:222,width:640,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAYAAACuyE5IAAAAbUlEQVR4nGM0WPE8k/HfHwaG//+vMDCzcDL8+/vl////XoyMTA8ZmRj3MOqvehX7//PbIEZ2rl8MTMy/GX9+/fmPmdWEkZn1OSML61pGvUX35f59/yzMxMUrz/CfgRFolAvQhO2MTMwcDAyMlwFihCfj+2gFWQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:3}}}]);
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.