8 lines
72 KiB
JavaScript
8 lines
72 KiB
JavaScript
|
/*==================================================
|
||
|
* Anot normal version for future browsers
|
||
|
* @authors yutent (yutent@doui.cc)
|
||
|
* @date 2017-03-21 21:05:57
|
||
|
* support IE10+ and modern browsers
|
||
|
*
|
||
|
==================================================*/
|
||
|
var _Anot=function(){var e=1024,t=0;window.VBArray&&(t=document.documentMode||(window.XMLHttpRequest?7:6));var n=j(),r=window.document,i=r.head;i.insertAdjacentHTML("afterBegin",'<anot skip class="anot-hide"><style id="anot-style">.anot-hide{ display: none!important } slot{visibility:hidden;}</style></anot>');var a=i.firstChild;function o(){console.log.apply(console,arguments)}function s(){return Object.create(null)}var c,l,u,f,p="$"+n,d={},h=/[^, ]+/g,v=/\w+/g,m=/^\[object SVG\w*Element\]$/,y=Object.prototype,g=y.hasOwnProperty,b=y.toString,w=Array.prototype,x=w.slice,$=window.dispatchEvent,k=r.documentElement,C=r.createDocumentFragment(),A=(r.createElement("div"),{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object","[object Error]":"error","[object AsyncFunction]":"asyncfunction","[object Promise]":"promise","[object Generator]":"generator","[object GeneratorFunction]":"generatorfunction"});function _(){}function T(e){return Function.apply(_,e)}function N(e,t){"string"==typeof e&&(e=e.match(h)||[]);for(var n={},r=void 0!==t?t:1,i=0,a=e.length;i<a;i++)n[e[i]]=r;return n}function j(t){return(t=t&&t+"-"||"anot-")+(++e).toString(16)}!function(e){function t(e){return e}function n(e){throw e}function r(e){return this.then(e,n)}function i(e){return this.then(t,e)}function a(){var e={};return e.promise=new l(function(t,n){e.resolve=t,e.reject=n}),e}function o(e,t,n){e._fired=!0,e._val=t,e._state=n?"fulfilled":"rejected",s(e,function(){for(var t in e.callback)e._fire(e.callback[t].yes,e.callback[t].no)})}function s(e,t){("boolean"==typeof e.async?e.async:e.async=!0)?setTimeout(t,0):t()}function c(e,t){t=Array.isArray(t)?t:[];var n=0,r=[],i=!1;return new l(function(a,o){function s(s,c){s.then(function(o){i||(r[c]=o,(e||++n>=t.length)&&(a(e?o:r),i=!0))},function(e){i=!0,o(e)})}t.length||o(r);for(var c=0,l=t.length;c<l;c++)s(t[c],c)})}var l=function(e){this.callback=[];var t=this;if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Argument must be a function");e(function(e){!function(e,t){"pending"===e._state&&(t&&"function"==typeof t.then?t[t instanceof l?"_then":"then"](function(t){o(e,t,!0)},function(t){o(e,t,!1)}):o(e,t,!0))}(t,e)},function(e){!function(e,t){"pending"===e._state&&o(e,t,!1)}(t,e)})},u={_state:1,_fired:1,_val:1,callback:1};l.prototype={constructor:l,_state:"pending",_fired:!1,_fire:function(e,t){if("rejected"===this._state){if("function"!=typeof t)throw this._val;t(this._val)}else"function"==typeof e&&e(this._val)},_then:function(e,t){if(this._fired){var n=this;s(n,function(){n._fire(e,t)})}else this.callback.push({yes:e,no:t})},then:function(e,r){e="function"==typeof e?e:t,r="function"==typeof r?r:n;var i=this,a=new l(function(t,n){i._then(function(r){try{r=e(r)}catch(e){return n(e)}t(r)},function(e){try{e=r(e)}catch(e){return n(e)}t(e)})});for(var o in i)u[o]||(a[o]=i[o]);return a},done:r,catch:i,fail:i},l.all=function(e){return c(!1,e)},l.race=function(e){return c(!0,e)},l.defer=a,l.resolve=function(e){var t=this.defer();return t.resolve(e),t.promise},l.reject=function(e){var t=this.defer();return t.reject(e),t.promise},/native code/.test(e)&&(e.prototype.done=r,e.prototype.fail=i,e.defer||(e.defer=a)),window.Promise=e||l}(window.Promise),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,value:function(e,t){"use strict";if(void 0===e||null===e)throw new TypeError("Can not convert first argument to object");for(var n=Object(e),r=0,i=arguments.length;r<i;r++){var a=arguments[r];if(void 0!==a&&null!==a)for(var o=Object.keys(Object(a)),s=0,c=o.length;s<c;s++){var l=o[s],u=Object.getOwnPropertyDescriptor(a,l);void 0!==u&&u.enumerable&&(n[l]=a[l])}}return n}}),Array.from||Object.defineProperty(Array,"from",{enumerable:!1,value:(c=Object.prototype.toString,l=function(e){return"function"==typeof e||"[object Function]"===c.call(e)},u=Math.pow(2,53)-1,f=function
|