!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob|| (r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();/* @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */ "document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||!function(t){if("Element"in t){var e="classList",n="prototype",i=t.Element[n],s=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e}, c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,s=n.length;s>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",""+this)}},u=l[n]=[],h=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains= function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),s=!0);while(++nn;n++)t=arguments[n],e.call(this, t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}());if(!document.documentElement.dataset&&(!Object.getOwnPropertyDescriptor(Element.prototype,"dataset")||!Object.getOwnPropertyDescriptor(Element.prototype,"dataset").get)){var propDescriptor={get:function(){var i,HTML5_DOMStringMap={},attrVal,attrName,propName,attribute,attributes=this.attributes,attsLength=attributes.length,toUpperCase=function(n0){return n0.charAt(1).toUpperCase()},getter=function(){return this},setter=function(attrName,value){return typeof value!=="undefined"?this.setAttribute(attrName, value):this.removeAttribute(attrName)};for(i=0;in?a+",1":n>0?r+",1,"+e:a+",0"},n=function(){var e,a;if("undefined"!=typeof Intl&&"undefined"!=typeof Intl.DateTimeFormat&&(e=Intl.DateTimeFormat(), "undefined"!=typeof e&&"undefined"!=typeof e.resolvedOptions))return a=e.resolvedOptions().timeZone,a&&(a.indexOf("/")>-1||"UTC"===a)?a:void 0},o=function(e){for(var a=(new Date(e,0,1,0,0,1,0)).getTime(),s=(new Date(e,12,31,23,59,59)).getTime(),i=a,r=(new Date(i)).getTimezoneOffset(),n=null,o=null;s-864E5>i;){var t=new Date(i),A=t.getTimezoneOffset();A!==r&&(r>A&&(n=t),A>r&&(o=t),r=A),i+=864E5}return n&&o?{s:u(n).getTime(),e:u(o).getTime()}:!1},u=function l(e,a,i){"undefined"==typeof a&&(a=s.DAY, i=s.HOUR);for(var r=(new Date(e.getTime()-a)).getTime(),n=e.getTime()+a,o=(new Date(r)).getTimezoneOffset(),u=r,t=null;n-i>u;){var A=new Date(u),c=A.getTimezoneOffset();if(c!==o){t=A;break}u+=i}return a===s.DAY?l(t,s.HOUR,s.MINUTE):a===s.HOUR?l(t,s.MINUTE,s.SECOND):t},t=function(e,a,s,i){if("N/A"!==s)return s;if("Asia/Beirut"===a){if("Africa/Cairo"===i.name&&13983768E5===e[6].s&&14116788E5===e[6].e)return 0;if("Asia/Jerusalem"===i.name&&13959648E5===e[6].s&&14118588E5===e[6].e)return 0}else if("America/Santiago"=== a){if("America/Asuncion"===i.name&&14124816E5===e[6].s&&1397358E6===e[6].e)return 0;if("America/Campo_Grande"===i.name&&14136912E5===e[6].s&&13925196E5===e[6].e)return 0}else if("America/Montevideo"===a){if("America/Sao_Paulo"===i.name&&14136876E5===e[6].s&&1392516E6===e[6].e)return 0}else if("Pacific/Auckland"===a&&"Pacific/Fiji"===i.name&&14142456E5===e[6].s&&13961016E5===e[6].e)return 0;return s},A=function(e,i){for(var r=function(a){for(var r=0,n=0;n= a.rules[n].s&&e[n].e<=a.rules[n].e)){r="N/A";break}if(r=0,r+=Math.abs(e[n].s-a.rules[n].s),r+=Math.abs(a.rules[n].e-e[n].e),r>s.MAX_SCORE){r="N/A";break}}return r=t(e,i,r,a)},n={},o=a.olson.dst_rules.zones,u=o.length,A=s.AMBIGUITIES[i],c=0;u>c;c++){var m=o[c],l=r(o[c]);"N/A"!==l&&(n[m.name]=l)}for(var f in n)if(n.hasOwnProperty(f))for(var d=0;d>>d:a[b/32|0]>>>d)&(1<>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return!1;var c=0,d;for(d=0;d>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32>>24|c>>>8&65280|(c&65280)<<8|c<<24;return a}}; sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c>>e)>>>26),6>e?(f=a[c]<<6-e,e+=26,c++):(f<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,g=sjcl.codec.base64.g,f=0,l;b&&(g=g.substr(0,62)+"-_");for(d=0;dl)throw new sjcl.exception.invalid("this isn't base64!");26>>e),f=l<<32-e):(e+=6,f^=l<<32-e)}e&56&&c.push(sjcl.bitArray.partial(e&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.e[0]||t(this);a?(this.d=a.d.slice(0),this.c=a.c.slice(0),this.a=a.a):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()}; sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.d=this.i.slice(0);this.c=[];this.a=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.c=sjcl.bitArray.concat(this.c,a);b=this.a;a=this.a=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)u(this,c.splice(0,16));return this},finalize:function(){var a,b=this.c,c=this.d,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.a/ 4294967296));for(b.push(this.a|0);b.length;)u(this,b.splice(0,16));this.reset();return c},i:[],e:[]}; function u(a,b){var c,d,e,g=b.slice(0),f=a.d,l=a.e,r=f[0],h=f[1],m=f[2],p=f[3],k=f[4],q=f[5],n=f[6],s=f[7];for(c=0;64>c;c++)16>c?d=g[c]:(d=g[c+1&15],e=g[c+14&15],d=g[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+g[c&15]+g[c+9&15]|0),d=d+s+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(n^k&(q^n))+l[c],s=n,n=q,q=k,k=p+d|0,p=m,m=h,h=r,r=d+(h&m^p&(h^m))+(h>>>2^h>>>13^h>>>22^h<<30^h<<19^h<<10)|0;f[0]=f[0]+r|0;f[1]=f[1]+h|0;f[2]=f[2]+m|0;f[3]=f[3]+p|0;f[4]=f[4]+k|0;f[5]=f[5]+q|0;f[6]= f[6]+n|0;f[7]=f[7]+s|0}function t(a){function b(a){return 4294967296*(a-Math.floor(a))|0}var c=0,d=2,e;a:for(;64>c;d++){for(e=2;e*e<=d;e++)if(0===d%e)continue a;8>c&&(a.i[c]=b(Math.pow(d,.5)));a.e[c]=b(Math.pow(d,1/3));c++}}sjcl.misc.hmac=function(a,b){this.h=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.b=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d":">","'":"'",'"':"""},re=/\ud83d[\udc68-\udc69](?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92])|(?:\ud83c[\udfcb\udfcc]|\ud83d\udd75|\u26f9)(?:\ufe0f|\ud83c[\udffb-\udfff])\u200d[\u2640\u2642]\ufe0f|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd37-\udd39\udd3d\udd3e\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|(?:[\u0023\u002a\u0030-\u0039])\ufe0f?\u20e3|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\uddd1-\udddd]|[\u270a\u270b])(?:\ud83c[\udffb-\udfff]|)|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud800\udc00|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a-\udc6d\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\udeeb\udeec\udef4-\udef8]|\ud83e[\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd40-\udd45\udd47-\udd4c\udd50-\udd6b\udd80-\udd97\uddc0\uddd0\uddde-\udde6]|[\u23e9-\u23ec\u23f0\u23f3\u2640\u2642\u2695\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a]|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2122\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2694\u2696\u2697\u2699\u269b\u269c\u26a0\u26a1\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))/g, UFE0Fg=/\uFE0F/g,U200D=String.fromCharCode(8205),rescaper=/[&<>'"]/g,shouldntBeParsed=/IFRAME|NOFRAMES|NOSCRIPT|SCRIPT|SELECT|STYLE|TEXTAREA|[a-z]|TITLE/,fromCharCode=String.fromCharCode;return twemoji;function createText(text){return document.createTextNode(text)}function escapeHTML(s){return s.replace(rescaper,replacer)}function defaultImageSrcGenerator(icon,options){return"".concat(options.base,options.size,"/",icon,options.ext)}function grabAllTextNodes(node,allText){var childNodes=node.childNodes, length=childNodes.length,subnode,nodeType;while(length--){subnode=childNodes[length];nodeType=subnode.nodeType;if(nodeType===3)allText.push(subnode);else if(nodeType===1&&!shouldntBeParsed.test(subnode.nodeName)&&!subnode.dataset.noTwemoji)grabAllTextNodes(subnode,allText)}return allText}function grabTheRightIcon(rawText){return toCodePoint(rawText.indexOf(U200D)<0?rawText.replace(UFE0Fg,""):rawText)}function parseNode(node,options){var allText=grabAllTextNodes(node,[]),length=allText.length,attrib, attrname,modified,fragment,subnode,text,match,i,index,img,rawText,iconId,src;while(length--){modified=false;fragment=document.createDocumentFragment();subnode=allText[length];text=subnode.nodeValue;i=0;while(match=re.exec(text)){index=match.index;if(index!==i)fragment.appendChild(createText(text.slice(i,index)));rawText=match[0];iconId=grabTheRightIcon(rawText);i=index+rawText.length;src=options.callback(iconId,options);if(src){img=new Image;img.onerror=options.onerror;img.setAttribute("draggable", "false");attrib=options.attributes(rawText,iconId);for(attrname in attrib)if(attrib.hasOwnProperty(attrname)&&attrname.indexOf("on")!==0&&!img.hasAttribute(attrname))img.setAttribute(attrname,attrib[attrname]);img.className=options.className;img.alt=rawText;img.src=src;modified=true;fragment.appendChild(img)}if(!img)fragment.appendChild(createText(rawText));img=null}if(modified){if(i")}return ret})}function replacer(m){return escaper[m]}function returnNull(){return null}function toSizeSquaredAsset(value){return typeof value==="number"?value+"x"+value:value}function fromCodePoint(codepoint){var code=typeof codepoint==="string"?parseInt(codepoint,16):codepoint;if(code<65536)return fromCharCode(code);code-=65536;return fromCharCode(55296+(code>>10),56320+(code&1023))}function parse(what,how){if(!how||typeof how==="function")how={callback:how};return(typeof what=== "string"?parseString:parseNode)(what,{callback:how.callback||defaultImageSrcGenerator,attributes:typeof how.attributes==="function"?how.attributes:returnNull,base:typeof how.base==="string"?how.base:twemoji.base,ext:how.ext||twemoji.ext,size:how.folder||toSizeSquaredAsset(how.size||twemoji.size),className:how.className||twemoji.className,onerror:how.onerror||twemoji.onerror})}function replace(text,callback){return String(text).replace(re,callback)}function test(text){re.lastIndex=0;var result=re.test(text); re.lastIndex=0;return result}function toCodePoint(unicodeSurrogates,sep){var r=[],c=0,p=0,i=0;while(i>>18,b[1]=128|(d&258048)>>>12,b[2]=128|(d&4032)>>>6,b[3]=128|d&63):2048>>12,b[1]=128|(d&4032)>>>6,b[2]=128|d&63):128>>6,b[1]=128|d&63):b[0]=d;this.parsedData.push(b)}this.parsedData=Array.prototype.concat.apply([],this.parsedData);this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191), this.parsedData.unshift(187),this.parsedData.unshift(239))}function m(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function l(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var b=0;ba||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount}, make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var b=0;b=b;b++)if(!(-1>=a+b||this.moduleCount<=a+b))for(var d=-1;7>=d;d++)-1>=c+d||this.moduleCount<=c+d||(this.modules[a+b][c+d]=0<=b&&6>=b&&(0==d||6==d)||0<=d&&6>=d&&(0==b||6==b)||2<=b&&4>=b&&2<=d&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,b=0;8>b;b++){this.makeImpl(!0, b);var d=q.getLostPoint(this);if(0==b||a>d)a=d,c=b}return c},createMovieClip:function(a,c,b){a=a.createEmptyMovieClip(c,b);this.make();for(c=0;c=g;g++)for(var h=-2;2>=h;h++)this.modules[d+g][e+h]=-2==g||2==g||-2==h||2==h||0==g&&0==h?!0:!1}},setupTypeNumber:function(a){for(var c=q.getBCHTypeNumber(this.typeNumber),b=0;18>b;b++){var d=!a&&1==(c>>b&1);this.modules[Math.floor(b/3)][b%3+this.moduleCount- 8-3]=d}for(b=0;18>b;b++)d=!a&&1==(c>>b&1),this.modules[b%3+this.moduleCount-8-3][Math.floor(b/3)]=d},setupTypeInfo:function(a,c){c=q.getBCHTypeInfo(this.errorCorrectLevel<<3|c);for(var b=0;15>b;b++){var d=!a&&1==(c>>b&1);6>b?this.modules[b][8]=d:8>b?this.modules[b+1][8]=d:this.modules[this.moduleCount-15+b][8]=d}for(b=0;15>b;b++)d=!a&&1==(c>>b&1),8>b?this.modules[8][this.moduleCount-b-1]=d:9>b?this.modules[8][15-b-1+1]=d:this.modules[8][15-b-1]=d;this.modules[this.moduleCount-8][8]=!a},mapData:function(a, c){for(var b=-1,d=this.moduleCount-1,e=7,g=0,h=this.moduleCount-1;0f;f++)if(null==this.modules[d][h-f]){var n=!1;g>>e&1));q.getMask(c,d,h-f)&&(n=!n);this.modules[d][h-f]=n;e--;-1==e&&(g++,e=7)}d+=b;if(0>d||this.moduleCount<=d){d-=b;b=-b;break}}}};m.PAD0=236;m.PAD1=17;m.createData=function(a,c,b){c=u.getRSBlocks(a,c);for(var d=new A,e=0;e8*a)throw Error("code length overflow. ("+d.getLengthInBits()+">"+8*a+")");for(d.getLengthInBits()+4<=8*a&&d.put(0,4);0!=d.getLengthInBits()%8;)d.putBit(!1);for(;!(d.getLengthInBits()>=8*a);){d.put(m.PAD0,8);if(d.getLengthInBits()>=8*a)break;d.put(m.PAD1,8)}return m.createBytes(d,c)};m.createBytes=function(a,c){for(var b=0,d=0,e=0,g=Array(c.length),h=Array(c.length),f=0;f>>=1;return c},getPatternPosition:function(a){return q.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,b){switch(a){case 0:return 0==(c+b)%2;case 1:return 0==c%2;case 2:return 0==b%3;case 3:return 0==(c+b)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(b/3))%2;case 5:return 0==c*b%2+c*b%3;case 6:return 0==(c*b%2+c*b%3)%2;case 7:return 0==(c*b%3+(c+b)%2)%2;default:throw Error("bad maskPattern:"+a);}},getErrorCorrectPolynomial:function(a){for(var c= new l([1],0),b=0;bc)switch(a){case w.MODE_NUMBER:return 10;case w.MODE_ALPHA_NUM:return 9;case w.MODE_8BIT_BYTE:return 8;case w.MODE_KANJI:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case w.MODE_NUMBER:return 12;case w.MODE_ALPHA_NUM:return 11;case w.MODE_8BIT_BYTE:return 16;case w.MODE_KANJI:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case w.MODE_NUMBER:return 14; case w.MODE_ALPHA_NUM:return 13;case w.MODE_8BIT_BYTE:return 16;case w.MODE_KANJI:return 12;default:throw Error("mode:"+a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),b=0,d=0;d=f;f++)if(!(0>d+f||c<=d+f))for(var n=-1;1>=n;n++)0>e+n||c<=e+n||(0!=f||0!=n)&&h==a.isDark(d+f,e+n)&&g++;5a)throw Error("glog("+a+ ")");return t.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return t.EXP_TABLE[a]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},v=0;8>v;v++)t.EXP_TABLE[v]=1<v;v++)t.EXP_TABLE[v]=t.EXP_TABLE[v-4]^t.EXP_TABLE[v-5]^t.EXP_TABLE[v-6]^t.EXP_TABLE[v-8];for(v=0;255>v;v++)t.LOG_TABLE[t.EXP_TABLE[v]]=v;l.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),b=0;bthis.getLength()-a.getLength())return this;for(var c=t.glog(this.get(0))-t.glog(a.get(0)),b=Array(this.getLength()),d=0;d>>7-a%8&1)},put:function(a,c){for(var b=0;b>>c-b-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>> this.length%8);this.length++}};var z=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805, 625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],H=function(){var a=function(c,b){this._el=c;this._htOption=b};a.prototype.draw=function(c){function b(n,r){n=document.createElementNS("http://www.w3.org/2000/svg",n);for(var p in r)r.hasOwnProperty(p)&&n.setAttribute(p,r[p]); return n}var d=this._htOption,e=this._el,g=c.getModuleCount();this.clear();var h=b("svg",{viewBox:"0 0 "+String(g)+" "+String(g),width:"100%",height:"100%",fill:d.colorLight});h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");e.appendChild(h);h.appendChild(b("rect",{fill:d.colorLight,width:"100%",height:"100%"}));h.appendChild(b("rect",{fill:d.colorDark,width:"1",height:"1",id:"template"}));for(d=0;d'],n=0;n");for(var r=0;r');f.push("")}f.push("");d.innerHTML=f.join("");c=d.childNodes[0];d=(b.width-c.offsetWidth)/2;b=(b.height-c.offsetHeight)/2;0=this._android){var b=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(g,h,f,n,r,p,B,C,D){if("nodeName"in g&&/img/i.test(g.nodeName))for(var y=arguments.length-1;1<=y;y--)arguments[y]*=b;else"undefined"==typeof C&&(arguments[1]*=b,arguments[2]*=b,arguments[3]*=b,arguments[4]*=b);d.apply(this, arguments)}}var e=function(g,h){this._bIsPainted=!1;this._android=G();this._htOption=h;this._elCanvas=document.createElement("canvas");this._elCanvas.width=h.width;this._elCanvas.height=h.height;g.appendChild(this._elCanvas);this._el=g;this._oContext=this._elCanvas.getContext("2d");this._bIsPainted=!1;this._elImage=document.createElement("img");this._elImage.alt="Scan me!";this._elImage.style.display="none";this._el.appendChild(this._elImage);this._bSupportDataURI=null};e.prototype.draw=function(g){var h= this._elImage,f=this._oContext,n=this._htOption,r=g.getModuleCount(),p=n.width/r,B=n.height/r,C=Math.round(p),D=Math.round(B);h.style.display="none";this.clear();for(h=0;hz.length)throw Error("Too long data");this._oQRCode=new m(b,this._htOption.correctLevel);this._oQRCode.addData(a);this._oQRCode.make();this._el.title=a;this._oDrawing.draw(this._oQRCode);this.makeImage()};QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||3<=this._android)&&this._oDrawing.makeImage()};QRCode.prototype.clear=function(){this._oDrawing.clear()};QRCode.CorrectLevel=x})();xyzcrypto={};xyzcrypto.supported=function(){try{return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&"subarray"in Uint8Array.prototype?!0:!1}catch(k){return!1}}();xyzcrypto.resultToBytes=function(k){for(var m=new Uint8Array(32),l=0;32>l;l++)m[l]=k[l/4|0]>>>24-l%4*8;return m};xyzcrypto.fromString=function(k,m){m||(k=unescape(encodeURIComponent(k)));m=new Uint8Array(k.length);for(var l=0;lk.blocksize&&(m=k.hash(m));if(m.lengthl;l++)this.o_key[l]=m[l]^92,this.i_key[l]=m[l]^54;this.hash=new k;this.hash.updateBlock(this.i_key)};xyzcrypto.hmac.prototype.reset=function(){this.hash.reset();this.hash.updateBlock(this.i_key)}; xyzcrypto.hmac.prototype.update=function(k){this.hash.update(k)};xyzcrypto.hmac.prototype.finish=function(){var k=this.hash.finish();this.hash.reset();this.hash.updateBlock(this.o_key);this.hash.update(k);return this.hash.finish()};xyzcrypto.hmac.prototype.generate=function(k){this.reset();this.update(k);return this.finish()};xyzcrypto.hmac.generate=function(k,m,l){return(new xyzcrypto.hmac(k,m)).generate(l)};xyzcrypto.sha256={}; xyzcrypto.sha256.asm=function(){var k=new ArrayBuffer(65536);this.state=new Uint32Array(k,0,8);this.block=new Uint8Array(k,32,64);this.data=null;var m=this;this.asm=xyzcrypto.sha256.asm.module(window,{copyBlock:function(l,u,A){m.block.set(m.data.subarray(u,A),l)}},k);this.asm.reset()};xyzcrypto.sha256.asm.prototype.reset=function(){this.asm.reset()};xyzcrypto.sha256.asm.prototype.update=function(k){this.data=k;this.asm.update(k.length)}; xyzcrypto.sha256.asm.prototype.updateBlock=function(k){this.block.set(k);this.asm.updateBlock()};xyzcrypto.sha256.asm.prototype.finish=function(){this.asm.finish();return xyzcrypto.resultToBytes(this.state)};xyzcrypto.sha256.asm.prototype.hash=function(k){this.reset();this.update(k);return this.finish()};xyzcrypto.sha256.asm.hash=function(k){return(new xyzcrypto.sha256.asm).hash(k)};xyzcrypto.sha256.asm.blocksize=64; var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(c){return c.raw=c};$jscomp.createTemplateTagFirstArgWithRaw=function(c,d){c.raw=d;return c};$jscomp.arrayIteratorImpl=function(c){var d=0;return function(){return d>>0,$jscomp.propertyToPolyfillSymbol[g]=$jscomp.IS_SYMBOL_NATIVE? $jscomp.global.Symbol(g):$jscomp.POLYFILL_PREFIX+e+"$"+g),$jscomp.defineProperty(f,$jscomp.propertyToPolyfillSymbol[g],{configurable:!0,writable:!0,value:d})))}; $jscomp.getConstructImplementation=function(){function c(){function e(){}new e;Reflect.construct(e,[],function(){});return new e instanceof e}if($jscomp.TRUST_ES6_POLYFILLS&&"undefined"!=typeof Reflect&&Reflect.construct){if(c())return Reflect.construct;var d=Reflect.construct;return function(e,f,g){e=d(e,f);g&&Reflect.setPrototypeOf(e,g.prototype);return e}}return function(e,f,g){void 0===g&&(g=e);g=$jscomp.objectCreate(g.prototype||Object.prototype);return Function.prototype.apply.call(e,g,f)|| g}};$jscomp.construct={valueOf:$jscomp.getConstructImplementation}.valueOf();$jscomp.underscoreProtoCanBeSet=function(){var c={a:!0},d={};try{return d.__proto__=c,d.a}catch(e){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(c,d){c.__proto__=d;if(c.__proto__!==d)throw new TypeError(c+" is not extensible");return c}:null; $jscomp.inherits=function(c,d){c.prototype=$jscomp.objectCreate(d.prototype);c.prototype.constructor=c;if($jscomp.setPrototypeOf){var e=$jscomp.setPrototypeOf;e(c,d)}else for(e in d)if("prototype"!=e)if(Object.defineProperties){var f=Object.getOwnPropertyDescriptor(d,e);f&&Object.defineProperty(c,e,f)}else c[e]=d[e];c.superClass_=d.prototype};$jscomp.generator={}; $jscomp.generator.ensureIteratorResultIsObject_=function(c){if(!(c instanceof Object))throw new TypeError("Iterator result "+c+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null}; $jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(c){this.yieldResult=c}; $jscomp.generator.Context.prototype.throw_=function(c){this.abruptCompletion_={exception:c,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(c){this.abruptCompletion_={return:c};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(c){this.abruptCompletion_={jumpTo:c};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(c,d){this.nextAddress=d;return{value:c}}; $jscomp.generator.Context.prototype.yieldAll=function(c,d){c=$jscomp.makeIterator(c);var e=c.next();$jscomp.generator.ensureIteratorResultIsObject_(e);if(e.done)this.yieldResult=e.value,this.nextAddress=d;else return this.yieldAllIterator_=c,this.yield(e.value,d)};$jscomp.generator.Context.prototype.jumpTo=function(c){this.nextAddress=c};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0}; $jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(c,d){this.catchAddress_=c;void 0!=d&&(this.finallyAddress_=d)};$jscomp.generator.Context.prototype.setFinallyBlock=function(c){this.catchAddress_=0;this.finallyAddress_=c||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(c,d){this.nextAddress=c;this.catchAddress_=d||0}; $jscomp.generator.Context.prototype.enterCatchBlock=function(c){this.catchAddress_=c||0;c=this.abruptCompletion_.exception;this.abruptCompletion_=null;return c};$jscomp.generator.Context.prototype.enterFinallyBlock=function(c,d,e){e?this.finallyContexts_[e]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=c||0;this.finallyAddress_=d||0}; $jscomp.generator.Context.prototype.leaveFinallyBlock=function(c,d){d=this.finallyContexts_.splice(d||0)[0];if(d=this.abruptCompletion_=this.abruptCompletion_||d){if(d.isException)return this.jumpToErrorHandler_();void 0!=d.jumpTo&&this.finallyAddress_>>0)+"_",f=0,g=function(k){if(this instanceof g)throw new TypeError("Symbol is not a constructor");return new d(e+(k||"")+"_"+f++,k)};return g},"es6","es3"); $jscomp.polyfill("Symbol.iterator",function(c){if(c)return c;c=Symbol("Symbol.iterator");for(var d="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),e=0;ed||1342177279>>=1)e+=e;return f}},"es6","es3"); $jscomp.polyfill("String.prototype.startsWith",function(c){return c?c:function(d,e){var f=$jscomp.checkStringArgs(this,d,"startsWith");d+="";var g=f.length,k=d.length;e=Math.max(0,Math.min(e|0,f.length));for(var l=0;l=k}},"es6","es3"); $jscomp.iteratorFromArray=function(c,d){c instanceof String&&(c+="");var e=0,f=!1,g={next:function(){if(!f&&e":">",'"':""","'":"'"};function escapeHTML(c){return c.replace(/[&<>'"]/g,function(d){return ESC_MAP[d]})};var fQuery=function(){};fQuery.ready=function(c){"interactive"===document.readyState||"complete"===document.readyState?c():document.addEventListener("DOMContentLoaded",c)};fQuery.load=function(c){"complete"===document.readyState?c():window.addEventListener("load",c)};fQuery.on=function(c,d,e){Array.prototype.forEach.call(c,function(f){f.addEventListener(d,e)})};fQuery.click=function(c,d){fQuery.on(c,"click",d)};fQuery.append=function(c,d){}; fQuery.createFromHtml=function(c){var d=document.createElement("div");d.innerHTML=c.trim();return d.childNodes[0]};fQuery.addScopedEventListener=function(c,d,e,f,g){var k=function(l){for(var n=l.target;null!=n&&n!=document;){if(matchesSelector(n,d)){if(("mouseout"==e||"mouseover"==e)&&n.contains(l.relatedTarget))break;f.call(n,l,n)}if(c==n)break;n=n.parentNode}};c.addEventListener(e,k,void 0===g?!1:g);return k}; fQuery.removeScopedEventListener=function(c,d,e,f){c.removeEventListener(d,e,void 0===f?!1:f)};fQuery.isOrChildOf=function(c,d){do if(c==d)return!0;while(c=c.parentNode);return!1};fQuery.closestParent=function(c,d){for(;c=c.parentNode;){if(c==document)return null;if(matchesSelector(c,d))return c}};fQuery.siblings=function(c,d){d=void 0===d?!1:d;for(var e=[],f=$jscomp.makeIterator(c.parentNode.childNodes),g=f.next();!g.done;g=f.next())g=g.value,1==g.nodeType&&(d||g!=c)&&e.push(g);return e}; fQuery.addClass=function(c,d){c=$jscomp.makeIterator(c);for(var e=c.next();!e.done;e=c.next())e.value.classList.add(d)};fQuery.removeClass=function(c,d){c=$jscomp.makeIterator(c);for(var e=c.next();!e.done;e=c.next())e.value.classList.remove(d)};fQuery.toggleClass=function(c,d,e){c=$jscomp.makeIterator(c);for(var f=c.next();!f.done;f=c.next())toggleClass(f.value,d,e)};fQuery.css=function(c,d,e){c=$jscomp.makeIterator(c);for(var f=c.next();!f.done;f=c.next())f.value.style[d]=e}; fQuery.insertAfter=function(c,d){var e=c.nextSibling;null!=e?c.parentNode.insertBefore(d,e):c.parentNode.appendChild(d)};fQuery.insertBefore=function(c,d){c.parentNode.insertBefore(d,c)};fQuery.prepend=function(c,d){0==c.childNodes.length?c.appendChild(d):c.insertBefore(d,c.childNodes[0])}; fQuery.removeElement=function(c){for(var d=$jscomp.makeIterator(c.querySelectorAll("[data-controller-id]")),e=d.next();!e.done;e=d.next())App.DeleteController(App.GetControllerFromElement(e.value));c.dataset.controllerId&&App.DeleteController(App.GetControllerFromElement(c));c.parentNode.removeChild(c)};fQuery.removeElements=function(c){c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=c.next())fQuery.removeElement(d.value)}; fQuery.scrollTop=function(c,d,e){c=void 0===c?null:c;d=void 0===d?!1:d;e=void 0===e?null:e;if(null===c)return document.body.scrollTop||document.documentElement.scrollTop;null!==e?fQuery.animateProperty(function(f){fQuery.scrollTop(f,!0)},fQuery.scrollTop(),d?c:fQuery.scrollTop()+c,e,Curves.Cos):d?(document.documentElement.scrollTop=c,document.body.scrollTop=c):(document.documentElement.scrollTop+=c,document.body.scrollTop+=c)}; fQuery.scrollTo=function(c,d){d=void 0===d?null:d;fQuery.scrollTop(c.getBoundingClientRect().top,!1,d)};fQuery.scrollLeft=function(c,d){c=void 0===c?null:c;if(null===c)return document.body.scrollLeft||document.documentElement.scrollLeft;(void 0===d?0:d)?(document.documentElement.scrollLeft=c,document.body.scrollLeft=c):(document.documentElement.scrollLeft+=c,document.body.scrollLeft+=c)}; fQuery.text=function(c){var d=[];for(c=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:function(){return NodeFilter.FILTER_ACCEPT}},!1);c.nextNode();)d.push(c.currentNode.data);return d.join(" ").replace(/\s+/g," ")};fQuery.nodesToArray=function(c){return Array.from(c)}; fQuery.animateProperty=function(c,d,e,f,g){g=void 0===g?null:g;return new Promise(function(k,l){var n=0,m=null,p=function(q){null===m&&(m=q);n+=(q-m)/1E3*(1/f);m=q;1>n?window.requestAnimationFrame(p):(n=1,k());q=null!=g?g.call(null,n):n;c(d+(e-d)*q)};window.requestAnimationFrame(p)})};fQuery.debounce=function(c,d,e){var f;return function(){var g=this,k=arguments,l=e&&!f;clearTimeout(f);f=setTimeout(function(){f=null;e||c.apply(g,k)},d);l&&c.apply(g,k)}}; fQuery.throttle=function(c,d){var e;return function(){var f=this,g=arguments;null==e&&(e=setTimeout(function(){e=null;c.apply(f,g)},d))}}; fQuery.loadScript=function(c,d){var e=document.querySelector("script[src='"+c+"']");if(null!=e)return null==fQuery.scripts[c]?new Promise(function(f){f(e)}):new Promise(function(f,g){if(e.readyState){var k=e.onreadystatechange;e.onreadystatechange=function(){if("loaded"==e.readyState||"complete"==e.readyState)e.onreadystatechange=null,f(e),k()}}else{var l=e.onload;e.onload=function(){f(e);l()}}});d=new Promise(function(f,g){var k=document.createElement("script");k.type="text/javascript";k.readyState? k.onreadystatechange=function(){if("loaded"==k.readyState||"complete"==k.readyState)k.onreadystatechange=null,fQuery.scripts[c]=null,f(k)}:k.onload=function(){fQuery.scripts[c]=null;f(k)};k.src=c;document.getElementsByTagName("head")[0].appendChild(k)});return fQuery.scripts[c]=d};fQuery.animationFrame=function(c,d){var e=null,f=function(g){null==e&&(e=g);var k=Math.min((g-e)/1E3,d);e=g;!1!==c(k)&&window.requestAnimationFrame(f)};window.requestAnimationFrame(f)}; fQuery.disableScroll=function(){0==fQuery.scrollStack&&(document.addEventListener("wheel",fQuery.scrollHandler),is_mobile&&document.body.classList.add("unscrollable"));fQuery.scrollStack++;return{used:!1}};fQuery.enableScroll=function(c){c.used||(c.used=!0,fQuery.scrollStack--,0==fQuery.scrollStack&&(document.removeEventListener("wheel",fQuery.scrollHandler),document.body.classList.remove("unscrollable")))};fQuery.removeChildren=function(c){for(;c.firstChild;)c.removeChild(c.firstChild)}; fQuery.normalizeString=function(c){return c};fQuery.scrollStack=0;fQuery.scrollHandler=function(c){c.preventDefault()};fQuery.scripts={};var EventBus=function(){this.listeners=[]};EventBus.prototype.addListener=function(c){this.listeners.push(c)};EventBus.prototype.removeListener=function(c){c=this.listeners.indexOf(c);-1/g,">")}var events=function(){var c={},d=c.hasOwnProperty;return{subscribe:function(e,f){d.call(c,e)||(c[e]=[]);var g=c[e].push(f)-1;return{remove:function(){delete c[e][g]}}},publish:function(e,f){d.call(c,e)&&c[e].forEach(function(g){g(void 0!=f?f:{})})}}}();var Controller=function(){this.element=null;this.elements={};this.inputs={}};Controller.prototype.bind=function(c){this.element=c};Controller.prototype.findElements=function(c){return this.element.querySelectorAll(c)};Controller.prototype.findElement=function(c){return this.element.querySelector(c)};function Vec2(c,d){this.x=c;this.y=d;"freeze"in Object&&Object.freeze(this)}Vec2.Add=function(c,d){return new Vec2(c.x+d.x,c.y+d.y)};Vec2.Subtract=function(c,d){return new Vec2(c.x-d.x,c.y-d.y)};Vec2.Multiply=function(c,d){return d instanceof Vec2?new Vec2(c.x*d.x,c.y*d.y):new Vec2(c.x*d,c.y*d)};Vec2.Int=function(c){return new Vec2(Math.round(c.x),Math.round(c.y))};Vec2.prototype.Normalise=function(c){c=this.Length();return new Vec2(this.x/c,this.y/c)}; Vec2.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};Vec2.prototype.clone=function(){return new Vec2(this.x,this.y)};function ProjectPointToLine(c,d,e){d=(d.y-c.y)/(d.x-c.x);c=c.y-d*c.x;return new Vec2(Math.floor((d*e.y+e.x-d*c)/(d*d+1)),Math.floor((d*d*e.y+d*e.x+c)/(d*d+1)))}function saturate(c){return Math.max(Math.min(1,c),0)};function setCookie(c,d,e){var f=new Date;f.setTime(f.getTime()+864E5*e);d=escape(d);document.cookie=c+"="+d+(e?";expires="+f.toUTCString():"")+";path=/"}function delCookie(c){document.cookie=c+"=null;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"}function getCookie(c){for(var d=document.cookie.split(";"),e=0;ee;e++)c+=String.fromCharCode(Math.floor(255*Math.random()));return btoa(c)}}function SigningKeyNotFoundException(){}var signing_hmac=null; function SignString(c,d){if(null==signing_hmac){var e=LocalStorageGet("signing_key");if(null==e||"string"!=typeof e||0==e.length)throw new SigningKeyNotFoundException;signing_hmac=xyzcrypto.supported?new xyzcrypto.hmac(xyzcrypto.sha256.asm,xyzcrypto.fromB64(e)):new sjcl.misc.hmac(sjcl.codec.base64.toBits(e))}e=ComputeNonce();var f=Math.floor((new Date-server_time_offset)/1E3);c=e+"|"+f+"|"+btoa(d)+"|"+c;return{signature:xyzcrypto.supported?xyzcrypto.toB64(signing_hmac.generate(xyzcrypto.fromString(c))): sjcl.codec.base64.fromBits(signing_hmac.encrypt(c)),nonce:e,timestamp:f}} function DataToURLEncodedString(c){function d(e){return encodeURIComponent(e).replace(/[^A-Za-z0-9\-_.~%]/g,function(f){return"%"+f.charCodeAt(0).toString(16).toUpperCase()})}c=c.map(function(e){e.value+="";return e});c=c.sort(function(e,f){if(e.name==f.name){if(e.value==f.value)return 0;if(e.valuef.value)return 1}else{if(e.namef.name)return 1}});return c.map(function(e){return d(e.name)+"="+d(e.value)}).join("&")} function SignObject(c,d){var e=[],f;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&e.push({name:f,value:c[f]});return SignArray(e,d)}function SignArray(c,d){c=DataToURLEncodedString(c);d=SignString(c,d);return""==c?"signature="+encodeURIComponent(d.signature)+"&signature_nonce="+encodeURIComponent(d.nonce)+"&signature_timestamp="+d.timestamp:c+"&signature="+encodeURIComponent(d.signature)+"&signature_nonce="+encodeURIComponent(d.nonce)+"&signature_timestamp="+d.timestamp} function UpdateOrInsertHiddenField(c,d,e){var f=c.querySelector("input[name="+d+"]");f||(f=document.createElement("input"),f.setAttribute("type","hidden"),f.setAttribute("name",d),c.appendChild(f));f.value=e} function SignForm(c,d){var e=AjaxRequest.serializeForm(c).filter(function(f){return!/^signature(?:_nonce|_timestamp)?$/.test(f.name)});null==d&&(d=c.getAttribute("action"));"_submitter"in c&&""!=c._submitter.name&&e.push({name:c._submitter.name,value:c._submitter.value});e=DataToURLEncodedString(e);d=SignString(e,d);UpdateOrInsertHiddenField(c,"signature",d.signature);UpdateOrInsertHiddenField(c,"signature_nonce",d.nonce);UpdateOrInsertHiddenField(c,"signature_timestamp",d.timestamp)};function getXMLHttpRequest(){if(window.XMLHttpRequest)return new window.XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(c){return null}}var activeTurnstilePromise=null; function showTurnstile(c){var d=getCookie("stylesheet"),e="auto";"light"==d?e="light":"dark"==d&&(e="dark");return new Promise(function(f,g){var k=new PopUpMenu("","Captcha");k.SetAllowClose(!1);k.SetDimmerEnabled(!0);k.SetWidth(400);k.SetContent('
');k.Show();var l=turnstile.render("#turnstile_widget",{sitekey:"0x4AAAAAABD_iQwywF1InoIw",action:c,theme:e,size:"flexible",callback:function(n,m){turnstile.remove(l);k.Close();activeTurnstilePromise=null;m?f():g(Error("Captcha error: could not get pre-clearance."))}})})} function handleTurnstile(c){activeTurnstilePromise||(activeTurnstilePromise=showTurnstile(c));return activeTurnstilePromise} var AjaxRequest=function(c,d){var e=this;d=void 0===d?!0:d;this.options=c;var f=c.method||"POST",g=c.url,k={};"data"in c&&(k=c.data);if("GET"==f&&null!=k){c=[];for(var l in k)c.push(encodeURIComponent(l)+"="+encodeURIComponent(k[l]));g+=(-1knighty with your operating system and browser"),p;}if(d)return m}; AjaxRequest.prototype.signData=function(c,d){if("signed"in this.options&&this.options.signed)try{c="string"==typeof c?SignString(c,d):c instanceof Array?SignArray(c,d):SignObject(c,d)}catch(e){throw e instanceof SigningKeyNotFoundException?ShowErrorWindow("Signing Key not found, please log in again"):ShowErrorWindow("Error signing string: "+e),e;}else"string"!=typeof c&&(c=AjaxRequest.serialize(c));return c};AjaxRequest.execute=function(c){return new AjaxRequest(c)}; AjaxRequest.prototype.statusErrorMessage=function(c){switch(c){case 400:c="Bad Request";break;case 401:c="Request Unauthorized";break;case 403:c="Request Forbidden";break;case 404:c="Request destination not found";break;case 408:c="Request timed out. Please try again";break;case 500:c="Server Error";break;case 502:c="Bad Gateway. Please try again";break;case 503:c="Service Unavailable. Please try again later";break;default:c="Request Failed ("+c+")"}return c};AjaxRequest.prototype.cancel=function(){this.request.abort()}; AjaxRequest.serialize=function(c){var d=[],e;for(e in c)Object.prototype.hasOwnProperty.call(c,e)&&d.push(encodeURIComponent(e)+"="+encodeURIComponent(c[e]));return d.join("&")}; AjaxRequest.serializeForm=function(c){for(var d,e=[],f=c.elements.length-1;0<=f;--f)if(""!==c.elements[f].name)switch(c.elements[f].nodeName){case "INPUT":switch(c.elements[f].type){case "checkbox":case "radio":c.elements[f].checked&&e.push({name:c.elements[f].name,value:c.elements[f].value});break;case "file":break;default:e.push({name:c.elements[f].name,value:c.elements[f].value})}break;case "TEXTAREA":d=c.elements[f].value;d=d.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\n/g,"\r\n");e.push({name:c.elements[f].name, value:d});break;case "SELECT":switch(c.elements[f].type){case "select-one":e.push({name:c.elements[f].name,value:c.elements[f].value});break;case "select-multiple":for(d=c.elements[f].options.length-1;0<=d;--d)c.elements[f].options[d].selected&&e.push({name:c.elements[f].name,value:c.elements[f].options[d].value})}}return e}; AjaxRequest.serializeFormToString=function(c){var d=[];c=$jscomp.makeIterator(c.querySelectorAll("input[name]:not([disabled]), textarea[name]:not([disabled]), select[name]:not([disabled])"));for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=String({checkbox:1,radio:1}[e.type]?e.checked:e.value).replace(/\r?\n/g,"\r\n");d.push(encodeURIComponent(e.name)+"="+encodeURIComponent(f))}return d.join("&")}; AjaxRequest.BindForm=function(c,d,e){e=void 0===e?null:e;null==e&&(e=document);fQuery.addScopedEventListener(e,c,"submit",function(f){f.preventDefault();var g=this,k={};k.method=g.method;k.url=g.getAttribute("action");k.signed="1"==g.getAttribute("data-signed");k.button=g.querySelector("button[type=submit]");null==k.button&&(k.button=g.querySelector(".button-submit"));k.spinner=k.button.querySelector("i");k.data=k.signed?AjaxRequest.serializeForm(g):AjaxRequest.serializeFormToString(g);k.success= function(l,n){d(l,n,g)};g.getAttribute("data-confirm")?StyledConfirm(g.getAttribute("data-confirm"),function(){new AjaxRequest(k)}):new AjaxRequest(k)})};var Konami=function(c,d,e){this.step=0;this.code=(void 0===e?null:e)||[38,38,40,40,37,39,37,39,66,65];this.callback=d;c.addEventListener("keyup",this.keyup.bind(this),!0)};Konami.prototype.keyup=function(c){/^(?:INPUT|TEXTAREA|SELECT)?$/.test(c.target.nodeName)||(this.code[this.step]==c.keyCode?(this.step++,this.step==this.code.length&&(this.step=0,this.callback())):this.step=0)};function App(){}App.controllers={};App.createdControllers={};App.binders=[];App.globalBinders=[];App.controllerId=0;App.dependencies={};App.AddController=function(c,d){App.controllers[c]=d};App.AddDependency=function(c,d){App.dependencies[c]=d};App.GetDependency=function(c){return App.dependencies[c]}; App.GetController=function(c,d){if(!(c in App.controllers))return null;var e=new App.controllers[c](d);c=d.querySelectorAll("input, textarea, select, [data-element]");c=$jscomp.makeIterator(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;if("INPUT"==f.nodeName||"TEXTAREA"==f.nodeName||"SELECT"==f.nodeName)e.inputs[f.getAttribute("name")]=f;if(f.hasAttribute("data-element")){var g=f.getAttribute("data-element");e.elements[g]=f;f.removeAttribute("data-element")}}fQuery.addScopedEventListener(d, "[data-input]","input",function(k){!k.controllerHandled&&e[this.dataset.input]&&(e[this.dataset.input](this.value,k,this),k.controllerHandled=!0)});fQuery.addScopedEventListener(d,"[data-click]","click",function(k){if(!k.controllerHandled&&e[this.dataset.click]){var l=e[this.dataset.click](this,k);k.controllerHandled=!0;"undefined"===typeof l?k.preventDefault():l||k.preventDefault()}});fQuery.addScopedEventListener(d,"[data-change]","change",function(k){!k.controllerHandled&&e[this.dataset.change]&& (e[this.dataset.change](this.value,k,this),k.controllerHandled=!0)});fQuery.addScopedEventListener(d,"[data-submit]","submit",function(k){if(!k.controllerHandled){var l=e[this.getAttribute("data-submit")](this,k);"undefined"===typeof l?k.preventDefault():l||k.preventDefault()}k.controllerHandled=!0});e.bind(d);return e};App.GetControllerFromElement=function(c){c=c.getAttribute("data-controller-id");return App.createdControllers[c]};App.DeleteController=function(c){delete App.createdControllers[c.controllerId]}; App.Bind=function(c,d,e,f){c.addEventListener(d,function(g){f[e](g)})};App.AddBinder=function(c){App.binders.push(c)};App.AddGlobalEventListener=function(c,d,e){c={event:c,selector:d,"class":null,binder:e};if(d=/^\.([^\/]*)$/.exec(d))c.class=d[1];App.globalBinders.push(c)}; App.BindGlobalEventListeners=function(){for(var c=$jscomp.makeIterator(App.globalBinders),d=c.next();!d.done;d=c.next())if(d=d.value,null!=d.class)fQuery.on(document.getElementsByClassName(d.class),d.event,d.binder);else fQuery.on(document.querySelectorAll(d.selector),d.event,d.binder)};App.BindAll=function(c){App.binders.forEach(function(d){d(c)});App.BindControllers(c);App.BindGlobalEventListeners()}; App.BindControllers=function(c){c=$jscomp.makeIterator(fQuery.nodesToArray(c.querySelectorAll("[data-controller]")).reverse());for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=d.getAttribute("data-controller");try{var f=App.GetController(e,d);null!=f&&(d.removeAttribute("data-controller"),d.setAttribute("data-controller-id",App.controllerId),App.createdControllers[App.controllerId]=f,f.controllerId=App.controllerId,App.controllerId++)}catch(g){document.querySelector("body").appendChild(fQuery.createFromHtml(' \n
Error binding \''+ e+"' controller:
"+g.message+"
\n ")),console.log(g)}}};App.DispatchEvent=function(c,d,e){e=void 0===e?null:e;var f=document.createEvent("Event");f.initEvent(d,!0,!0);if(null!=e)for(var g in e)e.hasOwnProperty(g)&&(f[g]=e[g]);c.dispatchEvent(f)};var CookieConsent=function(){this.onChanged=new EventBus;this.data={updated:10,categories:{essential:{consent:!1,header:"Essential Cookies",items:[{name:"Sessions",description:"A cookie is required to keep you logged into the site as you browse."},{name:"Customisation",description:"For example, storing whether you're using dark mode and your chapter formatting options."}]},advertising:{consent:!1,header:"Advertising",items:[{name:"Advertising",description:'These adverts are required to support the site. Please consider supporting our Patreon if you dislike advertising', providers:[{name:"DoubleClick",policy:"https://policies.google.com/technologies/ads"}]}]},embed:{consent:!0,optional:!0,header:"Third Party Cookies",items:[{name:"Embedded Content",description:"Includes things like YouTube and Soundcloud embeds. Without consent you will not be able to view embedded content.",providers:[{name:"Youtube",policy:"https://policies.google.com/technologies/partner-sites"},{name:"Soundcloud",policy:"https://soundcloud.com/pages/privacy"}]}]},trackingAds:{consent:!0,optional:!0, header:"Personalised Advertising",items:[{name:"Advertising",description:"Personalised advertising shows you better adverts and helps support the site much more. The number of adverts does not change.",providerSrc:static_url+"/data/ad-providers.json",providers:[]}]}}};this.categories=JSON.parse(LocalStorageGet("consent","{}")).categories||{}};CookieConsent.prototype.getConsentRequired=function(){return"config"in window&&config.requireCookieConsent}; CookieConsent.prototype.getCategoryAllowed=function(c){return this.getConsentRequired()?null!=this.categories[c]&&this.categories[c].allowed:!0}; CookieConsent.prototype.requestConsent=function(c,d){var e=this;return new Promise(function(f,g){if(e.getConsentRequired()){if(!d&&(c=c.filter(function(n){return!e.getCategoryAllowed(n)}),0==c.length)){f(e);return}var k=new PopUpMenu(null,"Cookie Consent");k.SetWidth("700");k.SetCloseOnHoverOut(!1);k.SetCloseOnLinkPressed(!1);k.SetAllowClose(!1);k.SetFixed(!1);k.ShowDimmer();k.SetContent('
');k.Show(null,null,!1);k.SetPosition(); var l=App.GetControllerFromElement(k.element.querySelector("[data-controller-id]"));l.onSave.addListener(function(n){var m=!0,p;for(p in n.categories)e.categories[p]={allowed:n.categories[p].allowed,date:(new Date).getTime()},n.categories[p].allowed||(m=!1);e.save();k.Close();e.onChanged.fire(e);m?f(e):g(e)});l.onReject.addListener(function(n){n?k.Close():window.location.href="/cookies?rejected";g(e)})}else f(e)})}; CookieConsent.prototype.save=function(){var c={};c.date=(new Date).getTime();c.categories=this.categories;LocalStorageSet("consent",JSON.stringify(c))};(function(){var c=new CookieConsent;App.AddDependency("cookieConsent",c)})();var HTMLConverter=function(){this.config={ignore:["SCRIPT","STYLE"],codeLanguages:{cs:"csharp"},thresholds:{em:.3,px:6,pt:6}};this.regex={block:/^(block|flex|table(-row)?|grid|list-item)$/i,lineThrough:/\bline-through\b/i,underline:/\bunderline\b/i,px:/([0-9.]+)(?:px|pt)/,em:/([0-9.]+)em/,spacing:/([0-9.]+)(em|px|pt)/,codeLanguage:/lang(?:uage)?-([a-z]+)/i,figureFloat:/bbcode-figure-(left|right)/i,email:/mailto:(.*)/i,validUrlProtocol:/^(https?|ftp):/i}}; HTMLConverter.prototype.processNode=function(c){switch(c.nodeType){case HTMLElement.TEXT_NODE:var d={type:"text"};d.text=c.nodeValue;return d;case HTMLElement.ELEMENT_NODE:if(-1==this.config.ignore.indexOf(c.tagName)){d={type:null,children:[]};var e=!1,f=window.getComputedStyle(c),g=f.fontSize,k=f.fontWeight,l=f.textDecoration;this.regex.lineThrough.test(l);var n=this.regex.block.test(f.display),m=n?1:0,p=n?1:0;if(n){if(r=this.regex.spacing.exec(f.marginTop))m=r[1]>this.config.thresholds[r[2]]?2: 1;if(r=this.regex.spacing.exec(f.paddingTop))m=Math.max(m,r[1]>this.config.thresholds[r[2]]?2:1);if(r=this.regex.spacing.exec(f.marginBottom))p=r[1]>this.config.thresholds[r[2]]?2:1;if(r=this.regex.spacing.exec(f.paddingBottom))p=Math.max(p,r[1]>this.config.thresholds[r[2]]?2:1);(r=this.regex.spacing.exec(c.style.height))&&0","God Mode Activated")},[73,68,68,81,68]),new Konami(document,function(){StyledAlert("Why would a pony need guns?")},[73,68,75,70,65]),new Konami(document,function(){StyledAlert('')}, [0,1,1,8,9,9,9,8,8,1,9,9,9,1,1,9,7,2,5,3].map(function(c){return c+48})),new Konami(document,function(){StyledAlert('')},"justinbailey".split("").map(function(c){c=c.charCodeAt(0);if(48<=c&&57>=c)return c;if(97<=c&&122>=c)return c-32})))})(); function composePm(c,d){var e=new PopUpMenu(""," Compose Private Message");e.LoadContent("/ajax/private-messages/new?receiver="+encodeURIComponent(d)+"&subject="+encodeURIComponent(c),!0).then(function(f){var g=App.GetControllerFromElement(f.element.querySelector(".compose-pm-controller"));g.onSend.addListener(function(){f.Close()});g.onCancel.addListener(function(){f.Close()})});e.SetWidth(500);e.SetDimmerEnabled(!0);e.Show()} fQuery.addScopedEventListener(document,"[data-action='compose-pm']","click",function(){var c=this.getAttribute("data-subject");null==c&&(c="");composePm(c,this.getAttribute("data-recipient"))});var HashCallbacks={};function fireHashCallback(c){var d=window.location.hash.substr(1).split("/",2);if(Object.prototype.hasOwnProperty.call(HashCallbacks,d[0]))HashCallbacks[d[0]](d[1],c)}window.addEventListener("hashchange",function(){return fireHashCallback(!1)}); function AddHashCallback(c,d){HashCallbacks[c]=d} function ShowErrorWindow(c){var d=new PopUpMenu(""," Error");d.SetContent("");d.SetCloseOnHoverOut(!1);d.SetFixed(!0);d.SetContent("
"+c+"
");d.SetFooter("
");d.SetCloseOnHoverOut(!1);d.SetWidth(350);d.Show();d.element.querySelector("button").addEventListener("click",function(e){e.preventDefault();e.stopPropagation();d.Close()})} function StyledConfirm(c,d,e,f){var g=new PopUpMenu(""," Confirm");g.SetContent("");g.SetCloseOnHoverOut(!1);g.SetFixed(!0);g.SetContent("
"+c+"
");g.SetFooter("
");g.SetCloseOnHoverOut(!1);g.SetWidth(350); g.Show();document.getElementById("ok_button").addEventListener("click",function(k){k.preventDefault();k.stopPropagation();g.Close();void 0!==d&&d();void 0!==f&&f()});document.getElementById("cancel_button").addEventListener("click",function(k){k.preventDefault();k.stopPropagation();g.Close();void 0!==e&&e();void 0!==f&&f()})} fQuery.addScopedEventListener(document.body,"[data-lightbox]","click",function(c){if(null==fQuery.closestParent(this,"a")){var d=this.dataset.source||this.dataset.fullsize||this.src,e='\n ";e=fQuery.createFromHtml(e); d=e.querySelector("a");d.textContent=d.host;var f=null,g=e.querySelector("img"),k=e.querySelector(".container");fQuery.animationFrame(function(){if(g.naturalWidth)return e.querySelector(".dimensions").textContent=g.naturalWidth+"px \u00d7 "+g.naturalHeight+"px",k.classList.add("show"),!1});e.addEventListener("click",function(l){var n=this;fQuery.isOrChildOf(l.target,e.querySelector(".caption"))||(fQuery.enableScroll(f),k.classList.remove("show"),e.classList.remove("show"),setTimeout(function(){return fQuery.removeElement(n)}, 200))});document.body.appendChild(e);forceRelayout(e);e.classList.add("show");f=fQuery.disableScroll();c.preventDefault();return!0}},!0);App.AddGlobalEventListener("click",".user_image_link",function(c){c.preventDefault();(c=this.parentNode.querySelector("img"))?c.parentNode.removeChild(c):(c=document.createElement("img"),c.src=this.href,c.className="user_image",c.setAttribute("data-lightbox",""),c.setAttribute("data-source",this.textContent),c.style.display="block",fQuery.insertAfter(this,c))}); var UpdateTimeOffsets=function(){if(!document.hidden&&!document.webkitHidden){var c=Math.floor((new Date-server_time_offset)/1E3),d=document.getElementsByClassName("time_offset");d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.textContent=TimeOffsetToFriendlyName(c-e.dataset.time)}};setInterval(UpdateTimeOffsets,5E3);document.addEventListener("visibilitychange webkitvisibilitychange",UpdateTimeOffsets); App.AddBinder(function(c){"twemoji"==LocalStorageGet("emojis","")&&twemoji.parse(c,{folder:"svg",ext:".svg"})}); fQuery.ready(function(){fQuery.addScopedEventListener(document.body,".drop-down-expander","click",function(c){var d=this.parentNode,e=null,f=d.dataset.closeOnLink?"true"==d.dataset.closeOnLink:!0;if(d.classList.contains("drop-down-show"))App.DispatchEvent(d,"close"),c.stopPropagation();else{d.classList.add("drop-down-show");var g=function(l){fQuery.isOrChildOf(l.target,d)||(App.DispatchEvent(d,"close"),l.stopPropagation())},k=function(l){d.classList.remove("drop-down-show");document.body.removeEventListener("click", g,!1);fQuery.removeScopedEventListener(d,"click",e);d.removeEventListener("close",k)};d.addEventListener("close",k);App.DispatchEvent(d,"opened");document.body.addEventListener("click",g,!1);e=fQuery.addScopedEventListener(d,".drop-down a","click",function(l){f&&App.DispatchEvent(d,"close")})}})}); fQuery.ready(function(){fQuery.addScopedEventListener(document.body,".form-signed","submit",function(){SignForm(this);return!0});fQuery.addScopedEventListener(document.body,".form-signed button[name]","click",function(){this.form._submitter=this});fQuery.addScopedEventListener(document.body,"[data-signed] button[name]","click",function(){this.form._submitter=this})}); window.addEventListener("load",function(){for(var c=parseInt(LocalStorageGet("adblock-message","0"),10),d=$jscomp.makeIterator(document.getElementsByClassName("dgjklsdjlgksjdg")),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.dataset.adClass;if("undefined"!==typeof e.dataset.adLazy)break;var g=(new Date).getTime(),k=e.querySelector("ins"),l=e.getBoundingClientRect();(null==k||0==l.height)&&g>c+2592E6&&(f=fQuery.createFromHtml("
\n Hey there, looks like you're using adblock! We know, we know, adverts are incredibly annoying, but they really help to support the site. If you'd consider unblocking the site, we'd be extremely appreciative!\n Hide This Message\n
"), e.appendChild(f))}});fQuery.addScopedEventListener(document,".button-hide-ads","click",function(c){var d=(new Date).getTime();LocalStorageSet("adblock-message",d);fQuery.removeElements(document.getElementsByClassName("dafhgadeh4rahdfhadfhadfhadfghaergerg"));c.preventDefault()});var Curves=function(){};Curves.Cos=function(c){return 1-(Math.cos(3.14159*c)+1)/2};Curves.EaseOut=function(c){return 1-(1-c)*(1-c)}; fQuery.addScopedEventListener(document,".jump-to","click",function(c){c.preventDefault();c=null;c=document.querySelector(this.dataset.jump);c=this.dataset.align&&"bottom"==this.dataset.align?c.getBoundingClientRect().bottom-window.innerHeight:c.getBoundingClientRect().top;fQuery.animateProperty(function(d){fQuery.scrollTop(d,!0)},fQuery.scrollTop(),document.body.scrollTop+c,.5,Curves.Cos)});function diff(c,d){for(;0'));this.element.querySelector(".bbcode-editor__footer").appendChild(fQuery.createFromHtml(''))}; BBCodeEditorController.prototype.layoutToolbar=function(c){c=void 0===c?!1:c;if(null==this.toolbarItems){var d=this.toolbar.querySelector(".toolbar_buttons");if(null==d.offsetParent)return;this.toolbarItems=Array.from(d.childNodes).filter(function(m){return 1==m.nodeType}).map(function(m,p){m.dataset.order=p;return{node:m,width:m.offsetWidth+(m.classList.contains("divider")?5:0),priority:m.hasAttribute("data-priority")?m.dataset.priority:0,order:p}}).sort(function(m,p){return m.priority==p.priority? m.order-p.order:m.priority-p.priority})}d=this.toolbar.getBoundingClientRect().width-10;if(this.lastToolbarWidth!=d||c){this.lastToolbarWidth=d;c=this.toolbar.querySelector(".toolbar_buttons");fQuery.removeChildren(c);fQuery.removeChildren(this.elements.overflowList);for(var e=0,f=$jscomp.makeIterator(this.toolbarItems),g=f.next();!g.done;g=f.next()){g=g.value;var k=!1;if(g.priority<=this.maxPriority){for(var l=0;lg.order){fQuery.insertBefore(n, g.node);k=!0;break}}e+=g.width;k||c.appendChild(g.node);if(e>d&&"-1"!=g.priority){c.removeChild(g.node);break}}}d=[];for(e=0;e'));for(k=0;ke.order){fQuery.insertBefore(l,g);f=!0;break}f||this.elements.overflowList.appendChild(g)}for(c=0;c=i;i++){e=document.createElement("li");var g=document.createElement("a");g.setAttribute("data-click","setHeading");g.setAttribute("data-size",i);g.style.fontSize= 1+(6-i)/6*.8+"em";g.textContent="Heading "+i;e.appendChild(g);f.appendChild(e)}c.parentNode.appendChild(d)}};BBCodeEditorController.prototype.setHeading=function(c){c=c.getAttribute("data-size");this.insertTag("h"+c)};BBCodeEditorController.prototype.setSize=function(c){c=c.getAttribute("data-size");this.insertTags("[size="+c+"em]","[/size]")};BBCodeEditorController.prototype.bold=function(c,d){d.preventDefault();this.insertTag("b")}; BBCodeEditorController.prototype.italic=function(c,d){d.preventDefault();this.insertTag("i")};BBCodeEditorController.prototype.underline=function(c,d){d.preventDefault();this.insertTag("u")};BBCodeEditorController.prototype.strikethrough=function(c,d){d.preventDefault();this.insertTag("s")};BBCodeEditorController.prototype.superscript=function(c,d){d.preventDefault();this.insertTag("sup")};BBCodeEditorController.prototype.subscript=function(c,d){d.preventDefault();this.insertTag("sub")}; BBCodeEditorController.prototype.code=function(c,d){d.preventDefault();this.insertTag("code")};BBCodeEditorController.prototype.quote=function(c,d){d.preventDefault();this.insertTag("quote")};BBCodeEditorController.prototype.spoiler=function(c,d){d.preventDefault();this.insertTag("spoiler")}; BBCodeEditorController.prototype.curlyQuotes=function(c,d){c=this.textarea.value;c=c.replace(/(\S)"/g,"$1\u201d");c=c.replace(/"(?=\S)/g,"\u201c");c=c.replace(/(\S)'/g,"$1\u2019");c=c.replace(/'(?=\S)/g,"\u2018");this.textarea.value=c};BBCodeEditorController.prototype.insertUl=function(c,d){d.preventDefault();c=this.getSelection();d="[list]\n";for(var e=$jscomp.makeIterator(c.split("\n")),f=e.next();!f.done;f=e.next())f=f.value,""!=f&&(d+="[*]"+f+"\n");""==c&&(d+="[*]\n");this.insertText(d+"[/list]\n")}; BBCodeEditorController.prototype.insertOl=function(c,d){d.preventDefault();c=this.getSelection();d="[list=1]\n";for(var e=$jscomp.makeIterator(c.split("\n")),f=e.next();!f.done;f=e.next())f=f.value,""!=f&&(d+="[*]"+f+"\n");""==c&&(d+="[*]\n");this.insertText(d+"[/list]\n")}; BBCodeEditorController.prototype.showAddLink=function(c,d){var e=this;d.preventDefault();c=this.getSelection();null==c&&(c="");var f=new PopUpMenu(""," Add Link");str="\n ";f.SetContent(str); f.SetCloseOnHoverOut(!1);f.SetWidth(350);f.Show();f.element.querySelector("[name=text]").value=c;f.element.querySelector("[name=link]").focus();document.getElementById("add_link").addEventListener("submit",function(g){g.preventDefault();var k=g.target;g=k.querySelector("input[name='link']").value;k=k.querySelector("input[name='text']").value;""==k?e.insertText("[url]"+g+"[/url]"):e.insertText("[url="+g+"]"+k+"[/url]");f.Close()})}; BBCodeEditorController.prototype.showEmoticonsPicker=function(c,d){d.preventDefault();d=c.parentNode.querySelector("div");if(null==d){d=document.createElement("div");c.parentNode.dataset.closeOnLink=!1;d.className="drop-down drop-down-emoticons";var e=document.createElement("div");e.className="arrow";var f=fQuery.createFromHtml('\n
\n \n
    \n
      \n
      '); d.appendChild(e);d.appendChild(f);c.parentNode.appendChild(d);App.BindAll(document)}};BBCodeEditorController.prototype.addEmoticon=function(c,d){d.preventDefault();this.insertText(c.getAttribute("data-emoticon"));d.shiftKey||d.ctrlKey||App.DispatchEvent(c,"close")}; BBCodeEditorController.prototype.showAddEmbed=function(c,d){d.preventDefault();var e={Youtube:/(?:youtube.com\/watch\S*v=|youtu.be\/)([a-z0-9-_]{11})/i,Streamable:/^https:\/\/(?:www\.)?streamable\.com\/([a-zA-Z0-9]+)/i,Gfycat:/https:\/\/(?:www\.)?gfycat\.com\/([a-zA-Z0-9]+)/i,Imgur:/^(?:https?:\/\/)?imgur\.com\/a\/([a-z0-9_-]{5})/i,Soundcloud:/^https:\/\/soundcloud.com\/(.*)$/i,Twitch:/^https?:\/\/(?:www.)?twitch\.tv\/([^/]+)$/i,Fimfiction:/^https?:\/\/(?:www.)?fimfiction.net\/story\/([0-9]+)\/.*$/i}, f=new PopUpMenu(""," Add Embed");str="\n
      \n
      \n
      \n \n
      \n Supported sources: "+ Object.keys(e).join(", ")+"\n
      \n
      \n \n \n \n
      \n
      \n \n
      \n "; f.SetContent(str);f.SetCloseOnHoverOut(!1);f.SetWidth(350);f.Show();var g=this;document.getElementById("add_embed").addEventListener("submit",function(k){k.preventDefault();k=this.querySelector("[name=url]").value;g.insertText("[embed]"+k+"[/embed]");f.Close()});document.getElementById("add_embed").querySelector("[name=url]").focus();document.getElementById("add_embed").querySelector("[name=url]").addEventListener("input",function(k){k=this.value;for(var l=!1,n=$jscomp.makeIterator(Object.keys(e)), m=n.next();!m.done;m=n.next())m=m.value,null!=k.match(e[m])&&(document.getElementById("embed_message").innerHTML=""+m+":
      "+k,l=!0);l?(this.setCustomValidity(""),document.getElementById("embed_message").classList.remove("hidden")):(this.setCustomValidity("Not a valid embeddable URL"),document.getElementById("embed_message").classList.add("hidden"))})}; BBCodeEditorController.prototype.showAddImage=function(c){var d=this,e=new PopUpMenu(""," Add Image");str="\n
      \n
      \n
      \n
      \n \n
      \n \n \n \n "+ (1
      ':"")+'\n
      \n \n \n
      ';e.SetContent(str);e.SetCloseOnHoverOut(!1);e.SetWidth(350);e.Show();var f=!1;document.getElementById("bbcode_image").focus(); document.getElementById("bbcode_image").addEventListener("input",function(){""!=this.value&&/:\/\//i.test(this.value)&&(document.getElementById("bbcode_image_preview").src=this.value);document.getElementById("bbcode_image_preview").classList.toggle("hidden",""==this.value)});document.getElementById("bbcode_image_preview").addEventListener("load",function(){f=!0;document.getElementById("add_image_error").classList.add("hidden")});document.getElementById("bbcode_image_preview").addEventListener("error", function(){f=!1});document.getElementById("add_image").addEventListener("submit",function(g){var k=document.getElementById("add_image").querySelector("[name=file]");if(k&&0 BBCode Editor Settings");str='\n
      \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      \n \n \n Rich Text Paste\n
      \n
      \n
      \n

      Rich text paste lets you copy directly from gdocs/word/web pages and converts any formatting to BBCode automatically.

      \n

      You can leave this option enabled and use "Ctrl + Shift + V" to paste without formatting.

      \n
      \n
      \n
      \n
      \n \n \n Hotkeys\n
      \n
      \n
      \n

      Toggle whether to enable hotkeys

      \n
        \n
      • Ctrl + B - Bold
      • \n
      • Ctrl + I - Italic
      • \n
      • Ctrl + U - Underline
      • \n
      • Ctrl + Q - Quote
      • \n
      • Ctrl + K - Insert Link
      • \n
      • Ctrl + E - Insert Embed
      • \n
      • Ctrl + H - Insert Horizontal Rule
      • \n
      \n
      \n
      \n
      \n
      \n \n \n Smart Quotes\n
      \n
      \n
      \n

      Turns ordinary quotes (" and \') into smart quotes with direction

      \n
      \n
      \n
      \n
      \n \n
      '; e.SetContent(str);e.SetCloseOnHoverOut(!1);e.SetWidth(350);e.Show();var f=this;document.getElementById("bbcode-settings").addEventListener("submit",function(g){f.settings.richPaste=this.querySelector("[name=rich_paste]").checked;f.settings.hotkeys=this.querySelector("[name=hotkeys]").checked;f.settings.smartQuotes=this.querySelector("[name=smart_quotes]").checked;LocalStorageSet("bbcode_settings",JSON.stringify(f.settings));g.preventDefault();e.Close()});document.getElementById("bbcode-settings").querySelector("[name=cancel]").addEventListener("click", function(g){e.Close()})};BBCodeEditorController.prototype.togglePreview=function(c,d){this.showPreview(c,d)}; BBCodeEditorController.prototype.showPreview=function(c,d){new AjaxRequest({url:"/ajax/bbcode/html",method:"POST",button:c,spinner:c.querySelector("i"),data:{bbcode:this.textarea.value,preview_mode:this.element.dataset.previewMode},success:function(e){var f=new PopUpMenu("","Preview");f.SetWidth(800);f.SetContent('
      '+e.content+"
      ");f.SetFooter(''); f.Show();document.getElementById("button-close-preview").addEventListener("click",function(){f.Close()})}})};BBCodeEditorController.prototype.closePreview=function(){this.element.removeAttribute("data-previewing",!0);this.layoutToolbar(!0)};BBCodeEditorController.prototype.toggleFullscreen=function(c){this.element.hasAttribute("data-fullscreen")?this.exitFullscreen():(this.element.setAttribute("data-fullscreen","true"),this.focus(),document.body.style.overflow="hidden",this.layoutToolbar(!0))}; BBCodeEditorController.prototype.exitFullscreen=function(){this.element.hasAttribute("data-fullscreen")&&(this.element.removeAttribute("data-fullscreen"),this.focus(),document.body.style.overflow=null,this.layoutToolbar(!0))};App.AddController("bbcode-editor",BBCodeEditorController); function ConfirmPrompt(c,d){var e=new PopUpMenu(""," Comfirm Action");e.SetCloseOnHoverOut(!1);e.SetFixed(!0);e.SetContent("\n
      "+c+"
      \n ");e.SetCloseOnHoverOut(!1); e.SetWidth(350);e.Show();e.element.querySelector("#confirm_prompt").addEventListener("submit",function(f){f.preventDefault();d();e.Close()});e.element.querySelector("#confirm_prompt [data-cancel-button").addEventListener("click",function(f){f.preventDefault();f.stopPropagation();e.Close()})} function StyledAlert(c,d,e){e=void 0===e?[]:e;var f=new PopUpMenu(""," "+(void 0===d?"":d));e.align||(e.align="center");c="
      "+c+"
      ";f.SetCloseOnHoverOut(!1);f.SetFixed(!0);f.SetContent(c);f.SetFooter("
      ");f.SetCloseOnHoverOut(!1);f.SetWidth(350);f.Show();f.element.querySelector("[data-alert-button]").addEventListener("click", function(g){g.preventDefault();g.stopPropagation();f.Close()})};var dash_sayings="Do you want to come inside?;Are you a SPY?;It needs to be about 20% coo...*vomit*;I'm...an egghead!;Awesome!;Now careful [CENSORED];Excuse me!;Never fear, your friendly neighbourhood Dash is here!;And that's why you would never qualify to be my pet;Dun dun duuuun;My life is ruined!;I lost...;Best day ever!;LOUDER!;Pinkie Pie...you are SO random;Time to take out the adorable trash;Yes, it's all true;10...seconds...flat;I'd rather read Daring Do;'I love you, daddy'. Who'd write such trash?".split(";"), InteractivePony=function(){var c=this;this.base_url="//static.fimfiction.net/images/interactive_pony/dash/";this.sprite="dashing_right.gif";this.dom_element=fQuery.createFromHtml("
      Do you want to come inside?
      ");document.body.appendChild(this.dom_element);this.x=0;this.y=175;this.max_speed=300;this.hspeed=0;this.acceleration=17;this.friction= .93;this.facing="right";this.on_ground=!0;this.sleep_timer=0;this.text="";this.target_y=this.target_x=this.next_text_timer=this.text_counter=0;this.state="default";this.dom_element.addEventListener("click",function(){c.Clicked()});document.body.addEventListener("mousemove",function(d){var e=d.target;if(!fQuery.isOrChildOf(e,c.dom_element)){do if(50this.x+30&&(this.hspeed+=this.acceleration),this.target_xthis.max_speed&&(this.hspeed=this.max_speed),this.hspeed<-this.max_speed&&(this.hspeed=-this.max_speed),this.hspeed*=this.friction,2this.hspeed&&(this.facing="left"),this.x+=this.hspeed*c;"default"==this.state&&(1>Math.abs(this.hspeed)? (this.sleep_timer+=c,10f&&(f=-150);this.y+=f*c;1>Math.abs(e-this.y)&&this.x>d.left&&this.xthis.text.length&&(this.next_text_timer+=c);5this.hspeed?this.SetSprite("dashing_left.gif"):-15>this.hspeed?this.SetSprite("trotcycle_rainbow_left.gif"):this.SetSprite("stand_rainbow_"+this.facing+".gif"):this.SetSprite("fly_rainbow_"+this.facing+".gif");var c=parseInt(this.x-this.dom_element.getBoundingClientRect().width/ 2,10)+"px",d=parseInt(this.y-this.dom_element.getBoundingClientRect().height,10)+"px";this.dom_element.style.top!=d&&(this.dom_element.style.top=d);this.dom_element.style.left!=c&&(this.dom_element.style.left=c);this.dom_element.querySelector(".speech").textContent=this.text.substr(0,parseInt(this.text_counter,10))}; function InitiateInteractivePony(){var c=new InteractivePony;window.addEventListener("blur",function(){});window.addEventListener("focus",function(){});fQuery.animationFrame(function(d){c.Update(d);c.Render()},.1)}fQuery.ready(function(){1==LocalStorageGet("show_interactive_pony",0)&&InitiateInteractivePony()});var Group=function(){};Group.showAddToGroup=function(c){var d=new PopUpMenu(""," Add To Groups");d.SetWidth(450);d.SetCloseOnHoverOut(!1);d.SetCloseOnLinkPressed(!1);d.SetContent("
      ");d.LoadContent("/ajax/groups/list/add-story?story="+c,!0);d.Show()};var window_focused=!0,last_update_interval=60,time_since_update=0,max_interval=600,total_elapsed_time=0,num_notifications=0,flash_title=!1,title_cache="",flash_state=!1,popup_timer=0,beep_enabled=!1,debug=!1,event_source=null,event_source_interval=null,popup_interval=null,worker=null; function ShowNotification(c,d){"undefined"===typeof d&&(d=(new Date).getTime());if(!c.nsfw||"true"==getCookie("view_mature"))if(console.log("Showing notification: "+d),"granted"==DesktopNotificationStatus()){var e=LocalStorageGet("latest_message_id",-1);if(d!=e){LocalStorageSet("latest_message_id",d);var f=new Notification(c.title,{icon:"undefined"!==typeof c.icon?c.icon:"http://static.fimfiction.net/images/notifications/story.png",body:c.text,tag:d});"show"in f&&f.show();if("link"in c){var g=c.link, k=window;f.onclick=function(){k&&!k.closed?(k.location=g,k.focus()):window.open(g)}}setTimeout(function(){f.close()},2E4);beep_enabled&&document.getElementById("notification_beep").play()}setTimeout(function(){LocalStorageSet("latest_message_id",-1)},1E3)}else e=LocalStorageGet("latest_message_id",-1),d>e&&(LocalStorageSet("latest_message_id",d),beep_enabled&&document.getElementById("notification_beep").play()),$("#notification_popup .notification_title").text(c.title),$("#notification_popup .notification_title").attr("href", c.link),$("#notification_popup .notification_body").text(c.text),$("#notification_popup .notification_image").attr("src","http://static.fimfiction.net/images/notifications/story.png"),$("#notification_popup").fadeIn(),popup_timer=10,null==popup_interval&&(popup_interval=setInterval(function(){UpdateNotificationsPopup()},1E3))} function StartNotificationsWorker(){worker=new SharedWorker("/workers/notifications_worker.js");worker.port.addEventListener("message",function(c){if("ping"===c.data)worker.port.postMessage(logged_in_user.id);else{if("notification"==c.data.message){var d=JSON.parse(c.data.data);ShowNotification(d,d.identifier);console.log("Updating counts: "+c.data.counts);SetNotificationCount(c.data.counts)}"private_message"==c.data.message&&(d=JSON.parse(c.data.data),ShowNotification(d,c.data.event_id));"counts"== c.data.message&&(console.log("Updating counts: "+c.data.data),SetNotificationCount(c.data.data))}},!1);worker.port.start();worker.port.postMessage(logged_in_user.id)} function StartNotificationsEventSource(){var c=function(){var d=LocalStorageGet("last_event_source_ping",0);null!=event_source?LocalStorageSet("last_event_source_ping",GetTime()):dnum_notifications;num_notifications=f;!window_focused&&g&&(flash_title=!0,document.title="("+num_notifications+") "+title_cache);0==d&&0==c?($("#num_notifications").parent().removeClass("new"),document.title=title_cache):$("#num_notifications").parent().addClass("new");$("#num_social_notifications").text(c);0==c?$("#num_social_notifications").parent().removeClass("new"): $("#num_social_notifications").parent().addClass("new");$("#num_meta_notifications").text(d);0==d?$("#num_meta_notifications").parent().removeClass("new"):$("#num_meta_notifications").parent().addClass("new");$("#num_content_notifications").text(e);0==e?$("#num_content_notifications").parent().removeClass("new"):$("#num_content_notifications").parent().addClass("new");$("#num_notifications").text(parseInt(d)+parseInt(c))} var Notifications=function(){this.num_meta_notifications=this.num_social_notifications=this.num_content_notifications=0;this.onCountsUpdated=new EventBus};Notifications.prototype.setContentNotifications=function(c){this.num_content_notifications=c;this.updateNotificationsDisplay()};Notifications.prototype.setMetaNotifications=function(c){this.num_social_notifications=c;this.updateNotificationsDisplay()};Notifications.prototype.setSocialNotifications=function(c){this.num_meta_notifications=c;this.updateNotificationsDisplay()}; Notifications.prototype.updateNotificationsDisplay=function(){this.onCountsUpdated.fire(this.num_content_notifications,this.num_meta_notifications,this.num_social_notifications)};var notifications=new Notifications;function InitialiseNotificationUpdater(c,d,e){num_notifications=c;title_cache=d;beep_enabled=e}function UpdateNotificationsPopup(){flash_state=!flash_state;popup_timer--;0==popup_timer&&($("#notification_popup").fadeOut(),clearInterval(popup_interval))} function DesktopNotificationStatus(){if("function"!==typeof Notification)return null;if("permission"in Notification)return Notification.permission;if(window.webkitNotifications&&window.webkitNotifications.checkPermission)switch(window.webkitNotifications.checkPermission()){case 0:return"granted";case 1:return"default";case 2:return"denied"}return null};AjaxRequest.BindForm(".form-submit-story",function(c){window.setTimeout("location.reload()",0)});fQuery.addScopedEventListener(document,".button-set-featured-groups","click",function(c){c.preventDefault();c=this.dataset.story;var d=new PopUpMenu(""," Set Featured Groups");d.LoadContent("/ajax/groups/list/featured?story="+c,!0);d.SetCloseOnHoverOut(!1);d.SetWidth(400);d.Show()}); (function(){fQuery.ready(function(c){c=document.querySelectorAll(".story-description");for(var d=0;dc){var g=d;var k=f;var l=0}else 1<=c&&2>c?(g=f,k=d,l=0):2<=c&&3>c?(g=0,k=d,l=f):3<=c&&4>c?(g=0,k=f,l=d):4<=c&&5>c?(g=f,k=0,l=d):5<=c&&6>c&&(g=d,k=0,l=f);e-=d/2;g+=e;k+=e;l+=e;return rgbtohex(255*(0>g?0:1k?0:1l?0:1c;c+=40)fimf_chart_theme.AmSlicedChart.colors.push(hsltorgb(c,1,.47));for(c=20;360>c;c+=40)fimf_chart_theme.AmSlicedChart.colors.push(hsltorgb(c,1,.47))})();var fimf_dual_axis_chart_theme=JSON.parse(JSON.stringify(fimf_chart_theme));fimf_dual_axis_chart_theme.ValueAxesSettings.inside=!0;fimf_dual_axis_chart_theme.ValueAxesSettings.integersOnly=!0;fimf_dual_axis_chart_theme.PanelsSettings={};fimf_dual_axis_chart_theme.PanelsSettings.marginLeft=0; fimf_dual_axis_chart_theme.PanelsSettings.marginRight=0;var RegisterController=function(){Controller.apply(this,arguments)};$jscomp.inherits(RegisterController,Controller); RegisterController.prototype.bind=function(c){var d=this;Controller.prototype.bind.call(this,c);c=jstz.determine();this.inputs.timezone.value=c.name();this.inputs.name.addEventListener("blur",function(e){var f=e.target;new AjaxRequest({url:"/ajax/users/validate/username",method:"POST",data:{username:f.value},success:function(g){g.ok?d.elements.username_taken.classList.add("hidden"):(d.elements.username_taken.classList.remove("hidden"),f.setCustomValidity("Username has already been used"))}})});this.inputs.email.addEventListener("blur", function(e){var f=e.target;new AjaxRequest({url:"/ajax/users/validate/email",method:"POST",data:{email:f.value},success:function(g){g.ok?d.elements.email_taken.classList.add("hidden"):(d.elements.email_taken.classList.remove("hidden"),f.setCustomValidity("Email has already been used"))}})})};RegisterController.prototype.inputName=function(c,d,e){e.setCustomValidity("")};RegisterController.prototype.inputEmail=function(c,d,e){e.setCustomValidity("")};App.AddController("register",RegisterController);var FrontpageController=function(){Controller.call(this);this.featuredStory=Math.floor(10*Math.random())+1;this.lastFeaturedStory=null;this.selectFeaturedStory(this.featuredStory)};$jscomp.inherits(FrontpageController,Controller); FrontpageController.prototype.bind=function(c){var d=this;Controller.prototype.bind.call(this,c);this.newStories=document.querySelector("new_stories");this.latestStories=document.querySelector("latest_stories");this.nextTimer=setInterval(function(){d.nextFeaturedStory()},1E4);fQuery.click(c.querySelectorAll(".featured_box ul li"),function(e){e=e.target.getAttribute("data-story");d.selectFeaturedStory(e);clearInterval(d.nextTimer)})}; FrontpageController.prototype.nextFeaturedStory=function(){var c=this.featuredStory+1;10window.innerWidth||(this.featuredStory=c,this.lastFeaturedStory!=this.featuredStory&&(this.lastFeaturedStory=this.featuredStory,fQuery.removeClass(document.querySelectorAll(".featured_box ul li"),"selected"),document.getElementById("featured_story_link_"+c).classList.add("selected"),c=document.getElementById("featured_story_"+c),document.querySelector(".featured_box .right").appendChild(c)))};App.AddController("frontpage",FrontpageController);var CommentListController=function(){Controller.apply(this,arguments)};$jscomp.inherits(CommentListController,Controller); CommentListController.prototype.bind=function(c){var d=this;Controller.prototype.bind.call(this,c);this.container=c;this.current_page=parseInt(c.getAttribute("data-current-page"),10);this.num_pages=parseInt(c.getAttribute("data-num-pages"),10);this.comment_list=c.querySelector(".comment_list");this.type=this.comment_list.getAttribute("data-type");this.item=parseInt(this.comment_list.getAttribute("data-item"),10);this.order=this.comment_list.getAttribute("data-order");this.hoverTimeout=this.quote_container= null;this.updatePagination();this.setupQuotes();for(var e=this,f=c.querySelectorAll(".page_list .previous"),g=0;gthis.num_pages){e.classList.add("hidden");break}else e.classList.remove("hidden");e=400this.num_pages-f||g>this.current_page-(e+1)&&gf&&fQuery.scrollTop(f));d.comment_list.classList.add("loading");document.body.classList.add("loading");d.current_page=c;d.updatePagination();new AjaxRequest({url:"/ajax/comments/"+d.type,method:"GET",data:{item_id:d.item,page:c,order:d.order},success:function(g){for(var k=$jscomp.makeIterator(d.element.querySelectorAll(".comment_order")), l=k.next();!l.done;l=k.next())l=l.value,g.order==l.getAttribute("data-order")?l.parentNode.classList.add("selected"):l.parentNode.classList.remove("selected");d.current_page=c;d.num_pages=g.num_pages;d.updatePagination();d.updateContent(g.content);d.endShowQuote();d.comment_list.classList.remove("loading");document.body.classList.remove("loading");App.DispatchEvent(document,"loadVisibleImages");d.setupQuotes();e(c);k=$jscomp.makeIterator(d.element.querySelectorAll(".start-index"));for(l=k.next();!l.done;l= k.next())l.value.textContent=g.start_index;k=$jscomp.makeIterator(d.element.querySelectorAll(".end-index"));for(l=k.next();!l.done;l=k.next())l.value.textContent=g.end_index;k=$jscomp.makeIterator(d.element.querySelectorAll(".num-comments"));for(l=k.next();!l.done;l=k.next())l.value.textContent=g.num_comments}})})};CommentListController.prototype.getComments=function(){return this.comment_list.querySelectorAll(".comment")}; CommentListController.prototype.goToComment=function(c,d){var e=this;(new Promise(function(f,g){e.comment_list.querySelector("#comment_"+c)?f(e.current_page):new AjaxRequest({url:"/ajax/comments/page",method:"GET",data:{type:e.type,item:e.item,comment:c},success:function(k){0');this.h1=this.element.querySelector("h1");this.closeButton=this.element.querySelector(".close_button");this.content=this.element.querySelector(".drop-down-pop-up-content");this.onClose=new EventBus;var f=this;this.closeButton.addEventListener("click", function(){e.Close()});this.h1.addEventListener("mousedown",function(g){e.closeButton.contains(g.target)||e.closeButton==g.target||e.Grab()});this.h1.addEventListener("touchstart",function(g){e.closeButton.contains(g.target)||e.closeButton==g.target||e.Grab(!0)});document.body.addEventListener("mouseup",function(g){f.Release()},!0);document.body.addEventListener("touchend",function(g){f.Release()},!0);fQuery.addScopedEventListener(this.element,"a","click",function(g){e.close_on_link_pressed&&g.target!= e.closeButton&&e.Close()});this.dimmer_enabled=!0;this.close_on_link_pressed=!1;this.dimmer=null;this.close_on_hover_out=!1;this.allow_close=!0;this.deltay=this.deltax=null;this.h1.style.cursor="move";this.showing=this.grabbed=this.fixed=this.soft_close=!1;this.width=null};PopUpMenu.prototype.SetTitle=function(c){this.element.querySelector("h1 span").textContent=c};PopUpMenu.prototype.SetFixed=function(c){this.fixed=c};PopUpMenu.prototype.SetDimmerEnabled=function(c){this.dimmer_enabled=c}; PopUpMenu.prototype.SetSoftClose=function(c){this.soft_close=c};PopUpMenu.prototype.SetCloseOnLinkPressed=function(c){this.close_on_link_pressed=c};PopUpMenu.prototype.SetCloseOnHoverOut=function(c){this.close_on_hover_out=c};PopUpMenu.prototype.SetAllowClose=function(c){this.allow_close=c;fQuery.removeElement(this.closeButton)}; PopUpMenu.prototype.Grab=function(c){var d=this;this.grabbed||((void 0===c?0:c)?(this.touchmove_handler=function(e){d.MouseMove(e.changedTouches[0].pageX,e.changedTouches[0].pageY)},document.body.addEventListener("touchmove",this.touchmove_handler)):(this.mousemove_handler=function(e){d.MouseMove(e.pageX,e.pageY)},document.body.addEventListener("mousemove",this.mousemove_handler)),document.body.classList.add("unselectable"),is_mobile&&document.body.classList.add("unscrollable"),this.grabbed=!0)}; PopUpMenu.prototype.Release=function(){this.grabbed&&(document.body.classList.remove("unscrollable"),document.body.classList.remove("unselectable"),document.body.removeEventListener("mousemove",this.mousemove_handler),document.body.removeEventListener("touchmove",this.touchmove_handler),this.deltay=this.deltax=null,this.grabbed=!1)}; PopUpMenu.prototype.MouseMove=function(c,d){this.fixed&&(c-=document.body.scrollLeft,d-=document.body.scrollTop);null==this.deltax&&(this.deltax=c-this.x,this.deltay=d-this.y);this.x=c-this.deltax;this.y=d-this.deltay;c=this.element.offsetHeight;d=this.element.offsetWidth;if(this.fixed){var e=0;this.x=Math.max(e,Math.min(this.x,window.innerWidth-e-d));this.y=Math.max(e,Math.min(this.y,window.innerHeight-e-c))}else e=0,this.x=Math.max(fQuery.scrollLeft()+e,Math.min(this.x,fQuery.scrollLeft()+(window.innerWidth- e)-d)),this.y=Math.max(fQuery.scrollTop()+e,Math.min(this.y,fQuery.scrollTop()+(window.innerHeight-e)-c));this.element.style.left=this.x+"px";this.element.style.top=this.y+"px"}; PopUpMenu.prototype.Close=function(){var c=this;this.showing=!1;this.Release();var d=/([0-9.]+)px/i.exec(this.element.style.top),e=parseFloat(d[1]);fQuery.animateProperty(function(f){c.element.style.top=e+150*f+"px";c.element.style.opacity=1-f;c.dimmer&&(c.dimmer.style.opacity=1-f)},0,1,.15).then(function(){null!=c.dimmer&&(fQuery.removeElement(c.dimmer),c.dimmer=null,PopUpMenu.z_index--);fQuery.removeElement(c.element);c.soft_close||document.removeEventListener("keyup",c.document_keyup_handler); c.onClose.fire(c)})}; PopUpMenu.prototype.LoadContent=function(c,d){var e=this;this.SetContent("
      ");return new Promise(function(f,g){"undefined"!==typeof d&&d?new AjaxRequest({url:c,method:"GET",success:function(k){e.content.innerHTML=k.content;e.SetPosition();f(e);App.BindAll(document)},fail:function(k){ShowErrorWindow(k.error);g(e)}}):this.content.load(c,{},function(){e.SetPosition();f(e)})})}; PopUpMenu.prototype.SetContent=function(c){var d=this.element.offsetHeight,e=this.element.offsetWidth;this.content.innerHTML=c;this.showing&&this.SetPosition(this.x-(this.element.offsetWidth-e)/2,fQuery.scrollTop()+this.y-(this.element.offsetHeight-d)/2)};PopUpMenu.prototype.SetFooter=function(c){c=fQuery.createFromHtml("");this.content.appendChild(c)}; PopUpMenu.prototype.SetWidth=function(c){"auto"==c?this.element.querySelector(".drop-down-pop-up").style.width="auto":(c>window.innerWidth-20&&(c=window.innerWidth-20),this.width=c,this.element.querySelector(".drop-down-pop-up").style.width=c+"px",forceRelayout(this.element.querySelector(".drop-down-pop-up")))}; PopUpMenu.prototype.SetPosition=function(c,d){c=void 0===c?null:c;d=void 0===d?null:d;forceRelayout(this.element);null===c&&(c=window.innerWidth/2-this.element.getBoundingClientRect().width/2+fQuery.scrollLeft(),d=window.innerHeight/2-this.element.offsetHeight/2+fQuery.scrollTop());d=Math.max(0,d);this.fixed&&(c-=fQuery.scrollLeft(),d-=fQuery.scrollTop());this.element.style.left=c+"px";this.element.style.top=d+"px";this.x=c;this.y=d}; PopUpMenu.prototype.ShowDimmer=function(){var c=this;this.dimmer_enabled&&null==this.dimmer&&(PopUpMenu.z_index++,this.dimmer=fQuery.createFromHtml("
      "),document.getElementById("dimmers").appendChild(this.dimmer),fQuery.animateProperty(function(d){c.dimmer&&(c.dimmer.style.opacity=1-d)},1,0,.15,Curves.EaseOut))}; PopUpMenu.prototype.Show=function(c,d,e){var f=this;e=void 0===e?!0:e;this.showing=!0;document.body.appendChild(this.element);App.BindAll(this.element);this.ShowDimmer();this.document_keyup_handler=this.document_keyup_handler||function(k){27==k.keyCode&&f.allow_close&&f.Close()};document.addEventListener("keyup",this.document_keyup_handler);this.element.style.position=this.fixed?"fixed":"absolute";this.element.style.zIndex=PopUpMenu.z_index;this.SetPosition(c,d);c=/([0-9.]+)px/i.exec(this.element.style.top); var g=parseFloat(c[1]);e&&fQuery.animateProperty(function(k){f.element.style.top=g-150*k+"px";f.element.style.opacity=1-k},1,0,.15,Curves.EaseOut)};PopUpMenu.z_index=1E3;(function(){try{var c="undefined"!==typeof Intl&&"undefined"!==typeof Intl.Collator?Intl.Collator("generic",{sensitivity:"base"}):null}catch(g){console.log("Collator could not be initialized and wouldn't be used")}var d=[],e=[],f={get:function(g,k,l){var n=l&&c&&l.useCollator;l=g.length;var m=k.length;if(0===l)return m;if(0===m)return l;var p;for(p=0;pt&&(q=t);t=d[n+1]+1;q>t&&(q=t);d[n]=k}d[n]=q}else for(p=0;pt&&(q=t),t=d[n+1]+1,q>t&&(q=t),d[n]=k;d[n]=q}return q}};"undefined"!==typeof define&&null!==define&&define.amd?define(function(){return f}):"undefined"!==typeof module&&null!==module&&"undefined"!==typeof exports&&module.exports===exports?module.exports=f:"undefined"!==typeof self&&"function"===typeof self.postMessage&&"function"=== typeof self.importScripts?self.Levenshtein=f:"undefined"!==typeof window&&null!==window&&(window.Levenshtein=f)})();var Search=function(){};Search.levenshteinDistance=function(c,d){return window.Levenshtein.get(c,d)}; Search.characterSearch=function(c,d,e){e=void 0===e?!1:e;d=d.toLowerCase();if(""==d)return c.map(function(f){return f.item});c=c.map(function(f){var g=0,k=-1,l=f.text;Array.isArray(l)||(l=[l]);for(var n=0;n