PageSourceSearch

https://www.booksellers.ca/_next/static/chunks/358-73d53274216ffc99.js

js booksellers.ca collected 2026-09-26 08:49:23 UTC 33,464 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]="82c9488a-74cb-481a-a376-8ff6bbb9fd37",e._sentryDebugIdIdentifier="sentry-dbid-82c9488a-74cb-481a-a376-8ff6bbb9fd37")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{8510:(e,t,l)=>{"use strict";l.d(t,{Cf:()=>o,Ie:()=>h,cY:()=>b,kP:()=>p,kW:()=>d,nV:()=>m,xI:()=>u});var a=l(35088);let s=["new_releases","forthcoming","booksellers_picks","best_sellers"],n=[a.XQ.IN_INVENTORY,a.XQ.ORDER,a.XQ.PREORDER],r=[a.XQ.IN_BOOKSTORE_INVENTORY,...n],i=e=>!e||(e.bookstores?.length??0)>1,o=e=>i(e)?r:n,c=(e,t,l)=>e.map(e=>({id:e,label:{fr:l(`${t}.${e}`),en:l(`${t}.${e}`)}})),d=(e,t)=>{let{currStore:l,organization:a,t:o}=t;if(!e||0===Object.keys(e).length)return e;let d=(e=>{let{currStore:t,organization:l}=e;return(e=>{let{currStore:t,organization:l}=e;return null!=t&&i(l)})({currStore:t,organization:l})?r:n})({currStore:l,organization:a});return{...e,sections:c(s,"catalog.facets.section",o),availability:c(d,"catalog.facets.availabilities",o)}},u=(e,t)=>{if(!e||!Array.isArray(e)||!t||!Array.isArray(t))return[];let l=[];for(let a of e)(t.includes(a.id.toString())||t.includes(a.id))&&l.push(a),a.children&&a.children.length>0&&l.push(...u(a.children,t));return l},h=(e,t)=>{if(!e||!Array.isArray(e))return null;for(let l of e){if(l.id.toString()===t.toString())return l;if(l.children&&l.children.length>0){let e=h(l.children,t);if(e)return e}}return null},m=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!Array.isArray(e))return null;for(let a of e){if(a.id.toString()===t.toString())return l;if(a.children&&a.children.length>0){let e=m(a.children,t,a);if(null!==e)return e}}return null},b=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e||!Array.isArray(e))return null;for(let a of e){if(a.id.toString()===t.toString())return l;if(a.children&&a.children.length>0){let e=b(a.children,t,[...l,a]);if(null!==e)return e}}return null},p=e=>{if(!e||!e.children||0===e.children.length)return[];let t=[];for(let l of e.children)t.push(l),t.push(...p(l));return t}},20960:(e,t,l)=>{"use strict";l.d(t,{c:()=>r});var a=l(14232),s=l(89099),n=l(48690);let r=()=>{let e=(0,s.useRouter)(),{asPath:t}=e,l=(0,a.useMemo)(()=>(0,n.ng)(t),[t]),r=(0,a.useRef)(e.query);r.current=e.query;let i=(0,a.useRef)(e.push);i.current=e.push;let o=(0,a.useRef)(e.replace);o.current=e.replace;let c=(0,a.useCallback)(function(e,t,l){let{scroll:a=!1,shallow:s=!0}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return("push"===e?i.current:o.current)({pathname:t,query:(0,n.Wl)(r.current,l)},"",{scroll:a,shallow:s})},[]),d=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return c("push",l,e,t)},[c,l]),u=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return c("replace",l,e,t)},[c,l]),h=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;return c("push",e,t,l)},[c]);return(0,a.useMemo)(()=>({pushQueryUpdate:d,replaceQueryUpdate:u,pushPath:h}),[d,u,h])}},22844:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var a=l(37876),s=l(14232),n=l(19758),r=l(2847),i=l(47286),o=l(39906),c=l(79881);let d=(0,s.memo)(e=>{let{children:t,className:l="",mobileToggleText:s,mobileToggleIcon:d="menu"}=e,u=(0,i.A)((0,r.uT)("md"),!0),h=(0,i.A)((0,r.uT)("md")),m=(0,a.jsxs)("div",{children:[t,h&&(0,a.jsx)("div",{className:"mt-4 d-flex justify-content-center",children:(0,a.jsx)(o.A,{zone:n.mA.LEFT_SIDEBAR})})]});return s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"col-12 d-md-none mb-3",children:(0,a.jsxs)(c.A,{children:[(0,a.jsx)(c.A.Button,{icon:d,className:"link--icon btn btn--outline btn--outline--forest text-center mb-2 w-100",ariaLabel:s,children:s}),(0,a.jsx)(c.A.Content,{title:s,children:u?null:m})]})}),(0,a.jsx)("div",{className:`col-md-4 two-columns__sidebar d-none d-md-block ${l}`,children:u?m:null})]}):(0,a.jsx)("div",{className:`col-md-4 two-columns__sidebar ${l}`,children:m})});d.displayName="TwoColumnsWrapper.Left";let u=(0,s.memo)(e=>{let{children:t,className:l=""}=e;return(0,a.jsx)("div",{className:`col-md-8 catalog-grid two-columns__main ${l}`,children:t})});u.displayName="TwoColumnsWrapper.Right";let h=(0,s.memo)(e=>{let{children:t,className:l=""}=e;return(0,a.jsx)("section",{className:`section section--pt-20 ${l}`,children:(0,a.jsx)("div",{className:"row",children:s.Children.map(t,e=>e?(e.type===d||e.type,e):null)})})});h.displayName="TwoColumnsWrapper",h.Left=d,h.Right=u;let m=h},30148:(e,t,l)=>{"use strict";l.d(t,{A:()=>h});var a=l(37876),s=l(14232),n=l(86216),r=l(47286),i=l(25117),o=l(12212),c=l(21468),d=l(75975);let u=e=>e>99?"99+":e,h=e=>{let{from:t,title:l,querySearch:h}=e,{t:m}=(0,o.B)(),b=(0,r.A)("(max-width: 768px)"),{subdomain:p,organization:f,currStore:g}
1=(0,i.Z)(),[x,j]=(0,s.useState)(0),[y,_]=(0,s.useState)(0),v=p&&f?f.id:void 0,k=g?g.id:void 0,A=(0,n.I2)(h);(0,s.useEffect)(()=>{if(A.length<n.I3){j(0),_(0);return}let e=new AbortController;return(async()=>{let t=await (0,n.$P)({query:A,organizationId:v,bookstoreId:k},{signal:e.signal});t&&(j(t.books?.data?.length?u(Number(t.books.total)):0),_(t.products?.data?.length?u(Number(t.products.total)):0))})(),()=>e.abort()},[A,v,k]);let N=e=>{if(!e)return e;let t=e.split(/Theme:|Thème:/);return t.length>1?t[1]:e},C=!!h&&(h.includes("Theme:")||h.includes("Th\xe8me:")),w=N(h);return(0,a.jsxs)("div",{className:"catalog-switcher p-2 pt-4 pb-2 p-sm-4 pb-2",children:[(0,a.jsxs)("div",{className:"d-block flex-column flex-sm-row align-items-center mb-3",children:[(0,a.jsx)("h1",{className:"headline headline--main",children:l}),h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"headline headline--block headline--weight--bold mb-2 d-flex flex-wrap align-items-center","aria-label":m(`catalog.productswitcher.searchfor${C?"theme":""}simple`,{searched:N(h)}),children:(0,a.jsxs)("div",{className:"d-flex flex-wrap align-items-center",children:[(0,a.jsx)("span",{className:"d-none d-sm-block me-3 span--c-tomato",style:{maxWidth:"20px",width:"20px"},children:(0,a.jsx)(c.A,{value:"search"})}),(0,a.jsx)("p",{className:"mb-0",children:m.rich(`catalog.productswitcher.searchfor${C?"theme":""}`,{searched:w,highlight:e=>(0,a.jsx)("span",{className:"span--c-tomato",children:e})})})]})}),(0===x||0===y)&&(0,a.jsx)("small",{className:"span--c-tomato span--fs-13 d-block py-2 d-flex align-items-center",style:{lineHeight:"18px"},children:(0,a.jsxs)("span",{children:[m("catalog.productswitcher.noresults"),"?\xa0",(0,a.jsx)(d.A,{href:`/contact?s=6&q=${encodeURIComponent(h)}`,className:"link link--underline",children:m("catalog.productswitcher.contactus")}),"."]})})]}):null]}),h&&(x>0||y>0)&&(0,a.jsxs)("div",{className:"catalog-switcher__wrapper d-flex flex-nowrap mb-4 mt-3 overflow-x-auto",children:[(0,a.jsx)("div",{className:`${"books"===t?"order-1 me-3 me-sm-2":"order-2"}`,children:(0,a.jsxs)(d.A,{href:`/${m("routes.catalog")}?s=${encodeURIComponent(h)}&sort=pertinence`,prefetch:!1,className:`btn text-nowrap btn--medium ${"books"===t?"btn--raised btn--raised--tomato":"btn--outline btn--outline--tomato"}`,style:{pointerEvents:"books"!==t?"all":"none"},children:[(0,a.jsx)("span",{className:"me-2",children:"books"===t?(0,a.jsx)(c.A,{value:"checked"}):(0,a.jsx)(c.A,{value:"unchecked"})}),(0,a.jsx)("span",{className:"span--weight--regular",children:m.rich("catalog.productswitcher.result",{type:"books",length:b?"short":"long",count:x,bold:e=>(0,a.jsx)("strong",{children:e})})})]})}),(0,a.jsx)("div",{className:`${"products"===t?"order-1 me-3 me-sm-2":"order-2"}`,children:(0,a.jsxs)(d.A,{href:`/${m("routes.products")}?s=${encodeURIComponent(h)}&sort=pertinence`,prefetch:!1,style:{pointerEvents:"products"!==t?"all":"none"},className:`btn text-nowrap btn--medium ${"products"===t?"btn--raised btn--raised--tomato":"btn--outline btn--outline--tomato"}`,children:[(0,a.jsx)("span",{className:"me-2",children:"products"===t?(0,a.jsx)(c.A,{value:"checked"}):(0,a.jsx)(c.A,{value:"unchecked"})}),(0,a.jsx)("span",{className:"span--weight--regular",children:m.rich("catalog.productswitcher.result",{type:"products",length:b?"short":"long",count:y,bold:e=>(0,a.jsx)("strong",{children:e})})})]})})]})]})}},31322:(e,t,l)=>{"use strict";l.d(t,{A:()=>g});var a=l(37876),s=l(14232),n=l(96010),r=l(89099),i=l(12212),o=l(74474),c=l(18725),d=l(86303),u=l(69984),h=l(86216),m=l(24903);let b=Object.values(d.d4),p=[d.d4.POPULARITY,d.d4.NAME,d.d4.SALES],f={s:{type:"string",default:""},sort:{type:"string",default:""}},g=(0,s.memo)(e=>{let{t}=(0,i.B)(),l=(0,r.useRouter)(),{s:g,sort:x,isReady:j}=(0,o.I)(f),y=(0,s.useMemo)(()=>{let t=p;return("books"===e.type||"itemlist"===e.type)&&(t=[...t,d.d4.DATE_PUBLISHED]),e.additionalSortOptions&&(t=[...t,...e.additionalSortOptions]),j&&""!==g&&(t=[d.d4.RELEVANCE,...t]),e.addBlankOption&&!t.some(e=>"default"===e)&&(t=["default",...t]),(0,u.Fg)(t.filter(e=>b.includes(e)))},[e.type,e.additionalSortOptions,j,g,e.addBlankOption]),[_,v]=(0,s.use
1State)(y);(0,s.useEffect)(()=>{v(y)},[y]);let k=(0,s.useMemo)(()=>e.defaultSort?e.defaultSort:j&&l.query.slug&&void 0!==l.query.slug[0]&&"new_releases"===(0,h.S0)(l.query.slug[0])&&""===x?d.d4.DATE_PUBLISHED:d.d4.POPULARITY,[e.defaultSort,j,x,l.query.slug]);(0,s.useEffect)(()=>{let t="default";e.addBlankOption&&!_.some(e=>e===t)&&v([t,..._])},[e.addBlankOption,_]);let A=(0,s.useCallback)(()=>{e.changeEdition(!e.showLatestEdition)},[e.changeEdition,e.showLatestEdition]),N="";"itemlist"===e.type?e.data&&(0!==e.data.children.total&&null===e.data.parent_id?N=e.data.children.total:(0!==e.data.items.total&&null===e.data.parent_id||0!==e.data.items.total&&null!==e.data.parent_id)&&(N=e.data.items.total)):e.data&&(N=(0,m.Lm)(e.data.total));let C=(0,s.useMemo)(()=>{if(N>0){let l=null,s=null;return"itemlist"!==e.type&&e.data?(l=e.data.from,s=e.data.to):"itemlist"===e.type&&e.data.items&&(l=e.data.items.from,s=e.data.items.to),(0,a.jsxs)(a.Fragment,{children:[N<=m.gT?t("catalog.results",{count:N}):t("catalog.moreresults",{count:m.gT}),"\xa0",null!==l&&null!==s&&(0,a.jsx)("span",{className:"from-to","aria-label":t("catalog.from_to_aria",{from:l,to:s}),children:t("catalog.from_to",{from:l,to:s})})]})}},[e.type,e.data,N,t]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{id:"toolbar",className:"catalog-grid__toolbar mb-4","aria-busy":e.loading||void 0,children:[(0,a.jsxs)("div",{className:"d-flex justify-content-between",children:[C?(0,a.jsx)("h2",{className:"catalog-grid__toolbar__total mt-3 mt-md-0",children:C}):(0,a.jsx)("div",{className:"catalog-grid__toolbar__total mt-3 mt-md-0"}),!1!==e.changeDisplay&&(0,a.jsx)("div",{className:`catalog-grid__toolbar__view ${!1===e.sortBy?"d-flex justify-content-end":""}`,children:"grid"===e.displayMode?(0,a.jsx)(c.A,{onClick:()=>e.changeDisplay("detail"),className:"btn btn--outline btn--outline--tomato btn--small",icon:"detail-view",iconPlacement:"left",children:t("catalog.detailview")}):(0,a.jsx)(c.A,{onClick:()=>e.changeDisplay("grid"),className:"btn btn--outline btn--outline--tomato btn--small",icon:"grid-view",iconPlacement:"left",children:t("catalog.simpleview")})})]}),(0,a.jsxs)("div",{className:`catalog-grid__toolbar__actions mt-3 mt-md-0 d-flex ${e.isNumbered?"justify-content-end align-items-center":"justify-content-between align-items-center"}`,children:[!e.isNumbered&&(0,a.jsx)(a.Fragment,{children:!1!==e.sortBy&&(0,a.jsxs)("div",{className:"d-flex flex-column flex-sm-row catalog-grid__toolbar__sorter",children:[(0,a.jsx)("label",{htmlFor:"sort-select",className:"mb-0",children:(0,a.jsx)("strong",{children:t("catalog.sortby")})}),j?(0,a.jsx)("select",{id:"sort-select",className:"select select--sortby",value:x||k,onChange:t=>e.sortBy(t.target.value),children:_.map(e=>(0,a.jsx)("option",{value:e,children:t(`catalog.sortOptions.${e}`)},`sortby-${e}`))}):(0,a.jsx)("span",{className:"catalog-grid__toolbar__sorter__placeholder",children:(0,a.jsx)(n.A,{baseColor:"#FFF5F0",duration:2,inline:!0,width:156})})]})}),"books"===e.type&&void 0!==e.showLatestEdition&&e.changeEdition&&(0,a.jsxs)("label",{className:"filter-checkbox",children:[(0,a.jsx)("input",{type:"checkbox",checked:e.showLatestEdition,onChange:A}),(0,a.jsx)("span",{className:"span--weight--regular span--fs-15",children:t("catalog.search.latest_edition")})]})]})]}),(0,a.jsx)("div",{className:"catalog-grid__toolbar__total--mobile d-block d-sm-none span--c-forestlight a-center mb-4",children:C})]})})},32887:(e,t,l)=>{"use strict";l.d(t,{A:()=>g});var a=l(15039),s=l.n(a),n=l(69723),r=l(14232),i=l(23840),o=l(54644),c=l(14307);let d=function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.filter(e=>null!=e).reduce((e,t)=>{if("function"!=typeof t)throw Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var l=arguments.length,a=Array(l),s=0;s<l;s++)a[s]=arguments[s];e.apply(this,a),t.apply(this,a)}},null)};var u=l(57368),h=l(45949),m=l(37876);let b={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function p(e,t){let l=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],a=b[e];return l+parseInt((0,n.A)(t,a[0]),10)+parseInt((0,n.A)(t,a[1]),10)}let f={[i.kp]:"collapse",[i.ze]:"collapsing",[i.ns]:"collapsing",[i._K]:"collapse show"},g=r.forwardRef((e,t)=>
1{let{onEnter:l,onEntering:a,onEntered:n,onExit:i,onExiting:b,className:g,children:x,dimension:j="height",in:y=!1,timeout:_=300,mountOnEnter:v=!1,unmountOnExit:k=!1,appear:A=!1,getDimensionValue:N=p,...C}=e,w="function"==typeof j?j():j,$=(0,r.useMemo)(()=>d(e=>{e.style[w]="0"},l),[w,l]),E=(0,r.useMemo)(()=>d(e=>{let t=`scroll${w[0].toUpperCase()}${w.slice(1)}`;e.style[w]=`${e[t]}px`},a),[w,a]),I=(0,r.useMemo)(()=>d(e=>{e.style[w]=null},n),[w,n]),R=(0,r.useMemo)(()=>d(e=>{e.style[w]=`${N(w,e)}px`,(0,u.A)(e)},i),[i,N,w]),S=(0,r.useMemo)(()=>d(e=>{e.style[w]=null},b),[w,b]);return(0,m.jsx)(h.A,{ref:t,addEndListener:c.A,...C,"aria-expanded":C.role?y:null,onEnter:$,onEntering:E,onEntered:I,onExit:R,onExiting:S,childRef:(0,o.am)(x),in:y,timeout:_,mountOnEnter:v,unmountOnExit:k,appear:A,children:(e,t)=>r.cloneElement(x,{...t,className:s()(g,x.props.className,f[e],"width"===w&&"collapse-horizontal")})})})},46882:(e,t,l)=>{"use strict";l.d(t,{A:()=>j});var a=l(15039),s=l.n(a),n=l(14232),r=l(5122),i=l(44935),o=l(32887);function c(e,t){return Array.isArray(e)?e.includes(t):e===t}let d=n.createContext({});d.displayName="AccordionContext";var u=l(37876);let h=n.forwardRef((e,t)=>{let{as:l="div",bsPrefix:a,className:r,children:h,eventKey:m,...b}=e,{activeEventKey:p}=(0,n.useContext)(d);return a=(0,i.oU)(a,"accordion-collapse"),(0,u.jsx)(o.A,{ref:t,in:c(p,m),...b,className:s()(r,a),children:(0,u.jsx)(l,{children:n.Children.only(h)})})});h.displayName="AccordionCollapse";let m=n.createContext({eventKey:""});m.displayName="AccordionItemContext";let b=n.forwardRef((e,t)=>{let{as:l="div",bsPrefix:a,className:r,onEnter:o,onEntering:c,onEntered:d,onExit:b,onExiting:p,onExited:f,...g}=e;a=(0,i.oU)(a,"accordion-body");let{eventKey:x}=(0,n.useContext)(m);return(0,u.jsx)(h,{eventKey:x,onEnter:o,onEntering:c,onEntered:d,onExit:b,onExiting:p,onExited:f,children:(0,u.jsx)(l,{ref:t,...g,className:s()(r,a)})})});b.displayName="AccordionBody";let p=n.forwardRef((e,t)=>{let{as:l="button",bsPrefix:a,className:r,onClick:o,...h}=e;a=(0,i.oU)(a,"accordion-button");let{eventKey:b}=(0,n.useContext)(m),p=function(e,t){let{activeEventKey:l,onSelect:a,alwaysOpen:s}=(0,n.useContext)(d);return n=>{let r=e===l?null:e;s&&(r=Array.isArray(l)?l.includes(e)?l.filter(t=>t!==e):[...l,e]:[e]),null==a||a(r,n),null==t||t(n)}}(b,o),{activeEventKey:f}=(0,n.useContext)(d);return"button"===l&&(h.type="button"),(0,u.jsx)(l,{ref:t,onClick:p,...h,"aria-expanded":Array.isArray(f)?f.includes(b):b===f,className:s()(r,a,!c(f,b)&&"collapsed")})});p.displayName="AccordionButton";let f=n.forwardRef((e,t)=>{let{as:l="h2","aria-controls":a,bsPrefix:n,className:r,children:o,onClick:c,...d}=e;return n=(0,i.oU)(n,"accordion-header"),(0,u.jsx)(l,{ref:t,...d,className:s()(r,n),children:(0,u.jsx)(p,{onClick:c,"aria-controls":a,children:o})})});f.displayName="AccordionHeader";let g=n.forwardRef((e,t)=>{let{as:l="div",bsPrefix:a,className:r,eventKey:o,...c}=e;a=(0,i.oU)(a,"accordion-item");let d=(0,n.useMemo)(()=>({eventKey:o}),[o]);return(0,u.jsx)(m.Provider,{value:d,children:(0,u.jsx)(l,{ref:t,...c,className:s()(r,a)})})});g.displayName="AccordionItem";let x=n.forwardRef((e,t)=>{let{as:l="div",activeKey:a,bsPrefix:o,className:c,onSelect:h,flush:m,alwaysOpen:b,...p}=(0,r.Zw)(e,{activeKey:"onSelect"}),f=(0,i.oU)(o,"accordion"),g=(0,n.useMemo)(()=>({activeEventKey:a,onSelect:h,alwaysOpen:b}),[a,h,b]);return(0,u.jsx)(d.Provider,{value:g,children:(0,u.jsx)(l,{ref:t,...p,className:s()(c,f,m&&`${f}-flush`)})})});x.displayName="Accordion";let j=Object.assign(x,{Button:p,Collapse:h,Item:g,Header:f,Body:b})},47879:(e,t,l)=>{"use strict";l.d(t,{A:()=>$});var a=l(37876),s=l(14232),n=l(89099),r=l(46882),i=l(80998),o=l(1648),c=l(12212),d=l(82797),u=l(8510),h=l(249),m=l(2847),b=l(16142),p=l(35298),f=l(21468),g=l(86689);let x=["genre_ids","brand","category_ids"],j=["authors","publisher"],y=e=>{let{onClick:t,className:l="filter-parent-checkbox__label__icon",ariaLabel:s,isExpanded:n=!1}=e;return(0,a.jsx)("button",{type:"button",className:l,onClick:t,"aria-label":s,"aria-expanded":n,children:(0,a.jsx)(f.A,{value:n?"chevron-down":"chevron-right"})})},_=(0,s.memo)(e=>{let{t,locale:l}=(0,c.B)(),[n,o]=e.items,d=o??[],{activeItems:f}=e,_=(0,s.useCallback)(e=>
1(0,i.bT)(e,l),[l]),[v,k]=(0,s.useState)(""),[A,N]=(0,p.A)(!1),C=(0,s.useRef)(null),w=(0,s.useMemo)(()=>x.includes(n),[n]),$=(0,s.useCallback)(e=>{k((0,b.J2)(e))},[]),E=(0,s.useMemo)(()=>new Set((f??[]).map(e=>e.id)),[f]),I=(0,s.useMemo)(()=>new Set((f??[]).map(e=>String(e.id))),[f]),[R,S]=(0,s.useState)({}),[B,L]=(0,s.useState)({}),O=(0,s.useCallback)(e=>(0,u.kP)(e).some(e=>E.has(e.id)),[E]),M=(0,s.useCallback)(e=>R[e.id]??O(e),[R,O]),T=(0,s.useCallback)(e=>B[e.id]??O(e),[B,O]),U=(0,s.useCallback)((e,t)=>{S(l=>({...l,[e]:!t}))},[]),K=(0,s.useCallback)((e,t)=>{L(l=>({...l,[e]:!t}))},[]),P=(0,s.useCallback)(()=>{N(),A&&(0,m.YJ)(C)},[A,N]),D=(0,s.useCallback)(e=>{let l=_(e);return"has_related_content"===n?t(`catalog.facets.${l}`):`${l}`.trim()},[n,t,_]),F=(0,s.useMemo)(()=>d.filter(Boolean).filter(e=>{if(""===v)return!0;let t=_(e.label);return!t||(0,b.J2)(t).includes(v)||!!e.children?.some(e=>(0,b.J2)(_(e.label)).includes(v))}),[d,_,v]),q=(0,s.useCallback)(l=>{let s=l.children;return null===s||0===s.length?"":(0,a.jsx)("ul",{className:`filter-parent-checkbox__list ${T(l)?"active":""}`,children:[...s].sort((e,t)=>_(e.label).localeCompare(_(t.label))).map(l=>{let s=D(l.label),r=l.count||0;return(0,a.jsx)("li",{children:(0,a.jsx)("label",{className:"filter-checkbox justify-content-between",children:(0,a.jsxs)("div",{className:"d-flex",children:[(0,a.jsx)("input",{type:"checkbox",id:`filter-input-${l.id}`,tabIndex:"0",disabled:e.loading,defaultValue:_(l.label),"aria-label":t("catalog.facets.item_aria",{label:s,count:r}),onChange:()=>e.filterAction(n,l),checked:E.has(l.id),onKeyUp:t=>{(0,h.Ci)(t)&&e.filterAction(n,l)}}),(0,a.jsx)("span",{children:t("catalog.facets.item",{label:s,count:r})})]})})},l.id)})})},[D,_,T,E,n,e.loading,e.filterAction,t]),Q="";if(j.includes(n)){let l={authors:{setQuery:e.setQueryAuthors,query:e.queryAuthors},publisher:{setQuery:e.setQueryPublisher,query:e.queryPublisher}}[n],s=t("catalog.actions.search",{facet:t(`catalog.facets.${n}`)});Q=(0,a.jsx)(g.A,{className:"searchbox--facets",leftIcon:"searchcat",initialValue:l.query,onChange:l.setQuery,isLoading:e.loading,debounceMs:650,placeholder:s,"aria-label":s})}if(0===d.length&&("authors"!==n||""===e.queryAuthors)&&("publisher"!==n||""===e.queryPublisher))return null;let V=F.length;return(0,a.jsxs)(r.A.Item,{ref:C,eventKey:e.eventKey,className:`filter filter--${n}`,children:[(0,a.jsx)(r.A.Header,{as:"h3",children:t(`catalog.facets.${n}`)}),(0,a.jsxs)(r.A.Body,{children:[w?(0,a.jsx)(g.A,{className:"searchbox--facets",leftIcon:"searchcat",onChange:$,debounceMs:0,placeholder:t("catalog.actions.search",{facet:t(`catalog.facets.${n}`)}),"aria-label":t("catalog.actions.search",{facet:t(`catalog.facets.${n}`)})}):"",Q,(0,a.jsx)("div",{className:"filter__wrapper",children:(0,a.jsx)("ul",{className:`${w&&!A?"list-add-more":""} mb-1`,children:F.map(l=>{if(void 0===l.children){let s="sections"===n?"radio":"checkbox",r=I.has(String(l.id));return(0,a.jsx)("li",{children:(0,a.jsxs)("label",{className:"filter-checkbox",children:[(0,a.jsx)("input",{type:s,name:n,id:`filter-input-${l.id}`,tabIndex:"0",value:_(l.label),"aria-label":t("catalog.facets.item_aria",{label:D(l.label),count:l.count||0}),onChange:()=>e.filterAction(n,l,"radio"===s),checked:r,disabled:e.loading,onKeyUp:t=>{(0,h.Ci)(t)&&e.filterAction(n,l,"radio"===s)}}),(0,a.jsx)("span",{children:t("catalog.facets.item",{label:D(l.label),count:l.count||0})})]})},l.id)}let s=I.has(String(l.id)),r=M(l);return(0,a.jsx)("li",{children:(0,a.jsxs)("div",{className:`filter-parent-checkbox ${r?"active":""}`,id:`sub-cat-${"number"==typeof l.id?l.id:l.id.toLowerCase()}`,children:[(0,a.jsxs)("div",{className:"filter-parent-checkbox__label",children:[(0,a.jsxs)("label",{className:"filter-checkbox filter-parent-checkbox__label__main",children:[(0,a.jsx)("input",{type:"checkbox",id:`filter-input-${l.id}`,tabIndex:"0",defaultValue:_(l.label),disabled:e.loading,"aria-label":t("catalog.facets.item_aria",{label:D(l.label),count:l.count||0}),onChange:()=>e.filterAction(n,l),checked:s,onKeyUp:t=>{(0,h.Ci)(t)&&e.filterAction(n,l)}}),(0,a.jsx)("strong",{children:t("catalog.facets.item",{label:D(l.label),count:l.count||0})})]}),0!==l.children.length&&(0,a.jsx)(y,{onClick:()=>U(l.id,r),ariaLabel:t("catalog.actions.subCategory",{category:D(l.label)}),isExpanded:r})]}),(0,a.jsx)("ul",{className:"filter-parent-checkbox__list",children:l.children.map(l
1=>{let s=null!==l.children&&void 0!==l.children&&0!==l.children.length;return(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"filter-parent-checkbox__label",children:[(0,a.jsxs)("label",{className:"filter-checkbox justify-content-between",children:[(0,a.jsx)("input",{type:"checkbox",id:`filter-input-${l.id}`,disabled:e.loading,tabIndex:"0",defaultValue:_(l.label),"aria-label":t("catalog.facets.item_aria",{label:D(l.label),count:l.count||0}),onChange:()=>e.filterAction(n,l),checked:E.has(l.id),onKeyUp:t=>{(0,h.Ci)(t)&&e.filterAction(n,l)}}),(0,a.jsx)("span",{children:t("catalog.facets.item",{label:D(l.label),count:l.count||0})})]}),s?(0,a.jsx)(y,{onClick:()=>K(l.id,T(l)),ariaLabel:t("catalog.actions.subCategory",{category:D(l.label)}),isExpanded:T(l)}):""]}),s?q(l):""]},l.id)})})]})},l.id)})})}),w&&V>10?(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)("button",{type:"button",className:"link link--tomato",onClick:()=>P(n),children:A?t("catalog.actions.seeless"):t("catalog.actions.seemore")})}):"",0===V?(0,a.jsx)("p",{children:t("catalog.actions.noresult")}):""]})]})});var v=l(77845),k=l(23477),A=l(65364);let N="publication_date",C="additional_resources",w={books:"sections,availability,origin_attributes,has_accessibility_property_values,in_language,genre_ids,book_formats,authors,publisher,has_related_content",products:"sections,availability,brand,category_ids,in_language,has_related_content"},$=(0,s.memo)(e=>{let{active:t,activePublicationWindow:l,activeTeachersGuide:u,canAccessTeachersGuides:h,clearPublicationWindow:m,clearTeachersGuide:b,data:p,filterAction:g,for:x,loading:j,publicationWindowOptions:y,queryAuthors:$,queryPublisher:E,resetFilter:I,selectPublicationWindow:R,setQueryAuthors:S,setQueryPublisher:B,toggleTeachersGuide:L}=e,{t:O,locale:M}=(0,c.B)(),T=(0,n.useRouter)(),{isLoading:U,isInstitutional:K,supportedBookFormats:P}
1=(0,o.A)(),[D,F]=(0,s.useState)({}),q=(0,s.useMemo)(()=>t??{},[t]),Q=(0,s.useMemo)(()=>{let e="books"===x;return((e?"sections,availability,origin_attributes,has_accessibility_property_values,in_language,genre_ids,book_formats,authors,publisher,has_related_content":A.env.NEXT_PUBLIC_REACT_APP_FACETSPRODUCT_ORDER)||w[e?"books":"products"]).split(",")},[x]),V=(0,s.useMemo)(()=>Object.entries(p??{}).sort((e,t)=>{let[l]=e,[a]=t;return Q.indexOf(l)-Q.indexOf(a)}),[p,Q]),H=(0,s.useMemo)(()=>new Set(P??[]),[P]),W=(0,s.useMemo)(()=>{let e=[];return V.forEach(t=>{let[l]=t,a="sections"===l||"brand"===l||"products"===x&&"category_ids"===l,s=q[l]?.length>0,n="authors"===l&&""!==$,r="publisher"===l&&""!==E,i=void 0!==T.query[l]&&""!==T.query[l];(a||s||n||r||i)&&e.push(l)}),l&&e.push(N),u&&e.push(C),e},[V,q,T.query,$,E,x,l,u]),Y=(0,s.useMemo)(()=>{let e=new Set(W);for(let[t,l]of Object.entries(D))l?e.add(t):e.delete(t);return[...e]},[W,D]),X=(0,s.useRef)(Y);X.current=Y;let z=(0,s.useCallback)(e=>{if(null===e)return;let t=new Set(e),l=new Set(X.current);F(e=>{let a={...e};for(let e of t)l.has(e)||(a[e]=!0);for(let e of l)t.has(e)||(a[e]=!1);return a})},[]),J=(0,s.useMemo)(()=>Object.entries(q).flatMap(e=>{let[t,l]=e;return(Array.isArray(l)?l:[]).filter(Boolean).map(e=>({facetKey:t,item:e}))}),[q]),G=J.length>0||!!l||!!u;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.A,{children:(0,a.jsx)("h2",{children:O("catalog.filter")})}),(0,a.jsxs)("div",{className:"filters-current",children:[(0,a.jsxs)("ul",{children:[J.map(e=>{let{facetKey:t,item:l}=e;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>g(t,l),children:[(0,i.bT)(l.label,M),"\xa0",(0,a.jsx)(f.A,{value:"close"})]})},`${t}-${l.id}`)}),l&&(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:m,children:[O(`catalog.facets.publication_date_windows.${l}`),"\xa0",(0,a.jsx)(f.A,{value:"close"})]})}),u&&(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>b(),children:[O("catalog.facets.additional_resources_filters.has_teachers_guide"),"\xa0",(0,a.jsx)(f.A,{value:"close"})]})})]}),(G||void 0!==T.query.s)&&(0,a.jsx)("button",{type:"button",onClick:()=>I(),className:"d-block link link--forest link--underline link--weight--regular link--notbtn",children:O("catalog.actions.reset")}),(0,a.jsx)("br",{})]}),(0,a.jsxs)(r.A,{className:"filters-accordion filters-list",activeKey:Y,alwaysOpen:!0,onSelect:z,children:[V.map(e=>{let[t,n]=e;if(("availability"===t||"in_language"===t)&&"products"===x||"has_teachers_guide"===t)return null;let r="book_formats"===t&&K&&Array.isArray(n)?n.filter(e=>{let{id:t}=e;return H.has(t)}):n,i="publisher"===t||"authors"===t?{queryPublisher:E,queryAuthors:$,setQueryPublisher:B,setQueryAuthors:S}:{};return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)(_,{eventKey:t,...i,activeItems:q[t],filterAction:g,loading:j,items:[t,r],for:x,disabled:"book_formats"===t&&U}),"origin_attributes"===t&&"books"===x&&y&&(0,a.jsx)(v.A,{eventKey:N,options:y,active:l,select:R})]},`accordion-${t}`)}),"books"===x&&h&&(0,a.jsx)(d.A,{eventKey:C,activeTeachersGuide:u,toggleFilter:L,disabled:j})]})]})})},66641:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(37876),s=l(14232),n=l(24903),r=l(74474),i=l(12212);let o=(0,s.memo)(e=>{let{total:t,onChange:l,options:o=n.TI}=e,{t:c}=(0,i.B)(),d=(0,s.useMemo)(()=>({limit:{type:"number",default:o[0]}}),[o]),{limit:u}=(0,r.I)(d),h=(0,s.useCallback)(e=>{let t=Number(e.target.value);l&&"function"==typeof l&&l(t)},[l]);return!t||o[0]>=t?null:(0,a.jsxs)("div",{className:"d-flex align-items-center mb-4",children:[(0,a.jsx)("label",{htmlFor:"per-page-select",className:"me-3 mb-0",children:c("catalog.perpage")}),(0,a.jsx)("select",{id:"per-page-select",className:"select select--perpage",onChange:h,value:u,"aria-label":c("catalog.perpage"),children:o.map(e=>(0,a.jsx)("option",{value:e,children:e},`perpage-${e}`))})]})})},70087:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var a=l(37876),s=l(14232),n=l(12212),r=l(24903),i=l(21468);let o=e=>{let{onClick:t,className:l="",ariaLabel:s,children:n,isCurrent:r=!1,isDisabled:o=!1,icon:c=null}=e;return(0,a.jsxs)("button",{type:"button",onClick:t,className:`btn btn--pagination ${l}`,"aria-label":s,"aria-current":r?"page":null,disabled:o,"aria-disabled":o,children:[n,c&&(0,a.jsx)(i.A,{value:c,"aria-hidden":"true"})]})},c=(0,s.memo)(e=>{let{data:t,currPage:l,setPage:i}=e,{t:c}=(0,n.B)(),d=(0,s.useCallback)(()=>{let e=document.getElementById("toolbar");
1if(e){let t=e.getBoundingClientRect().top+window.pageYOffset+-20;window.scrollTo({top:t,behavior:"smooth"})}},[]),u=(0,s.useCallback)(e=>{d(),i(e)},[d,i]),{total:h,numberOfPages:m}=(0,s.useMemo)(()=>{if(!t)return{total:0,numberOfPages:0};let e=(0,r.Lm)(t.total),l=Math.ceil(e/t.per_page);return{total:e,numberOfPages:l}},[t]);if(!t||m<=1)return null;let b=1===l,p=l===m;return(0,a.jsx)("nav",{"aria-label":c("pagination.navigation"),children:(0,a.jsxs)("ul",{className:"pagination",children:[l>=2&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(1),ariaLabel:c("pagination.first"),icon:"page-first",isDisabled:b})}),(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(l-1),ariaLabel:c("pagination.prev"),icon:"page-prev",isDisabled:b})})]}),l>=3&&(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(l-2),ariaLabel:`${c("pagination.page")} ${l-2}`,children:l-2})}),l>=2&&(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(l-1),ariaLabel:`${c("pagination.page")} ${l-1}`,children:l-1})}),(0,a.jsx)("li",{children:(0,a.jsx)(o,{className:"selected",ariaLabel:`${c("pagination.current_page")} ${l}`,isCurrent:!0,children:l})}),l>=1&&l!==m&&[void 0,void 0].map((e,t)=>{let s=Number(l)+t+1;return s>=m?null:(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(s),ariaLabel:`${c("pagination.page")} ${s}`,children:s})},s)}),l!==m&&!(l>=m-3)&&(0,a.jsx)("li",{children:(0,a.jsx)("button",{className:"btn btn--pagination","aria-hidden":"true",disabled:!0,children:"..."})}),l!==m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(m),ariaLabel:`${c("pagination.page")} ${m}`,children:m})}),(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(l+1),ariaLabel:c("pagination.next"),icon:"page-next",isDisabled:p})}),(0,a.jsx)("li",{children:(0,a.jsx)(o,{onClick:()=>u(m),ariaLabel:c("pagination.last"),icon:"page-last",isDisabled:p})})]})]})})})},77845:(e,t,l)=>{"use strict";l.d(t,{A:()=>d,n:()=>c});var a=l(37876),s=l(14232),n=l(46882),r=l(41991),i=l(249),o=l(12212);let c={publicationWindow:{type:"enum",default:null,values:Object.values(r.zw),mappedFrom:"publication_window"}},d=(0,s.memo)(e=>{let{options:t=[],active:l,select:s,eventKey:r}=e,{t:c}=(0,o.B)();return(0,a.jsxs)(n.A.Item,{eventKey:r,className:"filter filter--publication_date",children:[(0,a.jsx)(n.A.Header,{as:"h3",children:c("catalog.facets.publication_date")}),(0,a.jsx)(n.A.Body,{children:(0,a.jsx)("div",{className:"filter__wrapper",children:(0,a.jsx)("ul",{className:"mb-1",children:t.map(e=>(0,a.jsx)("li",{children:(0,a.jsxs)("label",{className:"filter-checkbox",children:[(0,a.jsx)("input",{type:"radio",name:"publication_window",tabIndex:"0",checked:l===e.key,onChange:()=>s(e.key),onKeyUp:t=>{(0,i.Ci)(t)&&s(e.key)}}),(0,a.jsx)("span",{children:c(e.labelKey)})]})},e.key))})})})]})})},82797:(e,t,l)=>{"use strict";l.d(t,{A:()=>d,h:()=>c});var a=l(37876),s=l(14232),n=l(46882),r=l(249),i=l(12212);let o=[{key:"has_teachers_guide",labelKey:"catalog.facets.additional_resources_filters.has_teachers_guide"}],c={hasTeachersGuide:{type:"boolean",default:!1,mappedFrom:"has_teachers_guide",truthyValue:"true"}},d=(0,s.memo)(e=>{let{eventKey:t,activeTeachersGuide:l=!1,toggleFilter:s,disabled:c=!1}=e,d={has_teachers_guide:l},{t:u}=(0,i.B)();return(0,a.jsxs)(n.A.Item,{eventKey:t,className:"filter filter--additional_resources",children:[(0,a.jsx)(n.A.Header,{as:"h3",children:u("catalog.facets.additional_resources")}),(0,a.jsx)(n.A.Body,{children:(0,a.jsx)("div",{className:"filter__wrapper",children:(0,a.jsx)("ul",{className:"mb-1",children:o.map(e=>{let{key:t,labelKey:l}=e;return(0,a.jsx)("li",{children:(0,a.jsxs)("label",{className:"filter-checkbox",children:[(0,a.jsx)("input",{type:"checkbox",name:t,tabIndex:"0",disabled:c,checked:!!d[t],onChange:()=>s(t,!d[t]),onKeyUp:e=>{(0,r.Ci)(e)&&s(t,!d[t])}}),(0,a.jsx)("span",{children:u(l)})]})},t)})})})})]})})},86689:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a=l(37876),s=l(14232),n=l(56114),r=l(69295);let i=(0,s.memo)(e=>{let{id:t,value:l,initialValue:i="",onChange:o,placeholder:c,debounceMs:d=400,isLoading:u=!1,leftIcon:h="search",className:m="","aria-label":b,"aria-describedby":p}
1=e,[f,g]=(0,s.useState)(i),x=(0,s.useRef)(null),j=void 0!==l?l:f,y=(0,n.A)(e=>{o&&o(e)},d),_=(0,s.useCallback)(e=>{void 0===l&&g(e),y(e)},[l,y]),v=(0,s.useCallback)(()=>{void 0===l&&g(""),o&&o(""),x?.current&&setTimeout(()=>{x.current?.focus()},450)},[l,o]),k=(0,s.useMemo)(()=>j.length>0,[j]);return(0,a.jsx)("div",{className:`searchbox searchbox--wrapper ${m?` ${m}`:""}`,children:(0,a.jsx)(r.A,{id:t,value:j,onChange:_,placeholder:c,inputRef:x,leftIcon:h,showLeftIcon:!0,isLoading:u,showClearButton:k,onClear:v,showDropdownArrow:!1,groupClassName:"searchbox__group","aria-label":b,"aria-describedby":p})})})},93858:()=>{}}]);

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.