dotfiles/.config/spicetify/Extracted/Themed/xpui/home-v2.js

2 lines
17 KiB
JavaScript
Raw Normal View History

2024-07-11 00:01:49 +05:30
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[7704],{81958:(e,t,s)=>{s.r(t),s.d(t,{SKELETON_CARDS_COUNT:()=>It,SKELETON_SHELVES_COUNT:()=>Tt,SKELETON_SHORTCUTS_COUNT:()=>_t,default:()=>wt});var n=s(59496),a=s(84875),r=s.n(a),o=s(61740),i=s(36844),c=s(22385),l=s(3802),u=s(91703),d=s(40576),m=s(21718),h=s(23329),g=s(9374),p=s(82279),x=s(56876),f=s(7142),j=s(74991),y=s(34058),v=s(50346),C=s(27652),S=s(54299),k=s(75257),b=s(20287),N=s(82538),E=s(43064),_=s(91048),T=s(30301);const I="view-homeShortcutsGrid-shortcuts",P="view-homeShortcutsGrid-grid",L="view-homeShortcutsGrid-shortcutLink",w="view-homeShortcutsGrid-shortcut",M="view-homeShortcutsGrid-draggable",F="view-homeShortcutsGrid-imageContainer",B="view-homeShortcutsGrid-imageWrapper",U="view-homeShortcutsGrid-image",O="view-homeShortcutsGrid-main",D="view-homeShortcutsGrid-nameWrapper",A="view-homeShortcutsGrid-name",H="EzRmGRncgnv1zFgF4dqE",R="bPmmKmSPLKMhtJSaUJRX",W="vpQWUBWS_lXRLZMRJT7w",J="GSv7K805J9Jw7LB9tn2A",q="view-homeShortcutsGrid-PlayButtonContainer",z="s9c9x_mJq197U2hBzGtV";var $=s(4637);const Y=(0,n.memo)((function({item:e}){const t=(0,E._)(e.uri),s=e.duration_ms??0,{isPlaying:n,isActive:a}=(0,T.$o)(e.uri),[r]=(0,_.z)(1e4,(t=>t.item?.uri===e.uri)),o=e.resume_point?.resume_position_ms??0,i=n||a?r:o,c=Math.round(100/(s/i)),l=t===N.Om.YES,u=s&&i>0;return l||u?(0,$.jsxs)("div",{className:W,children:[l?(0,$.jsx)(k.E,{iconSize:16,semanticColor:"textSubdued"}):null,u?(0,$.jsx)(b.k,{className:J,value:c,semanticColor:"essentialBase"}):null]}):null}));var G=s(89605),K=s(56162),X=s(94722),Z=s(30985),V=s(17201),Q=s(40780),ee=s(39669),te=s(48607),se=s(96170),ne=s(32422),ae=s(42006),re=s(75207);const oe=(0,n.memo)((function({images:e=[],fallbackIcon:t=x.U}){const s=(0,re.X)(e);return(0,$.jsx)("div",{className:F,children:(0,$.jsx)("div",{className:B,children:(0,$.jsx)(ae.E,{className:U,src:s?.url,loading:"lazy",testid:"shortcut-image",children:(0,$.jsx)(t,{"aria-hidden":!0})})})})}));var ie=s(6142),ce=s(95663),le=s(63120);const ue=n.memo((function({index:e,item:t,fallbackIcon:s,showPlayButton:a,extraContent:i,playInsteadOfNavigating:c=!1,onContextMenu:u=(()=>{}),onTouchStart:d=(()=>{}),onTouchEnd:m=(()=>{})}){const h=(0,G.s0)(),g=(0,ce.o)(),{setColorFromUri:x,resetColor:f,clearColor:j}=(0,p.WQ)(),y=(0,Q.G3)(t.uri,t.release_date,t.resume_point?.resume_position_ms,t.resume_point?.fully_played),{spec:C,logger:S}=(0,se.fU)(X.createDesktopShortcutsPlayNavCardEventFactory,{data:{position:e,uri:t.uri}}),{isPlaying:k,isActive:b,togglePlay:N}=(0,te.n)({uri:t.uri},{featureIdentifier:"home",referrerIdentifier:"home"}),E=(0,v.EC)(t.uri),_=E?.type,T=(0,o.v9)(Z.br),I=(0,o.v9)(Z.yE),P=l.ag.getUrlLocale(),F=(0,ne.S9)({localeFeatureFlag:T,entityFeatureFlag:I,urlLocale:P,entity:_,type:"link"}),B=(0,n.useCallback)((()=>{g({targetUri:t.uri,intent:k?"pause":"play",type:"click"});const e=C.playButtonFactory();let s;s=k?e.hitPause({itemToBePaused:t.uri}):b?e.hitResume({itemToBeResumed:t.uri}):e.hitPlay({itemToBePlayed:t.uri});const n=S.logInteraction(s);N({loggingParams:n})}),[b,k,t.uri,S,g,C,N]),U=(0,n.useCallback)((()=>{if(c)return void B();g({targetUri:t.uri,intent:"navigate",type:"click"});const e=C.hitUiNavigate({destination:t.uri});let s;S.logInteraction(e),E&&(s=E.toURLPath(!0));const n=F?`/${ee.F0}${P}${s}`:s;n&&h(n)}),[t.uri,S,h,g,C,E,F,P,c,B]),W=(0,n.useCallback)((()=>{x(t.uri)}),[t.uri,x]);(0,n.useEffect)((()=>()=>{j()}),[j]);const J=(0,se.Wi)(C),Y=(0,ie.O)([t.uri],t.name);return(0,$.jsx)("div",{ref:J,className:w,onContextMenu:u,onTouchStart:d,onTouchEnd:m,onMouseEnter:W,onMouseLeave:f,children:(0,$.jsxs)("div",{className:M,onDragStart:Y,children:[(0,$.jsx)(oe,{images:t.images,fallbackIcon:s}),(0,$.jsxs)("div",{className:O,children:[(0,$.jsxs)("div",{className:D,children:[(0,$.jsxs)("div",{className:A,children:[y&&(0,$.jsx)(Q.Rd,{className:R}),(0,$.jsx)(le.Link,{to:t.uri,onClick:U,title:t.name,children:(0,$.jsx)(K.D,{as:"p",variant:"balladBold",className:H,children:t.name})})]}),i||null]}),a&
//# sourceMappingURL=home-v2.js.map