dishub-analytics.dashboard 1.0.0

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,146 @@
1
+ (function(q,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],M):(q=typeof globalThis<"u"?globalThis:q||self,M(q.DishubAnalyticsDashboard={},q.React))})(this,function(q,M){"use strict";function ct(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Be={exports:{}},Ne={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var dt;function lr(){if(dt)return Ne;dt=1;var a=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function c(o,l,u){var h=null;if(u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),"key"in l){u={};for(var b in l)b!=="key"&&(u[b]=l[b])}else u=l;return l=u.ref,{$$typeof:a,type:o,key:h,ref:l!==void 0?l:null,props:u}}return Ne.Fragment=d,Ne.jsx=c,Ne.jsxs=c,Ne}var Ce={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ut;function cr(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&function(){function a(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===ge?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case m:return"Fragment";case _:return"Profiler";case x:return"StrictMode";case B:return"Suspense";case J:return"SuspenseList";case ee:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case j:return"Portal";case y:return g.displayName||"Context";case P:return(g._context.displayName||"Context")+".Consumer";case A:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case H:return E=g.displayName||null,E!==null?E:a(g.type)||"Memo";case G:E=g._payload,g=g._init;try{return a(g(E))}catch{}}return null}function d(g){return""+g}function c(g){try{d(g);var E=!1}catch{E=!0}if(E){E=console;var V=E.error,Y=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return V.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Y),d(g)}}function o(g){if(g===m)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===G)return"<...>";try{var E=a(g);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function l(){var g=z.A;return g===null?null:g.getOwner()}function u(){return Error("react-stack-top-frame")}function h(g){if(ie.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function b(g,E){function V(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}V.isReactWarning=!0,Object.defineProperty(g,"key",{get:V,configurable:!0})}function w(){var g=a(this.type);return be[g]||(be[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function O(g,E,V,Y,$,Q){var K=V.ref;return g={$$typeof:T,type:g,key:E,props:V,_owner:Y},(K!==void 0?K:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:w}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function p(g,E,V,Y,$,Q){var K=E.children;if(K!==void 0)if(Y)if(pe(K)){for(Y=0;Y<K.length;Y++)C(K[Y]);Object.freeze&&Object.freeze(K)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(K);if(ie.call(E,"key")){K=a(g);var le=Object.keys(E).filter(function(Oe){return Oe!=="key"});Y=0<le.length?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}",xe[K+Y]||(le=0<le.length?"{"+le.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,Y,K,le,K),xe[K+Y]=!0)}if(K=null,V!==void 0&&(c(V),K=""+V),h(E)&&(c(E.key),K=""+E.key),"key"in E){V={};for(var re in E)re!=="key"&&(V[re]=E[re])}else V=E;return K&&b(V,typeof g=="function"?g.displayName||g.name||"Unknown":g),O(g,K,V,l(),$,Q)}function C(g){k(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===G&&(g._payload.status==="fulfilled"?k(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function k(g){return typeof g=="object"&&g!==null&&g.$$typeof===T}var S=M,T=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ge=Symbol.for("react.client.reference"),z=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,pe=Array.isArray,fe=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(g){return g()}};var oe,be={},me=S.react_stack_bottom_frame.bind(S,u)(),se=fe(o(u)),xe={};Ce.Fragment=m,Ce.jsx=function(g,E,V){var Y=1e4>z.recentlyCreatedOwnerStacks++;return p(g,E,V,!1,Y?Error("react-stack-top-frame"):me,Y?fe(o(g)):se)},Ce.jsxs=function(g,E,V){var Y=1e4>z.recentlyCreatedOwnerStacks++;return p(g,E,V,!0,Y?Error("react-stack-top-frame"):me,Y?fe(o(g)):se)}}()),Ce}process.env.NODE_ENV==="production"?Be.exports=lr():Be.exports=cr();var n=Be.exports;/**
23
+ * @license lucide-react v0.344.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */var dr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
28
+ * @license lucide-react v0.344.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const ur=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),X=(a,d)=>{const c=M.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:u=2,absoluteStrokeWidth:h,className:b="",children:w,...O},p)=>M.createElement("svg",{ref:p,...dr,width:l,height:l,stroke:o,strokeWidth:h?Number(u)*24/Number(l):u,className:["lucide",`lucide-${ur(a)}`,b].join(" "),...O},[...d.map(([C,k])=>M.createElement(C,k)),...Array.isArray(w)?w:[w]]));return c.displayName=`${a}`,c};/**
33
+ * @license lucide-react v0.344.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */const Fe=X("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
38
+ * @license lucide-react v0.344.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */const hr=X("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
43
+ * @license lucide-react v0.344.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const pr=X("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
48
+ * @license lucide-react v0.344.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const Le=X("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
53
+ * @license lucide-react v0.344.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const fr=X("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
58
+ * @license lucide-react v0.344.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const ht=X("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
63
+ * @license lucide-react v0.344.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const mr=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
68
+ * @license lucide-react v0.344.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const gr=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
73
+ * @license lucide-react v0.344.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const pt=X("Compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76",key:"m9r19z"}]]);/**
78
+ * @license lucide-react v0.344.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const br=X("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
83
+ * @license lucide-react v0.344.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const Ge=X("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
88
+ * @license lucide-react v0.344.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const xr=X("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
93
+ * @license lucide-react v0.344.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const vr=X("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
98
+ * @license lucide-react v0.344.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const ft=X("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
103
+ * @license lucide-react v0.344.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const wr=X("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
108
+ * @license lucide-react v0.344.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const mt=X("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
113
+ * @license lucide-react v0.344.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const gt=X("MousePointer2",[["path",{d:"m4 4 7.07 17 2.51-7.39L21 11.07z",key:"1vqm48"}]]);/**
118
+ * @license lucide-react v0.344.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const yr=X("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
123
+ * @license lucide-react v0.344.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const bt=X("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
128
+ * @license lucide-react v0.344.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const Ve=X("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
133
+ * @license lucide-react v0.344.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const jr=X("Wallet",[["path",{d:"M21 12V7H5a2 2 0 0 1 0-4h14v4",key:"195gfw"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h16v-5",key:"195n9w"}],["path",{d:"M18 12a2 2 0 0 0 0 4h4v-4Z",key:"vllfpd"}]]);var xt={exports:{}};/*!
138
+ * Pusher JavaScript Library v8.4.0
139
+ * https://pusher.com/
140
+ *
141
+ * Copyright 2020, Pusher
142
+ * Released under the MIT licence.
143
+ */(function(a,d){(function(o,l){a.exports=l()})(window,function(){return function(c){var o={};function l(u){if(o[u])return o[u].exports;var h=o[u]={i:u,l:!1,exports:{}};return c[u].call(h.exports,h,h.exports,l),h.l=!0,h.exports}return l.m=c,l.c=o,l.d=function(u,h,b){l.o(u,h)||Object.defineProperty(u,h,{enumerable:!0,get:b})},l.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},l.t=function(u,h){if(h&1&&(u=l(u)),h&8||h&4&&typeof u=="object"&&u&&u.__esModule)return u;var b=Object.create(null);if(l.r(b),Object.defineProperty(b,"default",{enumerable:!0,value:u}),h&2&&typeof u!="string")for(var w in u)l.d(b,w,(function(O){return u[O]}).bind(null,w));return b},l.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};return l.d(h,"a",h),h},l.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},l.p="",l(l.s=2)}([function(c,o,l){var u=this&&this.__extends||function(){var j=function(m,x){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,P){_.__proto__=P}||function(_,P){for(var y in P)P.hasOwnProperty(y)&&(_[y]=P[y])},j(m,x)};return function(m,x){j(m,x);function _(){this.constructor=m}m.prototype=x===null?Object.create(x):(_.prototype=x.prototype,new _)}}();Object.defineProperty(o,"__esModule",{value:!0});var h=256,b=function(){function j(m){m===void 0&&(m="="),this._paddingCharacter=m}return j.prototype.encodedLength=function(m){return this._paddingCharacter?(m+2)/3*4|0:(m*8+5)/6|0},j.prototype.encode=function(m){for(var x="",_=0;_<m.length-2;_+=3){var P=m[_]<<16|m[_+1]<<8|m[_+2];x+=this._encodeByte(P>>>3*6&63),x+=this._encodeByte(P>>>2*6&63),x+=this._encodeByte(P>>>1*6&63),x+=this._encodeByte(P>>>0*6&63)}var y=m.length-_;if(y>0){var P=m[_]<<16|(y===2?m[_+1]<<8:0);x+=this._encodeByte(P>>>3*6&63),x+=this._encodeByte(P>>>2*6&63),y===2?x+=this._encodeByte(P>>>1*6&63):x+=this._paddingCharacter||"",x+=this._paddingCharacter||""}return x},j.prototype.maxDecodedLength=function(m){return this._paddingCharacter?m/4*3|0:(m*6+7)/8|0},j.prototype.decodedLength=function(m){return this.maxDecodedLength(m.length-this._getPaddingLength(m))},j.prototype.decode=function(m){if(m.length===0)return new Uint8Array(0);for(var x=this._getPaddingLength(m),_=m.length-x,P=new Uint8Array(this.maxDecodedLength(_)),y=0,A=0,B=0,J=0,H=0,G=0,ee=0;A<_-4;A+=4)J=this._decodeChar(m.charCodeAt(A+0)),H=this._decodeChar(m.charCodeAt(A+1)),G=this._decodeChar(m.charCodeAt(A+2)),ee=this._decodeChar(m.charCodeAt(A+3)),P[y++]=J<<2|H>>>4,P[y++]=H<<4|G>>>2,P[y++]=G<<6|ee,B|=J&h,B|=H&h,B|=G&h,B|=ee&h;if(A<_-1&&(J=this._decodeChar(m.charCodeAt(A)),H=this._decodeChar(m.charCodeAt(A+1)),P[y++]=J<<2|H>>>4,B|=J&h,B|=H&h),A<_-2&&(G=this._decodeChar(m.charCodeAt(A+2)),P[y++]=H<<4|G>>>2,B|=G&h),A<_-3&&(ee=this._decodeChar(m.charCodeAt(A+3)),P[y++]=G<<6|ee,B|=ee&h),B!==0)throw new Error("Base64Coder: incorrect characters for decoding");return P},j.prototype._encodeByte=function(m){var x=m;return x+=65,x+=25-m>>>8&6,x+=51-m>>>8&-75,x+=61-m>>>8&-15,x+=62-m>>>8&3,String.fromCharCode(x)},j.prototype._decodeChar=function(m){var x=h;return x+=(42-m&m-44)>>>8&-h+m-43+62,x+=(46-m&m-48)>>>8&-h+m-47+63,x+=(47-m&m-58)>>>8&-h+m-48+52,x+=(64-m&m-91)>>>8&-h+m-65+0,x+=(96-m&m-123)>>>8&-h+m-97+26,x},j.prototype._getPaddingLength=function(m){var x=0;if(this._paddingCharacter){for(var _=m.length-1;_>=0&&m[_]===this._paddingCharacter;_--)x++;if(m.length<4||x>2)throw new Error("Base64Coder: incorrect padding")}return x},j}();o.Coder=b;var w=new b;function O(j){return w.encode(j)}o.encode=O;function p(j){return w.decode(j)}o.decode=p;var C=function(j){u(m,j);function m(){return j!==null&&j.apply(this,arguments)||this}return m.prototype._encodeByte=function(x){var _=x;return _+=65,_+=25-x>>>8&6,_+=51-x>>>8&-75,_+=61-x>>>8&-13,_+=62-x>>>8&49,String.fromCharCode(_)},m.prototype._decodeChar=function(x){var _=h;return _+=(44-x&x-46)>>>8&-h+x-45+62,_+=(94-x&x-96)>>>8&-h+x-95+63,_+=(47-x&x-58)>>>8&-h+x-48+52,_+=(64-x&x-91)>>>8&-h+x-65+0,_+=(96-x&x-123)>>>8&-h+x-97+26,_},m}(b);o.URLSafeCoder=C;var k=new C;function S(j){return k.encode(j)}o.encodeURLSafe=S;function T(j){return k.decode(j)}o.decodeURLSafe=T,o.encodedLength=function(j){return w.encodedLength(j)},o.maxDecodedLength=function(j){return w.maxDecodedLength(j)},o.decodedLength=function(j){return w.decodedLength(j)}},function(c,o,l){Object.defineProperty(o,"__esModule",{value:!0});var u="utf8: invalid string",h="utf8: invalid source encoding";function b(p){for(var C=new Uint8Array(w(p)),k=0,S=0;S<p.length;S++){var T=p.charCodeAt(S);T<128?C[k++]=T:T<2048?(C[k++]=192|T>>6,C[k++]=128|T&63):T<55296?(C[k++]=224|T>>12,C[k++]=128|T>>6&63,C[k++]=128|T&63):(S++,T=(T&1023)<<10,T|=p.charCodeAt(S)&1023,T+=65536,C[k++]=240|T>>18,C[k++]=128|T>>12&63,C[k++]=128|T>>6&63,C[k++]=128|T&63)}return C}o.encode=b;function w(p){for(var C=0,k=0;k<p.length;k++){var S=p.charCodeAt(k);if(S<128)C+=1;else if(S<2048)C+=2;else if(S<55296)C+=3;else if(S<=57343){if(k>=p.length-1)throw new Error(u);k++,C+=4}else throw new Error(u)}return C}o.encodedLength=w;function O(p){for(var C=[],k=0;k<p.length;k++){var S=p[k];if(S&128){var T=void 0;if(S<224){if(k>=p.length)throw new Error(h);var j=p[++k];if((j&192)!==128)throw new Error(h);S=(S&31)<<6|j&63,T=128}else if(S<240){if(k>=p.length-1)throw new Error(h);var j=p[++k],m=p[++k];if((j&192)!==128||(m&192)!==128)throw new Error(h);S=(S&15)<<12|(j&63)<<6|m&63,T=2048}else if(S<248){if(k>=p.length-2)throw new Error(h);var j=p[++k],m=p[++k],x=p[++k];if((j&192)!==128||(m&192)!==128||(x&192)!==128)throw new Error(h);S=(S&15)<<18|(j&63)<<12|(m&63)<<6|x&63,T=65536}else throw new Error(h);if(S<T||S>=55296&&S<=57343)throw new Error(h);if(S>=65536){if(S>1114111)throw new Error(h);S-=65536,C.push(String.fromCharCode(55296|S>>10)),S=56320|S&1023}}C.push(String.fromCharCode(S))}return C.join("")}o.decode=O},function(c,o,l){c.exports=l(3).default},function(c,o,l){l.r(o);class u{constructor(e,t){this.lastId=0,this.prefix=e,this.name=t}create(e){this.lastId++;var t=this.lastId,s=this.prefix+t,i=this.name+"["+t+"]",f=!1,v=function(){f||(e.apply(null,arguments),f=!0)};return this[t]=v,{number:t,id:s,name:i,callback:v}}remove(e){delete this[e.number]}}var h=new u("_pusher_script_","Pusher.ScriptReceivers"),b={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},w=b;class O{constructor(e){this.options=e,this.receivers=e.receivers||h,this.loading={}}load(e,t,s){var i=this;if(i.loading[e]&&i.loading[e].length>0)i.loading[e].push(s);else{i.loading[e]=[s];var f=L.createScriptRequest(i.getPath(e,t)),v=i.receivers.create(function(N){if(i.receivers.remove(v),i.loading[e]){var R=i.loading[e];delete i.loading[e];for(var D=function(Z){Z||f.cleanup()},U=0;U<R.length;U++)R[U](N,D)}});f.send(v)}}getRoot(e){var t,s=L.getDocument().location.protocol;return e&&e.useTLS||s==="https:"?t=this.options.cdn_https:t=this.options.cdn_http,t.replace(/\/*$/,"")+"/"+this.options.version}getPath(e,t){return this.getRoot(t)+"/"+e+this.options.suffix+".js"}}var p=new u("_pusher_dependencies","Pusher.DependenciesReceivers"),C=new O({cdn_http:w.cdn_http,cdn_https:w.cdn_https,version:w.VERSION,suffix:w.dependency_suffix,receivers:p});const k={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var T={buildLogSuffix:function(r){const e="See:",t=k.urls[r];if(!t)return"";let s;return t.fullUrl?s=t.fullUrl:t.path&&(s=k.baseUrl+t.path),s?`${e} ${s}`:""}},j;(function(r){r.UserAuthentication="user-authentication",r.ChannelAuthorization="channel-authorization"})(j||(j={}));class m extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class y extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class B extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class J extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(e,t){super(t),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}var ee=function(r,e,t,s,i){const f=L.createXHR();f.open("POST",t.endpoint,!0),f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var v in t.headers)f.setRequestHeader(v,t.headers[v]);if(t.headersProvider!=null){let N=t.headersProvider();for(var v in N)f.setRequestHeader(v,N[v])}return f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){let N,R=!1;try{N=JSON.parse(f.responseText),R=!0}catch{i(new H(200,`JSON returned from ${s.toString()} endpoint was invalid, yet status code was 200. Data was: ${f.responseText}`),null)}R&&i(null,N)}else{let N="";switch(s){case j.UserAuthentication:N=T.buildLogSuffix("authenticationEndpoint");break;case j.ChannelAuthorization:N=`Clients must be authorized to join private or presence channels. ${T.buildLogSuffix("authorizationEndpoint")}`;break}i(new H(f.status,`Unable to retrieve auth string from ${s.toString()} endpoint - received status: ${f.status} from ${t.endpoint}. ${N}`),null)}},f.send(e),f};function ge(r){return be(fe(r))}var z=String.fromCharCode,ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe=function(r){var e=r.charCodeAt(0);return e<128?r:e<2048?z(192|e>>>6)+z(128|e&63):z(224|e>>>12&15)+z(128|e>>>6&63)+z(128|e&63)},fe=function(r){return r.replace(/[^\x00-\x7F]/g,pe)},oe=function(r){var e=[0,2,1][r.length%3],t=r.charCodeAt(0)<<16|(r.length>1?r.charCodeAt(1):0)<<8|(r.length>2?r.charCodeAt(2):0),s=[ie.charAt(t>>>18),ie.charAt(t>>>12&63),e>=2?"=":ie.charAt(t>>>6&63),e>=1?"=":ie.charAt(t&63)];return s.join("")},be=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,oe)};class me{constructor(e,t,s,i){this.clear=t,this.timer=e(()=>{this.timer&&(this.timer=i(this.timer))},s)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var se=me;function xe(r){window.clearTimeout(r)}function g(r){window.clearInterval(r)}class E extends se{constructor(e,t){super(setTimeout,xe,e,function(s){return t(),null})}}class V extends se{constructor(e,t){super(setInterval,g,e,function(s){return t(),s})}}var Y={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new E(0,r)},method(r,...e){var t=Array.prototype.slice.call(arguments,1);return function(s){return s[r].apply(s,t.concat(arguments))}}},$=Y;function Q(r,...e){for(var t=0;t<e.length;t++){var s=e[t];for(var i in s)s[i]&&s[i].constructor&&s[i].constructor===Object?r[i]=Q(r[i]||{},s[i]):r[i]=s[i]}return r}function K(){for(var r=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?r.push(arguments[e]):r.push(Me(arguments[e]));return r.join(" : ")}function le(r,e){var t=Array.prototype.indexOf;if(r===null)return-1;if(t&&r.indexOf===t)return r.indexOf(e);for(var s=0,i=r.length;s<i;s++)if(r[s]===e)return s;return-1}function re(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e(r[t],t,r)}function Oe(r){var e=[];return re(r,function(t,s){e.push(s)}),e}function dn(r){var e=[];return re(r,function(t){e.push(t)}),e}function Ae(r,e,t){for(var s=0;s<r.length;s++)e.call(t||window,r[s],s,r)}function Dt(r,e){for(var t=[],s=0;s<r.length;s++)t.push(e(r[s],s,r,t));return t}function un(r,e){var t={};return re(r,function(s,i){t[i]=e(s)}),t}function Ut(r,e){e=e||function(i){return!!i};for(var t=[],s=0;s<r.length;s++)e(r[s],s,r,t)&&t.push(r[s]);return t}function Ht(r,e){var t={};return re(r,function(s,i){(e&&e(s,i,r,t)||s)&&(t[i]=s)}),t}function hn(r){var e=[];return re(r,function(t,s){e.push([s,t])}),e}function Bt(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t,r))return!0;return!1}function pn(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t,r))return!1;return!0}function fn(r){return un(r,function(e){return typeof e=="object"&&(e=Me(e)),encodeURIComponent(ge(e.toString()))})}function mn(r){var e=Ht(r,function(s){return s!==void 0}),t=Dt(hn(fn(e)),$.method("join","=")).join("&");return t}function gn(r){var e=[],t=[];return function s(i,f){var v,N,R;switch(typeof i){case"object":if(!i)return null;for(v=0;v<e.length;v+=1)if(e[v]===i)return{$ref:t[v]};if(e.push(i),t.push(f),Object.prototype.toString.apply(i)==="[object Array]")for(R=[],v=0;v<i.length;v+=1)R[v]=s(i[v],f+"["+v+"]");else{R={};for(N in i)Object.prototype.hasOwnProperty.call(i,N)&&(R[N]=s(i[N],f+"["+JSON.stringify(N)+"]"))}return R;case"number":case"string":case"boolean":return i}}(r,"$")}function Me(r){try{return JSON.stringify(r)}catch{return JSON.stringify(gn(r))}}class bn{constructor(){this.globalLog=e=>{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}log(e,...t){var s=K.apply(this,arguments);at.log?at.log(s):at.logToConsole&&e.bind(this)(s)}}var W=new bn,xn=function(r,e,t,s,i){(t.headers!==void 0||t.headersProvider!=null)&&W.warn(`To send headers with the ${s.toString()} request, you must use AJAX, rather than JSONP.`);var f=r.nextAuthCallbackID.toString();r.nextAuthCallbackID++;var v=r.getDocument(),N=v.createElement("script");r.auth_callbacks[f]=function(U){i(null,U)};var R="Pusher.auth_callbacks['"+f+"']";N.src=t.endpoint+"?callback="+encodeURIComponent(R)+"&"+e;var D=v.getElementsByTagName("head")[0]||v.documentElement;D.insertBefore(N,D.firstChild)},vn=xn;class wn{constructor(e){this.src=e}send(e){var t=this,s="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(s)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){(t.script.readyState==="loaded"||t.script.readyState==="complete")&&e.callback(null)},t.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+s+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var i=document.getElementsByTagName("head")[0];i.insertBefore(t.script,i.firstChild),t.errorScript&&i.insertBefore(t.errorScript,t.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class yn{constructor(e,t){this.url=e,this.data=t}send(e){if(!this.request){var t=mn(this.data),s=this.url+"/"+e.number+"?"+t;this.request=L.createScriptRequest(s),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var jn=function(r,e){return function(t,s){var i="http"+(e?"s":"")+"://",f=i+(r.host||r.options.host)+r.options.path,v=L.createJSONPRequest(f,t),N=L.ScriptReceivers.create(function(R,D){h.remove(N),v.cleanup(),D&&D.host&&(r.host=D.host),s&&s(R,D)});v.send(N)}},_n={name:"jsonp",getAgent:jn},kn=_n;function $e(r,e,t){var s=r+(e.useTLS?"s":""),i=e.useTLS?e.hostTLS:e.hostNonTLS;return s+"://"+i+t}function Ke(r,e){var t="/app/"+r,s="?protocol="+w.PROTOCOL+"&client=js&version="+w.VERSION+(e?"&"+e:"");return t+s}var Sn={getInitial:function(r,e){var t=(e.httpPath||"")+Ke(r,"flash=false");return $e("ws",e,t)}},Nn={getInitial:function(r,e){var t=(e.httpPath||"/pusher")+Ke(r);return $e("http",e,t)}},Cn={getInitial:function(r,e){return $e("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Ke(r)}};class Tn{constructor(){this._callbacks={}}get(e){return this._callbacks[Ze(e)]}add(e,t,s){var i=Ze(e);this._callbacks[i]=this._callbacks[i]||[],this._callbacks[i].push({fn:t,context:s})}remove(e,t,s){if(!e&&!t&&!s){this._callbacks={};return}var i=e?[Ze(e)]:Oe(this._callbacks);t||s?this.removeCallback(i,t,s):this.removeAllCallbacks(i)}removeCallback(e,t,s){Ae(e,function(i){this._callbacks[i]=Ut(this._callbacks[i]||[],function(f){return t&&t!==f.fn||s&&s!==f.context}),this._callbacks[i].length===0&&delete this._callbacks[i]},this)}removeAllCallbacks(e){Ae(e,function(t){delete this._callbacks[t]},this)}}function Ze(r){return"_"+r}class ce{constructor(e){this.callbacks=new Tn,this.global_callbacks=[],this.failThrough=e}bind(e,t,s){return this.callbacks.add(e,t,s),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,t,s){return this.callbacks.remove(e,t,s),this}unbind_global(e){return e?(this.global_callbacks=Ut(this.global_callbacks||[],t=>t!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,t,s){for(var i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](e,t);var f=this.callbacks.get(e),v=[];if(s?v.push(t,s):t&&v.push(t),f&&f.length>0)for(var i=0;i<f.length;i++)f[i].fn.apply(f[i].context||window,v);else this.failThrough&&this.failThrough(e,t);return this}}class Pn extends ce{constructor(e,t,s,i,f){super(),this.initialize=L.transportConnectionInitializer,this.hooks=e,this.name=t,this.priority=s,this.key=i,this.options=f,this.state="new",this.timeline=f.timeline,this.activityTimeout=f.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var e=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(e,this.options)}catch(t){return $.defer(()=>{this.onError(t),this.changeState("closed")}),!1}return this.bindListeners(),W.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(e){return this.state==="open"?($.defer(()=>{this.socket&&this.socket.send(e)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t})),this.emit(e,t)}buildTimelineMessage(e){return Q({cid:this.id},e)}}class Se{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,s,i){return new Pn(this.hooks,e,t,s,i)}}var An=new Se({urls:Sn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!L.getWebSocketAPI()},isSupported:function(){return!!L.getWebSocketAPI()},getSocket:function(r){return L.createWebSocket(r)}}),Ft={urls:Nn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Gt=Q({getSocket:function(r){return L.HTTPFactory.createStreamingSocket(r)}},Ft),Vt=Q({getSocket:function(r){return L.HTTPFactory.createPollingSocket(r)}},Ft),qt={isSupported:function(){return L.isXHRSupported()}},En=new Se(Q({},Gt,qt)),Rn=new Se(Q({},Vt,qt)),Ln={ws:An,xhr_streaming:En,xhr_polling:Rn},ze=Ln,In=new Se({file:"sockjs",urls:Cn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(r,e){return new window.SockJS(r,null,{js_path:C.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(r,e){r.send(JSON.stringify({path:e}))}}),Wt={isSupported:function(r){var e=L.isXDRSupported(r.useTLS);return e}},On=new Se(Q({},Gt,Wt)),Mn=new Se(Q({},Vt,Wt));ze.xdr_streaming=On,ze.xdr_polling=Mn,ze.sockjs=In;var zn=ze;class Dn extends ce{constructor(){super();var e=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Un=new Dn;class Hn{constructor(e,t,s){this.manager=e,this.transport=t,this.minPingDelay=s.minPingDelay,this.maxPingDelay=s.maxPingDelay,this.pingDelay=void 0}createConnection(e,t,s,i){i=Q({},i,{activityTimeout:this.pingDelay});var f=this.transport.createConnection(e,t,s,i),v=null,N=function(){f.unbind("open",N),f.bind("closed",R),v=$.now()},R=D=>{if(f.unbind("closed",R),D.code===1002||D.code===1003)this.manager.reportDeath();else if(!D.wasClean&&v){var U=$.now()-v;U<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(U/2,this.minPingDelay))}};return f.bind("open",N),f}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Jt={decodeMessage:function(r){try{var e=JSON.parse(r.data),t=e.data;if(typeof t=="string")try{t=JSON.parse(e.data)}catch{}var s={event:e.event,channel:e.channel,data:t};return e.user_id&&(s.user_id=e.user_id),s}catch(i){throw{type:"MessageParseError",error:i,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=Jt.decodeMessage(r);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:e.data.activity_timeout*1e3}}else{if(e.event==="pusher:error")return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"}},getCloseAction:function(r){return r.code<4e3?r.code>=1002&&r.code<=1004?"backoff":null:r.code===4e3?"tls_only":r.code<4100?"refused":r.code<4200?"backoff":r.code<4300?"retry":"refused"},getCloseError:function(r){return r.code!==1e3&&r.code!==1001?{type:"PusherError",data:{code:r.code,message:r.reason||r.message}}:null}};var ve=Jt;class Bn extends ce{constructor(e,t){super(),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,t,s){var i={event:e,data:t};return s&&(i.channel=s),W.debug("Event sent",i),this.send(ve.encodeMessage(i))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:s=>{var i;try{i=ve.decodeMessage(s)}catch(f){this.emit("error",{type:"MessageParseError",error:f,data:s.data})}if(i!==void 0){switch(W.debug("Event recd",i),i.event){case"pusher:error":this.emit("error",{type:"PusherError",data:i.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",i)}},activity:()=>{this.emit("activity")},error:s=>{this.emit("error",s)},closed:s=>{t(),s&&s.code&&this.handleCloseEvent(s),this.transport=null,this.emit("closed")}},t=()=>{re(e,(s,i)=>{this.transport.unbind(i,s)})};re(e,(s,i)=>{this.transport.bind(i,s)})}handleCloseEvent(e){var t=ve.getCloseAction(e),s=ve.getCloseError(e);s&&this.emit("error",s),t&&this.emit(t,{action:t,error:s})}}class Fn{constructor(e,t){this.transport=e,this.callback=t,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var t;try{t=ve.processHandshake(e)}catch(s){this.finish("error",{error:s}),this.transport.close();return}t.action==="connected"?this.finish("connected",{connection:new Bn(t.id,this.transport),activityTimeout:t.activityTimeout}):(this.finish(t.action,{error:t.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var t=ve.getCloseAction(e)||"backoff",s=ve.getCloseError(e);this.finish(t,{error:s})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,t){this.callback(Q({transport:this.transport,action:e},t))}}class Gn{constructor(e,t){this.timeline=e,this.options=t||{}}send(e,t){this.timeline.isEmpty()||this.timeline.send(L.TimelineTransport.getAgent(this,e),t)}}class Qe extends ce{constructor(e,t){super(function(s,i){W.debug("No callbacks on "+e+" for "+s)}),this.name=e,this.pusher=t,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,t){return t(null,{auth:""})}trigger(e,t){if(e.indexOf("client-")!==0)throw new m("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var s=T.buildLogSuffix("triggeringClientEvents");W.warn(`Client event triggered before channel 'subscription_succeeded' event . ${s}`)}return this.pusher.send_event(e,t,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var t=e.event,s=e.data;if(t==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(t==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(t.indexOf("pusher_internal:")!==0){var i={};this.emit(t,s,i)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(e,t)=>{e?(this.subscriptionPending=!1,W.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof H?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:t.auth,channel_data:t.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class et extends Qe{authorize(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}class Vn{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){re(this.members,(t,s)=>{e(this.get(s))})}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var qn=function(r,e,t,s){function i(f){return f instanceof t?f:new t(function(v){v(f)})}return new(t||(t=Promise))(function(f,v){function N(U){try{D(s.next(U))}catch(Z){v(Z)}}function R(U){try{D(s.throw(U))}catch(Z){v(Z)}}function D(U){U.done?f(U.value):i(U.value).then(N,R)}D((s=s.apply(r,e||[])).next())})};class Wn extends et{constructor(e,t){super(e,t),this.members=new Vn}authorize(e,t){super.authorize(e,(s,i)=>qn(this,void 0,void 0,function*(){if(!s)if(i=i,i.channel_data!=null){var f=JSON.parse(i.channel_data);this.members.setMyID(f.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let v=T.buildLogSuffix("authorizationEndpoint");W.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${v}, or the user should be signed in.`),t("Invalid auth response");return}t(s,i)}))}handleEvent(e){var t=e.event;if(t.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var s=e.data,i={};e.user_id&&(i.user_id=e.user_id),this.emit(t,s,i)}}handleInternalEvent(e){var t=e.event,s=e.data;switch(t){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var i=this.members.addMember(s);this.emit("pusher:member_added",i);break;case"pusher_internal:member_removed":var f=this.members.removeMember(s);f&&this.emit("pusher:member_removed",f);break}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Jn=l(1),tt=l(0);class Xn extends et{constructor(e,t,s){super(e,t),this.key=null,this.nacl=s}authorize(e,t){super.authorize(e,(s,i)=>{if(s){t(s,i);return}let f=i.shared_secret;if(!f){t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(tt.decode)(f),delete i.shared_secret,t(null,i)})}trigger(e,t){throw new A("Client events are not currently supported for encrypted channels")}handleEvent(e){var t=e.event,s=e.data;if(t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(t,s)}handleEncryptedEvent(e,t){if(!this.key){W.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!t.ciphertext||!t.nonce){W.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}let s=Object(tt.decode)(t.ciphertext);if(s.length<this.nacl.secretbox.overheadLength){W.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${s.length}`);return}let i=Object(tt.decode)(t.nonce);if(i.length<this.nacl.secretbox.nonceLength){W.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${i.length}`);return}let f=this.nacl.secretbox.open(s,i,this.key);if(f===null){W.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(v,N)=>{if(v){W.error(`Failed to make a request to the authEndpoint: ${N}. Unable to fetch new key, so dropping encrypted event`);return}if(f=this.nacl.secretbox.open(s,i,this.key),f===null){W.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(f))});return}this.emit(e,this.getDataToEmit(f))}getDataToEmit(e){let t=Object(Jn.decode)(e);try{return JSON.parse(t)}catch{return t}}}class Yn extends ce{constructor(e,t){super(),this.state="initialized",this.connection=null,this.key=e,this.options=t,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var s=L.getNetwork();s.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),s.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(e){return this.connection?this.connection.send(e):!1}send_event(e,t,s){return this.connection?this.connection.send_event(e,t,s):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(t,s)=>{t?this.runner=this.strategy.connect(0,e):s.action==="error"?(this.emit("error",{type:"HandshakeError",error:s.error}),this.timeline.error({handshakeError:s.error})):(this.abortConnecting(),this.handshakeCallbacks[s.action](s))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var e=this.abandonConnection();e.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new E(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new E(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new E(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new E(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return Q({},e,{message:t=>{this.resetActivityCheck(),this.emit("message",t)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:t=>{this.emit("error",t)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return Q({},e,{connected:t=>{this.activityTimeout=Math.min(this.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(t.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=t=>s=>{s.error&&this.emit("error",{type:"WebSocketError",error:s.error}),t(s)};return{tls_only:e(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:e(()=>{this.disconnect()}),backoff:e(()=>{this.retryIn(1e3)}),retry:e(()=>{this.retryIn(0)})}}setConnection(e){this.connection=e;for(var t in this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}}updateState(e,t){var s=this.state;if(this.state=e,s!==e){var i=e;i==="connected"&&(i+=" with new socket ID "+t.socket_id),W.debug("State changed",s+" -> "+i),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:s,current:e}),this.emit(e,t)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class $n{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=Kn(e,t)),this.channels[e]}all(){return dn(this.channels)}find(e){return this.channels[e]}remove(e){var t=this.channels[e];return delete this.channels[e],t}disconnect(){re(this.channels,function(e){e.disconnect()})}}function Kn(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return de.createEncryptedChannel(r,e,e.config.nacl);let t="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",s=T.buildLogSuffix("encryptedChannelSupport");throw new A(`${t}. ${s}`)}else{if(r.indexOf("private-")===0)return de.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return de.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new x('Cannot create a channel with name "'+r+'".');return de.createChannel(r,e)}}var Zn={createChannels(){return new $n},createConnectionManager(r,e){return new Yn(r,e)},createChannel(r,e){return new Qe(r,e)},createPrivateChannel(r,e){return new et(r,e)},createPresenceChannel(r,e){return new Wn(r,e)},createEncryptedChannel(r,e,t){return new Xn(r,e,t)},createTimelineSender(r,e){return new Gn(r,e)},createHandshake(r,e){return new Fn(r,e)},createAssistantToTheTransportManager(r,e,t){return new Hn(r,e,t)}},de=Zn;class Xt{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return de.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class we{constructor(e,t){this.strategies=e,this.loop=!!t.loop,this.failFast=!!t.failFast,this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}isSupported(){return Bt(this.strategies,$.method("isSupported"))}connect(e,t){var s=this.strategies,i=0,f=this.timeout,v=null,N=(R,D)=>{D?t(null,D):(i=i+1,this.loop&&(i=i%s.length),i<s.length?(f&&(f=f*2,this.timeoutLimit&&(f=Math.min(f,this.timeoutLimit))),v=this.tryStrategy(s[i],e,{timeout:f,failFast:this.failFast},N)):t(!0))};return v=this.tryStrategy(s[i],e,{timeout:f,failFast:this.failFast},N),{abort:function(){v.abort()},forceMinPriority:function(R){e=R,v&&v.forceMinPriority(R)}}}tryStrategy(e,t,s,i){var f=null,v=null;return s.timeout>0&&(f=new E(s.timeout,function(){v.abort(),i(!0)})),v=e.connect(t,function(N,R){N&&f&&f.isRunning()&&!s.failFast||(f&&f.ensureAborted(),i(N,R))}),{abort:function(){f&&f.ensureAborted(),v.abort()},forceMinPriority:function(N){v.forceMinPriority(N)}}}}class rt{constructor(e){this.strategies=e}isSupported(){return Bt(this.strategies,$.method("isSupported"))}connect(e,t){return Qn(this.strategies,e,function(s,i){return function(f,v){if(i[s].error=f,f){es(i)&&t(!0);return}Ae(i,function(N){N.forceMinPriority(v.transport.priority)}),t(null,v)}})}}function Qn(r,e,t){var s=Dt(r,function(i,f,v,N){return i.connect(e,t(f,N))});return{abort:function(){Ae(s,ts)},forceMinPriority:function(i){Ae(s,function(f){f.forceMinPriority(i)})}}}function es(r){return pn(r,function(e){return!!e.error})}function ts(r){!r.error&&!r.aborted&&(r.abort(),r.aborted=!0)}class rs{constructor(e,t,s){this.strategy=e,this.transports=t,this.ttl=s.ttl||1800*1e3,this.usingTLS=s.useTLS,this.timeline=s.timeline}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.usingTLS,i=ns(s),f=i&&i.cacheSkipCount?i.cacheSkipCount:0,v=[this.strategy];if(i&&i.timestamp+this.ttl>=$.now()){var N=this.transports[i.transport];N&&(["ws","wss"].includes(i.transport)||f>3?(this.timeline.info({cached:!0,transport:i.transport,latency:i.latency}),v.push(new we([N],{timeout:i.latency*2+1e3,failFast:!0}))):f++)}var R=$.now(),D=v.pop().connect(e,function U(Z,He){Z?(Yt(s),v.length>0?(R=$.now(),D=v.pop().connect(e,U)):t(Z)):(ss(s,He.transport.name,$.now()-R,f),t(null,He))});return{abort:function(){D.abort()},forceMinPriority:function(U){e=U,D&&D.forceMinPriority(U)}}}}function nt(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function ns(r){var e=L.getLocalStorage();if(e)try{var t=e[nt(r)];if(t)return JSON.parse(t)}catch{Yt(r)}return null}function ss(r,e,t,s){var i=L.getLocalStorage();if(i)try{i[nt(r)]=Me({timestamp:$.now(),transport:e,latency:t,cacheSkipCount:s})}catch{}}function Yt(r){var e=L.getLocalStorage();if(e)try{delete e[nt(r)]}catch{}}class De{constructor(e,{delay:t}){this.strategy=e,this.options={delay:t}}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy,i,f=new E(this.options.delay,function(){i=s.connect(e,t)});return{abort:function(){f.ensureAborted(),i&&i.abort()},forceMinPriority:function(v){e=v,i&&i.forceMinPriority(v)}}}}class Ee{constructor(e,t,s){this.test=e,this.trueBranch=t,this.falseBranch=s}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,t){var s=this.test()?this.trueBranch:this.falseBranch;return s.connect(e,t)}}class is{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy.connect(e,function(i,f){f&&s.abort(),t(i,f)});return s}}function Re(r){return function(){return r.isSupported()}}var as=function(r,e,t){var s={};function i(ar,ii,ai,oi,li){var or=t(r,ar,ii,ai,oi,li);return s[ar]=or,or}var f=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),v=Object.assign({},f,{useTLS:!0}),N=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),R={loop:!0,timeout:15e3,timeoutLimit:6e4},D=new Xt({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),U=new Xt({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),Z=i("ws","ws",3,f,D),He=i("wss","ws",3,v,D),ei=i("sockjs","sockjs",1,N),er=i("xhr_streaming","xhr_streaming",1,N,U),ti=i("xdr_streaming","xdr_streaming",1,N,U),tr=i("xhr_polling","xhr_polling",1,N),ri=i("xdr_polling","xdr_polling",1,N),rr=new we([Z],R),ni=new we([He],R),si=new we([ei],R),nr=new we([new Ee(Re(er),er,ti)],R),sr=new we([new Ee(Re(tr),tr,ri)],R),ir=new we([new Ee(Re(nr),new rt([nr,new De(sr,{delay:4e3})]),sr)],R),ot=new Ee(Re(ir),ir,si),lt;return e.useTLS?lt=new rt([rr,new De(ot,{delay:2e3})]):lt=new rt([rr,new De(ni,{delay:2e3}),new De(ot,{delay:5e3})]),new rs(new is(new Ee(Re(Z),lt,ot)),s,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},os=as,ls=function(){var r=this;r.timeline.info(r.buildTimelineMessage({transport:r.name+(r.options.useTLS?"s":"")})),r.hooks.isInitialized()?r.changeState("initialized"):r.hooks.file?(r.changeState("initializing"),C.load(r.hooks.file,{useTLS:r.options.useTLS},function(e,t){r.hooks.isInitialized()?(r.changeState("initialized"),t(!0)):(e&&r.onError(e),r.onClose(),t(!1))})):r.onClose()},cs={getRequest:function(r){var e=new window.XDomainRequest;return e.ontimeout=function(){r.emit("error",new _),r.close()},e.onerror=function(t){r.emit("error",t),r.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText),r.emit("finished",200),r.close()},e},abortRequest:function(r){r.ontimeout=r.onerror=r.onprogress=r.onload=null,r.abort()}},ds=cs;const us=256*1024;class hs extends ce{constructor(e,t,s){super(),this.hooks=e,this.method=t,this.url=s}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},L.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(L.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,t){for(;;){var s=this.advanceBuffer(t);if(s)this.emit("chunk",{status:e,data:s});else break}this.isBufferTooLong(t)&&this.emit("buffer_too_long")}advanceBuffer(e){var t=e.slice(this.position),s=t.indexOf(`
144
+ `);return s!==-1?(this.position+=s+1,t.slice(0,s)):null}isBufferTooLong(e){return this.position===e.length&&e.length>us}}var st;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(st||(st={}));var ye=st,ps=1;class fs{constructor(e,t){this.hooks=e,this.session=Kt(1e3)+"/"+xs(8),this.location=ms(t),this.readyState=ye.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,t){this.onClose(e,t,!0)}sendRaw(e){if(this.readyState===ye.OPEN)try{return L.createSocketRequest("POST",$t(gs(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,t,s){this.closeStream(),this.readyState=ye.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:s})}onChunk(e){if(e.status===200){this.readyState===ye.OPEN&&this.onActivity();var t,s=e.data.slice(0,1);switch(s){case"o":t=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(t);break;case"a":t=JSON.parse(e.data.slice(1)||"[]");for(var i=0;i<t.length;i++)this.onEvent(t[i]);break;case"m":t=JSON.parse(e.data.slice(1)||"null"),this.onEvent(t);break;case"h":this.hooks.onHeartbeat(this);break;case"c":t=JSON.parse(e.data.slice(1)||"[]"),this.onClose(t[0],t[1],!0);break}}}onOpen(e){this.readyState===ye.CONNECTING?(e&&e.hostname&&(this.location.base=bs(this.location.base,e.hostname)),this.readyState=ye.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===ye.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=L.createSocketRequest("POST",$t(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",e=>{this.onChunk(e)}),this.stream.bind("finished",e=>{this.hooks.onFinished(this,e)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(e){$.defer(()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function ms(r){var e=/([^\?]*)\/*(\??.*)/.exec(r);return{base:e[1],queryString:e[2]}}function gs(r,e){return r.base+"/"+e+"/xhr_send"}function $t(r){var e=r.indexOf("?")===-1?"?":"&";return r+e+"t="+ +new Date+"&n="+ps++}function bs(r,e){var t=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return t[1]+e+t[3]}function Kt(r){return L.randomInt(r)}function xs(r){for(var e=[],t=0;t<r;t++)e.push(Kt(32).toString(32));return e.join("")}var vs=fs,ws={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr_streaming"+r.queryString},onHeartbeat:function(r){r.sendRaw("[]")},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){r.onClose(1006,"Connection interrupted ("+e+")",!1)}},ys=ws,js={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr"+r.queryString},onHeartbeat:function(){},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){e===200?r.reconnect():r.onClose(1006,"Connection interrupted ("+e+")",!1)}},_s=js,ks={getRequest:function(r){var e=L.getXHRAPI(),t=new e;return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&r.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&r.onChunk(t.status,t.responseText),r.emit("finished",t.status),r.close();break}},t},abortRequest:function(r){r.onreadystatechange=null,r.abort()}},Ss=ks,Ns={createStreamingSocket(r){return this.createSocket(ys,r)},createPollingSocket(r){return this.createSocket(_s,r)},createSocket(r,e){return new vs(r,e)},createXHR(r,e){return this.createRequest(Ss,r,e)},createRequest(r,e,t){return new hs(r,e,t)}},Zt=Ns;Zt.createXDR=function(r,e){return this.createRequest(ds,r,e)};var Cs=Zt,Ts={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:h,DependenciesReceivers:p,getDefaultStrategy:os,Transports:zn,transportConnectionInitializer:ls,HTTPFactory:Cs,TimelineTransport:kn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(r){window.Pusher=r;var e=()=>{this.onDocumentBody(r.ready)};window.JSON?e():C.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:ee,jsonp:vn}},onDocumentBody(r){document.body?r():setTimeout(()=>{this.onDocumentBody(r)},0)},createJSONPRequest(r,e){return new yn(r,e)},createScriptRequest(r){return new wn(r)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var r=this.getXHRAPI();return new r},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Un},createWebSocket(r){var e=this.getWebSocketAPI();return new e(r)},createSocketRequest(r,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(r,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(r,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var r=this.getXHRAPI();return!!r&&new r().withCredentials!==void 0},isXDRSupported(r){var e=r?"https:":"http:",t=this.getProtocol();return!!window.XDomainRequest&&t===e},addUnloadListener(r){window.addEventListener!==void 0?window.addEventListener("unload",r,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",r)},removeUnloadListener(r){window.addEventListener!==void 0?window.removeEventListener("unload",r,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",r)},randomInt(r){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*r)}},L=Ts,it;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(it||(it={}));var Ue=it;class Ps{constructor(e,t,s){this.key=e,this.session=t,this.events=[],this.options=s||{},this.sent=0,this.uniqueID=0}log(e,t){e<=this.options.level&&(this.events.push(Q({},t,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(Ue.ERROR,e)}info(e){this.log(Ue.INFO,e)}debug(e){this.log(Ue.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,t){var s=Q({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(s,(i,f)=>{i||this.sent++,t&&t(i,f)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class As{constructor(e,t,s,i){this.name=e,this.priority=t,this.transport=s,this.options=i||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,t){if(this.isSupported()){if(this.priority<e)return Qt(new P,t)}else return Qt(new J,t);var s=!1,i=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),f=null,v=function(){i.unbind("initialized",v),i.connect()},N=function(){f=de.createHandshake(i,function(Z){s=!0,U(),t(null,Z)})},R=function(Z){U(),t(Z)},D=function(){U();var Z;Z=Me(i),t(new y(Z))},U=function(){i.unbind("initialized",v),i.unbind("open",N),i.unbind("error",R),i.unbind("closed",D)};return i.bind("initialized",v),i.bind("open",N),i.bind("error",R),i.bind("closed",D),i.initialize(),{abort:()=>{s||(U(),f?f.close():i.close())},forceMinPriority:Z=>{s||this.priority<Z&&(f?f.close():i.close())}}}}function Qt(r,e){return $.defer(function(){e(r)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Es}=L;var Rs=function(r,e,t,s,i,f){var v=Es[t];if(!v)throw new B(t);var N=(!r.enabledTransports||le(r.enabledTransports,e)!==-1)&&(!r.disabledTransports||le(r.disabledTransports,e)===-1),R;return N?(i=Object.assign({ignoreNullOrigin:r.ignoreNullOrigin},i),R=new As(e,s,f?f.getAssistant(v):v,i)):R=Ls,R},Ls={isSupported:function(){return!1},connect:function(r,e){var t=$.defer(function(){e(new J)});return{abort:function(){t.ensureAborted()},forceMinPriority:function(){}}}};function Is(r){if(r==null)throw"You must pass an options object";if(r.cluster==null)throw"Options object must provide a cluster";"disableStats"in r&&W.warn("The disableStats option is deprecated in favor of enableStats")}const Os=(r,e)=>{var t="socket_id="+encodeURIComponent(r.socketId);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let i=e.paramsProvider();for(var s in i)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(i[s])}return t};var Ms=r=>{if(typeof L.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=Os(e,r);L.getAuthorizers()[r.transport](L,s,r,j.UserAuthentication,t)}};const zs=(r,e)=>{var t="socket_id="+encodeURIComponent(r.socketId);t+="&channel_name="+encodeURIComponent(r.channelName);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let i=e.paramsProvider();for(var s in i)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(i[s])}return t};var Ds=r=>{if(typeof L.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=zs(e,r);L.getAuthorizers()[r.transport](L,s,r,j.ChannelAuthorization,t)}};const Us=(r,e,t)=>{const s={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(i,f)=>{const v=r.channel(i.channelName);t(v,s).authorize(i.socketId,f)}};function Hs(r,e){let t={activityTimeout:r.activityTimeout||w.activityTimeout,cluster:r.cluster,httpPath:r.httpPath||w.httpPath,httpPort:r.httpPort||w.httpPort,httpsPort:r.httpsPort||w.httpsPort,pongTimeout:r.pongTimeout||w.pongTimeout,statsHost:r.statsHost||w.stats_host,unavailableTimeout:r.unavailableTimeout||w.unavailableTimeout,wsPath:r.wsPath||w.wsPath,wsPort:r.wsPort||w.wsPort,wssPort:r.wssPort||w.wssPort,enableStats:qs(r),httpHost:Bs(r),useTLS:Vs(r),wsHost:Fs(r),userAuthenticator:Ws(r),channelAuthorizer:Xs(r,e)};return"disabledTransports"in r&&(t.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(t.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(t.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(t.timelineParams=r.timelineParams),"nacl"in r&&(t.nacl=r.nacl),t}function Bs(r){return r.httpHost?r.httpHost:r.cluster?`sockjs-${r.cluster}.pusher.com`:w.httpHost}function Fs(r){return r.wsHost?r.wsHost:Gs(r.cluster)}function Gs(r){return`ws-${r}.pusher.com`}function Vs(r){return L.getProtocol()==="https:"?!0:r.forceTLS!==!1}function qs(r){return"enableStats"in r?r.enableStats:"disableStats"in r?!r.disableStats:!1}function Ws(r){const e=Object.assign(Object.assign({},w.userAuthentication),r.userAuthentication);return"customHandler"in e&&e.customHandler!=null?e.customHandler:Ms(e)}function Js(r,e){let t;return"channelAuthorization"in r?t=Object.assign(Object.assign({},w.channelAuthorization),r.channelAuthorization):(t={transport:r.authTransport||w.authTransport,endpoint:r.authEndpoint||w.authEndpoint},"auth"in r&&("params"in r.auth&&(t.params=r.auth.params),"headers"in r.auth&&(t.headers=r.auth.headers)),"authorizer"in r&&(t.customHandler=Us(e,t,r.authorizer))),t}function Xs(r,e){const t=Js(r,e);return"customHandler"in t&&t.customHandler!=null?t.customHandler:Ds(t)}class Ys extends ce{constructor(e){super(function(t,s){W.debug(`No callbacks on watchlist events for ${t}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(e){e.data.events.forEach(t=>{this.emit(t.name,t)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var t=e.event;t==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function $s(){let r,e;return{promise:new Promise((s,i)=>{r=s,e=i}),resolve:r,reject:e}}var Ks=$s;class Zs extends ce{constructor(e){super(function(t,s){W.debug("No callbacks on user for "+t)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(t,s)=>{if(t){W.warn(`Error during signin: ${t}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:s.auth,user_data:s.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:t,current:s})=>{t!=="connected"&&s==="connected"&&this._signin(),t==="connected"&&s!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Ys(e),this.pusher.connection.bind("message",t=>{var s=t.event;s==="pusher:signin_success"&&this._onSigninSuccess(t.data),this.serverToUserChannel&&this.serverToUserChannel.name===t.channel&&this.serverToUserChannel.handleEvent(t)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch{W.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){W.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=t=>{t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.pusher.connection.state==="connected"&&t.subscribe()};this.serverToUserChannel=new Qe(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((t,s)=>{t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0||this.emit(t,s)}),e(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:t}=Ks();e.done=!1;const s=()=>{e.done=!0};e.then(s).catch(s),this.signinDonePromise=e,this._signinDoneResolve=t}}class te{static ready(){te.isReady=!0;for(var e=0,t=te.instances.length;e<t;e++)te.instances[e].connect()}static getClientFeatures(){return Oe(Ht({ws:L.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,t){Qs(e),Is(t),this.key=e,this.config=Hs(t,this),this.channels=de.createChannels(),this.global_emitter=new ce,this.sessionID=L.randomInt(1e9),this.timeline=new Ps(this.key,this.sessionID,{cluster:this.config.cluster,features:te.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Ue.INFO,version:w.VERSION}),this.config.enableStats&&(this.timelineSender=de.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+L.TimelineTransport.name}));var s=i=>L.getDefaultStrategy(this.config,i,Rs);this.connection=de.createConnectionManager(this.key,{getStrategy:s,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",i=>{var f=i.event,v=f.indexOf("pusher_internal:")===0;if(i.channel){var N=this.channel(i.channel);N&&N.handleEvent(i)}v||this.global_emitter.emit(i.event,i.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",i=>{W.warn(i)}),te.instances.push(this),this.timeline.info({instances:te.instances.length}),this.user=new Zs(this),te.isReady&&this.connect()}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new V(6e4,function(){t.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,t,s){return this.global_emitter.bind(e,t,s),this}unbind(e,t,s){return this.global_emitter.unbind(e,t,s),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.connection.state==="connected"&&t.subscribe(),t}unsubscribe(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e),t&&t.subscribed&&t.unsubscribe())}send_event(e,t,s){return this.connection.send_event(e,t,s)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}te.instances=[],te.isReady=!1,te.logToConsole=!1,te.Runtime=L,te.ScriptReceivers=L.ScriptReceivers,te.DependenciesReceivers=L.DependenciesReceivers,te.auth_callbacks=L.auth_callbacks;var at=o.default=te;function Qs(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}L.setup(te)}])})})(xt);var _r=xt.exports;const kr=ct(_r);function vt(a,d,c,o,l){const[u,h]=M.useState(null),[b,w]=M.useState(null),[O,p]=M.useState(!0),[C,k]=M.useState(null),S=M.useCallback(async()=>{try{p(!0);const P=c!=="all"?`&segment=${c}`:"",y=`&trafficType=${o}`;let A=`${a.endpoint}/stats?`;d==="custom"&&(l!=null&&l.start)&&(l!=null&&l.end)?A+=`startDate=${l.start}&endDate=${l.end}${P}${y}`:A+=`timeframe=${d}${P}${y}`;const B=await fetch(A,{headers:{"x-tenant-key":a.apiKey,"x-tenant-secret":a.adminSecret,"Cache-Control":"no-cache"}});if(B.ok){const J=await B.json();h(J),k(null)}else throw new Error("Failed to fetch stats")}catch(P){k(P.message)}finally{p(!1)}},[a.endpoint,a.apiKey,a.adminSecret,d,c,o,l]),T=M.useCallback(async()=>{try{const P=c!=="all"?`&segment=${c}`:"",y=`&trafficType=${o}`;let A=l==null?void 0:l.start,B=l==null?void 0:l.end;if(!A||!B){const H=new Date,G=new Date;d==="7d"?G.setDate(H.getDate()-7):d==="30d"?G.setDate(H.getDate()-30):G.setHours(H.getHours()-24),A=G.toISOString().split("T")[0],B=H.toISOString().split("T")[0]}const J=await fetch(`${a.endpoint}/funnel?startDate=${A}&endDate=${B}${P}${y}`,{headers:{"x-tenant-key":a.apiKey,"x-tenant-secret":a.adminSecret,"Cache-Control":"no-cache"}});if(J.ok){const H=await J.json();w(H)}}catch(P){console.error("[Dashboard] funnel fetch error:",P)}},[a.endpoint,a.apiKey,a.adminSecret,d,c,o,l]),j=M.useRef(0),m=M.useRef(null),x=M.useCallback(()=>{S(),T()},[S,T]),_=M.useCallback(()=>{m.current&&clearTimeout(m.current);const P=Date.now(),y=P-j.current;y>2e3?(x(),j.current=P):m.current=setTimeout(()=>{x(),j.current=Date.now()},2e3-y)},[x]);return M.useEffect(()=>{if(S(),T(),a.realtimeEnabled){const P=new kr(a.soketiKey||"infrabricks_key",{wsHost:a.soketiHost||"127.0.0.1",wsPort:a.soketiPort||443,forceTLS:a.soketiUseTLS!==!1,enabledTransports:["ws","wss"],cluster:"mt1"}),y=`analytics-${a.apiKey}`,A=P.subscribe(y);return A.bind("new-session",_),A.bind("new-pageview",_),A.bind("new-event",_),A.bind("heartbeat",_),A.bind("session-offline",_),()=>{P.unsubscribe(y),P.disconnect()}}},[S,T,_,a.realtimeEnabled,a.soketiHost,a.soketiKey,a.soketiPort,a.soketiUseTLS,a.apiKey]),M.useEffect(()=>{const P=setInterval(x,a.refreshInterval||6e4);return()=>clearInterval(P)},[x,a.refreshInterval]),{stats:u,funnel:b,loading:O,error:C,refresh:S}}function wt(a){var d,c,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var l=a.length;for(d=0;d<l;d++)a[d]&&(c=wt(a[d]))&&(o&&(o+=" "),o+=c)}else for(c in a)a[c]&&(o&&(o+=" "),o+=c);return o}function Sr(){for(var a,d,c=0,o="",l=arguments.length;c<l;c++)(a=arguments[c])&&(d=wt(a))&&(o&&(o+=" "),o+=d);return o}const qe="-",Nr=a=>{const d=Tr(a),{conflictingClassGroups:c,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:h=>{const b=h.split(qe);return b[0]===""&&b.length!==1&&b.shift(),yt(b,d)||Cr(h)},getConflictingClassGroupIds:(h,b)=>{const w=c[h]||[];return b&&o[h]?[...w,...o[h]]:w}}},yt=(a,d)=>{var h;if(a.length===0)return d.classGroupId;const c=a[0],o=d.nextPart.get(c),l=o?yt(a.slice(1),o):void 0;if(l)return l;if(d.validators.length===0)return;const u=a.join(qe);return(h=d.validators.find(({validator:b})=>b(u)))==null?void 0:h.classGroupId},jt=/^\[(.+)\]$/,Cr=a=>{if(jt.test(a)){const d=jt.exec(a)[1],c=d==null?void 0:d.substring(0,d.indexOf(":"));if(c)return"arbitrary.."+c}},Tr=a=>{const{theme:d,prefix:c}=a,o={nextPart:new Map,validators:[]};return Ar(Object.entries(a.classGroups),c).forEach(([u,h])=>{We(h,o,u,d)}),o},We=(a,d,c,o)=>{a.forEach(l=>{if(typeof l=="string"){const u=l===""?d:_t(d,l);u.classGroupId=c;return}if(typeof l=="function"){if(Pr(l)){We(l(o),d,c,o);return}d.validators.push({validator:l,classGroupId:c});return}Object.entries(l).forEach(([u,h])=>{We(h,_t(d,u),c,o)})})},_t=(a,d)=>{let c=a;return d.split(qe).forEach(o=>{c.nextPart.has(o)||c.nextPart.set(o,{nextPart:new Map,validators:[]}),c=c.nextPart.get(o)}),c},Pr=a=>a.isThemeGetter,Ar=(a,d)=>d?a.map(([c,o])=>{const l=o.map(u=>typeof u=="string"?d+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([h,b])=>[d+h,b])):u);return[c,l]}):a,Er=a=>{if(a<1)return{get:()=>{},set:()=>{}};let d=0,c=new Map,o=new Map;const l=(u,h)=>{c.set(u,h),d++,d>a&&(d=0,o=c,c=new Map)};return{get(u){let h=c.get(u);if(h!==void 0)return h;if((h=o.get(u))!==void 0)return l(u,h),h},set(u,h){c.has(u)?c.set(u,h):l(u,h)}}},kt="!",Rr=a=>{const{separator:d,experimentalParseClassName:c}=a,o=d.length===1,l=d[0],u=d.length,h=b=>{const w=[];let O=0,p=0,C;for(let m=0;m<b.length;m++){let x=b[m];if(O===0){if(x===l&&(o||b.slice(m,m+u)===d)){w.push(b.slice(p,m)),p=m+u;continue}if(x==="/"){C=m;continue}}x==="["?O++:x==="]"&&O--}const k=w.length===0?b:b.substring(p),S=k.startsWith(kt),T=S?k.substring(1):k,j=C&&C>p?C-p:void 0;return{modifiers:w,hasImportantModifier:S,baseClassName:T,maybePostfixModifierPosition:j}};return c?b=>c({className:b,parseClassName:h}):h},Lr=a=>{if(a.length<=1)return a;const d=[];let c=[];return a.forEach(o=>{o[0]==="["?(d.push(...c.sort(),o),c=[]):c.push(o)}),d.push(...c.sort()),d},Ir=a=>({cache:Er(a.cacheSize),parseClassName:Rr(a),...Nr(a)}),Or=/\s+/,Mr=(a,d)=>{const{parseClassName:c,getClassGroupId:o,getConflictingClassGroupIds:l}=d,u=[],h=a.trim().split(Or);let b="";for(let w=h.length-1;w>=0;w-=1){const O=h[w],{modifiers:p,hasImportantModifier:C,baseClassName:k,maybePostfixModifierPosition:S}=c(O);let T=!!S,j=o(T?k.substring(0,S):k);if(!j){if(!T){b=O+(b.length>0?" "+b:b);continue}if(j=o(k),!j){b=O+(b.length>0?" "+b:b);continue}T=!1}const m=Lr(p).join(":"),x=C?m+kt:m,_=x+j;if(u.includes(_))continue;u.push(_);const P=l(j,T);for(let y=0;y<P.length;++y){const A=P[y];u.push(x+A)}b=O+(b.length>0?" "+b:b)}return b};function zr(){let a=0,d,c,o="";for(;a<arguments.length;)(d=arguments[a++])&&(c=St(d))&&(o&&(o+=" "),o+=c);return o}const St=a=>{if(typeof a=="string")return a;let d,c="";for(let o=0;o<a.length;o++)a[o]&&(d=St(a[o]))&&(c&&(c+=" "),c+=d);return c};function Dr(a,...d){let c,o,l,u=h;function h(w){const O=d.reduce((p,C)=>C(p),a());return c=Ir(O),o=c.cache.get,l=c.cache.set,u=b,b(w)}function b(w){const O=o(w);if(O)return O;const p=Mr(w,c);return l(w,p),p}return function(){return u(zr.apply(null,arguments))}}const F=a=>{const d=c=>c[a]||[];return d.isThemeGetter=!0,d},Nt=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ur=/^\d+\/\d+$/,Hr=new Set(["px","full","screen"]),Br=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Gr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Vr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=a=>je(a)||Hr.has(a)||Ur.test(a),ue=a=>_e(a,"length",Qr),je=a=>!!a&&!Number.isNaN(Number(a)),Je=a=>_e(a,"number",je),Te=a=>!!a&&Number.isInteger(Number(a)),Wr=a=>a.endsWith("%")&&je(a.slice(0,-1)),I=a=>Nt.test(a),he=a=>Br.test(a),Jr=new Set(["length","size","percentage"]),Xr=a=>_e(a,Jr,Ct),Yr=a=>_e(a,"position",Ct),$r=new Set(["image","url"]),Kr=a=>_e(a,$r,tn),Zr=a=>_e(a,"",en),Pe=()=>!0,_e=(a,d,c)=>{const o=Nt.exec(a);return o?o[1]?typeof d=="string"?o[1]===d:d.has(o[1]):c(o[2]):!1},Qr=a=>Fr.test(a)&&!Gr.test(a),Ct=()=>!1,en=a=>Vr.test(a),tn=a=>qr.test(a),rn=Dr(()=>{const a=F("colors"),d=F("spacing"),c=F("blur"),o=F("brightness"),l=F("borderColor"),u=F("borderRadius"),h=F("borderSpacing"),b=F("borderWidth"),w=F("contrast"),O=F("grayscale"),p=F("hueRotate"),C=F("invert"),k=F("gap"),S=F("gradientColorStops"),T=F("gradientColorStopPositions"),j=F("inset"),m=F("margin"),x=F("opacity"),_=F("padding"),P=F("saturate"),y=F("scale"),A=F("sepia"),B=F("skew"),J=F("space"),H=F("translate"),G=()=>["auto","contain","none"],ee=()=>["auto","hidden","clip","visible","scroll"],ge=()=>["auto",I,d],z=()=>[I,d],ie=()=>["",ae,ue],pe=()=>["auto",je,I],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",I],xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],g=()=>[je,I];return{cacheSize:500,separator:":",theme:{colors:[Pe],spacing:[ae,ue],blur:["none","",he,I],brightness:g(),borderColor:[a],borderRadius:["none","","full",he,I],borderSpacing:z(),borderWidth:ie(),contrast:g(),grayscale:se(),hueRotate:g(),invert:se(),gap:z(),gradientColorStops:[a],gradientColorStopPositions:[Wr,ue],inset:ge(),margin:ge(),opacity:g(),padding:z(),saturate:g(),scale:g(),sepia:se(),skew:g(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[he]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...fe(),I]}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Te,I]}],basis:[{basis:ge()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",I]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Te,I]}],"grid-cols":[{"grid-cols":[Pe]}],"col-start-end":[{col:["auto",{span:["full",Te,I]},I]}],"col-start":[{"col-start":pe()}],"col-end":[{"col-end":pe()}],"grid-rows":[{"grid-rows":[Pe]}],"row-start-end":[{row:["auto",{span:[Te,I]},I]}],"row-start":[{"row-start":pe()}],"row-end":[{"row-end":pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],gap:[{gap:[k]}],"gap-x":[{"gap-x":[k]}],"gap-y":[{"gap-y":[k]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[J]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[J]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",I,d]}],"min-w":[{"min-w":[I,d,"min","max","fit"]}],"max-w":[{"max-w":[I,d,"none","full","min","max","fit","prose",{screen:[he]},he]}],h:[{h:[I,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[I,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[I,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[I,d,"auto","min","max","fit"]}],"font-size":[{text:["base",he,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Je]}],"font-family":[{font:[Pe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",I]}],"line-clamp":[{"line-clamp":["none",je,Je]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ae,I]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ae,ue]}],"underline-offset":[{"underline-offset":["auto",ae,I]}],"text-decoration-color":[{decoration:[a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),Yr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Kr]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[b]}],"border-w-x":[{"border-x":[b]}],"border-w-y":[{"border-y":[b]}],"border-w-s":[{"border-s":[b]}],"border-w-e":[{"border-e":[b]}],"border-w-t":[{"border-t":[b]}],"border-w-r":[{"border-r":[b]}],"border-w-b":[{"border-b":[b]}],"border-w-l":[{"border-l":[b]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[b]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[b]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:oe()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[ae,I]}],"outline-w":[{outline:[ae,ue]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ae,ue]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",he,Zr]}],"shadow-color":[{shadow:[Pe]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...be(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":be()}],filter:[{filter:["","none"]}],blur:[{blur:[c]}],brightness:[{brightness:[o]}],contrast:[{contrast:[w]}],"drop-shadow":[{"drop-shadow":["","none",he,I]}],grayscale:[{grayscale:[O]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[C]}],saturate:[{saturate:[P]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[c]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[w]}],"backdrop-grayscale":[{"backdrop-grayscale":[O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[P]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",I]}],duration:[{duration:g()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:g()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Te,I]}],"translate-x":[{"translate-x":[H]}],"translate-y":[{"translate-y":[H]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],accent:[{accent:["auto",a]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",I]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",I]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[ae,ue,Je]}],stroke:[{stroke:[a,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Tt={"Ascension Island":"🇦🇨",Andorra:"🇦🇩","United Arab Emirates":"🇦🇪",Afghanistan:"🇦🇫","Antigua & Barbuda":"🇦🇬",Anguilla:"🇦🇮",Albania:"🇦🇱",Armenia:"🇦🇲",Angola:"🇦🇴",Antarctica:"🇦🇶",Argentina:"🇦🇷","American Samoa":"🇦🇸",Austria:"🇦🇹",Australia:"🇦🇺",Aruba:"🇦🇼","Åland Islands":"🇦🇽",Azerbaijan:"🇦🇿","Bosnia & Herzegovina":"🇧🇦",Barbados:"🇧🇧",Bangladesh:"🇧🇩",Belgium:"🇧🇪","Burkina Faso":"🇧🇫",Bulgaria:"🇧🇬",Bahrain:"🇧🇭",Burundi:"🇧🇮",Benin:"🇧🇯","St. Barthélemy":"🇧🇱",Bermuda:"🇧🇲",Brunei:"🇧🇳",Bolivia:"🇧🇴","Caribbean Netherlands":"🇧🇶",Brazil:"🇧🇷",Bahamas:"🇧🇸",Bhutan:"🇧🇹","Bouvet Island":"🇧🇻",Botswana:"🇧🇼",Belarus:"🇧🇾",Belize:"🇧🇿",Canada:"🇨🇦","Cocos (Keeling) Islands":"🇨🇨","Congo - Kinshasa":"🇨🇩","Central African Republic":"🇨🇫","Congo - Brazzaville":"🇨🇬",Switzerland:"🇨🇭","Côte d’Ivoire":"🇨🇮","Cook Islands":"🇨🇰",Chile:"🇨🇱",Cameroon:"🇨🇲",China:"🇨🇳",Colombia:"🇨🇴","Clipperton Island":"🇨🇵","Costa Rica":"🇨🇷",Cuba:"🇨🇺","Cape Verde":"🇨🇻",Curaçao:"🇨🇼","Christmas Island":"🇨🇽",Cyprus:"🇨🇾",Czechia:"🇨🇿",Germany:"🇩🇪","Diego Garcia":"🇩🇬",Djibouti:"🇩🇯",Denmark:"🇩🇰",Dominica:"🇩🇲","Dominican Republic":"🇩🇴",Algeria:"🇩🇿","Ceuta & Melilla":"🇪🇦",Ecuador:"🇪🇨",Estonia:"🇪🇪",Egypt:"🇪🇬","Western Sahara":"🇪🇭",Eritrea:"🇪🇷",Spain:"🇪🇸",Ethiopia:"🇪🇹","European Union":"🇪🇺",Finland:"🇫🇮",Fiji:"🇫🇯","Falkland Islands":"🇫🇰",Micronesia:"🇫🇲","Faroe Islands":"🇫🇴",France:"🇫🇷",Gabon:"🇬🇦","United Kingdom":"🇬🇧",Grenada:"🇬🇩",Georgia:"🇬🇪","French Guiana":"🇬🇫",Guernsey:"🇬🇬",Ghana:"🇬🇭",Gibraltar:"🇬🇮",Greenland:"🇬🇱",Gambia:"🇬🇲",Guinea:"🇬🇳",Guadeloupe:"🇬🇵","Equatorial Guinea":"🇬🇶",Greece:"🇬🇷","South Georgia & South Sandwich Islands":"🇬🇸",Guatemala:"🇬🇹",Guam:"🇬🇺","Guinea-Bissau":"🇬🇼",Guyana:"🇬🇾","Hong Kong SAR China":"🇭🇰","Heard & McDonald Islands":"🇭🇲",Honduras:"🇭🇳",Croatia:"🇭🇷",Haiti:"🇭🇹",Hungary:"🇭🇺","Canary Islands":"🇮🇨",Indonesia:"🇮🇩",Ireland:"🇮🇪",Israel:"🇮🇱","Isle of Man":"🇮🇲",India:"🇮🇳","British Indian Ocean Territory":"🇮🇴",Iraq:"🇮🇶",Iran:"🇮🇷",Iceland:"🇮🇸",Italy:"🇮🇹",Jersey:"🇯🇪",Jamaica:"🇯🇲",Jordan:"🇯🇴",Japan:"🇯🇵",Kenya:"🇰🇪",Kyrgyzstan:"🇰🇬",Cambodia:"🇰🇭",Kiribati:"🇰🇮",Comoros:"🇰🇲","St. Kitts & Nevis":"🇰🇳","North Korea":"🇰🇵","South Korea":"🇰🇷",Kuwait:"🇰🇼","Cayman Islands":"🇰🇾",Kazakhstan:"🇰🇿",Laos:"🇱🇦",Lebanon:"🇱🇧","St. Lucia":"🇱🇨",Liechtenstein:"🇱🇮","Sri Lanka":"🇱🇰",Liberia:"🇱🇷",Lesotho:"🇱🇸",Lithuania:"🇱🇹",Luxembourg:"🇱🇺",Latvia:"🇱🇻",Libya:"🇱🇾",Morocco:"🇲🇦",Monaco:"🇲🇨",Moldova:"🇲🇩",Montenegro:"🇲🇪","St. Martin":"🇲🇫",Madagascar:"🇲🇬","Marshall Islands":"🇲🇭","North Macedonia":"🇲🇰",Mali:"🇲🇱","Myanmar (Burma)":"🇲🇲",Mongolia:"🇲🇳","Macao SAR China":"🇲🇴","Northern Mariana Islands":"🇲🇵",Martinique:"🇲🇶",Mauritania:"🇲🇷",Montserrat:"🇲🇸",Malta:"🇲🇹",Mauritius:"🇲🇺",Maldives:"🇲🇻",Malawi:"🇲🇼",Mexico:"🇲🇽",Malaysia:"🇲🇾",Mozambique:"🇲🇿",Namibia:"🇳🇦","New Caledonia":"🇳🇨",Niger:"🇳🇪","Norfolk Island":"🇳🇫",Nigeria:"🇳🇬",Nicaragua:"🇳🇮",Netherlands:"🇳🇱",Norway:"🇳🇴",Nepal:"🇳🇵",Nauru:"🇳🇷",Niue:"🇳🇺","New Zealand":"🇳🇿",Oman:"🇴🇲",Panama:"🇵🇦",Peru:"🇵🇪","French Polynesia":"🇵🇫","Papua New Guinea":"🇵🇬",Philippines:"🇵🇭",Pakistan:"🇵🇰",Poland:"🇵🇱","St. Pierre & Miquelon":"🇵🇲","Pitcairn Islands":"🇵🇳","Puerto Rico":"🇵🇷","Palestinian Territories":"🇵🇸",Portugal:"🇵🇹",Palau:"🇵🇼",Paraguay:"🇵🇾",Qatar:"🇶🇦",Réunion:"🇷🇪",Romania:"🇷🇴",Serbia:"🇷🇸",Russia:"🇷🇺",Rwanda:"🇷🇼","Saudi Arabia":"🇸🇦","Solomon Islands":"🇸🇧",Seychelles:"🇸🇨",Sudan:"🇸🇩",Sweden:"🇸🇪",Singapore:"🇸🇬","St. Helena":"🇸🇭",Slovenia:"🇸🇮","Svalbard & Jan Mayen":"🇸🇯",Slovakia:"🇸🇰","Sierra Leone":"🇸🇱","San Marino":"🇸🇲",Senegal:"🇸🇳",Somalia:"🇸🇴",Suriname:"🇸🇷","South Sudan":"🇸🇸","São Tomé & Príncipe":"🇸🇹","El Salvador":"🇸🇻","Sint Maarten":"🇸🇽",Syria:"🇸🇾",Eswatini:"🇸🇿","Tristan da Cunha":"🇹🇦","Turks & Caicos Islands":"🇹🇨",Chad:"🇹🇩","French Southern Territories":"🇹🇫",Togo:"🇹🇬",Thailand:"🇹🇭",Tajikistan:"🇹🇯",Tokelau:"🇹🇰","Timor-Leste":"🇹🇱",Turkmenistan:"🇹🇲",Tunisia:"🇹🇳",Tonga:"🇹🇴",Turkey:"🇹🇷","Trinidad & Tobago":"🇹🇹",Tuvalu:"🇹🇻",Taiwan:"🇹🇼",Tanzania:"🇹🇿",Ukraine:"🇺🇦",Uganda:"🇺🇬","U.S. Outlying Islands":"🇺🇲","United Nations":"🇺🇳","United States":"🇺🇸",Uruguay:"🇺🇾",Uzbekistan:"🇺🇿","Vatican City":"🇻🇦","St. Vincent & Grenadines":"🇻🇨",Venezuela:"🇻🇪","British Virgin Islands":"🇻🇬","U.S. Virgin Islands":"🇻🇮",Vietnam:"🇻🇳",Vanuatu:"🇻🇺","Wallis & Futuna":"🇼🇫",Samoa:"🇼🇸",Kosovo:"🇽🇰",Yemen:"🇾🇪",Mayotte:"🇾🇹","South Africa":"🇿🇦",Zambia:"🇿🇲",Zimbabwe:"🇿🇼",England:"🏴󠁧󠁢󠁥󠁮󠁧󠁿",Scotland:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",Wales:"🏴󠁧󠁢󠁷󠁬󠁳󠁿"},Ie=(a,d)=>!a&&!d?"🌐":d&&d.length===2?d.toUpperCase().split("").map(c=>String.fromCodePoint(c.charCodeAt(0)+127397)).join(""):a&&Tt[a]||"🌐",nn=a=>new Intl.NumberFormat().format(a),Xe=a=>{const d=new Date,c=new Date(a),o=Math.floor((d.getTime()-c.getTime())/1e3);return o<60?"Just now":o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:c.toLocaleDateString()},Pt=a=>{const d=new Date(a),c=d.getDate(),o=d.toLocaleString("en-US",{month:"long"}),l=d.toLocaleString("en-US",{weekday:"long"});return d.getFullYear(),`${l} ${c}${(h=>{if(h>3&&h<21)return"th";switch(h%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}})(c)}, ${o}`};function ne(...a){return rn(Sr(a))}function ke({label:a,value:d,icon:c,color:o,pulse:l}){const u={blue:"text-blue-400 bg-blue-500/10",purple:"text-purple-400 bg-purple-500/10",green:"text-green-400 bg-green-500/10",orange:"text-orange-400 bg-orange-500/10",red:"text-red-400 bg-red-500/10"};return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 p-6 rounded-3xl backdrop-blur-xl group hover:border-white/10 transition-all relative overflow-hidden",children:[l&&n.jsxs("div",{className:"absolute top-4 right-4 flex h-3 w-3",children:[n.jsx("span",{className:ne("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",o==="green"?"bg-green-400":"bg-blue-400")}),n.jsx("span",{className:ne("relative inline-flex rounded-full h-3 w-3",o==="green"?"bg-green-500":"bg-blue-500")})]}),n.jsx("div",{className:ne("w-10 h-10 rounded-2xl flex items-center justify-center mb-4",u[o]),children:c}),n.jsx("p",{className:"text-slate-400 text-sm font-medium mb-1",children:a}),n.jsx("p",{className:"text-3xl font-bold text-white tracking-tight",children:d})]})}function At({stats:a}){var l,u;const d=((l=a==null?void 0:a.summary)==null?void 0:l.realtimeActivity)||Array(30).fill(0),c=((u=a==null?void 0:a.summary)==null?void 0:u.realtimeActivityDetails)||Array(30).fill([]),o=Math.max(...d,1);return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Le,{className:"w-5 h-5 text-blue-400"}),"Page Views per Minute"]}),n.jsx("p",{className:"text-slate-500 text-sm",children:"Real-time activity for the last 30 minutes"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("span",{className:"text-3xl font-black text-white",children:d[d.length-1]||0}),n.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:"Views in last minute"})]})]}),n.jsx("div",{className:"flex items-end gap-1.5 h-32",children:d.map((h,b)=>{const w=h/o*100,O=c[b]||[];return n.jsx("div",{className:ne("flex-1 transition-all duration-500 rounded-t-lg relative group",b===d.length-1?"bg-blue-500 shadow-[0_0_15px_rgba(59,130,246,0.5)]":"bg-blue-500/20 hover:bg-blue-500/40"),style:{height:`${Math.max(w,4)}%`},children:n.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-3 bg-slate-800 text-white text-[10px] py-2 px-3 rounded-lg opacity-0 group-hover:opacity-100 whitespace-nowrap pointer-events-none z-10 border border-white/10 shadow-2xl backdrop-blur-md transition-opacity min-w-[120px]",children:[n.jsxs("div",{className:"font-bold mb-1",children:[h," views • ",d.length-1-b,"m ago"]}),O.length>0&&n.jsxs("div",{className:"space-y-0.5 border-t border-white/10 pt-1.5 mt-1",children:[O.slice(0,3).map((p,C)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm",children:Ie(p.country,p.countryCode)}),n.jsx("span",{className:"text-slate-300 truncate max-w-[80px]",children:p.city||p.country}),n.jsxs("span",{className:"text-slate-500 ml-auto",children:["(",p.count,")"]})]},C)),O.length>3&&n.jsxs("div",{className:"text-slate-500 text-[9px]",children:["+",O.length-3," more"]})]})]})},b)})}),n.jsxs("div",{className:"flex justify-between mt-4",children:[n.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-[0.2em]",children:"30 minutes ago"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse shadow-[0_0_8px_rgba(34,197,94,0.5)]"}),n.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-[0.2em]",children:"Live"})]})]})]})}function Et({pages:a,totalViews:d}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(br,{className:"w-5 h-5 text-blue-400"}),"Most Visited Pages"]})}),n.jsxs("div",{className:"space-y-4",children:[a.map((c,o)=>n.jsxs("div",{className:"group flex items-center justify-between p-4 rounded-2xl bg-white/5 hover:bg-white/10 transition-all border border-transparent hover:border-white/10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-xs font-bold text-slate-500 w-4",children:o+1}),n.jsx("span",{className:"text-slate-300 font-medium group-hover:text-blue-400 transition-colors uppercase tracking-wider text-xs",children:c.path==="/"?"Home":c.path.replace("/","").replace(/-/g," ")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-white font-bold",children:c.count}),n.jsx("div",{className:"w-16 bg-white/5 h-1.5 rounded-full overflow-hidden",children:n.jsx("div",{className:"bg-blue-500 h-full rounded-full",style:{width:`${c.count/(d||1)*100}%`}})})]})]},o)),a.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-8 italic",children:"No page view data yet."})]})]})}function Rt({geo:a,cities:d}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ge,{className:"w-5 h-5 text-purple-400"}),"Top Locations"]})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest mb-4",children:"Countries"}),n.jsx("div",{className:"space-y-3",children:a.map((c,o)=>c.country!=="Unknown"&&o<5&&n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-white/5 border border-transparent",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-lg",children:Ie(c.country,c.countryCode)}),n.jsx("span",{className:"text-slate-300 font-medium text-sm",children:c.country})]}),n.jsx("span",{className:"text-white font-bold text-sm",children:c.count})]},o))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest mb-4",children:"Cities"}),n.jsx("div",{className:"grid grid-cols-2 gap-3",children:d.map((c,o)=>n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-blue-500/5 border border-blue-500/10",children:[n.jsx("span",{className:"text-slate-300 text-sm truncate",children:c.city}),n.jsx("span",{className:"text-blue-400 font-bold text-sm",children:c.count})]},o))})]}),a.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-12 italic",children:"Waiting for more traffic data..."})]})]})}function Lt({sources:a,referrers:d}){return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Le,{className:"w-5 h-5 text-orange-400"}),"Traffic Sources (UTM)"]}),n.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[a.map((c,o)=>n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl bg-white/5 border border-white/5",children:[n.jsx("span",{className:"text-slate-300 font-medium",children:c.source}),n.jsx("span",{className:"text-white font-bold",children:c.count})]},o)),a.length===0&&n.jsx("p",{className:"text-slate-500 italic text-sm",children:"No UTM parameters detected yet."})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("h2",{className:"text-xl font-bold text-white mb-8",children:"Top Referrers"}),n.jsxs("div",{className:"space-y-4",children:[d.map((c,o)=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"text-slate-400 text-[10px] truncate max-w-full italic",children:c.url||"Direct"}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-white font-medium text-sm",children:c.url?new URL(c.url).hostname:"Direct Entry"}),n.jsx("span",{className:"text-blue-400 font-bold",children:c.count})]})]},o)),d.length===0&&n.jsx("p",{className:"text-slate-500 italic text-sm",children:"No referrers detected yet."})]})]})]})}function It({session:a}){var c;if(!a.pageViews&&!a.events)return null;const d=[...(a.pageViews||[]).map(o=>({...o,type:"page_view"})),...(a.events||[]).map(o=>{var l;return{...o,type:"event",path:((l=o.metadata)==null?void 0:l.path)||"Action"}})].sort((o,l)=>new Date(o.timestamp).getTime()-new Date(l.timestamp).getTime());return d.length===0?n.jsx("div",{className:"py-8 text-center text-slate-500 italic text-sm",children:"No detailed navigation data available for this session."}):n.jsxs("div",{className:"py-8 px-10 bg-white/[0.01] border-t border-white/5",children:[n.jsx("h3",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-4",children:"Navigation Journey"}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-400",children:n.jsx(pt,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Browser"}),n.jsx("p",{className:"text-white text-xs font-medium",children:a.browser||"Unknown"})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center text-purple-400",children:n.jsx(mt,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"OS & Screen"}),n.jsxs("p",{className:"text-white text-xs font-medium",children:[a.os||"Unknown",a.screenWidth&&` (${a.screenWidth}x${a.screenHeight})`]})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center text-green-400",children:n.jsx(xr,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Language"}),n.jsx("p",{className:"text-white text-xs font-medium uppercase",children:a.language||"Unknown"})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-yellow-500/10 flex items-center justify-center text-yellow-400",children:n.jsx(Ge,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Network / ISP"}),n.jsx("p",{className:"text-white text-xs font-medium truncate max-w-[120px]",title:a.org||a.isp,children:a.org||a.isp||"Unknown"})]})]})]}),n.jsxs("div",{className:"space-y-0 relative",children:[n.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-white/5"}),d.map((o,l)=>{var u;return n.jsxs("div",{className:"relative pl-10 pb-8 last:pb-4 group",children:[n.jsx("div",{className:`absolute left-0 top-0.5 w-6 h-6 rounded-full border-2 border-slate-900 z-10 flex items-center justify-center transition-transform group-hover:scale-110
145
+ ${o.type==="page_view"?"bg-blue-500 shadow-[0_0_10px_rgba(59,130,246,0.5)]":"bg-yellow-500 shadow-[0_0_10px_rgba(234,179,8,0.3)]"}
146
+ `,children:o.type==="page_view"?n.jsx(gt,{className:"w-3 h-3 text-white"}):n.jsx(Fe,{className:"w-3 h-3 text-slate-900"})}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:`text-sm font-bold tracking-tight ${o.type==="page_view"?"text-white":"text-yellow-500"}`,children:o.type==="page_view"?o.path:((u=o.name)==null?void 0:u.replace(/_/g," "))||"Interaction"}),n.jsx("span",{className:"text-[10px] text-slate-500 font-mono bg-white/5 px-1.5 py-0.5 rounded",children:new Date(o.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[o.type==="page_view"&&o.duration&&n.jsxs("span",{className:"text-[10px] text-slate-500 flex items-center gap-1 bg-white/5 px-1.5 py-0.5 rounded",children:["⏱️ ",o.duration,"s duration"]}),o.type==="event"&&n.jsxs("span",{className:"text-[10px] text-yellow-500/60 uppercase font-bold tracking-tighter",children:["Triggered ",o.category||"interaction"]})]}),o.metadata&&Object.keys(o.metadata).length>0&&n.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:Object.entries(o.metadata).map(([h,b])=>h!=="path"&&n.jsxs("span",{className:"text-[9px] bg-white/5 px-2 py-0.5 rounded border border-white/5 text-slate-500 font-medium whitespace-nowrap",children:[n.jsxs("span",{className:"text-slate-600 mr-1",children:[h,":"]}),typeof b=="object"?JSON.stringify(b):String(b)]},h))})]})]},l)}),n.jsxs("div",{className:"relative pl-10 group mt-4",children:[n.jsx("div",{className:"absolute left-0 top-0 w-6 h-6 rounded-full border-2 border-slate-900 bg-red-500/20 z-10 flex items-center justify-center",children:n.jsx(wr,{className:"w-3 h-3 text-red-500"})}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-bold text-red-400",children:"Exit / Last Activity"}),n.jsx("span",{className:"text-[10px] text-slate-600 bg-red-500/5 px-2 py-0.5 rounded font-mono",children:new Date(a.lastActive).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),n.jsxs("span",{className:"text-[10px] text-slate-500 italic",children:["User left site from: ",n.jsx("span",{className:"text-slate-400 font-bold not-italic ml-1",children:((c=d[d.length-1])==null?void 0:c.path)||"Unknown page"})]})]})]})]})]})}function Ot({sessions:a}){const[d,c]=M.useState(null),[,o]=M.useState(0);return M.useEffect(()=>{const l=setInterval(()=>o(u=>u+1),3e4);return()=>clearInterval(l)},[]),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Ve,{className:"w-5 h-5 text-green-400"}),"Recent Visitors"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/5 pb-4",children:[n.jsx("th",{className:"pb-4 w-10"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest text-center px-2",children:"Live"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Visitor / IP"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Location"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"ISP"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Source"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Exit Page"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Device"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Browser"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"OS"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Views"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest px-2 text-right",children:"Last Activity"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:a.slice(0,7).map(l=>{var w;const u=new Date(l.lastActive||l.createdAt).getTime(),h=l.isOnline&&Date.now()-u<3e4,b=d===l.id;return n.jsxs(M.Fragment,{children:[n.jsxs("tr",{className:ne("group hover:bg-white/5 transition-colors cursor-pointer",b&&"bg-white/5"),onClick:()=>c(b?null:l.id),children:[n.jsx("td",{className:"py-4 pl-4",children:b?n.jsx(mr,{className:"w-4 h-4 text-blue-500"}):n.jsx(gr,{className:"w-4 h-4 text-slate-600 group-hover:text-blue-500 transition-colors"})}),n.jsx("td",{className:"py-4 text-center px-2",children:h&&n.jsx("div",{className:"flex justify-center items-center",children:n.jsxs("span",{className:"relative flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"})]})})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-bold text-sm truncate max-w-[120px]",title:l.ip,children:l.user?l.user.name||l.user.email:"Anonymous"}),l.isReturning&&n.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 uppercase tracking-wide",children:"🔄 Returning"})]}),n.jsx("span",{className:"text-slate-500 text-[10px] font-mono",children:l.ip||"0.0.0.0"})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-lg",children:Ie(l.country||"Unknown",l.countryCode)}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-white text-xs",children:l.country||"Unknown"}),n.jsx("span",{className:"text-slate-500 text-[10px]",children:l.city})]})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-slate-200 text-xs font-medium truncate max-w-[120px] block",title:l.isp,children:l.isp||"Unknown ISP"}),l.org&&l.org!==l.isp&&n.jsx("span",{className:"text-slate-500 text-[10px] truncate max-w-[120px]",title:l.org,children:l.org})]})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:ne("text-[10px] uppercase font-bold px-2 py-0.5 rounded border",(w=l.utmSource)!=null&&w.includes("google")?"text-green-400 border-green-500/20 bg-green-500/10":"text-slate-400 border-slate-500/20 bg-slate-500/10"),children:l.utmSource||"Direct"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-slate-300 text-xs font-mono truncate max-w-[150px] block",title:l.exitPage,children:l.exitPage})}),n.jsx("td",{className:"py-4",children:l.device==="bot"?n.jsxs("div",{className:"flex items-center gap-1.5 text-orange-400 bg-orange-500/10 px-2 py-1 rounded border border-orange-500/20 w-fit",children:[n.jsx(fr,{className:"w-3 h-3"}),n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider",children:"Bot"})]}):n.jsx("span",{className:"text-slate-400 text-xs px-2 py-1 bg-white/5 rounded-lg border border-white/5 uppercase font-bold tracking-tighter",children:l.device||"Desktop"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-white text-xs whitespace-nowrap",children:l.browser||"Unknown"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-white text-xs whitespace-nowrap",children:l.os||"Unknown"})}),n.jsx("td",{className:"py-4",children:n.jsxs("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${l.pageViewsCount>1?"bg-blue-500/10 text-blue-400":"bg-slate-500/10 text-slate-400"}`,children:[l.pageViewsCount," View",l.pageViewsCount!==1&&"s"]})}),n.jsx("td",{className:"py-4 text-right pr-4",children:n.jsxs("div",{className:"flex flex-col items-end",children:[n.jsx("span",{className:"text-slate-400 text-xs font-medium",children:Xe(l.lastActive||l.createdAt)}),n.jsx("span",{className:"text-slate-500 text-[10px] whitespace-nowrap",children:Pt(l.lastActive||l.createdAt)})]})})]}),b&&n.jsx("tr",{className:"bg-white/[0.02] no-hover",children:n.jsx("td",{colSpan:11,className:"p-0 border-b border-white/5",children:n.jsx(It,{session:l})})})]},l.id)})})]})})]})}function sn({events:a}){return!a||a.length===0?n.jsx("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No events recorded in this timeframe."})})}):n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:"Recent Interactions"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-brand-gold/10 border border-brand-gold/20",children:[n.jsx(Fe,{className:"w-4 h-4 text-brand-gold"}),n.jsx("span",{className:"text-[10px] font-bold text-brand-gold uppercase tracking-widest",children:"Live Feed"})]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/5 pb-4",children:[n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Time"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Event"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Category"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"User"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest text-right",children:"Details"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:a.slice(0,7).map(d=>{var l,u,h;let c=Fe,o="text-slate-400 bg-slate-500/10";return d.category==="auth"?(c=yr,o="text-purple-400 bg-purple-500/10"):d.category==="investment"?(c=Le,o="text-brand-gold bg-brand-gold/10"):d.category==="wallet"&&(c=jr,o="text-blue-400 bg-blue-500/10"),n.jsxs("tr",{className:"group hover:bg-white/5 transition-colors",children:[n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-slate-500 text-[10px] font-mono",children:new Date(d.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),n.jsx("span",{className:"text-slate-600 text-[9px]",children:Xe(d.timestamp)})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${o}`,children:n.jsx(c,{className:"w-4 h-4"})}),n.jsx("span",{className:"text-white font-bold text-sm uppercase tracking-tight",children:(l=d.name)==null?void 0:l.replace(/_/g," ")})]})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:`px-2 py-1 rounded-md text-[10px] font-bold uppercase tracking-widest border border-white/5 ${o}`,children:d.category||"General"})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-white text-sm font-medium",children:((u=d.user)==null?void 0:u.name)||"Anonymous User"}),((h=d.user)==null?void 0:h.email)&&n.jsx("span",{className:"text-slate-500 text-xs",children:d.user.email})]})}),n.jsx("td",{className:"py-4 text-right",children:d.metadata&&Object.keys(d.metadata).length>0&&n.jsx("div",{className:"flex flex-wrap justify-end gap-1.5 max-w-md ml-auto",children:Object.entries(d.metadata).slice(0,3).map(([b,w])=>n.jsxs("div",{className:"flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded border border-white/5",children:[n.jsxs("span",{className:"text-[10px] text-slate-500 font-bold uppercase",children:[b,":"]}),n.jsx("span",{className:"text-[10px] text-slate-300 font-mono",children:typeof w=="string"&&w.length>20?w.substring(0,20)+"...":String(w)})]},b))})})]},d.id)})})]})})]})}function Mt({funnel:a}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(bt,{className:"w-5 h-5 text-brand-gold"}),"Conversion Funnel"]})}),n.jsxs("div",{className:"text-right",children:[n.jsxs("span",{className:"text-2xl font-black text-brand-gold",children:[a.overallConversion,"%"]}),n.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:"Overall"})]})]}),n.jsx("div",{className:"space-y-3",children:a.steps.map((d,c)=>{const o=a.steps[0].count||1,l=Math.max(d.count/o*100,8),u=a.steps[c+1],h=u?d.count-u.count:0;return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-white font-medium",children:d.name}),n.jsx("span",{className:"text-slate-400",children:d.count.toLocaleString()})]}),n.jsx("div",{className:"relative h-10 bg-slate-800/50 rounded-lg overflow-hidden",children:n.jsx("div",{className:`h-full rounded-lg transition-all duration-500 flex items-center justify-end pr-3 ${c===0?"bg-blue-500":c===a.steps.length-1?"bg-green-500":"bg-blue-500/60"}`,style:{width:`${l}%`},children:n.jsxs("span",{className:"text-[10px] font-black text-white/90",children:[d.rate,"%"]})})}),u&&h>0&&n.jsxs("div",{className:"flex items-center justify-center text-[10px] text-red-400 py-1",children:[n.jsx(bt,{className:"w-3 h-3 mr-1"}),h.toLocaleString()," dropped (",100-u.rate,"% loss)"]})]},d.name)})})]})}function an({config:a,className:d}){var T,j,m,x,_,P;const[c,o]=M.useState("24h"),[l,u]=M.useState("front"),[h,b]=M.useState("users"),[w,O]=M.useState({start:"",end:""}),{stats:p,funnel:C,loading:k,error:S}=vt(a,c,l,h,c==="custom"?w:void 0);return!p&&k?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px]",children:[n.jsx(ft,{className:"w-10 h-10 animate-spin text-blue-500 mb-4"}),n.jsx("p",{className:"text-slate-400",children:"Loading your analytics data..."})]}):S?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 bg-red-500/10 rounded-3xl border border-red-500/20",children:[n.jsx("p",{className:"text-red-400 font-bold mb-2",children:"Error loading analytics"}),n.jsx("p",{className:"text-red-300 text-sm",children:S})]}):n.jsxs("div",{className:ne("space-y-8 animate-in fade-in duration-500",d),children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-4xl font-bold text-white mb-2 bg-gradient-to-r from-white to-white/60 bg-clip-text text-transparent",children:"Traffic Analytics"}),n.jsx("p",{className:"text-slate-400",children:"Measure visitor behavior and traffic sources in real-time."})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 w-full lg:w-auto",children:[n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["all","front","investor","admin"].map(y=>n.jsx("button",{onClick:()=>u(y),className:ne("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",l===y?"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:y==="all"?"All Pools":y==="front"?"Web":y==="investor"?"Dashboard":"Admin"},y))}),n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["all","users","bots"].map(y=>n.jsx("button",{onClick:()=>b(y),className:ne("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",h===y?y==="bots"?"bg-orange-500/20 text-orange-400 shadow-lg border border-orange-500/20":"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:y==="all"?"All":y==="users"?"Visitors":"Bots"},y))}),n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["24h","7d","30d","custom"].map(y=>n.jsx("button",{onClick:()=>o(y),className:ne("px-4 py-2 rounded-lg text-sm font-medium transition-all",c===y?"bg-blue-600 text-white shadow-lg shadow-blue-600/20":"text-slate-400 hover:text-white hover:bg-white/5"),children:y==="custom"?"Custom":y.toUpperCase()},y))})]})]}),c==="custom"&&n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-2xl p-6 flex flex-col sm:flex-row items-center gap-4",children:[n.jsx(ht,{className:"w-5 h-5 text-blue-400"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-slate-400 text-sm",children:"From:"}),n.jsx("input",{type:"date",value:w.start,onChange:y=>O(A=>({...A,start:y.target.value})),className:"bg-slate-800 border border-white/10 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-blue-500"})]}),n.jsx(pr,{className:"w-4 h-4 text-slate-500 hidden sm:block"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-slate-400 text-sm",children:"To:"}),n.jsx("input",{type:"date",value:w.end,onChange:y=>O(A=>({...A,end:y.target.value})),className:"bg-slate-800 border border-white/10 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-blue-500"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6",children:[n.jsx(ke,{label:"Active Now",value:((T=p==null?void 0:p.summary)==null?void 0:T.activeNow)||0,icon:n.jsx(Ve,{className:"w-5 h-5"}),color:"green",pulse:!0}),n.jsx(ke,{label:"Total Sessions",value:((j=p==null?void 0:p.summary)==null?void 0:j.sessions)||0,icon:n.jsx(gt,{className:"w-5 h-5"}),color:"purple"}),n.jsx(ke,{label:"Unique Visitors",value:((m=p==null?void 0:p.summary)==null?void 0:m.uniqueVisitors)||0,icon:n.jsx(Ve,{className:"w-5 h-5"}),color:"blue"}),n.jsx(ke,{label:"Page Views",value:((x=p==null?void 0:p.summary)==null?void 0:x.pageViews)||0,icon:n.jsx(Le,{className:"w-5 h-5"}),color:"orange"}),n.jsx(ke,{label:"Bounce Rate",value:`${((_=p==null?void 0:p.summary)==null?void 0:_.bounceRate)||0}%`,icon:n.jsx(ht,{className:"w-5 h-5"}),color:"red"})]}),n.jsxs("div",{className:"space-y-8",children:[n.jsx(At,{stats:p}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsx(Et,{pages:(p==null?void 0:p.topPages)||[],totalViews:((P=p==null?void 0:p.summary)==null?void 0:P.pageViews)||1}),n.jsx(Rt,{geo:(p==null?void 0:p.geo)||[],cities:(p==null?void 0:p.cities)||[]})]}),n.jsx(Lt,{sources:(p==null?void 0:p.sources)||[],referrers:(p==null?void 0:p.referrers)||[]}),n.jsx(Ot,{sessions:(p==null?void 0:p.recentSessions)||[]}),n.jsx(sn,{events:(p==null?void 0:p.recentEvents)||[]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(vr,{className:"w-5 h-5 text-blue-400"}),"Device Breakdown"]}),n.jsx("div",{className:"space-y-4",children:["Desktop","Mobile","Tablet"].map(y=>{var B,J,H;const A=((J=(B=p==null?void 0:p.devices)==null?void 0:B.find(G=>{var ee;return((ee=G.device)==null?void 0:ee.toLowerCase())===y.toLowerCase()}))==null?void 0:J.count)||0;return n.jsx(Ye,{label:y,count:A,total:((H=p==null?void 0:p.summary)==null?void 0:H.sessions)||0},y)})})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(pt,{className:"w-5 h-5 text-purple-400"}),"Browser Breakdown"]}),n.jsxs("div",{className:"space-y-4",children:[((p==null?void 0:p.browsers)||[]).slice(0,5).map(y=>{var A;return n.jsx(Ye,{label:y.browser,count:y.count,total:((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||0},y.browser)}),(!(p!=null&&p.browsers)||p.browsers.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No browser data yet"})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(mt,{className:"w-5 h-5 text-green-400"}),"OS Breakdown"]}),n.jsxs("div",{className:"space-y-4",children:[((p==null?void 0:p.os)||[]).slice(0,5).map(y=>{var A;return n.jsx(Ye,{label:y.os,count:y.count,total:((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||0},y.os)}),(!(p!=null&&p.os)||p.os.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No OS data yet"})]})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Ge,{className:"w-5 h-5 text-yellow-400"}),"Top Networks (ISP)"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[((p==null?void 0:p.isps)||[]).slice(0,8).map(y=>{var A;return n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/5",children:[n.jsx("p",{className:"text-white font-bold text-sm truncate",title:y.isp,children:y.isp}),n.jsxs("div",{className:"flex justify-between items-center mt-2",children:[n.jsxs("p",{className:"text-slate-500 text-xs",children:[y.count," sessions"]}),n.jsxs("p",{className:"text-blue-400 text-xs font-bold",children:[Math.round(y.count/(((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||1)*100),"%"]})]})]},y.isp)}),(!(p!=null&&p.isps)||p.isps.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic col-span-full",children:"No ISP data yet"})]})]}),C&&n.jsx(Mt,{funnel:C})]})]})}function Ye({label:a,count:d,total:c}){const o=c>0?Math.round(d/c*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-xs",children:[n.jsx("span",{className:"text-slate-300 font-medium",children:a}),n.jsxs("span",{className:"text-slate-500",children:[d," (",o,"%)"]})]}),n.jsx("div",{className:"h-1.5 w-full bg-white/5 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all duration-500",style:{width:`${o}%`}})})]})}var zt={exports:{}};(function(a){a.exports=d;function d(c){if(!(this instanceof d))return new d(c);this._canvas=c=typeof c=="string"?document.getElementById(c):c,this._ctx=c.getContext("2d"),this._width=c.width,this._height=c.height,this._max=1,this._data=[]}d.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(c){return this._data=c,this},max:function(c){return this._max=c,this},add:function(c){return this._data.push(c),this},clear:function(){return this._data=[],this},radius:function(c,o){o=o===void 0?15:o;var l=this._circle=this._createCanvas(),u=l.getContext("2d"),h=this._r=c+o;return l.width=l.height=h*2,u.shadowOffsetX=u.shadowOffsetY=h*2,u.shadowBlur=o,u.shadowColor="black",u.beginPath(),u.arc(-h,-h,c,0,Math.PI*2,!0),u.closePath(),u.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(c){var o=this._createCanvas(),l=o.getContext("2d"),u=l.createLinearGradient(0,0,0,256);o.width=1,o.height=256;for(var h in c)u.addColorStop(+h,c[h]);return l.fillStyle=u,l.fillRect(0,0,1,256),this._grad=l.getImageData(0,0,1,256).data,this},draw:function(c){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var o=this._ctx;o.clearRect(0,0,this._width,this._height);for(var l=0,u=this._data.length,h;l<u;l++)h=this._data[l],o.globalAlpha=Math.max(h[2]/this._max,c===void 0?.05:c),o.drawImage(this._circle,h[0]-this._r,h[1]-this._r);var b=o.getImageData(0,0,this._width,this._height);return this._colorize(b.data,this._grad),o.putImageData(b,0,0),this},_colorize:function(c,o){for(var l=0,u=c.length,h;l<u;l+=4)h=c[l+3]*4,h&&(c[l]=o[h],c[l+1]=o[h+1],c[l+2]=o[h+2])},_createCanvas:function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor}}})(zt);var on=zt.exports;const ln=ct(on);function cn({path:a,tenantUrl:d}){var p;const c=M.useRef(null),o=M.useRef(null),[l,u]=M.useState(!0),[h,b]=M.useState(null),[w,O]=M.useState([]);return M.useEffect(()=>{(async()=>{u(!0),b(null);try{const k=await fetch(`/api/v1/heatmap?path=${encodeURIComponent(a)}`,{headers:{"x-tenant-key":localStorage.getItem("ib_v2_api_key")||""}});if(!k.ok)throw new Error("Failed to fetch heatmap data");const S=await k.json();O(S)}catch(k){b(k.message)}finally{u(!1)}})()},[a]),M.useEffect(()=>{var m;if(!c.current||w.length===0||l)return;const C=c.current,k=C.getContext("2d");if(!k)return;k.clearRect(0,0,C.width,C.height);const S=ln(C),T=((m=o.current)==null?void 0:m.offsetWidth)||window.innerWidth,j=w.map(x=>{const _=T/x.width;return[x.x*_,x.y,1]});S.data(j),S.radius(25,15),S.draw()},[w,l]),n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:"Interaction Heatmap"}),n.jsxs("p",{className:"text-slate-500 text-sm",children:["Showing clusters for: ",a]})]}),n.jsxs("div",{className:"bg-slate-800 rounded-lg px-4 py-2 border border-white/5",children:[n.jsx("span",{className:"text-white font-bold",children:w.length}),n.jsx("span",{className:"text-slate-500 text-xs ml-2",children:"Total Interactions"})]})]}),n.jsxs("div",{ref:o,className:"relative bg-slate-900 rounded-3xl border border-white/5 overflow-hidden min-h-[600px]",children:[n.jsx("iframe",{src:`${d}${a}`,className:"absolute inset-0 w-full h-full border-none opacity-50 pointer-events-none",title:"Heatmap Preview"}),n.jsx("canvas",{ref:c,width:((p=o.current)==null?void 0:p.offsetWidth)||1200,height:2e3,className:"absolute inset-0 pointer-events-none z-10"}),l&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/50 backdrop-blur-sm z-20",children:n.jsx(ft,{className:"w-8 h-8 text-red-500 animate-spin"})}),h&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/50 backdrop-blur-sm z-20",children:n.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 p-6 rounded-2xl flex flex-col items-center gap-3",children:[n.jsx(hr,{className:"w-8 h-8 text-red-500"}),n.jsx("p",{className:"text-white font-medium",children:h})]})}),!l&&w.length===0&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/50 backdrop-blur-sm z-20",children:n.jsx("div",{className:"bg-slate-900 border border-white/5 p-8 rounded-3xl text-center",children:n.jsx("p",{className:"text-slate-400",children:"No interaction data found for this page yet."})})})]})]})}q.AnalyticsDashboard=an,q.COUNTRY_FLAGS=Tt,q.ConversionFunnel=Mt,q.GeoDistribution=Rt,q.HeatmapVisualizer=cn,q.RealtimeMonitor=At,q.RecentVisitors=Ot,q.SessionTimeline=It,q.StatCard=ke,q.TopPages=Et,q.TrafficSources=Lt,q.cn=ne,q.formatNumber=nn,q.formatRelativeTime=Xe,q.formatVisitorDate=Pt,q.getFlag=Ie,q.useAnalyticsData=vt,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,72 @@
1
+ export interface AnalyticsStats {
2
+ summary: {
3
+ activeNow: number;
4
+ sessions: number;
5
+ uniqueVisitors: number;
6
+ pageViews: number;
7
+ bounceRate: number;
8
+ realtimeActivity: number[];
9
+ realtimeActivityDetails: any[][];
10
+ };
11
+ topPages: Array<{
12
+ path: string;
13
+ count: number;
14
+ }>;
15
+ geo: Array<{
16
+ country: string;
17
+ count: number;
18
+ }>;
19
+ cities: Array<{
20
+ city: string;
21
+ count: number;
22
+ }>;
23
+ sources: Array<{
24
+ source: string;
25
+ count: number;
26
+ }>;
27
+ referrers: Array<{
28
+ url: string;
29
+ count: number;
30
+ }>;
31
+ devices: Array<{
32
+ device: string;
33
+ count: number;
34
+ }>;
35
+ browsers: Array<{
36
+ browser: string;
37
+ count: number;
38
+ }>;
39
+ os: Array<{
40
+ os: string;
41
+ count: number;
42
+ }>;
43
+ isps: Array<{
44
+ isp: string;
45
+ count: number;
46
+ }>;
47
+ recentSessions: any[];
48
+ recentEvents: any[];
49
+ }
50
+ export interface FunnelData {
51
+ steps: Array<{
52
+ name: string;
53
+ count: number;
54
+ rate: number;
55
+ }>;
56
+ overallConversion: number;
57
+ period: {
58
+ start: string;
59
+ end: string;
60
+ };
61
+ }
62
+ export interface DashboardConfig {
63
+ apiKey: string;
64
+ adminSecret: string;
65
+ endpoint: string;
66
+ refreshInterval?: number;
67
+ realtimeEnabled?: boolean;
68
+ soketiHost?: string;
69
+ soketiPort?: number;
70
+ soketiKey?: string;
71
+ soketiUseTLS?: boolean;
72
+ }
@@ -0,0 +1,7 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare const COUNTRY_FLAGS: Record<string, string>;
3
+ export declare const getFlag: (country: string | null | undefined, code?: string | null) => string;
4
+ export declare const formatNumber: (num: number) => string;
5
+ export declare const formatRelativeTime: (date: string | Date) => string;
6
+ export declare const formatVisitorDate: (date: string | Date) => string;
7
+ export declare function cn(...inputs: ClassValue[]): string;