@kbapp/data-analysis 0.0.1

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,863 @@
1
+ const T = class {
2
+ constructor(n) {
3
+ this.errorCode = n.errorCode, this.errorMsg = n.errorMsg;
4
+ }
5
+ };
6
+ T.UNKNOWN = new T({
7
+ errorCode: 1e3,
8
+ errorMsg: "未知错误"
9
+ }), T.UNSUPPORTED_VERSION = new T({
10
+ errorCode: 1001,
11
+ errorMsg: "当前开吧版本不支持"
12
+ }), T.TIMEOUT = new T({
13
+ errorCode: 1002,
14
+ errorMsg: "执行超时"
15
+ }), T.UNSUPPORTED_BRIDGE_ENV = new T({
16
+ errorCode: 1003,
17
+ errorMsg: "请在开吧app内执行"
18
+ });
19
+ let x = T;
20
+ const Cr = () => {
21
+ const o = (i, s, f) => {
22
+ var d = "";
23
+ typeof s == "function" && (f = s, s = {});
24
+ var g = { data: s === void 0 ? null : s };
25
+ if (typeof f == "function") {
26
+ var E = "dscb" + window.dscb++;
27
+ window[E] = f, g._dscbstub = E;
28
+ }
29
+ if (g = JSON.stringify(g), window.flutter_inappwebview ? window.flutter_inappwebview.callHandler && (d = window.flutter_inappwebview.callHandler("" + i, g)) : (window._dswk || navigator.userAgent.indexOf("_dsbridge") != -1) && (d = prompt("_flutterDsbridge=" + i, g)), d instanceof Promise)
30
+ return d;
31
+ try {
32
+ return JSON.parse(d || "{}").data;
33
+ } catch {
34
+ console.error("callHandle异常,JSON.parse错误");
35
+ }
36
+ }, n = () => window.navigator.userAgent.includes("Android") ? window.flutter_inappwebview && window.flutter_inappwebview._platformReady : !0, c = (() => {
37
+ const i = [], s = setInterval(() => {
38
+ n() && (clearInterval(s), i.forEach((f) => {
39
+ o.apply(window, f);
40
+ }), i.length = 0);
41
+ }, 500);
42
+ return (...f) => {
43
+ i.push(f);
44
+ };
45
+ })();
46
+ var u = {
47
+ default: void 0,
48
+ // for typescript
49
+ callHandler: function(i, s, f) {
50
+ return n() ? o(i, s, f) : c(i, s, f);
51
+ },
52
+ register: function(i, s, f) {
53
+ var d = f ? window._dsaf : window._dsf;
54
+ window._dsInit || (window._dsInit = !0, setTimeout(function() {
55
+ u.callHandler("_dsb.dsinit");
56
+ }, 0)), typeof s == "object" ? d._obs[i] = s : d[i] = s;
57
+ },
58
+ registerHandler: function(i, s) {
59
+ this.register(i, s, !0);
60
+ }
61
+ };
62
+ return (function() {
63
+ if (!window._dsf) {
64
+ var i = {
65
+ //保存JS同步方法
66
+ _dsf: {
67
+ _obs: {}
68
+ },
69
+ //保存JS异步方法
70
+ _dsaf: {
71
+ _obs: {}
72
+ },
73
+ dscb: 0,
74
+ jsBridge: u,
75
+ _handleMessageFromNative: function(f) {
76
+ var d = JSON.parse(f.data), g = {
77
+ id: f.callbackId,
78
+ complete: !0
79
+ }, E = this._dsf[f.method], M = this._dsaf[f.method], L = function(N, C) {
80
+ g.data = N.apply(C, d), u.callHandler("_dsb.returnValue", g);
81
+ }, S = function(N, C) {
82
+ d.push(function(J, B) {
83
+ g.data = J, g.complete = B !== !1, u.callHandler("_dsb.returnValue", g);
84
+ }), N.apply(C, d);
85
+ };
86
+ if (E)
87
+ L(E, this._dsf);
88
+ else if (M)
89
+ S(M, this._dsaf);
90
+ else {
91
+ var R = f.method.split(".");
92
+ if (R.length < 2) return;
93
+ var G = R.pop(), V = R.join("."), D = this._dsf._obs, _ = D[V] || {}, y = _[G];
94
+ if (y && typeof y == "function") {
95
+ L(y, _);
96
+ return;
97
+ }
98
+ if (D = this._dsaf._obs, _ = D[V] || {}, y = _[G], y && typeof y == "function") {
99
+ S(y, _);
100
+ return;
101
+ }
102
+ }
103
+ }
104
+ };
105
+ for (var s in i)
106
+ window[s] = i[s];
107
+ }
108
+ })(), u;
109
+ }, jr = ((o) => /(kb)/i.test(o) ? Cr() : {
110
+ registerHandler(n, c) {
111
+ throw x.UNSUPPORTED_BRIDGE_ENV;
112
+ },
113
+ callHandler(n, c, u) {
114
+ throw x.UNSUPPORTED_BRIDGE_ENV;
115
+ }
116
+ })(window?.navigator?.userAgent);
117
+ function Qt(o) {
118
+ const n = (c) => {
119
+ let u;
120
+ const i = (f) => {
121
+ (!u || u === "success") && (u = "success", c.success?.(f));
122
+ }, s = (f) => {
123
+ (!u || u === "error") && (u = "error", c.fail?.(f));
124
+ };
125
+ c.timeout && setTimeout(() => {
126
+ s(x.TIMEOUT);
127
+ }, c.timeout);
128
+ try {
129
+ jr.callHandler(c.name, c.params, (f) => {
130
+ let d;
131
+ try {
132
+ d = typeof f == "string" ? JSON.parse(f.replace(/\n/g, "\\n").replace(/\r/g, "\\r")) : f;
133
+ } catch {
134
+ d = null;
135
+ }
136
+ i(d);
137
+ });
138
+ } catch (f) {
139
+ s(f);
140
+ }
141
+ };
142
+ return new Promise((c, u) => {
143
+ n({
144
+ name: o.name,
145
+ params: o.params,
146
+ timeout: o.timeout,
147
+ success: (i) => {
148
+ o.success?.(i), o.complete?.(), c(i);
149
+ },
150
+ fail: (i) => {
151
+ o.fail?.(i), o.complete?.(), u(i);
152
+ }
153
+ });
154
+ });
155
+ }
156
+ const dt = /(kb_flutter|kb_dsbridge_flutter|kb_ios|kb_android|kb_dsbridge_android)/i.test(window.navigator.userAgent);
157
+ function te(o, n) {
158
+ return new Promise(async (c, u) => {
159
+ try {
160
+ const i = await n();
161
+ o.success?.(i), c(i);
162
+ } catch (i) {
163
+ const s = i?.errorCode ? i : new x({ errorCode: x.UNKNOWN.errorCode, errorMsg: String(i) });
164
+ o.fail?.(s), u(s);
165
+ } finally {
166
+ o.complete?.();
167
+ }
168
+ });
169
+ }
170
+ function mr(o) {
171
+ let n;
172
+ return function(...c) {
173
+ return n || (n = o(...c), Promise.resolve(n).catch(() => {
174
+ n = void 0;
175
+ }), n);
176
+ };
177
+ }
178
+ const Pr = mr(() => Qt({
179
+ name: "OpenActRequest",
180
+ params: {
181
+ // 这个函数只能使用35, 而不能使用新提供的60001, 这是因为写这个sdk的时候, 60001 也没有提供!!!
182
+ type: 35,
183
+ data: {}
184
+ }
185
+ }));
186
+ function Ir(o) {
187
+ return te(o, async () => (await Pr()).vcode >= o.minVersion);
188
+ }
189
+ function xr(o, n) {
190
+ return (...c) => Ir({
191
+ minVersion: o.minVersion
192
+ }).then((u) => u ? n(...c) : Promise.reject(new x({
193
+ errorCode: x.UNSUPPORTED_VERSION.errorCode,
194
+ errorMsg: `最低版本要求${o.minVersion}`
195
+ })));
196
+ }
197
+ function Mr(o) {
198
+ if (typeof o != "object" || o === null || Array.isArray(o))
199
+ return {};
200
+ const n = {};
201
+ return Object.keys(o).forEach((c) => {
202
+ const u = o[c];
203
+ u !== void 0 && (n[c] = u);
204
+ }), n;
205
+ }
206
+ function ht(o) {
207
+ return te(
208
+ o,
209
+ xr({ minVersion: 80801 }, async () => Qt({
210
+ name: "OpenActRequest",
211
+ params: {
212
+ type: 60400,
213
+ data: Mr({
214
+ /** 事件名 */
215
+ eventId: o.eventName,
216
+ /** 上报值 */
217
+ trackParams: o.eventParams,
218
+ /** 开始结束类型传递 */
219
+ ExtEventType: o.eventType
220
+ })
221
+ }
222
+ }))
223
+ );
224
+ }
225
+ function gt(o) {
226
+ const n = [];
227
+ return Object.keys(o).forEach((c) => {
228
+ n.push([c, o[c]]);
229
+ }), new Map(n);
230
+ }
231
+ const Rr = (o) => window[o.key] ? window[o.key] : new Promise((n, c) => {
232
+ const u = window.document.createElement("script");
233
+ u.setAttribute("src", o.src), u.async = !0, u.onload = () => {
234
+ n(window[o.key]);
235
+ }, u.onerror = (i) => {
236
+ c(i);
237
+ }, window.document.head.appendChild(u);
238
+ }), Yt = /* @__PURE__ */ (() => {
239
+ let o, n = "";
240
+ function c(i) {
241
+ n = i.sdkURL;
242
+ }
243
+ async function u() {
244
+ return n ? o || (o = new Promise(async (i, s) => {
245
+ try {
246
+ await Rr({ src: n, key: "GsIdo" }), i(window.GsIdo);
247
+ } catch (f) {
248
+ o = void 0, s(f);
249
+ }
250
+ }), o) : Promise.reject(new Error("GsIdo SDK 地址未配置,请先调用 GsidoProxy.configureSdk"));
251
+ }
252
+ return {
253
+ configure: c,
254
+ load: u
255
+ };
256
+ })(), I = new Proxy(
257
+ {},
258
+ {
259
+ get(n, c) {
260
+ return c === "configureSdk" ? Yt.configure : c === "getGsido" ? window.GsIdo : function(...u) {
261
+ return Yt.load().then((i) => {
262
+ const s = i[c];
263
+ if (typeof s != "function")
264
+ throw new Error(`${c} 不是 GsIdo 的有效方法`);
265
+ return s(...u);
266
+ });
267
+ };
268
+ }
269
+ }
270
+ );
271
+ var tt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
272
+ function Gr(o) {
273
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
274
+ }
275
+ var $ = { exports: {} };
276
+ $.exports;
277
+ var Zt;
278
+ function Dr() {
279
+ return Zt || (Zt = 1, (function(o, n) {
280
+ var c = 200, u = "__lodash_hash_undefined__", i = 9007199254740991, s = "[object Arguments]", f = "[object Array]", d = "[object Boolean]", g = "[object Date]", E = "[object Error]", M = "[object Function]", L = "[object GeneratorFunction]", S = "[object Map]", R = "[object Number]", G = "[object Object]", V = "[object Promise]", D = "[object RegExp]", _ = "[object Set]", y = "[object String]", N = "[object Symbol]", C = "[object WeakMap]", J = "[object ArrayBuffer]", B = "[object DataView]", _t = "[object Float32Array]", yt = "[object Float64Array]", wt = "[object Int8Array]", vt = "[object Int16Array]", At = "[object Int32Array]", Tt = "[object Uint8Array]", Ot = "[object Uint8ClampedArray]", Et = "[object Uint16Array]", St = "[object Uint32Array]", re = /[\\^$.*+?()[\]{}|]/g, ne = /\w*$/, oe = /^\[object .+?Constructor\]$/, ie = /^(?:0|[1-9]\d*)$/, l = {};
281
+ l[s] = l[f] = l[J] = l[B] = l[d] = l[g] = l[_t] = l[yt] = l[wt] = l[vt] = l[At] = l[S] = l[R] = l[G] = l[D] = l[_] = l[y] = l[N] = l[Tt] = l[Ot] = l[Et] = l[St] = !0, l[E] = l[M] = l[C] = !1;
282
+ var ae = typeof tt == "object" && tt && tt.Object === Object && tt, se = typeof self == "object" && self && self.Object === Object && self, w = ae || se || Function("return this")(), Ct = n && !n.nodeType && n, jt = Ct && !0 && o && !o.nodeType && o, ce = jt && jt.exports === Ct;
283
+ function ue(t, e) {
284
+ return t.set(e[0], e[1]), t;
285
+ }
286
+ function fe(t, e) {
287
+ return t.add(e), t;
288
+ }
289
+ function le(t, e) {
290
+ for (var r = -1, a = t ? t.length : 0; ++r < a && e(t[r], r, t) !== !1; )
291
+ ;
292
+ return t;
293
+ }
294
+ function de(t, e) {
295
+ for (var r = -1, a = e.length, h = t.length; ++r < a; )
296
+ t[h + r] = e[r];
297
+ return t;
298
+ }
299
+ function mt(t, e, r, a) {
300
+ for (var h = -1, p = t ? t.length : 0; ++h < p; )
301
+ r = e(r, t[h], h, t);
302
+ return r;
303
+ }
304
+ function he(t, e) {
305
+ for (var r = -1, a = Array(t); ++r < t; )
306
+ a[r] = e(r);
307
+ return a;
308
+ }
309
+ function ge(t, e) {
310
+ return t?.[e];
311
+ }
312
+ function Pt(t) {
313
+ var e = !1;
314
+ if (t != null && typeof t.toString != "function")
315
+ try {
316
+ e = !!(t + "");
317
+ } catch {
318
+ }
319
+ return e;
320
+ }
321
+ function It(t) {
322
+ var e = -1, r = Array(t.size);
323
+ return t.forEach(function(a, h) {
324
+ r[++e] = [h, a];
325
+ }), r;
326
+ }
327
+ function et(t, e) {
328
+ return function(r) {
329
+ return t(e(r));
330
+ };
331
+ }
332
+ function xt(t) {
333
+ var e = -1, r = Array(t.size);
334
+ return t.forEach(function(a) {
335
+ r[++e] = a;
336
+ }), r;
337
+ }
338
+ var pe = Array.prototype, be = Function.prototype, z = Object.prototype, rt = w["__core-js_shared__"], Mt = (function() {
339
+ var t = /[^.]+$/.exec(rt && rt.keys && rt.keys.IE_PROTO || "");
340
+ return t ? "Symbol(src)_1." + t : "";
341
+ })(), Rt = be.toString, O = z.hasOwnProperty, q = z.toString, _e = RegExp(
342
+ "^" + Rt.call(O).replace(re, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
343
+ ), Gt = ce ? w.Buffer : void 0, Dt = w.Symbol, Nt = w.Uint8Array, ye = et(Object.getPrototypeOf, Object), we = Object.create, ve = z.propertyIsEnumerable, Ae = pe.splice, Bt = Object.getOwnPropertySymbols, Te = Gt ? Gt.isBuffer : void 0, Oe = et(Object.keys, Object), nt = K(w, "DataView"), W = K(w, "Map"), ot = K(w, "Promise"), it = K(w, "Set"), at = K(w, "WeakMap"), F = K(Object, "create"), Ee = P(nt), Se = P(W), Ce = P(ot), je = P(it), me = P(at), Ut = Dt ? Dt.prototype : void 0, Ht = Ut ? Ut.valueOf : void 0;
344
+ function j(t) {
345
+ var e = -1, r = t ? t.length : 0;
346
+ for (this.clear(); ++e < r; ) {
347
+ var a = t[e];
348
+ this.set(a[0], a[1]);
349
+ }
350
+ }
351
+ function Pe() {
352
+ this.__data__ = F ? F(null) : {};
353
+ }
354
+ function Ie(t) {
355
+ return this.has(t) && delete this.__data__[t];
356
+ }
357
+ function xe(t) {
358
+ var e = this.__data__;
359
+ if (F) {
360
+ var r = e[t];
361
+ return r === u ? void 0 : r;
362
+ }
363
+ return O.call(e, t) ? e[t] : void 0;
364
+ }
365
+ function Me(t) {
366
+ var e = this.__data__;
367
+ return F ? e[t] !== void 0 : O.call(e, t);
368
+ }
369
+ function Re(t, e) {
370
+ var r = this.__data__;
371
+ return r[t] = F && e === void 0 ? u : e, this;
372
+ }
373
+ j.prototype.clear = Pe, j.prototype.delete = Ie, j.prototype.get = xe, j.prototype.has = Me, j.prototype.set = Re;
374
+ function v(t) {
375
+ var e = -1, r = t ? t.length : 0;
376
+ for (this.clear(); ++e < r; ) {
377
+ var a = t[e];
378
+ this.set(a[0], a[1]);
379
+ }
380
+ }
381
+ function Ge() {
382
+ this.__data__ = [];
383
+ }
384
+ function De(t) {
385
+ var e = this.__data__, r = X(e, t);
386
+ if (r < 0)
387
+ return !1;
388
+ var a = e.length - 1;
389
+ return r == a ? e.pop() : Ae.call(e, r, 1), !0;
390
+ }
391
+ function Ne(t) {
392
+ var e = this.__data__, r = X(e, t);
393
+ return r < 0 ? void 0 : e[r][1];
394
+ }
395
+ function Be(t) {
396
+ return X(this.__data__, t) > -1;
397
+ }
398
+ function Ue(t, e) {
399
+ var r = this.__data__, a = X(r, t);
400
+ return a < 0 ? r.push([t, e]) : r[a][1] = e, this;
401
+ }
402
+ v.prototype.clear = Ge, v.prototype.delete = De, v.prototype.get = Ne, v.prototype.has = Be, v.prototype.set = Ue;
403
+ function U(t) {
404
+ var e = -1, r = t ? t.length : 0;
405
+ for (this.clear(); ++e < r; ) {
406
+ var a = t[e];
407
+ this.set(a[0], a[1]);
408
+ }
409
+ }
410
+ function He() {
411
+ this.__data__ = {
412
+ hash: new j(),
413
+ map: new (W || v)(),
414
+ string: new j()
415
+ };
416
+ }
417
+ function Ke(t) {
418
+ return Y(this, t).delete(t);
419
+ }
420
+ function ke(t) {
421
+ return Y(this, t).get(t);
422
+ }
423
+ function Le(t) {
424
+ return Y(this, t).has(t);
425
+ }
426
+ function Ve(t, e) {
427
+ return Y(this, t).set(t, e), this;
428
+ }
429
+ U.prototype.clear = He, U.prototype.delete = Ke, U.prototype.get = ke, U.prototype.has = Le, U.prototype.set = Ve;
430
+ function H(t) {
431
+ this.__data__ = new v(t);
432
+ }
433
+ function We() {
434
+ this.__data__ = new v();
435
+ }
436
+ function Fe(t) {
437
+ return this.__data__.delete(t);
438
+ }
439
+ function $e(t) {
440
+ return this.__data__.get(t);
441
+ }
442
+ function Je(t) {
443
+ return this.__data__.has(t);
444
+ }
445
+ function ze(t, e) {
446
+ var r = this.__data__;
447
+ if (r instanceof v) {
448
+ var a = r.__data__;
449
+ if (!W || a.length < c - 1)
450
+ return a.push([t, e]), this;
451
+ r = this.__data__ = new U(a);
452
+ }
453
+ return r.set(t, e), this;
454
+ }
455
+ H.prototype.clear = We, H.prototype.delete = Fe, H.prototype.get = $e, H.prototype.has = Je, H.prototype.set = ze;
456
+ function qe(t, e) {
457
+ var r = ut(t) || wr(t) ? he(t.length, String) : [], a = r.length, h = !!a;
458
+ for (var p in t)
459
+ O.call(t, p) && !(h && (p == "length" || pr(p, a))) && r.push(p);
460
+ return r;
461
+ }
462
+ function Kt(t, e, r) {
463
+ var a = t[e];
464
+ (!(O.call(t, e) && Wt(a, r)) || r === void 0 && !(e in t)) && (t[e] = r);
465
+ }
466
+ function X(t, e) {
467
+ for (var r = t.length; r--; )
468
+ if (Wt(t[r][0], e))
469
+ return r;
470
+ return -1;
471
+ }
472
+ function Xe(t, e) {
473
+ return t && kt(e, ft(e), t);
474
+ }
475
+ function st(t, e, r, a, h, p, A) {
476
+ var b;
477
+ if (a && (b = p ? a(t, h, p, A) : a(t)), b !== void 0)
478
+ return b;
479
+ if (!Z(t))
480
+ return t;
481
+ var Jt = ut(t);
482
+ if (Jt) {
483
+ if (b = dr(t), !e)
484
+ return ur(t, b);
485
+ } else {
486
+ var k = m(t), zt = k == M || k == L;
487
+ if (Ar(t))
488
+ return rr(t, e);
489
+ if (k == G || k == s || zt && !p) {
490
+ if (Pt(t))
491
+ return p ? t : {};
492
+ if (b = hr(zt ? {} : t), !e)
493
+ return fr(t, Xe(b, t));
494
+ } else {
495
+ if (!l[k])
496
+ return p ? t : {};
497
+ b = gr(t, k, st, e);
498
+ }
499
+ }
500
+ A || (A = new H());
501
+ var qt = A.get(t);
502
+ if (qt)
503
+ return qt;
504
+ if (A.set(t, b), !Jt)
505
+ var Xt = r ? lr(t) : ft(t);
506
+ return le(Xt || t, function(lt, Q) {
507
+ Xt && (Q = lt, lt = t[Q]), Kt(b, Q, st(lt, e, r, a, Q, t, A));
508
+ }), b;
509
+ }
510
+ function Ye(t) {
511
+ return Z(t) ? we(t) : {};
512
+ }
513
+ function Ze(t, e, r) {
514
+ var a = e(t);
515
+ return ut(t) ? a : de(a, r(t));
516
+ }
517
+ function Qe(t) {
518
+ return q.call(t);
519
+ }
520
+ function tr(t) {
521
+ if (!Z(t) || _r(t))
522
+ return !1;
523
+ var e = $t(t) || Pt(t) ? _e : oe;
524
+ return e.test(P(t));
525
+ }
526
+ function er(t) {
527
+ if (!Vt(t))
528
+ return Oe(t);
529
+ var e = [];
530
+ for (var r in Object(t))
531
+ O.call(t, r) && r != "constructor" && e.push(r);
532
+ return e;
533
+ }
534
+ function rr(t, e) {
535
+ if (e)
536
+ return t.slice();
537
+ var r = new t.constructor(t.length);
538
+ return t.copy(r), r;
539
+ }
540
+ function ct(t) {
541
+ var e = new t.constructor(t.byteLength);
542
+ return new Nt(e).set(new Nt(t)), e;
543
+ }
544
+ function nr(t, e) {
545
+ var r = e ? ct(t.buffer) : t.buffer;
546
+ return new t.constructor(r, t.byteOffset, t.byteLength);
547
+ }
548
+ function or(t, e, r) {
549
+ var a = e ? r(It(t), !0) : It(t);
550
+ return mt(a, ue, new t.constructor());
551
+ }
552
+ function ir(t) {
553
+ var e = new t.constructor(t.source, ne.exec(t));
554
+ return e.lastIndex = t.lastIndex, e;
555
+ }
556
+ function ar(t, e, r) {
557
+ var a = e ? r(xt(t), !0) : xt(t);
558
+ return mt(a, fe, new t.constructor());
559
+ }
560
+ function sr(t) {
561
+ return Ht ? Object(Ht.call(t)) : {};
562
+ }
563
+ function cr(t, e) {
564
+ var r = e ? ct(t.buffer) : t.buffer;
565
+ return new t.constructor(r, t.byteOffset, t.length);
566
+ }
567
+ function ur(t, e) {
568
+ var r = -1, a = t.length;
569
+ for (e || (e = Array(a)); ++r < a; )
570
+ e[r] = t[r];
571
+ return e;
572
+ }
573
+ function kt(t, e, r, a) {
574
+ r || (r = {});
575
+ for (var h = -1, p = e.length; ++h < p; ) {
576
+ var A = e[h], b = void 0;
577
+ Kt(r, A, b === void 0 ? t[A] : b);
578
+ }
579
+ return r;
580
+ }
581
+ function fr(t, e) {
582
+ return kt(t, Lt(t), e);
583
+ }
584
+ function lr(t) {
585
+ return Ze(t, ft, Lt);
586
+ }
587
+ function Y(t, e) {
588
+ var r = t.__data__;
589
+ return br(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
590
+ }
591
+ function K(t, e) {
592
+ var r = ge(t, e);
593
+ return tr(r) ? r : void 0;
594
+ }
595
+ var Lt = Bt ? et(Bt, Object) : Er, m = Qe;
596
+ (nt && m(new nt(new ArrayBuffer(1))) != B || W && m(new W()) != S || ot && m(ot.resolve()) != V || it && m(new it()) != _ || at && m(new at()) != C) && (m = function(t) {
597
+ var e = q.call(t), r = e == G ? t.constructor : void 0, a = r ? P(r) : void 0;
598
+ if (a)
599
+ switch (a) {
600
+ case Ee:
601
+ return B;
602
+ case Se:
603
+ return S;
604
+ case Ce:
605
+ return V;
606
+ case je:
607
+ return _;
608
+ case me:
609
+ return C;
610
+ }
611
+ return e;
612
+ });
613
+ function dr(t) {
614
+ var e = t.length, r = t.constructor(e);
615
+ return e && typeof t[0] == "string" && O.call(t, "index") && (r.index = t.index, r.input = t.input), r;
616
+ }
617
+ function hr(t) {
618
+ return typeof t.constructor == "function" && !Vt(t) ? Ye(ye(t)) : {};
619
+ }
620
+ function gr(t, e, r, a) {
621
+ var h = t.constructor;
622
+ switch (e) {
623
+ case J:
624
+ return ct(t);
625
+ case d:
626
+ case g:
627
+ return new h(+t);
628
+ case B:
629
+ return nr(t, a);
630
+ case _t:
631
+ case yt:
632
+ case wt:
633
+ case vt:
634
+ case At:
635
+ case Tt:
636
+ case Ot:
637
+ case Et:
638
+ case St:
639
+ return cr(t, a);
640
+ case S:
641
+ return or(t, a, r);
642
+ case R:
643
+ case y:
644
+ return new h(t);
645
+ case D:
646
+ return ir(t);
647
+ case _:
648
+ return ar(t, a, r);
649
+ case N:
650
+ return sr(t);
651
+ }
652
+ }
653
+ function pr(t, e) {
654
+ return e = e ?? i, !!e && (typeof t == "number" || ie.test(t)) && t > -1 && t % 1 == 0 && t < e;
655
+ }
656
+ function br(t) {
657
+ var e = typeof t;
658
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
659
+ }
660
+ function _r(t) {
661
+ return !!Mt && Mt in t;
662
+ }
663
+ function Vt(t) {
664
+ var e = t && t.constructor, r = typeof e == "function" && e.prototype || z;
665
+ return t === r;
666
+ }
667
+ function P(t) {
668
+ if (t != null) {
669
+ try {
670
+ return Rt.call(t);
671
+ } catch {
672
+ }
673
+ try {
674
+ return t + "";
675
+ } catch {
676
+ }
677
+ }
678
+ return "";
679
+ }
680
+ function yr(t) {
681
+ return st(t, !0, !0);
682
+ }
683
+ function Wt(t, e) {
684
+ return t === e || t !== t && e !== e;
685
+ }
686
+ function wr(t) {
687
+ return vr(t) && O.call(t, "callee") && (!ve.call(t, "callee") || q.call(t) == s);
688
+ }
689
+ var ut = Array.isArray;
690
+ function Ft(t) {
691
+ return t != null && Tr(t.length) && !$t(t);
692
+ }
693
+ function vr(t) {
694
+ return Or(t) && Ft(t);
695
+ }
696
+ var Ar = Te || Sr;
697
+ function $t(t) {
698
+ var e = Z(t) ? q.call(t) : "";
699
+ return e == M || e == L;
700
+ }
701
+ function Tr(t) {
702
+ return typeof t == "number" && t > -1 && t % 1 == 0 && t <= i;
703
+ }
704
+ function Z(t) {
705
+ var e = typeof t;
706
+ return !!t && (e == "object" || e == "function");
707
+ }
708
+ function Or(t) {
709
+ return !!t && typeof t == "object";
710
+ }
711
+ function ft(t) {
712
+ return Ft(t) ? qe(t) : er(t);
713
+ }
714
+ function Er() {
715
+ return [];
716
+ }
717
+ function Sr() {
718
+ return !1;
719
+ }
720
+ o.exports = yr;
721
+ })($, $.exports)), $.exports;
722
+ }
723
+ var Nr = Dr();
724
+ const Br = /* @__PURE__ */ Gr(Nr);
725
+ class Hr {
726
+ constructor(n) {
727
+ this.globalAttrs = [], this.debugger = n.debugger || !1, I.configureSdk({ sdkURL: n.sdkUrl }), I.init({ gsAppid: n.appid }), I.setDebugEnable(this.debugger);
728
+ }
729
+ /** 打印日志 */
730
+ log(...n) {
731
+ this.debugger && console.log(...n);
732
+ }
733
+ /**
734
+ *
735
+ * @description 获取用于上报的属性 (合并公共属性)
736
+ */
737
+ getReportDataMergeGlobalAttrs(n) {
738
+ const c = {}, u = Br(Object.assign.apply(null, [{}, ...this.globalAttrs, n]));
739
+ return Object.keys(u).forEach((i) => {
740
+ if (typeof u[i] == "number")
741
+ return c[i] = u[i];
742
+ u[i] && (c[i] = String(u[i]));
743
+ }), c;
744
+ }
745
+ /**
746
+ *
747
+ * @description 获取原始 GsIdo 对象
748
+ */
749
+ getGsido() {
750
+ return I.getGsido();
751
+ }
752
+ /**
753
+ *
754
+ * @description 设置上报的公共属性
755
+ */
756
+ setReportGlobalAttrs(n = {}) {
757
+ this.globalAttrs.push(n);
758
+ }
759
+ /**
760
+ *
761
+ * @description 上报事件
762
+ */
763
+ report(n) {
764
+ return dt ? ((i, s) => {
765
+ this.log("[个推] 桥接埋点", { name: i, params: s }), ht({
766
+ eventName: i,
767
+ eventParams: s
768
+ });
769
+ })(n.name, this.getReportDataMergeGlobalAttrs(n.params)) : ((i, s) => {
770
+ this.log("[个推] web埋点", { name: i, params: s }), I.onEvent({ id: i, attrs: gt(s) });
771
+ })(n.name, this.getReportDataMergeGlobalAttrs(n.params));
772
+ }
773
+ /**
774
+ *
775
+ * @description 持续类型事件上报 - 开始事件
776
+ */
777
+ reportBeginEvent(n) {
778
+ return dt ? ((i, s) => {
779
+ this.log("[个推] 桥接.begin埋点", { name: i, params: s }), ht({
780
+ eventName: i,
781
+ eventParams: s,
782
+ eventType: "Begin"
783
+ });
784
+ })(n.name, this.getReportDataMergeGlobalAttrs(n.params)) : ((i, s) => {
785
+ this.log("[个推] web.begin埋点", { name: i, params: s }), I.onBeginEvent({ id: i, attrs: gt(s) });
786
+ })(n.name, this.getReportDataMergeGlobalAttrs(n.params));
787
+ }
788
+ /**
789
+ *
790
+ * @description 持续类型事件上报 - 结束事件
791
+ */
792
+ reportEndEvent(n) {
793
+ return dt ? ((i, s) => {
794
+ this.log("[个推] 桥接.end埋点", { name: i, params: s }), ht({
795
+ eventName: i,
796
+ eventParams: s,
797
+ eventType: "End"
798
+ });
799
+ })(n.name, this.getReportDataMergeGlobalAttrs(n.params)) : ((i, s) => {
800
+ this.log("[个推] web.end埋点", { name: i, params: s }), I.onEndEvent({ id: i, attrs: gt(s) });
801
+ })(n.name, this.getReportDataMergeGlobalAttrs(n.params));
802
+ }
803
+ }
804
+ function ee(o) {
805
+ if (typeof o != "object" || o === null || Array.isArray(o))
806
+ return {};
807
+ const n = {};
808
+ return Object.keys(o).forEach((c) => {
809
+ const u = o[c];
810
+ u !== void 0 && (n[c] = u);
811
+ }), n;
812
+ }
813
+ class pt {
814
+ constructor(n) {
815
+ this.act = n.act, this.biz = n.biz, this.unit = n.unit, this.ref1 = n.ref1, this.ref2 = n.ref2, this.ref3 = n.ref3, this.sid = n.sid, this.title = n.title, this.channel = n.channel, this.depart = n.depart, this.suid = n.suid, Object.defineProperty(this, "docId", {
816
+ enumerable: !0,
817
+ configurable: !1,
818
+ get: () => pt.generateDocId(this)
819
+ });
820
+ }
821
+ /**
822
+ *
823
+ * @description 生成稿件标识
824
+ */
825
+ static generateDocId(n) {
826
+ return [n.biz, n.unit, n.ref1, n.ref2, n.ref3, n.sid].filter((c) => !!c).join("-");
827
+ }
828
+ /**
829
+ *
830
+ * @description 生成稿件数据(自动生成docId)
831
+ */
832
+ static createDocTrackEvent(n) {
833
+ return ee(new pt(n));
834
+ }
835
+ }
836
+ class bt {
837
+ constructor(n) {
838
+ this.biz = n.biz, this.unit = n.unit, this.ref1 = n.ref1, this.ref2 = n.ref2, this.ref3 = n.ref3, this.sid = n.sid, this.title = n.title, this.channel = n.channel, this.depart = n.depart, this.referer = n.referer, this.suid = n.suid, Object.defineProperty(this, "docId", {
839
+ enumerable: !0,
840
+ configurable: !1,
841
+ get: () => bt.generateDocId(this)
842
+ });
843
+ }
844
+ /**
845
+ *
846
+ * @description 生成稿件标识
847
+ */
848
+ static generateDocId(n) {
849
+ return [n.biz, n.unit, n.ref1, n.ref2, n.ref3, n.sid].filter((c) => !!c).join("-");
850
+ }
851
+ /**
852
+ *
853
+ * @description 生成稿件数据(自动生成docId)
854
+ */
855
+ static createDocTrackEvent(n) {
856
+ return ee(new bt(n));
857
+ }
858
+ }
859
+ export {
860
+ Hr as DataAnalysis,
861
+ pt as DocActionEvent,
862
+ bt as DocVisitEvent
863
+ };