dotfiles/.config/spicetify/Extracted/Themed/xpui/5647.js

2 lines
7.2 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[5647],{34223:(e,a,t)=>{t.d(a,{o:()=>_});var i=t(59496),n=t(56162),l=t(3802),r=t(70925),s=t(4637);const c=i.memo((function({text:e,onTimeStampClick:a,children:t,className:l,enableTimestamps:c=!1}){const m=(0,i.useMemo)((()=>(0,s.jsx)(r.w,{html:e,onTimeStampClick:a,enableTimestamps:c})),[e,c,a]);return(0,s.jsxs)(n.D,{as:"div",variant:"ballad",className:l,children:[m,t]})})),m="EBLEo2u6UDcK37liXPVw",o=(0,i.memo)((function({text:e,onTimeStampClick:a,onToggle:t,className:i,enableTimestamps:r}){return(0,s.jsx)(c,{className:i,text:e,onTimeStampClick:a,enableTimestamps:r,children:(0,s.jsx)("button",{"aria-expanded":!1,className:m,onClick:t,children:(0,s.jsxs)(n.D,{variant:"balladBold",children:["… ",l.ag.get("mwp.see.more")]})})})})),d=(e,a,t)=>{const i=l.ag.get("mwp.see.more").length,n=e.length+i+6;return t<=1&&n<a},h=(0,i.memo)((function({paragraphs:e,clickHandler:a,maxCharactersPerLine:t,maxLines:i,toggleExpandedState:n,className:r,enableTimestamps:m}){let h=!1,u=0;const g=e.map(((g,p)=>{const x=Math.round(g.length/t);if(u+=x>0?x:1,h)return null;const f=i-(u-x);if(!(p+1===e.length&&(d(g,t,f)||x<=f))&&u>=i){h=!0;const e=((e,a,t)=>{const i=l.ag.get("mwp.see.more").length;if(d(e,a,t))return e;const n=a*t-i-6;return e.slice(0,n)})(g,t,f);return(0,s.jsx)(o,{text:e,onTimeStampClick:a,onToggle:n,className:r,enableTimestamps:m},p)}return(0,s.jsx)(c,{className:r,text:g,onTimeStampClick:a,enableTimestamps:m},p)})).filter((e=>null!==e)).map(((e,a,t)=>a+1===t.length?e:[e," "])).flat();return(0,s.jsx)(s.Fragment,{children:g})}));var u=t(21718);const g="TQXhY8PT8v1vogxO85c_",p="RKzJftL6TOVUXkXOPykT",x="PEODYhy3IOufoACR6vf2",f="mCKPqUiNNAO6GM3nRBXe",b={isOpen:null,contentWidth:0},j=(e,a)=>({...e,...a}),v=(e="")=>e.split(/[ \u00a0]{2}/).filter(Boolean),C=(e="")=>e.replace("<p>","").split(/(?:<\/p>)/).filter(Boolean),_=(0,i.memo)((function({content:e,htmlContent:a,maxLines:t=2,className:m,onTimeStampClick:o=(()=>{}),onExpanded:d,enableTimestamps:_=!1}){const[k,T]=(0,i.useReducer)(j,b),{isOpen:N,contentWidth:w}=k,S=(0,i.useRef)(null),y=(0,i.useCallback)((()=>{T({isOpen:!N}),d&&d(!N)}),[N,d]);(0,i.useEffect)((()=>{T({isOpen:null})}),[e]),(0,i.useEffect)((()=>{null!==k.isOpen&&S.current?.querySelector("button[aria-expanded]")?.focus()}),[k.isOpen]);const L=w?w/7.8:Number.MAX_VALUE,D=(0,i.useCallback)((e=>{e&&(S.current=e,T({contentWidth:e.clientWidth}))}),[]),O=(0,i.useMemo)((()=>a?C(a).map((e=>(0,s.jsx)(r.w,{html:e,onTimeStampClick:o,enableTimestamps:_},e))):((e,a,t)=>v(e).map(((e,i)=>(0,s.jsx)(c,{className:p,text:e,onTimeStampClick:a,enableTimestamps:t},i))))(e,o,_)),[e,_,a,o]),P=(0,i.useMemo)((()=>a?C(a):v(e)),[e,a]);return(0,u.a)((()=>{S.current&&T({contentWidth:S.current.clientWidth})})),(0,s.jsx)("div",{className:m,children:(0,s.jsxs)("div",{ref:D,className:g,children:[N&&(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsx)("button",{"aria-expanded":!0,className:f,onClick:y,children:(0,s.jsx)(n.D,{className:x,variant:"balladBold",children:l.ag.get("show_less")})})]}),!N&&(0,s.jsx)(h,{className:p,paragraphs:P,clickHandler:o,enableTimestamps:_,maxCharactersPerLine:L,maxLines:t,toggleExpandedState:y})]})})}))},70925:(e,a,t)=>{t.d(a,{w:()=>h});var i=t(59496),n=t(4417),l=t.n(n),r=t(56162),s=t(66432);const c=/(\((?:[0-9]{1,3}:){1,2}[0-9]{2}\))/g;var m=t(63120);const o={Heading:"playlist-playlist-heading",HTMLDescription:"playlist-playlist-playlistDescription",List:"playlist-playlist-list",ListItem:"playlist-playlist-listItem",Paragraph:"playlist-playlist-paragraph"};var d=t(4637);const h=i.memo((function({html:e,onTimeStampClick:a,enableTimestamps:t=!1,semanticColor:n="textSubdued"}){const r=(0,i.useMemo)((()=>{const i=t?e.split(c).map((e=>e.match(c)?`(<time>${e.replace("(","").replace(")","")}</time>)`:e)).join(""):e;let r;try{r=l()(i,{transform:u(a,n),dangerouslySetChildren:[]})}catch{r=e}return r}),[t,e,a,n]);return(0,d.jsx)("div",{className:o.HTMLDescription,children:r})}));function u(e,a){let t=0;return{p:e=>(0,d.jsx)(r.D,{as:"p",variant:"ballad",semanticColor:a,className:o.Paragraph,children:e.children}),a:a=>a.href?.startsWith("#t=")?(0,d.jsx)(s.E,{onClick:e,children:a.children}):a.href?(0,d.jsx)(m.Link,{to:a.href,children:a.children}):(0,d.jsx)(d.Fragment,{children:a.children}),ul:e=>(0,d.jsx)("ul",{className:o.List,children:e.children}),ol:e=>(0,d.jsx)("ol",{className:o.List,children:e.children}),li:e=>(0,d.jsx)(r.D,{as:"li",variant:"ballad",semanticColor:a,className:o.ListItem,children:e.children}),br:()=>(0,d.jsx)("br",{}),h1:e=>(0,d.jsx)(r.D,{as:"h1",variant:"balladBold",semanticColor:a,className:o.Heading,children:e.children}),h2:e=>(0,d.jsx)(r.D,{as:"h2",variant:"balladBold",semanticColor:a,className:o.Heading,children:e.children}),h3:e=>(0,d.jsx)(r.D,{as:"h3",variant:"balladBold",semanticColor:a,className:o.Heading,children:e.children}),h4:e=>(0,d.jsx)(r.D,{as:"h4",variant:"balladBold",semanticColor:a,className:o.Heading,children:e.children}),h5:e=>(0,d.jsx)(r.D,{as:"h5",variant:"balladBold",semanticColor:a,className:o.Heading,children:e.children}),h6:e=>(0,d.jsx)(r.D,{as:"h6",variant:"balladBold",semanticColor:a,className:o.Heading,children:e.children}),time:a=>(0,d.jsx)(s.E,{onClick:e,children:a.children}),_:(e,a,n)=>{const l=void 0===a?e:n;return(0,d.jsx)(i.Fragment,{children:l},"fragment"+t++)}}}},13198:(e,a,t)=>{t.d(a,{C:()=>r});var i=t(59496),n=t(90707),l=t(4637);const r=({pageId:e,uri:a,children:t})=>{const r=(0,n.b)(),s=(0,n.H)();return(0,i.useEffect)((()=>{r?.reportPageView({pageId:e,navigationalRoot:s??void 0,entityUri:a})}),[e,s,r,a]),(0,l.jsx)(l.Fragment,{children:t})}},65970:(e,a,t)=>{t.d(a,{s:()=>h});var i=t(59496),n=t(95663);const l=e=>e<=64?"small":e>640?"xlarge":e>300?"large":"standard";function r(e,a){return e.filter((e=>e.label?e.label===a:e.width?l(e.width)===a:!!e.height&&l(e.height)===a))[0]}var s=t(23327);function c(e){const a=r(e,"standard"),t=r(e,"large"),i=r(e,"small"),n=r(e,"xlarge");return{image_url:a?.url,image_height:a?.height?.toString(),image_width:a?.width?.toString(),image_url_large:t?.url,image_height_large:t?.height?.toString(),image_width_large:t?.width?.toString(),image_url_small:i?.url,image_height_small:i?.height?.toString(),image_width_small:i?.width?.toString(),image_url_xlarge:n?.url,image_height_xlarge:n?.height?.toString(),image_width_xlarge:n?.width?.toString()}}var m=t(37409),o=t(30301),d=t(9374);function h(e,a){const t=(0,n.o)(),l=(0,m.g)(),{isPlaying:r,isActive:h}=(0,o.$o)(e?.uri||""),{isActive:u}=(0,o.cR)(a?.uri||"");return(0,i.useCallback)((i=>{if(!a||!e)return;const n=function(e,a){const t=(e.coverArt?.sources||[]).sort(((e,a)=>(a.width||0)-(e.width||0))),i=(0,s.Xb)(e,a),n=(0,s.Ie)(a)||i;return{uri:e.uri,title:e.name,subtitle:a.name,type:"episode",album_uri:a.uri,album_title:a.name,artist_uri:a.uri,artist_name:a.name,...c(t),media_type:"audio",isTrailer:i,anonymousPlaybackAllowed:n}}(e,a);u&&!r&&h&&!i?l.resume():u&&r&&!i?(t({type:"click",intent:"pause",targetUri:e.uri}),l.pause()):(t({type:"click",intent:"play",targetUri:e.uri}),l.play({uri:a.uri,pages:[{items:[{type:d.p.EPISODE,uri:e.uri,uid:null,metadata:n,provider:null}]}]},{referrerIdentifier:l.getReferrer(),featureIdentifier:"episode"},i))}),[h,r,u,l,t,a,e])}}}]);
//# sourceMappingURL=5647.js.map