dotfiles/.config/spicetify/CustomApps/marketplace/extension.js

3 lines
53 KiB
JavaScript
Raw Normal View History

2024-07-11 00:01:49 +05:30
"use strict";var marketplace=(()=>{var f=Object.create,i=Object.defineProperty,r=Object.defineProperties,u=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t=t||{})h.call(t,r)&&c(e,r,t[r]);if(a)for(var r of a(t))o.call(t,r)&&c(e,r,t[r]);return e},p=(e,t)=>r(e,n(t));e={"node_modules/chroma-js/chroma.js"(e,t){var r;r=function(){for(var e=function(e,t,r){return void 0===r&&(r=1),e<(t=void 0===t?0:t)?t:r<e?r:e},I=e,q={},t=0,U=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];t<U.length;t+=1){var F=U[t];q["[object "+F+"]"]=F.toLowerCase()}function r(e){return q[Object.prototype.toString.call(e)]||"object"}function D(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if("object"===V(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=!1;if(!(o=J(e))){r=!0,f.sorted||(f.autodetect=f.autodetect.sort(function(e,t){return t.p-e.p}),f.sorted=!0);for(var n=0,a=f.autodetect;n<a.length;n+=1){var o,c=a[n];if(o=c.test.apply(c,e))break}}if(!f.format[o])throw new Error("unknown format: "+e);r=f.format[o].apply(null,r?e:e.slice(0,-1)),this._rgb=X(r),3===this._rgb.length&&this._rgb.push(1)}function n(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(n.Color,[null].concat(e)))}function G(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Q(e,"cmyk"))[0],n=e[1],a=e[2],o=e[3],c=4<e.length?e[4]:1;return 1===o?[0,0,0,c]:[1<=r?0:255*(1-r)*(1-o),1<=n?0:255*(1-n)*(1-o),1<=a?0:255*(1-a)*(1-o),c]}function a(e){return Math.round(100*e)/100}function W(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,a=(e=ce(e,"rgba"))[0],o=e[1],c=e[2],f=(a/=255,o/=255,c/=255,Math.min(a,o,c)),i=Math.max(a,o,c),u=(i+f)/2;return i===f?(r=0,n=Number.NaN):r=u<.5?(i-f)/(i+f):(i-f)/(2-i-f),a==i?n=(o-c)/(i-f):o==i?n=2+(c-a)/(i-f):c==i&&(n=4+(a-o)/(i-f)),(n*=60)<0&&(n+=360),3<e.length&&void 0!==e[3]?[n,r,u,e[3]]:[n,r,u]}function B(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=fe(e,"rgba"),n=ie(e)||"rgb";return"hsl"==n.substr(0,3)?ue(le(r),n):(r[0]=se(r[0]),r[1]=se(r[1]),r[2]=se(r[2]),("rgba"===n||3<r.length&&r[3]<1)&&(r[3]=3<r.length?r[3]:1,n="rgba"),n+"("+r.slice(0,"rgb"===n?3:4).join(",")+")")}function T(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,a,o=(e=he(e,"hsl"))[0],c=e[1],f=e[2];if(0===c)r=n=a=255*f;else{var i=[0,0,0],u=[0,0,0],l=f<.5?f*(1+c):f+c-f*c,s=2*f-l,c=o/360;i[0]=c+1/3,i[1]=c,i[2]=c-1/3;for(var h=0;h<3;h++)i[h]<0&&(i[h]+=1),1<i[h]&&--i[h],u[h]=6*i[h]<1?s+6*(l-s)*i[h]:2*i[h]<1?l:3*i[h]<2?s+(l-s)*(2/3-i[h])*6:s;r=(f=[de(255*u[0]),de(255*u[1]),de(255*u[2])])[0],n=f[1],a=f[2]}return 3<e.length?[r,n,a,e[3]]:[r,n,a,1]}function z(e){var t,r;if(e=e.toLowerCase().trim(),be.format.named)try{return be.format.named(e)}catch(e){}if(t=e.match(ge)){for(var n=t.slice(1,4),a=0;a<3;a++)n[a]=+n[a];return n[3]=1,n}if(t=e.match(me)){for(var o=t.slice(1,5),c=0;c<4;c++)o[c]=+o[c];return o}if(t=e.match(ve)){for(var f=t.slice(1,4),i=0;i<3;i++)f[i]=Me(2.55*f[i]);return f[3]=1,f}if(t=e.match(ye)){for(var u=t.slice(1,5),l=0;l<3;l++)u[l]=Me(2.55*u[l]);return u[3]=+u[3],u}return(t=e.match(we))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(r=pe(r))[3]=1,r):(t=e.match(ke))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(e=pe(r))[3]=+t[4],e):void 0}var Y=r,H=r,o=Math.PI,e={clip_rgb:function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var t=0;t<=3;t++)t<3?((e[t]<0||255<e[t])&&(e._clipped=!0),e[t]=I(e[t],0,255)):3===t&&(e[t]=I(e[t],0,1));return e},limit:e,type:r,unpack:function(t,e){return void 0===e&&(e=null),3<=t.length?Array.prototype.slice.call(t):"object"==Y(t[0])&&e?e.split("").filter(function(e){return void 0!==t[0][e]}).map(function(e){return t[0][e]}):t[0]},last:function(e){var t;return!(e.length<2)&&(t=e.length-1,"string"==H(e[t]))?e[t].toLowerCase
`)+t.code+`
`,""),e.innerHTML=t,e.classList.add("marketplaceSnippets"),document.body.appendChild(e),x(g,[]).forEach(e=>{if((e=x(e))&&e.extensionURL){console.debug("Initializing extension: ",e);var t=document.createElement("script");if(t.defer=!0,t.src=e.extensionURL,j(t.src)){var{user:r,repo:n,branch:a,filePath:o}=E(e.extensionURL);if(!(r&&n&&a&&o))return;t.src=`https://cdn.jsdelivr.net/gh/${r}/${n}@${a}/`+o}t.src=t.src+"?time="+Date.now(),document.body.appendChild(t),P(null==(r=e.manifest)?void 0:r.main)}})})(),async function(){console.debug("Preloading extensions and themes..."),window.sessionStorage.clear();var e=await(await fetch("https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/resources/blacklist.json").then(e=>e.json()).catch(()=>({}))).repos;window.sessionStorage.setItem("marketplace:blacklist",JSON.stringify(e)),await Promise.all([A("extension",1),A("theme",1)])}()})();