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 pathpolyfill.min.js
1 lines (1 loc) · 15.9 KB
/
polyfill.min.js
1
Object.getPrototypeOf||(Object.getPrototypeOf=function(t){if(t!==Object(t))throw TypeError("Object.getPrototypeOf called on non-object");return t.__proto__||t.constructor.prototype||Object.prototype}),"function"!=typeof Object.getOwnPropertyNames&&(Object.getOwnPropertyNames=function(t){if(t!==Object(t))throw TypeError("Object.getOwnPropertyNames called on non-object");var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r}),"function"!=typeof Object.create&&(Object.create=function(t,e){function r(){}if("object"!=typeof t)throw TypeError();r.prototype=t;var n=new r;if(t&&(n.constructor=r),void 0!==e){if(e!==Object(e))throw TypeError();Object.defineProperties(n,e)}return n}),function(){if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}()){var t=Object.defineProperty;Object.defineProperty=function(e,r,n){if(t)try{return t(e,r,n)}catch(o){}if(e!==Object(e))throw TypeError("Object.defineProperty called on non-object");return Object.prototype.__defineGetter__&&"get"in n&&Object.prototype.__defineGetter__.call(e,r,n.get),Object.prototype.__defineSetter__&&"set"in n&&Object.prototype.__defineSetter__.call(e,r,n.set),"value"in n&&(e[r]=n.value),e}}}(),"function"!=typeof Object.defineProperties&&(Object.defineProperties=function(t,e){if(t!==Object(t))throw TypeError("Object.defineProperties called on non-object");var r;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&Object.defineProperty(t,r,e[r]);return t}),Object.keys||(Object.keys=function(t){if(t!==Object(t))throw TypeError("Object.keys called on non-object");var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r}),Function.prototype.bind||(Function.prototype.bind=function(t){function e(){}if("function"!=typeof this)throw TypeError("Bind must be called on a function");var r=[].slice,n=r.call(arguments,1),o=this,i=function(){return o.apply(this instanceof e?this:t,n.concat(r.call(arguments)))};return e.prototype=o.prototype,i.prototype=new e,i}),Array.isArray=Array.isArray||function(t){return Boolean(t&&"[object Array]"===Object.prototype.toString.call(Object(t)))},Array.prototype.indexOf||(Array.prototype.indexOf=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if(0===r)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),isNaN(n)?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=r)return-1;for(var o=n>=0?n:Math.max(r-Math.abs(n),0);r>o;o++)if(o in e&&e[o]===t)return o;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if(0===r)return-1;var n=r;arguments.length>1&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))));for(var o=n>=0?Math.min(n,r-1):r-Math.abs(n);o>=0;o--)if(o in e&&e[o]===t)return o;return-1}),Array.prototype.every||(Array.prototype.every=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();var n,o=arguments[1];for(n=0;r>n;n++)if(n in e&&!t.call(o,e[n],n,e))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();var n,o=arguments[1];for(n=0;r>n;n++)if(n in e&&t.call(o,e[n],n,e))return!0;return!1}),Array.prototype.forEach||(Array.prototype.forEach=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();var n,o=arguments[1];for(n=0;r>n;n++)n in e&&t.call(o,e[n],n,e)}),Array.prototype.map||(Array.prototype.map=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();var n=[];n.length=r;var o,i=arguments[1];for(o=0;r>o;o++)o in e&&(n[o]=t.call(i,e[o],o,e));return n}),Array.prototype.filter||(Array.prototype.filter=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();var n,o=[],i=arguments[1];for(n=0;r>n;n++)if(n in e){var c=e[n];t.call(i,c,n,e)&&o.push(c)}return o}),Array.prototype.reduce||(Array.prototype.reduce=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();if(0===r&&1===arguments.length)throw TypeError();var n,o=0;if(arguments.length>=2)n=arguments[1];else for(;;){if(o in e){n=e[o++];break}if(++o>=r)throw TypeError()}for(;r>o;)o in e&&(n=t.call(void 0,n,e[o],o,e)),o++;return n}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){if(void 0===this||null===this)throw TypeError();var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw TypeError();if(0===r&&1===arguments.length)throw TypeError();var n,o=r-1;if(arguments.length>=2)n=arguments[1];else for(;;){if(o in this){n=this[o--];break}if(--o<0)throw TypeError()}for(;o>=0;)o in e&&(n=t.call(void 0,n,e[o],o,e)),o--;return n}),String.prototype.trim||(String.prototype.trim=function(){return String(this).replace(/^\s+/,"").replace(/\s+$/,"")}),Date.now||(Date.now=function(){return Number(new Date)}),Date.prototype.toISOString||(Date.prototype.toISOString=function(){function t(t){return("00"+t).slice(-2)}function e(t){return("000"+t).slice(-3)}return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"."+e(this.getUTCMilliseconds())+"Z"}),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 r=this.attributes[e];r.specified&&"data-"===r.name.substring(0,5)&&!function(e,r){t[r]=e.getAttribute("data-"+r),Object.defineProperty(t,r,{get:function(){return e.getAttribute("data-"+r)},set:function(t){e.setAttribute("data-"+r,t)}})}(this,r.name.substring(5))}return t}}),function(){function e(t){t=String(t);var e,r=0,o=[],i=0,c=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(;r<t.length;)e=n.indexOf(t.charAt(r)),i=i<<6|e,c+=6,24===c&&(o.push(String.fromCharCode(i>>16&255)),o.push(String.fromCharCode(i>>8&255)),o.push(String.fromCharCode(255&i)),c=0,i=0),r+=1;return 12===c?(i>>=4,o.push(String.fromCharCode(255&i))):18===c&&(i>>=2,o.push(String.fromCharCode(i>>8&255)),o.push(String.fromCharCode(255&i))),o.join("")}function r(t){t=String(t);var e,r,o,i,c,a,u,s=0,l=[];if(/[^\x00-\xFF]/.test(t))throw Error("InvalidCharacterError");for(;s<t.length;)e=t.charCodeAt(s++),r=t.charCodeAt(s++),o=t.charCodeAt(s++),i=e>>2,c=(3&e)<<4|r>>4,a=(15&r)<<2|o>>6,u=63&o,s===t.length+2?(a=64,u=64):s===t.length+1&&(u=64),l.push(n.charAt(i),n.charAt(c),n.charAt(a),n.charAt(u));return l.join("")}if(!("atob"in t&&"btoa"in t)){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.atob=e,t.btoa=r}}())}(this),function(t){"window"in t&&"document"in t&&(document.querySelectorAll||(document.querySelectorAll=function(t){var e,r=document.createElement("style"),n=[];for(document.documentElement.firstChild.appendChild(r),document._qsa=[],r.styleSheet.cssText=t+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),r.parentNode.removeChild(r);document._qsa.length;)e=document._qsa.shift(),e.style.removeAttribute("x-qsa"),n.push(e);return document._qsa=null,n}),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 r=this,n=function(t){t._timeStamp=Date.now(),t._currentTarget=r,e.call(this,t),t._currentTarget=null};this["_"+t+e]=n,this.attachEvent("on"+t,n)}}function r(t,e){if("function"==typeof e){"DOMContentLoaded"===t&&(t="load");var r=this["_"+t+e];r&&(this.detachEvent("on"+t,r),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=r}))}(),window.addEvent=function(t,e,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent&&(t["e"+e+r]=r,t[e+r]=function(){var n=window.event;n.currentTarget=t,n.preventDefault=function(){n.returnValue=!1},n.stopPropagation=function(){n.cancelBubble=!0},n.target=n.srcElement,n.timeStamp=Date.now(),t["e"+e+r].call(this,n)},t.attachEvent("on"+e,t[e+r]))},window.removeEvent=function(t,e,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.detachEvent&&(t.detachEvent("on"+e,t[e+r]),t[e+r]=null,t["e"+e+r]=null)},function(){function e(t,e){function r(t){return t.length?t.split(/\s+/g):[]}function n(t,e){var n=r(e),o=n.indexOf(t);return-1!==o&&n.splice(o,1),n.join(" ")}if(Object.defineProperties(this,{length:{get:function(){return r(t[e]).length}},item:{value:function(n){var o=r(t[e]);return n>=0&&n<o.length?o[n]:null}},contains:{value:function(n){if(n=String(n),0===n.length)throw SyntaxError();if(/\s/.test(n))throw Error("InvalidCharacterError");var o=r(t[e]);return-1!==o.indexOf(n)}},add:{value:function(){var n=Array.prototype.slice.call(arguments).map(String);if(n.some(function(t){return 0===t.length}))throw SyntaxError();if(n.some(function(t){return/\s/.test(t)}))throw Error("InvalidCharacterError");try{var o=t[e],i=r(o);if(n=n.filter(function(t){return-1===i.indexOf(t)}),0===n.length)return;0===o.length||/\s$/.test(o)||(o+=" "),o+=n.join(" "),t[e]=o}finally{var c=r(t[e]).length;this.length!==c&&(this.length=c)}}},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=n(t,i)}),t[e]=i}finally{var c=r(t[e]).length;this.length!==c&&(this.length=c)}}},toggle:{value:function(o,i){try{if(o=String(o),0===o.length)throw SyntaxError();if(/\s/.test(o))throw Error("InvalidCharacterError");var c=r(t[e]),a=c.indexOf(o);if(-1!==a&&(!i||void 0===i))return t[e]=n(o,t[e]),!1;if(-1!==a&&i)return!0;var u=t[e];return 0===u.length||/\s$/.test(u)||(u+=" "),u+=o,t[e]=u,!0}finally{var s=r(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=r(t[e]).length}function r(e,r){"Element"in t&&Element.prototype&&Object.defineProperty&&Object.defineProperty(Element.prototype,e,{get:r})}"classList"in document.createElement("span")?window.getClassList=function(t){return t.classList}:(window.getClassList=function(t){return new e(t,"className")},r("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")},r("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 r=t.elements[e];""!==r.name&&this.append(r.name,r.value)}}if(!("FormData"in t)){e.prototype={append:function(e,r){if("Blob"in t&&r instanceof t.Blob)throw TypeError("Blob not supported");e=String(e),this._data.push([e,r])},toString:function(){return this._data.map(function(t){return encodeURIComponent(t[0])+"="+encodeURIComponent(t[1])}).join("&")}},t.FormData=e;var r=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()),r.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 r(){var t=c;c=Object.create(null),u=-1,Object.keys(t).forEach(function(r){var n=t[r];(!n.element||e(n.element))&&n.callback(Date.now())})}function n(e,n){var o=++a;return c[o]={callback:e,element:n},-1===u&&(u=t.setTimeout(r,1e3/i)),o}function o(e){delete c[e],0===Object.keys(c).length&&(t.clearTimeout(u),u=-1)}if(!("requestAnimationFrame"in t)){var i=60,c=Object.create(null),a=0,u=-1;t.requestAnimationFrame=n,t.cancelAnimationFrame=o}}(),function(){function e(e){var r=[].slice.call(arguments,1);return t.setTimeout(function(){e.apply(null,r)},0)}function r(e){t.clearTimeout(e)}"setImmediate"in t||(t.setImmediate=e,t.clearImmediate=r)}())}(this);