@oneclick.dev/cms-core-modules 0.0.84 → 0.0.85

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.
@@ -1,11 +1,11 @@
1
- import { defineComponent as Y, ref as y, withAsyncContext as M, watch as $, onMounted as O, resolveComponent as s, openBlock as d, createElementBlock as j, createElementVNode as c, createVNode as t, unref as v, withCtx as l, createTextVNode as o, createBlock as g, createCommentVNode as T, toDisplayString as r, Fragment as Q, renderList as h } from "vue";
2
- import { useModulePermissions as G, useModuleRoute as J, useModuleStorage as K, useModuleBreadcrumbs as W, useFirebaseIntegration as X, useRoute as Z, useRouter as ee } from "@oneclick.dev/cms-kit";
3
- import { Plus as te, Search as le, Loader2 as ne, Pencil as oe } from "lucide-vue-next";
4
- import { u as se } from "./index-CrGjxSwa.mjs";
5
- const ae = { class: "relative" }, ue = {
1
+ import { defineComponent as Y, ref as _, withAsyncContext as M, watch as $, onMounted as Q, resolveComponent as s, openBlock as d, createElementBlock as j, createElementVNode as c, createVNode as t, unref as v, withCtx as l, createTextVNode as o, createBlock as g, createCommentVNode as T, toDisplayString as i, Fragment as h, renderList as G } from "vue";
2
+ import { useModulePermissions as J, useModuleRoute as K, useModuleStorage as W, useModuleBreadcrumbs as X, useFirebaseIntegration as Z, useRoute as ee, useRouter as te, useOverlayParams as le } from "@oneclick.dev/cms-kit";
3
+ import { Plus as ne, Search as oe, Loader2 as se, Pencil as ae } from "lucide-vue-next";
4
+ import { u as ue } from "./index-CrGjxSwa.mjs";
5
+ const re = { class: "relative" }, ie = {
6
6
  ref: "container",
7
7
  class: "w-full max-w-5xl mx-auto"
8
- }, ie = { class: "flex justify-between items-center mb-4" }, re = { class: "relative w-full max-w-sm items-center" }, de = { class: "absolute start-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none" }, ce = { class: "absolute end-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none" }, ye = /* @__PURE__ */ Y({
8
+ }, de = { class: "flex justify-between items-center mb-4" }, ce = { class: "relative w-full max-w-sm items-center" }, fe = { class: "absolute start-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none" }, me = { class: "absolute end-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none" }, be = /* @__PURE__ */ Y({
9
9
  __name: "Find",
10
10
  props: {
11
11
  config: {
@@ -15,68 +15,68 @@ const ae = { class: "relative" }, ue = {
15
15
  },
16
16
  async setup(z) {
17
17
  let a, b;
18
- const x = z, { hasPermission: fe } = G(), { navigateTo: B } = J(), { getModuleData: F } = K();
19
- W(() => [
18
+ const x = z, { hasPermission: pe } = J(), { navigateTo: S } = K(), { getModuleData: F } = W();
19
+ X(() => [
20
20
  { text: "Promo codes list" }
21
21
  ]);
22
- const w = y([]);
22
+ const w = _([]);
23
23
  w.value = ([a, b] = M(() => F("promo-types")), a = await a, b(), a || []);
24
- const _ = y([]), k = X(x.config.project);
25
- _.value = ([a, b] = M(() => k.find(x.config.promoCodeCollection)), a = await a, b(), a);
26
- const N = Z(), R = ee(), u = y(N.query.q || ""), C = y(""), S = y(!1), P = se(async () => {
27
- S.value = !0;
28
- let i = u.value.trim().toUpperCase();
29
- i.length === 0 ? _.value = await k.find(x.config.promoCodeCollection) : _.value = await k.find(x.config.promoCodeCollection, {
24
+ const y = _([]), k = Z(x.config.project);
25
+ y.value = ([a, b] = M(() => k.find(x.config.promoCodeCollection)), a = await a, b(), a);
26
+ const q = ee(), R = te(), D = le(), u = _(D.value.q || q.query.q || ""), C = _(""), P = _(!1), B = ue(async () => {
27
+ P.value = !0;
28
+ let r = u.value.trim().toUpperCase();
29
+ r.length === 0 ? y.value = await k.find(x.config.promoCodeCollection) : y.value = await k.find(x.config.promoCodeCollection, {
30
30
  filters: [
31
31
  {
32
32
  field: "code",
33
33
  operator: ">=",
34
- value: i
34
+ value: r
35
35
  },
36
36
  {
37
37
  field: "code",
38
38
  operator: "<",
39
- value: i.slice(0, -1) + String.fromCharCode(i.slice(-1).charCodeAt(0) + 1)
39
+ value: r.slice(0, -1) + String.fromCharCode(r.slice(-1).charCodeAt(0) + 1)
40
40
  }
41
41
  ]
42
- }), C.value = u.value, S.value = !1;
42
+ }), C.value = u.value, P.value = !1;
43
43
  }, 600);
44
44
  $(u, async () => {
45
- await P(), R.replace({
45
+ await B(), R.replace({
46
46
  query: {
47
- ...N.query,
47
+ ...q.query,
48
48
  q: u.value.trim() ? u.value.trim() : void 0
49
49
  // remove param when empty
50
50
  }
51
51
  });
52
52
  });
53
- const D = (i) => {
53
+ const H = (r) => {
54
54
  const e = /* @__PURE__ */ new Date();
55
- return i.expiresAt > e && i.startsAt < e;
55
+ return r.expiresAt > e && r.startsAt < e;
56
56
  };
57
- return O(async () => {
58
- u.value.trim() && await P();
59
- }), (i, e) => {
60
- const V = s("Button"), H = s("Input"), q = s("TableCaption"), f = s("TableHead"), A = s("TableRow"), E = s("TableHeader"), m = s("TableCell"), I = s("TableBody"), L = s("Table"), U = s("Card");
61
- return d(), j("div", ae, [
62
- c("div", ue, [
63
- c("div", ie, [
57
+ return Q(async () => {
58
+ u.value.trim() && await B();
59
+ }), (r, e) => {
60
+ const N = s("Button"), E = s("Input"), V = s("TableCaption"), f = s("TableHead"), A = s("TableRow"), I = s("TableHeader"), m = s("TableCell"), L = s("TableBody"), U = s("Table"), O = s("Card");
61
+ return d(), j("div", re, [
62
+ c("div", ie, [
63
+ c("div", de, [
64
64
  e[3] || (e[3] = c("h1", { class: "text-2xl font-bold" }, "Find Promo Codes", -1)),
65
- t(V, {
66
- onClick: e[0] || (e[0] = (n) => v(B)("")),
65
+ t(N, {
66
+ onClick: e[0] || (e[0] = (n) => v(S)("")),
67
67
  variant: "outline"
68
68
  }, {
69
69
  default: l(() => [
70
- t(v(te), { class: "size-4" }),
70
+ t(v(ne), { class: "size-4" }),
71
71
  e[2] || (e[2] = o(" Create New Promo Code ", -1))
72
72
  ]),
73
73
  _: 1
74
74
  })
75
75
  ]),
76
- t(U, { class: "p-4" }, {
76
+ t(O, { class: "p-4" }, {
77
77
  default: l(() => [
78
- c("div", re, [
79
- t(H, {
78
+ c("div", ce, [
79
+ t(E, {
80
80
  id: "search",
81
81
  type: "text",
82
82
  placeholder: "Search...",
@@ -84,33 +84,33 @@ const ae = { class: "relative" }, ue = {
84
84
  "onUpdate:modelValue": e[1] || (e[1] = (n) => u.value = n),
85
85
  class: "px-8"
86
86
  }, null, 8, ["modelValue"]),
87
- c("span", de, [
88
- t(v(le), { class: "size-4 text-muted-foreground" })
87
+ c("span", fe, [
88
+ t(v(oe), { class: "size-4 text-muted-foreground" })
89
89
  ]),
90
- c("span", ce, [
91
- S.value ? (d(), g(v(ne), {
90
+ c("span", me, [
91
+ P.value ? (d(), g(v(se), {
92
92
  key: 0,
93
93
  class: "size-4 text-muted-foreground animate-spin"
94
94
  })) : T("", !0)
95
95
  ])
96
96
  ]),
97
- t(L, null, {
97
+ t(U, null, {
98
98
  default: l(() => [
99
- C.value ? T("", !0) : (d(), g(q, { key: 0 }, {
99
+ C.value ? T("", !0) : (d(), g(V, { key: 0 }, {
100
100
  default: l(() => [...e[4] || (e[4] = [
101
101
  o("A list of your most recent promo codes.", -1)
102
102
  ])]),
103
103
  _: 1
104
104
  })),
105
- C.value ? (d(), g(q, { key: 1 }, {
105
+ C.value ? (d(), g(V, { key: 1 }, {
106
106
  default: l(() => [
107
107
  e[5] || (e[5] = o("A list of your promo codes starting with ", -1)),
108
- c("strong", null, '"' + r(C.value) + '"', 1),
108
+ c("strong", null, '"' + i(C.value) + '"', 1),
109
109
  e[6] || (e[6] = o(".", -1))
110
110
  ]),
111
111
  _: 1
112
112
  })) : T("", !0),
113
- t(E, null, {
113
+ t(I, null, {
114
114
  default: l(() => [
115
115
  t(A, null, {
116
116
  default: l(() => [
@@ -156,51 +156,51 @@ const ae = { class: "relative" }, ue = {
156
156
  ]),
157
157
  _: 1
158
158
  }),
159
- _.value?.length > 0 ? (d(), g(I, { key: 2 }, {
159
+ y.value?.length > 0 ? (d(), g(L, { key: 2 }, {
160
160
  default: l(() => [
161
- (d(!0), j(Q, null, h(_.value, (n) => (d(), g(A, {
161
+ (d(!0), j(h, null, G(y.value, (n) => (d(), g(A, {
162
162
  key: n.id
163
163
  }, {
164
164
  default: l(() => [
165
165
  t(m, { class: "font-medium uppercase" }, {
166
166
  default: l(() => [
167
- o(r(n.code), 1)
167
+ o(i(n.code), 1)
168
168
  ]),
169
169
  _: 2
170
170
  }, 1024),
171
171
  t(m, null, {
172
172
  default: l(() => [
173
- o(r(w.value.find((p) => p.key === n.type)?.label), 1)
173
+ o(i(w.value.find((p) => p.key === n.type)?.label), 1)
174
174
  ]),
175
175
  _: 2
176
176
  }, 1024),
177
177
  t(m, null, {
178
178
  default: l(() => [
179
- o(r(w.value.find((p) => p.key === n.type)?.valuePrefix) + " " + r(n.value) + " " + r(w.value.find((p) => p.key === n.type)?.valueSuffix), 1)
179
+ o(i(w.value.find((p) => p.key === n.type)?.valuePrefix) + " " + i(n.value) + " " + i(w.value.find((p) => p.key === n.type)?.valueSuffix), 1)
180
180
  ]),
181
181
  _: 2
182
182
  }, 1024),
183
183
  t(m, null, {
184
184
  default: l(() => [
185
- o(r(n.usageLimit === 1 ? n.usageCount > 0 ? "Yes" : "No" : n.usageCount === 0 ? "No" : n.usageCount === 1 ? "1 time" : n.usageCount + " times"), 1)
185
+ o(i(n.usageLimit === 1 ? n.usageCount > 0 ? "Yes" : "No" : n.usageCount === 0 ? "No" : n.usageCount === 1 ? "1 time" : n.usageCount + " times"), 1)
186
186
  ]),
187
187
  _: 2
188
188
  }, 1024),
189
189
  t(m, null, {
190
190
  default: l(() => [
191
- o(r(D(n) ? "Yes" : "No"), 1)
191
+ o(i(H(n) ? "Yes" : "No"), 1)
192
192
  ]),
193
193
  _: 2
194
194
  }, 1024),
195
195
  t(m, null, {
196
196
  default: l(() => [
197
- t(V, {
197
+ t(N, {
198
198
  variant: "ghost",
199
199
  size: "icon",
200
- onClick: (p) => v(B)("/promo-codes/" + n.id)
200
+ onClick: (p) => v(S)("/promo-codes/" + n.id)
201
201
  }, {
202
202
  default: l(() => [
203
- t(v(oe), { class: "size-4" })
203
+ t(v(ae), { class: "size-4" })
204
204
  ]),
205
205
  _: 1
206
206
  }, 8, ["onClick"])
@@ -225,5 +225,5 @@ const ae = { class: "relative" }, ue = {
225
225
  }
226
226
  });
227
227
  export {
228
- ye as default
228
+ be as default
229
229
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("@oneclick.dev/cms-kit"),x=require("lucide-vue-next"),A=require("./index-4tjmIans.js"),M={class:"relative"},j={ref:"container",class:"w-full max-w-5xl mx-auto"},z={class:"flex justify-between items-center mb-4"},F={class:"relative w-full max-w-sm items-center"},R={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none"},H={class:"absolute end-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none"},I=e.defineComponent({__name:"Find",props:{config:{type:Object,required:!0}},async setup(T){let n,d;const f=T,{hasPermission:L}=r.useModulePermissions(),{navigateTo:N}=r.useModuleRoute(),{getModuleData:b}=r.useModuleStorage();r.useModuleBreadcrumbs(()=>[{text:"Promo codes list"}]);const m=e.ref([]);m.value=([n,d]=e.withAsyncContext(()=>b("promo-types")),n=await n,d(),n||[]);const c=e.ref([]),v=r.useFirebaseIntegration(f.config.project);c.value=([n,d]=e.withAsyncContext(()=>v.find(f.config.promoCodeCollection)),n=await n,d(),n);const V=r.useRoute(),k=r.useRouter(),h=r.useOverlayParams(),l=e.ref(h.value.q||V.query.q||""),p=e.ref(""),C=e.ref(!1),y=A.useDebounceFn(async()=>{C.value=!0;let a=l.value.trim().toUpperCase();a.length===0?c.value=await v.find(f.config.promoCodeCollection):c.value=await v.find(f.config.promoCodeCollection,{filters:[{field:"code",operator:">=",value:a},{field:"code",operator:"<",value:a.slice(0,-1)+String.fromCharCode(a.slice(-1).charCodeAt(0)+1)}]}),p.value=l.value,C.value=!1},600);e.watch(l,async()=>{await y(),k.replace({query:{...V.query,q:l.value.trim()?l.value.trim():void 0}})});const B=a=>{const t=new Date;return a.expiresAt>t&&a.startsAt<t};return e.onMounted(async()=>{l.value.trim()&&await y()}),(a,t)=>{const w=e.resolveComponent("Button"),S=e.resolveComponent("Input"),_=e.resolveComponent("TableCaption"),s=e.resolveComponent("TableHead"),g=e.resolveComponent("TableRow"),q=e.resolveComponent("TableHeader"),i=e.resolveComponent("TableCell"),D=e.resolveComponent("TableBody"),P=e.resolveComponent("Table"),E=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",j,[e.createElementVNode("div",z,[t[3]||(t[3]=e.createElementVNode("h1",{class:"text-2xl font-bold"},"Find Promo Codes",-1)),e.createVNode(w,{onClick:t[0]||(t[0]=o=>e.unref(N)("")),variant:"outline"},{default:e.withCtx(()=>[e.createVNode(e.unref(x.Plus),{class:"size-4"}),t[2]||(t[2]=e.createTextVNode(" Create New Promo Code ",-1))]),_:1})]),e.createVNode(E,{class:"p-4"},{default:e.withCtx(()=>[e.createElementVNode("div",F,[e.createVNode(S,{id:"search",type:"text",placeholder:"Search...",modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=o=>l.value=o),class:"px-8"},null,8,["modelValue"]),e.createElementVNode("span",R,[e.createVNode(e.unref(x.Search),{class:"size-4 text-muted-foreground"})]),e.createElementVNode("span",H,[C.value?(e.openBlock(),e.createBlock(e.unref(x.Loader2),{key:0,class:"size-4 text-muted-foreground animate-spin"})):e.createCommentVNode("",!0)])]),e.createVNode(P,null,{default:e.withCtx(()=>[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:0},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("A list of your most recent promo codes.",-1)])]),_:1})),p.value?(e.openBlock(),e.createBlock(_,{key:1},{default:e.withCtx(()=>[t[5]||(t[5]=e.createTextVNode("A list of your promo codes starting with ",-1)),e.createElementVNode("strong",null,'"'+e.toDisplayString(p.value)+'"',1),t[6]||(t[6]=e.createTextVNode(".",-1))]),_:1})):e.createCommentVNode("",!0),e.createVNode(q,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[e.createVNode(s,null,{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Code",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode("Value",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode("Used",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode("Still eligible",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Action",-1)])]),_:1})]),_:1})]),_:1}),c.value?.length>0?(e.openBlock(),e.createBlock(D,{key:2},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,o=>(e.openBlock(),e.createBlock(g,{key:o.id},{default:e.withCtx(()=>[e.createVNode(i,{class:"font-medium uppercase"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.code),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value.find(u=>u.key===o.type)?.label),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value.find(u=>u.key===o.type)?.valuePrefix)+" "+e.toDisplayString(o.value)+" "+e.toDisplayString(m.value.find(u=>u.key===o.type)?.valueSuffix),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.usageLimit===1?o.usageCount>0?"Yes":"No":o.usageCount===0?"No":o.usageCount===1?"1 time":o.usageCount+" times"),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B(o)?"Yes":"No"),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(w,{variant:"ghost",size:"icon",onClick:u=>e.unref(N)("/promo-codes/"+o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(x.Pencil),{class:"size-4"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})],512)])}}});exports.default=I;
@@ -1,4 +1,4 @@
1
- import { isRef as vt, shallowRef as Mt, watch as Se, ref as A, watchEffect as _t, defineComponent as ne, h as Z, unref as b, inject as j, resolveComponent as m, openBlock as D, createElementBlock as E, Fragment as K, createElementVNode as $, toDisplayString as N, createVNode as r, withCtx as i, renderList as oe, createTextVNode as S, createCommentVNode as Y, computed as Ie, createBlock as O, normalizeClass as ie, markRaw as Oe, withModifiers as It, resolveDynamicComponent as ot, useTemplateRef as Pt, reactive as ye, onMounted as Pe, nextTick as Be, provide as ae } from "vue";
1
+ import { isRef as vt, shallowRef as Mt, watch as Se, ref as A, watchEffect as _t, defineComponent as ne, h as Z, unref as b, inject as j, resolveComponent as m, openBlock as D, createElementBlock as E, Fragment as K, createElementVNode as $, toDisplayString as N, createVNode as r, withCtx as i, renderList as le, createTextVNode as S, createCommentVNode as Y, computed as Ie, createBlock as O, normalizeClass as ie, markRaw as Oe, withModifiers as It, resolveDynamicComponent as ot, useTemplateRef as Pt, reactive as ye, onMounted as Pe, nextTick as Be, provide as ae } from "vue";
2
2
  import { useFlowBuilder as St, useProjectSettings as At, useFirebaseIntegration as kt, useModulePermissions as me, useModuleStorage as we, useModuleRoute as Tt, useModuleBreadcrumbs as Et } from "@oneclick.dev/cms-kit";
3
3
  import { i as Lt, v as xe, c as Me, d as zt } from "./utils-BVKy9S2J.mjs";
4
4
  import { ChevronsLeft as Ht, ChevronLeft as Gt, ChevronRight as Ot, ChevronsRight as Bt, Table2 as Ct, icons as lt, ArrowUpDown as Qe, Info as Ut, Check as Le, Trash2 as Nt, Plus as Re, ChevronUp as qt, ChevronDown as rt, X as jt, CalendarIcon as Yt, MousePointerClick as Kt } from "lucide-vue-next";
@@ -1990,7 +1990,7 @@ const Zn = {
1990
1990
  }),
1991
1991
  r(u, { side: "top" }, {
1992
1992
  default: i(() => [
1993
- (D(), E(K, null, oe([10, 20, 30, 40, 50], (C) => r(a, {
1993
+ (D(), E(K, null, le([10, 20, 30, 40, 50], (C) => r(a, {
1994
1994
  key: C,
1995
1995
  value: `${C}`
1996
1996
  }, {
@@ -2076,7 +2076,7 @@ const Zn = {
2076
2076
  }),
2077
2077
  r(u, { side: "top" }, {
2078
2078
  default: i(() => [
2079
- (D(), E(K, null, oe([10, 20, 30, 40, 50], (C) => r(a, {
2079
+ (D(), E(K, null, le([10, 20, 30, 40, 50], (C) => r(a, {
2080
2080
  key: C,
2081
2081
  value: `${C}`
2082
2082
  }, {
@@ -2396,7 +2396,7 @@ const wo = (e, o = {}) => {
2396
2396
  default: i(() => [
2397
2397
  $("div", yo, [
2398
2398
  $("div", Ro, [
2399
- (D(!0), E(K, null, oe(b(n), (v) => (D(), O(d, {
2399
+ (D(!0), E(K, null, le(b(n), (v) => (D(), O(d, {
2400
2400
  variant: "outline",
2401
2401
  class: "w-full",
2402
2402
  key: v,
@@ -2685,14 +2685,14 @@ const wo = (e, o = {}) => {
2685
2685
  d.value = Wn(X);
2686
2686
  }), Se(x, (L) => {
2687
2687
  L ? T() : B.value = {
2688
- pageIndex: le.value,
2688
+ pageIndex: oe.value,
2689
2689
  pageSize: te.value
2690
2690
  };
2691
2691
  });
2692
2692
  const [W, q] = l([], {
2693
2693
  plugins: [en()]
2694
- }), te = A(10), le = A(0), T = () => {
2695
- te.value = B.value.pageSize, le.value = B.value.pageIndex, B.value = {
2694
+ }), te = A(10), oe = A(0), T = () => {
2695
+ te.value = B.value.pageSize, oe.value = B.value.pageIndex, B.value = {
2696
2696
  pageIndex: 0,
2697
2697
  pageSize: 1e4
2698
2698
  }, q.value = (f?.value ?? []).slice().sort((L, R) => {
@@ -2725,11 +2725,11 @@ const wo = (e, o = {}) => {
2725
2725
  default: i(() => [
2726
2726
  r(re, null, {
2727
2727
  default: i(() => [
2728
- (D(!0), E(K, null, oe(b(d).getHeaderGroups(), (fe) => (D(), O(Q, {
2728
+ (D(!0), E(K, null, le(b(d).getHeaderGroups(), (fe) => (D(), O(Q, {
2729
2729
  key: fe.id
2730
2730
  }, {
2731
2731
  default: i(() => [
2732
- (D(!0), E(K, null, oe(fe.headers, (ve) => (D(), O(P, {
2732
+ (D(!0), E(K, null, le(fe.headers, (ve) => (D(), O(P, {
2733
2733
  key: ve.id
2734
2734
  }, {
2735
2735
  default: i(() => [
@@ -2769,7 +2769,7 @@ const wo = (e, o = {}) => {
2769
2769
  ref: W
2770
2770
  }, {
2771
2771
  default: i(() => [
2772
- b(d).getRowModel().rows?.length ? (D(!0), E(K, { key: 0 }, oe(b(x) ? b(q) : b(d).getRowModel().rows, (fe, ve) => (D(), E(K, {
2772
+ b(d).getRowModel().rows?.length ? (D(!0), E(K, { key: 0 }, le(b(x) ? b(q) : b(d).getRowModel().rows, (fe, ve) => (D(), E(K, {
2773
2773
  key: fe.id
2774
2774
  }, [
2775
2775
  r(Q, {
@@ -2778,7 +2778,7 @@ const wo = (e, o = {}) => {
2778
2778
  onClick: R[0] || (R[0] = (pe) => b(_).onRowClick(pe))
2779
2779
  }, {
2780
2780
  default: i(() => [
2781
- (D(!0), E(K, null, oe(fe.getVisibleCells(), (pe) => (D(), O(ee, {
2781
+ (D(!0), E(K, null, le(fe.getVisibleCells(), (pe) => (D(), O(ee, {
2782
2782
  key: pe.id
2783
2783
  }, {
2784
2784
  default: i(() => [
@@ -2871,7 +2871,7 @@ const wo = (e, o = {}) => {
2871
2871
  return o({
2872
2872
  openDialog: f
2873
2873
  }), (w, g) => {
2874
- const _ = m("DialogTitle"), c = m("DialogDescription"), I = m("DialogHeader"), y = m("Label"), F = m("Input"), V = m("SelectValue"), M = m("SelectTrigger"), G = m("SelectItem"), B = m("SelectContent"), X = m("Select"), W = m("ComboboxTrigger"), q = m("ComboboxInput"), te = m("ComboboxAnchor"), le = m("ComboboxItem"), T = m("ComboboxGroup"), J = m("ComboboxList"), L = m("Combobox"), R = m("Button"), U = m("DialogFooter"), h = m("DialogScrollContent"), k = m("Dialog");
2874
+ const _ = m("DialogTitle"), c = m("DialogDescription"), I = m("DialogHeader"), y = m("Label"), F = m("Input"), V = m("SelectValue"), M = m("SelectTrigger"), G = m("SelectItem"), B = m("SelectContent"), X = m("Select"), W = m("ComboboxTrigger"), q = m("ComboboxInput"), te = m("ComboboxAnchor"), oe = m("ComboboxItem"), T = m("ComboboxGroup"), J = m("ComboboxList"), L = m("Combobox"), R = m("Button"), U = m("DialogFooter"), h = m("DialogScrollContent"), k = m("Dialog");
2875
2875
  return D(), O(k, {
2876
2876
  open: s.value,
2877
2877
  "onUpdate:open": g[4] || (g[4] = (P) => s.value = P)
@@ -3008,7 +3008,7 @@ const wo = (e, o = {}) => {
3008
3008
  default: i(() => [
3009
3009
  r(T, null, {
3010
3010
  default: i(() => [
3011
- (D(!0), E(K, null, oe(b(l), (P) => (D(), O(le, {
3011
+ (D(!0), E(K, null, le(b(l), (P) => (D(), O(oe, {
3012
3012
  key: P.property,
3013
3013
  value: P.property,
3014
3014
  onSelect: () => {
@@ -3043,7 +3043,7 @@ const wo = (e, o = {}) => {
3043
3043
  }),
3044
3044
  g[25] || (g[25] = $("p", { class: "text-xs text-muted-foreground mb-2" }, " Only rows that match the conditions will be included in the calculation of the stat. ", -1)),
3045
3045
  d.conditions?.length > 0 ? (D(), E("div", Po, [
3046
- (D(!0), E(K, null, oe(d.conditions, (P) => (D(), E("div", {
3046
+ (D(!0), E(K, null, le(d.conditions, (P) => (D(), E("div", {
3047
3047
  key: P.id,
3048
3048
  class: "grid grid-cols-13 gap-2"
3049
3049
  }, [
@@ -3084,7 +3084,7 @@ const wo = (e, o = {}) => {
3084
3084
  default: i(() => [
3085
3085
  r(T, null, {
3086
3086
  default: i(() => [
3087
- (D(!0), E(K, null, oe(b(l), (Q) => (D(), O(le, {
3087
+ (D(!0), E(K, null, le(b(l), (Q) => (D(), O(oe, {
3088
3088
  key: Q.property,
3089
3089
  value: Q.property,
3090
3090
  onSelect: () => {
@@ -3318,7 +3318,7 @@ const wo = (e, o = {}) => {
3318
3318
  a.value = await n("stats") || [];
3319
3319
  }), (y, F) => (D(), E(K, null, [
3320
3320
  $("div", Lo, [
3321
- (D(!0), E(K, null, oe(a.value, (V) => (D(), E("div", {
3321
+ (D(!0), E(K, null, le(a.value, (V) => (D(), E("div", {
3322
3322
  key: V.label,
3323
3323
  class: ie(["flex flex-col items-center justify-center size-24 p-4 border rounded-md", b(t)() ? "hover:bg-muted cursor-pointer" : ""]),
3324
3324
  onClick: (M) => b(t)() ? s.value.openDialog(V) : null
@@ -3679,7 +3679,7 @@ const wo = (e, o = {}) => {
3679
3679
  a.value = a.value.filter((g) => !g._remove), t("columns", a.value), s.value = a.value, C(), u.value = !1;
3680
3680
  };
3681
3681
  return (g, _) => {
3682
- const c = m("DropdownMenuItem"), I = m("DialogTrigger"), y = m("DialogTitle"), F = m("DialogDescription"), V = m("DialogHeader"), M = m("Button"), G = m("PopoverTrigger"), B = m("Label"), X = m("Input"), W = m("Checkbox"), q = m("SelectValue"), te = m("SelectTrigger"), le = m("SelectLabel"), T = m("SelectItem"), J = m("SelectGroup"), L = m("SelectContent"), R = m("Select"), U = m("PopoverContent"), h = m("Popover"), k = m("Accordion"), P = m("DialogFooter"), Q = m("DialogScrollContent"), re = m("Dialog");
3682
+ const c = m("DropdownMenuItem"), I = m("DialogTrigger"), y = m("DialogTitle"), F = m("DialogDescription"), V = m("DialogHeader"), M = m("Button"), G = m("PopoverTrigger"), B = m("Label"), X = m("Input"), W = m("Checkbox"), q = m("SelectValue"), te = m("SelectTrigger"), oe = m("SelectLabel"), T = m("SelectItem"), J = m("SelectGroup"), L = m("SelectContent"), R = m("Select"), U = m("PopoverContent"), h = m("Popover"), k = m("Accordion"), P = m("DialogFooter"), Q = m("DialogScrollContent"), re = m("Dialog");
3683
3683
  return D(), O(re, {
3684
3684
  open: u.value,
3685
3685
  "onUpdate:open": [
@@ -3819,7 +3819,7 @@ const wo = (e, o = {}) => {
3819
3819
  default: i(() => [
3820
3820
  r(J, null, {
3821
3821
  default: i(() => [
3822
- r(le, null, {
3822
+ r(oe, null, {
3823
3823
  default: i(() => [..._[17] || (_[17] = [
3824
3824
  S("Types", -1)
3825
3825
  ])]),
@@ -3972,7 +3972,7 @@ const wo = (e, o = {}) => {
3972
3972
  class: "w-full"
3973
3973
  }, {
3974
3974
  default: i(() => [
3975
- (D(!0), E(K, null, oe(a.value, (ee, be) => (D(), E("div", {
3975
+ (D(!0), E(K, null, le(a.value, (ee, be) => (D(), E("div", {
3976
3976
  key: ee.id,
3977
3977
  class: "relative group"
3978
3978
  }, [
@@ -4077,7 +4077,7 @@ const wo = (e, o = {}) => {
4077
4077
  }, null, 8, ["open"]),
4078
4078
  b(t)?.length > 0 ? (D(), O(w, { key: 0 })) : Y("", !0)
4079
4079
  ], 64)) : Y("", !0),
4080
- (D(!0), E(K, null, oe(b(t), (I) => (D(), O(g, {
4080
+ (D(!0), E(K, null, le(b(t), (I) => (D(), O(g, {
4081
4081
  key: I.id,
4082
4082
  class: "capitalize",
4083
4083
  "model-value": I.visible,
@@ -4144,8 +4144,8 @@ const wo = (e, o = {}) => {
4144
4144
  n("saved", { field: d.value }), C();
4145
4145
  };
4146
4146
  return (v, p) => {
4147
- const w = m("DialogTrigger"), g = m("DialogTitle"), _ = m("DialogDescription"), c = m("DialogHeader"), I = m("Label"), y = m("ComboboxTrigger"), F = m("ComboboxInput"), V = m("ComboboxAnchor"), M = m("ComboboxItem"), G = m("ComboboxGroup"), B = m("ComboboxList"), X = m("Combobox"), W = m("Button"), q = m("DialogFooter"), te = m("DialogScrollContent"), le = m("Dialog");
4148
- return D(), O(le, {
4147
+ const w = m("DialogTrigger"), g = m("DialogTitle"), _ = m("DialogDescription"), c = m("DialogHeader"), I = m("Label"), y = m("ComboboxTrigger"), F = m("ComboboxInput"), V = m("ComboboxAnchor"), M = m("ComboboxItem"), G = m("ComboboxGroup"), B = m("ComboboxList"), X = m("Combobox"), W = m("Button"), q = m("DialogFooter"), te = m("DialogScrollContent"), oe = m("Dialog");
4148
+ return D(), O(oe, {
4149
4149
  open: u.value,
4150
4150
  "onUpdate:open": [
4151
4151
  p[3] || (p[3] = (T) => u.value = T),
@@ -4220,7 +4220,7 @@ const wo = (e, o = {}) => {
4220
4220
  default: i(() => [
4221
4221
  r(G, null, {
4222
4222
  default: i(() => [
4223
- (D(!0), E(K, null, oe(b(a), (T) => (D(), O(M, {
4223
+ (D(!0), E(K, null, le(b(a), (T) => (D(), O(M, {
4224
4224
  key: T.property,
4225
4225
  value: T.property,
4226
4226
  onSelect: (J) => d.value = T.property
@@ -4421,7 +4421,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
4421
4421
  n("saved", { field: f.value, defaultDate: C.value }), v();
4422
4422
  };
4423
4423
  return (w, g) => {
4424
- const _ = m("DialogTrigger"), c = m("DialogTitle"), I = m("DialogDescription"), y = m("DialogHeader"), F = m("Label"), V = m("ComboboxTrigger"), M = m("ComboboxInput"), G = m("ComboboxAnchor"), B = m("ComboboxItem"), X = m("ComboboxGroup"), W = m("ComboboxList"), q = m("Combobox"), te = m("SelectValue"), le = m("SelectTrigger"), T = m("SelectItem"), J = m("SelectLabel"), L = m("SelectGroup"), R = m("SelectContent"), U = m("Select"), h = m("Button"), k = m("DialogFooter"), P = m("DialogScrollContent"), Q = m("Dialog");
4424
+ const _ = m("DialogTrigger"), c = m("DialogTitle"), I = m("DialogDescription"), y = m("DialogHeader"), F = m("Label"), V = m("ComboboxTrigger"), M = m("ComboboxInput"), G = m("ComboboxAnchor"), B = m("ComboboxItem"), X = m("ComboboxGroup"), W = m("ComboboxList"), q = m("Combobox"), te = m("SelectValue"), oe = m("SelectTrigger"), T = m("SelectItem"), J = m("SelectLabel"), L = m("SelectGroup"), R = m("SelectContent"), U = m("Select"), h = m("Button"), k = m("DialogFooter"), P = m("DialogScrollContent"), Q = m("Dialog");
4425
4425
  return D(), O(Q, {
4426
4426
  open: d.value,
4427
4427
  "onUpdate:open": [
@@ -4498,7 +4498,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
4498
4498
  default: i(() => [
4499
4499
  r(X, null, {
4500
4500
  default: i(() => [
4501
- (D(!0), E(K, null, oe(b(u), (re) => (D(), O(B, {
4501
+ (D(!0), E(K, null, le(b(u), (re) => (D(), O(B, {
4502
4502
  key: re.property,
4503
4503
  value: re.property,
4504
4504
  onSelect: (ee) => f.value = re.property
@@ -4533,7 +4533,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
4533
4533
  "onUpdate:modelValue": g[3] || (g[3] = (re) => C.value = re)
4534
4534
  }, {
4535
4535
  default: i(() => [
4536
- r(le, { class: "w-[180px]" }, {
4536
+ r(oe, { class: "w-[180px]" }, {
4537
4537
  default: i(() => [
4538
4538
  r(te, { placeholder: "Select a fruit" })
4539
4539
  ]),
@@ -4699,12 +4699,12 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
4699
4699
  const _ = await o("dateRangeFilter");
4700
4700
  C.value = _?.field ?? "", x.value = _?.defaultDate ?? "today", p(x.value), g();
4701
4701
  }), (_, c) => {
4702
- const I = m("Button"), y = m("PopoverTrigger"), F = m("RangeCalendar"), V = m("DropdownMenuTrigger"), M = m("DropdownMenuItem"), G = m("DropdownMenuSeparator"), B = m("DropdownMenuLabel"), X = m("DropdownMenuGroup"), W = m("DropdownMenuContent"), q = m("DropdownMenu"), te = m("PopoverContent"), le = m("Popover");
4702
+ const I = m("Button"), y = m("PopoverTrigger"), F = m("RangeCalendar"), V = m("DropdownMenuTrigger"), M = m("DropdownMenuItem"), G = m("DropdownMenuSeparator"), B = m("DropdownMenuLabel"), X = m("DropdownMenuGroup"), W = m("DropdownMenuContent"), q = m("DropdownMenu"), te = m("PopoverContent"), oe = m("Popover");
4703
4703
  return C.value || b(n)() ? (D(), E("div", {
4704
4704
  key: 0,
4705
4705
  class: ie(["flex flex-col items-start gap-1", b(l) ? "opacity-50 pointer-events-none" : ""])
4706
4706
  }, [
4707
- r(le, {
4707
+ r(oe, {
4708
4708
  open: f.value,
4709
4709
  "onUpdate:open": c[14] || (c[14] = (T) => f.value = T)
4710
4710
  }, {
@@ -4942,13 +4942,13 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
4942
4942
  return o({
4943
4943
  openDialog: C
4944
4944
  }), (_, c) => {
4945
- const I = m("DialogTitle"), y = m("DialogDescription"), F = m("DialogHeader"), V = m("Label"), M = m("Input"), G = m("Button"), B = m("PopoverTrigger"), X = m("Checkbox"), W = m("PopoverContent"), q = m("Popover"), te = m("DialogFooter"), le = m("DialogScrollContent"), T = m("Dialog");
4945
+ const I = m("DialogTitle"), y = m("DialogDescription"), F = m("DialogHeader"), V = m("Label"), M = m("Input"), G = m("Button"), B = m("PopoverTrigger"), X = m("Checkbox"), W = m("PopoverContent"), q = m("Popover"), te = m("DialogFooter"), oe = m("DialogScrollContent"), T = m("Dialog");
4946
4946
  return D(), O(T, {
4947
4947
  open: l.value,
4948
4948
  "onUpdate:open": c[6] || (c[6] = (J) => l.value = J)
4949
4949
  }, {
4950
4950
  default: i(() => [
4951
- r(le, { class: "sm:max-w-2xl" }, {
4951
+ r(oe, { class: "sm:max-w-2xl" }, {
4952
4952
  default: i(() => [
4953
4953
  r(F, null, {
4954
4954
  default: i(() => [
@@ -5106,7 +5106,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
5106
5106
  }, 8, ["open"])
5107
5107
  ]),
5108
5108
  $("div", null, [
5109
- (D(!0), E(K, null, oe(d.options, (J) => (D(), E("div", {
5109
+ (D(!0), E(K, null, le(d.options, (J) => (D(), E("div", {
5110
5110
  key: J.id,
5111
5111
  class: "grid grid-cols-4 items-center gap-4"
5112
5112
  }, [
@@ -5197,7 +5197,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
5197
5197
  const g = m("Button"), _ = m("DropdownMenuTrigger"), c = m("DropdownMenuCheckboxItem"), I = m("DropdownMenuContent"), y = m("DropdownMenu");
5198
5198
  return D(), E(K, null, [
5199
5199
  $("div", zl, [
5200
- (D(!0), E(K, null, oe(b(n), (F) => (D(), E("div", {
5200
+ (D(!0), E(K, null, le(b(n), (F) => (D(), E("div", {
5201
5201
  key: F.id,
5202
5202
  class: "flex flex-col items-start gap-1"
5203
5203
  }, [
@@ -5225,7 +5225,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
5225
5225
  })
5226
5226
  }, {
5227
5227
  default: i(() => [
5228
- (D(!0), E(K, null, oe(F.options, (V) => (D(), O(c, {
5228
+ (D(!0), E(K, null, le(F.options, (V) => (D(), O(c, {
5229
5229
  key: V.id,
5230
5230
  "model-value": V.checked,
5231
5231
  "onUpdate:modelValue": (M) => {
@@ -5464,7 +5464,7 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
5464
5464
  _: 1
5465
5465
  }),
5466
5466
  $("div", Yl, [
5467
- (D(!0), E(K, null, oe(b(l), (c) => (D(), O(C, {
5467
+ (D(!0), E(K, null, le(b(l), (c) => (D(), O(C, {
5468
5468
  key: c.id,
5469
5469
  onClick: (I) => n.value.openDialog(c),
5470
5470
  variant: "outline"
@@ -5633,18 +5633,20 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
5633
5633
  const a = A(), u = A(), d = A([]), f = A([]), C = A(), x = A(!1), v = A(""), p = A(), w = A([]), g = A([]), _ = A(!1), c = A(null), I = Ie(() => o.config?.getItems?.integration), y = async () => {
5634
5634
  const W = await l("dateRangeFilter");
5635
5635
  let q;
5636
- return W && (q = {
5636
+ W && (q = {
5637
5637
  name: "dateRangeFilter",
5638
5638
  type: "dateRangeFilter",
5639
5639
  value: {
5640
5640
  from: p.value?.[0],
5641
5641
  to: p.value?.[1]
5642
5642
  }
5643
- }), [...Object.entries(t.query).map(([T, J]) => ({
5643
+ });
5644
+ const oe = [...Object.entries(t.query).map(([T, J]) => ({
5644
5645
  name: M(T),
5645
5646
  type: "routeQueryParam",
5646
5647
  value: J ?? null
5647
5648
  })) || [], q].filter(Boolean);
5649
+ return console.log("Context:", oe), oe;
5648
5650
  }, F = async () => {
5649
5651
  let W = o.config?.getItems ? JSON.parse(JSON.stringify(o.config?.getItems)) : null;
5650
5652
  if (!W) return;
@@ -5702,13 +5704,13 @@ const Cl = ["disabled"], wl = { class: "flex flex-col items-start gap-4 py-4" },
5702
5704
  b(n)() ? (D(), E("button", {
5703
5705
  key: 0,
5704
5706
  class: "text-xs text-primary hover:underline",
5705
- onClick: q[0] || (q[0] = (le) => a.value.openDialog())
5707
+ onClick: q[0] || (q[0] = (oe) => a.value.openDialog())
5706
5708
  }, "Settings")) : Y("", !0)
5707
5709
  ])) : c.value && b(n)() ? (D(), O(te, {
5708
5710
  key: 2,
5709
5711
  variant: "outline",
5710
5712
  class: "border-primary dark:border-primary border-dashed text-primary dark:text-primary",
5711
- onClick: q[1] || (q[1] = (le) => a.value.openDialog())
5713
+ onClick: q[1] || (q[1] = (oe) => a.value.openDialog())
5712
5714
  }, {
5713
5715
  default: i(() => [
5714
5716
  r(b(Re), { class: "size-4" }),