voodoojs 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3387,7 +3387,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3387
3387
  // src/store/index.ts
3388
3388
  init_reactivity();
3389
3389
  var stores = /* @__PURE__ */ new Map();
3390
- var versao = ref(0);
3390
+ var version = ref(0);
3391
3391
  var persistHandles = /* @__PURE__ */ new Map();
3392
3392
  function store(name, definition, options = {}) {
3393
3393
  const existing = stores.get(name);
@@ -3404,30 +3404,30 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3404
3404
  return existing;
3405
3405
  }
3406
3406
  const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
3407
- const descritores = Object.getOwnPropertyDescriptors(definition);
3408
- const initial = Object.defineProperties({}, descritores);
3407
+ const descriptors = Object.getOwnPropertyDescriptors(definition);
3408
+ const initial = Object.defineProperties({}, descriptors);
3409
3409
  if (options.persist && typeof localStorage !== "undefined") {
3410
3410
  try {
3411
3411
  const saved = localStorage.getItem(key);
3412
3412
  if (saved) {
3413
- const salvo = JSON.parse(saved);
3414
- for (const [chave, valor] of Object.entries(salvo)) {
3415
- if (descritores[chave] && !("value" in descritores[chave])) continue;
3416
- initial[chave] = valor;
3413
+ const parsed = JSON.parse(saved);
3414
+ for (const [field, value] of Object.entries(parsed)) {
3415
+ if (descriptors[field] && !("value" in descriptors[field])) continue;
3416
+ initial[field] = value;
3417
3417
  }
3418
3418
  }
3419
3419
  } catch (e) {
3420
3420
  }
3421
3421
  }
3422
3422
  const created = reactive(initial);
3423
- for (const [prop, descritor] of Object.entries(descritores)) {
3424
- const value = descritor.value;
3423
+ for (const [prop, descriptor] of Object.entries(descriptors)) {
3424
+ const value = descriptor.value;
3425
3425
  if (typeof value === "function") {
3426
3426
  created[prop] = (...args) => value.apply(created, args);
3427
3427
  }
3428
3428
  }
3429
3429
  stores.set(name, created);
3430
- versao.value++;
3430
+ version.value++;
3431
3431
  if (options.persist && typeof localStorage !== "undefined") {
3432
3432
  const stop2 = watch(
3433
3433
  created,
@@ -3445,10 +3445,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3445
3445
  }
3446
3446
  function stripFunctions(source) {
3447
3447
  const out = {};
3448
- const descritores = Object.getOwnPropertyDescriptors(toRaw(source));
3448
+ const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
3449
3449
  for (const [key, value] of Object.entries(source)) {
3450
3450
  if (typeof value === "function") continue;
3451
- if (descritores[key] && !("value" in descritores[key])) continue;
3451
+ if (descriptors[key] && !("value" in descriptors[key])) continue;
3452
3452
  out[key] = value;
3453
3453
  }
3454
3454
  return out;
@@ -3457,11 +3457,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3457
3457
  {},
3458
3458
  {
3459
3459
  get: (_t, key) => {
3460
- void versao.value;
3460
+ void version.value;
3461
3461
  return stores.get(key);
3462
3462
  },
3463
3463
  has: (_t, key) => {
3464
- void versao.value;
3464
+ void version.value;
3465
3465
  return stores.has(key);
3466
3466
  },
3467
3467
  ownKeys: () => [...stores.keys()],
@@ -4736,11 +4736,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4736
4736
  }
4737
4737
  };
4738
4738
  var THEME_KEY = "voodoo:theme";
4739
+ var picked = null;
4739
4740
  var theme = {
4740
4741
  /** Theme chosen by the user, or `system` when never set. */
4741
4742
  get current() {
4742
- var _a2;
4743
- return (_a2 = storage.get(THEME_KEY)) != null ? _a2 : "system";
4743
+ var _a2, _b;
4744
+ return (_b = (_a2 = storage.get(THEME_KEY)) != null ? _a2 : picked) != null ? _b : "system";
4744
4745
  },
4745
4746
  /** Theme effectively applied, resolving `system`. */
4746
4747
  get resolved() {
@@ -4750,6 +4751,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4750
4751
  return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
4751
4752
  },
4752
4753
  set(value) {
4754
+ picked = value;
4753
4755
  storage.set(THEME_KEY, value);
4754
4756
  this.apply();
4755
4757
  },
@@ -4760,7 +4762,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4760
4762
  },
4761
4763
  /** `true` once the visitor has actually picked a theme. */
4762
4764
  get chosen() {
4763
- return storage.get(THEME_KEY) != null;
4765
+ return picked !== null || storage.get(THEME_KEY) != null;
4764
4766
  },
4765
4767
  /** Writes `data-theme` on the root element and notifies the page. */
4766
4768
  apply() {
@@ -4784,7 +4786,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4784
4786
  init() {
4785
4787
  if (typeof document === "undefined") return;
4786
4788
  this.apply();
4787
- matchMedia == null ? void 0 : matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4789
+ if (typeof matchMedia === "undefined") return;
4790
+ matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4788
4791
  if (this.current === "system") this.apply();
4789
4792
  });
4790
4793
  }
@@ -5234,8 +5237,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5234
5237
  defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
5235
5238
  effect2(() => {
5236
5239
  el.textContent = stringify(ev());
5237
- const primeiro = el.firstChild;
5238
- if (primeiro && primeiro.nodeType === 3) markInitialized(primeiro);
5240
+ const first = el.firstChild;
5241
+ if (first && first.nodeType === 3) markInitialized(first);
5239
5242
  });
5240
5243
  });
5241
5244
  defineDirective("html", (ctx) => {
@@ -5441,10 +5444,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5441
5444
  next.push({ key, scope: childScope, nodes, data: childScope.data });
5442
5445
  });
5443
5446
  if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
5444
- for (const [node, escopo] of batch.pending) walk(node, escopo);
5445
- const reaproveitados = new Set(next);
5447
+ for (const [node, rowScope] of batch.pending) walk(node, rowScope);
5448
+ const reused = new Set(next);
5446
5449
  for (const block2 of blocks) {
5447
- if (used.has(block2.key) && reaproveitados.has(block2)) continue;
5450
+ if (used.has(block2.key) && reused.has(block2)) continue;
5448
5451
  for (const node of block2.nodes) {
5449
5452
  destroy(node);
5450
5453
  node.remove();
@@ -5514,7 +5517,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5514
5517
  "novalidate",
5515
5518
  "inert"
5516
5519
  ]);
5517
- var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
5520
+ var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
5518
5521
  "href",
5519
5522
  "src",
5520
5523
  "action",
@@ -5523,15 +5526,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5523
5526
  "ping",
5524
5527
  "poster"
5525
5528
  ]);
5526
- var RUIDO_DE_ESQUEMA = /[\s\x00-\x1f]/g;
5527
- function urlPerigosa(valor) {
5528
- const limpo = valor.replace(RUIDO_DE_ESQUEMA, "").toLowerCase();
5529
- return limpo.startsWith("javascript:") || limpo.startsWith("vbscript:") || limpo.startsWith("data:text/html") || limpo.startsWith("data:application/xhtml");
5529
+ var SCHEME_NOISE = /[\s\x00-\x1f]/g;
5530
+ function isDangerousUrl(value) {
5531
+ const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
5532
+ return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
5530
5533
  }
5531
- function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
5534
+ function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
5532
5535
  if (name === "class") return applyClass(el, value);
5533
5536
  if (name === "style") return applyStyle(el, value);
5534
- if (config.sanitizeUrls && !perigoLiberado && name === "srcdoc") {
5537
+ if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
5535
5538
  warn2(
5536
5539
  `:srcdoc refused in ${describeElement(el)}: the value becomes a document with active script inside the iframe, the same way v-html becomes markup. If the content is trusted, write :srcdoc.dangerous="..."; to turn off this protection on the entire application, set V.config.sanitizeUrls = false.`
5537
5540
  );
@@ -5539,7 +5542,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5539
5542
  return;
5540
5543
  }
5541
5544
  if (config.sanitizeUrls && !asProp) {
5542
- if (ATRIBUTOS_DE_URL.has(name) && typeof value === "string" && urlPerigosa(value)) {
5545
+ if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
5543
5546
  warn2(
5544
5547
  `value refused in :${name} of ${describeElement(el)}: "${value.slice(0, 60)}" uses a scheme that executes code. Use an http(s) or relative address. To turn off this protection, set V.config.sanitizeUrls = false.`
5545
5548
  );
@@ -5636,9 +5639,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5636
5639
  }
5637
5640
  if (arg === "key") return;
5638
5641
  const asProp = !!modifiers.prop;
5639
- const perigoLiberado = !!modifiers.dangerous;
5642
+ const allowDangerous = !!modifiers.dangerous;
5640
5643
  effect2(() => {
5641
- applyBinding(el, arg, ev(), asProp, perigoLiberado);
5644
+ applyBinding(el, arg, ev(), asProp, allowDangerous);
5642
5645
  });
5643
5646
  void expression;
5644
5647
  },
@@ -6573,7 +6576,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6573
6576
  (ctx) => {
6574
6577
  var _a3, _b2;
6575
6578
  let oldValue;
6576
- let mounted = false;
6579
+ let mounted2 = false;
6577
6580
  const makeBinding = (value) => {
6578
6581
  var _a4, _b3;
6579
6582
  return {
@@ -6593,8 +6596,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6593
6596
  ctx.effect(() => {
6594
6597
  var _a4, _b3;
6595
6598
  const value = hooks.raw ? ctx.expression : ctx.evaluate();
6596
- if (!mounted) {
6597
- mounted = true;
6599
+ if (!mounted2) {
6600
+ mounted2 = true;
6598
6601
  oldValue = value;
6599
6602
  (_a4 = hooks.mounted) == null ? void 0 : _a4.call(hooks, ctx.el, makeBinding(value));
6600
6603
  return;
@@ -6618,11 +6621,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6618
6621
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
6619
6622
  return rootScope.data;
6620
6623
  }
6621
- var version = "0.4.6";
6624
+ var version2 = "0.4.6";
6622
6625
  var core = {
6623
6626
  // Utilities first: Voodoo's own names can override.
6624
6627
  ...utils_exports,
6625
- version,
6628
+ version: version2,
6626
6629
  config,
6627
6630
  // Reactivity
6628
6631
  reactive,
@@ -7852,6 +7855,32 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
7852
7855
  const base = settings2.base === "/" ? "" : settings2.base.replace(/\/$/, "");
7853
7856
  return `${base}${suffix}` || "/";
7854
7857
  }
7858
+ var historyRefused = false;
7859
+ var writingHash = false;
7860
+ function writeUrl(state2, url2, replace) {
7861
+ if (!historyRefused) {
7862
+ try {
7863
+ if (replace) window.history.replaceState(state2, "", url2);
7864
+ else window.history.pushState(state2, "", url2);
7865
+ return;
7866
+ } catch (error) {
7867
+ if (!(error instanceof Error) || error.name !== "SecurityError") throw error;
7868
+ historyRefused = true;
7869
+ }
7870
+ }
7871
+ if (settings2.mode !== "hash") return;
7872
+ const hash = url2.slice(url2.indexOf("#"));
7873
+ if (window.location.hash === hash) return;
7874
+ writingHash = true;
7875
+ try {
7876
+ if (replace) window.location.replace(url2);
7877
+ else window.location.hash = hash;
7878
+ } finally {
7879
+ setTimeout(() => {
7880
+ writingHash = false;
7881
+ }, 0);
7882
+ }
7883
+ }
7855
7884
  function compileRoute(pattern, record) {
7856
7885
  const clean = pattern === "*" ? "*" : normalizePath(pattern);
7857
7886
  const raw = clean === "*" ? ["*"] : clean.split("/").filter(Boolean);
@@ -8042,8 +8071,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
8042
8071
  const key = uid("rota");
8043
8072
  const historyState = { ...(_a2 = options.state) != null ? _a2 : {}, [HISTORY_KEY]: key };
8044
8073
  const url2 = buildUrl(destination);
8045
- if (options.replace) window.history.replaceState(historyState, "", url2);
8046
- else window.history.pushState(historyState, "", url2);
8074
+ writeUrl(historyState, url2, options.replace === true);
8047
8075
  currentKey = key;
8048
8076
  applyLocation(destination);
8049
8077
  if (options.scroll !== false) scheduleScroll(destination, from, null);
@@ -8057,17 +8085,14 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
8057
8085
  }
8058
8086
  async function onHistoryChange(event) {
8059
8087
  var _a2, _b;
8088
+ if (writingHash) return;
8060
8089
  const { path, query: query2, hash } = readLocation();
8061
8090
  const destination = locationFor(path, query2, hash);
8062
8091
  const from = snapshot();
8063
8092
  if (destination.fullPath === from.fullPath) return;
8064
8093
  const verdict = await runGuards(destination, from);
8065
8094
  if (verdict === false) {
8066
- window.history.replaceState(
8067
- { [HISTORY_KEY]: currentKey },
8068
- "",
8069
- buildUrl(from)
8070
- );
8095
+ writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(from), true);
8071
8096
  devtoolsBus.emit("navigation", {
8072
8097
  from: from.fullPath,
8073
8098
  to: destination.fullPath,
@@ -8110,6 +8135,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
8110
8135
  window.removeEventListener("popstate", historyListener);
8111
8136
  window.removeEventListener("hashchange", historyListener);
8112
8137
  window.removeEventListener("beforeunload", saveScroll);
8138
+ historyRefused = false;
8139
+ writingHash = false;
8113
8140
  }
8114
8141
  async function enterInitialRoute() {
8115
8142
  var _a2;
@@ -8131,7 +8158,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
8131
8158
  break;
8132
8159
  }
8133
8160
  currentKey = uid("rota");
8134
- window.history.replaceState({ [HISTORY_KEY]: currentKey }, "", buildUrl(destination));
8161
+ writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(destination), true);
8135
8162
  applyLocation(destination);
8136
8163
  if (destination.hash) scheduleScroll(destination, from, null);
8137
8164
  (_a2 = settings2.afterEach) == null ? void 0 : _a2.call(settings2, snapshot(), from);
@@ -9993,7 +10020,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
9993
10020
  if (addedTabIndex) el.setAttribute("tabindex", "0");
9994
10021
  let bubble = null;
9995
10022
  let timer = null;
9996
- const build = () => {
10023
+ const build2 = () => {
9997
10024
  const node = document.createElement("div");
9998
10025
  node.className = "v-tooltip";
9999
10026
  node.setAttribute("role", "tooltip");
@@ -10007,7 +10034,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
10007
10034
  };
10008
10035
  const open = () => {
10009
10036
  if (bubble) return;
10010
- bubble = build();
10037
+ bubble = build2();
10011
10038
  el.setAttribute("aria-describedby", bubble.id);
10012
10039
  reposition();
10013
10040
  requestAnimationFrame(() => bubble == null ? void 0 : bubble.classList.add("v-in"));
@@ -11217,37 +11244,37 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
11217
11244
  init_registry();
11218
11245
  init_style();
11219
11246
  var messages = {
11220
- required: "Preencha este campo.",
11221
- email: "Informe um e-mail valido.",
11222
- url: "Informe uma URL valida.",
11223
- number: "Informe um numero valido.",
11224
- integer: "Informe um numero inteiro.",
11225
- decimal: "Informe um numero decimal valido.",
11226
- alpha: "Use apenas letras.",
11227
- alphanumeric: "Use apenas letras e numeros.",
11228
- minlength: "Use no minimo {param} caracteres.",
11229
- maxlength: "Use no maximo {param} caracteres.",
11230
- min: "O valor minimo e {param}.",
11231
- max: "O valor maximo e {param}.",
11232
- between: "Informe um valor entre {min} e {max}.",
11233
- match: "Os campos nao conferem.",
11234
- regex: "O formato informado nao e valido.",
11235
- date: "Informe uma data valida.",
11236
- after: "A data precisa ser posterior a {param}.",
11237
- before: "A data precisa ser anterior a {param}.",
11238
- accepted: "E preciso marcar esta opcao para continuar.",
11239
- same: "Os valores precisam ser iguais.",
11240
- different: "Os valores precisam ser diferentes.",
11241
- in: "Escolha uma das opcoes permitidas.",
11242
- notin: "Este valor nao e permitido.",
11243
- phone: "Informe um telefone valido com DDD.",
11244
- cpf: "CPF invalido.",
11245
- cnpj: "CNPJ invalido.",
11246
- cep: "CEP invalido.",
11247
- creditcard: "Numero de cartao invalido.",
11248
- strongpassword: "Use {param} caracteres ou mais, com maiuscula, minuscula, numero e simbolo.",
11249
- unique: "Este valor ja esta em uso.",
11250
- invalid: "Valor invalido."
11247
+ required: "Please fill in this field.",
11248
+ email: "Enter a valid email address.",
11249
+ url: "Enter a valid URL.",
11250
+ number: "Enter a valid number.",
11251
+ integer: "Enter a whole number.",
11252
+ decimal: "Enter a valid decimal number.",
11253
+ alpha: "Use letters only.",
11254
+ alphanumeric: "Use letters and numbers only.",
11255
+ minlength: "Use at least {param} characters.",
11256
+ maxlength: "Use at most {param} characters.",
11257
+ min: "The smallest allowed value is {param}.",
11258
+ max: "The largest allowed value is {param}.",
11259
+ between: "Enter a value between {min} and {max}.",
11260
+ match: "The fields do not match.",
11261
+ regex: "That format is not valid.",
11262
+ date: "Enter a valid date.",
11263
+ after: "The date has to be later than {param}.",
11264
+ before: "The date has to be earlier than {param}.",
11265
+ accepted: "You have to tick this to continue.",
11266
+ same: "The values have to be the same.",
11267
+ different: "The values have to be different.",
11268
+ in: "Choose one of the allowed options.",
11269
+ notin: "That value is not allowed.",
11270
+ phone: "Enter a valid phone number, including the area code.",
11271
+ cpf: "Invalid CPF.",
11272
+ cnpj: "Invalid CNPJ.",
11273
+ cep: "Invalid postcode.",
11274
+ creditcard: "Invalid card number.",
11275
+ strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
11276
+ unique: "That value is already taken.",
11277
+ invalid: "Invalid value."
11251
11278
  };
11252
11279
  function formatMessage(template, data2) {
11253
11280
  var _a2, _b, _c, _d, _e, _f;
@@ -14684,7 +14711,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
14684
14711
  const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
14685
14712
  const series = [];
14686
14713
  const raw = options.data;
14687
- const singleName = (_a2 = options.name) != null ? _a2 : "Valor";
14714
+ const singleName = (_a2 = options.name) != null ? _a2 : "Value";
14688
14715
  if (typeof raw === "number") {
14689
14716
  series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
14690
14717
  } else if (Array.isArray(raw) && raw.length > 0) {
@@ -15417,7 +15444,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
15417
15444
  const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
15418
15445
  const format = (_b = options.format) != null ? _b : "number";
15419
15446
  const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
15420
- const height = Math.max(48, Math.round((_c = options.height) != null ? _c : defaultHeight(type)));
15447
+ const height = Math.max(48, Math.round((_c = options.height) != null ? _c : el.clientHeight || defaultHeight(type)));
15421
15448
  state2.lastWidth = width;
15422
15449
  state2.viewWidth = width;
15423
15450
  state2.viewHeight = height;
@@ -16280,7 +16307,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16280
16307
  @keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
16281
16308
  @keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
16282
16309
 
16283
- /* ------------------------------------------------------------------ botao */
16310
+ /* ----------------------------------------------------------------- button */
16284
16311
  .v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
16285
16312
  align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
16286
16313
  font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
@@ -16324,7 +16351,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16324
16351
  .v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
16325
16352
  border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
16326
16353
 
16327
- /* ------------------------------------------------------- botao de icone */
16354
+ /* ------------------------------------------------------------ icon button */
16328
16355
  .v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
16329
16356
  border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
16330
16357
  font-family:var(--v-font-sans);
@@ -16369,7 +16396,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16369
16396
  .v-card-foot:empty{display:none}
16370
16397
  .v-card[data-padded="false"] .v-card-body{padding:0}
16371
16398
 
16372
- /* ------------------------------------------------------------ formulario */
16399
+ /* ------------------------------------------------------------------- form */
16373
16400
  .v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
16374
16401
  .v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
16375
16402
  line-height:1.3;color:var(--v-text)}
@@ -16448,7 +16475,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16448
16475
  .v-select-opt.is-selected .v-select-check{opacity:1}
16449
16476
  .v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
16450
16477
 
16451
- /* -------------------------------------------- caixa, radio e interruptor */
16478
+ /* --------------------------------------------- checkbox, radio and switch */
16452
16479
  .v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
16453
16480
  font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
16454
16481
  .v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
@@ -16485,7 +16512,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16485
16512
  .v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
16486
16513
  .v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
16487
16514
 
16488
- /* --------------------------------------------------- selo, etiqueta, alerta */
16515
+ /* ------------------------------------------------------ badge, tag, alert */
16489
16516
  .v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
16490
16517
  font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
16491
16518
  white-space:nowrap;vertical-align:middle}
@@ -16562,7 +16589,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16562
16589
  .v-avatar-status[data-status="busy"]{background:var(--v-danger)}
16563
16590
  .v-avatar-status[data-status="away"]{background:var(--v-warning)}
16564
16591
 
16565
- /* ------------------------------------------------- spinner e esqueleto */
16592
+ /* --------------------------------------------------- spinner and skeleton */
16566
16593
  .v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
16567
16594
  border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
16568
16595
  .v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
@@ -16579,7 +16606,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16579
16606
  .v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
16580
16607
  .v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
16581
16608
 
16582
- /* ------------------------------------------------------------- progresso */
16609
+ /* --------------------------------------------------------------- progress */
16583
16610
  .v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
16584
16611
  .v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
16585
16612
  .v-progress-value{font-weight:650;color:var(--v-text)}
@@ -16596,7 +16623,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16596
16623
  .v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
16597
16624
  .v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
16598
16625
 
16599
- /* ------------------------------------------------------------- divisor */
16626
+ /* ---------------------------------------------------------------- divider */
16600
16627
  .v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
16601
16628
  font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
16602
16629
  .v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
@@ -16604,7 +16631,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16604
16631
  .v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
16605
16632
  .v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
16606
16633
 
16607
- /* -------------------------------------------------------------- tabela */
16634
+ /* ------------------------------------------------------------------ table */
16608
16635
  .v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
16609
16636
  border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16610
16637
  .v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
@@ -16625,7 +16652,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16625
16652
  .v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
16626
16653
  .v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
16627
16654
 
16628
- /* ---------------------------------------------------------- paginacao */
16655
+ /* ------------------------------------------------------------- pagination */
16629
16656
  .v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
16630
16657
  .v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
16631
16658
  background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
@@ -16637,7 +16664,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16637
16664
  .v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
16638
16665
  .v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
16639
16666
 
16640
- /* ----------------------------------------------------------- migalhas */
16667
+ /* ------------------------------------------------------------- breadcrumb */
16641
16668
  .v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
16642
16669
  .v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
16643
16670
  .v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
@@ -16647,7 +16674,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16647
16674
  .v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
16648
16675
  .v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
16649
16676
 
16650
- /* ------------------------------------------------------------ metrica */
16677
+ /* ------------------------------------------------------------------- stat */
16651
16678
  .v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
16652
16679
  border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16653
16680
  .v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
@@ -16665,7 +16692,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16665
16692
  .v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
16666
16693
  .v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
16667
16694
 
16668
- /* ------------------------------------------------------- estado vazio */
16695
+ /* ------------------------------------------------------------ empty state */
16669
16696
  .v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
16670
16697
  padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
16671
16698
  .v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
@@ -16675,7 +16702,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16675
16702
  .v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
16676
16703
  .v-empty-actions:empty{display:none}
16677
16704
 
16678
- /* ----------------------------------------------------------- linha do tempo */
16705
+ /* --------------------------------------------------------------- timeline */
16679
16706
  .v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
16680
16707
  display:flex;flex-direction:column}
16681
16708
  .v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
@@ -16695,7 +16722,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16695
16722
  .v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
16696
16723
  .v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
16697
16724
 
16698
- /* ---------------------------------------------------------------- passos */
16725
+ /* ------------------------------------------------------------------ steps */
16699
16726
  .v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
16700
16727
  .v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
16701
16728
  .v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
@@ -16714,7 +16741,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16714
16741
  .v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
16715
16742
  .v-step:last-child .v-step-line{display:none}
16716
16743
 
16717
- /* ------------------------------------------------------------ avaliacao */
16744
+ /* ----------------------------------------------------------------- rating */
16718
16745
  .v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
16719
16746
  .v-rating-stars{display:inline-flex;gap:2px}
16720
16747
  .v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
@@ -16741,7 +16768,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16741
16768
  .v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
16742
16769
  .v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
16743
16770
 
16744
- /* ------------------------------------------------------------ codigo */
16771
+ /* ------------------------------------------------------------------- code */
16745
16772
  .v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
16746
16773
  border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
16747
16774
  .v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
@@ -17754,7 +17781,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17754
17781
  props: {
17755
17782
  columns: { type: "any", default: "" },
17756
17783
  rows: { type: "any", default: "" },
17757
- empty: { type: "string", default: "Nenhum registro encontrado" },
17784
+ empty: { type: "string", default: "No records found" },
17758
17785
  sortable: { type: "any", default: true },
17759
17786
  dense: BOOL,
17760
17787
  striped: BOOL,
@@ -17866,9 +17893,9 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17866
17893
  total: { type: "number", default: 0 },
17867
17894
  perPage: { type: "number", default: 10 },
17868
17895
  siblings: { type: "number", default: 1 },
17869
- previousLabel: { type: "string", default: "Anterior" },
17870
- nextLabel: { type: "string", default: "Pr\xF3xima" },
17871
- ariaLabel: { type: "string", default: "Pagina\xE7\xE3o" }
17896
+ previousLabel: { type: "string", default: "Previous" },
17897
+ nextLabel: { type: "string", default: "Next" },
17898
+ ariaLabel: { type: "string", default: "Pagination" }
17872
17899
  },
17873
17900
  computed: {
17874
17901
  lastPage() {
@@ -17882,7 +17909,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17882
17909
  const value = Number(this.page) || 1;
17883
17910
  return Math.min(Math.max(1, Math.round(value)), this.lastPage);
17884
17911
  },
17885
- /** Numeros visiveis, com `0` marcando as reticencias. */
17912
+ /** Visible page numbers, with `0` marking the ellipsis. */
17886
17913
  items() {
17887
17914
  const last = this.lastPage;
17888
17915
  const current2 = this.currentPage;
@@ -17927,7 +17954,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17927
17954
  <template v-for="(item, index) in items" :key="index">
17928
17955
  <span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
17929
17956
  <button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
17930
- :aria-label="'P\xE1gina ' + item" v-click="go(item)" v-text="item"></button>
17957
+ :aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
17931
17958
  </template>
17932
17959
  <button type="button" class="v-page" :disabled="currentPage >= lastPage"
17933
17960
  :aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
@@ -17960,7 +17987,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17960
17987
  props: {
17961
17988
  items: { type: "any", default: "" },
17962
17989
  separator: { type: "string", default: "/" },
17963
- ariaLabel: { type: "string", default: "Trilha de navega\xE7\xE3o" }
17990
+ ariaLabel: { type: "string", default: "Breadcrumb" }
17964
17991
  },
17965
17992
  computed: {
17966
17993
  crumbs() {
@@ -17994,7 +18021,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17994
18021
  hint: TEXT,
17995
18022
  icon: TEXT,
17996
18023
  suffix: { type: "string", default: "%" },
17997
- /** Quando `true`, uma variacao negativa e considerada positiva. */
18024
+ /** When `true`, a negative change counts as positive. */
17998
18025
  inverted: BOOL
17999
18026
  },
18000
18027
  computed: {
@@ -18047,7 +18074,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18047
18074
  register("v-empty-state", {
18048
18075
  props: {
18049
18076
  icon: { type: "string", default: "inbox" },
18050
- title: { type: "string", default: "Nada por aqui" },
18077
+ title: { type: "string", default: "Nothing here yet" },
18051
18078
  description: TEXT
18052
18079
  },
18053
18080
  template: `
@@ -18121,7 +18148,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18121
18148
  steps: { type: "any", default: "" },
18122
18149
  current: { type: "number", default: 0 },
18123
18150
  vertical: BOOL,
18124
- ariaLabel: { type: "string", default: "Etapas" }
18151
+ ariaLabel: { type: "string", default: "Steps" }
18125
18152
  },
18126
18153
  computed: {
18127
18154
  ...flags("vertical"),
@@ -18169,7 +18196,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18169
18196
  value: { type: "number", default: 0 },
18170
18197
  max: { type: "number", default: 5 },
18171
18198
  size: { type: "string", default: "md" },
18172
- label: { type: "string", default: "Avalia\xE7\xE3o" },
18199
+ label: { type: "string", default: "Rating" },
18173
18200
  readonly: BOOL,
18174
18201
  disabled: BOOL,
18175
18202
  showValue: BOOL,
@@ -18195,7 +18222,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18195
18222
  return this.hovered > 0 ? this.hovered : this.score;
18196
18223
  },
18197
18224
  valueText() {
18198
- return `${this.score} de ${this.total}`;
18225
+ return `${this.score} of ${this.total}`;
18199
18226
  }
18200
18227
  },
18201
18228
  methods: {
@@ -18251,7 +18278,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18251
18278
  :tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
18252
18279
  <span class="v-rating-stars">
18253
18280
  <button type="button" class="v-star" v-for="index in total" :key="index"
18254
- :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' de ' + total"
18281
+ :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
18255
18282
  :tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
18256
18283
  v-html="svgIcon('star')"></button>
18257
18284
  </span>
@@ -18319,8 +18346,8 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18319
18346
  code: TEXT,
18320
18347
  language: TEXT,
18321
18348
  filename: TEXT,
18322
- copyLabel: { type: "string", default: "Copiar" },
18323
- copiedLabel: { type: "string", default: "Copiado" },
18349
+ copyLabel: { type: "string", default: "Copy" },
18350
+ copiedLabel: { type: "string", default: "Copied" },
18324
18351
  wrap: BOOL
18325
18352
  },
18326
18353
  state() {
@@ -18664,7 +18691,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
18664
18691
  source.remove();
18665
18692
  }
18666
18693
  sourceAnchors.delete(source);
18667
- if (source.hasAttribute(`${config.prefix}modal-content`) || source.hasAttribute("data-v-modal-content")) {
18694
+ if (hasDirective(source, "modal-content")) {
18668
18695
  source.setAttribute("hidden", "");
18669
18696
  }
18670
18697
  }
@@ -20700,14 +20727,14 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
20700
20727
 
20701
20728
  // src/devtools/launcher.ts
20702
20729
  init_style();
20703
- var POSICAO_KEY = "voodoo:devtools:widget-position";
20704
- var ESCONDIDO_KEY = "voodoo:devtools:widget-hidden";
20705
- var LIMIAR_ARRASTO = 4;
20730
+ var POSITION_KEY = "voodoo:devtools:widget-position";
20731
+ var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
20732
+ var DRAG_THRESHOLD = 4;
20706
20733
  var refs2 = null;
20707
- var montado = false;
20708
- var timerContador = 0;
20709
- var timerPulso = 0;
20710
- var desligar = [];
20734
+ var mounted = false;
20735
+ var counterTimer = 0;
20736
+ var pulseTimer = 0;
20737
+ var teardown2 = [];
20711
20738
  var WIDGET_CSS = `
20712
20739
  .v-devtools-widget{
20713
20740
  all: initial;
@@ -20840,219 +20867,219 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
20840
20867
  .v-devtools-btn:hover{transform:none}
20841
20868
  }
20842
20869
  `;
20843
- var MARCA = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20870
+ var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20844
20871
  <path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
20845
20872
  <circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
20846
20873
  </svg>`;
20847
- function lerPosicao() {
20874
+ function readPosition() {
20848
20875
  try {
20849
- const bruto = localStorage.getItem(POSICAO_KEY);
20850
- if (!bruto) return null;
20851
- const valor = JSON.parse(bruto);
20852
- if (typeof (valor == null ? void 0 : valor.x) !== "number" || typeof (valor == null ? void 0 : valor.y) !== "number") return null;
20853
- return valor;
20876
+ const raw = localStorage.getItem(POSITION_KEY);
20877
+ if (!raw) return null;
20878
+ const value = JSON.parse(raw);
20879
+ if (typeof (value == null ? void 0 : value.x) !== "number" || typeof (value == null ? void 0 : value.y) !== "number") return null;
20880
+ return value;
20854
20881
  } catch (e) {
20855
20882
  return null;
20856
20883
  }
20857
20884
  }
20858
- function gravarPosicao(pos) {
20885
+ function writePosition(pos) {
20859
20886
  try {
20860
- localStorage.setItem(POSICAO_KEY, JSON.stringify(pos));
20887
+ localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
20861
20888
  } catch (e) {
20862
20889
  }
20863
20890
  }
20864
- function aplicarPosicao(raiz, pos) {
20865
- const largura = raiz.offsetWidth || 120;
20866
- const altura = raiz.offsetHeight || 38;
20867
- const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - largura - 8));
20868
- const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - altura - 8));
20869
- raiz.style.left = `${x}px`;
20870
- raiz.style.top = `${y}px`;
20871
- raiz.style.right = "auto";
20872
- raiz.style.bottom = "auto";
20873
- }
20874
- function construir() {
20875
- const raiz = document.createElement("div");
20876
- raiz.className = "v-devtools-widget";
20877
- raiz.setAttribute("data-voodoo-devtools", "widget");
20878
- const botao = document.createElement("button");
20879
- botao.type = "button";
20880
- botao.className = "v-devtools-btn";
20881
- botao.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20882
- botao.setAttribute("aria-pressed", "false");
20883
- botao.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20884
- botao.innerHTML = MARCA;
20885
- const rotulo = document.createElement("span");
20886
- rotulo.className = "v-devtools-label";
20887
- rotulo.textContent = "Voodoo";
20888
- const contador = document.createElement("span");
20889
- contador.className = "v-devtools-count";
20890
- contador.textContent = "0";
20891
- const pulso = document.createElement("span");
20892
- pulso.className = "v-devtools-pulse";
20893
- pulso.setAttribute("data-on", "false");
20894
- botao.append(rotulo, contador, pulso);
20895
- const fechar = document.createElement("button");
20896
- fechar.type = "button";
20897
- fechar.className = "v-devtools-close";
20898
- fechar.setAttribute("aria-label", "Hide the devtools widget in this tab");
20899
- fechar.title = "Hide in this tab";
20900
- fechar.textContent = "\xD7";
20901
- raiz.append(botao, fechar);
20902
- document.body.appendChild(raiz);
20903
- const salva = lerPosicao();
20904
- if (salva) {
20905
- aplicarPosicao(raiz, salva);
20891
+ function applyPosition(root, pos) {
20892
+ const width = root.offsetWidth || 120;
20893
+ const height = root.offsetHeight || 38;
20894
+ const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
20895
+ const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
20896
+ root.style.left = `${x}px`;
20897
+ root.style.top = `${y}px`;
20898
+ root.style.right = "auto";
20899
+ root.style.bottom = "auto";
20900
+ }
20901
+ function build() {
20902
+ const root = document.createElement("div");
20903
+ root.className = "v-devtools-widget";
20904
+ root.setAttribute("data-voodoo-devtools", "widget");
20905
+ const button = document.createElement("button");
20906
+ button.type = "button";
20907
+ button.className = "v-devtools-btn";
20908
+ button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20909
+ button.setAttribute("aria-pressed", "false");
20910
+ button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20911
+ button.innerHTML = MARK;
20912
+ const label = document.createElement("span");
20913
+ label.className = "v-devtools-label";
20914
+ label.textContent = "Voodoo";
20915
+ const counter2 = document.createElement("span");
20916
+ counter2.className = "v-devtools-count";
20917
+ counter2.textContent = "0";
20918
+ const pulse = document.createElement("span");
20919
+ pulse.className = "v-devtools-pulse";
20920
+ pulse.setAttribute("data-on", "false");
20921
+ button.append(label, counter2, pulse);
20922
+ const close = document.createElement("button");
20923
+ close.type = "button";
20924
+ close.className = "v-devtools-close";
20925
+ close.setAttribute("aria-label", "Hide the devtools widget in this tab");
20926
+ close.title = "Hide in this tab";
20927
+ close.textContent = "\xD7";
20928
+ root.append(button, close);
20929
+ document.body.appendChild(root);
20930
+ const saved = readPosition();
20931
+ if (saved) {
20932
+ applyPosition(root, saved);
20906
20933
  } else {
20907
- raiz.style.right = "16px";
20908
- raiz.style.bottom = "16px";
20909
- }
20910
- return { raiz, botao, pulso, contador, fechar };
20911
- }
20912
- function ligarArrasto(refs3, aoClicar) {
20913
- let arrastando = false;
20914
- let moveu = false;
20915
- let deslocX = 0;
20916
- let deslocY = 0;
20917
- let inicioX = 0;
20918
- let inicioY = 0;
20919
- const aoDescer = (evento) => {
20934
+ root.style.right = "16px";
20935
+ root.style.bottom = "16px";
20936
+ }
20937
+ return { root, button, pulse, counter: counter2, close };
20938
+ }
20939
+ function enableDrag(refs3, onClick) {
20940
+ let dragging = false;
20941
+ let moved = false;
20942
+ let offsetX = 0;
20943
+ let offsetY = 0;
20944
+ let startX = 0;
20945
+ let startY = 0;
20946
+ const onPointerDown = (event) => {
20920
20947
  var _a2, _b;
20921
- if (evento.button !== 0) return;
20922
- const caixa = refs3.raiz.getBoundingClientRect();
20923
- arrastando = true;
20924
- moveu = false;
20925
- inicioX = evento.clientX;
20926
- inicioY = evento.clientY;
20927
- deslocX = evento.clientX - caixa.left;
20928
- deslocY = evento.clientY - caixa.top;
20929
- (_b = (_a2 = refs3.botao).setPointerCapture) == null ? void 0 : _b.call(_a2, evento.pointerId);
20948
+ if (event.button !== 0) return;
20949
+ const box = refs3.root.getBoundingClientRect();
20950
+ dragging = true;
20951
+ moved = false;
20952
+ startX = event.clientX;
20953
+ startY = event.clientY;
20954
+ offsetX = event.clientX - box.left;
20955
+ offsetY = event.clientY - box.top;
20956
+ (_b = (_a2 = refs3.button).setPointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
20930
20957
  };
20931
- const aoMover = (evento) => {
20932
- if (!arrastando) return;
20933
- const distancia = Math.hypot(evento.clientX - inicioX, evento.clientY - inicioY);
20934
- if (!moveu && distancia < LIMIAR_ARRASTO) return;
20935
- moveu = true;
20936
- evento.preventDefault();
20937
- aplicarPosicao(refs3.raiz, { x: evento.clientX - deslocX, y: evento.clientY - deslocY });
20958
+ const onPointerMove2 = (event) => {
20959
+ if (!dragging) return;
20960
+ const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
20961
+ if (!moved && distance < DRAG_THRESHOLD) return;
20962
+ moved = true;
20963
+ event.preventDefault();
20964
+ applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
20938
20965
  };
20939
- const aoSubir = (evento) => {
20966
+ const onPointerUp = (event) => {
20940
20967
  var _a2, _b;
20941
- if (!arrastando) return;
20942
- arrastando = false;
20943
- (_b = (_a2 = refs3.botao).releasePointerCapture) == null ? void 0 : _b.call(_a2, evento.pointerId);
20944
- if (!moveu) {
20945
- aoClicar();
20968
+ if (!dragging) return;
20969
+ dragging = false;
20970
+ (_b = (_a2 = refs3.button).releasePointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
20971
+ if (!moved) {
20972
+ onClick();
20946
20973
  return;
20947
20974
  }
20948
- const caixa = refs3.raiz.getBoundingClientRect();
20949
- gravarPosicao({ x: caixa.left, y: caixa.top });
20975
+ const box = refs3.root.getBoundingClientRect();
20976
+ writePosition({ x: box.left, y: box.top });
20950
20977
  };
20951
- const aoTeclar = (evento) => {
20952
- if (evento.key !== "Enter" && evento.key !== " ") return;
20953
- evento.preventDefault();
20954
- aoClicar();
20978
+ const onKeyDown = (event) => {
20979
+ if (event.key !== "Enter" && event.key !== " ") return;
20980
+ event.preventDefault();
20981
+ onClick();
20955
20982
  };
20956
- const aoRedimensionar = () => {
20957
- const caixa = refs3.raiz.getBoundingClientRect();
20958
- if (refs3.raiz.style.left) aplicarPosicao(refs3.raiz, { x: caixa.left, y: caixa.top });
20983
+ const onResize = () => {
20984
+ const box = refs3.root.getBoundingClientRect();
20985
+ if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
20959
20986
  };
20960
- refs3.botao.addEventListener("pointerdown", aoDescer);
20961
- refs3.botao.addEventListener("pointermove", aoMover);
20962
- refs3.botao.addEventListener("pointerup", aoSubir);
20963
- refs3.botao.addEventListener("pointercancel", aoSubir);
20964
- refs3.botao.addEventListener("keydown", aoTeclar);
20965
- window.addEventListener("resize", aoRedimensionar);
20987
+ refs3.button.addEventListener("pointerdown", onPointerDown);
20988
+ refs3.button.addEventListener("pointermove", onPointerMove2);
20989
+ refs3.button.addEventListener("pointerup", onPointerUp);
20990
+ refs3.button.addEventListener("pointercancel", onPointerUp);
20991
+ refs3.button.addEventListener("keydown", onKeyDown);
20992
+ window.addEventListener("resize", onResize);
20966
20993
  return () => {
20967
- refs3.botao.removeEventListener("pointerdown", aoDescer);
20968
- refs3.botao.removeEventListener("pointermove", aoMover);
20969
- refs3.botao.removeEventListener("pointerup", aoSubir);
20970
- refs3.botao.removeEventListener("pointercancel", aoSubir);
20971
- refs3.botao.removeEventListener("keydown", aoTeclar);
20972
- window.removeEventListener("resize", aoRedimensionar);
20994
+ refs3.button.removeEventListener("pointerdown", onPointerDown);
20995
+ refs3.button.removeEventListener("pointermove", onPointerMove2);
20996
+ refs3.button.removeEventListener("pointerup", onPointerUp);
20997
+ refs3.button.removeEventListener("pointercancel", onPointerUp);
20998
+ refs3.button.removeEventListener("keydown", onKeyDown);
20999
+ window.removeEventListener("resize", onResize);
20973
21000
  };
20974
21001
  }
20975
- function piscar() {
21002
+ function blink() {
20976
21003
  if (!refs2) return;
20977
- refs2.pulso.setAttribute("data-on", "true");
20978
- window.clearTimeout(timerPulso);
20979
- timerPulso = window.setTimeout(() => {
20980
- refs2 == null ? void 0 : refs2.pulso.setAttribute("data-on", "false");
21004
+ refs2.pulse.setAttribute("data-on", "true");
21005
+ window.clearTimeout(pulseTimer);
21006
+ pulseTimer = window.setTimeout(() => {
21007
+ refs2 == null ? void 0 : refs2.pulse.setAttribute("data-on", "false");
20981
21008
  }, 320);
20982
21009
  }
20983
- function atualizarContador() {
21010
+ function updateCounter() {
20984
21011
  if (!refs2) return;
20985
21012
  const total = instances.size;
20986
- const texto = total === 1 ? "1 component" : `${total} components`;
20987
- if (refs2.contador.textContent !== texto) refs2.contador.textContent = texto;
21013
+ const text = total === 1 ? "1 component" : `${total} components`;
21014
+ if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
20988
21015
  }
20989
21016
  function mountDevtoolsWidget() {
20990
- if (montado || typeof document === "undefined" || !document.body) return;
21017
+ if (mounted || typeof document === "undefined" || !document.body) return;
20991
21018
  try {
20992
- if (sessionStorage.getItem(ESCONDIDO_KEY) === "1") return;
21019
+ if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
20993
21020
  } catch (e) {
20994
21021
  }
20995
- montado = true;
21022
+ mounted = true;
20996
21023
  injectStyle("devtools-widget", WIDGET_CSS);
20997
- refs2 = construir();
20998
- const alternar = () => {
20999
- const ligado = xray();
21000
- refs2 == null ? void 0 : refs2.raiz.setAttribute("data-active", String(ligado));
21001
- refs2 == null ? void 0 : refs2.botao.setAttribute("aria-pressed", String(ligado));
21024
+ refs2 = build();
21025
+ const toggle = () => {
21026
+ const enabled2 = xray();
21027
+ refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
21028
+ refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
21002
21029
  };
21003
- desligar.push(ligarArrasto(refs2, alternar));
21004
- const aoFechar = (evento) => {
21005
- evento.stopPropagation();
21030
+ teardown2.push(enableDrag(refs2, toggle));
21031
+ const onClose = (event) => {
21032
+ event.stopPropagation();
21006
21033
  try {
21007
- sessionStorage.setItem(ESCONDIDO_KEY, "1");
21034
+ sessionStorage.setItem(HIDDEN_KEY, "1");
21008
21035
  } catch (e) {
21009
21036
  }
21010
21037
  unmountDevtoolsWidget();
21011
21038
  console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
21012
21039
  };
21013
- refs2.fechar.addEventListener("click", aoFechar);
21014
- desligar.push(() => refs2 == null ? void 0 : refs2.fechar.removeEventListener("click", aoFechar));
21015
- const aoTeclarGlobal = () => {
21016
- const ligado = isXrayEnabled();
21017
- refs2 == null ? void 0 : refs2.raiz.setAttribute("data-active", String(ligado));
21018
- refs2 == null ? void 0 : refs2.botao.setAttribute("aria-pressed", String(ligado));
21040
+ refs2.close.addEventListener("click", onClose);
21041
+ teardown2.push(() => refs2 == null ? void 0 : refs2.close.removeEventListener("click", onClose));
21042
+ const onGlobalKeyUp = () => {
21043
+ const enabled2 = isXrayEnabled();
21044
+ refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
21045
+ refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
21019
21046
  };
21020
- document.addEventListener("keyup", aoTeclarGlobal);
21021
- desligar.push(() => document.removeEventListener("keyup", aoTeclarGlobal));
21022
- for (const tipo of ["network", "event", "navigation", "update"]) {
21023
- desligar.push(devtoolsBus.on(tipo, piscar));
21047
+ document.addEventListener("keyup", onGlobalKeyUp);
21048
+ teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
21049
+ for (const type of ["network", "event", "navigation", "update"]) {
21050
+ teardown2.push(devtoolsBus.on(type, blink));
21024
21051
  }
21025
- atualizarContador();
21026
- timerContador = window.setInterval(atualizarContador, 1e3);
21052
+ updateCounter();
21053
+ counterTimer = window.setInterval(updateCounter, 1e3);
21027
21054
  }
21028
21055
  function unmountDevtoolsWidget() {
21029
- if (!montado) return;
21030
- montado = false;
21031
- for (const fn of desligar.splice(0)) {
21056
+ if (!mounted) return;
21057
+ mounted = false;
21058
+ for (const fn of teardown2.splice(0)) {
21032
21059
  try {
21033
21060
  fn();
21034
21061
  } catch (e) {
21035
21062
  }
21036
21063
  }
21037
- window.clearInterval(timerContador);
21038
- window.clearTimeout(timerPulso);
21039
- timerContador = 0;
21040
- timerPulso = 0;
21041
- refs2 == null ? void 0 : refs2.raiz.remove();
21064
+ window.clearInterval(counterTimer);
21065
+ window.clearTimeout(pulseTimer);
21066
+ counterTimer = 0;
21067
+ pulseTimer = 0;
21068
+ refs2 == null ? void 0 : refs2.root.remove();
21042
21069
  refs2 = null;
21043
21070
  }
21044
21071
  function devtoolsWidget(force) {
21045
- const alvo = force != null ? force : !montado;
21046
- if (alvo) {
21072
+ const target = force != null ? force : !mounted;
21073
+ if (target) {
21047
21074
  try {
21048
- sessionStorage.removeItem(ESCONDIDO_KEY);
21075
+ sessionStorage.removeItem(HIDDEN_KEY);
21049
21076
  } catch (e) {
21050
21077
  }
21051
21078
  mountDevtoolsWidget();
21052
21079
  } else {
21053
21080
  unmountDevtoolsWidget();
21054
21081
  }
21055
- return montado;
21082
+ return mounted;
21056
21083
  }
21057
21084
 
21058
21085
  // src/index.ts