-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path258.js
1 lines (1 loc) · 14.9 KB
/
258.js
1
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[258],{68055:(o,i,l)=>{l.d(i,{rn:()=>P,SR:()=>h,mH:()=>g,zP:()=>N,Eo:()=>v,E$:()=>y,sL:()=>S,kp:()=>J,gN:()=>E,kV:()=>O});var e=l(60744),s=l(44816);const t={fromJSON:o=>({uri:w(o.uri)?String(o.uri):"",name:w(o.name)?String(o.name):"",image_url:w(o.image_url)?String(o.image_url):"",followers_count:w(o.followers_count)?Number(o.followers_count):0,following_count:w(o.following_count)?Number(o.following_count):0,is_following:!!w(o.is_following)&&Boolean(o.is_following),recently_played_artists:Array.isArray(o?.recently_played_artists)?o.recently_played_artists.map((o=>n.fromJSON(o))):[],public_playlists:Array.isArray(o?.public_playlists)?o.public_playlists.map((o=>d.fromJSON(o))):[],total_public_playlists_count:w(o.total_public_playlists_count)?Number(o.total_public_playlists_count):0,is_current_user:!!w(o.is_current_user)&&Boolean(o.is_current_user),is_verified:!!w(o.is_verified)&&Boolean(o.is_verified),edit_profile_disabled:!!w(o.edit_profile_disabled)&&Boolean(o.edit_profile_disabled),report_abuse_disabled:!!w(o.report_abuse_disabled)&&Boolean(o.report_abuse_disabled),has_spotify_name:!!w(o.has_spotify_name)&&Boolean(o.has_spotify_name),has_spotify_image:!!w(o.has_spotify_image)&&Boolean(o.has_spotify_image),color:w(o.color)?Number(o.color):0,is_dismissed:!!w(o.is_dismissed)&&Boolean(o.is_dismissed),allow_follows:!!w(o.allow_follows)&&Boolean(o.allow_follows),show_follows:!!w(o.show_follows)&&Boolean(o.show_follows),pronouns:w(o.pronouns)?String(o.pronouns):"",location:w(o.location)?String(o.location):"",bio:w(o.bio)?String(o.bio):"",blends:Array.isArray(o?.blends)?o.blends.map((o=>d.fromJSON(o))):[],top_artists:w(o.top_artists)?r.fromJSON(o.top_artists):void 0,edit_name_disabled:!!w(o.edit_name_disabled)&&Boolean(o.edit_name_disabled),edit_image_disabled:!!w(o.edit_image_disabled)&&Boolean(o.edit_image_disabled),edit_bio_disabled:!!w(o.edit_bio_disabled)&&Boolean(o.edit_bio_disabled)}),toJSON(o){const i={};return void 0!==o.uri&&(i.uri=o.uri),void 0!==o.name&&(i.name=o.name),void 0!==o.image_url&&(i.image_url=o.image_url),void 0!==o.followers_count&&(i.followers_count=Math.round(o.followers_count)),void 0!==o.following_count&&(i.following_count=Math.round(o.following_count)),void 0!==o.is_following&&(i.is_following=o.is_following),o.recently_played_artists?i.recently_played_artists=o.recently_played_artists.map((o=>o?n.toJSON(o):void 0)):i.recently_played_artists=[],o.public_playlists?i.public_playlists=o.public_playlists.map((o=>o?d.toJSON(o):void 0)):i.public_playlists=[],void 0!==o.total_public_playlists_count&&(i.total_public_playlists_count=Math.round(o.total_public_playlists_count)),void 0!==o.is_current_user&&(i.is_current_user=o.is_current_user),void 0!==o.is_verified&&(i.is_verified=o.is_verified),void 0!==o.edit_profile_disabled&&(i.edit_profile_disabled=o.edit_profile_disabled),void 0!==o.report_abuse_disabled&&(i.report_abuse_disabled=o.report_abuse_disabled),void 0!==o.has_spotify_name&&(i.has_spotify_name=o.has_spotify_name),void 0!==o.has_spotify_image&&(i.has_spotify_image=o.has_spotify_image),void 0!==o.color&&(i.color=Math.round(o.color)),void 0!==o.is_dismissed&&(i.is_dismissed=o.is_dismissed),void 0!==o.allow_follows&&(i.allow_follows=o.allow_follows),void 0!==o.show_follows&&(i.show_follows=o.show_follows),void 0!==o.pronouns&&(i.pronouns=o.pronouns),void 0!==o.location&&(i.location=o.location),void 0!==o.bio&&(i.bio=o.bio),o.blends?i.blends=o.blends.map((o=>o?d.toJSON(o):void 0)):i.blends=[],void 0!==o.top_artists&&(i.top_artists=o.top_artists?r.toJSON(o.top_artists):void 0),void 0!==o.edit_name_disabled&&(i.edit_name_disabled=o.edit_name_disabled),void 0!==o.edit_image_disabled&&(i.edit_image_disabled=o.edit_image_disabled),void 0!==o.edit_bio_disabled&&(i.edit_bio_disabled=o.edit_bio_disabled),i},create:o=>t.fromPartial(o??{}),fromPartial(o){const i={uri:"",name:"",image_url:"",followers_count:0,following_count:0,is_following:!1,recently_played_artists:[],public_playlists:[],total_public_playlists_count:0,is_current_user:!1,is_verified:!1,edit_profile_disabled:!1,report_abuse_disabled:!1,has_spotify_name:!1,has_spotify_image:!1,color:0,is_dismissed:!1,allow_follows:!1,show_follows:!1,pronouns:"",location:"",bio:"",blends:[],top_artists:void 0,edit_name_disabled:!1,edit_image_disabled:!1,edit_bio_disabled:!1};return i.uri=o.uri??"",i.name=o.name??"",i.image_url=o.image_url??"",i.followers_count=o.followers_count??0,i.following_count=o.following_count??0,i.is_following=o.is_following??!1,i.recently_played_artists=o.recently_played_artists?.map((o=>n.fromPartial(o)))||[],i.public_playlists=o.public_playlists?.map((o=>d.fromPartial(o)))||[],i.total_public_playlists_count=o.total_public_playlists_count??0,i.is_current_user=o.is_current_user??!1,i.is_verified=o.is_verified??!1,i.edit_profile_disabled=o.edit_profile_disabled??!1,i.report_abuse_disabled=o.report_abuse_disabled??!1,i.has_spotify_name=o.has_spotify_name??!1,i.has_spotify_image=o.has_spotify_image??!1,i.color=o.color??0,i.is_dismissed=o.is_dismissed??!1,i.allow_follows=o.allow_follows??!1,i.show_follows=o.show_follows??!1,i.pronouns=o.pronouns??"",i.location=o.location??"",i.bio=o.bio??"",i.blends=o.blends?.map((o=>d.fromPartial(o)))||[],i.top_artists=void 0!==o.top_artists&&null!==o.top_artists?r.fromPartial(o.top_artists):void 0,i.edit_name_disabled=o.edit_name_disabled??!1,i.edit_image_disabled=o.edit_image_disabled??!1,i.edit_bio_disabled=o.edit_bio_disabled??!1,i}};const r={fromJSON:o=>({title:w(o.title)?String(o.title):"",subtitle:w(o.subtitle)?String(o.subtitle):"",image_url:w(o.image_url)?String(o.image_url):"",top_artists_page_uri:w(o.top_artists_page_uri)?String(o.top_artists_page_uri):""}),toJSON(o){const i={};return void 0!==o.title&&(i.title=o.title),void 0!==o.subtitle&&(i.subtitle=o.subtitle),void 0!==o.image_url&&(i.image_url=o.image_url),void 0!==o.top_artists_page_uri&&(i.top_artists_page_uri=o.top_artists_page_uri),i},create:o=>r.fromPartial(o??{}),fromPartial(o){const i={title:"",subtitle:"",image_url:"",top_artists_page_uri:""};return i.title=o.title??"",i.subtitle=o.subtitle??"",i.image_url=o.image_url??"",i.top_artists_page_uri=o.top_artists_page_uri??"",i}};const a={fromJSON:o=>({artists:Array.isArray(o?.artists)?o.artists.map((o=>n.fromJSON(o))):[]}),toJSON(o){const i={};return o.artists?i.artists=o.artists.map((o=>o?n.toJSON(o):void 0)):i.artists=[],i},create:o=>a.fromPartial(o??{}),fromPartial(o){const i={artists:[]};return i.artists=o.artists?.map((o=>n.fromPartial(o)))||[],i}};const n={fromJSON:o=>({uri:w(o.uri)?String(o.uri):"",name:w(o.name)?String(o.name):"",image_url:w(o.image_url)?String(o.image_url):"",followers_count:w(o.followers_count)?Number(o.followers_count):0,is_following:!!w(o.is_following)&&Boolean(o.is_following)}),toJSON(o){const i={};return void 0!==o.uri&&(i.uri=o.uri),void 0!==o.name&&(i.name=o.name),void 0!==o.image_url&&(i.image_url=o.image_url),void 0!==o.followers_count&&(i.followers_count=Math.round(o.followers_count)),void 0!==o.is_following&&(i.is_following=o.is_following),i},create:o=>n.fromPartial(o??{}),fromPartial(o){const i={uri:"",name:"",image_url:"",followers_count:0,is_following:!1};return i.uri=o.uri??"",i.name=o.name??"",i.image_url=o.image_url??"",i.followers_count=o.followers_count??0,i.is_following=o.is_following??!1,i}};const _={fromJSON:o=>({public_playlists:Array.isArray(o?.public_playlists)?o.public_playlists.map((o=>d.fromJSON(o))):[],total_public_playlists_count:w(o.total_public_playlists_count)?Number(o.total_public_playlists_count):0}),toJSON(o){const i={};return o.public_playlists?i.public_playlists=o.public_playlists.map((o=>o?d.toJSON(o):void 0)):i.public_playlists=[],void 0!==o.total_public_playlists_count&&(i.total_public_playlists_count=Math.round(o.total_public_playlists_count)),i},create:o=>_.fromPartial(o??{}),fromPartial(o){const i={public_playlists:[],total_public_playlists_count:0};return i.public_playlists=o.public_playlists?.map((o=>d.fromPartial(o)))||[],i.total_public_playlists_count=o.total_public_playlists_count??0,i}};const d={fromJSON:o=>({uri:w(o.uri)?String(o.uri):"",name:w(o.name)?String(o.name):"",image_url:w(o.image_url)?String(o.image_url):"",followers_count:w(o.followers_count)?Number(o.followers_count):0,owner_name:w(o.owner_name)?String(o.owner_name):"",owner_uri:w(o.owner_uri)?String(o.owner_uri):"",is_following:!!w(o.is_following)&&Boolean(o.is_following)}),toJSON(o){const i={};return void 0!==o.uri&&(i.uri=o.uri),void 0!==o.name&&(i.name=o.name),void 0!==o.image_url&&(i.image_url=o.image_url),void 0!==o.followers_count&&(i.followers_count=Math.round(o.followers_count)),void 0!==o.owner_name&&(i.owner_name=o.owner_name),void 0!==o.owner_uri&&(i.owner_uri=o.owner_uri),void 0!==o.is_following&&(i.is_following=o.is_following),i},create:o=>d.fromPartial(o??{}),fromPartial(o){const i={uri:"",name:"",image_url:"",followers_count:0,owner_name:"",owner_uri:"",is_following:!1};return i.uri=o.uri??"",i.name=o.name??"",i.image_url=o.image_url??"",i.followers_count=o.followers_count??0,i.owner_name=o.owner_name??"",i.owner_uri=o.owner_uri??"",i.is_following=o.is_following??!1,i}};const u={fromJSON:o=>({profiles:Array.isArray(o?.profiles)?o.profiles.map((o=>f.fromJSON(o))):[]}),toJSON(o){const i={};return o.profiles?i.profiles=o.profiles.map((o=>o?f.toJSON(o):void 0)):i.profiles=[],i},create:o=>u.fromPartial(o??{}),fromPartial(o){const i={profiles:[]};return i.profiles=o.profiles?.map((o=>f.fromPartial(o)))||[],i}};const f={fromJSON:o=>({uri:w(o.uri)?String(o.uri):"",name:w(o.name)?String(o.name):"",image_url:w(o.image_url)?String(o.image_url):"",followers_count:w(o.followers_count)?Number(o.followers_count):0,following_count:w(o.following_count)?Number(o.following_count):0,is_followed:!!w(o.is_followed)&&Boolean(o.is_followed),is_following:!!w(o.is_following)&&Boolean(o.is_following),is_dismissed:!!w(o.is_dismissed)&&Boolean(o.is_dismissed),is_verified:!!w(o.is_verified)&&Boolean(o.is_verified),color:w(o.color)?Number(o.color):0,allow_follows:!!w(o.allow_follows)&&Boolean(o.allow_follows)}),toJSON(o){const i={};return void 0!==o.uri&&(i.uri=o.uri),void 0!==o.name&&(i.name=o.name),void 0!==o.image_url&&(i.image_url=o.image_url),void 0!==o.followers_count&&(i.followers_count=Math.round(o.followers_count)),void 0!==o.following_count&&(i.following_count=Math.round(o.following_count)),void 0!==o.is_followed&&(i.is_followed=o.is_followed),void 0!==o.is_following&&(i.is_following=o.is_following),void 0!==o.is_dismissed&&(i.is_dismissed=o.is_dismissed),void 0!==o.is_verified&&(i.is_verified=o.is_verified),void 0!==o.color&&(i.color=Math.round(o.color)),void 0!==o.allow_follows&&(i.allow_follows=o.allow_follows),i},create:o=>f.fromPartial(o??{}),fromPartial(o){const i={uri:"",name:"",image_url:"",followers_count:0,following_count:0,is_followed:!1,is_following:!1,is_dismissed:!1,is_verified:!1,color:0,allow_follows:!1};return i.uri=o.uri??"",i.name=o.name??"",i.image_url=o.image_url??"",i.followers_count=o.followers_count??0,i.following_count=o.following_count??0,i.is_followed=o.is_followed??!1,i.is_following=o.is_following??!1,i.is_dismissed=o.is_dismissed??!1,i.is_verified=o.is_verified??!1,i.color=o.color??0,i.allow_follows=o.allow_follows??!1,i}};function w(o){return null!=o}var m=l(22795),c=l.n(m);const p={encode:(o,i=c().Writer.create())=>(!0===o.showFollows&&i.uint32(8).bool(o.showFollows),i),decode(o,i){const l=o instanceof c().Reader?o:new(c().Reader)(o);let e=void 0===i?l.len:l.pos+i;const s={showFollows:!1};for(;l.pos<e;){const o=l.uint32();if(o>>>3==1)s.showFollows=l.bool();else l.skipType(7&o)}return s},fromPartial(o){const i={showFollows:!1};return i.showFollows=o.showFollows??!1,i}};const b={encode:(o,i=c().Writer.create())=>(""!==o.username&&i.uint32(10).string(o.username),!0===o.showFollows&&i.uint32(16).bool(o.showFollows),i),decode(o,i){const l=o instanceof c().Reader?o:new(c().Reader)(o);let e=void 0===i?l.len:l.pos+i;const s={username:"",showFollows:!1};for(;l.pos<e;){const o=l.uint32();switch(o>>>3){case 1:s.username=l.string();break;case 2:s.showFollows=l.bool();break;default:l.skipType(7&o)}}return s},fromPartial(o){const i={username:"",showFollows:!1};return i.username=o.username??"",i.showFollows=o.showFollows??!1,i}};const g=async(o,i)=>{const l=await o.build().withMethod("GET").withHost(s.Ty).withPath(`/profile/${encodeURIComponent((0,e.v)(i))}/following`).withEndpointIdentifier("/profile/{username}/following").send();return u.fromJSON(l.body)},h=async(o,i)=>{const l=await o.build().withMethod("GET").withHost(s.Ty).withPath(`/profile/${encodeURIComponent((0,e.v)(i))}/followers`).withEndpointIdentifier("/profile/{username}/followers").send();return u.fromJSON(l.body)},y=async(o,{uri:i,playlists:l=0,artists:r=0,episodes:a=0})=>{const n=await o.build().withHost(s.Ty).withPath(`/profile/${encodeURIComponent((0,e.v)(i))}`).withEndpointIdentifier("/profile/{username}").withQueryParameters({playlist_limit:l,artist_limit:r,episode_limit:a}).send();return t.fromJSON(n.body)},v=async(o,{uri:i,offset:l=0,limit:t=200})=>{const r=await o.build().withHost(s.Ty).withPath(`/profile/${encodeURIComponent((0,e.v)(i))}/playlists`).withEndpointIdentifier("/profile/{username}/playlists").withQueryParameters({offset:l,limit:t}).send();return _.fromJSON(r.body)},S=async(o,{uri:i,limit:l=10})=>{const t=await o.build().withMethod("GET").withHost(s.Ty).withPath(`/profile/${encodeURIComponent((0,e.v)(i))}/artists`).withEndpointIdentifier("/profile/{username}/artists").withQueryParameters({limit:l}).send();return a.fromJSON(t.body)},N=(o,{currentUserUri:i,uri:l})=>o.build().withMethod("GET").withHost(s.EN).withPath("/is_dismissed").withEndpointIdentifier("/is_dismissed").withQueryParameters({source_uri:i,target_uri:l,format:"json"}).send(),P=(o,{currentUserUri:i,uri:l})=>o.build().withMethod("POST").withHost(s.EN).withPath("/dismissed").withEndpointIdentifier("/dismissed").withQueryParameters({source_uri:i,target_uri:l,format:"json"}).send(),O=(o,{currentUserUri:i,uri:l})=>o.build().withMethod("DELETE").withHost(s.EN).withPath("/dismissed").withEndpointIdentifier("/dismissed").withQueryParameters({source_uri:i,target_uri:l,format:"json"}).send(),J=async(o,{uri:i})=>o.build().withHost(s.us).withMethod("GET").withoutMarket().withResponseType("arraybuffer").withPath(`/show-follows/${encodeURIComponent((0,e.v)(i))}`).withEndpointIdentifier("/show-follows/{username}").send().then((o=>p.decode(new Uint8Array(o.body)))),E=async(o,{uri:i,showFollows:l})=>{const t=b.encode(b.fromPartial({username:(0,e.v)(i),showFollows:l}));await o.build().withHost(s.us).withMethod("POST").withoutMarket().withBody(t.finish()).withPath("/show-follows").withEndpointIdentifier("/show-follows").send()}},43080:(o,i,l)=>{l.d(i,{Z:()=>n});var e=l(46710),s=l(88308),t=l(80687);let r=0;const a=new WeakMap,n=function(o,i,l){const n=(0,t.A)(),_=a.has(o)?a.get(o):a.set(o,++r).get(o),d=(0,s.lB)((()=>["useEndpoint",o.name,_,i]),[o.name,_,i]),{isLoading:u,error:f,data:w}=(0,e.I)({...l,queryKey:d,queryFn:()=>o(n,...i||[])});return{data:w??null,error:f,loading:u,queryKey:d}}}}]);