mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 17:53:16 +00:00
1 line
No EOL
15 KiB
JavaScript
Vendored
1 line
No EOL
15 KiB
JavaScript
Vendored
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"+lRy":function(e,t){},0:function(e,t,r){r("JO1w"),r("+lRy"),r("xWuY"),r("YfGV"),e.exports=r("RvBz")},"8oxB":function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l,u=[],c=!1,f=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):f=-1,u.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=u.length;t;){for(l=u,u=[];++f<t;)l&&l[f].run();f=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function w(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=w,o.addListener=w,o.once=w,o.off=w,o.removeListener=w,o.removeAllListeners=w,o.emit=w,o.prependListener=w,o.prependOnceListener=w,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},JO1w:function(e,t,r){window._=r("LvDl"),window.Popper=r("8L3F").default,window.pixelfed=window.pixelfed||{},window.$=window.jQuery=r("EVdn"),r("SYky"),window.axios=r("vDqi"),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",r("KGuw"),window.blurhash=r("oL3X");var n=document.head.querySelector('meta[name="csrf-token"]');n?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=n.content:console.error("CSRF token not found."),window.App=window.App||{},window.App.redirect=function(){document.querySelectorAll("a").forEach((function(e,t){var r=e.getAttribute("href");if(r&&r.length>5&&r.startsWith("https://")){var n=new URL(r);n.host!==window.location.host&&"/i/redirect"!==n.pathname&&e.setAttribute("href","/i/redirect?url="+encodeURIComponent(r))}}))},window.App.boot=function(){new Vue({el:"#content"})},window.App.util={compose:{post:function(){var e=window.location.pathname;["/","/timeline/public"].includes(e)?$("#composeModal").modal("show"):window.location.href="/?a=co"},circle:function(){console.log("Unsupported method.")},collection:function(){console.log("Unsupported method.")},loop:function(){console.log("Unsupported method.")},story:function(){console.log("Unsupported method.")}},time:function(){return new Date},version:1,format:{count:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-GB",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compact";return e<1?0:new Intl.NumberFormat(t,{notation:r,compactDisplay:"short"}).format(e)},timeAgo:function(e){var t=Date.parse(e),r=Math.floor((new Date-t)/1e3),n=Math.floor(r/63072e3);return n>=1?n+"y":(n=Math.floor(r/604800))>=1?n+"w":(n=Math.floor(r/86400))>=1?n+"d":(n=Math.floor(r/3600))>=1?n+"h":(n=Math.floor(r/60))>=1?n+"m":Math.floor(r)+"s"}},filters:[["1977","filter-1977"],["Aden","filter-aden"],["Amaro","filter-amaro"],["Ashby","filter-ashby"],["Brannan","filter-brannan"],["Brooklyn","filter-brooklyn"],["Charmes","filter-charmes"],["Clarendon","filter-clarendon"],["Crema","filter-crema"],["Dogpatch","filter-dogpatch"],["Earlybird","filter-earlybird"],["Gingham","filter-gingham"],["Ginza","filter-ginza"],["Hefe","filter-hefe"],["Helena","filter-helena"],["Hudson","filter-hudson"],["Inkwell","filter-inkwell"],["Kelvin","filter-kelvin"],["Kuno","filter-juno"],["Lark","filter-lark"],["Lo-Fi","filter-lofi"],["Ludwig","filter-ludwig"],["Maven","filter-maven"],["Mayfair","filter-mayfair"],["Moon","filter-moon"],["Nashville","filter-nashville"],["Perpetua","filter-perpetua"],["Poprocket","filter-poprocket"],["Reyes","filter-reyes"],["Rise","filter-rise"],["Sierra","filter-sierra"],["Skyline","filter-skyline"],["Slumber","filter-slumber"],["Stinson","filter-stinson"],["Sutro","filter-sutro"],["Toaster","filter-toaster"],["Valencia","filter-valencia"],["Vesper","filter-vesper"],["Walden","filter-walden"],["Willow","filter-willow"],["X-Pro II","filter-xpro-ii"]],filterCss:{"filter-1977":"sepia(.5) hue-rotate(-30deg) saturate(1.4)","filter-aden":"sepia(.2) brightness(1.15) saturate(1.4)","filter-amaro":"sepia(.35) contrast(1.1) brightness(1.2) saturate(1.3)","filter-ashby":"sepia(.5) contrast(1.2) saturate(1.8)","filter-brannan":"sepia(.4) contrast(1.25) brightness(1.1) saturate(.9) hue-rotate(-2deg)","filter-brooklyn":"sepia(.25) contrast(1.25) brightness(1.25) hue-rotate(5deg)","filter-charmes":"sepia(.25) contrast(1.25) brightness(1.25) saturate(1.35) hue-rotate(-5deg)","filter-clarendon":"sepia(.15) contrast(1.25) brightness(1.25) hue-rotate(5deg)","filter-crema":"sepia(.5) contrast(1.25) brightness(1.15) saturate(.9) hue-rotate(-2deg)","filter-dogpatch":"sepia(.35) saturate(1.1) contrast(1.5)","filter-earlybird":"sepia(.25) contrast(1.25) brightness(1.15) saturate(.9) hue-rotate(-5deg)","filter-gingham":"contrast(1.1) brightness(1.1)","filter-ginza":"sepia(.25) contrast(1.15) brightness(1.2) saturate(1.35) hue-rotate(-5deg)","filter-hefe":"sepia(.4) contrast(1.5) brightness(1.2) saturate(1.4) hue-rotate(-10deg)","filter-helena":"sepia(.5) contrast(1.05) brightness(1.05) saturate(1.35)","filter-hudson":"sepia(.25) contrast(1.2) brightness(1.2) saturate(1.05) hue-rotate(-15deg)","filter-inkwell":"brightness(1.25) contrast(.85) grayscale(1)","filter-kelvin":"sepia(.15) contrast(1.5) brightness(1.1) hue-rotate(-10deg)","filter-juno":"sepia(.35) contrast(1.15) brightness(1.15) saturate(1.8)","filter-lark":"sepia(.25) contrast(1.2) brightness(1.3) saturate(1.25)","filter-lofi":"saturate(1.1) contrast(1.5)","filter-ludwig":"sepia(.25) contrast(1.05) brightness(1.05) saturate(2)","filter-maven":"sepia(.35) contrast(1.05) brightness(1.05) saturate(1.75)","filter-mayfair":"contrast(1.1) brightness(1.15) saturate(1.1)","filter-moon":"brightness(1.4) contrast(.95) saturate(0) sepia(.35)","filter-nashville":"sepia(.25) contrast(1.5) brightness(.9) hue-rotate(-15deg)","filter-perpetua":"contrast(1.1) brightness(1.25) saturate(1.1)","filter-poprocket":"sepia(.15) brightness(1.2)","filter-reyes":"sepia(.75) contrast(.75) brightness(1.25) saturate(1.4)","filter-rise":"sepia(.25) contrast(1.25) brightness(1.2) saturate(.9)","filter-sierra":"sepia(.25) contrast(1.5) brightness(.9) hue-rotate(-15deg)","filter-skyline":"sepia(.15) contrast(1.25) brightness(1.25) saturate(1.2)","filter-slumber":"sepia(.35) contrast(1.25) saturate(1.25)","filter-stinson":"sepia(.35) contrast(1.25) brightness(1.1) saturate(1.25)","filter-sutro":"sepia(.4) contrast(1.2) brightness(.9) saturate(1.4) hue-rotate(-10deg)","filter-toaster":"sepia(.25) contrast(1.5) brightness(.95) hue-rotate(-15deg)","filter-valencia":"sepia(.25) contrast(1.1) brightness(1.1)","filter-vesper":"sepia(.35) contrast(1.15) brightness(1.2) saturate(1.3)","filter-walden":"sepia(.35) contrast(.8) brightness(1.25) saturate(1.4)","filter-willow":"brightness(1.2) contrast(.85) saturate(.05) sepia(.2)","filter-xpro-ii":"sepia(.45) contrast(1.25) brightness(1.75) saturate(1.3) hue-rotate(-5deg)"},emoji:["😂","💯","❤️","🙌","👏","👌","😍","😯","😢","😅","😁","🙂","😎","😀","🤣","😃","😄","😆","😉","😊","😋","😘","😗","😙","😚","🤗","🤩","🤔","🤨","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😪","😫","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","🙁","😖","😞","😟","😤","😭","😦","😧","😨","😩","🤯","😬","😰","😱","😳","🤪","😵","😡","😠","🤬","😷","🤒","🤕","🤢","🤮","🤧","😇","🤠","🤡","🤥","🤫","🤭","🧐","🤓","😈","👿","👹","👺","💀","👻","👽","🤖","💩","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🤲","👐","🤝","👍","👎","👊","✊","🤛","🤜","🤞","✌️","🤟","🤘","👈","👉","👆","👇","☝️","✋","🤚","🖐","🖖","👋","🤙","💪","🖕","✍️","🙏","💍","💄","💋","👄","👅","👂","👃","👣","👁","👀","🧠","🗣","👤","👥"],embed:{post:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=e+"/embed?";return o+=t?"caption=true&":"caption=false&",o+=r?"likes=true&":"likes=false&",'<iframe src="'+(o+="compact"==n?"layout=compact":"layout=full")+'" class="pixelfed__embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script async defer src="'+window.location.origin+'/embed.js"><\/script>'},profile:function(e){return'<iframe src="'+(e+"/embed")+'" class="pixelfed__embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script async defer src="'+window.location.origin+'/embed.js"><\/script>'}},clipboard:function(e){return navigator.clipboard.writeText(e)},navatar:function(){$("#navbarDropdown .far").addClass("d-none"),$("#navbarDropdown img").attr("src",window._sharedData.curUser.avatar).removeClass("d-none").addClass("rounded-circle border shadow").attr("width",34).attr("height",34)}}},KZQ9:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("Sdi+"),o=r("MFRG"),a=r("qsxg");t.default=function(e,t,r,i,s){if(i<1||i>9||s<1||s>9)throw new a.ValidationError("BlurHash must have between 1 and 9 components");if(t*r*4!==e.length)throw new a.ValidationError("Width and height must match the pixels array");for(var l=[],u=function(n){for(var a=function(a){var i=0==a&&0==n?1:2,s=function(e,t,r,n){for(var a=0,i=0,s=0,l=4*t,u=0;u<t;u++)for(var c=0;c<r;c++){var f=n(u,c);a+=f*o.sRGBToLinear(e[4*u+0+c*l]),i+=f*o.sRGBToLinear(e[4*u+1+c*l]),s+=f*o.sRGBToLinear(e[4*u+2+c*l])}var h=1/(t*r);return[a*h,i*h,s*h]}(e,t,r,(function(e,o){return i*Math.cos(Math.PI*a*e/t)*Math.cos(Math.PI*n*o/r)}));l.push(s)},s=0;s<i;s++)a(s)},c=0;c<s;c++)u(c);var f,h,d=l[0],p=l.slice(1),w="",g=i-1+9*(s-1);if(w+=n.encode83(g,1),p.length>0){var m=Math.max.apply(Math,p.map((function(e){return Math.max.apply(Math,e)}))),b=Math.floor(Math.max(0,Math.min(82,Math.floor(166*m-.5))));f=(b+1)/166,w+=n.encode83(b,1)}else f=1,w+=n.encode83(0,1);return w+=n.encode83((h=d,(o.linearTosRGB(h[0])<<16)+(o.linearTosRGB(h[1])<<8)+o.linearTosRGB(h[2])),4),p.forEach((function(e){w+=n.encode83(function(e,t){return 19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o.signPow(e[0]/t,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o.signPow(e[1]/t,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o.signPow(e[2]/t,.5)+9.5))))}(e,f),2)})),w}},MFRG:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sRGBToLinear=function(e){var t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},t.linearTosRGB=function(e){var t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.round(12.92*t*255+.5):Math.round(255*(1.055*Math.pow(t,1/2.4)-.055)+.5)},t.sign=function(e){return e<0?-1:1},t.signPow=function(e,r){return t.sign(e)*Math.pow(Math.abs(e),r)}},RvBz:function(e,t){},"Sdi+":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"];t.decode83=function(e){for(var t=0,r=0;r<e.length;r++){var o=e[r];t=83*t+n.indexOf(o)}return t},t.encode83=function(e,t){for(var r="",o=1;o<=t;o++){var a=Math.floor(e)/Math.pow(83,t-o)%83;r+=n[Math.floor(a)]}return r}},YfGV:function(e,t){},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},oL3X:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("oWFt");t.decode=n.default,t.isBlurhashValid=n.isBlurhashValid;var o=r("KZQ9");t.encode=o.default,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r("qsxg"))},oWFt:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("Sdi+"),o=r("MFRG"),a=r("qsxg"),i=function(e){if(!e||e.length<6)throw new a.ValidationError("The blurhash string must be at least 6 characters");var t=n.decode83(e[0]),r=Math.floor(t/9)+1,o=t%9+1;if(e.length!==4+2*o*r)throw new a.ValidationError("blurhash length mismatch: length is "+e.length+" but it should be "+(4+2*o*r))};t.isBlurhashValid=function(e){try{i(e)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}};var s=function(e){var t=e>>16,r=e>>8&255,n=255&e;return[o.sRGBToLinear(t),o.sRGBToLinear(r),o.sRGBToLinear(n)]},l=function(e,t){var r=Math.floor(e/361),n=Math.floor(e/19)%19,a=e%19;return[o.signPow((r-9)/9,2)*t,o.signPow((n-9)/9,2)*t,o.signPow((a-9)/9,2)*t]};t.default=function(e,t,r,a){i(e),a|=1;for(var u=n.decode83(e[0]),c=Math.floor(u/9)+1,f=u%9+1,h=(n.decode83(e[1])+1)/166,d=new Array(f*c),p=0;p<d.length;p++)if(0===p){var w=n.decode83(e.substring(2,6));d[p]=s(w)}else{w=n.decode83(e.substring(4+2*p,6+2*p));d[p]=l(w,h*a)}for(var g=4*t,m=new Uint8ClampedArray(g*r),b=0;b<r;b++)for(var v=0;v<t;v++){for(var y=0,M=0,T=0,x=0;x<c;x++)for(p=0;p<f;p++){var R=Math.cos(Math.PI*v*p/t)*Math.cos(Math.PI*b*x/r),k=d[p+x*f];y+=k[0]*R,M+=k[1]*R,T+=k[2]*R}var P=o.linearTosRGB(y),_=o.linearTosRGB(M),B=o.linearTosRGB(T);m[4*v+0+b*g]=P,m[4*v+1+b*g]=_,m[4*v+2+b*g]=B,m[4*v+3+b*g]=255}return m}},qsxg:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var r=e.call(this,t)||this;return r.name="ValidationError",r.message=t,r}return o(t,e),t}(Error);t.ValidationError=a},xWuY:function(e,t){},yLpj:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r}},[[0,0,1]]]); |