UNPKG

@eclicktech/js-sdk

Version:

The JavaScript browser client library for DataEye

1 lines 150 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).funsdata=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}function r(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var h,c="1.0.3",u=Array.prototype,l=Object.prototype,f=u.slice,p=l.toString,d=l.hasOwnProperty,g=u.forEach,m={},v=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],_={};_.each=function(t,e,r){if(null!==t)if(g&&t.forEach===g)t.forEach(e,r);else if(t.length===+t.length){for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i,t)===m)return}else for(var s in t)if(d.call(t,s)&&e.call(r,t[s],s,t)===m)return},_.extend=function(t){return _.each(f.call(arguments,1),(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},_.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+((r=t.getMilliseconds())<10?"00"+r:r<100?"0"+r:r);var r},_.formatTimeZone=function(t,e){if("number"!=typeof e)return t;var r=t.getTime(),i=6e4*t.getTimezoneOffset();return new Date(r+i+36e5*e)},_.formatJsonString=function(t){try{return JSON.stringify(t,null,8)}catch(e){return JSON.stringify(t)}},_.searchObjDate=function(t,e){(_.check.isObject(t)||_.check.isArray(t))&&_.each(t,(function(r,i){_.check.isObject(r)||_.check.isArray(r)?_.searchObjDate(t[i],e):_.check.isDate(r)&&(t[i]=_.formatDate(_.formatTimeZone(r,e)))}))},_.check={isUndefined:function(t){return void 0===t},isObject:function(t){return"[object Object]"===p.call(t)&&null!==t},isEmptyObject:function(t){if(_.check.isObject(t)){for(var e in t)if(d.call(t,e))return!1;return!0}return!1},isArray:function(t){return"[object Array]"===p.call(t)},isString:function(t){return"[object String]"===p.call(t)},isDate:function(t){return"[object Date]"===p.call(t)},isNumber:function(t){return"[object Number]"===p.call(t)},isBoolean:function(t){return"[object Boolean]"===p.call(t)},isJSONString:function(t){try{JSON.parse(t)}catch(t){return!1}return!0}},_.UUID=(h=function(){for(var t=1*new Date,e=0;t===1*new Date;)e++;return t.toString(16)+e.toString(16)},function(){var t=String(screen.height*screen.width);t=t&&/\d{5,}/.test(t)?t.toString(16):String(31242*Math.random()).replace(".","").slice(0,8);var e=h()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var t,e,r=navigator.userAgent,i=[],n=0;function s(t,e){var r,n=0;for(r=0;r<e.length;r++)n|=i[r]<<8*r;return t^n}for(t=0;t<r.length;t++)e=r.charCodeAt(t),i.unshift(255&e),i.length>=4&&(n=s(n,i),i=[]);return i.length>0&&(n=s(n,i)),n.toString(16)}()+"-"+t+"-"+h();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}),_.UUIDv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},_.getReferrer=function(t){var e=t||document.referrer;return"string"!=typeof e?"referrer exception"+String(e):(0===e.indexOf("https://www.baidu.com/")&&(e=e.split("?")[0]),"string"==typeof(e=e.slice(0,200))?e:"")},_.url=function(){function t(){return new RegExp(/(.*?)\.?([^\.]*?)\.(com|net|org|biz|ws|in|me|co\.uk|co|org\.uk|ltd\.uk|plc\.uk|me\.uk|edu|mil|br\.com|cn\.com|eu\.com|hu\.com|no\.com|qc\.com|sa\.com|se\.com|se\.net|us\.com|uy\.com|ac|co\.ac|gv\.ac|or\.ac|ac\.ac|af|am|as|at|ac\.at|co\.at|gv\.at|or\.at|asn\.au|com\.au|edu\.au|org\.au|net\.au|id\.au|be|ac\.be|adm\.br|adv\.br|am\.br|arq\.br|art\.br|bio\.br|cng\.br|cnt\.br|com\.br|ecn\.br|eng\.br|esp\.br|etc\.br|eti\.br|fm\.br|fot\.br|fst\.br|g12\.br|gov\.br|ind\.br|inf\.br|jor\.br|lel\.br|med\.br|mil\.br|net\.br|nom\.br|ntr\.br|odo\.br|org\.br|ppg\.br|pro\.br|psc\.br|psi\.br|rec\.br|slg\.br|tmp\.br|tur\.br|tv\.br|vet\.br|zlg\.br|br|ab\.ca|bc\.ca|mb\.ca|nb\.ca|nf\.ca|ns\.ca|nt\.ca|on\.ca|pe\.ca|qc\.ca|sk\.ca|yk\.ca|ca|cc|ac\.cn|net\.cn|com\.cn|edu\.cn|gov\.cn|org\.cn|bj\.cn|sh\.cn|tj\.cn|cq\.cn|he\.cn|nm\.cn|ln\.cn|jl\.cn|hl\.cn|js\.cn|zj\.cn|ah\.cn|gd\.cn|gx\.cn|hi\.cn|sc\.cn|gz\.cn|yn\.cn|xz\.cn|sn\.cn|gs\.cn|qh\.cn|nx\.cn|xj\.cn|tw\.cn|hk\.cn|mo\.cn|cn|cx|cz|de|dk|fo|com\.ec|tm\.fr|com\.fr|asso\.fr|presse\.fr|fr|gf|gs|co\.il|net\.il|ac\.il|k12\.il|gov\.il|muni\.il|ac\.in|co\.in|org\.in|ernet\.in|gov\.in|net\.in|res\.in|is|it|ac\.jp|co\.jp|go\.jp|or\.jp|ne\.jp|ac\.kr|co\.kr|go\.kr|ne\.kr|nm\.kr|or\.kr|li|lt|lu|asso\.mc|tm\.mc|com\.mm|org\.mm|net\.mm|edu\.mm|gov\.mm|ms|nl|no|nu|pl|ro|org\.ro|store\.ro|tm\.ro|firm\.ro|www\.ro|arts\.ro|rec\.ro|info\.ro|nom\.ro|nt\.ro|se|si|com\.sg|org\.sg|net\.sg|gov\.sg|sk|st|tf|ac\.th|co\.th|go\.th|mi\.th|net\.th|or\.th|tm|to|com\.tr|edu\.tr|gov\.tr|k12\.tr|net\.tr|org\.tr|com\.tw|org\.tw|net\.tw|ac\.uk|uk\.com|uk\.net|gb\.com|gb\.net|vg|sh|kz|ch|info|ua|gov|name|pro|ie|hk|com\.hk|org\.hk|net\.hk|edu\.hk|us|tk|cd|by|ad|lv|eu\.lv|bz|es|jp|cl|ag|mobi|eu|co\.nz|org\.nz|net\.nz|maori\.nz|iwi\.nz|io|la|md|sc|sg|vc|tw|travel|my|se|tv|pt|com\.pt|edu\.pt|asia|fi|com\.ve|net\.ve|fi|org\.ve|web\.ve|info\.ve|co\.ve|tel|im|gr|ru|net\.ru|org\.ru|hr|com\.hr|ly|xyz)$/)}function e(t,e){var r=t.charAt(0),i=e.split(r);return r===t?i:i[(t=parseInt(t.substring(1),10))<0?i.length+t:t-1]}function r(t,e){for(var r,i=t.charAt(0),n=e.split("&"),s=[],o={},a=[],h=t.substring(1),c=0,u=n.length;c<u;c++)if((s=n[c].match(/(.*?)=(.*)/))||(s=[n[c],n[c],""]),""!==s[1].replace(/\s/g,"")){if(s[2]=(r=s[2]||"",_.decodeURIComponent(r.replace(/\+/g," "))),h===s[1])return s[2];(a=s[1].match(/(.*)\[([0-9]+)\]/))?(o[a[1]]=o[a[1]]||[],o[a[1]][a[2]]=s[2]):o[s[1]]=s[2]}return i===t?o:o[h]}return function(i,n){var s,o={};if("tld?"===i)return t();if(n=n||window.location.toString(),!i)return n;if(i=i.toString(),s=n.match(/^mailto:([^\/].+)/))o.protocol="mailto",o.email=s[1];else{if((s=n.match(/(.*?)\/#\!(.*)/))&&(n=s[1]+s[2]),(s=n.match(/(.*?)#(.*)/))&&(o.hash=s[2],n=s[1]),o.hash&&i.match(/^#/))return r(i,o.hash);if((s=n.match(/(.*?)\?(.*)/))&&(o.query=s[2],n=s[1]),o.query&&i.match(/^\?/))return r(i,o.query);if((s=n.match(/(.*?)\:?\/\/(.*)/))&&(o.protocol=s[1].toLowerCase(),n=s[2]),(s=n.match(/(.*?)(\/.*)/))&&(o.path=s[2],n=s[1]),o.path=(o.path||"").replace(/^([^\/])/,"/$1").replace(/\/$/,""),i.match(/^[\-0-9]+$/)&&(i=i.replace(/^([^\/])/,"/$1")),i.match(/^\//))return e(i,o.path.substring(1));if((s=e("/-1",o.path.substring(1)))&&(s=s.match(/(.*?)\.(.*)/))&&(o.file=s[0],o.filename=s[1],o.fileext=s[2]),(s=n.match(/(.*)\:([0-9]+)$/))&&(o.port=s[2],n=s[1]),(s=n.match(/(.*?)@(.*)/))&&(o.auth=s[1],n=s[2]),o.auth&&(s=o.auth.match(/(.*)\:(.*)/),o.user=s?s[1]:o.auth,o.pass=s?s[2]:void 0),o.hostname=n.toLowerCase(),"."===i.charAt(0))return e(i,o.hostname);t()&&(s=o.hostname.match(t()))&&(o.tld=s[3],o.domain=s[2]?s[2]+"."+s[3]:void 0,o.sub=s[1]||void 0);var a=o.port?":"+o.port:"";o.protocol=o.protocol||window.location.protocol.replace(":",""),o.port=o.port||("https"===o.protocol?"443":"80"),o.protocol=o.protocol||("443"===o.port?"https":"http"),o.basic=o.protocol+"://"+o.hostname+a}return i in o?o[i]:"{}"===i?o:""}}(),_.hashCode=function(t){if("string"!=typeof t)return 0;var e=0;if(0===t.length)return e;for(var r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return e},_.decodeURIComponent=function(t){var e="";try{e=decodeURIComponent(t)}catch(r){e=t}return e},_.encodeURIComponent=function(t){var e="";try{e=encodeURIComponent(t)}catch(r){e=t}return e},_.utf8Encode=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=t.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),null!==a&&(r>e&&(s+=t.substring(e,r)),s+=a,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},_.base64Encode=function(t){var e,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,h=0,c="",u=[];if(!t)return t;t=_.utf8Encode(t);do{e=(s=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,u[h++]=o.charAt(e)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<t.length);switch(c=u.join(""),t.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c},_.cookie={get:function(t){for(var e=t+"=",r=document.cookie.split(";"),i=0;i<r.length;i++){for(var n=r[i];" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return _.decodeURIComponent(n.substring(e.length,n.length))}return null},set:function(t,e,r,i,n){var s="",o="",a="";if(r=null===r?73e3:r,i){var h=_.url("domain",location.href);s=h?"; domain=."+h:""}if(r){var c=new Date;"s"===String(r).slice(-1)?c.setTime(c.getTime()+1e3*Number(String(r).slice(0,-1))):c.setTime(c.getTime()+24*r*60*60*1e3),o="; expires="+c.toGMTString()}n&&(a="; secure");var u=t+"="+encodeURIComponent(e)+o+"; path=/"+s+a;return document.cookie=u,u},remove:function(t,e){_.cookie.set(t,"",-1,e)}},_.localStorage={get:function(t){try{return window.localStorage.getItem(t)}catch(t){_.localStorage.error(t)}},parse:function(t){var e;try{e=JSON.parse(_.localStorage.get(t))||null}catch(t){_.localStorage.error(t)}return e},set:function(t,e){try{window.localStorage.setItem(t,e)}catch(t){_.localStorage.error(t)}},remove:function(t){try{window.localStorage.removeItem(t)}catch(t){_.localStorage.error(t)}},error:function(t){console.error("localStorage error: "+t)},isSupported:function(){var t=!0;try{var e="__funsdatasupport__",r="testIsSupportStorage";_.localStorage.set(e,r),_.localStorage.get(e)!==r&&(t=!1),_.localStorage.remove(e)}catch(e){t=!1}return t}},_.stripEmptyProperties=function(t){var e={};return _.each(t,(function(t,r){_.check.isString(t)&&t.length>0&&(e[r]=t)})),e},_.info={os:function(){var t=navigator.userAgent;return/Windows/i.test(t)?/Phone/.test(t)||/WPDesktop/.test(t)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(t)?"iOS":/Android/.test(t)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Mac/i.test(t)?"Mac OS X":/Linux/.test(t)?"Linux":/CrOS/.test(t)?"Chrome OS":""},browser:function(){var t={type:"",version:""};try{var e=navigator.userAgent.toLowerCase(),r=[];if(null!==e.match(/baidubrowser/)?(t.type="baidu",r.push(/baidubrowser\/([\d.]+)/)):null!==e.match(/bidubrowser/)?(t.type="baidu",r.push(/bidubrowser\/([\d.]+)/)):null!==e.match(/edga/)?(t.type="edge",r.push(/edga\/([\d.]+)/)):null!==e.match(/edgios/)?(t.type="edge",r.push(/edgios\/([\d.]+)/)):null!==e.match(/liebaofast/)?(t.type="liebao",r.push(/liebaofast\/([\d.]+)/)):null!==e.match(/sogoumobilebrowser/)?(t.type="sogou",r.push(/sogoumobilebrowser\/([\d.]+)/)):null!==e.match(/lbbrowser/)?(t.type="liebao",r.push(/lbbrowser\/([\d.]+)/)):null!==e.match(/crios/)?(t.type="chrome",r.push(/crios\/([\d.]+)/)):null!==e.match(/qihoobrowser/)?(t.type="360",r.push(/qihoobrowser\/([\d.]+)/)):null!==e.match(/mxios/)?(t.type="maxthon",r.push(/mxios\/([\d.]+)/)):null!==e.match(/fxios/)?(t.type="firefox",r.push(/fxios\/([\d.\w]+)/)):null!==e.match(/edge/)?(t.type="edge",r.push(/edge\/([\d.]+)/)):null!==e.match(/metasr/)?(t.type="sogou",r.push(/metasr ([\d.]+)/)):null!==e.match(/micromessenger/)?(t.type="micromessenger",r.push(/micromessenger\/([\d.]+)/)):null!==e.match(/mqqbrowser/)?(t.type="qq",r.push(/mqqbrowser\/([\d.]+)/)):null!==e.match(/qqbrowserlite/)?(t.type="qq",r.push(/qqbrowserlite\/([\d.]+)/)):null!==e.match(/tencenttraveler/)?(t.type="qq",r.push(/tencenttraveler\/([\d.]+)/)):null!==e.match(/qqbrowser/)?(t.type="qq",r.push(/qqbrowser\/([\d.]+)/)):null!==e.match(/maxthon/)?(t.type="maxthon",r.push(/maxthon\/([\d.]+)/)):null!==e.match(/ubrowser/)?(t.type="uc",r.push(/ubrowser\/([\d.]+)/)):null!==e.match(/ucbrowser/)?(t.type="uc",r.push(/ucbrowser\/([\d.]+)/)):null!==e.match(/firefox/)?(t.type="firefox",r.push(/firefox\/([\d.]+)/)):null!==e.match(/opera/)?(t.type="opera",r.push(/opera\/([\d.]+)/)):null!==e.match(/opr/)?(t.type="opera",r.push(/opr\/([\d.]+)/)):null!==e.match(/chrome/)?(t.type="chrome",r.push(/chrome\/([\d.]+)/)):null!==e.match(/safari/)?(t.type="safari",r.push(/version\/([\d.]+)/)):null===e.match(/trident/)&&null===e.match(/msie/)||(t.type="ie"),"ie"===t.type){var i=e.match(/trident\/([\d.]+)/)?e.match(/trident\/([\d.]+)/)[1]:"",n=e.match(/msie ([\d.]+)/)?e.match(/msie ([\d.]+)/)[1]:"";""!==i?t.version=String(parseInt(i)+4):""!==n&&(t.version=n)}else r&&(t.version=e.match(r[0])?e.match(r[0])[1]:"")}catch(t){y.w("getting browser info failed due to ",t)}return t},properties:function(){var t=_.info.browser();return _.extend({"#os":_.info.os(),"#lib_version":c,"#lib":"js","#screen_height":screen.height,"#screen_width":screen.width,"#browser":t.type,"#browser_version":t.version,"#system_language":_.check.isString(navigator.languages[1])?navigator.languages[1].toLowerCase():"Value exception","#ua":_.check.isString(navigator.userAgent)?navigator.userAgent.toLowerCase():"Value exception","#utm":_.getUtm()})},pageProperties:function(){var t=_.getReferrer();return _.stripEmptyProperties({"#referrer":t,"#referrer_host":t?_.url("hostname",t):t,"#url":location.href,"#url_path":location.pathname,"#title":document.title})}},_.getUtm=function(){var t={};return _.each(v,(function(e){var r=_.getQueryParam(location.href,e);r.length&&(t[e]=r)})),JSON.stringify(t)},_.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=_.decodeURIComponent(t);var r=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":_.decodeURIComponent(r[1])},_.createString=function(t){for(var e=t,r=Math.random().toString(36).substr(2);r.length<e;)r+=Math.random().toString(36).substr(2);return r=r.substr(0,t)},_.createAesKey=function(){return _.createString(16)},_.generateEncryptyData=function(t,e){if(void 0===e)return t;var r=e.publicKey,i=e.version;if(void 0===r||void 0===i)return t;if("undefined"==typeof CryptoJS||"undefined"==typeof JSEncrypt)return t;var n=_.createAesKey();try{var s=CryptoJS.enc.Utf8.parse(n),o=CryptoJS.enc.Utf8.parse(JSON.stringify(t)),a=CryptoJS.AES.encrypt(o,s,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}).toString(),h=new JSEncrypt;h.setPublicKey(r);var c=h.encrypt(n);return!1===c?(y.w("encryption failed"),t):{pkv:i,ekey:c,payload:a}}catch(t){y.w("encryption failed")}return t},_.paramType=function(t){return Object.prototype.toString.call(t).replace("[object ","").replace("]","")},_.addEvent=function(t,e,r,i){if(document.addEventListener)if("Array"!==this.paramType(t)&&"HTMLCollection"!==this.paramType(t)||!t.length||t===window)t.addEventListener(e,r,i);else for(var n=0;n<t.length;n++)this.addEvent(t[n],e,r,i);else if(t.length&&t!==window)for(var s=0;s<t.length;s++)this.addEvent(t[s],e,r);else t.attachEvent("on"+e,(function(){return r.call(t,window.event)}))},_.getRandom=function(){return(new Date).getTime()+"_"+Math.floor(1e6*Math.random())},_.safeJSONParse=function(t){var e=null;try{e=JSON.parse(t)}catch(e){return t}return e},_.saveObjectVal=function(t,e){_.check.isString(e)||(e=JSON.stringify(e)),_.localStorage.set(t,e)},_.readObjectVal=function(t){var e=_.localStorage.get(t);return e?_.safeJSONParse(e):null},_.indexOf=function(t,e){var r=t.indexOf;if(r)return r.call(t,e);for(var i=0;i<t.length;i++)if(e===t[i])return i;return-1},_.hasEncrypty=function(t){return!!_.check.isObject()&&("undefined"!==t.pkv&&"undefined"!==t.ekey&&"undefined"!==t.payload)},_.addSiteEvent=function(t,e,r,i){function n(t){return t&&(t.preventDefault=n.preventDefault,t.stopPropagation=n.stopPropagation,t._getPath=n._getPath),t}n._getPath=function(){var t;return this.path||this.composedPath&&this.composedPath()||(t=this.target,new s(t)).getParents()};var s=function(t){this.ele=t};n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0};(function(t,e,r){if(void 0===i&&"click"===e&&(i=!0),t&&t.addEventListener)t.addEventListener(e,(function(t){t._getPath=n._getPath,r.call(this,t)}),i);else{var s="on"+e,o=t[s];t[s]=function(t,e,r,i){var s=function(s){if(s=s||n(window.event)){s.target=s.srcElement;var o,a,h=!0;return"function"==typeof r&&(o=r(s)),a=e.call(t,s),"beforeunload"!==i?(!1!==o&&!1!==a||(h=!1),h):void 0}};return s}(t,r,o,e)}}).apply(null,arguments)},_.getURLSearchParams=function(t){for(var e={},r=(t=t||"").substring(1).split("&"),i=0;i<r.length;i++){var n=r[i].indexOf("=");if(-1!==n){var s=r[i].substring(0,n),o=r[i].substring(n+1);s=_.decodeURIComponent(s),o=_.decodeURIComponent(o),e[s]=o}}return e},_.urlParse=function(t){var e=function(t){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==t&&this._parse(t)};return e.prototype.setUrl=function(t){this._parse(t)},e.prototype._initValues=function(){for(var t in this._fields)this._values[t]=""},e.prototype.addQueryString=function(t){if("object"!==a(t))return!1;var e=this._values.QueryString||"";for(var r in t)e=new RegExp(r+"[^&]+").test(e)?e.replace(new RegExp(r+"[^&]+"),r+"="+t[r]):"&"===e.slice(-1)?e+r+"="+t[r]:""===e?r+"="+t[r]:e+"&"+r+"="+t[r];this._values.QueryString=e},e.prototype.getUrl=function(){var t="";return t+=this._values.Origin,t+=this._values.Port?":"+this._values.Port:"",t+=this._values.Path,t+=this._values.QueryString?"?"+this._values.QueryString:"",t+=this._values.Fragment?"#"+this._values.Fragment:""},e.prototype._parse=function(t){this._initValues();var e=this._regex.exec(t);e||y.i("URLParser::_parse -> Invalid URL");var r=t.split("#"),i=r[0],n=r.slice(1).join("#");for(var s in e=this._regex.exec(i),this._fields)void 0!==e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=n},new e(t)},_.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},_.URL=function(t){var e,r={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(t){return!1}}())(r=new URL(t)).searchParams||(r.searchParams=(e=_.getURLSearchParams(r.search),{get:function(t){return e[t]}}));else{_.check.isString(t)||(t=String(t)),t=_.trim(t);if(!1===/^https?:\/\/.+/.test(t))return void y.w("Invalid URL");var i=_.urlParse(t);r.hash=i._values.Fragment,r.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",r.href=i._values.URL,r.password=i._values.Password,r.pathname=i._values.Path,r.port=i._values.Port,r.search=i._values.QueryString?"?"+i._values.QueryString:"",r.username=i._values.Username,r.hostname=i._values.Hostname,r.protocol=i._values.Protocol?i._values.Protocol+":":"",r.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",r.searchParams=function(){var t=_.getURLSearchParams("?"+i._values.QueryString);return{get:function(e){return t[e]}}}()}return r},_.normalizeTopLevelKeys=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("object"!==a(t)||null===t||Array.isArray(t))return{};var r={};for(var i in t){if(Object.hasOwnProperty.call(t,i))r[e&&Object.keys(_.info.pageProperties()).includes(i)?i:i.replace(/^#+/,"").toLowerCase()]=t[i]}return r};var y=function(){return r((function e(){t(this,e)}),null,[{key:"i",value:function(){if(!this.showLog)return!1;if(!0!==this.showLog&&"string"!==this.showLog||(arguments[0]=_.formatJsonString(arguments[0])),"object"===("undefined"==typeof console?"undefined":a(console))&&console.log)try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},{key:"w",value:function(){if(!this.showLog)return!1;if(!0!==this.showLog&&"string"!==this.showLog||(arguments[0]=_.formatJsonString(arguments[0])),"object"===("undefined"==typeof console?"undefined":a(console))&&console.warn)try{return console.warn.apply(console,arguments)}catch(t){console.warn(arguments[0])}}}])}(),b=/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/,w=function(){return r((function e(){t(this,e)}),null,[{key:"stripProperties",value:function(t){return _.check.isObject(t)?(_.each(t,(function(t,e){_.check.isString(t)||_.check.isNumber(t)||_.check.isDate(t)||_.check.isBoolean(t)||_.check.isArray(t)||_.check.isObject(t)||y.w("The format of Data-",e,t," does not meet the requirements and may not be stored correctly. The attribute value only supports String, Number, Date, Boolean, Array,Object")})),t):t}},{key:"_checkPropertiesKey",value:function(t){var e=!0;return _.each(t,(function(t,r){b.test(r)||(y.w("invalid key: "+r),e=!1)})),e}},{key:"event",value:function(t){return!(!_.check.isString(t)||!b.test(t))||(y.w("Please check the parameter format, eventName must be an English letter or a string starting with '_', containing letters and numbers with no more than 50 characters: "+t),!1)}},{key:"propertyName",value:function(t){return!(!_.check.isString(t)||!b.test(t))||(y.w("Please check the parameter format, propertyName must be an English letter or a string starting with '_', containing letters and numbers with no more than 50 characters: "+t),!1)}},{key:"properties",value:function(t){return this.stripProperties(t),!t||!!_.check.isObject(t)&&(!!this._checkPropertiesKey(t)||(y.w("Please check the parameter format, the key of properties can only start with a letter, contain numbers, letters and underscores _, and the maximum length is 50 characters"),!1))}},{key:"propertiesMust",value:function(t){return this.stripProperties(t),void 0===t||!_.check.isObject(t)||_.check.isEmptyObject(t)?(y.w("properties must be objects and have values"),!1):!!this._checkPropertiesKey(t)||(y.w("Please check the parameter format, the key of properties can only start with a letter, contain numbers, letters and underscores _, and the maximum length is 50 characters"),!1)}},{key:"userId",value:function(t){return!(!_.check.isString(t)||!/^.{1,63}$/.test(t))||(y.w("User id must be a string that cannot be empty and is less than 64 bits"),!1)}}])}(),S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T,k,E,D,O,A,P,R,C,I,B={},z={},N={};function U(){if(T)return N;T=1;function t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=256,r=286,i=30,n=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=new Array(576);t(c);const u=new Array(60);t(u);const l=new Array(512);t(l);const f=new Array(256);t(f);const p=new Array(29);t(p);const d=new Array(i);function g(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let m,v,_;function y(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const b=t=>t<256?l[t]:l[256+(t>>>7)],w=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},S=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},x=(t,e,r)=>{S(t,r[2*e],r[2*e+1])},k=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},E=(t,e,r)=>{const i=new Array(16);let s,o,a=0;for(s=1;s<=n;s++)a=a+r[s-1]<<1,i[s]=a;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=k(i[e]++,e))}},D=t=>{let e;for(e=0;e<r;e++)t.dyn_ltree[2*e]=0;for(e=0;e<i;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},O=t=>{t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=(t,e,r,i)=>{const n=2*e,s=2*r;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[r]},P=(t,e,r)=>{const i=t.heap[r];let n=r<<1;for(;n<=t.heap_len&&(n<t.heap_len&&A(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!A(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i},R=(t,r,i)=>{let n,a,h,c,u=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+u++],n+=(255&t.pending_buf[t.sym_buf+u++])<<8,a=t.pending_buf[t.sym_buf+u++],0===n?x(t,a,r):(h=f[a],x(t,h+e+1,r),c=s[h],0!==c&&(a-=p[h],S(t,a,c)),n--,h=b(n),x(t,h,i),c=o[h],0!==c&&(n-=d[h],S(t,n,c)))}while(u<t.sym_next);x(t,256,r)},C=(t,e)=>{const r=e.dyn_tree,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.elems;let a,h,c,u=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(t.heap[++t.heap_len]=u=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[2*c]=1,t.depth[c]=0,t.opt_len--,s&&(t.static_len-=i[2*c+1]);for(e.max_code=u,a=t.heap_len>>1;a>=1;a--)P(t,r,a);c=o;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],P(t,r,1),h=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=h,r[2*c]=r[2*a]+r[2*h],t.depth[c]=(t.depth[a]>=t.depth[h]?t.depth[a]:t.depth[h])+1,r[2*a+1]=r[2*h+1]=c,t.heap[1]=c++,P(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,i=e.max_code,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,c=e.stat_desc.max_length;let u,l,f,p,d,g,m=0;for(p=0;p<=n;p++)t.bl_count[p]=0;for(r[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)l=t.heap[u],p=r[2*r[2*l+1]+1]+1,p>c&&(p=c,m++),r[2*l+1]=p,l>i||(t.bl_count[p]++,d=0,l>=h&&(d=a[l-h]),g=r[2*l],t.opt_len+=g*(p+d),o&&(t.static_len+=g*(s[2*l+1]+d)));if(0!==m){do{for(p=c-1;0===t.bl_count[p];)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[c]--,m-=2}while(m>0);for(p=c;0!==p;p--)for(l=t.bl_count[p];0!==l;)f=t.heap[--u],f>i||(r[2*f+1]!==p&&(t.opt_len+=(p-r[2*f+1])*r[2*f],r[2*f+1]=p),l--)}})(t,e),E(r,u,t.bl_count)},I=(t,e,r)=>{let i,n,s=-1,o=e[1],a=0,h=7,c=4;for(0===o&&(h=138,c=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++a<h&&n===o||(a<c?t.bl_tree[2*n]+=a:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,s=n,0===o?(h=138,c=3):n===o?(h=6,c=3):(h=7,c=4))},B=(t,e,r)=>{let i,n,s=-1,o=e[1],a=0,h=7,c=4;for(0===o&&(h=138,c=3),i=0;i<=r;i++)if(n=o,o=e[2*(i+1)+1],!(++a<h&&n===o)){if(a<c)do{x(t,n,t.bl_tree)}while(0!=--a);else 0!==n?(n!==s&&(x(t,n,t.bl_tree),a--),x(t,16,t.bl_tree),S(t,a-3,2)):a<=10?(x(t,17,t.bl_tree),S(t,a-3,3)):(x(t,18,t.bl_tree),S(t,a-11,7));a=0,s=n,0===o?(h=138,c=3):n===o?(h=6,c=3):(h=7,c=4)}};let z=!1;const U=(t,e,r,i)=>{S(t,0+(i?1:0),3),O(t),w(t,r),w(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};return N._tr_init=t=>{z||((()=>{let t,e,h,y,b;const w=new Array(16);for(h=0,y=0;y<28;y++)for(p[y]=h,t=0;t<1<<s[y];t++)f[h++]=y;for(f[h-1]=y,b=0,y=0;y<16;y++)for(d[y]=b,t=0;t<1<<o[y];t++)l[b++]=y;for(b>>=7;y<i;y++)for(d[y]=b<<7,t=0;t<1<<o[y]-7;t++)l[256+b++]=y;for(e=0;e<=n;e++)w[e]=0;for(t=0;t<=143;)c[2*t+1]=8,t++,w[8]++;for(;t<=255;)c[2*t+1]=9,t++,w[9]++;for(;t<=279;)c[2*t+1]=7,t++,w[7]++;for(;t<=287;)c[2*t+1]=8,t++,w[8]++;for(E(c,287,w),t=0;t<i;t++)u[2*t+1]=5,u[2*t]=k(t,5);m=new g(c,s,257,r,n),v=new g(u,o,0,i,n),_=new g(new Array(0),a,0,19,7)})(),z=!0),t.l_desc=new y(t.dyn_ltree,m),t.d_desc=new y(t.dyn_dtree,v),t.bl_desc=new y(t.bl_tree,_),t.bi_buf=0,t.bi_valid=0,D(t)},N._tr_stored_block=U,N._tr_flush_block=(t,r,i,n)=>{let s,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let r,i=4093624447;for(r=0;r<=31;r++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*r])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(r=32;r<e;r++)if(0!==t.dyn_ltree[2*r])return 1;return 0})(t)),C(t,t.l_desc),C(t,t.d_desc),a=(t=>{let e;for(I(t,t.dyn_ltree,t.l_desc.max_code),I(t,t.dyn_dtree,t.d_desc.max_code),C(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=s&&(s=o)):s=o=i+5,i+4<=s&&-1!==r?U(t,r,i,n):4===t.strategy||o===s?(S(t,2+(n?1:0),3),R(t,c,u)):(S(t,4+(n?1:0),3),((t,e,r,i)=>{let n;for(S(t,e-257,5),S(t,r-1,5),S(t,i-4,4),n=0;n<i;n++)S(t,t.bl_tree[2*h[n]+1],3);B(t,t.dyn_ltree,e-1),B(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),R(t,t.dyn_ltree,t.dyn_dtree)),D(t),n&&O(t)},N._tr_tally=(t,r,i)=>(t.pending_buf[t.sym_buf+t.sym_next++]=r,t.pending_buf[t.sym_buf+t.sym_next++]=r>>8,t.pending_buf[t.sym_buf+t.sym_next++]=i,0===r?t.dyn_ltree[2*i]++:(t.matches++,r--,t.dyn_ltree[2*(f[i]+e+1)]++,t.dyn_dtree[2*b(r)]++),t.sym_next===t.sym_end),N._tr_align=t=>{S(t,2,3),x(t,256,c),(t=>{16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)},N}function j(){return P?A:(P=1,A={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"})}function L(){return C?R:(C=1,R={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8})}function M(){if(I)return z;I=1;const{_tr_init:t,_tr_stored_block:e,_tr_flush_block:r,_tr_tally:i,_tr_align:n}=U(),s=E?k:(E=1,k=(t,e,r,i)=>{let n=65535&t,s=t>>>16&65535,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{n=n+e[i++]|0,s=s+n|0}while(--o);n%=65521,s%=65521}return n|s<<16}),o=function(){if(O)return D;O=1;const t=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());return D=(e,r,i,n)=>{const s=t,o=n+i;e^=-1;for(let t=n;t<o;t++)e=e>>>8^s[255&(e^r[t])];return~e},D}(),a=j(),{Z_NO_FLUSH:h,Z_PARTIAL_FLUSH:c,Z_FULL_FLUSH:u,Z_FINISH:l,Z_BLOCK:f,Z_OK:p,Z_STREAM_END:d,Z_STREAM_ERROR:g,Z_DATA_ERROR:m,Z_BUF_ERROR:v,Z_DEFAULT_COMPRESSION:_,Z_FILTERED:y,Z_HUFFMAN_ONLY:b,Z_RLE:w,Z_FIXED:S,Z_DEFAULT_STRATEGY:x,Z_UNKNOWN:T,Z_DEFLATED:A}=L(),P=258,R=262,C=42,B=113,N=666,M=(t,e)=>(t.msg=a[e],e),V=t=>2*t-(t>4?9:0),q=t=>{let e=t.length;for(;--e>=0;)t[e]=0},H=t=>{let e,r,i,n=t.w_size;e=t.hash_size,i=e;do{r=t.head[--i],t.head[i]=r>=n?r-n:0}while(--e);e=n,i=e;do{r=t.prev[--i],t.prev[i]=r>=n?r-n:0}while(--e)};let F=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const K=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},Z=(t,e)=>{r(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,K(t.strm)},J=(t,e)=>{t.pending_buf[t.pending++]=e},$=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},W=(t,e,r,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),1===t.state.wrap?t.adler=s(t.adler,e,n,r):2===t.state.wrap&&(t.adler=o(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},G=(t,e)=>{let r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match;const h=t.strstart>t.w_size-R?t.strstart-(t.w_size-R):0,c=t.window,u=t.w_mask,l=t.prev,f=t.strstart+P;let p=c[s+o-1],d=c[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(r=e,c[r+o]===d&&c[r+o-1]===p&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<f);if(i=P-(f-s),s=f-P,i>o){if(t.match_start=e,o=i,i>=a)break;p=c[s+o-1],d=c[s+o]}}}while((e=l[e&u])>h&&0!=--n);return o<=t.lookahead?o:t.lookahead},X=t=>{const e=t.w_size;let r,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-R)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),H(t),i+=e),0===t.strm.avail_in)break;if(r=W(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=F(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=F(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<R&&0!==t.strm.avail_in)},Y=(t,r)=>{let i,n,s,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,c=t.strm.avail_in;do{if(i=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s)break;if(s=t.strm.avail_out-s,n=t.strstart-t.block_start,i>n+t.strm.avail_in&&(i=n+t.strm.avail_in),i>s&&(i=s),i<o&&(0===i&&r!==l||r===h||i!==n+t.strm.avail_in))break;a=r===l&&i===n+t.strm.avail_in?1:0,e(t,0,0,a),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,K(t.strm),n&&(n>i&&(n=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,i-=n),i&&(W(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(0===a);return c-=t.strm.avail_in,c&&(c>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=c&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-c,t.strm.next_in),t.strstart),t.strstart+=c,t.insert+=c>t.w_size-t.insert?t.w_size-t.insert:c),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?4:r!==h&&r!==l&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(W(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,o=s>t.w_size?t.w_size:s,n=t.strstart-t.block_start,(n>=o||(n||r===l)&&r!==h&&0===t.strm.avail_in&&n<=s)&&(i=n>s?s:n,a=r===l&&0===t.strm.avail_in&&i===n?1:0,e(t,t.block_start,i,a),t.block_start+=i,K(t.strm)),a?3:1)},Q=(t,e)=>{let r,n;for(;;){if(t.lookahead<R){if(X(t),t.lookahead<R&&e===h)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=F(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-R&&(t.match_length=G(t,r)),t.match_length>=3)if(n=i(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=F(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=F(t,t.ins_h,t.window[t.strstart+1]);else n=i(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Z(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===l?(Z(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Z(t,!1),0===t.strm.avail_out)?1:2},tt=(t,e)=>{let r,n,s;for(;;){if(t.lookahead<R){if(X(t),t.lookahead<R&&e===h)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=F(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-R&&(t.match_length=G(t,r),t.match_length<=5&&(t.strategy===y||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){s=t.strstart+t.lookahead-3,n=i(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=s&&(t.ins_h=F(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Z(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=i(t,0,t.window[t.strstart-1]),n&&Z(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=i(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===l?(Z(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Z(t,!1),0===t.strm.avail_out)?1:2};function et(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}const rt=[new et(0,0,0,0,Y),new et(4,4,8,4,Q),new et(4,5,16,8,Q),new et(4,6,32,32,Q),new et(4,4,16,16,tt),new et(8,16,32,32,tt),new et(8,16,128,128,tt),new et(8,32,128,256,tt),new et(32,128,258,1024,tt),new et(32,258,258,4096,tt)];function it(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),q(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const nt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==C&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==B&&e.status!==N?1:0},st=e=>{if(nt(e))return M(e,g);e.total_in=e.total_out=0,e.data_type=T;const r=e.state;return r.pending=0,r.pending_out=0,r.wrap<0&&(r.wrap=-r.wrap),r.status=2===r.wrap?57:r.wrap?C:B,e.adler=2===r.wrap?0:1,r.last_flush=-2,t(r),p},ot=t=>{const e=st(t);var r;return e===p&&((r=t.state).window_size=2*r.w_size,q(r.head),r.max_lazy_match=rt[r.level].max_lazy,r.good_match=rt[r.level].good_length,r.nice_match=rt[r.level].nice_length,r.max_chain_length=rt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},at=(t,e,r,i,n,s)=>{if(!t)return g;let o=1;if(e===_&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>9||r!==A||i<8||i>15||e<0||e>9||s<0||s>S||8===i&&1!==o)return M(t,g);8===i&&(i=9);const a=new it;return t.state=a,a.strm=t,a.status=C,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=s,a.method=r,ot(t)};return z.deflateInit=(t,e)=>at(t,e,A,15,8,x),z.deflateInit2=at,z.deflateReset=ot,z.deflateResetKeep=st,z.deflateSetHeader=(t,e)=>nt(t)||2!==t.state.wrap?g:(t.state.gzhead=e,p),z.deflate=(t,r)=>{if(nt(t)||r>f||r<0)return t?M(t,g):g;const s=t.state;if(!t.output||0!==t.avail_in&&!t.input||s.status===N&&r!==l)return M(t,0===t.avail_out?v:g);const a=s.last_flush;if(s.last_flush=r,0!==s.pending){if(K(t),0===t.avail_out)return s.last_flush=-1,p}else if(0===t.avail_in&&V(r)<=V(a)&&r!==l)return M(t,v);if(s.status===N&&0!==t.avail_in)return M(t,v);if(s.status===C&&0===s.wrap&&(s.status=B),s.status===C){let e=A+(s.w_bits-8<<4)<<8,r=-1;if(r=s.strategy>=b||s.level<2?0:s.level<6?1:6===s.level?2:3,e|=r<<6,0!==s.strstart&&(e|=32),e+=31-e%31,$(s,e),0!==s.strstart&&($(s,t.adler>>>16),$(s,65535&t.adler)),t.adler=1,s.status=B,K(t),0!==s.pending)return s.last_flush=-1,p}if(57===s.status)if(t.adler=0,J(s,31),J(s,139),J(s,8),s.gzhead)J(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),J(s,255&s.gzhead.time),J(s,s.gzhead.time>>8&255),J(s,s.gzhead.time>>16&255),J(s,s.gzhead.time>>24&255),J(s,9===s.level?2:s.strategy>=b||s.level<2?4:0),J(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(J(s,255&s.gzhead.extra.length),J(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=o(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69;else if(J(s,0),J(s,0),J(s,0),J(s,0),J(s,0),J(s,9===s.level?2:s.strategy>=b||s.level<2?4:0),J(s,3),s.status=B,K(t),0!==s.pending)return s.last_flush=-1,p;if(69===s.status){if(s.gzhead.extra){let e=s.pending,r=(65535&s.gzhead.extra.length)-s.gzindex;for(;s.pending+r>s.pending_buf_size;){let i=s.pending_buf_size-s.pending;if(s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex,s.gzindex+i),s.pending),s.pending=s.pending_buf_size,s.gzhead.hcrc&&s.pending>e&&(t.adler=o(t.adler,s.pending_buf,s.pending-e,e)),s.gzindex+=i,K(t),0!==s.pending)return s.last_flush=-1,p;e=0,r-=i}let i=new Uint8Array(s.gzhead.extra);s.pending_buf.set(i.subarray(s.gzindex,s.gzindex+r),s.pending),s.pending+=r,s.gzhead.hcrc&&s.pending>e&&(t.adler=o(t.adler,s.pending_buf,s.pending-e,e)),s.gzindex=0}s.status=73}if(73===s.status){if(s.gzhead.name){let e,r=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>r&&(t.adler=o(t.adler,s.pending_buf,s.pending-r,r)),K(t),0!==s.pending)return s.last_flush=-1,p;r=0}e=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,J(s,e)}while(0!==e);s.gzhead.hcrc&&s.pending>r&&(t.adler=o(t.adler,s.pending_buf,s.pending-r,r)),s.gzindex=0}s.status=91}if(91===s.status){if(s.gzhead.comment){let e,r=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>r&&(t.adler=o(t.adler,s.pending_buf,s.pending-r,r)),K(t),0!==s.pending)return s.last_flush=-1,p;r=0}e=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,J(s,e)}while(0!==e);s.gzhead.hcrc&&s.pending>r&&(t.adler=o(t.adler,s.pending_buf,s.pending-r,r))}s.status=103}if(103===s.status){if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size&&(K(t),0!==s.pending))return s.last_flush=-1,p;J(s,255&t.adler),J(s,t.adler>>8&255),t.adler=0}if(s.status=B,K(t),0!==s.pending)return s.last_flush=-1,p}if(0!==t.avail_in||0!==s.lookahead||r!==h&&s.status!==N){let o=0===s.level?Y(s,r):s.strategy===b?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(X(t),0===t.lookahead)){if(e===h)return 1;break}if(t.match_length=0,r=i(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Z(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===l?(Z(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Z(t,!1),0===t.strm.avail_out)?1:2})(s,r):s.strategy===w?((t,e)=>{let r,n,s,o;const a=t.window;for(;;){if(t.lookahead<=P){if(X(t),t.lookahead<=P&&e===h)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(s=t.strstart-1,n=a[s],n===a[++s]&&n===a[++s]&&n===a[++s])){o=t.strstart+P;do{}while(n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&s<o);t.match_length=P-(o-s),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=i(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=i(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Z(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===l?(Z(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Z(t,!1),0===t.strm.avail_out)?1:2})(s,r):rt[s.level].func(s,r);if(3!==o&&4!==o||(s.status=N),1===o||3===o)return 0===t.avail_out&&(s.last_flush=-1),p;if(2===o&&(r===c?n(s):r!==f&&(e(s,0,0,!1),r===u&&(q(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),K(t),0===t.avail_out))return s.last_flush=-1,p}return r!==l?p:s.wrap<=0?d:(2===s.wrap?(J(s,255&t.adler),J(s,t.adler>>8&255),J(s,t.adler>>16&255),J(s,t.adler>>24&255),J(s,255&t.total_in),J(s,t.total_in>>8&255),J(s,t.total_in>>16&255),J(s,t.total_in>>24&255)):($(s,t.adler>>>16),$(s,65535&t.adler)),K(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?p:d)},z.deflateEnd=t=>{if(nt(t))return g;const e=t.state.status;return t.state=null,e===B?M(t,m):p},z.deflateSetDictionary=(t,e)=>{let r=e.length;if(nt(t))return g;const i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==C||i.lookahead)return g;if(1===n&&(t.adler=s(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){0===n&&(q(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(r-i.w_size,r),0),e=t,r=i.w_size}const o=t.avail_in,a=t.next_in,h=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,X(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=F(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,X(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=a,t.input=h,t.avail_in=o,i.wrap=n,p},z.deflateInfo="pako deflate (from Nodeca project)",z}var V,q={};var H,F,K,Z,J={};function $(){if(H)return J;H=1;let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const e=new Uint8Array(256);for(let t=0;t<256;t++)e[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;e[254]=e[254]=1,J.string2buf=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,i,n,s,o=t.length,a=0;for(n=0;n<o;n++)r=t.charCodeAt(n),55296==(64512&r)&&n+1<o&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),n++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),s=0,n=0;s<a;n++)r=t.charCodeAt(n),55296==(64512&r)&&n+1<o&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e};return J.buf2string=(r,i)=>{const n=i||r.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(r.subarray(0,i));let s,o;const a=new Array(2*n);for(o=0,s=0;s<n;){let t=r[s++];if(t<128){a[o++]=t;continue}let i=e[t];if(i>4)a[o++]=65533,s+=i-1;else{for(t&=2===i?31:3===i?15:7;i>1&&s<n;)t=t<<6|63&r[s++],i--;i>1?a[o++]=65533:t<65536?a[o++]=t:(t-=65536,a[o++]=55296|t>>10&1023,a[o++]=56320|1023&t)}}return((e,r)=>{if(r<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let i="";for(let t=0;t<r;t++)i+=String.fromCharCode(e[t]);return i})(a,o)},J.utf8border=(t,r)=>{(r=r||t.length)>t.length&&(r=t.length);let i=r-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?r:i+e[t[i]]>r?i:r},J}var W=function(){if(Z)return B;Z=1;const t=M(),e=function(){if(V)return q;V=1;const t=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);return q.assign=function(e){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const i=r.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const r in i)t(i,r)&&(e[r]=i[r])}}return e},q.flattenChunks=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];r.set(n,i),i+=n.length}return r},q}(),r=$(),i=j(),n=K?F:(K=1,F=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,thi