Files
dotfiles/.config/spicetify/Extracted/Themed/xpui/xpui-debug-window-contents.js
T
2024-05-05 19:02:45 +02:00

2 lines
49 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[5320],{36132:(e,n,t)=>{t.d(n,{DebugWindowContents:()=>ra});t(46758),t(53321),t(86277);var s=t(50959),a=t(82187),i=t.n(a),l=t(93749),r=t(21393),o=t(46822),c=t(45712),d=t(10226),u=(t(2836),t(12960)),m=t(30982),p=t(52250);const h=(0,m.v)();window.abba={get:async function(e,n){const t=new u.hH((0,p.G)()),s=(await t.getValues(u.hr.fromPartial({}))).pairs;let a={},i="";if(s.abbaOverrides?i=s.abbaOverrides:s.abbaoverrides&&(i=s.abbaoverrides),i)try{a=JSON.parse(i)}catch(e){console.error(`error parsing value=${i}, error=${e}`)}if(Object.prototype.hasOwnProperty.call(a,e))return console.warn(`Abba: Override for ${e} : ${a[e]}`),void setTimeout((()=>n(null,a[e])),0);h.post("sp://abba/v1/flags",{flags:[e]}).then((t=>{const{flags:s=[]}=t,a=s[0]&&s[0].featureName===e&&s[0].cell;n(null,a||null)})).catch((e=>{n(e)}))},getAll:function(e){console.warn("Abba:getAll should only be used by TA tests for logging purposes."),h.get("sp://abba/v1/all_flags").then((n=>{const{flags:t=[]}=n,s=t.reduce(((e,n)=>(e[n.featureName]=n.cell,e)),{});e(null,JSON.stringify(s,null,2))})).catch((n=>{e(n)}))},getRequestedFlagNames:function(e){h.get("sp://abba/v1/requested_flag_names").then((n=>{e(null,JSON.stringify(n.sort(),null,2))})).catch((n=>{e(n)}))}};var v=t(36981);const x="rh7v8PDNC0ke2OkkyRhk",j="L6pjHHt_x4tfksfQ4Pem",f="H0jIvFjLqNoS1jwvMR82",g="UZcGKrwobJ2tS5Ka06pD";var y=t(11527);const N=()=>{const[e,n]=(0,s.useState)(60),[t,a]=(0,s.useState)("stream"),[i,l]=(0,s.useState)("");return(0,y.jsxs)("div",{className:x,children:[(0,y.jsxs)("div",{className:j,children:[(0,y.jsx)("p",{children:"Stream time (in seconds)"}),(0,y.jsx)("input",{className:f,type:"text",value:e,onChange:e=>{const t=e.target.value;n(parseInt(t,10))}}),(0,y.jsx)("button",{className:g,onClick:()=>{v.N.increaseStreamTime(e)},children:"Add time"}),(0,y.jsx)("button",{className:g,onClick:()=>{v.N.increaseStreamTime(1200)},children:"Add 20 minutes"})]}),(0,y.jsxs)("div",{className:j,children:[(0,y.jsx)("p",{children:"Override Country"}),(0,y.jsxs)("select",{value:i,onBlur:()=>{},onChange:e=>{l(e.target.value)},children:[(0,y.jsx)("option",{value:"US",children:"USA"}),(0,y.jsx)("option",{value:"UK",children:"United Kingdom"}),(0,y.jsx)("option",{value:"JP",children:"Japan"}),(0,y.jsx)("option",{value:"BR",children:"Brasil"}),(0,y.jsx)("option",{value:"AU",children:"Australia"}),(0,y.jsx)("option",{value:"SE",children:"Sweden"}),(0,y.jsx)("option",{value:"",children:"Clear Override"})]}),(0,y.jsx)("button",{className:g,onClick:()=>{v.N.overrideCountry(i)},children:"Override"})]}),(0,y.jsxs)("div",{className:j,children:[(0,y.jsx)("p",{children:"Clear ad in slot"}),(0,y.jsxs)("select",{value:t,onBlur:()=>{},onChange:e=>{a(e.target.value)},children:[(0,y.jsx)("option",{value:"stream",children:"STREAM"}),(0,y.jsx)("option",{value:"billboard",children:"BILLBOARD OVERLAY"}),(0,y.jsx)("option",{value:"promotedsong",children:"PROMOTED SONG"}),(0,y.jsx)("option",{value:"hpto",children:"HPTO"}),(0,y.jsx)("option",{value:"leaderboard",children:"LEADERBOARD"})]}),(0,y.jsx)("button",{className:g,onClick:()=>{v.N.clearSlot(t)},children:"Clear slot"}),(0,y.jsx)("p",{children:"Trigger ad in slot"}),(0,y.jsxs)("select",{value:t,onBlur:()=>{},onChange:e=>{a(e.target.value)},children:[(0,y.jsx)("option",{value:"stream",children:"STREAM"}),(0,y.jsx)("option",{value:"billboard",children:"BILLBOARD OVERLAY"}),(0,y.jsx)("option",{value:"promotedsong",children:"PROMOTED SONG"}),(0,y.jsx)("option",{value:"hpto",children:"HPTO"}),(0,y.jsx)("option",{value:"leaderboard",children:"LEADERBOARD"})]}),(0,y.jsx)("button",{className:g,onClick:()=>{v.N.triggerSlot(t)},children:"Trigger slot"})]}),(0,y.jsx)("button",{className:g,onClick:()=>{v.N.queueVideoAd()},children:"Queue Video Ad"})]})};var b=t(35869),k=t(3533),S=t(15994),w=t(73057);const C="scaF2wOGtuiU5UBKJrGa",O="PjVBb0nlrIUasTrrFgCx",A="MjtdwpkzFFhhmzeyzOy2",I="uVClWczmJLRR5jfAENGP",T=[{label:"Production",value:"prod"},{label:"Development",value:"dev"}],R=()=>{const e=(0,b.I0)(),n=(0,b.v9)((e=>e.inAppMessaging.env)),t=(0,b.v9)((e=>e.inAppMessaging.message)),[a,i]=(0,s.useState)(""),[l,r]=(0,s.useState)(""),[o,c]=(0,s.useState)(!1);(0,s.useEffect)((()=>{t&&o&&c(!1)}),[t,o]);const d=!t&&o;return(0,y.jsx)("div",{className:C,children:(0,y.jsxs)("div",{className:O,children:[(0,y.jsx)("div",{children:(0,y.jsx)("label",{htmlFor:"desktop.settings.inAppMessagingEnv",children:"Mode (endpoint):"})}),(0,y.jsx)(S.v,{dir:"auto",value:n,id:"desktop.settings.inAppMessagingEnv",onSelect:function(n){"prod"!==n&&"dev"!==n||e((0,w.q1)(n))},children:T.map((({label:e,value:n})=>(0,y.jsx)("option",{value:n,children:e},n)))}),(0,y.jsx)("div",{children:(0,y.jsx)("label",{htmlFor:"desktop.settings.inAppMessagingCreativeId",children:"Creative Id:"})}),(0,y.jsx)("div",{children:(0,y.jsx)("input",{className:A,placeholder:"(eg. 12123434)",id:"desktop.settings.inAppMessagingCreativeId",name:"Creative Id",type:"text",value:a,onChange:function(e){i(e.target.value),c(!1)}})}),(0,y.jsx)("div",{children:(0,y.jsx)("label",{htmlFor:"desktop.settings.inAppMessagingAppUri",children:"URI for Dynamic Content (optional):"})}),(0,y.jsx)("div",{children:(0,y.jsx)("input",{className:A,placeholder:"(eg. spotify:artist:123)",id:"desktop.settings.inAppMessagingAppUri",name:"App Uri",type:"text",value:l,onChange:function(e){r(e.target.value),c(!1)}})}),(0,y.jsx)("div",{}),(0,y.jsx)("div",{}),(0,y.jsx)("div",{children:(0,y.jsx)(k.D,{colorSet:"invertedLight",onClick:function(n){n.preventDefault(),e((0,w.XJ)(a,l)),c(!1),window.setTimeout((()=>{c(!0)}),1e3)},children:"Get Preview"})}),d&&(0,y.jsx)("div",{className:I,children:"No Messsage found"})]})})};var E=t(67577),P=t(19617),D=t(82315),_=t(27067),F=t(91054),L=t(71166),B=t(14832),V=t(40125),U=t(39390),M=t(25122),z=t(94260),J=t(85866),H=t(24161),q=t(89022);const G={tableContainer:"Oq75N3dIIFwLLxqhrTGw",collapsed:"Y1mIc_urBEFpW0IaPvTg",tableTitle:"A3f7b8Ykb8QaTHv9e6DV",tableToggle:"cN2yet80TrzvhUOVyNyJ",table:"w3RCrOKYvq_0htC6zhzd",tableHead:"viEusJyR3z4ijG1P7ji6",rowHeader:"qM20Y4j0mkUnh1qSFmb3",rowName:"PMJ_WnnsgiBd1d9yFIGf",rowValue:"zyDs7IcK71IYTnn2YfNJ",rowActions:"ofGd7aEjrX3mgVu0DbO8",propertyDescription:"WoXbezM6uoI1BhVP_Huq",rowAction:"zmgvPs6K0W0mLJ3xX1Uv",rowControl:"dPVfdc5bb3lNG2ybyp2a"},K=({title:e,titleExtra:n,rows:t,cols:a,canCollapse:l=!1,isCollapsedInitially:r=!1,renderHead:o=!1,renderRow:c})=>{const[d,u]=(0,s.useState)(!!l&&r);return(0,y.jsxs)(M.x,{className:i()(G.tableContainer,{[G.collapsed]:d}),children:[e?(0,y.jsxs)("div",{className:G.tableTitle,onClick:()=>{l&&u(!d)},children:[l?(0,y.jsx)("button",{className:G.tableToggle,children:d?(0,y.jsx)(z.V,{size:"small"}):(0,y.jsx)(J.C,{size:"small"})}):null,(0,y.jsx)("h3",{children:e}),n]}):null,(0,y.jsxs)(H.i,{className:G.table,children:[(0,y.jsx)("colgroup",{children:a.map(((e,n)=>(0,y.jsx)("col",{width:e.width,className:e.className},n)))}),o?(0,y.jsx)("thead",{children:(0,y.jsx)("tr",{children:a.map(((e,n)=>(0,y.jsx)(q.x,{className:G.tableHead,children:e.name},n)))})}):null,(0,y.jsx)("tbody",{children:Array.isArray(t)?t.map((e=>c?c(e,a):null)):t})]})]})};function W(){const e=(0,P.zY)();return(0,s.useMemo)((()=>e?new e.Function("value","if (value) { navigator.clipboard.writeText(value) }"):()=>{}),[e])}const $="ipHwQurO5v9UGSq71YmY",Y=()=>{const e=W(),n=(0,U.p)(),t=n.token?.accessToken??"Not authorized",s=new Date(n.token?.accessTokenExpirationTimestampMs??0);return(0,y.jsx)("div",{className:$,children:(0,y.jsx)(K,{title:"Authorization",rows:[{name:"Token",value:t},{name:"Expires At",value:s.toLocaleString()},{name:"Retry Attempt",value:n.retryAttempt?.toString()??"N/A"},{name:"Retry At",value:n.retryAt?.toLocaleString()??"N/A"}],cols:[{width:"30%"},{},{width:"16px"}],renderRow:({name:n,value:t})=>(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,highlight:!0,children:n}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,align:"right",children:t}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>e(t),children:(0,y.jsx)(V.c,{size:"small"})})})]})})})};var Z=t(17385);const X="WT_NZ6JEU_dK03UPUjQm",Q=({name:e,value:n})=>{const t=W();return(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,highlight:!0,children:e}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,align:"right",children:n}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>t(n),children:(0,y.jsx)(V.c,{size:"small"})})})]})},ee=({device:e})=>(0,y.jsx)(K,{title:e.name,rows:[{name:"Device",value:e?.name},{name:"Identifier",value:e.id},{name:"Type",value:e.type},{name:"Group",value:e.isGroup.toString()},{name:"Local",value:e.isLocal.toString()},{name:"Active",value:e.isActive.toString()},{name:"Connecting",value:e.isConnecting.toString()},{name:"Disabled",value:e.isDisabled.toString()},{name:"Volume",value:e.volume.toString()},{name:"HiFi",value:e.hifiSupport.deviceSupported.toString()}],cols:[{name:"Property",width:"30%"},{name:"Value"},{name:"Actions",width:"16px"}],renderRow:e=>(0,y.jsx)(Q,{...e}),canCollapse:!0,isCollapsedInitially:!0}),ne=()=>{const e=(0,Z.O)(),n=e.devices;return(0,y.jsxs)("div",{className:X,children:[(0,y.jsx)(K,{title:"Connect",rows:(0,y.jsx)(Q,{name:"Status",value:e.connectionStatus}),cols:[{name:"Property",width:"30%"},{name:"Value"},{name:"Actions",width:"16px"}]}),n.map((e=>(0,y.jsx)(ee,{device:e},e.id)))]})};var te=t(69736),se=t(6370),ae=t(54799),ie=t(51227),le=t(95683),re=t(51833),oe=t(7605),ce=t(9756),de=t(87280),ue=t(75533),me=t(61233),pe=t(4965),he=t(44478),ve=t(42240),xe=t(85826),je=t(45540),fe=t(7863),ge=t(62609);const ye=({view:e,className:n})=>{const t=(0,s.useCallback)((n=>{(0,pe.$1)(e,n.nativeEvent,"search-panel")&&n.preventDefault()}),[e]),a=(0,s.useCallback)((n=>{e.dispatch({effects:de.ql.of(new de.Jb({search:n}))})}),[e]),i=(0,s.useCallback)((()=>{(0,de.N$)(e)}),[e]),l=(0,s.useRef)(null);return(0,s.useEffect)((()=>{e.dispatch({effects:de.ql.of(new de.Jb({search:""}))}),l.current?.select()}),[e]),(0,y.jsx)("div",{className:n,children:(0,y.jsx)(xe.N,{iconLeading:(0,y.jsx)(je.j,{}),iconTrailing:(0,y.jsx)(fe.k,{onClick:()=>i()}),children:(0,y.jsx)(ge.y,{ref:l,onKeyDown:e=>t(e),onChange:e=>a(e.currentTarget.value)})})})};var Ne=t(42784);t(39301);function be(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ke(e,n,t=[]){let s=0;for(const a of Object.getOwnPropertyNames(e))n(e,a,t)?s++:be(e[a])&&(s+=ke(e[a],n,[a,...t]));return s}function Se(e,n){return void 0===e[n]&&(e[n]={},!0)}function we(e,n){return!(!Array.isArray(e[n])||0!==e[n].length)&&(e[n]=[{}],!0)}function Ce(e,n){return!(!Array.isArray(e[n])||1!==e[n].length||!be(e[n][0])||0!==Object.getOwnPropertyNames(e[n][0]).length)&&(e[n]=[],!0)}function Oe(e,n){return!(!be(e[n])||0!==Object.getOwnPropertyNames(e[n]).length)&&(e[n]=void 0,!0)}function Ae(e,n,t){return!(!t.some((e=>/policy/i.test(e)))||!1!==e[n])&&(delete e[n],!0)}function Ie(e,n,t={}){let s=0;do{s=ke(n=e.fromPartial(n),Se),s+=ke(n,we)}while(s>0);return ke(n,Oe),ke(n,Ce),!0===t.cleanPolicies&&ke(n,Ae),n}const Te=["spotify:artist:5INjqkS1o8h1imAzPqGZBb","spotify:album:79dL7FLiJFOO0EoehUHQBv","spotify:track:6K4t31amVTZDgR3sKmwUJJ","spotify:show:1OLcQdw2PFDPG1jo3s0wbp","spotify:episode:0VpyIy8Srg5IKQdRAbDDH1"],Re=Object.values(Ne.TP).filter((e=>"string"==typeof e)).map((e=>({name:e,value:(0,Ne.EE)(e)})));function Ee(e,n){let t=0;const s=[];if(n.type.is("["))n.parent();else if(n.type.is("Property")){if(!n.firstChild())return[];s.unshift(e.sliceDoc(n.from+1,n.to-1)),n.parent()}for(;n.parent()&&!n.type.is("JsonText");){if(n.type.is("Array"))s.unshift("[]");else if(n.type.is("Property")){if(!n.firstChild())break;s.unshift(e.sliceDoc(n.from+1,n.to-1)),n.parent()}if(++t>1e4)break}return s}function Pe(e,n){for(const t of n)if("[]"===t){if(!Array.isArray(e)||0===e.length)return null;e=e[0]}else Object.hasOwn(e,t)&&(e=e[t]);return e}function De(e={}){return(0,ie.ys)({activateOnTyping:!1,override:[n=>{const t=(0,oe.qz)(n.state).cursorAt(n.pos,-1);if(t.type.is("{")||t.type.is("Object")){const s=Ee(n.state,t),a=function(e,n){return Object.getOwnPropertyNames(Pe(e,n))}(e,s);return{from:n.pos,options:a.map((e=>({type:"text",label:e,apply:`"${e}"`})))}}if(t.type.is("[")||t.type.is("Array")){const s=Ee(n.state,t),a=Pe(e,s);return Array.isArray(a)&&be(a[0])?{from:n.pos,options:[{type:"text",label:"{ ... }",apply:JSON.stringify(a[0]),boost:1},{type:"text",label:"{}",boost:0}]}:/extension/i.test(s[s.length-1])?{from:n.pos,options:Re.map((({name:e,value:n})=>({type:"constant",label:e,apply:`${n}`})))}:{from:n.pos,options:Te.map((e=>({type:"text",label:`"${e}"`})))}}if(t.type.is("Property")){const s=Ee(n.state,t),a=function(e,n){const t=Pe(e,n);return void 0===t?"null":Array.isArray(t)?"array":typeof t}(e,s),i=[];if("boolean"===a)i.push({type:"keyword",label:"true",boost:1}),i.push({type:"keyword",label:"false",boost:0});else if("null"===a)i.push({type:"keyword",label:"null",boost:1}),i.push({label:"{}",apply:"{}",boost:0});else if("string"===a){i.push({label:'""'});for(const e of Te)i.push({label:`"${e}"`})}else if("number"===a)if(/extension/i.test(s[s.length-1]))for(const{name:e,value:n}of Re)i.push({type:"constant",label:e,apply:`${n}`});else i.push({label:"0",apply:"0"}),i.push({label:"10",apply:"10"}),i.push({label:"100",apply:"100"});else"object"===a?i.push({label:"{}",apply:"{}"}):"array"===a&&i.push({label:"[]",apply:"[]"});return{from:n.pos,options:i}}return null}]})}const _e=[me.vk,(0,oe.nF)(me.VE),(0,pe.Eu)(),(0,pe.ZO)(),(0,pe.HQ)(),(0,pe.Uw)(),ue.yy.allowMultipleSelections.of(!0),pe.$f.of([...le.wQ,...le.f$,...ie.B1,...de.Lp,le.oc]),(0,de.yC)({top:!0,createPanel:e=>{const n=e.dom.ownerDocument.createElement("div");return(0,he.s)(n).render((0,y.jsx)(ve.LC,{target:e.dom.ownerDocument.head,children:(0,y.jsx)(ye,{view:e})})),{dom:n,top:!0}}}),(0,oe.mi)(),(0,re.AV)()],Fe=[..._e,(0,le.m8)(),(0,ce.ir)((0,re.ap)()),(0,oe.nY)(),(0,oe.n$)(),(0,ie.vQ)()],Le=[..._e,ue.yy.readOnly.of(!0)],Be=new ue.F6,Ve=({readOnly:e=!1,onChange:n,onDiagnostics:t,editorRef:a,className:i})=>{const l=(0,s.useRef)(null);return(0,s.useEffect)((()=>{const s=new pe.tk({parent:l.current,extensions:[...e?Le:Fe,Be.of(De({})),pe.tk.updateListener.of((e=>{e.docChanged&&n?.(e.state.doc.toString());for(const n of e.transactions)for(const e of n.effects)e.is(ce.lC)&&t?.(e.value)}))]});return void 0!==a&&(a.current=s),()=>{s.destroy()}}),[e,n,t,a]),(0,y.jsx)("div",{className:i,ref:l})};function Ue({readOnly:e,className:n,onChange:t,onDiagnostics:a}){const i=(0,s.useRef)(),l=(0,s.useRef)(t),r=(0,s.useRef)(a);l.current=t,r.current=a;const o=(0,s.useCallback)((()=>{const e=i.current;return void 0!==e?e.state.doc.toString():null}),[]),c=(0,s.useCallback)((e=>{const n=i.current;void 0!==n&&n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e}})}),[]),d=(0,s.useCallback)((e=>{const n=i.current;void 0!==n&&n.dispatch({effects:Be.reconfigure(De(e))})}),[]),u=(0,s.useCallback)((e=>{l?.current?.(e)}),[]),m=(0,s.useCallback)((e=>{r?.current?.(e)}),[]);return{Editor:(0,y.jsx)(Ve,{editorRef:i,readOnly:e,className:n,onChange:u,onDiagnostics:m}),getContent:o,setContent:c,setReference:d}}var Me=t(32602),ze=t(59214),Je=t(76464),He=t(62311),qe=t(39215),Ge=t(38258),Ke=t(7140),We=t(71044),$e=t(10830),Ye=t(24267),Ze=t(77115),Xe=t(34334),Qe=t(44411),en=t(60492),nn=t(61531),tn=t(80245),sn=t(16326),an=t(44526),ln=t(89746),rn=t(61216),on=t(80964),cn=t(33547),dn=t(1805),un=t(51165),mn=t(84054),pn=t(86360),hn=t(8693),vn=t(22211),xn=t(9111),jn=t(47152),fn=t(96015),gn=t(27057),yn=t(44501),Nn=t(194),bn=t(733),kn=t(47113),Sn=t(57098),wn=t(87133),Cn=t(44308),On=t(16856),An=t(29523),In=t(10783),Tn=t(81337);const Rn=[Me.F,ze.Ul,Je.M$,He.eN,qe.qu,Ge.r2,Ke.JD,We.cf,$e.HP,Ye.I1,Ze.Fg,Xe.w4,Qe.xi,en.cB,nn.Xs,tn.U,sn.I1,an.nW,ln.w6,rn.id,on.gw,cn.jd,dn._X,un.BK,un.yP,un.b1,mn.E3,pn.No,hn.KW,vn.xT,xn.Yx,u.hH,jn.HB,fn.XV,gn.KQ,yn.Pn,Nn.Hv,bn.R,kn.f,Sn.l,wn.n0,Cn.xK,Ne.ev,On.R3,An.cuk,An.MRO,An.jLT,An.lcT,An.IBM,In.A7,Tn.Dx].concat([]);function En(e){return JSON.parse(e,((e,n)=>null===n?void 0:n))}function Pn(e){return JSON.stringify(e,((e,n)=>void 0===n?null:"bigint"==typeof n?n.toString():n),2)}function Dn(){const{serviceMap:e,serviceNames:n}=(0,s.useMemo)((()=>{const e=function(e){return Rn.sort(((e,n)=>e.SERVICE_ID.localeCompare(n.SERVICE_ID))).reduce(((n,t)=>(n[t.SERVICE_ID]={methods:t.METHODS,client:new t(e)},n)),{})}((0,p.G)());return{serviceMap:e,serviceNames:Object.keys(e)}}),[]),[t,a]=(0,s.useState)(n[0]),i=e[t].methods,l=e[t].client,r=Object.keys(i),[o,c]=(0,s.useState)(r[0]),d=i[o].requestType,u=i[o].isStreaming,m=l[o],h=(0,s.useCallback)(((n,t)=>{const s=n??Object.keys(e)[0],i=e[s].methods,l=t??Object.keys(i)[0];a(s),c(l)}),[e,a,c]),v=(0,s.useMemo)((()=>Pn(Ie(d,{},{cleanPolicies:!0}))),[d]),x=(0,s.useMemo)((()=>Ie(d,{})),[d]),j=(0,s.useCallback)((e=>{try{return Pn(Ie(d,En(e),{cleanPolicies:!0}))}catch(n){return e}}),[d]),f=(0,s.useCallback)((async(e,n)=>{const t=d.fromPartial(En(e));if(u)return m.call(l,t,(e=>{n(Pn(e))}));const s=await m.call(l,t);return n(Pn(s)),null}),[l,u,d,m]);return{services:n,methods:r,service:t,method:o,client:l,message:d,call:f,jsonReference:x,jsonString:v,prettify:j,update:h}}const _n="gbcTqus4yhTHlzm2IETQ",Fn="EHmr8C7kxkrYGyC7o3JO",Ln="JAHwAteJRJtwtczneeVN",Bn="nqOWuGeqweWJBgtLeohb",Vn="tU2LEDqdrQPq3oDlpEOv",Un="gkuNSEZ7uAKsay3cfbMR",Mn="nbQvEMLCjLpv4xnKSOIt",zn=()=>{const{services:e,methods:n,service:t,method:a,call:i,jsonReference:l,jsonString:r,prettify:o,update:c}=Dn(),d=(0,s.useRef)(null),[u,m]=(0,s.useState)(!1),[p,h]=(0,s.useState)([]),v=p.length>0,{Editor:x,setContent:j,getContent:f,setReference:g}=Ue({className:Mn,onDiagnostics:e=>h(e)}),{Editor:N,setContent:b}=Ue({className:Mn,readOnly:!0}),k=(0,s.useCallback)((()=>{null!==d.current&&(d.current.cancel(),d.current=null,m(!1))}),[m]),S=(0,s.useCallback)((async()=>{k();const e=await i(f()??"{}",(e=>{b(e)}));null!==e&&(d.current=e,m(!0))}),[i,k,f,b]),w=(0,s.useCallback)((async()=>{const e=o(f()??"{}");j(e)}),[o,f,j]);(0,s.useEffect)((()=>{g(l),j(r),b(""),k()}),[g,l,j,r,b,k]);const C=[{label:"Core",options:e.filter((e=>-1===e.indexOf("desktop"))).map((e=>({label:e,value:e})))},{label:"Desktop",options:e.filter((e=>-1!==e.indexOf("desktop"))).map((e=>({label:e,value:e})))}],O=n.map((e=>({label:e,value:e})));return(0,y.jsxs)("div",{className:_n,children:[(0,y.jsxs)("div",{className:Fn,children:[(0,y.jsx)(te.x,{as:"p",variant:"bodyMedium",children:"Endpoint"}),(0,y.jsx)(ae.ZP,{value:{label:t,value:t},options:C,onChange:e=>{c(e?.value??void 0)},styles:{menuList:n=>({...n,minHeight:`min(60vh, ${50*e.length}px)`})}}),(0,y.jsx)(ae.ZP,{value:{label:a,value:a},options:O,onChange:e=>c(t,e?.value??void 0),styles:{menuList:e=>({...e,minHeight:`min(60vh, ${50*n.length}px)`})}})]}),(0,y.jsxs)("div",{className:Ln,children:[(0,y.jsxs)("div",{className:Vn,children:[(0,y.jsx)(te.x,{as:"p",variant:"bodyMedium",children:"Request"}),(0,y.jsx)(se.P,{className:Un,size:"small",disabled:v,onClick:w,children:"Prettify"}),(0,y.jsx)(se.P,{className:Un,size:"small",disabled:v,onClick:u?k:S,children:u?"Cancel":"Send"})]}),x]}),(0,y.jsxs)("div",{className:Bn,children:[(0,y.jsx)("div",{className:Vn,children:(0,y.jsx)(te.x,{as:"p",variant:"bodyMedium",children:"Response"})}),N]})]})};var Jn=t(39505),Hn=t(85536),qn=t(50648),Gn=t(78171),Kn=t(88509),Wn=t(97154),$n=t(374),Yn=t(8172),Zn=t(36879),Xn=t(13379);var Qn=t(76280),et=t(66369);var nt=t(8570),tt=t(65019),st=t(5380);const at="bFE0oGWgZ40KJHjcBj12",it="nzbIAA5MqUSD0hIKUuHg",lt="hksYFxAm48XqAEbpcukQ",rt="UnO1u4VJB0B6pTtqWh1n",ot="xlSWVFMQmYmRK34yiPOA",ct="oKgZ0g8at59jN8nf8Bee",dt="Nodut0kqaRIc93iGqbbP",ut="dUIum8rPR6Msq9wot5ky",mt="QHO5pYBkfWBn6qyAh9dp";const pt=({size:e,ranges:n})=>{if(0===n.length)return(0,y.jsx)("div",{className:lt,children:(0,y.jsx)("div",{className:rt})});const t=`linear-gradient(90deg, ${n.map((n=>{const t=100*n.fromByte/e,s=100*n.toByte/e;return`transparent ${t}%, ${Jn.pCU} ${t}%, ${Jn.pCU} ${s}%, transparent ${s}%`})).join(", ")})`;return(0,y.jsx)("div",{className:lt,children:(0,y.jsx)("div",{className:rt,style:{background:t}})})},ht=({item:e,file:n})=>{const t=(0,nt.g)(),s=W(),a=(function(e){let n,t,s=0;if(0===e.length)return s;for(n=0;n<e.length;n++)t=e.charCodeAt(n),s=(s<<5)-s+t,s|=0;return s}(`${n.format}${n.bitrate}${n.formatEnum}`)+180)%360;return(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,highlight:!0,children:(0,y.jsxs)("div",{className:ot,style:{background:`linear-gradient(180deg, hsl(${a}, 60%, 30%), hsl(${a}, 40%, 70%))`},children:[(0,y.jsx)("span",{className:ct,children:n.format}),(0,y.jsx)("span",{className:dt,children:vt(n)})]})}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,children:(0,y.jsxs)("div",{className:it,children:[n.fileId,(0,y.jsx)(pt,{size:n.byteSize,ranges:n.byteRanges})]})}),(0,y.jsxs)(B.p,{className:G.rowActions,children:[(0,y.jsx)("button",{className:G.rowAction,onClick:()=>{t.play({uri:"spotify:internal:fileplayback",pages:[{items:[{...e,provider:"context",metadata:{"media.manifest":JSON.stringify({id:n.fileId,bitrate:n.bitrate,format:n.formatEnum,encryption:"aes"})}}]}]},{referrerIdentifier:"PlayerStub_UnknownReferrer",featureIdentifier:"debug"})},children:(0,y.jsx)(Hn.J,{size:"small"})}),(0,y.jsx)("button",{className:G.rowAction,onClick:()=>{s(n.fileId)},children:(0,y.jsx)(V.c,{size:"small"})})]})]})};function vt(e){switch(e.formatEnum){case 16:return"16-bit";case 22:return"24-bit";default:return xt(e.bitrate,1e3,"k")}}function xt(e=void 0,n=1,t=""){if(void 0!==e&&-1!==e)return"string"==typeof e&&(e=Number.parseInt(e,10)),`${(Number(e)/n).toLocaleString("en",{maximumFractionDigits:10})}${t}`}function jt(e=void 0){return!0===e?"Yes":"No"}function ft(e=void 0){if(void 0!==e)return(0,st.m)(Number(e))}const gt=({name:e,value:n})=>{const t=W();return(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,highlight:!0,children:e}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,align:"right",children:n}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>t(n),children:(0,y.jsx)(V.c,{size:"small"})})})]})},yt=({terminalType:e,transportType:n,isDefaultDevice:t})=>{const s=t?"essentialPositive":"essentialBase",a=[];switch(e){case Nn.OE.TERMINAL_TYPE_SPEAKERS:a.push((0,y.jsx)(qn.X,{semanticColor:s,size:"small"}));break;case Nn.OE.TERMINAL_TYPE_HEADPHONES:a.push((0,y.jsx)(Gn.F,{semanticColor:s,size:"small"}));break;case Nn.OE.TERMINAL_TYPE_DISPLAY_DEVICE:a.push((0,y.jsx)(Kn.x,{semanticColor:s,size:"small"}))}switch(n){case Nn.Fl.TRANSPORT_TYPE_BUILT_IN:case Nn.Fl.TRANSPORT_TYPE_VIRTUAL:break;case Nn.Fl.TRANSPORT_TYPE_USB:a.push((0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",style:{position:"relative",top:"3px",width:16,height:16,fill:(0,Wn.NE)(s)},children:(0,y.jsx)("path",{d:"m7.792.312-1.533 2.3A.25.25 0 0 0 6.467 3H7.5v7.319a2.5 2.5 0 0 0-.515-.298L5.909 9.56A1.5 1.5 0 0 1 5 8.18v-.266a1.5 1.5 0 1 0-1 0v.266a2.5 2.5 0 0 0 1.515 2.298l1.076.461a1.5 1.5 0 0 1 .888 1.129 2.001 2.001 0 1 0 1.021-.006v-.902a1.5 1.5 0 0 1 .756-1.303l1.484-.848A2.5 2.5 0 0 0 11.995 7h.755a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h.741a1.5 1.5 0 0 1-.747 1.142L8.76 8.99a2.584 2.584 0 0 0-.26.17V3h1.033a.25.25 0 0 0 .208-.389L8.208.312a.25.25 0 0 0-.416 0Z"})}));break;case Nn.Fl.TRANSPORT_TYPE_BLUETOOTH:a.push((0,y.jsx)($n.X,{semanticColor:s,size:"small"}));break;case Nn.Fl.TRANSPORT_TYPE_DISPLAY_DEVICE:a.push((0,y.jsx)(Kn.x,{semanticColor:s,size:"small"}))}return 0===a.length&&a.push((0,y.jsx)(Yn.S,{semanticColor:s,size:"small"})),(0,y.jsx)(y.Fragment,{children:a})},Nt=({name:e,id:n,isDefaultDevice:t,terminalType:s,terminalTypeRaw:a,transportType:i,transportTypeRaw:l})=>{const r=W();return(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsxs)(B.p,{className:G.rowName,highlight:!0,children:[(0,y.jsx)(yt,{terminalType:s,transportType:i,isDefaultDevice:t})," ",e]}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,children:n}),(0,y.jsx)(B.p,{className:G.rowValue,children:a}),(0,y.jsx)(B.p,{className:G.rowValue,children:l}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>r(n),children:(0,y.jsx)(V.c,{size:"small"})})})]})},bt=()=>{const e=(0,tt.Y)((e=>e?.item??null)),n=function(){const[e,n]=(0,s.useState)(null),t=(0,Xn.f)();return(0,s.useEffect)((()=>{let e=!0;return t.getPlaybackInfo().then((t=>{e&&n(t)})),()=>{e=!1}}),[t]),(0,et._)(Qn.r.INFO,(({data:e})=>{n(e)})),e}(),t=function(e=null,n=null){const[t,a]=(0,s.useState)(null),i=(0,Xn.f)();return(0,s.useEffect)((()=>{let t=!0,s=null;if(null===e)a(null);else{const l=async()=>{const n=await i.getFiles(e);t&&a(n)};l(),null!==n&&(s=window.setInterval(l,n))}return()=>{t=!1,null!==s&&window.clearInterval(s)}}),[i,e,n]),t}(e?.uri,500),a=(0,nt.g)(),[i,l]=(0,s.useState)([]);return(0,s.useEffect)((()=>{const e=(0,p.G)(),n=new Nn.Hv(e).getAudioOutputDevices({},(e=>{l(e.devices.sort(((e,n)=>e.isDefaultDevice?-1:n.isDefaultDevice?1:e.name.localeCompare(n.name))))}));return()=>{n.cancel()}}),[]),null===e?(0,y.jsx)("div",{className:at,children:"Nothing is currently playing."}):(0,y.jsxs)("div",{className:at,children:[(0,y.jsxs)("div",{className:ut,children:[(0,y.jsx)(te.x,{variant:"bodySmallBold",children:"Forced shuffle"}),(0,y.jsx)(Zn.Z,{id:"forced-shuffe",value:a.getForcedShuffle(),onSelected:e=>{a.setForcedShuffle(e)}})]}),(0,y.jsx)("div",{children:(0,y.jsx)("button",{className:mt,onClick:()=>{a.play({uri:"invalid_context_uri"},{referrerIdentifier:"PlayerStub_UnknownReferrer",featureIdentifier:"debug"})},children:(0,y.jsx)("span",{children:"Clear context"})})}),(0,y.jsx)(K,{title:"Devices",rows:i,cols:[{name:"Name",width:"30%"},{name:"ID"},{name:"Terminal"},{name:"Transport"},{name:"Actions",width:"16px"}],renderRow:e=>(0,y.jsx)(Nt,{...e}),canCollapse:!0}),(0,y.jsx)(K,{title:"Details",rows:[{name:"url"===n?.fileType?"URL":"File ID",value:n?.fileId},{name:"Type",value:n?.fileType},{name:"Codec",value:n?.codecName},{name:"Bitrate",value:xt(n?.fileBitrate,1e3,"k")},{name:"Strategy",value:n?.strategy},{name:"Target Bitrate",value:xt(n?.targetBitrate,1e3,"k")},{name:"Advisted Bitrate",value:xt(n?.advisedBitrate,1e3,"k")},{name:"Target File Available",value:jt(n?.targetFileAvailable)},{name:"Duration (hh:mm)",value:ft(n?.lengthMs)},{name:"Duration (ms)",value:xt(n?.lengthMs,1," ms")},{name:"Speed",value:xt(n?.playbackSpeed)},{name:"Gain Adjustment",value:xt(n?.gainAdjustment)},{name:"Loudness",value:n?.hasLoudness?xt(n?.loudness):void 0}],cols:[{name:"Property",width:"30%"},{name:"Value"},{name:"Actions",width:"16px"}],renderRow:e=>(0,y.jsx)(gt,{...e}),canCollapse:!0}),(0,y.jsx)(K,{title:"Files",rows:t??[],cols:[{name:"Property",width:"30%"},{name:"Value"},{name:"Actions",width:"16px"}],renderRow:n=>(0,y.jsx)(ht,{item:e,file:n},n.fileId),canCollapse:!0,isCollapsedInitially:!0})]})};var kt=t(9004),St=t(27611),wt=t(21682),Ct=t(63046);function Ot(e,n){const t=(0,Ct.o)();(0,s.useEffect)((()=>{const s=t.getEvents();return s.addListener(e,n),()=>{s.removeListener(e,n)}}),[e,n,t])}var At=t(50809),It=t(95077),Tt=t(96207);const Rt="X2I_RYWYpxMLnNlZS4pC",Et="SeONzyUTUcSX69dLCXjf",Pt="a6zsfAU_4iY1od9MSoF4",Dt=({name:e,value:n})=>{const t=W();return(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,highlight:!0,children:e}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,align:"right",children:n}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>t(n),children:(0,y.jsx)(V.c,{size:"small"})})})]})},_t=()=>{const e=(()=>{const e=(0,Ct.o)(),[n,t]=(0,s.useState)(e.getSubscriptions()),a=(0,s.useCallback)((()=>{t(e.getSubscriptions())}),[e,t]);return Ot(wt.f.SUBSCRIBE,a),Ot(wt.f.CANCEL,a),Ot(wt.f.REFRESH,a),n})(),n=W(),t=Object.entries((0,It.v)(e,(e=>`${e.ident}${e.isPrefix?"*":""}`)));return(0,y.jsx)(K,{title:"Subscriptions",rows:t,cols:[{name:"Ident"},{name:"Actions",width:"16px"}],renderRow:([e,t])=>(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsxs)(B.p,{className:G.rowValue,truncate:!0,children:[e," (",t.length,")"]}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>n(e),children:(0,y.jsx)(V.c,{size:"small"})})})]},e),canCollapse:!0})};function Ft(e){if(e.ident.endsWith("/json"))return!0;if(0===e.payloads.length)return!1;const n=(0,At.BB)(e.payloads[0]);return n.length>0&&"{"===n[0]}const Lt=({message:e})=>{const[n,t]=(0,s.useState)(!1),{Editor:a,setContent:i}=Ue({readOnly:!0});return(0,s.useEffect)((()=>{if(0!==e.payloads.length)if(Ft(e)){const n=JSON.parse((0,At.BB)(e.payloads[0]));i(JSON.stringify(n,void 0,2))}else{const n=(0,At.zv)(e.payloads[0]);i(JSON.stringify(n,void 0,2))}}),[e,i]),(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,children:new Date(e.timestamp).toLocaleString()}),(0,y.jsx)(B.p,{className:G.rowName,children:e.ident}),(0,y.jsxs)(B.p,{className:G.rowName,children:[(0,y.jsx)("button",{className:G.rowAction,onClick:()=>t(!n),children:(0,y.jsx)(kt.V,{size:"small"})}),(0,y.jsx)(Tt.q,{isOpen:n,className:Pt,onRequestClose:()=>t(!1),shouldCloseOnEsc:!0,shouldCloseOnBackdropClick:!0,animated:!0,children:a})]})]})},Bt=()=>{const e=(0,Ct.o)(),[n,t]=(0,s.useState)(0),[a,i]=(0,s.useState)(!0);Ot(wt.f.MESSAGE,(()=>{t(n+1)}));const l=a?e.getMessages().filter(Ft):e.getMessages();return(0,y.jsx)(K,{title:"Messages",titleExtra:(0,y.jsxs)("div",{className:Et,children:[(0,y.jsx)(St.z,{id:"json-only",size:"small",checked:a,onChange:()=>i(!a)}),(0,y.jsx)(te.x,{as:"label",htmlFor:"json-only",variant:"marginal",children:"JSON only"})]}),rows:l,cols:[{name:"Time",width:"200px"},{name:"Ident"},{name:"Payload",width:"16px"}],renderRow:(e,n)=>(0,y.jsx)(Lt,{message:e},`${n}-${e.ident}-${e.timestamp}`),canCollapse:!0})},Vt=()=>{const e=(()=>{const e=(0,Ct.o)(),[n,t]=(0,s.useState)(null);(0,s.useEffect)((()=>{e.getConnectionId().then((e=>t(e)))}),[e,t]);const a=(0,s.useCallback)((e=>t(e.data.connectionId)),[t]);return Ot(wt.f.CONNECTION,a),n})();return(0,y.jsxs)("div",{className:Rt,children:[(0,y.jsx)(K,{title:"PubSub",rows:(0,y.jsx)(Dt,{name:"Connection ID",value:e??"-"}),cols:[{name:"Property",width:"30%"},{name:"Value"},{name:"Actions",width:"16px"}]}),(0,y.jsx)(_t,{}),(0,y.jsx)(Bt,{})]})};var Ut=t(49857),Mt=t(82325),zt=t(15671),Jt=t(54960),Ht=t(12618),qt=t(75857),Gt=t(2334),Kt=t(36813),Wt=t(8824),$t=t(4901),Yt=t(65432),Zt=t(41194),Xt=t(14005),Qt=t(39721),es=t(85803),ns=t(67305);const ts=36e5;const ss="HnpguQ3rtX44hdThdwy9",as="y1gsL5scUuLOArVrFYRl",is="Ni7focuLC626smvmOnLP",ls="W5wjtyjHTJPGX5j7_WOp",rs="gbwwwTt68IMGNnwRJ7x7",os=({property:e,value:n,onOverride:t,isOverridden:s})=>{if("int"===e.type||"internal"===e.type)throw Error("Invalid property type for dropdown!");const a="bool"===e.type?["true","false"]:e.values;return(0,y.jsx)(Mt.i,{id:`${e.name}-dropdown`,value:(n??e.default).toString(),onChange:n=>{var s;t(e.name,(s=n.currentTarget.value,"bool"===e.type?"true"===s:s))},className:i()({[ls]:s}),children:a.map((e=>(0,y.jsx)("option",{value:e,children:e},e)))})},cs=({property:e,value:n,onOverride:t,isOverridden:a})=>{if("int"!==e.type)throw Error("Invalid property type for dropdown!");const[l,r]=(0,s.useState)(n??e.default),o=(0,Ut.y1)((n=>{t(e.name,n)}),500);return(0,y.jsx)(ge.y,{type:"number",min:e.lower,max:e.upper,value:l,onChange:e=>{r(e.currentTarget.value),o(Number.parseInt(e.currentTarget.value,10))},className:i()({[ls]:a})})},ds=({property:e,localValue:n,remoteValue:t,experimentUrl:s,isRemoteUserSpecificOverride:a,onOverride:i,filter:l})=>{const r=n!==t,o=e.default.toString(),c=t?.toString();let d=(s||o!==c?c:null)??null;return d&&s&&(d=(0,y.jsxs)("a",{href:s,target:"_blank",className:rs,children:[c,a&&(0,y.jsx)(zt.l,{size:"small"})]}),a&&(d=(0,y.jsx)(Ht.ws,{label:"This value comes from a user-specific override in the linked experiment.",children:d}))),(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsxs)(B.p,{className:G.rowName,title:e.name,highlight:!0,children:[(0,y.jsx)("a",{href:`https://sites.spotify.net/s/hyperlink?path=property-experiments&property=${e.name}`,rel:"noopener noreferrer",target:"_blank",children:l?(0,y.jsx)($t.o,{searchWords:[l??""],textToHighlight:e.name}):e.name}),(0,y.jsx)("div",{className:G.propertyDescription,children:e.description})]}),(0,y.jsx)(B.p,{className:G.rowValue,children:o}),(0,y.jsx)(B.p,{className:G.rowValue,children:d}),(0,y.jsx)(B.p,{className:G.rowValue,children:"bool"===e.type||"enum"===e.type?(0,y.jsx)(os,{property:e,value:n,onOverride:i,isOverridden:r}):"int"===e.type?(0,y.jsx)(cs,{property:e,value:n,onOverride:i,isOverridden:r}):null})]})},us="debugPanelRemoteConfigLastChangedAtByPropertyName",ms=({properties:e,localConfiguration:n,remoteConfiguration:t,setOverrides:a,clearOverrides:i})=>{const{filter:l}=(0,s.useContext)(Yt.fo),r=(0,D.um)(),o=()=>{const e=r.getItem(us);return e instanceof Gt.d||e instanceof Kt.y?{}:e},c=(e,n)=>{a(Jt.VK.fromJSON({[e]:n})),r.setItem(us,{...o(),[e]:Date.now()})},d=(0,s.useRef)(o()),u=e.sort(((e,n)=>(d.current[n.name]??0)-(d.current[e.name]??0)||e.name.localeCompare(n.name))),m=function(){const e=(0,ns.t)(),n=(0,Qt.C)(),t=(0,es.r)()?.username,a=(0,s.useMemo)((()=>Jt.Z9.getPropertySetId({clientId:e.remote_config_client_id},(0,Jt.y6)(),[])),[e.remote_config_client_id]),i=(0,s.useMemo)((()=>{if(!e||!n.data||!t)return null;const s="web-player"===e.remote_config_client_id||"1"===n.data.employee;return{data:{platform:"WEB",clientId:e.remote_config_client_id,country:n.data.country,propertySetKey:a,clientVersion:e.event_sender_context_information?.client_version_string??"",installationId:e.event_sender_context_information?.installation_id??"",oauthClientId:e.event_sender_context_information?.client_id??"",employee:s,catalogue:n.data.catalogue,originPlatform:e.app_platform,originVersion:e.os_version??"",userName:t}}}),[t,e,n.data,a]),{data:l}=(0,Zt.a)({queryKey:["traceback-config"],queryFn:()=>(0,Xt.k)().request("https://remote-configuration-resolver.spotify.net/debug/traceback-config",{method:"POST",responseType:"json",headers:{"content-type":"application/json"},payload:JSON.stringify(i)}).then((e=>{const n=e.body;return Object.fromEntries(n.data.map((e=>[e.name,e])))})),staleTime:5e3,gcTime:ts,refetchInterval:ts,refetchOnWindowFocus:!1,enabled:!!i});return l??{}}();return(0,y.jsxs)("div",{className:as,children:[(0,y.jsxs)("div",{className:is,children:[(0,y.jsx)(se.P,{size:"small",onClick:()=>{i(),r.clearItem(us)},children:"Clear local overrides"}),(0,y.jsx)(Wt.K,{placeholder:"Find",alwaysExpanded:!0})]}),(0,y.jsx)(M.x,{children:(0,y.jsxs)(H.i,{children:[(0,y.jsxs)("colgroup",{children:[(0,y.jsx)("col",{width:"30%"}),(0,y.jsx)("col",{}),(0,y.jsx)("col",{})]}),(0,y.jsxs)("tbody",{children:[(0,y.jsxs)(L.S,{children:[(0,y.jsx)(q.x,{className:G.rowHeader,children:"Name"}),(0,y.jsx)(q.x,{className:G.rowHeader,children:"Default"}),(0,y.jsx)(q.x,{className:G.rowHeader,children:"Remote"}),(0,y.jsx)(q.x,{className:G.rowHeader,children:"Local"})]}),u.filter((e=>-1!==e.name.toLowerCase().indexOf(l.toLowerCase()))).map((e=>(0,y.jsx)(ds,{property:e,localValue:n.getValue(e.name),remoteValue:t.getValue(e.name),experimentUrl:m?.[e.name]?.experimentRef?.experimentUrl,isRemoteUserSpecificOverride:m?.[e.name]?.isOverride??!1,onOverride:c,filter:l},e.name)))]})]})})]})},ps=()=>{const e=[...(0,Jt.y6)()],{localConfiguration:n,remoteConfiguration:t,setOverrides:s,clearOverrides:a}=(0,qt.j)();return(0,y.jsx)("div",{className:ss,children:(0,y.jsx)(Yt.hz,{uri:"spotify:internal:debug:remote-config-properties",children:(0,y.jsx)(ms,{properties:e,localConfiguration:n,remoteConfiguration:t,setOverrides:s,clearOverrides:a})})})};var hs=t(75802),vs=t(11317);const xs="mHtMWLOMN_lZh6Eq1lBe",js="MNRz4Pg1lZNyfjDZ3N6M",fs=()=>{const e=(0,hs.TH)(),n=(0,hs.s0)(),t=e=>{const t=(0,vs.EC)(e);t&&n(t.toURLPath(!0),{state:{preventMoveFocus:!0}})},s=(0,vs.EC)(e.pathname);return(0,y.jsxs)("div",{className:xs,children:[(0,y.jsxs)("form",{onSubmit:e=>{e.preventDefault();const n=new FormData(e.target).get("navigateTo").toString(),s=new URL(n,"https://open.spotify.com");s.hostname&&s.pathname?t(s.pathname):t(n)},className:js,children:[(0,y.jsx)("label",{htmlFor:"navigate-input",children:"Navigate to"}),(0,y.jsx)(te.x,{variant:"bodySmall",as:"input",style:{color:Jn.Snx},name:"navigateTo",id:"navigate-input",type:"text",placeholder:"ex. /search/nirvana",onKeyDown:e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.stopPropagation()}})]}),(0,y.jsx)("h2",{children:"Current location:"}),(0,y.jsxs)("ul",{children:[(0,y.jsxs)("li",{children:["Location: ",e.pathname]}),e.search&&(0,y.jsxs)("li",{children:["Search params: ?",e.search]}),e.hash&&(0,y.jsxs)("li",{children:["Hash params: #",e.hash]}),s?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("li",{children:["URL: ",s.toURL()]}),(0,y.jsxs)("li",{children:["URI: ",s.toURI()]})]}):(0,y.jsx)("li",{children:"Not parseable as a Spotify URI!"}),(0,y.jsxs)("li",{children:["Location state: ",(0,y.jsx)("pre",{children:JSON.stringify(e.state,null,2)})]})]})]})};var gs=t(77855),ys=t(34755),Ns=t(40257),bs=t(17950),ks=t(36353),Ss=t(83673),ws=t(94948),Cs=t(25566),Os=t(39861),As=function(e){return e.IPL="IN_PERSON",e.RGS="REMOTE",e}(As||{});var Is=t(41887),Ts=t(68007),Rs=t(51550);function Es({obj:e}){return(0,y.jsx)(H.i,{children:(0,y.jsx)("tbody",{children:Object.entries(e).map((e=>(0,y.jsx)(Ps,{name:e[0],value:e[1]},e[0])))})})}function Ps({name:e,value:n}){const t=W();let s;return"string"==typeof n||"number"==typeof n?s=n:"boolean"==typeof n?s=(0,y.jsx)(Is.N,{defaultChecked:n,isActive:!1,onClick:e=>{e.preventDefault()}}):"object"==typeof n&&(s=(0,y.jsx)(Es,{obj:n})),(0,y.jsxs)(L.S,{hover:!0,children:[(0,y.jsx)(B.p,{className:G.rowName,highlight:!0,children:e}),(0,y.jsx)(B.p,{className:G.rowValue,truncate:!0,align:"right",children:s}),(0,y.jsx)(B.p,{className:G.rowActions,children:(0,y.jsx)("button",{className:G.rowAction,onClick:()=>{void 0!==n&&t("object"==typeof n?JSON.stringify(n):n.toString())},children:(0,y.jsx)(V.c,{size:"small"})})})]})}const Ds=[{title:"Current Session",Component:()=>{const{currentSession:e,refreshCurrentSession:n}=(0,Os.A)();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Ts.o,{iconOnly:Rs.t,onClick:()=>{n()}}),(0,y.jsx)(M.x,{children:e&&(0,y.jsxs)(H.i,{children:[(0,y.jsxs)("colgroup",{children:[(0,y.jsx)("col",{width:"30%"}),(0,y.jsx)("col",{}),(0,y.jsx)("col",{width:"16px"})]}),(0,y.jsx)("tbody",{children:Object.entries(e).map((e=>(0,y.jsx)(Ps,{name:e[0],value:e[1]},e[0])))})]})})]})}},{title:"Create New Session",Component:()=>{const{createSession:e}=(0,Os.A)(),[n,t]=(0,s.useState)(null),[a,i]=(0,s.useState)(As.IPL),l=(0,b.I0)();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{children:"Create a new session as your current user (does nothing if you already have a session)"}),(0,y.jsxs)("div",{className:G.rowControl,children:[(0,y.jsxs)(S.v,{id:"sessionTypeDropdown",value:a,onSelect:e=>{switch(e){case As.IPL:i(As.IPL);break;case As.RGS:i(As.RGS);break;default:i(As.IPL)}},children:[(0,y.jsx)("option",{value:As.IPL,children:As.IPL},As.IPL),(0,y.jsx)("option",{value:As.RGS,children:As.RGS},As.RGS)]}),(0,y.jsx)(k.D,{onClick:async n=>{n.preventDefault();const s=await e();t(s)},children:"Create"})]}),(0,y.jsx)(se.P,{onClick:()=>{l((0,ws.xX)(Cs.q4.INVITE))},style:{marginTop:ks.mG},children:"Open invitation modal"}),null!==n&&(0,y.jsx)(Ss.B,{value:JSON.stringify(n,null,2),readOnly:!0})]})}},{title:"Leave Current Session",Component:()=>{const{leaveSession:e,currentSession:n}=(0,Os.A)(),[t,a]=(0,s.useState)(null);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:G.rowName,children:"Leave your current session"}),(0,y.jsxs)("div",{className:G.rowControl,children:[(0,y.jsx)(ge.y,{value:n?.sessionId??"",readOnly:!0}),(0,y.jsx)(k.D,{onClick:async t=>{if(t.preventDefault(),!n)return;const s=await e();a(s)},children:"Leave"})]}),null!==t&&(0,y.jsx)(Ss.B,{value:JSON.stringify(t,null,2),readOnly:!0})]})}},{title:"Delete Current Session",Component:()=>{const{currentSession:e,deleteSession:n}=(0,Os.A)(),[t,a]=(0,s.useState)(null);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:G.rowName,children:"Delete your current session"}),(0,y.jsxs)("div",{className:G.rowControl,children:[(0,y.jsx)(ge.y,{value:e?.sessionId??"",readOnly:!0}),(0,y.jsx)(k.D,{onClick:async t=>{if(t.preventDefault(),!e)return;const s=await n();a(s)},children:"Delete"})]}),null!==t&&(0,y.jsx)(Ss.B,{value:JSON.stringify(t,null,2),readOnly:!0})]})}},{title:"Join Session as Guest",Component:()=>{const[e,n]=(0,s.useState)(""),t=(0,b.I0)(),a=(0,hs.s0)();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:G.rowName,children:"Join somebody else's session (paste join token or join URI)"}),(0,y.jsxs)("div",{className:G.rowControl,children:[(0,y.jsx)(ge.y,{value:e,onChange:e=>n(e.currentTarget.value)}),(0,y.jsx)(k.D,{onClick:async n=>{n.preventDefault();const s=(0,vs.EC)(e);s&&(0,vs._s)(s)?a(s.toURLPath(!0)):t((0,ws.xX)(Cs.q4.JOIN,e))},children:"Join"})]})]})}}],_s=()=>{const[e,n]=(0,s.useState)(-1);return(0,y.jsxs)("div",{className:xs,children:[(0,y.jsx)("h1",{children:"Social Connect!"}),(0,y.jsx)(gs.U,{children:Ds.map(((t,s)=>(0,y.jsxs)(ys.Q,{children:[(0,y.jsx)(Ns.i,{className:G.rowHeader,onClick:t=>{t.preventDefault(),n(s===e?-1:s)},isExpanded:s===e,children:t.title}),(0,y.jsx)(bs.v,{isExpanded:s===e,children:t.Component&&(0,y.jsx)(t.Component,{})})]},`${s}-item`)))})]})};var Fs=t(24194);const Ls="EpKDeW2JglvI1Jul9PDh",Bs="g2miUZeGB9MKVvwZBLXH",Vs=()=>{const{value:e,setValue:n,clearStoredKeyValue:t,clearSessionStorage:s}=(0,Fs.useSessionStorage)("eligibility"),{value:a,setValue:i,clearStoredKeyValue:l}=(0,Fs.useSessionStorage)("datetime");return(0,y.jsxs)("div",{className:Ls,children:[(0,y.jsx)("h1",{children:"Premium Page Debug"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{children:"Override Eligiiblity"}),(0,y.jsxs)("select",{className:Bs,value:e,onChange:e=>n(e.target.value),children:[(0,y.jsx)("option",{}),(0,y.jsx)("option",{value:"INTRO_ELIGIBLE",children:"INTRO_ELIGIBLE"}),(0,y.jsx)("option",{value:"NON_INTRO_ELIGIBLE",children:"NON_INTRO_ELIGIBLE"}),(0,y.jsx)("option",{value:"WINBACK",children:"WINBACK"})]}),(0,y.jsx)(k.D,{className:Ls,size:"small",onClick:()=>t("eligibility"),children:"Remove Eligiblity Override"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{children:"Override Date"}),(0,y.jsx)("input",{className:Bs,type:"datetime-local",value:a,onChange:e=>i(e.target.value)}),(0,y.jsx)(k.D,{size:"small",onClick:()=>l("datetime"),children:"Remove Date/Time Override"})]}),(0,y.jsx)(k.D,{size:"small",onClick:s,children:"Remove All Overrides"})]})};var Us=t(17676),Ms=t(58568),zs=t(55512),Js=t(65441),Hs=t(7627),qs=t(65786),Gs=(t(20069),t(53724));const Ks={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"lookupDebug"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uris"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lookup"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uris"},value:{kind:"Variable",name:{kind:"Name",value:"uris"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"lookupResult"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"lookupResult"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"LookupResult"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AlbumResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeAlbum"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ArtistResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeArtist"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EpisodeOrChapterResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeEpisode"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeChapter"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlaylistResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homePlaylist"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PodcastOrAudiobookResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homePodcast"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeAudiobook"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TrackResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeTrack"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UserResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"homeUser"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UnknownTypeWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_uri"}}]}}]}},...Gs.c.definitions,...Gs.Iv.definitions,...Gs.pM.definitions,...Gs.oZ.definitions,...Gs.ZZ.definitions,...Gs.Uh.definitions,...Gs.b4.definitions,...Gs.iw.definitions,...Gs.dX.definitions,...Gs.fd.definitions]};var Ws=t(60886),$s=t(62648);const Ys="u52EO0zzXPDFTTlWPw5O",Zs="xj_2z64kLq0lRP2TaIXN";function Xs(e){return Boolean(e)}function Qs(e){return(0,Ws.sf)(e)}const ea=()=>{const{request:e}=(0,s.useContext)(Js.Ax),[n,t]=(0,qs.z)($s._,[]),[a,i]=(0,s.useState)(""),l=async()=>{if(!function(e){const n=(0,vs.EC)(e);return!(!n||(0,vs.zO)(n)||n?.id===vs.JM.COLLECTION||!(!n||(0,vs.YF)(n)||(0,vs.OB)(n)||(0,vs.hn)(n)||(0,vs.Kv)(n)||(0,vs.wj)(n)||(0,vs.RS)(n)||(0,vs.CA)(n)))}(a))return;const s=await(0,Hs.J)(e,Ks,{uris:[a]}),i=s?.data?.lookup.map(Qs).filter(Xs)||[];t(i.concat(n))};return(0,y.jsxs)("div",{className:Ys,children:[(0,y.jsx)("h1",{children:"Home"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("h2",{children:"Shortcuts override"}),(0,y.jsxs)(Ms.c,{label:"Entity URI to add",labelFor:"shortcut_to_add",children:[(0,y.jsx)(ge.y,{id:"shortcut_to_add",type:"text",placeholder:"spotify:episode:123123",value:a,onChange:e=>i(e.currentTarget.value)}),(0,y.jsxs)(zs.C,{children:["Right now we only allow: Artist, Album, Audiobook, Podcast, Track, User, Playlist, Episode and Chapter.",(0,y.jsx)("br",{})," For more info check the HomeV2ShortcutsShelf logic."]})]}),(0,y.jsx)(k.D,{size:"small",className:Zs,disabled:0===a.length,onClick:()=>{l()},children:"Add to Shortcuts"}),(0,y.jsx)(k.D,{size:"small",className:Zs,onClick:()=>{t([])},children:"Clear all overrides"})]})]})},na="wjncHEmBUc7V8RZYdENw",ta="uyHngn_fJez61BsFl3tA",sa="J2KhtXbDovVMDOMzv1Jy",aa="h5nLocSUS3w2NB53IdWQ",ia="debugWindowActiveTabGroup",la="debugWindowActiveTabIndex",ra=()=>{const e=(0,Xn.f)().getCapabilities().canGetFiles,n=(0,_.Y)(),t=(0,P.ky)(),a=(0,d.W6)(Us.yaB);(0,s.useEffect)((()=>{t&&(t.title="Spotify Debug Window")}),[t]);const u=(0,s.useMemo)((()=>Object.fromEntries(Object.entries({Page:[null].filter(F.K),Authorization:[{label:"Access Token",Panel:Y}],Playback:[e?{label:"Playback",Panel:bt}:null,{label:"Connect",Panel:ne},n?{label:"Social Connect",Panel:_s}:null].filter(F.K),"Data Fetching":[{label:"Esperanto",Panel:zn},{label:"PubSub",Panel:Vt},null].filter(F.K),UI:[{label:"Routing",Panel:fs}].filter(F.K),Other:[{label:"Remote Config",Panel:ps},{label:"Ads",Panel:N},{label:"In-App Messaging",Panel:R},{label:"Your DJ",Panel:E.Fh},{label:"Home",Panel:ea},{label:"Premium Page",Panel:Vs}].filter(F.K)}).filter((([e,n])=>n.length>0)))),[e,n]),m=Object.keys(u),p=(0,D.um)(),h=p.getItem(ia),v="string"==typeof h&&h in u?h:m[0],[x,j]=(0,s.useState)(v),f=p.getItem(la),g="number"==typeof f&&f in u[x]?f:0,[b,k]=(0,s.useState)(g),S=u[x][b].Panel;return(0,y.jsx)("div",{className:i()("encore-dark-theme","encore-layout-themes",{"vertical-metrics":a}),children:(0,y.jsxs)("div",{className:na,children:[(0,y.jsx)(l.W,{className:ta,children:(0,y.jsx)(r.b,{flexMobile:!0,children:m.map((e=>(0,y.jsxs)(s.Fragment,{children:[(0,y.jsx)(o.W,{children:e}),u[e].map(((n,t)=>(0,y.jsx)(c._,{active:x===e&&b===t,label:n.label,onClick:()=>{j(e),p.setItem(ia,e),k(t),p.setItem(la,t)},className:sa,children:n.label},n.label)))]},e)))})}),(0,y.jsx)("div",{className:aa,children:(0,y.jsx)(S,{})})]})})}},85803:(e,n,t)=>{t.d(n,{r:()=>i});t(86277);var s=t(35869),a=t(82857);const i=()=>{const e=(0,s.v9)((e=>e.session?.user));return e?{type:a.p.USER,uri:e.uri,username:e.id,displayName:e.display_name??null,images:e.images.map((({url:e,width:n,height:t})=>({url:e,width:n||void 0,height:t||void 0})))}:null}}}]);
//# sourceMappingURL=xpui-debug-window-contents.js.map