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