// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0 !function(e){var t={};function n(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(s,i,function(t){return e[t]}.bind(null,i));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";function s(e,t,n,s,i){var o;if((o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")).onreadystatechange=function(){4==this.readyState&&n(o)},o.open(e,t,!0),s)for(var r in s)s.hasOwnProperty(r)&&o.setRequestHeader(r,s[r]);o.withCredentials=!0,o.send(i)}function i(e){return void 0!==e&&e&&e.constructor===Array}function o(e){return document.cookie.search(e)>=0}n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return l}));var s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o={Y:function(e){return e.getUTCFullYear()},m:function(e){return e.getUTCMonth()+1},b:function(e){return i[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},d:function(e){return e.getUTCDate()},H:function(e){return("0"+e.getUTCHours()).slice(-2)},M:function(e){return("0"+e.getUTCMinutes()).slice(-2)},S:function(e){return("0"+e.getUTCSeconds()).slice(-2)},"%":function(){return"%"}};function r(e){var t=function(e){return"number"==typeof e&&(e=e.toString()),[e.slice(-14,-10),e.slice(-10,-8),e.slice(-8,-6),e.slice(-6,-4),e.slice(-4,-2),e.slice(-2)]}(e);return new Date(Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]))}function a(e){return i[e]}function l(e,t){return t.replace(/%./g,(function(t){var n=o[t[1]];return n?n(r(e)):t}))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var s=n(0);function i(e,t){for(var n=0;n=400?i.failure&&i.failure(e):i.success&&i.success(e)}),{"Content-Type":"application/json"},o.stringify({url:e,snapshot:t,tags:n||[]})),!1}var a=function(){function e(t,n,i){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=t,this.url=n,this.timestamp=i,t.onclick=this.save.bind(this),document.addEventListener("DOMContentLoaded",(function(){Object(s.b)("logged-in-user")&&Object(s.b)("logged-in-sig")?o.userIsLoggedIn():o.userIsNotLoggedIn()}))}var t,n,o;return t=e,(n=[{key:"save",value:function(e){this.start(),r(this.url,this.timestamp,[],{failure:this.failure.bind(this),success:this.success.bind(this)})}},{key:"start",value:function(){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-open","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-in-progress"])}},{key:"failure",value:function(e){401==e.status?this.userNotLoggedIn(e):(this.hide(["wm-save-snapshot-in-progress","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-fail","wm-save-snapshot-open"]),console.log("You have got an error."),console.log("If you think something wrong here please send it to support."),console.log('Response: "'+e.responseText+'"'),console.log('status: "'+e.status+'"'))}},{key:"success",value:function(e){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-in-progress"]),this.show(["wm-save-snapshot-open","wm-save-snapshot-success"])}},{key:"userIsLoggedIn",value:function(){this.show("wm-save-snapshot-open"),this.hide("wm-sign-in")}},{key:"userIsNotLoggedIn",value:function(){this.hide(["wm-save-snapshot-open","wm-save-snapshot-in-progress"]),this.show("wm-sign-in")}},{key:"show",value:function(e){this.setDisplayStyle(e,"inline-block")}},{key:"hide",value:function(e){this.setDisplayStyle(e,"none")}},{key:"setDisplayStyle",value:function(e,t){var n=this;(Object(s.c)(e)?e:[e]).forEach((function(e){var s=n.el.getRootNode().getElementById(e);s&&(s.style.display=t)}))}}])&&i(t.prototype,n),o&&i(t,o),e}()},function(e,t,n){"use strict";n.r(t);var s,i={};n.r(i),n.d(i,"init",(function(){return r}));var o={createElementNS:document.createElementNS};function r(e){!function(){var e=document.cookie.split(";");if(e.length>40)for(var t=0;t=t?e:"00000000".substring(0,t-e.length)+e}function h(e){for(var t=0,n=0;n3}(e)){var s=[];for(n=0;n0?(r=0,b.map((function(e){e.match("^https?://")&&(r++,Object(d.a)("HEAD",e,(function(e){if(200==e.status){var t=e.getResponseHeader("Memento-Datetime");if(null==t)console.log("%s: no Memento-Datetime",u);else{var n=document.createElement("span"),a=function(e,t){var n=new Date(e).getTime()-t,s="";n<0?(s+="-",n=Math.abs(n)):s+="+";var i=!1;if(n<1e3)return{delta:n,text:"",highlight:i};var o=n,r=Math.floor(n/1e3/60/60/24/30/12);n-=1e3*r*60*60*24*30*12;var a=Math.floor(n/1e3/60/60/24/30);n-=1e3*a*60*60*24*30;var l=Math.floor(n/1e3/60/60/24);n-=1e3*l*60*60*24;var c=Math.floor(n/1e3/60/60);n-=1e3*c*60*60;var u=Math.floor(n/1e3/60);n-=1e3*u*60;var h=Math.floor(n/1e3),d=[];r>1?(d.push(r+" years"),i=!0):1==r&&(d.push(r+" year"),i=!0);a>1?(d.push(a+" months"),i=!0):1==a&&(d.push(a+" month"),i=!0);l>1?d.push(l+" days"):1==l&&d.push(l+" day");c>1?d.push(c+" hours"):1==c&&d.push(c+" hour");u>1?d.push(u+" minutes"):1==u&&d.push(u+" minute");h>1?d.push(h+" seconds"):1==h&&d.push(h+" second");d.length>2&&(d=d.slice(0,2));return{delta:o,text:s+d.join(" "),highlight:i}}(t,o),l=a.highlight?"color:red;":"";n.innerHTML=" "+a.text,n.title=t,n.setAttribute("style",l);var c=e.getResponseHeader("Content-Type"),u=e.responseURL.replace(window.location.origin,""),h=document.createElement("a");h.innerHTML=u.split("/").splice(3).join("/"),h.href=u,h.title=c,h.onmouseover=g,h.onmouseout=v;var d=document.createElement("div");d.setAttribute("data-delta",a.delta),d.appendChild(h),d.append(n),s.appendChild(d);var f=Array.prototype.slice.call(s.childNodes,0);f.sort((function(e,t){return t.getAttribute("data-delta")-e.getAttribute("data-delta")})),s.innerHTML="";for(var p=0,m=f.length;p0)for(var n=0;n0)for(var n=0;n0?this.sc.scrollTop=i+this.sc.suggestionHeight+s-this.sc.maxHeight:i<0&&(this.sc.scrollTop=i+s)}}},{key:"blurHandler",value:function(){var e=this;try{var t=this.root.querySelector(".wb-autocomplete-suggestions:hover")}catch(e){t=null}t?this.input!==document.activeElement&&setTimeout((function(){return e.focus()}),20):(this.last_val=this.input.value,this.sc.style.display="none",setTimeout((function(){return e.sc.style.display="none"}),350))}},{key:"suggest",value:function(e){var t=this.input.value;if(this.cache[t]=e,e.length&&t.length>=this.minChars){for(var n="",s=0;s40)&&13!=n&&27!=n){var s=this.input.value;if(s.length>=this.minChars){if(s!=this.last_val){if(this.last_val=s,clearTimeout(this.timer),this.cache){if(s in this.cache)return void this.suggest(this.cache[s]);for(var i=1;i'+e.replace(n,"$1")+""}},{key:"onSelect",value:function(e,t,n){}}]),e}(),N=function(){function e(t,n){b(this,e);var s=t.getRootNode();if(s.querySelector){var i="object"==w(t)?[t]:s.querySelectorAll(t);this.elems=i.map((function(e){return new E(e,n)}))}}return C(e,[{key:"destroy",value:function(){for(;this.elems.length>0;)this.elems.pop().unload()}}]),e}(),O=n(2),A=window.JSON,R=window.open,_=window.Date,I=document,j=document,U=function(e){return j.getElementById(e)};var D,q="/static/";function B(e){x.classList.contains("wm-closed")?(e&&L.classList.add("notice-only"),x.classList.replace("wm-closed","wm-open"),L.style.display="block",f(D,q,U)):(x.classList.replace("wm-open","wm-closed"),L.style.display="none",L.classList.remove("notice-only"))}function F(e,t){var n=U(e);n&&(n.style.visibility=t?"visible":"hidden")}function P(e,t){Object(d.c)(e)||(e=[e]);for(var n=0;n0&&o<60,o)}))}window.__wm={init:r,bt:function(e,t,n,s,i,o,r,a,f,p){q=f||"/static/",D=r;var m,g,v,y="/"+(i||"web")+"/",w=l.c(D),b=w.getUTCFullYear(),M=w.getUTCMonth()+1,C=w.getUTCDate(),T=-1,k=-1,S=U("wm-ipp-base");if(S.attachShadow){var H=S.attachShadow({mode:"closed"});for(j=H;S.children.length>0;)H.appendChild(S.children[0]);if(p)for(var E=0;E'+((""+n).replace(/\B(?=(\d{3})+$)/g,",")+" ")+(n>1?"captures":"capture")+"",d=l.a(i,"%d %b %Y");r!=i&&(d+=" - "+l.a(r,"%d %b %Y")),h+='
'+d+"
",t.innerHTML=h}(s),function(e,t,n,s,i,o,r){var a=s.getContext("2d");if(a){a.fillStyle="#FFF";var l=(new c).getUTCFullYear(),u=t/(l-i+1),d=h(e.years),f=d[0],p=n/d[1];if(o>=i){var m=k(o);a.fillStyle="#FFFFA5",a.fillRect(m,0,u,n)}for(var g=i;g<=l;g++){m=k(g);a.beginPath(),a.moveTo(m,0),a.lineTo(m,n),a.lineWidth=1,a.strokeStyle="#CCC",a.stroke()}r=parseInt(r)-1;for(var v=(u-1)/12,y=0;y0){var T=Math.ceil(C*p);a.fillStyle=g==o&&M==r?"#EC008C":"#000",a.fillRect(Math.round(b),Math.ceil(n-T),Math.ceil(v),Math.round(T))}b+=v}}}function k(e){return Math.ceil((e-i)*u)+.5}}(s,e,t,Q,a,b,M)}}))}else{var Z=new Image;Z.src="/__wb/sparkline?url="+encodeURIComponent(o)+"&width="+e+"&height="+t+"&selected_year="+b+"&selected_month="+M+(i&&"&collection="+i||""),Z.alt="sparkline",Z.width=e,Z.height=t,Z.id="sparklineImgId",Z.border="0",K.parentNode.replaceChild(Z,K)}function ee(e){for(var t=[],n=e.length,s=0;s