"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[9480],{32478:(e,r,t)=>{t.d(r,{M:()=>m});var i=t(12341),n=(t(47994),t(20815)),a=t(20837),o=t(8016),l=t(56039),s=t(18886);const u="profile-editImage-imageContainer",c="profile-editImage-editImageButtonContainer";var d=t(86070),m=function(e){var r=e.onClick,t=e.name,m=e.images,p=e.canEdit,f=e.placeholderType,g=e.shape,v=void 0===g?a.u.SQUARE:g,h=e.dragUri,b=void 0===h?"":h,x=(0,l.P)(m),y=(0,i.A)(x,2),j=y[0],k=y[1],w=(0,s.b)(j,k)===s.g.loaded,I=(0,o.P)({itemUris:[b],dragLabelText:t}),O=I.draggable,P=I.onDragStart;return(0,d.jsxs)("div",{className:u,"data-testid":"".concat(f,"-image"),draggable:O&&!!b,onDragStart:P,children:[(0,d.jsx)(a.b,{loading:"eager",name:t,images:m,placeholderType:f,shape:v}),p&&(0,d.jsx)("div",{className:c,children:(0,d.jsx)(n.a,{overlay:w,onClick:r,rounded:v===a.u.CIRCLE})})]})}},20815:(e,r,t)=>{t.d(r,{a:()=>v});var i=t(52542),n=t(97500),a=t.n(n),o=t(37283),l=t(13534),s=t(92107);const u="main-editImage-buttonContainer",c="main-editImageButton-image",d="main-editImageButton-overlay",m="main-editImageButton-rounded",p="main-editImageButton-icon",f="main-editImageButton-copy";var g=t(86070),v=function(e){var r=e.overlay,t=void 0!==r&&r,n=e.rounded,v=void 0!==n&&n,h=e.onClick;return(0,g.jsx)("div",{className:u,children:(0,g.jsx)("button",{"data-testid":"edit-image-button",className:a()(c,(0,i.A)((0,i.A)({},m,v),d,t)),"aria-haspopup":"true",onClick:h,type:"button",children:(0,g.jsxs)("div",{className:a()(p,"icon"),children:[(0,g.jsx)(o.G,{size:"xlarge","aria-hidden":"true"}),(0,g.jsx)(l.E,{variant:"bodyMedium",className:f,children:s.Ru.get("choose_photo")})]})})})}},87583:(e,r,t)=>{t.d(r,{X:()=>l});var i=t(97500),n=t.n(i),a=t(13758),o=t(86070),l=function(e){var r=e.children;return(0,o.jsx)("div",{className:n()(a.A.imageContainer,a.A.imageContainerNew),children:r})}},74351:(e,r,t)=>{t.d(r,{B:()=>o});var i=t(13534),n=t(13758),a=t(86070),o=function(e){var r=e.children;return(0,a.jsx)(i.E,{variant:"bodySmall",className:n.A.pretitle,children:r})}},81573:(e,r,t)=>{t.d(r,{W:()=>l});var i=t(30758),n=t(12072),a=t(92107),o=t(86070),l=(0,i.memo)((function(e){var r=e.isFollowing,t=e.onClick,i=e.disabled,l=void 0!==i&&i,s=e.buttonText,u=e.size,c=void 0===u?"small":u,d=e.className,m=r?a.Ru.get("following"):a.Ru.get("follow");return(0,o.jsx)(n.n,{onClick:t,disabled:l,size:c,className:d,children:s||m})}))},74494:(e,r,t)=>{t.d(r,{M:()=>d});t(83234);var i=t(97500),n=t.n(i),a=t(13181),o=t(13534);const l="artist-artistVerifiedBadge-wrapper",s="artist-artistVerifiedBadge-badge",u="artist-artistVerifiedBadge-fillColor";var c=t(86070),d=function(e){var r=e.text,t=e.iconSize,i=void 0===t?"medium":t,d=e.className;return(0,c.jsxs)("span",{className:n()(l,d),children:[(0,c.jsx)("div",{className:"".concat(s," ").concat(u)}),(0,c.jsx)(a.O,{semanticColor:"textAnnouncement",className:s,size:i}),r?(0,c.jsx)(o.E,{variant:"bodySmall",children:r}):null]})}},42104:(e,r,t)=>{t.d(r,{u:()=>x,i:()=>b});t(7651),t(30456),t(26701),t(37417),t(11737),t(51691),t(702),t(5672),t(43379),t(34192),t(88856),t(51565),t(18316);var i=t(12341),n=t(62822),a=t(52542),o=t(13734),l=t(93091),s=t.n(l),u=(t(86746),t(78551),t(60482),t(82467),t(97460),t(30758));t(42486),t(68216),t(51234),t(78397);function c(e){return new Promise((function(r,t){var i=new FileReader;i.readAsDataURL(e),i.onload=function(){var e,t;r(null!==(e=null===(t=i.result)||void 0===t?void 0:t.toString())&&void 0!==e?e:"")},i.onerror=function(e){return t(e)}}))}function d(e){return new Promise((function(r,t){var i=new Image;i.onload=function(){var e=i.width,t=i.height;r([e,t])},i.src=e,i.onerror=function(e){return t(e)}}))}const m="main-imagePicker-fileInput";var p=t(86070),f=["onChange","onError","isOpen","minImageWidth","minImageHeight","maxImageWidth","maxImageHeight","maxFileSizeMB"];function g(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function v(e){for(var r=1;rw||r.imageHeight>O)){e.next=7;break}throw b.IMAGE_TOO_BIG;case 7:if(!(r.imageFile.size>E)){e.next=9;break}throw b.FILE_TOO_BIG;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(e){return D.apply(this,arguments)}function D(){return(D=(0,n.A)(s().mark((function e(r){var t,n,a,o,l;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c(r);case 2:return t=e.sent,e.next=5,d(t);case 5:return n=e.sent,a=(0,i.A)(n,2),o=a[0],l=a[1],e.abrupt("return",{imageFile:r,imageDataUrl:t,imageWidth:o,imageHeight:l});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,p.jsx)("input",v(v({},T),{},{type:"file","data-testid":"image-file-picker",ref:_,className:m,onChange:function(e){return N.apply(this,arguments)}}))}},69395:(e,r,t)=>{t.d(r,{z:()=>p});var i=t(52542),n=t(97500),a=t.n(n),o=t(13534),l=t(81120);const s="pIZVZOfjnJGth1BcoA1E",u="ZBBTIITnUdwh05dCI0tm",c="sz8Nwj2lvhOZxDwYWRQr",d="jjPsW7vuG9xH9qhEGL3I";var m=t(86070),p=function(e){var r=e.message,t=e.isErrorMessage,n=void 0!==t&&t;return r?(0,m.jsx)("div",{role:"alert",children:(0,m.jsx)("div",{className:a()(s,(0,i.A)({},u,n)),children:(0,m.jsxs)(o.E,{as:"p",variant:"marginal",className:c,children:[(0,m.jsx)(l.b,{size:"small",className:d,"aria-hidden":"true"}),r]})})}):null}},15054:(e,r,t)=>{t.d(r,{g:()=>h});t(47994);var i=t(30758),n=t(97500),a=t.n(n),o=t(13534),l=t(80366),s=t(83643),u=t(59739),c=t(64877),d=t(17011),m=t(93051),p=t(8016),f=t(70566),g=t(13584),v=t(86070),h=function(e){var r=e.children,t=e.uri,n=e.name,h=e.nonInteractive,b=void 0!==h&&h,x=e.creatorUri,y=e.spec,j=null,k=(0,p.P)({itemUris:[t],dragLabelText:n}),w=k.draggable,I=k.onDragStart,O=(0,f.s)(),P=(0,i.useCallback)((function(){y&&O.logInteraction(y.albumLinkFactory({uri:t}).hitUiNavigate({destination:t}))}),[O,y,t]);return b?(0,v.jsx)("span",{className:a()("standalone-ellipsis-one-line",g.A.text),children:r}):((0,l._T)(t)&&(j=(0,v.jsx)(u.h,{uri:t,artistUri:x})),(0,l.WB)(t)&&(j=(0,v.jsx)(c.H,{uri:t})),(0,v.jsx)(s.h,{menu:j,children:(0,v.jsx)(o.E,{variant:"bodySmall",children:(0,v.jsx)(d.Zp,{label:n,showDelay:d.uF,children:(0,v.jsx)(m.N,{draggable:w,onDragStart:I,className:a()("standalone-ellipsis-one-line"),to:t,dir:"auto",onClick:P,children:r})})})}))}},54180:(e,r,t)=>{t.d(r,{p:()=>a});var i=t(12341),n=(t(60287),t(30758));function a(){var e=(0,n.useState)(!1),r=(0,i.A)(e,2),t=r[0],a=r[1];return[t,(0,n.useCallback)((function(){a(!0),setTimeout((function(){return a(!1)}),0)}),[a])]}},90663:(e,r,t)=>{t.r(r),t.d(r,{default:()=>Ei});var i=t(30758),n=t(44286),a=t(86308),o=t(80366),l=t(56482),s=(t(25550),t(47994),t(15342),t(38195)),u=t(92107),c=t(8388),d=t(44206),m=t(1349),p=t(32218),f=t(12988),g=t(86070),v=function(e){var r=e.uri,t=(0,f.Z)(p.SR,[r]),i=t.data,n=t.loading,a=t.error,o=null==i?void 0:i.profiles;return n?(0,g.jsx)(d.LoadingPage,{hasError:null!==a,errorMessage:u.Ru.get("error.not_found.title.page")}):(0,g.jsx)(m.$,{title:u.Ru.get("followers"),total:null==o?void 0:o.length,showAll:!0,fullPage:!0,rowGap:s.lT,children:null==o?void 0:o.map((function(e,r){return(0,g.jsx)(c.a,{index:r,uri:e.uri,name:e.name,images:[{url:e.image_url}]},e.uri)}))})},h=t(12341),b=(t(30456),t(43379),t(34192),t(88856),t(89255));const x="WqHooc2Y_6VuGI84LxQj";var y=function(e){var r=e.uri,t=(0,f.Z)(p.mH,[r]),n=t.data,a=t.loading,l=t.error,s=null==n?void 0:n.profiles,v=(0,i.useMemo)((function(){return(null==s?void 0:s.filter((function(e){return(0,o.ec)(e.uri)})))||[]}),[s]),y=(0,i.useMemo)((function(){return(null==s?void 0:s.filter((function(e){return(0,o.AP)(e.uri)})))||[]}),[s]),j=(0,i.useState)("all"),k=(0,h.A)(j,2),w=k[0],I=k[1],O=v.length&&y.length,P=(0,i.useMemo)((function(){if(!O)return s;switch(w){case"artists":return v;case"users":return y;default:return s}}),[w,s,v,y,O]),A=(0,i.useCallback)((function(){return O?(0,g.jsxs)("div",{className:x,children:[(0,g.jsx)(b.v,{selected:"all"===w,onClick:function(){I("all")},selectedColorSet:"invertedLight",children:u.Ru.get("web-player.user-page.following.filter-all")}),(0,g.jsx)(b.v,{selected:"artists"===w,onClick:function(){I("artists")},selectedColorSet:"invertedLight",children:u.Ru.get("web-player.user-page.following.filter-artists")}),(0,g.jsx)(b.v,{selected:"users"===w,onClick:function(){I("users")},selectedColorSet:"invertedLight",children:u.Ru.get("web-player.user-page.following.filter-friends")})]}):(0,g.jsx)(g.Fragment,{})}),[w,O]);return a?(0,g.jsx)(d.LoadingPage,{hasError:null!==l,errorMessage:u.Ru.get("error.not_found.title.page")}):(0,g.jsx)(m.$,{title:u.Ru.get("following"),total:null==s?void 0:s.length,showAll:!0,fullPage:!0,renderSubHeader:A,children:null==P?void 0:P.map((function(e,r){return(0,g.jsx)(c.a,{index:r,uri:e.uri,name:e.name,images:[{url:e.image_url}]},e.uri)}))})},j=(t(28430),t(9582),t(11656)),k=t(88677),w=t(42551),I=t(93493),O=t(79686),P=t(15992),A=t(26314),R=t(83643),_=t(24804),T=t(45625),E=t(32478),N=t(9754),C=t(87583),S=t(33598),U=t(17067),D=t(85925),L=t(20837),M=t(74351),B=t(88420),H=t(74494),F=t(36085),G=t(62822),W=t(93091),z=t.n(W),Q=(t(79210),t(97500)),q=t.n(Q),K=t(13534),Z=t(64399),V=t(37865),Y=t(11854),$=t(47540),X=t(42104),J=t(54180),ee=t(69395),re=t(52542),te=t(37283),ie=t(56039),ne=t(18886);const ae="profile-userEditDetails-image",oe="valcBm4lLe9qFBcg0sFY",le="tAIzXn8C9KriGwGuBfWg",se="PsrXxenHUFXYM1ub1xWw",ue="U_VWfeeLWnDPhUTxCmrQ";var ce=function(e){var r=e.onClickEdit,t=e.onClickRemove,i=e.name,n=e.images,a=e.canEdit,o=(0,ie.P)(n),l=(0,h.A)(o,2),s=l[0],c=l[1],d=(0,ne.b)(s,c)===ne.g.loaded;return(0,g.jsxs)("div",{className:ae,children:[(0,g.jsx)(L.b,{loading:"eager",name:i,images:n,placeholderType:"user",shape:L.u.CIRCLE}),a&&(0,g.jsxs)("div",{className:q()(oe,(0,re.A)({},se,d)),children:[(0,g.jsx)("button",{className:le,"aria-haspopup":"true",onClick:r,type:"button",children:(0,g.jsx)(K.E,{variant:"bodyMedium",children:u.Ru.get("user.edit-details.choose-photo")})}),(0,g.jsx)("div",{className:q()(ue,"icon"),children:(0,g.jsx)(te.G,{size:"xlarge","aria-hidden":!0})}),(0,g.jsx)("button",{className:le,onClick:t,type:"button",children:(0,g.jsx)(K.E,{variant:"bodyMedium",children:u.Ru.get("user.edit-details.remove-photo")})})]})]})},de=(t(184),t(42486),"https://image-upload.spotify.com/v4"),me=(t(83234),t(7651),t(14551),t(9267),t(26701),t(86746),t(45434),t(79024),t(70750),t(5015),t(66209),t(10885),t(39261),t(83700),t(83632),t(26851),t(68216),t(76588),t(37417),t(11737),t(51691),t(702),t(5672),t(2823),t(65594),t(78397),t(97460),t(77329),t(13740),t(96542),t(85738),t(12900),t(82051),t(53198),t(74211),t(19791),t(75294),t(41526),t(66032),t(73659),t(38551),t(28553),t(67612),t(28579),t(77719),t(97576),t(62891),t(82605),t(14863),t(59637),t(2709),t(73974),t(58941),t(51579),t(26236),t(57716),t(81913),t(51565),t(18316),t(93577),t(69443));function pe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function fe(e){for(var r=1;r=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){l=!0,a=e},f:function(){try{o||null==t.return||t.return()}finally{if(l)throw a}}}}function ve(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,i=Array(r);t1&&void 0!==arguments[1]?arguments[1]:me.Writer.create(),i=ge(e.paths);try{for(i.s();!(r=i.n()).done;){var n=r.value;t.uint32(10).string(n)}}catch(e){i.e(e)}finally{i.f()}return t},xe=function(e,r){var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=fe({},he);for(n.paths=[];t.pos>>3==1)n.paths.push(t.string());else t.skipType(7&a)}return n},ye=function(e){var r=fe({},he);if(r.paths=[],void 0!==e.paths&&null!==e.paths){var t,i=ge(e.paths);try{for(i.s();!(t=i.n()).done;){var n=t.value;r.paths.push(String(n))}}catch(e){i.e(e)}finally{i.f()}}return r},je=function(e){var r=fe({},he);if(r.paths=[],void 0!==e.paths&&null!==e.paths){var t,i=ge(e.paths);try{for(i.s();!(t=i.n()).done;){var n=t.value;r.paths.push(n)}}catch(e){i.e(e)}finally{i.f()}}return r},ke=function(e){var r={};return e.paths?r.paths=e.paths.map((function(e){return e})):r.paths=[],r},we=(t(34518),t(28169),t(46625),t(85983),t(44967),t(96403),t(83355),t(21364)),Ie=t(84686).hp;function Oe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function Pe(e){for(var r=1;r1&&void 0!==arguments[1]?arguments[1]:me.Writer.create();return r.uint32(8).int32(e.value),r},Ee=function(e,r){for(var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=Pe({},Ae);t.pos>>3==1)n.value=t.int32();else t.skipType(7&a)}return n},Ne=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me.Writer.create();return r.uint32(8).bool(e.value),r},Ce=function(e,r){for(var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=Pe({},Re);t.pos>>3==1)n.value=t.bool();else t.skipType(7&a)}return n},Se=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me.Writer.create();return r.uint32(10).string(e.value),r},Ue=function(e,r){for(var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=Pe({},_e);t.pos>>3==1)n.value=t.string();else t.skipType(7&a)}return n};me.util.Long!==we.A&&(me.util.Long=we.A,(0,me.configure)());var De=globalThis;De.atob,De.btoa;function Le(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return Me(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Me(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){l=!0,a=e},f:function(){try{o||null==t.return||t.return()}finally{if(l)throw a}}}}function Me(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,i=Array(r);t1&&void 0!==arguments[1]?arguments[1]:me.Writer.create();return r.uint32(8).int32(e.maxWidth),r.uint32(16).int32(e.maxHeight),r.uint32(26).string(e.url),r},Qe=function(e,r){for(var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=He({},Fe);t.pos>>3){case 1:n.maxWidth=t.int32();break;case 2:n.maxHeight=t.int32();break;case 3:n.url=t.string();break;default:t.skipType(7&a)}}return n},qe=function(e){var r=He({},Fe);return void 0!==e.maxWidth&&null!==e.maxWidth?r.maxWidth=Number(e.maxWidth):r.maxWidth=0,void 0!==e.maxHeight&&null!==e.maxHeight?r.maxHeight=Number(e.maxHeight):r.maxHeight=0,void 0!==e.url&&null!==e.url?r.url=String(e.url):r.url="",r},Ke=function(e){var r=He({},Fe);return void 0!==e.maxWidth&&null!==e.maxWidth?r.maxWidth=e.maxWidth:r.maxWidth=0,void 0!==e.maxHeight&&null!==e.maxHeight?r.maxHeight=e.maxHeight:r.maxHeight=0,void 0!==e.url&&null!==e.url?r.url=e.url:r.url="",r},Ze=function(e){var r={};return void 0!==e.maxWidth&&(r.maxWidth=e.maxWidth),void 0!==e.maxHeight&&(r.maxHeight=e.maxHeight),void 0!==e.url&&(r.url=e.url),r},Ve=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me.Writer.create();void 0!==e.username&&void 0!==e.username&&Se({value:e.username},r.uint32(10).fork()).ldelim(),void 0!==e.name&&void 0!==e.name&&Se({value:e.name},r.uint32(18).fork()).ldelim();var t,i=Le(e.images);try{for(i.s();!(t=i.n()).done;){var n=t.value;ze(n,r.uint32(26).fork()).ldelim()}}catch(e){i.e(e)}finally{i.f()}return void 0!==e.verified&&void 0!==e.verified&&Ne({value:e.verified},r.uint32(34).fork()).ldelim(),void 0!==e.editProfileDisabled&&void 0!==e.editProfileDisabled&&Ne({value:e.editProfileDisabled},r.uint32(42).fork()).ldelim(),void 0!==e.reportAbuseDisabled&&void 0!==e.reportAbuseDisabled&&Ne({value:e.reportAbuseDisabled},r.uint32(50).fork()).ldelim(),void 0!==e.abuseReportedName&&void 0!==e.abuseReportedName&&Ne({value:e.abuseReportedName},r.uint32(58).fork()).ldelim(),void 0!==e.abuseReportedImage&&void 0!==e.abuseReportedImage&&Ne({value:e.abuseReportedImage},r.uint32(66).fork()).ldelim(),void 0!==e.hasSpotifyName&&void 0!==e.hasSpotifyName&&Ne({value:e.hasSpotifyName},r.uint32(74).fork()).ldelim(),void 0!==e.hasSpotifyImage&&void 0!==e.hasSpotifyImage&&Ne({value:e.hasSpotifyImage},r.uint32(82).fork()).ldelim(),void 0!==e.color&&void 0!==e.color&&Te({value:e.color},r.uint32(90).fork()).ldelim(),r},Ye=function(e,r){var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=He({},Ge);for(n.images=[];t.pos>>3){case 1:n.username=Ue(t,t.uint32()).value;break;case 2:n.name=Ue(t,t.uint32()).value;break;case 3:n.images.push(Qe(t,t.uint32()));break;case 4:n.verified=Ce(t,t.uint32()).value;break;case 5:n.editProfileDisabled=Ce(t,t.uint32()).value;break;case 6:n.reportAbuseDisabled=Ce(t,t.uint32()).value;break;case 7:n.abuseReportedName=Ce(t,t.uint32()).value;break;case 8:n.abuseReportedImage=Ce(t,t.uint32()).value;break;case 9:n.hasSpotifyName=Ce(t,t.uint32()).value;break;case 10:n.hasSpotifyImage=Ce(t,t.uint32()).value;break;case 11:n.color=Ee(t,t.uint32()).value;break;default:t.skipType(7&a)}}return n},$e=function(e){var r=He({},Ge);if(r.images=[],void 0!==e.username&&null!==e.username?r.username=String(e.username):r.username=void 0,void 0!==e.name&&null!==e.name?r.name=String(e.name):r.name=void 0,void 0!==e.images&&null!==e.images){var t,i=Le(e.images);try{for(i.s();!(t=i.n()).done;){var n=t.value;r.images.push(qe(n))}}catch(e){i.e(e)}finally{i.f()}}return void 0!==e.verified&&null!==e.verified?r.verified=Boolean(e.verified):r.verified=void 0,void 0!==e.editProfileDisabled&&null!==e.editProfileDisabled?r.editProfileDisabled=Boolean(e.editProfileDisabled):r.editProfileDisabled=void 0,void 0!==e.reportAbuseDisabled&&null!==e.reportAbuseDisabled?r.reportAbuseDisabled=Boolean(e.reportAbuseDisabled):r.reportAbuseDisabled=void 0,void 0!==e.abuseReportedName&&null!==e.abuseReportedName?r.abuseReportedName=Boolean(e.abuseReportedName):r.abuseReportedName=void 0,void 0!==e.abuseReportedImage&&null!==e.abuseReportedImage?r.abuseReportedImage=Boolean(e.abuseReportedImage):r.abuseReportedImage=void 0,void 0!==e.hasSpotifyName&&null!==e.hasSpotifyName?r.hasSpotifyName=Boolean(e.hasSpotifyName):r.hasSpotifyName=void 0,void 0!==e.hasSpotifyImage&&null!==e.hasSpotifyImage?r.hasSpotifyImage=Boolean(e.hasSpotifyImage):r.hasSpotifyImage=void 0,void 0!==e.color&&null!==e.color?r.color=Number(e.color):r.color=void 0,r},Xe=function(e){var r=He({},Ge);if(r.images=[],void 0!==e.username&&null!==e.username?r.username=e.username:r.username=void 0,void 0!==e.name&&null!==e.name?r.name=e.name:r.name=void 0,void 0!==e.images&&null!==e.images){var t,i=Le(e.images);try{for(i.s();!(t=i.n()).done;){var n=t.value;r.images.push(Ke(n))}}catch(e){i.e(e)}finally{i.f()}}return void 0!==e.verified&&null!==e.verified?r.verified=e.verified:r.verified=void 0,void 0!==e.editProfileDisabled&&null!==e.editProfileDisabled?r.editProfileDisabled=e.editProfileDisabled:r.editProfileDisabled=void 0,void 0!==e.reportAbuseDisabled&&null!==e.reportAbuseDisabled?r.reportAbuseDisabled=e.reportAbuseDisabled:r.reportAbuseDisabled=void 0,void 0!==e.abuseReportedName&&null!==e.abuseReportedName?r.abuseReportedName=e.abuseReportedName:r.abuseReportedName=void 0,void 0!==e.abuseReportedImage&&null!==e.abuseReportedImage?r.abuseReportedImage=e.abuseReportedImage:r.abuseReportedImage=void 0,void 0!==e.hasSpotifyName&&null!==e.hasSpotifyName?r.hasSpotifyName=e.hasSpotifyName:r.hasSpotifyName=void 0,void 0!==e.hasSpotifyImage&&null!==e.hasSpotifyImage?r.hasSpotifyImage=e.hasSpotifyImage:r.hasSpotifyImage=void 0,void 0!==e.color&&null!==e.color?r.color=e.color:r.color=void 0,r},Je=function(e){var r={};return void 0!==e.username&&(r.username=e.username),void 0!==e.name&&(r.name=e.name),e.images?r.images=e.images.map((function(e){return e?Ze(e):void 0})):r.images=[],void 0!==e.verified&&(r.verified=e.verified),void 0!==e.editProfileDisabled&&(r.editProfileDisabled=e.editProfileDisabled),void 0!==e.reportAbuseDisabled&&(r.reportAbuseDisabled=e.reportAbuseDisabled),void 0!==e.abuseReportedName&&(r.abuseReportedName=e.abuseReportedName),void 0!==e.abuseReportedImage&&(r.abuseReportedImage=e.abuseReportedImage),void 0!==e.hasSpotifyName&&(r.hasSpotifyName=e.hasSpotifyName),void 0!==e.hasSpotifyImage&&(r.hasSpotifyImage=e.hasSpotifyImage),void 0!==e.color&&(r.color=e.color),r},er={encode:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me.Writer.create();return void 0!==e.mask&&void 0!==e.mask&&be(e.mask,r.uint32(10).fork()).ldelim(),void 0!==e.userProfile&&void 0!==e.userProfile&&Ve(e.userProfile,r.uint32(18).fork()).ldelim(),r},decode:function(e,r){for(var t=e instanceof Uint8Array?new me.Reader(e):e,i=void 0===r?t.len:t.pos+r,n=He({},We);t.pos>>3){case 1:n.mask=xe(t,t.uint32());break;case 2:n.userProfile=Ye(t,t.uint32());break;default:t.skipType(7&a)}}return n},fromJSON:function(e){var r=He({},We);return void 0!==e.mask&&null!==e.mask?r.mask=ye(e.mask):r.mask=void 0,void 0!==e.userProfile&&null!==e.userProfile?r.userProfile=$e(e.userProfile):r.userProfile=void 0,r},fromPartial:function(e){var r=He({},We);return void 0!==e.mask&&null!==e.mask?r.mask=je(e.mask):r.mask=void 0,void 0!==e.userProfile&&null!==e.userProfile?r.userProfile=Xe(e.userProfile):r.userProfile=void 0,r},toJSON:function(e){var r={};return void 0!==e.mask&&(r.mask=e.mask?ke(e.mask):void 0),void 0!==e.userProfile&&(r.userProfile=e.userProfile?Je(e.userProfile):void 0),r}},rr=t(82316),tr=t(12500),ir="".concat(rr.I_,"/identity");function nr(e,r,t){return ar.apply(this,arguments)}function ar(){return(ar=(0,G.A)(z().mark((function e(r,t,i){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.build().withHost(ir).withMethod("POST").withPath("/v3/profile-image/".concat(encodeURIComponent((0,tr.v)(t)),"/").concat(i)).withEndpointIdentifier("/v3/profile-image/{username}/{uploadToken}").withoutMarket().send();case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function or(e,r){return lr.apply(this,arguments)}function lr(){return(lr=(0,G.A)(z().mark((function e(r,t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.build().withHost(ir).withMethod("DELETE").withPath("/v3/profile-image/".concat(encodeURIComponent((0,tr.v)(t)))).withEndpointIdentifier("/v3/profile-image/{username}").withoutMarket().send();case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sr(e,r,t){return ur.apply(this,arguments)}function ur(){return(ur=(0,G.A)(z().mark((function e(r,t,i){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=er.encode(er.fromPartial({mask:{paths:["name"]},userProfile:null!==i?{name:i}:{}})),e.next=3,r.build().withHost(ir).withMethod("POST").withPath("/v3/user/username/".concat(encodeURIComponent((0,tr.v)(t)))).withEndpointIdentifier("/v3/user/username/{username}").withBody(n.finish()).withoutMarket().send();case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cr(e,r,t){return dr.apply(this,arguments)}function dr(){return(dr=(0,G.A)(z().mark((function e(r,t,i){var n,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.name,a=i.imageUploadToken,void 0===n){e.next=4;break}return e.next=4,sr(r,t,n);case 4:if(void 0===a){e.next=12;break}if(null===a){e.next=10;break}return e.next=8,nr(r,t,a);case 8:e.next=12;break;case 10:return e.next=12,or(r,t);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mr=t(75844);function pr(e,r){return fr.apply(this,arguments)}function fr(){return(fr=(0,G.A)(z().mark((function e(r,t){var i,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.name,n=t.imageUploadToken,e.next=3,cr(mr.n.getInstance(),r,{name:i,imageUploadToken:n});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gr(e){return vr.apply(this,arguments)}function vr(){return(vr=(0,G.A)(z().mark((function e(r){var t;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mr.n.getInstance().build().withEndpointIdentifier("image-upload/v4/user-profile").withHost(de).withMethod("POST").withPath("/user-profile").withBody(r).withoutGlobalHeaders().withHeaders([{key:"Content-Type",value:r.type}]).withoutMarket().send();case 2:if((t=e.sent).body){e.next=5;break}throw new Error("No upload token received");case 5:return e.abrupt("return",t.body.uploadToken);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var hr={type:"error",get message(){return u.Ru.get("user.edit-details.error.file-size-exceeded",10)}},br={type:"error",get message(){return u.Ru.get("user.edit-details.error.too-small",300,300)}},xr={type:"error",get message(){return u.Ru.get("user.edit-details.error.too-big",1e4,1e4)}},yr={type:"error",get message(){return u.Ru.get("user.edit-details.error.image-type-not-supported")}},jr={type:"error",get message(){return u.Ru.get("user.edit-details.error.missing-name")}},kr={type:"error",get message(){return u.Ru.get("user.edit-details.error.failed-to-save")}},wr={type:"error",get message(){return u.Ru.get("user.edit-details.error.file-upload-failed")}};function Ir(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function Or(e){for(var r=1;r0&&(0,g.jsx)(rt.q,{children:u.Ru.get("user.public-playlists",t)}),(0,g.jsx)(tt.J,{}),i>0&&(0,g.jsx)(it.N,{to:(0,o.Qj)((0,tr.v)(r),["followers"]).toURI(),onClick:function(e,r){if(r){var t=l.headerFactory().followersLinkFactory().hitUiNavigate({destination:r});s.logInteraction(t)}},children:u.Ru.get("user.followers",i)}),(0,g.jsx)(tt.J,{}),n>0&&(0,g.jsx)(it.N,{to:(0,o.Qj)((0,tr.v)(r),["following"]).toURI(),onClick:function(e,r){if(r){var t=l.headerFactory().followersLinkFactory().hitUiNavigate({destination:r});s.logInteraction(t)}},children:u.Ru.get("user.following",n)}),(0,g.jsx)(tt.J,{}),a&&(0,g.jsx)(rt.q,{children:u.Ru.get("user.they_follow_us")})]})}var at=t(37778),ot=t(75365),lt=t(51725),st=t(15054),ut=t(8972),ct=t(76422),dt=t(26682),mt=t(77355),pt=t(79044),ft=t(84466),gt=t(52382),vt=t(20938),ht=t(45994),bt=t(13558),xt=t(86786),yt=t(15150),jt=t(74542),kt=t(31772),wt=t(40321),It=t(71646),Ot=t(41289),Pt=t(10631),At=t(64348),Rt=t(4560),_t=t(46198),Tt=t(53607),Et=t(48133),Nt=t(12574),Ct=t(97724),St=t(13584),Ut=i.memo((function(e){var r,t=e.uri,i=e.name,n=e.duration_ms,a=e.artists,o=e.album,l=e.contextUri,s=e.isExplicit,c=e.isMOGEFRestricted,d=e.isPlayable,m=e.index,p=e.imgUrl,f=e.usePlayContextItem,v=(0,Nt.r)(ot.i,{data:{position:m,reason:"",uri:t}}).spec,h=f({uri:t,index:m}),b=h.isActive,x=h.isPlaying,y=h.triggerPlay,j=h.togglePlay,k=(0,Et.T)(t),w=(0,Pt.g)(t,{isPlayable:d,isLocal:!1,isOutOfMarket:!1,artistUris:null==a?void 0:a.map((function(e){return e.uri}))}),I=w.isPlayable,O=w.isAnyArtistBanned,P=(0,Ot.M)(a.map((function(e){return e.uri}))).unBanArtists,A=(0,Ct.b)({downloadAvailability:k,isExplicit:s,isMOGEFRestricted:c}),_=A.badges,T=A.hasBadges,E=(null==a?void 0:a.map((function(e){return e.name})).join(u.Ru.getSeparator()))||"";return(0,g.jsx)(Tt.pZ,{value:"row",index:m,children:(0,g.jsx)(R.h,{menu:(0,g.jsx)(lt.P,{uri:t,albumUri:o.uri,artists:a,contextUri:l}),children:(0,g.jsxs)(wt.w,{uri:t,contextUri:l,onTriggerPlay:function(e,r){y({loggingParams:r})},isActive:b,index:m,ariaRowIndex:m+1,isPlayable:I,isAnyArtistBanned:O,handleArtistBanUndoClick:P,ageRestricted:c,dragMetadata:{name:i,createdBy:E},spec:v,children:[(0,g.jsx)(bt.y,{ariaColIndex:0,children:(0,g.jsx)(ft.$,{uri:t,playAriaLabel:u.Ru.get("tracklist.a11y.play",i,E),isPlaying:x,isActive:b,onClick:function(e,r){j({loggingParams:r})},spec:v,children:(0,g.jsx)(vt.a,{children:m+1})})}),(0,g.jsxs)(xt.U,{ariaColIndex:1,children:[(0,g.jsx)(mt.e,{src:p}),(0,g.jsxs)(pt.l,{children:[(0,g.jsx)(kt.p,{titleText:i,children:i}),T&&(0,g.jsxs)(ct.P,{children:[_.download&&(0,g.jsx)(Rt._,{}),_.explicit&&(0,g.jsx)(At.U,{}),_.nineteen&&(0,g.jsx)(_t.q,{className:St.A.nineteen,size:16})]}),(0,g.jsx)(jt.p,{children:(0,g.jsx)(ut.l,{artists:a,spec:v})})]})]}),(0,g.jsx)(yt.o,{ariaColIndex:2,children:(0,g.jsx)(st.g,{uri:o.uri,name:o.name,creatorUri:null==a||null===(r=a[0])||void 0===r?void 0:r.uri,spec:v,children:o.name})}),(0,g.jsxs)(ht.l,{ariaColIndex:3,children:[(0,g.jsx)(It.d,{uri:t,spec:v}),(0,g.jsx)(dt.P,{duration:n}),(0,g.jsx)(gt.Y,{menu:(0,g.jsx)(lt.P,{uri:t,albumUri:o.uri,artists:a,contextUri:l}),label:u.Ru.get("more.label.track",i,E),spec:v})]})]})})})}),(function(e,r){return e.uri===r.uri})),Dt=t(87198),Lt=t(93195),Mt=t(70129),Bt=t(79431),Ht=t(4140),Ft=t(16920),Gt=t(18809),Wt=i.memo((function(e){var r=e.tracks,t=e.hasHeaderRow,n=void 0!==t&&t,a=e.nrTracksVisible,l=e.uri,s=(0,tr.v)(l),c=(0,o.du)(s,"tracks").toURI(),d=(0,i.useMemo)((function(){return a?r.slice(0,a):r}),[a,r]),m=(0,Bt.P)({uri:c,pages:[{items:r.map((function(e){return{type:Ft.c.TRACK,uri:e.uri,uid:null,provider:null}}))}]},{featureIdentifier:"profile",referrerIdentifier:"user_profile"}).usePlayContextItem,p=(0,i.useCallback)((function(e,r){var t,i,n,a=(0,Gt.g)(null==e||null===(t=e.albumOfTrack)||void 0===t||null===(t=t.coverArt)||void 0===t?void 0:t.sources,{desiredSize:40});return(0,g.jsx)(Ut,{index:r,uri:(0,Mt.a)(e),duration_ms:e.duration.totalMilliseconds,name:e.name,artists:e.artists.items.map((function(e){return{uri:e.uri,name:e.profile.name}})),album:e.albumOfTrack,isPlayable:!0,isExplicit:(null===(i=e.contentRating)||void 0===i?void 0:i.label)===Ht.x7.Explicit,isMOGEFRestricted:(null===(n=e.contentRating)||void 0===n?void 0:n.label)===Ht.x7.NineteenPlus,imgUrl:(null==a?void 0:a.url)||"",contextUri:c,usePlayContextItem:m},r+e.uri)}),[c,m]),f=(0,i.useMemo)((function(){return[Lt.$.INDEX,Lt.$.TITLE_AND_ARTIST,Lt.$.ALBUM,Lt.$.DURATION]}),[]),v=(0,i.useCallback)((function(e){return{uri:e.uri}}),[]);return(0,g.jsx)(Tt.pZ,{value:"user-top-tracks-tracklist",children:(0,g.jsx)(Dt.S4,{ariaLabel:u.Ru.get("top_tracks_this_month"),renderRow:p,nrTracks:d.length,tracks:d,resolveItem:v,headerTop:0,hasHeaderRow:n,columns:f,columnPersistenceKey:"user-top-tracks-tracklist"})})}),(function(e,r){return e.tracks===r.tracks})),zt=t(76026),Qt=t(70566),qt=i.memo((function(e){var r=e.tracks,t=e.title,n=e.subtitle,a=e.seeAllUri,o=e.className,l=e.uri,s=e.spec,u=(0,Qt.s)(),c=(0,i.useCallback)((function(){var e=s.titleLinkFactory().hitUiNavigate({destination:a});u.logInteraction(e)}),[u,a,s]),d=(0,i.useCallback)((function(){var e=s.titleLinkFactory().hitUiNavigate({destination:a});u.logInteraction(e)}),[u,a,s]);if(!r||0===r.totalCount||0===r.items.length)return null;var m=r.totalCount>4;return(0,g.jsxs)("section",{className:o,children:[(0,g.jsx)(at.k,{title:t,subtitle:n,seeAllUri:a,hasMoreElements:m,onClickTitle:c,onClickSeeAll:d}),(0,g.jsx)(zt.r,{spec:s,children:(0,g.jsx)(Wt,{tracks:r.items,uri:l,nrTracksVisible:4})})]})}),(function(e,r){return e.tracks===r.tracks}));function Kt(e,r){switch(r.type){case"OPEN_MODAL":return{isModalOpen:!0,modalVariant:"editProfile",shouldOpenImagePicker:!1};case"OPEN_MODAL_WITH_IMAGEPICKER":return{isModalOpen:!0,modalVariant:"editProfile",shouldOpenImagePicker:!0};case"CLOSE_MODAL":return{isModalOpen:!1,modalVariant:null,shouldOpenImagePicker:!1};default:return e}}var Zt=t(86295),Vt=t(87718),Yt=new Zt.l("userTopContent","query","feb6d55177e2cbce2ac59214f9493f1ef2e4368eec01b3d4c3468fa1b97336e2",null);function $t(e){return"Artist"===e.__typename}function Xt(e){var r;if("ArtistPageV2"!==(null==e||null===(r=e.topArtists)||void 0===r?void 0:r.__typename))return null;var t=e.topArtists.items.map((function(e){return e.data})).filter($t);return 0===t.length?null:{totalCount:e.topArtists.totalCount,items:t}}function Jt(e){return"Track"===e.__typename}function ei(e){var r;if("TrackPageV2"!==(null==e||null===(r=e.topTracks)||void 0===r?void 0:r.__typename))return null;var t=e.topTracks.items.map((function(e){return e.data})).filter(Jt).filter((function(e){return null!==e.albumOfTrack}));return 0===t.length?null:{totalCount:e.topTracks.totalCount,items:t}}var ri=Ht.xE.Affinity,ti=Ht.Nm.ShortTerm;function ii(e){var r,t,i,n,a,o,l=e.includeTopArtists,s=e.includeTopTracks,u=e.topArtistsLimit,c=e.topTracksLimit,d=(a={includeTopArtists:l,topArtistsInput:{offset:0,limit:u,sortBy:ri,timeRange:ti},includeTopTracks:s,topTracksInput:{offset:0,limit:c,sortBy:ri,timeRange:ti}},o={enabled:l||s,gcTime:18e5,staleTime:3e5},(0,Vt.I)(Yt,a,o)),m=d.data,p=d.loading;return null!==d.error?{topTracks:null,topArtists:null,loading:p,error:new Error("Failed loading user top content!")}:{topTracks:ei(null!==(r=null==m||null===(t=m.me)||void 0===t?void 0:t.profile)&&void 0!==r?r:null),topArtists:Xt(null!==(i=null==m||null===(n=m.me)||void 0===n?void 0:n.profile)&&void 0!==i?i:null),loading:p,error:null}}var ni=t(86429),ai=t(72346),oi=t(41481),li=t(87999),si=t(58114),ui=t(65249),ci=t(47305),di=t(44551),mi=t(27483),pi=t(25509);const fi="J6PX6RfvHlA4BPp7_8sJ",gi="DJCugGBTcU3io4Q28BHl",vi="vpTiIBeCfuGKOTj3Tzg6",hi="eGAuBpyB1eqsyPKbaQU7",bi="GoG_UTK1uLaPCfhipeF0";var xi=18e5,yi=3e5,ji=(0,w.Mz)(ui.mB,(function(e){return(null==e?void 0:e.images)||[]})),ki=function(e){var r,t,n,a=e.uri,l=e.isCurrentUser,s=null===(r=(0,k.d4)(ui.mB))||void 0===r?void 0:r.uri,m=(0,k.d4)(ui.Mn),v=(0,k.d4)(ji),b=(0,k.wA)(),x=(0,j.jE)(),y=(0,I.NC)(si.DGB,{loadingValue:!0}),w=(0,i.useMemo)((function(){return(0,Gt.g)(v)}),[v]),G=(t=(0,i.useReducer)(Kt,{isModalOpen:!1,modalVariant:null,shouldOpenImagePicker:!1}),[(n=(0,h.A)(t,2))[0],n[1]]),W=(0,h.A)(G,2),z=W[0],Q=z.isModalOpen,q=z.modalVariant,K=z.shouldOpenImagePicker,Z=W[1],V=(0,f.Z)(p.E$,[{uri:a,playlists:10,artists:10,episodes:10}],{gcTime:xi,staleTime:yi}),Y=V.data,$=V.loading,X=V.queryKey,J=(0,ni.V)();(0,li.N)(oi.mc.OPERATION_COMPLETE,(function(){x.invalidateQueries({queryKey:X})})),(0,mi.l)(di.UV.OPERATION_COMPLETE,(function(){x.invalidateQueries({queryKey:X})}));var ee=null==Y?void 0:Y.public_playlists,re=null==Y?void 0:Y.is_verified,te=null==Y?void 0:Y.recently_played_artists,ie=l?(null==w?void 0:w.url)||"":(null==Y?void 0:Y.image_url)||"",ne=(0,tr.v)(a),ae=(l?m:null==Y?void 0:Y.name)||"",oe=(0,ai.H)((null==Y?void 0:Y.image_url)||null),le=(0,Nt.r)(O._,{data:{uri:a}}),se=le.spec,ue=le.logger,ce=(0,i.useMemo)((function(){return se.sectionTopTracksFactory()}),[se]),de=!J&&(!1!==(null==Y?void 0:Y.show_follows)||l),me=l&&y,pe=(0,f.Z)(p.mH,[a],{enabled:de,gcTime:xi,staleTime:yi}),fe=pe.data,ge=pe.loading,ve=null==fe?void 0:fe.profiles,he=(0,f.Z)(p.SR,[a],{enabled:de,gcTime:xi,staleTime:yi}),be=he.data,xe=he.loading,ye=null==be?void 0:be.profiles,je=null==ve?void 0:ve.some((function(e){return e.uri===s})),ke=ii({includeTopArtists:me,includeTopTracks:me,topArtistsLimit:10,topTracksLimit:4}),we=ke.topArtists,Ie=ke.topTracks,Oe=ke.loading,Pe=(0,i.useCallback)((function(e){Z({type:"CLOSE_MODAL"}),e&&(b((0,ci.IE)(e.name)),b((0,ci.ZQ)(e.image?[{url:e.image,height:null,width:null}]:[])))}),[Z,b]),Ae=(0,i.useCallback)((function(){Z({type:"OPEN_MODAL"});var e=se.headerFactory().usernameFactory().hitUiReveal();ue.logInteraction(e)}),[ue,Z,se]),Re=(0,i.useCallback)((function(){Z({type:"OPEN_MODAL_WITH_IMAGEPICKER"});var e=se.headerFactory().profileImageFactory().hitUiReveal();ue.logInteraction(e)}),[ue,Z,se]),_e=(0,i.useMemo)((function(){return[{url:ie}]}),[ie]);if(!Y||$||ge||xe||Oe)return(0,g.jsx)(d.LoadingPage,{hasError:!1,errorMessage:u.Ru.get("error.not_found.title.page")});var Te=de&&!(null==ye||!ye.length),Ee=de&&!(null==ve||!ve.length),Ne=(0,g.jsx)(_.B,{uri:Y.uri});return(0,g.jsxs)("div",{className:fi,children:[(0,g.jsx)(T.Q,{children:ae}),(0,g.jsxs)(N.z,{backgroundColor:oe,children:[(0,g.jsx)(U.h,{children:(0,g.jsx)(R.h,{menu:Ne,children:(0,g.jsx)(D.X,{text:ae})})}),(0,g.jsx)(R.h,{menu:Ne,children:(0,g.jsx)(C.X,{children:(0,g.jsx)(E.M,{canEdit:l&&!Y.edit_image_disabled,name:ae,images:_e,onClick:Re,placeholderType:"user",shape:L.u.CIRCLE})})}),(0,g.jsxs)(S.Y,{children:[(0,g.jsx)(M.B,{children:re?(0,g.jsx)(H.M,{text:u.Ru.get("card.tag.profile")}):u.Ru.get("card.tag.profile")}),(0,g.jsx)(R.h,{menu:Ne,children:(0,g.jsx)(B.mm,{canEdit:l&&!Y.edit_name_disabled,editTitle:u.Ru.get("playlist.edit-details.title"),onClick:Ae,children:ae})}),(0,g.jsx)(nt,{userUri:a,totalPublicPlaylistsCount:Y.total_public_playlists_count,followersCount:Y.followers_count,followingCount:Y.following_count,theyFollowUs:!!je,spec:se,logger:ue})]})]}),(0,g.jsx)(Jr,{openModal:Ae,spec:se,logger:ue,name:ae,backgroundColor:oe,isCurrentUser:l,uri:a}),(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsxs)(zt.r,{spec:se,children:[l&&(0,g.jsxs)(g.Fragment,{children:[null!==we&&(0,g.jsx)(F.p,{className:gi,total:we.totalCount,title:u.Ru.get("top_artists_this_month"),subtitle:u.Ru.get("only_visible_to_you"),seeAllUri:(0,o.Qj)(ne,["top","artists"]).toURI(),id:"top-artists",index:0,children:we.items.map((function(e,r){var t,i;return(0,g.jsx)(P.a,{index:r,uri:e.uri,name:e.profile.name,images:null!==(t=null===(i=e.visuals.avatarImage)||void 0===i?void 0:i.sources)&&void 0!==t?t:[]},e.uri)}))}),(0,g.jsx)(qt,{className:gi,title:u.Ru.get("top_tracks_this_month"),subtitle:u.Ru.get("only_visible_to_you"),seeAllUri:(0,o.Qj)(ne,["top","tracks"]).toURI(),uri:a,tracks:Ie,spec:ce})]}),(0,g.jsx)(F.p,{className:gi,total:Y.total_public_playlists_count,title:u.Ru.get("public_playlists"),seeAllUri:(0,o.Qj)(ne,["playlists"]).toURI(),id:"playlists",index:1,children:null==ee?void 0:ee.map((function(e,r){return(0,g.jsx)(A.B,{index:r,uri:e.uri,name:e.name,images:[{url:(0,pi.m)({imageUriOrUrl:e.image_url}),width:300,height:300}],authorName:e.owner_name,description:e.followers_count?u.Ru.get("user.followers",e.followers_count):""},e.uri)}))}),null!=te&&te.length?(0,g.jsx)(F.p,{className:gi,total:null==te?void 0:te.length,title:u.Ru.get("recently_played_artists"),seeAllUri:(0,o.Qj)(ne,["recently-played-artists"]).toURI(),id:"recently-played-artists",index:2,children:null==te?void 0:te.map((function(e,r){return(0,g.jsx)(P.a,{index:r,uri:e.uri,name:e.name,images:[{url:e.image_url}]},e.uri)}))}):null,Te?(0,g.jsx)(F.p,{className:gi,title:u.Ru.get("followers"),total:null==ye?void 0:ye.length,seeAllUri:(0,o.Qj)(ne,["followers"]).toURI(),id:"followers",index:3,children:null==ye?void 0:ye.map((function(e,r){return(0,g.jsx)(c.a,{index:r,uri:e.uri,name:e.name,images:[{url:e.image_url}]},e.uri)}))}):null,Ee?(0,g.jsx)(F.p,{className:gi,title:u.Ru.get("following"),total:null==ve?void 0:ve.length,seeAllUri:(0,o.Qj)(ne,["following"]).toURI(),id:"following",index:4,children:null==ve?void 0:ve.map((function(e,r){return(0,g.jsx)(c.a,{index:r,uri:e.uri,name:e.name,images:[{url:e.image_url}]},e.uri)}))}):null,l&&Q&&("editProfile"===q?(0,g.jsx)(Gr,{uri:a,name:ae,image:ie,onClose:Pe,shouldOpenImagePicker:K,userCapabilities:{edit_image:!(null!=Y&&Y.edit_image_disabled),edit_name:!(null!=Y&&Y.edit_name_disabled)}}):null)]})})]})},wi=function(e){var r=e.uri,t=(0,f.Z)(p.Eo,[{uri:r}]),i=t.data,n=t.loading,a=t.error,o=i||{},l=o.public_playlists,c=o.total_public_playlists_count,v=void 0===c?0:c;return n?(0,g.jsx)(d.LoadingPage,{hasError:null!==a,errorMessage:u.Ru.get("error.not_found.title.page")}):(0,g.jsx)(m.$,{total:v,title:u.Ru.get("public_playlists"),showAll:!0,fullPage:!0,rowGap:s.lT,children:null==l?void 0:l.map((function(e,r){return(0,g.jsx)(A.B,{index:r,uri:e.uri,name:e.name,authorName:e.owner_name,description:e.followers_count?u.Ru.get("user.followers",e.followers_count):"",images:[{url:(0,pi.m)({imageUriOrUrl:e.image_url}),width:300,height:300}]},e.uri)}))})},Ii=function(e){var r=e.uri,t=(0,f.Z)(p.sL,[{uri:r,limit:50}]),i=t.data,n=t.loading,a=t.error,o=null==i?void 0:i.artists;return n?(0,g.jsx)(d.LoadingPage,{hasError:null!==a,errorMessage:u.Ru.get("error.not_found.title.page")}):(0,g.jsx)(m.$,{total:null==o?void 0:o.length,title:u.Ru.get("recently_played_artists"),showAll:!0,fullPage:!0,rowGap:s.lT,children:null==o?void 0:o.map((function(e,r){return(0,g.jsx)(P.a,{index:r,name:e.name,uri:e.uri,images:[{url:e.image_url}]},e.uri)}))})},Oi=function(){var e=ii({includeTopArtists:!0,includeTopTracks:!1,topArtistsLimit:100,topTracksLimit:0}),r=e.topArtists,t=e.loading,i=e.error;return t?(0,g.jsx)(d.LoadingPage,{hasError:null!==i,errorMessage:u.Ru.get("error.not_found.title.page")}):null===r?null:(0,g.jsx)(m.$,{total:r.items.length,title:u.Ru.get("top_artists_this_month"),subtitle:u.Ru.get("only_visible_to_you"),showAll:!0,fullPage:!0,rowGap:s.lT,children:r.items.map((function(e,r){var t,i;return(0,g.jsx)(P.a,{index:r,uri:e.uri,name:e.profile.name,images:null!==(t=null===(i=e.visuals.avatarImage)||void 0===i?void 0:i.sources)&&void 0!==t?t:[]},e.uri)}))})},Pi=function(e){return e.isCurrentUser?(0,g.jsx)(Oi,{}):(0,g.jsx)(d.LoadingPage,{hasError:!0,errorMessage:u.Ru.get("error.not_found.title.page")})},Ai=function(e){var r=e.uri,t=ii({includeTopArtists:!1,includeTopTracks:!0,topArtistsLimit:0,topTracksLimit:100}),i=t.topTracks,n=t.loading,a=t.error;return n?(0,g.jsx)(d.LoadingPage,{hasError:null!==a,errorMessage:u.Ru.get("error.not_found.title.page")}):null===i?null:(0,g.jsxs)("div",{className:q()("contentSpacing",vi),children:[(0,g.jsxs)("div",{className:hi,children:[(0,g.jsx)(K.E,{as:"h1",variant:"titleMedium",className:bi,children:u.Ru.get("top_tracks_this_month")}),(0,g.jsx)(K.E,{as:"p",variant:"bodySmall",children:u.Ru.get("only_visible_to_you")})]}),(0,g.jsx)(Wt,{tracks:i.items,uri:r,hasHeaderRow:!0})]})},Ri=function(e){var r=e.uri;return e.isCurrentUser?(0,g.jsx)(Ai,{uri:r}):(0,g.jsx)(d.LoadingPage,{hasError:!0,errorMessage:u.Ru.get("error.not_found.title.page")})},_i=t(11327);const Ti="cubl27eU3uN3hmAiqdmQ";const Ei=(0,i.memo)((function(){var e=(0,n.g)().userId,r=decodeURIComponent(void 0===e?"":e),t=(0,o.Qj)(r).toURI(),i=function(e){var r,t=(0,ni.V)(),i=null===(r=(0,_i.C)())||void 0===r?void 0:r.username;return!t&&i===e}(r);return(0,g.jsx)("section",{className:Ti,children:(0,g.jsxs)(n.BV,{children:[(0,g.jsx)(n.qh,{path:"playlists",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE_PLAYLISTS,children:(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsx)(wi,{uri:t})})})}),(0,g.jsx)(n.qh,{path:"top/tracks",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE_TOP_TRACKS,children:(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsx)(Ri,{uri:t,isCurrentUser:i})})})}),(0,g.jsx)(n.qh,{path:"top/artists",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE_TOP_ARTISTS,children:(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsx)(Pi,{isCurrentUser:i})})})}),(0,g.jsx)(n.qh,{path:"recently-played-artists",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE_RECENTLY_PLAYED_ARTISTS,children:(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsx)(Ii,{uri:t})})})}),(0,g.jsx)(n.qh,{path:"following",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE_FOLLOWING,children:(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsx)(y,{uri:t})})})}),(0,g.jsx)(n.qh,{path:"followers",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE_FOLLOWERS,children:(0,g.jsx)("div",{className:"contentSpacing",children:(0,g.jsx)(v,{uri:t})})})}),(0,g.jsx)(n.qh,{path:"/",element:(0,g.jsx)(l.e,{pageId:a.$h.PROFILE,children:(0,g.jsx)(ki,{uri:t,isCurrentUser:i})})})]})})}))},11327:(e,r,t)=>{t.d(r,{C:()=>a});t(25550),t(15342);var i=t(88677),n=t(16920),a=function(){var e,r=(0,i.d4)((function(e){var r;return null===(r=e.session)||void 0===r?void 0:r.user}));return r?{type:n.c.USER,uri:r.uri,username:r.id,displayName:null!==(e=r.display_name)&&void 0!==e?e:null,images:r.images.map((function(e){return{url:e.url,width:e.width||void 0,height:e.height||void 0}}))}:null}},72346:(e,r,t)=>{t.d(r,{H:()=>l});var i=t(30758),n=t(23100),a=t(19424),o=t(55137);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.l0o,t=(0,a.oI)().backgroundColor,l=(0,a.as)(),s=(0,o.z)(e);return(0,i.useEffect)((function(){return l((0,a.Mo)(s)),function(){l((0,a.Hf)())}}),[s,l]),t||r}},70129:(e,r,t)=>{t.d(r,{a:()=>i});var i=function(e){var r;return(null==e||null===(r=e.linked_from)||void 0===r?void 0:r.uri)||e.uri}},18886:(e,r,t)=>{t.d(r,{b:()=>o,g:()=>a});var i=t(12341),n=t(30758),a=function(e){return e[e.loading=0]="loading",e[e.loaded=1]="loaded",e[e.error=2]="error",e}({});function o(e,r){var t=e?a.loading:a.error,o=(0,n.useState)(t),l=(0,i.A)(o,2),s=l[0],u=l[1];return(0,n.useEffect)((function(){var t=function(){u(a.loaded)},i=function(){u(a.error)};if(!e)return u(a.error),function(){};u(a.loading);var n=document.createElement("img");return n.addEventListener("load",t),n.addEventListener("error",i),n.setAttribute("src",e),r&&n.setAttribute("srcSet",r),function(){n.removeEventListener("load",t),n.removeEventListener("error",i)}}),[e,r]),s}},55137:(e,r,t)=>{t.d(r,{r:()=>c,z:()=>d});var i=t(12341),n=t(30758),a=t(23100),o=t(54552),l=t(57165),s=t(75355),u=t(28925);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=(0,n.useContext)(s.j).request,t=(0,u.I)({queryKey:["extracted-color",e],queryFn:function(){return e?(0,l.j)(r,e).then((function(e){var r=(0,i.A)(e,1)[0],t=r.colorDark,n=r.colorLight,a=r.colorRaw;return{colorDark:t.toCSS(o.a.HEX),colorLight:n.toCSS(o.a.HEX),colorRaw:a.toCSS(o.a.HEX)}})):null},gcTime:864e5,staleTime:216e5,enabled:!!e}).data;return null!=t?t:void 0}function d(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.l0o,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"colorRaw";return null!==(e=null===(r=c(t))||void 0===r?void 0:r[n])&&void 0!==e?e:i}}}]); //# sourceMappingURL=xpui-routes-profile.js.map