This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
forked from inexorabletash/polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.min.js
1 lines (1 loc) · 10.4 KB
/
web.min.js
1
!function(t){"window"in t&&"document"in t&&(document.head=document.head||document.getElementsByTagName("head")[0],["abbr","article","aside","audio","bdi","canvas","data","datalist","details","dialog","figcaption","figure","footer","header","hgroup","main","mark","meter","nav","output","picture","progress","section","summary","template","time","video"].forEach(function(t){document.createElement(t)}),!("dataset"in document.createElement("span"))&&"Element"in t&&Element.prototype&&Object.defineProperty&&Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=Object.create(null),e=0;e<this.attributes.length;++e){var n=this.attributes[e];n.specified&&"data-"===n.name.substring(0,5)&&!function(e,n){t[n]=e.getAttribute("data-"+n),Object.defineProperty(t,n,{get:function(){return e.getAttribute("data-"+n)},set:function(t){e.setAttribute("data-"+n,t)}})}(this,n.name.substring(5))}return t}}),function(){function e(t){t=String(t);var e,n=0,o=[],i=0,a=0;if(t=t.replace(/\s/g,""),t.length%4===0&&(t=t.replace(/=+$/,"")),t.length%4===1)throw Error("InvalidCharacterError");if(/[^+/0-9A-Za-z]/.test(t))throw Error("InvalidCharacterError");for(;n<t.length;)e=r.indexOf(t.charAt(n)),i=i<<6|e,a+=6,24===a&&(o.push(String.fromCharCode(i>>16&255)),o.push(String.fromCharCode(i>>8&255)),o.push(String.fromCharCode(255&i)),a=0,i=0),n+=1;return 12===a?(i>>=4,o.push(String.fromCharCode(255&i))):18===a&&(i>>=2,o.push(String.fromCharCode(i>>8&255)),o.push(String.fromCharCode(255&i))),o.join("")}function n(t){t=String(t);var e,n,o,i,a,c,u,s=0,l=[];if(/[^\x00-\xFF]/.test(t))throw Error("InvalidCharacterError");for(;s<t.length;)e=t.charCodeAt(s++),n=t.charCodeAt(s++),o=t.charCodeAt(s++),i=e>>2,a=(3&e)<<4|n>>4,c=(15&n)<<2|o>>6,u=63&o,s===t.length+2?(c=64,u=64):s===t.length+1&&(u=64),l.push(r.charAt(i),r.charAt(a),r.charAt(c),r.charAt(u));return l.join("")}if(!("atob"in t&&"btoa"in t)){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.atob=e,t.btoa=n}}())}(this),function(t){"window"in t&&"document"in t&&(document.querySelectorAll||(document.querySelectorAll=function(t){var e,n=document.createElement("style"),r=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=t+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)e=document._qsa.shift(),e.style.removeAttribute("x-qsa"),r.push(e);return document._qsa=null,r}),document.querySelector||(document.querySelector=function(t){var e=document.querySelectorAll(t);return e.length?e[0]:null}),document.getElementsByClassName||(document.getElementsByClassName=function(t){return t=String(t).replace(/^|\s+/g,"."),document.querySelectorAll(t)}),t.Node=t.Node||function(){throw TypeError("Illegal constructor")},Node.ELEMENT_NODE=1,Node.ATTRIBUTE_NODE=2,Node.TEXT_NODE=3,Node.CDATA_SECTION_NODE=4,Node.ENTITY_REFERENCE_NODE=5,Node.ENTITY_NODE=6,Node.PROCESSING_INSTRUCTION_NODE=7,Node.COMMENT_NODE=8,Node.DOCUMENT_NODE=9,Node.DOCUMENT_TYPE_NODE=10,Node.DOCUMENT_FRAGMENT_NODE=11,Node.NOTATION_NODE=12,t.DOMException=t.DOMException||function(){throw TypeError("Illegal constructor")},DOMException.INDEX_SIZE_ERR=1,DOMException.DOMSTRING_SIZE_ERR=2,DOMException.HIERARCHY_REQUEST_ERR=3,DOMException.WRONG_DOCUMENT_ERR=4,DOMException.INVALID_CHARACTER_ERR=5,DOMException.NO_DATA_ALLOWED_ERR=6,DOMException.NO_MODIFICATION_ALLOWED_ERR=7,DOMException.NOT_FOUND_ERR=8,DOMException.NOT_SUPPORTED_ERR=9,DOMException.INUSE_ATTRIBUTE_ERR=10,DOMException.INVALID_STATE_ERR=11,DOMException.SYNTAX_ERR=12,DOMException.INVALID_MODIFICATION_ERR=13,DOMException.NAMESPACE_ERR=14,DOMException.INVALID_ACCESS_ERR=15,function(){function e(t,e){if("function"==typeof e){"DOMContentLoaded"===t&&(t="load");var n=this,r=function(t){t._timeStamp=Date.now(),t._currentTarget=n,e.call(this,t),t._currentTarget=null};this["_"+t+e]=r,this.attachEvent("on"+t,r)}}function n(t,e){if("function"==typeof e){"DOMContentLoaded"===t&&(t="load");var n=this["_"+t+e];n&&(this.detachEvent("on"+t,n),this["_"+t+e]=null)}}"Element"in t&&!Element.prototype.addEventListener&&Object.defineProperty&&(Event.CAPTURING_PHASE=1,Event.AT_TARGET=2,Event.BUBBLING_PHASE=3,Object.defineProperties(Event.prototype,{CAPTURING_PHASE:{get:function(){return 1}},AT_TARGET:{get:function(){return 2}},BUBBLING_PHASE:{get:function(){return 3}},target:{get:function(){return this.srcElement}},currentTarget:{get:function(){return this._currentTarget}},eventPhase:{get:function(){return this.srcElement===this.currentTarget?Event.AT_TARGET:Event.BUBBLING_PHASE}},bubbles:{get:function(){switch(this.type){case"click":case"dblclick":case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"mouseout":case"mousewheel":case"keydown":case"keypress":case"keyup":case"resize":case"scroll":case"select":case"change":case"submit":case"reset":return!0}return!1}},cancelable:{get:function(){switch(this.type){case"click":case"dblclick":case"mousedown":case"mouseup":case"mouseover":case"mouseout":case"mousewheel":case"keydown":case"keypress":case"keyup":case"submit":return!0}return!1}},timeStamp:{get:function(){return this._timeStamp}},stopPropagation:{value:function(){this.cancelBubble=!0}},preventDefault:{value:function(){this.returnValue=!1}},defaultPrevented:{get:function(){return this.returnValue===!1}}}),[Window,HTMLDocument,Element].forEach(function(t){t.prototype.addEventListener=e,t.prototype.removeEventListener=n}))}(),window.addEvent=function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&(t["e"+e+n]=n,t[e+n]=function(){var r=window.event;r.currentTarget=t,r.preventDefault=function(){r.returnValue=!1},r.stopPropagation=function(){r.cancelBubble=!0},r.target=r.srcElement,r.timeStamp=Date.now(),t["e"+e+n].call(this,r)},t.attachEvent("on"+e,t[e+n]))},window.removeEvent=function(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&(t.detachEvent("on"+e,t[e+n]),t[e+n]=null,t["e"+e+n]=null)},function(){function e(t,e){function n(t){return t.length?t.split(/\s+/g):[]}function r(t,e){var r=n(e),o=r.indexOf(t);return-1!==o&&r.splice(o,1),r.join(" ")}if(Object.defineProperties(this,{length:{get:function(){return n(t[e]).length}},item:{value:function(r){var o=n(t[e]);return r>=0&&r<o.length?o[r]:null}},contains:{value:function(r){if(r=String(r),0===r.length)throw SyntaxError();if(/\s/.test(r))throw Error("InvalidCharacterError");var o=n(t[e]);return-1!==o.indexOf(r)}},add:{value:function(){var r=Array.prototype.slice.call(arguments).map(String);if(r.some(function(t){return 0===t.length}))throw SyntaxError();if(r.some(function(t){return/\s/.test(t)}))throw Error("InvalidCharacterError");try{var o=t[e],i=n(o);if(r=r.filter(function(t){return-1===i.indexOf(t)}),0===r.length)return;0===o.length||/\s$/.test(o)||(o+=" "),o+=r.join(" "),t[e]=o}finally{var a=n(t[e]).length;this.length!==a&&(this.length=a)}}},remove:{value:function(){var o=Array.prototype.slice.call(arguments).map(String);if(o.some(function(t){return 0===t.length}))throw SyntaxError();if(o.some(function(t){return/\s/.test(t)}))throw Error("InvalidCharacterError");try{var i=t[e];o.forEach(function(t){i=r(t,i)}),t[e]=i}finally{var a=n(t[e]).length;this.length!==a&&(this.length=a)}}},toggle:{value:function(o,i){try{if(o=String(o),0===o.length)throw SyntaxError();if(/\s/.test(o))throw Error("InvalidCharacterError");var a=n(t[e]),c=a.indexOf(o);if(-1!==c&&(!i||void 0===i))return t[e]=r(o,t[e]),!1;if(-1!==c&&i)return!0;var u=t[e];return 0===u.length||/\s$/.test(u)||(u+=" "),u+=o,t[e]=u,!0}finally{var s=n(t[e]).length;this.length!==s&&(this.length=s)}}},toString:{value:function(){return t[e]}}}),"length"in this)for(var o=0;100>o;++o)Object.defineProperty(this,String(o),{get:function(t){return function(){return this.item(t)}}(o)});else this.length=n(t[e]).length}function n(e,n){"Element"in t&&Element.prototype&&Object.defineProperty&&Object.defineProperty(Element.prototype,e,{get:n})}"classList"in document.createElement("span")?window.getClassList=function(t){return t.classList}:(window.getClassList=function(t){return new e(t,"className")},n("classList",function(){return new e(this,"className")})),"relList"in document.createElement("link")?window.getRelList=function(t){return t.relList}:(window.getRelList=function(t){return new e(t,"rel")},n("relList",function(){return new e(this,"rel")}))}())}(this),function(t){"window"in t&&"document"in t&&(t.XMLHttpRequest=t.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("This browser does not support XMLHttpRequest.")},XMLHttpRequest.UNSENT=0,XMLHttpRequest.OPENED=1,XMLHttpRequest.HEADERS_RECEIVED=2,XMLHttpRequest.LOADING=3,XMLHttpRequest.DONE=4,function(){function e(t){if(this._data=[],t)for(var e=0;e<t.elements.length;++e){var n=t.elements[e];""!==n.name&&this.append(n.name,n.value)}}if(!("FormData"in t)){e.prototype={append:function(e,n){if("Blob"in t&&n instanceof t.Blob)throw TypeError("Blob not supported");e=String(e),this._data.push([e,n])},toString:function(){return this._data.map(function(t){return encodeURIComponent(t[0])+"="+encodeURIComponent(t[1])}).join("&")}},t.FormData=e;var n=t.XMLHttpRequest.prototype.send;t.XMLHttpRequest.prototype.send=function(t){return t instanceof e&&(this.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),arguments[0]=t.toString()),n.apply(this,arguments)}}}())}(this),function(t){"window"in t&&"document"in t&&"TextRectangle"in this&&!("width"in TextRectangle.prototype)&&Object.defineProperties(TextRectangle.prototype,{width:{get:function(){return this.right-this.left}},height:{get:function(){return this.bottom-this.top}}})}(this),function(t){"window"in t&&"document"in t&&(!function(){function e(t){return t.offsetWidth>0&&t.offsetHeight>0}function n(){var t=a;a=Object.create(null),u=-1,Object.keys(t).forEach(function(n){var r=t[n];(!r.element||e(r.element))&&r.callback(Date.now())})}function r(e,r){var o=++c;return a[o]={callback:e,element:r},-1===u&&(u=t.setTimeout(n,1e3/i)),o}function o(e){delete a[e],0===Object.keys(a).length&&(t.clearTimeout(u),u=-1)}if(!("requestAnimationFrame"in t)){var i=60,a=Object.create(null),c=0,u=-1;t.requestAnimationFrame=r,t.cancelAnimationFrame=o}}(),function(){function e(e){var n=[].slice.call(arguments,1);return t.setTimeout(function(){e.apply(null,n)},0)}function n(e){t.clearTimeout(e)}"setImmediate"in t||(t.setImmediate=e,t.clearImmediate=n)}())}(this);