@realeyes/environment-detector
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -1,2 +0,2 @@ | ||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){"use strict";var _index=require("./lib/index");var _index2=_interopRequireDefault(_index);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}window.Realeyesit=window.Realeyesit||{};window.Realeyesit.EnvironmentDetector={detect:_index2["default"]}},{"./lib/index":5}],2:[function(require,module,exports){"use strict";exports.__esModule=true;var _getFirstMatch=require("./utils/getFirstMatch");var _getFirstMatch2=_interopRequireDefault(_getFirstMatch);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var names={OPERA:"Opera",INTERNET_EXPLORER:"Internet Explorer",MICROSOFT_EDGE:"Microsoft Edge",FIREFOX:"Firefox",PHANTOM_JS:"PhantomJS",CHROMIUM:"Chromium",CHROME:"Chrome",ANDROID:"Android",SAFARI:"Safari",UNKNOWN:"Unknown"};var tests=[{browserName:names.OPERA,testRegex:/opera|opr|opios/i,versionRegex:/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i},{browserName:names.INTERNET_EXPLORER,testRegex:/msie|trident/i,versionRegex:/(?:msie |rv:)(\d+(\.\d+)?)/i},{browserName:names.MICROSOFT_EDGE,testRegex:/chrome.+? edge/i,versionRegex:/edge\/(\d+(\.\d+)?)/i},{browserName:names.FIREFOX,testRegex:/firefox|iceweasel|fxios/i,versionRegex:/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i},{browserName:names.PHANTOM_JS,testRegex:/phantom/i,versionRegex:/phantomjs\/(\d+(\.\d+)?)/i},{browserName:names.CHROMIUM,testRegex:/chromium/i,versionRegex:/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i},{browserName:names.CHROME,testRegex:/chrome|crios|crmo/i,versionRegex:/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i},{browserName:names.ANDROID,testRegex:/android/i,versionRegex:null},{browserName:names.SAFARI,testRegex:/safari|applewebkit/i,versionRegex:null}];exports["default"]={names:names,detect:function detect(ua){for(var i=0;i<tests.length;i++){if(tests[i].testRegex.test(ua)){return{name:tests[i].browserName,version:(0,_getFirstMatch2["default"])(ua,tests[i].versionRegex)||(0,_getFirstMatch2["default"])(ua,/version\/(\d+(\.\d+)?)/i)||(0,_getFirstMatch2["default"])(ua,/^.*\/(.*) /)}}}return{name:names.UNKNOWN,version:null}}}},{"./utils/getFirstMatch":10}],3:[function(require,module,exports){"use strict";exports.__esModule=true;var _swfobject=require("swfobject");var _swfobject2=_interopRequireDefault(_swfobject);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var names={FLASH:"flash",GET_USER_MEDIA:"navigator.getUserMedia",MEDIA_RECORDER:"MediaRecorder",WEBCAM:"webcam",DOCUMENT_ALL:"document.all",DOCUMENT_QUERY_SELECTOR:"document.querySelector",HTTP:"http",HTTPS:"https",LOCALHOST:"localhost"};var tests=[{capabilityName:names.FLASH,test:function test(){var version=_swfobject2["default"].getFlashPlayerVersion();return!(version.major===0&&version.minor===0&&version.release===0)}},{capabilityName:names.GET_USER_MEDIA,test:function test(){return!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}},{capabilityName:names.MEDIA_RECORDER,test:function test(){return typeof window.MediaRecorder==="function"}},{capabilityName:names.DOCUMENT_ALL,test:function test(){return document.querySelector!==undefined}},{capabilityName:names.DOCUMENT_QUERY_SELECTOR,test:function test(){return typeof document.querySelector==="function"}},{capabilityName:names.HTTP,test:function test(){return document.location.protocol==="http:"}},{capabilityName:names.HTTPS,test:function test(){return document.location.protocol==="https:"}},{capabilityName:names.LOCALHOST,test:function test(){return document.location.hostname==="localhost"||document.location.hostname==="127.0.0.1"}}];exports["default"]={names:names,detect:function detect(features){var results=[];for(var i=0;i<tests.length;i++){if(features.indexOf(tests[i].capabilityName)>-1&&tests[i].test()){results.push(tests[i].capabilityName)}}return results}}},{swfobject:17}],4:[function(require,module,exports){"use strict";exports.__esModule=true;var _nativePromiseOnly=require("native-promise-only");var _nativePromiseOnly2=_interopRequireDefault(_nativePromiseOnly);var _swfobject=require("swfobject");var _swfobject2=_interopRequireDefault(_swfobject);var _timeout=require("./utils/timeout");var _timeout2=_interopRequireDefault(_timeout);var _waitForDocumentReady=require("./utils/waitForDocumentReady");var _waitForDocumentReady2=_interopRequireDefault(_waitForDocumentReady);var _currentScriptPath=require("./utils/currentScriptPath");var _currentScriptPath2=_interopRequireDefault(_currentScriptPath);var _visible=require("./utils/visible");var _visible2=_interopRequireDefault(_visible);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var DEFAULT_SWF_PATH=_currentScriptPath2["default"]+"environment-detector.swf";var DEFAULT_TEST_TIMEOUT=3e3;var DEFAULT_CONTAINER_ID="Realeyesit_FlashEnvironmentDetector";var DEFAULT_MIN_FLASH_VERSION="10.2.0";var flashEl=void 0;exports["default"]={embedSWF:function embedSWF(path,containerId,minFlashVersion){return new _nativePromiseOnly2["default"](function(resolve,reject){if(flashEl!==undefined){resolve(flashEl);return}var container=document.createElement("div");container.id=containerId;document.body.appendChild(container);_swfobject2["default"].createCSS("#"+containerId,"position: absolute; top: -10px;");_swfobject2["default"].embedSWF(path,containerId,"10","1",minFlashVersion,null,null,{allowScriptAccess:"always"},null,function(e){if(!e.success){reject()}else{window.Realeyesit=window.Realeyesit||{};window.Realeyesit.FlashEnvironmentDetectorReady=resolve}})})},detect:function detect(){var _this=this;var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$path=_ref.path,path=_ref$path===undefined?DEFAULT_SWF_PATH:_ref$path,_ref$testTimeout=_ref.testTimeout,testTimeout=_ref$testTimeout===undefined?DEFAULT_TEST_TIMEOUT:_ref$testTimeout,_ref$containerId=_ref.containerId,containerId=_ref$containerId===undefined?DEFAULT_CONTAINER_ID:_ref$containerId,_ref$minFlashVersion=_ref.minFlashVersion,minFlashVersion=_ref$minFlashVersion===undefined?DEFAULT_MIN_FLASH_VERSION:_ref$minFlashVersion;return(0,_visible2["default"])().then(function(){return(0,_timeout2["default"])(testTimeout,(0,_waitForDocumentReady2["default"])().then(function(){return _this.embedSWF(path,containerId,minFlashVersion)}))["catch"](function(){return null})})}}},{"./utils/currentScriptPath":9,"./utils/timeout":11,"./utils/visible":12,"./utils/waitForDocumentReady":13,"native-promise-only":16,swfobject:17}],5:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=detect;var _browsers=require("./browsers");var _browsers2=_interopRequireDefault(_browsers);var _platform=require("./platform");var _platform2=_interopRequireDefault(_platform);var _os=require("./os");var _os2=_interopRequireDefault(_os);var _capabilities=require("./capabilities");var _capabilities2=_interopRequireDefault(_capabilities);var _flash=require("./flash");var _flash2=_interopRequireDefault(_flash);var _webcam=require("./webcam");var _webcam2=_interopRequireDefault(_webcam);var _Logger=require("./utils/Logger");var _Logger2=_interopRequireDefault(_Logger);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function detect(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var ua=navigator.userAgent;var start=+new Date;var logger=new _Logger2["default"](options.logger);var features=options.features;if(!features){features=[];for(var key in _capabilities2["default"].names){if(_capabilities2["default"].names.hasOwnProperty(key)){features.push(_capabilities2["default"].names[key])}}}var result={browser:_browsers2["default"].detect(ua),platform:_platform2["default"].detect(ua),os:_os2["default"].detect(ua),flash:null,webcams:null,capabilities:_capabilities2["default"].detect(features)};var detectFlash=features.indexOf(_capabilities2["default"].names.FLASH)>-1;var detectWebcams=features.indexOf(_capabilities2["default"].names.WEBCAM)>-1;if(detectFlash||detectWebcams){if(detectWebcams){return _webcam2["default"].detect().then(function(webcamresult){result.webcams=webcamresult;if(!webcamresult||detectFlash){return _flash2["default"].detect(options.flash).then(function(flashResult){if(detectWebcams&&!result.webcams&&flashResult){result.webcams=flashResult.webcams}if(detectFlash){result.flash=flashResult}logger.log({result:result,start:start,duration:+new Date-start});return result})}logger.log({result:result,start:start,duration:+new Date-start});return result})}return _flash2["default"].detect(function(flashResult){result.flash=flashResult;logger.log({result:result,start:start,duration:+new Date-start});return result})}logger.log({result:result,start:start,duration:+new Date-start});return Promise.resolve(result)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(searchElement,fromIndex){for(var i=fromIndex||0;i<this.length;++i){if(this[i]===searchElement)return i}return-1}}},{"./browsers":2,"./capabilities":3,"./flash":4,"./os":6,"./platform":7,"./utils/Logger":8,"./webcam":14}],6:[function(require,module,exports){"use strict";exports.__esModule=true;var _getFirstMatch=require("./utils/getFirstMatch");var _getFirstMatch2=_interopRequireDefault(_getFirstMatch);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var names={ANDROID:"android",MAC_OS:"macos",WINDOWS:"windows",LINUX:"linux",UNKNOWN:"unknown"};var tests=[{osName:names.ANDROID,testRegex:/^(?!.*like android).*android/i,getVersion:function getVersion(){return null}},{osName:names.MAC_OS,testRegex:/macintosh/i,getVersion:function getVersion(ua){return ua.replace(/.*?OS X (.*?)\).*/,"$1")}},{osName:names.WINDOWS,testRegex:/windows/i,getVersion:function getVersion(){return null}},{osName:names.LINUX,testRegex:/linux/i,getVersion:function getVersion(){return null}}];exports["default"]={names:names,detect:function detect(ua){for(var i=0;i<tests.length;i++){if(tests[i].testRegex.test(ua)){return{name:tests[i].osName,version:tests[i].getVersion(ua)||(0,_getFirstMatch2["default"])(ua,/version\/(\d+\.\d+)/i)||null}}}return{name:names.UNKNOWN,version:null}}}},{"./utils/getFirstMatch":10}],7:[function(require,module,exports){"use strict";exports.__esModule=true;var types={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"};var tests=[{type:types.TABLET,testRegex:/tablet/i},{type:types.MOBILE,testRegex:new RegExp(["Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|","Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|","Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune"].join(""))}];exports["default"]={types:types,detect:function detect(ua){for(var i=0;i<tests.length;i++){if(tests[i].testRegex.test(ua)){return{type:tests[i].type}}}return{type:types.DESKTOP}}}},{}],8:[function(require,module,exports){"use strict";exports.__esModule=true;var _json=require("json3");var _json2=_interopRequireDefault(_json);var _currentScriptPath=require("./currentScriptPath");var _currentScriptPath2=_interopRequireDefault(_currentScriptPath);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var DEFAULT_LOGGER_PATH=_currentScriptPath2["default"]+"log.gif";var Logger=function(){function Logger(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$path=_ref.path,path=_ref$path===undefined?DEFAULT_LOGGER_PATH:_ref$path;_classCallCheck(this,Logger);this.path=path}Logger.prototype.log=function log(msg){var img=document.createElement("img");img.style.position="absolute";img.style.top="-10px";img.src=this.path+"?msg="+encodeURIComponent(_json2["default"].stringify(msg));document.body.appendChild(img);img.parentNode.removeChild(img)};return Logger}();exports["default"]=Logger},{"./currentScriptPath":9,json3:15}],9:[function(require,module,exports){"use strict";exports.__esModule=true;function getPath(){if(document.currentScript!==undefined){return document.currentScript.src.split("/").slice(0,-1).join("/")+"/"}var scripts=document.getElementsByTagName("script");var src=scripts[scripts.length-1].src.split("?")[0];return src.split("/").slice(0,-1).join("/")+"/"}exports["default"]=getPath()},{}],10:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=function(str,regex){var match=str.match(regex);if(match&&match.length>1){return match[1]}return""}},{}],11:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=timeout;var _nativePromiseOnly=require("native-promise-only");var _nativePromiseOnly2=_interopRequireDefault(_nativePromiseOnly);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function timeout(ms,promise){var pending=true;return _nativePromiseOnly2["default"].race([promise.then(function(v){pending=false;return v}),new _nativePromiseOnly2["default"](function(_,reject){return setTimeout(function(){if(pending){reject("timeout")}},ms)})])}},{"native-promise-only":16}],12:[function(require,module,exports){"use strict";exports.__esModule=true;var _visibilityjs=require("visibilityjs");var _visibilityjs2=_interopRequireDefault(_visibilityjs);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports["default"]=function(){return new Promise(function(resolve){_visibilityjs2["default"].onVisible(resolve)})}},{visibilityjs:18}],13:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=function(){return new Promise(function(resolve){if(document.readyState==="complete"){resolve();return}if(typeof document.addEventListener==="function"){document.addEventListener("readystatechange",function(){if(document.readyState==="complete"){resolve()}})}else if(window.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){resolve()}})}})}},{}],14:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]={detect:function detect(flashResult){if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices){return navigator.mediaDevices.enumerateDevices().then(function(devices){var result=[];for(var i=0;i<devices.length;i++){if(devices[i].kind==="videoinput"){var name=devices[i].label?devices[i].label:"unknown";result.push(name)}}return result})}else if(flashResult){return Promise.resolve(flashResult.webcams)}return Promise.resolve([])}}},{}],15:[function(require,module,exports){(function(global){(function(){var isLoader=typeof define==="function"&&define.amd;var objectTypes={function:true,object:true};var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var root=objectTypes[typeof window]&&window||this,freeGlobal=freeExports&&objectTypes[typeof module]&&module&&!module.nodeType&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal["global"]===freeGlobal||freeGlobal["window"]===freeGlobal||freeGlobal["self"]===freeGlobal)){root=freeGlobal}function runInContext(context,exports){context||(context=root["Object"]());exports||(exports=root["Object"]());var Number=context["Number"]||root["Number"],String=context["String"]||root["String"],Object=context["Object"]||root["Object"],Date=context["Date"]||root["Date"],SyntaxError=context["SyntaxError"]||root["SyntaxError"],TypeError=context["TypeError"]||root["TypeError"],Math=context["Math"]||root["Math"],nativeJSON=context["JSON"]||root["JSON"];if(typeof nativeJSON=="object"&&nativeJSON){exports.stringify=nativeJSON.stringify;exports.parse=nativeJSON.parse}var objectProto=Object.prototype,getClass=objectProto.toString,isProperty,forEach,undef;var isExtended=new Date(-0xc782b5b800cec);try{isExtended=isExtended.getUTCFullYear()==-109252&&isExtended.getUTCMonth()===0&&isExtended.getUTCDate()===1&&isExtended.getUTCHours()==10&&isExtended.getUTCMinutes()==37&&isExtended.getUTCSeconds()==6&&isExtended.getUTCMilliseconds()==708}catch(exception){}function has(name){if(has[name]!==undef){return has[name]}var isSupported;if(name=="bug-string-char-index"){isSupported="a"[0]!="a"}else if(name=="json"){isSupported=has("json-stringify")&&has("json-parse")}else{var value,serialized='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(name=="json-stringify"){var stringify=exports.stringify,stringifySupported=typeof stringify=="function"&&isExtended;if(stringifySupported){(value=function(){return 1}).toJSON=value;try{stringifySupported=stringify(0)==="0"&&stringify(new Number)==="0"&&stringify(new String)=='""'&&stringify(getClass)===undef&&stringify(undef)===undef&&stringify()===undef&&stringify(value)==="1"&&stringify([value])=="[1]"&&stringify([undef])=="[null]"&&stringify(null)=="null"&&stringify([undef,getClass,null])=="[null,null,null]"&&stringify({a:[value,true,false,null,"\0\b\n\f\r\t"]})==serialized&&stringify(null,value)==="1"&&stringify([1,2],null,1)=="[\n 1,\n 2\n]"&&stringify(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&stringify(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&stringify(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&stringify(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch(exception){stringifySupported=false}}isSupported=stringifySupported}if(name=="json-parse"){var parse=exports.parse;if(typeof parse=="function"){try{if(parse("0")===0&&!parse(false)){value=parse(serialized);var parseSupported=value["a"].length==5&&value["a"][0]===1;if(parseSupported){try{parseSupported=!parse('"\t"')}catch(exception){}if(parseSupported){try{parseSupported=parse("01")!==1}catch(exception){}}if(parseSupported){try{parseSupported=parse("1.")!==1}catch(exception){}}}}}catch(exception){parseSupported=false}}isSupported=parseSupported}}return has[name]=!!isSupported}if(!has("json")){var functionClass="[object Function]",dateClass="[object Date]",numberClass="[object Number]",stringClass="[object String]",arrayClass="[object Array]",booleanClass="[object Boolean]";var charIndexBuggy=has("bug-string-char-index");if(!isExtended){var floor=Math.floor;var Months=[0,31,59,90,120,151,181,212,243,273,304,334];var getDay=function(year,month){return Months[month]+365*(year-1970)+floor((year-1969+(month=+(month>1)))/4)-floor((year-1901+month)/100)+floor((year-1601+month)/400)}}if(!(isProperty=objectProto.hasOwnProperty)){isProperty=function(property){var members={},constructor;if((members.__proto__=null,members.__proto__={toString:1},members).toString!=getClass){isProperty=function(property){var original=this.__proto__,result=property in(this.__proto__=null,this);this.__proto__=original;return result}}else{constructor=members.constructor;isProperty=function(property){var parent=(this.constructor||constructor).prototype;return property in this&&!(property in parent&&this[property]===parent[property])}}members=null;return isProperty.call(this,property)}}forEach=function(object,callback){var size=0,Properties,members,property;(Properties=function(){this.valueOf=0}).prototype.valueOf=0;members=new Properties;for(property in members){if(isProperty.call(members,property)){size++}}Properties=members=null;if(!size){members=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,length;var hasProperty=!isFunction&&typeof object.constructor!="function"&&objectTypes[typeof object.hasOwnProperty]&&object.hasOwnProperty||isProperty;for(property in object){if(!(isFunction&&property=="prototype")&&hasProperty.call(object,property)){callback(property)}}for(length=members.length;property=members[--length];hasProperty.call(object,property)&&callback(property));}}else if(size==2){forEach=function(object,callback){var members={},isFunction=getClass.call(object)==functionClass,property;for(property in object){if(!(isFunction&&property=="prototype")&&!isProperty.call(members,property)&&(members[property]=1)&&isProperty.call(object,property)){callback(property)}}}}else{forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,isConstructor;for(property in object){if(!(isFunction&&property=="prototype")&&isProperty.call(object,property)&&!(isConstructor=property==="constructor")){callback(property)}}if(isConstructor||isProperty.call(object,property="constructor")){callback(property)}}}return forEach(object,callback)};if(!has("json-stringify")){var Escapes={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var leadingZeroes="000000";var toPaddedString=function(width,value){return(leadingZeroes+(value||0)).slice(-width)};var unicodePrefix="\\u00";var quote=function(value){var result='"',index=0,length=value.length,useCharIndex=!charIndexBuggy||length>10;var symbols=useCharIndex&&(charIndexBuggy?value.split(""):value);for(;index<length;index++){var charCode=value.charCodeAt(index);switch(charCode){case 8:case 9:case 10:case 12:case 13:case 34:case 92:result+=Escapes[charCode];break;default:if(charCode<32){result+=unicodePrefix+toPaddedString(2,charCode.toString(16));break}result+=useCharIndex?symbols[index]:value.charAt(index)}}return result+'"'};var serialize=function(property,object,callback,properties,whitespace,indentation,stack){var value,className,year,month,date,time,hours,minutes,seconds,milliseconds,results,element,index,length,prefix,result;try{value=object[property]}catch(exception){}if(typeof value=="object"&&value){className=getClass.call(value);if(className==dateClass&&!isProperty.call(value,"toJSON")){if(value>-1/0&&value<1/0){if(getDay){date=floor(value/864e5);for(year=floor(date/365.2425)+1970-1;getDay(year+1,0)<=date;year++);for(month=floor((date-getDay(year,0))/30.42);getDay(year,month+1)<=date;month++);date=1+date-getDay(year,month);time=(value%864e5+864e5)%864e5;hours=floor(time/36e5)%24;minutes=floor(time/6e4)%60;seconds=floor(time/1e3)%60;milliseconds=time%1e3}else{year=value.getUTCFullYear();month=value.getUTCMonth();date=value.getUTCDate();hours=value.getUTCHours();minutes=value.getUTCMinutes();seconds=value.getUTCSeconds();milliseconds=value.getUTCMilliseconds()}value=(year<=0||year>=1e4?(year<0?"-":"+")+toPaddedString(6,year<0?-year:year):toPaddedString(4,year))+"-"+toPaddedString(2,month+1)+"-"+toPaddedString(2,date)+"T"+toPaddedString(2,hours)+":"+toPaddedString(2,minutes)+":"+toPaddedString(2,seconds)+"."+toPaddedString(3,milliseconds)+"Z"}else{value=null}}else if(typeof value.toJSON=="function"&&(className!=numberClass&&className!=stringClass&&className!=arrayClass||isProperty.call(value,"toJSON"))){value=value.toJSON(property)}}if(callback){value=callback.call(object,property,value)}if(value===null){return"null"}className=getClass.call(value);if(className==booleanClass){return""+value}else if(className==numberClass){return value>-1/0&&value<1/0?""+value:"null"}else if(className==stringClass){return quote(""+value)}if(typeof value=="object"){for(length=stack.length;length--;){if(stack[length]===value){throw TypeError()}}stack.push(value);results=[];prefix=indentation;indentation+=whitespace;if(className==arrayClass){for(index=0,length=value.length;index<length;index++){element=serialize(index,value,callback,properties,whitespace,indentation,stack);results.push(element===undef?"null":element)}result=results.length?whitespace?"[\n"+indentation+results.join(",\n"+indentation)+"\n"+prefix+"]":"["+results.join(",")+"]":"[]"}else{forEach(properties||value,function(property){var element=serialize(property,value,callback,properties,whitespace,indentation,stack);if(element!==undef){results.push(quote(property)+":"+(whitespace?" ":"")+element)}});result=results.length?whitespace?"{\n"+indentation+results.join(",\n"+indentation)+"\n"+prefix+"}":"{"+results.join(",")+"}":"{}"}stack.pop();return result}};exports.stringify=function(source,filter,width){var whitespace,callback,properties,className;if(objectTypes[typeof filter]&&filter){if((className=getClass.call(filter))==functionClass){callback=filter}else if(className==arrayClass){properties={};for(var index=0,length=filter.length,value;index<length;value=filter[index++],(className=getClass.call(value),className==stringClass||className==numberClass)&&(properties[value]=1));}}if(width){if((className=getClass.call(width))==numberClass){if((width-=width%1)>0){for(whitespace="",width>10&&(width=10);whitespace.length<width;whitespace+=" ");}}else if(className==stringClass){whitespace=width.length<=10?width:width.slice(0,10)}}return serialize("",(value={},value[""]=source,value),callback,properties,whitespace,"",[])}}if(!has("json-parse")){var fromCharCode=String.fromCharCode;var Unescapes={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"};var Index,Source;var abort=function(){Index=Source=null;throw SyntaxError()};var lex=function(){var source=Source,length=source.length,value,begin,position,isSigned,charCode;while(Index<length){charCode=source.charCodeAt(Index);switch(charCode){case 9:case 10:case 13:case 32:Index++;break;case 123:case 125:case 91:case 93:case 58:case 44:value=charIndexBuggy?source.charAt(Index):source[Index];Index++;return value;case 34:for(value="@",Index++;Index<length;){charCode=source.charCodeAt(Index);if(charCode<32){abort()}else if(charCode==92){charCode=source.charCodeAt(++Index);switch(charCode){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:value+=Unescapes[charCode];Index++;break;case 117:begin=++Index;for(position=Index+4;Index<position;Index++){charCode=source.charCodeAt(Index);if(!(charCode>=48&&charCode<=57||charCode>=97&&charCode<=102||charCode>=65&&charCode<=70)){abort()}}value+=fromCharCode("0x"+source.slice(begin,Index));break;default:abort()}}else{if(charCode==34){break}charCode=source.charCodeAt(Index);begin=Index;while(charCode>=32&&charCode!=92&&charCode!=34){charCode=source.charCodeAt(++Index)}value+=source.slice(begin,Index)}}if(source.charCodeAt(Index)==34){Index++;return value}abort();default:begin=Index;if(charCode==45){isSigned=true;charCode=source.charCodeAt(++Index)}if(charCode>=48&&charCode<=57){if(charCode==48&&(charCode=source.charCodeAt(Index+1),charCode>=48&&charCode<=57)){abort()}isSigned=false;for(;Index<length&&(charCode=source.charCodeAt(Index),charCode>=48&&charCode<=57);Index++);if(source.charCodeAt(Index)==46){position=++Index;for(;position<length&&(charCode=source.charCodeAt(position),charCode>=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}charCode=source.charCodeAt(Index);if(charCode==101||charCode==69){charCode=source.charCodeAt(++Index);if(charCode==43||charCode==45){Index++}for(position=Index;position<length&&(charCode=source.charCodeAt(position),charCode>=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}return+source.slice(begin,Index)}if(isSigned){abort()}if(source.slice(Index,Index+4)=="true"){Index+=4;return true}else if(source.slice(Index,Index+5)=="false"){Index+=5;return false}else if(source.slice(Index,Index+4)=="null"){Index+=4;return null}abort()}}return"$"};var get=function(value){var results,hasMembers;if(value=="$"){abort()}if(typeof value=="string"){if((charIndexBuggy?value.charAt(0):value[0])=="@"){return value.slice(1)}if(value=="["){results=[];for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="]"){break}if(hasMembers){if(value==","){value=lex();if(value=="]"){abort()}}else{abort()}}if(value==","){abort()}results.push(get(value))}return results}else if(value=="{"){results={};for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="}"){break}if(hasMembers){if(value==","){value=lex();if(value=="}"){abort()}}else{abort()}}if(value==","||typeof value!="string"||(charIndexBuggy?value.charAt(0):value[0])!="@"||lex()!=":"){abort()}results[value.slice(1)]=get(lex())}return results}abort()}return value};var update=function(source,property,callback){var element=walk(source,property,callback);if(element===undef){delete source[property]}else{source[property]=element}};var walk=function(source,property,callback){var value=source[property],length;if(typeof value=="object"&&value){if(getClass.call(value)==arrayClass){for(length=value.length;length--;){update(value,length,callback)}}else{forEach(value,function(property){update(value,property,callback)})}}return callback.call(source,property,value)};exports.parse=function(source,callback){var result,value;Index=0;Source=""+source;result=get(lex());if(lex()!="$"){abort()}Index=Source=null;return callback&&getClass.call(callback)==functionClass?walk((value={},value[""]=result,value),"",callback):result}}}exports["runInContext"]=runInContext;return exports}if(freeExports&&!isLoader){runInContext(root,freeExports)}else{var nativeJSON=root.JSON,previousJSON=root["JSON3"],isRestored=false;var JSON3=runInContext(root,root["JSON3"]={noConflict:function(){if(!isRestored){isRestored=true;root.JSON=nativeJSON;root["JSON3"]=previousJSON;nativeJSON=previousJSON=null}return JSON3}});root.JSON={parse:JSON3.parse,stringify:JSON3.stringify}}if(isLoader){define(function(){return JSON3})}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],16:[function(require,module,exports){(function(global){(function UMD(name,context,definition){context[name]=context[name]||definition();if(typeof module!="undefined"&&module.exports){module.exports=context[name]}else if(typeof define=="function"&&define.amd){define(function $AMD$(){return context[name]})}})("Promise",typeof global!="undefined"?global:this,function DEF(){"use strict";var builtInProp,cycle,scheduling_queue,ToString=Object.prototype.toString,timer=typeof setImmediate!="undefined"?function timer(fn){return setImmediate(fn)}:setTimeout;try{Object.defineProperty({},"x",{});builtInProp=function builtInProp(obj,name,val,config){return Object.defineProperty(obj,name,{value:val,writable:true,configurable:config!==false})}}catch(err){builtInProp=function builtInProp(obj,name,val){obj[name]=val;return obj}}scheduling_queue=function Queue(){var first,last,item;function Item(fn,self){this.fn=fn;this.self=self;this.next=void 0}return{add:function add(fn,self){item=new Item(fn,self);if(last){last.next=item}else{first=item}last=item;item=void 0},drain:function drain(){var f=first;first=last=cycle=void 0;while(f){f.fn.call(f.self);f=f.next}}}}();function schedule(fn,self){scheduling_queue.add(fn,self);if(!cycle){cycle=timer(scheduling_queue.drain)}}function isThenable(o){var _then,o_type=typeof o;if(o!=null&&(o_type=="object"||o_type=="function")){_then=o.then}return typeof _then=="function"?_then:false}function notify(){for(var i=0;i<this.chain.length;i++){notifyIsolated(this,this.state===1?this.chain[i].success:this.chain[i].failure,this.chain[i])}this.chain.length=0}function notifyIsolated(self,cb,chain){var ret,_then;try{if(cb===false){chain.reject(self.msg)}else{if(cb===true){ret=self.msg}else{ret=cb.call(void 0,self.msg)}if(ret===chain.promise){chain.reject(TypeError("Promise-chain cycle"))}else if(_then=isThenable(ret)){_then.call(ret,chain.resolve,chain.reject)}else{chain.resolve(ret)}}}catch(err){chain.reject(err)}}function resolve(msg){var _then,self=this;if(self.triggered){return}self.triggered=true;if(self.def){self=self.def}try{if(_then=isThenable(msg)){schedule(function(){var def_wrapper=new MakeDefWrapper(self);try{_then.call(msg,function $resolve$(){resolve.apply(def_wrapper,arguments)},function $reject$(){reject.apply(def_wrapper,arguments); | ||
})}catch(err){reject.call(def_wrapper,err)}})}else{self.msg=msg;self.state=1;if(self.chain.length>0){schedule(notify,self)}}}catch(err){reject.call(new MakeDefWrapper(self),err)}}function reject(msg){var self=this;if(self.triggered){return}self.triggered=true;if(self.def){self=self.def}self.msg=msg;self.state=2;if(self.chain.length>0){schedule(notify,self)}}function iteratePromises(Constructor,arr,resolver,rejecter){for(var idx=0;idx<arr.length;idx++){(function IIFE(idx){Constructor.resolve(arr[idx]).then(function $resolver$(msg){resolver(idx,msg)},rejecter)})(idx)}}function MakeDefWrapper(self){this.def=self;this.triggered=false}function MakeDef(self){this.promise=self;this.state=0;this.triggered=false;this.chain=[];this.msg=void 0}function Promise(executor){if(typeof executor!="function"){throw TypeError("Not a function")}if(this.__NPO__!==0){throw TypeError("Not a promise")}this.__NPO__=1;var def=new MakeDef(this);this["then"]=function then(success,failure){var o={success:typeof success=="function"?success:true,failure:typeof failure=="function"?failure:false};o.promise=new this.constructor(function extractChain(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}o.resolve=resolve;o.reject=reject});def.chain.push(o);if(def.state!==0){schedule(notify,def)}return o.promise};this["catch"]=function $catch$(failure){return this.then(void 0,failure)};try{executor.call(void 0,function publicResolve(msg){resolve.call(def,msg)},function publicReject(msg){reject.call(def,msg)})}catch(err){reject.call(def,err)}}var PromisePrototype=builtInProp({},"constructor",Promise,false);Promise.prototype=PromisePrototype;builtInProp(PromisePrototype,"__NPO__",0,false);builtInProp(Promise,"resolve",function Promise$resolve(msg){var Constructor=this;if(msg&&typeof msg=="object"&&msg.__NPO__===1){return msg}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}resolve(msg)})});builtInProp(Promise,"reject",function Promise$reject(msg){return new this(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}reject(msg)})});builtInProp(Promise,"all",function Promise$all(arr){var Constructor=this;if(ToString.call(arr)!="[object Array]"){return Constructor.reject(TypeError("Not an array"))}if(arr.length===0){return Constructor.resolve([])}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}var len=arr.length,msgs=Array(len),count=0;iteratePromises(Constructor,arr,function resolver(idx,msg){msgs[idx]=msg;if(++count===len){resolve(msgs)}},reject)})});builtInProp(Promise,"race",function Promise$race(arr){var Constructor=this;if(ToString.call(arr)!="[object Array]"){return Constructor.reject(TypeError("Not an array"))}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}iteratePromises(Constructor,arr,function resolver(idx,msg){resolve(msg)},reject)})});return Promise})}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],17:[function(require,module,exports){var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O[["Active"].concat("Object").join("X")]!=D){try{var ad=new(window[["Active"].concat("Object").join("X")])(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if(typeof j.readyState!=D&&j.readyState=="complete"||typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body)){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return!a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||!/%$/.test(aa.width)&&parseInt(aa.width,10)<310){aa.width="310"}if(typeof aa.height==D||!/%$/.test(aa.height)&&parseInt(aa.height,10)<137){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?["Active"].concat("").join("X"):"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return Y[0]>X[0]||Y[0]==X[0]&&Y[1]>X[1]||Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=ad&&typeof ad=="string"?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring(Y[X].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();module.exports=swfobject},{}],18:[function(require,module,exports){module.exports=require("./lib/visibility.timers.js")},{"./lib/visibility.timers.js":20}],19:[function(require,module,exports){(function(global){"use strict";var lastId=-1;var self={onVisible:function(callback){var support=self.isSupported();if(!support||!self.hidden()){callback();return support}var listener=self.change(function(e,state){if(!self.hidden()){self.unbind(listener);callback()}});return listener},change:function(callback){if(!self.isSupported()){return false}lastId+=1;var number=lastId;self._callbacks[number]=callback;self._listen();return number},unbind:function(id){delete self._callbacks[id]},afterPrerendering:function(callback){var support=self.isSupported();var prerender="prerender";if(!support||prerender!=self.state()){callback();return support}var listener=self.change(function(e,state){if(prerender!=state){self.unbind(listener);callback()}});return listener},hidden:function(){return!!(self._doc.hidden||self._doc.webkitHidden)},state:function(){return self._doc.visibilityState||self._doc.webkitVisibilityState||"visible"},isSupported:function(){return!!(self._doc.visibilityState||self._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(event){var state=self.state();for(var i in self._callbacks){self._callbacks[i].call(self._doc,event,state)}},_listen:function(){if(self._init){return}var event="visibilitychange";if(self._doc.webkitVisibilityState){event="webkit"+event}var listener=function(){self._change.apply(self,arguments)};if(self._doc.addEventListener){self._doc.addEventListener(event,listener)}else{self._doc.attachEvent(event,listener)}self._init=true}};if(typeof module!="undefined"&&module.exports){module.exports=self}else{global.Visibility=self}})(this)},{}],20:[function(require,module,exports){(function(window){"use strict";var lastTimer=-1;var install=function(Visibility){Visibility.every=function(interval,hiddenInterval,callback){Visibility._time();if(!callback){callback=hiddenInterval;hiddenInterval=null}lastTimer+=1;var number=lastTimer;Visibility._timers[number]={visible:interval,hidden:hiddenInterval,callback:callback};Visibility._run(number,false);if(Visibility.isSupported()){Visibility._listen()}return number};Visibility.stop=function(id){if(!Visibility._timers[id]){return false}Visibility._stop(id);delete Visibility._timers[id];return true};Visibility._timers={};Visibility._time=function(){if(Visibility._timed){return}Visibility._timed=true;Visibility._wasHidden=Visibility.hidden();Visibility.change(function(){Visibility._stopRun();Visibility._wasHidden=Visibility.hidden()})};Visibility._run=function(id,runNow){var interval,timer=Visibility._timers[id];if(Visibility.hidden()){if(null===timer.hidden){return}interval=timer.hidden}else{interval=timer.visible}var runner=function(){timer.last=new Date;timer.callback.call(window)};if(runNow){var now=new Date;var last=now-timer.last;if(interval>last){timer.delay=setTimeout(function(){timer.id=setInterval(runner,interval);runner()},interval-last)}else{timer.id=setInterval(runner,interval);runner()}}else{timer.id=setInterval(runner,interval)}};Visibility._stop=function(id){var timer=Visibility._timers[id];clearInterval(timer.id);clearTimeout(timer.delay);delete timer.id;delete timer.delay};Visibility._stopRun=function(event){var isHidden=Visibility.hidden(),wasHidden=Visibility._wasHidden;if(isHidden&&!wasHidden||!isHidden&&wasHidden){for(var i in Visibility._timers){Visibility._stop(i);Visibility._run(i,!isHidden)}}};return Visibility};if(typeof module!="undefined"&&module.exports){module.exports=install(require("./visibility.core"))}else{install(window.Visibility)}})(window)},{"./visibility.core":19}]},{},[1]); | ||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){"use strict";var _index=require("./lib/index");var _index2=_interopRequireDefault(_index);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}window.Realeyesit=window.Realeyesit||{};window.Realeyesit.EnvironmentDetector={detect:_index2["default"]}},{"./lib/index":5}],2:[function(require,module,exports){"use strict";exports.__esModule=true;var _getFirstMatch=require("./utils/getFirstMatch");var _getFirstMatch2=_interopRequireDefault(_getFirstMatch);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var names={OPERA:"Opera",INTERNET_EXPLORER:"Internet Explorer",MICROSOFT_EDGE:"Microsoft Edge",FIREFOX:"Firefox",PHANTOM_JS:"PhantomJS",CHROMIUM:"Chromium",CHROME:"Chrome",ANDROID:"Android",SAFARI:"Safari",UNKNOWN:"Unknown"};var tests=[{browserName:names.OPERA,testRegex:/opera|opr|opios/i,versionRegex:/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i},{browserName:names.INTERNET_EXPLORER,testRegex:/msie|trident/i,versionRegex:/(?:msie |rv:)(\d+(\.\d+)?)/i},{browserName:names.MICROSOFT_EDGE,testRegex:/chrome.+? edge/i,versionRegex:/edge\/(\d+(\.\d+)?)/i},{browserName:names.FIREFOX,testRegex:/firefox|iceweasel|fxios/i,versionRegex:/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i},{browserName:names.PHANTOM_JS,testRegex:/phantom/i,versionRegex:/phantomjs\/(\d+(\.\d+)?)/i},{browserName:names.CHROMIUM,testRegex:/chromium/i,versionRegex:/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i},{browserName:names.CHROME,testRegex:/chrome|crios|crmo/i,versionRegex:/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i},{browserName:names.ANDROID,testRegex:/android/i,versionRegex:null},{browserName:names.SAFARI,testRegex:/safari|applewebkit/i,versionRegex:null}];exports["default"]={names:names,detect:function detect(ua){for(var i=0;i<tests.length;i++){if(tests[i].testRegex.test(ua)){return{name:tests[i].browserName,version:(0,_getFirstMatch2["default"])(ua,tests[i].versionRegex)||(0,_getFirstMatch2["default"])(ua,/version\/(\d+(\.\d+)?)/i)||(0,_getFirstMatch2["default"])(ua,/^.*\/(.*) /)}}}return{name:names.UNKNOWN,version:null}}}},{"./utils/getFirstMatch":10}],3:[function(require,module,exports){"use strict";exports.__esModule=true;var _swfobject=require("swfobject");var _swfobject2=_interopRequireDefault(_swfobject);var _inArray=require("./utils/inArray");var _inArray2=_interopRequireDefault(_inArray);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var names={FLASH:"flash",GET_USER_MEDIA:"navigator.getUserMedia",MEDIA_RECORDER:"MediaRecorder",WEBCAM:"webcam",DOCUMENT_ALL:"document.all",DOCUMENT_QUERY_SELECTOR:"document.querySelector",HTTP:"http",HTTPS:"https",LOCALHOST:"localhost"};var tests=[{capabilityName:names.FLASH,test:function test(){var version=_swfobject2["default"].getFlashPlayerVersion();return!(version.major===0&&version.minor===0&&version.release===0)}},{capabilityName:names.GET_USER_MEDIA,test:function test(){return!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}},{capabilityName:names.MEDIA_RECORDER,test:function test(){return typeof window.MediaRecorder==="function"}},{capabilityName:names.DOCUMENT_ALL,test:function test(){return document.querySelector!==undefined}},{capabilityName:names.DOCUMENT_QUERY_SELECTOR,test:function test(){return typeof document.querySelector==="function"}},{capabilityName:names.HTTP,test:function test(){return document.location.protocol==="http:"}},{capabilityName:names.HTTPS,test:function test(){return document.location.protocol==="https:"}},{capabilityName:names.LOCALHOST,test:function test(){return document.location.hostname==="localhost"||document.location.hostname==="127.0.0.1"}}];exports["default"]={names:names,detect:function detect(){var skip=arguments.length<=0||arguments[0]===undefined?[]:arguments[0];var results=[];for(var i=0;i<tests.length;i++){if(!(0,_inArray2["default"])(skip,tests[i].capabilityName)&&tests[i].test()){results.push(tests[i].capabilityName)}}return results}}},{"./utils/inArray":11,swfobject:18}],4:[function(require,module,exports){"use strict";exports.__esModule=true;var _nativePromiseOnly=require("native-promise-only");var _nativePromiseOnly2=_interopRequireDefault(_nativePromiseOnly);var _swfobject=require("swfobject");var _swfobject2=_interopRequireDefault(_swfobject);var _timeout=require("./utils/timeout");var _timeout2=_interopRequireDefault(_timeout);var _waitForDocumentReady=require("./utils/waitForDocumentReady");var _waitForDocumentReady2=_interopRequireDefault(_waitForDocumentReady);var _currentScriptPath=require("./utils/currentScriptPath");var _currentScriptPath2=_interopRequireDefault(_currentScriptPath);var _visible=require("./utils/visible");var _visible2=_interopRequireDefault(_visible);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var DEFAULT_SWF_PATH=_currentScriptPath2["default"]+"environment-detector.swf";var DEFAULT_TEST_TIMEOUT=3e3;var DEFAULT_CONTAINER_ID="Realeyesit_FlashEnvironmentDetector";var DEFAULT_MIN_FLASH_VERSION="10.2.0";var flashEl=void 0;exports["default"]={embedSWF:function embedSWF(path,containerId,minFlashVersion){return new _nativePromiseOnly2["default"](function(resolve,reject){if(flashEl!==undefined){resolve(flashEl);return}var container=document.createElement("div");container.id=containerId;document.body.appendChild(container);_swfobject2["default"].createCSS("#"+containerId,"position: absolute; top: -10px;");_swfobject2["default"].embedSWF(path,containerId,"10","1",minFlashVersion,null,null,{allowScriptAccess:"always"},null,function(e){if(!e.success){reject()}else{window.Realeyesit=window.Realeyesit||{};window.Realeyesit.FlashEnvironmentDetectorReady=resolve}})})},detect:function detect(){var _this=this;var _ref=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];var _ref$path=_ref.path;var path=_ref$path===undefined?DEFAULT_SWF_PATH:_ref$path;var _ref$testTimeout=_ref.testTimeout;var testTimeout=_ref$testTimeout===undefined?DEFAULT_TEST_TIMEOUT:_ref$testTimeout;var _ref$containerId=_ref.containerId;var containerId=_ref$containerId===undefined?DEFAULT_CONTAINER_ID:_ref$containerId;var _ref$minFlashVersion=_ref.minFlashVersion;var minFlashVersion=_ref$minFlashVersion===undefined?DEFAULT_MIN_FLASH_VERSION:_ref$minFlashVersion;var skip=arguments.length<=1||arguments[1]===undefined?false:arguments[1];if(skip){return _nativePromiseOnly2["default"].resolve(null)}return(0,_visible2["default"])().then(function(){return(0,_timeout2["default"])(testTimeout,(0,_waitForDocumentReady2["default"])().then(function(){return _this.embedSWF(path,containerId,minFlashVersion)}))["catch"](function(){return null})})}}},{"./utils/currentScriptPath":9,"./utils/timeout":12,"./utils/visible":13,"./utils/waitForDocumentReady":14,"native-promise-only":17,swfobject:18}],5:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=detect;var _browsers=require("./browsers");var _browsers2=_interopRequireDefault(_browsers);var _platform=require("./platform");var _platform2=_interopRequireDefault(_platform);var _os=require("./os");var _os2=_interopRequireDefault(_os);var _capabilities=require("./capabilities");var _capabilities2=_interopRequireDefault(_capabilities);var _flash=require("./flash");var _flash2=_interopRequireDefault(_flash);var _webcam=require("./webcam");var _webcam2=_interopRequireDefault(_webcam);var _Logger=require("./utils/Logger");var _Logger2=_interopRequireDefault(_Logger);var _inArray=require("./utils/inArray");var _inArray2=_interopRequireDefault(_inArray);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function detect(){var options=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];var ua=navigator.userAgent;var start=+new Date;var logger=new _Logger2["default"](options.logger);var skipFlash=options.skip&&(0,_inArray2["default"])(options.skip,"flash");return _flash2["default"].detect(options.flash,skipFlash).then(function(flashResult){return _webcam2["default"].detect(flashResult).then(function(webcamsResult){var result={browser:_browsers2["default"].detect(ua),platform:_platform2["default"].detect(ua),os:_os2["default"].detect(ua),flash:flashResult,webcams:webcamsResult,capabilities:_capabilities2["default"].detect(options.skip)};logger.log({result:result,start:start,duration:+new Date-start});return result})})}},{"./browsers":2,"./capabilities":3,"./flash":4,"./os":6,"./platform":7,"./utils/Logger":8,"./utils/inArray":11,"./webcam":15}],6:[function(require,module,exports){"use strict";exports.__esModule=true;var _getFirstMatch=require("./utils/getFirstMatch");var _getFirstMatch2=_interopRequireDefault(_getFirstMatch);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var names={ANDROID:"android",MAC_OS:"macos",WINDOWS:"windows",LINUX:"linux",UNKNOWN:"unknown"};var tests=[{osName:names.ANDROID,testRegex:/^(?!.*like android).*android/i,getVersion:function getVersion(){return null}},{osName:names.MAC_OS,testRegex:/macintosh/i,getVersion:function getVersion(ua){return ua.replace(/.*?OS X (.*?)\).*/,"$1")}},{osName:names.WINDOWS,testRegex:/windows/i,getVersion:function getVersion(){return null}},{osName:names.LINUX,testRegex:/linux/i,getVersion:function getVersion(){return null}}];exports["default"]={names:names,detect:function detect(ua){for(var i=0;i<tests.length;i++){if(tests[i].testRegex.test(ua)){return{name:tests[i].osName,version:tests[i].getVersion(ua)||(0,_getFirstMatch2["default"])(ua,/version\/(\d+\.\d+)/i)||null}}}return{name:names.UNKNOWN,version:null}}}},{"./utils/getFirstMatch":10}],7:[function(require,module,exports){"use strict";exports.__esModule=true;var types={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"};var tests=[{type:types.TABLET,testRegex:/tablet/i},{type:types.MOBILE,testRegex:new RegExp(["Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|","Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|","Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune"].join(""))}];exports["default"]={types:types,detect:function detect(ua){for(var i=0;i<tests.length;i++){if(tests[i].testRegex.test(ua)){return{type:tests[i].type}}}return{type:types.DESKTOP}}}},{}],8:[function(require,module,exports){"use strict";exports.__esModule=true;var _json=require("json3");var _json2=_interopRequireDefault(_json);var _currentScriptPath=require("./currentScriptPath");var _currentScriptPath2=_interopRequireDefault(_currentScriptPath);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var DEFAULT_LOGGER_PATH=_currentScriptPath2["default"]+"log.gif";var Logger=function(){function Logger(){var _ref=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];var _ref$path=_ref.path;var path=_ref$path===undefined?DEFAULT_LOGGER_PATH:_ref$path;_classCallCheck(this,Logger);this.path=path}Logger.prototype.log=function log(msg){var img=document.createElement("img");img.style.position="absolute";img.style.top="-10px";img.src=this.path+"?msg="+encodeURIComponent(_json2["default"].stringify(msg));document.body.appendChild(img);img.parentNode.removeChild(img)};return Logger}();exports["default"]=Logger},{"./currentScriptPath":9,json3:16}],9:[function(require,module,exports){"use strict";exports.__esModule=true;function getPath(){if(document.currentScript!==undefined){return document.currentScript.src.split("/").slice(0,-1).join("/")+"/"}var scripts=document.getElementsByTagName("script");var src=scripts[scripts.length-1].src.split("?")[0];return src.split("/").slice(0,-1).join("/")+"/"}exports["default"]=getPath()},{}],10:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=function(str,regex){var match=str.match(regex);if(match&&match.length>1){return match[1]}return""}},{}],11:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=inArray;function inArray(arr,value){if(typeof Array.prototype.indexOf==="function"){return arr.indexOf(value)!==-1}for(var i=0;i<arr.length;i++){if(arr[i]===value){return true}}return false}},{}],12:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=timeout;var _nativePromiseOnly=require("native-promise-only");var _nativePromiseOnly2=_interopRequireDefault(_nativePromiseOnly);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function timeout(ms,promise){var pending=true;return _nativePromiseOnly2["default"].race([promise.then(function(v){pending=false;return v}),new _nativePromiseOnly2["default"](function(_,reject){return setTimeout(function(){if(pending){reject("timeout")}},ms)})])}},{"native-promise-only":17}],13:[function(require,module,exports){"use strict";exports.__esModule=true;var _visibilityjs=require("visibilityjs");var _visibilityjs2=_interopRequireDefault(_visibilityjs);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports["default"]=function(){return new Promise(function(resolve){_visibilityjs2["default"].onVisible(resolve)})}},{visibilityjs:19}],14:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=function(){return new Promise(function(resolve){if(document.readyState==="complete"){resolve();return}if(typeof document.addEventListener==="function"){document.addEventListener("readystatechange",function(){if(document.readyState==="complete"){resolve()}})}else if(window.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){resolve()}})}})}},{}],15:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]={detect:function detect(flashResult){if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices){return navigator.mediaDevices.enumerateDevices().then(function(devices){var result=[];for(var i=0;i<devices.length;i++){if(devices[i].kind==="videoinput"){var name=devices[i].label?devices[i].label:"unknown";result.push(name)}}return result})}else if(flashResult!==null){return Promise.resolve(flashResult.webcams)}return Promise.resolve([])}}},{}],16:[function(require,module,exports){(function(global){(function(){var isLoader=typeof define==="function"&&define.amd;var objectTypes={function:true,object:true};var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var root=objectTypes[typeof window]&&window||this,freeGlobal=freeExports&&objectTypes[typeof module]&&module&&!module.nodeType&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal["global"]===freeGlobal||freeGlobal["window"]===freeGlobal||freeGlobal["self"]===freeGlobal)){root=freeGlobal}function runInContext(context,exports){context||(context=root["Object"]());exports||(exports=root["Object"]());var Number=context["Number"]||root["Number"],String=context["String"]||root["String"],Object=context["Object"]||root["Object"],Date=context["Date"]||root["Date"],SyntaxError=context["SyntaxError"]||root["SyntaxError"],TypeError=context["TypeError"]||root["TypeError"],Math=context["Math"]||root["Math"],nativeJSON=context["JSON"]||root["JSON"];if(typeof nativeJSON=="object"&&nativeJSON){exports.stringify=nativeJSON.stringify;exports.parse=nativeJSON.parse}var objectProto=Object.prototype,getClass=objectProto.toString,isProperty,forEach,undef;var isExtended=new Date(-0xc782b5b800cec);try{isExtended=isExtended.getUTCFullYear()==-109252&&isExtended.getUTCMonth()===0&&isExtended.getUTCDate()===1&&isExtended.getUTCHours()==10&&isExtended.getUTCMinutes()==37&&isExtended.getUTCSeconds()==6&&isExtended.getUTCMilliseconds()==708}catch(exception){}function has(name){if(has[name]!==undef){return has[name]}var isSupported;if(name=="bug-string-char-index"){isSupported="a"[0]!="a"}else if(name=="json"){isSupported=has("json-stringify")&&has("json-parse")}else{var value,serialized='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(name=="json-stringify"){var stringify=exports.stringify,stringifySupported=typeof stringify=="function"&&isExtended;if(stringifySupported){(value=function(){return 1}).toJSON=value;try{stringifySupported=stringify(0)==="0"&&stringify(new Number)==="0"&&stringify(new String)=='""'&&stringify(getClass)===undef&&stringify(undef)===undef&&stringify()===undef&&stringify(value)==="1"&&stringify([value])=="[1]"&&stringify([undef])=="[null]"&&stringify(null)=="null"&&stringify([undef,getClass,null])=="[null,null,null]"&&stringify({a:[value,true,false,null,"\0\b\n\f\r\t"]})==serialized&&stringify(null,value)==="1"&&stringify([1,2],null,1)=="[\n 1,\n 2\n]"&&stringify(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&stringify(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&stringify(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&stringify(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch(exception){stringifySupported=false}}isSupported=stringifySupported}if(name=="json-parse"){var parse=exports.parse;if(typeof parse=="function"){try{if(parse("0")===0&&!parse(false)){value=parse(serialized);var parseSupported=value["a"].length==5&&value["a"][0]===1;if(parseSupported){try{parseSupported=!parse('"\t"')}catch(exception){}if(parseSupported){try{parseSupported=parse("01")!==1}catch(exception){}}if(parseSupported){try{parseSupported=parse("1.")!==1}catch(exception){}}}}}catch(exception){parseSupported=false}}isSupported=parseSupported}}return has[name]=!!isSupported}if(!has("json")){var functionClass="[object Function]",dateClass="[object Date]",numberClass="[object Number]",stringClass="[object String]",arrayClass="[object Array]",booleanClass="[object Boolean]";var charIndexBuggy=has("bug-string-char-index");if(!isExtended){var floor=Math.floor;var Months=[0,31,59,90,120,151,181,212,243,273,304,334];var getDay=function(year,month){return Months[month]+365*(year-1970)+floor((year-1969+(month=+(month>1)))/4)-floor((year-1901+month)/100)+floor((year-1601+month)/400)}}if(!(isProperty=objectProto.hasOwnProperty)){isProperty=function(property){var members={},constructor;if((members.__proto__=null,members.__proto__={toString:1},members).toString!=getClass){isProperty=function(property){var original=this.__proto__,result=property in(this.__proto__=null,this);this.__proto__=original;return result}}else{constructor=members.constructor;isProperty=function(property){var parent=(this.constructor||constructor).prototype;return property in this&&!(property in parent&&this[property]===parent[property])}}members=null;return isProperty.call(this,property)}}forEach=function(object,callback){var size=0,Properties,members,property;(Properties=function(){this.valueOf=0}).prototype.valueOf=0;members=new Properties;for(property in members){if(isProperty.call(members,property)){size++}}Properties=members=null;if(!size){members=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,length;var hasProperty=!isFunction&&typeof object.constructor!="function"&&objectTypes[typeof object.hasOwnProperty]&&object.hasOwnProperty||isProperty;for(property in object){if(!(isFunction&&property=="prototype")&&hasProperty.call(object,property)){callback(property)}}for(length=members.length;property=members[--length];hasProperty.call(object,property)&&callback(property));}}else if(size==2){forEach=function(object,callback){var members={},isFunction=getClass.call(object)==functionClass,property;for(property in object){if(!(isFunction&&property=="prototype")&&!isProperty.call(members,property)&&(members[property]=1)&&isProperty.call(object,property)){callback(property)}}}}else{forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,isConstructor;for(property in object){if(!(isFunction&&property=="prototype")&&isProperty.call(object,property)&&!(isConstructor=property==="constructor")){callback(property)}}if(isConstructor||isProperty.call(object,property="constructor")){callback(property)}}}return forEach(object,callback)};if(!has("json-stringify")){var Escapes={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var leadingZeroes="000000";var toPaddedString=function(width,value){return(leadingZeroes+(value||0)).slice(-width)};var unicodePrefix="\\u00";var quote=function(value){var result='"',index=0,length=value.length,useCharIndex=!charIndexBuggy||length>10;var symbols=useCharIndex&&(charIndexBuggy?value.split(""):value);for(;index<length;index++){var charCode=value.charCodeAt(index);switch(charCode){case 8:case 9:case 10:case 12:case 13:case 34:case 92:result+=Escapes[charCode];break;default:if(charCode<32){result+=unicodePrefix+toPaddedString(2,charCode.toString(16));break}result+=useCharIndex?symbols[index]:value.charAt(index)}}return result+'"'};var serialize=function(property,object,callback,properties,whitespace,indentation,stack){var value,className,year,month,date,time,hours,minutes,seconds,milliseconds,results,element,index,length,prefix,result;try{value=object[property]}catch(exception){}if(typeof value=="object"&&value){className=getClass.call(value);if(className==dateClass&&!isProperty.call(value,"toJSON")){if(value>-1/0&&value<1/0){if(getDay){date=floor(value/864e5);for(year=floor(date/365.2425)+1970-1;getDay(year+1,0)<=date;year++);for(month=floor((date-getDay(year,0))/30.42);getDay(year,month+1)<=date;month++);date=1+date-getDay(year,month);time=(value%864e5+864e5)%864e5;hours=floor(time/36e5)%24;minutes=floor(time/6e4)%60;seconds=floor(time/1e3)%60;milliseconds=time%1e3}else{year=value.getUTCFullYear();month=value.getUTCMonth();date=value.getUTCDate();hours=value.getUTCHours();minutes=value.getUTCMinutes();seconds=value.getUTCSeconds();milliseconds=value.getUTCMilliseconds()}value=(year<=0||year>=1e4?(year<0?"-":"+")+toPaddedString(6,year<0?-year:year):toPaddedString(4,year))+"-"+toPaddedString(2,month+1)+"-"+toPaddedString(2,date)+"T"+toPaddedString(2,hours)+":"+toPaddedString(2,minutes)+":"+toPaddedString(2,seconds)+"."+toPaddedString(3,milliseconds)+"Z"}else{value=null}}else if(typeof value.toJSON=="function"&&(className!=numberClass&&className!=stringClass&&className!=arrayClass||isProperty.call(value,"toJSON"))){value=value.toJSON(property)}}if(callback){value=callback.call(object,property,value)}if(value===null){return"null"}className=getClass.call(value);if(className==booleanClass){return""+value}else if(className==numberClass){return value>-1/0&&value<1/0?""+value:"null"}else if(className==stringClass){return quote(""+value)}if(typeof value=="object"){for(length=stack.length;length--;){if(stack[length]===value){throw TypeError()}}stack.push(value);results=[];prefix=indentation;indentation+=whitespace;if(className==arrayClass){for(index=0,length=value.length;index<length;index++){element=serialize(index,value,callback,properties,whitespace,indentation,stack);results.push(element===undef?"null":element)}result=results.length?whitespace?"[\n"+indentation+results.join(",\n"+indentation)+"\n"+prefix+"]":"["+results.join(",")+"]":"[]"}else{forEach(properties||value,function(property){var element=serialize(property,value,callback,properties,whitespace,indentation,stack);if(element!==undef){results.push(quote(property)+":"+(whitespace?" ":"")+element)}});result=results.length?whitespace?"{\n"+indentation+results.join(",\n"+indentation)+"\n"+prefix+"}":"{"+results.join(",")+"}":"{}"}stack.pop();return result}};exports.stringify=function(source,filter,width){var whitespace,callback,properties,className;if(objectTypes[typeof filter]&&filter){if((className=getClass.call(filter))==functionClass){callback=filter}else if(className==arrayClass){properties={};for(var index=0,length=filter.length,value;index<length;value=filter[index++],(className=getClass.call(value),className==stringClass||className==numberClass)&&(properties[value]=1));}}if(width){if((className=getClass.call(width))==numberClass){if((width-=width%1)>0){for(whitespace="",width>10&&(width=10);whitespace.length<width;whitespace+=" ");}}else if(className==stringClass){whitespace=width.length<=10?width:width.slice(0,10)}}return serialize("",(value={},value[""]=source,value),callback,properties,whitespace,"",[])}}if(!has("json-parse")){var fromCharCode=String.fromCharCode;var Unescapes={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"};var Index,Source;var abort=function(){Index=Source=null;throw SyntaxError()};var lex=function(){var source=Source,length=source.length,value,begin,position,isSigned,charCode;while(Index<length){charCode=source.charCodeAt(Index);switch(charCode){case 9:case 10:case 13:case 32:Index++;break;case 123:case 125:case 91:case 93:case 58:case 44:value=charIndexBuggy?source.charAt(Index):source[Index];Index++;return value;case 34:for(value="@",Index++;Index<length;){charCode=source.charCodeAt(Index);if(charCode<32){abort()}else if(charCode==92){charCode=source.charCodeAt(++Index);switch(charCode){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:value+=Unescapes[charCode];Index++;break;case 117:begin=++Index;for(position=Index+4;Index<position;Index++){charCode=source.charCodeAt(Index);if(!(charCode>=48&&charCode<=57||charCode>=97&&charCode<=102||charCode>=65&&charCode<=70)){abort()}}value+=fromCharCode("0x"+source.slice(begin,Index));break;default:abort()}}else{if(charCode==34){break}charCode=source.charCodeAt(Index);begin=Index;while(charCode>=32&&charCode!=92&&charCode!=34){charCode=source.charCodeAt(++Index)}value+=source.slice(begin,Index)}}if(source.charCodeAt(Index)==34){Index++;return value}abort();default:begin=Index;if(charCode==45){isSigned=true;charCode=source.charCodeAt(++Index)}if(charCode>=48&&charCode<=57){if(charCode==48&&(charCode=source.charCodeAt(Index+1),charCode>=48&&charCode<=57)){abort()}isSigned=false;for(;Index<length&&(charCode=source.charCodeAt(Index),charCode>=48&&charCode<=57);Index++);if(source.charCodeAt(Index)==46){position=++Index;for(;position<length&&(charCode=source.charCodeAt(position),charCode>=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}charCode=source.charCodeAt(Index);if(charCode==101||charCode==69){charCode=source.charCodeAt(++Index);if(charCode==43||charCode==45){Index++}for(position=Index;position<length&&(charCode=source.charCodeAt(position),charCode>=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}return+source.slice(begin,Index)}if(isSigned){abort()}if(source.slice(Index,Index+4)=="true"){Index+=4;return true}else if(source.slice(Index,Index+5)=="false"){Index+=5;return false}else if(source.slice(Index,Index+4)=="null"){Index+=4;return null}abort()}}return"$"};var get=function(value){var results,hasMembers;if(value=="$"){abort()}if(typeof value=="string"){if((charIndexBuggy?value.charAt(0):value[0])=="@"){return value.slice(1)}if(value=="["){results=[];for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="]"){break}if(hasMembers){if(value==","){value=lex();if(value=="]"){abort()}}else{abort()}}if(value==","){abort()}results.push(get(value))}return results}else if(value=="{"){results={};for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="}"){break}if(hasMembers){if(value==","){value=lex();if(value=="}"){abort()}}else{abort()}}if(value==","||typeof value!="string"||(charIndexBuggy?value.charAt(0):value[0])!="@"||lex()!=":"){abort()}results[value.slice(1)]=get(lex())}return results}abort()}return value};var update=function(source,property,callback){var element=walk(source,property,callback);if(element===undef){delete source[property]}else{source[property]=element}};var walk=function(source,property,callback){var value=source[property],length;if(typeof value=="object"&&value){if(getClass.call(value)==arrayClass){for(length=value.length;length--;){update(value,length,callback)}}else{forEach(value,function(property){update(value,property,callback)})}}return callback.call(source,property,value)};exports.parse=function(source,callback){var result,value;Index=0;Source=""+source;result=get(lex());if(lex()!="$"){abort()}Index=Source=null;return callback&&getClass.call(callback)==functionClass?walk((value={},value[""]=result,value),"",callback):result}}}exports["runInContext"]=runInContext;return exports}if(freeExports&&!isLoader){runInContext(root,freeExports)}else{var nativeJSON=root.JSON,previousJSON=root["JSON3"],isRestored=false;var JSON3=runInContext(root,root["JSON3"]={noConflict:function(){if(!isRestored){isRestored=true;root.JSON=nativeJSON;root["JSON3"]=previousJSON;nativeJSON=previousJSON=null}return JSON3}});root.JSON={parse:JSON3.parse,stringify:JSON3.stringify}}if(isLoader){define(function(){return JSON3})}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],17:[function(require,module,exports){(function(global){(function UMD(name,context,definition){context[name]=context[name]||definition();if(typeof module!="undefined"&&module.exports){module.exports=context[name]}else if(typeof define=="function"&&define.amd){define(function $AMD$(){return context[name]})}})("Promise",typeof global!="undefined"?global:this,function DEF(){"use strict";var builtInProp,cycle,scheduling_queue,ToString=Object.prototype.toString,timer=typeof setImmediate!="undefined"?function timer(fn){return setImmediate(fn)}:setTimeout;try{Object.defineProperty({},"x",{});builtInProp=function builtInProp(obj,name,val,config){return Object.defineProperty(obj,name,{value:val,writable:true,configurable:config!==false})}}catch(err){builtInProp=function builtInProp(obj,name,val){obj[name]=val;return obj}}scheduling_queue=function Queue(){var first,last,item;function Item(fn,self){this.fn=fn;this.self=self;this.next=void 0}return{add:function add(fn,self){item=new Item(fn,self);if(last){last.next=item}else{first=item}last=item;item=void 0},drain:function drain(){var f=first;first=last=cycle=void 0;while(f){f.fn.call(f.self);f=f.next}}}}();function schedule(fn,self){scheduling_queue.add(fn,self);if(!cycle){cycle=timer(scheduling_queue.drain)}}function isThenable(o){var _then,o_type=typeof o;if(o!=null&&(o_type=="object"||o_type=="function")){_then=o.then}return typeof _then=="function"?_then:false}function notify(){for(var i=0;i<this.chain.length;i++){notifyIsolated(this,this.state===1?this.chain[i].success:this.chain[i].failure,this.chain[i])}this.chain.length=0}function notifyIsolated(self,cb,chain){var ret,_then;try{if(cb===false){chain.reject(self.msg)}else{if(cb===true){ret=self.msg}else{ret=cb.call(void 0,self.msg)}if(ret===chain.promise){chain.reject(TypeError("Promise-chain cycle"))}else if(_then=isThenable(ret)){_then.call(ret,chain.resolve,chain.reject)}else{chain.resolve(ret)}}}catch(err){chain.reject(err)}}function resolve(msg){var _then,self=this;if(self.triggered){return}self.triggered=true;if(self.def){self=self.def}try{if(_then=isThenable(msg)){schedule(function(){var def_wrapper=new MakeDefWrapper(self);try{_then.call(msg,function $resolve$(){resolve.apply(def_wrapper,arguments)},function $reject$(){reject.apply(def_wrapper,arguments)})}catch(err){reject.call(def_wrapper,err)}})}else{self.msg=msg;self.state=1;if(self.chain.length>0){schedule(notify,self)}}}catch(err){reject.call(new MakeDefWrapper(self),err)}}function reject(msg){var self=this;if(self.triggered){ | ||
return}self.triggered=true;if(self.def){self=self.def}self.msg=msg;self.state=2;if(self.chain.length>0){schedule(notify,self)}}function iteratePromises(Constructor,arr,resolver,rejecter){for(var idx=0;idx<arr.length;idx++){(function IIFE(idx){Constructor.resolve(arr[idx]).then(function $resolver$(msg){resolver(idx,msg)},rejecter)})(idx)}}function MakeDefWrapper(self){this.def=self;this.triggered=false}function MakeDef(self){this.promise=self;this.state=0;this.triggered=false;this.chain=[];this.msg=void 0}function Promise(executor){if(typeof executor!="function"){throw TypeError("Not a function")}if(this.__NPO__!==0){throw TypeError("Not a promise")}this.__NPO__=1;var def=new MakeDef(this);this["then"]=function then(success,failure){var o={success:typeof success=="function"?success:true,failure:typeof failure=="function"?failure:false};o.promise=new this.constructor(function extractChain(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}o.resolve=resolve;o.reject=reject});def.chain.push(o);if(def.state!==0){schedule(notify,def)}return o.promise};this["catch"]=function $catch$(failure){return this.then(void 0,failure)};try{executor.call(void 0,function publicResolve(msg){resolve.call(def,msg)},function publicReject(msg){reject.call(def,msg)})}catch(err){reject.call(def,err)}}var PromisePrototype=builtInProp({},"constructor",Promise,false);Promise.prototype=PromisePrototype;builtInProp(PromisePrototype,"__NPO__",0,false);builtInProp(Promise,"resolve",function Promise$resolve(msg){var Constructor=this;if(msg&&typeof msg=="object"&&msg.__NPO__===1){return msg}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}resolve(msg)})});builtInProp(Promise,"reject",function Promise$reject(msg){return new this(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}reject(msg)})});builtInProp(Promise,"all",function Promise$all(arr){var Constructor=this;if(ToString.call(arr)!="[object Array]"){return Constructor.reject(TypeError("Not an array"))}if(arr.length===0){return Constructor.resolve([])}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}var len=arr.length,msgs=Array(len),count=0;iteratePromises(Constructor,arr,function resolver(idx,msg){msgs[idx]=msg;if(++count===len){resolve(msgs)}},reject)})});builtInProp(Promise,"race",function Promise$race(arr){var Constructor=this;if(ToString.call(arr)!="[object Array]"){return Constructor.reject(TypeError("Not an array"))}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}iteratePromises(Constructor,arr,function resolver(idx,msg){resolve(msg)},reject)})});return Promise})}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],18:[function(require,module,exports){var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O[["Active"].concat("Object").join("X")]!=D){try{var ad=new(window[["Active"].concat("Object").join("X")])(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if(typeof j.readyState!=D&&j.readyState=="complete"||typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body)){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return!a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||!/%$/.test(aa.width)&&parseInt(aa.width,10)<310){aa.width="310"}if(typeof aa.height==D||!/%$/.test(aa.height)&&parseInt(aa.height,10)<137){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?["Active"].concat("").join("X"):"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return Y[0]>X[0]||Y[0]==X[0]&&Y[1]>X[1]||Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=ad&&typeof ad=="string"?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring(Y[X].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();module.exports=swfobject},{}],19:[function(require,module,exports){module.exports=require("./lib/visibility.timers.js")},{"./lib/visibility.timers.js":21}],20:[function(require,module,exports){(function(global){"use strict";var lastId=-1;var self={onVisible:function(callback){var support=self.isSupported();if(!support||!self.hidden()){callback();return support}var listener=self.change(function(e,state){if(!self.hidden()){self.unbind(listener);callback()}});return listener},change:function(callback){if(!self.isSupported()){return false}lastId+=1;var number=lastId;self._callbacks[number]=callback;self._listen();return number},unbind:function(id){delete self._callbacks[id]},afterPrerendering:function(callback){var support=self.isSupported();var prerender="prerender";if(!support||prerender!=self.state()){callback();return support}var listener=self.change(function(e,state){if(prerender!=state){self.unbind(listener);callback()}});return listener},hidden:function(){return!!(self._doc.hidden||self._doc.webkitHidden)},state:function(){return self._doc.visibilityState||self._doc.webkitVisibilityState||"visible"},isSupported:function(){return!!(self._doc.visibilityState||self._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(event){var state=self.state();for(var i in self._callbacks){self._callbacks[i].call(self._doc,event,state)}},_listen:function(){if(self._init){return}var event="visibilitychange";if(self._doc.webkitVisibilityState){event="webkit"+event}var listener=function(){self._change.apply(self,arguments)};if(self._doc.addEventListener){self._doc.addEventListener(event,listener)}else{self._doc.attachEvent(event,listener)}self._init=true}};if(typeof module!="undefined"&&module.exports){module.exports=self}else{global.Visibility=self}})(this)},{}],21:[function(require,module,exports){(function(window){"use strict";var lastTimer=-1;var install=function(Visibility){Visibility.every=function(interval,hiddenInterval,callback){Visibility._time();if(!callback){callback=hiddenInterval;hiddenInterval=null}lastTimer+=1;var number=lastTimer;Visibility._timers[number]={visible:interval,hidden:hiddenInterval,callback:callback};Visibility._run(number,false);if(Visibility.isSupported()){Visibility._listen()}return number};Visibility.stop=function(id){if(!Visibility._timers[id]){return false}Visibility._stop(id);delete Visibility._timers[id];return true};Visibility._timers={};Visibility._time=function(){if(Visibility._timed){return}Visibility._timed=true;Visibility._wasHidden=Visibility.hidden();Visibility.change(function(){Visibility._stopRun();Visibility._wasHidden=Visibility.hidden()})};Visibility._run=function(id,runNow){var interval,timer=Visibility._timers[id];if(Visibility.hidden()){if(null===timer.hidden){return}interval=timer.hidden}else{interval=timer.visible}var runner=function(){timer.last=new Date;timer.callback.call(window)};if(runNow){var now=new Date;var last=now-timer.last;if(interval>last){timer.delay=setTimeout(function(){timer.id=setInterval(runner,interval);runner()},interval-last)}else{timer.id=setInterval(runner,interval);runner()}}else{timer.id=setInterval(runner,interval)}};Visibility._stop=function(id){var timer=Visibility._timers[id];clearInterval(timer.id);clearTimeout(timer.delay);delete timer.id;delete timer.delay};Visibility._stopRun=function(event){var isHidden=Visibility.hidden(),wasHidden=Visibility._wasHidden;if(isHidden&&!wasHidden||!isHidden&&wasHidden){for(var i in Visibility._timers){Visibility._stop(i);Visibility._run(i,!isHidden)}}};return Visibility};if(typeof module!="undefined"&&module.exports){module.exports=install(require("./visibility.core"))}else{install(window.Visibility)}})(window)},{"./visibility.core":20}]},{},[1]); |
@@ -0,0 +0,0 @@ # Environment Detector |
@@ -9,2 +9,3 @@ /** | ||
import swfobject from 'swfobject'; | ||
import inArray from './utils/inArray'; | ||
@@ -105,10 +106,10 @@ | ||
* | ||
* @param {Array.<string>} features list of features to detect | ||
* @param {Array.<string>} skip Array of checks to skip | ||
* @return {Array.<string>} | ||
*/ | ||
detect(features) { | ||
detect(skip = []) { | ||
const results = []; | ||
for (let i = 0; i < tests.length; i++) { | ||
if (features.indexOf(tests[i].capabilityName) > -1 && tests[i].test()) { | ||
if (!inArray(skip, tests[i].capabilityName) && tests[i].test()) { | ||
results.push(tests[i].capabilityName); | ||
@@ -115,0 +116,0 @@ } |
@@ -89,2 +89,3 @@ /** | ||
* @param {string} path Url of the swf checker component | ||
* @param {boolean} skip Skip flash check | ||
* @param {number} testTimeout Timeout for the test in ms | ||
@@ -100,3 +101,7 @@ * @param {string} containerId Id of the placeholder element | ||
minFlashVersion = DEFAULT_MIN_FLASH_VERSION, | ||
} = {}) { | ||
} = {}, skip = false) { | ||
if (skip) { | ||
return Promise.resolve(null); | ||
} | ||
return visible().then( | ||
@@ -103,0 +108,0 @@ () => timeout( |
@@ -15,2 +15,3 @@ /** | ||
import Logger from './utils/Logger'; | ||
import inArray from './utils/inArray'; | ||
@@ -43,3 +44,2 @@ | ||
* @typedef {{ | ||
* features: Array.<string> | ||
* flash: ?{ | ||
@@ -51,2 +51,3 @@ * path: ?string, | ||
* }, | ||
* skip: Array.<string>, | ||
* logger: ?{ | ||
@@ -67,68 +68,24 @@ * path: ?string, | ||
const logger = new Logger(options.logger); | ||
let features = options.features; | ||
const skipFlash = options.skip && inArray(options.skip, 'flash'); | ||
if (!features) { | ||
features = []; | ||
for (const key in capabilities.names) { // eslint-disable-line | ||
if (capabilities.names.hasOwnProperty(key)) { // eslint-disable-line | ||
features.push(capabilities.names[key]); | ||
} | ||
} | ||
} | ||
return flash.detect(options.flash, skipFlash) | ||
.then(flashResult => webcams.detect(flashResult) | ||
.then(webcamsResult => { | ||
const result = { | ||
browser: browsers.detect(ua), | ||
platform: platform.detect(ua), | ||
os: os.detect(ua), | ||
flash: flashResult, | ||
webcams: webcamsResult, | ||
capabilities: capabilities.detect(options.skip), | ||
}; | ||
const result = { | ||
browser: browsers.detect(ua), | ||
platform: platform.detect(ua), | ||
os: os.detect(ua), | ||
flash: null, | ||
webcams: null, | ||
capabilities: capabilities.detect(features), | ||
}; | ||
logger.log({ | ||
result, | ||
start, | ||
duration: (+new Date()) - start, | ||
}); | ||
const detectFlash = features.indexOf(capabilities.names.FLASH) > -1; | ||
const detectWebcams = features.indexOf(capabilities.names.WEBCAM) > -1; | ||
if (detectFlash || detectWebcams) { | ||
if (detectWebcams) { | ||
return webcams.detect().then(webcamresult => { | ||
result.webcams = webcamresult; | ||
if (!webcamresult || detectFlash) { | ||
return flash.detect(options.flash).then(flashResult => { | ||
if (detectWebcams && !result.webcams && flashResult) { | ||
result.webcams = flashResult.webcams; | ||
} | ||
if (detectFlash) { | ||
result.flash = flashResult; | ||
} | ||
logger.log({ result, start, duration: (+new Date()) - start }); | ||
return result; | ||
}); | ||
} | ||
logger.log({ result, start, duration: (+new Date()) - start }); | ||
return result; | ||
}); | ||
} | ||
return flash.detect(flashResult => { | ||
result.flash = flashResult; | ||
logger.log({ result, start, duration: (+new Date()) - start }); | ||
return result; | ||
}); | ||
} | ||
logger.log({ result, start, duration: (+new Date()) - start }); | ||
return Promise.resolve(result); | ||
})); | ||
} | ||
// fixme: use polyfill or extract to separate file | ||
if (!Array.prototype.indexOf) { | ||
Array.prototype.indexOf = function (searchElement, fromIndex) { // eslint-disable-line | ||
for (let i = (fromIndex || 0); i < this.length; ++i) { | ||
if (this[i] === searchElement) return i; | ||
} | ||
return -1; | ||
}; | ||
} |
@@ -29,3 +29,3 @@ /** | ||
}); | ||
} else if (flashResult) { | ||
} else if (flashResult !== null) { | ||
return Promise.resolve(flashResult.webcams); | ||
@@ -32,0 +32,0 @@ } |
{ | ||
"name": "@realeyes/environment-detector", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "lint": "eslint .", |
@@ -55,3 +55,2 @@ # Environment Detector | ||
* @typedef {{ | ||
* features: Array.<string> | ||
* flash: { | ||
@@ -65,4 +64,2 @@ * path: string, | ||
*/ | ||
* **fetures** is an array of strings, the list of capabilities which should be detected. If 'features' equals null or undefined then all features will be detected otherwise only features from the list. Example \["flash", "navigator.getUserMedia"\] | ||
@@ -69,0 +66,0 @@ ### Example usage |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45
388554
4161
88