solorice/config/spicetify/Extracted/Themed/xpui/9395.js
Kristofers Solo a42ded1119 Use dotter
2024-08-28 09:02:07 +03:00

2 lines
116 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[9395],{2629:(e,t,r)=>{r.d(t,{p:()=>u});var i=r(30758),a=r(41978),n=r(75930),l=r(90751),o=r(83542),s=r(52608),c=r(11898),d=r(86070);const u=i.memo((function({uri:e,divider:t,removeLabel:r}){const u=(0,a.wA)(),p=!(0,s.n)(),g=(0,c.f)(),y=(0,i.useCallback)((async()=>{u((0,l.aw)(e,!0))}),[u,e]);return(0,d.jsx)(o.D,{role:"menuitem",divider:t,disabled:p&&!g?.getCapabilities().canModifyOffline,onClick:y,leadingIcon:(0,d.jsx)(n.k,{semanticColor:"textBrightAccent",size:"small"}),children:r})}))},40938:(e,t,r)=>{r.d(t,{P:()=>x});var i=r(30758),a=r(11808),n=r(66416),l=r(65183),o=r(72522),s=r(91039),c=r(79095),d=r(2629),u=r(95302),p=r(70583),g=r(6576),y=r(71817),m=r(86070);const x=i.memo((function({uri:e,artistUri:t,canPin:r=p.oT.NO,isPinned:i=!1,canRemove:x=!1}){const{spec:b}=(0,g.o)(e);return(0,m.jsx)(u.pZ,{value:"album",children:(0,m.jsxs)(n.W,{children:[x&&(0,m.jsx)(d.p,{uri:e,removeLabel:a.Ru.get("contextmenu.remove-from-library")}),t&&(0,m.jsx)(o.z,{spec:b,divider:"after",uri:t,displayText:a.Ru.get("contextmenu.go-to-artist-radio")}),r!==p.oT.NO&&(0,m.jsx)(c.k,{uri:e,canPin:r,isPinned:i,type:y.c.PRE_RELEASE_ALBUM,spec:b}),(0,m.jsx)(l.m,{uri:e,spec:b,displayText:a.Ru.get("context-menu.copy-album-link")}),(0,m.jsx)(s.q,{spec:b,divider:"before",uri:e})]})})}))},38608:(e,t,r)=>{r.d(t,{e:()=>l});var i=r(73114);const a="k270skPbT7JOaSidSA2a";var n=r(86070);const l=({iconSize:e=64,...t})=>(0,n.jsx)("div",{className:a,children:(0,n.jsx)(i.E,{iconSize:e,...t,semanticColor:"textBrightAccent","aria-hidden":!0})})},13961:(e,t,r)=>{r.d(t,{X:()=>u,A:()=>X});var i=r(30758),a=r(49217),n=r(72119),l=r(11808),o=r(42750),s=r(26119);const c="KsnGjjEeMb2miriJrkjW";var d=r(86070);const u=()=>{const e=l.Ru.getLocaleForTranslation(),t=s.IB[e]??s.IB.en,r=(0,o.ZZ)(),u=(0,i.useCallback)((()=>{r({type:"OPEN"})}),[r]);return(0,d.jsx)("div",{className:c,children:(0,d.jsx)(a.n,{iconLeading:n.d,size:"small",onClick:u,"data-testid":"language-selection-button",children:t.displayName})})};var p=r(8143),g=r(41978),y=r(12783),m=r(21953),x=r(61544),b=r(80460),h=r(32712),f=r(71817),S=r(53209),v=r(39554);const C="ZpqHX3kvsJIsR1QIc4kf",w=({children:e,locale:t,onClick:r,type:i="button"})=>{const a=t===h.Xn,n=(0,v.vf)(window.location.pathname),o=(0,x.o_)(window.location.pathname),s=(0,b.W)({type:"route",uri:n?f.c.HOME:o?.toURI()}),c={className:C,id:t,onClick:e=>(e=>{if("button"===i){e.preventDefault();const t=new URL(window.location.href);window.location.href.includes("locale")&&t.searchParams.delete("locale"),window.location.href=t.href}r(t)})(e),"data-testid":`language-option-${t}`};if("link"===i){const r=(0,S.ll)(window.location.pathname,!a),i=(0,S.hF)(r,(0,l.a7)(t).baseName),n=s?i:window.location.pathname,o=(e=>e.endsWith("/")?e.slice(0,-1):e)(`${window.location.origin}${n}`);return(0,d.jsx)("a",{href:o,...c,children:e})}return(0,d.jsx)("button",{...c,children:e})},P="eYLSfS4EKfwsdTsItWkY",R=({style:e,children:t})=>(0,d.jsx)("div",{className:P,style:e,children:t});var T=r(97500),I=r.n(T),A=r(81987),j=r(62943);const D="KPuW9eE4auKgVgMtPZoH",L="zCedVxWmwaJhPIGzJixP",E="qzuG9AHNXHQrOGF06r9A",O="ZgjCz5A7qOyprtvcLK8y",k="BSwvSvqHiQUVuim4Eidv",N="TpluDuF12UKv3IIq_VDu",F=({onClose:e,children:t})=>{const r=(0,i.useRef)(null),{isOpen:a}=(0,o.iL)(),n=(0,A.NC)(j.rW);return(0,d.jsx)("div",{"data-testid":"language-selection-modal",className:I()(D,{"circular-sp-vietnamese":n,[L]:a}),onClick:t=>{t.target===r.current&&e()},role:"presentation",ref:r,children:t})},B=({ariaDescribedBy:e,ariaLabelledBy:t,children:r})=>{const{isOpen:i}=(0,o.iL)();return(0,d.jsx)("div",{className:E,role:"dialog",hidden:!i,"aria-modal":!0,"aria-labelledby":t,"aria-describedby":e,children:r})};var M=r(43178);const U=({onClose:e})=>(0,d.jsx)("button",{"data-testid":"close-button",className:N,onClick:()=>{e()},children:(0,d.jsx)(M.M,{size:"small","aria-label":l.Ru.get("close")})});var V=r(57402),_=r(77339),H=r(26969),W=r(95625);const X=({languageSelectionModalRef:e})=>{const t=(0,i.useRef)(null),[r,a]=(0,i.useState)("0"),n=(0,o.ZZ)(),c=(0,g.d4)(V.MU),u=(0,i.useCallback)((()=>{n({type:"CLOSE"})}),[n]),{isOpen:x}=(0,o.iL)(),b=(0,i.useCallback)((()=>{a(`${t.current?.getBoundingClientRect().height}px`)}),[a]),h=e=>{var t;(0,W.n0)({name:"sp_locale",value:e,domain:(t="open.spotify.com",t.substring(t.indexOf("."))),days:365}),u()};var f;if(f=u,(0,i.useEffect)((()=>{const e=e=>{"Escape"===e.key&&f()};return window.addEventListener("keyup",e,!1),()=>window.removeEventListener("keyup",e)})),(0,H.w)({refOrElement:t,observeOnly:"height",onResize:b}),(0,i.useEffect)((()=>{b()}),[b]),!e.current)return null;const S="language-selection-title",C="language-selection-subtitle",P={"--header-height":r};return(0,p.createPortal)((0,d.jsx)(_.s,{active:x,children:(0,d.jsx)("div",{children:(0,d.jsx)(F,{onClose:u,children:(0,d.jsxs)(B,{ariaLabelledBy:S,ariaDescribedBy:C,children:[(0,d.jsxs)("div",{className:O,ref:t,children:[(0,d.jsxs)("div",{className:k,children:[(0,d.jsx)(y.E,{as:"h1",variant:"titleSmall",semanticColor:"textBase",id:S,paddingBottom:m.v4,children:l.Ru.get("i18n.language-selection.title")}),(0,d.jsx)(y.E,{as:"p",variant:"bodyMedium",semanticColor:"textBase",id:C,paddingBottom:m.CD,children:l.Ru.get("i18n.language-selection.subtitle")})]}),(0,d.jsx)(U,{onClose:u})]}),(0,d.jsx)(R,{style:{...P},children:s.Np.map((e=>{const t=(0,l.a7)(e).baseName,r=(0,v.p)({localeFeatureFlag:c,urlLocale:t,type:"locale"});return(0,d.jsxs)(w,{onClick:h,locale:e,type:r?"link":"button",children:[(0,d.jsx)(y.E,{semanticColor:"textBase",children:s.IB[e].displayName}),(0,d.jsx)(y.E,{children:s.IB[e].displayNameEn})]},e)}))})]})})})}),e.current)}},39395:(e,t,r)=>{r.d(t,{A:()=>Nl,YourLibraryX:()=>ts,q:()=>Fl});var i=r(30758),a=r(97500),n=r.n(a),l=r(96131),o=r(41978),s=r(8159),c=r(61272),d=r(81987),u=r(25297),p=r(84492),g=r(71588),y=r(66416),m=r(45293),x=r(99262),b=r(11808),h=r(83542),f=r(45346),S=r(58591),v=r(95302),C=r(79303),w=r(86070);const P=({position:e,divider:t,onCreateCallback:r=(()=>{}),spec:a})=>{const n=(0,f.W)(),{createPlaylist:l}=(0,S.A)(),o=(0,C.s)(),s=(0,i.useCallback)((()=>{n({intent:"create-playlist",type:"click"});const t=a.createButtonFactory().hitCreatePlaylist();t&&o.logInteraction(t),l(b.Ru.get("playlist.default_playlist_name"),e),r()}),[n,a,o,l,e,r]);return(0,w.jsx)(h.D,{role:"menuitem",divider:t,onClick:s,leadingIcon:(0,w.jsx)(x.u,{semanticColor:"textSubdued",size:"small"}),children:b.Ru.get("contextmenu.create-playlist")})},R=i.memo((function(e){return(0,w.jsx)(v.pZ,{value:"create-playlist",children:(0,w.jsx)(P,{...e})})}));var T=r(70583),I=r(6576);const A=i.memo((function({folderUri:e,onCreateCallback:t}){const r=e?{after:{uri:e}}:{before:"start"},{spec:i}=(0,I.o)(e??T.gv);return(0,w.jsx)(v.pZ,{value:"folder",children:(0,w.jsxs)(y.W,{children:[(0,w.jsx)(R,{position:r,onCreateCallback:t,spec:i}),(0,w.jsx)(m.j,{position:r,onCreateCallback:t,spec:i})]})})}));var j=r(36921),D=r(24805),L=r(68341),E=r(82097),O=r(45518),k=r(43717),N=r(60751),F=r(45879),B=r(68679),M=r(23361),U=r(64245),V=r(62338),_=r(93766),H=r(60674),W=r(25650),X=r(19159),z=r(25828);const Y=1248,K=800,G=(0,z.g)(_.Z),Z=(0,z.g)(H.fX),J=()=>(function(){const{size:e,setSize:t,minWidth:r,maxWidth:a,ylxCollapsedStateNavbarWidth:n,ylxDefaultStateNavbarWidth:o,ylxExpandedStateNavbarWidth:s}=(0,M.y)(),{ylxSidebarState:c,setYlxSidebarState:d,canCollapse:u}=(0,H.$)(),p=(0,U.XB)(),g=(0,U._Y)(),{min:y,max:m,size:x,setSize:b}=(0,U.Zf)(),h=(0,W.H)(),f=(0,i.useRef)(null),S=(0,i.useRef)(null),v=(0,i.useRef)(null);(0,i.useLayoutEffect)((()=>{const i=h-e-3*F.KV-(p!==_.Z.Disabled?x+F.KV:0),C={leftSidebarWidth:e,leftSidebarMinWidth:r,leftSidebarMaxWidth:a,ylxSidebarState:c,ylxSidebarStateRestoreTarget:f.current,rightSidebarWidth:x,rightSidebarMinWidth:y,rightSidebarMaxWidth:m,rightSidebarPanel:p,rightSidebarPanelRestoreTarget:S.current,storedCollapsedYLXWidth:n,storedDefaultYLXWidth:o,storedExpandedYLXWidth:s,clientWidth:h,mainContentWidth:i,canCollapse:u},w=v.current;if((0,l.j)(C,w))return;const P=function(e,t){if(!e)return{};let{leftSidebarWidth:r=0,rightSidebarWidth:i=0}=t;const{mainContentWidth:a=0,leftSidebarMinWidth:n=0,leftSidebarMaxWidth:l=0,ylxSidebarState:o,ylxSidebarStateRestoreTarget:s,rightSidebarMinWidth:c=0,rightSidebarMaxWidth:d=0,rightSidebarPanel:u,rightSidebarPanelRestoreTarget:p,storedCollapsedYLXWidth:g=0,storedDefaultYLXWidth:y=0,storedExpandedYLXWidth:m=0,clientWidth:x=0,canCollapse:b=!0}=t,h={},f=u!==_.Z.Disabled,S=void 0!==e.leftSidebarWidth&&r>e.leftSidebarWidth,v=void 0!==e.rightSidebarWidth&&i>e.rightSidebarWidth,C=void 0===e.clientWidth?0:x-e.clientWidth,w=C<0,P=x>0,R=a<F.ev?F.ev-a:0;let T=w?-1*C:0;a>Y?T=Math.max(0,T-(a-Y)):R&&(T=R);const I=o===H.fX.EXPANDED&&e.ylxSidebarState!==H.fX.EXPANDED,A=o===H.fX.DEFAULT&&e.ylxSidebarState!==H.fX.DEFAULT;let j=r-n;S&&(j=I?r-B.ZU.EXPANDED_MIN:A?r-B.ZU.DEFAULT_MIN:0);let D=v?0:i-c;const L=T<=j+D;if(a<F.ev&&!L)f&&(S||w&&(o===H.fX.COLLAPSED||!b))?(h.rightSidebarPanel=_.Z.Disabled,h.rightSidebarPanelRestoreTarget=t.rightSidebarPanel,T-=i,D=0):(o===H.fX.EXPANDED&&a+(r-B.ZU.DEFAULT_MIN)>F.ev?(h.ylxSidebarState=H.fX.DEFAULT,T-=r-y,j=y-B.ZU.DEFAULT_MIN):(h.ylxSidebarState=H.fX.COLLAPSED,T-=r-g,j=0),h.ylxSidebarStateRestoreTarget=t.ylxSidebarState);else if(u===_.Z.Disabled&&p!==_.Z.Disabled&&G(p)&&u!==e.rightSidebarPanelRestoreTarget&&a-i-F.KV>=F.ev)h.rightSidebarPanel=p,h.rightSidebarPanelRestoreTarget=null;else if(o===H.fX.DEFAULT&&s===H.fX.EXPANDED&&a-(m-r)>=F.ev)h.ylxSidebarState=H.fX.EXPANDED,h.ylxSidebarStateRestoreTarget=null;else if(o===H.fX.COLLAPSED&&s===H.fX.DEFAULT&&a-(y-r)>=F.ev)h.ylxSidebarState=H.fX.DEFAULT,h.ylxSidebarStateRestoreTarget=null;else if(P&&a>=K){let e=l-r,t=d-i;const a=Math.min(C,e+t);for(let n=0;n<a;n++)r<i&&r<l&&e>0?(r++,e--):i<d&&t>0&&(i++,t--)}o!==e.ylxSidebarState&&Z(s)&&s===e.ylxSidebarStateRestoreTarget&&(h.ylxSidebarStateRestoreTarget=null);u!==e.rightSidebarPanel&&G(p)&&p===e.rightSidebarPanelRestoreTarget&&(h.rightSidebarPanelRestoreTarget=null);if(T>0&&T<=j+D)for(let e=0;e<T;e++)r>i&&r>n&&j>0?(r--,j--):i>c&&D>0&&(i--,D--);r&&r!==t.leftSidebarWidth&&(h.leftSidebarWidth=r);i&&i!==t.rightSidebarWidth&&(h.rightSidebarWidth=i);return h}(w,C);void 0!==P.leftSidebarWidth&&t(P.leftSidebarWidth),Z(P.ylxSidebarState)&&d(P.ylxSidebarState),void 0!==P.ylxSidebarStateRestoreTarget&&(f.current=P.ylxSidebarStateRestoreTarget),void 0!==P.rightSidebarWidth&&0!==w?.rightSidebarWidth&&b(P.rightSidebarWidth),void 0!==P.rightSidebarPanel&&g((0,V.MQ)(P.rightSidebarPanel)),void 0!==P.rightSidebarPanelRestoreTarget&&(S.current=P.rightSidebarPanelRestoreTarget),v.current=C}),[e,r,a,t,c,x,y,m,b,p,n,o,s,d,g,h,u])}(),null),q=()=>(0,d.NC)(X.Wfl,{loadingValue:!1})?(0,w.jsx)(J,{}):null;var Q=r(15549);let $=function(e){return e.YLX_SORT_AND_VIEW_PICKER="ylx-sort-and-view-picker",e.YLX_CUSTOM_ORDERING="ylx-custom-ordering",e.REFINERS_PICKER="refiners-picker",e}({}),ee=function(e){return e.URGENT="urgent",e.CONTEXTUAL="contextual",e.DEFAULT="default",e}({});var te=r(88485);let re=function(e){return e.VISIBILITY_GRANTED="visibilityGranted",e.VISIBILITY_DENIED="visibilityDenied",e}({});class ie extends te.V{}const ae=(0,i.createContext)({notifyShowInterest:()=>{throw new Error("notifyShowInterest must be used within a VisibilityOrchestratorProvider")},notifyHideInterest:()=>{throw new Error("notifyHideInterest must be used within a VisibilityOrchestratorProvider")},events:new ie}),ne=({children:e})=>{const t=(0,i.useRef)({[ee.URGENT]:new Set,[ee.CONTEXTUAL]:new Set,[ee.DEFAULT]:new Set}),r=(0,i.useRef)(null),a=(0,i.useRef)(new ie),n=(0,i.useCallback)((()=>{let e=null;[ee.URGENT,ee.CONTEXTUAL,ee.DEFAULT].some((r=>{const i=t.current[r];return e=Array.from(i).at(-1)??null,e})),e!==r.current&&(null!==r.current&&a.current.emitSync(re.VISIBILITY_DENIED,{key:r.current}),null!==e&&a.current.emitSync(re.VISIBILITY_GRANTED,{key:e}),r.current=e)}),[]),l=(0,i.useCallback)(((e,r=ee.DEFAULT)=>{t.current[r].add(e),n()}),[n]),o=(0,i.useCallback)(((e,r=ee.DEFAULT)=>{const i=t.current[r];i.delete(e),t.current[r]=i,n()}),[n]);return(0,w.jsx)(ae.Provider,{value:{events:a.current,notifyShowInterest:l,notifyHideInterest:o},children:e})};r(92759),r(501);te.V;class le{events=new te.V;addRefiners(){throw new Error("Method not implemented.")}removeRefiners(){throw new Error("Method not implemented.")}getEvents(){return this.events}updateSelectedRefinersOrder(e){throw new Error("Method not implemented.")}}const oe=(0,i.createContext)(null);r(39733);var se=r(77814);r(8352),r(51396);const ce=function({children:e}){const t=(0,i.useMemo)((()=>new le),[]);return(0,w.jsx)(oe.Provider,{value:t,children:e})},de=()=>null,ue=()=>null,pe=()=>null,ge=()=>null,ye=()=>null;const me={focusElement:()=>{},getFocusElement:()=>null,registerFocusElement:()=>()=>{}},xe=(0,i.createContext)(me);class be{focusElement=()=>{};getFocusElement=()=>null;registerFocusElement=()=>()=>{}}const he=({children:e})=>{const t=(0,i.useMemo)((()=>new be),[]);return(0,w.jsx)(xe.Provider,{value:t,children:e})};var fe=r(75235);const Se=()=>({cheetaraOnboardingIsActive:!1,setCheetaraOnboardingIsActive:()=>{},cheetaraOnboardingDismissed:!1,setCheetaraOnboardingDismissed:()=>{},handleCloseCheetaraOnboarding:()=>{},cheetaraTooltipVisible:!1,setCheetaraTooltipVisible:()=>{}});r(74494);const ve=()=>!1;var Ce=r(13961),we=r(12783),Pe=r(38461),Re=r(63198),Te=r(47721),Ie=r(14467);const Ae="rqGyIqd3Igk05BEB2ZC6",je="WycFx_Gl2tUXbUJpZiD8",De=()=>{const[e,t]=(0,i.useState)(!1),r=(0,Re.V)(),a=(0,o.d4)(Te.JJ);(0,i.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),1100);return()=>{t(!1),clearTimeout(e)}}),[]);const n=(0,o.d4)(Te.mo);return r&&e?(0,w.jsx)(Pe.t5,{language:b.Ru.getLocaleForSmartling(),market:a.toLowerCase(),children:(0,w.jsxs)("div",{className:Ae,"data-testid":"left-sidebar-legal-links",children:[(0,w.jsx)(Pe.JM,{}),(0,w.jsx)("a",{draggable:!1,href:Ie.Bl,target:"_blank",rel:"noopener",className:je,children:(0,w.jsx)(we.E,{variant:"marginal",children:b.Ru.get("cookies")})}),n&&(0,w.jsx)("a",{draggable:!1,href:Ie.Vd,target:"_blank",rel:"noopener",className:je,children:(0,w.jsx)(we.E,{variant:"marginal",children:"Форма для Ваших обращений"})})]})}):null},Le="YNnobzGm5w3XKBniKdW9",Ee=(0,i.memo)((function({isAnonymous:e}){return(0,w.jsx)("div",{className:Le,"data-testid":"left-sidebar-footer",children:e&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(De,{}),(0,w.jsx)(Ce.X,{})]})})}));var Oe=r(19643),ke=r(30171),Ne=r(58593),Fe=r(53129),Be=r(34171),Me=r(38273),Ue=r(72091);const Ve="lvJXjYO7YXxGKHcgx5pe",_e="yYGZUqSKJttCw_Z2JvPL",He="wkyebhrfwyJPCfDhQgbp",We=()=>{const e=(0,Be.sy)(),t=(0,C.s)(),r=(0,o.wA)(),{spec:a}=(0,Ue.r)(Ne.V,{}),n=b.Ru.get("web-player.your-library-x.dsa-message",b.Ru.get("web-player.your-library-x.dsa-message-link")),l=(0,i.useCallback)((()=>{r(Me.r8.actions.open()),t.logInteraction(a.learnMoreButtonFactory().hitUiReveal())}),[r,t,a]);return(0,w.jsx)("div",{className:Ve,children:e?(0,w.jsx)(Fe.Zp,{label:(0,w.jsx)(we.E,{children:n}),placement:"right",showDelay:0,children:(0,w.jsx)("div",{className:_e,children:(0,w.jsx)(Oe.p,{"aria-label":n})})}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{children:(0,w.jsx)(Oe.p,{size:"small"})}),(0,w.jsx)(we.E,{as:"p",semanticColor:"textSubdued",children:b.Ru.get("web-player.your-library-x.dsa-message",(0,w.jsx)(ke.H,{condensedAll:!0,size:"small",semanticColor:"textBase",onClick:l,className:He,children:(0,w.jsx)(we.E,{variant:"bodyMedium",children:b.Ru.get("web-player.your-library-x.dsa-message-link")})}))})]})})},Xe="AhNLpx0iVnlj4SuL_Gaw",ze="JyZRugeRBHbUtS5ABOQ8",Ye=({className:e})=>(0,w.jsx)("section",{className:n()(Xe,e),children:(0,w.jsxs)("div",{className:ze,children:[(0,w.jsx)(we.E,{as:"h2",variant:"titleSmall",semanticColor:"textBase",children:b.Ru.get("web-player.your-library-x.empty-state-folder-title")}),(0,w.jsx)(we.E,{as:"p",variant:"bodySmall",semanticColor:"textBase",children:b.Ru.get("web-player.your-library-x.empty-state-folder-subtitle")})]})});var Ke=r(31843),Ge=r(75208);const Ze={getTitle:()=>b.Ru.get("action-trigger.create-playlist"),getDescription:()=>b.Ru.get("action-trigger.login-playlist")},Je=({children:e,renderInline:t})=>(0,w.jsx)(Ke.y,{id:Ge.x9,options:{...Ze,renderInline:t},children:e});var qe=r(43830),Qe=r(80852);const $e="CfruGiDGW_FH4l65GMpb",et="fIgbQ9qpINdyy__tkaHi",tt="wv308QWnPnkI8n0GdqYO",rt=(0,i.memo)((function(e){const{message:t,title:r,linkTitle:i,linkTo:a,onClick:l,className:o}=e;return(0,w.jsxs)("section",{className:n()($e,o),children:[(0,w.jsxs)("div",{className:et,children:[(0,w.jsx)(we.E,{variant:"bodyMediumBold",semanticColor:"textBase",children:r}),(0,w.jsx)(we.E,{variant:"bodySmall",semanticColor:"textBase",children:t})]}),(0,w.jsx)("div",{className:tt,children:i&&(a||l)&&(0,w.jsx)(qe.$,{className:tt,as:l?"button":void 0,colorSet:"invertedLight",href:a,onClick:l,component:Qe.v,size:"small",children:i})})]})})),it=({className:e})=>{const{createPlaylist:t}=(0,S.A)(),r=(0,i.useCallback)((()=>{t()}),[t]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Je,{renderInline:!1,children:(0,w.jsx)(rt,{onClick:r,linkTitle:b.Ru.get("web-player.your-library-x.empty-state-playlists-cta"),title:b.Ru.get("web-player.your-library-x.empty-state-playlists-title"),message:b.Ru.get("web-player.your-library-x.empty-state-playlists-subtitle"),className:e})}),(0,w.jsx)(rt,{linkTo:"/genre/podcasts-web",linkTitle:b.Ru.get("web-player.your-library-x.empty-state-podcasts-browse"),title:b.Ru.get("web-player.your-library-x.empty-state-podcasts-to-follow"),message:b.Ru.get("web-player.your-library-x.empty-state-podcasts-keep-you-updated"),className:e})]})},at="NOXrKH_1anB9lsOlyv5g",nt="FIARvjbv_YZKwz7yxNHw",lt="Fqrv8StT3DnEAfntIKCg",ot="JydI9ZzWnssPC899sOGP",st=({query:e,className:t})=>(0,w.jsxs)("div",{className:n()(at,t),"data-testid":"no-search-results-view",children:[(0,w.jsx)(we.E,{as:"h1",variant:"bodyMediumBold",className:nt,children:b.Ru.get("web-player.your-library-x.empty-results-title-short",(0,w.jsx)("span",{className:lt,children:(0,w.jsx)("span",{className:ot,children:e})}))}),(0,w.jsx)(we.E,{as:"h2",variant:"bodySmall",children:b.Ru.get("web-player.your-library-x.empty-results-text-short")})]});var ct=r(68637);const dt="vhOeYrTmSoea5vemsMpv",ut="pCKhe1uJhYBUC4YVmz9B",pt=({onClick:e})=>(0,w.jsxs)("div",{className:dt,children:[(0,w.jsx)("div",{className:"icon",children:(0,w.jsx)(ct.b,{size:"xlarge",semanticColor:"textBase"})}),(0,w.jsxs)("div",{className:ut,children:[(0,w.jsx)(we.E,{as:"h2",variant:"titleSmall",semanticColor:"textBase",children:b.Ru.get("web-player.your-library-x.error-title")}),(0,w.jsx)(we.E,{as:"p",variant:"bodySmall",semanticColor:"textBase",children:b.Ru.get("web-player.your-library-x.error-body")})]}),(0,w.jsx)("div",{children:(0,w.jsx)(qe.$,{onClick:e,colorSet:"invertedLight",size:"small",children:b.Ru.get("web-player.your-library-x.error-button")})})]}),gt=(0,i.createContext)(null);const yt=({children:e})=>{const t=function(){const[e,t]=(0,fe.x)("ylx-expanded-folders",[]),r=(0,i.useCallback)((t=>e.includes(t)),[e]),a=(0,i.useCallback)(((r,i)=>{const a=e.indexOf(r);if(i){if(-1!==a)return;t([...e,r])}else{if(-1===a)return;t(e.filter((e=>e!==r)))}}),[e,t]);return{expandedFolders:e,getIsFolderExpanded:r,setIsFolderExpanded:a}}();return(0,w.jsx)(gt.Provider,{value:t,children:e})},mt="fYWNdY4zhj4OX_T2Xtg6",xt="BRX6aJUAuAsvHKD_fpbo",bt="ZZsPF3Sn4h7m0_5Clhk0",ht="IZq_xBKdh88HLD4QY90X",ft="PUipCs3_0Qott0Sru3pB",St="XAOxFVWnd185_vZ5zPGu",vt="YsCa3XbOXEm79LH0B7do",Ct="eC25_w41L83mXDCqdm_A",wt="VyDwqqtx0153zD8a3TED",Pt="rOgsguaurlHVlgCTY0P7",Rt="zS8ATyQNwnAiEoPrCcIo",Tt="Zwr4MoUVImDin82vBn4y",It="lb8li6m8Zei4tr0zNKxX",At="aK6vld0FgHGxjz6IiHyS",jt="Xw1OibA6EkrU4F47EMw9",Dt="_EFIA9HjgZxxgTSZzQcg",Lt="JUPaw8kZF94Coth4G88s",Et="main-yourLibraryX-listItem",Ot="c1PJ2LHU0EnzyA0jDc1j",kt=({isScrolled:e})=>(0,w.jsxs)("div",{className:n()(Tt,At,{[jt]:e}),children:[(0,w.jsx)(we.E,{variant:"marginalBold",semanticColor:"textSubdued",children:b.Ru.get("web-player.your-library-x.expanded-list-header.title")}),(0,w.jsx)(we.E,{variant:"marginalBold",semanticColor:"textSubdued",children:b.Ru.get("web-player.your-library-x.expanded-list-header.date-added")}),(0,w.jsx)(we.E,{variant:"marginalBold",semanticColor:"textSubdued",children:b.Ru.get("web-player.your-library-x.expanded-list-header.played-at")})]});var Nt=r(60765);const Ft=()=>null,Bt=()=>null;const Mt=()=>({getFocusElement:null,registerFocusElement:null});var Ut=r(76792),Vt=r(11898);const _t="a2XwshgvydvJO9If_GzQ",Ht="aVLBGREPTnbTFhkSdUMV",Wt="ViXEX4SVVU_NA7zcS9kd",Xt="pQvrkwXAqZnbSqJiiQuo",zt="mA1QNQx6oUXgQ8kMID2S",Yt={marginBlockEnd:0,willChange:"transform, opacity"},Kt=({filterId:e,isPrimaryFilter:t,isPlaceholder:r,resetFilterIds:a,toggleFilterId:l,allowedDropTargetMimeTypes:o=D.Vp,className:s,innerRef:c,index:d=0,spec:u,...p})=>{const g=(0,C.s)(),y=(0,Vt.f)(),m=p.selected,x=e?y.getFilterLabel(e):"",b=(0,i.useCallback)((()=>{!e||m&&t?(a(),m&&t&&e?g.logInteraction(u.filterChipFactory({identifier:x,position:d}).hitClearFilter()):g.logInteraction(u.clearButtonFactory().hitClearFilter())):(l(e),m?g.logInteraction(u.filterChipFactory({identifier:x,position:d}).hitClearFilter()):g.logInteraction(u.filterChipFactory({identifier:x,position:d}).hitFilter()))}),[e,x,m,t,a,l,d,g,u]),h=(0,i.useCallback)((e=>{e.detail>1||r||b()}),[r,b]),{className:f,dropPosition:S,...v}=(0,L.A)({allowedMimeTypesByDropPosition:{[D.Nz.ON]:o},onLongDragOver:b});return(0,w.jsx)(Ut.v,{...p,"aria-label":p["aria-label"],...v,...S===D.Nz.ON?{selectedColorSet:"base"}:void 0,className:n()(s,f,{[Ht]:S===D.Nz.ON,[zt]:r}),onClick:h,selectedColorSet:S===D.Nz.ON?"invertedDark":"invertedLight",secondary:m&&!t,style:Yt,ref:c,tabIndex:-1})};var Gt=r(63731);const Zt={marginBlockEnd:0,willChange:"transform, opacity"},Jt=({filterId:e,isPrimaryFilter:t,isPlaceholder:r,resetFilterIds:a,toggleFilterId:l,allowedDropTargetMimeTypes:o=D.Vp,className:s,innerRef:c,index:d=0,spec:u,...p})=>{const g=(0,C.s)(),y=(0,Vt.f)(),m=p.selected,x=e?y.getFilterLabel(e):"",b=(0,i.useCallback)((()=>{!e||m&&t?(a(),m&&t&&e?g.logInteraction(u.filterChipFactory({identifier:x,position:d}).hitClearFilter()):g.logInteraction(u.clearButtonFactory().hitClearFilter())):(l(e),m?g.logInteraction(u.filterChipFactory({identifier:x,position:d}).hitClearFilter()):g.logInteraction(u.filterChipFactory({identifier:x,position:d}).hitFilter()))}),[e,x,m,t,a,l,d,g,u]),h=(0,i.useCallback)((e=>{e.detail>1||r||b()}),[r,b]),{className:f,dropPosition:S,...v}=(0,L.A)({allowedMimeTypesByDropPosition:{[D.Nz.ON]:o},onLongDragOver:b});return(0,w.jsx)(Gt.m,{...p,"aria-label":p["aria-label"],...v,...S===D.Nz.ON?{selectedColorSet:"base"}:void 0,className:n()(s,f,{[Ht]:S===D.Nz.ON,[zt]:r}),onClick:h,style:Zt,ref:c,tabIndex:-1})},qt=[j.fl.TRACKS,j.fl.LOCAL_TRACKS,j.fl.ALBUMS,j.fl.ARTISTS,j.fl.PLAYLISTS_V2,j.fl.SHOWS,j.fl.AUDIOBOOKS,j.fl.EPISODES,j.fl.FOLDERS],Qt=[j.fl.TRACKS,j.fl.LOCAL_TRACKS,j.fl.ALBUMS,j.fl.EPISODES,j.fl.PLAYLISTS_V2,j.fl.FOLDERS],$t=[j.fl.TRACKS,j.fl.LOCAL_TRACKS,j.fl.ALBUMS,j.fl.EPISODES,j.fl.PLAYLISTS_V2,j.fl.FOLDERS];r(59744);const er=()=>[];function tr(e){return{type:"contentType",id:e.id,name:e.name}}function rr(e){return e.id.startsWith("spotify:concept:")?{type:"tag",id:(t={tagUri:e.id,tagName:e.name,entityCount:0}).tagUri,name:t.tagName,count:t.entityCount}:tr(e);var t}var ir=r(24359);const ar=(0,i.memo)((function({availableFilters:e,selectedFilters:t,toggleFilterId:r,resetFilterIds:a,className:n,spec:l,inFolderView:o}){const s=!(t||e),{availableRefiners:c,activeRefiners:d,allContentTypeRefiners:u}=(({availableFilters:e,activeFilters:t,inFolderView:r})=>{const i=e?.map(tr),a=t?.map(rr)??[],n=er(),l=ve();return{availableRefiners:t?.length||!l||r?i:n,activeRefiners:a,allContentTypeRefiners:i}})({availableFilters:e,activeFilters:t,inFolderView:o}),{registerFocusElement:p}=Mt(),y=s?u:[...d??[],...c??[]],m=(0,i.useRef)(null),x=(0,i.useCallback)((()=>{(0,ir.MS)(m.current,m.current?.nextElementSibling instanceof HTMLElement?m.current?.nextElementSibling:null),a()}),[a]),h=ve();return y&&0!==y?.length?(0,w.jsxs)(Nt.F,{className:n,ariaLabel:b.Ru.get("web-player.your-library-x.filter_options"),children:[!!t?.length&&(0,w.jsx)(Jt,{resetFilterIds:x,toggleFilterId:r,allowedDropTargetMimeTypes:qt,"aria-label":b.Ru.get("web-player.your-library-x.clear_filters"),innerRef:m,spec:l}),y.map(((e,t)=>{const n=d?.includes(e),o=0===t,c=(0,w.jsx)(Kt,{innerRef:void 0,filterId:e.id,isPrimaryFilter:o,isPlaceholder:s,resetFilterIds:a,toggleFilterId:r,selected:n,spec:l,index:t,children:e.name},e.id);return h&&o?(0,w.jsx)(g.h,{menu:(0,w.jsx)(i.Suspense,{fallback:!0,children:(0,w.jsx)(Bt,{refiner:e,resetFilterIds:a,isSelected:n})}),children:c},e.id):c})),h&&!d?.length&&!o&&(0,w.jsx)(Ft,{})]}):null})),nr="",lr=(0,i.createContext)({openedFolderUri:nr,pushFolder:()=>{},popFolder:()=>{},resetFolder:()=>{},change:"PUSH"}),or=({children:e})=>{const{setFilter:t}=(0,i.useContext)(Q.g),[r,a]=(0,fe.x)("opened-folder-uri",nr),n=(0,i.useRef)([r??nr]),l=(0,i.useRef)("PUSH"),o=(0,i.useCallback)((e=>{a(e),t(nr)}),[a,t]),s=(0,i.useCallback)((e=>{n.current.push(e),l.current="PUSH",o(n.current.at(-1))}),[o]),c=(0,i.useCallback)((()=>{n.current.pop();const e=n.current.at(-1);return l.current="POP",o(e),e}),[o]),d=(0,i.useCallback)((()=>{n.current=[nr],o(nr)}),[o]);return(0,w.jsx)(lr.Provider,{value:{openedFolderUri:r,pushFolder:s,popFolder:c,resetFolder:d,change:l.current},children:e})};var sr=r(63898),cr=r(10608),dr=r(90751),ur=r(88778),pr=r(20288),gr=r(26694),yr=r(98768),mr=r(21953),xr=r(61544),br=r(56914),hr=r(67062),fr=r(2983),Sr=r(5588);const vr=({iconSize:e="small"})=>(0,w.jsx)("span",{className:ft,children:(0,w.jsx)(Sr.C,{size:e,semanticColor:"textBrightAccent",className:ht})});var Cr=r(62943);const wr=({children:e,title:t,subtitleSlot:r,isPlaying:i})=>{const a=(0,d.NC)(Cr.rW);return(0,w.jsx)(Fe.Zp,{label:(0,w.jsxs)("div",{className:n()({"circular-sp-vietnamese":a},Rt),children:[(0,w.jsxs)("div",{children:[t,r]}),i&&(0,w.jsx)(vr,{})]}),placement:"right",showDelay:0,children:e})},Pr=e=>{const t=(0,i.useRef)(null);return(0,cr.c0)(e.uri)?(0,w.jsx)(fr.cW,{parentRef:e.parentRef,api:t,children:(0,w.jsx)(wr,{...e})}):(0,w.jsx)(wr,{...e})};var Rr=r(24284),Tr=r(2512),Ir=r(16833);const Ar=({leading:e,subtitle:t,uri:r})=>{const i=`listrow-subtitle-${r}`;return(0,w.jsx)("div",{className:Ir.A.subtitle,children:(0,w.jsxs)(Rr.j,{className:Ir.A.link,id:i,dir:"auto",children:[(0,w.jsx)("span",{className:Ir.A.subtitleLeadingWrapper,children:e}),(0,w.jsx)("span",{className:Ir.A.subtitleText,children:t})]})})},jr=({leading:e,subtitle:t,uri:r})=>{const i=`card-subtitle-${r}`;return(0,w.jsx)("div",{className:Ir.A.subtitle,children:(0,w.jsxs)(Tr.j,{lineClamp:1,className:Ir.A.link,id:i,role:"gridcell",dir:"auto",children:[(0,w.jsx)("span",{className:Ir.A.subtitleLeadingWrapper,children:e}),t]})})};var Dr=r(9183),Lr=r(66060),Er=r(84608),Or=r(80460),kr=r(85993);const Nr=new Set(["Unidentified","Alt","AltGraph","CapsLock","Control","Fn","FnLock","Meta","NumLock","ScrollLock","Shift","Symbol","SymbolLock","Hyper","Super","Enter","Tab","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp","Backspace","Clear","Copy","CrSel","Cut","Delete","EraseEof","ExSel","Insert","Paste","Redo","Undo","Accept","Again","Attn","Cancel","ContextMenu","Escape","Execute","Find","Help","Pause","Play","Props","Select","ZoomIn","ZoomOut","BrightnessDown","BrightnessUp","Eject","LogOff","Power","PowerOff","PrintScreen","Hibernate","Standby","WakeUp","AllCandidates","Alphanumeric","CodeInput","Compose","Convert","Dead","FinalMode","GroupFirst","GroupLast","GroupNext","GroupPrevious","ModeChange","NextCandidate","NonConvert","PreviousCandidate","Process","SingleCandidate","HangulMode","HanjaMode","JunjaMode","Eisu","Hankaku","Hiragana","HiraganaKatakana","KanaMode","KanjiMode","Katakana","Romaji","Zenkaku","ZenkakuHankaku","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","Soft1","Soft2","Soft3","Soft4","ChannelDown","ChannelUp","Close","MailForward","MailReply","MailSend","MediaClose","MediaFastForward","MediaPause","MediaPlay","MediaPlayPause","MediaRecord","MediaRewind","MediaStop","MediaTrackNext","MediaTrackPrevious","New","Open","Print","Save","SpellCheck","Key11","Key12","AudioBalanceLeft","AudioBalanceRight","AudioBassBoostDown","AudioBassBoostToggle","AudioBassBoostUp","AudioFaderFront","AudioFaderRear","AudioSurroundModeNext","AudioTrebleDown","AudioTrebleUp","AudioVolumeDown","AudioVolumeUp","AudioVolumeMute","MicrophoneToggle","MicrophoneVolumeDown","MicrophoneVolumeUp","MicrophoneVolumeMute","SpeechCorrectionList","SpeechInputToggle","LaunchApplication1","LaunchApplication2","LaunchCalendar","LaunchContacts","LaunchMail","LaunchMediaPlayer","LaunchMusicPlayer","LaunchPhone","LaunchScreenSaver","LaunchSpreadsheet","LaunchWebBrowser","LaunchWebCam","LaunchWordProcessor","BrowserBack","BrowserFavorites","BrowserForward","BrowserHome","BrowserRefresh","BrowserSearch","BrowserStop","AppSwitch","Call","Camera","CameraFocus","EndCall","GoBack","GoHome","HeadsetHook","LastNumberRedial","Notification","MannerMode","VoiceDial","TV","TV3DMode","TVAntennaCable","TVAudioDescription","TVAudioDescriptionMixDown","TVAudioDescriptionMixUp","TVContentsMenu","TVDataService","TVInput","TVInputComponent1","TVInputComponent2","TVInputComposite1","TVInputComposite2","TVInputHDMI1","TVInputHDMI2","TVInputHDMI3","TVInputHDMI4","TVInputVGA1","TVMediaContext","TVNetwork","TVNumberEntry","TVPower","TVRadioService","TVSatellite","TVSatelliteBS","TVSatelliteCS","TVSatelliteToggle","TVTerrestrialAnalog","TVTerrestrialDigital","TVTimer","AVRInput","AVRPower","ColorF0Red","ColorF1Green","ColorF2Yellow","ColorF3Blue","ColorF4Grey","ColorF5Brown","ClosedCaptionToggle","Dimmer","DisplaySwap","DVR","Exit","FavoriteClear0","FavoriteClear1","FavoriteClear2","FavoriteClear3","FavoriteRecall0","FavoriteRecall1","FavoriteRecall2","FavoriteRecall3","FavoriteStore0","FavoriteStore1","FavoriteStore2","FavoriteStore3","Guide","GuideNextDay","GuidePreviousDay","Info","InstantReplay","Link","ListProgram","LiveContent","Lock","MediaApps","MediaAudioTrack","MediaLast","MediaSkipBackward","MediaSkipForward","MediaStepBackward","MediaStepForward","MediaTopMenu","NavigateIn","NavigateNext","NavigateOut","NavigatePrevious","NextFavoriteChannel","NextUserProfile","OnDemand","Pairing","PinPDown","PinPMove","PinPToggle","PinPUp","PlaySpeedDown","PlaySpeedReset","PlaySpeedUp","RandomToggle","RcLowBattery","RecordSpeedNext","RfBypass","ScanChannelsToggle","ScreenModeNext","Settings","SplitScreenToggle","STBInput","STBPower","Subtitle","Teletext","VideoModeNext","Wink","ZoomToggle"]);function Fr(e,t){const[r,a]=(0,i.useState)(""),n=(0,i.useRef)(r);n.current=r;const l=(0,i.useRef)(null);return(0,i.useEffect)((()=>{const r=e.current;if(!r||!t)return a(""),()=>{};const i=e=>{const t="Backspace"===e.key,r=" "===e.key,i=e.metaKey||e.ctrlKey,o=e.target instanceof HTMLElement&&e.target?.matches("input, textarea, [contenteditable]"),s=e.isComposing||229===e.keyCode,c=(d=e.key,Nr.has(d)&&!t);var d;const u=r&&!n.current,p=t&&!n.current;if(i||o||s||c||u||p)return;(t&&n.current||r)&&(e.preventDefault(),e.stopPropagation()),a((r=>t?r.slice(0,-1):r+e.key)),l.current&&clearTimeout(l.current),l.current=setTimeout((()=>a("")),1e3)};return r.addEventListener("keydown",i,!0),()=>{r.removeEventListener("keydown",i,!0),l.current&&clearTimeout(l.current)}}),[e,t]),r}const Br=(0,i.createContext)({setTypeaheadResult:({uid:e,str:t})=>{if(e||t)throw new Error("setTypeaheadResult must be used within a TypeaheadProvider")},typeaheadResult:{uid:null,str:""}}),Mr=({children:e,containerRef:t,findMatchingTypeaheadUid:r,isEnabled:a=!0})=>{const[n,l]=(0,i.useState)({uid:null,str:""}),o=(0,i.useMemo)((()=>({typeaheadResult:n,setTypeaheadResult:l})),[n,l]),s=Fr(t,a),c=(0,i.useRef)(s);c.current=s;const d=(0,i.useRef)(r);return d.current=r,(0,i.useEffect)((()=>{s&&a?d.current(s).then((e=>{s===c.current&&l({uid:e,str:s})})):l({uid:null,str:""})}),[a,s,l]),(0,w.jsx)(Br.Provider,{value:o,children:e})};var Ur=r(53209);const Vr={state:{referrer:"your_library",preventMoveFocus:!0}};function _r(e,t,r,a){const{filter:n}=(0,i.useContext)(Q.g),{isActive:l}=(0,kr.l_)(e),o=function(e){const{typeaheadResult:{uid:t,str:r}}=(0,i.useContext)(Br);return t===e?r:null}(e),s=!!o,c=(0,Or.W)({uri:e,type:"link"})?(0,Ur.hF)(t):t,d=(0,i.useRef)(null),u=(0,Dr.Zp)(),p=(0,i.useCallback)((e=>{e.preventDefault(),a?a():c&&u(c,Vr)}),[a,u,c]);(0,i.useLayoutEffect)((()=>{s&&d.current?.closest('[role="row"], [role="listitem"]')?.querySelector("button")?.focus({preventScroll:!0})}),[s]);return{isActive:l,onClick:p,contents:n||o?(0,w.jsx)("span",{ref:d,children:(0,w.jsx)(gr.M,{autoEscape:!0,searchWords:[n.trim(),...o?.split(" ")??""],textToHighlight:r})}):r}}const Hr=({uri:e,playbackUri:t=e,title:r,menu:i,to:a=(0,xr.o_)(e)?.toURLPath(!0)||"",handleNavigate:l})=>{const{isActive:o,contents:s}=_r(t,a,r,l),c=`listrow-title-${e}`;return(0,w.jsx)(g.h,{menu:i,children:(0,w.jsx)(Lr.d,{id:c,lineClamp:1,className:n()(Ir.A.link,Ir.A.titleLink),semanticColor:o?"textBrightAccent":"textBase",dir:"auto",children:s})})},Wr=({uri:e,playbackUri:t=e,title:r,menu:i,to:a=(0,xr.o_)(e)?.toURLPath(!0)||"",handleNavigate:l})=>{const{isActive:o,onClick:s,contents:c}=_r(t,a,r,l);return(0,w.jsx)(g.h,{menu:i,children:(0,w.jsx)(Er.Z,{lineClamp:1,className:n()(Ir.A.link,Ir.A.titleLink),semanticColor:o?"textBrightAccent":"textBase",href:a,onClick:s,role:"gridcell",dir:"auto",children:c})})},Xr=[j.fl.ALBUMS,j.fl.ARTISTS,j.fl.PLAYLISTS_V2,j.fl.SHOWS,j.fl.FOLDERS,j.fl.PSEUDO_PLAYLISTS],zr=[j.fl.PLAYLISTS_V2,j.fl.FOLDERS];var Yr=r(76174);const Kr=({isConfirmationForPlaylist:e,onConfirm:t,onClose:r})=>{const i=e?b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.title-playlist"):b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.title-folder");return(0,w.jsx)(Yr.T,{"aria-label":i,titleText:i,descriptionText:e?b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.message-playlist"):b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.message-folder"),onConfirm:t,onClose:r,confirmText:b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.confirm-button-text"),confirmLabel:e?b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.confirm-button-label-playlist"):b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.confirm-button-label-folder"),cancelText:b.Ru.get("web-player.your-library-x.unpin-confirmation-dialog.cancel-button-text"),allowHTML:!0})};var Gr=r(6823);function Zr({onApplyDrop:e,spec:t,isDropTargetPinned:r}){const a=(0,Vt.f)(),{contains:n}=(0,Gr.p)("ylpin"),[l,o]=(0,i.useState)(null),s=(0,i.useCallback)((async(t,i)=>{if(r)return void e(t,i);const{[j.fl.PLAYLISTS_V2]:a=[],[j.fl.FOLDERS]:l=[]}=t,s=[...a,...l];if(!!s.length&&(await n(...s)).some(Boolean)){if(s.length>1)throw new Error("Reordering multiple pinned items at once is not supported");o({dropData:t,dropPosition:i})}else e(t,i)}),[r,n,e]),c=(0,C.s)();return{applyDropWithUnpinConfirmation:s,unpinConfirmationDialog:l?(0,w.jsx)(Kr,{isConfirmationForPlaylist:!l.dropData[j.fl.FOLDERS]?.length,onClose:()=>o(null),onConfirm:async()=>{const{[j.fl.PLAYLISTS_V2]:r=[],[j.fl.FOLDERS]:i=[]}=l.dropData;await a.unpin([...r,...i][0]),t?.dragUnpinItem&&c.logInteraction(t.dragUnpinItem({itemToUnpin:[...r,...i][0]})),e(l.dropData,l.dropPosition),o(null)}}):null}}function Jr(){const{dropOriginUri:e,sectionId:t}=(0,i.useContext)(k.O_);return{dropOriginIsYLX:e===T.gv,entityIsInFolder:t>0}}var qr=r(67196);function Qr(){const e=(0,qr.g)(),{dropOriginIsYLX:t}=Jr();return(0,i.useCallback)((async(r,i)=>{const a=await e.contains(r);if(1!==new Set(a).size)throw new Error("Dropping a mix of newly added and moved playlists is not supported");if(a[0]){if(r.length>1)throw new Error("Moving multiple playlists at once is not supported");t?await e.move({uri:r[0]},i):await e.move({uri:r[0]},i,!0)}else await e.add(r,i)}),[t,e])}var $r=r(47327);function ei({dropTargetUri:e,spec:t,isDropTargetPinned:r}){const a=(0,qr.g)(),n=(0,Vt.f)(),l=(0,C.s)(),o=Qr(),s=(0,i.useCallback)((async(i,s)=>{const{[j.fl.PLAYLISTS_V2]:c=[],[j.fl.FOLDERS]:[d]=[]}=i,u=s===D.Nz.BEFORE?{before:{uri:e}}:{after:{uri:e}};if(r){const e=i[Object.keys(i)[0]][0];if((0,xr.tb)(e)||(0,xr.fp)(e)){const t=ti((await a.getContents()).items,e);-1===t?await a.add([e],{before:"start"}):t>0&&((0,xr.tb)(e)?await a.move({uri:e},{before:"start"}):await a.moveFolder({uri:e},{before:"start"}))}else if(!(0,xr.Z0)(e)){const[t]=await n.contains(e);t||await n.add({uris:[e]})}await n.pin(e,u),l.logInteraction(t.dragPinItem({itemToPin:e}))}else d?await a.moveFolder({uri:d},u):c.length&&await o(c,u);l.logInteraction(t.dragSort())}),[e,r,n,l,t,a,o]),{unpinConfirmationDialog:c,applyDropWithUnpinConfirmation:d}=Zr(r?{onApplyDrop:s,spec:t,isDropTargetPinned:r}:{onApplyDrop:s});return{handleDropBeforeOrAfterRootlistItem:(0,i.useCallback)((async(e,t)=>{const{[j.fl.PLAYLISTS_V2]:r=[],[j.fl.FOLDERS]:i=[]}=e;if(r.length&&i.length)throw new Error("Dropping a mix of playlists and folders is not supported");if(i.length>1)throw new Error("Dropping multiple folders is not supported");d(e,t)}),[d]),unpinConfirmationDialog:c}}function ti(e,t,r=0){for(const i of e)if((0,$r.Af)(i)||(0,$r.sA)(i)){if((0,xr.B2)(i.uri,t))return r;if((0,$r.sA)(i)){const e=ti(i.items,t,r+1);if(-1!==e)return e}}return-1}var ri=r(14627);const ii={state:{referrer:"your_library",preventMoveFocus:!0}};function ai({uri:e,to:t=(0,xr.o_)(e)?.toURLPath(!0)||"",type:r,handleNavigate:a,dragLabel:n,isPinned:l,canReorder:o,allowedDropTargetDropOnMimeTypes:s=[],onDropTargetDropOn:c,onLongDragOver:d,openDeleteDialog:u,togglePlay:p,isItemInGrid:g,playInsteadOfNavigating:y=!1,isPlaying:m,isActive:x,spec:b,folderDepth:h}){const f=(0,Or.W)({uri:e,type:"link"})?(0,Ur.hF)(t):t,S=(0,Dr.Zp)(),v=(0,Dr.zy)(),w=(0,i.useCallback)((()=>{S(f,ii)}),[S,f]),P=(0,C.s)(),R=(0,i.useRef)(0),I=(0,i.useRef)(null),A=(0,i.useCallback)((({target:e})=>e instanceof HTMLElement&&!I.current?.contains(e)),[]),E=(0,i.useCallback)((t=>{if(!A(t)){if(t.preventDefault(),t.currentTarget.scrollIntoView({block:"nearest"}),y){if(R.current>Date.now())return;return R.current=Date.now()+300,void(m||(p?.(),P.logInteraction(b.yourLibraryItemFactory().hitPlay({itemToBePlayed:e}))))}a?a():f&&S(f,{...ii,replace:f===v.pathname}),P.logInteraction(b.yourLibraryItemFactory().hitUiNavigate({destination:e}))}}),[A,y,a,f,P,b,e,p,m,S,v.pathname]),O=(0,i.useCallback)((t=>{y||A(t)||p&&(x?m?P.logInteraction(b.yourLibraryItemFactory().doubleHitPause({itemToBePaused:e})):P.logInteraction(b.yourLibraryItemFactory().doubleHitResume({itemToBeResumed:e})):P.logInteraction(b.yourLibraryItemFactory().doubleHitPlay({itemToBePlayed:e})),p?.())}),[A,y,p,x,m,P,b,e]),k=(0,i.useCallback)((()=>{P.logInteraction(b.yourLibraryItemFactory().secondaryHitUiReveal())}),[P,b]),{draggable:N,onDragStart:F}=(0,ri.P)({itemUris:[e],itemMimeTypes:[(0,j.j3)(r)],dragLabelText:n,sectionId:h??0,dropOriginUri:T.gv});let B=[];l?B=Xr:o&&(B=zr);const M={[D.Nz.ON]:s,[D.Nz.BEFORE]:B,[D.Nz.AFTER]:B},{handleDropBeforeOrAfterRootlistItem:U,unpinConfirmationDialog:V}=ei({dropTargetUri:e,spec:b,isDropTargetPinned:l}),_=(0,i.useCallback)(((e,t)=>{t===D.Nz.ON?c?.(e,t):t!==D.Nz.BEFORE&&t!==D.Nz.AFTER||U(e,t)}),[c,U]),{dropPosition:H,className:W,...X}=(0,L.A)({uri:e,allowedMimeTypesByDropPosition:M,onDrop:_,onLongDragOver:d??w,reorderDirection:g?"horizontal":"vertical"}),z=(0,i.useCallback)((t=>{t.repeat||A(t)||("Backspace"!==t.key&&"Delete"!==t.key||!u||u(),"Enter"===t.key&&t.shiftKey&&p&&(t.preventDefault(),p()),"Enter"===t.key&&P.logInteraction(b.yourLibraryItemFactory().keyStrokeUiNavigate({destination:e})))}),[A,P,u,b,p,e]),Y=(0,xr.o_)(v.pathname,{parseUnknown:!0})?.toURI();return{onClick:E,onDoubleClick:O,draggable:N&&!!n,onDragStart:F,onKeyDown:z,unpinConfirmationDialog:V,dropPosition:H,dropTargetClassName:W,logRightClick:k,isViewActive:!!Y&&(0,xr.B2)(e,Y),itemRef:I,...X}}var ni=r(71817),li=r(36485);const oi=e=>{switch(e){case ni.c.ALBUM:return b.Ru.get("web-player.your-library-x.type-album");case ni.c.ARTIST:return b.Ru.get("web-player.your-library-x.type-artist");case ni.c.FOLDER:return b.Ru.get("web-player.your-library-x.type-folder");case ni.c.AUDIOBOOK:return b.Ru.get("web-player.your-library-x.type-audiobook");case ni.c.YOUR_EPISODES:case ni.c.LOCAL_FILES:case ni.c.LIKED_SONGS:case ni.c.PLAYLIST:return b.Ru.get("web-player.your-library-x.type-playlist");case ni.c.SHOW:return b.Ru.get("web-player.your-library-x.type-show");case ni.c.PRE_RELEASE_ALBUM:return b.Ru.get("web-player.your-library-x.type-prerelease-album");case ni.c.PRE_RELEASE_BOOK:return b.Ru.get("web-player.your-library-x.type-prerelease-audiobook");default:return(0,li.d)(e)}},si=e=>{switch(e){case ni.c.YOUR_EPISODES:case ni.c.LIKED_SONGS:case ni.c.LOCAL_FILES:return ni.c.PLAYLIST;default:return e}};var ci=r(265);const di=i.createContext(!1),ui=({children:e,isCompact:t})=>(0,w.jsx)(di.Provider,{value:t,children:e}),pi=()=>(0,i.useContext)(di),gi="wJTUKAyYI219kJtclJLa",yi="q0_cpEyu_8EC7he96qT_",mi="L8ET6xwMh_wMEqCpmunH",xi="D_1eJKOJ3wTCKO93GX06",bi="_7kcfiJ2UNEh3CDR9Wau",hi="N8wAJha8ApfxgOfqv4UM",fi="iJMxV9zMXSfrjJPyB3Fw",Si=({uri:e,to:t=(0,xr.o_)(e)?.toURLPath(!0)||"",handleNavigate:r,dragLabel:a,name:l,subtitle:o,cover:s,type:c,downloadButton:d,canReorder:u,allowedDropTargetDropOnMimeTypes:p,onDropTargetDropOn:y,onLongDragOver:m,menu:x,leading:b,openDeleteDialog:h,togglePlay:f,isPinned:S,shouldShowType:v,playbackUri:C,isPlaying:P,isActive:R,playInsteadOfNavigating:T,spec:I,index:A,animateClassName:j="",animateState:L,preReleaseIcon:E,lockedIcon:O})=>{const{onClick:k,onDoubleClick:N,draggable:F,onDragStart:B,onKeyDown:M,dropPosition:U,dropTargetClassName:V,unpinConfirmationDialog:_,logRightClick:H,isViewActive:W,itemRef:X,...z}=ai({uri:e,to:t,handleNavigate:r,dragLabel:a,isPinned:S,canReorder:u,allowedDropTargetDropOnMimeTypes:p,onDropTargetDropOn:y,openDeleteDialog:h,onLongDragOver:m,togglePlay:f,isItemInGrid:!0,isPlaying:P,isActive:R,spec:I,playInsteadOfNavigating:T}),Y=(0,w.jsx)(Wr,{uri:e,title:l,menu:x,handleNavigate:r,playbackUri:C}),K=(0,w.jsx)(jr,{leading:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ci.g,{pinned:S}),O,E,d]}),subtitle:(0,w.jsxs)(w.Fragment,{children:[v&&oi(c),!!o&&v&&" • ",o]}),uri:e}),G=(0,i.useRef)(null),Z=pi();let J=(0,w.jsx)(g.h,{menu:x,onShow:H,children:(0,w.jsx)(hr.E,{uri:e,trigger:hr.l.OnMouseDown,children:(0,w.jsx)(yr.Z,{id:e,title:Y,subtitle:K,media:s,size:"sm",leading:b,className:n()(gi,{[j]:L}),variant:W?"tinted":void 0,onClick:k,onDoubleClick:N,padding:mr.CJ,...z})})});return Z&&(J=(0,w.jsx)(Pr,{title:Y,subtitleSlot:K,uri:e,isPlaying:P,parentRef:G,children:(0,w.jsx)("div",{children:(0,w.jsx)(g.h,{menu:x,onShow:H,children:(0,w.jsx)(hr.E,{uri:e,trigger:hr.l.OnMouseDown,children:(0,w.jsx)(yr.Z,{id:e,title:void 0,media:s,size:"sm",className:n()(gi,yi,{[j]:L}),variant:W?"tinted":void 0,onClick:k,onDoubleClick:N,padding:mr.vw,ref:G,...z})})})})})),(0,w.jsxs)(w.Fragment,{children:[_,(0,w.jsx)(br.W,{draggable:F,onDragStart:B,onKeyDown:M,className:n()(V,{[_t]:U===D.Nz.ON,[Wt]:U===D.Nz.BEFORE,[Xt]:U===D.Nz.AFTER}),"aria-selected":R,innerRef:X,"aria-posinset":A,children:J})]})};var vi=r(2977),Ci=r(27685);const wi=({name:e,uri:t,togglePlay:r,spec:a,isActive:l,isPlaying:o,size:s})=>{const c=(0,C.s)(),d=(0,i.useCallback)((()=>{l?o?c.logInteraction(a.yourLibraryItemFactory().doubleHitPause({itemToBePaused:t})):c.logInteraction(a.yourLibraryItemFactory().doubleHitResume({itemToBeResumed:t})):c.logInteraction(a.yourLibraryItemFactory().doubleHitPlay({itemToBePlayed:t})),r()}),[l,o,c,a,r,t]);return(0,w.jsx)("div",{className:n()(bi,{[fi]:o,[hi]:"small"===s}),role:"gridcell",children:(0,w.jsx)(Ci.R,{isPlaying:o,onClick:d,ariaPlayLabel:b.Ru.get("playlist.a11y.play",e),ariaPauseLabel:b.Ru.get("playlist.a11y.pause",e),size:s})})};var Pi=r(67464),Ri=r(89942),Ti=r(578),Ii=r(26969),Ai=r(38861);const ji=(0,i.memo)((function({title:e,type:t,images:r,isCircular:i,color:a,animateState:l,animateClassName:o=""}){const s=(0,Ai._)();return(0,w.jsx)(Pi.b,{fadeIn:!0,images:s(r,48),shape:i?Pi.u.CIRCLE:Pi.u.ROUNDED_CORNERS,size:Ri.Qe.SIZE_48,iconSize:"medium",type:t,title:e,className:n()(Ir.A.entityImage,{[o]:l}),color:a,loadingMode:"eager"})})),Di=(0,i.memo)((function({title:e,type:t,uri:r,images:a,isCircular:n,togglePlay:l,color:o,spec:s,isActive:c,isPlaying:u}){const p=(0,d.NC)(Cr.AE),g=pi(),y=(0,Ai._)(),[m,x]=(0,i.useState)("medium"),b=(0,i.useRef)(null);return(0,Ii.w)({onResize:({width:e})=>{x(e<90?"small":"medium")},refOrElement:b}),(0,w.jsx)("div",{className:xi,ref:b,children:(0,w.jsx)(vi.M,{images:y(a,250),FallbackComponent:e=>(0,w.jsx)(Ti.s,{semanticColor:"textSubdued",type:t,size:"xxlarge",className:p?mi:"",...e}),isCircular:n,color:o,loadingMode:"eager",children:l&&!g&&(0,w.jsx)(wi,{name:e,uri:r,togglePlay:l,spec:s,isActive:c,isPlaying:u,size:m})})})}));var Li=r(5122);const Ei="_ymJNIfklFmogab9uWY1",Oi=({folderDepth:e=0})=>(0,w.jsx)("li",{className:Ei,style:{"--ylx-folder-depth":e}}),ki=e=>{const{RowVariantComponent:t,uri:r,to:a=(0,xr.o_)(r)?.toURLPath(!0)||"",handleNavigate:l,folderDepth:o,className:s,dragLabel:c,isPinned:d,canReorder:u,allowedDropTargetDropOnMimeTypes:p,onDropTargetDropOn:g,onLongDragOver:y,style:m,openDeleteDialog:x,togglePlay:b,isPlaying:h,isActive:f,type:S,menu:v,name:C,subtitle:P,downloadButton:R,expandFolderButton:T,cover:I,alt:A,addedAt:j,lastPlayedAt:L,shouldShowType:E,playbackUri:O,playInsteadOfNavigating:k,spec:N,nrValidItems:F,index:B,lockedIcon:M,onKeyDown:U,preReleaseIcon:V,..._}=e,{onClick:H,onDoubleClick:W,onDragStart:X,onKeyDown:z,dropPosition:Y,dropTargetClassName:K,draggable:G,unpinConfirmationDialog:Z,logRightClick:J,isViewActive:q,itemRef:Q,...$}=ai({uri:r,to:a,type:S,handleNavigate:l,dragLabel:c,isPinned:d,canReorder:u,allowedDropTargetDropOnMimeTypes:p,onDropTargetDropOn:g,onLongDragOver:y,openDeleteDialog:x,togglePlay:b,isPlaying:h,isActive:f,playInsteadOfNavigating:k,spec:N,folderDepth:o}),ee=(0,i.useCallback)((e=>{z(e),U?.(e)}),[z,U]);return(0,w.jsxs)(w.Fragment,{children:[Z,Y===D.Nz.BEFORE&&(0,w.jsx)(Oi,{folderDepth:o}),(0,w.jsx)(Li.c,{style:{"--ylx-folder-depth":o,...m},draggable:G,onDragStart:X,onDoubleClick:W,className:n()(s,K,Et,{[_t]:Y===D.Nz.ON}),..._,...$,onKeyDown:ee,innerRef:Q,"aria-setsize":F,"aria-posinset":B+1,children:(0,w.jsx)(t,{...e,to:a,isActive:f,isViewActive:q,onClick:H,logRightClick:J,playInsteadOfNavigating:k,parentRef:Q})}),Y===D.Nz.AFTER&&(0,w.jsx)(Oi,{folderDepth:o})]})};var Ni=r(88952);const Fi=({locked:e})=>e?(0,w.jsx)(Ni.u,{semanticColor:"textSubdued",title:b.Ru.get("mwp.header.content.unavailable"),className:Ir.A.icon,size:"xsmall"}):null;var Bi=r(42582);function Mi(e){const{uri:t,artists:r,isPremiumOnly:a}=e,{filter:n}=(0,i.useContext)(Q.g),{isPlaying:l,isActive:s}=(0,kr.l_)(t),c=(0,o.wA)(),d=(0,i.useCallback)((()=>{c((0,dr.aw)(t))}),[c,t]),{togglePlay:u}=(0,Bi.P)({uri:t},{featureIdentifier:"album",referrerIdentifier:"your_library"});return{isPlaying:l,isActive:s,openDeleteDialog:d,togglePlay:a?void 0:u,menu:(0,w.jsx)(ur.h,{uri:t,canPin:e.canPin,isPinned:e.pinned,useDialogForUnfollow:!0,isInLibrary:!0}),subtitleText:(0,w.jsx)(gr.M,{searchWords:[n.trim()],textToHighlight:r.at(0)?.name??""}),downloadButton:(0,w.jsx)(pr.M,{uri:t,size:"xsmall",className:Ir.A.icon,as:"span"})}}const Ui=({libraryItem:e,shouldShowType:t=!1,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{uri:l,images:o,name:s,pinned:c,type:d,addedAt:u,lastPlayedAt:p,color:g,isPremiumOnly:y}=e,{isPlaying:m,isActive:x,openDeleteDialog:b,togglePlay:h,menu:f,subtitleText:S,downloadButton:v}=Mi(e),C=(0,w.jsx)(ji,{title:s,type:d,images:o,color:g}),P=(0,w.jsx)(Fi,{locked:y});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:l,cover:C,name:s,subtitle:S,downloadButton:v,alt:s,type:d,dragLabel:s,menu:f,togglePlay:h,openDeleteDialog:b,addedAt:u,lastPlayedAt:p,isPinned:c,isPlaying:m,isActive:x,shouldShowType:t,spec:i,nrValidItems:a,index:n,lockedIcon:P})},Vi=({libraryItem:e,shouldShowType:t=!1,spec:r,index:i})=>{const{uri:a,images:n,name:l,pinned:o,type:s,color:c,isPremiumOnly:d}=e,{togglePlay:u,menu:p,subtitleText:g,downloadButton:y,openDeleteDialog:m,isPlaying:x,isActive:b}=Mi(e),h=(0,w.jsx)(Di,{title:l,type:s,images:n,uri:a,togglePlay:u,color:c,spec:r,isActive:b,isPlaying:x}),f=(0,w.jsx)(Fi,{locked:d});return(0,w.jsx)(Si,{uri:a,name:l,subtitle:g,menu:p,dragLabel:l,cover:h,downloadButton:y,type:s,togglePlay:u,isPinned:o,shouldShowType:t,openDeleteDialog:m,isPlaying:x,isActive:b,spec:r,index:i,lockedIcon:f})};var _i=r(17202);function Hi(e){const{uri:t}=e,r=(0,o.wA)(),{togglePlay:a}=(0,Bi.P)({uri:t},{featureIdentifier:"artist",referrerIdentifier:"your_library"}),{isPlaying:n,isActive:l}=(0,kr.l_)(t);return{togglePlay:a,isPlaying:n,isActive:l,openDeleteDialog:(0,i.useCallback)((()=>{r((0,dr.aw)(t))}),[r,t]),menu:(0,w.jsx)(_i.t,{uri:t,canPin:e.canPin,isPinned:e.pinned,useDialogForUnfollow:!0,isInLibrary:!0})}}const Wi=({libraryItem:e,shouldShowType:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{uri:l,images:o,name:s,type:c,addedAt:d,lastPlayedAt:u,pinned:p,color:g}=e,{togglePlay:y,isPlaying:m,isActive:x,openDeleteDialog:b,menu:h}=Hi(e),f=(0,w.jsx)(ji,{title:s,type:c,images:o,isCircular:!0,color:g});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:l,cover:f,name:s,type:c,alt:s,dragLabel:s,menu:h,togglePlay:y,openDeleteDialog:b,addedAt:d,lastPlayedAt:u,isPlaying:m,isActive:x,isPinned:p,shouldShowType:t,spec:i,nrValidItems:a,index:n})},Xi=({libraryItem:e,shouldShowType:t,spec:r,index:i})=>{const{uri:a,images:n,name:l,type:o,pinned:s,color:c}=e,{togglePlay:d,menu:u,openDeleteDialog:p,isPlaying:g,isActive:y}=Hi(e),m=(0,w.jsx)(Di,{title:l,type:o,images:n,uri:a,togglePlay:d,isCircular:!0,color:c,spec:r,isActive:y,isPlaying:g});return(0,w.jsx)(Si,{uri:a,name:l,menu:u,dragLabel:l,cover:m,type:o,togglePlay:d,isPinned:s,shouldShowType:t,openDeleteDialog:p,isPlaying:g,isActive:y,spec:r,index:i})};var zi=r(71072);function Yi(e){const{uri:t,authorName:r}=e,{filter:a}=(0,i.useContext)(Q.g),n=(0,o.wA)(),{isPlaying:l,isActive:s}=(0,kr.l_)(t);return{isPlaying:l,isActive:s,openDeleteDialog:(0,i.useCallback)((()=>{n((0,dr.aw)(t))}),[n,t]),menu:(0,w.jsx)(zi.p,{uri:t,canPin:e.canPin,isPinned:e.pinned,useDialogForUnfollow:!0,isInLibrary:!0}),subtitleText:(0,w.jsx)(gr.M,{searchWords:[a.trim()],textToHighlight:r}),downloadButton:(0,w.jsx)(pr.M,{uri:t,size:"xsmall",className:Ir.A.icon,as:"span"})}}const Ki=({libraryItem:e,shouldShowType:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{uri:l,images:o,name:s,type:c,pinned:d,addedAt:u,lastPlayedAt:p,color:g}=e,{isPlaying:y,isActive:m,openDeleteDialog:x,menu:b,subtitleText:h,downloadButton:f}=Yi(e),S=(0,w.jsx)(ji,{title:s,type:c,images:o,color:g}),v=(0,w.jsx)(Fi,{locked:e.isLocked});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:l,cover:S,name:s,subtitle:h,alt:s,dragLabel:s,menu:b,openDeleteDialog:x,addedAt:u,lastPlayedAt:p,isPlaying:y,isActive:m,isPinned:d,shouldShowType:t,type:c,spec:i,nrValidItems:a,lockedIcon:v,index:n,downloadButton:f})},Gi=({libraryItem:e,shouldShowType:t,spec:r,index:i})=>{const{uri:a,images:n,name:l,type:o,pinned:s,color:c}=e,{menu:d,subtitleText:u,openDeleteDialog:p,isPlaying:g,isActive:y,downloadButton:m}=Yi(e),x=(0,w.jsx)(Di,{title:l,type:o,images:n,uri:a,color:c,spec:r,isActive:y,isPlaying:g});return(0,w.jsx)(Si,{uri:a,name:l,subtitle:u,menu:d,dragLabel:l,cover:x,isPinned:s,shouldShowType:t,type:o,openDeleteDialog:p,isPlaying:g,isActive:y,spec:r,index:i,downloadButton:m})};var Zi=r(96554),Ji=r(34489);const qi=({uri:e,divider:t,onDeleteCallback:r})=>{const a=(0,f.W)(),n=(0,o.wA)(),l=(0,i.useCallback)((()=>{a({intent:"playlisting",type:"click"}),n((0,dr.OB)(e,r))}),[n,r,a,e]);return(0,w.jsx)(h.D,{role:"menuitem",divider:t,onClick:l,leadingIcon:(0,w.jsx)(Ji.P,{semanticColor:"textSubdued",size:"small"}),children:b.Ru.get("contextmenu.delete")})},Qi=i.memo((function(e){return(0,w.jsx)(v.pZ,{value:"delete-folder",children:(0,w.jsx)(qi,{...e})})}));var $i=r(79095),ea=r(1256),ta=r(94526);const ra=({uri:e,spec:t})=>{const{togglePlay:r,isPlaying:a,isActive:n}=(0,Bi.P)({uri:e},{featureIdentifier:"folder"}),l=(0,C.s)(),o=(0,i.useCallback)((()=>{r(),t&&l&&(a?l.logInteraction(t.playButtonFactory({uri:e}).hitPause({itemToBePaused:e})):n?l.logInteraction(t.playButtonFactory({uri:e}).hitResume({itemToBeResumed:e})):l.logInteraction(t.playButtonFactory({uri:e}).hitPlay({itemToBePlayed:e})))}),[n,a,l,t,r,e]);return(0,w.jsx)(h.D,{role:"menuitem",onClick:o,leadingIcon:a?(0,w.jsx)(ea._,{semanticColor:"textSubdued",size:"small"}):(0,w.jsx)(ta.A,{semanticColor:"textSubdued",size:"small"}),children:a?b.Ru.get("pause"):b.Ru.get("play")})},ia=i.memo((function(e){return(0,w.jsx)(v.pZ,{value:"create-folder",children:(0,w.jsx)(ra,{...e})})}));var aa=r(17652);const na=({uri:e,name:t,divider:r,spec:a,handleRename:n})=>{const l=(0,C.s)(),s=(0,o.wA)(),c=(0,i.useCallback)((()=>{a&&l.logInteraction(a.editButtonFactory({uri:e}).hitUiReveal()),s((0,dr.O2)(t,n))}),[s,l,t,n,a,e]);return(0,w.jsx)(h.D,{role:"menuitem",divider:r,onClick:c,leadingIcon:(0,w.jsx)(aa.G,{semanticColor:"textSubdued",size:"small"}),children:b.Ru.get("contextmenu.rename")})},la=i.memo((function(e){return(0,w.jsx)(v.pZ,{value:"rename",children:(0,w.jsx)(na,{...e})})}));var oa=r(58357),sa=r(39683);const ca=i.memo((function({reference:e,name:t="",onRename:r,onCreateCallback:i=(()=>{}),onDeleteCallback:a,canPin:n=T.oT.NO,isPinned:l=!1,isPlayable:o=!0}){const{spec:s}=(0,I.o)(e.uri),c=(0,sa.Ek)()&&o;return(0,w.jsx)(v.pZ,{value:"folder",children:(0,w.jsxs)(y.W,{children:[(0,w.jsx)(la,{spec:s,uri:e.uri,name:t,handleRename:r}),(0,w.jsx)(Qi,{uri:e.uri,divider:"after",onDeleteCallback:a}),(n!==T.oT.NO||l)&&(0,w.jsx)($i.k,{uri:e.uri,canPin:n,isPinned:l,type:ni.c.FOLDER,spec:s}),(0,w.jsx)(R,{position:{after:e},onCreateCallback:i,spec:s}),(0,w.jsx)(m.j,{position:{after:e},onCreateCallback:i,spec:s}),(0,w.jsx)(oa.y,{uriToBeAdded:e.uri,isInLibrary:!0,spec:s}),c&&(0,w.jsx)(ia,{uri:e.uri,spec:s})]})})}));function da(e,t){const{createPlaylistFromAlbum:r,createPlaylistFromTracks:a}=(0,S.A)(),n=(0,C.s)(),l=(0,qr.g)(),o=Qr(),s=(0,i.useCallback)((r=>{if(!t)return;const{[j.fl.PLAYLISTS_V2]:i=[],[j.fl.FOLDERS]:a=[]}=r,s={after:{uri:t}};i.length&&(o(i,s),n.logInteraction(e.dragSort())),a.length&&(l.moveFolder({uri:a[0]},s),n.logInteraction(e.dragSort()))}),[o,n,l,e,t]),{unpinConfirmationDialog:c,applyDropWithUnpinConfirmation:d}=Zr({onApplyDrop:s});return{unpinConfirmationDialog:c,handleDropOnFolder:(0,i.useCallback)((async i=>{if(!t)return;const{[j.fl.TRACKS]:l=[],[j.fl.LOCAL_TRACKS]:o=[],[j.fl.ALBUMS]:s=[],[j.fl.EPISODES]:c=[],[j.fl.PLAYLISTS_V2]:u=[],[j.fl.FOLDERS]:p=[]}=i,g={after:{uri:t}};u.length||p.length?d(i,D.Nz.ON):s.length?(r(s[0],g),n.logInteraction(e.yourLibraryItemFactory().dragCreatePlaylist())):(l.length||o.length||c.length)&&(a([...l,...o,...c],g),n.logInteraction(e.yourLibraryItemFactory().dragCreatePlaylist()))}),[t,d,r,n,e,a])}}var ua=r(87128),pa=r(25558),ga=r(88602),ya=r(14964),ma=r(32660),xa=r(52509),ba=r(40814);const ha=({uri:e})=>{const[t,r]=(0,i.useState)(!1),a=(0,ua.x)(),n=(0,i.useCallback)((()=>{r(!0),setTimeout((()=>{r(!1)}),500)}),[]);return(0,ga.l)(pa.UV.OPERATION_COMPLETE,(t=>{"add"===t.data.operation&&e===a.getDefaultCurationContextUri(t.data.uris[0])&&n()})),(0,ma.e)(ya.Lj.OPERATION_COMPLETE,(t=>{"add"===t.data.operation&&e===t.data.uri&&n()})),(0,xa.b)(ba.tD.OPERATION_COMPLETE,(t=>{"remove"!==t.data.operation&&"end"!==t.data.position?.after&&t.data.position.after?.uri===e&&(0,xr.fp)(e)&&n()})),{animateState:t,animateClassName:Ir.A.pulse}};var fa=r(42947),Sa=r(7353);function va(e,t){const{uri:r,name:a,numberOfFolders:n,numberOfPlaylists:l,pinned:s}=e,{isPlaying:c,isActive:d}=(0,kr.l_)(r),{pushFolder:u}=(0,i.useContext)(lr),p=(0,o.wA)(),{togglePlay:g}=(0,Bi.P)({uri:r},{featureIdentifier:"folder",referrerIdentifier:"your_library"}),y=(0,o.d4)((e=>e.platform.isDesktop)),{handleDropOnFolder:m,unpinConfirmationDialog:x}=da(t,r),{renameFolder:h}=(0,fa.Z)(),f=m,S=[l>0||!n?b.Ru.get("web-player.your-library-x.rows.folder.number-of-playlists",l):null,n>0?b.Ru.get("web-player.your-library-x.rows.folder.number-of-folders",n):null].filter(Sa.P).join(b.Ru.getSeparator()),v=(0,i.useCallback)(((t="")=>{h(e,t)}),[e,h]),C=(0,i.useCallback)((()=>{u(e.uri)}),[e.uri,u]);return{openDeleteDialog:(0,i.useCallback)((()=>{p((0,dr.OB)(r))}),[p,r]),togglePlay:y?g:void 0,menu:(0,w.jsx)(ca,{reference:{uri:r},name:a,canPin:e.canPin,isPinned:s,onRename:v,isPlayable:!e.isEmpty}),subtitleText:S,onDropTargetDropOn:f,handleNavigate:C,dropOnFolderUnpinConfirmationDialog:x,isPlaying:c,isActive:d}}const Ca=({libraryItem:e,RowVariantComponent:t,spec:r,nrValidItems:a,index:l})=>{const{uri:o,folderDepth:s,name:c,type:d,isFlattened:u,pinned:p,canReorder:g}=e,{openDeleteDialog:y,togglePlay:m,menu:x,subtitleText:h,onDropTargetDropOn:f,handleNavigate:S,dropOnFolderUnpinConfirmationDialog:v,isPlaying:P,isActive:R}=va(e,r),[T,I]=function(e){const{getIsFolderExpanded:t,setIsFolderExpanded:r}=(0,i.useContext)(gt);return[(0,i.useMemo)((()=>t(e)),[t,e]),(0,i.useCallback)((t=>{r(e,t)}),[r,e])]}(o),A=(0,C.s)(),j=(0,i.useCallback)((()=>{I(!0),A.logInteraction(r.yourLibraryItemFactory().dragUiReveal())}),[A,I,r]),D=(0,i.useCallback)((e=>{e.stopPropagation()}),[]),L=(0,i.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),I(!T),T?A.logInteraction(r.yourLibraryItemFactory().toggleFolderButtonFactory().hitUiHide()):A.logInteraction(r.yourLibraryItemFactory().toggleFolderButtonFactory().hitUiReveal())}),[I,T,A,r]),E=(0,i.useCallback)((e=>{"ArrowLeft"===e.key?I(!1):"ArrowRight"===e.key&&I(!0)}),[I]),O=!u&&(0,w.jsx)(ke.H,{"data-skip-in-keyboard-nav":!0,"aria-label":T?b.Ru.get("web-player.your-library-x.collapse-folder"):b.Ru.get("web-player.your-library-x.expand-folder"),iconOnly:Zi.y,size:"small",condensedAll:!0,onClick:L,onDoubleClick:D,tabIndex:-1,className:n()(ft,St,{[Lt]:!T})}),{animateState:k,animateClassName:N}=ha({uri:o}),F=(0,w.jsx)(ji,{title:c,type:d,animateState:k,animateClassName:N});return(0,w.jsxs)(w.Fragment,{children:[v,(0,w.jsx)(ki,{onKeyDown:E,RowVariantComponent:t,uri:o,to:`/folder/${(0,xr.o_)(o)?.id??""}`,handleNavigate:S,folderDepth:s,cover:F,name:c,subtitle:h,alt:c,dragLabel:c,menu:x,canReorder:g,allowedDropTargetDropOnMimeTypes:$t,onDropTargetDropOn:f,onLongDragOver:j,togglePlay:m,openDeleteDialog:y,addedAt:e.addedAt,lastPlayedAt:e.lastPlayedAt,isPinned:p,shouldShowType:!1,type:d,isPlaying:P,isActive:R,expandFolderButton:O,spec:r,nrValidItems:a,index:l})]})},wa=({libraryItem:e,spec:t,index:r})=>{const{uri:i,name:a,type:n,pinned:l,canReorder:o}=e,{togglePlay:s,menu:c,subtitleText:d,onDropTargetDropOn:u,handleNavigate:p,openDeleteDialog:g,isPlaying:y,isActive:m}=va(e,t),{animateState:x,animateClassName:b}=ha({uri:i}),h=(0,w.jsx)(Di,{title:a,type:n,uri:i,togglePlay:s,spec:t,isActive:m,isPlaying:y});return(0,w.jsx)(Si,{uri:i,to:`/folder/${(0,xr.o_)(i)?.id??""}`,handleNavigate:p,cover:h,name:a,subtitle:d,menu:c,dragLabel:a,canReorder:o,allowedDropTargetDropOnMimeTypes:$t,onLongDragOver:p,onDropTargetDropOn:u,togglePlay:s,isPinned:l,shouldShowType:!1,type:n,openDeleteDialog:g,isPlaying:y,isActive:m,spec:t,index:r,animateState:x,animateClassName:b})};var Pa=r(23038);const Ra=i.memo((function({uri:e,canPin:t,isPinned:r,downloadUri:i}){const{spec:a}=(0,I.o)(e);return(0,w.jsx)(v.pZ,{value:"generic",children:(0,w.jsxs)(y.W,{children:[i?(0,w.jsx)(Pa.d,{spec:a,uri:i}):null,t!==T.oT.NO&&(0,w.jsx)($i.k,{uri:e,canPin:t,isPinned:r,type:ni.c.PLAYLIST,spec:a})]})})}));var Ta=r(7939);const Ia=[j.fl.TRACKS,j.fl.LOCAL_TRACKS];function Aa(e){const{numberOfSongs:t}=e,r="spotify:collection:tracks",{user:a}=(0,o.d4)(Ta.Ht),n=(0,xr.fH)(a?.id).toURI(),l=n,s=n,{togglePlay:c}=(0,Bi.P)({uri:l},{featureIdentifier:"your_library",referrerIdentifier:"your_library"}),d=(0,Vt.f)(),{isPlaying:u,isActive:p}=(0,kr.l_)(l),g=(0,i.useCallback)((e=>{const{[j.fl.TRACKS]:t=[],[j.fl.LOCAL_TRACKS]:r=[]}=e,i=[...t,...r];i?.length&&d?.add({uris:i})}),[d]);return{isPlaying:u,isActive:p,togglePlay:c,menu:(0,w.jsx)(Ra,{uri:r,canPin:e.canPin,isPinned:e.pinned,downloadUri:s}),downloadButton:(0,w.jsx)(pr.M,{uri:s,size:"xsmall",className:Ir.A.icon,as:"span"}),subtitleText:(0,w.jsx)(w.Fragment,{children:b.Ru.get("web-player.your-library-x.rows.liked-songs.subtitle",t)}),onDropTargetDropOn:g,playbackUri:l,uri:r,...ha({uri:r})}}const ja=({libraryItem:e,shouldShowType:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{images:l,name:o,type:s,pinned:c,addedAt:d,lastPlayedAt:u,color:p}=e,{isPlaying:g,isActive:y,togglePlay:m,menu:x,subtitleText:b,onDropTargetDropOn:h,playbackUri:f,uri:S,downloadButton:v,animateState:C,animateClassName:P}=Aa(e),R=(0,w.jsx)(ji,{title:o,type:s,images:l,color:p,animateState:C,animateClassName:P});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:S,cover:R,name:o,subtitle:b,alt:o,dragLabel:o,menu:x,allowedDropTargetDropOnMimeTypes:Ia,onDropTargetDropOn:h,togglePlay:m,addedAt:d,lastPlayedAt:u,isPlaying:g,isActive:y,isPinned:c,shouldShowType:t,type:s,playbackUri:f,downloadButton:v,spec:i,nrValidItems:a,index:n})},Da=({libraryItem:e,shouldShowType:t,spec:r,index:i})=>{const{images:a,name:n,type:l,pinned:o,color:s}=e,{togglePlay:c,menu:d,subtitleText:u,onDropTargetDropOn:p,playbackUri:g,uri:y,downloadButton:m,isPlaying:x,isActive:b,animateState:h,animateClassName:f}=Aa(e),S=(0,w.jsx)(Di,{title:n,type:l,images:a,uri:g,togglePlay:c,color:s,spec:r,isActive:b,isPlaying:x});return(0,w.jsx)(Si,{uri:y,name:n,subtitle:u,menu:d,dragLabel:n,allowedDropTargetDropOnMimeTypes:Ia,onDropTargetDropOn:p,cover:S,togglePlay:c,isPinned:o,shouldShowType:t,type:l,playbackUri:g,downloadButton:m,isPlaying:x,isActive:b,spec:r,index:i,animateState:h,animateClassName:f})};var La=r(21383),Ea=r(38608),Oa=r(12811),ka=r(48168);function Na(e){const{numberOfFiles:t}=e,r=ka.bV,i=(0,Oa.Iu)().uri,{isPlaying:a,isActive:n}=(0,kr.l_)(r);return{playbackUri:r,uri:i,isPlaying:a,isActive:n,menu:(0,w.jsx)(Ra,{uri:i,canPin:e.canPin,isPinned:e.pinned}),downloadButton:(0,w.jsx)(La.F,{size:"xsmall",className:Ir.A.icon,semanticColor:"textBrightAccent"}),subtitleText:b.Ru.get("web-player.your-library-x.rows.local-files.subtitle",t)}}const Fa=({libraryItem:e,shouldShowType:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{name:l,addedAt:o,lastPlayedAt:s,type:c,pinned:d}=e,{playbackUri:u,uri:p,isPlaying:g,menu:y,subtitleText:m,downloadButton:x,isActive:b}=Na(e),h=(0,w.jsx)("div",{className:vt,children:(0,w.jsx)(Ea.e,{iconSize:24,title:l})});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:p,name:l,subtitle:m,alt:l,dragLabel:l,menu:y,addedAt:o,lastPlayedAt:s,isPinned:d,isPlaying:g,isActive:b,shouldShowType:t,playbackUri:u,downloadButton:x,cover:h,type:c,spec:i,nrValidItems:a,index:n})},Ba=({libraryItem:e,shouldShowType:t,spec:r,index:i})=>{const{name:a,images:n,type:l,pinned:o}=e,{playbackUri:s,uri:c,menu:u,downloadButton:p,subtitleText:g,isPlaying:y,isActive:m}=Na(e),x=(0,d.NC)(Cr.AE),b=(0,w.jsx)("div",{className:xi,children:(0,w.jsx)(vi.M,{images:n,FallbackComponent:e=>(0,w.jsx)(Ea.e,{size:"xxlarge",className:x?mi:"",...e})})});return(0,w.jsx)(Si,{uri:c,name:a,subtitle:g,menu:u,cover:b,type:l,playbackUri:s,downloadButton:p,isPinned:o,shouldShowType:t,isPlaying:y,isActive:m,spec:r,index:i})};var Ma=r(67707);const Ua=({index:e,type:t})=>{const r=(0,d.NC)(Cr.AE),i=pi();return(0,w.jsx)(Ma.T,{columnIndex:0,children:(0,w.jsx)(yr.Z,{className:n()(gi,{[yi]:i}),media:(0,w.jsx)(vi.M,{images:[],FallbackComponent:()=>(0,w.jsx)(Ti.s,{type:t,size:"xxlarge",className:r?mi:"",semanticColor:"textSubdued"}),isCircular:t===ni.c.ARTIST}),variant:"naked",id:e,title:"",padding:i?mr.vw:mr.CJ})})};var Va=r(35293),_a=r(9987),Ha=r(30038),Wa=r(65183),Xa=r(71955),za=r(31055),Ya=r(91619),Ka=r(91795),Ga=r(82751),Za=r(23561),Ja=r(3711),qa=r(463),Qa=r(49813),$a=r(5861),en=r(96264),tn=r(80561),rn=r(42299),an=r(49993);const nn=i.memo((function({reference:e,isPublished:t,canPin:r=T.oT.NO,isPinned:i=!1,useDialogForUnfollow:a=!1,isInLibrary:n}){const{uri:l}=e,o=(0,rn.J)(l),s=!!o?.permissions?.isPrivate,c=(0,an.v)(l)??o?.isPublished??t,{spec:d}=(0,I.o)(l),u=o?.hasSpotifyAudiobooks;return o&&(0,w.jsx)(v.pZ,{value:"playlist",children:(0,w.jsxs)(y.W,{children:[!u&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Ha.K,{spec:d,uris:[l]}),(0,w.jsx)(tn._,{uri:l,spec:d})]}),!s&&(0,w.jsx)(qa._,{spec:d,divider:o.isOwnedBySelf?"after":"both",uri:l,isPublished:c}),o.isOwnedBySelf&&(0,w.jsx)(za.T,{spec:d,uri:l,name:o.name,description:o.description,image:o.images[0]}),!o.isOwnedBySelf&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Qa.P,{spec:d,uri:l}),(0,w.jsx)(_a.ET,{uri:l,useDialog:a,initialState:n})]}),o.isOwnedBySelf&&(0,w.jsx)(Xa.u,{spec:d,uri:l}),!u&&(0,w.jsx)(Pa.d,{spec:d,uri:l}),(0,w.jsx)(R,{position:{after:e},divider:"before",spec:d}),(0,w.jsx)(m.j,{position:{after:e},spec:d}),o.permissions?.canAdministratePermissions&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Ja.U,{spec:d,divider:"before",uri:l,isPrivate:s}),!u&&(0,w.jsx)(Ka.n,{uri:l,spec:d})]}),o.permissions?.canCancelMembership&&(0,w.jsx)(Ga._,{spec:d,divider:"before",uri:l}),(0,w.jsx)(Ya.w,{spec:d,uri:l}),(0,w.jsx)(oa.y,{uriToBeAdded:l,isInLibrary:!0,spec:d}),!u&&(0,w.jsx)($a.o,{spec:d,uris:[l],isPlaylist:!0}),(r!==T.oT.NO||i)&&(0,w.jsx)($i.k,{uri:l,canPin:r,isPinned:i,type:ni.c.PLAYLIST,spec:d}),(o.isOwnedBySelf||!s)&&(0,w.jsxs)(en.h,{divider:"before",children:[(0,w.jsx)(Wa.m,{spec:d,uri:l,displayText:b.Ru.get("contextmenu.share.copy-playlist-link"),isPrivatePlaylist:s}),(0,w.jsx)(Za.x,{spec:d,uri:l,type:ni.c.PLAYLIST})]})]})})})),ln=i.memo((function({reference:e,canPin:t=T.oT.NO,isPinned:r=!1}){const{uri:i}=e,{spec:a}=(0,I.o)(i);return(0,w.jsx)(v.pZ,{value:"playlist",children:(0,w.jsxs)(y.W,{children:[(0,w.jsx)(R,{position:{after:e},divider:"before",spec:a}),(0,w.jsx)(m.j,{position:{after:e},spec:a}),t!==T.oT.NO&&(0,w.jsx)($i.k,{uri:i,canPin:t,isPinned:r,type:ni.c.PLAYLIST,spec:a})]})})}));var on=r(48604);const sn=()=>(0,on.m)().getCapabilities();function cn(e,t){const{uri:r,isLoading:a,owner:n,pinned:l}=e,s=(0,on.m)(),{filter:c}=(0,i.useContext)(Q.g),{canAddAudiobooks:d}=sn(),u=[j.fl.TRACKS,j.fl.LOCAL_TRACKS,j.fl.ALBUMS,j.fl.EPISODES],p=d?[j.fl.AUDIOBOOKS]:[];(0,i.useEffect)((()=>{a&&s.resync(r)}),[s,r,a]);const{togglePlay:g}=(0,Bi.P)({uri:r},{featureIdentifier:"playlist",referrerIdentifier:"your_library"}),{isPlaying:m,isActive:x}=(0,kr.l_)(r),h=(0,o.wA)(),f=(0,C.s)();let S,v=[];const P=(0,i.useCallback)((async e=>{const{[j.fl.TRACKS]:i=[],[j.fl.LOCAL_TRACKS]:a=[],[j.fl.ALBUMS]:n=[],[j.fl.EPISODES]:l=[],[j.fl.AUDIOBOOKS]:o=[]}=e,s=[...i,...a,...n,...l,...o];h((0,Va.io)(r,s)),f.logInteraction(t.yourLibraryItemFactory().dragAddToPlaylist({itemToBeAdded:s.at(0)??"",playlist:r}))}),[h,f,t,r]);e.canAddTo&&(v=e.isEmpty?[...p,...u]:e.isBooklist?p:u,S=P);const R=(0,i.useCallback)((()=>{h((0,dr.O)(r))}),[h,r]),T=(0,cr.c0)(r),I=a&&!e.name;let A;A=T?(0,w.jsx)(ln,{reference:e,canPin:e.canPin,isPinned:l}):I?(0,w.jsx)(y.W,{children:(0,w.jsx)(_a.ET,{uri:r,initialState:!0})}):(0,w.jsx)(nn,{reference:e,canPin:e.canPin,isPinned:l,useDialogForUnfollow:!0,isInLibrary:!0});const D=(0,w.jsx)(pr.M,{uri:r,size:"xsmall",className:Ir.A.icon,as:"span"}),L=(0,cr.c0)(r)?(0,w.jsx)(w.Fragment,{children:b.Ru.get("ylx.clicktoplay")}):(n.uri,(0,w.jsx)(gr.M,{searchWords:[c.trim()],textToHighlight:n.name}));return{openDeleteDialog:R,togglePlay:!!(0,cr.c0)(r)||!e.isBooklist&&!e.isEmpty?g:void 0,isPlaying:m,isActive:x,menu:A,downloadButton:D,subtitleText:L,allowedDropTargetDropOnMimeTypes:v,onDropTargetDropOn:S,...ha({uri:r})}}const dn=({libraryItem:e,shouldShowType:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{uri:l,images:o,folderDepth:s,name:c,type:d,pinned:u,addedAt:p,lastPlayedAt:g,color:y,canReorder:m}=e,{openDeleteDialog:x,togglePlay:b,isPlaying:h,isActive:f,menu:S,downloadButton:v,subtitleText:C,allowedDropTargetDropOnMimeTypes:P,onDropTargetDropOn:R,animateState:T,animateClassName:I}=cn(e,i),A=(0,w.jsx)(ji,{title:c,type:d,images:o,color:y,animateState:T,animateClassName:I});return(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(ki,{RowVariantComponent:r,uri:l,folderDepth:s,cover:A,name:c,subtitle:C,alt:c,dragLabel:c,menu:S,canReorder:m,allowedDropTargetDropOnMimeTypes:P,onDropTargetDropOn:R,togglePlay:b,openDeleteDialog:x,addedAt:p,lastPlayedAt:g,isPlaying:h,isActive:f,isPinned:u,shouldShowType:t,type:d,downloadButton:v,spec:i,playInsteadOfNavigating:(0,cr.c0)(l),nrValidItems:a,index:n})})},un=({libraryItem:e,shouldShowType:t,spec:r,index:i})=>{const{uri:a,images:n,name:l,type:o,pinned:s,color:c,canReorder:d}=e,{togglePlay:u,menu:p,downloadButton:g,subtitleText:y,onDropTargetDropOn:m,allowedDropTargetDropOnMimeTypes:x,openDeleteDialog:b,isPlaying:h,isActive:f,animateState:S,animateClassName:v}=cn(e,r),C=(0,w.jsx)(Di,{title:l,type:o,images:n,uri:a,togglePlay:u,color:c,spec:r,isActive:f,isPlaying:h});return(0,w.jsx)(Si,{uri:a,name:l,subtitle:y,menu:p,dragLabel:l,canReorder:d,allowedDropTargetDropOnMimeTypes:x,onDropTargetDropOn:m,cover:C,togglePlay:u,isPinned:s,shouldShowType:t,type:o,downloadButton:g,openDeleteDialog:b,isPlaying:h,isActive:f,spec:r,playInsteadOfNavigating:(0,cr.c0)(a),index:i,animateState:S,animateClassName:v})};var pn=r(67859),gn=r(40938),yn=r(91039),mn=r(2629);const xn=i.memo((function({uri:e,canPin:t=T.oT.NO,isPinned:r=!1,canRemove:i=!1}){const{spec:a}=(0,I.o)(e);return(0,w.jsx)(v.pZ,{value:"audiobook",children:(0,w.jsxs)(y.W,{children:[i&&(0,w.jsx)(mn.p,{uri:e,removeLabel:b.Ru.get("contextmenu.remove-from-library")}),t!==T.oT.NO&&(0,w.jsx)($i.k,{uri:e,canPin:t,isPinned:r,type:ni.c.PRE_RELEASE_BOOK,spec:a}),(0,w.jsx)(Wa.m,{uri:e,spec:a,displayText:b.Ru.get("context-menu.copy-book-link")}),(0,w.jsx)(yn.q,{spec:a,divider:"before",uri:e})]})})}));function bn(e){const{uri:t,canPin:r,pinned:a,type:n}=e,{filter:l}=(0,i.useContext)(Q.g),s=(0,o.wA)(),c=(0,i.useCallback)((()=>{s((0,dr.aw)(t,!0))}),[s,t]);let d,u="";if(n===ni.c.PRE_RELEASE_ALBUM){const i=e.artists?.at(0);u=i?.name??"",d=(0,w.jsx)(gn.P,{uri:t,artistUri:i?.uri,canPin:r,isPinned:a,canRemove:!0})}else u=e.authorName,d=(0,w.jsx)(xn,{uri:t,canPin:r,isPinned:a,canRemove:!0});return{openDeleteDialog:c,menu:d,subtitleText:(0,w.jsx)(gr.M,{searchWords:[l.trim()],textToHighlight:u})}}const hn=({libraryItem:e,shouldShowType:t=!1,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{uri:l,images:o,name:s,pinned:c,type:d,addedAt:u,lastPlayedAt:p,color:g}=e,{openDeleteDialog:y,menu:m,subtitleText:x}=bn(e),b=(0,w.jsx)(ji,{title:s,type:d,images:o,color:g});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:l,cover:b,name:s,subtitle:x,alt:s,type:d,dragLabel:s,menu:m,openDeleteDialog:y,addedAt:u,lastPlayedAt:p,isPinned:c,isPlaying:!1,isActive:!1,shouldShowType:t,spec:i,nrValidItems:a,index:n,preReleaseIcon:(0,w.jsx)(pn.t,{size:"xsmall",className:Ir.A.icon})})},fn=({libraryItem:e,shouldShowType:t=!1,spec:r,index:i})=>{const{uri:a,images:n,name:l,pinned:o,type:s,color:c}=e,{menu:d,subtitleText:u,openDeleteDialog:p}=bn(e),g=(0,w.jsx)(Di,{title:l,type:s,images:n,uri:a,color:c,spec:r,isActive:!1,isPlaying:!1});return(0,w.jsx)(Si,{uri:a,name:l,subtitle:u,menu:d,dragLabel:l,cover:g,type:s,isPinned:o,shouldShowType:t,openDeleteDialog:p,isPlaying:!1,isActive:!1,spec:r,index:i,preReleaseIcon:(0,w.jsx)(pn.t,{size:"xsmall",className:Ir.A.icon})})};var Sn=r(38916);function vn(e){const{uri:t,publisher:r}=e,{filter:a}=(0,i.useContext)(Q.g),n=(0,o.wA)(),{togglePlay:l}=(0,Bi.P)({uri:t},{featureIdentifier:"show",referrerIdentifier:"your_library"}),{isPlaying:s,isActive:c}=(0,kr.l_)(t);return{isPlaying:s,isActive:c,openDeleteDialog:(0,i.useCallback)((()=>{n((0,dr.aw)(t))}),[n,t]),togglePlay:l,menu:(0,w.jsx)(Sn.H,{uri:t,canPin:e.canPin,isPinned:e.pinned,useDialogForUnfollow:!0,isInLibrary:!0}),downloadButton:(0,w.jsx)(pr.M,{uri:t,size:"xsmall",className:Ir.A.icon,as:"span"}),subtitleText:(0,w.jsx)(gr.M,{autoEscape:!0,searchWords:[a.trim()],textToHighlight:r})}}const Cn=({libraryItem:e,shouldShowType:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n})=>{const{uri:l,images:o,name:s,type:c,addedAt:d,lastPlayedAt:u,pinned:p,color:g}=e,{isPlaying:y,isActive:m,openDeleteDialog:x,togglePlay:b,menu:h,downloadButton:f,subtitleText:S}=vn(e),v=(0,w.jsx)(ji,{title:s,type:c,images:o,color:g});return(0,w.jsx)(ki,{RowVariantComponent:r,uri:l,cover:v,name:s,subtitle:S,alt:s,dragLabel:s,menu:h,togglePlay:b,openDeleteDialog:x,addedAt:d,lastPlayedAt:u,isPlaying:y,isActive:m,isPinned:p,shouldShowType:t,type:c,downloadButton:f,spec:i,nrValidItems:a,index:n})},wn=({libraryItem:e,shouldShowType:t,spec:r,index:i})=>{const{uri:a,images:n,name:l,type:o,pinned:s,color:c}=e,{togglePlay:d,menu:u,downloadButton:p,subtitleText:g,openDeleteDialog:y,isPlaying:m,isActive:x}=vn(e),b=(0,w.jsx)(Di,{title:l,type:o,images:n,uri:a,togglePlay:d,color:c,spec:r,isActive:x,isPlaying:m});return(0,w.jsx)(Si,{uri:a,name:l,subtitle:g,menu:u,dragLabel:l,cover:b,togglePlay:d,isPinned:s,shouldShowType:t,type:o,downloadButton:p,openDeleteDialog:y,isPlaying:m,isActive:x,spec:r,index:i})},Pn=[j.fl.EPISODES];function Rn(e){const{numberOfDownloadedEpisodes:t,uri:r}=e,a=(0,d.NC)(X.ucV,{loadingValue:!1}),{user:n}=(0,o.d4)(Ta.Ht),l=(0,xr.fH)(n?.id,"your-episodes").toURI(),s=a?r:l,c=T.Xn,{togglePlay:u}=(0,Bi.P)({uri:s},{featureIdentifier:"episode",referrerIdentifier:"your_library"}),{isPlaying:p,isActive:g}=(0,kr.l_)(s),y=(0,Vt.f)(),m=(0,i.useCallback)((e=>{const{[j.fl.EPISODES]:t=[]}=e;t?.length&&y?.add({uris:t})}),[y]);return{isPlaying:p,isActive:g,togglePlay:u,menu:(0,w.jsx)(Ra,{uri:c,canPin:e.canPin,isPinned:e.pinned}),downloadButton:t?(0,w.jsx)(La.F,{size:"xsmall",className:Ir.A.icon,semanticColor:"textBrightAccent"}):null,subtitleText:b.Ru.get("web-player.your-library-x.subtitle-your-episodes"),onDropTargetDropOn:m,playbackUri:s,uri:c,...ha({uri:c})}}const Tn=({libraryItem:e,RowVariantComponent:t,spec:r,nrValidItems:i,index:a})=>{const{images:n,name:l,type:o,pinned:s,lastPlayedAt:c,addedAt:d,color:u}=e,{isPlaying:p,isActive:g,togglePlay:y,menu:m,downloadButton:x,subtitleText:b,onDropTargetDropOn:h,playbackUri:f,uri:S,animateState:v,animateClassName:C}=Rn(e),P=(0,w.jsx)(ji,{title:l,type:o,images:n,color:u,animateState:v,animateClassName:C});return(0,w.jsx)(ki,{RowVariantComponent:t,uri:S,cover:P,name:l,subtitle:b,alt:l,dragLabel:l,menu:m,allowedDropTargetDropOnMimeTypes:Pn,onDropTargetDropOn:h,togglePlay:y,addedAt:d,lastPlayedAt:c,isPlaying:p,isActive:g,isPinned:s,shouldShowType:!1,type:o,downloadButton:x,playbackUri:f,spec:r,nrValidItems:i,index:a})},In=({libraryItem:e,spec:t,index:r})=>{const{images:i,name:a,type:n,pinned:l,color:o}=e,{togglePlay:s,menu:c,downloadButton:d,subtitleText:u,onDropTargetDropOn:p,playbackUri:g,uri:y,isPlaying:m,isActive:x,animateState:b,animateClassName:h}=Rn(e),f=(0,w.jsx)(Di,{title:a,type:n,images:i,uri:y,togglePlay:s,color:o,spec:t,isActive:x,isPlaying:m});return(0,w.jsx)(Si,{uri:y,name:a,subtitle:u,menu:c,dragLabel:a,allowedDropTargetDropOnMimeTypes:Pn,onDropTargetDropOn:p,cover:f,togglePlay:s,playbackUri:g,downloadButton:d,isPinned:l,shouldShowType:!1,type:n,isPlaying:m,isActive:x,spec:t,index:r,animateState:b,animateClassName:h})};function An(){const e=(0,d.NC)(X.AEN),[t,r]=(0,fe.x)("ylx-grid-scale",1);return{gridScale:e?t:1,setGridScale:r}}var jn=r(42331),Dn=r(94921),Ln=r(16436);const En=({span:e,onInView:t,marginBottom:r,marginTop:a})=>{const n=(0,i.useRef)(null);return(0,i.useEffect)((()=>{if(!window.IntersectionObserver)return()=>{};const e=new window.IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&t()}))}));return n.current&&e.observe(n.current),()=>{e.disconnect()}}),[t]),e<=0?null:(0,w.jsx)("div",{style:{gridColumn:"1/-1",gridRow:`span ${e}`,marginBottom:r,marginTop:a},ref:n,"data-type":"sentinel"},"topSentinel")},On=({renderItems:e,nrItems:t,estimatedItemMaxHeight:r,scrollNodeRef:a,nrRowsOverscan:n=5,initalNrRows:l=5,onGridResize:o})=>{const[s,c]=(0,i.useState)({firstRowToRender:0,nrRows:l+n}),d=(0,i.useRef)(0),u=(0,i.useRef)(null),p=(0,i.useRef)(r),g=(0,i.useCallback)((()=>{const e=u.current?.querySelector(':scope > *:not([data-type="sentinel"])');p.current=e?e.getBoundingClientRect().height:p.current}),[]),y=(0,i.useCallback)((()=>{const e=a.current;if(!e)return;g();const t=Math.floor((e.scrollTop-d.current)/p.current),r=Math.max(t-n,0),i=Math.ceil(e.offsetHeight/p.current)+2*n;r===s.firstRowToRender&&i===s.nrRows||c({firstRowToRender:r,nrRows:i})}),[n,s,a,g]),m=(0,i.useCallback)((({columnCount:r})=>{if(r<=0)return[null];o&&o(r,p.current);const i=Math.ceil(t/r),a=s.firstRowToRender*r,l=s.firstRowToRender+s.nrRows-1,c=Math.min(t-1,(l+1)*r-1),d=p.current*(n-2);return[(0,w.jsx)(En,{span:s.firstRowToRender,onInView:y,marginBottom:`-${d}px`},`topSentinel-${s.firstRowToRender}`),e(a,c,r),(0,w.jsx)(En,{span:i-l,onInView:y,marginTop:`-${d}px`},"bottomSentinel-"+(i-l))]}),[t,n,o,y,e,s]);return(0,i.useEffect)((()=>{const e=u.current,t=a.current;e&&t&&(d.current=e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)}),[a]),(0,w.jsx)(Ln.E,{useUniformRowHeight:!0,ref:u,render:m,onLayoutChange:g})},kn=(0,z.g)(ni.c),Nn=(0,i.memo)((function({item:e,primaryFilter:t,spec:r,index:i}){const a={shouldShowType:!(0,cr.c0)(e.uri)&&si(e.type)!==t,spec:r,index:i},n=(0,d.NC)(X.lDH),l=(0,d.NC)(X.H8e);switch(e.type){case ni.c.FOLDER:return(0,w.jsx)(wa,{libraryItem:e,...a});case ni.c.ALBUM:return(0,w.jsx)(Vi,{libraryItem:e,...a});case ni.c.ARTIST:return(0,w.jsx)(Xi,{libraryItem:e,...a});case ni.c.AUDIOBOOK:return(0,w.jsx)(Gi,{libraryItem:e,...a});case ni.c.SHOW:return(0,w.jsx)(wn,{libraryItem:e,...a});case ni.c.PLAYLIST:return(0,w.jsx)(un,{libraryItem:e,...a});case ni.c.LIKED_SONGS:return(0,w.jsx)(Da,{libraryItem:e,...a});case ni.c.YOUR_EPISODES:return(0,w.jsx)(In,{libraryItem:e,...a});case ni.c.LOCAL_FILES:return(0,w.jsx)(Ba,{libraryItem:e,...a});case ni.c.PRE_RELEASE_ALBUM:return n?(0,w.jsx)(fn,{libraryItem:e,...a}):null;case ni.c.PRE_RELEASE_BOOK:return l?(0,w.jsx)(fn,{libraryItem:e,...a}):null;default:(0,li.d)(e)}})),Fn=({getItems:e,scrollNodeRef:t,primaryFilter:r,nrValidItems:a,spec:n})=>{const{gridScale:l}=An(),o=(0,Dn.s1)(Dn.yV.YLX,l),s=(0,i.useRef)({}),c=function(){const{gridScale:e}=An();return!!(0,d.NC)(X.AEN)&&e<.8}(),u=(0,i.useCallback)((e=>(0,w.jsx)(Ua,{index:e,type:kn(r)?r:void 0},e)),[r]),p=(0,i.useCallback)(((t,i)=>e(t,i).map(((e,i)=>e?(0,w.jsx)(Nn,{item:e,spec:n,primaryFilter:r,index:t+i},e.uri):u(`${t+i}`)))),[e,r,u,n]),g=(0,i.useCallback)(((e,t)=>{s.current={numColumns:e,rowHeight:t}}),[]);return(0,w.jsx)(jn.x,{config:o,children:(0,w.jsx)(ui,{isCompact:c,children:(0,w.jsx)(sr.R,{firstInteractiveIsWrapper:!0,"aria-label":b.Ru.get("web-player.your-library-x.your-library"),"aria-rowcount":Math.round(a/(s.current.numColumns??1)),"aria-colcount":s.current.numColumns,children:(0,w.jsx)(On,{renderItems:p,nrItems:a,estimatedItemMaxHeight:250,scrollNodeRef:t,onGridResize:g})})})})};var Bn=r(62413),Mn=r(35764),Un=r(37022);const Vn="main-yourLibraryX-header",_n="ILEuCdEH9mglJaM4gKuf",Hn="main-yourLibraryX-collapseButtonWrapper",Wn="main-yourLibraryX-headerContent",Xn="iYP0xuQiJCgi7gx1jUPJ",zn="main-yourLibraryX-collapseButton",Yn="main-yourLibraryX-button",Kn="af749NDLYTDK_8LinKWD",Gn="nGWhztVvLY1BInXjcWYa",Zn="oZT8iKL42zhLAm_zE5F5",Jn="MdDY8fQ_j94mQZy7ZVXf",qn="uNReR011bI8ML42Pgveg",Qn=e=>{switch(e){case Be.fX.EXPANDED:return"expanded";case Be.fX.COLLAPSED:return"collapsed";case Be.fX.DEFAULT:return"default";default:throw(0,li.k)(e)}},$n=({folderUri:e,dropTargetClassName:t,spec:r})=>{const{isCollapsed:a,ylxSidebarState:l,setYlxSidebarState:o,lastUncollapsedYlxSidebarState:s}=(0,Be.$)(),c=(0,C.s)(),d=(0,i.useCallback)((()=>{const e=l===Be.fX.COLLAPSED?s:Be.fX.COLLAPSED;o(e),c.logInteraction(r.hitToggleState({stateBeforeToggle:Qn(l),stateAfterToggle:Qn(e)}))}),[l,s,o,c,r]),u=a?Mn.M:Un.A;return(0,w.jsx)(Fe.Zp,{label:a?b.Ru.get("web-player.your-library-x.expand-your-library"):b.Ru.get("web-player.your-library-x.collapse-your-library"),placement:a?"right":void 0,children:(0,w.jsx)(ke.H,{"aria-label":a?b.Ru.get("web-player.your-library-x.expand-your-library"):b.Ru.get("web-player.your-library-x.collapse-your-library"),onClick:d,className:n()(Hn,Yn,t),condensed:!0,iconLeading:e||a?void 0:u,iconOnly:e||a?u:void 0,children:!e&&!a&&b.Ru.get("web-player.your-library-x.your-library")})})};var el=r(6288),tl=r(64981),rl=r(78840);const il=function({folderUri:e,spec:t}){const{createPlaylist:r}=(0,S.A)(),{createFolder:i}=(0,fa.Z)(),a=(0,C.s)(),n=(0,Re.V)(),l=e?{after:{uri:e}}:{before:"start"};return(0,w.jsxs)(y.W,{children:[(0,w.jsx)(h.D,{onClick:()=>{r(void 0,l),a.logInteraction(t.createPlaylistOptionFactory().hitCreatePlaylist())},role:"menuitem",leadingIcon:(0,w.jsx)(x.u,{size:"small"}),children:b.Ru.get("web-player.your-library-x.create.create-a-new-playlist")}),!n&&(0,w.jsx)(h.D,{onClick:()=>{i(b.Ru.get("web-player.your-library-x.default_folder_name"),l),a.logInteraction(t.createFolderOptionFactory().hitCreateFolder())},role:"menuitem",leadingIcon:(0,w.jsx)(rl.h,{size:"small"}),children:b.Ru.get("web-player.your-library-x.create.create-a-playlist-folder")})]})},al=({className:e="",folderUri:t,tooltipPlacement:r,spec:a})=>{const l=b.Ru.get("web-player.your-library-x.create.button-label"),o=(0,C.s)(),{canAddAudiobooks:s}=sn(),{createPlaylistFromAlbum:c,createPlaylistFromTracks:d,createPlaylistFromPlaylist:u}=(0,S.A)(),{className:p,dropPosition:g,...y}=(0,L.A)({allowedMimeTypesByDropPosition:{[D.Nz.ON]:[j.fl.TRACKS,j.fl.EPISODES,j.fl.ALBUMS,j.fl.PLAYLISTS_V2,...s?[j.fl.AUDIOBOOKS]:[]]},onDrop:(0,i.useCallback)((e=>{const{[j.fl.TRACKS]:r=[],[j.fl.LOCAL_TRACKS]:i=[],[j.fl.EPISODES]:a=[],[j.fl.AUDIOBOOKS]:n=[],[j.fl.ALBUMS]:l=[],[j.fl.PLAYLISTS_V2]:o=[]}=e,s=t?{after:{uri:t}}:{before:"start"},p=[...r,...i,...a];n.length>0?d(n,s):p.length?d(p,s):l.length>0?c(l[0],s):o.length>0&&u(o[0],s)}),[c,u,d,t])});return(0,w.jsx)(tl.t,{renderInline:!0,menu:(0,w.jsx)(il,{folderUri:t,spec:a.createMenuFactory()}),preventScrollingWhileOpen:!1,children:(t,i,s)=>(0,w.jsx)(Fe.Zp,{label:l,placement:r,children:(0,w.jsx)(ke.H,{ref:s,iconOnly:el.u,className:n()(e,p,{[Ht]:g===D.Nz.ON}),"aria-label":l,onClick:e=>{i(e),o.logInteraction(a.hitUiReveal())},size:"small",...y})})})};var nl=r(64571),ll=r(98878);const ol=({dropTargetClassName:e,spec:t})=>{const{ylxSidebarState:r,setYlxSidebarState:i}=(0,Be.$)(),a=r===Be.fX.DEFAULT,l=(0,C.s)();return(0,w.jsx)(Fe.Zp,{label:a?b.Ru.get("web-player.your-library-x.show-more"):b.Ru.get("web-player.your-library-x.show-less"),children:(0,w.jsx)(ke.H,{className:n()(Yn,Gn,e),iconOnly:a?nl.h:ll.G,"aria-label":a?b.Ru.get("web-player.your-library-x.enlarge-your-library"):b.Ru.get("web-player.your-library-x.reduce-your-library"),onClick:()=>{i(a?Be.fX.EXPANDED:Be.fX.DEFAULT),l.logInteraction(t.hitToggleState({stateBeforeToggle:a?"default":"expanded",stateAfterToggle:a?"expanded":"default"}))},size:"small"})})};var sl=r(89732);const cl=({handleNavigateBack:e,parentFolderUri:t,spec:r})=>{const{handleDropBeforeOrAfterRootlistItem:i}=ei({dropTargetUri:t,spec:r}),{dropPosition:a,className:l,...o}=(0,L.A)({allowedMimeTypesByDropPosition:{[D.Nz.ON]:qt},onDrop:async e=>{i(e,D.Nz.BEFORE)},onLongDragOver:e});return(0,w.jsx)(Fe.Zp,{label:b.Ru.get("web-player.your-library-x.navigate-back-folder"),children:(0,w.jsx)(ke.H,{className:n()(Yn,Kn,l,{[Ht]:a===D.Nz.ON}),"aria-label":b.Ru.get("web-player.your-library-x.navigate-back-folder"),onClick:e,iconOnly:sl.g,size:"small",...o})})};var dl=r(76727),ul=r(39796);const pl=({folderMenu:e,folderName:t,dropTargetClassName:r})=>(0,w.jsx)(ul.b,{menu:e,children:(0,w.jsx)("span",{children:(0,w.jsx)(Fe.Zp,{label:b.Ru.get("more.label.context",t),children:(0,w.jsx)(ke.H,{className:n()(Yn,Gn,r),iconOnly:dl.x,"aria-haspopup":"menu","aria-label":b.Ru.get("more.label.context",t),size:"small"})})})});var gl=r(31307),yl=r(50363),ml=r(45597);const xl=({dropTargetClassName:e,spec:t})=>{const{isGridView:r,setItemsView:i}=(0,ml.t)(),a=(0,C.s)();return(0,w.jsx)(Fe.Zp,{label:r?b.Ru.get("web-player.your-library-x.list-view"):b.Ru.get("web-player.your-library-x.grid-view"),children:(0,w.jsx)(ke.H,{className:n()(Yn,e),iconOnly:r?gl.N:yl.D,"aria-label":r?b.Ru.get("web-player.your-library-x.list-view"):b.Ru.get("web-player.your-library-x.grid-view"),onClick:()=>{i(r?ml.X.LIST:ml.X.GRID),a.logInteraction(t.hitToggleState({stateBeforeToggle:r?"grid":"list",stateAfterToggle:r?"list":"grid"}))},size:"small"})})},bl=(0,i.forwardRef)((function({folderUri:e,folderName:t,folderMenu:r,onRename:a,spec:l,className:s},c){const{isActive:d}=(0,kr.l_)(e??"not-a-folder"),u=(0,o.wA)(),p=(0,C.s)(),y=(0,i.useCallback)((()=>{u((0,dr.O2)(t,a)),p.logInteraction(l.hitRenameFolder({uri:e}))}),[u,t,e,p,a,l]);return(0,w.jsx)(Fe.Zp,{label:t,showDelay:Fe.uF,children:(0,w.jsx)("div",{className:n()(Jn,s),children:(0,w.jsx)(g.h,{menu:r,children:(0,w.jsx)(ke.H,{"aria-label":t,onClick:y,size:"small",condensed:!0,className:n()(Yn),ref:c,children:(0,w.jsx)(we.E,{variant:"bodyMediumBold",semanticColor:d?"textBrightAccent":void 0,className:qn,children:t})})})})})}));var hl=r(75456),fl=r(49062),Sl=r(95742);const vl="fJrnaZd0QWm65978IgD2",Cl="yCpl0fAaEYj7E8F_Oabw",wl=()=>{const{syncing:e,percentage:t,currentItem:r,totalItems:a}=function(){const[e,t]=(0,i.useState)({syncing:!1,percentage:0,totalItems:0,currentItem:0}),r=fl.I.UPDATE_TOTAL_PROGRESS,a=(0,i.useCallback)((e=>t(e.data.progress)),[]);return(0,Sl.b)(r,a),e}();return e?(0,w.jsxs)("div",{className:vl,children:[(0,w.jsxs)("div",{className:Cl,children:[(0,w.jsx)(we.E,{variant:"bodySmallBold",semanticColor:"textBase",children:b.Ru.get("web-player.your-library-x.download-progress-title")}),(0,w.jsx)(we.E,{variant:"bodySmallBold",semanticColor:"textBase",children:b.Ru.get("web-player.your-library-x.download-progress-count-out-of-total",r,a)})]}),(0,w.jsx)(hl.z,{value:t})]}):null};const Pl=({parentDropTargetClassName:e,isLibraryCompletelyEmpty:t,folderUri:r,folderName:a,spec:l,openedFolderIsPlayable:o})=>{const{isCollapsed:s,ylxSidebarState:u,canExpand:p}=(0,Be.$)(),{renameFolder:g}=(0,fa.Z)(),{popFolder:y}=(0,i.useContext)(lr),m=(0,i.useCallback)(((e="")=>{r&&g({uri:r},e)}),[r,g]),x=(0,i.useCallback)((()=>{y()}),[y]),b=r?(0,w.jsx)(ca,{reference:{uri:r},name:a,onRename:m,onDeleteCallback:x,isPlayable:o}):null,{dropOriginIsYLX:h}=Jr(),f=!s&&r&&void 0!==a,S=(0,i.useRef)(null),v=(0,i.useRef)(null),C=(0,i.useRef)(null);!function(e,t,r,...a){const n=(0,c.U0)((()=>{if(e.current)if(t.current instanceof HTMLElement){e.current.style.display="block";const{scrollWidth:r,offsetWidth:i}=t.current,a=r>i;e.current.style.display=a?"none":"block"}else e.current.style.display="block"}),[a]);(0,i.useLayoutEffect)(n,[n]),(0,Ii.w)({refOrElement:r,observeOnly:"width",onResize:n})}(C,(0,i.useMemo)((()=>({get current(){return v.current?.firstElementChild instanceof HTMLElement?v.current?.firstElementChild:null}})),[]),S,a,f);const P=(0,d.NC)(X.AEN),R=(0,Bn.A)(),T=!s||t&&s;return(0,w.jsxs)("header",{className:n()(Vn,{[_n]:R,[Zn]:s}),ref:S,children:[!s&&(0,w.jsx)(wl,{}),(0,w.jsxs)("div",{className:n()(Wn,{[Xn]:s}),children:[(0,w.jsxs)("div",{className:n()(zn,{[Xn]:s}),children:[(0,w.jsx)($n,{folderUri:r,dropTargetClassName:e,spec:l.toggleCollapsedModeButtonFactory({identifier:""})}),r&&(0,w.jsx)(cl,{handleNavigateBack:x,parentFolderUri:r,spec:l.folderBackButtonFactory()}),f&&(0,w.jsx)(bl,{folderUri:r,folderName:a,folderMenu:b,onRename:m,spec:l.folderTitleFactory(),className:h?e:void 0,ref:v},r)]}),T&&(0,w.jsx)("span",{ref:C,children:(0,w.jsx)(al,{className:n()(Yn,Gn),folderUri:r,tooltipPlacement:s?"right":void 0,spec:l.createMenuButtonFactory()})}),r&&!s&&(0,w.jsx)(pl,{folderName:a,folderMenu:b,dropTargetClassName:e}),u===Be.fX.EXPANDED&&!P&&(0,w.jsx)(xl,{dropTargetClassName:e,spec:l.viewDensityToggleFactory({identifier:""})}),(u===Be.fX.DEFAULT&&p||u===Be.fX.EXPANDED)&&(0,w.jsx)(ol,{dropTargetClassName:e,spec:l.toggleExpandedModeButtonFactory({identifier:""})})]})]})};var Rl=r(96475),Tl=r(16047),Il=r(30400);const Al=({date:e})=>(0,w.jsx)(we.E,{variant:"bodySmall",semanticColor:"textSubdued",className:It,children:e&&b.Ru.formatRelativeDate(new Date(e),{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}),jl=e=>{const t=e.handleNavigate,r=(0,w.jsx)(Hr,{uri:e.uri,title:e.name,menu:e.menu,handleNavigate:t,playbackUri:e.playbackUri}),i=e.expandFolderButton??(e.isPlaying&&(0,w.jsx)(vr,{})),a=(0,w.jsx)(Ar,{leading:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ci.g,{pinned:e.isPinned}),e.preReleaseIcon,e.downloadButton,e.lockedIcon]}),subtitle:(0,w.jsxs)(w.Fragment,{children:[e.shouldShowType&&oi(e.type),!!e.subtitle&&e.shouldShowType&&" • ",e.subtitle]}),uri:e.uri}),n=e.logRightClick,l=(0,w.jsx)(g.h,{menu:e.menu,onShow:n,children:(0,w.jsx)(hr.E,{uri:e.uri,trigger:hr.l.OnMouseDown,children:(0,w.jsx)(Tl.v,{className:mt,media:e.cover,title:r,subtitle:a,trailing:i,id:e.uri,variant:e.isViewActive?"tinted":void 0,padding:mr.v4,onClick:e.onClick,hoverAnimationDuration:"0ms"})})});return(0,cr.c0)(e.uri)?(0,w.jsx)(fr.cW,{parentRef:e.parentRef,children:l}):l},Dl=e=>{const t=e.handleNavigate,r=(0,w.jsx)(Hr,{uri:e.uri,title:e.name,menu:e.menu,handleNavigate:t,playbackUri:e.playbackUri}),i=(0,w.jsx)(Ar,{leading:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ci.g,{pinned:e.isPinned}),e.preReleaseIcon,e.downloadButton,e.lockedIcon]}),subtitle:(0,w.jsxs)(w.Fragment,{children:[e.shouldShowType&&oi(e.type),!!e.subtitle&&e.shouldShowType&&" • ",e.subtitle]}),uri:e.uri}),a=e.logRightClick;return(0,w.jsx)(Pr,{...e,title:r,subtitleSlot:i,parentRef:e.parentRef,children:(0,w.jsxs)("div",{children:[(0,w.jsx)(g.h,{menu:e.menu,onShow:a,children:(0,w.jsx)(hr.E,{uri:e.uri,trigger:hr.l.OnMouseDown,children:(0,w.jsx)(Tl.v,{className:n()(mt,bt),media:e.cover,id:e.uri,padding:mr.v4,onClick:e.onClick,variant:void 0,title:void 0,hoverAnimationDuration:"0ms"})})}),(0,w.jsxs)("span",{className:Ot,children:[r," ",i]})]})})},Ll=e=>{const t=(0,i.useRef)(null),r=e.logRightClick;return(0,w.jsx)(g.h,{menu:e.menu,onShow:r,children:(0,w.jsxs)("div",{className:Tt,ref:t,children:[(0,w.jsx)(jl,{...e,parentRef:t}),(0,w.jsx)(Al,{date:e.addedAt}),(0,w.jsx)(Al,{date:e.lastPlayedAt})]})})},El=e=>{const t=e.handleNavigate,r=(0,w.jsxs)("div",{className:Dt,children:[(0,w.jsx)(Hr,{uri:e.uri,title:e.name,menu:e.menu,handleNavigate:t,playbackUri:e.playbackUri}),e.shouldShowType&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Il.v,{children:"•"}),(0,w.jsx)(Il.v,{lineClamp:1,children:oi(e.type)})]}),(!e.shouldShowType&&e.type===ni.c.ALBUM||(0,cr.c0)(e.uri))&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Il.v,{children:"•"}),(0,w.jsx)(Ar,{leading:null,uri:e.uri,subtitle:e.subtitle})]})]}),i=(0,w.jsx)(ci.g,{pinned:e.isPinned}),a=e.expandFolderButton??(e.isPlaying?(0,w.jsx)(vr,{iconSize:"xsmall"}):(0,w.jsxs)(w.Fragment,{children:[e.downloadButton&&(0,w.jsx)("div",{className:ft,children:e.downloadButton}),e.preReleaseIcon&&(0,w.jsx)("div",{className:ft,children:e.preReleaseIcon}),e.lockedIcon&&(0,w.jsx)("div",{className:ft,children:e.lockedIcon})]})),l=e.logRightClick;return(0,w.jsx)(g.h,{menu:e.menu,onShow:l,children:(0,w.jsx)(hr.E,{uri:e.uri,trigger:hr.l.OnMouseDown,children:(0,w.jsx)(Tl.v,{className:n()(mt,xt),title:r,leading:e.isPinned?i:void 0,trailing:a,id:e.uri,variant:e.isViewActive?"tinted":void 0,padding:`${mr.vw} ${mr.v4}`,onClick:e.onClick,size:"sm",hoverAnimationDuration:"0ms"})})})},Ol=e=>{const t=e.logRightClick;return(0,w.jsx)(g.h,{menu:e.menu,onShow:t,children:(0,w.jsxs)("div",{className:Tt,children:[(0,w.jsx)(El,{...e}),(0,w.jsx)(Al,{date:e.addedAt}),(0,w.jsx)(Al,{date:e.lastPlayedAt})]})})},kl=({height:e,isCompact:t,primaryFilter:r})=>(0,w.jsx)(Li.c,{className:n()({[Ct]:!t,[Pt]:t,[wt]:r===ni.c.ARTIST}),style:{height:e}});let Nl=function(e){return e[e.DEFAULT=0]="DEFAULT",e[e.COMPACT=1]="COMPACT",e}({});const Fl=()=>{const[e,t]=(0,fe.x)("library-row-mode",Nl.DEFAULT),r=(0,Be.vW)();return{libraryRowMode:e,setLibraryRowMode:t,rowHeight:e===Nl.DEFAULT||r===Be.fX.COLLAPSED?64:32}};var Bl=r(64844);const Ml=(0,i.memo)((function({item:e,primaryFilter:t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n}){const l={shouldShowType:!(0,cr.c0)(e.uri)&&si(e.type)!==t,RowVariantComponent:r,spec:i,nrValidItems:a,index:n},o=(0,d.NC)(X.lDH),s=(0,d.NC)(X.H8e);switch(e.type){case ni.c.FOLDER:return(0,w.jsx)(Ca,{libraryItem:e,...l});case ni.c.ALBUM:return(0,w.jsx)(Ui,{libraryItem:e,...l});case ni.c.ARTIST:return(0,w.jsx)(Wi,{libraryItem:e,...l});case ni.c.AUDIOBOOK:return(0,w.jsx)(Ki,{libraryItem:e,...l});case ni.c.SHOW:return(0,w.jsx)(Cn,{libraryItem:e,...l});case ni.c.PLAYLIST:return(0,w.jsx)(dn,{libraryItem:e,...l});case ni.c.LIKED_SONGS:return(0,w.jsx)(ja,{libraryItem:e,...l});case ni.c.YOUR_EPISODES:return(0,w.jsx)(Tn,{libraryItem:e,...l});case ni.c.LOCAL_FILES:return(0,w.jsx)(Fa,{libraryItem:e,...l});case ni.c.PRE_RELEASE_ALBUM:return o?(0,w.jsx)(hn,{libraryItem:e,...l}):null;case ni.c.PRE_RELEASE_BOOK:return s?(0,w.jsx)(hn,{libraryItem:e,...l}):null;default:(0,li.d)(e)}})),Ul=({getItems:e,scrollNodeRef:t,primaryFilter:r,nrValidItems:a,spec:n})=>{const l=(0,Be.vW)(),{rowHeight:o,libraryRowMode:s}=Fl(),c=s===Nl.COMPACT,d=((e,t)=>{switch(e){case Be.fX.COLLAPSED:return Dl;case Be.fX.DEFAULT:return t?El:jl;case Be.fX.EXPANDED:return t?Ol:Ll;default:(0,li.d)(e)}})(l,c),u=(0,i.useCallback)(((e,t)=>(0,w.jsx)(kl,{height:e,isCompact:c,primaryFilter:r},t)),[c,r]),p=(0,i.useCallback)(((t,i)=>e(t,i).map(((e,i)=>e?(0,w.jsx)(Ml,{item:e,spec:n,RowVariantComponent:d,primaryFilter:r,nrValidItems:a,index:t+i},e.uri):u(`${o}px`,`${t+i}`)))),[d,e,r,u,o,n,a]);return(0,w.jsx)(Rl.$,{circular:!1,allowsMultipleInteractiveChildrenInItem:!0,"aria-label":b.Ru.get("web-player.your-library-x.your-library"),children:(0,w.jsx)(Bl.L,{renderRows:p,nrRows:a,rowHeight:o,scrollNodeRef:t,renderPlaceholder:u})})};var Vl=r(2e3),_l=r(8143),Hl=r(27268),Wl=r(43178);var Xl=r(65876);function zl(e,t,r){const a=t.isInterestedInBeingShown,n=()=>{},l=(0,Xl.A)(t.onVisibilityGranted??n),o=(0,Xl.A)(t.onVisibilityDenied??n),[s,c]=(0,i.useState)(!1),{notifyShowInterest:d,notifyHideInterest:u,events:p}=((e,t)=>{const{notifyShowInterest:r,notifyHideInterest:a,events:n}=(0,i.useContext)(ae);return{events:n,notifyShowInterest:(0,i.useCallback)((()=>{r(e,t)}),[e,r,t]),notifyHideInterest:(0,i.useCallback)((()=>{a(e,t)}),[e,a,t])}})(e,r);return(0,i.useEffect)((()=>{const t=p.addListener(re.VISIBILITY_GRANTED,(t=>{t.data.key===e&&(l(),c(!0))})),r=p.addListener(re.VISIBILITY_DENIED,(t=>{t.data.key===e&&(o(),c(!1))}));return()=>{t(),r()}}),[p,e,l,o]),(0,i.useEffect)((()=>{a?d():u()}),[u,d,a]),(0,i.useEffect)((()=>u),[u]),{isVisible:s}}const Yl="cZ3IJprhLYLVtLoxVtDe",Kl="C8nlESBb6d0huyAhMq2v",Gl="yclq4HDmRA_euiUYwB9O",Zl=function({title:e,bodyText:t,children:r,root:a,isAllowedToShow:n,childrenWrapperClassName:l,onHide:o,onboardingVisibilityKey:s,priority:c}){const[u,p]=(0,i.useState)(null),[g,y]=(0,i.useState)(null),m=(0,d.NC)(X.zJD),x=(0,i.useCallback)((()=>{o()}),[o]);(0,i.useEffect)((()=>{if(!n)return()=>{};const e=e=>{"Escape"===e.key&&x()};return window.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0)}}),[x,s,g,n]);const h=u?.getBoundingClientRect(),{isVisible:f}=zl(s,{isInterestedInBeingShown:!!h&&0!==h.width&&n&&m},c);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{ref:p,className:l,children:r}),f&&(0,_l.createPortal)((0,w.jsx)("div",{className:Yl,style:{top:h?.top??0,left:h?.left??0,width:h?.width,height:h?.height},ref:y,children:(0,w.jsxs)(Hl.A,{popoverTitle:e,arrow:Hl.A.left,colorSet:"announcement",className:Kl,children:[(0,w.jsx)(we.E,{as:"p",dangerouslySetInnerHTML:{__html:t||""}}),(0,w.jsx)(ke.H,{size:"small",onClick:x,iconOnly:Wl.M,"aria-label":b.Ru.get("close"),className:Gl})]})}),a||document.body)]})};var Jl=r(84033),ql=r(18456),Ql=r(21048),$l=r(65987);const eo=(e,t,r)=>{const i=t.closest('li[role="presentation"]'),a=e.parentElement?.querySelectorAll('ul[role="menu"]');if(r===$l.O.UP){const r=a?.[a.length-1],n=e.previousElementSibling,l=i?.previousElementSibling?.previousElementSibling;if(t instanceof HTMLUListElement||!l){if(n&&n instanceof HTMLUListElement)return n;if(r&&r instanceof HTMLUListElement)return r}}else{const t=i?.nextElementSibling;if(!t){const t=e.nextElementSibling;return t&&t instanceof HTMLUListElement?t:a?.[0]}}},to="GvHaMehoYEIaLhHafB4F",ro="main-yourLibraryX-librarySortWrapper",io="ijaSPbJ8wd3RNiyukjlh",ao="w0nWe_59HwsG7nQLoibF",no="LbAtRPub21imosz1Xjht",lo=[{itemsViewState:ml.X.LIST,compactModeState:Nl.COMPACT},{itemsViewState:ml.X.LIST,compactModeState:Nl.DEFAULT},{itemsViewState:ml.X.GRID,compactModeState:Nl.DEFAULT}],oo=(e,t,r)=>Math.round((e+t)*r)/r,so=e=>e.itemsViewState===ml.X.GRID?b.Ru.get("web-player.your-library-x.sort-and-view-picker.grid"):e.compactModeState===Nl.COMPACT?b.Ru.get("web-player.your-library-x.sort-and-view-picker.compact"):b.Ru.get("web-player.your-library-x.sort-and-view-picker.list"),co=({selectedSort:e,selectedView:t,onSortSelect:r,onViewSelect:a,sortOptions:n,spec:l,id:o})=>{const s=(0,C.s)(),c=(0,i.useCallback)((e=>e.itemsViewState===ml.X.GRID?(0,w.jsx)(yl.D,{size:"small"}):e.compactModeState===Nl.COMPACT?(0,w.jsx)(Jl.d,{size:"small"}):(0,w.jsx)(gl.N,{size:"small"})),[]),{gridScale:d,setGridScale:u}=An(),p=e=>{const t=oo(e,.5,100);u(t),s.logInteraction(l.gridDensitySliderFactory().dragSetSliderPosition({position:t}))},g=(0,i.useCallback)((e=>{u(e),s.logInteraction(l.gridDensitySliderFactory().hitSetSliderPosition({position:e}))}),[s,u,l]),m=e=>e?.parentElement?.querySelector("ul"),x=(0,i.useRef)(null);return(0,w.jsxs)("div",{id:o,className:io,ref:x,children:[(0,w.jsxs)(y.W,{"aria-label":b.Ru.get("web-player.your-library-x.sort_by"),onFocusVerticalItem:eo,getInitialFocusElement:m,children:[(0,w.jsx)(ql.y,{children:b.Ru.get("web-player.your-library-x.sort_by")}),n.map((({key:t,value:i},a)=>(0,w.jsx)(h.D,{role:"menuitemradio","aria-checked":t===e.key,onClick:()=>r(t,a),divider:a===n.length-1?"after":void 0,autoClose:!1,children:i},t)))]}),(0,w.jsxs)(y.W,{"aria-label":b.Ru.get("web-player.your-library-x.sort-and-view-picker.view-as"),onFocusVerticalItem:eo,getInitialFocusElement:m,children:[(0,w.jsx)(ql.y,{children:b.Ru.get("web-player.your-library-x.sort-and-view-picker.view-as")}),lo.map((e=>{const r=so(e),i=e.itemsViewState===t.itemsViewState&&e.compactModeState===t.compactModeState;return(0,w.jsx)(h.D,{role:"menuitemradio","aria-checked":i,onClick:()=>a(e),leadingIcon:c(e),autoClose:!1,children:r},r)})),ml.X.GRID===t.itemsViewState&&(0,w.jsx)("li",{role:"presentation",children:(0,w.jsx)("div",{role:"menuitem",className:no,children:(0,w.jsx)(Ql.z2,{labelText:b.Ru.get("web-player.your-library-x.sort-and-view-picker.grid-density-label"),value:oo(d,-.5,100),max:1,step:.1,onDragStart:p,onDragMove:p,onDragEnd:p,onStepBackward:()=>g(oo(d,-.1,10)),onStepForward:()=>g(oo(d,.1,10)),forceActiveStyles:!0,"data-roving-interactive":"1"})})})]})]})},uo=(e,t=!0)=>{const[r,a]=(0,fe.x)("onboarding-dismissed:ylx-playlist-ordering",!1),[n,l]=(0,fe.x)("onboarding-dismissed-amount:ylx-playlist-ordering",0),[o,s]=(0,i.useState)(!1),{dropOriginIsYLX:c}=Jr(),{draggingIsInProgress:d}=(0,i.useContext)(k.O_);(0,i.useEffect)((()=>{d&&c&&s(!0)}),[d,c]);const u=(0,i.useCallback)((()=>{a(!0),s(!1),l(n+1)}),[n,l,a]);return{show:e&&n<3&&(!r||o)&&(t||o),onHide:u}};var po=r(50244);const go=({sortOptions:e,selectedSort:t,onSortSelect:r,root:a,showReorderingOnboarding:n,scrollNodeRef:l,spec:o})=>{const{itemsView:s,setItemsView:c}=(0,ml.t)(),{libraryRowMode:d,setLibraryRowMode:u}=Fl(),p=(0,C.s)(),g=(0,i.useCallback)((()=>{p.logInteraction(o.hitUiReveal())}),[p,o]),y=(0,i.useMemo)((()=>s===ml.X.GRID?{itemsViewState:ml.X.GRID,compactModeState:Nl.DEFAULT}:d===Nl.COMPACT?{itemsViewState:ml.X.LIST,compactModeState:Nl.COMPACT}:{itemsViewState:ml.X.LIST,compactModeState:Nl.DEFAULT}),[s,d]),m=(0,i.useCallback)((e=>{let t=o.viewAsOptionFactory({identifier:"grid",position:3}).hitUiElementToggle();e.itemsViewState===ml.X.GRID?c(ml.X.GRID):e.compactModeState===Nl.COMPACT?(t=o.viewAsOptionFactory({identifier:"compact",position:1}).hitUiElementToggle(),c(ml.X.LIST),u(Nl.COMPACT)):(t=o.viewAsOptionFactory({identifier:"list",position:2}).hitUiElementToggle(),c(ml.X.LIST),u(Nl.DEFAULT)),p.logInteraction(t)}),[p,c,u,o]),x=(0,i.useRef)(null),h=(0,po.y)(l,"0px 0px 0px 0px",.75,x),[f,S]=(0,fe.x)("sort-view-picker-onboarding-seen",!1),{show:v,onHide:P}=uo(n,!h),R=(0,i.useCallback)((()=>{g(),S(!0)}),[g,S]);return(0,w.jsx)(Zl,{bodyText:b.Ru.get("web-player.your-library-x.sort-and-view-picker.view-onboarding"),root:a,isAllowedToShow:!f&&!h,childrenWrapperClassName:ro,onHide:()=>S(!0),onboardingVisibilityKey:$.YLX_SORT_AND_VIEW_PICKER,children:(0,w.jsx)(Zl,{bodyText:b.Ru.get("web-player.your-library-x.custom-ordering-onboarding-text"),root:a,isAllowedToShow:v,childrenWrapperClassName:ro,onHide:P,onboardingVisibilityKey:$.YLX_CUSTOM_ORDERING,priority:ee.CONTEXTUAL,children:(0,w.jsx)(ul.b,{menu:(0,w.jsx)(co,{selectedSort:t,selectedView:{itemsViewState:y.itemsViewState??ml.X.LIST,compactModeState:y.compactModeState??Nl.DEFAULT},sortOptions:e,onSortSelect:r,onViewSelect:m,spec:o,id:"sort-and-view-picker"}),placement:"bottom-end",children:(0,w.jsx)(ke.H,{"aria-label":b.Ru.get("web-player.your-library-x.sort-and-view-picker.button-aria-label",t.value,so(y)),onClick:R,size:"small",iconTrailing:(T=y,T.itemsViewState===ml.X.GRID?yl.D:T.compactModeState===Nl.COMPACT?Jl.d:gl.N),ref:x,role:"combobox","aria-controls":"sort-and-view-picker",children:(0,w.jsx)(we.E,{variant:"bodySmall",className:ao,children:t.value})})})})});var T},yo=({sortOrders:e,activeSortOrderId:t,setActiveSortOrderId:r,root:a,showReorderingOnboarding:n,spec:l,scrollNodeRef:o})=>{const s=(0,i.useMemo)((()=>l.sortMenuButtonFactory()),[l]),c=(0,i.useMemo)((()=>l.sortbyViewasMenuButtonFactory()),[l]),u=(0,C.s)(),p=(0,Vt.f)(),g=e.find((e=>e.id===t))??e?.at(0),y=(0,i.useRef)(null),m=(0,d.NC)(X.AEN),x=(0,i.useCallback)(((e,t)=>{r(e);const i=p.getSortOrderLabel(e);m?u.logInteraction(c.sortOptionFactory({identifier:i,position:t}).hitSort()):u.logInteraction(s.sortMenuFactory().sortOptionFactory({identifier:i,position:t}).hitSort())}),[p,u,r,c,s,m]),{show:h,onHide:f}=uo(n);return m?(0,w.jsx)(go,{sortOptions:e.map((({id:e,name:t})=>({key:e,value:t}))),selectedSort:{key:g?.id??"",value:g?.name??""},onSortSelect:x,root:a,showReorderingOnboarding:n,scrollNodeRef:o,spec:c}):(0,w.jsx)("div",{className:to,ref:y,children:(0,w.jsx)(Zl,{bodyText:b.Ru.get("web-player.your-library-x.custom-ordering-onboarding-text"),root:a,isAllowedToShow:h,childrenWrapperClassName:ro,onHide:f,onboardingVisibilityKey:$.YLX_CUSTOM_ORDERING,priority:ee.CONTEXTUAL,children:(0,w.jsx)(Vl.g,{options:e.map((({id:e,name:t})=>({key:e,value:t}))),onClick:()=>{u.logInteraction(s.hitUiReveal())},onSelect:x,selected:{key:g?.id??"",value:g?.name??""},heading:b.Ru.get("web-player.your-library-x.sort_by"),ariaLabel:b.Ru.get("web-player.your-library-x.sort_by")})})})};var mo=r(25763),xo=r(34122),bo=r(4852);const ho=({clearOnEscapeInElementRef:e,primaryFilter:t,spec:r})=>{const a=(0,Vt.f)(),n=(0,C.s)(),l=function(e){switch(e){case ni.c.PRE_RELEASE_ALBUM:case ni.c.ALBUM:return b.Ru.get("web-player.your-library-x.text-filter.albums-placeholder");case ni.c.ARTIST:return b.Ru.get("web-player.your-library-x.text-filter.artists-placeholder");case ni.c.PLAYLIST:return b.Ru.get("web-player.your-library-x.text-filter.playlists-placeholder");case ni.c.SHOW:return b.Ru.get("web-player.your-library-x.text-filter.shows-placeholder");case ni.c.PRE_RELEASE_BOOK:case ni.c.AUDIOBOOK:return b.Ru.get("web-player.your-library-x.text-filter.audiobooks-placeholder");case"downloaded":return b.Ru.get("web-player.your-library-x.text-filter.downloaded-placeholder");case void 0:return b.Ru.get("web-player.your-library-x.text-filter.generic-placeholder");default:return void(0,li.k)(e)}}(t),o=(0,i.useCallback)((()=>(n.logInteraction(r.searchButtonFactory().hitUiReveal()),!0)),[n,r]),s=(0,i.useCallback)((()=>(n.logInteraction(r.textFilterFactory().keyStrokeClearFilter()),!0)),[n,r]);return(0,w.jsx)(mo.S,{placeholder:l,clearOnEscapeInElementRef:e,debounceFilterChangeTimeout:a?.getCapabilities().canTextFilterContentsInRealtime?0:void 0,expandDirection:"right",onActivate:o,onClear:s,useExpandCallback:e=>{(0,bo.f)(xo.gO.FOCUS_YLX_TEXT_FILTER,e)}})};var fo=r(52608);var So=r(22203);var vo=r(8261);function Co(){const[e,t]=(0,i.useState)(null);if((0,ga.l)(pa.UV.UPDATE_PIN_ERROR,(e=>{t(e.data)})),void 0===e?.reason)return null;switch(e.reason){case pa.uL.TOO_MANY_PINS:return(0,w.jsx)(vo.x,{animated:!0,headingMessage:b.Ru.get("web-player.your-library-x.pin-error.title"),message:b.Ru.get("web-player.your-library-x.pin-error.message",e.maximumPinnedItems),buttonLabel:b.Ru.get("web-player.your-library-x.pin-error.ok"),isOpen:!0,onDismissDialog:()=>t(null)});case pa.uL.NO_PIN_IN_FOLDER:return(0,w.jsx)(vo.x,{animated:!0,headingMessage:b.Ru.get("web-player.your-library-x.pin-error.no-pin-in-folder.title"),message:b.Ru.get("web-player.your-library-x.pin-error.no-pin-in-folder.message"),buttonLabel:b.Ru.get("web-player.your-library-x.pin-error.ok"),isOpen:!0,onDismissDialog:()=>t(null)});default:return(0,li.k)(e),null}}var wo=r(90778),Po=r(43396);var Ro=r(87925),To=r(58127),Io=r(45235),Ao=r(59228);const jo=(e,t,r,a,n)=>{const l=(0,Ao.x)(),o=(0,i.useRef)(r),s=(0,i.useRef)(),c=(0,i.useRef)();s.current=a,c.current=n,(0,i.useEffect)((()=>{const r={ident:e,isPrefix:t,onMessage:e=>o.current(e),onSubscribe:async e=>await(s.current?.(e)),onCancel:async e=>await(c.current?.(e))},i=l.subscribe(r);return()=>{i.cancel()}}),[e,t,l])},Do={[pa.Ir.ALBUMS]:ni.c.ALBUM,[pa.Ir.ARTISTS]:ni.c.ARTIST,[pa.Ir.BOOKS]:ni.c.AUDIOBOOK,[pa.Ir.EPISODES]:ni.c.EPISODE,[pa.Ir.SHOWS]:ni.c.SHOW,[pa.Ir.TRACKS]:ni.c.TRACK};function Lo(e,t){const r=(0,i.useCallback)((({data:{list:r}})=>{Eo(e,Do[r])&&t()}),[e,t]);(0,ga.l)(pa.UV.UPDATE,r),(0,ga.l)(pa.UV.UPDATE_PIN,t);const a=(0,i.useCallback)((()=>{Eo(e,ni.c.PLAYLIST)&&t()}),[e,t]);(0,xa.L)(a),function(e){jo("hm://collection/ylpin/",!0,e)}(t),function(e){const t=(0,Io.A)(),r=t.getEvents();(0,i.useEffect)((()=>r.addListener(To.T.UPDATE,e)),[t,r,e])}(t),function(e){const t=(0,Ro.l)().getEvents();(0,i.useEffect)((()=>{const r=({data:{set:t}})=>{"prerelease"===t&&e()};return t.addListener(se.ar.ADDED,r),t.addListener(se.ar.REMOVED,r),()=>{t.removeListener(se.ar.ADDED,r),t.removeListener(se.ar.REMOVED,r)}}),[e,t])}(t)}function Eo(e,t){switch(e){case ni.c.ALBUM:case ni.c.ARTIST:case ni.c.AUDIOBOOK:case ni.c.SHOW:return e===t;case ni.c.PLAYLIST:switch(t){case ni.c.TRACK:case ni.c.PLAYLIST:case ni.c.EPISODE:return!0;default:return!1}default:return!0}}var Oo=r(90224),ko=r(88321),No=r(33834),Fo=r(75621);const Bo="Vf3ww2_My5QuwUnbpzhu";var Mo=r(24755);const Uo=()=>{const{typeaheadResult:{str:e}}=(0,i.useContext)(Br);return e?(0,w.jsx)(Mo.qb,{className:Bo,children:e}):null};var Vo=r(48905);const _o="main-yourLibraryX-libraryContainer",Ho="main-yourLibraryX-libraryFilter",Wo="iwhVJuPipY1lrQIjaA1k",Xo="main-yourLibraryX-libraryItemContainer",zo="main-yourLibraryX-libraryRootlist",Yo="sikBfynL1Y6I25nVpbAg",Ko="KwShd3RdVrsX6dGLJNxT",Go="main-yourLibraryX-filters",Zo="qOtD4rsRpIMhQLCjJ4K3",Jo="oEDH8yMQOKQNoX7LWjwt",qo="RHRitk6QC3rvuG24RAdj",Qo="main-yourLibraryX-filterArea",$o={items:[],totalLength:0},es=()=>{const{filter:e}=(0,i.useContext)(Q.g),[t,r]=(0,i.useState)(null),{refinersPickedByUserRef:a,selectedRefinerIds:o,resetRefinerIds:y,resetAndToggleRootRefiner:m,toggleRefinerId:x}=function(e){const{openedFolderUri:t=nr,change:r,resetFolder:a}=(0,i.useContext)(lr),n=(0,i.useRef)(t),[l,o]=(0,fe.x)("ylx-active-filter-ids",{[t]:[]}),s=(0,i.useRef)(!0),d=(0,c.U0)(((r,i=!0)=>{const a=new Set(e);a.has(r)?a.delete(r):a.add(r),s.current=i,o({...l,[t]:Array.from(a)})}),[e,o,t]),u=(0,i.useCallback)((()=>o({...l,[t]:[]})),[t,l,o]),p=(0,i.useCallback)((e=>{t&&a(),o({...l,[nr]:e?[e]:[]})}),[t,a,l,o]);return(0,i.useLayoutEffect)((()=>{t!==n.current&&t!==nr&&"PUSH"===r&&o({...l,[t]:l[n.current]}),n.current=t}),[r,t,l,o]),{refinersPickedByUserRef:s,selectedRefinerIds:l[t],resetRefinerIds:u,resetAndToggleRootRefiner:p,toggleRefinerId:d}}(t?.selectedFilters?.map((e=>e.id))??[]),b=o?.[0],{selectedSortOrderId:h,setSelectedSortOrderId:f}=function(e){const t=(0,Vt.f)().getContentsPrimaryFilterId(ni.c.PLAYLIST),{openedFolderUri:r=""}=(0,i.useContext)(lr),[a,n]=(0,fe.x)("ylx-active-sort-order-by-filter-id",{}),l=`${r&&t?t:e}`;return{selectedSortOrderId:a[l],setSelectedSortOrderId:(0,i.useCallback)((e=>{n({...a,[l]:e})}),[l,a,n])}}(b),S=(0,i.useRef)(null),v=(0,i.useRef)(null),P=(0,i.useRef)(null),{expandedFolders:R}=function(){const e=(0,i.useContext)(gt);if(!e)throw new Error("useExpandedFolders must be used within a ExpandedFoldersProvider");return e}(),{openedFolderUri:I,resetFolder:E}=(0,i.useContext)(lr),F=(0,Oo.p)(),B=(0,No.P)(),M=(0,Vt.f)(),U=(0,qr.g)(),V=ve(),_=Qr(),[H,W]=(0,i.useState)(!1),{isCollapsed:z,isExpanded:Y,setYlxSidebarState:K}=(0,Be.$)();(e=>{const t=(0,Vt.f)(),{isCollapsed:r,setYlxSidebarState:a,lastUncollapsedYlxSidebarState:n}=(0,Be.$)(),l=(0,Po.W)(),o=(0,i.useCallback)((()=>{const e=r?n:Be.fX.COLLAPSED;a(e)}),[r,n,a]),s=(0,i.useCallback)((()=>{e(null),r&&a(n)}),[r,n,e,a]),c=(0,i.useCallback)((i=>()=>{e(t.getContentsPrimaryFilterId(i)),r&&a(n)}),[r,n,t,e,a]),d=c(ni.c.PLAYLIST),u=c(ni.c.SHOW),p=c(ni.c.ARTIST),g=c(ni.c.ALBUM),y=c(ni.c.AUDIOBOOK);(0,wo.Nx)(l?xo.gO.TOGGLE_NPV_SIDEBAR:xo.gO.TOGGLE_YLX_SIDEBAR,o),(0,wo.Nx)(xo.gO.GO_TO_LIBRARY,s),(0,wo.Nx)(xo.gO.GO_TO_PLAYLISTS,d),(0,wo.Nx)(xo.gO.GO_TO_PODCASTS,u),(0,wo.Nx)(xo.gO.GO_TO_ARTISTS,p),(0,wo.Nx)(xo.gO.GO_TO_ALBUMS,g),(0,wo.Nx)(xo.gO.GO_TO_AUDIOBOOKS,y)})(m);const{isGridView:G}=(0,ml.t)(),{libraryRowMode:Z}=Fl(),J=Z===Nl.COMPACT,{spec:$,UBIFragment:ee}=(0,Ue.r)(u.j,{data:{identifier:"yourlibraryx"}});let te;te=z?"collapsed":G?Y?"expanded_grid":"default_grid":J?Y?"expanded_compact":"default_compact":Y?"expanded_list":"default_list";const re=(0,i.useMemo)((()=>$.sidebarFactory({uri:I??nr,identifier:te})),[$,I,te]),ie=(0,Vo.t)(re),ae=(0,i.useMemo)((()=>re.headerFactory()),[re]),ne=(0,i.useMemo)((()=>ae.filtersFactory()),[ae]),le=(0,i.useMemo)((()=>ae.searchBarFactory()),[ae]),oe=(0,i.useMemo)((()=>re.listFactory()),[re]),se=(0,C.s)();!function(e=[],t=[],r){const a=(0,fo.n)(),n=(0,Vt.f)().getContentsPrimaryFilterId("downloaded"),l=(0,i.useRef)(e);l.current=e;const o=(0,i.useRef)(t);o.current=t;const s=(0,i.useRef)(r);s.current=r;const d=(0,i.useRef)(!1);(0,i.useEffect)((()=>{if(!n)return;const e=o.current.includes(n),t=l.current.includes(n),r=o.current.length>1,i=!a&&!r&&!e&&t,c=a&&e&&d.current;(i||c)&&(i&&(d.current=!0),s.current(n,!1))}),[n,a]);const u=(0,i.useRef)(t);(0,c.Ij)((()=>{n&&(t.includes(n)&&!u.current.includes(n)&&d.current||(d.current=!1),u.current=t)}),[n,t])}(t?.availableFilters?.map((e=>e.id)),t?.selectedFilters?.map((e=>e.id)),x);const{handleDropOnFolder:ce,unpinConfirmationDialog:ue}=da(oe,I),{dropOriginIsYLX:me,entityIsInFolder:xe}=Jr(),{setDraggingIsInProgress:be}=(0,i.useContext)(k.O_);(0,N.g)(S);const he=I?Qt:qt,Ce=xe&&!t?.reorderAllowed?[j.fl.PLAYLISTS_V2,j.fl.FOLDERS]:[],{dropPosition:we,className:Pe,...Re}=(0,L.A)({allowedMimeTypesByDropPosition:{[D.Nz.ON]:me?Ce:he},onDrop:(0,i.useCallback)((async e=>{if(I)ce(e);else{const{[j.fl.TRACKS]:t=[],[j.fl.LOCAL_TRACKS]:r=[],[j.fl.ALBUMS]:i,[j.fl.ARTISTS]:a,[j.fl.EPISODES]:n,[j.fl.SHOWS]:l,[j.fl.PLAYLISTS_V2]:o=[],[j.fl.FOLDERS]:s,[j.fl.AUDIOBOOKS]:c}=e,d=[...t,...r];d.length&&(M?.add({uris:d}),se.logInteraction(oe.dragCreatePlaylist())),i?.length&&(M?.add({uris:i}),se.logInteraction(oe.dragLike({itemToBeLiked:i.at(0)??""}))),a?.length&&(M?.add({uris:a}),se.logInteraction(oe.dragLike({itemToBeLiked:a.at(0)??""}))),n?.length&&(M?.add({uris:n}),se.logInteraction(oe.dragLike({itemToBeLiked:n.at(0)??""}))),l?.length&&(M?.add({uris:l}),se.logInteraction(oe.dragLike({itemToBeLiked:l.at(0)??""}))),c?.length&&(M?.add({uris:c}),se.logInteraction(oe.dragLike({itemToBeLiked:c.at(0)??""}))),o.length&&(_(o,{before:"start"}),me?se.logInteraction(oe.dragSort()):se.logInteraction(oe.dragLike({itemToBeLiked:o.at(0)??""}))),s?.length&&(U.moveFolder({uri:s[0]},{before:"start"}),se.logInteraction(oe.dragSort()))}}),[I,ce,M,se,oe,_,me,U]),onLongDragOver:(0,i.useCallback)((()=>{z&&K(Be.fX.DEFAULT)}),[z,K])}),Te=(0,d.NC)(X.H8e),Ie=(0,d.NC)(X.lDH),Ae=Te||Ie,je=(0,i.useMemo)((()=>({filters:o,sortOrder:h,textFilter:e,includeLocalFiles:B,includeYourEpisodes:!0,includeLikedSongs:!0,includePreReleases:Ae,expandedFolders:z||G?[]:R,filtersPickedByUser:a.current,folderUri:I})),[o,h,e,B,Ae,z,G,R,a,I]),De=(0,i.useCallback)((async(e,t)=>{try{const i=await M.getContents({offset:e,limit:t,...je}),{offset:a,limit:n,items:o,...s}=i;return W(!1),{fetchedId:je.folderUri,onCacheSuccess:()=>{r((e=>(0,l.j)(s,e)?e:s))},...i}}catch(e){return e instanceof T.c_?(y(),$o):e instanceof T.IU?(f(void 0),$o):e instanceof T.db?(E(),$o):((0,Fo.UD)(e),W(!0),$o)}}),[je,M,y,E,f]),Le=!1===t?.hasUnfilteredItems,Ee=t?.hasTextFilter&&0===t.totalLength&&""!==e,{setFilter:Oe}=(0,i.useContext)(Q.g);(0,i.useEffect)((()=>{Ee&&z&&Oe("")}),[Ee,z,Oe]);const ke=0===t?.totalLength&&t.selectedFilters.length>0&&!t.passedFolderUri&&!t.hasTextFilter;(0,c.Ij)((()=>{const e=t?.selectedFilters.at(-1);ke&&e&&x(e.id,!1)}),[ke,t?.selectedFilters]);const Ne=(0,d.NC)(X.HbK,{loadingValue:!1})&&M?.getCapabilities().canFetchAllItems,{fetchedId:Fe,getItems:Me,nrValidItems:Ve,invalidateCache:_e}=(0,ko.E)({nrItems:50,fetch:De,limit:50,cacheAllOnInvalidation:Ne,cacheAllLimit:5e4}),He=(0,s.YQ)(_e,200,{leading:!0,trailing:!0,maxWait:1e3});Lo(t?.primaryFilter,He);const Xe=!I&&!Fe||I===Fe;((e,t="")=>{const r=(0,i.useRef)({});(0,i.useLayoutEffect)((()=>{if(!e.current)return()=>{};const i=e.current,a=r.current[t];i.scrollTop=a??0;const n=()=>{r.current[t]=i.scrollTop};return i?.addEventListener("scroll",n),()=>{i?.removeEventListener("scroll",n)}}),[e,t])})(S,Fe);const ze=(0,i.useCallback)((()=>{_e(),W(!1)}),[_e]),Ke=(0,po.y)(S),Ge=!!t?.openedFolderName,Ze=(0,d.NC)(X._p8,{loadingValue:!1})&&Ne,Je=function(e,t,r){const{isGridView:a}=(0,ml.t)(),{rowHeight:n}=Fl();return(0,i.useCallback)((async i=>{let l=n,o=1;if(a){const t=e.current?.querySelector('li[role="row"]');l=t?.getBoundingClientRect().height??0,t?.parentElement&&(o=getComputedStyle(t.parentElement).getPropertyValue("grid-template-columns").split(" ").length)}if(!l)return null;const s=r(0,5e4,{cachedOnly:!0}),c=s.find((e=>e?.name&&(0,So.u)(i,e.name))),d=c?s.indexOf(c):-1;return-1!==d&&t.current&&function(e,t,r,i){if(!e)return;const{scrollTop:a,offsetHeight:n}=e,l=t&&e?t.getBoundingClientRect().top+a-e.getBoundingClientRect().top:0;if(l+r<a||l+r+i>a+n){const t=r-n/2+l+i/2;e.scrollTop=t}}(t.current,e.current,Math.floor(d/o)*l,l),c?.uri??null}),[e,t,n,r,a])}(P,S,Me),qe=H?(0,w.jsx)(pt,{onClick:ze}):null;let Qe;(0,i.useEffect)((()=>{H&&z&&K(Be.fX.DEFAULT)}),[H,z,K]),Le&&!z&&(Qe=Ge?(0,w.jsx)(Ye,{className:Pe}):(0,w.jsx)(it,{className:Pe}));const $e=Ee?(0,w.jsx)(st,{query:e,className:Pe}):null,et=(0,d.NC)(X.AEN),tt=!z&&!Qe&&(0,w.jsxs)("div",{className:n()(Ho,Pe,{[Wo]:et}),children:[(0,w.jsx)(ho,{clearOnEscapeInElementRef:v,primaryFilter:t?.primaryFilter,spec:le},I),(0,w.jsx)(yo,{sortOrders:t?.availableSortOrders??[],activeSortOrderId:t?.selectedSortOrder?.id,setActiveSortOrderId:f,root:v.current,showReorderingOnboarding:t?.primaryFilter===ni.c.PLAYLIST&&!t?.reorderAllowed,spec:ae,scrollNodeRef:S})]}),rt=H&&!t,at=Y&&!G&&!qe&&!Qe,nt=(t?.selectedFilters??[]).length>0,lt=V&&!nt&&!I&&!Le,{cheetaraOnboardingIsActive:ot,setCheetaraOnboardingIsActive:ct,cheetaraOnboardingDismissed:dt,setCheetaraOnboardingDismissed:ut,handleCloseCheetaraOnboarding:yt}=Se(),mt=!z&&V&&!H&&!dt&&!t?.passedFolderUri;return(0,w.jsx)(Mr,{containerRef:v,findMatchingTypeaheadUid:Je,isEnabled:Ze,children:(0,w.jsxs)(ee,{spec:$,children:[(0,w.jsx)(q,{}),ot&&(0,w.jsx)(ge,{onClose:yt}),(0,w.jsx)(g.h,{menu:(0,w.jsx)(A,{folderUri:I}),children:(0,w.jsxs)("div",{className:n()(_o,{[_t]:we===D.Nz.ON,[Yo]:z,[Jo]:ot}),style:{"--placeholder-image":`url(${(0,p.b)("images/ylx-row-placeholder.png")})`,"--placeholder-artist-image":`url(${(0,p.b)("images/ylx-artist-row-placeholder.png")})`,"--placeholder-compact-image":`url(${(0,p.b)("images/ylx-compact-row-placeholder.png")})`},ref:e=>{v.current=e,ie(e)},...Re,tabIndex:-1,onDragStart:()=>be(!0),onDragEnd:()=>be(!1),children:[ue,(0,w.jsxs)("div",{className:n()({[qo]:Ke}),children:[(0,w.jsx)(Pl,{parentDropTargetClassName:Pe,isLibraryCompletelyEmpty:Le,folderUri:t?.passedFolderUri,folderName:t?.openedFolderName,spec:ae.titleRowFactory(),openedFolderIsPlayable:t?.openedFolderIsPlayable}),!F&&(0,w.jsx)(ee,{spec:ae,children:(0,w.jsx)(We,{})}),!z&&!rt&&(0,w.jsxs)("div",{className:Qo,children:[lt&&(0,w.jsx)(i.Suspense,{fallback:null,children:(0,w.jsx)(ye,{})}),(0,w.jsx)(ar,{selectedFilters:t?.selectedFilters,availableFilters:t?.availableFilters,toggleFilterId:x,resetFilterIds:y,className:n()(Go,{[Zo]:!Xe}),scrollNodeRef:S,spec:ne,inFolderView:!!t?.passedFolderUri},Fe),Y&&tt]}),mt&&Y&&(0,w.jsx)(i.Suspense,{fallback:null,children:(0,w.jsx)(pe,{ylxIsExpanded:Y,setCheetaraOnboardingIsActive:ct,onHide:()=>ut(!0)})}),at&&(0,w.jsx)(kt,{isScrolled:Ke})]}),(0,w.jsx)(O.a,{className:Xo,onInstanceCreated:e=>{S.current=e.elements().viewport},children:(0,w.jsxs)("div",{className:n()(zo,{[Zo]:!H&&!Xe,[Yo]:z,[Ko]:at}),children:[mt&&!Y&&(0,w.jsx)(i.Suspense,{fallback:null,children:(0,w.jsx)(pe,{ylxIsExpanded:Y,setCheetaraOnboardingIsActive:ct,onHide:()=>ut(!0)})}),!Y&&tt,!z&&t?.tagPlaylist&&(0,w.jsx)(i.Suspense,{fallback:null,children:(0,w.jsx)(de,{playlist:t.tagPlaylist})}),qe||Qe||$e,(0,w.jsx)("div",{ref:P,children:G?(0,w.jsx)(Fn,{getItems:Me,scrollNodeRef:S,primaryFilter:t?.primaryFilter,nrValidItems:Ve,spec:oe}):(0,w.jsx)(Ul,{getItems:Me,scrollNodeRef:S,primaryFilter:t?.primaryFilter,nrValidItems:Ve,spec:oe})})]})}),Co(),(0,w.jsx)(Uo,{})]})})]})})},ts=()=>{const{isAnonymous:e}=(0,o.d4)((e=>e.session)),t=(0,o.d4)((e=>e.ui.editRefinersModal)),r=ve();return(0,w.jsx)(E.s,{onError:e=>{(0,Fo.Jy)(e,"YourLibraryX")},children:(0,w.jsx)(Q.s,{uri:T.gv,children:(0,w.jsx)(yt,{children:(0,w.jsxs)(or,{children:[(0,w.jsx)(ce,{children:(0,w.jsx)(he,{children:(0,w.jsxs)(ne,{children:[(0,w.jsx)(es,{}),r&&t.isOpen&&(0,w.jsx)(ue,{})]})})}),(0,w.jsx)(Ee,{isAnonymous:e})]})})})})}},33834:(e,t,r)=>{r.d(t,{P:()=>a});var i=r(76149);function a(){return(0,i.y)()[0]}},76149:(e,t,r)=>{r.d(t,{y:()=>n});var i=r(30758),a=r(45235);function n(){const e=(0,a.A)(),[t,r]=(0,i.useState)(e.getIsEnabled());(0,i.useEffect)((()=>{const t=e.subscribeIsEnabled(r);return()=>t()}),[e]);return[t,(0,i.useCallback)((t=>e.setIsEnabled(t)),[e])]}},59228:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(48839),a=r(60102);function n(){return(0,a.N)(i.b)}}}]);
//# sourceMappingURL=9395.js.map