PageSourceSearch

https://arttoronto.ca/static/js/HubNav.7a21af66.chunk.js

js arttoronto.ca collected 2026-09-24 19:20:58 UTC 8,631 bytes, 2 lines download raw bytes

1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[2283],{56079(e,n,a){a.d(n,{v:()=>i});a(76998);var s=a(34156),r=a.n(s);const l="SearchButton_button__leOj2";var c=a(23446);function i(e){let{open:n,className:a,testId:s,...i}=e;const o=r()(l,"material-icons");return(0,c.jsx)("span",{"data-testid":s,className:o,...i,children:n?"close":"search"})}i.defaultProps={open:!1,testId:"search-button"}},47308(e,n,a){a.d(n,{L:()=>u});a(76998);var s=a(34156),r=a.n(s),l=a(17788);const c="SearchField_wrapper__1dqWN",i="SearchField_asButton__haagU",o="SearchField_button__uzNxN";var t=a(56079),d=a(23446);let _=function(e){return e.search="search",e.button="button",e}({});function u(e){let{variant:n,onSearch:a,placeholder:s,...u}=e;const{value:h,handleChange:m,handleKeyDown:p,handleSearch:v}=(0,l.zM)(a);return(0,d.jsxs)("div",{className:r()(c,{[i]:n===_.button}),children:[(0,d.jsx)("input",{type:"text",value:h,onInput:m,onKeyDown:p,placeholder:s||"Enter your search term or a topic",...u}),(0,d.jsx)("div",{className:o,children:(0,d.jsx)(t.v,{onClick:()=>v(h)})})]})}u.defaultProps={variant:_.search}},15380(e,n,a){a.r(n),a.d(n,{default:()=>ee});var s=a(76998),r=a(34156),l=a.n(r),c=a(86273),i=a(23236),o=a(12669);const t="Nav_wrapper__G-eX+",d="Nav_body__6VmTh",_="Nav_reversed__YJ+dK",u="Nav_menu__OiQL9",h="Nav_menuRight__DoZUf",m="Nav_brandLogoWrapper__Aksjg",p="Nav_brandLogo__LVPc4",v="Nav_brandLogoAnchor__9po-v",x="Nav_searchWrapper__s9zlF",N="Nav_searchField__23fwg",j="Nav_searchButton__1RFny",f="Nav_list__N4tRy",g="Nav_listItem__2U2oe",b="Nav_buttonElement__MQa7K",k="Nav_buttonLinkWrapper__fR-iE",L="Nav_user__PW90z",w="Link_anchor__ylL8n",y="Link_label__WCtGv";var S=a(71992),M=a(23446);function I(e){let{link:n}=e;const{indexPath:a}=(0,o.E)();return(0,M.jsx)(S.M,{to:n.href,pathPrefix:n["@type"]===c.Wf.CustomLink?"":[a],openInNewTab:n.openInNewTab,className:l()(w,"hub-nav-item"),children:(0,M.jsx)("span",{className:y,children:n.label})})}const U="HomeLink_anchor__xOl-r",A="HomeLink_label__T-XoJ",P="HomeLink_icon__66Mh9";function C(e){let{link:n}=e;const{indexPath:a}=(0,o.E)();return(0,M.jsxs)(S.M,{to:"/",pathPrefix:a,className:l()(U,"hub-nav-home-item"),children:[(0,M.jsx)("span",{className:A,children:n.label}),(0,M.jsx)("span",{className:l()("material-icons",P),children:"home"})]})}const D="ButtonLink_button__nok9T";var T=a(90679);function R(e){let{link:n}=e;const{indexPath:a}=(0,o.E)();return(0,M.jsx)(T.$n,{to:n.href,pathPrefix:n["@type"]===c.Wf.CustomLink?"":[a],size:"small",className:D,children:n.label})}var $=a(49113);const E="DropdownGroupLink_anchor__2CmxZ",W="DropdownGroupLink_label__YY1z4",z="DropdownGroupLink_icon__hgonR",G="DropdownGroupLink_secondLevelMenu__1FoNA",O="DropdownGroupLink_open__rIPvz",B="SecondLevelMenu_wrapper__uzhsP",K="SecondLevelMenu_list__H8VDL",F="SecondLevelMenu_listItem__U97mM",H="SecondLevelMenu_anchor__Rm8KK",q="SecondLevelMenu_alignRight__+MUxh";function Q(e){const{links:n,fullScreen:a}=e,{indexPath:s}=(0,o.E)(),r=l()({"container-fluid":a,container:!a});return(0,M.jsx)("div",{className:B,children:(0,M.jsx)("div",{className:r,children:(0,M.jsx)("div",{className:"row",children:(0,M.jsx)("div",{className:"col-xs-12",children:(0,M.jsx)("ul",{className:l()(K,{[q]:!1}),children:n.map(e=>(0,M.jsx)("li",{className:F,children:(0,M.jsx)(S.M,{to:e.href,pathPrefix:e["@type"]===c.Wf.CustomLink?"":[s],openInNewTab:e.openInNewTab,className:l()(H,"hub-nav-sub-item"),children:e.label})},e.id))})})})})})}var V=a(17788);function X(e){const{link:n,fullScreen:a,alignRight:r}=e,{pathname:c}=(0,$.zy)(),[i,o]=(0,s.useState)(!1),t=(0,s.useMemo)(()=>n.groupItems.some(e=>{const n=new RegExp(`${e.href}/?$`);return c.search(n)>-1}),[n.groupItems,c]),{isDesktop:d}=(0,V.DL)();return(0,M.jsxs)("div",{className:l()(E,{[O]:i}),children:[(0,M.jsxs)("span",{onClick:()=>!d&&o(!i),className:l()(W,"hub-nav-group-item",{active:t}),children:[n.label,(0,M.jsx)("span",{className:l()("material-icons",z),children:i?"expand_less":"expand_more"})]}),(0,M.jsx)("div",{className:G,children:(0,M.jsx)(Q,{links:n.groupItems,fullScreen:a,alignRight:r})})]})}var Y=a(47308),J=a(32383),Z=a(58284);function ee(e){const{links:n,sectors:a,brandLogo:r,displayHomeLink:w,displayBrandLogo:y,displayKeywordSearch:U,searchPlaceholderText:A,displayUser:P,fullScreen:D}=e,{indexPath:T}=(0,o.E)(),$=l()({"container-fluid":D,container:!D}),E=!(!y||!r),W=(0,s.useCallback)(e=>{if("home"===e.id)return(0,M.jsx)(C,{link:e});
1if("browse"===e.id){const n=a.map(e=>({"@type":c.Wf.CustomLink,id:e.id,href:`/${e.brandUrlSuffix}/${e.path}/`,label:e.name}));return n.length>0&&(0,M.jsx)(X,{fullScreen:D,alignRight:E,link:{...e,groupItems:n}})}return e["@type"]===c.Wf.DropdownGroup?(0,M.jsx)(X,{fullScreen:D,alignRight:E,link:e}):e.displayAsCTA?(0,M.jsx)("div",{className:k,children:(0,M.jsx)(R,{link:e})}):(0,M.jsx)(I,{link:e})},[a,D,E]),z=(0,s.useCallback)(e=>{const n=encodeURIComponent(e),a=(0,i._b)([T,"/search/"]);document.location.assign(`${a}?searchInput=${n}`)},[T]);return(0,M.jsx)("div",{id:"hub-nav",className:t,children:(0,M.jsx)("div",{className:$,children:(0,M.jsx)("div",{className:"row",children:(0,M.jsx)("div",{className:"col-xs-12",children:(0,M.jsxs)("div",{className:l()(d,_),children:[E&&(0,M.jsx)("div",{className:m,children:(0,M.jsx)(S.M,{to:"/",pathPrefix:T,className:v,children:(0,M.jsx)(J.Ay,{src:null===r||void 0===r?void 0:r.path,alt:"Brand Logo",className:p,lazy:!1})})}),(0,M.jsx)("div",{className:l()(u,{[h]:E}),children:(0,M.jsx)("ul",{className:f,children:n.slice(w?0:1).map(e=>{const n=W(e);return n&&(0,M.jsx)("li",{className:l()(g,{[b]:e.displayAsCTA}),children:n},e.id)})})}),U&&(0,M.jsxs)("div",{className:x,children:[(0,M.jsx)("div",{className:N,children:(0,M.jsx)(Y.L,{onSearch:z,placeholder:A})}),(0,M.jsx)("div",{className:j,children:(0,M.jsx)(Y.L,{variant:"button",onSearch:z,placeholder:A})})]}),P&&(0,M.jsx)("div",{className:L,children:(0,M.jsx)(Z.A,{})})]})})})})})}ee.defaultProps={sectors:[]}},58284(e,n,a){a.d(n,{A:()=>M});var s=a(76998),r=a(23236),l=a(13978),c=a(66899);const i="UserPreferences_wrapper__c4T7j",o="UserPreferences_menu__ckwgX";var t=a(34156),d=a.n(t);const _={wrapper:"UserIcon_wrapper__Toitk",picture:"UserIcon_picture__MpdqS",name:"UserIcon_name__DqycC"};var u=a(32383),h=a(23446);function m(e){const[n,a]=e.split(" ");return`${n[0]}${a[0]}`}function p(e){const{open:n,onClick:a,name:s,picture:r}=e;return(0,h.jsxs)("div",{onClick:a,className:_.wrapper,role:"button",children:[r?(0,h.jsx)(u.Ay,{src:r,alt:s,lazy:!1,imgixParams:"w=80&h=80",className:_.picture}):(0,h.jsx)("div",{className:_.name,children:m(s)}),(0,h.jsx)("span",{className:d()(_.arrowIcon,"material-icons"),children:n?"expand_less":"expand_more"})]})}const v="UserMenu_wrapper__UcSwG",x="UserMenu_header__qMO9v",N="UserMenu_body__5WTa9",j="UserMenu_footer__JAYQA",f="UserMenu_name__mB-fv",g="UserMenu_email__juS2V",b="MenuItem_anchor__fqIiu",k="MenuItem_icon__AUjhX";var L=a(71992);function w(e){const{icon:n,className:a,children:s,...r}=e;return(0,h.jsxs)(L.M,{className:d()(b,a),...r,children:[(0,h.jsx)("span",{className:d()(k,"material-icons"),children:n}),s]})}function y(e){let{name:n,email:a,onSignOut:s}=e;return(0,h.jsxs)("div",{className:v,children:[(0,h.jsxs)("div",{className:x,children:[(0,h.jsx)("div",{className:f,children:n}),(0,h.jsx)("div",{className:g,children:a})]}),(0,h.jsx)("div",{className:N,children:(0,h.jsx)(w,{to:"/account/profile/",icon:"manage_accounts",children:"My Profile"})}),(0,h.jsx)("div",{className:j,children:(0,h.jsx)(w,{to:"/account/logout/",onClick:s,icon:"logout",children:"Sign Out"})})]})}var S=a(31088);function M(){const[e,n]=(0,s.useState)({loggedIn:!1}),[a,t]=(0,s.useState)(),[d,_]=(0,s.useState)(!1),u=(0,c.j)(d,()=>{_(!1)}),m=(0,s.useCallback)(async()=>{try{var e;const n=await l.A.fetchAccountDetails("core"),a=await n.json();t((null===(e=a.profile)||void 0===e?void 0:e.core)||{})}catch(n){console.error(n)}},[]);(0,s.useEffect)(()=>{const e=l.A.getShortAccountDetails();n(e),e.loggedIn&&m()},[m]);const v=(0,s.useCallback)(()=>{_(e=>!e)},[]),x=a?`${a.forename} ${a.surname}`:`${null===e||void 0===e?void 0:e.forename} ${null===e||void 0===e?void 0:e.surname}`;return e.loggedIn?(0,h.jsxs)("div",{ref:u,className:i,children:[(0,h.jsx)(p,{open:d,onClick:v,name:x,picture:null===a||void 0===a?void 0:a.profilePhotoUrl}),d&&(0,h.jsx)("div",{className:o,children:(0,h.jsx)(y,{name:x,email:null===e||void 0===e?void 0:e.email,onSignOut:async e=>{e.preventDefault(),_(!1);try{await l.A.logout(),S.A.ga4UserLogout(),(0,r.yQ)()}catch(n){console.error(n)}}})})]}):null}}}]);
2//# sourceMappingURL=HubNav.7a21af66.chunk.js.map

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.