@vuetify/one 0.1.2 → 0.2.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.
Files changed (3) hide show
  1. package/dist/index.js +265 -228
  2. package/package.json +3 -2
  3. package/dist/index.d.ts +0 -636
package/dist/index.js CHANGED
@@ -1,19 +1,44 @@
1
- import { reactive as Y, toRefs as Z, ref as K, shallowRef as E, computed as j, watch as N, defineComponent as L, openBlock as m, createBlock as g, unref as a, withCtx as d, createVNode as u, createTextVNode as w, toDisplayString as x, createCommentVNode as Q, mergeProps as ee, createElementVNode as b, createElementBlock as te, Fragment as oe, renderList as ie, pushScopeId as se, popScopeId as ne, onBeforeMount as re } from "vue";
2
- import { defineStore as O } from "pinia";
1
+ import { reactive as Z, toRefs as K, ref as j, shallowRef as T, computed as D, watch as F, defineComponent as L, openBlock as g, createBlock as y, unref as a, withCtx as p, createVNode as d, createTextVNode as w, toDisplayString as $, createCommentVNode as Q, mergeProps as tt, createElementVNode as _, createElementBlock as et, Fragment as ot, renderList as st, pushScopeId as nt, popScopeId as it, onBeforeMount as rt } from "vue";
2
+ import { defineStore as x } from "pinia";
3
3
  import { merge as I } from "lodash-es";
4
- import { mdiDiscord as H, mdiGithub as B, mdiViewDashboard as ae, mdiLogoutVariant as le, mdiLogin as ce, mdiShieldStarOutline as ue, mdiReddit as de } from "@mdi/js";
5
- import { VListItem as F, VList as G, VListSubheader as fe } from "vuetify/lib/components/VList/index.mjs";
6
- import { VAvatar as pe } from "vuetify/lib/components/VAvatar/index.mjs";
7
- import { VBtn as M } from "vuetify/lib/components/VBtn/index.mjs";
8
- import { VMenu as me } from "vuetify/lib/components/VMenu/index.mjs";
9
- import { VSkeletonLoader as he } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
10
- import { useDisplay as ve, useTheme as ge } from "vuetify";
11
- import { VCard as ye, VCardTitle as _e, VCardSubtitle as be } from "vuetify/lib/components/VCard/index.mjs";
12
- import { VDialog as we } from "vuetify/lib/components/VDialog/index.mjs";
13
- import { VImg as J } from "vuetify/lib/components/VImg/index.mjs";
14
- import { VFooter as Le } from "vuetify/lib/components/VFooter/index.mjs";
15
- import { VIcon as Ve } from "vuetify/lib/components/VIcon/index.mjs";
16
- const A = typeof window < "u", U = {
4
+ import { mdiDiscord as P, mdiGithub as E, mdiViewDashboard as at, mdiLogoutVariant as lt, mdiLogin as ct, mdiShieldStarOutline as ut, mdiReddit as ft } from "@mdi/js";
5
+ import { VListItem as G, VList as M, VListSubheader as dt } from "vuetify/lib/components/VList/index.mjs";
6
+ import { VAvatar as pt } from "vuetify/lib/components/VAvatar/index.mjs";
7
+ import { VBtn as J } from "vuetify/lib/components/VBtn/index.mjs";
8
+ import { VMenu as mt } from "vuetify/lib/components/VMenu/index.mjs";
9
+ import { VSkeletonLoader as ht } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
10
+ import { useDisplay as vt, useTheme as gt } from "vuetify";
11
+ import { VCard as yt, VCardTitle as bt, VCardSubtitle as _t } from "vuetify/lib/components/VCard/index.mjs";
12
+ import { VDialog as wt } from "vuetify/lib/components/VDialog/index.mjs";
13
+ import { VImg as W } from "vuetify/lib/components/VImg/index.mjs";
14
+ import { VFooter as Lt } from "vuetify/lib/components/VFooter/index.mjs";
15
+ import { VIcon as xt } from "vuetify/lib/components/VIcon/index.mjs";
16
+ const C = x("http", {
17
+ state: () => ({
18
+ url: ""
19
+ }),
20
+ actions: {
21
+ async fetch(o, e = {}) {
22
+ return (await fetch(`${this.url}${o}`, {
23
+ credentials: "include",
24
+ ...e
25
+ })).json();
26
+ },
27
+ async post(o, e, s = {}) {
28
+ return this.fetch(o, {
29
+ method: "POST",
30
+ headers: {
31
+ "Content-Type": "application/json"
32
+ },
33
+ body: JSON.stringify(e),
34
+ ...s
35
+ });
36
+ },
37
+ async get(o, e = {}) {
38
+ return this.fetch(o, e);
39
+ }
40
+ }
41
+ }), A = typeof window < "u", R = {
17
42
  v: 4,
18
43
  api: "link-only",
19
44
  avatar: "",
@@ -40,206 +65,194 @@ const A = typeof window < "u", U = {
40
65
  jobs: null
41
66
  }
42
67
  }
43
- }, W = O("user", () => {
44
- const i = Y(I({}, U));
45
- function t() {
68
+ }, q = x("user", () => {
69
+ const o = Z(I({}, R));
70
+ function e() {
46
71
  if (!A)
47
72
  return;
48
- const r = localStorage.getItem("vuetify@user"), e = r ? JSON.parse(r) : {}, c = e.v === i.v;
49
- e.v || (e.pwaRefresh = !0, typeof e.api == "boolean" && (e.api = e.api ? "inline" : "link-only"), typeof e.rtl == "boolean" && (e.direction = e.rtl ? "rtl" : "ltr", delete e.rtl), typeof e.theme == "object" && (e.mixedTheme = e.theme.mixed, e.theme = e.theme.system ? "system" : e.theme.dark ? "dark" : "light"), Array.isArray(e.notifications) && (e.notifications = { read: e.notifications }), typeof e.last == "object" && (e.notifications.last = e.last, delete e.last)), e.v === 1 && (Array.isArray(e.composition) && (e.composition = "composition"), Array.isArray(e.notifications.last.banner) || (e.notifications = e.notifications || {}, e.notifications.last = e.notifications.last || {}, e.notifications.last.banner = [])), e.v === 2 && (e.syncSettings = !0, e.disableAds = !1, e.v = 3), e.v === 3 && (e.quickbar = !1), e.v = i.v, Object.assign(i, I(i, e)), c && s();
73
+ const r = localStorage.getItem("vuetify@user"), t = r ? JSON.parse(r) : {}, h = t.v === o.v;
74
+ t.v || (t.pwaRefresh = !0, typeof t.api == "boolean" && (t.api = t.api ? "inline" : "link-only"), typeof t.rtl == "boolean" && (t.direction = t.rtl ? "rtl" : "ltr", delete t.rtl), typeof t.theme == "object" && (t.mixedTheme = t.theme.mixed, t.theme = t.theme.system ? "system" : t.theme.dark ? "dark" : "light"), Array.isArray(t.notifications) && (t.notifications = { read: t.notifications }), typeof t.last == "object" && (t.notifications.last = t.last, delete t.last)), t.v === 1 && (Array.isArray(t.composition) && (t.composition = "composition"), Array.isArray(t.notifications.last.banner) || (t.notifications = t.notifications || {}, t.notifications.last = t.notifications.last || {}, t.notifications.last.banner = [])), t.v === 2 && (t.syncSettings = !0, t.disableAds = !1, t.v = 3), t.v === 3 && (t.quickbar = !1), t.v = o.v, Object.assign(o, I(o, t)), h && s();
50
75
  }
51
76
  function s() {
52
- A && localStorage.setItem("vuetify@user", JSON.stringify(i, null, 2));
77
+ A && localStorage.setItem("vuetify@user", JSON.stringify(o, null, 2));
53
78
  }
54
- function n() {
55
- A && (Object.assign(i, I({}, U)), s());
79
+ function i() {
80
+ A && (Object.assign(o, I({}, R)), s());
56
81
  }
57
- return t(), {
58
- ...Z(i),
59
- load: t,
82
+ return e(), {
83
+ ...K(o),
84
+ load: e,
60
85
  save: s,
61
- reset: n
86
+ reset: i
62
87
  };
63
- }), v = {}.VITE_API_SERVER_URL, V = O("auth", () => {
64
- const i = K(null), t = W(), s = E(!1), n = j(() => {
65
- var o, l;
66
- return !v || ((o = i.value) == null ? void 0 : o.isAdmin) || ((l = i.value) == null ? void 0 : l.sponsorships.some((f) => f.isActive));
88
+ }), V = x("auth", () => {
89
+ const o = j(null), e = C(), s = q(), i = T(!1), r = D(() => {
90
+ var n, l;
91
+ return !e.url || ((n = o.value) == null ? void 0 : n.isAdmin) || ((l = o.value) == null ? void 0 : l.sponsorships.some((S) => S.isActive));
67
92
  });
68
- let r = !1;
69
- N(i, (o) => {
70
- if (!(o != null && o.settings))
93
+ let t = !1;
94
+ F(o, (n) => {
95
+ if (!(n != null && n.settings))
71
96
  return;
72
97
  const l = localStorage.getItem("vuetify@user") || "{}";
73
- JSON.stringify(o.settings, null, 2) !== l && (r = !0, Object.assign(t, o.settings));
74
- }), t.$subscribe(() => {
75
- r || e(), r = !1;
98
+ JSON.stringify(n.settings, null, 2) !== l && (t = !0, Object.assign(s, n.settings));
99
+ }), s.$subscribe(() => {
100
+ t || h(), t = !1;
76
101
  });
77
- async function e() {
102
+ async function h() {
78
103
  try {
79
- await fetch(`${v}/user/settings`, {
80
- method: "POST",
81
- credentials: "include",
82
- headers: {
83
- "Content-Type": "application/json"
84
- },
85
- body: JSON.stringify({
86
- settings: t.$state
87
- })
88
- });
89
- } catch (o) {
90
- console.error(o);
104
+ await e.post("/user/settings", { settings: s.$state });
105
+ } catch (n) {
106
+ console.error(n);
91
107
  }
92
108
  }
93
- async function c(o = !1) {
109
+ async function c(n = !1) {
94
110
  if (c.promise)
95
111
  return c.promise;
96
- s.value = !0, c.promise = fetch(`${v}/auth/verify`, {
112
+ i.value = !0, c.promise = fetch(`${e.url}/auth/verify`, {
97
113
  credentials: "include",
98
- headers: o ? {
114
+ headers: n ? {
99
115
  "Cache-Control": "no-cache"
100
116
  } : void 0
101
117
  }).then(
102
118
  async (l) => {
103
- l.ok ? i.value = (await l.json()).user : l.status === 401 ? i.value = null : console.error(l.statusText);
119
+ l.ok ? o.value = (await l.json()).user : l.status === 401 ? o.value = null : console.error(l.statusText);
104
120
  },
105
121
  () => {
106
122
  }
107
123
  ).finally(() => {
108
- s.value = !1, c.promise = null;
124
+ i.value = !1, c.promise = null;
109
125
  });
110
126
  }
111
127
  c.promise = null;
112
- async function h(o = "github") {
113
- s.value = !0;
114
- const l = `${v}/auth/${o}/redirect`, f = 400, D = 600, z = window.screenX + (window.innerWidth - f) / 2, X = window.screenY + (window.innerHeight - D) / 2, p = window.open(
128
+ async function f(n = "github") {
129
+ i.value = !0;
130
+ const l = `${e.url}/auth/${n}/redirect`, S = 400, O = 600, X = window.screenX + (window.innerWidth - S) / 2, Y = window.screenY + (window.innerHeight - O) / 2, v = window.open(
115
131
  "",
116
132
  "vuetify:authorize:popup",
117
- `popup,left=${z},top=${X},width=${f},height=${D},resizable`
133
+ `popup,left=${X},top=${Y},width=${S},height=${O},resizable`
118
134
  );
119
- if (!p) {
135
+ if (!v) {
120
136
  console.error("Failed to open popup");
121
137
  return;
122
138
  }
123
- p.location.href = l;
124
- let T = -1, R = -1;
125
- function C(_) {
126
- var P;
127
- _.origin === v && ((P = _.data) == null ? void 0 : P.type) === "auth-response" && (_.data.status === "success" ? (i.value || localStorage.setItem("vuetify@lastLoginProvider", o), i.value = _.data.body.user) : console.error(_.data.message), k());
139
+ v.location.href = l;
140
+ let H = -1, B = -1;
141
+ function N(b) {
142
+ var U;
143
+ b.origin === e.url && ((U = b.data) == null ? void 0 : U.type) === "auth-response" && (b.data.status === "success" ? (o.value || localStorage.setItem("vuetify@lastLoginProvider", n), o.value = b.data.body.user) : console.error(b.data.message), k());
128
144
  }
129
145
  function k() {
130
- window.removeEventListener("message", C), window.clearInterval(T), window.clearTimeout(R), p == null || p.close(), s.value = !1;
146
+ window.removeEventListener("message", N), window.clearInterval(H), window.clearTimeout(B), v == null || v.close(), i.value = !1;
131
147
  }
132
- window.addEventListener("message", C), T = window.setInterval(() => {
133
- !p || p.closed ? (console.error("Auth popup closed"), k()) : p.postMessage({ type: "auth-request" }, "*");
134
- }, 1e3), R = window.setTimeout(() => {
148
+ window.addEventListener("message", N), H = window.setInterval(() => {
149
+ !v || v.closed ? (console.error("Auth popup closed"), k()) : v.postMessage({ type: "auth-request" }, "*");
150
+ }, 1e3), B = window.setTimeout(() => {
135
151
  k(), console.error("Auth timed out");
136
152
  }, 120 * 1e3);
137
153
  }
138
- async function $() {
139
- s.value = !0;
154
+ async function u() {
155
+ i.value = !0;
140
156
  try {
141
- await fetch(`${v}/auth/logout`, {
142
- method: "POST",
143
- credentials: "include"
144
- }), await c(!0), i.value = null;
145
- } catch (o) {
146
- console.error(o);
157
+ await e.post("/auth/logout"), await c(!0), o.value = null;
158
+ } catch (n) {
159
+ console.error(n);
147
160
  } finally {
148
- s.value = !1;
161
+ i.value = !1;
149
162
  }
150
163
  }
151
- function y() {
164
+ function m() {
152
165
  return localStorage.getItem("vuetify@lastLoginProvider");
153
166
  }
154
- return y() && c(), {
155
- user: i,
156
- url: v,
157
- isLoading: s,
167
+ return m() && c(), {
168
+ user: o,
169
+ url: e.url,
170
+ isLoading: i,
158
171
  verify: c,
159
- login: h,
160
- logout: $,
161
- isSubscriber: n,
162
- lastLoginProvider: y
172
+ login: f,
173
+ logout: u,
174
+ isSubscriber: r,
175
+ lastLoginProvider: m
163
176
  };
164
- }), Se = /* @__PURE__ */ L({
177
+ }), Vt = /* @__PURE__ */ L({
165
178
  __name: "VoDiscordLogin",
166
- setup(i) {
167
- const t = V();
168
- return (s, n) => (m(), g(F, {
169
- "prepend-icon": `svg:${a(H)}`,
170
- title: a(t).user ? "Connect Discord" : "Log in with Discord",
171
- subtitle: !a(t).user && a(t).lastLoginProvider() === "discord" ? "Last Used" : "",
179
+ setup(o) {
180
+ const e = V();
181
+ return (s, i) => (g(), y(G, {
182
+ "prepend-icon": `svg:${a(P)}`,
183
+ title: a(e).user ? "Connect Discord" : "Log in with Discord",
184
+ subtitle: !a(e).user && a(e).lastLoginProvider() === "discord" ? "Last Used" : "",
172
185
  nav: "",
173
186
  "base-color": "#5865F2",
174
187
  slim: "",
175
188
  variant: "flat",
176
- onClick: n[0] || (n[0] = (r) => a(t).login("discord"))
189
+ onClick: i[0] || (i[0] = (r) => a(e).login("discord"))
177
190
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
178
191
  }
179
- }), xe = /* @__PURE__ */ L({
192
+ }), St = /* @__PURE__ */ L({
180
193
  __name: "VoGithubLogin",
181
- setup(i) {
182
- const t = V();
183
- return (s, n) => (m(), g(F, {
184
- "prepend-icon": `svg:${a(B)}`,
185
- title: a(t).user ? "Connect GitHub" : "Log in with GitHub",
186
- subtitle: !a(t).user && a(t).lastLoginProvider() === "github" ? "Last Used" : "",
194
+ setup(o) {
195
+ const e = V();
196
+ return (s, i) => (g(), y(G, {
197
+ "prepend-icon": `svg:${a(E)}`,
198
+ title: a(e).user ? "Connect GitHub" : "Log in with GitHub",
199
+ subtitle: !a(e).user && a(e).lastLoginProvider() === "github" ? "Last Used" : "",
187
200
  "base-color": "#2a2a2a",
188
201
  nav: "",
189
202
  slim: "",
190
203
  variant: "flat",
191
- onClick: n[0] || (n[0] = (r) => a(t).login("github"))
204
+ onClick: i[0] || (i[0] = (r) => a(e).login("github"))
192
205
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
193
206
  }
194
- }), $e = /* @__PURE__ */ L({
207
+ }), $t = /* @__PURE__ */ L({
195
208
  __name: "VoUserBtn",
196
209
  props: {
197
210
  external: Boolean
198
211
  },
199
- setup(i) {
200
- const t = i, s = V(), n = W(), r = [
212
+ setup(o) {
213
+ const e = o, s = V(), i = q(), r = [
201
214
  { title: "Options", type: "subheader" },
202
215
  {
203
216
  title: "My Dashboard",
204
- appendIcon: `svg:${ae}`,
205
- to: t.external ? void 0 : "/user/dashboard",
206
- href: t.external ? "https://vuetifyjs.com/user/dashboard/" : void 0,
207
- target: t.external ? "_blank" : void 0
217
+ appendIcon: `svg:${at}`,
218
+ to: e.external ? void 0 : "/user/dashboard",
219
+ href: e.external ? "https://vuetifyjs.com/user/dashboard/" : void 0,
220
+ target: e.external ? "_blank" : void 0
208
221
  },
209
222
  {
210
223
  title: "Logout",
211
- appendIcon: `svg:${le}`,
224
+ appendIcon: `svg:${lt}`,
212
225
  onClick: () => {
213
226
  s.logout();
214
227
  }
215
228
  }
216
229
  ];
217
- return (e, c) => (m(), g(M, {
230
+ return (t, h) => (g(), y(J, {
218
231
  class: "vo-user-btn",
219
232
  loading: a(s).isLoading,
220
233
  icon: ""
221
234
  }, {
222
- loader: d(() => [
223
- u(he, { type: "avatar" })
235
+ loader: p(() => [
236
+ d(ht, { type: "avatar" })
224
237
  ]),
225
- default: d(() => [
226
- u(me, {
238
+ default: p(() => [
239
+ d(mt, {
227
240
  disabled: !a(s).user || a(s).isLoading,
228
241
  activator: "parent",
229
242
  location: "bottom end"
230
243
  }, {
231
- default: d(() => [
232
- u(G, {
244
+ default: p(() => [
245
+ d(M, {
233
246
  items: r,
234
247
  lines: !1,
235
248
  density: "compact",
236
249
  "item-props": "",
237
250
  nav: ""
238
251
  }, {
239
- subheader: d(({ props: h }) => [
240
- u(fe, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
241
- default: d(() => [
242
- w(x(h.title), 1)
252
+ subheader: p(({ props: c }) => [
253
+ d(dt, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
254
+ default: p(() => [
255
+ w($(c.title), 1)
243
256
  ]),
244
257
  _: 2
245
258
  }, 1024)
@@ -249,33 +262,33 @@ const A = typeof window < "u", U = {
249
262
  ]),
250
263
  _: 1
251
264
  }, 8, ["disabled"]),
252
- a(s).user ? (m(), g(pe, {
265
+ a(s).user ? (g(), y(pt, {
253
266
  key: 0,
254
- image: a(n).avatar || a(s).user.picture || ""
267
+ image: a(i).avatar || a(s).user.picture || ""
255
268
  }, null, 8, ["image"])) : Q("", !0)
256
269
  ]),
257
270
  _: 1
258
271
  }, 8, ["loading"]));
259
272
  }
260
273
  });
261
- const q = (i, t) => {
262
- const s = i.__vccOpts || i;
263
- for (const [n, r] of t)
264
- s[n] = r;
274
+ const z = (o, e) => {
275
+ const s = o.__vccOpts || o;
276
+ for (const [i, r] of e)
277
+ s[i] = r;
265
278
  return s;
266
- }, ke = /* @__PURE__ */ q($e, [["__scopeId", "data-v-8e6fff6f"]]), Ie = { class: "text-center mb-6" }, Ae = /* @__PURE__ */ L({
279
+ }, kt = /* @__PURE__ */ z($t, [["__scopeId", "data-v-8e6fff6f"]]), It = { class: "text-center mb-6" }, At = /* @__PURE__ */ L({
267
280
  __name: "VoAuthDialog",
268
- setup(i) {
269
- const t = V(), { mdAndDown: s, lgAndUp: n } = ve(), r = ge();
270
- return (e, c) => !a(t).user && !a(t).isLoading ? (m(), g(we, {
281
+ setup(o) {
282
+ const e = V(), { mdAndDown: s, lgAndUp: i } = vt(), r = gt();
283
+ return (t, h) => !a(e).user && !a(e).isLoading ? (g(), y(wt, {
271
284
  key: 0,
272
285
  "max-width": "480"
273
286
  }, {
274
- activator: d(({ props: h }) => [
275
- u(M, ee({
276
- ...h,
277
- [`${a(n) ? "append-" : ""}icon`]: `svg:${a(ce)}`,
278
- text: a(n) ? "Login" : void 0
287
+ activator: p(({ props: c }) => [
288
+ d(J, tt({
289
+ ...c,
290
+ [`${a(i) ? "append-" : ""}icon`]: `svg:${a(ct)}`,
291
+ text: a(i) ? "Login" : void 0
279
292
  }, {
280
293
  rounded: a(s),
281
294
  class: "text-none",
@@ -283,36 +296,36 @@ const q = (i, t) => {
283
296
  variant: "outlined"
284
297
  }), null, 16, ["rounded"])
285
298
  ]),
286
- default: d(() => [
287
- u(ye, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
288
- default: d(() => [
289
- u(J, {
299
+ default: p(() => [
300
+ d(yt, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
301
+ default: p(() => [
302
+ d(W, {
290
303
  src: `https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-${a(r).name.value}.svg`,
291
304
  class: "mb-4",
292
305
  height: "30"
293
306
  }, null, 8, ["src"]),
294
- b("div", Ie, [
295
- u(_e, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
296
- default: d(() => [
297
- w(x(a(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
307
+ _("div", It, [
308
+ d(bt, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
309
+ default: p(() => [
310
+ w($(a(e).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
298
311
  ]),
299
312
  _: 1
300
313
  }),
301
- u(be, { class: "text-wrap" }, {
302
- default: d(() => [
314
+ d(_t, { class: "text-wrap" }, {
315
+ default: p(() => [
303
316
  w(" Sign in with GitHub or Discord to save your settings and unlock exclusive subscriber perks. ")
304
317
  ]),
305
318
  _: 1
306
319
  })
307
320
  ]),
308
- u(G, {
321
+ d(M, {
309
322
  class: "mx-auto",
310
323
  "max-width": "300",
311
324
  width: "100%"
312
325
  }, {
313
- default: d(() => [
314
- u(xe, { class: "mb-3" }),
315
- u(Se)
326
+ default: p(() => [
327
+ d(St, { class: "mb-3" }),
328
+ d(Vt)
316
329
  ]),
317
330
  _: 1
318
331
  })
@@ -321,24 +334,24 @@ const q = (i, t) => {
321
334
  })
322
335
  ]),
323
336
  _: 1
324
- })) : (m(), g(ke, { key: 1 }));
337
+ })) : (g(), y(kt, { key: 1 }));
325
338
  }
326
- }), je = (i) => (se("data-v-6f6b85b8"), i = i(), ne(), i), Oe = {
339
+ }), jt = (o) => (nt("data-v-6f6b85b8"), o = o(), it(), o), Dt = {
327
340
  class: "d-inline-block me-2 text-decoration-none text-primary",
328
341
  href: "https://vuetifyjs.com/",
329
342
  target: "_blank",
330
343
  title: "Vuetify Documentation",
331
344
  rel: "noopener noreferrer"
332
- }, De = ["href", "title"], Te = {
345
+ }, Ct = ["href", "title"], Ot = {
333
346
  class: "text-caption",
334
347
  style: { position: "absolute", right: "16px" }
335
- }, Re = /* @__PURE__ */ je(() => /* @__PURE__ */ b("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Ce = /* @__PURE__ */ L({
348
+ }, Ht = /* @__PURE__ */ jt(() => /* @__PURE__ */ _("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Bt = /* @__PURE__ */ L({
336
349
  __name: "VoFooter",
337
- setup(i) {
338
- const t = [
350
+ setup(o) {
351
+ const e = [
339
352
  {
340
353
  title: "Vuetify Support",
341
- icon: `svg:${ue}`,
354
+ icon: `svg:${ut}`,
342
355
  href: "https://support.vuetifyjs.com/"
343
356
  },
344
357
  {
@@ -348,34 +361,34 @@ const q = (i, t) => {
348
361
  },
349
362
  {
350
363
  title: "Vuetify GitHub",
351
- icon: `svg:${B}`,
364
+ icon: `svg:${E}`,
352
365
  href: "https://github.com/vuetifyjs/vuetify"
353
366
  },
354
367
  {
355
368
  title: "Vuetify Discord",
356
- icon: `svg:${H}`,
369
+ icon: `svg:${P}`,
357
370
  href: "https://community.vuetifyjs.com/"
358
371
  },
359
372
  {
360
373
  title: "Vuetify Reddit",
361
- icon: `svg:${de}`,
374
+ icon: `svg:${ft}`,
362
375
  href: "https://reddit.com/r/vuetifyjs"
363
376
  }
364
377
  ];
365
- return (s, n) => (m(), g(Le, {
378
+ return (s, i) => (g(), y(Lt, {
366
379
  class: "vo-footer",
367
380
  theme: "dark",
368
381
  height: "40"
369
382
  }, {
370
- default: d(() => [
371
- b("a", Oe, [
372
- u(J, {
383
+ default: p(() => [
384
+ _("a", Dt, [
385
+ d(W, {
373
386
  alt: "Vuetify logo",
374
387
  src: "https://cdn.vuetifyjs.com/docs/images/logos/v.svg",
375
388
  width: "32"
376
389
  })
377
390
  ]),
378
- (m(), te(oe, null, ie(t, (r) => b("a", {
391
+ (g(), et(ot, null, st(e, (r) => _("a", {
379
392
  key: r.title,
380
393
  href: r.href,
381
394
  title: r.title,
@@ -383,104 +396,128 @@ const q = (i, t) => {
383
396
  target: "_blank",
384
397
  rel: "noopener noreferrer"
385
398
  }, [
386
- u(Ve, { size: "18" }, {
387
- default: d(() => [
388
- w(x(r.icon), 1)
399
+ d(xt, { size: "18" }, {
400
+ default: p(() => [
401
+ w($(r.icon), 1)
389
402
  ]),
390
403
  _: 2
391
404
  }, 1024)
392
- ], 8, De)), 64)),
393
- b("div", Te, [
394
- w(" © 2016-" + x((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
395
- Re
405
+ ], 8, Ct)), 64)),
406
+ _("div", Ot, [
407
+ w(" © 2016-" + $((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
408
+ Ht
396
409
  ])
397
410
  ]),
398
411
  _: 1
399
412
  }));
400
413
  }
401
414
  });
402
- const Pe = /* @__PURE__ */ q(Ce, [["__scopeId", "data-v-6f6b85b8"]]), S = {}.VITE_API_SERVER_URL, Ke = O("one", () => {
403
- const t = new URLSearchParams(window.location.search).get("session_id"), s = V(), n = E(!1), r = j(() => {
404
- var o;
405
- return (o = s.user) == null ? void 0 : o.sponsorships.find((l) => l.platform === "stripe" && l.tierName.startsWith("sub_"));
406
- }), e = j(() => {
407
- var o;
408
- return (o = r.value) == null ? void 0 : o.isActive;
415
+ const Nt = /* @__PURE__ */ z(Bt, [["__scopeId", "data-v-6f6b85b8"]]), Kt = x("bins", () => {
416
+ const o = C(), e = j([]), s = j();
417
+ async function i() {
418
+ const f = await o.get("/one/bins");
419
+ e.value = f.bins;
420
+ }
421
+ async function r(f) {
422
+ const u = await o.post("/one/bins", { bin: f });
423
+ return e.value.push(u.bin), s.value = u.bin, u;
424
+ }
425
+ async function t(f, u) {
426
+ const m = await o.post(`/one/bins/${u}`, { bin: f }), n = e.value.findIndex((l) => l.id === u);
427
+ return e.value.splice(n, 1, m.bin), s.value = m.bin, m;
428
+ }
429
+ async function h(f, u) {
430
+ const m = u ? await t(f, u) : await r(f);
431
+ return s.value = m.bin, m;
432
+ }
433
+ async function c(f) {
434
+ const u = await o.get(`/one/bins/${f}`);
435
+ return s.value = u.bin, u;
436
+ }
437
+ return {
438
+ all: e,
439
+ create: r,
440
+ current: s,
441
+ find: c,
442
+ get: i,
443
+ update: t,
444
+ updateOrCreate: h
445
+ };
446
+ }), Qt = x("one", () => {
447
+ const e = new URLSearchParams(window.location.search).get("session_id"), s = V(), i = C(), r = T(!1), t = D(() => {
448
+ var n;
449
+ return (n = s.user) == null ? void 0 : n.sponsorships.find((l) => l.platform === "stripe" && l.tierName.startsWith("sub_"));
450
+ }), h = D(() => {
451
+ var n;
452
+ return (n = t.value) == null ? void 0 : n.isActive;
409
453
  });
410
- re(async () => {
411
- t && await c();
412
- }), N(e, (o) => {
413
- o && y();
454
+ rt(async () => {
455
+ e && await c();
456
+ }), F(h, (n) => {
457
+ n && m();
414
458
  });
415
459
  async function c() {
416
460
  try {
417
- n.value = !0;
418
- const o = await fetch(`${S}/one/activate`, {
419
- method: "POST",
420
- credentials: "include",
421
- headers: {
422
- "Content-Type": "application/json"
423
- },
424
- body: JSON.stringify({ sessionId: t })
425
- }).then((l) => l.json());
426
- s.user = o.user;
461
+ r.value = !0;
462
+ const n = await i.post("/one/activate", { sessionId: e });
463
+ s.user = n.user;
427
464
  } catch {
428
465
  } finally {
429
- n.value = !1;
466
+ r.value = !1;
430
467
  }
431
468
  }
432
- async function h() {
433
- n.value = !0, window.location.href = `${S}/one/subscribe`;
469
+ async function f() {
470
+ r.value = !0, window.location.href = `${i.url}/one/subscribe`;
434
471
  }
435
- async function $() {
436
- var o;
437
- if (r.value)
472
+ async function u() {
473
+ var n;
474
+ if (t.value)
438
475
  try {
439
- n.value = !0;
440
- const l = await fetch(`${S}/one/cancel?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
441
- method: "POST",
442
- credentials: "include"
443
- }).then((f) => f.json());
476
+ r.value = !0;
477
+ const l = await i.post(
478
+ `/one/cancel?subscriptionId=${(n = t.value) == null ? void 0 : n.tierName}`
479
+ );
444
480
  s.user = l.user;
445
481
  } catch {
446
482
  } finally {
447
- n.value = !1;
483
+ r.value = !1;
448
484
  }
449
485
  }
450
- async function y() {
451
- var o;
452
- if (r.value)
486
+ async function m() {
487
+ var n;
488
+ if (t.value)
453
489
  try {
454
- n.value = !0;
455
- const l = await fetch(`${S}/one/verify?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
456
- method: "POST",
457
- credentials: "include"
458
- }).then((f) => f.json());
490
+ r.value = !0;
491
+ const l = await i.post(
492
+ `/one/verify?subscriptionId=${(n = t.value) == null ? void 0 : n.tierName}`
493
+ );
459
494
  s.user = l.user;
460
495
  } catch {
461
496
  } finally {
462
- n.value = !1;
497
+ r.value = !1;
463
498
  }
464
499
  }
465
500
  return {
466
501
  activate: c,
467
- cancel: $,
468
- subscribe: h,
469
- verify: y,
470
- subscription: r,
471
- isLoading: n,
472
- isSubscriber: e
502
+ cancel: u,
503
+ subscribe: f,
504
+ verify: m,
505
+ subscription: t,
506
+ isLoading: r,
507
+ isSubscriber: h
473
508
  };
474
509
  });
475
- function Qe() {
476
- function i(t) {
477
- t.component("VoAuthDialog", Ae), t.component("VoFooter", Pe);
510
+ function te() {
511
+ function o(e) {
512
+ e.component("VoAuthDialog", At), e.component("VoFooter", Nt);
478
513
  }
479
- return { install: i };
514
+ return { install: o };
480
515
  }
481
516
  export {
482
- Qe as createOne,
517
+ te as createOne,
483
518
  V as useAuthStore,
484
- Ke as useOneStore,
485
- W as useUserStore
519
+ Kt as useBinsStore,
520
+ C as useHttpStore,
521
+ Qt as useOneStore,
522
+ q as useUserStore
486
523
  };