@jctrans-materials/shared 1.0.37-beta.5 → 1.0.37-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Te=function(i,t){return Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])},Te(i,t)},f=function(){return f=Object.assign||function(i){for(var t,e=1,n=arguments.length;n>e;e++)for(var r in t=arguments[e])({}).hasOwnProperty.call(t,r)&&(i[r]=t[r]);return i},f.apply(this,arguments)};function fe(i,t,e,n){return new(e||(e=Promise))(function(r,o){function a(d){try{c(n.next(d))}catch(u){o(u)}}function s(d){try{c(n.throw(d))}catch(u){o(u)}}function c(d){var u;d.done?r(d.value):(u=d.value,u instanceof e?u:new e(function(g){g(u)})).then(a,s)}c((n=n.apply(i,[])).next())})}function ve(i,t){var e,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(d){return(function(u){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||u[0]!==6&&u[0]!==2)){o=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){o.label=u[1];break}if(u[0]===6&&o.label<r[1]){o.label=r[1],r=u;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(u);break}r[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(i,o)}catch(g){u=[6,g],n=0}finally{e=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}})([c,d])}}}function q(i,t,e){if(e||arguments.length===2)for(var n,r=0,o=t.length;o>r;r++)!n&&r in t||(n||(n=[].slice.call(t,0,r)),n[r]=t[r]);return i.concat(n||[].slice.call(t))}var Fe,je,Ge,Me,Se=/^(\.ac\.|\.br\.|\.co\.|\.com\.|\.edu\.|\.gov\.|\.org\.|\.net\.)/,yt=/^[a-zA-Z][a-zA-Z0-9_]{0,99}$/,St=/.+_gdp_session_id_.{36}/;function Ot(i){return i&&i.__esModule&&{}.hasOwnProperty.call(i,"default")?i.default:i}var ne,He,Be,_t=Me?Ge:(Me=1,Ge=typeof Array.from=="function"?Array.from:(je||(je=1,ne=function(i){return typeof i=="function"},He=function(i){var t=(function(e){var n=Number(e);return isNaN(n)?0:n!==0&&isFinite(n)?(n>0?1:-1)*Math.floor(Math.abs(n)):n})(i);return Math.min(Math.max(t,0),9007199254740991)},Be=function(i){var t=i.next();return!t.done&&t},Fe=function(i){var t,e,n,r=this,o=arguments.length>1?arguments[1]:void 0;if(o!==void 0){if(!ne(o))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(t=arguments[2])}var a=(function(h,S){if(h!=null&&S!=null){var p=h[S];if(p==null)return;if(!ne(p))throw new TypeError(p+" is not a function");return p}})(i,(function(h){if(h!=null){if(["string","number","boolean","symbol"].indexOf(typeof h)>-1||typeof Symbol<"u"&&"iterator"in Symbol&&Symbol.iterator in h)return Symbol.iterator;if("@@iterator"in h)return"@@iterator"}})(i));if(a!==void 0){e=ne(r)?Object(new r):[];var s,c,d=a.call(i);if(d==null)throw new TypeError("Array.from requires an array-like or iterable object");for(n=0;;){if(!(s=Be(d)))return e.length=n,e;c=s.value,e[n]=o?o.call(t,c,n):c,n++}}else{var u=Object(i);if(i==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var g,l=He(u.length);for(e=ne(r)?Object(new r(l)):Array(l),n=0;l>n;)g=u[n],e[n]=o?o.call(t,g,n):g,n++;e.length=l}return e}),Fe)),D=function(i){return _(["undefined","null"],P(i))},K=function(i){return P(i)==="string"},Q=function(i){return P(i)==="number"},oe=function(i){return T(Number(i))==="NaN"},k=function(i){return P(i)==="object"&&!D(i)},et=function(i){return P(i)==="regexp"},x=function(i){return _(["function","asyncfunction"],P(i))},N=function(i){return Array.isArray(i)&&P(i)==="array"},Ce=function(i){return P(i)==="date"},pe=function(i){try{return se(i)[0]}catch{return}},he=function(i){try{var t=se(i);return t[t.length-1]}catch{return}},me=function(i,t){return t===void 0&&(t=1),N(i)&&Q(t)?i.slice(t>0?t:1,i.length):i},tt=function(i,t){if(t===void 0&&(t=!1),N(i)){for(var e=0,n=[],r=0,o=i;r<o.length;r++){var a=o[r];a&&!y(a)&&(n[e++]=a),t&&a===0&&(n[e++]=a)}return n}return i},rt=function(i,t){return i[De(i,t)]},De=function(i,t){var e=-1;return N(i)&&i.every(function(n,r){return!t(n)||(e=r,!1)}),e},_=function(i,t){return(P(i)==="array"||P(i)==="string")&&(P(t)==="array"?t.some(function(e){return i.indexOf(e)>=0}):i.indexOf(t)>=0)},se=Ot(_t),T=function(i){return D(i)?"":"".concat(i)},Pe=function(i,t){return typeof i=="string"?i.split(t):i},nt=function(i){if(K(i)){var t=Pe(i,"");return"".concat(pe(t).toLowerCase()).concat(me(t).join(""))}return i},ae=function(i,t){return!!K(i)&&i.slice(0,t.length)===t},Ie=function(i,t){if(K(i)){var e=i.length,n=e;n>e&&(n=e);var r=n;return(n-=t.length)>=0&&i.slice(n,r)===t}return!1},bt={}.hasOwnProperty,ee=function(i,t){return!D(i)&&bt.call(i,t)},C=function(i){return k(i)?Object.keys(i):[]},J=function(i,t){C(i).forEach(function(e){return t(i[e],e)})},it=function(i,t){var e=C(i);return!(!k(i)||!k(t)||e.length!==C(t).length||_(e.map(function(n){return k(i[n])?it(i[n],t[n]):i[n]===t[n]}),!1))},E=function(i,t){if(!k(i))return!1;try{return P(t)==="string"?delete i[t]:P(t)==="array"?t.map(function(e){return delete i[e]}):(et(t)&&C(i).forEach(function(e){t.test(e)&&E(i,e)}),!0)}catch{return!1}},y=function(i){return N(i)?i.length===0:k(i)?C(i).length===0:!i},P=function(i){return{}.toString.call(i).slice(8,-1).toLowerCase()},ot=function(i){if(Ce(i)){var t=function(e){return 10>e?"0"+e:e};return i.getFullYear()+"-"+t(i.getMonth()+1)+"-"+t(i.getDate())+" "+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"."+t(i.getMilliseconds())}return i},kt=Object.freeze({__proto__:null,arrayFrom:se,compact:tt,drop:me,dropWhile:function(i,t){return N(i)?i.filter(function(e){return!t(e)}):i},endsWith:Ie,find:rt,findIndex:De,fixed:function(i,t){return Q(i)?Number(i.toFixed(Q(t)?t:2)):K(i)&&T(Number(i))!=="NaN"?Number(Number(i).toFixed(Q(t)?t:2)):i},forEach:J,formatDate:ot,get:function(i,t,e){var n=i;return k(i)?(t.split(".").forEach(function(r){n=n?n[r]:e}),n):e},has:ee,head:pe,includes:_,isArray:N,isBoolean:function(i){return P(i)==="boolean"},isDate:Ce,isEmpty:y,isEqual:it,isFunction:x,isNaN:oe,isNil:D,isNumber:Q,isObject:k,isRegExp:et,isString:K,keys:C,last:he,lowerFirst:nt,split:Pe,startsWith:ae,toString:T,typeOf:P,unset:E,upperFirst:function(i){if(K(i)){var t=Pe(i,"");return"".concat(pe(t).toUpperCase()).concat(me(t).join(""))}return i}}),Y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var t=16*Math.random()|0;return(i==="x"?t:3&t|8).toString(16)})},m=function(i,t){console.log("%c [GrowingIO]:".concat(i),{info:"color: #3B82F6;",error:"color: #EF4444;",warn:"color: #F59E0B;",success:"color: #10B981;"}[t]||"")},A=function(i){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];try{return i.apply(void 0,t)}catch{return}},O=function(i){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];if(x(i))try{i.apply(void 0,t)}catch(n){m("回调执行失败!".concat(n),"error")}},at=function(i,t){return!(y(i)||D(i)||!i.name||!x(i.method))||(m("插件不合法,跳过加载! ".concat(Q(t)?"index"+t:""),"warn"),!1)},st=function(){var i,t=!!(!((i=window?.navigator)===null||i===void 0)&&i.sendBeacon),e=window.navigator.userAgent;if(e.match(/(iPad|iPhone|iPod)/g)){var n=ut(e);return t&&n>13}return t},ut=function(i){var t=i.toLowerCase().match(/cpu.*os (.*?) like mac os/i);return!t||2>t.length?0:+t[1].split("_").slice(0,2).join(".")},ct=function(){var i=window.navigator.userAgent;return/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(i)&&!/chrome\/(\d+\.\d+)/i.test(i)},gt=function(){return/bot|crawler|spider|scrapy|jiankongbao|slurp|transcoder|networkbench/i.test(navigator.userAgent.toLowerCase())},dt=function(){return typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1},j=function(i,t,e){return t===void 0&&(t=!0),e===void 0&&(e="参数不合法"),m("".concat(t?"调用":"设置"," ").concat(i," 失败,").concat(e,"!"),"warn")},Ee=function(i,t,e,n){n===void 0&&(n={}),document.addEventListener?i.addEventListener(t,e,f(f({},{capture:!0}),n)):i.attachEvent?i.attachEvent("on"+t,e):i["on"+t]=e},V=function(i){return Ie(i,"_gioenc")?i.slice(0,-7):i},we=function(i){return isNaN(Number(i))&&A(function(){return JSON.parse(i)})||i},B=function(i){var t={};return k(i)&&(E(i,"&&sendTo"),J(i,function(e,n){var r=T(n).slice(0,100);k(e)?t[r]=B(e):N(e)?(t[r]=tt(e.slice(0,100),!0),t[r]=t[r].join("||").slice(0,1e3)):Ce(e)?t[r]=ot(e):t[r]=D(e)?"":T(e).slice(0,1e3)})),t},te=function(i){return D(i)||C(i).forEach(function(t){x(i[t])?i[t]=A(function(){return i[t]()}):k(i[t])?E(i,t):N(i[t])||(i[t]=T(i[t]))}),i},Oe=function(){var i,t=window._gio_local_vds||"vds";return(i=window[t])!==null&&i!==void 0?i:{}},Tt=Object.freeze({__proto__:null,addListener:Ee,callError:j,checkPluginItem:at,compareVersion:function(i,t){for(var e=function(g){return g.replace(/\s+/g,"")},n=function(g){return g.replace(/[vV]/g,"")},r=e(n(i)),o=e(n(t)),a=r.split("."),s=o.split("."),c=0;3>c;c++){var d=Number(a[c]),u=Number(s[c]);if(d>u)return 1;if(u>d)return-1;if(!isNaN(d)&&isNaN(u))return 1;if(isNaN(d)&&!isNaN(u))return-1}return 0},consoleText:m,flattenObject:function(i){i===void 0&&(i={});var t=f({},i);return C(t).forEach(function(e){k(t[e])?(C(t[e]).forEach(function(n){t["".concat(e,"_").concat(n)]=T(t[e][n])}),E(t,e)):N(t[e])?(t[e].forEach(function(n,r){k(n)?C(n).forEach(function(o){t["".concat(e,"_").concat(r,"_").concat(o)]=T(n[o])}):t["".concat(e,"_").concat(r)]=T(n)}),E(t,e)):D(t[e])||t[e]===""?E(t,e):t[e]=T(t[e])}),B(t)},getActualKey:V,getDynamicAttributes:te,getGioFunction:function(){var i,t,e,n,r=(t=(i=Oe())===null||i===void 0?void 0:i.namespace)!==null&&t!==void 0?t:"gdp";return x(window[r])?window[r]:(n=(e=window.gdp)!==null&&e!==void 0?e:window.gio)!==null&&n!==void 0?n:function(){}},getIOSVersion:ut,getMainTrackingId:function(){var i;return(i=Oe().trackingId)!==null&&i!==void 0?i:"g0"},getVds:Oe,guid:Y,hashCode:function(i,t){t===void 0&&(t=!1);var e=0;if(y(i)||typeof i=="boolean")return e;for(var n=0;n<i.length;)e=(e<<5)-e+i.charCodeAt(n),e&=e,n++;return t?Math.abs(e):e},isBot:gt,isPromiseSupported:dt,isSafari:ct,limitObject:B,niceCallback:O,niceTry:A,parseStorageValue:we,queryParse:function(i){if(ae(i,"?")||_(i,["=","&"])){var t={},e=[];return ae(i,"?")&&(i=i.substring(1)),i.split("&").forEach(function(n){var r,o=n.split("="),a=o[0],s=(r=o[1])!==null&&r!==void 0?r:"";D(a)||a===""||(t[a]=s,e.push(a))}),f(f({},t),{__GIO_ORDER__:e})}return decodeURIComponent(i)},queryStringify:function(i,t){if(t===void 0&&(t=!1),P(i)==="object"){var e="";return(i.__GIO_ORDER__||C(i)).forEach(function(n){n!=="__GIO_ORDER__"&&ee(i,n)&&(e===""?e=(t?"?":"")+"".concat(n,"=").concat(i[n]):e+="&".concat(n,"=").concat(i[n]))}),e}if(P(i)==="string")return encodeURIComponent(i)},supportBeacon:st}),ze=function(i){return K(i)&&i.length>0||Q(i)&&i>0},We=function(i,t){return K(i)&&!y(i)&&i.match(yt)?t():(m("事件名格式不正确,只能包含数字、字母和下划线,且不能以数字开头,字符总长度不能超过100!","error"),!1)},Pt=["web","wxwv","Android","iOS","minp","alip","baidup","qq","bytedance","kuaishoup","jdp"],Et={gsid:"_gdp_sequence_ids",originalSource:"_gdp_original_source",sentSign:"_gdp_session_id_sent",sessionId:"_gdp_session_id",userId:"_gdp_cs1_gioenc",userKey:"_gdp_user_key_gioenc",gioId:"_gdp_gio_id_gioenc",gqs:"_gdp_query_string_gioenc",abts:"_gdp_abt_sid"},ge={autotrack:{type:"boolean",default:!0},appId:{type:"string",default:""},compress:{type:"boolean",default:!0},cookieDomain:{type:"string",default:""},dataCollect:{type:"boolean",default:!0},debug:{type:"boolean",default:!1},embeddedIgnore:{type:"array",default:[]},embeddedAdapter:{type:"object",default:{circleServerUrl:""}},extraUA:{type:"boolean",default:!0},forceLogin:{type:"boolean",default:!1},idMapping:{type:"boolean",default:!1},enableIdMapping:{type:"boolean",default:!1},gtouchHost:{type:"string",default:""},hashtag:{type:"boolean",default:!1},ignoreFields:{type:"array",default:[]},impressionScale:{type:"number",default:0},originalSource:{type:"boolean",default:!0},packageName:{type:"string",default:""},penetrateHybrid:{type:"boolean",default:!0},performance:{type:"object",default:{monitor:!0,exception:!0}},platform:{type:"string",default:"web"},requestTimeout:{type:"number",default:5e3},rewriteQuery:{type:"boolean",default:!0},sendType:{type:"string",default:"beacon"},serverUrl:{type:"string",default:"https://napi.growingio.com"},sessionExpires:{type:"number",default:30},storageType:{type:"string",default:"cookie"},touch:{type:"boolean",default:!1},trackBot:{type:"boolean",default:!0},trackPage:{type:"boolean",default:!0},version:{type:"string",default:"1.0.0"}},lt=["clearGeneralProps","clearPageAttributes","clearTrackTimer","clearUserId","getABTest","getOption","identify","removeTimer","sendPage","sendVisit","setBeforeSendListener","setGeneralProps","setOption","setPageAttributes","setPageListener","setUserAttributes","setUserId","track","trackTimerEnd","trackTimerPause","trackTimerResume","trackTimerStart"],Qe=q(q(["init","registerPlugins"],["getPlugins","getDeviceId","getUserAgent","updateImpression"],!0),lt,!0),Ue={autotrack:"无埋点采集",dataCollect:"数据采集",dataSourceId:"数据源ID",debug:"调试模式",extraUA:"增强用户代理",forceLogin:"强制登录",hashtag:"哈希解析",serverUrl:"数据上报服务地址"},Ut=["collectImp","enableDebug","enableHT","getVisitorId","send","setAutotrack","setConfig","setDataCollect","setPlatformProfile","setTrackerHost","setTrackerScheme"],At=["screenHeight","screenWidth"];function ue(i){for(var t=1;arguments.length>t;t++){var e=arguments[t];for(var n in e)i[n]=e[n]}return i}var de,W=(function i(t,e){function n(r,o,a){if(typeof document<"u"){typeof(a=ue({},e,a)).expires=="number"&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in a)a[c]&&(s+="; "+c,a[c]!==!0&&(s+="="+a[c].split(";")[0]));return document.cookie=r+"="+t.write(o,r)+s}}return Object.create({set:n,get:function(r){if(typeof document<"u"&&(!arguments.length||r)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var c=o[s].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(a[u]=t.read(d,u),r===u)break}catch{}}return r?a[r]:a}},remove:function(r,o){n(r,"",ue({},o,{expires:-1}))},withAttributes:function(r){return i(this.converter,ue({},this.attributes,r))},withConverter:function(r){return i(ue({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})})({read:function(i){return i[0]==='"'&&(i=i.slice(1,-1)),i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),xt={A:1,a:1,Z:1,z:1,"@":1,"{":1},Ke=function(i){return D(i)?i:A(function(){return"gioenc-".concat(ft(i))})||i},Ne=function(i){return K(i)&&ae(i,"gioenc-")&&A(function(){return ft(i.replace("gioenc-",""))})||i},ft=function(i){return(i=i||"").split("").map(function(t){return xt[t]?t:Ct(t)}).join("")},Ct=function(i){if(/[0-9]/.test(i))return 1^+i;var t=i.charCodeAt(0);return String.fromCharCode(1^t)},Je=function(i){var t=this;this.domain=i,this.getItem=function(e){return we(Ne(W.get(V(e),{domain:t.domain,path:"/"})))},this.setItem=function(e,n,r){var o;o=K(n)?n.length?Ie(e,"_gioenc")?Ke(n):n:"":JSON.stringify(n),W.set(V(e),o,{expires:new Date(r||new Date(new Date().toDateString()).getTime()+3456e7),domain:t.domain,path:"/"})},this.removeItem=function(e){W.remove(V(e),{domain:t.domain,path:"/"})},this.hasItem=function(e){return _(C(W.get()),V(e))},this.getKeys=function(){return C(W.get())},this.type="Cookie"},Dt=function(){this.getItem=function(i){var t=A(function(){return JSON.parse(localStorage.getItem(V(i))||"")})||{};return k(t)&&t.expiredAt>+Date.now()?we(Ne(t.value)):void 0},this.setItem=function(i,t,e){var n=e??+new Date(new Date().getFullYear()+3,new Date().getMonth(),new Date().getDay()).getTime();localStorage.setItem(V(i),JSON.stringify({value:K(t)&&t.length&&Ie(i,"_gioenc")?Ke(t):t,expiredAt:n}))},this.removeItem=function(i){return localStorage.removeItem(V(i))},this.hasItem=function(i){return!!localStorage.getItem(V(i))},this.getKeys=function(){return se(Array(localStorage.length)).map(function(i,t){return localStorage.key(t)})},this.type="localStorage"},ie={},Kt=function(){this.getItem=function(i){var t=A(function(){return JSON.parse(ie[V(i)]||"")});return k(t)&&t.expiredAt>+Date.now()?we(Ne(t.value)):void 0},this.setItem=function(i,t,e){var n=e??+new Date(new Date().getFullYear()+3,new Date().getMonth(),new Date().getDay()).getTime();ie[V(i)]=JSON.stringify({value:K(t)&&t.length?Ke(t):t,expiredAt:n})},this.removeItem=function(i){return E(ie,V(i))},this.hasItem=function(i){return ee(ie,V(i))},this.getKeys=function(){return C(ie)},this.type="memory"},_e=function(i){var t=[];try{var e=i.split("."),n=he(e);if(e.length>=2&&(isNaN(Number(n))||0>Number(n)||Number(n)>255)){var r=".".concat(e.slice(-2).join("."));Se.test(r)?de=r:t.push(r);var o=".".concat(e.slice(-3).join("."));Se.test(o)||_(t,o)||t.push(o);var a=".".concat(e.slice(-4).join("."));Se.test(a)||_(t,a)||t.push(a)}}catch(s){m(s,"error")}return t},Xe=function(i){var t="";return i.some(function(e){return!!le(e)&&(t=e,!0)}),t},le=function(i){try{W.set("gioCookie","yes",{domain:i});var t=!!W.get("gioCookie",{domain:i});return W.remove("gioCookie",{domain:i}),t}catch{return!1}},Nt=function(i){var t,e,n,r=i.storageType,o=i.cookieDomain,a=i.projectId;if(_(["cookie","localstorage"],r)||(r="cookie"),r==="cookie"&&(e=!!(n=navigator.userAgent.indexOf("Electron")>-1||_(["","localhost","127.0.0.1"],window.location.hostname)||!_(["http:","https:"],window.location.protocol)?"":Xe(q(q([],_e(window.location.hostname),!0),[window.location.hostname],!1)))),r==="cookie"&&e){var s=new Je(n);if(o){var c=_e(o),d=Xe(y(c)?[]:q([o],_e(o),!0));d&&le(d)?s.domain=d:m("指定Cookie域无效或无权限,使用默认域!","warn")}t=s}else t=(function(){try{var u=window.localStorage,g="__storage_test__";return u.setItem(g,g),u.removeItem(g),!0}catch{return!1}})()?new Dt:new Kt;return r==="cookie"&&de&&le(de)&&(function(u,g,l){if(g&&le(g)){var h=new Je(g);["".concat(l,"_gdp_session_id"),"gdp_user_id_gioenc","".concat(l,"_gdp_cs1_gioenc"),"".concat(l,"_gdp_user_key_gioenc"),"".concat(l,"_gdp_gio_id_gioenc"),"".concat(l,"_gdp_sequence_ids"),"".concat(l,"_gdp_session_id_sent")].forEach(function(S){var p=h.getItem(S);h.hasItem(S)&&(u.setItem(S,p),h.removeItem(S))}),h=void 0}})(t,de,a),t},vt="ON_COMMIT_REQUEST",pt="ON_COMPOSE_AFTER",Ye="ON_ERROR",Ze="ON_INSTALL",qe="ON_SEND_AFTER",Ae="ON_SEND_BEFORE",$e="OPTION_CHANGE",Ve="OPTION_INITIALIZED",ht="SDK_INITIALIZED",mt="SESSIONID_UPDATE";function qt(i){return fe(this,void 0,void 0,function(){var t,e,n,r,o,a,s,c;return ve(this,function(d){return t=function(u){var g="";return u.bitness==="64"?u.architecture==="x86"?g="x86_64":u.architecture==="arm"&&(g="aarch64"):u.architecture==="arm"&&u.bitness==="32"&&(g="armv7l"),g===""?"X11; CrOS ".concat(u.platformVersion):"X11; CrOS ".concat(g," ").concat(u.platformVersion)},e=function(u){var g,l,h="";return u.architecture==="x86"&&u.bitness==="64"?h="; Win64; x64":u.architecture==="arm"?h="; ARM":u.wow64===!0&&(h="; WOW64"),"Windows NT ".concat((g=u.platformVersion||"10.0",l=new Map([["0.3.0","6.3"],["0.2.0","6.2"],["0.1.0","6.1"]]),l.has(g)?l.get(g):typeof navigator<"u"&&navigator.userAgentData&&navigator.userAgentData.platform==="Windows"&&parseInt(g.split(".")[0],10)>=13?"13.0":"10.0")).concat(h)},n=function(u){var g="Macintosh; Intel Mac OS X ",l=u.platformVersion||"10_15_7";return l.indexOf(".")>-1&&(l=l.split(".").join("_")),g+l},r=function(u){var g="Linux; Android ";return g+=u.platformVersion,u.model&&(g+="; ",g+=u.model),g},o=function(u){return u.architecture||(u.architecture="x86"),u.bitness||(u.bitness="64"),u.model||(u.model=""),u.platform||(u.platform="Windows"),u.platformVersion||(u.platformVersion="10.0"),u.wow64||(u.wow64=!1),u},navigator.userAgentData?(a=!1,c=RegExp("AppleWebKit/537.36 \\(KHTML, like Gecko\\) Chrome/\\d+.\\d+.\\d+.\\d+ (Mobile )?Safari/537.36"),navigator.userAgentData.brands.forEach(function(u){u.brand==="Chromium"&&(a=c.test(navigator.userAgent),s=u.version)}),a&&s&&parseInt(s,10)>=100?[2,new Promise(function(u){var g;(g=navigator.userAgentData)===null||g===void 0||g.getHighEntropyValues(i).then(function(l){var h,S;if(l){var p={platform:(h=navigator.userAgentData)===null||h===void 0?void 0:h.platform,version:s};l=Object.assign(p,l),l=o(l);var v="Mozilla/5.0 (",w=navigator.userAgent;if(/OpenHarmony/.test(w)){var b=w.match(/\(([^)]*OpenHarmony[^)]*)\)/);if(b&&b[1])v+=b[1];else{var I=w.match(/OpenHarmony\s([\d.]+)/),L=I&&I[1]||l.platformVersion||"";v+="Phone; OpenHarmony ".concat(L).trim()}}else _(["Chrome OS","Chromium OS"],l.platform||"")?v+=t(l):l.platform==="Windows"?v+=e(l):l.platform==="macOS"?v+=n(l):l.platform==="Android"?v+=r(l):v+="X11; Linux x86_64";v+=") AppleWebKit/537.36 (KHTML, like Gecko) Chrome/",v+=(function(M,H){var F;return((F=M?.find(function(re){return _(["Google Chrome","Microsoft Edge","Opera","Chromium"],re.brand)}))===null||F===void 0?void 0:F.version)||"".concat(H,".0.0.0")})(l?.fullVersionList,p.version||"100"),!((S=navigator.userAgentData)===null||S===void 0)&&S.mobile&&(v+=" Mobile"),v+=" Safari/537.36";var R=w.indexOf("Safari/537.36");if(R!==-1){var G=R+13,U=w.substring(G);U&&(v+=U)}u(v)}else u("")})})]:[2,Promise.resolve(void 0)]):[2,Promise.resolve(void 0)]})})}var Vt=["architecture","bitness","model","platformVersion","fullVersionList","wow64"],Lt=["model","platformVersion","fullVersionList"];function xe(){return!(typeof navigator>"u"||!navigator.userAgentData||typeof navigator.userAgentData.getHighEntropyValues!="function")}function Rt(i){return fe(this,void 0,void 0,function(){var t,e,n;return ve(this,function(r){switch(r.label){case 0:if(!xe())return[2,""];e=((n=navigator.userAgentData)===null||n===void 0?void 0:n.mobile)||!1,t=e?Lt:Vt,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,qt(q([],t,!0))];case 2:return[2,r.sent()||""];case 3:return r.sent(),[2,""];case 4:return[2]}})})}var be,ke,Z,z=(function(){function i(){}return i.isCompatible=function(){return!(!dt()||!xe())||(i.hasWarnedOnce||(m("当前浏览器/环境不支持获取增强UA","warn"),i.hasWarnedOnce=!0),i.cachedUserAgent="",!1)},i.initialize=function(){return fe(this,void 0,void 0,function(){return ve(this,function(t){return i.initPromise||(i.initPromise=i._doInitialize()),[2,i.initPromise]})})},i._doInitialize=function(){return fe(this,void 0,void 0,function(){var t,e,n,r;return ve(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=new Promise(function(a,s){setTimeout(function(){return s(Error("UA获取超时"))},i.TIMEOUT)}),[4,Promise.race([Rt(),t])];case 1:return e=o.sent(),i.cachedUserAgent=e||"",[3,3];case 2:return n=o.sent(),i.hasWarnedOnce||(r=n instanceof Error?n.message:"未知错误",m("获取增强UA失败: ".concat(r),"warn"),i.hasWarnedOnce=!0),i.cachedUserAgent="",[3,3];case 3:return[2]}})})},i.getUserAgent=function(){return xe()&&i.cachedUserAgent||""},i.isInitializing=function(){return i.initPromise!==null},i.cachedUserAgent=null,i.initPromise=null,i.hasWarnedOnce=!1,i.TIMEOUT=1e3,i})(),Ft=function(i){var t=this;this.growingIO=i,this.main=function(e,n){var r,o,a;n===void 0&&(n=!0),e||(e=t.growingIO.trackingId);var s=t.growingIO,c=s.sdkVersion,d=s.useEmbeddedInherit,u=s.userStore,g=s.dataStore,l=g.currentPage,h=l.path,S=l.query,p=l.title,v=l.getReferralPage,w=g.getTrackerVds(e),b=(r=A(function(){return g.lastPageEvent[e]}))!==null&&r!==void 0?r:{},I={appVersion:w.version,dataSourceId:w.dataSourceId,deviceId:u.getUid(),domain:e===d?w.appId:window.location.host,language:navigator.language,path:h,platform:w.platform,query:S,referralPage:v(e)||"",screenHeight:window.screen.height,screenWidth:window.screen.width,sdkVersion:c,sessionId:u.getSessionId(e),timestamp:+Date.now(),timezoneOffset:new Date().getTimezoneOffset(),title:(a=(o=b.title)!==null&&o!==void 0?o:p)!==null&&a!==void 0?a:A(function(){return document.title.slice(0,255)}),userId:u.getUserId(e)};if(w.idMapping?I.userKey=u.getUserKey(e):I.userKey="",n&&!y(g.generalProps[e])&&(I.attributes=f({},g.generalProps[e]),y(I.attributes)||(I.attributes=B(te(f({},I.attributes))))),n){var L=g.getTrackerVds(t.growingIO.trackingId);if(L&&L.extraUA!==!1){var R=z.getUserAgent();R&&R.trim()&&(I.attributes||(I.attributes={}),I.attributes.$userAgent=R)}}return y(w.ignoreFields)||w.ignoreFields.forEach(function(G){E(I,G)}),d&&e===d&&!y(t.minpExtraParams)&&J(f(f({},I),t.minpExtraParams),function(G,U){var M,H;_(w.embeddedIgnore,U)?(I[U]=(M=w?.originValues[U])!==null&&M!==void 0?M:I[U],U==="domain"&&(I[U]=window.location.host)):I[U]=(H=t.minpExtraParams[U])!==null&&H!==void 0?H:I[U]}),I.trackingId=e,I},this.minpExtraParams={}},jt=function(i){var t,e=this;this.growingIO=i,this.parsePage=function(){var n=e.growingIO.vdsConfig.hashtag,r=location.pathname,o=location.search,a=location.hash,s=a.indexOf("?");e.domain=window.location.host,e.title=document.title.slice(0,255),e.time=+Date.now(),e.path=r,e.query=o,n&&(s>-1?(e.path+=a.slice(0,s),e.query=e.query+"&"+a.slice(s+1)):e.path+=a),e.query&&_(["?","&"],e.query.charAt(0))&&(e.query=e.query.slice(1))},this._getNoHashHref=function(){var n=window.location,r=n.protocol,o=n.host,a=n.pathname,s=n.search;return"".concat(r,"://").concat(o).concat(a).concat(s)},this.getReferralPage=function(n){var r,o,a=e.growingIO.dataStore.lastPageEvent[n];return a?.path===e.path&&((r=a?.query)!==null&&r!==void 0?r:"")===((o=e.query)!==null&&o!==void 0?o:"")?a?.referralPage:a?.path?a?.nextRefferer:document.referrer},this.handlePage=function(){var n=e.growingIO,r=n.vdsConfig.hashtag,o=n.dataStore,a=window.location.href,s=e.lastHref;r||(a=e._getNoHashHref(),s=e.lastNoHashHref),s!==a&&(e.parsePage(),o.initializedTrackingIds.forEach(function(c){o.sendVerifiedPage(c)}))},this.hookHistory=function(){var n=window.history.pushState,r=window.history.replaceState,o=e;n&&A(function(){return window.history.pushState=function(){for(var a=[],s=0;arguments.length>s;s++)a[s]=arguments[s];n.apply(window.history,a),setTimeout(o.handlePage)}}),r&&A(function(){return window.history.replaceState=function(){for(var a=[],s=0;arguments.length>s;s++)a[s]=arguments[s];r.apply(window.history,a),setTimeout(o.handlePage)}}),Ee(window,"popstate",e.handlePage),e.growingIO.vdsConfig.hashtag&&Ee(window,"hashchange",e.handlePage)},this.eventSetPageProps=function(n,r){var o=A(function(){return e.pageProps[n][e.path]});return y(o)?r.attributes:B(f(f({},r.attributes),te(o)))},this.buildPageEvent=function(n,r){var o=e.growingIO.dataStore,a=o.eventContextBuilder,s=o.eventConverter,c=f(f({eventType:"PAGE"},a(n)),{title:e.title,protocolType:location.protocol.substring(0,location.protocol.length-1),referralPage:e.getReferralPage(n),timestamp:e.time});!y(r)&&r.title&&(c.title=r.title),c.attributes=e.eventSetPageProps(n,c),s(c),e.lastHref=window.location.href,e.lastNoHashHref=e._getNoHashHref(),e.lastLocation=f({},window.location)},this.title=(t=A(function(){return document.title.slice(0,255)}))!==null&&t!==void 0?t:"",this.lastLocation=f({},window.location),this.pageListeners={},this.pageProps={}},Gt=function(i){var t,e=this;this.growingIO=i,this.ALLOW_SETTING_KEYS=Object.keys(ge),this.trackTimers={},this.getTrackerVds=function(r){return e.growingIO.trackingId===r?f({},e.growingIO.vdsConfig):void 0},this.getKeyPrefix=function(r){return e.growingIO.vdsConfig.projectId},this.getStorageKey=function(r,o){return"".concat(e.getKeyPrefix(r)).concat(Et[o])},this.getGsid=function(r){var o,a=e.growingIO.storage.getItem(e.getStorageKey(r,"gsid"))||{},s=Number(a.globalKey);return oe(s)||s>=1e9||1>s?(o=1,e.setGsid(r,o)):o=s,o},this.setGsid=function(r,o){var a=oe(Number(o))||o>=1e9||1>o?1:o;e.setSequenceIds(r,a)},this.setSequenceIds=function(r,o){var a=e.getStorageKey(r,"gsid"),s=e.growingIO.storage.getItem(a)||{};s.globalKey=o,e.growingIO.storage.setItem(a,s)},this.initTrackerOptions=function(r){var o=e.initOptions(r);return o.trackingId=r.trackingId,e.growingIO.trackingId=r.trackingId,e.growingIO.vdsConfig=o,window[e.growingIO.vdsName]=o,o},this.initOptions=function(r){var o,a,s,c,d,u,g,l=r.projectId,h=r.dataSourceId,S=r.appId,p={};return e.ALLOW_SETTING_KEYS.forEach(function(v){var w=ge[v].type,b=N(w)?!_(w,P(r[v])):P(r[v])!==w;v!=="platform"||_(Pt,r[v])||(b=!0),b?p[v]=ge[v].default:v==="ignoreFields"?p.ignoreFields=r.ignoreFields.filter(function(I){return _(At,I)}):(p[v]=r[v],_(["dataCollect","autotrack"],v)&&!p[v]&&m("已关闭".concat(Ue[v]),"info"))}),r.host&&m("host字段已废弃,指定上报请求地址请使用 serverUrl!","error"),p.sessionExpires=Math.round(p.sessionExpires),(oe(p.sessionExpires)||1>p.sessionExpires||p.sessionExpires>360)&&(p.sessionExpires=30),p.storageType=p.storageType.toLowerCase(),p.enableIdMapping&&!p.idMapping&&(p.idMapping=!0),E(p,"enableIdMapping"),p.sendType=p.sendType.toLowerCase(),_(["beacon","xhr","image"],p.sendType)||(p.sendType="beacon"),!p.trackBot&&gt()&&(p.dataCollect=!1),!oe(Number(p.requestTimeout))&&p.requestTimeout>0||(p.requestTimeout=5e3),(p.impressionScale>1||0>p.impressionScale)&&(p.impressionScale=0),f(f(f({},(o=window[e.growingIO.vdsName])!==null&&o!==void 0?o:{}),p),{projectId:l,dataSourceId:h,appId:S,performance:{monitor:(s=(a=p.performance)===null||a===void 0?void 0:a.monitor)===null||s===void 0||s,exception:(d=(c=p.performance)===null||c===void 0?void 0:c.exception)===null||d===void 0||d,network:(g=(u=p.performance)===null||u===void 0?void 0:u.network)!==null&&g!==void 0&&g}})},this.setOriginalSource=function(r){var o=e.growingIO,a=o.storage,s=o.userStore,c=a.getItem(e.getStorageKey(r,"sentSign"));if(s.getSessionId(r)!==c&&y(e.getOriginalSource(r))){var d=e.currentPage,u=d.path,g=d.query,l=d.getReferralPage,h={path:u,query:g,referralPage:document.referrer||l(r)};localStorage.setItem(e.getStorageKey(r,"originalSource"),JSON.stringify(h))}},this.getOriginalSource=function(r){return A(function(){return JSON.parse(localStorage.getItem(e.getStorageKey(r,"originalSource")))})},this.setOption=function(r,o,a){var s,c=e.growingIO,d=c.emitter,u=c.userStore,g=e.getTrackerVds(r),l=f({},g);e.updateVdsConfig(r,f(f({},g),((s={})[o]=a,s))),o==="dataCollect"&&l.dataCollect!==a&&(a?u.setSessionId(r,Y()):e.growingIO.clearTrackTimer(r)),d?.emit($e,{trackingId:r,optionName:o,optionValue:a})},this.getOption=function(r,o){var a=e.getTrackerVds(r);return o&&ee(e.growingIO.vdsConfig,o)?ee(a,o)?a[o]:e.growingIO.vdsConfig[o]:y(o)||D(o)?a:void j("getOption > ".concat(o))},this.updateVdsConfig=function(r,o){var a=window[e.growingIO.vdsName];try{r===e.growingIO.trackingId?(e.growingIO.vdsConfig=f(f({},e.growingIO.vdsConfig),o),window[e.growingIO.vdsName]=f(f({},a),e.growingIO.vdsConfig)):(e.growingIO.subInstance[r]=f(f({},e.growingIO.subInstance[r]),o),window[e.growingIO.vdsName].subInstance[r]=f(f({},a.subInstance[r]),e.growingIO.subInstance[r]))}catch(s){m("Internal Error! ".concat(s),"error")}},this.sendVerifiedVisit=function(r,o){var a=e.growingIO,s=a.userStore.getSessionId,c=a.storage.getItem(e.getStorageKey(r,"sentSign")),d=s(r)===c;!o&&d||e.buildVisitEvent(r)},this.sendVerifiedPage=function(r,o){o===void 0&&(o=!1),o&&e.currentPage.parsePage();var a=e.getTrackerVds(r).trackPage,s=e.currentPage,c=s.pageListeners,d=s.path,u=s.query,g=s.title,l=s.buildPageEvent;x(c[r])&&c[r]({path:d,query:u,title:g}),a&&l(r)},this.buildVisitEvent=function(r,o){var a=e.growingIO,s=a.dataStore,c=s.eventContextBuilder,d=s.eventConverter,u=s.currentPage,g=a.emitter,l=a.vdsConfig,h=e.getOriginalSource(r),S=f(f({eventType:"VISIT"},c(r)),{title:u.title,referralPage:document.referrer||e.currentPage.getReferralPage(r),timestamp:u.time-1});l.originalSource&&!D(h)&&(S=f(f({},S),h)),y(o)||J(S,function(p,v){ee(o,v)&&(Q(o[v])?S[v]=o[v]:y(o[v])||(S[v]=o[v]||S[v]))}),g.on(qe,function(p){var v=p.requestData,w=p.trackingId,b=e.growingIO,I=b.userStore,L=b.storage;if(v.eventType==="VISIT"&&r===w){L.setItem(e.getStorageKey(v.trackingId,"sentSign"),v.sessionId),I.setUid(v.deviceId);var R=I.getUserId(w);R&&R===v.userId&&I.setUserId(w,I.getUserId(w));var G=I.getUserKey(w);G&&G===v.userKey&&I.setUserKey(w,I.getUserKey(w));var U=I.getGioId(w);U&&U===v.gioId&&I.setGioId(w,I.getGioId(w)),localStorage.removeItem(e.getStorageKey(w,"originalSource"))}}),d(S)},this.eventConverter=function(r){var o,a,s=e.growingIO.uploader;if(e.getTrackerVds(r.trackingId).dataCollect){r.eventSequenceId=e.getGsid(r.trackingId),r.eventType==="LOGIN_USER_ATTRIBUTES"?E(r,["timezoneOffset","eventSequenceId"]):e.setGsid(r.trackingId,e.getGsid(r.trackingId)+1);var c={};J(r,function(g,l){var h;if(l==="element"){var S=(h=pe(g))!==null&&h!==void 0?h:{};J(S,function(p,v){y(p)&&p!==0||(c[v]=p)})}else(y(g)||D(g))&&g!==0||(c[l]=g)}),(o=e.growingIO.emitter)===null||o===void 0||o.emit(pt,{composedEvent:f({},c),trackingId:r.trackingId});var d=e.beforeSendListener[r.trackingId];if(!y(d)&&x(d)){var u=(a=A(function(){return d(f({},c))}))!==null&&a!==void 0?a:{};k(u)&&!y(u)&&u.eventType&&u.dataSourceId&&(["path","query","title"].forEach(function(g){u[g]&&K(u[g])&&(c[g]=u[g])}),u.attributes&&k(u.attributes)&&(y(u.attributes)?E(c,"attributes"):c.attributes=B(u.attributes)))}s.commitRequest(f(f({},c),{requestId:Y()}))}},this.currentPage=new jt(this.growingIO),this.eventContextBuilderInst=new Ft(this.growingIO),this.eventContextBuilder=(t=this.eventContextBuilderInst)===null||t===void 0?void 0:t.main,this.generalProps={},this.beforeSendListener={},this.lastPageEvent={};var n=this.growingIO.emitter;n?.on(vt,function(r){var o=r.eventData,a=r.trackingId;o.eventType!=="PAGE"&&o.t!=="page"||(e.lastPageEvent[a]=f(f({},o),{nextRefferer:window.location.href}))}),this.initializedTrackingIds=[],n.on(ht,function(r){var o=r.trackingId;e.initializedTrackingIds.push(o)}),n?.on(mt,function(r){var o=r.trackingId;_(e.initializedTrackingIds,o)&&(e.growingIO.uploader.hoardingQueue[o]=[],e.currentPage.parsePage(),e.sendVerifiedVisit(o,!0),e.sendVerifiedPage(o,!0))}),this.growingIO.emitter.on($e,function(r){var o=r.optionName,a=r.optionValue;o==="dataCollect"&&a===!1&&e.initializedTrackingIds.forEach(function(s){return e.growingIO.clearTrackTimer(s)})})},Mt=["gioPerformance"],Ht=(function(i){function t(e){var n=i.call(this,e)||this;return n.growingIO=e,n.growingIO.gioSDKFull=!1,n.pluginsContext={plugins:{}},n}return(function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+n+" is not a constructor or null");function r(){this.constructor=e}Te(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)})(t,i),t})(function(i){var t,e,n,r,o,a,s=this;this.growingIO=i,this.innerPluginInit=function(){var c;Mt.forEach(function(u){var g;return E((g=s.pluginsContext)===null||g===void 0?void 0:g.plugins,u)});var d=C((c=s.pluginsContext)===null||c===void 0?void 0:c.plugins).map(function(u){var g;return(g=s.pluginsContext)===null||g===void 0?void 0:g.plugins[u]});y(d)||s.installAll(d,!0)},this.installAll=function(c,d){d===void 0&&(d=!1),(c||s.pluginItems).forEach(function(u){s.install(u.name,c?u:void 0,d)})},this.install=function(c,d,u){var g,l;u===void 0&&(u=!1);var h=s.growingIO.emitter;try{d&&h.emit(Ze,d);var S=De(s.pluginItems,function(v){return v.name===c}),p={name:nt(c),method:d.method||function(){},options:d.options||{}};return S>-1?(s.pluginItems[S]=p,u||m("重复加载插件 ".concat(c," 或插件重名,已跳过加载!"),"warn")):(s.pluginItems.push(p),u||m("加载插件 ".concat(c),"info"),((g=s.growingIO)===null||g===void 0?void 0:g.plugins)[c]=new d.method(s.growingIO,d.options)),((l=s.growingIO)===null||l===void 0?void 0:l.plugins)[c].options=d.options,!0}catch(v){return s.lifeError(d,v),u||m("插件【".concat(c,"】加载异常 ").concat(v),"error"),!1}},this.uninstall=function(c){var d;return E(s.pluginItems,c),E((d=s.growingIO)===null||d===void 0?void 0:d.plugins,c),c==="gioEmbeddedAdapter"&&(s.growingIO.useEmbeddedInherit=""),c==="gioHybridAdapter"&&(s.growingIO.useHybridInherit=""),!0},this.uninstallAll=function(){s.growingIO.useEmbeddedInherit="",s.growingIO.useHybridInherit="",s.pluginItems.forEach(function(c){return s.uninstall(c.name)})},this.lifeError=function(c,d){s.growingIO.emitter.emit(Ye,{plugin:c,error:d}),m("插件执行错误 ".concat(c.name," ").concat(d),"error")},this.callLifeCycle=function(c,d){s.pluginItems.forEach(function(u){var g=s.growingIO.plugins[u.name]?s.growingIO.plugins[u.name][c]:void 0;if(g&&x(g))try{g(d)}catch(l){s.lifeError(u,l)}})},this.pluginsContext={plugins:{}},this.pluginItems=[],(t=this.growingIO.emitter)===null||t===void 0||t.on(Ze,function(c){return s.callLifeCycle("onInstall",c)}),(e=this.growingIO.emitter)===null||e===void 0||e.on(Ye,function(c){return s.callLifeCycle("onError",c)}),(n=this.growingIO.emitter)===null||n===void 0||n.on("ON_COMPOSE_BEFORE",function(c){return s.callLifeCycle("onComposeBefore",c)}),(r=this.growingIO.emitter)===null||r===void 0||r.on(pt,function(c){return s.callLifeCycle("onComposeAfter",c)}),(o=this.growingIO.emitter)===null||o===void 0||o.on(Ae,function(c){return s.callLifeCycle("onSendBefore",c)}),(a=this.growingIO.emitter)===null||a===void 0||a.on(qe,function(c){return s.callLifeCycle("onSendAfter",c)})}),Bt=function(i){var t=this;this.growingIO=i,this.generateURL=function(e){var n=t.growingIO.dataStore.getTrackerVds(e),r=n.serverUrl,o=n.projectId;return ae(r,"http")?"".concat(r,"/v3/projects/").concat(o,"/collect"):"https://".concat(r,"/v3/projects/").concat(o,"/collect")},this.getSendType=function(e){var n=t.growingIO.dataStore.getTrackerVds(e).sendType;return n==="beacon"?st()?"beacon":"xhr":n},this.getHoardingQueue=function(e){var n;return(n=t.hoardingQueue[e])!==null&&n!==void 0?n:[]},this.commitRequest=function(e){var n,r=t.growingIO,o=r.vdsConfig;r.emitter.emit(vt,{eventData:e,trackingId:e.trackingId});var a=f(f({},e),{requestType:t.getSendType(e.trackingId)});o.forceLogin?(t.hoardingQueue[e.trackingId]||(t.hoardingQueue[e.trackingId]=[]),(n=t.hoardingQueue[e.trackingId])===null||n===void 0||n.push(a)):(t.requestQueue.push(a),t.initiateRequest(e.trackingId))},this.initiateRequest=function(e){var n=t.getHoardingQueue(e);if(q(q([],n,!0),t.requestQueue,!0).length>0&&t.requestingNum<t.requestLimit){var r=t.growingIO.emitter;if(t.requestQueue=q(q([],n,!0),t.requestQueue,!0),t.hoardingQueue[e]=[],y(t.requestQueue))return;var o=t.requestQueue.shift();r?.emit(Ae,{requestData:f({},o),trackingId:o.trackingId})}},this.sendEvent=function(e){var n,r,o=t.growingIO,a=o.vdsConfig,s=o.useHybridInherit,c=o.plugins,d=f({},e),u=t.generateURL(e.trackingId);if(E(d,["requestType","trackingId","requestId"]),a.debug&&console.log("[GrowingIO Debug]:",JSON.stringify(d,null,2).replace(/"/g,ct()?"":'"')),t.requestingNum+=1,s===e.trackingId)return t.requestSuccessFn(e),!1;var g,l=f({},d);a.compress&&c?.gioCompress?e.requestType==="image"?(g="11",l=(n=c?.gioCompress)===null||n===void 0?void 0:n.compressToEncodedURIComponent(JSON.stringify([l]))):(g="1",l=(r=c?.gioCompress)===null||r===void 0?void 0:r.compressToUint8Array(JSON.stringify([l]))):(g="0",l=JSON.stringify([l]));var h="".concat(u,"?stm=").concat(+Date.now(),"&compress=").concat(g);switch(e.requestType){case"beacon":default:t.sendByBeacon(e,l,h);break;case"xhr":t.sendByXHR(e,l,h);break;case"image":t.sendByImage(e,l,h)}},this.sendByBeacon=function(e,n,r){navigator.sendBeacon(r,n)?t.requestSuccessFn(e):t.requestFailFn(e,"xhr")},this.sendByXHR=function(e,n,r){var o=t.growingIO.dataStore.getTrackerVds(e.trackingId).requestTimeout,a=new XMLHttpRequest;if(a)return a.open("POST",r,!0),a.onload=function(){a.status===204?t.requestSuccessFn(e):t.requestFailFn(e,"image")},a.ontimeout=a.onerror=a.onabort=function(){t.requestFailFn(e,"image")},a.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),a.timeout=o,void a.send(n);if(window?.XDomainRequest){var s=new window.XDomainRequest;s.open("POST",r.replace("https://","http://"),!0),s.onload=function(){s.status===204?t.requestSuccessFn(e):t.requestFailFn(e,"image")},s.onerror=s.ontimeout=function(){t.requestFailFn(e,"image")},s.send(n)}},this.sendByImage=function(e,n,r){var o=t.growingIO.dataStore.getTrackerVds(e.trackingId).requestTimeout,a="".concat(r,"&data=").concat(n),s=document.createElement("img");s.width=1,s.height=1;var c=window.setTimeout(function(){t.requestingNum-=1,t.clearImage(s),window.clearTimeout(c),c=null,t.initiateRequest(e.trackingId)},o);s.onload=function(){t.requestSuccessFn(e),t.clearImage(s),window.clearTimeout(c),c=null},s.onerror=s.onabort=function(){t.requestSuccessFn(e),t.clearImage(s),window.clearTimeout(c),c=null},s.src=a},this.clearImage=function(e){e.src="",e.onload=function(){},e.onerror=e.onerabort=function(){},e=null},this.requestSuccessFn=function(e){var n;t.requestingNum-=1;var r=t.growingIO.userStore.getSessionId(e.trackingId);r===e.sessionId&&t.growingIO.userStore.setSessionId(e.trackingId,r),(n=t.growingIO.emitter)===null||n===void 0||n.emit(qe,{requestData:f({},e),trackingId:e.trackingId}),t.initiateRequest(e.trackingId)},this.requestFailFn=function(e,n){if(t.requestingNum-=1,!t.requestQueue.some(function(o){return o.requestId===e.requestId})&&n)var r=window.setTimeout(function(){t.requestQueue.push(f(f({},e),{requestType:n})),t.initiateRequest(e.trackingId),window.clearTimeout(r),r=null},800)},this.hoardingQueue={},this.requestQueue=[],this.requestLimit=10,this.requestingNum=0,this.growingIO.emitter.on(Ve,function(e){var n=e.trackingId;t.hoardingQueue[n]=[]}),this.growingIO.emitter.on(Ae,function(e){var n=e.requestData;e.trackingId===t.growingIO.trackingId&&t.sendEvent(n)})},ce="gdp_user_id_gioenc",zt=function(i){var t=this;this.growingIO=i,this.getUid=function(){var e=t.growingIO.storage.getItem(ce);if(e)return e;var n=Y();return t.setUid(n),n},this.setUid=function(e){var n,r=t.growingIO.storage,o=r.getItem(ce)||t.prevUId;r.setItem(ce,e),o!==e&&((n=t.growingIO.emitter)===null||n===void 0||n.emit("UID_UPDATE",{newUId:e,oldUId:o})),t.prevUId=e},this._getSidKey=function(e){return t.growingIO.dataStore.getStorageKey(e,"sessionId")},this.getPrevSessionId=function(e){var n;return(n=t.prevIds[e])===null||n===void 0?void 0:n.sessionId},this.getSessionId=function(e){var n=t.growingIO.storage.getItem(t._getSidKey(e));if(n)return n;var r=Y();return t.setSessionId(e,r),r},this.setSessionId=function(e,n){var r;n||(n=Y());var o=t.growingIO,a=o.storage,s=o.dataStore,c=o.emitter,d=a.getItem(t._getSidKey(e))||t.getPrevSessionId(e),u=((r=s.getTrackerVds(e))!==null&&r!==void 0?r:{}).sessionExpires,g=u===void 0?30:u;a.setItem(t._getSidKey(e),n,+Date.now()+60*g*1e3),d!==n&&(a.getKeys().filter(function(l){return St.test(l)}).forEach(function(l){a.removeItem(l)}),a.setItem(s.getStorageKey(e,"sentSign"),""),c?.emit(mt,{newSessionId:n,oldSessionId:d,trackingId:e})),t.prevIds[e]||(t.prevIds[e]={}),t.prevIds[e].sessionId=n},this._getUserIdKey=function(e){return t.growingIO.dataStore.getStorageKey(e,"userId")},this.getPrevUserId=function(e){var n;return(n=t.prevIds[e])===null||n===void 0?void 0:n.userId},this.getUserId=function(e){return t.growingIO.storage.getItem(t._getUserIdKey(e))||""},this.setUserId=function(e,n){var r,o,a=t.growingIO.storage,s=a.getItem(t._getUserIdKey(e))||t.getPrevUserId(e);a.setItem(t._getUserIdKey(e),n),(r=t.growingIO.emitter)===null||r===void 0||r.emit("SET_USERID",{newUserId:n,oldUserId:s,userKey:t.getUserKey(e),trackingId:e}),s!==n&&((o=t.growingIO.emitter)===null||o===void 0||o.emit("USERID_UPDATE",{newUserId:n,oldUserId:s,userKey:t.getUserKey(e),trackingId:e})),n&&t.setGioId(e,n),t.prevIds[e]||(t.prevIds[e]={}),t.prevIds[e].userId=n},this._getUserKeyKey=function(e){return t.growingIO.dataStore.getStorageKey(e,"userKey")},this.getPrevUserKey=function(e){var n;return(n=t.prevIds[e])===null||n===void 0?void 0:n.userKey},this.getUserKey=function(e){return t.growingIO.storage.getItem(t._getUserKeyKey(e))||""},this.setUserKey=function(e,n){var r,o,a=t.growingIO.storage,s=a.getItem(t._getUserKeyKey(e))||t.getPrevUserKey(e);a.setItem(t._getUserKeyKey(e),n),(r=t.growingIO.emitter)===null||r===void 0||r.emit("SET_USERKEY",{newUserKey:n,oldUserKey:s,userId:t.getUserId(e),trackingId:e}),s!==n&&((o=t.growingIO.emitter)===null||o===void 0||o.emit("USERKEY_UPDATE",{newUserKey:n,oldUserKey:s,userId:t.getUserId(e),trackingId:e})),t.prevIds[e]||(t.prevIds[e]={}),t.prevIds[e].userKey=n},this._getGioIdKey=function(e){return t.growingIO.dataStore.getStorageKey(e,"gioId")},this.getPrevGioId=function(e){var n;return(n=t.prevIds[e])===null||n===void 0?void 0:n.gioId},this.getGioId=function(e){return t.growingIO.storage.getItem(t._getGioIdKey(e))||""},this.setGioId=function(e,n){var r,o=t.growingIO.storage,a=o.getItem(t._getGioIdKey(e))||t.getPrevGioId(e);o.setItem(t._getGioIdKey(e),n),a!==n&&((r=t.growingIO.emitter)===null||r===void 0||r.emit("GIOID_UPDATE",{newGioId:n,oldGioId:a,trackingId:e})),t.prevIds[e]||(t.prevIds[e]={}),t.prevIds[e].gioId=n},this.transferStorage=function(e,n){if(!n.storage.getItem(ce)&&e===n.trackingId&&t.growingIO.storage.getItem("gr_user_id")){var r=n.vdsConfig.projectId,o=n.storage,a=o.getItem("gr_user_id");a&&t.setUid(a);var s=o.getItem("".concat(r,"_gr_cs1"))||t.getUserId(e);s&&t.setUserId(e,s),o.removeItem("gr_user_id"),o.removeItem("".concat(r,"_gr_cs1")),o.removeItem("".concat(r,"_gr_last_sent_cs1")),o.removeItem("".concat(r,"_gr_last_sent_sid_with_cs1")),o.removeItem("".concat(r,"_gr_session_id")),o.removeItem("".concat(r,"_gr_session_id_sent_vst"));var c=rt(o.getKeys(),function(d){return d.indexOf("gr_imp_")>-1});c&&o.removeItem(c)}},this.prevIds={},this.growingIO.emitter.on(Ve,function(e){var n=e.trackingId,r=e.growingIO;t.transferStorage(n,r)})},Wt=(function(){function i(){var t,e=this;this.init=function(n){var r;e.emitter.emit("ON_SDK_INITIALIZE_BEFORE");try{if(m("Gio Web SDK 初始化中...","info"),n.trackingId&&_(e.dataStore.initializedTrackingIds,n.trackingId))throw Error("已存在实例 ".concat(n.trackingId,",请勿重复初始化!"));if(e.trackingId&&!e.plugins.gioMultipleInstances)throw Error("您正在尝试初始化另一个实例,请集成多实例插件后重试!");var o=e.dataStore.currentPage,a=e.dataStore.initTrackerOptions(n);return(!e.trackingId||a.trackingId===e.trackingId)&&(e.storage=Nt(e.vdsConfig),o.hookHistory(),a.extraUA!==!1&&z.isCompatible()&&z.initialize(),e.gioSDKInitialized=!0,e.vdsConfig.gioSDKInitialized=!0),(r=e.emitter)===null||r===void 0||r.emit(Ve,{growingIO:e,trackingId:a.trackingId,vdsConfig:a}),o.parsePage(),e.vdsConfig.originalSource&&e.dataStore.setOriginalSource(a.trackingId),m("Gio Web SDK 初始化完成!".concat(e.useEmbeddedInherit===a.trackingId?"小程序模式":e.useHybridInherit===a.trackingId?"Hybrid模式":"Web模式"),"success"),e.vdsConfig.forceLogin&&m("forceLogin已开启,请调用 identify 方法设置 openId 以继续上报!","info"),e._waitForUserAgentAndSendEvents(a.trackingId),!0}catch(s){return m(s,"error"),!1}},this.handlerDistribute=function(n,r,o){e.dataStore.getTrackerVds(n)?z.isInitializing()?z.initialize().finally(function(){e[r].apply(e,q([n],o,!1))}):e[r].apply(e,q([n],o,!1)):(x(he(o))&&O(he(o),!1),m("不存在实例:".concat(n,",请检查!"),"warn"))},this.registerPlugins=function(n,r){if(N(n)){var o=[];n.forEach(function(a,s){at(a,s)&&o.push(a)}),e.plugins.installAll(o)}else m("插件注册失败,参数不合法,请检查!","error");O(r,e.plugins.pluginItems)},this.getPlugins=function(n){O(n,e.plugins.pluginItems)},this.getDeviceId=function(n){O(n,e.userStore.getUid())},this.setOption=function(n,r,o,a){var s,c;_(C(Ue),r)?typeof o===((s=ge[r])===null||s===void 0?void 0:s.type)?(e.dataStore.setOption(n,r,o),m("已修改".concat(Ue[r],": ").concat(o),"info"),c=!0):(m("参数格式不正确:".concat(o,",请检查后重试!"),"error"),c=!1):(m("不存在可修改的配置项:".concat(r,",请检查后重试!"),"error"),c=!1),O(a,c)},this.getOption=function(n,r,o){x(r)&&D(o)&&(o=r,r=void 0),O(o,e.dataStore.getOption(n,r))},this.sendVisit=function(n,r,o){e.dataStore.buildVisitEvent(f(f({},r),{trackingId:n})),O(o)},this.setPageListener=function(n,r){var o=e.dataStore.currentPage;if(x(r)){o.pageListeners[n]=r;var a=e.dataStore.currentPage,s=a.path,c=a.query,d=a.title;O(r,{path:s,query:c,title:d})}},this.setPageAttributes=function(n,r,o){var a;if(k(r)&&!y(r))if(e.dataStore.getTrackerVds(n).trackPage)a=!1,m("仅在关闭trackPage时允许调用setPageAttributes,请确认后修改初始化配置项!","error");else{var s=e.dataStore.currentPage;y(s.pageProps[n])&&(s.pageProps[n]={}),y(s.pageProps[n][s.path])&&(s.pageProps[n][s.path]={}),y(r)||J(r,function(c,d){x(s.pageProps[n][s.path][d])&&!x(c)||(s.pageProps[n][s.path][d]=c)}),a=!0}else a=!1,j("setPageAttributes");O(o,a)},this.clearPageAttributes=function(n,r,o){var a=!0;try{if(!y(e.dataStore.currentPage.pageProps[n])){var s=e.dataStore.currentPage;N(r)&&!y(r)?r.forEach(function(c){E(s.pageProps[n][s.path],c)}):s.pageProps[n][s.path]={}}}catch{j("clearPageAttributes"),a=!1}O(o,a)},this.sendPage=function(n,r,o){e.dataStore.getTrackerVds(n).trackPage?m("仅在关闭trackPage时允许调用sendPage,请确认后修改初始化配置项!","error"):(e.dataStore.currentPage.buildPageEvent(n,r),O(o))},this.identify=function(n,r,o){if(n===e.trackingId){if(e.vdsConfig.forceLogin){if(!ze(r))return void j("identify");var a=T(r).slice(0,1e3);e.userStore.setUid(a),e.dataStore.initializedTrackingIds.forEach(function(s){var c=e.uploader.getHoardingQueue(s);c.forEach(function(d,u){return c[u].deviceId=a}),s===e.trackingId&&e.vdsConfig.forceLogin&&e.dataStore.setOption(s,"forceLogin",!1),e.uploader.initiateRequest(s)})}else j("identify",!1,"forceLogin未开启");O(o)}else j("identify",!1,"子实例不允许调用identify")},this.setUserAttributes=function(n,r,o){var a,s;if(k(r)&&!y(r)){var c=e.dataStore,d=c.eventContextBuilder,u=c.eventConverter,g=f({eventType:"LOGIN_USER_ATTRIBUTES"},d(n));g.attributes=B(f(f({},(a=g.attributes)!==null&&a!==void 0?a:{}),te(r))),u(g),s=!0}else j("setUserAttributes"),s=!1;O(o,s)},this.setUserId=function(n,r,o,a){var s;if(ze(T(r).trim())){var c=e.userStore.getGioId(n),d=!D(o)&&T(o).length>0?T(o).slice(0,1e3):"";e.userStore.setUserKey(n,d),!e.dataStore.getTrackerVds(n).idMapping&&d&&m("您设置了 userKey ,请初始化开启 idMapping!","warn"),e.userStore.setUserId(n,T(r).slice(0,1e3)),c&&c!==e.userStore.getUserId(n)&&e.userStore.setSessionId(n,""),s=!0}else e.clearUserId(n),j("setUserId"),s=!1;O(a,s)},this.clearUserId=function(n,r){e.userStore.setUserId(n,""),e.userStore.setUserKey(n,""),O(r)},this.setGeneralProps=function(n,r,o){var a;k(r)&&!y(r)?(y(e.dataStore.generalProps[n])&&(e.dataStore.generalProps[n]={}),J(r,function(s,c){x(e.dataStore.generalProps[n][c])&&!x(s)||(e.dataStore.generalProps[n][c]=s)}),a=!0):(j("setGeneralProps"),a=!1),O(o,a)},this.clearGeneralProps=function(n,r,o){y(e.dataStore.generalProps[n])||(N(r)&&!y(r)?r.forEach(function(a){E(e.dataStore.generalProps[n],a)}):e.dataStore.generalProps[n]={}),O(o)},this.track=function(n,r,o,a){We(r,function(){var s,c=e.dataStore,d=c.eventContextBuilder,u=c.eventConverter,g=f({eventType:"CUSTOM",eventName:r},d(n));g.attributes=B(f(f({},(s=g.attributes)!==null&&s!==void 0?s:{}),te(f({},k(o)&&!y(o)?o:{})))),e.plugins.gioMultipleInstances&&o&&o["&&sendTo"]&&(g["&&sendTo"]=o["&&sendTo"]),u(g)}),O(a)},this.trackTimerStart=function(n,r,o){var a;e.dataStore.getTrackerVds(n).dataCollect?We(r,function(){a=Y(),e.dataStore.trackTimers[n]||(e.dataStore.trackTimers[n]={}),e.dataStore.trackTimers[n][a]={eventName:r,leng:0,start:+Date.now()}}):m("指定实例未开启数据采集,请检查!","error"),O(o,a)},this.trackTimerPause=function(n,r,o){var a=e.dataStore.trackTimers[n];if(r&&a&&a[r]){var s=a[r];s.start&&(s.leng=s.leng+(+Date.now()-s.start)),s.start=0}else m("未查询到指定计时器,请检查!","error");O(o)},this.trackTimerResume=function(n,r,o){var a=e.dataStore.trackTimers[n];if(r&&a&&a[r]){var s=a[r];s.start===0&&(s.start=+Date.now())}else m("未查询到指定计时器,请检查!","error");O(o)},this.trackTimerEnd=function(n,r,o,a){var s,c,d=e.dataStore.getTrackerVds(n).dataCollect,u=e.dataStore.trackTimers[n];if(r&&u&&u[r]){if(d){var g=u[r];if(g.start!==0){var l=+Date.now()-g.start;g.leng=l>0?g.leng+l:0}var h=e.dataStore,S=h.eventContextBuilder,p=h.eventConverter,v=f({eventType:"CUSTOM",eventName:g.eventName},S(n));v.attributes=B(f(f(f({},(s=v.attributes)!==null&&s!==void 0?s:{}),te(f({},k(o)&&!y(o)?o:{}))),{event_duration:g.leng>864e5?0:g.leng/1e3})),e.plugins.gioMultipleInstances&&o&&o["&&sendTo"]&&(v["&&sendTo"]=o["&&sendTo"]),p(v),c=!0}else m("指定实例未开启数据采集,计时器已移除,请检查!","error"),c=!1;e.removeTimer(n,r)}else m("未查询到指定计时器,请检查!","error"),c=!1;O(a,c)},this.removeTimer=function(n,r,o){var a=e.dataStore.trackTimers[n];r&&a&&a[r]?delete a[r]:m("未查询到指定计时器,请检查!","error"),O(o)},this.clearTrackTimer=function(n,r){e.dataStore.trackTimers[n]={},O(r)},this.updateImpression=function(n){var r,o,a=(o=(r=e.plugins)===null||r===void 0?void 0:r.gioImpressionTracking)===null||o===void 0?void 0:o.main;a?a("manual"):m("updateImpression 错误! 请集成半自动埋点浏览插件后重试!","error"),O(n)},this.getABTest=function(n,r,o){m("获取ABTest数据错误! 请集成ABTest插件后重试!","error"),O(o,{})},this.setBeforeSendListener=function(n,r,o){T(r).indexOf("sendPage")>-1?m("拦截回调中不能调用sendPage方法,请检查!","error"):x(r)?(e.dataStore.beforeSendListener[n]=r,O(o)):O(o,!1)},this.getUserAgent=function(n){var r="Unknown";try{r=e.vdsConfig.extraUA!==!1?z.getUserAgent():typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"Unknown"}catch{r=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"Unknown"}return O(n,r),r},this.sdkVersion="4.3.1",this.vdsName=window._gio_local_vds||"vds",this.utils=f(f({},kt),Tt),this.emitter=(t=t||Object.create(null),{on:function(n,r){(t[n]||(t[n]=[])).push(r)},off:function(n,r){t[n]&&t[n].splice(t[n].indexOf(r)>>>0,1)},emit:function(n,r){(t[n]||[]).slice().map(function(o){o(r)}),(t["*"]||[]).slice().map(function(o){o(n,r)})}}),this.useEmbeddedInherit="",this.useHybridInherit="",this.gioSDKInitialized=!1,this.plugins=new Ht(this),this.plugins.innerPluginInit(),this.dataStore=new Gt(this),this.userStore=new zt(this),this.uploader=new Bt(this)}return i.prototype._waitForUserAgentAndSendEvents=function(t){var e=this;z.isInitializing()?z.initialize().finally(function(){e._sendEventsAfterUserAgent(t)}):this._sendEventsAfterUserAgent(t)},i.prototype._sendEventsAfterUserAgent=function(t){var e;this.useEmbeddedInherit!==t&&this.dataStore.sendVerifiedVisit(t),this.dataStore.sendVerifiedPage(t),(e=this.emitter)===null||e===void 0||e.emit(ht,{growingIO:this,trackingId:t})},i})(),$=window._gio_local_vds||"vds",X=(ke=(be=window[$])===null||be===void 0?void 0:be.namespace)!==null&&ke!==void 0?ke:"gdp";(function(){var i,t,e,n,r;if(!((i=window[$])===null||i===void 0)&&i.gioSDKInstalled)return Z=window[X],void m("SDK重复加载,请检查是否重复加载SDK或接入其他平台SDK导致冲突!","warn");window[$]=f(f({},(t=window[$])!==null&&t!==void 0?t:{}),{gioSDKInstalled:!0});var o=new Wt,a=function(l){return _(Qe,l)&&!!o[l]};Z=function(){for(var l,h,S=[],p=0;arguments.length>p;p++)S[p]=arguments[p];var v=S[0],w="g0",b=v;if(v.indexOf(".")>-1&&(w=(l=v.split(".")[0])!==null&&l!==void 0?l:"g0",b=v.split(".")[1]),K(b)&&_(Qe,b)&&o[b]){var I=me(se(S));if(b==="init"){var L=(function(H,F){if(_(["","localhost","127.0.0.1"],location.hostname)&&!window._gr_ignore_local_rule)return m("当前SDK不允许在本地环境初始化!","error"),!1;var re=T(F[0]),ye=T(F[1]),Le=(F.length===4?F[3]:F[2])||{};return re&&ye?H.dataStore.initializedTrackingIds.some(function(It,wt){var Re=wt===0?H.vdsConfig:H.subInstance[It];return Re.projectId===re&&Re.dataSourceId===ye})?(m("SDK初始化失败,重复初始化,请检查初始化参数!","error"),!1):{projectId:re,dataSourceId:ye,appId:Le.appId||T(F.length===4?F[2]:""),userOptions:Le}:(m('SDK初始化失败,请使用 gdp("init", "您的GrowingIO项目 accountId", "您项目的 dataSourceId", options: { host: "您的数据上报地址host" }); 进行初始化!',"error"),!1)})(o,I);if(L){var R=L.projectId,G=L.dataSourceId,U=L.appId,M=L.userOptions;return o.init(f(f({},M),{projectId:R,dataSourceId:G,appId:U||M.appId,trackingId:w}))}return!1}b==="registerPlugins"?o.registerPlugins.apply(o,I):_(["setGeneralProps","clearGeneralProps"],b)?o[b].apply(o,q([w],I,!1)):o.gioSDKInitialized&&o.vdsConfig?_(lt,b)?A(function(){return o.handlerDistribute(w,b,I)}):A(function(){return o[b].apply(o,I)}):(o.emitter.emit("UN_EXECUTE_CALL",S),m("SDK未初始化!","error"))}else if(_(Ut,b))m("方法 ".concat(T(b)," 已被弃用,请移除!"),"warn");else{if(b==="canIUse")return a(S[1]);m("不存在名为 ".concat(T(b)," 的方法调用!"),"error")}window[$]=f(f({},window[$]),{_gr_ignore_local_rule:(h=window._gr_ignore_local_rule)!==null&&h!==void 0&&h,gioSDKVersion:o.sdkVersion,gioSDKFull:o.gioSDKFull,canIUse:a})};var s=(e=window[X])===null||e===void 0?void 0:e.q,c=(n=window[X])===null||n===void 0?void 0:n.e,d=(r=window[X])===null||r===void 0?void 0:r.ef;if(window[X]=Z,window[X].e=c,window[X].ef=d,window.gdp=Z,window.gdp.e=c,window.gdp.ef=d,N(s)&&!y(s))for(var u=s.length,g=0;u>g;g+=1)Z.apply(null,s.shift())})();var Qt=Z;exports.default=Qt;