2 lines
99 KiB
JavaScript
2 lines
99 KiB
JavaScript
|
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[2219],{88741:(e,i,n)=>{n.d(i,{o:()=>m});var a=n(59496),t=n(3802),s=n(1996),l=n(98340),d=n(45118),r=n(91834),o=n(40778),c=n(4637);const m=a.memo((function({uri:e}){const{spec:i}=(0,d.T)(e);return(0,c.jsx)(l.ZP,{value:"generic",children:(0,c.jsx)(s.v,{children:(0,c.jsxs)(r.q,{divider:"before",children:[(0,c.jsx)(o.Jx,{spec:i,uri:e,displayText:t.ag.get("context-menu.copy-generic-link")}),(0,c.jsx)(o.W2,{spec:i,uri:e})]})})})}))},39084:(e,i,n)=>{n.d(i,{Pd:()=>l,Wm:()=>s,i9:()=>t});var a=n(3802);const t=["artists","albums","episodes","genres","playlists","podcasts","audiobooks","tracks","users","topResults","podcastAndEpisodes"],s={artists:()=>a.ag.get("search.title.artists"),albums:()=>a.ag.get("search.title.albums"),playlists:()=>a.ag.get("search.title.playlists"),podcasts:()=>a.ag.get("search.title.shows"),episodes:()=>a.ag.get("search.title.episodes"),audiobooks:()=>a.ag.get("search.title.audiobooks"),users:()=>a.ag.get("search.title.profiles"),genres:()=>a.ag.get("search.title.genres-and-moods"),tracks:()=>a.ag.get("search.title.tracks"),podcastAndEpisodes:()=>a.ag.get("search.title.podcast-and-shows"),topResults:()=>a.ag.get("search.row.top-results")},l=["artists","albums","playlists","podcasts","episodes","audiobooks","users","genres"]},27659:(e,i,n)=>{n.d(i,{M:()=>R});var a=n(59496),t=n(84875),s=n.n(t),l=n(61740),d=n(89605),r=n(85830),o=n(94041),c=n(56162),m=n(48710),u=n(83680),k=n(36844),p=n(7681),v=n(50346),S=n(3802),N=n(46997),g=n(21524),y=n(96170),h=n(2831),f=n(41836),x=n(46179);const F="main-topBar-searchBar",b="x-searchInput-searchInputSearchIcon",j="x-searchInput-searchInputInput",C="x-searchInput-searchInputOnSearch",D="x-searchInput-searchInputClearButton",T="x-searchInput-searchInputIconContainer",A="x-searchInput=searchInputClearIcon";var I=n(4637);const R=a.memo((function({isSearchChipsEnabled:e=!1,onSearch:i=!0,onClick:n}){const t=(0,d.TH)(),R=(0,d.s0)(),E=(0,a.useRef)(null),V=(0,a.useRef)(null),w=(0,l.I0)(),[{category:U,query:P},q]=(0,x.l)(),[_,O]=(0,a.useState)(P),L=!!U,{scrollNodeRef:M}=a.useContext(g.VX),W=t.pathname.startsWith("/recent-searches"),H=L||W,{spec:B,logger:K}=(0,y.fU)(p.createDesktopSearchInputEventFactory,{}),G=(0,k.W6)(f.yA),z=(0,r.y1)(((i,n,a)=>{let t;if(a){const{interactionId:e}=K.logInteraction(a);t=e}e?q(i,U,!1,t):q(i,null,n,t),M.current&&(M.current.scrollTop=0)}),200),$=(0,a.useCallback)(((e=!1)=>{E.current!==document.activeElement&&(V.current=document.activeElement,E.current&&E.current.focus()),e&&E.current?.select()}),[]);(0,N.eY)(N.O4.SHOW_SEARCH,(()=>$(!0)));const Z=t.pathname.startsWith("/search");(0,a.useEffect)((()=>{!H&&i&&Z&&(e&&P||$())}),[P,$,t.key,i,Z,H,e]),(0,a.useEffect)((()=>{O(Z?P:"")}),[Z,P]);return(0,I.jsxs)("div",{className:s()(F,{[C]:!i}),children:[(0,I.jsx)("form",{onSubmit:e=>{e.preventDefault(),_&&K.logInteraction(B.keyStrokeSearch());const i=(0,v.EC)(_);if(i?.type===v.JM.AD){const e=(0,v.HB)(i.id);if(i.id===e)return;w((0,h.HI)(i.id))}else i?R(i.toURLPath(!0),{state:{preventMoveFocus:!0}}):_||R("/search",{state:{preventMoveFocus:!0}});_&&M.current?.querySelector("h1, h2, h3, h4")?.focus()},role:"search",children:(0,I.jsx)(c.D,{variant:"mesto",as:"input",style:{color:o.Snx},ref:E,className:s()(j),value:_,maxLength:800,autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,onChange:e=>{const i=e.currentTarget.value,n=B.keyStrokeChangeSearchQuery({searchQueryString:i});O(i),z(i,H,n)},onKeyDown:e=>{if("Escape"===e.key)if(_){const e=B.hitTextClear();O(""),z("",H,e)}else E.current&&E.current.blur(),V.current instanceof HTMLElement&&V.current.focus()},placeholder:i?S.ag.get("search.search-for-label"):S.ag.get("navbar.search"),onFocus:()=>{e||!H&&i||z(_,H,null)},"data-testid":"search-input",onClick:n})}),(0,I.jsxs)("div",{className:T,children:[(0,I.jsx)("span",{className:b,children:(0,I.jsx)(m.j,{className:A,"aria-hidden":!0,iconSize:G?16:24})}),_&&(0,I.jsx)("button",{className:D,onClick:()=>{E.current&&E.current.focus();const e=B.hi
|
||
|
//# sourceMappingURL=xpui-routes-search.js.map
|