UNPKG

mixfill

Version:
1 lines 12.1 kB
"document"in self&&!("classList"in document.createElement("_"))&&!function(a){"use strict";if("Element"in a){var b="classList",c="prototype",d=a.Element[c],e=Object,f=String[c].trim||function(){return this.replace(/^\s+|\s+$/g,"")},g=Array[c].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a,this.code=DOMException[a],this.message=b},i=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return g.call(a,b)},j=function(a){for(var b=f.call(a.getAttribute("class")||""),c=b?b.split(/\s+/):[],d=0,e=c.length;e>d;d++)this.push(c[d]);this._updateClassName=function(){a.setAttribute("class",this.toString())}},k=j[c]=[],l=function(){return new j(this)};if(h[c]=Error[c],k.item=function(a){return this[a]||null},k.contains=function(a){return a+="",-1!==i(this,a)},k.add=function(){var a,b=arguments,c=0,d=b.length,e=!1;do a=b[c]+"",-1===i(this,a)&&(this.push(a),e=!0);while(++c<d);e&&this._updateClassName()},k.remove=function(){var a,b,c=arguments,d=0,e=c.length,f=!1;do for(a=c[d]+"",b=i(this,a);-1!==b;)this.splice(b,1),f=!0,b=i(this,a);while(++d<e);f&&this._updateClassName()},k.toggle=function(a,b){a+="";var c=this.contains(a),d=c?b!==!0&&"remove":b!==!1&&"add";return d&&this[d](a),!c},k.toString=function(){return this.join(" ")},e.defineProperty){var m={get:l,enumerable:!0,configurable:!0};try{e.defineProperty(d,b,m)}catch(n){-2146823252===n.number&&(m.enumerable=!1,e.defineProperty(d,b,m))}}else e[c].__defineGetter__&&d.__defineGetter__(b,l)}}(self),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.returnExports=b()}(this,function(){function a(a){try{return a.sentinel=0,0===Object.getOwnPropertyDescriptor(a,"sentinel").value}catch(b){}}function b(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}var c,d,e,f,g=Function.prototype.call,h=Object.prototype,i=g.bind(h.hasOwnProperty),j=i(h,"__defineGetter__");if(j&&(c=g.bind(h.__defineGetter__),d=g.bind(h.__defineSetter__),e=g.bind(h.__lookupGetter__),f=g.bind(h.__lookupSetter__)),Object.getPrototypeOf||(Object.getPrototypeOf=function(a){var b=a.__proto__;return b||null===b?b:a.constructor?a.constructor.prototype:h}),Object.defineProperty){var k=a({}),l="undefined"==typeof document||a(document.createElement("div"));if(!l||!k)var m=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||m){var n="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(a,b){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError(n+a);if(m)try{return m.call(Object,a,b)}catch(c){}if(i(a,b)){var d={enumerable:!0,configurable:!0};if(j){var g=a.__proto__,k=a!==h;k&&(a.__proto__=h);var l=e(a,b),o=f(a,b);if(k&&(a.__proto__=g),l||o)return l&&(d.get=l),o&&(d.set=o),d}return d.value=a[b],d.writable=!0,d}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(a){return Object.keys(a)}),!Object.create){var o,p=!({__proto__:null}instanceof Object);o=p||"undefined"==typeof document?function(){return{__proto__:null}}:function(){function a(){}var b=document.createElement("iframe"),c=document.body||document.documentElement;b.style.display="none",c.appendChild(b),b.src="javascript:";var d=b.contentWindow.Object.prototype;return c.removeChild(b),b=null,delete d.constructor,delete d.hasOwnProperty,delete d.propertyIsEnumerable,delete d.isPrototypeOf,delete d.toLocaleString,delete d.toString,delete d.valueOf,d.__proto__=null,a.prototype=d,o=function(){return new a},new a},Object.create=function(a,b){function c(){}var d;if(null===a)d=o();else{if("object"!=typeof a&&"function"!=typeof a)throw new TypeError("Object prototype may only be an Object or null");c.prototype=a,d=new c,d.__proto__=a}return void 0!==b&&Object.defineProperties(d,b),d}}if(Object.defineProperty){var q=b({}),r="undefined"==typeof document||b(document.createElement("div"));if(!q||!r)var s=Object.defineProperty,t=Object.defineProperties}if(!Object.defineProperty||s){var u="Property description must be an object: ",v="Object.defineProperty called on non-object: ",w="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(a,b,g){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError(v+a);if("object"!=typeof g&&"function"!=typeof g||null===g)throw new TypeError(u+g);if(s)try{return s.call(Object,a,b,g)}catch(k){}if(i(g,"value"))if(j&&(e(a,b)||f(a,b))){var l=a.__proto__;a.__proto__=h,delete a[b],a[b]=g.value,a.__proto__=l}else a[b]=g.value;else{if(!j)throw new TypeError(w);i(g,"get")&&c(a,b,g.get),i(g,"set")&&d(a,b,g.set)}return a}}(!Object.defineProperties||t)&&(Object.defineProperties=function(a,b){if(t)try{return t.call(Object,a,b)}catch(c){}for(var d in b)i(b,d)&&"__proto__"!==d&&Object.defineProperty(a,d,b[d]);return a}),Object.seal||(Object.seal=function(a){return a}),Object.freeze||(Object.freeze=function(a){return a});try{Object.freeze(function(){})}catch(x){Object.freeze=function(a){return function(b){return"function"==typeof b?b:a(b)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(a){return a}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(a){if(Object(a)!==a)throw new TypeError;for(var b="";i(a,b);)b+="?";a[b]=!0;var c=i(a,b);return delete a[b],c})}),function(){if(!document.addEventListener&&window.Element&&window.Event){var a="__events",b="__immediateStopped";Event.prototype.NONE=Event.NONE=0,Event.prototype.CAPTURING_PHASE=Event.CAPTURING_PHASE=1,Event.prototype.AT_TARGET=Event.AT_TARGET=2,Event.prototype.BUBBLING_PHASE=Event.BUBBLING_PHASE=3,Event.prototype.preventDefault=function(){this.cancelable!==!1&&(this.returnValue=!1)},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},Event.prototype.stopImmediatePropagation=function(){this[b]=this.cancelBubble=!0};for(var c=function(a,b){return a.timeStamp=+new Date,a.target||(a.target=a.srcElement||b),a.pageX=a.clientX+document.documentElement.scrollLeft,a.pageY=a.clientY+document.documentElement.scrollTop,a.relatedTarget="mouseover"==a.type?a.fromElement:"mouseout"==a.type?a.toElement:null,a},d=function(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];if(e.useCapture==c&&e.listener==b)return d}return-1},e=function(a,b,c){a.currentTarget=c,"function"==typeof b?b.call(c,a):b.handleEvent(a)},f=function(a){for(var b=[];a.parentNode;)b.unshift(a.parentNode),a=a.parentNode;return b},g=function(c,d,f){c.eventPhase=f;for(var g=0;g<d.length;g++){for(var h=d[g],i=[],j=(h[a]||{})[c.type]||[],k=0;k<j.length;k++){var l=j[k];l.useCapture&&f==Event.BUBBLING_PHASE||(l.useCapture||f!=Event.CAPTURING_PHASE)&&i.push(l.listener)}for(k=0;k<i.length;)try{for(;k<i.length;){var m=i[k++];if(e(c,m,h),c[b])return!0}}catch(n){setTimeout(function(){throw n},0)}if(c.cancelBubble)return!0}return!1},h=function(a){c(a,this);var b=f(a.target);return b.length&&g(a,b,Event.CAPTURING_PHASE)?a.returnValue:g(a,[a.target],Event.AT_TARGET)?a.returnValue:b.length&&a.bubbles!==!1&&(b.reverse(),g(a,b,Event.BUBBLING_PHASE))?a.returnValue:(a.stopPropagation(),a.returnValue)},i=({addEventListener:function(b,c,e){var f=(this[a]||{})[b]||[],g=f.length;if(!(d(f,c,e)>-1)){if(a in this)var i=this[a];else{var i={_handler:h.bind(this)};this[a]=i}b in i||(i[b]=[]),i[b].push({listener:c,useCapture:e}),g||this.attachEvent("on"+b,i._handler)}},removeEventListener:function(b,c,e){var f=(this[a]||{})[b]||[],g=d(f,c,e);-1!=g&&(f.splice(g,1),f.length||this.detachEvent("on"+b,this[a]._handler))},dispatchEvent:function(a){return a.returnValue=!0,h.call(this,a)}}),j=[Element,window.constructor,document.constructor];j.length;){var k=j.pop();for(var l in i)k.prototype[l]=i[l]}}}(),function(){if(!window.CustomEvent&&document.createEventObject)return void(window.CustomEvent=function(a,b){if(!arguments.length)throw new Error("Not enough arguments");var c={type:a,bubbles:!1,cancelable:!1,detail:null},d=document.createEventObject();for(var e in c)d[e]=c[e];for(var e in b)d[e]=b[e];return d});try{new CustomEvent("test")}catch(a){var b=function(a,b){if(!arguments.length)throw new Error("Not enough arguments");var c={bubbles:!1,cancelable:!1,detail:null};for(var d in b)c[d]=b[d];var e=document.createEvent("CustomEvent");return e.initCustomEvent(a,c.bubbles,c.cancelable,c.detail),e};b.prototype=(window.CustomEvent||window.Event).prototype,window.CustomEvent=b}}(),function(){document.addEventListener("readystatechange",function(){if("complete"==document.readyState){var a=new CustomEvent("DOMContentLoaded");document.dispatchEvent(a)}})}(),function(){if(!window.MouseEvent)return void(window.MouseEvent=function(a,b){if(!arguments.length)throw new Error("Not enough arguments");var c={type:a,cancelable:!1,bubbles:!1},d=document.createEventObject();for(var e in c)d[e]=c[e];for(var e in b)d[e]=b[e];return d});try{new MouseEvent("click")}catch(a){var b=function(a,b){if(!arguments.length)throw new Error("Not enough arguments");var c={type:a,bubbles:!1,cancelable:!1,view:window,detail:1,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altLey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};for(var d in b)c[d]=b[d];var e=document.createEvent("MouseEvent");return e.initMouseEvent(c.type,c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget),e};b.prototype=window.MouseEvent.prototype,window.MouseEvent=b}}(),function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}"undefined"!=typeof module&&module.exports?module.exports=a.Promise?a.Promise:c:a.Promise||(a.Promise=c);var j=a.setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"==typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})}}(this);