/** vim: et:ts=4:sw=4:sts=4
 * @license RequireJS 2.3.3 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
 */

/*!
 * SmartBeat.js
 *
 * This following software may be included in this product: SmartBeat SDK. This software contains the following license
 * and notice below:
 *
 * RequireJS      MIT License   https://github.com/requirejs/requirejs/blob/master/LICENSE
 * JQuery         MIT License   https://jquery.org/license
 * PlatformJS     MIT License   https://mths.be/mit
 * StacktraceJS   MIT License   https://www.stacktracejs.com
 * JQuery Cookie  MIT License   https://plugins.jquery.com/cookie/
 * HTML2Canvas    MIT License   http://html2canvas.hertzen.com
 * ES6Promise     MIT License   https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
 *
 *
 * *** MIT License ***
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */


var requirejs,require,define;!function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var n;for(n=0;n<e.length&&(!e[n]||!t(e[n],n,e));n+=1);}}function eachReverse(e,t){if(e){var n;for(n=e.length-1;n>-1&&(!e[n]||!t(e[n],n,e));n-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){!n&&hasProp(e,i)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[i]=t:(e[i]||(e[i]={}),mixin(e[i],t,n,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function t(e){var t,n;for(t=0;t<e.length;t++)if(n=e[t],"."===n)e.splice(t,1),t-=1;else if(".."===n){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}function n(e,n,r){var i,o,a,s,u,c,p,l,d,f,h,g,m=n&&n.split("/"),b=q.map,E=b&&b["*"];if(e&&(e=e.split("/"),p=e.length-1,q.nodeIdCompat&&jsSuffixRegExp.test(e[p])&&(e[p]=e[p].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&m&&(g=m.slice(0,m.length-1),e=g.concat(e)),t(e),e=e.join("/")),r&&b&&(m||E)){a=e.split("/");e:for(s=a.length;s>0;s-=1){if(c=a.slice(0,s).join("/"),m)for(u=m.length;u>0;u-=1)if(o=getOwn(b,m.slice(0,u).join("/")),o&&(o=getOwn(o,c))){l=o,d=s;break e}!f&&E&&getOwn(E,c)&&(f=getOwn(E,c),h=s)}!l&&f&&(l=f,d=h),l&&(a.splice(0,d,l),e=a.join("/"))}return i=getOwn(q.pkgs,e),i?i:e}function r(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===y.contextName)return t.parentNode.removeChild(t),!0})}function i(e){var t=getOwn(q.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),y.require.undef(e),y.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function a(e,t,r,i){var a,s,u,c,p=null,l=t?t.name:null,d=e,f=!0,h="";return e||(f=!1,e="_@r"+(R+=1)),c=o(e),p=c[0],e=c[1],p&&(p=n(p,l,i),s=getOwn(M,p)),e&&(p?h=r?e:s&&s.normalize?s.normalize(e,function(e){return n(e,l,i)}):e.indexOf("!")===-1?n(e,l,i):e:(h=n(e,l,i),c=o(h),p=c[0],h=c[1],r=!0,a=y.nameToUrl(h))),u=!p||s||r?"":"_unnormalized"+(j+=1),{prefix:p,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:d,isDefine:f,id:(p?p+"!"+h:h)+u}}function s(e){var t=e.id,n=getOwn(S,t);return n||(n=S[t]=new y.Module(e)),n}function u(e,t,n){var r=e.id,i=getOwn(S,r);!hasProp(M,r)||i&&!i.defineEmitComplete?(i=s(e),i.error&&"error"===t?n(i.error):i.on(t,n)):"defined"===t&&n(M[r])}function c(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(S,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function p(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(y.defQueueMap[t]=!0),A.push(e)}),globalDefQueue=[])}function l(e){delete S[e],delete L[e]}function d(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var o=r.id,a=getOwn(S,o);!a||e.depMatched[i]||n[o]||(getOwn(t,o)?(e.defineDep(i,M[o]),e.check()):d(a,t,n))}),n[r]=!0)}function f(){var e,t,n=1e3*q.waitSeconds,o=n&&y.startTime+n<(new Date).getTime(),a=[],s=[],u=!1,p=!0;if(!E){if(E=!0,eachProp(L,function(e){var n=e.map,c=n.id;if(e.enabled&&(n.isDefine||s.push(e),!e.error))if(!e.inited&&o)i(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&n.isDefine&&(u=!0,!n.prefix))return p=!1}),o&&a.length)return e=makeError("timeout","Load timeout for modules: "+a,null,a),e.contextName=y.contextName,c(e);p&&each(s,function(e){d(e,{},{})}),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,f()},50)),E=!1}}function h(e){hasProp(M,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function g(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function m(e){var t=e.currentTarget||e.srcElement;return g(t,y.onScriptLoad,"load","onreadystatechange"),g(t,y.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function b(){var e;for(p();A.length;){if(e=A.shift(),null===e[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}y.defQueueMap={}}var E,v,y,x,w,q={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},L={},O={},A=[],M={},T={},P={},R=1,j=1;return x={require:function(e){return e.require?e.require:e.require=y.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?M[e.map.id]=e.exports:e.exports=M[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(q.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},v=function(e){this.events=getOwn(O,e.id)||{},this.map=e,this.shim=getOwn(q.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},v.prototype={init:function(e,t,n,r){r=r||{},this.inited||(this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,y.startTime=(new Date).getTime();var e=this.map;return this.shim?void y.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;T[e]||(T[e]=!0,y.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,n=this.map.id,r=this.depExports,i=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{i=y.execCb(n,o,r,i)}catch(t){e=t}else i=y.execCb(n,o,r,i);if(this.map.isDefine&&void 0===i&&(t=this.module,t?i=t.exports:this.usingExports&&(i=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else i=o;if(this.exports=i,this.map.isDefine&&!this.ignore&&(M[n]=i,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(y,this.map,a)}l(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(y.defQueueMap,n)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var i,o,p,d=getOwn(P,this.map.id),f=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,g=y.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(f=r.normalize(f,function(e){return n(e,h,!0)})||""),o=a(e.prefix+"!"+f,this.map.parentMap,!0),u(o,"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),p=getOwn(S,o.id),void(p&&(this.depMaps.push(o),this.events.error&&p.on("error",bind(this,function(e){this.emit("error",e)})),p.enable()))):d?(this.map.url=y.nameToUrl(d),void this.load()):(i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&l(e.map.id)}),c(e)}),i.fromText=bind(this,function(n,r){var o=e.name,u=a(o),p=useInteractive;r&&(n=r),p&&(useInteractive=!1),s(u),hasProp(q.config,t)&&(q.config[o]=q.config[t]);try{req.exec(n)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}p&&(useInteractive=!0),this.depMaps.push(u),y.completeLoad(o),g([o],i)}),void r.load(e.name,g,i,q))})),y.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){L[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,r,i;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,i=getOwn(x,e.id))return void(this.depExports[t]=i(this));this.depCount+=1,u(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,function(e){this.emit("error",e)}))}n=e.id,r=S[n],hasProp(x,n)||!r||r.enabled||y.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(S,e.id);t&&!t.enabled&&y.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},y={config:q,contextName:e,registry:S,defined:M,urlFetched:T,defQueue:A,defQueueMap:{},Module:v,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,n){return(n.indexOf("?")===-1?"?":"&")+t}}var n=q.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(q[t]||(q[t]={}),mixin(q[t],e,!0,!0)):q[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(P[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=y.makeShimExports(e)),n[t]=e}),q.shim=n),e.packages&&each(e.packages,function(e){var t,n;e="string"==typeof e?{name:e}:e,n=e.name,t=e.location,t&&(q.paths[n]=e.location),q.pkgs[n]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(S,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))}),(e.deps||e.callback)&&y.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,i){function o(n,r,u){var p,l,d;return i.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof n?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(x,n)?x[n](S[t.id]):req.get?req.get(y,n,t,o):(l=a(n,t,!1,!0),p=l.id,hasProp(M,p)?M[p]:c(makeError("notloaded",'Module name "'+p+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(b(),y.nextTick(function(){b(),d=s(a(null,t)),d.skipMap=i.skipMap,d.init(n,r,u,{enabled:!0}),f()}),o)}return i=i||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,i=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return i!==-1&&(!a||i>1)&&(r=e.substring(i,e.length),e=e.substring(0,i)),y.nameToUrl(n(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(M,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(M,e)||hasProp(S,e)}}),t||(o.undef=function(e){p();var n=a(e,t,!0),i=getOwn(S,e);i.undefed=!0,r(e),delete M[e],delete T[n.url],delete O[e],eachReverse(A,function(t,n){t[0]===e&&A.splice(n,1)}),delete y.defQueueMap[e],i&&(i.events.defined&&(O[e]=i.events),l(e))}),o},enable:function(e){var t=getOwn(S,e.id);t&&s(e).enable()},completeLoad:function(e){var t,n,r,o=getOwn(q.shim,e)||{},a=o.exports;for(p();A.length;){if(n=A.shift(),null===n[0]){if(n[0]=e,t)break;t=!0}else n[0]===e&&(t=!0);h(n)}if(y.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(M,e)&&r&&!r.inited){if(!(!q.enforceDefine||a&&getGlobal(a)))return i(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}f()},nameToUrl:function(e,t,n){var r,i,o,a,s,u,c,p=getOwn(q.pkgs,e);if(p&&(e=p),c=getOwn(P,e))return y.nameToUrl(c,t,n);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=q.paths,i=e.split("/"),o=i.length;o>0;o-=1)if(a=i.slice(0,o).join("/"),u=getOwn(r,a)){isArray(u)&&(u=u[0]),i.splice(0,o,u);break}s=i.join("/"),s+=t||(/^data\:|^blob\:|\?/.test(s)||n?"":".js"),s=("/"===s.charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":q.baseUrl)+s}return q.urlArgs&&!/^blob\:/.test(s)?s+q.urlArgs(e,s):s},load:function(e,t){req.load(y,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=m(e);y.completeLoad(t.id)}},onScriptError:function(e){var t=m(e);if(!i(t.id)){var n=[];return eachProp(S,function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return n.push(r),!0})}),c(makeError("scripterror",'Script error for "'+t.id+(n.length?'", needed by: '+n.join(", "):'"'),e,[t.id]))}}},y.require=y.makeRequire(),y}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.3",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,n,r){var i,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=n,n=r):e=[]),o&&o.context&&(a=o.context),i=getOwn(contexts,a),i||(i=contexts[a]=req.s.newContext(a)),o&&i.configure(o),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,n){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,n){var r,i=e&&e.config||{};if(isBrowser)return r=req.createNode(i,t,n),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=n,i.onNodeCreated&&i.onNodeCreated(r,i,t,n),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout(function(){},0),importScripts(n),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||mainScript.indexOf("!")!==-1||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,n){var r,i;"string"!=typeof e&&(n=t,t=e,e=null),isArray(t)||(n=t,t=null),!t&&isFunction(n)&&(t=[],n.length&&(n.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(1===n.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),i?(i.defQueue.push([e,t,n]),i.defQueueMap[e]=!0):globalDefQueue.push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),define("requireLib",function(){}),requirejs.config({baseUrl:"lib",paths:{jquery:"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery",platform:"https://cdnjs.cloudflare.com/ajax/libs/platform/1.3.3/platform",stacktrace:"https://cdnjs.cloudflare.com/ajax/libs/stacktrace.js/1.3.1/stacktrace",jquery_cookie:"https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min",html2canvas:"https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min",ES6Promise:"https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.0.5/es6-promise"}}),"undefined"==typeof Promise&&require(["ES6Promise"],function(e){window.Promise=e}),define("smartbeat",["jquery","platform","stacktrace","html2canvas","jquery_cookie"],function(e,t,n){var r=function(){function r(e,t,n){this.apiKey="",this.version="",this.userId="",this.consoleLogging=!0,this.loggingPriorities=null,this.meta={},this.screenCaptureEnabled=!1,this.enabled=!0,this.captureEnabled=!0,this.platform=e,this.stacktrace=t,this.queue=[],this.pingInterval=null,this.breadcrumbs=[],this.logDelegated=!1,this.lastErrorSent=0,this.lastError=0,this.logData=[],"undefined"!=typeof n&&n?(this.controlEndpoint=n+"/remote",this.apiEndpoint=n+"/errors",this.uploadEndpoint=n+"/upload"):(this.controlEndpoint="https://control.smbeat.jp/api/remote",this.apiEndpoint="https://api.smbeat.jp/api/errors",this.uploadEndpoint="https://api.smbeat.jp/api/upload")}return r.PING_DELAY=216e5,r.REMOTE_DELAY=864e5,r.REMOTE_DELAY_MAX=8*r.REMOTE_DELAY,r.ERROR_RETRY_INTERVAL=3e5,r.MAX_LOG_LENGTH=500,r.MAX_LOG_LENGTH_BYTES=65536,r.MAX_QUEUE_LENGTH=5,r.STORAGE_KEY_PREFIX="_SmartBeat_",r.PLATFORM_NAME="SmartBeat-Web",r.VERSION="1.1.3",r.prototype.enableConsolePassthrough=function(e){this.consoleLogging=e!==!1},r.LOG_LEVEL={ASSERT:"Assert",LOG:"Log",TRACE:"Trace",INFO:"Info",WARN:"Warning",EXCEPTION:"Exception",ERROR:"Error"},r.prototype.enableLoggingPriorities=function(e){"object"==typeof e&&Array.isArray(e)?this.loggingPriorities=e.slice():"string"==typeof e?this.loggingPriorities=[e]:null==e&&(this.loggingPriorities=null)},r.prototype.init=function(e,t,n,i){this.consoleLogging=null==i||i!==!1,window.SmartBeat=this,this.apiKey=e,this.version=t,this.uuid=this.getUuid(),this.appIdentifier=n,this.storageKeyPrefix=r.STORAGE_KEY_PREFIX+e+"_";var o=r.getItem(this.storageKeyPrefix+"queue");null!=o&&(this.queue=JSON.parse(o)),(null==this.queue||!this.queue instanceof Array)&&(this.queue=[]);var a=this,s=console.assert;console.assert=function(e,t){e||null!=a.loggingPriorities&&a.loggingPriorities.indexOf(r.LOG_LEVEL.ASSERT)===-1||a.log(t,r.LOG_LEVEL.ASSERT),a.consoleLogging&&null!=s&&null!=console&&s.apply(console,[e,t])},window.addEventListener?window.addEventListener("error",function(e){var t=a.unhandledException(e.message,e.filename,e.lineno,e.colno,e.error);try{null!=t&&a.screenCaptureEnabled&&a.captureEnabled&&html2canvas(document.body,{onrendered:function(e){a.uploadCapture(t,e)}})}catch(e){}e.stopPropagation&&e.stopPropagation(),!a.consoleLogging&&e.preventDefault&&e.preventDefault()},!0):window.onerror=this.unhandledException,this.checkRemote();var u,c=r.getItem(this.storageKeyPrefix+"lastPing"),p=(new Date).getTime();u=c>p||p-c>r.PING_DELAY?0:c-p+r.PING_DELAY,u<=0&&(u=0),setTimeout(function(){a.sendPing()},u)},r.prototype.delegateLogInternal=function(e,t,n){var r=this;return function(i){r.log(i,n),r.consoleLogging&&"function"==typeof e&&"object"==typeof t&&e.apply(t,[i])}},r.prototype.delegateLog=function(e){this.logDelegated||(this.logDelegated=!0,e.log=this.delegateLogInternal(e.log,e,r.LOG_LEVEL.LOG),e.trace=this.delegateLogInternal(e.trace,e,r.LOG_LEVEL.TRACE),e.info=this.delegateLogInternal(e.info,e,r.LOG_LEVEL.INFO),e.warn=this.delegateLogInternal(e.warn,e,r.LOG_LEVEL.WARN),e.error=this.delegateLogInternal(e.error,e,r.LOG_LEVEL.ERROR))},r.prototype.getUuid=function(){var e,t="_SmartBeat_UUID";return e=r.getItem(t),"undefined"!=typeof e&&null!=e||(e=r.generateUUID(),r.setItem(t,e)),e},r.getItem=function(t){return"undefined"!=typeof window.localStorage&&null!=window.localStorage?window.localStorage.getItem(t):e.cookie(t)},r.setItem=function(t,n,r){r|=730,"undefined"!=typeof window.localStorage&&null!=window.localStorage?window.localStorage.setItem(t,n):e.cookie(t,n,{expires:r})},r.prototype.disableScreenCapture=function(){this.screenCaptureEnabled=!1},r.prototype.enableScreenCapture=function(){this.screenCaptureEnabled=!0},r.prototype.setUser=function(e){this.userId=e},r.prototype.addExtraData=function(e,t){this.meta[e]=t},r.generateUUID=function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})},r.prototype.checkRemote=function(){var n={request:{type:"remote",userId:this.userId,occuredAt:(new Date).getTime()},environment:{uid:this.uuid,model:t.name+" "+t.version,brand:navigator.vendor,appVer:this.version,appVerCode:this.version,appIdentifier:this.appIdentifier,osVer:t.os.toString(),locale:null!=navigator.language?navigator.language:null!=navigator.browserLanguage?navigator.browserLanguage:"(empty)",optOutCrashLog:!1},sdk:{name:r.PLATFORM_NAME,version:r.VERSION}},i={"X-SmartBeat-Api-Key":this.apiKey},o=this;e.ajax({type:"POST",url:this.controlEndpoint,headers:i,contentType:"application/json; charset=UTF-8",data:JSON.stringify(n),success:function(e,t,n){o.enabled=!e.suppressSdk,o.captureEnabled=!e.suppressCap},error:function(e,t,n){console.error("[SmartBeat] Error querying remote status: "+t+" "+n)},dataType:"json"})},r.prototype.sendPing=function(){var e=Number(r.getItem(this.storageKeyPrefix+"lastPing")),n=(new Date).getTime(),i=this;if(!(e<n&&e+r.PING_DELAY>n)&&this.enabled){null==this.pingInterval&&(this.pingInterval=setInterval(function(){i.sendPing()},r.PING_DELAY+5e3));var o={endpoint:this.apiEndpoint,request:{type:"ping",userId:this.userId,occuredAt:(new Date).getTime()},environment:{uid:this.uuid,model:t.name+" "+t.version,brand:navigator.vendor,appVer:this.version,appVerCode:this.version,appIdentifier:this.appIdentifier,osVer:t.os.toString(),locale:null!=navigator.language?navigator.language:null!=navigator.browserLanguage?navigator.browserLanguage:"(empty)",optOutCrashLog:!1},sdk:{name:r.PLATFORM_NAME,version:r.VERSION}};this.sendApiRequest(o,function(e){"OK"===e.status&&r.setItem(i.storageKeyPrefix+"lastPing",n)})}},r.prototype.uploadCapture=function(e,t){var n=t.toDataURL("image/jpeg",.5);this.uploadCaptureFile(e,n)},r.prototype.uploadCaptureFile=function(t,n){if(this.captureEnabled){var r;r=n.split(",")[0].indexOf("base64")>=0?atob(n.split(",")[1]):unescape(n.split(",")[1]);for(var i=new Uint8Array(r.length),o=0;o<r.length;o++)i[o]=r.charCodeAt(o);var a=new Blob([i],{type:"application/octet-stream"}),s=this,u=t+"_"+(new Date).getTime()+".png",c=new FormData;c.append("screenshot",a,u),e.ajax({url:this.uploadEndpoint,type:"POST",data:c,headers:{"X-SmartBeat-Api-Key":s.apiKey},processData:!1,contentType:!1})}},r.prototype.updateQueue=function(){"undefined"!=typeof window.localStorage&&null!=window.localStorage&&window.localStorage.setItem(this.storageKeyPrefix+"queue",JSON.stringify(this.queue))},r.prototype.sendApiRequest=function(t,n,i){if(null!=t&&this.queue.length<r.MAX_QUEUE_LENGTH&&(this.queue.push([t,0,n,i]),this.updateQueue()),this.queue.length>0&&!this.queueProcessing){var o=this;e(o.queue.slice(0)).each(function(){o.queueProcessing++;var t=this,n={"X-SmartBeat-Api-Key":o.apiKey},i={type:"POST",url:t[0].endpoint,headers:n,contentType:"application/json; charset=UTF-8",data:JSON.stringify(t[0]),success:function(e,n,r){o.queueProcessing--,o.queue.splice(o.queue.indexOf(t),1),o.updateQueue(),o.lastError=0;try{null!=t[2]&&t[2](e,n,r)}catch(e){}},error:function(e,n,r){o.queueProcessing--,console.error("[SmartBeat] Error sending report: "+n+" "+r),console.log(e),t[1]++;try{null!=t[3]&&t[3](e,n,r)}catch(e){}finally{o.lastError=(new Date).getTime()}},dataType:"json"};0===t[1]||o.lastError+r.ERROR_RETRY_INTERVAL<(new Date).getTime()&&t[1]<=3?e.ajax(i):t[1]>3&&o.queue.splice(o.queue.indexOf(t),1)})}},r.prototype.handledException=function(e,t,n,r,i,o,a,s){return this.unhandledException(e,t,n,r,i,o,!0,a,s)},r.prototype.unhandledException=function(e,i,o,a,s,u,c,p,l){if(this.enabled&&!((new Date).getTime()-this.lastErrorSent<2e3)){this.lastErrorSent=(new Date).getTime();var d,f=this;d="undefined"!=typeof u&&u?"unity-exception-report":"exception-report",c="undefined"!=typeof c&&c;var h=document.createElement("div");h.setAttribute("style","height: 1in;left: -100%;position: absolute;top: -100%;width: 1in;"),h.setAttribute("id","_SmartBeat_MeasureDiv"),document.body.appendChild(h);var g=h.offsetHeight;document.body.removeChild(h);var m=r.generateUUID(),b=function(n){var a={endpoint:f.apiEndpoint,request:{type:d,userId:f.userId,requestId:m,occuredAt:(new Date).getTime()},exception:{message:e,location:{file:i,line:o&&o.length>0?o:"0"},stackTrace:n,breadcrumbs:f.breadcrumbs.join("|"),handled:c},performance:{memory:{sysAvail:0,sysLow:0,sysThreshold:0,appPss:0,appAvail:0,appMax:0,appTotal:0}},environment:{uid:f.uuid,model:t.name+" "+t.version,brand:navigator.vendor,appVer:f.version,appVerCode:f.version,wifi:navigator.onLine.toString(),appName:f.appIdentifier,appIdentifier:f.appIdentifier,osVer:t.os.toString(),locale:null!=navigator.language?navigator.language:null!=navigator.browserLanguage?navigator.browserLanguage:"(empty)",customMeta:f.meta,log:{log:f.logData.join("\n"),msFromStart:Math.round(performance.now())},screenWidth:window.screen.width,screenHeight:window.screen.height,screenDpi:g,screenRotation:0,viewportWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),viewportHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0)},sdk:{name:r.PLATFORM_NAME,version:r.VERSION}};null!=l?(a.performance.memory.appPss=l.appUsed,a.performance.memory.appTotal=l.appTotal,a.performance.memory.appAvail=l.appAvail,a.performance.memory.appMax=l.appMax):"undefined"!=typeof window.performance.memory&&null!=window.performance.memory&&(a.performance.memory.appMax=window.performance.memory.jsHeapSizeLimit,a.performance.memory.appTotal=window.performance.memory.totalJSHeapSize,a.performance.memory.appAvail=window.performance.memory.totalJSHeapSize-window.performance.memory.usedJSHeapSize),f.sendApiRequest(a)};if("undefined"!=typeof u&&u&&null!=s)b(s);else{if(null==s||"string"==typeof s&&0===s.length){try{throw new Error(e,i,o,a)}catch(e){s=e}p=2}if("undefined"!=typeof Module&&null!=Module&&(Module.debugSymbols||Module.debugSymbolsUrl))if(!Module.debugSymbolsUrl||Module.debugSymbols){e=demangleError(e);try{throw new Error(e,i,o,a)}catch(e){s=e}p=2,n.fromError(s).then(function(e){return p&&(e=e.slice(p)),e.length>201&&(e=e.slice(0,100).concat("...").concat(e.slice(e.length-101,e.length-1))),e.map(function(e){return"string"==typeof e?e:(e.functionName=demangleSymbol(e.functionName),e.toString())}).join("\n")}).then(b)}else LoadCompressedJS(Module.debugSymbolsUrl,function(){e=demangleError(e);try{throw new Error(e,i,o,a)}catch(e){s=e}p=2,n.fromError(s).then(function(e){return p&&(e=e.slice(p)),e.length>201&&(e=e.slice(0,100).concat("...").concat(e.slice(e.length-101,e.length-1))),e.map(function(e){return"string"==typeof e?e:(e.functionName=demangleSymbol(e.functionName),e.toString())}).join("\n")}).then(b)});else n.fromError(s).then(function(e){return p&&(e=e.slice(p)),e.length>201&&(e=e.slice(0,100).concat("...").concat(e.slice(e.length-101,e.length-1))),e.map(function(e){return e.toString()}).join("\n")}).then(b)}return m}},r.prototype.leaveBreadcrumb=function(e){if(!(null==e||e.length>255))for(this.breadcrumbs.push(e);this.breadcrumbs.length>16||this.breadcrumbs.join("|").length>255;)this.breadcrumbs.shift()},r.prototype.log=function(e,t){if(t||(t=r.LOG_LEVEL.LOG),null==this.loggingPriorities||this.loggingPriorities.indexOf(t)!==-1)for("string"==typeof e?this.logData.push("("+t+") : "+e):this.logData.push("("+t+") : "+JSON.stringify(e));this.logData.length>r.MAX_LOG_LENGTH||this.logData.join("\n").length>r.MAX_LOG_LENGTH_BYTES;)this.logData.shift()},r}();try{return new r(t,n)}catch(e){console.log("[SmartBeat] Exception instantiating API: "+e)}}),window.SmartBeat={init:function(e,t,n,r){require(["smartbeat"],function(i){return i.init(e,t,n,r)})},setUser:function(e){require(["smartbeat"],function(t){return t.setUser(e)})},disableScreenCapture:function(){require(["smartbeat"],function(e){return e.disableScreenCapture()})},enableScreenCapture:function(){require(["smartbeat"],function(e){return e.enableScreenCapture()})},addExtraData:function(e,t){require(["smartbeat"],function(n){return n.addExtraData(e,t)})},handledException:function(e,t,n,r,i,o,a,s){require(["smartbeat"],function(u){return u.handledException(e,t,n,r,i,o,a,s)})},unhandledException:function(e,t,n,r,i,o,a,s,u){require(["smartbeat"],function(c){return c.unhandledException(e,t,n,r,i,o,a,s,u)})},delegateLog:function(e){require(["smartbeat"],function(t){t.delegateLog(e)})},log:function(e,t){require(["smartbeat"],function(n){n.log(e,t)})},enableLoggingPriorities:function(e){require(["smartbeat"],function(t){t.enableLoggingPriorities(e)})},enableConsolePassthrough:function(e){require(["smartbeat"],function(t){t.enableConsolePassthrough(e)})},leaveBreadcrumb:function(e){require(["smartbeat"],function(t){t.leaveBreadcrumb(e)})}};
//# sourceMappingURL=smartbeat-1.1.3.min.js.map