@qratilabs/qrati-connect 2.27.2 → 2.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/element/1UqTmSK2.js +3 -0
- package/element/{B0sEsGHn.js → 2PuRbItp.js} +7 -7
- package/element/{B5RetLW0.js → 3uWxzKri.js} +51 -49
- package/element/{DyemeRjE2.js → 5z04gCoQ2.js} +1 -1
- package/element/77CTD63x.js +3 -0
- package/element/{B9ImRAum.js → 7zeKIiiL.js} +1 -1
- package/element/{MU5QuIq0.js → B01ceTPt.js} +1 -1
- package/element/{C8meSsHD.js → B7YFs6p5.js} +1 -1
- package/element/BB90a5r62.js +93 -0
- package/element/{DSx5wvUb2.js → BHmNrbtm2.js} +1 -1
- package/element/{DlAI3J0X.js → BMcQNiLL.js} +1 -1
- package/element/{DZGp2V2-.js → BMibcq6T.js} +1 -1
- package/element/BUDCYszs.js +1 -0
- package/element/{DdYePHxG.js → BcAwTWQC.js} +1 -1
- package/element/BdQrGBTf.js +4 -0
- package/element/Bgw9OUdR.js +4 -0
- package/element/{BdkTKcG52.js → BhOaopIk2.js} +5 -5
- package/element/C6et9sp52.js +3 -0
- package/element/{C4DSwLWc.js → C6ph3KPL.js} +1 -1
- package/element/{DOOdI-Oh.js → C8ixb9k4.js} +1 -1
- package/element/{Bspyv2wJ2.js → CKwlnGWW2.js} +2 -2
- package/element/{p0Q_2x6C.js → CLV9vt29.js} +4 -5
- package/element/CZK4LCzr2.js +3 -0
- package/element/CfTxXwtG2.js +36 -0
- package/element/{Vk429P022.js → Cr4OmKxk2.js} +1 -1
- package/element/{DvisvxzJ.js → CrF08YS6.js} +1 -1
- package/element/CtApMHPf.js +11 -0
- package/element/{BKENYwOQ.js → CxJgMv2R.js} +1 -1
- package/element/{DGZEznLT2.js → D34k0bDj2.js} +1 -1
- package/element/DBlhTxUx2.js +16 -0
- package/element/{CeHBrY_i.js → DUEaNsCB.js} +1 -1
- package/element/DUWOb-5c.js +1 -0
- package/element/{DmIYOIw1.js → DZwpw1jG.js} +1 -1
- package/element/{BspExsK7.js → Da7cHmvl.js} +2 -2
- package/element/{QDuBhueG.js → DlNQukHq.js} +1 -1
- package/element/DmVgPRH5.js +14 -0
- package/element/{CBM5QMn8.js → DtcmI8yd2.js} +1 -1
- package/element/{DVFC5Z2L2.js → DtqQWU6q2.js} +31 -31
- package/element/{DLF5ysgi.js → JFF45CMp.js} +1 -1
- package/element/{CUBxHQ8u.js → KdgQ7jUn.js} +1 -1
- package/element/{C6YE4WUG2.js → cePYhOkN2.js} +4 -4
- package/element/{D_FNRN5A2.js → hiapcVVA2.js} +1 -1
- package/element/{CKQOToSD.js → tJ2MS5HS.js} +3 -3
- package/element/{1eQ9Ef0M2.js → vA5CQmOb2.js} +2 -2
- package/element/web.es.js +39 -39
- package/package.json +1 -1
- package/element/BLeZg2Bz.js +0 -1
- package/element/BmsDSHUi.js +0 -4
- package/element/BqiJLitq2.js +0 -3
- package/element/C6MqLLDX.js +0 -3
- package/element/CfTdZB8y.js +0 -4
- package/element/CgxypkdG.js +0 -3
- package/element/Cl0CwL5p.js +0 -9
- package/element/DRPgs6nu2.js +0 -16
- package/element/DWqIpaZ02.js +0 -2
- package/element/SgRzjPnr.js +0 -14
- package/element/aXvUP7X72.js +0 -93
- package/element/qBKIp1ZW2.js +0 -36
- /package/element/{DPg_DKOi2.js → DPg_DKOi.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as r,t as e}from"./DrrpB4Om.js";import{i as t}from"./
|
|
1
|
+
import{T as r,t as e}from"./DrrpB4Om.js";import{i as t}from"./tJ2MS5HS.js";import{r as a}from"./DZwpw1jG.js";function i({className:r}){/* @__PURE__ */
|
|
2
2
|
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:r,"aria-hidden":"true",focusable:"false",children:[
|
|
3
3
|
/* @__PURE__ */e("circle",{cx:"18",cy:"12",r:"0",fill:"currentColor",children:/* @__PURE__ */e("animate",{attributeName:"r",begin:".67",calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"})}),
|
|
4
4
|
/* @__PURE__ */e("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",children:/* @__PURE__ */e("animate",{attributeName:"r",begin:".33",calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"})}),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{C as e,_ as r,f as t,h as n,p as s,t as a}from"./DrrpB4Om.js";import{a as o,l as i,n as c}from"./tJ2MS5HS.js";import{t as l}from"./DUEaNsCB.js";import{v as u}from"./DUWOb-5c.js";import{t as m}from"./7zeKIiiL.js";import{t as f}from"./BUDCYszs.js";import{a as p,i as d,n as g,r as h,t as b}from"./CLV9vt29.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:k}=Object,{hasOwnProperty:v}=Object.prototype;function x(e,r){return function(t,n,s){return e(t,n,s)&&r(t,n,s)}}function w(e){return function(r,t,n){if(!r||!t||"object"!=typeof r||"object"!=typeof t)return e(r,t,n);const{cache:s}=n,a=s.get(r),o=s.get(t);if(a&&o)return a===t&&o===r;s.set(r,t),s.set(t,r);const i=e(r,t,n);return s.delete(r),s.delete(t),i}}function E(e){return y(e).concat(k(e))}var M=Object.hasOwn||((e,r)=>v.call(e,r));function C(e,r){return e===r||!e&&!r&&e!=e&&r!=r}var{getOwnPropertyDescriptor:j,keys:L}=Object;function A(e,r){return e.byteLength===r.byteLength&&D(new Uint8Array(e),new Uint8Array(r))}function q(e,r,t){let n=e.length;if(r.length!==n)return!1;for(;n-- >0;)if(!t.equals(e[n],r[n],n,n,e,r,t))return!1;return!0}function O(e,r){return e.byteLength===r.byteLength&&D(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}function I(e,r){return C(e.getTime(),r.getTime())}function S(e,r){return e.name===r.name&&e.message===r.message&&e.cause===r.cause&&e.stack===r.stack}function _(e,r){return e===r}function z(e,r,t){const n=e.size;if(n!==r.size)return!1;if(!n)return!0;const s=new Array(n),a=e.entries();let o,i,c=0;for(;(o=a.next())&&!o.done;){const n=r.entries();let a=!1,l=0;for(;(i=n.next())&&!i.done;){if(s[l]){l++;continue}const n=o.value,u=i.value;if(t.equals(n[0],u[0],c,l,e,r,t)&&t.equals(n[1],u[1],n[0],u[0],e,r,t)){a=s[l]=!0;break}l++}if(!a)return!1;c++}return!0}var P=C;function T(e,r,t){const n=L(e);let s=n.length;if(L(r).length!==s)return!1;for(;s-- >0;)if(!Z(e,r,t,n[s]))return!1;return!0}function U(e,r,t){const n=E(e);let s,a,o,i=n.length;if(E(r).length!==i)return!1;for(;i-- >0;){if(s=n[i],!Z(e,r,t,s))return!1;if(a=j(e,s),o=j(r,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable))return!1}return!0}function N(e,r){return C(e.valueOf(),r.valueOf())}function $(e,r){return e.source===r.source&&e.flags===r.flags}function B(e,r,t){const n=e.size;if(n!==r.size)return!1;if(!n)return!0;const s=new Array(n),a=e.values();let o,i;for(;(o=a.next())&&!o.done;){const n=r.values();let a=!1,c=0;for(;(i=n.next())&&!i.done;){if(!s[c]&&t.equals(o.value,i.value,o.value,i.value,e,r,t)){a=s[c]=!0;break}c++}if(!a)return!1}return!0}function D(e,r){let t=e.byteLength;if(r.byteLength!==t||e.byteOffset!==r.byteOffset)return!1;for(;t-- >0;)if(e[t]!==r[t])return!1;return!0}function F(e,r){return e.hostname===r.hostname&&e.pathname===r.pathname&&e.protocol===r.protocol&&e.port===r.port&&e.hash===r.hash&&e.username===r.username&&e.password===r.password}function Z(e,r,t,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!e.$$typeof&&!r.$$typeof)||M(r,n)&&t.equals(e[n],r[n],n,n,e,r,t)}var R={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},V=Object.prototype.toString;var G=K();function K(e={}){const{circular:r=!1,createInternalComparator:t,createState:n,strict:s=!1}=e,a=function({areArrayBuffersEqual:e,areArraysEqual:r,areDataViewsEqual:t,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:i,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:m,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:d}){return function(g,h,b){if(g===h)return!0;if(null==g||null==h)return!1;const y=typeof g;if(y!==typeof h)return!1;if("object"!==y)return"number"===y?i(g,h,b):"function"===y&&a(g,h,b);const k=g.constructor;if(k!==h.constructor)return!1;if(k===Object)return c(g,h,b);if(Array.isArray(g))return r(g,h,b);if(k===Date)return n(g,h,b);if(k===RegExp)return u(g,h,b);if(k===Map)return o(g,h,b);if(k===Set)return m(g,h,b);const v=V.call(g);if("[object Date]"===v)return n(g,h,b);if("[object RegExp]"===v)return u(g,h,b);if("[object Map]"===v)return o(g,h,b);if("[object Set]"===v)return m(g,h,b);if("[object Object]"===v)return"function"!=typeof g.then&&"function"!=typeof h.then&&c(g,h,b);if("[object URL]"===v)return p(g,h,b);if("[object Error]"===v)return s(g,h,b);if("[object Arguments]"===v)return c(g,h,b);if(R[v])return f(g,h,b);if("[object ArrayBuffer]"===v)return e(g,h,b);if("[object DataView]"===v)return t(g,h,b);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return l(g,h,b);if(d){let e=d[v];if(!e){const r=null!=(x=g)?x[Symbol.toStringTag]:void 0;r&&(e=d[r])}if(e)return e(g,h,b)}var x;return!1}}(function({circular:e,createCustomConfig:r,strict:t}){let n={areArrayBuffersEqual:A,areArraysEqual:t?U:q,areDataViewsEqual:O,areDatesEqual:I,areErrorsEqual:S,areFunctionsEqual:_,areMapsEqual:t?x(z,U):z,areNumbersEqual:P,areObjectsEqual:t?U:T,arePrimitiveWrappersEqual:N,areRegExpsEqual:$,areSetsEqual:t?x(B,U):B,areTypedArraysEqual:t?x(D,U):D,areUrlsEqual:F,unknownTagComparators:void 0};if(r&&(n=Object.assign({},n,r(n))),e){const e=w(n.areArraysEqual),r=w(n.areMapsEqual),t=w(n.areObjectsEqual),s=w(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:e,areMapsEqual:r,areObjectsEqual:t,areSetsEqual:s})}return n}(e));return function({circular:e,comparator:r,createState:t,equals:n,strict:s}){if(t)return function(a,o){const{cache:i=(e?/* @__PURE__ */new WeakMap:void 0),meta:c}=t();return r(a,o,{cache:i,equals:n,meta:c,strict:s})};if(e)return function(e,t){return r(e,t,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const a={cache:void 0,equals:n,meta:void 0,strict:s};return function(e,t){return r(e,t,a)}}({circular:r,comparator:a,createState:n,equals:t?t(a):(o=a,function(e,r,t,n,s,a,i){return o(e,r,i)}),strict:s});var o}K({strict:!0}),K({circular:!0}),K({circular:!0,strict:!0}),K({createInternalComparator:()=>C}),K({strict:!0,createInternalComparator:()=>C}),K({circular:!0,createInternalComparator:()=>C}),K({circular:!0,createInternalComparator:()=>C,strict:!0});var W=class{static isAdvancedMarkerAvailable(e){return google.maps.marker&&!0===e.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,r){this.isAdvancedMarker(e)?e.map=r:e.setMap(r)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return!!this.isAdvancedMarker(e)||e.getVisible()}},J=class{constructor({markers:e,position:r}){this.markers=[],e&&(this.markers=e),r&&(r instanceof google.maps.LatLng?this._position=r:this._position=new google.maps.LatLng(r))}get bounds(){if(0===this.markers.length&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const r of this.markers)e.extend(W.getPosition(r));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>W.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(W.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function X(e,r="assertion failed"){if(null==e)throw Error(r)}var H,Q=class{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return Y(e)}},Y=e=>e.map(e=>new J({position:W.getPosition(e),markers:[e]})),ee=class extends Q{constructor(e){var{maxZoom:r,radius:t=60}=e,n=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)r.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(t[n[s]]=e[n[s]])}return t}(e,["maxZoom","radius"]);super({maxZoom:r}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new f(Object.assign({maxZoom:this.maxZoom,radius:t},n))}calculate(e){let r=!1,t=e.map.getZoom();X(t),t=Math.round(t);const n={zoom:t};if(!G(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const t=this.markers.map(e=>{const r=W.getPosition(e);return{type:"Feature",geometry:{type:"Point",coordinates:[r.lng(),r.lat()]},properties:{marker:e}}});this.superCluster.load(t)}return r||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(r=!G(this.state,n)),this.state=n,0===e.markers.length?(this.clusters=[],{clusters:this.clusters,changed:r}):(r&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:r})}cluster({map:e}){const r=e.getZoom();return X(r),this.superCluster.getClusters([-180,-90,180,90],Math.round(r)).map(e=>this.transformCluster(e))}transformCluster({geometry:{coordinates:[e,r]},properties:t}){if(t.cluster)return new J({markers:this.superCluster.getLeaves(t.cluster_id,1/0).map(e=>e.properties.marker),position:{lat:r,lng:e}});const n=t.marker;return new J({markers:[n],position:W.getPosition(n)})}},re=class{constructor(e,r){this.markers={sum:e.length};const t=r.map(e=>e.count),n=t.reduce((e,r)=>e+r,0);this.clusters={count:r.length,markers:{mean:n/r.length,sum:n,min:Math.min(...t),max:Math.max(...t)}}}},te=class{render({count:e,position:r},t,n){const s=`<svg fill="${e>Math.max(10,t.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>\n</svg>`,a=`Cluster of ${e} markers`,o=Number(google.maps.Marker.MAX_ZINDEX)+e;if(W.isAdvancedMarkerAvailable(n)){const e=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;e.setAttribute("transform","translate(0 25)");const t={map:n,position:r,zIndex:o,title:a,content:e};return new google.maps.marker.AdvancedMarkerElement(t)}const i={position:r,zIndex:o,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(i)}},ne=class e{constructor(){!function(e,r){for(let t in r.prototype)e.prototype[t]=r.prototype[t]}(e,google.maps.OverlayView)}};!function(e){e.CLUSTERING_BEGIN="clusteringbegin",e.CLUSTERING_END="clusteringend",e.CLUSTER_CLICK="click",e.GMP_CLICK="gmp-click"}(H||(H={}));var se=(e,r,t)=>{r.bounds&&t.fitBounds(r.bounds)},ae=class extends ne{constructor({map:e,markers:r=[],algorithmOptions:t={},algorithm:n=new ee(t),renderer:s=new te,onClusterClick:a=se}){super(),this.map=null,this.idleListener=null,this.markers=[...r],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=a,e&&this.setMap(e)}addMarker(e,r){this.markers.includes(e)||(this.markers.push(e),r||this.render())}addMarkers(e,r){e.forEach(e=>{this.addMarker(e,!0)}),r||this.render()}removeMarker(e,r){const t=this.markers.indexOf(e);return-1!==t&&(W.setMap(e,null),this.markers.splice(t,1),r||this.render(),!0)}removeMarkers(e,r){let t=!1;return e.forEach(e=>{t=this.removeMarker(e,!0)||t}),t&&!r&&this.render(),t}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,H.CLUSTERING_BEGIN,this);const{clusters:r,changed:t}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(t||null==t){const e=/* @__PURE__ */new Set;for(const n of r)1==n.markers.length&&e.add(n.markers[0]);const t=[];for(const r of this.clusters)null!=r.marker&&(1==r.markers.length?e.has(r.marker)||W.setMap(r.marker,null):t.push(r.marker));this.clusters=r,this.renderClusters(),requestAnimationFrame(()=>t.forEach(e=>W.setMap(e,null)))}google.maps.event.trigger(this,H.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();X(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>W.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new re(this.markers,this.clusters),r=this.getMap();this.clusters.forEach(t=>{if(1===t.markers.length)t.marker=t.markers[0];else if(t.marker=this.renderer.render(t,e,r),t.markers.forEach(e=>W.setMap(e,null)),this.onClusterClick){const e=W.isAdvancedMarker(t.marker)?H.GMP_CLICK:H.CLUSTER_CLICK;t.marker.addListener(e,e=>{google.maps.event.trigger(this,H.CLUSTER_CLICK,t),this.onClusterClick(e,t,r)})}W.setMap(t.marker,r)})}},oe={top:60,bottom:60,left:276,right:60},ie="#fb8500",ce=new l,le=e=>{const r=document.createElement("div");r.style.cssText=`\n background:${h(e.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const t=document.createElement("span");t.textContent=e.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(e.eventCount),r.appendChild(t),r.appendChild(n),r},ue=(e,r)=>{const t=document.createElement("div");if(t.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${e};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,r){const e=document.createElement("img");e.src=d(r)??"",e.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",t.appendChild(e)}return t},me=({apiKey:l,onExplore:f,logoUrl:d})=>{const h=t(null),y=t(null),k=t(null),v=t(null),x=t(null),w=t([]),E=t([]),M=t(null),C=t(null),j=t(!1),L=t(!1),[A,q]=n(!1),[O,I]=n(!0),{folderTree:S,activeFolderId:_,activeFolder:z,visibleEvents:P,setActiveFolderId:T,isLoadingEvents:U}=m(),{organization:N}=c(),$=`${u}-${N?._id??"unknown"}`,B=t($);B.current=$;const D=s(()=>(e=>{try{const r=sessionStorage.getItem(e);if(!r)return null;const t=JSON.parse(r);if(Array.isArray(t?.center)&&"number"==typeof t.zoom)return t}catch{}return null})($),[$]),F=t(/* @__PURE__ */new Map),Z=t(/* @__PURE__ */new Map),R=t(null),V=t(null),G=t(f);G.current=f;const K=(e,r,t,n,s)=>{s.event.addListenerOnce(e,"bounds_changed",()=>{const r=e.getZoom();void 0!==r&&r>n&&e.setZoom(n)}),e.fitBounds(r,t)},W=()=>{w.current.forEach(e=>{e.map=null}),w.current=[]},J=()=>{M.current&&(M.current.clearMarkers(),M.current=null),E.current.forEach(e=>{e.map=null}),E.current=[]};return r(()=>{if(!h.current||y.current)return;let r=!1;return(async()=>{try{const{setOptions:t,importLibrary:n}=await import("./CL_evx_l.js");if(r)return;if(t({key:l,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),r||!h.current)return;const s=window.google.maps;k.current=s;const a=D?.center?{lng:D.center[0],lat:D.center[1]}:{lat:20,lng:0},o=D?.zoom??3,i=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:a,zoom:o,mapTypeControl:!1,streetViewControl:!1});y.current=i,v.current=new s.InfoWindow({maxWidth:280}),v.current.addListener("closeclick",()=>{x.current&&(e(null,x.current),x.current=null)}),C.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const e=i.getCenter();if(!e)return;sessionStorage.setItem(B.current,JSON.stringify({center:[e.lng(),e.lat()],zoom:i.getZoom()}))}catch{}};i.addListener("idle",c),I(!1),q(!0)}finally{r||I(!1)}})(),()=>{r=!0,W(),J(),C.current&&(C.current.setMap(null),C.current=null),v.current?.close(),x.current&&(e(null,x.current),x.current=null),y.current=null,k.current=null}},[l]),r(()=>{if(!A)return;const r=y.current,t=k.current;if(!r||!t)return;const n=null===_&&S.length>0,s=!n&&0===S.length&&null===_,o=n?"folders":s?"all-events":"folder-events";if(R.current!==o&&(W(),J(),Z.current.clear(),F.current.clear(),V.current=null,v.current?.close(),R.current=o),n){C.current?.setMap(null);const e=[],n=r=>{for(const t of r)t.centroid?e.push(t):t.children.length>0&&n(t.children)};n(S);const s=new Set(e.map(e=>e.folder._id));for(const[r,t]of Z.current)s.has(r)||(t.map=null,Z.current.delete(r));w.current=Array.from(Z.current.values());for(const a of e){const e=Z.current.get(a.folder._id);if(e){e.position={lng:a.centroid[0],lat:a.centroid[1]};continue}const n=le(a),s=new t.marker.AdvancedMarkerElement({map:r,position:{lng:a.centroid[0],lat:a.centroid[1]},content:n,gmpClickable:!0});s.addListener("click",()=>T(a.folder._id)),Z.current.set(a.folder._id,s),w.current.push(s)}}else{if(0===P.length){for(const e of F.current.values())"all-events"===o?M.current?.removeMarker(e,!0):e.map=null;return F.current.clear(),void(E.current=[])}const n=s?ie:z?.color||ie,c=`${n}|${d??""}`,l=V.current!==c;V.current=c;const u=new Set(P.map(e=>String(e._id))),m=[];for(const[e,r]of F.current)u.has(e)||(m.push(r),F.current.delete(e));m.length>0&&M.current?.removeMarkers(m,!0);const f=[],g=[],h=new t.LatLngBounds;P.forEach(o=>{const c=String(o._id),u=o.location.y,m=o.location.x;h.extend({lat:u,lng:m}),s&&g.push({location:new t.LatLng(u,m),weight:(o.views||0)+1});const b=F.current.get(c);if(b)return b.position={lat:u,lng:m},void(l&&(b.content=ue(n,d)));const y=ue(n,d),k=new t.marker.AdvancedMarkerElement({map:r,position:{lat:u,lng:m},content:y,gmpClickable:!0});k.addListener("click",()=>{x.current&&e(null,x.current);const t=document.createElement("div");((r,t)=>{e(/* @__PURE__ */a(i,{client:ce,children:/* @__PURE__ */a(p,{event:r,onExplore:e=>G.current?.(e)})}),t)})(o,t),v.current?.close(),v.current?.setContent(t),v.current?.open({anchor:k,map:r}),x.current=t}),F.current.set(c,k),f.push(k)}),E.current=Array.from(F.current.values()),l&&M.current&&(M.current.clearMarkers(),M.current=null),(f.length>0||m.length>0||l)&&(M.current?(f.length>0&&M.current.addMarkers(f,!0),M.current.render()):M.current=new ae({markers:E.current,map:r,renderer:{render:e=>{const{count:r,position:s}=e,a=document.createElement("div"),o=r<10?28:r<30?34:40;return a.style.cssText=`\n width:${o}px;height:${o}px;border-radius:50%;cursor:pointer;\n background:${n};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,a.textContent=String(r),new t.marker.AdvancedMarkerElement({position:s,content:a,gmpClickable:!0,zIndex:1e6+r})}}})),s?(C.current&&(C.current.setData(g),C.current.setMap(r)),L.current||(L.current=!0,D||h.isEmpty()||K(r,h,oe,8,t))):C.current?.setMap(null)}},[_,S,P,A,d,T,z,D]),r(()=>{if(!A)return;const e=y.current,r=k.current;if(e&&r)if(j.current||!D){if(j.current=!0,_){const t=g(S,_);if(!t?.folder.boundary?.length)return;const n=new r.LatLngBounds;for(const e of t.folder.boundary)n.extend({lat:e.y,lng:e.x});n.isEmpty()||K(e,n,oe,14,r)}else if(S.length>0){const t=new r.LatLngBounds,n=e=>{for(const r of e)r.centroid?t.extend({lng:r.centroid[0],lat:r.centroid[1]}):n(r.children)};n(S),t.isEmpty()||K(e,t,oe,8,r)}}else j.current=!0},[_,S,A,D]),/* @__PURE__ */a("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:o(N),children:[
|
|
2
|
+
/* @__PURE__ */a(b,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:S,activeFolderId:_,setActiveFolderId:T}),U&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */a("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),O&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */a("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */a("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */a("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
|
+
/* @__PURE__ */a("div",{ref:h,class:"size-full"})]})};export{me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,h as n,p as t,v as o}from"./DrrpB4Om.js";import{n as i,s as r}from"./
|
|
1
|
+
import{_ as e,h as n,p as t,v as o}from"./DrrpB4Om.js";import{n as i,s as r}from"./tJ2MS5HS.js";import{t as a}from"./DmpmrPE5.js";import{i as l}from"./DUWOb-5c.js";var s=(e,n)=>e.filter(e=>(e.parentFolderId??null)===n).map(n=>{return{folder:n,children:s(e,n._id),eventCount:n.boundary?.length??0,centroid:(t=n.boundary,t?.length?[t.reduce((e,n)=>e+n.x,0)/t.length,t.reduce((e,n)=>e+n.y,0)/t.length]:null),color:n.color||"#fb8500"};var t}).filter(e=>e.eventCount>0||e.children.length>0),d=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),c=()=>{const{folders:c,organization:m}=i(),[g,u]=n(null),f=Boolean(m?.integrationSettings?.enableFolderView),h=t(()=>f?s(c??[],null):[],[c,f]),y=r({queryKey:["map-all-events",m?._id],queryFn:async()=>d((await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(m?._id)&&(!f||0===h.length),staleTime:3e5,gcTime:6e5,retry:!1}),v=r({queryKey:["map-folder-events",m?._id,g],queryFn:async()=>d((await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{folderId:g,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(m?._id)&&f&&Boolean(g),staleTime:3e5,gcTime:6e5,retry:!1}),p=t(()=>(c??[]).find(e=>e._id===g)??null,[c,g]);e(()=>{f||u(null)},[f]);const _=o(e=>{u(e)},[]),F=f&&h.length>0;return{folderTree:h,activeFolderId:g,activeFolder:p,visibleEvents:F?v.data??[]:y.data??[],setActiveFolderId:_,isLoadingEvents:F?Boolean(g)&&(v.isLoading||v.isFetching):y.isLoading||y.isFetching}};export{c as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as a}from"./DrrpB4Om.js";import{i as t,n as e}from"./
|
|
1
|
+
import{t as a}from"./DrrpB4Om.js";import{i as t,n as e}from"./tJ2MS5HS.js";import{t as i}from"./DZwpw1jG.js";var r=({title:r,description:s,iconSvg:o,className:l})=>{const{props:n,organization:c}=e(),m=n?.emptyStateImage;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:t("mx-auto flex w-full max-w-md flex-col items-center justify-center gap-8",l),children:[c?.integrationSettings?.showLogo?/* @__PURE__ */a("img",{className:"h-44 w-auto",src:c?.logoUrl||"/images/qrati-logo.svg",alt:r}):m?/* @__PURE__ */a("img",{className:"h-44 w-auto",src:m,alt:r}):o?/* @__PURE__ */a("div",{className:"text-primary h-44 w-auto",children:o}):null,/* @__PURE__ */a("div",{className:"space-y-2",children:[
|
|
3
3
|
/* @__PURE__ */a(i,{variant:"h4",align:"center",children:r}),"string"==typeof s&&/* @__PURE__ */a(i,{variant:"body2",color:"muted",align:"center",children:s}),"string"!=typeof s&&s]})]})};export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,m as r,p as s}from"./
|
|
1
|
+
import{c as e,d as t,m as r,p as s}from"./tJ2MS5HS.js";var i=class extends t{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:i}=e,a=super.createResult(e,t),{isFetching:c,isRefetching:h,isError:o,isRefetchError:n}=a,P=i.fetchMeta?.fetchMore?.direction,g=o&&"forward"===P,u=c&&"forward"===P,f=o&&"backward"===P,d=c&&"backward"===P;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:s(t,i.data),hasPreviousPage:r(t,i.data),isFetchNextPageError:g,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:d,isRefetchError:n&&!g&&!f,isRefetching:h&&!u&&!d}}};function a(t,r){return e(t,i,r)}var c=e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0,h=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0;export{c as n,a as r,h as t};
|