container/doc/Creating containers - Part .../playback.js

4 lines
23 KiB
JavaScript

// @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<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}var o=JSON;function r(e,t,n,i){return i=i||{},Object(s.a)("POST","/__wb/web-archive/",(function(e){401===e.status?i.userNotLoggedIn&&i.userNotLoggedIn(e):e.status>=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<e.length;t++){a(e[t].split("=")[0].trim())}}(),s=e,document.createElementNS=function(e,t){return 0==e.indexOf(s)&&(e=e.substring(s.length).replace(/\/?[0-9]+\//,"")),o.createElementNS.call(this,e,t)}}function a(e){!function(e,t,n){if(n){var s=new Date;s.setTime(s.getTime()+24*n*60*60*1e3);var i="; expires="+s.toGMTString()}else i="";document.cookie=e+"="+t+i+"; path=/"}(e,"",-1)}var l=n(1),c=window.Date;function u(e,t){return(e=e.toString()).length>=t?e:"00000000".substring(0,t-e.length)+e}function h(e){for(var t=0,n=0;n<e.length;n++)t=Math.max(t,Math.max.apply(null,e[n][1]));if(function(e){for(var t=0,n=1e3,s=0;s<e.length;s++){var i=e[s];t=Math.max(t,Math.max.apply(null,i[1])),n=Math.min(n,Math.min.apply(null,i[1].filter(Boolean)))}return Math.log1p(t)-Math.log1p(n)>3}(e)){var s=[];for(n=0;n<e.length;n++){var i=e[n];s.push([i[0],i[1].map(Math.log1p)])}e=s,t=Math.log1p(t)}return[e,t]}var d=n(0);function f(e,t,n){var s=n("wm-capresources");s.innerHTML="";var i=n("wm-capresources-loading");i.style.display="block";var o=l.c(e).getTime(),r=0;t=window.location.origin+t;for(var a=[],c=y(window,"img"),u=0,h=c.length;u<h;u++)c[u].src&&!c[u].src.startsWith(t)&&c[u].src.startsWith(window.location.origin)&&!c[u].src.startsWith("data:")&&a.push(c[u].src);var f=y(window,"frame");for(u=0,h=f.length;u<h;u++)f[u].src&&a.push(f[u].src);var p=y(window,"iframe");for(u=0,h=p.length;u<h;u++)!p[u].src||p[u].id&&"playback"===p[u].id||a.push(p[u].src);var m=y(window,"script");for(u=0,h=m.length;u<h;u++)m[u].src&&!m[u].src.startsWith(t)&&m[u].src.startsWith(window.location.origin)&&a.push(m[u].src);var w=y(window,"link");for(u=0,h=w.length;u<h;u++)w[u].href&&!w[u].href.startsWith(t)&&w[u].href.startsWith(window.location.origin)&&w[u].rel&&"stylesheet"==w[u].rel&&a.push(w[u].href);var b=a.filter((function(e,t,n){return n.indexOf(e)===t}));b.length>0?(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;p<m;p++)s.appendChild(f[p])}}0==--r&&(i.style.display="none")})))}))):(s.innerHTML="There are no sub-resources in the page.",i.style.display="none")}function p(e,t){for(var n=t.split("/").splice(6).join("/"),s=e.document.querySelectorAll("img[src$='"+n+"'], iframe[src$='"+n+"'], frame[src$='"+n+"']"),i=Array.prototype.slice.call(s),o=0;o<e.frames.length;o++)try{var r=p(e.frames[o].window,t);i=i.concat(r)}catch(e){}return i}function m(e){return"FRAME"==e.tagName||"IFRAME"==e.tagName?e.contentWindow.document.documentElement:e}function g(e){var t=p(window,e.target.href);if(t.length>0)for(var n=0;n<t.length;n++)m(t[n]).classList.add("wb-highlight")}function v(e){var t=p(window,e.target.href);if(t.length>0)for(var n=0;n<t.length;n++)m(t[n]).classList.remove("wb-highlight")}function y(e,t){for(var n=e.document.getElementsByTagName(t),s=Array.prototype.slice.call(n),i=0;i<e.frames.length;i++)try{var o=y(e.frames[i].window,t);s=s.concat(o)}catch(e){}return s}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function C(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e}function T(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function k(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n)}function S(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n)}function H(e,t,n,s){k(s||document,t,(function(t){for(var s,i=t.target||t.srcElement;i&&!(s=T(i,e));)i=i.parentElement;s&&n.call(i,t)}))}var x,L,E=function(){function e(t,n){b(this,e),this.input=t,this.source=0,this.minChars=3,this.delay=150,this.offsetLeft=0,this.offsetTop=0,this.cache=!0,this.menuClass="",Object.assign(this,n),this.root=this.input.getRootNode(),this.cache&&(this.cache={}),this.sc=document.createElement("div"),this.sc.className="wb-autocomplete-suggestions "+this.menuClass,this.root.appendChild(this.sc);this.selector;this.autocompleteAttr=t.getAttribute("autocomplete"),t.setAttribute("autocomplete","off"),this.last_val="",this.updateSC=this.updateSC.bind(this),this.blurHandler=this.blurHandler.bind(this),this.keydownHandler=this.keydownHandler.bind(this),this.keyupHandler=this.keyupHandler.bind(this),this.focusHandler=this.focusHandler.bind(this),k(window,"resize",this.updateSC),k(t,"blur",this.blurHandler),k(t,"keydown",this.keydownHandler),k(t,"keyup",this.keyupHandler),this.minChars||k(t,"focus",this.focusHandler);var s=this;H("wb-autocomplete-suggestion","mouseleave",(function(e){var t=s.sc.querySelector(".autocomplete-suggestion.selected");t&&setTimeout((function(){t.className=t.className.replace("selected","")}),20)}),this.sc),H("wb-autocomplete-suggestion","mouseover",(function(e){var t=s.sc.querySelector(".wb-autocomplete-suggestion.selected");t&&(t.className=t.className.replace("selected","")),this.className+=" selected"}),this.sc),H("wb-autocomplete-suggestion","mousedown",(function(e){if(T(this,"wb-autocomplete-suggestion")){var t=this.getAttribute("data-val");s.input.value=t,s.onSelect(e,t,this),s.sc.style.display="none"}}),this.sc)}return C(e,[{key:"unload",value:function(){S(window,"resize",this.updateSC),S(this.input,"blur",this.blurHandler),S(this.input,"focus",this.focusHandler),S(this.input,"keydown",this.keydownHandler),S(this.input,"keyup",this.keyupHandler),this.autocompleteAttr?this.setAttribute("autocomplete",this.autocompleteAttr):this.removeAttribute("autocomplete"),this.root.removeChild(this.sc)}},{key:"updateSC",value:function(e,t){var n=this.input.getBoundingClientRect();if(this.sc.style.left=Math.round(n.left+(window.pageXOffset||document.documentElement.scrollLeft)+this.offsetLeft)+"px",this.sc.style.top=Math.round(n.bottom+(window.pageYOffset||document.documentElement.scrollTop)+this.offsetTop)+"px",this.sc.style.width=Math.round(n.right-n.left)+"px",!e)if(this.sc.style.display="block",this.sc.maxHeight||(this.sc.maxHeight=parseInt((window.getComputedStyle?getComputedStyle(this.sc,null):this.sc.currentStyle).maxHeight)),this.sc.suggestionHeight||(this.sc.suggestionHeight=this.sc.querySelector(".wb-autocomplete-suggestion").offsetHeight),this.sc.suggestionHeight)t||(this.sc.scrollTop=0);else{var s=this.sc.scrollTop,i=t.getBoundingClientRect().top-this.sc.getBoundingClientRect().top;i+this.sc.suggestionHeight-this.sc.maxHeight>0?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;s<e.length;s++)n+=this.renderItem(e[s],t);this.sc.innerHTML=n,this.updateSC(0)}else this.sc.style.display="none"}},{key:"keydownHandler",value:function(e){var t,n=this,s=window.event?e.keyCode:e.which;if((40==s||38==s)&&this.sc.innerHTML)return(i=this.sc.querySelector(".wb-autocomplete-suggestion.selected"))?(t=40==s?i.nextSibling:i.previousSibling)?(i.className=i.className.replace("selected",""),t.className+=" selected",this.input.value=t.getAttribute("data-val")):(i.className=i.className.replace("selected",""),this.input.value=this.last_val,t=0):((t=40==s?this.sc.querySelector(".wb-autocomplete-suggestion"):this.sc.childNodes[this.sc.childNodes.length-1]).className+=" selected",this.input.value=t.getAttribute("data-val")),this.updateSC(0,t),!1;if(27==s)this.value=this.last_val,this.sc.style.display="none";else if(13==s||9==s){var i;(i=this.sc.querySelector(".wb-autocomplete-suggestion.selected"))&&"none"!=this.sc.style.display&&(this.onSelect(e,i.getAttribute("data-val"),i),setTimeout((function(){n.sc.style.display="none"}),20))}}},{key:"keyupHandler",value:function(e){var t=this,n=window.event?e.keyCode:e.which;if(!n||(n<35||n>40)&&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<s.length-this.minChars;i++){var o=s.slice(0,s.length-i);if(o in this.cache&&!this.cache[o].length)return void this.suggest([])}}this.timer=setTimeout((function(){t.source(s,t.suggest.bind(t))}),this.delay)}}else this.last_val=s,this.sc.style.display="none"}}},{key:"focusHandler",value:function(e){this.last_val="\n",this.keyupHandler(e)}},{key:"renderItem",value:function(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var n=new RegExp("("+t.split(" ").join("|")+")","gi");return'<div class="wb-autocomplete-suggestion" data-val="'+e+'">'+e.replace(n,"<b>$1</b>")+"</div>"}},{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;n<e.length;n++)F(e[n],t)}var Y=/web\/(\d*)\/http:\/\/web\.archive\.org\/screenshot/g;function X(e,t,n){!function(e,t){Object(d.a)("HEAD",e,(function(e){t(e.status<300,e.responseURL)}))}("/web/"+t+"/http://web.archive.org/screenshot/"+e,(function(e,s){if(!e)return n(!1);var i=function(e){var t=Y.exec(e);return t&&t[1]?t[1]:null}(s),o=(l.c(i).getTime()-l.c(t).getTime())/1e3;console.log("screen shot delta: "+o+"s"),n(o>0&&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<p.length;E++){var F=I.createElement("link");F.setAttribute("rel","stylesheet"),F.setAttribute("type","text/css"),F.setAttribute("href",p[E]),H.appendChild(F)}}window.top==window.self&&(S.style.display="block");var Y=!1,W=!0,J=document.getElementById("donato");if(J)if(window.top!=window.self)J.style.display="none";else{var $=document.getElementById("donato-base");window.addEventListener("message",(function(e){if(-1!==e.origin.indexOf("archive.org")){var t="string"==typeof e.data?A.parse(e.data):e.data;if(console.log("got message %o",t),"set height"==t.event){var n=t.value,s=t.bannerHeight;if("number"!=typeof n||n<=0)return;if(!W)return;if(prevHeight=t.value,Y)return;J.style.height=s+"px",$.style.height=n+"px"}else if("open modal"==t.event)$.style.height="",document.body.classList.add("wm-modal"),window.scrollTo(0,0),Y=!0;else if("close modal"==t.event)J.style.marginBottom="0px",document.body.classList.remove("wm-modal"),Y=!1;else if("hide banner"==t.event){J.style.height=0;var i=new _(_.now()+24*t.value*3600*1e3);document.cookie="donation=x; domain=archive.org; path=/; expires="+i.toUTCString(),W=!1,Y=!1,prevHeight=0}}}),!1)}var G=U("wm-ipp-sparkline");function z(e){var t="mouseenter"==e.type?1:0;if(t!==m){var n=U("wm-ipp"),s=U("displayYearEl"),i=U("displayMonthEl"),o=U("displayDayEl");t?n.className="hi":(n.className="",s.innerHTML=b,i.innerHTML=l.b(M-1),o.innerHTML=u(C,2)),g.style.display=t?"inline":"none",v.style.display=t?"inline":"none",m=t}}x=U("wm-expand"),L=U("wm-capinfo"),(g=I.createElement("div")).className="yt",g.style.display="none",g.style.width=n+"px",g.style.height=t+"px",(v=I.createElement("div")).className="mt",v.style.display="none",v.style.width=s+"px",v.style.height=t+"px",G.appendChild(g),G.appendChild(v);var K=U("wm-sparkline-canvas");G.onmouseenter=z,G.onmouseleave=z,G.onmousemove=function(t){var i,r,c=G,h=function(e){var t=0;return e.pageX||e.pageY?t=e.pageX:(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft),t}(t),d=(i=c,r=I.documentElement,("undefied"!=typeof i.getBoundingClientRect?i.getBoundingClientRect():{top:0,left:0}).left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)),f=Math.min(Math.max(0,h-d),e),p=f%n,m=Math.floor(f/n),w=Math.min(11,Math.floor(p/s)),b=12*m+w,M=p%2==1?15:1,C=u(m+a)+u(w+1,2)+u(M,2)+"000000";U("displayYearEl").innerHTML=m+a,U("displayMonthEl").innerHTML=l.b(w);var S=y+C+"/"+o;if(U("wm-graph-anchor").href=S,T!=m){var H=m*n;g.style.left=H+"px",T=m}if(k!=b){var x=m+b*s+1;v.style.left=x+"px",k=b}};var Q=U("wm-sparkline-canvas");if(Q.getContext&&Q.getContext("2d")){var V="/__wb/sparkline?output=json&url="+encodeURIComponent(o)+(i&&"&collection="+i||"");Object(d.a)("GET",V,(function(n){if(200==n.status){for(var s=A.parse(n.responseText),i=s.years,r=Object.getOwnPropertyNames(i),u=s.years=[],d=0;d<r.length;d++){var f=r[d];i[f]&&u.push([f,i[f]])}!function(e){for(var t=U("wm-nav-captures"),n=0,s=e.years,i=e.first_ts,r=e.last_ts,a=0;a<s.length;a++)for(var c=s[a][1],u=0;u<c.length;u++)n+=c[u];var h='<a class="t" href="'+y+"*/"+o+'" title="See a list of every capture for this URL">'+((""+n).replace(/\B(?=(\d{3})+$)/g,",")+" ")+(n>1?"captures":"capture")+"</a>",d=l.a(i,"%d %b %Y");r!=i&&(d+=" - "+l.a(r,"%d %b %Y")),h+='<div class="r" title="Timespan for captures of this URL">'+d+"</div>",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;y<f.length;y++){g=f[y][0];for(var w=f[y][1],b=k(g)+1,M=0;M<12;M++){var C=w[M];if(C>0){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<n;s++)void 0===e[s].excluded&&t.push(e[s].display_name);return t}U("wm-share-facebook").onclick=function(e){var t=this.dataset.url;return R("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t),"","height=400,width=600"),e.preventDefault(),!1},U("wm-share-twitter").onclick=function(e){var t=this.dataset.url;return R("https://twitter.com/intent/tweet?text="+encodeURIComponent(t)+"&via=internetarchive","","height=446,width=600"),e.preventDefault(),!1},new N(U("wmtbURL"),{delay:400,source:function(e,t){Object(d.a)("GET","/__wb/search/host?q="+encodeURIComponent(e),(function(n){if(void 0!==(n=A.parse(n.response)).hosts&&n.hosts.length>0){var s=ee(n.hosts);t(s)}else void 0!==n.isUrl&&!0===n.isUrl&&void 0===n.excluded?t([e]):Object(d.a)("GET","/__wb/search/anchor?q="+encodeURIComponent(e),(function(e){if(void 0!==(e=A.parse(e.response))&&e.length>0){var n=ee(e.slice(0,5));t(n)}}))}))},onSelect:function(e,t,n){U("wmtb").submit()}}),U("wmtb").onsubmit=function(e){var t=U("wmtbURL").value;if(0!==t.indexOf("http://")&&0!==t.indexOf("https://")&&!t.match(/[\w\.]{2,256}\.[a-z]{2,4}/gi))return document.location.href="/web/*/"+U("wmtbURL").value,e.preventDefault(),!1},function(e,t){X(e,t,(function(e,t){e?(U("wm-screenshot").title="screen shot (delta: "+t+"s)",P("wm-screenshot",!0)):P("wm-screenshot",!1)}))}(o,D),U("wm-capinfo-notice")&&B(!0),new O.a(U("wm-save-snapshot-open"),o,D)},h:function(e){U("wm-ipp").style.display="none",e.stopPropagation()},ex:function(e){e.stopPropagation(),B(!1)}},window.__wbhack=i}]);
// @license-end