lib/har/viewer/scripts/core/lib.js in har-0.1.0 vs lib/har/viewer/scripts/core/lib.js in har-0.1.1

- old
+ new

@@ -1,2 +1,4 @@ -require.def("core/lib",["core/trace"],function(a){var b={},c=navigator.userAgent.toLowerCase();b.isFirefox=/firefox/.test(c),b.isOpera=/opera/.test(c),b.isWebkit=/webkit/.test(c),b.isSafari=/webkit/.test(c),b.isIE=/msie/.test(c)&&!/opera/.test(c),b.isIE6=/msie 6/i.test(navigator.appVersion),b.browserVersion=(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],b.isIElt8=b.isIE&&b.browserVersion-0<8,b.extend=function d(a,c){var d={};b.append(d,a),b.append(d,c);return d},b.append=function(a,b){for(var c in b)a[c]=b[c];return a},b.bind=function(){var a=b.cloneArray(arguments),c=a.shift(),d=a.shift();return function(){return c.apply(d,b.arrayInsert(b.cloneArray(a),0,arguments))}},b.bindFixed=function(){var a=b.cloneArray(arguments),c=a.shift(),d=a.shift();return function(){return c.apply(d,a)}},b.dispatch=function(b,c,d){for(var e=0;b&&e<b.length;e++){var f=b[e];if(f[c])try{f[c].apply(f,d)}catch(g){a.exception(g)}}},b.dispatch2=function(b,c,d){for(var e=0;e<b.length;e++){var f=b[e];if(f[c])try{var g=f[c].apply(f,d);if(g)return g}catch(h){a.exception(h)}}};var e=Object.prototype.toString,f=/^\s*function(\s+[\w_$][\w\d_$]*)?\s*\(/;b.isArray=function(a){return jQuery.isArray(a)},b.isFunction=function(a){if(!a)return!1;return e.call(a)==="[object Function]"||b.isIE&&typeof a!="string"&&f.test(""+a)},b.isAncestor=function(a,b){for(var c=a;c;c=c.parentNode)if(c==b)return!0;return!1},b.fixEvent=function(a){return jQuery.event.fix(a||window.event)},b.fireEvent=function(a,b){if(document.createEvent){var c=document.createEvent("Events");c.initEvent(b,!0,!1);return!a.dispatchEvent(c)}},b.cancelEvent=function(a){var c=b.fixEvent(a);c.stopPropagation(),c.preventDefault()},b.addEventListener=function(a,b,c,d){d=d||!1,a.addEventListener?a.addEventListener(b,c,d):a.attachEvent("on"+b,c)},b.removeEventListener=function(a,b,c,d){d=d||!1,a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent("on"+b,c)},b.isLeftClick=function(a){return a.button==0&&b.noKeyModifiers(a)},b.noKeyModifiers=function(a){return!a.ctrlKey&&!a.shiftKey&&!a.altKey&&!a.metaKey},b.isControlClick=function(a){return a.button==0&&b.isControl(a)},b.isShiftClick=function(a){return a.button==0&&b.isShift(a)},b.isControl=function(a){return(a.metaKey||a.ctrlKey)&&!a.shiftKey&&!a.altKey},b.isAlt=function(a){return a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey},b.isAltClick=function(a){return a.button==0&&b.isAlt(a)},b.isControlShift=function(a){return(a.metaKey||a.ctrlKey)&&a.shiftKey&&!a.altKey},b.isShift=function(a){return a.shiftKey&&!a.metaKey&&!a.ctrlKey&&!a.altKey},b.inflateRect=function(a,b,c){return{top:a.top-c,left:a.left-b,height:a.height+2*c,width:a.width+2*b}},b.pointInRect=function(a,b,c){return c>=a.top&&c<=a.top+a.height&&b>=a.left&&b<=a.left+a.width},b.cloneArray=function(a,b){var c=[];if(b)for(var d=0;d<a.length;++d)c.push(b(a[d]));else for(var d=0;d<a.length;++d)c.push(a[d]);return c},b.arrayInsert=function(a,b,c){for(var d=0;d<c.length;++d)a.splice(d+b,0,c[d]);return a},b.remove=function(a,b){for(var c=0;c<a.length;++c)if(a[c]==b){a.splice(c,1);return!0}return!1},b.formatSize=function(a){var b=1;b=b>2?2:b,b=b<-1?-1:b;if(b==-1)return a+" B";var c=Math.pow(10,b);return a==-1||a==undefined?"?":a==0?"0":a<1024?a+" B":a<1048576?Math.round(a/1024*c)/c+" KB":Math.round(a/1048576*c)/c+" MB"},b.formatTime=function(a){return a==-1?"-":a<1e3?a+"ms":a<6e4?Math.ceil(a/10)/100+"s":Math.ceil(a/6e4*100)/100+"m"},b.formatNumber=function(a){a+="";var b=a.split("."),c=b[0],d=b.length>1?"."+b[1]:"",e=/(\d+)(\d{3})/;while(e.test(c))c=c.replace(e,"$1 $2");return c+d},b.formatString=function(a){var c=b.cloneArray(arguments),a=c.shift();for(var d=0;d<c.length;d++){var e=c[d].toString();a=a.replace("%S",e)}return a},b.parseISO8601=function(a){var c=b.fromISOString(a);return c?c.getTime():null},b.fromISOString=function(a){if(!a)return null;var b=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,c=new RegExp(b),d=a.toString().match(new RegExp(b));if(!d)return null;var e=new Date;e.setUTCDate(1),e.setUTCFullYear(parseInt(d[1],10)),e.setUTCMonth(parseInt(d[3],10)-1),e.setUTCDate(parseInt(d[5],10)),e.setUTCHours(parseInt(d[7],10)),e.setUTCMinutes(parseInt(d[9],10)),e.setUTCSeconds(parseInt(d[11],10)),d[12]?e.setUTCMilliseconds(parseFloat(d[12])*1e3):e.setUTCMilliseconds(0);if(d[13]!="Z"){var f=d[15]*60+parseInt(d[17],10);f*=d[14]=="-"?-1:1,e.setTime(e.getTime()-f*60*1e3)}return e},b.toISOString=function(a){function b(a,b){b||(b=2);var c=new String(a);while(c.length<b)c="0"+c;return c}var c=a.getUTCFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+"."+b(a.getMilliseconds(),3),d=a.getTimezoneOffset(),e=Math.floor(d/60),f=Math.floor(d%60),g=(d>0?"-":"+")+b(Math.abs(e))+":"+b(Math.abs(f));return c+g},b.getFileName=function(c){try{var d=b.splitURLBase(c);return d.name}catch(e){a.log(unescape(c))}return c},b.getFileExtension=function(a){if(!a)return null;var b=a.indexOf("?");b!=-1&&(a=a.substr(0,b));var c=a.lastIndexOf(".");return a.substr(c+1)},b.splitURLBase=function(a){if(b.isDataURL(a))return b.splitDataURL(a);return b.splitURLTrue(a)},b.isDataURL=function(a){return a&&a.substr(0,5)=="data:"},b.splitDataURL=function(a){var c=a.indexOf(":",3);if(c!=4)return!1;var d=a.indexOf(",",c+1);if(d<c)return!1;var e={encodedContent:a.substr(d+1)},f=a.substr(c+1,d),g=f.split(";");for(var h=0;h<g.length;h++){var i=g[h].split("=");i.length==2&&(e[i[0]]=i[1])}if(e.hasOwnProperty("fileName")){var j=decodeURIComponent(e.fileName),k=b.splitURLTrue(j);if(e.hasOwnProperty("baseLineNumber")){e.path=k.path,e.line=e.baseLineNumber;var l=decodeURIComponent(e.encodedContent.substr(0,200)).replace(/\s*$/,"");e.name="eval->"+l}else e.name=k.name,e.path=k.path}else e.hasOwnProperty("path")||(e.path="data:"),e.hasOwnProperty("name")||(e.name=decodeURIComponent(e.encodedContent.substr(0,200)).replace(/\s*$/,""));return e},b.splitURLTrue=function(a){var b=/:\/{1,3}(.*?)\/([^\/]*?)\/?($|\?.*)/,c=b.exec(a);return c?c[2]?{path:c[1],name:c[2]+c[3]}:{path:c[1],name:c[1]}:{name:a,path:a}},b.getURLParameter=function(a){var b=window.location.search.substring(1),c=b.split("&");for(var d=0;d<c.length;d++){var e=c[d].split("=");if(e[0]==a)return unescape(e[1])}return null},b.getURLParameters=function(a){var b=[],c=window.location.search.substring(1),d=c.split("&");for(var e=0;e<d.length;e++){var f=d[e].split("=");f[0]==a&&b.push(unescape(f[1]))}return b},b.parseURLParams=function(a){var c=a?a.indexOf("?"):-1;if(c==-1)return[];var d=a.substr(c+1),e=d.lastIndexOf("#");e!=-1&&(d=d.substr(0,e));if(!d)return[];return b.parseURLEncodedText(d)},b.parseURLEncodedText=function(a,c){function f(a){try{return decodeURIComponent(a)}catch(b){return decodeURIComponent(unescape(a))}}var d=25e3,e=[];if(a=="")return e;a=a.replace(/\+/g," ");var g=a.split("&");for(var h=0;h<g.length;++h)try{var i=g[h].indexOf("=");if(i!=-1){var j=g[h].substring(0,i),k=g[h].substring(i+1);k.length>d&&!c&&(k=b.$STR("LargeData")),e.push({name:f(j),value:f(k)})}else{var j=g[h];e.push({name:f(j),value:""})}}catch(l){}e.sort(function(a,b){return a.name<=b.name?-1:1});return e},b.getBody=function(a){if(a.body)return a.body;var b=a.getElementsByTagName("body")[0];if(b)return b;return null},b.getHead=function(a){return a.getElementsByTagName("head")[0]},b.getAncestorByClass=function(a,c){for(var d=a;d;d=d.parentNode)if(b.hasClass(d,c))return d;return null},b.$=function(){return b.getElementByClass.apply(this,arguments)},b.getElementByClass=function(a,c){if(!a)return null;var d=b.cloneArray(arguments);d.splice(0,1);for(var e=a.firstChild;e;e=e.nextSibling){var f=b.cloneArray(d);f.unshift(e);if(b.hasClass.apply(this,f))return e;var g=b.getElementByClass.apply(this,f);if(g)return g}return null},b.getElementsByClass=function(a,c){function f(a,c,d){for(var e=a.firstChild;e;e=e.nextSibling){var g=b.cloneArray(c);g.unshift(e),b.hasClass.apply(null,g)&&d.push(e),f(e,c,d)}}if(a.querySelectorAll){var d=b.cloneArray(arguments);d.shift();var e="."+d.join(".");return a.querySelectorAll(e)}var g=[],d=b.cloneArray(arguments);d.shift(),f(a,d,g);return g},b.getChildByClass=function(a){for(var c=1;c<arguments.length;++c){var d=arguments[c],e=a.firstChild;a=null;for(;e;e=e.nextSibling)if(b.hasClass(e,d)){a=e;break}}return a},b.eraseNode=function(a){while(a.lastChild)a.removeChild(a.lastChild)},b.clearNode=function(a){a.innerHTML=""},b.hasClass=function(a,b){if(a&&a.nodeType==1){for(var c=1;c<arguments.length;++c){var b=arguments[c],d=a.className;if(!d||d.indexOf(b+" ")==-1)return!1}return!0}return!1},b.setClass=function(a,c){a&&!b.hasClass(a,c)&&(a.className+=" "+c+" ")},b.removeClass=function(a,b){if(a&&a.className){var c=a.className.indexOf(b);if(c>=0){var d=b.length;a.className=a.className.substr(0,c-1)+a.className.substr(c+d)}}},b.toggleClass=function(a,c){if(b.hasClass(a,c)){b.removeClass(a,c);return!1}b.setClass(a,c);return!0},b.setClassTimed=function(a,c,d){d||(d=1300),a.__setClassTimeout?clearTimeout(a.__setClassTimeout):b.setClass(a,c),a.__setClassTimeout=setTimeout(function(){delete a.__setClassTimeout,b.removeClass(a,c)},d)},b.trim=function(a){return a.replace(/^\s*|\s*$/g,"")},b.wrapText=function(a,c){var d=/[^A-Za-z_$0-9'"-]/,e=[],f=100,g=b.splitLines(a);for(var h=0;h<g.length;++h){var i=g[h];while(i.length>f){var j=d.exec(i.substr(f,100)),k=f+(j?j.index:0),l=i.substr(0,k);i=i.substr(k),c||e.push("<pre>"),e.push(c?l:b.escapeHTML(l)),c||e.push("</pre>")}c||e.push("<pre>"),e.push(c?i:b.escapeHTML(i)),c||e.push("</pre>")}return e.join(c?"\n":"")},b.insertWrappedText=function(a,c,d){c.innerHTML="<pre>"+b.wrapText(a,d)+"</pre>"},b.splitLines=function(a){var b=/\r\n|\r|\n/;if(!a)return[];if(a.split)return a.split(b);var c=a+"",d=c.split(b);return d},b.getPrettyDomain=function(a){var b=/[^:]+:\/{1,3}(www\.)?([^\/]+)/.exec(a);return b?b[2]:""},b.escapeHTML=function(a){function b(a){switch(a){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"'":return"&#39;";case'"':return"&quot;"}return"?"}return String(a).replace(/[<>&"']/g,b)},b.cropString=function(a,c){a=a+"";if(c)var d=c/2;else var d=50;return a.length>c?b.escapeNewLines(a.substr(0,d)+"..."+a.substr(a.length-d)):b.escapeNewLines(a)},b.escapeNewLines=function(a){return a.replace(/\r/g,"\\r").replace(/\n/g,"\\n")},b.cloneJSON=function(b){if(b==null||typeof b!="object")return b;try{var c=b.constructor();for(var d in b)c[d]=this.cloneJSON(b[d]);return c}catch(e){a.exception(e)}return null},b.getOverflowParent=function(a){for(var b=a.parentNode;b;b=b.offsetParent)if(b.scrollHeight>b.offsetHeight)return b},b.getElementBox=function(a){var c={};if(a.getBoundingClientRect){var d=a.getBoundingClientRect(),e=b.isIE?document.body.clientTop||document.documentElement.clientTop:0,f=b.getWindowScrollPosition();c.top=Math.round(d.top-e+f.top),c.left=Math.round(d.left-e+f.left),c.height=Math.round(d.bottom-d.top),c.width=Math.round(d.right-d.left)}else{var g=b.getElementPosition(a);c.top=g.top,c.left=g.left,c.height=a.offsetHeight,c.width=a.offsetWidth}return c},b.getElementPosition=function(a){var b=0,c=0;do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return{left:b,top:c}},b.getWindowSize=function(){var a=0,b=0,c;typeof window.innerWidth=="number"?(a=window.innerWidth,b=window.innerHeight):(c=document.documentElement)&&(c.clientHeight||c.clientWidth)?(a=c.clientWidth,b=c.clientHeight):(c=document.body)&&(c.clientHeight||c.clientWidth)&&(a=c.clientWidth,b=c.clientHeight);return{width:a,height:b}},b.getWindowScrollSize=function(){var a=0,c=0,d;!b.isIEQuiksMode&&(d=document.documentElement)&&(d.scrollHeight||d.scrollWidth)&&(a=d.scrollWidth,c=d.scrollHeight),(d=document.body)&&(d.scrollHeight||d.scrollWidth)&&(d.scrollWidth>a||d.scrollHeight>c)&&(a=d.scrollWidth,c=d.scrollHeight);return{width:a,height:c}},b.getWindowScrollPosition=function(){var a=0,b=0,c;typeof window.pageYOffset=="number"?(a=window.pageYOffset,b=window.pageXOffset):(c=document.body)&&(c.scrollTop||c.scrollLeft)?(a=c.scrollTop,b=c.scrollLeft):(c=document.documentElement)&&(c.scrollTop||c.scrollLeft)&&(a=c.scrollTop,b=c.scrollLeft);return{top:a,left:b}},b.scrollIntoCenterView=function(a,c,d,e){if(a){c||(c=b.getOverflowParent(a));if(!c)return;var f=b.getClientOffset(a);if(!e){var g=f.y-c.scrollTop,h=c.scrollTop+c.clientHeight-(f.y+a.offsetHeight);if(g<0||h<0){var i=f.y-c.clientHeight/2;c.scrollTop=i}}if(!d){var j=f.x-c.scrollLeft,k=c.scrollLeft+c.clientWidth-(f.x+a.clientWidth);if(j<0||k<0){var l=f.x-c.clientWidth/2;c.scrollLeft=l}}}},b.getClientOffset=function(a){function b(a,c,d){var e=a.offsetParent,f=d.getComputedStyle(a,"");a.offsetLeft&&(c.x+=a.offsetLeft+parseInt(f.borderLeftWidth)),a.offsetTop&&(c.y+=a.offsetTop+parseInt(f.borderTopWidth)),e?e.nodeType==1&&b(e,c,d):a.ownerDocument.defaultView.frameElement&&b(a.ownerDocument.defaultView.frameElement,c,a.ownerDocument.defaultView)}var c={x:0,y:0};if(a){var d=a.ownerDocument.defaultView;b(a,c,d)}return c},b.addStyleSheet=function(a,c){if(!a.getElementById(c)){var d=a.createElement("link");d.type="text/css",d.rel="stylesheet",d.href=c,d.setAttribute("id",c);var e=b.getHead(a);e.appendChild(d)}},b.selectElementText=function(a,b,c){var d=window,e=d.document;if(d.getSelection&&e.createRange){var f=d.getSelection(),g=e.createRange();g.setStart(a,b),g.setEnd(a,c),f.removeAllRanges(),f.addRange(g)}else e.body.createTextRange&&(g=e.body.createTextRange(),g.moveToElementText(a),g.select())};return b}) +/* See license.txt for terms of usage */ + +define("core/lib",["core/trace"],function(e){var t={},n=navigator.userAgent.toLowerCase();t.isFirefox=/firefox/.test(n),t.isOpera=/opera/.test(n),t.isWebkit=/webkit/.test(n),t.isSafari=/webkit/.test(n),t.isIE=/msie/.test(n)&&!/opera/.test(n),t.isIE6=/msie 6/i.test(navigator.appVersion),t.browserVersion=(n.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],t.isIElt8=t.isIE&&t.browserVersion-0<8,t.supportsSelectElementText=window.getSelection&&window.document.createRange||window.document.body.createTextRange,t.extend=function(n,r){var i={};return t.append(i,n),t.append(i,r),i},t.append=function(e,t){for(var n in t)e[n]=t[n];return e},t.bind=function(){var e=t.cloneArray(arguments),n=e.shift(),r=e.shift();return function(){return n.apply(r,t.arrayInsert(t.cloneArray(e),0,arguments))}},t.bindFixed=function(){var e=t.cloneArray(arguments),n=e.shift(),r=e.shift();return function(){return n.apply(r,e)}},t.dispatch=function(t,n,r){for(var i=0;t&&i<t.length;i++){var s=t[i];if(s[n])try{s[n].apply(s,r)}catch(o){e.exception(o)}}},t.dispatch2=function(t,n,r){for(var i=0;i<t.length;i++){var s=t[i];if(s[n])try{var o=s[n].apply(s,r);if(o)return o}catch(u){e.exception(u)}}};var r=Object.prototype.toString,i=/^\s*function(\s+[\w_$][\w\d_$]*)?\s*\(/;return t.isArray=function(e){return jQuery.isArray(e)},t.isFunction=function(e){return e?r.call(e)==="[object Function]"||t.isIE&&typeof e!="string"&&i.test(""+e):!1},t.isAncestor=function(e,t){for(var n=e;n;n=n.parentNode)if(n==t)return!0;return!1},t.fixEvent=function(e){return jQuery.event.fix(e||window.event)},t.fireEvent=function(e,t){if(document.createEvent){var n=document.createEvent("Events");return n.initEvent(t,!0,!1),!e.dispatchEvent(n)}},t.cancelEvent=function(e){var n=t.fixEvent(e);n.stopPropagation(),n.preventDefault()},t.addEventListener=function(e,t,n,r){r=r||!1,e.addEventListener?e.addEventListener(t,n,r):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n,r){r=r||!1,e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent("on"+t,n)},t.isLeftClick=function(e){return e.button==0&&t.noKeyModifiers(e)},t.noKeyModifiers=function(e){return!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey},t.isControlClick=function(e){return e.button==0&&t.isControl(e)},t.isShiftClick=function(e){return e.button==0&&t.isShift(e)},t.isControl=function(e){return(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey},t.isAlt=function(e){return e.altKey&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey},t.isAltClick=function(e){return e.button==0&&t.isAlt(e)},t.isControlShift=function(e){return(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey},t.isShift=function(e){return e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey},t.inflateRect=function(e,t,n){return{top:e.top-n,left:e.left-t,height:e.height+2*n,width:e.width+2*t}},t.pointInRect=function(e,t,n){return n>=e.top&&n<=e.top+e.height&&t>=e.left&&t<=e.left+e.width},t.cloneArray=function(e,t){var n=[];if(t)for(var r=0;r<e.length;++r)n.push(t(e[r]));else for(var r=0;r<e.length;++r)n.push(e[r]);return n},t.arrayInsert=function(e,t,n){for(var r=0;r<n.length;++r)e.splice(r+t,0,n[r]);return e},t.remove=function(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return e.splice(n,1),!0;return!1},t.formatSize=function(e){var t=1;t=t>2?2:t,t=t<-1?-1:t;if(t==-1)return e+" B";var n=Math.pow(10,t);return e==-1||e==undefined?"?":e==0?"0":e<1024?e+" B":e<1048576?Math.round(e/1024*n)/n+" KB":Math.round(e/1048576*n)/n+" MB"},t.formatTime=function(e){return e==-1?"-":e<1e3?e+"ms":e<6e4?Math.ceil(e/10)/100+"s":Math.ceil(e/6e4*100)/100+"m"},t.formatNumber=function(e){e+="";var t=e.split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=/(\d+)(\d{3})/;while(i.test(n))n=n.replace(i,"$1 $2");return n+r},t.formatString=function(e){var n=t.cloneArray(arguments),e=n.shift();for(var r=0;r<n.length;r++){var i=n[r].toString();e=e.replace("%S",i)}return e},t.parseISO8601=function(e){var n=t.fromISOString(e);return n?n.getTime():null},t.fromISOString=function(e){if(!e)return null;var t=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,n=new RegExp(t),r=e.toString().match(new RegExp(t));if(!r)return null;var i=new Date;i.setUTCDate(1),i.setUTCFullYear(parseInt(r[1],10)),i.setUTCMonth(parseInt(r[3],10)-1),i.setUTCDate(parseInt(r[5],10)),i.setUTCHours(parseInt(r[7],10)),i.setUTCMinutes(parseInt(r[9],10)),i.setUTCSeconds(parseInt(r[11],10)),r[12]?i.setUTCMilliseconds(parseFloat(r[12])*1e3):i.setUTCMilliseconds(0);if(r[13]!="Z"){var s=r[15]*60+parseInt(r[17],10);s*=r[14]=="-"?-1:1,i.setTime(i.getTime()-s*60*1e3)}return i},t.toISOString=function(e){function t(e,t){t||(t=2);var n=new String(e);while(n.length<t)n="0"+n;return n}var n=e.getUTCFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+t(e.getMilliseconds(),3),r=e.getTimezoneOffset(),i=Math.floor(r/60),s=Math.floor(r%60),o=(r>0?"-":"+")+t(Math.abs(i))+":"+t(Math.abs(s));return n+o},t.getFileName=function(n){try{var r=t.splitURLBase(n);return r.name}catch(i){e.log(unescape(n))}return n},t.getFileExtension=function(e){if(!e)return null;var t=e.indexOf("?");t!=-1&&(e=e.substr(0,t));var n=e.lastIndexOf(".");return e.substr(n+1)},t.splitURLBase=function(e){return t.isDataURL(e)?t.splitDataURL(e):t.splitURLTrue(e)},t.isDataURL=function(e){return e&&e.substr(0,5)=="data:"},t.splitDataURL=function(e){var n=e.indexOf(":",3);if(n!=4)return!1;var r=e.indexOf(",",n+1);if(r<n)return!1;var i={encodedContent:e.substr(r+1)},s=e.substr(n+1,r),o=s.split(";");for(var u=0;u<o.length;u++){var a=o[u].split("=");a.length==2&&(i[a[0]]=a[1])}if(i.hasOwnProperty("fileName")){var f=decodeURIComponent(i.fileName),l=t.splitURLTrue(f);if(i.hasOwnProperty("baseLineNumber")){i.path=l.path,i.line=i.baseLineNumber;var c=decodeURIComponent(i.encodedContent.substr(0,200)).replace(/\s*$/,"");i.name="eval->"+c}else i.name=l.name,i.path=l.path}else i.hasOwnProperty("path")||(i.path="data:"),i.hasOwnProperty("name")||(i.name=decodeURIComponent(i.encodedContent.substr(0,200)).replace(/\s*$/,""));return i},t.splitURLTrue=function(e){var t=/:\/{1,3}(.*?)\/([^\/]*?)\/?($|\?.*)/,n=t.exec(e);return n?n[2]?{path:n[1],name:n[2]+n[3]}:{path:n[1],name:n[1]}:{name:e,path:e}},t.getURLParameter=function(e){var t=window.location.search.substring(1),n=t.split("&");for(var r=0;r<n.length;r++){var i=n[r].split("=");if(i[0]==e)return unescape(i[1])}return null},t.getURLParameters=function(e){var t=[],n=window.location.search.substring(1),r=n.split("&");for(var i=0;i<r.length;i++){var s=r[i].split("=");s[0]==e&&t.push(unescape(s[1]))}return t},t.getHashParameters=function(e){var t=[],n=window.location.hash.substring(1),r=n.split("&");for(var i=0;i<r.length;i++){var s=r[i].split("=");s[0]==e&&t.push(unescape(s[1]))}return t},t.parseURLParams=function(e){var n=e?e.indexOf("?"):-1;if(n==-1)return[];var r=e.substr(n+1),i=r.lastIndexOf("#");return i!=-1&&(r=r.substr(0,i)),r?t.parseURLEncodedText(r):[]},t.parseURLEncodedText=function(e,n){function s(e){try{return decodeURIComponent(e)}catch(t){return decodeURIComponent(unescape(e))}}var r=25e3,i=[];if(e=="")return i;e=e.replace(/\+/g," ");var o=e.split("&");for(var u=0;u<o.length;++u)try{var a=o[u].indexOf("=");if(a!=-1){var f=o[u].substring(0,a),l=o[u].substring(a+1);l.length>r&&!n&&(l=t.$STR("LargeData")),i.push({name:s(f),value:s(l)})}else{var f=o[u];i.push({name:s(f),value:""})}}catch(c){}return i.sort(function(e,t){return e.name<=t.name?-1:1}),i},t.getBody=function(e){if(e.body)return e.body;var t=e.getElementsByTagName("body")[0];return t?t:null},t.getHead=function(e){return e.getElementsByTagName("head")[0]},t.getAncestorByClass=function(e,n){for(var r=e;r;r=r.parentNode)if(t.hasClass(r,n))return r;return null},t.$=function(){return t.getElementByClass.apply(this,arguments)},t.getElementByClass=function(e,n){if(!e)return null;var r=t.cloneArray(arguments);r.splice(0,1);for(var i=e.firstChild;i;i=i.nextSibling){var s=t.cloneArray(r);s.unshift(i);if(t.hasClass.apply(this,s))return i;var o=t.getElementByClass.apply(this,s);if(o)return o}return null},t.getElementsByClass=function(e,n){function s(e,n,r){for(var i=e.firstChild;i;i=i.nextSibling){var o=t.cloneArray(n);o.unshift(i),t.hasClass.apply(null,o)&&r.push(i),s(i,n,r)}}if(e.querySelectorAll){var r=t.cloneArray(arguments);r.shift();var i="."+r.join(".");return e.querySelectorAll(i)}var o=[],r=t.cloneArray(arguments);return r.shift(),s(e,r,o),o},t.getChildByClass=function(e){for(var n=1;n<arguments.length;++n){var r=arguments[n],i=e.firstChild;e=null;for(;i;i=i.nextSibling)if(t.hasClass(i,r)){e=i;break}}return e},t.eraseNode=function(e){while(e.lastChild)e.removeChild(e.lastChild)},t.clearNode=function(e){e.innerHTML=""},t.hasClass=function(e,t){if(!e||e.nodeType!=1)return!1;for(var n=1;n<arguments.length;++n){var t=arguments[n],r=e.className;if(!r||r.indexOf(t+" ")==-1)return!1}return!0},t.setClass=function(e,n){e&&!t.hasClass(e,n)&&(e.className+=" "+n+" ")},t.removeClass=function(e,t){if(e&&e.className){var n=e.className.indexOf(t);if(n>=0){var r=t.length;e.className=e.className.substr(0,n-1)+e.className.substr(n+r)}}},t.toggleClass=function(e,n){return t.hasClass(e,n)?(t.removeClass(e,n),!1):(t.setClass(e,n),!0)},t.setClassTimed=function(e,n,r){r||(r=1300),e.__setClassTimeout?clearTimeout(e.__setClassTimeout):t.setClass(e,n),e.__setClassTimeout=setTimeout(function(){delete e.__setClassTimeout,t.removeClass(e,n)},r)},t.startsWith=function(e,t,n){return n=n||0,e.indexOf(t,n)===n},t.trim=function(e){return e.replace(/^\s*|\s*$/g,"")},t.wrapText=function(e,n){var r=/[^A-Za-z_$0-9'"-]/,i=[],s=100,o=t.splitLines(e);for(var u=0;u<o.length;++u){var a=o[u];while(a.length>s){var f=r.exec(a.substr(s,100)),l=s+(f?f.index:0),c=a.substr(0,l);a=a.substr(l),n||i.push("<pre>"),i.push(n?c:t.escapeHTML(c)),n||i.push("</pre>")}n||i.push("<pre>"),i.push(n?a:t.escapeHTML(a)),n||i.push("</pre>")}return i.join(n?"\n":"")},t.insertWrappedText=function(e,n,r){n.innerHTML="<pre>"+t.wrapText(e,r)+"</pre>"},t.splitLines=function(e){var t=/\r\n|\r|\n/;if(!e)return[];if(e.split)return e.split(t);var n=e+"",r=n.split(t);return r},t.getPrettyDomain=function(e){var t=/^(?!data:)[^:]+:\/{1,3}(www\.)?([^\/]{1,256})/.exec(e);return t?t[2]:""},t.escapeHTML=function(e){function t(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"'":return"&#39;";case'"':return"&quot;"}return"?"}return String(e).replace(/[<>&"']/g,t)},t.cropString=function(e,n){e+="";if(!n)var r=50;else var r=n/2;return e.length>n?t.escapeNewLines(e.substr(0,r)+"..."+e.substr(e.length-r)):t.escapeNewLines(e)},t.escapeNewLines=function(e){return e.replace(/\r/g,"\\r").replace(/\n/g,"\\n")},t.cloneJSON=function(t){if(t==null||typeof t!="object")return t;try{var n=t.constructor();for(var r in t)n[r]=this.cloneJSON(t[r]);return n}catch(i){e.exception(i)}return null},t.getOverflowParent=function(e){for(var t=e.parentNode;t;t=t.offsetParent)if(t.scrollHeight>t.offsetHeight)return t},t.getElementBox=function(e){var n={};if(e.getBoundingClientRect){var r=e.getBoundingClientRect(),i=t.isIE?document.body.clientTop||document.documentElement.clientTop:0,s=t.getWindowScrollPosition();n.top=Math.round(r.top-i+s.top),n.left=Math.round(r.left-i+s.left),n.height=Math.round(r.bottom-r.top),n.width=Math.round(r.right-r.left)}else{var o=t.getElementPosition(e);n.top=o.top,n.left=o.left,n.height=e.offsetHeight,n.width=e.offsetWidth}return n},t.getElementPosition=function(e){var t=0,n=0;do t+=e.offsetLeft,n+=e.offsetTop;while(e=e.offsetParent);return{left:t,top:n}},t.getWindowSize=function(){var e=0,t=0,n;return typeof window.innerWidth=="number"?(e=window.innerWidth,t=window.innerHeight):(n=document.documentElement)&&(n.clientHeight||n.clientWidth)?(e=n.clientWidth,t=n.clientHeight):(n=document.body)&&(n.clientHeight||n.clientWidth)&&(e=n.clientWidth,t=n.clientHeight),{width:e,height:t}},t.getWindowScrollSize=function(){var e=0,n=0,r;return!t.isIEQuiksMode&&(r=document.documentElement)&&(r.scrollHeight||r.scrollWidth)&&(e=r.scrollWidth,n=r.scrollHeight),(r=document.body)&&(r.scrollHeight||r.scrollWidth)&&(r.scrollWidth>e||r.scrollHeight>n)&&(e=r.scrollWidth,n=r.scrollHeight),{width:e,height:n}},t.getWindowScrollPosition=function(){var e=0,t=0,n;return typeof window.pageYOffset=="number"?(e=window.pageYOffset,t=window.pageXOffset):(n=document.body)&&(n.scrollTop||n.scrollLeft)?(e=n.scrollTop,t=n.scrollLeft):(n=document.documentElement)&&(n.scrollTop||n.scrollLeft)&&(e=n.scrollTop,t=n.scrollLeft),{top:e,left:t}},t.scrollIntoCenterView=function(e,n,r,i){if(!e)return;n||(n=t.getOverflowParent(e));if(!n)return;var s=t.getClientOffset(e);if(!i){var o=s.y-n.scrollTop,u=n.scrollTop+n.clientHeight-(s.y+e.offsetHeight);if(o<0||u<0){var a=s.y-n.clientHeight/2;n.scrollTop=a}}if(!r){var f=s.x-n.scrollLeft,l=n.scrollLeft+n.clientWidth-(s.x+e.clientWidth);if(f<0||l<0){var c=s.x-n.clientWidth/2;n.scrollLeft=c}}},t.getClientOffset=function(e){function t(e,n,r){var i=e.offsetParent,s=r.getComputedStyle(e,"");e.offsetLeft&&(n.x+=e.offsetLeft+parseInt(s.borderLeftWidth)),e.offsetTop&&(n.y+=e.offsetTop+parseInt(s.borderTopWidth)),i?i.nodeType==1&&t(i,n,r):e.ownerDocument.defaultView.frameElement&&t(e.ownerDocument.defaultView.frameElement,n,e.ownerDocument.defaultView)}var n={x:0,y:0};if(e){var r=e.ownerDocument.defaultView;t(e,n,r)}return n},t.addStyleSheet=function(e,n){if(e.getElementById(n))return;var r=e.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=n,r.setAttribute("id",n);var i=t.getHead(e);i.appendChild(r)},t.selectElementText=function(e,t,n){var r=window,i=r.document;if(r.getSelection&&i.createRange){var s=r.getSelection(),o=i.createRange();o.setStart(e,t),o.setEnd(e,n),s.removeAllRanges(),s.addRange(o)}else i.body.createTextRange&&(o=i.body.createTextRange(),o.moveToElementText(e),o.select())},t}); \ No newline at end of file