gamestage 0.29.2 → 0.29.4

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 (2) hide show
  1. package/cli.mjs +482 -106
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -10,7 +10,7 @@
10
10
  * A single bundled file, minified. Nothing here phones home, and inspect,
11
11
  * create and manifest validate all run without an account.
12
12
  */
13
- var O$=Object.defineProperty;var g=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var nt=(e,t)=>{for(var r in t)O$(e,r,{get:t[r],enumerable:!0})};var In,Rr,ke,He,$t,se,cg,M$,z$,U$,F$,B$,ii,Et=g(()=>{"use strict";In=`/**
13
+ var G$=Object.defineProperty;var y=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var nt=(e,t)=>{for(var r in t)G$(e,r,{get:t[r],enumerable:!0})};var Cn,jr,xe,Je,Et,se,lg,H$,J$,Y$,q$,X$,si,Tt=y(()=>{"use strict";Cn=`/**
14
14
  * @monterosa/gamestage-player, bundled for a browser.
15
15
  *
16
16
  * Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
@@ -64,6 +64,9 @@ var ENDPOINTS = {
64
64
 
65
65
  // packages/player-client/src/index.ts
66
66
  var sessionKey = (game) => \`gamestage-session:\${game}\`;
67
+ function sessionTokenFor(game, storage = typeof localStorage === "undefined" ? void 0 : localStorage) {
68
+ return storage?.getItem(sessionKey(game)) ?? void 0;
69
+ }
67
70
  var path = (template, game, round) => template.replace("{game}", encodeURIComponent(game)).replace("{round}", encodeURIComponent(round ?? ""));
68
71
  function newIdempotencyKey() {
69
72
  const bytes = new Uint8Array(12);
@@ -190,9 +193,10 @@ function createPlayerClient(options) {
190
193
  export {
191
194
  PlayerApiError,
192
195
  createPlayerClient,
193
- newIdempotencyKey
196
+ newIdempotencyKey,
197
+ sessionTokenFor
194
198
  };
195
- `,Rr="c34f91fbdee09836",ke="gamestage-player.js",He=`/**
199
+ `,jr="5be55e8955e465ef",xe="gamestage-player.js",Je=`/**
196
200
  * @monterosa/gamestage, bundled for a browser.
197
201
  *
198
202
  * Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
@@ -442,6 +446,14 @@ var init_app_settings = __esm({
442
446
  description: 'A closing line on the result screen, e.g. "Can you do better?" Leave it empty and the line is not drawn.',
443
447
  readBy: "The game's own page, under the result.",
444
448
  section: "Wording"
449
+ },
450
+ {
451
+ key: "capped_today_note",
452
+ label: "When today's plays are used up",
453
+ type: "freetext",
454
+ description: "What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Leave it empty to keep the game's own words.",
455
+ readBy: "The game's own page, when the Engine refuses a play until tomorrow.",
456
+ section: "Wording"
445
457
  }
446
458
  ];
447
459
  OPTIONAL_WORDING_KEYS = OPTIONAL_WORDING_FIELDS.map((field) => field.key);
@@ -772,6 +784,7 @@ var init_app_settings = __esm({
772
784
  share_under: "shareUnder",
773
785
  result_bust_note: "resultBustNote",
774
786
  share_bust_note: "shareBustNote",
787
+ capped_today_note: "cappedTodayNote",
775
788
  share_dare: "shareDare",
776
789
  result_dare: "resultDare"
777
790
  };
@@ -6282,6 +6295,7 @@ async function readLoyalty(options) {
6282
6295
  const mine = (points.items ?? []).find(
6283
6296
  (item) => item.programmeId === options.programmeId
6284
6297
  );
6298
+ const { unlocked, stillToUnlock, catalogue } = await readAchievements(doFetch, base, headers);
6285
6299
  if (!mine) {
6286
6300
  return {
6287
6301
  kind: "standing",
@@ -6289,7 +6303,10 @@ async function readLoyalty(options) {
6289
6303
  programmeId: options.programmeId,
6290
6304
  balance: 0,
6291
6305
  enrolled: false,
6292
- statement: []
6306
+ statement: [],
6307
+ catalogue,
6308
+ unlocked,
6309
+ stillToUnlock
6293
6310
  }
6294
6311
  };
6295
6312
  }
@@ -6307,10 +6324,40 @@ async function readLoyalty(options) {
6307
6324
  tier: mine.tier,
6308
6325
  tiers: mine.tiers,
6309
6326
  enrolled: true,
6310
- statement: lines
6327
+ statement: lines,
6328
+ catalogue,
6329
+ unlocked,
6330
+ stillToUnlock
6311
6331
  }
6312
6332
  };
6313
6333
  }
6334
+ async function readAchievements(doFetch, base, headers) {
6335
+ const [rewardsRes, productsRes] = await Promise.all([
6336
+ doFetch(\`\${base}/rewards\`, { headers }).catch(() => void 0),
6337
+ doFetch(\`\${base}/products\`, { headers }).catch(() => void 0)
6338
+ ]);
6339
+ const unlocked = rewardsRes?.ok ? ((await rewardsRes.json()).items ?? []).map((item) => ({
6340
+ instanceId: item.instance.instanceId,
6341
+ product: {
6342
+ productId: item.instance.product.productId,
6343
+ name: item.instance.product.name,
6344
+ description: item.instance.product.description,
6345
+ type: item.instance.product.type
6346
+ },
6347
+ campaignName: item.campaign?.name,
6348
+ awardedAt: item.awardedAt
6349
+ })) : [];
6350
+ const catalogue = productsRes?.ok ? (await productsRes.json()).items ?? [] : [];
6351
+ const heldIds = new Set(unlocked.map((one) => one.product.productId));
6352
+ const inOrder = catalogue.map((product) => ({
6353
+ productId: product.productId,
6354
+ name: product.name,
6355
+ description: product.description,
6356
+ type: product.type
6357
+ }));
6358
+ const stillToUnlock = inOrder.filter((product) => !heldIds.has(product.productId));
6359
+ return { unlocked, stillToUnlock, catalogue: inOrder };
6360
+ }
6314
6361
 
6315
6362
  // packages/gamestage/src/streak.ts
6316
6363
  function dayIn(iso, timeZone) {
@@ -6419,10 +6466,12 @@ function localeFor(ids2, navigatorLike = globalThis.navigator) {
6419
6466
  const language = asked.trim().split(/[-_]/)[0].toLowerCase();
6420
6467
  return language || void 0;
6421
6468
  }
6469
+ var PLATFORM_LOOKUP_DEADLINE_MS = 3e4;
6422
6470
  async function askForPlatformIds(api, game, fetchImpl) {
6423
6471
  const url = \`\${api.replace(/\\/+$/, "")}/public/v1/platform/\${encodeURIComponent(game)}\`;
6424
6472
  try {
6425
- const response = await fetchImpl(url);
6473
+ const cutoff = AbortSignal.timeout ? AbortSignal.timeout(PLATFORM_LOOKUP_DEADLINE_MS) : void 0;
6474
+ const response = await fetchImpl(url, cutoff ? { signal: cutoff } : void 0);
6426
6475
  if (!response.ok) {
6427
6476
  return {
6428
6477
  because: response.status === 404 ? \`\${game} is not on Interaction Cloud: the control plane answered 404.\` : \`asking for this game's platform ids answered \${response.status}.\`
@@ -6439,8 +6488,9 @@ async function askForPlatformIds(api, game, fetchImpl) {
6439
6488
  }
6440
6489
  return { host, projectId, name };
6441
6490
  } catch (cause) {
6491
+ const timedOut = cause instanceof Error && (cause.name === "TimeoutError" || cause.name === "AbortError");
6442
6492
  return {
6443
- because: \`asking for this game's platform ids failed: \${cause instanceof Error ? cause.message : String(cause)}\`
6493
+ because: timedOut ? \`the control plane did not answer within \${PLATFORM_LOOKUP_DEADLINE_MS / 1e3}s, so this page is playing the round without a Studio connection. A producer's words and live updates will reach the next load.\` : \`asking for this game's platform ids failed: \${cause instanceof Error ? cause.message : String(cause)}\`
6444
6494
  };
6445
6495
  }
6446
6496
  }
@@ -6465,6 +6515,11 @@ async function platformFor(globals4, search, options) {
6465
6515
  } else if ((!host || !projectId) && globals4.GAMESTAGE_IC_LOOKUP) {
6466
6516
  because = "this page carries no Interaction Cloud ids and no API to ask for them.";
6467
6517
  }
6518
+ if ((!host || !projectId) && globals4.GAMESTAGE_IC_LOOKUP) {
6519
+ throw new Error(
6520
+ because ?? "this game could not reach Interaction Cloud and there is no reason recorded."
6521
+ );
6522
+ }
6468
6523
  if (!host || !projectId) {
6469
6524
  return { deployedName, projectId, platform: createLocalPlatform({
6470
6525
  pollMilliseconds: 5e3,
@@ -6649,6 +6704,7 @@ async function start(options = {}) {
6649
6704
  analytics,
6650
6705
  now: () => platform.clock.now(),
6651
6706
  deployedName,
6707
+ offPlatformReason: platform.offPlatformReason,
6652
6708
  get identity() {
6653
6709
  return identity;
6654
6710
  },
@@ -6787,7 +6843,7 @@ export {
6787
6843
  streakFrom,
6788
6844
  tokenOf
6789
6845
  };
6790
- `,$t="5188d17d2f4b1dba",se="gamestage.js",cg="0.40.0",M$=`<!doctype html>
6846
+ `,Et="13be8274feecb21d",se="gamestage.js",lg="0.46.0",H$=`<!doctype html>
6791
6847
  <html lang="en">
6792
6848
  <head>
6793
6849
  <meta charset="utf-8" />
@@ -7043,7 +7099,7 @@ async function main() {
7043
7099
  // page that answered 200 to every check we had.
7044
7100
  if (game.platform === "local" && !developing) {
7045
7101
  connectionNotice(
7046
- "This game is not connected to Interaction Cloud. It is playable, but a producer's changes will not reach it.",
7102
+ "Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again.",
7047
7103
  );
7048
7104
  }
7049
7105
 
@@ -7151,7 +7207,7 @@ main().catch((error) => {
7151
7207
  </script>
7152
7208
  </body>
7153
7209
  </html>
7154
- `,z$=`<!doctype html>
7210
+ `,J$=`<!doctype html>
7155
7211
  <html lang="en">
7156
7212
  <head>
7157
7213
  <meta charset="utf-8" />
@@ -7469,7 +7525,7 @@ async function main() {
7469
7525
  // page that answered 200 to every check we had.
7470
7526
  if (game.platform === "local" && !developing) {
7471
7527
  connectionNotice(
7472
- "This game is not connected to Interaction Cloud. It is playable, but a producer's changes will not reach it.",
7528
+ "Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again.",
7473
7529
  );
7474
7530
  }
7475
7531
 
@@ -7564,7 +7620,7 @@ main().catch((error) => {
7564
7620
  </script>
7565
7621
  </body>
7566
7622
  </html>
7567
- `,U$=`<!doctype html>
7623
+ `,Y$=`<!doctype html>
7568
7624
  <html lang="en">
7569
7625
  <head>
7570
7626
  <meta charset="utf-8" />
@@ -7916,7 +7972,7 @@ async function main() {
7916
7972
  // page that answered 200 to every check we had.
7917
7973
  if (game.platform === "local" && !developing) {
7918
7974
  connectionNotice(
7919
- "This game is not connected to Interaction Cloud. It is playable, but a producer's changes will not reach it.",
7975
+ "Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again.",
7920
7976
  );
7921
7977
  }
7922
7978
 
@@ -8031,7 +8087,7 @@ main().catch((error) => {
8031
8087
  </script>
8032
8088
  </body>
8033
8089
  </html>
8034
- `,F$=`<!doctype html>
8090
+ `,q$=`<!doctype html>
8035
8091
  <html lang="en">
8036
8092
  <head>
8037
8093
  <meta charset="utf-8" />
@@ -8292,7 +8348,7 @@ async function main() {
8292
8348
  // page that answered 200 to every check we had.
8293
8349
  if (game.platform === "local" && !developing) {
8294
8350
  connectionNotice(
8295
- "This game is not connected to Interaction Cloud. It is playable, but a producer's changes will not reach it.",
8351
+ "Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again.",
8296
8352
  );
8297
8353
  }
8298
8354
 
@@ -8396,7 +8452,7 @@ main().catch((error) => {
8396
8452
  </script>
8397
8453
  </body>
8398
8454
  </html>
8399
- `,B$=`<!doctype html>
8455
+ `,X$=`<!doctype html>
8400
8456
  <html lang="en">
8401
8457
  <head>
8402
8458
  <meta charset="utf-8" />
@@ -8436,6 +8492,82 @@ main().catch((error) => {
8436
8492
  .cell.centre { border-style: dashed; color: var(--muted); }
8437
8493
  .cell.centre.chosen { border-style: solid; color: var(--text); }
8438
8494
  .centre-picker { display: flex; flex-wrap: wrap; gap: 8px; }
8495
+ /* Only a card a producer has explained is tappable, so the cursor appears
8496
+ exactly where a tap does something. */
8497
+ .cell[role="button"] { cursor: pointer; }
8498
+ .cell[role="button"]:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
8499
+ /* The back of a card: a sentence rather than a label, so it is lighter,
8500
+ smaller and left-aligned, and it scrolls rather than bursting the grid. */
8501
+ /* A card that came in. Red is "a tally running now", which is what this is. */
8502
+ .cell[data-mark="correct"] {
8503
+ background: var(--red); border-color: var(--red); color: #fff; font-weight: 700;
8504
+ }
8505
+ /* One that did not. Faded rather than struck through: it is still a card on
8506
+ their board and it still says what it says, it just cannot help now. */
8507
+ .cell[data-mark="incorrect"] { opacity: .4; }
8508
+ /* A free centre is not a card that came in and must not look like one: it
8509
+ was red before kick-off and nothing in the match earned it. Tint and
8510
+ outline rather than fill, so it reads as "yours already" and stops
8511
+ competing with the cards a fan is watching. Tom, 2026-08-28. */
8512
+ .cell.centre[data-mark="correct"] {
8513
+ background: color-mix(in srgb, var(--red) 12%, var(--surface));
8514
+ border-color: var(--red); color: var(--red);
8515
+ }
8516
+ /* The card a fan is waiting on. A steady outline rather than a pulse: a
8517
+ nine-cell grid with something throbbing in it is a page a fan closes. */
8518
+ .cell[data-awaited] {
8519
+ border-color: var(--red); border-width: 2.5px;
8520
+ }
8521
+ /* A line that has landed, lifted clear of the cards that merely came in. */
8522
+ .cell[data-in-line] { box-shadow: inset 0 0 0 2px #fff; }
8523
+ /* A card turning over. GS-419. A half turn each way: to edge-on, where the
8524
+ words are swapped, and back. \`TURN_MS\` below is this duration and the
8525
+ swap happens at its midpoint, so the two have to stay in step.
8526
+ \`perspective\` is on the transform rather than the parent, because a
8527
+ perspective on the grid would give nine cells one vanishing point and the
8528
+ corner cards would look bent. */
8529
+ @keyframes turn {
8530
+ 0% { transform: perspective(600px) rotateY(0deg); }
8531
+ 50% { transform: perspective(600px) rotateY(90deg); }
8532
+ 100% { transform: perspective(600px) rotateY(0deg); }
8533
+ }
8534
+ .cell[data-turning] { animation: turn 320ms ease-in-out; z-index: 1; }
8535
+ /* The line above a board a fan is watching. GS-419. Quiet by default: a fan
8536
+ spends most of a match with nothing on their board, and a status line
8537
+ that shouted for ninety minutes would stop being read. It earns colour
8538
+ only at the two moments that deserve it. */
8539
+ .watch {
8540
+ display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
8541
+ margin: 0 0 12px; padding: 10px 14px;
8542
+ border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
8543
+ font-size: 14px; color: var(--muted);
8544
+ }
8545
+ .watch[hidden] { display: none; }
8546
+ .watch strong { font-size: 15px; color: var(--text); }
8547
+ .watch[data-close], .watch[data-landed] { border-color: #d81f2a; }
8548
+ .watch[data-close] strong, .watch[data-landed] strong { color: #d81f2a; }
8549
+ /* The confetti a landed line earns. GS-419. Tom named the condition
8550
+ himself: when you get one right. On the line rather than the card,
8551
+ because a card comes in four or five times a match and a line is the
8552
+ moment the game pays out. */
8553
+ .confetti { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
8554
+ .confetti span {
8555
+ position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
8556
+ background: #d81f2a; animation: fall 1.6s cubic-bezier(.3,.7,.6,1) forwards;
8557
+ }
8558
+ .confetti span:nth-child(3n) { background: var(--text); }
8559
+ @keyframes fall {
8560
+ 0% { opacity: 1; translate: 0 0; rotate: 0deg; }
8561
+ 100% { opacity: 0; translate: 0 100vh; rotate: 540deg; }
8562
+ }
8563
+ @media (prefers-reduced-motion: reduce) {
8564
+ .cell[data-turning] { animation: none; }
8565
+ }
8566
+ .cell[data-flipped] {
8567
+ align-items: flex-start; justify-content: flex-start; text-align: left;
8568
+ font-size: 11px; font-weight: 400; line-height: 1.3;
8569
+ color: var(--muted); overflow-y: auto;
8570
+ }
8439
8571
  /* Which board of how many, and a step either way. A sentence rather than a
8440
8572
  row of dots: a fan cannot count dots at a glance and a screen reader
8441
8573
  reads them as nothing. */
@@ -8495,6 +8627,13 @@ main().catch((error) => {
8495
8627
  -->
8496
8628
  <p class="notice" id="connection" role="status" aria-live="polite" hidden></p>
8497
8629
 
8630
+ <!-- What is happening while a fan waits. GS-419. The waiting state is the
8631
+ game: a fan locks a board and then watches it for ninety minutes, and
8632
+ until this line existed the only thing that ever happened was a cell
8633
+ quietly changing colour. Three facts, all off the Engine's own marks
8634
+ and lines, so nothing here can say something the scoring does not.
8635
+ \`role="status"\` so a fan not looking at the screen is told. -->
8636
+ <p class="watch" id="watch" role="status" hidden></p>
8498
8637
  <div class="board" id="board"></div>
8499
8638
 
8500
8639
  <!-- Shown only while the centre is a choice and none has been made yet. -->
@@ -8511,9 +8650,8 @@ main().catch((error) => {
8511
8650
 
8512
8651
  <div class="actions">
8513
8652
  <button class="secondary" id="shuffle" hidden>Deal my boards</button>
8514
- <button class="primary" id="lock" disabled hidden>Lock in this board</button>
8653
+ <button class="primary" id="lock" disabled hidden>Back this board</button>
8515
8654
  <span class="state">
8516
- <span>Reshuffles <b id="attempts">0</b></span>
8517
8655
  <span>Score <b id="score">0</b></span>
8518
8656
  </span>
8519
8657
  </div>
@@ -8521,9 +8659,8 @@ main().catch((error) => {
8521
8659
  <p class="verdict" id="verdict"></p>
8522
8660
 
8523
8661
  <footer>
8524
- The pool every board is dealt from, and which cards turn out correct, live
8525
- on the Gamestage Engine. This page holds neither: it sends a reshuffle or a
8526
- lock and renders what the server committed.
8662
+ Nothing to mark off: cards tick themselves as they come in. Your board is
8663
+ locked once you back it, and it keeps filling until full time.
8527
8664
  </footer>
8528
8665
  </main>
8529
8666
 
@@ -8551,6 +8688,32 @@ import { applyPresentation, start } from "./gamestage.js";
8551
8688
  const el = (id) => document.getElementById(id);
8552
8689
  let chosenCentre;
8553
8690
  let finished = false;
8691
+ /**
8692
+ * The Engine's verdict, or \`pending\` while the world is still deciding.
8693
+ *
8694
+ * Held because the watch line belongs to the pending state and to no other:
8695
+ * once the outcome settles the verdict says what happened, and a line above
8696
+ * the board still reading "Your board is live" would be the page
8697
+ * contradicting itself at the moment a fan reads it most carefully.
8698
+ */
8699
+ let outcome;
8700
+ /** How long a card takes to turn over. Matches the \`turn\` keyframes above. */
8701
+ const TURN_MS = 320;
8702
+ /** How long the confetti stays up, and how many pieces fall. */
8703
+ const CELEBRATION_MS = 1600;
8704
+ const CONFETTI_PIECES = 24;
8705
+ /** How often a locked board asks whether the match has decided anything. */
8706
+ const PENDING_POLL_MS = 5000;
8707
+ /**
8708
+ * How many lines had landed last time the board was drawn. GS-419.
8709
+ *
8710
+ * **A transition, never a state.** The page re-reads state while the outcome
8711
+ * is pending, so celebrating "a line is complete" would celebrate on every
8712
+ * read, and a fan reloading a finished board would arrive into confetti for
8713
+ * something that happened an hour ago. \`undefined\` means nothing has been
8714
+ * seen yet, so the first read only records.
8715
+ */
8716
+ let seenLines;
8554
8717
  let game;
8555
8718
  let currentState;
8556
8719
  /**
@@ -8628,9 +8791,20 @@ function layout(challenge, board) {
8628
8791
 
8629
8792
  function renderState(state) {
8630
8793
  if (!state) return;
8631
- el("attempts").textContent = \`\${state.attempts_used}/\${state.attempts_allowed ?? "-"}\`;
8794
+ /**
8795
+ * No attempts counter, because a carousel has nothing to count. GS-311.
8796
+ *
8797
+ * It said "Reshuffles 0" and then, once the carousel spent the allowance in
8798
+ * one deal, "Reshuffles 3" on a board a fan had only just been given: a
8799
+ * true number telling them they were out of goes before they had taken
8800
+ * one. The count a fan needs here is which board of how many, and the
8801
+ * carousel says that in words under the grid.
8802
+ *
8803
+ * Removed from the markup too, so this is not a write to a missing element.
8804
+ */
8632
8805
  el("score").textContent = state.score;
8633
8806
  finished = Boolean(state.finished);
8807
+ outcome = state.outcome;
8634
8808
 
8635
8809
  if (finished) {
8636
8810
  el("shuffle").hidden = true;
@@ -8641,8 +8815,17 @@ function renderState(state) {
8641
8815
  // the game rather than by a test, because both halves looked right on
8642
8816
  // their own and only the order of two calls put them together wrongly.
8643
8817
  el("carousel").hidden = true;
8818
+ /**
8819
+ * The pending case moved to the watch line above the board. GS-419.
8820
+ *
8821
+ * "Locked in. Waiting for the pool's own result." was true and it was the
8822
+ * whole of the ninety minutes a fan spends here: one sentence that never
8823
+ * changed while their board filled up behind it. The watch line says how
8824
+ * many of their cards have been called and whether they are one away,
8825
+ * which is the same moment described by something that moves.
8826
+ */
8644
8827
  el("verdict").textContent =
8645
- state.outcome === "pending" ? "Locked in. Waiting for the pool's own result." :
8828
+ state.outcome === "pending" ? "" :
8646
8829
  state.outcome === "won" ? "A line came in. That is the server's word for it, not this page's." :
8647
8830
  "No line came in. The Engine decided that, not the browser.";
8648
8831
  }
@@ -8650,11 +8833,50 @@ function renderState(state) {
8650
8833
 
8651
8834
  function renderBoard() {
8652
8835
  const challenge = game.round.challenge;
8653
- el("prompt").textContent = challenge.prompt || "Fill a line before the pool decides.";
8836
+ /**
8837
+ * The producer's line, or a default that says what to do. GS-311.
8838
+ *
8839
+ * "Fill a line before the pool decides" was the old one and Tom was right
8840
+ * that it makes no sense: a fan fills nothing, the match does, and "the
8841
+ * pool" is our word for a thing they never see. What a fan actually does
8842
+ * here is choose between boards.
8843
+ */
8844
+ el("prompt").textContent =
8845
+ challenge.prompt ||
8846
+ "Pick the board you fancy. It marks itself as things happen in the match.";
8654
8847
 
8655
8848
  const progress = currentState?.progress ?? {};
8656
8849
  /** The words for this fan's own dealt cards, keyed by card id. */
8657
8850
  const words = progress.cards ?? {};
8851
+ /**
8852
+ * What each card means, where a producer has explained it. GS-311.
8853
+ *
8854
+ * Tapping a card turns it over to show this. A card nobody has explained
8855
+ * does not turn over, rather than flipping to an empty back and teaching a
8856
+ * fan the gesture is broken.
8857
+ */
8858
+ const notes = progress.notes ?? {};
8859
+ /**
8860
+ * Which of this fan's own cards have come in, and how their lines stand.
8861
+ *
8862
+ * **The half that makes a board worth watching**, and this page did not
8863
+ * draw it until 2026-08-27: the Engine had computed marks and lines since
8864
+ * the day before, and the React taster rendered them, so a fan on the
8865
+ * playground watched nine identical cells and a score that changed for
8866
+ * reasons they could not see. Two readers of one shape, and only one of
8867
+ * them had been taught the new half.
8868
+ *
8869
+ * The Engine's word on both. A page working out its own lines would put
8870
+ * the scoring rule in two places, and the one that scores is the Engine's.
8871
+ */
8872
+ const marks = progress.marks ?? {};
8873
+ const lines = Array.isArray(progress.lines) ? progress.lines : [];
8874
+ /** Cards in a line that has come in, so the whole line can light up. */
8875
+ const inLine = new Set(lines.filter((l) => l.complete).flatMap((l) => l.cards));
8876
+ /** And the one card a fan is waiting on, which is the feeling this game sells. */
8877
+ const awaited = new Set(
8878
+ lines.filter((l) => l.oneAway).flatMap((l) => l.cards.filter((k) => marks[k] === undefined)),
8879
+ );
8658
8880
  /**
8659
8881
  * Every board this fan was offered. The Engine deals them all at once and a
8660
8882
  * fan swipes between them, rather than rerolling one hand at a time: an
@@ -8669,6 +8891,58 @@ function renderBoard() {
8669
8891
  : Math.min(at, Math.max(0, boards.length - 1));
8670
8892
  const board = { board: boards[showing], centre: progress.centre };
8671
8893
 
8894
+ /**
8895
+ * The watch line, and the confetti a landed line earns. GS-419.
8896
+ *
8897
+ * Three states of one sentence and the strongest true one wins: a line has
8898
+ * landed, they are one card away, or the match is simply still going. All
8899
+ * three off the Engine's own marks and lines.
8900
+ *
8901
+ * "Called" rather than "decided", because it is the word a bingo player
8902
+ * already has for a card the caller has read out.
8903
+ */
8904
+ const own = boards[showing] ?? [];
8905
+ const called = own.filter((key) => marks[key] !== undefined).length;
8906
+ const completeLines = lines.filter((l) => l.complete).length;
8907
+ const oneAway = lines.some((l) => l.oneAway);
8908
+ const watch = el("watch");
8909
+ const watching = finished && outcome === "pending";
8910
+ watch.hidden = !watching;
8911
+ if (watching) {
8912
+ watch.toggleAttribute("data-landed", completeLines > 0);
8913
+ watch.toggleAttribute("data-close", completeLines === 0 && oneAway);
8914
+ watch.replaceChildren();
8915
+ const said = document.createElement("strong");
8916
+ said.textContent =
8917
+ completeLines > 0 ? "You have a line" : oneAway ? "One to go" : "Your board is live";
8918
+ const count = document.createElement("span");
8919
+ count.textContent = \`\${called} of \${own.length} called\`;
8920
+ watch.append(said, count);
8921
+ }
8922
+
8923
+ // A line landing is worth confetti, and nothing else is: see \`seenLines\`.
8924
+ const before = seenLines;
8925
+ seenLines = completeLines;
8926
+ if (
8927
+ before !== undefined &&
8928
+ completeLines > before &&
8929
+ !matchMedia("(prefers-reduced-motion: reduce)").matches
8930
+ ) {
8931
+ const shower = document.createElement("div");
8932
+ shower.className = "confetti";
8933
+ // Hidden from a screen reader: the line above already said what happened
8934
+ // and the pieces have nothing to add to it.
8935
+ shower.setAttribute("aria-hidden", "true");
8936
+ for (let piece = 0; piece < CONFETTI_PIECES; piece++) {
8937
+ const bit = document.createElement("span");
8938
+ bit.style.left = \`\${(piece * 100) / CONFETTI_PIECES}%\`;
8939
+ bit.style.animationDelay = \`\${(piece % 6) * 60}ms\`;
8940
+ shower.append(bit);
8941
+ }
8942
+ document.body.append(shower);
8943
+ setTimeout(() => shower.remove(), CELEBRATION_MS);
8944
+ }
8945
+
8672
8946
  el("board").style.gridTemplateColumns = \`repeat(\${challenge.columns}, 1fr)\`;
8673
8947
  el("board").replaceChildren(
8674
8948
  ...layout(challenge, dealt ? board : undefined).map(({ centre, key }) => {
@@ -8686,9 +8960,77 @@ function renderBoard() {
8686
8960
  * board dealt by an older Engine legible rather than blank.
8687
8961
  */
8688
8962
  const word = key === undefined ? undefined : (words[key] ?? key);
8689
- cell.textContent = centre
8963
+ const face = centre
8690
8964
  ? (word ?? (challenge.centre_mode === "free" ? "FREE" : "?"))
8691
8965
  : (word ?? "");
8966
+ cell.textContent = face;
8967
+
8968
+ /**
8969
+ * How this card turned out, and whether it is the one being waited on.
8970
+ *
8971
+ * A free centre counts as in from the moment it is dealt: it is marked
8972
+ * for everybody, and a board showing eight cards come in around a blank
8973
+ * middle would read as broken.
8974
+ */
8975
+ const mark =
8976
+ // Only once there is a board: an undealt grid is the round's shape
8977
+ // with nothing in it, and a centre already wearing the brand colour
8978
+ // there says a square is a fan's before they have one.
8979
+ dealt && centre && key === undefined && challenge.centre_mode === "free"
8980
+ ? "correct"
8981
+ : key !== undefined
8982
+ ? marks[key]
8983
+ : undefined;
8984
+ if (mark) cell.dataset.mark = mark;
8985
+ if (key !== undefined && inLine.has(key)) cell.dataset.inLine = "true";
8986
+ if (key !== undefined && awaited.has(key)) cell.dataset.awaited = "true";
8987
+
8988
+ // Only a card with something to say becomes a button. A control that
8989
+ // does nothing teaches a fan the gesture is broken.
8990
+ const note = key === undefined ? undefined : notes[key];
8991
+ if (note) {
8992
+ cell.setAttribute("role", "button");
8993
+ cell.tabIndex = 0;
8994
+ cell.setAttribute("aria-pressed", "false");
8995
+ /**
8996
+ * Turn the card over, and let the rotation carry the change. GS-419.
8997
+ *
8998
+ * The words change at the halfway point, where the card is edge-on
8999
+ * and nobody can read either face. Swapping at either end is what
9000
+ * this did before, and it read as a cell that had reloaded rather
9001
+ * than a card that had turned.
9002
+ *
9003
+ * A half turn each way rather than a full 180: a full one needs two
9004
+ * faces stacked with \`backface-visibility\`, which means moving the
9005
+ * card's background, border and every mark colour off the cell and
9006
+ * onto a face. A fan sees the same rotation either way.
9007
+ */
9008
+ const swap = () => {
9009
+ const showing = cell.dataset.flipped === "true";
9010
+ if (showing) cell.removeAttribute("data-flipped");
9011
+ else cell.dataset.flipped = "true";
9012
+ cell.textContent = showing ? face : note;
9013
+ cell.setAttribute("aria-pressed", String(!showing));
9014
+ };
9015
+ const turn = () => {
9016
+ // Reduced motion gets the swap and no rotation, rather than no flip
9017
+ // at all: the fan still asked what the card means.
9018
+ if (matchMedia("(prefers-reduced-motion: reduce)").matches) {
9019
+ swap();
9020
+ return;
9021
+ }
9022
+ cell.dataset.turning = "true";
9023
+ setTimeout(swap, TURN_MS / 2);
9024
+ setTimeout(() => cell.removeAttribute("data-turning"), TURN_MS);
9025
+ };
9026
+ cell.onclick = turn;
9027
+ cell.onkeydown = (event) => {
9028
+ // Enter and Space, because a button answers to both.
9029
+ if (event.key !== "Enter" && event.key !== " ") return;
9030
+ event.preventDefault();
9031
+ turn();
9032
+ };
9033
+ }
8692
9034
  return cell;
8693
9035
  }),
8694
9036
  );
@@ -8781,7 +9123,7 @@ async function main() {
8781
9123
 
8782
9124
  if (game.platform === "local" && !developing) {
8783
9125
  connectionNotice(
8784
- "This game is not connected to Interaction Cloud. It is playable, but a producer's changes will not reach it.",
9126
+ "Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again.",
8785
9127
  );
8786
9128
  }
8787
9129
 
@@ -8804,6 +9146,33 @@ async function main() {
8804
9146
  renderBoard();
8805
9147
 
8806
9148
  game.track("round_opened", { round: game.round.number ?? null });
9149
+
9150
+ /**
9151
+ * While the world is still deciding, keep asking. GS-419.
9152
+ *
9153
+ * **This page read state once and never again, so a live board could not be
9154
+ * watched here at all.** The React taster has polled since GS-311 and this
9155
+ * one did not, which is the fourth time this scaffold has lagged the board
9156
+ * beside it: it lagged on \`progress.boards\`, on the flip, and on marks, and
9157
+ * each time the two halves looked right on their own.
9158
+ *
9159
+ * Bingo is the only format that needs it. Every other one settles on the
9160
+ * play that finishes it, so its outcome is never \`pending\` and this loop
9161
+ * never starts. It stops the moment the outcome settles, so a fan who
9162
+ * watches to full time leaves no timer running behind them.
9163
+ */
9164
+ setInterval(async () => {
9165
+ if (!finished || outcome !== "pending") return;
9166
+ try {
9167
+ currentState = await game.client.getRoundState(game.round.id);
9168
+ renderState(currentState);
9169
+ renderBoard();
9170
+ } catch (error) {
9171
+ // A read that fails leaves the last known state on screen and tries
9172
+ // again on the next tick. A board that blanked because one request
9173
+ // missed would be worse than a board a few seconds stale.
9174
+ }
9175
+ }, PENDING_POLL_MS);
8807
9176
  }
8808
9177
 
8809
9178
  el("shuffle").onclick = () => operate("deal");
@@ -8836,8 +9205,11 @@ addEventListener("online", async () => {
8836
9205
  try {
8837
9206
  if (game?.round) {
8838
9207
  currentState = await game.client.getRoundState(game.round.id);
8839
- renderBoard();
9208
+ // State before board, the same order the other three call sites use and
9209
+ // for the same reason: \`renderBoard\` reads \`finished\` and \`outcome\`, so
9210
+ // rendering it first draws the previous read's answer.
8840
9211
  renderState(currentState);
9212
+ renderBoard();
8841
9213
  }
8842
9214
  connectionNotice(null);
8843
9215
  } catch (error) {
@@ -8851,54 +9223,54 @@ main().catch((error) => {
8851
9223
  </script>
8852
9224
  </body>
8853
9225
  </html>
8854
- `,ii={hunt:M$,push:z$,group:U$,predict:F$,bingo:B$}});function lg(e){Pn=e}function j(){return Pn}function ai(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=e[1]??"";if(/[\\/]_npx[\\/]/.test(r))return"npx gamestage";let o=r.split(/[\\/]/).pop()??"";return o==="gamestage.mjs"||o==="cli.mjs"?`node ${o}`:"gamestage"}function Ge(e){return`${ai()} ${e}`}function K$(e){let t=ai();return t==="gamestage"?e:e.replace(Z$,(r,o,n)=>W$.includes(o)?`\`${t} ${o}${n}\``:r)}function y(e=""){Pn||process.stdout.write(K$(e)+`
8855
- `)}function R(e){y(),y($.bold(e))}function S(e,t="-"){y(` ${$.dim(t)} ${e}`)}function P(e,t){y(` ${$.dim(e.padEnd(18))} ${t}`)}function U(e){Pn&&process.stdout.write(JSON.stringify(e,null,2)+`
8856
- `)}function O(e,t){if(Pn)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
9226
+ `,si={hunt:H$,push:J$,group:Y$,predict:q$,bingo:X$}});function dg(e){On=e}function j(){return On}function ci(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=e[1]??"";if(/[\\/]_npx[\\/]/.test(r))return"npx gamestage";let o=r.split(/[\\/]/).pop()??"";return o==="gamestage.mjs"||o==="cli.mjs"?`node ${o}`:"gamestage"}function Pe(e){return`${ci()} ${e}`}function nE(e){let t=ci();return t==="gamestage"?e:e.replace(tE,(r,o,n)=>eE.includes(o)?`\`${t} ${o}${n}\``:r)}function g(e=""){On||process.stdout.write(nE(e)+`
9227
+ `)}function N(e){g(),g($.bold(e))}function S(e,t="-"){g(` ${$.dim(t)} ${e}`)}function P(e,t){g(` ${$.dim(e.padEnd(18))} ${t}`)}function U(e){On&&process.stdout.write(JSON.stringify(e,null,2)+`
9228
+ `)}function O(e,t){if(On)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
8857
9229
  `);else{process.stderr.write(`${$.red("Error")} ${e}
8858
9230
  `);for(let r of t??[])process.stderr.write(` ${r}
8859
- `)}process.exit(1)}var Pn,G$,Cn,$,W$,Z$,de=g(()=>{"use strict";Pn=!1;G$=()=>!Pn&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,Cn=(e,t)=>G$()?`\x1B[${e}m${t}\x1B[0m`:t,$={bold:e=>Cn("1",e),dim:e=>Cn("2",e),red:e=>Cn("31",e),green:e=>Cn("32",e),yellow:e=>Cn("33",e),cyan:e=>Cn("36",e)};W$=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","start","status","suggest","suspend","verify","wake","whoami"],Z$=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});function nn(e,t={}){let r=e?.trim()||On;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var On,Dr=g(()=>{"use strict";On="Round"});function Je(e){return tE[e]??e}function pg(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=Je(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var tE,sc,mg,Tt=g(()=>{"use strict";tE={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};sc={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element"},mg={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo"}});function v(e,t,r){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let d=a.prototype,u=Object.keys(d);for(let p=0;p<u.length;p++){let m=u[p];m in s||(s[m]=d[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let d=r?.Parent?new i:this;o(d,s),(l=d._zod).deferred??(l.deferred=[]);for(let u of d._zod.deferred)u();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function ne(e){return e&&Object.assign(rn,e),rn}var hg,cc,lc,Ye,At,rn,on=g(()=>{cc=Object.freeze({status:"aborted"});lc=Symbol("zod_brand"),Ye=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},At=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(hg=globalThis).__zod_globalConfig??(hg.__zod_globalConfig={});rn=globalThis.__zod_globalConfig});var I={};nt(I,{BIGINT_FORMAT_RANGES:()=>bc,Class:()=>uc,NUMBER_FORMAT_RANGES:()=>vc,aborted:()=>Ot,allowsEval:()=>hc,assert:()=>aE,assertEqual:()=>nE,assertIs:()=>oE,assertNever:()=>iE,assertNotEqual:()=>rE,assignProp:()=>Ct,base64ToUint8Array:()=>gg,base64urlToUint8Array:()=>xE,cached:()=>Rn,captureStackTrace:()=>ci,cleanEnum:()=>kE,cleanRegex:()=>Mr,clone:()=>xe,cloneDef:()=>cE,createTransparentProxy:()=>hE,defineLazy:()=>W,esc:()=>si,escapeRegex:()=>We,explicitlyAborted:()=>_c,extend:()=>yE,finalizeIssue:()=>Se,floatSafeRemainder:()=>pc,getElementAtPath:()=>lE,getEnumValues:()=>jr,getLengthableOrigin:()=>Fr,getParsedType:()=>mE,getSizableOrigin:()=>Ur,hexToUint8Array:()=>$E,isObject:()=>an,isPlainObject:()=>Pt,issue:()=>Dn,joinValues:()=>_,jsonStringifyReplacer:()=>Nn,merge:()=>bE,mergeDefs:()=>mt,normalizeParams:()=>C,nullish:()=>It,numKeys:()=>pE,objectClone:()=>sE,omit:()=>gE,optionalKeys:()=>yc,parsedType:()=>A,partial:()=>_E,pick:()=>fE,prefixIssues:()=>Ce,primitiveTypes:()=>gc,promiseAllObject:()=>dE,propertyKeyTypes:()=>zr,randomString:()=>uE,required:()=>wE,safeExtend:()=>vE,shallowClone:()=>fc,slugify:()=>mc,stringifyPrimitive:()=>E,uint8ArrayToBase64:()=>yg,uint8ArrayToBase64url:()=>SE,uint8ArrayToHex:()=>EE,unwrapMessage:()=>Lr});function nE(e){return e}function rE(e){return e}function oE(e){}function iE(e){throw new Error("Unexpected value in exhaustive check")}function aE(e){}function jr(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function _(e,t="|"){return e.map(r=>E(r)).join(t)}function Nn(e,t){return typeof t=="bigint"?t.toString():t}function Rn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function It(e){return e==null}function Mr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function pc(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function W(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==fg)return o===void 0&&(o=fg,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function sE(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ct(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function mt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function cE(e){return mt(e._zod.def)}function lE(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function dE(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function uE(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function si(e){return JSON.stringify(e)}function mc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function an(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pt(e){if(an(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(an(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function fc(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function pE(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function We(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function C(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function hE(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function E(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function fE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=mt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Ct(this,"shape",a),a},checks:[]});return xe(e,i)}function gE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=mt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Ct(this,"shape",a),a},checks:[]});return xe(e,i)}function yE(e,t){if(!Pt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=mt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ct(this,"shape",i),i}});return xe(e,n)}function vE(e,t){if(!Pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=mt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ct(this,"shape",o),o}});return xe(e,r)}function bE(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=mt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Ct(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return xe(e,r)}function _E(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=mt(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(l[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)l[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return Ct(this,"shape",l),l},checks:[]});return xe(t,a)}function wE(e,t,r){let o=mt(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Ct(this,"shape",i),i}});return xe(t,o)}function Ot(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function _c(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Lr(e){return typeof e=="string"?e:e?.message}function Se(e,t,r){let o=e.message?e.message:Lr(e.inst?._zod.def?.error?.(e))??Lr(t?.error?.(e))??Lr(r.customError?.(e))??Lr(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Ur(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Fr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function A(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Dn(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function kE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function gg(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function yg(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function xE(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return gg(t+r)}function SE(e){return yg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $E(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function EE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var fg,ci,hc,mE,zr,gc,vc,bc,uc,M=g(()=>{on();fg=Symbol("evaluating");ci="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};hc=Rn(()=>{if(rn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});mE=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},zr=new Set(["string","number","symbol"]),gc=new Set(["string","number","bigint","boolean","symbol","undefined"]);vc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};uc=class{constructor(...t){}}});function Gr(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Wr(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,d=0;for(;d<s.length;){let u=s[d];d===s.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(a))):l[u]=l[u]||{_errors:[]},l=l[u],d++}}}};return o(e),r}function wc(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(d=>o({issues:d},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let d=[...i,...l.path];if(d.length===0){r.errors.push(t(l));continue}let u=r,p=0;for(;p<d.length;){let m=d[p],h=p===d.length-1;typeof m=="string"?(u.properties??(u.properties={}),(a=u.properties)[m]??(a[m]={errors:[]}),u=u.properties[m]):(u.items??(u.items=[]),(s=u.items)[m]??(s[m]={errors:[]}),u=u.items[m]),h&&u.errors.push(t(l)),p++}}};return o(e),r}function bg(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function kc(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${bg(o.path)}`);return t.join(`
8860
- `)}var vg,Br,Pe,xc=g(()=>{on();M();vg=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Nn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Br=v("$ZodError",vg),Pe=v("$ZodError",vg,{Parent:Error})});var Ln,li,jn,di,Mn,Sc,zn,$c,ui,AE,pi,IE,mi,CE,hi,PE,fi,OE,gi,NE,yi,RE,vi,DE,Ec=g(()=>{on();xc();M();Ln=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Ye;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Se(l,i,ne())));throw ci(s,n?.callee),s}return a.value},li=Ln(Pe),jn=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Se(l,i,ne())));throw ci(s,n?.callee),s}return a.value},di=jn(Pe),Mn=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Ye;return i.issues.length?{success:!1,error:new(e??Br)(i.issues.map(a=>Se(a,n,ne())))}:{success:!0,data:i.value}},Sc=Mn(Pe),zn=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Se(a,n,ne())))}:{success:!0,data:i.value}},$c=zn(Pe),ui=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ln(e)(t,r,n)},AE=ui(Pe),pi=e=>(t,r,o)=>Ln(e)(t,r,o),IE=pi(Pe),mi=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return jn(e)(t,r,n)},CE=mi(Pe),hi=e=>async(t,r,o)=>jn(e)(t,r,o),PE=hi(Pe),fi=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Mn(e)(t,r,n)},OE=fi(Pe),gi=e=>(t,r,o)=>Mn(e)(t,r,o),NE=gi(Pe),yi=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zn(e)(t,r,n)},RE=yi(Pe),vi=e=>async(t,r,o)=>zn(e)(t,r,o),DE=vi(Pe)});var je={};nt(je,{base64:()=>Bc,base64url:()=>bi,bigint:()=>Jc,boolean:()=>qc,browserEmail:()=>GE,cidrv4:()=>Uc,cidrv6:()=>Fc,cuid:()=>Tc,cuid2:()=>Ac,date:()=>Zc,datetime:()=>Vc,domain:()=>KE,duration:()=>Nc,e164:()=>Wc,email:()=>Dc,emoji:()=>Lc,extendedDuration:()=>LE,guid:()=>Rc,hex:()=>VE,hostname:()=>ZE,html5Email:()=>UE,httpProtocol:()=>Gc,idnEmail:()=>BE,integer:()=>Yc,ipv4:()=>jc,ipv6:()=>Mc,ksuid:()=>Pc,lowercase:()=>el,mac:()=>zc,md5_base64:()=>JE,md5_base64url:()=>YE,md5_hex:()=>HE,nanoid:()=>Oc,null:()=>Xc,number:()=>_i,rfc5322Email:()=>FE,sha1_base64:()=>XE,sha1_base64url:()=>QE,sha1_hex:()=>qE,sha256_base64:()=>tT,sha256_base64url:()=>nT,sha256_hex:()=>eT,sha384_base64:()=>oT,sha384_base64url:()=>iT,sha384_hex:()=>rT,sha512_base64:()=>sT,sha512_base64url:()=>cT,sha512_hex:()=>aT,string:()=>Hc,time:()=>Kc,ulid:()=>Ic,undefined:()=>Qc,unicodeEmail:()=>_g,uppercase:()=>tl,uuid:()=>sn,uuid4:()=>jE,uuid6:()=>ME,uuid7:()=>zE,xid:()=>Cc});function Lc(){return new RegExp(WE,"u")}function kg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kc(e){return new RegExp(`^${kg(e)}$`)}function Vc(e){let t=kg({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${wg}T(?:${o})$`)}function Zr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Kr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Tc,Ac,Ic,Cc,Pc,Oc,Nc,LE,Rc,sn,jE,ME,zE,Dc,UE,FE,_g,BE,GE,WE,jc,Mc,zc,Uc,Fc,Bc,bi,ZE,KE,Gc,Wc,wg,Zc,Hc,Jc,Yc,_i,qc,Xc,Qc,el,tl,VE,HE,JE,YE,qE,XE,QE,eT,tT,nT,rT,oT,iT,aT,sT,cT,wi=g(()=>{M();Tc=/^[cC][0-9a-z]{6,}$/,Ac=/^[0-9a-z]+$/,Ic=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cc=/^[0-9a-vA-V]{20}$/,Pc=/^[A-Za-z0-9]{27}$/,Oc=/^[a-zA-Z0-9_-]{21}$/,Nc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,LE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Rc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,sn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jE=sn(4),ME=sn(6),zE=sn(7),Dc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,UE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,FE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,_g=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,BE=_g,GE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,WE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";jc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zc=e=>{let t=We(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Uc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Fc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bi=/^[A-Za-z0-9_-]*$/,ZE=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,KE=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Gc=/^https?$/,Wc=/^\+[1-9]\d{6,14}$/,wg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Zc=new RegExp(`^${wg}$`);Hc=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Jc=/^-?\d+n?$/,Yc=/^-?\d+$/,_i=/^-?\d+(?:\.\d+)?$/,qc=/^(?:true|false)$/i,Xc=/^null$/i,Qc=/^undefined$/i,el=/^[^A-Z]*$/,tl=/^[^a-z]*$/,VE=/^[0-9a-fA-F]*$/;HE=/^[0-9a-fA-F]{32}$/,JE=Zr(22,"=="),YE=Kr(22),qE=/^[0-9a-fA-F]{40}$/,XE=Zr(27,"="),QE=Kr(27),eT=/^[0-9a-fA-F]{64}$/,tT=Zr(43,"="),nT=Kr(43),rT=/^[0-9a-fA-F]{96}$/,oT=Zr(64,""),iT=Kr(64),aT=/^[0-9a-fA-F]{128}$/,sT=Zr(86,"=="),cT=Kr(86)});function xg(e,t,r){e.issues.length&&t.issues.push(...Ce(r,e.issues))}var X,Sg,ki,xi,nl,rl,ol,il,al,sl,cl,ll,dl,Un,ul,pl,ml,hl,fl,gl,yl,vl,bl,Si=g(()=>{on();wi();M();X=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Sg={number:"number",bigint:"bigint",object:"date"},ki=v("$ZodCheckLessThan",(e,t)=>{X.init(e,t);let r=Sg[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xi=v("$ZodCheckGreaterThan",(e,t)=>{X.init(e,t);let r=Sg[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nl=v("$ZodCheckMultipleOf",(e,t)=>{X.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):pc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),rl=v("$ZodCheckNumberFormat",(e,t)=>{X.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=vc[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Yc)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ol=v("$ZodCheckBigIntFormat",(e,t)=>{X.init(e,t);let[r,o]=bc[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),il=v("$ZodCheckMaxSize",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!It(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Ur(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),al=v("$ZodCheckMinSize",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!It(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Ur(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),sl=v("$ZodCheckSizeEquals",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!It(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Ur(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),cl=v("$ZodCheckMaxLength",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!It(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Fr(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ll=v("$ZodCheckMinLength",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!It(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Fr(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dl=v("$ZodCheckLengthEquals",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!It(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Fr(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Un=v("$ZodCheckStringFormat",(e,t)=>{var r,o;X.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),ul=v("$ZodCheckRegex",(e,t)=>{Un.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pl=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=el),Un.init(e,t)}),ml=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tl),Un.init(e,t)}),hl=v("$ZodCheckIncludes",(e,t)=>{X.init(e,t);let r=We(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),fl=v("$ZodCheckStartsWith",(e,t)=>{X.init(e,t);let r=new RegExp(`^${We(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),gl=v("$ZodCheckEndsWith",(e,t)=>{X.init(e,t);let r=new RegExp(`.*${We(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});yl=v("$ZodCheckProperty",(e,t)=>{X.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>xg(n,r,t.property));xg(o,r,t.property)}}),vl=v("$ZodCheckMimeType",(e,t)=>{X.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),bl=v("$ZodCheckOverwrite",(e,t)=>{X.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Vr,_l=g(()=>{Vr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
9231
+ `)}process.exit(1)}var On,Q$,Pn,$,eE,tE,de=y(()=>{"use strict";On=!1;Q$=()=>!On&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,Pn=(e,t)=>Q$()?`\x1B[${e}m${t}\x1B[0m`:t,$={bold:e=>Pn("1",e),dim:e=>Pn("2",e),red:e=>Pn("31",e),green:e=>Pn("32",e),yellow:e=>Pn("33",e),cyan:e=>Pn("36",e)};eE=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","start","status","suggest","suspend","verify","wake","whoami"],tE=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});function on(e,t={}){let r=e?.trim()||Nn;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var Nn,Mr=y(()=>{"use strict";Nn="Round"});function Ye(e){return uE[e]??e}function hg(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=Ye(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var uE,cc,mg,At=y(()=>{"use strict";uE={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};cc={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element"},mg={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo"}});function v(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let d=a.prototype,u=Object.keys(d);for(let p=0;p<u.length;p++){let h=u[p];h in s||(s[h]=d[h].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let d=r?.Parent?new i:this;o(d,s),(c=d._zod).deferred??(c.deferred=[]);for(let u of d._zod.deferred)u();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function ne(e){return e&&Object.assign(an,e),an}var fg,lc,dc,qe,It,an,sn=y(()=>{lc=Object.freeze({status:"aborted"});dc=Symbol("zod_brand"),qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(fg=globalThis).__zod_globalConfig??(fg.__zod_globalConfig={});an=globalThis.__zod_globalConfig});var I={};nt(I,{BIGINT_FORMAT_RANGES:()=>wc,Class:()=>pc,NUMBER_FORMAT_RANGES:()=>bc,aborted:()=>Nt,allowsEval:()=>fc,assert:()=>gE,assertEqual:()=>pE,assertIs:()=>mE,assertNever:()=>fE,assertNotEqual:()=>hE,assignProp:()=>Pt,base64ToUint8Array:()=>yg,base64urlToUint8Array:()=>NE,cached:()=>Dn,captureStackTrace:()=>di,cleanEnum:()=>OE,cleanRegex:()=>Fr,clone:()=>Se,cloneDef:()=>vE,createTransparentProxy:()=>SE,defineLazy:()=>W,esc:()=>li,escapeRegex:()=>We,explicitlyAborted:()=>_c,extend:()=>TE,finalizeIssue:()=>$e,floatSafeRemainder:()=>hc,getElementAtPath:()=>bE,getEnumValues:()=>Ur,getLengthableOrigin:()=>Wr,getParsedType:()=>xE,getSizableOrigin:()=>Br,hexToUint8Array:()=>DE,isObject:()=>cn,isPlainObject:()=>Ot,issue:()=>Ln,joinValues:()=>w,jsonStringifyReplacer:()=>Rn,merge:()=>IE,mergeDefs:()=>ht,normalizeParams:()=>C,nullish:()=>Ct,numKeys:()=>kE,objectClone:()=>yE,omit:()=>EE,optionalKeys:()=>vc,parsedType:()=>A,partial:()=>CE,pick:()=>$E,prefixIssues:()=>Oe,primitiveTypes:()=>yc,promiseAllObject:()=>wE,propertyKeyTypes:()=>Gr,randomString:()=>_E,required:()=>PE,safeExtend:()=>AE,shallowClone:()=>gc,slugify:()=>mc,stringifyPrimitive:()=>E,uint8ArrayToBase64:()=>vg,uint8ArrayToBase64url:()=>RE,uint8ArrayToHex:()=>LE,unwrapMessage:()=>zr});function pE(e){return e}function hE(e){return e}function mE(e){}function fE(e){throw new Error("Unexpected value in exhaustive check")}function gE(e){}function Ur(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function w(e,t="|"){return e.map(r=>E(r)).join(t)}function Rn(e,t){return typeof t=="bigint"?t.toString():t}function Dn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ct(e){return e==null}function Fr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function hc(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function W(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==gg)return o===void 0&&(o=gg,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yE(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ht(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function vE(e){return ht(e._zod.def)}function bE(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function wE(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function _E(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function li(e){return JSON.stringify(e)}function mc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function cn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ot(e){if(cn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(cn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function gc(e){return Ot(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function kE(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function We(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Se(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function C(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function SE(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function E(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function $E(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=ht(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Pt(this,"shape",a),a},checks:[]});return Se(e,i)}function EE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=ht(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Pt(this,"shape",a),a},checks:[]});return Se(e,i)}function TE(e,t){if(!Ot(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=ht(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Pt(this,"shape",i),i}});return Se(e,n)}function AE(e,t){if(!Ot(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ht(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Pt(this,"shape",o),o}});return Se(e,r)}function IE(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ht(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Pt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Se(e,r)}function CE(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=ht(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(c[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)c[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return Pt(this,"shape",c),c},checks:[]});return Se(t,a)}function PE(e,t,r){let o=ht(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Pt(this,"shape",i),i}});return Se(t,o)}function Nt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function _c(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Oe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function zr(e){return typeof e=="string"?e:e?.message}function $e(e,t,r){let o=e.message?e.message:zr(e.inst?._zod.def?.error?.(e))??zr(t?.error?.(e))??zr(r.customError?.(e))??zr(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Br(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Wr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function A(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ln(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function OE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function yg(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function vg(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function NE(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return yg(t+r)}function RE(e){return vg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function DE(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function LE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var gg,di,fc,xE,Gr,yc,bc,wc,pc,M=y(()=>{sn();gg=Symbol("evaluating");di="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};fc=Dn(()=>{if(an.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});xE=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Gr=new Set(["string","number","symbol"]),yc=new Set(["string","number","bigint","boolean","symbol","undefined"]);bc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};pc=class{constructor(...t){}}});function Kr(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Vr(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,d=0;for(;d<s.length;){let u=s[d];d===s.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(a))):c[u]=c[u]||{_errors:[]},c=c[u],d++}}}};return o(e),r}function kc(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>o({issues:d},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let d=[...i,...c.path];if(d.length===0){r.errors.push(t(c));continue}let u=r,p=0;for(;p<d.length;){let h=d[p],m=p===d.length-1;typeof h=="string"?(u.properties??(u.properties={}),(a=u.properties)[h]??(a[h]={errors:[]}),u=u.properties[h]):(u.items??(u.items=[]),(s=u.items)[h]??(s[h]={errors:[]}),u=u.items[h]),m&&u.errors.push(t(c)),p++}}};return o(e),r}function wg(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function xc(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${wg(o.path)}`);return t.join(`
9232
+ `)}var bg,Zr,Ne,Sc=y(()=>{sn();M();bg=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Rn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zr=v("$ZodError",bg),Ne=v("$ZodError",bg,{Parent:Error})});var jn,ui,Mn,pi,zn,$c,Un,Ec,hi,ME,mi,zE,fi,UE,gi,FE,yi,GE,vi,BE,bi,WE,wi,ZE,Tc=y(()=>{sn();Sc();M();jn=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new qe;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>$e(c,i,ne())));throw di(s,n?.callee),s}return a.value},ui=jn(Ne),Mn=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>$e(c,i,ne())));throw di(s,n?.callee),s}return a.value},pi=Mn(Ne),zn=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new qe;return i.issues.length?{success:!1,error:new(e??Zr)(i.issues.map(a=>$e(a,n,ne())))}:{success:!0,data:i.value}},$c=zn(Ne),Un=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>$e(a,n,ne())))}:{success:!0,data:i.value}},Ec=Un(Ne),hi=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return jn(e)(t,r,n)},ME=hi(Ne),mi=e=>(t,r,o)=>jn(e)(t,r,o),zE=mi(Ne),fi=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Mn(e)(t,r,n)},UE=fi(Ne),gi=e=>async(t,r,o)=>Mn(e)(t,r,o),FE=gi(Ne),yi=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zn(e)(t,r,n)},GE=yi(Ne),vi=e=>(t,r,o)=>zn(e)(t,r,o),BE=vi(Ne),bi=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Un(e)(t,r,n)},WE=bi(Ne),wi=e=>async(t,r,o)=>Un(e)(t,r,o),ZE=wi(Ne)});var ze={};nt(ze,{base64:()=>Bc,base64url:()=>_i,bigint:()=>Yc,boolean:()=>Xc,browserEmail:()=>QE,cidrv4:()=>Fc,cidrv6:()=>Gc,cuid:()=>Ac,cuid2:()=>Ic,date:()=>Kc,datetime:()=>Hc,domain:()=>nT,duration:()=>Rc,e164:()=>Zc,email:()=>Lc,emoji:()=>jc,extendedDuration:()=>KE,guid:()=>Dc,hex:()=>rT,hostname:()=>tT,html5Email:()=>YE,httpProtocol:()=>Wc,idnEmail:()=>XE,integer:()=>qc,ipv4:()=>Mc,ipv6:()=>zc,ksuid:()=>Oc,lowercase:()=>tl,mac:()=>Uc,md5_base64:()=>iT,md5_base64url:()=>aT,md5_hex:()=>oT,nanoid:()=>Nc,null:()=>Qc,number:()=>ki,rfc5322Email:()=>qE,sha1_base64:()=>cT,sha1_base64url:()=>lT,sha1_hex:()=>sT,sha256_base64:()=>uT,sha256_base64url:()=>pT,sha256_hex:()=>dT,sha384_base64:()=>mT,sha384_base64url:()=>fT,sha384_hex:()=>hT,sha512_base64:()=>yT,sha512_base64url:()=>vT,sha512_hex:()=>gT,string:()=>Jc,time:()=>Vc,ulid:()=>Cc,undefined:()=>el,unicodeEmail:()=>_g,uppercase:()=>nl,uuid:()=>ln,uuid4:()=>VE,uuid6:()=>HE,uuid7:()=>JE,xid:()=>Pc});function jc(){return new RegExp(eT,"u")}function xg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vc(e){return new RegExp(`^${xg(e)}$`)}function Hc(e){let t=xg({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${kg}T(?:${o})$`)}function Hr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Jr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ac,Ic,Cc,Pc,Oc,Nc,Rc,KE,Dc,ln,VE,HE,JE,Lc,YE,qE,_g,XE,QE,eT,Mc,zc,Uc,Fc,Gc,Bc,_i,tT,nT,Wc,Zc,kg,Kc,Jc,Yc,qc,ki,Xc,Qc,el,tl,nl,rT,oT,iT,aT,sT,cT,lT,dT,uT,pT,hT,mT,fT,gT,yT,vT,xi=y(()=>{M();Ac=/^[cC][0-9a-z]{6,}$/,Ic=/^[0-9a-z]+$/,Cc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Pc=/^[0-9a-vA-V]{20}$/,Oc=/^[A-Za-z0-9]{27}$/,Nc=/^[a-zA-Z0-9_-]{21}$/,Rc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,KE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Dc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ln=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,VE=ln(4),HE=ln(6),JE=ln(7),Lc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,_g=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,XE=_g,QE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,eT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Mc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Uc=e=>{let t=We(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Fc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Gc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_i=/^[A-Za-z0-9_-]*$/,tT=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,nT=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wc=/^https?$/,Zc=/^\+[1-9]\d{6,14}$/,kg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Kc=new RegExp(`^${kg}$`);Jc=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Yc=/^-?\d+n?$/,qc=/^-?\d+$/,ki=/^-?\d+(?:\.\d+)?$/,Xc=/^(?:true|false)$/i,Qc=/^null$/i,el=/^undefined$/i,tl=/^[^A-Z]*$/,nl=/^[^a-z]*$/,rT=/^[0-9a-fA-F]*$/;oT=/^[0-9a-fA-F]{32}$/,iT=Hr(22,"=="),aT=Jr(22),sT=/^[0-9a-fA-F]{40}$/,cT=Hr(27,"="),lT=Jr(27),dT=/^[0-9a-fA-F]{64}$/,uT=Hr(43,"="),pT=Jr(43),hT=/^[0-9a-fA-F]{96}$/,mT=Hr(64,""),fT=Jr(64),gT=/^[0-9a-fA-F]{128}$/,yT=Hr(86,"=="),vT=Jr(86)});function Sg(e,t,r){e.issues.length&&t.issues.push(...Oe(r,e.issues))}var X,$g,Si,$i,rl,ol,il,al,sl,cl,ll,dl,ul,Fn,pl,hl,ml,fl,gl,yl,vl,bl,wl,Ei=y(()=>{sn();xi();M();X=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),$g={number:"number",bigint:"bigint",object:"date"},Si=v("$ZodCheckLessThan",(e,t)=>{X.init(e,t);let r=$g[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$i=v("$ZodCheckGreaterThan",(e,t)=>{X.init(e,t);let r=$g[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=v("$ZodCheckMultipleOf",(e,t)=>{X.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):hc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ol=v("$ZodCheckNumberFormat",(e,t)=>{X.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=bc[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=qc)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),il=v("$ZodCheckBigIntFormat",(e,t)=>{X.init(e,t);let[r,o]=wc[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),al=v("$ZodCheckMaxSize",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ct(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Br(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),sl=v("$ZodCheckMinSize",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ct(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Br(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cl=v("$ZodCheckSizeEquals",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ct(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Br(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ll=v("$ZodCheckMaxLength",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ct(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Wr(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dl=v("$ZodCheckMinLength",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ct(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Wr(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ul=v("$ZodCheckLengthEquals",(e,t)=>{var r;X.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ct(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Wr(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Fn=v("$ZodCheckStringFormat",(e,t)=>{var r,o;X.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),pl=v("$ZodCheckRegex",(e,t)=>{Fn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hl=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tl),Fn.init(e,t)}),ml=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nl),Fn.init(e,t)}),fl=v("$ZodCheckIncludes",(e,t)=>{X.init(e,t);let r=We(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),gl=v("$ZodCheckStartsWith",(e,t)=>{X.init(e,t);let r=new RegExp(`^${We(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),yl=v("$ZodCheckEndsWith",(e,t)=>{X.init(e,t);let r=new RegExp(`.*${We(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});vl=v("$ZodCheckProperty",(e,t)=>{X.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Sg(n,r,t.property));Sg(o,r,t.property)}}),bl=v("$ZodCheckMimeType",(e,t)=>{X.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),wl=v("$ZodCheckOverwrite",(e,t)=>{X.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Yr,_l=y(()=>{Yr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
8861
9233
  `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
8862
- `))}}});var wl,kl=g(()=>{wl={major:4,minor:4,patch:3}});function Wl(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Ug(e){if(!bi.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wl(r)}function Fg(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function Eg(e,t,r){e.issues.length&&t.issues.push(...Ce(r,e.issues)),t.value[r]=e.value}function Ai(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...Ce(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function Bg(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=yc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Gg(e,t,r,o,n,i){let a=[],s=n.keySet,l=n.catchall._zod,d=l.def.type,u=l.optin==="optional",p=l.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(d==="never"){a.push(m);continue}let h=l.run({value:t[m],issues:[]},o);h instanceof Promise?e.push(h.then(f=>Ai(f,r,m,t,u,p))):Ai(h,r,m,t,u,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function Tg(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Ot(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Se(a,o,ne())))}),t)}function Ag(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Se(a,o,ne())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function xl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Pt(e)&&Pt(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=xl(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=xl(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ig(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Ot(e))return e;let a=xl(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function Cg(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Pg(e,t,r){e.issues.length&&t.issues.push(...Ce(r,e.issues)),t.value[r]=e.value}function Og(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...Ce(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Ng(e,t,r,o,n,i,a){e.issues.length&&(zr.has(typeof o)?r.issues.push(...Ce(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>Se(s,a,ne()))})),t.issues.length&&(zr.has(typeof o)?r.issues.push(...Ce(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>Se(s,a,ne()))})),r.value.set(e.value,t.value)}function Rg(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Dg(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function Lg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function jg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function $i(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Ei(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ti(e,i,t.out,r)):Ti(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ti(e,i,t.in,r)):Ti(e,n,t.in,r)}}function Ti(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function Mg(e){return e.value=Object.freeze(e.value),e}function zg(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Dn(n))}}var B,cn,Y,Sl,$l,El,Tl,Al,Il,Cl,Pl,Ol,Nl,Rl,Dl,Ll,jl,Ml,zl,Ul,Fl,Bl,Gl,Zl,Kl,Vl,Hl,Jl,Ii,Yl,Hr,Ci,ql,Xl,Ql,ed,td,nd,rd,od,id,ad,Wg,sd,Jr,cd,ld,dd,Pi,ud,pd,md,hd,fd,gd,yd,Oi,vd,bd,_d,wd,kd,xd,Sd,$d,Ni,Yr,Ed,Td,Ad,Id,Cd,Pd,Od,Nd=g(()=>{Si();on();_l();Ec();wi();M();kl();M();B=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wl;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let d=Ot(a),u;for(let p of s){if(p._zod.def.when){if(_c(a)||!p._zod.def.when(a))continue}else if(d)continue;let m=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&l?.async===!1)throw new Ye;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(d||(d=Ot(a,m)))});else{if(a.issues.length===m)continue;d||(d=Ot(a,m))}}return u?u.then(()=>a):a},i=(a,s,l)=>{if(Ot(a))return a.aborted=!0,a;let d=n(s,o,l);if(d instanceof Promise){if(l.async===!1)throw new Ye;return d.then(u=>e._zod.parse(u,l))}return e._zod.parse(d,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(u=>i(u,a,s)):i(d,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Ye;return l.then(d=>n(d,o,s))}return n(l,o,s)}}W(e,"~standard",()=>({validate:n=>{try{let i=Sc(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return $c(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),cn=v("$ZodString",(e,t)=>{B.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Hc(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Y=v("$ZodStringFormat",(e,t)=>{Un.init(e,t),cn.init(e,t)}),Sl=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Rc),Y.init(e,t)}),$l=v("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=sn(o))}else t.pattern??(t.pattern=sn());Y.init(e,t)}),El=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Dc),Y.init(e,t)}),Tl=v("$ZodURL",(e,t)=>{Y.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Gc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Al=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Lc()),Y.init(e,t)}),Il=v("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Oc),Y.init(e,t)}),Cl=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Tc),Y.init(e,t)}),Pl=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ac),Y.init(e,t)}),Ol=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ic),Y.init(e,t)}),Nl=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cc),Y.init(e,t)}),Rl=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Pc),Y.init(e,t)}),Dl=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Vc(t)),Y.init(e,t)}),Ll=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Zc),Y.init(e,t)}),jl=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Kc(t)),Y.init(e,t)}),Ml=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Nc),Y.init(e,t)}),zl=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=jc),Y.init(e,t),e._zod.bag.format="ipv4"}),Ul=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Mc),Y.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Fl=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=zc(t.delimiter)),Y.init(e,t),e._zod.bag.format="mac"}),Bl=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Uc),Y.init(e,t)}),Gl=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Fc),Y.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Zl=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bc),Y.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Wl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Kl=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bi),Y.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ug(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Vl=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wc),Y.init(e,t)});Hl=v("$ZodJWT",(e,t)=>{Y.init(e,t),e._zod.check=r=>{Fg(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Jl=v("$ZodCustomStringFormat",(e,t)=>{Y.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ii=v("$ZodNumber",(e,t)=>{B.init(e,t),e._zod.pattern=e._zod.bag.pattern??_i,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Yl=v("$ZodNumberFormat",(e,t)=>{rl.init(e,t),Ii.init(e,t)}),Hr=v("$ZodBoolean",(e,t)=>{B.init(e,t),e._zod.pattern=qc,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Ci=v("$ZodBigInt",(e,t)=>{B.init(e,t),e._zod.pattern=Jc,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),ql=v("$ZodBigIntFormat",(e,t)=>{ol.init(e,t),Ci.init(e,t)}),Xl=v("$ZodSymbol",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Ql=v("$ZodUndefined",(e,t)=>{B.init(e,t),e._zod.pattern=Qc,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),ed=v("$ZodNull",(e,t)=>{B.init(e,t),e._zod.pattern=Xc,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),td=v("$ZodAny",(e,t)=>{B.init(e,t),e._zod.parse=r=>r}),nd=v("$ZodUnknown",(e,t)=>{B.init(e,t),e._zod.parse=r=>r}),rd=v("$ZodNever",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),od=v("$ZodVoid",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),id=v("$ZodDate",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});ad=v("$ZodArray",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(d=>Eg(d,r,a))):Eg(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});Wg=v("$ZodObject",(e,t)=>{if(B.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=Rn(()=>Bg(t));W(e._zod,"propValues",()=>{let s=t.shape,l={};for(let d in s){let u=s[d]._zod;if(u.values){l[d]??(l[d]=new Set);for(let p of u.values)l[d].add(p)}}return l});let n=an,i=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};let u=[],p=a.shape;for(let m of a.keys){let h=p[m],f=h._zod.optin==="optional",b=h._zod.optout==="optional",x=h._zod.run({value:d[m],issues:[]},l);x instanceof Promise?u.push(x.then(k=>Ai(k,s,m,d,f,b))):Ai(x,s,m,d,f,b)}return i?Gg(u,d,s,l,o.value,e):u.length?Promise.all(u).then(()=>s):s}}),sd=v("$ZodObjectJIT",(e,t)=>{Wg.init(e,t);let r=e._zod.parse,o=Rn(()=>Bg(t)),n=m=>{let h=new Vr(["shape","payload","ctx"]),f=o.value,b=T=>{let L=si(T);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};h.write("const input = payload.value;");let x=Object.create(null),k=0;for(let T of f.keys)x[T]=`key_${k++}`;h.write("const newResult = {};");for(let T of f.keys){let L=x[T],N=si(T),V=m[T],Z=V?._zod?.optin==="optional",te=V?._zod?.optout==="optional";h.write(`const ${L} = ${b(T)};`),Z&&te?h.write(`
9234
+ `))}}});var kl,xl=y(()=>{kl={major:4,minor:4,patch:3}});function Zl(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Fg(e){if(!_i.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Zl(r)}function Gg(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function Tg(e,t,r){e.issues.length&&t.issues.push(...Oe(r,e.issues)),t.value[r]=e.value}function Ci(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...Oe(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function Bg(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=vc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Wg(e,t,r,o,n,i){let a=[],s=n.keySet,c=n.catchall._zod,d=c.def.type,u=c.optin==="optional",p=c.optout==="optional";for(let h in t){if(h==="__proto__"||s.has(h))continue;if(d==="never"){a.push(h);continue}let m=c.run({value:t[h],issues:[]},o);m instanceof Promise?e.push(m.then(f=>Ci(f,r,h,t,u,p))):Ci(m,r,h,t,u,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function Ag(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Nt(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>$e(a,o,ne())))}),t)}function Ig(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>$e(a,o,ne())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function Sl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ot(e)&&Ot(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=Sl(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=Sl(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Cg(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Nt(e))return e;let a=Sl(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function Pg(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Og(e,t,r){e.issues.length&&t.issues.push(...Oe(r,e.issues)),t.value[r]=e.value}function Ng(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...Oe(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Rg(e,t,r,o,n,i,a){e.issues.length&&(Gr.has(typeof o)?r.issues.push(...Oe(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>$e(s,a,ne()))})),t.issues.length&&(Gr.has(typeof o)?r.issues.push(...Oe(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>$e(s,a,ne()))})),r.value.set(e.value,t.value)}function Dg(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Lg(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function jg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Mg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Ti(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Ai(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ii(e,i,t.out,r)):Ii(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ii(e,i,t.in,r)):Ii(e,n,t.in,r)}}function Ii(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function zg(e){return e.value=Object.freeze(e.value),e}function Ug(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Ln(n))}}var G,dn,Y,$l,El,Tl,Al,Il,Cl,Pl,Ol,Nl,Rl,Dl,Ll,jl,Ml,zl,Ul,Fl,Gl,Bl,Wl,Kl,Vl,Hl,Jl,Yl,Pi,ql,qr,Oi,Xl,Ql,ed,td,nd,rd,od,id,ad,sd,Zg,cd,Xr,ld,dd,ud,Ni,pd,hd,md,fd,gd,yd,vd,Ri,bd,wd,_d,kd,xd,Sd,$d,Ed,Di,Qr,Td,Ad,Id,Cd,Pd,Od,Nd,Rd=y(()=>{Ei();sn();_l();Tc();xi();M();xl();M();G=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kl;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,c)=>{let d=Nt(a),u;for(let p of s){if(p._zod.def.when){if(_c(a)||!p._zod.def.when(a))continue}else if(d)continue;let h=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&c?.async===!1)throw new qe;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,a.issues.length!==h&&(d||(d=Nt(a,h)))});else{if(a.issues.length===h)continue;d||(d=Nt(a,h))}}return u?u.then(()=>a):a},i=(a,s,c)=>{if(Nt(a))return a.aborted=!0,a;let d=n(s,o,c);if(d instanceof Promise){if(c.async===!1)throw new qe;return d.then(u=>e._zod.parse(u,c))}return e._zod.parse(d,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(u=>i(u,a,s)):i(d,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new qe;return c.then(d=>n(d,o,s))}return n(c,o,s)}}W(e,"~standard",()=>({validate:n=>{try{let i=$c(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ec(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),dn=v("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jc(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Y=v("$ZodStringFormat",(e,t)=>{Fn.init(e,t),dn.init(e,t)}),$l=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Dc),Y.init(e,t)}),El=v("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ln(o))}else t.pattern??(t.pattern=ln());Y.init(e,t)}),Tl=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Lc),Y.init(e,t)}),Al=v("$ZodURL",(e,t)=>{Y.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Wc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Il=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=jc()),Y.init(e,t)}),Cl=v("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Nc),Y.init(e,t)}),Pl=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ac),Y.init(e,t)}),Ol=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ic),Y.init(e,t)}),Nl=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Cc),Y.init(e,t)}),Rl=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Pc),Y.init(e,t)}),Dl=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Oc),Y.init(e,t)}),Ll=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Hc(t)),Y.init(e,t)}),jl=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kc),Y.init(e,t)}),Ml=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Vc(t)),Y.init(e,t)}),zl=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Rc),Y.init(e,t)}),Ul=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Mc),Y.init(e,t),e._zod.bag.format="ipv4"}),Fl=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zc),Y.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Gl=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Uc(t.delimiter)),Y.init(e,t),e._zod.bag.format="mac"}),Bl=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Fc),Y.init(e,t)}),Wl=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gc),Y.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Kl=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bc),Y.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Zl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Vl=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_i),Y.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Fg(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Hl=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zc),Y.init(e,t)});Jl=v("$ZodJWT",(e,t)=>{Y.init(e,t),e._zod.check=r=>{Gg(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Yl=v("$ZodCustomStringFormat",(e,t)=>{Y.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Pi=v("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??ki,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),ql=v("$ZodNumberFormat",(e,t)=>{ol.init(e,t),Pi.init(e,t)}),qr=v("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=Xc,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Oi=v("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=Yc,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Xl=v("$ZodBigIntFormat",(e,t)=>{il.init(e,t),Oi.init(e,t)}),Ql=v("$ZodSymbol",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),ed=v("$ZodUndefined",(e,t)=>{G.init(e,t),e._zod.pattern=el,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),td=v("$ZodNull",(e,t)=>{G.init(e,t),e._zod.pattern=Qc,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),nd=v("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),rd=v("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),od=v("$ZodNever",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),id=v("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),ad=v("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});sd=v("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(d=>Tg(d,r,a))):Tg(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});Zg=v("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=Dn(()=>Bg(t));W(e._zod,"propValues",()=>{let s=t.shape,c={};for(let d in s){let u=s[d]._zod;if(u.values){c[d]??(c[d]=new Set);for(let p of u.values)c[d].add(p)}}return c});let n=cn,i=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=o.value);let d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};let u=[],p=a.shape;for(let h of a.keys){let m=p[h],f=m._zod.optin==="optional",b=m._zod.optout==="optional",x=m._zod.run({value:d[h],issues:[]},c);x instanceof Promise?u.push(x.then(k=>Ci(k,s,h,d,f,b))):Ci(x,s,h,d,f,b)}return i?Wg(u,d,s,c,o.value,e):u.length?Promise.all(u).then(()=>s):s}}),cd=v("$ZodObjectJIT",(e,t)=>{Zg.init(e,t);let r=e._zod.parse,o=Dn(()=>Bg(t)),n=h=>{let m=new Yr(["shape","payload","ctx"]),f=o.value,b=T=>{let L=li(T);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};m.write("const input = payload.value;");let x=Object.create(null),k=0;for(let T of f.keys)x[T]=`key_${k++}`;m.write("const newResult = {};");for(let T of f.keys){let L=x[T],R=li(T),K=h[T],Z=K?._zod?.optin==="optional",te=K?._zod?.optout==="optional";m.write(`const ${L} = ${b(T)};`),Z&&te?m.write(`
8863
9235
  if (${L}.issues.length) {
8864
- if (${N} in input) {
9236
+ if (${R} in input) {
8865
9237
  payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
8866
9238
  ...iss,
8867
- path: iss.path ? [${N}, ...iss.path] : [${N}]
9239
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
8868
9240
  })));
8869
9241
  }
8870
9242
  }
8871
9243
 
8872
9244
  if (${L}.value === undefined) {
8873
- if (${N} in input) {
8874
- newResult[${N}] = undefined;
9245
+ if (${R} in input) {
9246
+ newResult[${R}] = undefined;
8875
9247
  }
8876
9248
  } else {
8877
- newResult[${N}] = ${L}.value;
9249
+ newResult[${R}] = ${L}.value;
8878
9250
  }
8879
9251
 
8880
- `):Z?h.write(`
9252
+ `):Z?m.write(`
8881
9253
  if (${L}.issues.length) {
8882
9254
  payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
8883
9255
  ...iss,
8884
- path: iss.path ? [${N}, ...iss.path] : [${N}]
9256
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
8885
9257
  })));
8886
9258
  }
8887
9259
 
8888
9260
  if (${L}.value === undefined) {
8889
- if (${N} in input) {
8890
- newResult[${N}] = undefined;
9261
+ if (${R} in input) {
9262
+ newResult[${R}] = undefined;
8891
9263
  }
8892
9264
  } else {
8893
- newResult[${N}] = ${L}.value;
9265
+ newResult[${R}] = ${L}.value;
8894
9266
  }
8895
9267
 
8896
- `):h.write(`
8897
- const ${L}_present = ${N} in input;
9268
+ `):m.write(`
9269
+ const ${L}_present = ${R} in input;
8898
9270
  if (${L}.issues.length) {
8899
9271
  payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
8900
9272
  ...iss,
8901
- path: iss.path ? [${N}, ...iss.path] : [${N}]
9273
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
8902
9274
  })));
8903
9275
  }
8904
9276
  if (!${L}_present && !${L}.issues.length) {
@@ -8906,55 +9278,55 @@ main().catch((error) => {
8906
9278
  code: "invalid_type",
8907
9279
  expected: "nonoptional",
8908
9280
  input: undefined,
8909
- path: [${N}]
9281
+ path: [${R}]
8910
9282
  });
8911
9283
  }
8912
9284
 
8913
9285
  if (${L}_present) {
8914
9286
  if (${L}.value === undefined) {
8915
- newResult[${N}] = undefined;
9287
+ newResult[${R}] = undefined;
8916
9288
  } else {
8917
- newResult[${N}] = ${L}.value;
9289
+ newResult[${R}] = ${L}.value;
8918
9290
  }
8919
9291
  }
8920
9292
 
8921
- `)}h.write("payload.value = newResult;"),h.write("return payload;");let w=h.compile();return(T,L)=>w(m,T,L)},i,a=an,s=!rn.jitless,d=s&&hc.value,u=t.catchall,p;e._zod.parse=(m,h)=>{p??(p=o.value);let f=m.value;return a(f)?s&&d&&h?.async===!1&&h.jitless!==!0?(i||(i=n(t.shape)),m=i(m,h),u?Gg([],f,m,h,p,e):m):r(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),m)}});Jr=v("$ZodUnion",(e,t)=>{B.init(e,t),W(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Mr(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(s=>Tg(s,o,e,n)):Tg(a,o,e,n)}});cd=v("$ZodXor",(e,t)=>{Jr.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(a.push(l),i=!0):a.push(l)}return i?Promise.all(a).then(s=>Ag(s,o,e,n)):Ag(a,o,e,n)}}),ld=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Jr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let d of l)n[s].add(d)}}return n});let o=Rn(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!an(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),dd=v("$ZodIntersection",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,d])=>Ig(r,l,d)):Ig(r,i,a)}});Pi=v("$ZodTuple",(e,t)=>{B.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=Cg(r,"optin"),l=Cg(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let d=new Array(r.length);for(let u=0;u<r.length;u++){let p=r[u]._zod.run({value:i[u],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{d[u]=m})):d[u]=p}if(t.rest){let u=r.length-1,p=i.slice(r.length);for(let m of p){u++;let h=t.rest._zod.run({value:m,issues:[]},n);h instanceof Promise?a.push(h.then(f=>Pg(f,o,u))):Pg(h,o,u)}}return a.length?Promise.all(a).then(()=>Og(d,o,r,i,l)):Og(d,o,r,i,l)}});ud=v("$ZodRecord",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Pt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){s.add(typeof d=="number"?d.toString():d);let u=t.keyType._zod.run({value:d,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>Se(h,o,ne())),input:d,path:[d],inst:e});continue}let p=u.value,m=t.valueType._zod.run({value:n[d],issues:[]},o);m instanceof Promise?i.push(m.then(h=>{h.issues.length&&r.issues.push(...Ce(d,h.issues)),r.value[p]=h.value})):(m.issues.length&&r.issues.push(...Ce(d,m.issues)),r.value[p]=m.value)}let l;for(let d in n)s.has(d)||(l=l??[],l.push(d));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&_i.test(s)&&l.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Se(p,o,ne())),input:s,path:[s],inst:e});continue}let u=t.valueType._zod.run({value:n[s],issues:[]},o);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...Ce(s,p.issues)),r.value[l.value]=p.value})):(u.issues.length&&r.issues.push(...Ce(s,u.issues)),r.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>r):r}}),pd=v("$ZodMap",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},o),d=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise||d instanceof Promise?i.push(Promise.all([l,d]).then(([u,p])=>{Ng(u,p,r,a,n,e,o)})):Ng(l,d,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});md=v("$ZodSet",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(l=>Rg(l,r))):Rg(s,r)}return i.length?Promise.all(i).then(()=>r):r}});hd=v("$ZodEnum",(e,t)=>{B.init(e,t);let r=jr(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>zr.has(typeof n)).map(n=>typeof n=="string"?We(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),fd=v("$ZodLiteral",(e,t)=>{if(B.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?We(o):o?We(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),gd=v("$ZodFile",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),yd=v("$ZodTransform",(e,t)=>{B.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new At(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Ye;return r.value=n,r.fallback=!0,r}});Oi=v("$ZodOptional",(e,t)=>{B.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Dg(a,n)):Dg(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),vd=v("$ZodExactOptional",(e,t)=>{Oi.init(e,t),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),bd=v("$ZodNullable",(e,t)=>{B.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(r.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),_d=v("$ZodDefault",(e,t)=>{B.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Lg(i,t)):Lg(n,t)}});wd=v("$ZodPrefault",(e,t)=>{B.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),kd=v("$ZodNonOptional",(e,t)=>{B.init(e,t),W(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jg(i,e)):jg(n,e)}});xd=v("$ZodSuccess",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new At("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Sd=v("$ZodCatch",(e,t)=>{B.init(e,t),e._zod.optin="optional",W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Se(a,o,ne()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Se(i,o,ne()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),$d=v("$ZodNaN",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Ni=v("$ZodPipe",(e,t)=>{B.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>$i(a,t.in,o)):$i(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>$i(i,t.out,o)):$i(n,t.out,o)}});Yr=v("$ZodCodec",(e,t)=>{B.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Ei(a,t,o)):Ei(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ei(a,t,o)):Ei(i,t,o)}}});Ed=v("$ZodPreprocess",(e,t)=>{Ni.init(e,t)}),Td=v("$ZodReadonly",(e,t)=>{B.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType?._zod?.optin),W(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Mg):Mg(n)}});Ad=v("$ZodTemplateLiteral",(e,t)=>{B.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||gc.has(typeof o))r.push(We(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Id=v("$ZodFunction",(e,t)=>(B.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?li(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?li(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await di(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await di(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Pi({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Cd=v("$ZodPromise",(e,t)=>{B.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Pd=v("$ZodLazy",(e,t)=>{B.init(e,t),W(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),W(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),W(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),W(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),W(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Od=v("$ZodCustom",(e,t)=>{X.init(e,t),B.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>zg(i,r,o,e));zg(n,r,o,e)}})});function Zg(){return{localeError:dT()}}var dT,Kg=g(()=>{M();dT=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${E(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${_(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function Vg(){return{localeError:uT()}}var uT,Hg=g(()=>{M();uT=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${E(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function Jg(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function Yg(){return{localeError:pT()}}var pT,qg=g(()=>{M();pT=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${E(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Jg(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Jg(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Xg(){return{localeError:mT()}}var mT,Qg=g(()=>{M();mT=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${E(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function ey(){return{localeError:hT()}}var hT,ty=g(()=>{M();hT=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${E(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${_(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function ny(){return{localeError:fT()}}var fT,ry=g(()=>{M();fT=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${E(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${_(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function oy(){return{localeError:gT()}}var gT,iy=g(()=>{M();gT=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${E(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function ay(){return{localeError:yT()}}var yT,sy=g(()=>{M();yT=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${E(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function cy(){return{localeError:vT()}}var vT,ly=g(()=>{M();vT=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${E(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Ri(){return{localeError:bT()}}var bT,Rd=g(()=>{M();bT=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${E(n.values[0])}`:`Invalid option: expected one of ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function dy(){return{localeError:_T()}}var _T,uy=g(()=>{M();_T=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${E(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function py(){return{localeError:wT()}}var wT,my=g(()=>{M();wT=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${E(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function hy(){return{localeError:kT()}}var kT,fy=g(()=>{M();kT=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${E(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${_(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${_(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function gy(){return{localeError:xT()}}var xT,yy=g(()=>{M();xT=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${E(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function vy(){return{localeError:ST()}}var ST,by=g(()=>{M();ST=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${E(n.values[0])} attendu`:`Option invalide : une valeur parmi ${_(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function _y(){return{localeError:$T()}}var $T,wy=g(()=>{M();$T=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${E(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function ky(){return{localeError:ET()}}var ET,xy=g(()=>{M();ET=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=d=>d?e[d]:void 0,o=d=>{let u=r(d);return u?u.label:d??e.unknown.label},n=d=>`\u05D4${o(d)}`,i=d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=d=>d?t[d]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let u=d.expected,p=l[u??""]??o(u),m=A(d.input),h=l[m]??e[m]?.label??m;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${E(d.values[0])}`;let u=d.values.map(h=>E(h));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=a(d.origin),p=n(d.origin??"value");if(d.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${u?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let f=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(d.origin==="array"||d.origin==="set"){let f=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",b=d.inclusive?`${d.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let m=d.inclusive?"<=":"<",h=i(d.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${m}${d.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${h} ${m}${d.maximum.toString()}`}case"too_small":{let u=a(d.origin),p=n(d.origin??"value");if(d.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${u?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let f=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(d.origin==="array"||d.origin==="set"){let f=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let x=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let b=d.inclusive?`${d.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let m=d.inclusive?">=":">",h=i(d.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${m}${d.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${h} ${m}${d.minimum.toString()}`}case"invalid_format":{let u=d;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let p=s[u.format],m=p?.label??u.format,f=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${f}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${_(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Sy(){return{localeError:TT()}}var TT,$y=g(()=>{M();TT=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${E(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${_(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function Ey(){return{localeError:AT()}}var AT,Ty=g(()=>{M();AT=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${E(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Ay(e,t,r){return Math.abs(e)===1?t:r}function Fn(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function Iy(){return{localeError:IT()}}var IT,Cy=g(()=>{M();IT=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${E(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Ay(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Fn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Fn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Ay(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Fn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Fn(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${_(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Fn(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Fn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Py(){return{localeError:CT()}}var CT,Oy=g(()=>{M();CT=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${E(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function Ny(){return{localeError:PT()}}var PT,Ry=g(()=>{M();PT=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${E(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${_(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function Dy(){return{localeError:OT()}}var OT,Ly=g(()=>{M();OT=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${E(n.values[0])}`:`Opzione non valida: atteso uno tra ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${_(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function jy(){return{localeError:NT()}}var NT,My=g(()=>{M();NT=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${E(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${_(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${_(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function zy(){return{localeError:RT()}}var RT,Uy=g(()=>{M();RT=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${E(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${_(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Di(){return{localeError:DT()}}var DT,Dd=g(()=>{M();DT=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${E(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${_(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Fy(){return Di()}var By=g(()=>{Dd()});function Gy(){return{localeError:LT()}}var LT,Wy=g(()=>{M();LT=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${E(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${_(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${_(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function Zy(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function Ky(){return{localeError:jT()}}var qr,jT,Vy=g(()=>{M();qr=e=>e.charAt(0).toUpperCase()+e.slice(1);jT=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${E(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${_(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,Zy(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${qr(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${qr(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,Zy(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${qr(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${qr(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${_(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${qr(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Hy(){return{localeError:MT()}}var MT,Jy=g(()=>{M();MT=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${E(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function Yy(){return{localeError:zT()}}var zT,qy=g(()=>{M();zT=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${E(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function Xy(){return{localeError:UT()}}var UT,Qy=g(()=>{M();UT=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${E(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function ev(){return{localeError:FT()}}var FT,tv=g(()=>{M();FT=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${E(n.values[0])}`:`Ugyldig valg: forventet en av ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function nv(){return{localeError:BT()}}var BT,rv=g(()=>{M();BT=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${E(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function ov(){return{localeError:GT()}}var GT,iv=g(()=>{M();GT=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${E(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${_(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function av(){return{localeError:WT()}}var WT,sv=g(()=>{M();WT=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${E(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function cv(){return{localeError:ZT()}}var ZT,lv=g(()=>{M();ZT=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${E(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function dv(){return{localeError:KT()}}var KT,uv=g(()=>{M();KT=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${E(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${_(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function pv(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function mv(){return{localeError:VT()}}var VT,hv=g(()=>{M();VT=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${E(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=pv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=pv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function fv(){return{localeError:HT()}}var HT,gv=g(()=>{M();HT=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${E(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${_(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function yv(){return{localeError:JT()}}var JT,vv=g(()=>{M();JT=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${E(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function bv(){return{localeError:YT()}}var YT,_v=g(()=>{M();YT=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${E(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${_(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function wv(){return{localeError:qT()}}var qT,kv=g(()=>{M();qT=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${E(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${_(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function xv(){return{localeError:XT()}}var XT,Sv=g(()=>{M();XT=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${E(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Li(){return{localeError:QT()}}var QT,Ld=g(()=>{M();QT=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${E(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function $v(){return Li()}var Ev=g(()=>{Ld()});function Tv(){return{localeError:eA()}}var eA,Av=g(()=>{M();eA=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${E(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${_(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${_(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Iv(){return{localeError:tA()}}var tA,Cv=g(()=>{M();tA=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${E(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function Pv(){return{localeError:nA()}}var nA,Ov=g(()=>{M();nA=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${E(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${_(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Nv(){return{localeError:rA()}}var rA,Rv=g(()=>{M();rA=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${E(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Dv(){return{localeError:oA()}}var oA,Lv=g(()=>{M();oA=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${E(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${_(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function jv(){return{localeError:iA()}}var iA,Mv=g(()=>{M();iA=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${E(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${_(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${_(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var Xr={};nt(Xr,{ar:()=>Zg,az:()=>Vg,be:()=>Yg,bg:()=>Xg,ca:()=>ey,cs:()=>ny,da:()=>oy,de:()=>ay,el:()=>cy,en:()=>Ri,eo:()=>dy,es:()=>py,fa:()=>hy,fi:()=>gy,fr:()=>vy,frCA:()=>_y,he:()=>ky,hr:()=>Sy,hu:()=>Ey,hy:()=>Iy,id:()=>Py,is:()=>Ny,it:()=>Dy,ja:()=>jy,ka:()=>zy,kh:()=>Fy,km:()=>Di,ko:()=>Gy,lt:()=>Ky,mk:()=>Hy,ms:()=>Yy,nl:()=>Xy,no:()=>ev,ota:()=>nv,pl:()=>av,ps:()=>ov,pt:()=>cv,ro:()=>dv,ru:()=>mv,sl:()=>fv,sv:()=>yv,ta:()=>bv,th:()=>wv,tr:()=>xv,ua:()=>$v,uk:()=>Li,ur:()=>Tv,uz:()=>Iv,vi:()=>Pv,yo:()=>jv,zhCN:()=>Nv,zhTW:()=>Dv});var jd=g(()=>{Kg();Hg();qg();Qg();ty();ry();iy();sy();ly();Rd();uy();my();fy();yy();by();wy();xy();$y();Ty();Cy();Oy();Ry();Ly();My();Uy();By();Dd();Wy();Vy();Jy();qy();Qy();tv();rv();iv();sv();lv();uv();hv();gv();vv();_v();kv();Sv();Ev();Ld();Av();Cv();Ov();Rv();Lv();Mv()});function Mi(){return new ji}var zv,Md,zd,ji,he,Qr=g(()=>{Md=Symbol("ZodOutput"),zd=Symbol("ZodInput"),ji=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(zv=globalThis).__zod_globalRegistry??(zv.__zod_globalRegistry=Mi());he=globalThis.__zod_globalRegistry});function Ud(e,t){return new e({type:"string",...C(t)})}function Fd(e,t){return new e({type:"string",coerce:!0,...C(t)})}function zi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...C(t)})}function eo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...C(t)})}function Ui(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...C(t)})}function Fi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(t)})}function Bi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(t)})}function Gi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(t)})}function to(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...C(t)})}function Wi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...C(t)})}function Zi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(t)})}function Ki(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...C(t)})}function Vi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(t)})}function Hi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...C(t)})}function Ji(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...C(t)})}function Yi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(t)})}function qi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(t)})}function Xi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(t)})}function Bd(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...C(t)})}function Qi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(t)})}function ea(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(t)})}function ta(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...C(t)})}function na(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...C(t)})}function ra(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...C(t)})}function oa(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...C(t)})}function Wd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(t)})}function Zd(e,t){return new e({type:"string",format:"date",check:"string_format",...C(t)})}function Kd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...C(t)})}function Vd(e,t){return new e({type:"string",format:"duration",check:"string_format",...C(t)})}function Hd(e,t){return new e({type:"number",checks:[],...C(t)})}function Jd(e,t){return new e({type:"number",coerce:!0,checks:[],...C(t)})}function Yd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...C(t)})}function qd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...C(t)})}function Xd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...C(t)})}function Qd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...C(t)})}function eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...C(t)})}function tu(e,t){return new e({type:"boolean",...C(t)})}function nu(e,t){return new e({type:"boolean",coerce:!0,...C(t)})}function ru(e,t){return new e({type:"bigint",...C(t)})}function ou(e,t){return new e({type:"bigint",coerce:!0,...C(t)})}function iu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(t)})}function au(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(t)})}function su(e,t){return new e({type:"symbol",...C(t)})}function cu(e,t){return new e({type:"undefined",...C(t)})}function lu(e,t){return new e({type:"null",...C(t)})}function du(e){return new e({type:"any"})}function uu(e){return new e({type:"unknown"})}function pu(e,t){return new e({type:"never",...C(t)})}function mu(e,t){return new e({type:"void",...C(t)})}function hu(e,t){return new e({type:"date",...C(t)})}function fu(e,t){return new e({type:"date",coerce:!0,...C(t)})}function gu(e,t){return new e({type:"nan",...C(t)})}function rt(e,t){return new ki({check:"less_than",...C(t),value:e,inclusive:!1})}function Me(e,t){return new ki({check:"less_than",...C(t),value:e,inclusive:!0})}function ot(e,t){return new xi({check:"greater_than",...C(t),value:e,inclusive:!1})}function $e(e,t){return new xi({check:"greater_than",...C(t),value:e,inclusive:!0})}function ia(e){return ot(0,e)}function aa(e){return rt(0,e)}function sa(e){return Me(0,e)}function ca(e){return $e(0,e)}function Nt(e,t){return new nl({check:"multiple_of",...C(t),value:e})}function Rt(e,t){return new il({check:"max_size",...C(t),maximum:e})}function it(e,t){return new al({check:"min_size",...C(t),minimum:e})}function ln(e,t){return new sl({check:"size_equals",...C(t),size:e})}function dn(e,t){return new cl({check:"max_length",...C(t),maximum:e})}function ht(e,t){return new ll({check:"min_length",...C(t),minimum:e})}function un(e,t){return new dl({check:"length_equals",...C(t),length:e})}function Bn(e,t){return new ul({check:"string_format",format:"regex",...C(t),pattern:e})}function Gn(e){return new pl({check:"string_format",format:"lowercase",...C(e)})}function Wn(e){return new ml({check:"string_format",format:"uppercase",...C(e)})}function Zn(e,t){return new hl({check:"string_format",format:"includes",...C(t),includes:e})}function Kn(e,t){return new fl({check:"string_format",format:"starts_with",...C(t),prefix:e})}function Vn(e,t){return new gl({check:"string_format",format:"ends_with",...C(t),suffix:e})}function la(e,t,r){return new yl({check:"property",property:e,schema:t,...C(r)})}function Hn(e,t){return new vl({check:"mime_type",mime:e,...C(t)})}function qe(e){return new bl({check:"overwrite",tx:e})}function Jn(e){return qe(t=>t.normalize(e))}function Yn(){return qe(e=>e.trim())}function qn(){return qe(e=>e.toLowerCase())}function Xn(){return qe(e=>e.toUpperCase())}function Qn(){return qe(e=>mc(e))}function yu(e,t,r){return new e({type:"array",element:t,...C(r)})}function sA(e,t,r){return new e({type:"union",options:t,...C(r)})}function cA(e,t,r){return new e({type:"union",options:t,inclusive:!1,...C(r)})}function lA(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...C(o)})}function dA(e,t,r){return new e({type:"intersection",left:t,right:r})}function uA(e,t,r,o){let n=r instanceof B,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...C(i)})}function pA(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...C(o)})}function mA(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...C(o)})}function hA(e,t,r){return new e({type:"set",valueType:t,...C(r)})}function fA(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...C(r)})}function gA(e,t,r){return new e({type:"enum",entries:t,...C(r)})}function yA(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...C(r)})}function vu(e,t){return new e({type:"file",...C(t)})}function vA(e,t){return new e({type:"transform",transform:t})}function bA(e,t){return new e({type:"optional",innerType:t})}function _A(e,t){return new e({type:"nullable",innerType:t})}function wA(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():fc(r)}})}function kA(e,t,r){return new e({type:"nonoptional",innerType:t,...C(r)})}function xA(e,t){return new e({type:"success",innerType:t})}function SA(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function $A(e,t,r){return new e({type:"pipe",in:t,out:r})}function EA(e,t){return new e({type:"readonly",innerType:t})}function TA(e,t,r){return new e({type:"template_literal",parts:t,...C(r)})}function AA(e,t){return new e({type:"lazy",getter:t})}function IA(e,t){return new e({type:"promise",innerType:t})}function bu(e,t,r){let o=C(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function _u(e,t,r){return new e({type:"custom",check:"custom",fn:t,...C(r)})}function wu(e,t){let r=Uv(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Dn(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Dn(i))}},e(o.value,o)),t);return r}function Uv(e,t){let r=new X({check:"custom",...C(t)});return r._zod.check=e,r}function ku(e){let t=new X({check:"describe"});return t._zod.onattach=[r=>{let o=he.get(r)??{};he.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function xu(e){let t=new X({check:"meta"});return t._zod.onattach=[r=>{let o=he.get(r)??{};he.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Su(e,t){let r=C(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(h=>typeof h=="string"?h.toLowerCase():h),n=n.map(h=>typeof h=="string"?h.toLowerCase():h));let i=new Set(o),a=new Set(n),s=e.Codec??Yr,l=e.Boolean??Hr,d=e.String??cn,u=new d({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),m=new s({type:"pipe",in:u,out:p,transform:((h,f)=>{let b=h;return r.case!=="sensitive"&&(b=b.toLowerCase()),i.has(b)?!0:a.has(b)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:f.value,inst:m,continue:!1}),{})}),reverseTransform:((h,f)=>h===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function er(e,t,r,o={}){let n=C(o),i={...C(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var Gd,Fv=g(()=>{Si();Qr();Nd();M();Gd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Dt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??he,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function H(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{let m=a.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,u)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),H(p,t,u),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Ee(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Lt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=o.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(f=>f);if(p)return{ref:m(p)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${m("__shared")}#/${s}/${h}`}}if(a[1]===r)return{ref:"#"};let d=`#/${s}/`,u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:d+u}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:d}=n(a);s.def={...s.schema},d&&(s.defId=d);let u=s.schema;for(let p in u)delete u[p];u.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
9293
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(T,L)=>_(h,T,L)},i,a=cn,s=!an.jitless,d=s&&fc.value,u=t.catchall,p;e._zod.parse=(h,m)=>{p??(p=o.value);let f=h.value;return a(f)?s&&d&&m?.async===!1&&m.jitless!==!0?(i||(i=n(t.shape)),h=i(h,m),u?Wg([],f,h,m,p,e):h):r(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),h)}});Xr=v("$ZodUnion",(e,t)=>{G.init(e,t),W(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Fr(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(s=>Ag(s,o,e,n)):Ag(a,o,e,n)}});ld=v("$ZodXor",(e,t)=>{Xr.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);c instanceof Promise?(a.push(c),i=!0):a.push(c)}return i?Promise.all(a).then(s=>Ig(s,o,e,n)):Ig(a,o,e,n)}}),dd=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Xr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(let d of c)n[s].add(d)}}return n});let o=Dn(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!cn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),ud=v("$ZodIntersection",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,d])=>Cg(r,c,d)):Cg(r,i,a)}});Ni=v("$ZodTuple",(e,t)=>{G.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=Pg(r,"optin"),c=Pg(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let d=new Array(r.length);for(let u=0;u<r.length;u++){let p=r[u]._zod.run({value:i[u],issues:[]},n);p instanceof Promise?a.push(p.then(h=>{d[u]=h})):d[u]=p}if(t.rest){let u=r.length-1,p=i.slice(r.length);for(let h of p){u++;let m=t.rest._zod.run({value:h,issues:[]},n);m instanceof Promise?a.push(m.then(f=>Og(f,o,u))):Og(m,o,u)}}return a.length?Promise.all(a).then(()=>Ng(d,o,r,i,c)):Ng(d,o,r,i,c)}});pd=v("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Ot(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){s.add(typeof d=="number"?d.toString():d);let u=t.keyType._zod.run({value:d,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>$e(m,o,ne())),input:d,path:[d],inst:e});continue}let p=u.value,h=t.valueType._zod.run({value:n[d],issues:[]},o);h instanceof Promise?i.push(h.then(m=>{m.issues.length&&r.issues.push(...Oe(d,m.issues)),r.value[p]=m.value})):(h.issues.length&&r.issues.push(...Oe(d,h.issues)),r.value[p]=h.value)}let c;for(let d in n)s.has(d)||(c=c??[],c.push(d));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&ki.test(s)&&c.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>$e(p,o,ne())),input:s,path:[s],inst:e});continue}let u=t.valueType._zod.run({value:n[s],issues:[]},o);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...Oe(s,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...Oe(s,u.issues)),r.value[c.value]=u.value)}}return i.length?Promise.all(i).then(()=>r):r}}),hd=v("$ZodMap",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let c=t.keyType._zod.run({value:a,issues:[]},o),d=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise||d instanceof Promise?i.push(Promise.all([c,d]).then(([u,p])=>{Rg(u,p,r,a,n,e,o)})):Rg(c,d,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});md=v("$ZodSet",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(c=>Dg(c,r))):Dg(s,r)}return i.length?Promise.all(i).then(()=>r):r}});fd=v("$ZodEnum",(e,t)=>{G.init(e,t);let r=Ur(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Gr.has(typeof n)).map(n=>typeof n=="string"?We(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),gd=v("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?We(o):o?We(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),yd=v("$ZodFile",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),vd=v("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new It(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new qe;return r.value=n,r.fallback=!0,r}});Ri=v("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Fr(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Lg(a,n)):Lg(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),bd=v("$ZodExactOptional",(e,t)=>{Ri.init(e,t),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),wd=v("$ZodNullable",(e,t)=>{G.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Fr(r.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),_d=v("$ZodDefault",(e,t)=>{G.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jg(i,t)):jg(n,t)}});kd=v("$ZodPrefault",(e,t)=>{G.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),xd=v("$ZodNonOptional",(e,t)=>{G.init(e,t),W(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Mg(i,e)):Mg(n,e)}});Sd=v("$ZodSuccess",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new It("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),$d=v("$ZodCatch",(e,t)=>{G.init(e,t),e._zod.optin="optional",W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>$e(a,o,ne()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>$e(i,o,ne()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Ed=v("$ZodNaN",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Di=v("$ZodPipe",(e,t)=>{G.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ti(a,t.in,o)):Ti(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Ti(i,t.out,o)):Ti(n,t.out,o)}});Qr=v("$ZodCodec",(e,t)=>{G.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Ai(a,t,o)):Ai(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ai(a,t,o)):Ai(i,t,o)}}});Td=v("$ZodPreprocess",(e,t)=>{Di.init(e,t)}),Ad=v("$ZodReadonly",(e,t)=>{G.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType?._zod?.optin),W(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(zg):zg(n)}});Id=v("$ZodTemplateLiteral",(e,t)=>{G.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||yc.has(typeof o))r.push(We(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Cd=v("$ZodFunction",(e,t)=>(G.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?ui(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?ui(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await pi(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await pi(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Ni({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Pd=v("$ZodPromise",(e,t)=>{G.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Od=v("$ZodLazy",(e,t)=>{G.init(e,t),W(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),W(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),W(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),W(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),W(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Nd=v("$ZodCustom",(e,t)=>{X.init(e,t),G.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Ug(i,r,o,e));Ug(n,r,o,e)}})});function Kg(){return{localeError:wT()}}var wT,Vg=y(()=>{M();wT=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${E(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${w(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function Hg(){return{localeError:_T()}}var _T,Jg=y(()=>{M();_T=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${E(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function Yg(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function qg(){return{localeError:kT()}}var kT,Xg=y(()=>{M();kT=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${E(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Yg(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Yg(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Qg(){return{localeError:xT()}}var xT,ey=y(()=>{M();xT=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${E(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function ty(){return{localeError:ST()}}var ST,ny=y(()=>{M();ST=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${E(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function ry(){return{localeError:$T()}}var $T,oy=y(()=>{M();$T=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${E(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function iy(){return{localeError:ET()}}var ET,ay=y(()=>{M();ET=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${E(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function sy(){return{localeError:TT()}}var TT,cy=y(()=>{M();TT=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${E(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function ly(){return{localeError:AT()}}var AT,dy=y(()=>{M();AT=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${E(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Li(){return{localeError:IT()}}var IT,Dd=y(()=>{M();IT=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${E(n.values[0])}`:`Invalid option: expected one of ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function uy(){return{localeError:CT()}}var CT,py=y(()=>{M();CT=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${E(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function hy(){return{localeError:PT()}}var PT,my=y(()=>{M();PT=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${E(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function fy(){return{localeError:OT()}}var OT,gy=y(()=>{M();OT=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${E(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function yy(){return{localeError:NT()}}var NT,vy=y(()=>{M();NT=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${E(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function by(){return{localeError:RT()}}var RT,wy=y(()=>{M();RT=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${E(n.values[0])} attendu`:`Option invalide : une valeur parmi ${w(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function _y(){return{localeError:DT()}}var DT,ky=y(()=>{M();DT=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${E(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function xy(){return{localeError:LT()}}var LT,Sy=y(()=>{M();LT=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=d=>d?e[d]:void 0,o=d=>{let u=r(d);return u?u.label:d??e.unknown.label},n=d=>`\u05D4${o(d)}`,i=d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=d=>d?t[d]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let u=d.expected,p=c[u??""]??o(u),h=A(d.input),m=c[h]??e[h]?.label??h;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${E(d.values[0])}`;let u=d.values.map(m=>E(m));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=a(d.origin),p=n(d.origin??"value");if(d.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${u?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let f=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(d.origin==="array"||d.origin==="set"){let f=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",b=d.inclusive?`${d.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let h=d.inclusive?"<=":"<",m=i(d.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${h}${d.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${m} ${h}${d.maximum.toString()}`}case"too_small":{let u=a(d.origin),p=n(d.origin??"value");if(d.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${u?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let f=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(d.origin==="array"||d.origin==="set"){let f=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let x=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let b=d.inclusive?`${d.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let h=d.inclusive?">=":">",m=i(d.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${h}${d.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${m} ${h}${d.minimum.toString()}`}case"invalid_format":{let u=d;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let p=s[u.format],h=p?.label??u.format,f=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${f}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function $y(){return{localeError:jT()}}var jT,Ey=y(()=>{M();jT=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${E(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${w(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function Ty(){return{localeError:MT()}}var MT,Ay=y(()=>{M();MT=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${E(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Iy(e,t,r){return Math.abs(e)===1?t:r}function Gn(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function Cy(){return{localeError:zT()}}var zT,Py=y(()=>{M();zT=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${E(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Iy(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Iy(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gn(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${w(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Gn(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Gn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Oy(){return{localeError:UT()}}var UT,Ny=y(()=>{M();UT=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${E(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function Ry(){return{localeError:FT()}}var FT,Dy=y(()=>{M();FT=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${E(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${w(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function Ly(){return{localeError:GT()}}var GT,jy=y(()=>{M();GT=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${E(n.values[0])}`:`Opzione non valida: atteso uno tra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${w(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function My(){return{localeError:BT()}}var BT,zy=y(()=>{M();BT=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${E(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${w(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function Uy(){return{localeError:WT()}}var WT,Fy=y(()=>{M();WT=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${E(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function ji(){return{localeError:ZT()}}var ZT,Ld=y(()=>{M();ZT=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${E(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Gy(){return ji()}var By=y(()=>{Ld()});function Wy(){return{localeError:KT()}}var KT,Zy=y(()=>{M();KT=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${E(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function Ky(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function Vy(){return{localeError:VT()}}var eo,VT,Hy=y(()=>{M();eo=e=>e.charAt(0).toUpperCase()+e.slice(1);VT=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let c=e[n]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${E(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,Ky(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${eo(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${eo(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,Ky(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${eo(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${eo(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${w(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${eo(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Jy(){return{localeError:HT()}}var HT,Yy=y(()=>{M();HT=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${E(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function qy(){return{localeError:JT()}}var JT,Xy=y(()=>{M();JT=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${E(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function Qy(){return{localeError:YT()}}var YT,ev=y(()=>{M();YT=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${E(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function tv(){return{localeError:qT()}}var qT,nv=y(()=>{M();qT=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${E(n.values[0])}`:`Ugyldig valg: forventet en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function rv(){return{localeError:XT()}}var XT,ov=y(()=>{M();XT=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${E(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function iv(){return{localeError:QT()}}var QT,av=y(()=>{M();QT=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${E(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function sv(){return{localeError:eA()}}var eA,cv=y(()=>{M();eA=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${E(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function lv(){return{localeError:tA()}}var tA,dv=y(()=>{M();tA=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${E(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function uv(){return{localeError:nA()}}var nA,pv=y(()=>{M();nA=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${E(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${w(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function hv(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function mv(){return{localeError:rA()}}var rA,fv=y(()=>{M();rA=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${E(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=hv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=hv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function gv(){return{localeError:oA()}}var oA,yv=y(()=>{M();oA=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${E(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function vv(){return{localeError:iA()}}var iA,bv=y(()=>{M();iA=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${E(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function wv(){return{localeError:aA()}}var aA,_v=y(()=>{M();aA=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${E(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function kv(){return{localeError:sA()}}var sA,xv=y(()=>{M();sA=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${E(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Sv(){return{localeError:cA()}}var cA,$v=y(()=>{M();cA=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${E(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Mi(){return{localeError:lA()}}var lA,jd=y(()=>{M();lA=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${E(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function Ev(){return Mi()}var Tv=y(()=>{jd()});function Av(){return{localeError:dA()}}var dA,Iv=y(()=>{M();dA=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${E(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${w(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Cv(){return{localeError:uA()}}var uA,Pv=y(()=>{M();uA=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${E(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function Ov(){return{localeError:pA()}}var pA,Nv=y(()=>{M();pA=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${E(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Rv(){return{localeError:hA()}}var hA,Dv=y(()=>{M();hA=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${E(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Lv(){return{localeError:mA()}}var mA,jv=y(()=>{M();mA=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${E(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${w(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function Mv(){return{localeError:fA()}}var fA,zv=y(()=>{M();fA=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=A(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${E(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var to={};nt(to,{ar:()=>Kg,az:()=>Hg,be:()=>qg,bg:()=>Qg,ca:()=>ty,cs:()=>ry,da:()=>iy,de:()=>sy,el:()=>ly,en:()=>Li,eo:()=>uy,es:()=>hy,fa:()=>fy,fi:()=>yy,fr:()=>by,frCA:()=>_y,he:()=>xy,hr:()=>$y,hu:()=>Ty,hy:()=>Cy,id:()=>Oy,is:()=>Ry,it:()=>Ly,ja:()=>My,ka:()=>Uy,kh:()=>Gy,km:()=>ji,ko:()=>Wy,lt:()=>Vy,mk:()=>Jy,ms:()=>qy,nl:()=>Qy,no:()=>tv,ota:()=>rv,pl:()=>sv,ps:()=>iv,pt:()=>lv,ro:()=>uv,ru:()=>mv,sl:()=>gv,sv:()=>vv,ta:()=>wv,th:()=>kv,tr:()=>Sv,ua:()=>Ev,uk:()=>Mi,ur:()=>Av,uz:()=>Cv,vi:()=>Ov,yo:()=>Mv,zhCN:()=>Rv,zhTW:()=>Lv});var Md=y(()=>{Vg();Jg();Xg();ey();ny();oy();ay();cy();dy();Dd();py();my();gy();vy();wy();ky();Sy();Ey();Ay();Py();Ny();Dy();jy();zy();Fy();By();Ld();Zy();Hy();Yy();Xy();ev();nv();ov();av();cv();dv();pv();fv();yv();bv();_v();xv();$v();Tv();jd();Iv();Pv();Nv();Dv();jv();zv()});function Ui(){return new zi}var Uv,zd,Ud,zi,me,no=y(()=>{zd=Symbol("ZodOutput"),Ud=Symbol("ZodInput"),zi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(Uv=globalThis).__zod_globalRegistry??(Uv.__zod_globalRegistry=Ui());me=globalThis.__zod_globalRegistry});function Fd(e,t){return new e({type:"string",...C(t)})}function Gd(e,t){return new e({type:"string",coerce:!0,...C(t)})}function Fi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...C(t)})}function ro(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...C(t)})}function Gi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...C(t)})}function Bi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(t)})}function Wi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(t)})}function Zi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(t)})}function oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...C(t)})}function Ki(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...C(t)})}function Vi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(t)})}function Hi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...C(t)})}function Ji(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(t)})}function Yi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...C(t)})}function qi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...C(t)})}function Xi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(t)})}function Qi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(t)})}function ea(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(t)})}function Bd(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...C(t)})}function ta(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(t)})}function na(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(t)})}function ra(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...C(t)})}function oa(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...C(t)})}function ia(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...C(t)})}function aa(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...C(t)})}function Zd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(t)})}function Kd(e,t){return new e({type:"string",format:"date",check:"string_format",...C(t)})}function Vd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...C(t)})}function Hd(e,t){return new e({type:"string",format:"duration",check:"string_format",...C(t)})}function Jd(e,t){return new e({type:"number",checks:[],...C(t)})}function Yd(e,t){return new e({type:"number",coerce:!0,checks:[],...C(t)})}function qd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...C(t)})}function Xd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...C(t)})}function Qd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...C(t)})}function eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...C(t)})}function tu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...C(t)})}function nu(e,t){return new e({type:"boolean",...C(t)})}function ru(e,t){return new e({type:"boolean",coerce:!0,...C(t)})}function ou(e,t){return new e({type:"bigint",...C(t)})}function iu(e,t){return new e({type:"bigint",coerce:!0,...C(t)})}function au(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(t)})}function su(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(t)})}function cu(e,t){return new e({type:"symbol",...C(t)})}function lu(e,t){return new e({type:"undefined",...C(t)})}function du(e,t){return new e({type:"null",...C(t)})}function uu(e){return new e({type:"any"})}function pu(e){return new e({type:"unknown"})}function hu(e,t){return new e({type:"never",...C(t)})}function mu(e,t){return new e({type:"void",...C(t)})}function fu(e,t){return new e({type:"date",...C(t)})}function gu(e,t){return new e({type:"date",coerce:!0,...C(t)})}function yu(e,t){return new e({type:"nan",...C(t)})}function rt(e,t){return new Si({check:"less_than",...C(t),value:e,inclusive:!1})}function Ue(e,t){return new Si({check:"less_than",...C(t),value:e,inclusive:!0})}function ot(e,t){return new $i({check:"greater_than",...C(t),value:e,inclusive:!1})}function Ee(e,t){return new $i({check:"greater_than",...C(t),value:e,inclusive:!0})}function sa(e){return ot(0,e)}function ca(e){return rt(0,e)}function la(e){return Ue(0,e)}function da(e){return Ee(0,e)}function Rt(e,t){return new rl({check:"multiple_of",...C(t),value:e})}function Dt(e,t){return new al({check:"max_size",...C(t),maximum:e})}function it(e,t){return new sl({check:"min_size",...C(t),minimum:e})}function un(e,t){return new cl({check:"size_equals",...C(t),size:e})}function pn(e,t){return new ll({check:"max_length",...C(t),maximum:e})}function mt(e,t){return new dl({check:"min_length",...C(t),minimum:e})}function hn(e,t){return new ul({check:"length_equals",...C(t),length:e})}function Bn(e,t){return new pl({check:"string_format",format:"regex",...C(t),pattern:e})}function Wn(e){return new hl({check:"string_format",format:"lowercase",...C(e)})}function Zn(e){return new ml({check:"string_format",format:"uppercase",...C(e)})}function Kn(e,t){return new fl({check:"string_format",format:"includes",...C(t),includes:e})}function Vn(e,t){return new gl({check:"string_format",format:"starts_with",...C(t),prefix:e})}function Hn(e,t){return new yl({check:"string_format",format:"ends_with",...C(t),suffix:e})}function ua(e,t,r){return new vl({check:"property",property:e,schema:t,...C(r)})}function Jn(e,t){return new bl({check:"mime_type",mime:e,...C(t)})}function Xe(e){return new wl({check:"overwrite",tx:e})}function Yn(e){return Xe(t=>t.normalize(e))}function qn(){return Xe(e=>e.trim())}function Xn(){return Xe(e=>e.toLowerCase())}function Qn(){return Xe(e=>e.toUpperCase())}function er(){return Xe(e=>mc(e))}function vu(e,t,r){return new e({type:"array",element:t,...C(r)})}function yA(e,t,r){return new e({type:"union",options:t,...C(r)})}function vA(e,t,r){return new e({type:"union",options:t,inclusive:!1,...C(r)})}function bA(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...C(o)})}function wA(e,t,r){return new e({type:"intersection",left:t,right:r})}function _A(e,t,r,o){let n=r instanceof G,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...C(i)})}function kA(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...C(o)})}function xA(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...C(o)})}function SA(e,t,r){return new e({type:"set",valueType:t,...C(r)})}function $A(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...C(r)})}function EA(e,t,r){return new e({type:"enum",entries:t,...C(r)})}function TA(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...C(r)})}function bu(e,t){return new e({type:"file",...C(t)})}function AA(e,t){return new e({type:"transform",transform:t})}function IA(e,t){return new e({type:"optional",innerType:t})}function CA(e,t){return new e({type:"nullable",innerType:t})}function PA(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():gc(r)}})}function OA(e,t,r){return new e({type:"nonoptional",innerType:t,...C(r)})}function NA(e,t){return new e({type:"success",innerType:t})}function RA(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function DA(e,t,r){return new e({type:"pipe",in:t,out:r})}function LA(e,t){return new e({type:"readonly",innerType:t})}function jA(e,t,r){return new e({type:"template_literal",parts:t,...C(r)})}function MA(e,t){return new e({type:"lazy",getter:t})}function zA(e,t){return new e({type:"promise",innerType:t})}function wu(e,t,r){let o=C(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function _u(e,t,r){return new e({type:"custom",check:"custom",fn:t,...C(r)})}function ku(e,t){let r=Fv(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Ln(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Ln(i))}},e(o.value,o)),t);return r}function Fv(e,t){let r=new X({check:"custom",...C(t)});return r._zod.check=e,r}function xu(e){let t=new X({check:"describe"});return t._zod.onattach=[r=>{let o=me.get(r)??{};me.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Su(e){let t=new X({check:"meta"});return t._zod.onattach=[r=>{let o=me.get(r)??{};me.add(r,{...o,...e})}],t._zod.check=()=>{},t}function $u(e,t){let r=C(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),n=n.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(o),a=new Set(n),s=e.Codec??Qr,c=e.Boolean??qr,d=e.String??dn,u=new d({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),h=new s({type:"pipe",in:u,out:p,transform:((m,f)=>{let b=m;return r.case!=="sensitive"&&(b=b.toLowerCase()),i.has(b)?!0:a.has(b)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:f.value,inst:h,continue:!1}),{})}),reverseTransform:((m,f)=>m===!0?o[0]||"true":n[0]||"false"),error:r.error});return h}function tr(e,t,r,o={}){let n=C(o),i={...C(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var Wd,Gv=y(()=>{Ei();no();Rd();M();Wd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Lt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??me,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function H(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{let h=a.schema,m=t.processors[n.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,h,u)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),H(p,t,u),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&Te(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function jt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=o.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,h=e.external.uri??(f=>f);if(p)return{ref:h(p)};let m=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=m,{defId:m,ref:`${h("__shared")}#/${s}/${m}`}}if(a[1]===r)return{ref:"#"};let d=`#/${s}/`,u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:d+u}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:d}=n(a);s.def={...s.schema},d&&(s.defId=d);let u=s.schema;for(let p in u)delete u[p];u.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
8922
9294
 
8923
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function jt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let l=e.seen.get(s);if(l.ref===null)return;let d=l.def??l.schema,u={...d},p=l.ref;if(l.ref=null,p){o(p);let h=e.seen.get(p),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(f)):Object.assign(d,f),Object.assign(d,u),s._zod.parent===p)for(let x in d)x==="$ref"||x==="allOf"||x in u||delete d[x];if(f.$ref&&h.def)for(let x in d)x==="$ref"||x==="allOf"||x in h.def&&JSON.stringify(d[x])===JSON.stringify(h.def[x])&&delete d[x]}let m=s._zod.parent;if(m&&m!==p){o(m);let h=e.seen.get(m);if(h?.schema.$ref&&(d.$ref=h.schema.$ref,h.def))for(let f in d)f==="$ref"||f==="allOf"||f in h.def&&JSON.stringify(d[f])===JSON.stringify(h.def[f])&&delete d[f]}e.override({zodSchema:s,jsonSchema:d,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:tr(t,"input",e.processors),output:tr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Ee(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ee(o.element,r);if(o.type==="set")return Ee(o.valueType,r);if(o.type==="lazy")return Ee(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Ee(o.innerType,r);if(o.type==="intersection")return Ee(o.left,r)||Ee(o.right,r);if(o.type==="record"||o.type==="map")return Ee(o.keyType,r)||Ee(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ee(o.in,r)||Ee(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ee(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ee(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ee(n,r))return!0;return!!(o.rest&&Ee(o.rest,r))}return!1}var $u,tr,no=g(()=>{Qr();$u=(e,t={})=>r=>{let o=Dt({...r,processors:t});return H(e,o),Lt(o,e),jt(o,e)},tr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Dt({...n??{},target:i,io:t,processors:r});return H(e,a),Lt(a,e),jt(a,e)}});function ma(e,t){if("_idmap"in e){let o=e,n=Dt({...t,processors:da}),i={};for(let l of o._idmap.entries()){let[d,u]=l;H(u,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let l of o._idmap.entries()){let[d,u]=l;Lt(n,u),a[d]=jt(n,u)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:i}}return{schemas:a}}let r=Dt({...t,processors:da});return H(e,r),Lt(r,e),jt(r,e)}var CA,Eu,Tu,Au,Iu,Cu,Pu,Ou,Nu,Ru,Du,Lu,ju,Mu,zu,Uu,Fu,Bu,Gu,Wu,Zu,Ku,Vu,Hu,Ju,Yu,ua,qu,Xu,Qu,ep,tp,np,rp,op,ip,ap,sp,pa,cp,da,ro=g(()=>{no();M();CA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Eu=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=CA[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),d&&(n.contentEncoding=d),l&&l.size>0){let u=[...l];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Tu=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let p=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),m=typeof d=="number"&&d<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";p?h?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof i=="number"&&(n.minimum=i),m?h?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof a=="number"&&(n.maximum=a),typeof l=="number"&&(n.multipleOf=l)},Au=(e,t,r,o)=>{r.type="boolean"},Iu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Cu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Pu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ou=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Nu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{r.not={}},Du=(e,t,r,o)=>{},Lu=(e,t,r,o)=>{},ju=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Mu=(e,t,r,o)=>{let n=e._zod.def,i=jr(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},zu=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Uu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Fu=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Bu=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(d=>({contentMediaType:d}))):Object.assign(n,i)},Gu=(e,t,r,o)=>{r.type="boolean"},Wu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Zu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ku=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Vu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Hu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ju=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=H(i.element,t,{...o,path:[...o.path,"items"]})},Yu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let d in a)n.properties[d]=H(a[d],t,{...o,path:[...o.path,"properties",d]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(d=>{let u=i.shape[d]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=H(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ua=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,l)=>H(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},qu=(e,t,r,o)=>{let n=e._zod.def,i=H(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=H(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},Xu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((m,h)=>H(m,t,{...o,path:[...o.path,a,h]})),d=i.rest?H(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:l},d&&n.items.anyOf.push(d),n.minItems=l.length,d||(n.maxItems=l.length)):(n.items=l,d&&(n.additionalItems=d));let{minimum:u,maximum:p}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof p=="number"&&(n.maxItems=p)},Qu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let u=H(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of l)n.patternProperties[p.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=H(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=H(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let d=a._zod.values;if(d){let u=[...d].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(n.required=u)}},ep=(e,t,r,o)=>{let n=e._zod.def,i=H(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},tp=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},np=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},rp=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},op=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},ip=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;H(a,t,o);let s=t.seen.get(e);s.ref=a},ap=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},sp=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},pa=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},cp=(e,t,r,o)=>{let n=e._zod.innerType;H(n,t,o);let i=t.seen.get(e);i.ref=n},da={string:Eu,number:Tu,boolean:Au,bigint:Iu,symbol:Cu,null:Pu,undefined:Ou,void:Nu,never:Ru,any:Du,unknown:Lu,date:ju,enum:Mu,literal:zu,nan:Uu,template_literal:Fu,file:Bu,success:Gu,custom:Wu,function:Zu,transform:Ku,map:Vu,set:Hu,array:Ju,object:Yu,union:ua,intersection:qu,tuple:Xu,record:Qu,nullable:ep,nonoptional:tp,default:np,prefault:rp,catch:op,pipe:ip,readonly:ap,promise:sp,optional:pa,lazy:cp}});var ha,Bv=g(()=>{ro();no();ha=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Dt({processors:da,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return H(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Lt(this.ctx,t);let o=jt(this.ctx,t),{"~standard":n,...i}=o;return i}}});var Gv={};var Wv=g(()=>{});var ft={};nt(ft,{$ZodAny:()=>td,$ZodArray:()=>ad,$ZodAsyncError:()=>Ye,$ZodBase64:()=>Zl,$ZodBase64URL:()=>Kl,$ZodBigInt:()=>Ci,$ZodBigIntFormat:()=>ql,$ZodBoolean:()=>Hr,$ZodCIDRv4:()=>Bl,$ZodCIDRv6:()=>Gl,$ZodCUID:()=>Cl,$ZodCUID2:()=>Pl,$ZodCatch:()=>Sd,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>ol,$ZodCheckEndsWith:()=>gl,$ZodCheckGreaterThan:()=>xi,$ZodCheckIncludes:()=>hl,$ZodCheckLengthEquals:()=>dl,$ZodCheckLessThan:()=>ki,$ZodCheckLowerCase:()=>pl,$ZodCheckMaxLength:()=>cl,$ZodCheckMaxSize:()=>il,$ZodCheckMimeType:()=>vl,$ZodCheckMinLength:()=>ll,$ZodCheckMinSize:()=>al,$ZodCheckMultipleOf:()=>nl,$ZodCheckNumberFormat:()=>rl,$ZodCheckOverwrite:()=>bl,$ZodCheckProperty:()=>yl,$ZodCheckRegex:()=>ul,$ZodCheckSizeEquals:()=>sl,$ZodCheckStartsWith:()=>fl,$ZodCheckStringFormat:()=>Un,$ZodCheckUpperCase:()=>ml,$ZodCodec:()=>Yr,$ZodCustom:()=>Od,$ZodCustomStringFormat:()=>Jl,$ZodDate:()=>id,$ZodDefault:()=>_d,$ZodDiscriminatedUnion:()=>ld,$ZodE164:()=>Vl,$ZodEmail:()=>El,$ZodEmoji:()=>Al,$ZodEncodeError:()=>At,$ZodEnum:()=>hd,$ZodError:()=>Br,$ZodExactOptional:()=>vd,$ZodFile:()=>gd,$ZodFunction:()=>Id,$ZodGUID:()=>Sl,$ZodIPv4:()=>zl,$ZodIPv6:()=>Ul,$ZodISODate:()=>Ll,$ZodISODateTime:()=>Dl,$ZodISODuration:()=>Ml,$ZodISOTime:()=>jl,$ZodIntersection:()=>dd,$ZodJWT:()=>Hl,$ZodKSUID:()=>Rl,$ZodLazy:()=>Pd,$ZodLiteral:()=>fd,$ZodMAC:()=>Fl,$ZodMap:()=>pd,$ZodNaN:()=>$d,$ZodNanoID:()=>Il,$ZodNever:()=>rd,$ZodNonOptional:()=>kd,$ZodNull:()=>ed,$ZodNullable:()=>bd,$ZodNumber:()=>Ii,$ZodNumberFormat:()=>Yl,$ZodObject:()=>Wg,$ZodObjectJIT:()=>sd,$ZodOptional:()=>Oi,$ZodPipe:()=>Ni,$ZodPrefault:()=>wd,$ZodPreprocess:()=>Ed,$ZodPromise:()=>Cd,$ZodReadonly:()=>Td,$ZodRealError:()=>Pe,$ZodRecord:()=>ud,$ZodRegistry:()=>ji,$ZodSet:()=>md,$ZodString:()=>cn,$ZodStringFormat:()=>Y,$ZodSuccess:()=>xd,$ZodSymbol:()=>Xl,$ZodTemplateLiteral:()=>Ad,$ZodTransform:()=>yd,$ZodTuple:()=>Pi,$ZodType:()=>B,$ZodULID:()=>Ol,$ZodURL:()=>Tl,$ZodUUID:()=>$l,$ZodUndefined:()=>Ql,$ZodUnion:()=>Jr,$ZodUnknown:()=>nd,$ZodVoid:()=>od,$ZodXID:()=>Nl,$ZodXor:()=>cd,$brand:()=>lc,$constructor:()=>v,$input:()=>zd,$output:()=>Md,Doc:()=>Vr,JSONSchema:()=>Gv,JSONSchemaGenerator:()=>ha,NEVER:()=>cc,TimePrecision:()=>Gd,_any:()=>du,_array:()=>yu,_base64:()=>ta,_base64url:()=>na,_bigint:()=>ru,_boolean:()=>tu,_catch:()=>SA,_check:()=>Uv,_cidrv4:()=>Qi,_cidrv6:()=>ea,_coercedBigint:()=>ou,_coercedBoolean:()=>nu,_coercedDate:()=>fu,_coercedNumber:()=>Jd,_coercedString:()=>Fd,_cuid:()=>Ki,_cuid2:()=>Vi,_custom:()=>bu,_date:()=>hu,_decode:()=>pi,_decodeAsync:()=>hi,_default:()=>wA,_discriminatedUnion:()=>lA,_e164:()=>ra,_email:()=>zi,_emoji:()=>Wi,_encode:()=>ui,_encodeAsync:()=>mi,_endsWith:()=>Vn,_enum:()=>fA,_file:()=>vu,_float32:()=>qd,_float64:()=>Xd,_gt:()=>ot,_gte:()=>$e,_guid:()=>eo,_includes:()=>Zn,_int:()=>Yd,_int32:()=>Qd,_int64:()=>iu,_intersection:()=>dA,_ipv4:()=>qi,_ipv6:()=>Xi,_isoDate:()=>Zd,_isoDateTime:()=>Wd,_isoDuration:()=>Vd,_isoTime:()=>Kd,_jwt:()=>oa,_ksuid:()=>Yi,_lazy:()=>AA,_length:()=>un,_literal:()=>yA,_lowercase:()=>Gn,_lt:()=>rt,_lte:()=>Me,_mac:()=>Bd,_map:()=>mA,_max:()=>Me,_maxLength:()=>dn,_maxSize:()=>Rt,_mime:()=>Hn,_min:()=>$e,_minLength:()=>ht,_minSize:()=>it,_multipleOf:()=>Nt,_nan:()=>gu,_nanoid:()=>Zi,_nativeEnum:()=>gA,_negative:()=>aa,_never:()=>pu,_nonnegative:()=>ca,_nonoptional:()=>kA,_nonpositive:()=>sa,_normalize:()=>Jn,_null:()=>lu,_nullable:()=>_A,_number:()=>Hd,_optional:()=>bA,_overwrite:()=>qe,_parse:()=>Ln,_parseAsync:()=>jn,_pipe:()=>$A,_positive:()=>ia,_promise:()=>IA,_property:()=>la,_readonly:()=>EA,_record:()=>pA,_refine:()=>_u,_regex:()=>Bn,_safeDecode:()=>gi,_safeDecodeAsync:()=>vi,_safeEncode:()=>fi,_safeEncodeAsync:()=>yi,_safeParse:()=>Mn,_safeParseAsync:()=>zn,_set:()=>hA,_size:()=>ln,_slugify:()=>Qn,_startsWith:()=>Kn,_string:()=>Ud,_stringFormat:()=>er,_stringbool:()=>Su,_success:()=>xA,_superRefine:()=>wu,_symbol:()=>su,_templateLiteral:()=>TA,_toLowerCase:()=>qn,_toUpperCase:()=>Xn,_transform:()=>vA,_trim:()=>Yn,_tuple:()=>uA,_uint32:()=>eu,_uint64:()=>au,_ulid:()=>Hi,_undefined:()=>cu,_union:()=>sA,_unknown:()=>uu,_uppercase:()=>Wn,_url:()=>to,_uuid:()=>Ui,_uuidv4:()=>Fi,_uuidv6:()=>Bi,_uuidv7:()=>Gi,_void:()=>mu,_xid:()=>Ji,_xor:()=>cA,clone:()=>xe,config:()=>ne,createStandardJSONSchemaMethod:()=>tr,createToJSONSchemaMethod:()=>$u,decode:()=>IE,decodeAsync:()=>PE,describe:()=>ku,encode:()=>AE,encodeAsync:()=>CE,extractDefs:()=>Lt,finalize:()=>jt,flattenError:()=>Gr,formatError:()=>Wr,globalConfig:()=>rn,globalRegistry:()=>he,initializeContext:()=>Dt,isValidBase64:()=>Wl,isValidBase64URL:()=>Ug,isValidJWT:()=>Fg,locales:()=>Xr,meta:()=>xu,parse:()=>li,parseAsync:()=>di,prettifyError:()=>kc,process:()=>H,regexes:()=>je,registry:()=>Mi,safeDecode:()=>NE,safeDecodeAsync:()=>DE,safeEncode:()=>OE,safeEncodeAsync:()=>RE,safeParse:()=>Sc,safeParseAsync:()=>$c,toDotPath:()=>bg,toJSONSchema:()=>ma,treeifyError:()=>wc,util:()=>I,version:()=>wl});var ze=g(()=>{on();Ec();xc();Nd();Si();kl();M();wi();jd();Qr();_l();Fv();no();ro();Bv();Wv()});var fa={};nt(fa,{endsWith:()=>Vn,gt:()=>ot,gte:()=>$e,includes:()=>Zn,length:()=>un,lowercase:()=>Gn,lt:()=>rt,lte:()=>Me,maxLength:()=>dn,maxSize:()=>Rt,mime:()=>Hn,minLength:()=>ht,minSize:()=>it,multipleOf:()=>Nt,negative:()=>aa,nonnegative:()=>ca,nonpositive:()=>sa,normalize:()=>Jn,overwrite:()=>qe,positive:()=>ia,property:()=>la,regex:()=>Bn,size:()=>ln,slugify:()=>Qn,startsWith:()=>Kn,toLowerCase:()=>qn,toUpperCase:()=>Xn,trim:()=>Yn,uppercase:()=>Wn});var ga=g(()=>{ze()});var nr={};nt(nr,{ZodISODate:()=>va,ZodISODateTime:()=>ya,ZodISODuration:()=>_a,ZodISOTime:()=>ba,date:()=>dp,datetime:()=>lp,duration:()=>pp,time:()=>up});function lp(e){return Wd(ya,e)}function dp(e){return Zd(va,e)}function up(e){return Kd(ba,e)}function pp(e){return Vd(_a,e)}var ya,va,ba,_a,oo=g(()=>{ze();ao();ya=v("ZodISODateTime",(e,t)=>{Dl.init(e,t),q.init(e,t)});va=v("ZodISODate",(e,t)=>{Ll.init(e,t),q.init(e,t)});ba=v("ZodISOTime",(e,t)=>{jl.init(e,t),q.init(e,t)});_a=v("ZodISODuration",(e,t)=>{Ml.init(e,t),q.init(e,t)})});var Zv,OA,Oe,mp=g(()=>{ze();ze();M();Zv=(e,t)=>{Br.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Wr(e,r)},flatten:{value:r=>Gr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Nn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Nn,2)}},isEmpty:{get(){return e.issues.length===0}}})},OA=v("ZodError",Zv),Oe=v("ZodError",Zv,{Parent:Error})});var hp,fp,gp,yp,vp,bp,_p,wp,kp,xp,Sp,$p,Ep=g(()=>{ze();mp();hp=Ln(Oe),fp=jn(Oe),gp=Mn(Oe),yp=zn(Oe),vp=ui(Oe),bp=pi(Oe),_p=mi(Oe),wp=hi(Oe),kp=fi(Oe),xp=gi(Oe),Sp=yi(Oe),$p=vi(Oe)});var io={};nt(io,{ZodAny:()=>Rp,ZodArray:()=>Mp,ZodBase64:()=>La,ZodBase64URL:()=>ja,ZodBigInt:()=>lr,ZodBigIntFormat:()=>Ua,ZodBoolean:()=>cr,ZodCIDRv4:()=>Ra,ZodCIDRv6:()=>Da,ZodCUID:()=>Ta,ZodCUID2:()=>Aa,ZodCatch:()=>am,ZodCodec:()=>bo,ZodCustom:()=>_o,ZodCustomStringFormat:()=>ar,ZodDate:()=>ho,ZodDefault:()=>em,ZodDiscriminatedUnion:()=>Up,ZodE164:()=>Ma,ZodEmail:()=>Sa,ZodEmoji:()=>$a,ZodEnum:()=>or,ZodExactOptional:()=>qp,ZodFile:()=>Jp,ZodFunction:()=>gm,ZodGUID:()=>co,ZodIPv4:()=>Oa,ZodIPv6:()=>Na,ZodIntersection:()=>Fp,ZodJWT:()=>za,ZodKSUID:()=>Pa,ZodLazy:()=>mm,ZodLiteral:()=>Hp,ZodMAC:()=>Tp,ZodMap:()=>Kp,ZodNaN:()=>cm,ZodNanoID:()=>Ea,ZodNever:()=>Lp,ZodNonOptional:()=>Ka,ZodNull:()=>Op,ZodNullable:()=>Qp,ZodNumber:()=>sr,ZodNumberFormat:()=>mn,ZodObject:()=>go,ZodOptional:()=>Za,ZodPipe:()=>vo,ZodPrefault:()=>nm,ZodPreprocess:()=>lm,ZodPromise:()=>fm,ZodReadonly:()=>dm,ZodRecord:()=>rr,ZodSet:()=>Vp,ZodString:()=>ir,ZodStringFormat:()=>q,ZodSuccess:()=>im,ZodSymbol:()=>Cp,ZodTemplateLiteral:()=>pm,ZodTransform:()=>Yp,ZodTuple:()=>Gp,ZodType:()=>G,ZodULID:()=>Ia,ZodURL:()=>mo,ZodUUID:()=>at,ZodUndefined:()=>Pp,ZodUnion:()=>yo,ZodUnknown:()=>Dp,ZodVoid:()=>jp,ZodXID:()=>Ca,ZodXor:()=>zp,_ZodString:()=>xa,_default:()=>tm,_function:()=>Qb,any:()=>Cb,array:()=>fo,base64:()=>mb,base64url:()=>hb,bigint:()=>$b,boolean:()=>Ip,catch:()=>sm,check:()=>e_,cidrv4:()=>ub,cidrv6:()=>pb,codec:()=>Jb,cuid:()=>rb,cuid2:()=>ob,custom:()=>t_,date:()=>Ob,describe:()=>n_,discriminatedUnion:()=>Mb,e164:()=>fb,email:()=>Vv,emoji:()=>tb,enum:()=>Ga,exactOptional:()=>Xp,file:()=>Zb,float32:()=>wb,float64:()=>kb,function:()=>Qb,guid:()=>Hv,hash:()=>_b,hex:()=>bb,hostname:()=>vb,httpUrl:()=>eb,instanceof:()=>o_,int:()=>wa,int32:()=>xb,int64:()=>Eb,intersection:()=>Bp,invertCodec:()=>Yb,ipv4:()=>cb,ipv6:()=>db,json:()=>a_,jwt:()=>gb,keyof:()=>Nb,ksuid:()=>sb,lazy:()=>hm,literal:()=>Wb,looseObject:()=>Lb,looseRecord:()=>Ub,mac:()=>lb,map:()=>Fb,meta:()=>r_,nan:()=>Hb,nanoid:()=>nb,nativeEnum:()=>Gb,never:()=>Fa,nonoptional:()=>om,null:()=>Np,nullable:()=>uo,nullish:()=>Kb,number:()=>Ap,object:()=>Rb,optional:()=>lo,partialRecord:()=>zb,pipe:()=>ka,prefault:()=>rm,preprocess:()=>s_,promise:()=>Xb,readonly:()=>um,record:()=>Zp,refine:()=>ym,set:()=>Bb,strictObject:()=>Db,string:()=>so,stringFormat:()=>yb,stringbool:()=>i_,success:()=>Vb,superRefine:()=>vm,symbol:()=>Ab,templateLiteral:()=>qb,transform:()=>Wa,tuple:()=>Wp,uint32:()=>Sb,uint64:()=>Tb,ulid:()=>ib,undefined:()=>Ib,union:()=>Ba,unknown:()=>pn,url:()=>Qv,uuid:()=>Jv,uuidv4:()=>Yv,uuidv6:()=>qv,uuidv7:()=>Xv,void:()=>Pb,xid:()=>ab,xor:()=>jb});function po(e,t,r){let o=Object.getPrototypeOf(e),n=Kv.get(o);if(n||(n=new Set,Kv.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}function so(e){return Ud(ir,e)}function Vv(e){return zi(Sa,e)}function Hv(e){return eo(co,e)}function Jv(e){return Ui(at,e)}function Yv(e){return Fi(at,e)}function qv(e){return Bi(at,e)}function Xv(e){return Gi(at,e)}function Qv(e){return to(mo,e)}function eb(e){return to(mo,{protocol:je.httpProtocol,hostname:je.domain,...I.normalizeParams(e)})}function tb(e){return Wi($a,e)}function nb(e){return Zi(Ea,e)}function rb(e){return Ki(Ta,e)}function ob(e){return Vi(Aa,e)}function ib(e){return Hi(Ia,e)}function ab(e){return Ji(Ca,e)}function sb(e){return Yi(Pa,e)}function cb(e){return qi(Oa,e)}function lb(e){return Bd(Tp,e)}function db(e){return Xi(Na,e)}function ub(e){return Qi(Ra,e)}function pb(e){return ea(Da,e)}function mb(e){return ta(La,e)}function hb(e){return na(ja,e)}function fb(e){return ra(Ma,e)}function gb(e){return oa(za,e)}function yb(e,t,r={}){return er(ar,e,t,r)}function vb(e){return er(ar,"hostname",je.hostname,e)}function bb(e){return er(ar,"hex",je.hex,e)}function _b(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=je[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return er(ar,o,n,t)}function Ap(e){return Hd(sr,e)}function wa(e){return Yd(mn,e)}function wb(e){return qd(mn,e)}function kb(e){return Xd(mn,e)}function xb(e){return Qd(mn,e)}function Sb(e){return eu(mn,e)}function Ip(e){return tu(cr,e)}function $b(e){return ru(lr,e)}function Eb(e){return iu(Ua,e)}function Tb(e){return au(Ua,e)}function Ab(e){return su(Cp,e)}function Ib(e){return cu(Pp,e)}function Np(e){return lu(Op,e)}function Cb(){return du(Rp)}function pn(){return uu(Dp)}function Fa(e){return pu(Lp,e)}function Pb(e){return mu(jp,e)}function Ob(e){return hu(ho,e)}function fo(e,t){return yu(Mp,e,t)}function Nb(e){let t=e._zod.def.shape;return Ga(Object.keys(t))}function Rb(e,t){let r={type:"object",shape:e??{},...I.normalizeParams(t)};return new go(r)}function Db(e,t){return new go({type:"object",shape:e,catchall:Fa(),...I.normalizeParams(t)})}function Lb(e,t){return new go({type:"object",shape:e,catchall:pn(),...I.normalizeParams(t)})}function Ba(e,t){return new yo({type:"union",options:e,...I.normalizeParams(t)})}function jb(e,t){return new zp({type:"union",options:e,inclusive:!1,...I.normalizeParams(t)})}function Mb(e,t,r){return new Up({type:"union",options:t,discriminator:e,...I.normalizeParams(r)})}function Bp(e,t){return new Fp({type:"intersection",left:e,right:t})}function Wp(e,t,r){let o=t instanceof B,n=o?r:t,i=o?t:null;return new Gp({type:"tuple",items:e,rest:i,...I.normalizeParams(n)})}function Zp(e,t,r){return!t||!t._zod?new rr({type:"record",keyType:so(),valueType:e,...I.normalizeParams(t)}):new rr({type:"record",keyType:e,valueType:t,...I.normalizeParams(r)})}function zb(e,t,r){let o=xe(e);return o._zod.values=void 0,new rr({type:"record",keyType:o,valueType:t,...I.normalizeParams(r)})}function Ub(e,t,r){return new rr({type:"record",keyType:e,valueType:t,mode:"loose",...I.normalizeParams(r)})}function Fb(e,t,r){return new Kp({type:"map",keyType:e,valueType:t,...I.normalizeParams(r)})}function Bb(e,t){return new Vp({type:"set",valueType:e,...I.normalizeParams(t)})}function Ga(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new or({type:"enum",entries:r,...I.normalizeParams(t)})}function Gb(e,t){return new or({type:"enum",entries:e,...I.normalizeParams(t)})}function Wb(e,t){return new Hp({type:"literal",values:Array.isArray(e)?e:[e],...I.normalizeParams(t)})}function Zb(e){return vu(Jp,e)}function Wa(e){return new Yp({type:"transform",transform:e})}function lo(e){return new Za({type:"optional",innerType:e})}function Xp(e){return new qp({type:"optional",innerType:e})}function uo(e){return new Qp({type:"nullable",innerType:e})}function Kb(e){return lo(uo(e))}function tm(e,t){return new em({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}function rm(e,t){return new nm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}function om(e,t){return new Ka({type:"nonoptional",innerType:e,...I.normalizeParams(t)})}function Vb(e){return new im({type:"success",innerType:e})}function sm(e,t){return new am({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Hb(e){return gu(cm,e)}function ka(e,t){return new vo({type:"pipe",in:e,out:t})}function Jb(e,t,r){return new bo({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Yb(e){let t=e._zod.def;return new bo({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function um(e){return new dm({type:"readonly",innerType:e})}function qb(e,t){return new pm({type:"template_literal",parts:e,...I.normalizeParams(t)})}function hm(e){return new mm({type:"lazy",getter:e})}function Xb(e){return new fm({type:"promise",innerType:e})}function Qb(e){return new gm({type:"function",input:Array.isArray(e?.input)?Wp(e?.input):e?.input??fo(pn()),output:e?.output??pn()})}function e_(e){let t=new X({check:"custom"});return t._zod.check=e,t}function t_(e,t){return bu(_o,e??(()=>!0),t)}function ym(e,t={}){return _u(_o,e,t)}function vm(e,t){return wu(e,t)}function o_(e,t={}){let r=new _o({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...I.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function a_(e){let t=hm(()=>Ba([so(e),Ap(),Ip(),Np(),fo(t),Zp(so(),t)]));return t}function s_(e,t){return new lm({type:"pipe",in:Wa(e),out:t})}var Kv,G,xa,ir,q,Sa,co,at,mo,$a,Ea,Ta,Aa,Ia,Ca,Pa,Oa,Tp,Na,Ra,Da,La,ja,Ma,za,ar,sr,mn,cr,lr,Ua,Cp,Pp,Op,Rp,Dp,Lp,jp,ho,Mp,go,yo,zp,Up,Fp,Gp,rr,Kp,Vp,or,Hp,Jp,Yp,Za,qp,Qp,em,nm,Ka,im,am,cm,vo,bo,lm,dm,pm,mm,fm,gm,_o,n_,r_,i_,ao=g(()=>{ze();ze();ro();no();ga();oo();Ep();Kv=new WeakMap;G=v("ZodType",(e,t)=>(B.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tr(e,"input"),output:tr(e,"output")}}),e.toJSONSchema=$u(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>hp(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>gp(e,r,o),e.parseAsync=async(r,o)=>fp(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>yp(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>vp(e,r,o),e.decode=(r,o)=>bp(e,r,o),e.encodeAsync=async(r,o)=>_p(e,r,o),e.decodeAsync=async(r,o)=>wp(e,r,o),e.safeEncode=(r,o)=>kp(e,r,o),e.safeDecode=(r,o)=>xp(e,r,o),e.safeEncodeAsync=async(r,o)=>Sp(e,r,o),e.safeDecodeAsync=async(r,o)=>$p(e,r,o),po(e,"ZodType",{check(...r){let o=this.def;return this.clone(I.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return xe(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(ym(r,o))},superRefine(r,o){return this.check(vm(r,o))},overwrite(r){return this.check(qe(r))},optional(){return lo(this)},exactOptional(){return Xp(this)},nullable(){return uo(this)},nullish(){return lo(uo(this))},nonoptional(r){return om(this,r)},array(){return fo(this)},or(r){return Ba([this,r])},and(r){return Bp(this,r)},transform(r){return ka(this,Wa(r))},default(r){return tm(this,r)},prefault(r){return rm(this,r)},catch(r){return sm(this,r)},pipe(r){return ka(this,r)},readonly(){return um(this)},describe(r){let o=this.clone();return he.add(o,{description:r}),o},meta(...r){if(r.length===0)return he.get(this);let o=this.clone();return he.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return he.get(e)?.description},configurable:!0}),e)),xa=v("_ZodString",(e,t)=>{cn.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Eu(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,po(e,"_ZodString",{regex(...o){return this.check(Bn(...o))},includes(...o){return this.check(Zn(...o))},startsWith(...o){return this.check(Kn(...o))},endsWith(...o){return this.check(Vn(...o))},min(...o){return this.check(ht(...o))},max(...o){return this.check(dn(...o))},length(...o){return this.check(un(...o))},nonempty(...o){return this.check(ht(1,...o))},lowercase(o){return this.check(Gn(o))},uppercase(o){return this.check(Wn(o))},trim(){return this.check(Yn())},normalize(...o){return this.check(Jn(...o))},toLowerCase(){return this.check(qn())},toUpperCase(){return this.check(Xn())},slugify(){return this.check(Qn())}})}),ir=v("ZodString",(e,t)=>{cn.init(e,t),xa.init(e,t),e.email=r=>e.check(zi(Sa,r)),e.url=r=>e.check(to(mo,r)),e.jwt=r=>e.check(oa(za,r)),e.emoji=r=>e.check(Wi($a,r)),e.guid=r=>e.check(eo(co,r)),e.uuid=r=>e.check(Ui(at,r)),e.uuidv4=r=>e.check(Fi(at,r)),e.uuidv6=r=>e.check(Bi(at,r)),e.uuidv7=r=>e.check(Gi(at,r)),e.nanoid=r=>e.check(Zi(Ea,r)),e.guid=r=>e.check(eo(co,r)),e.cuid=r=>e.check(Ki(Ta,r)),e.cuid2=r=>e.check(Vi(Aa,r)),e.ulid=r=>e.check(Hi(Ia,r)),e.base64=r=>e.check(ta(La,r)),e.base64url=r=>e.check(na(ja,r)),e.xid=r=>e.check(Ji(Ca,r)),e.ksuid=r=>e.check(Yi(Pa,r)),e.ipv4=r=>e.check(qi(Oa,r)),e.ipv6=r=>e.check(Xi(Na,r)),e.cidrv4=r=>e.check(Qi(Ra,r)),e.cidrv6=r=>e.check(ea(Da,r)),e.e164=r=>e.check(ra(Ma,r)),e.datetime=r=>e.check(lp(r)),e.date=r=>e.check(dp(r)),e.time=r=>e.check(up(r)),e.duration=r=>e.check(pp(r))});q=v("ZodStringFormat",(e,t)=>{Y.init(e,t),xa.init(e,t)}),Sa=v("ZodEmail",(e,t)=>{El.init(e,t),q.init(e,t)});co=v("ZodGUID",(e,t)=>{Sl.init(e,t),q.init(e,t)});at=v("ZodUUID",(e,t)=>{$l.init(e,t),q.init(e,t)});mo=v("ZodURL",(e,t)=>{Tl.init(e,t),q.init(e,t)});$a=v("ZodEmoji",(e,t)=>{Al.init(e,t),q.init(e,t)});Ea=v("ZodNanoID",(e,t)=>{Il.init(e,t),q.init(e,t)});Ta=v("ZodCUID",(e,t)=>{Cl.init(e,t),q.init(e,t)});Aa=v("ZodCUID2",(e,t)=>{Pl.init(e,t),q.init(e,t)});Ia=v("ZodULID",(e,t)=>{Ol.init(e,t),q.init(e,t)});Ca=v("ZodXID",(e,t)=>{Nl.init(e,t),q.init(e,t)});Pa=v("ZodKSUID",(e,t)=>{Rl.init(e,t),q.init(e,t)});Oa=v("ZodIPv4",(e,t)=>{zl.init(e,t),q.init(e,t)});Tp=v("ZodMAC",(e,t)=>{Fl.init(e,t),q.init(e,t)});Na=v("ZodIPv6",(e,t)=>{Ul.init(e,t),q.init(e,t)});Ra=v("ZodCIDRv4",(e,t)=>{Bl.init(e,t),q.init(e,t)});Da=v("ZodCIDRv6",(e,t)=>{Gl.init(e,t),q.init(e,t)});La=v("ZodBase64",(e,t)=>{Zl.init(e,t),q.init(e,t)});ja=v("ZodBase64URL",(e,t)=>{Kl.init(e,t),q.init(e,t)});Ma=v("ZodE164",(e,t)=>{Vl.init(e,t),q.init(e,t)});za=v("ZodJWT",(e,t)=>{Hl.init(e,t),q.init(e,t)});ar=v("ZodCustomStringFormat",(e,t)=>{Jl.init(e,t),q.init(e,t)});sr=v("ZodNumber",(e,t)=>{Ii.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Tu(e,o,n,i),po(e,"ZodNumber",{gt(o,n){return this.check(ot(o,n))},gte(o,n){return this.check($e(o,n))},min(o,n){return this.check($e(o,n))},lt(o,n){return this.check(rt(o,n))},lte(o,n){return this.check(Me(o,n))},max(o,n){return this.check(Me(o,n))},int(o){return this.check(wa(o))},safe(o){return this.check(wa(o))},positive(o){return this.check(ot(0,o))},nonnegative(o){return this.check($e(0,o))},negative(o){return this.check(rt(0,o))},nonpositive(o){return this.check(Me(0,o))},multipleOf(o,n){return this.check(Nt(o,n))},step(o,n){return this.check(Nt(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});mn=v("ZodNumberFormat",(e,t)=>{Yl.init(e,t),sr.init(e,t)});cr=v("ZodBoolean",(e,t)=>{Hr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n)});lr=v("ZodBigInt",(e,t)=>{Ci.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Iu(e,o,n,i),e.gte=(o,n)=>e.check($e(o,n)),e.min=(o,n)=>e.check($e(o,n)),e.gt=(o,n)=>e.check(ot(o,n)),e.gte=(o,n)=>e.check($e(o,n)),e.min=(o,n)=>e.check($e(o,n)),e.lt=(o,n)=>e.check(rt(o,n)),e.lte=(o,n)=>e.check(Me(o,n)),e.max=(o,n)=>e.check(Me(o,n)),e.positive=o=>e.check(ot(BigInt(0),o)),e.negative=o=>e.check(rt(BigInt(0),o)),e.nonpositive=o=>e.check(Me(BigInt(0),o)),e.nonnegative=o=>e.check($e(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Nt(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ua=v("ZodBigIntFormat",(e,t)=>{ql.init(e,t),lr.init(e,t)});Cp=v("ZodSymbol",(e,t)=>{Xl.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n)});Pp=v("ZodUndefined",(e,t)=>{Ql.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n)});Op=v("ZodNull",(e,t)=>{ed.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n)});Rp=v("ZodAny",(e,t)=>{td.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n)});Dp=v("ZodUnknown",(e,t)=>{nd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lu(e,r,o,n)});Lp=v("ZodNever",(e,t)=>{rd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n)});jp=v("ZodVoid",(e,t)=>{od.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n)});ho=v("ZodDate",(e,t)=>{id.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>ju(e,o,n,i),e.min=(o,n)=>e.check($e(o,n)),e.max=(o,n)=>e.check(Me(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});Mp=v("ZodArray",(e,t)=>{ad.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ju(e,r,o,n),e.element=t.element,po(e,"ZodArray",{min(r,o){return this.check(ht(r,o))},nonempty(r){return this.check(ht(1,r))},max(r,o){return this.check(dn(r,o))},length(r,o){return this.check(un(r,o))},unwrap(){return this.element}})});go=v("ZodObject",(e,t)=>{sd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yu(e,r,o,n),I.defineLazy(e,"shape",()=>t.shape),po(e,"ZodObject",{keyof(){return Ga(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:pn()})},loose(){return this.clone({...this._zod.def,catchall:pn()})},strict(){return this.clone({...this._zod.def,catchall:Fa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return I.extend(this,r)},safeExtend(r){return I.safeExtend(this,r)},merge(r){return I.merge(this,r)},pick(r){return I.pick(this,r)},omit(r){return I.omit(this,r)},partial(...r){return I.partial(Za,this,r[0])},required(...r){return I.required(Ka,this,r[0])}})});yo=v("ZodUnion",(e,t)=>{Jr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ua(e,r,o,n),e.options=t.options});zp=v("ZodXor",(e,t)=>{yo.init(e,t),cd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ua(e,r,o,n),e.options=t.options});Up=v("ZodDiscriminatedUnion",(e,t)=>{yo.init(e,t),ld.init(e,t)});Fp=v("ZodIntersection",(e,t)=>{dd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n)});Gp=v("ZodTuple",(e,t)=>{Pi.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xu(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});rr=v("ZodRecord",(e,t)=>{ud.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});Kp=v("ZodMap",(e,t)=>{pd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(it(...r)),e.nonempty=r=>e.check(it(1,r)),e.max=(...r)=>e.check(Rt(...r)),e.size=(...r)=>e.check(ln(...r))});Vp=v("ZodSet",(e,t)=>{md.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hu(e,r,o,n),e.min=(...r)=>e.check(it(...r)),e.nonempty=r=>e.check(it(1,r)),e.max=(...r)=>e.check(Rt(...r)),e.size=(...r)=>e.check(ln(...r))});or=v("ZodEnum",(e,t)=>{hd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Mu(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new or({...t,checks:[],...I.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new or({...t,checks:[],...I.normalizeParams(n),entries:i})}});Hp=v("ZodLiteral",(e,t)=>{fd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Jp=v("ZodFile",(e,t)=>{gd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bu(e,r,o,n),e.min=(r,o)=>e.check(it(r,o)),e.max=(r,o)=>e.check(Rt(r,o)),e.mime=(r,o)=>e.check(Hn(Array.isArray(r)?r:[r],o))});Yp=v("ZodTransform",(e,t)=>{yd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ku(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new At(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(I.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(I.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});Za=v("ZodOptional",(e,t)=>{Oi.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});qp=v("ZodExactOptional",(e,t)=>{vd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Qp=v("ZodNullable",(e,t)=>{bd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ep(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});em=v("ZodDefault",(e,t)=>{_d.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>np(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});nm=v("ZodPrefault",(e,t)=>{wd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ka=v("ZodNonOptional",(e,t)=>{kd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});im=v("ZodSuccess",(e,t)=>{xd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});am=v("ZodCatch",(e,t)=>{Sd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>op(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});cm=v("ZodNaN",(e,t)=>{$d.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n)});vo=v("ZodPipe",(e,t)=>{Ni.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ip(e,r,o,n),e.in=t.in,e.out=t.out});bo=v("ZodCodec",(e,t)=>{vo.init(e,t),Yr.init(e,t)});lm=v("ZodPreprocess",(e,t)=>{vo.init(e,t),Ed.init(e,t)}),dm=v("ZodReadonly",(e,t)=>{Td.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ap(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});pm=v("ZodTemplateLiteral",(e,t)=>{Ad.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fu(e,r,o,n)});mm=v("ZodLazy",(e,t)=>{Pd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cp(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});fm=v("ZodPromise",(e,t)=>{Cd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});gm=v("ZodFunction",(e,t)=>{Id.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zu(e,r,o,n)});_o=v("ZodCustom",(e,t)=>{Od.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wu(e,r,o,n)});n_=ku,r_=xu;i_=(...e)=>Su({Codec:bo,Boolean:cr,String:ir},...e)});function DA(e){ne({customError:e})}function LA(){return ne().customError}var RA,bm,c_=g(()=>{ze();RA={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};bm||(bm={})});function MA(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function zA(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function l_(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return D.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return D.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=zA(n,t),a=ye(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return D.null();if(n.length===0)return D.never();if(n.length===1)return D.literal(n[0]);if(n.every(a=>typeof a=="string"))return D.enum(n);let i=n.map(a=>D.literal(a));return i.length<2?i[0]:D.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return D.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return l_(a,t)});return n.length===0?D.never():n.length===1?n[0]:D.union(n)}if(!r)return D.any();let o;switch(r){case"string":{let n=D.string();if(e.format){let i=e.format;i==="email"?n=n.check(D.email()):i==="uri"||i==="uri-reference"?n=n.check(D.url()):i==="uuid"||i==="guid"?n=n.check(D.uuid()):i==="date-time"?n=n.check(D.iso.datetime()):i==="date"?n=n.check(D.iso.date()):i==="time"?n=n.check(D.iso.time()):i==="duration"?n=n.check(D.iso.duration()):i==="ipv4"?n=n.check(D.ipv4()):i==="ipv6"?n=n.check(D.ipv6()):i==="mac"?n=n.check(D.mac()):i==="cidr"?n=n.check(D.cidrv4()):i==="cidr-v6"?n=n.check(D.cidrv6()):i==="base64"?n=n.check(D.base64()):i==="base64url"?n=n.check(D.base64url()):i==="e164"?n=n.check(D.e164()):i==="jwt"?n=n.check(D.jwt()):i==="emoji"?n=n.check(D.emoji()):i==="nanoid"?n=n.check(D.nanoid()):i==="cuid"?n=n.check(D.cuid()):i==="cuid2"?n=n.check(D.cuid2()):i==="ulid"?n=n.check(D.ulid()):i==="xid"?n=n.check(D.xid()):i==="ksuid"&&(n=n.check(D.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?D.number().int():D.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=D.boolean();break}case"null":{o=D.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[l,d]of Object.entries(i)){let u=ye(d,t);n[l]=a.has(l)?u:u.optional()}if(e.propertyNames){let l=ye(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?ye(e.additionalProperties,t):D.any();if(Object.keys(n).length===0){o=D.record(l,d);break}let u=D.object(n).passthrough(),p=D.looseRecord(l,d);o=D.intersection(u,p);break}if(e.patternProperties){let l=e.patternProperties,d=Object.keys(l),u=[];for(let m of d){let h=ye(l[m],t),f=D.string().regex(new RegExp(m));u.push(D.looseRecord(f,h))}let p=[];if(Object.keys(n).length>0&&p.push(D.object(n).passthrough()),p.push(...u),p.length===0)o=D.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=D.intersection(p[0],p[1]);for(let h=2;h<p.length;h++)m=D.intersection(m,p[h]);o=m}break}let s=D.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(ye(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>ye(l,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?ye(i,t):void 0;s?o=D.tuple(a).rest(s):o=D.tuple(a),typeof e.minItems=="number"&&(o=o.check(D.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(D.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(l=>ye(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?ye(e.additionalItems,t):void 0;s?o=D.tuple(a).rest(s):o=D.tuple(a),typeof e.minItems=="number"&&(o=o.check(D.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(D.maxLength(e.maxItems)))}else if(i!==void 0){let a=ye(i,t),s=D.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=D.array(D.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function ye(e,t){if(typeof e=="boolean")return e?D.any():D.never();let r=l_(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(d=>ye(d,t)),l=D.union(s);r=o?D.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(d=>ye(d,t)),l=D.xor(s);r=o?D.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:D.any();else{let s=o?r:ye(e.allOf[0],t),l=o?0:1;for(let d=l;d<e.allOf.length;d++)s=D.intersection(s,ye(e.allOf[d],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=D.nullable(r)),e.readOnly===!0&&(r=D.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))jA.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function d_(e,t){if(typeof e=="boolean")return e?D.any():D.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=MA(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??he};return ye(r,i)}var D,jA,u_=g(()=>{Qr();ga();oo();ao();D={...io,...fa,iso:nr},jA=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var _m={};nt(_m,{bigint:()=>GA,boolean:()=>BA,date:()=>WA,number:()=>FA,string:()=>UA});function UA(e){return Fd(ir,e)}function FA(e){return Jd(sr,e)}function BA(e){return nu(cr,e)}function GA(e){return ou(lr,e)}function WA(e){return fu(ho,e)}var p_=g(()=>{ze();ao()});var c={};nt(c,{$brand:()=>lc,$input:()=>zd,$output:()=>Md,NEVER:()=>cc,TimePrecision:()=>Gd,ZodAny:()=>Rp,ZodArray:()=>Mp,ZodBase64:()=>La,ZodBase64URL:()=>ja,ZodBigInt:()=>lr,ZodBigIntFormat:()=>Ua,ZodBoolean:()=>cr,ZodCIDRv4:()=>Ra,ZodCIDRv6:()=>Da,ZodCUID:()=>Ta,ZodCUID2:()=>Aa,ZodCatch:()=>am,ZodCodec:()=>bo,ZodCustom:()=>_o,ZodCustomStringFormat:()=>ar,ZodDate:()=>ho,ZodDefault:()=>em,ZodDiscriminatedUnion:()=>Up,ZodE164:()=>Ma,ZodEmail:()=>Sa,ZodEmoji:()=>$a,ZodEnum:()=>or,ZodError:()=>OA,ZodExactOptional:()=>qp,ZodFile:()=>Jp,ZodFirstPartyTypeKind:()=>bm,ZodFunction:()=>gm,ZodGUID:()=>co,ZodIPv4:()=>Oa,ZodIPv6:()=>Na,ZodISODate:()=>va,ZodISODateTime:()=>ya,ZodISODuration:()=>_a,ZodISOTime:()=>ba,ZodIntersection:()=>Fp,ZodIssueCode:()=>RA,ZodJWT:()=>za,ZodKSUID:()=>Pa,ZodLazy:()=>mm,ZodLiteral:()=>Hp,ZodMAC:()=>Tp,ZodMap:()=>Kp,ZodNaN:()=>cm,ZodNanoID:()=>Ea,ZodNever:()=>Lp,ZodNonOptional:()=>Ka,ZodNull:()=>Op,ZodNullable:()=>Qp,ZodNumber:()=>sr,ZodNumberFormat:()=>mn,ZodObject:()=>go,ZodOptional:()=>Za,ZodPipe:()=>vo,ZodPrefault:()=>nm,ZodPreprocess:()=>lm,ZodPromise:()=>fm,ZodReadonly:()=>dm,ZodRealError:()=>Oe,ZodRecord:()=>rr,ZodSet:()=>Vp,ZodString:()=>ir,ZodStringFormat:()=>q,ZodSuccess:()=>im,ZodSymbol:()=>Cp,ZodTemplateLiteral:()=>pm,ZodTransform:()=>Yp,ZodTuple:()=>Gp,ZodType:()=>G,ZodULID:()=>Ia,ZodURL:()=>mo,ZodUUID:()=>at,ZodUndefined:()=>Pp,ZodUnion:()=>yo,ZodUnknown:()=>Dp,ZodVoid:()=>jp,ZodXID:()=>Ca,ZodXor:()=>zp,_ZodString:()=>xa,_default:()=>tm,_function:()=>Qb,any:()=>Cb,array:()=>fo,base64:()=>mb,base64url:()=>hb,bigint:()=>$b,boolean:()=>Ip,catch:()=>sm,check:()=>e_,cidrv4:()=>ub,cidrv6:()=>pb,clone:()=>xe,codec:()=>Jb,coerce:()=>_m,config:()=>ne,core:()=>ft,cuid:()=>rb,cuid2:()=>ob,custom:()=>t_,date:()=>Ob,decode:()=>bp,decodeAsync:()=>wp,describe:()=>n_,discriminatedUnion:()=>Mb,e164:()=>fb,email:()=>Vv,emoji:()=>tb,encode:()=>vp,encodeAsync:()=>_p,endsWith:()=>Vn,enum:()=>Ga,exactOptional:()=>Xp,file:()=>Zb,flattenError:()=>Gr,float32:()=>wb,float64:()=>kb,formatError:()=>Wr,fromJSONSchema:()=>d_,function:()=>Qb,getErrorMap:()=>LA,globalRegistry:()=>he,gt:()=>ot,gte:()=>$e,guid:()=>Hv,hash:()=>_b,hex:()=>bb,hostname:()=>vb,httpUrl:()=>eb,includes:()=>Zn,instanceof:()=>o_,int:()=>wa,int32:()=>xb,int64:()=>Eb,intersection:()=>Bp,invertCodec:()=>Yb,ipv4:()=>cb,ipv6:()=>db,iso:()=>nr,json:()=>a_,jwt:()=>gb,keyof:()=>Nb,ksuid:()=>sb,lazy:()=>hm,length:()=>un,literal:()=>Wb,locales:()=>Xr,looseObject:()=>Lb,looseRecord:()=>Ub,lowercase:()=>Gn,lt:()=>rt,lte:()=>Me,mac:()=>lb,map:()=>Fb,maxLength:()=>dn,maxSize:()=>Rt,meta:()=>r_,mime:()=>Hn,minLength:()=>ht,minSize:()=>it,multipleOf:()=>Nt,nan:()=>Hb,nanoid:()=>nb,nativeEnum:()=>Gb,negative:()=>aa,never:()=>Fa,nonnegative:()=>ca,nonoptional:()=>om,nonpositive:()=>sa,normalize:()=>Jn,null:()=>Np,nullable:()=>uo,nullish:()=>Kb,number:()=>Ap,object:()=>Rb,optional:()=>lo,overwrite:()=>qe,parse:()=>hp,parseAsync:()=>fp,partialRecord:()=>zb,pipe:()=>ka,positive:()=>ia,prefault:()=>rm,preprocess:()=>s_,prettifyError:()=>kc,promise:()=>Xb,property:()=>la,readonly:()=>um,record:()=>Zp,refine:()=>ym,regex:()=>Bn,regexes:()=>je,registry:()=>Mi,safeDecode:()=>xp,safeDecodeAsync:()=>$p,safeEncode:()=>kp,safeEncodeAsync:()=>Sp,safeParse:()=>gp,safeParseAsync:()=>yp,set:()=>Bb,setErrorMap:()=>DA,size:()=>ln,slugify:()=>Qn,startsWith:()=>Kn,strictObject:()=>Db,string:()=>so,stringFormat:()=>yb,stringbool:()=>i_,success:()=>Vb,superRefine:()=>vm,symbol:()=>Ab,templateLiteral:()=>qb,toJSONSchema:()=>ma,toLowerCase:()=>qn,toUpperCase:()=>Xn,transform:()=>Wa,treeifyError:()=>wc,trim:()=>Yn,tuple:()=>Wp,uint32:()=>Sb,uint64:()=>Tb,ulid:()=>ib,undefined:()=>Ib,union:()=>Ba,unknown:()=>pn,uppercase:()=>Wn,url:()=>Qv,util:()=>I,uuid:()=>Jv,uuidv4:()=>Yv,uuidv6:()=>qv,uuidv7:()=>Xv,void:()=>Pb,xid:()=>ab,xor:()=>jb});var wm=g(()=>{ze();ao();ga();mp();Ep();c_();ze();Rd();ze();ro();u_();jd();oo();oo();p_();ne(Ri())});var Ze=g(()=>{wm();wm()});function m_(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(KA.has(t)||ZA.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return m_(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function h_(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(m_(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var ZA,KA,km=g(()=>{"use strict";ZA=[".localhost",".local",".internal",".test",".localdomain"],KA=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var wo,ko=g(()=>{"use strict";Ze();wo=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var xo,Va=g(()=>{"use strict";Ze();xo=c.discriminatedUnion("source",[c.object({source:c.literal("manifest")}),c.object({source:c.literal("studio"),element_id:c.string().min(1),edition_id:c.string().min(1)})])});function v_(e){return e.questions?e.questions:[{id:"1",kind:"choice",prompt:e.prompt,options:e.options??[],result:e.result,points:void 0,min:void 0,max:void 0,step:void 0,tolerance:void 0}]}function Ha(e,t,r){if(e.result===void 0)return 0;let n=(e.kind==="choice"?(e.options??[]).find(i=>i.key===e.result):void 0)?.points??e.points??r;if(e.kind==="number"){if(typeof t!="number"||typeof e.result!="number")return 0;let i=Math.abs(t-e.result);return i===0?n:e.tolerance===void 0||i>=e.tolerance?0:Math.round(n*(1-i/e.tolerance))}return t===e.result?n:0}function hn(e){return`round-${e.number}`}var xm,VA,HA,JA,YA,f_,qA,Sm,g_,XA,y_,QA,eI,Ke,QM,e2,t2,gt=g(()=>{"use strict";Ze();Tt();ko();Va();xm=c.object({archetype:c.literal("hunt"),number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(2),targets:c.array(c.string().min(1)).min(1),required:c.number().int().positive().optional(),pointsPerTarget:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),VA=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative()}),HA=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(VA).min(1)}),JA=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),YA=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],f_=c.object({archetype:c.literal("push"),number:c.number().int().positive().default(1),prompt:c.string().default(""),target:c.number().int().positive(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),theme:c.string().default(""),slates:c.array(HA).min(1),tiers:c.array(JA).default(YA),floorLabel:c.string().default("Rookie"),bustLabel:c.string().default("Busted"),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(l=>l.key)),n=[...new Set(o.filter((s,l)=>o.indexOf(s)!==l))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,l)=>s+Math.min(...l.entries.map(d=>d.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,l)=>l===0||s.within>e.tiers[l-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),qA=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),Sm=c.object({archetype:c.literal("group"),number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(qA).min(2),pointsPerGroup:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let l=r.get(s);l&&l!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${l} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),g_=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),XA=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(g_).optional(),min:c.number().optional(),max:c.number().optional(),step:c.number().positive().optional(),result:c.union([c.string().min(1),c.number()]).optional(),points:c.number().int().nonnegative().optional(),tolerance:c.number().positive().optional()}).superRefine((e,t)=>{if(e.kind==="choice"){if(!e.options||e.options.length<2){t.addIssue({code:"custom",path:["options"],message:"A choice needs at least two options, or there is nothing to predict."});return}new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),typeof e.result=="string"&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),typeof e.result=="number"&&t.addIssue({code:"custom",path:["result"],message:"A choice settles to one of its option keys, not to a number."});return}e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A number question has no options: a fan gives a value."}),e.min===void 0||e.max===void 0?t.addIssue({code:"custom",path:["min"],message:"A number needs a min and a max, or a fan is given a control with no ends."}):e.max<=e.min&&t.addIssue({code:"custom",path:["max"],message:"The maximum has to be above the minimum."}),typeof e.result=="string"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),y_=c.object({archetype:c.literal("predict"),number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(g_).min(2).optional(),questions:c.array(XA).min(1).optional(),result:c.string().min(1).optional(),pointsForCorrect:c.number().int().nonnegative().default(10),attemptsAllowed:c.number().int().positive().default(1),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.options!==void 0,o=e.questions!==void 0;if(r&&o&&t.addIssue({code:"custom",path:["questions"],message:"A round declares options or questions, not both. Two homes for one question is how they drift apart."}),!r&&!o&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),o&&e.questions){let n=e.questions.map(i=>i.id);new Set(n).size!==n.length&&t.addIssue({code:"custom",path:["questions"],message:"Two questions share an id. A play names the question it answered."})}e.options&&new Set(e.options.map(n=>n.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&e.options!==void 0&&!e.options.some(n=>n.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})});QA=c.object({archetype:c.literal("bingo"),number:c.number().int().positive().default(1),prompt:c.string().default(""),rows:c.number().int().min(2),columns:c.number().int().min(2),centreMode:c.enum(["none","free","choice"]).default("none"),centreOptions:c.array(c.string().min(1)).optional(),allowCentreDuplicate:c.boolean().default(!1),lineTypes:c.array(c.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:c.array(c.object({key:c.string().min(1),label:c.string().min(1),result:c.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:c.number().int().nonnegative().default(10),pointsForFullBoard:c.number().int().nonnegative().default(0),shuffleAllowance:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),locksAt:c.string().optional()}).superRefine((e,t)=>{let r=e.cardPool.map(n=>n.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let o=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<o&&t.addIssue({code:"custom",path:["cardPool"],message:`The pool has ${e.cardPool.length} card${e.cardPool.length===1?"":"s"}, and a ${e.rows}x${e.columns} board needs ${o}. Add more cards or shrink the board.`}),e.centreMode==="choice")if(!e.centreOptions||e.centreOptions.length===0)t.addIssue({code:"custom",path:["centreOptions"],message:"The centre is a player's choice, so at least one option is required."});else{let n=e.centreOptions.filter(i=>!r.includes(i));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),eI=c.discriminatedUnion("archetype",[xm,f_,Sm,y_,QA]),Ke=c.preprocess(pg,eI);QM=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),e2=c.object({game:c.string().min(1),round:Ke,origin:xo.optional(),snapshot:c.string().default(""),source:c.string().optional(),roundId:c.string().min(1).optional(),selection:c.object({mode:c.literal("rotation"),windowSeconds:c.number().int().positive(),rounds:c.array(c.object({id:c.string().min(1),round:Ke,origin:xo.optional()})).min(1)}).optional()}),t2=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(wo).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function __(e){let t=[];e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let r=e.operations.promotion;if(r.offers_prize&&(r.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),r.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!r.skill_based&&!r.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let o of["issuer","jwks_uri"]){let n=e.identity.jwt[o],i=h_(n);i&&t.push({path:`identity.jwt.${o}`,message:i==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":i==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var So,$m,Em,Tm,Mt,zt,b_,tI,st,nI,rI,oI,iI,aI,Ut,sI,cI,lI,dI,uI,pI,mI,hI,fI,gI,yI,vI,bI,Ft,dr,Bt=g(()=>{"use strict";Ze();km();Dr();Tt();gt();So="1.0",$m=c.enum(["missing","proposed","confirmed","verified","approved"]),Em={missing:0,proposed:1,confirmed:2,verified:3,approved:4},Tm=c.enum(["runtime","live","enterprise"]),Mt=c.enum(["L0","L1","L2","L3","L4","L5"]),zt={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},b_={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},tI=c.discriminatedUnion("kind",[c.object({kind:c.literal("human_decision"),owner:c.string(),date:c.string(),note:c.string().optional()}),c.object({kind:c.literal("generated_proposal"),tool:c.string(),model:c.string().optional(),source_context:c.string().optional()}),c.object({kind:c.literal("repository_evidence"),file:c.string(),commit:c.string().optional(),package:c.string().optional()}),c.object({kind:c.literal("platform_evidence"),system:c.string(),id:c.string()}),c.object({kind:c.literal("external_evidence"),supplier:c.string(),licence:c.string().optional(),dataset_version:c.string().optional()})]),st={status:$m.default("missing"),provenance:c.array(tI).default([])},nI=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:Mt.default("L0")}),rI=c.object({repository:c.string().url(),branch:c.string().default("main")}),oI=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:rI.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...st}),iI=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),aI=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo"]),Ut=c.preprocess(e=>typeof e=="string"?Je(e):e,aI),sI=c.object({route:iI.optional(),archetype:Ut.optional(),component:c.string().optional(),version:c.string().optional(),variant:c.string().optional(),configuration:c.record(c.string(),c.unknown()).default({}),round:Ke.optional(),...st}),cI=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(On),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:Mt.optional()}).optional(),...st}),lI=c.object({spec_url:c.string().optional(),version:c.string().optional(),...st}),dI=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...st}),uI=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...st}),pI=c.object({required:c.boolean().default(!1),minimum_age:c.number().int().positive().max(120).optional(),method:c.enum(["self_declared","verified"]).default("self_declared"),verifier:c.string().optional()}),mI=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),hI=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:mI.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:pI.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...st}),fI=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),gI=c.object({destinations:c.array(fI).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:c.array(c.string()).default([]),signal:c.object({enabled:c.boolean().default(!1),application_id:c.string().optional(),write_key:c.string().optional(),monterosa:c.object({enabled:c.boolean().default(!1),organisation_id:c.string().optional(),project_id:c.string().optional()}).prefault({})}).prefault({}),...st}),yI=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...st}),vI=c.object({offers_prize:c.boolean().default(!1),free_entry_route:c.string().optional(),skill_based:c.boolean().default(!1),terms_url:c.string().optional(),jurisdictions:c.array(c.string()).default([])}),bI=c.object({support_tier:Tm.optional(),runbook:c.string().optional(),promotion:vI.prefault({}),...st}),Ft=c.object({manifest:nI,app:oI,experience:cI.prefault({}),studio_app:lI.prefault({}),studio_surface:dI.prefault({}),backend:sI.prefault({}),interaction_cloud:uI.prefault({}),identity:hI.prefault({}),measurement:gI.prefault({}),deployment:yI.prefault({}),operations:bI.prefault({})});dr=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function Ne(e,t={}){let r=m=>({id:m.id,level:m.level,requirement:m.requirement,advice:m.advice,owner:m.owner,passed:m.check(e,t)}),o=Am.filter(m=>m.checkable).map(r),n=Am.filter(m=>!m.checkable).map(r),i="L0",a=!0;for(let m of Im){let h=o.filter(b=>b.level===m);h.length>0&&h.every(b=>b.passed)&&a?i=m:a=!1}let s=o.filter(m=>m.level==="L0").every(m=>m.passed),l=zt[i]+1,d=Im[l],u=d?o.filter(m=>m.level===d&&!m.passed):[],p=e.manifest.conformance;return{computed:i,computedName:b_[i],claimed:p,overclaimed:!s||Math.min(zt[p],zt[w_])>zt[i],results:o,blockers:s?u:o.filter(m=>m.level==="L0"&&!m.passed),ceiling:w_,advice:n}}function k_(e,t){let o=Ne(e).results.filter(n=>!n.passed&&zt[n.level]<=zt[t]);return{ok:o.length===0,missing:o}}var fn,fe,Am,Im,_I,d2,w_,Ja=g(()=>{"use strict";Bt();fn=(e,t,r)=>{let o=e[t];return Em[o?.status??"missing"]>=Em[r]},fe=e=>typeof e=="string"?e.trim().length>0:e!=null,Am=[{level:"L0",id:"L0.app.identity",checkable:!0,advice:"Give the game a name, and a short id we can use in web addresses.",owner:"creator",requirement:"app.id and app.title are set",check:e=>fe(e.app.id)&&fe(e.app.title)},{level:"L0",id:"L0.app.status",checkable:!0,advice:"Mark the game as started.",owner:"creator",requirement:"app section is at least proposed",check:e=>fn(e,"app","proposed")},{level:"L0",id:"L0.schema.version",checkable:!0,advice:"The version of the format this game is described in. Set when the game was created.",owner:"creator",requirement:"manifest.schema_version is set",check:e=>fe(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",checkable:!0,advice:"Describe the screens in the game.",owner:"creator",requirement:"experience declares a screen graph or at least one player surface",check:e=>fe(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",checkable:!0,advice:"Mark the design as started.",owner:"creator",requirement:"experience section is at least proposed",check:e=>fn(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",checkable:!0,advice:"Choose which engine runs the game: one we manage, or one you bring.",owner:"creator",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>fe(e.backend.route)},{level:"L2",id:"L2.backend.pinned",checkable:!0,advice:"Deploy the game. We record which engine answered.",owner:"creator",requirement:"a component is serving this game's rounds",check:(e,t)=>fe(t.backendComponent)||fe(e.backend.component)&&fe(e.backend.version)},{level:"L2",id:"L2.identity.policy",checkable:!0,advice:"Say how a fan signs in. If they don't sign in, say that. Gamestage does not provide sign-in, so this names the one a fan meets.",owner:"creator",requirement:"an identity provider is named",check:e=>fe(e.identity.provider)},{level:"L2",id:"L2.measurement.destination",checkable:!0,advice:"Switch on somewhere to send the data, on this game's Integrations tab. This checks the switch is on. Whether events are arriving is a separate question.",owner:"creator",requirement:"an analytics destination is switched on",check:(e,t)=>t.destinationsEnabled===!0||e.measurement.destinations.some(r=>r.enabled)},{level:"L2",id:"L2.platform.identifiers",checkable:!0,advice:"Deploy the game. That puts it on Monterosa's platform and gives you a place to manage content.",owner:"creator",requirement:"the game exists on Interaction Cloud",check:(e,t)=>fe(t.platformProject)||fe(e.studio_app.spec_url)||fe(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",checkable:!0,advice:"Deploy the game with a URL.",owner:"creator",requirement:"the game is deployed somewhere a fan can reach",check:(e,t)=>fe(t.playgroundUrl)||fe(e.deployment.space_spec)&&e.deployment.environments.some(r=>r!=="local")},{level:"L3",id:"L3.surface.declared",checkable:!1,advice:"Say what the person running your game can change: rounds, wording, or both.",owner:"creator",requirement:"a Studio Surface family is declared for operator control",check:e=>fe(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",checkable:!1,advice:"Mark which parts you have finished: the play, the scoring, and the hosting.",owner:"creator",requirement:"experience, backend and deployment are all confirmed or better",check:e=>fn(e,"experience","confirmed")&&fn(e,"backend","confirmed")&&fn(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",checkable:!1,advice:"Link proof it works: a play-through recording, or a test result.",owner:"creator",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>fn(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",checkable:!1,advice:"Name who to call when it breaks, and link the instructions they follow.",owner:"creator",requirement:"operations declares a support tier and a runbook",check:e=>fe(e.operations.support_tier)&&fe(e.operations.runbook)},{level:"L5",id:"L5.production.approved",checkable:!1,advice:"Monterosa checks your game and puts it in front of a real audience.",owner:"monterosa",requirement:"the manifest is approved and deployed to a production environment",check:e=>fn(e,"operations","approved")&&e.deployment.environments.includes("production")}],Im=["L0","L1","L2","L3","L4","L5"],_I=[{level:"L0",name:"Concept",means:"the game has a name and an App Spec that describes it"},{level:"L1",name:"Experience built",means:"there is something to play, and the Engine has been chosen"},{level:"L2",name:"Wired to the platform",means:"it exists on Interaction Cloud, names an identity, and reports somewhere"},{level:"L3",name:"Ready to deploy",means:"it is deployed where a fan can reach it"},{level:"L4",name:"Production ready",means:"checked with evidence, with a support tier and a runbook"},{level:"L5",name:"Operating live",means:"approved by Monterosa and running in production"}],d2=new Map(_I.map(e=>[e.level,e])),w_=[...Im].reverse().find(e=>Am.some(t=>t.level===e&&t.checkable))??"L0"});function M_(e){return typeof e>"u"||e===null}function wI(e){return typeof e=="object"&&e!==null}function kI(e){return Array.isArray(e)?e:M_(e)?[]:[e]}function xI(e,t){var r,o,n,i;if(t)for(i=Object.keys(t),r=0,o=i.length;r<o;r+=1)n=i[r],e[n]=t[n];return e}function SI(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function $I(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}function z_(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
9295
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function Mt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let c=e.seen.get(s);if(c.ref===null)return;let d=c.def??c.schema,u={...d},p=c.ref;if(c.ref=null,p){o(p);let m=e.seen.get(p),f=m.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(f)):Object.assign(d,f),Object.assign(d,u),s._zod.parent===p)for(let x in d)x==="$ref"||x==="allOf"||x in u||delete d[x];if(f.$ref&&m.def)for(let x in d)x==="$ref"||x==="allOf"||x in m.def&&JSON.stringify(d[x])===JSON.stringify(m.def[x])&&delete d[x]}let h=s._zod.parent;if(h&&h!==p){o(h);let m=e.seen.get(h);if(m?.schema.$ref&&(d.$ref=m.schema.$ref,m.def))for(let f in d)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(d[f])===JSON.stringify(m.def[f])&&delete d[f]}e.override({zodSchema:s,jsonSchema:d,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:nr(t,"input",e.processors),output:nr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Te(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Te(o.element,r);if(o.type==="set")return Te(o.valueType,r);if(o.type==="lazy")return Te(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Te(o.innerType,r);if(o.type==="intersection")return Te(o.left,r)||Te(o.right,r);if(o.type==="record"||o.type==="map")return Te(o.keyType,r)||Te(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Te(o.in,r)||Te(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Te(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Te(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Te(n,r))return!0;return!!(o.rest&&Te(o.rest,r))}return!1}var Eu,nr,io=y(()=>{no();Eu=(e,t={})=>r=>{let o=Lt({...r,processors:t});return H(e,o),jt(o,e),Mt(o,e)},nr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Lt({...n??{},target:i,io:t,processors:r});return H(e,a),jt(a,e),Mt(a,e)}});function fa(e,t){if("_idmap"in e){let o=e,n=Lt({...t,processors:pa}),i={};for(let c of o._idmap.entries()){let[d,u]=c;H(u,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let c of o._idmap.entries()){let[d,u]=c;jt(n,u),a[d]=Mt(n,u)}if(Object.keys(i).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}let r=Lt({...t,processors:pa});return H(e,r),jt(r,e),Mt(r,e)}var UA,Tu,Au,Iu,Cu,Pu,Ou,Nu,Ru,Du,Lu,ju,Mu,zu,Uu,Fu,Gu,Bu,Wu,Zu,Ku,Vu,Hu,Ju,Yu,qu,ha,Xu,Qu,ep,tp,np,rp,op,ip,ap,sp,cp,ma,lp,pa,ao=y(()=>{io();M();UA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Tu=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:d}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=UA[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),d&&(n.contentEncoding=d),c&&c.size>0){let u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Au=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:d,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let p=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),h=typeof d=="number"&&d<=(a??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";p?m?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof i=="number"&&(n.minimum=i),h?m?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(n.multipleOf=c)},Iu=(e,t,r,o)=>{r.type="boolean"},Cu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Pu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ou=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Nu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Du=(e,t,r,o)=>{r.not={}},Lu=(e,t,r,o)=>{},ju=(e,t,r,o)=>{},Mu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},zu=(e,t,r,o)=>{let n=e._zod.def,i=Ur(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Uu=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Fu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Gu=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Bu=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=c.map(d=>({contentMediaType:d}))):Object.assign(n,i)},Wu=(e,t,r,o)=>{r.type="boolean"},Zu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ku=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Vu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Hu=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ju=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Yu=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=H(i.element,t,{...o,path:[...o.path,"items"]})},qu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let d in a)n.properties[d]=H(a[d],t,{...o,path:[...o.path,"properties",d]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(d=>{let u=i.shape[d]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=H(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ha=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>H(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},Xu=(e,t,r,o)=>{let n=e._zod.def,i=H(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=H(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},Qu=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((h,m)=>H(h,t,{...o,path:[...o.path,a,m]})),d=i.rest?H(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:c},d&&n.items.anyOf.push(d),n.minItems=c.length,d||(n.maxItems=c.length)):(n.items=c,d&&(n.additionalItems=d));let{minimum:u,maximum:p}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof p=="number"&&(n.maxItems=p)},ep=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let u=H(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of c)n.patternProperties[p.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=H(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=H(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let d=a._zod.values;if(d){let u=[...d].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(n.required=u)}},tp=(e,t,r,o)=>{let n=e._zod.def,i=H(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},np=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},rp=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},op=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},ip=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},ap=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;H(a,t,o);let s=t.seen.get(e);s.ref=a},sp=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},cp=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},ma=(e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},lp=(e,t,r,o)=>{let n=e._zod.innerType;H(n,t,o);let i=t.seen.get(e);i.ref=n},pa={string:Tu,number:Au,boolean:Iu,bigint:Cu,symbol:Pu,null:Ou,undefined:Nu,void:Ru,never:Du,any:Lu,unknown:ju,date:Mu,enum:zu,literal:Uu,nan:Fu,template_literal:Gu,file:Bu,success:Wu,custom:Zu,function:Ku,transform:Vu,map:Hu,set:Ju,array:Yu,object:qu,union:ha,intersection:Xu,tuple:Qu,record:ep,nullable:tp,nonoptional:np,default:rp,prefault:op,catch:ip,pipe:ap,readonly:sp,promise:cp,optional:ma,lazy:lp}});var ga,Bv=y(()=>{ao();io();ga=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Lt({processors:pa,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return H(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),jt(this.ctx,t);let o=Mt(this.ctx,t),{"~standard":n,...i}=o;return i}}});var Wv={};var Zv=y(()=>{});var ft={};nt(ft,{$ZodAny:()=>nd,$ZodArray:()=>sd,$ZodAsyncError:()=>qe,$ZodBase64:()=>Kl,$ZodBase64URL:()=>Vl,$ZodBigInt:()=>Oi,$ZodBigIntFormat:()=>Xl,$ZodBoolean:()=>qr,$ZodCIDRv4:()=>Bl,$ZodCIDRv6:()=>Wl,$ZodCUID:()=>Pl,$ZodCUID2:()=>Ol,$ZodCatch:()=>$d,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>il,$ZodCheckEndsWith:()=>yl,$ZodCheckGreaterThan:()=>$i,$ZodCheckIncludes:()=>fl,$ZodCheckLengthEquals:()=>ul,$ZodCheckLessThan:()=>Si,$ZodCheckLowerCase:()=>hl,$ZodCheckMaxLength:()=>ll,$ZodCheckMaxSize:()=>al,$ZodCheckMimeType:()=>bl,$ZodCheckMinLength:()=>dl,$ZodCheckMinSize:()=>sl,$ZodCheckMultipleOf:()=>rl,$ZodCheckNumberFormat:()=>ol,$ZodCheckOverwrite:()=>wl,$ZodCheckProperty:()=>vl,$ZodCheckRegex:()=>pl,$ZodCheckSizeEquals:()=>cl,$ZodCheckStartsWith:()=>gl,$ZodCheckStringFormat:()=>Fn,$ZodCheckUpperCase:()=>ml,$ZodCodec:()=>Qr,$ZodCustom:()=>Nd,$ZodCustomStringFormat:()=>Yl,$ZodDate:()=>ad,$ZodDefault:()=>_d,$ZodDiscriminatedUnion:()=>dd,$ZodE164:()=>Hl,$ZodEmail:()=>Tl,$ZodEmoji:()=>Il,$ZodEncodeError:()=>It,$ZodEnum:()=>fd,$ZodError:()=>Zr,$ZodExactOptional:()=>bd,$ZodFile:()=>yd,$ZodFunction:()=>Cd,$ZodGUID:()=>$l,$ZodIPv4:()=>Ul,$ZodIPv6:()=>Fl,$ZodISODate:()=>jl,$ZodISODateTime:()=>Ll,$ZodISODuration:()=>zl,$ZodISOTime:()=>Ml,$ZodIntersection:()=>ud,$ZodJWT:()=>Jl,$ZodKSUID:()=>Dl,$ZodLazy:()=>Od,$ZodLiteral:()=>gd,$ZodMAC:()=>Gl,$ZodMap:()=>hd,$ZodNaN:()=>Ed,$ZodNanoID:()=>Cl,$ZodNever:()=>od,$ZodNonOptional:()=>xd,$ZodNull:()=>td,$ZodNullable:()=>wd,$ZodNumber:()=>Pi,$ZodNumberFormat:()=>ql,$ZodObject:()=>Zg,$ZodObjectJIT:()=>cd,$ZodOptional:()=>Ri,$ZodPipe:()=>Di,$ZodPrefault:()=>kd,$ZodPreprocess:()=>Td,$ZodPromise:()=>Pd,$ZodReadonly:()=>Ad,$ZodRealError:()=>Ne,$ZodRecord:()=>pd,$ZodRegistry:()=>zi,$ZodSet:()=>md,$ZodString:()=>dn,$ZodStringFormat:()=>Y,$ZodSuccess:()=>Sd,$ZodSymbol:()=>Ql,$ZodTemplateLiteral:()=>Id,$ZodTransform:()=>vd,$ZodTuple:()=>Ni,$ZodType:()=>G,$ZodULID:()=>Nl,$ZodURL:()=>Al,$ZodUUID:()=>El,$ZodUndefined:()=>ed,$ZodUnion:()=>Xr,$ZodUnknown:()=>rd,$ZodVoid:()=>id,$ZodXID:()=>Rl,$ZodXor:()=>ld,$brand:()=>dc,$constructor:()=>v,$input:()=>Ud,$output:()=>zd,Doc:()=>Yr,JSONSchema:()=>Wv,JSONSchemaGenerator:()=>ga,NEVER:()=>lc,TimePrecision:()=>Wd,_any:()=>uu,_array:()=>vu,_base64:()=>ra,_base64url:()=>oa,_bigint:()=>ou,_boolean:()=>nu,_catch:()=>RA,_check:()=>Fv,_cidrv4:()=>ta,_cidrv6:()=>na,_coercedBigint:()=>iu,_coercedBoolean:()=>ru,_coercedDate:()=>gu,_coercedNumber:()=>Yd,_coercedString:()=>Gd,_cuid:()=>Hi,_cuid2:()=>Ji,_custom:()=>wu,_date:()=>fu,_decode:()=>mi,_decodeAsync:()=>gi,_default:()=>PA,_discriminatedUnion:()=>bA,_e164:()=>ia,_email:()=>Fi,_emoji:()=>Ki,_encode:()=>hi,_encodeAsync:()=>fi,_endsWith:()=>Hn,_enum:()=>$A,_file:()=>bu,_float32:()=>Xd,_float64:()=>Qd,_gt:()=>ot,_gte:()=>Ee,_guid:()=>ro,_includes:()=>Kn,_int:()=>qd,_int32:()=>eu,_int64:()=>au,_intersection:()=>wA,_ipv4:()=>Qi,_ipv6:()=>ea,_isoDate:()=>Kd,_isoDateTime:()=>Zd,_isoDuration:()=>Hd,_isoTime:()=>Vd,_jwt:()=>aa,_ksuid:()=>Xi,_lazy:()=>MA,_length:()=>hn,_literal:()=>TA,_lowercase:()=>Wn,_lt:()=>rt,_lte:()=>Ue,_mac:()=>Bd,_map:()=>xA,_max:()=>Ue,_maxLength:()=>pn,_maxSize:()=>Dt,_mime:()=>Jn,_min:()=>Ee,_minLength:()=>mt,_minSize:()=>it,_multipleOf:()=>Rt,_nan:()=>yu,_nanoid:()=>Vi,_nativeEnum:()=>EA,_negative:()=>ca,_never:()=>hu,_nonnegative:()=>da,_nonoptional:()=>OA,_nonpositive:()=>la,_normalize:()=>Yn,_null:()=>du,_nullable:()=>CA,_number:()=>Jd,_optional:()=>IA,_overwrite:()=>Xe,_parse:()=>jn,_parseAsync:()=>Mn,_pipe:()=>DA,_positive:()=>sa,_promise:()=>zA,_property:()=>ua,_readonly:()=>LA,_record:()=>kA,_refine:()=>_u,_regex:()=>Bn,_safeDecode:()=>vi,_safeDecodeAsync:()=>wi,_safeEncode:()=>yi,_safeEncodeAsync:()=>bi,_safeParse:()=>zn,_safeParseAsync:()=>Un,_set:()=>SA,_size:()=>un,_slugify:()=>er,_startsWith:()=>Vn,_string:()=>Fd,_stringFormat:()=>tr,_stringbool:()=>$u,_success:()=>NA,_superRefine:()=>ku,_symbol:()=>cu,_templateLiteral:()=>jA,_toLowerCase:()=>Xn,_toUpperCase:()=>Qn,_transform:()=>AA,_trim:()=>qn,_tuple:()=>_A,_uint32:()=>tu,_uint64:()=>su,_ulid:()=>Yi,_undefined:()=>lu,_union:()=>yA,_unknown:()=>pu,_uppercase:()=>Zn,_url:()=>oo,_uuid:()=>Gi,_uuidv4:()=>Bi,_uuidv6:()=>Wi,_uuidv7:()=>Zi,_void:()=>mu,_xid:()=>qi,_xor:()=>vA,clone:()=>Se,config:()=>ne,createStandardJSONSchemaMethod:()=>nr,createToJSONSchemaMethod:()=>Eu,decode:()=>zE,decodeAsync:()=>FE,describe:()=>xu,encode:()=>ME,encodeAsync:()=>UE,extractDefs:()=>jt,finalize:()=>Mt,flattenError:()=>Kr,formatError:()=>Vr,globalConfig:()=>an,globalRegistry:()=>me,initializeContext:()=>Lt,isValidBase64:()=>Zl,isValidBase64URL:()=>Fg,isValidJWT:()=>Gg,locales:()=>to,meta:()=>Su,parse:()=>ui,parseAsync:()=>pi,prettifyError:()=>xc,process:()=>H,regexes:()=>ze,registry:()=>Ui,safeDecode:()=>BE,safeDecodeAsync:()=>ZE,safeEncode:()=>GE,safeEncodeAsync:()=>WE,safeParse:()=>$c,safeParseAsync:()=>Ec,toDotPath:()=>wg,toJSONSchema:()=>fa,treeifyError:()=>kc,util:()=>I,version:()=>kl});var Fe=y(()=>{sn();Tc();Sc();Rd();Ei();xl();M();xi();Md();no();_l();Gv();io();ao();Bv();Zv()});var ya={};nt(ya,{endsWith:()=>Hn,gt:()=>ot,gte:()=>Ee,includes:()=>Kn,length:()=>hn,lowercase:()=>Wn,lt:()=>rt,lte:()=>Ue,maxLength:()=>pn,maxSize:()=>Dt,mime:()=>Jn,minLength:()=>mt,minSize:()=>it,multipleOf:()=>Rt,negative:()=>ca,nonnegative:()=>da,nonpositive:()=>la,normalize:()=>Yn,overwrite:()=>Xe,positive:()=>sa,property:()=>ua,regex:()=>Bn,size:()=>un,slugify:()=>er,startsWith:()=>Vn,toLowerCase:()=>Xn,toUpperCase:()=>Qn,trim:()=>qn,uppercase:()=>Zn});var va=y(()=>{Fe()});var rr={};nt(rr,{ZodISODate:()=>wa,ZodISODateTime:()=>ba,ZodISODuration:()=>ka,ZodISOTime:()=>_a,date:()=>up,datetime:()=>dp,duration:()=>hp,time:()=>pp});function dp(e){return Zd(ba,e)}function up(e){return Kd(wa,e)}function pp(e){return Vd(_a,e)}function hp(e){return Hd(ka,e)}var ba,wa,_a,ka,so=y(()=>{Fe();lo();ba=v("ZodISODateTime",(e,t)=>{Ll.init(e,t),q.init(e,t)});wa=v("ZodISODate",(e,t)=>{jl.init(e,t),q.init(e,t)});_a=v("ZodISOTime",(e,t)=>{Ml.init(e,t),q.init(e,t)});ka=v("ZodISODuration",(e,t)=>{zl.init(e,t),q.init(e,t)})});var Kv,GA,Re,mp=y(()=>{Fe();Fe();M();Kv=(e,t)=>{Zr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Vr(e,r)},flatten:{value:r=>Kr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Rn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Rn,2)}},isEmpty:{get(){return e.issues.length===0}}})},GA=v("ZodError",Kv),Re=v("ZodError",Kv,{Parent:Error})});var fp,gp,yp,vp,bp,wp,_p,kp,xp,Sp,$p,Ep,Tp=y(()=>{Fe();mp();fp=jn(Re),gp=Mn(Re),yp=zn(Re),vp=Un(Re),bp=hi(Re),wp=mi(Re),_p=fi(Re),kp=gi(Re),xp=yi(Re),Sp=vi(Re),$p=bi(Re),Ep=wi(Re)});var co={};nt(co,{ZodAny:()=>Dp,ZodArray:()=>zp,ZodBase64:()=>Ma,ZodBase64URL:()=>za,ZodBigInt:()=>dr,ZodBigIntFormat:()=>Ga,ZodBoolean:()=>lr,ZodCIDRv4:()=>La,ZodCIDRv6:()=>ja,ZodCUID:()=>Ia,ZodCUID2:()=>Ca,ZodCatch:()=>sh,ZodCodec:()=>ko,ZodCustom:()=>xo,ZodCustomStringFormat:()=>sr,ZodDate:()=>yo,ZodDefault:()=>th,ZodDiscriminatedUnion:()=>Fp,ZodE164:()=>Ua,ZodEmail:()=>Ea,ZodEmoji:()=>Ta,ZodEnum:()=>ir,ZodExactOptional:()=>Xp,ZodFile:()=>Yp,ZodFunction:()=>yh,ZodGUID:()=>po,ZodIPv4:()=>Ra,ZodIPv6:()=>Da,ZodIntersection:()=>Gp,ZodJWT:()=>Fa,ZodKSUID:()=>Na,ZodLazy:()=>mh,ZodLiteral:()=>Jp,ZodMAC:()=>Ap,ZodMap:()=>Vp,ZodNaN:()=>lh,ZodNanoID:()=>Aa,ZodNever:()=>jp,ZodNonOptional:()=>Ha,ZodNull:()=>Np,ZodNullable:()=>eh,ZodNumber:()=>cr,ZodNumberFormat:()=>fn,ZodObject:()=>bo,ZodOptional:()=>Va,ZodPipe:()=>_o,ZodPrefault:()=>rh,ZodPreprocess:()=>dh,ZodPromise:()=>gh,ZodReadonly:()=>uh,ZodRecord:()=>or,ZodSet:()=>Hp,ZodString:()=>ar,ZodStringFormat:()=>q,ZodSuccess:()=>ah,ZodSymbol:()=>Pp,ZodTemplateLiteral:()=>hh,ZodTransform:()=>qp,ZodTuple:()=>Wp,ZodType:()=>B,ZodULID:()=>Pa,ZodURL:()=>go,ZodUUID:()=>at,ZodUndefined:()=>Op,ZodUnion:()=>wo,ZodUnknown:()=>Lp,ZodVoid:()=>Mp,ZodXID:()=>Oa,ZodXor:()=>Up,_ZodString:()=>$a,_default:()=>nh,_function:()=>ew,any:()=>Pb,array:()=>vo,base64:()=>mb,base64url:()=>fb,bigint:()=>Eb,boolean:()=>Cp,catch:()=>ch,check:()=>tw,cidrv4:()=>pb,cidrv6:()=>hb,codec:()=>Yb,cuid:()=>ob,cuid2:()=>ib,custom:()=>nw,date:()=>Nb,describe:()=>rw,discriminatedUnion:()=>zb,e164:()=>gb,email:()=>Hv,emoji:()=>nb,enum:()=>Za,exactOptional:()=>Qp,file:()=>Kb,float32:()=>kb,float64:()=>xb,function:()=>ew,guid:()=>Jv,hash:()=>_b,hex:()=>wb,hostname:()=>bb,httpUrl:()=>tb,instanceof:()=>iw,int:()=>xa,int32:()=>Sb,int64:()=>Tb,intersection:()=>Bp,invertCodec:()=>qb,ipv4:()=>lb,ipv6:()=>ub,json:()=>sw,jwt:()=>yb,keyof:()=>Rb,ksuid:()=>cb,lazy:()=>fh,literal:()=>Zb,looseObject:()=>jb,looseRecord:()=>Fb,mac:()=>db,map:()=>Gb,meta:()=>ow,nan:()=>Jb,nanoid:()=>rb,nativeEnum:()=>Wb,never:()=>Ba,nonoptional:()=>ih,null:()=>Rp,nullable:()=>mo,nullish:()=>Vb,number:()=>Ip,object:()=>Db,optional:()=>ho,partialRecord:()=>Ub,pipe:()=>Sa,prefault:()=>oh,preprocess:()=>cw,promise:()=>Qb,readonly:()=>ph,record:()=>Kp,refine:()=>vh,set:()=>Bb,strictObject:()=>Lb,string:()=>uo,stringFormat:()=>vb,stringbool:()=>aw,success:()=>Hb,superRefine:()=>bh,symbol:()=>Ib,templateLiteral:()=>Xb,transform:()=>Ka,tuple:()=>Zp,uint32:()=>$b,uint64:()=>Ab,ulid:()=>ab,undefined:()=>Cb,union:()=>Wa,unknown:()=>mn,url:()=>eb,uuid:()=>Yv,uuidv4:()=>qv,uuidv6:()=>Xv,uuidv7:()=>Qv,void:()=>Ob,xid:()=>sb,xor:()=>Mb});function fo(e,t,r){let o=Object.getPrototypeOf(e),n=Vv.get(o);if(n||(n=new Set,Vv.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}function uo(e){return Fd(ar,e)}function Hv(e){return Fi(Ea,e)}function Jv(e){return ro(po,e)}function Yv(e){return Gi(at,e)}function qv(e){return Bi(at,e)}function Xv(e){return Wi(at,e)}function Qv(e){return Zi(at,e)}function eb(e){return oo(go,e)}function tb(e){return oo(go,{protocol:ze.httpProtocol,hostname:ze.domain,...I.normalizeParams(e)})}function nb(e){return Ki(Ta,e)}function rb(e){return Vi(Aa,e)}function ob(e){return Hi(Ia,e)}function ib(e){return Ji(Ca,e)}function ab(e){return Yi(Pa,e)}function sb(e){return qi(Oa,e)}function cb(e){return Xi(Na,e)}function lb(e){return Qi(Ra,e)}function db(e){return Bd(Ap,e)}function ub(e){return ea(Da,e)}function pb(e){return ta(La,e)}function hb(e){return na(ja,e)}function mb(e){return ra(Ma,e)}function fb(e){return oa(za,e)}function gb(e){return ia(Ua,e)}function yb(e){return aa(Fa,e)}function vb(e,t,r={}){return tr(sr,e,t,r)}function bb(e){return tr(sr,"hostname",ze.hostname,e)}function wb(e){return tr(sr,"hex",ze.hex,e)}function _b(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=ze[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return tr(sr,o,n,t)}function Ip(e){return Jd(cr,e)}function xa(e){return qd(fn,e)}function kb(e){return Xd(fn,e)}function xb(e){return Qd(fn,e)}function Sb(e){return eu(fn,e)}function $b(e){return tu(fn,e)}function Cp(e){return nu(lr,e)}function Eb(e){return ou(dr,e)}function Tb(e){return au(Ga,e)}function Ab(e){return su(Ga,e)}function Ib(e){return cu(Pp,e)}function Cb(e){return lu(Op,e)}function Rp(e){return du(Np,e)}function Pb(){return uu(Dp)}function mn(){return pu(Lp)}function Ba(e){return hu(jp,e)}function Ob(e){return mu(Mp,e)}function Nb(e){return fu(yo,e)}function vo(e,t){return vu(zp,e,t)}function Rb(e){let t=e._zod.def.shape;return Za(Object.keys(t))}function Db(e,t){let r={type:"object",shape:e??{},...I.normalizeParams(t)};return new bo(r)}function Lb(e,t){return new bo({type:"object",shape:e,catchall:Ba(),...I.normalizeParams(t)})}function jb(e,t){return new bo({type:"object",shape:e,catchall:mn(),...I.normalizeParams(t)})}function Wa(e,t){return new wo({type:"union",options:e,...I.normalizeParams(t)})}function Mb(e,t){return new Up({type:"union",options:e,inclusive:!1,...I.normalizeParams(t)})}function zb(e,t,r){return new Fp({type:"union",options:t,discriminator:e,...I.normalizeParams(r)})}function Bp(e,t){return new Gp({type:"intersection",left:e,right:t})}function Zp(e,t,r){let o=t instanceof G,n=o?r:t,i=o?t:null;return new Wp({type:"tuple",items:e,rest:i,...I.normalizeParams(n)})}function Kp(e,t,r){return!t||!t._zod?new or({type:"record",keyType:uo(),valueType:e,...I.normalizeParams(t)}):new or({type:"record",keyType:e,valueType:t,...I.normalizeParams(r)})}function Ub(e,t,r){let o=Se(e);return o._zod.values=void 0,new or({type:"record",keyType:o,valueType:t,...I.normalizeParams(r)})}function Fb(e,t,r){return new or({type:"record",keyType:e,valueType:t,mode:"loose",...I.normalizeParams(r)})}function Gb(e,t,r){return new Vp({type:"map",keyType:e,valueType:t,...I.normalizeParams(r)})}function Bb(e,t){return new Hp({type:"set",valueType:e,...I.normalizeParams(t)})}function Za(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ir({type:"enum",entries:r,...I.normalizeParams(t)})}function Wb(e,t){return new ir({type:"enum",entries:e,...I.normalizeParams(t)})}function Zb(e,t){return new Jp({type:"literal",values:Array.isArray(e)?e:[e],...I.normalizeParams(t)})}function Kb(e){return bu(Yp,e)}function Ka(e){return new qp({type:"transform",transform:e})}function ho(e){return new Va({type:"optional",innerType:e})}function Qp(e){return new Xp({type:"optional",innerType:e})}function mo(e){return new eh({type:"nullable",innerType:e})}function Vb(e){return ho(mo(e))}function nh(e,t){return new th({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}function oh(e,t){return new rh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}function ih(e,t){return new Ha({type:"nonoptional",innerType:e,...I.normalizeParams(t)})}function Hb(e){return new ah({type:"success",innerType:e})}function ch(e,t){return new sh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Jb(e){return yu(lh,e)}function Sa(e,t){return new _o({type:"pipe",in:e,out:t})}function Yb(e,t,r){return new ko({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function qb(e){let t=e._zod.def;return new ko({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function ph(e){return new uh({type:"readonly",innerType:e})}function Xb(e,t){return new hh({type:"template_literal",parts:e,...I.normalizeParams(t)})}function fh(e){return new mh({type:"lazy",getter:e})}function Qb(e){return new gh({type:"promise",innerType:e})}function ew(e){return new yh({type:"function",input:Array.isArray(e?.input)?Zp(e?.input):e?.input??vo(mn()),output:e?.output??mn()})}function tw(e){let t=new X({check:"custom"});return t._zod.check=e,t}function nw(e,t){return wu(xo,e??(()=>!0),t)}function vh(e,t={}){return _u(xo,e,t)}function bh(e,t){return ku(e,t)}function iw(e,t={}){let r=new xo({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...I.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function sw(e){let t=fh(()=>Wa([uo(e),Ip(),Cp(),Rp(),vo(t),Kp(uo(),t)]));return t}function cw(e,t){return new dh({type:"pipe",in:Ka(e),out:t})}var Vv,B,$a,ar,q,Ea,po,at,go,Ta,Aa,Ia,Ca,Pa,Oa,Na,Ra,Ap,Da,La,ja,Ma,za,Ua,Fa,sr,cr,fn,lr,dr,Ga,Pp,Op,Np,Dp,Lp,jp,Mp,yo,zp,bo,wo,Up,Fp,Gp,Wp,or,Vp,Hp,ir,Jp,Yp,qp,Va,Xp,eh,th,rh,Ha,ah,sh,lh,_o,ko,dh,uh,hh,mh,gh,yh,xo,rw,ow,aw,lo=y(()=>{Fe();Fe();ao();io();va();so();Tp();Vv=new WeakMap;B=v("ZodType",(e,t)=>(G.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nr(e,"input"),output:nr(e,"output")}}),e.toJSONSchema=Eu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>fp(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>yp(e,r,o),e.parseAsync=async(r,o)=>gp(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>vp(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>bp(e,r,o),e.decode=(r,o)=>wp(e,r,o),e.encodeAsync=async(r,o)=>_p(e,r,o),e.decodeAsync=async(r,o)=>kp(e,r,o),e.safeEncode=(r,o)=>xp(e,r,o),e.safeDecode=(r,o)=>Sp(e,r,o),e.safeEncodeAsync=async(r,o)=>$p(e,r,o),e.safeDecodeAsync=async(r,o)=>Ep(e,r,o),fo(e,"ZodType",{check(...r){let o=this.def;return this.clone(I.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Se(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(vh(r,o))},superRefine(r,o){return this.check(bh(r,o))},overwrite(r){return this.check(Xe(r))},optional(){return ho(this)},exactOptional(){return Qp(this)},nullable(){return mo(this)},nullish(){return ho(mo(this))},nonoptional(r){return ih(this,r)},array(){return vo(this)},or(r){return Wa([this,r])},and(r){return Bp(this,r)},transform(r){return Sa(this,Ka(r))},default(r){return nh(this,r)},prefault(r){return oh(this,r)},catch(r){return ch(this,r)},pipe(r){return Sa(this,r)},readonly(){return ph(this)},describe(r){let o=this.clone();return me.add(o,{description:r}),o},meta(...r){if(r.length===0)return me.get(this);let o=this.clone();return me.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return me.get(e)?.description},configurable:!0}),e)),$a=v("_ZodString",(e,t)=>{dn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Tu(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,fo(e,"_ZodString",{regex(...o){return this.check(Bn(...o))},includes(...o){return this.check(Kn(...o))},startsWith(...o){return this.check(Vn(...o))},endsWith(...o){return this.check(Hn(...o))},min(...o){return this.check(mt(...o))},max(...o){return this.check(pn(...o))},length(...o){return this.check(hn(...o))},nonempty(...o){return this.check(mt(1,...o))},lowercase(o){return this.check(Wn(o))},uppercase(o){return this.check(Zn(o))},trim(){return this.check(qn())},normalize(...o){return this.check(Yn(...o))},toLowerCase(){return this.check(Xn())},toUpperCase(){return this.check(Qn())},slugify(){return this.check(er())}})}),ar=v("ZodString",(e,t)=>{dn.init(e,t),$a.init(e,t),e.email=r=>e.check(Fi(Ea,r)),e.url=r=>e.check(oo(go,r)),e.jwt=r=>e.check(aa(Fa,r)),e.emoji=r=>e.check(Ki(Ta,r)),e.guid=r=>e.check(ro(po,r)),e.uuid=r=>e.check(Gi(at,r)),e.uuidv4=r=>e.check(Bi(at,r)),e.uuidv6=r=>e.check(Wi(at,r)),e.uuidv7=r=>e.check(Zi(at,r)),e.nanoid=r=>e.check(Vi(Aa,r)),e.guid=r=>e.check(ro(po,r)),e.cuid=r=>e.check(Hi(Ia,r)),e.cuid2=r=>e.check(Ji(Ca,r)),e.ulid=r=>e.check(Yi(Pa,r)),e.base64=r=>e.check(ra(Ma,r)),e.base64url=r=>e.check(oa(za,r)),e.xid=r=>e.check(qi(Oa,r)),e.ksuid=r=>e.check(Xi(Na,r)),e.ipv4=r=>e.check(Qi(Ra,r)),e.ipv6=r=>e.check(ea(Da,r)),e.cidrv4=r=>e.check(ta(La,r)),e.cidrv6=r=>e.check(na(ja,r)),e.e164=r=>e.check(ia(Ua,r)),e.datetime=r=>e.check(dp(r)),e.date=r=>e.check(up(r)),e.time=r=>e.check(pp(r)),e.duration=r=>e.check(hp(r))});q=v("ZodStringFormat",(e,t)=>{Y.init(e,t),$a.init(e,t)}),Ea=v("ZodEmail",(e,t)=>{Tl.init(e,t),q.init(e,t)});po=v("ZodGUID",(e,t)=>{$l.init(e,t),q.init(e,t)});at=v("ZodUUID",(e,t)=>{El.init(e,t),q.init(e,t)});go=v("ZodURL",(e,t)=>{Al.init(e,t),q.init(e,t)});Ta=v("ZodEmoji",(e,t)=>{Il.init(e,t),q.init(e,t)});Aa=v("ZodNanoID",(e,t)=>{Cl.init(e,t),q.init(e,t)});Ia=v("ZodCUID",(e,t)=>{Pl.init(e,t),q.init(e,t)});Ca=v("ZodCUID2",(e,t)=>{Ol.init(e,t),q.init(e,t)});Pa=v("ZodULID",(e,t)=>{Nl.init(e,t),q.init(e,t)});Oa=v("ZodXID",(e,t)=>{Rl.init(e,t),q.init(e,t)});Na=v("ZodKSUID",(e,t)=>{Dl.init(e,t),q.init(e,t)});Ra=v("ZodIPv4",(e,t)=>{Ul.init(e,t),q.init(e,t)});Ap=v("ZodMAC",(e,t)=>{Gl.init(e,t),q.init(e,t)});Da=v("ZodIPv6",(e,t)=>{Fl.init(e,t),q.init(e,t)});La=v("ZodCIDRv4",(e,t)=>{Bl.init(e,t),q.init(e,t)});ja=v("ZodCIDRv6",(e,t)=>{Wl.init(e,t),q.init(e,t)});Ma=v("ZodBase64",(e,t)=>{Kl.init(e,t),q.init(e,t)});za=v("ZodBase64URL",(e,t)=>{Vl.init(e,t),q.init(e,t)});Ua=v("ZodE164",(e,t)=>{Hl.init(e,t),q.init(e,t)});Fa=v("ZodJWT",(e,t)=>{Jl.init(e,t),q.init(e,t)});sr=v("ZodCustomStringFormat",(e,t)=>{Yl.init(e,t),q.init(e,t)});cr=v("ZodNumber",(e,t)=>{Pi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Au(e,o,n,i),fo(e,"ZodNumber",{gt(o,n){return this.check(ot(o,n))},gte(o,n){return this.check(Ee(o,n))},min(o,n){return this.check(Ee(o,n))},lt(o,n){return this.check(rt(o,n))},lte(o,n){return this.check(Ue(o,n))},max(o,n){return this.check(Ue(o,n))},int(o){return this.check(xa(o))},safe(o){return this.check(xa(o))},positive(o){return this.check(ot(0,o))},nonnegative(o){return this.check(Ee(0,o))},negative(o){return this.check(rt(0,o))},nonpositive(o){return this.check(Ue(0,o))},multipleOf(o,n){return this.check(Rt(o,n))},step(o,n){return this.check(Rt(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});fn=v("ZodNumberFormat",(e,t)=>{ql.init(e,t),cr.init(e,t)});lr=v("ZodBoolean",(e,t)=>{qr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n)});dr=v("ZodBigInt",(e,t)=>{Oi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Cu(e,o,n,i),e.gte=(o,n)=>e.check(Ee(o,n)),e.min=(o,n)=>e.check(Ee(o,n)),e.gt=(o,n)=>e.check(ot(o,n)),e.gte=(o,n)=>e.check(Ee(o,n)),e.min=(o,n)=>e.check(Ee(o,n)),e.lt=(o,n)=>e.check(rt(o,n)),e.lte=(o,n)=>e.check(Ue(o,n)),e.max=(o,n)=>e.check(Ue(o,n)),e.positive=o=>e.check(ot(BigInt(0),o)),e.negative=o=>e.check(rt(BigInt(0),o)),e.nonpositive=o=>e.check(Ue(BigInt(0),o)),e.nonnegative=o=>e.check(Ee(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Rt(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ga=v("ZodBigIntFormat",(e,t)=>{Xl.init(e,t),dr.init(e,t)});Pp=v("ZodSymbol",(e,t)=>{Ql.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n)});Op=v("ZodUndefined",(e,t)=>{ed.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n)});Np=v("ZodNull",(e,t)=>{td.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n)});Dp=v("ZodAny",(e,t)=>{nd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lu(e,r,o,n)});Lp=v("ZodUnknown",(e,t)=>{rd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n)});jp=v("ZodNever",(e,t)=>{od.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n)});Mp=v("ZodVoid",(e,t)=>{id.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n)});yo=v("ZodDate",(e,t)=>{ad.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Mu(e,o,n,i),e.min=(o,n)=>e.check(Ee(o,n)),e.max=(o,n)=>e.check(Ue(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});zp=v("ZodArray",(e,t)=>{sd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yu(e,r,o,n),e.element=t.element,fo(e,"ZodArray",{min(r,o){return this.check(mt(r,o))},nonempty(r){return this.check(mt(1,r))},max(r,o){return this.check(pn(r,o))},length(r,o){return this.check(hn(r,o))},unwrap(){return this.element}})});bo=v("ZodObject",(e,t)=>{cd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),I.defineLazy(e,"shape",()=>t.shape),fo(e,"ZodObject",{keyof(){return Za(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:mn()})},loose(){return this.clone({...this._zod.def,catchall:mn()})},strict(){return this.clone({...this._zod.def,catchall:Ba()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return I.extend(this,r)},safeExtend(r){return I.safeExtend(this,r)},merge(r){return I.merge(this,r)},pick(r){return I.pick(this,r)},omit(r){return I.omit(this,r)},partial(...r){return I.partial(Va,this,r[0])},required(...r){return I.required(Ha,this,r[0])}})});wo=v("ZodUnion",(e,t)=>{Xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ha(e,r,o,n),e.options=t.options});Up=v("ZodXor",(e,t)=>{wo.init(e,t),ld.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ha(e,r,o,n),e.options=t.options});Fp=v("ZodDiscriminatedUnion",(e,t)=>{wo.init(e,t),dd.init(e,t)});Gp=v("ZodIntersection",(e,t)=>{ud.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xu(e,r,o,n)});Wp=v("ZodTuple",(e,t)=>{Ni.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qu(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});or=v("ZodRecord",(e,t)=>{pd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ep(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});Vp=v("ZodMap",(e,t)=>{hd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(it(...r)),e.nonempty=r=>e.check(it(1,r)),e.max=(...r)=>e.check(Dt(...r)),e.size=(...r)=>e.check(un(...r))});Hp=v("ZodSet",(e,t)=>{md.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ju(e,r,o,n),e.min=(...r)=>e.check(it(...r)),e.nonempty=r=>e.check(it(1,r)),e.max=(...r)=>e.check(Dt(...r)),e.size=(...r)=>e.check(un(...r))});ir=v("ZodEnum",(e,t)=>{fd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>zu(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ir({...t,checks:[],...I.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ir({...t,checks:[],...I.normalizeParams(n),entries:i})}});Jp=v("ZodLiteral",(e,t)=>{gd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Yp=v("ZodFile",(e,t)=>{yd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bu(e,r,o,n),e.min=(r,o)=>e.check(it(r,o)),e.max=(r,o)=>e.check(Dt(r,o)),e.mime=(r,o)=>e.check(Jn(Array.isArray(r)?r:[r],o))});qp=v("ZodTransform",(e,t)=>{vd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vu(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new It(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(I.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(I.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});Va=v("ZodOptional",(e,t)=>{Ri.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ma(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Xp=v("ZodExactOptional",(e,t)=>{bd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ma(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});eh=v("ZodNullable",(e,t)=>{wd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});th=v("ZodDefault",(e,t)=>{_d.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});rh=v("ZodPrefault",(e,t)=>{kd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>op(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ha=v("ZodNonOptional",(e,t)=>{xd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>np(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});ah=v("ZodSuccess",(e,t)=>{Sd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});sh=v("ZodCatch",(e,t)=>{$d.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ip(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});lh=v("ZodNaN",(e,t)=>{Ed.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fu(e,r,o,n)});_o=v("ZodPipe",(e,t)=>{Di.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ap(e,r,o,n),e.in=t.in,e.out=t.out});ko=v("ZodCodec",(e,t)=>{_o.init(e,t),Qr.init(e,t)});dh=v("ZodPreprocess",(e,t)=>{_o.init(e,t),Td.init(e,t)}),uh=v("ZodReadonly",(e,t)=>{Ad.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});hh=v("ZodTemplateLiteral",(e,t)=>{Id.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gu(e,r,o,n)});mh=v("ZodLazy",(e,t)=>{Od.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lp(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});gh=v("ZodPromise",(e,t)=>{Pd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});yh=v("ZodFunction",(e,t)=>{Cd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ku(e,r,o,n)});xo=v("ZodCustom",(e,t)=>{Nd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zu(e,r,o,n)});rw=xu,ow=Su;aw=(...e)=>$u({Codec:ko,Boolean:lr,String:ar},...e)});function ZA(e){ne({customError:e})}function KA(){return ne().customError}var WA,wh,lw=y(()=>{Fe();WA={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};wh||(wh={})});function HA(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function JA(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function dw(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return D.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return D.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=JA(n,t),a=ve(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return D.null();if(n.length===0)return D.never();if(n.length===1)return D.literal(n[0]);if(n.every(a=>typeof a=="string"))return D.enum(n);let i=n.map(a=>D.literal(a));return i.length<2?i[0]:D.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return D.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return dw(a,t)});return n.length===0?D.never():n.length===1?n[0]:D.union(n)}if(!r)return D.any();let o;switch(r){case"string":{let n=D.string();if(e.format){let i=e.format;i==="email"?n=n.check(D.email()):i==="uri"||i==="uri-reference"?n=n.check(D.url()):i==="uuid"||i==="guid"?n=n.check(D.uuid()):i==="date-time"?n=n.check(D.iso.datetime()):i==="date"?n=n.check(D.iso.date()):i==="time"?n=n.check(D.iso.time()):i==="duration"?n=n.check(D.iso.duration()):i==="ipv4"?n=n.check(D.ipv4()):i==="ipv6"?n=n.check(D.ipv6()):i==="mac"?n=n.check(D.mac()):i==="cidr"?n=n.check(D.cidrv4()):i==="cidr-v6"?n=n.check(D.cidrv6()):i==="base64"?n=n.check(D.base64()):i==="base64url"?n=n.check(D.base64url()):i==="e164"?n=n.check(D.e164()):i==="jwt"?n=n.check(D.jwt()):i==="emoji"?n=n.check(D.emoji()):i==="nanoid"?n=n.check(D.nanoid()):i==="cuid"?n=n.check(D.cuid()):i==="cuid2"?n=n.check(D.cuid2()):i==="ulid"?n=n.check(D.ulid()):i==="xid"?n=n.check(D.xid()):i==="ksuid"&&(n=n.check(D.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?D.number().int():D.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=D.boolean();break}case"null":{o=D.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[c,d]of Object.entries(i)){let u=ve(d,t);n[c]=a.has(c)?u:u.optional()}if(e.propertyNames){let c=ve(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?ve(e.additionalProperties,t):D.any();if(Object.keys(n).length===0){o=D.record(c,d);break}let u=D.object(n).passthrough(),p=D.looseRecord(c,d);o=D.intersection(u,p);break}if(e.patternProperties){let c=e.patternProperties,d=Object.keys(c),u=[];for(let h of d){let m=ve(c[h],t),f=D.string().regex(new RegExp(h));u.push(D.looseRecord(f,m))}let p=[];if(Object.keys(n).length>0&&p.push(D.object(n).passthrough()),p.push(...u),p.length===0)o=D.object({}).passthrough();else if(p.length===1)o=p[0];else{let h=D.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)h=D.intersection(h,p[m]);o=h}break}let s=D.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(ve(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(c=>ve(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?ve(i,t):void 0;s?o=D.tuple(a).rest(s):o=D.tuple(a),typeof e.minItems=="number"&&(o=o.check(D.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(D.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(c=>ve(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?ve(e.additionalItems,t):void 0;s?o=D.tuple(a).rest(s):o=D.tuple(a),typeof e.minItems=="number"&&(o=o.check(D.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(D.maxLength(e.maxItems)))}else if(i!==void 0){let a=ve(i,t),s=D.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=D.array(D.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function ve(e,t){if(typeof e=="boolean")return e?D.any():D.never();let r=dw(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(d=>ve(d,t)),c=D.union(s);r=o?D.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(d=>ve(d,t)),c=D.xor(s);r=o?D.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:D.any();else{let s=o?r:ve(e.allOf[0],t),c=o?0:1;for(let d=c;d<e.allOf.length;d++)s=D.intersection(s,ve(e.allOf[d],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=D.nullable(r)),e.readOnly===!0&&(r=D.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))VA.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function uw(e,t){if(typeof e=="boolean")return e?D.any():D.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=HA(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??me};return ve(r,i)}var D,VA,pw=y(()=>{no();va();so();lo();D={...co,...ya,iso:rr},VA=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var _h={};nt(_h,{bigint:()=>QA,boolean:()=>XA,date:()=>e0,number:()=>qA,string:()=>YA});function YA(e){return Gd(ar,e)}function qA(e){return Yd(cr,e)}function XA(e){return ru(lr,e)}function QA(e){return iu(dr,e)}function e0(e){return gu(yo,e)}var hw=y(()=>{Fe();lo()});var l={};nt(l,{$brand:()=>dc,$input:()=>Ud,$output:()=>zd,NEVER:()=>lc,TimePrecision:()=>Wd,ZodAny:()=>Dp,ZodArray:()=>zp,ZodBase64:()=>Ma,ZodBase64URL:()=>za,ZodBigInt:()=>dr,ZodBigIntFormat:()=>Ga,ZodBoolean:()=>lr,ZodCIDRv4:()=>La,ZodCIDRv6:()=>ja,ZodCUID:()=>Ia,ZodCUID2:()=>Ca,ZodCatch:()=>sh,ZodCodec:()=>ko,ZodCustom:()=>xo,ZodCustomStringFormat:()=>sr,ZodDate:()=>yo,ZodDefault:()=>th,ZodDiscriminatedUnion:()=>Fp,ZodE164:()=>Ua,ZodEmail:()=>Ea,ZodEmoji:()=>Ta,ZodEnum:()=>ir,ZodError:()=>GA,ZodExactOptional:()=>Xp,ZodFile:()=>Yp,ZodFirstPartyTypeKind:()=>wh,ZodFunction:()=>yh,ZodGUID:()=>po,ZodIPv4:()=>Ra,ZodIPv6:()=>Da,ZodISODate:()=>wa,ZodISODateTime:()=>ba,ZodISODuration:()=>ka,ZodISOTime:()=>_a,ZodIntersection:()=>Gp,ZodIssueCode:()=>WA,ZodJWT:()=>Fa,ZodKSUID:()=>Na,ZodLazy:()=>mh,ZodLiteral:()=>Jp,ZodMAC:()=>Ap,ZodMap:()=>Vp,ZodNaN:()=>lh,ZodNanoID:()=>Aa,ZodNever:()=>jp,ZodNonOptional:()=>Ha,ZodNull:()=>Np,ZodNullable:()=>eh,ZodNumber:()=>cr,ZodNumberFormat:()=>fn,ZodObject:()=>bo,ZodOptional:()=>Va,ZodPipe:()=>_o,ZodPrefault:()=>rh,ZodPreprocess:()=>dh,ZodPromise:()=>gh,ZodReadonly:()=>uh,ZodRealError:()=>Re,ZodRecord:()=>or,ZodSet:()=>Hp,ZodString:()=>ar,ZodStringFormat:()=>q,ZodSuccess:()=>ah,ZodSymbol:()=>Pp,ZodTemplateLiteral:()=>hh,ZodTransform:()=>qp,ZodTuple:()=>Wp,ZodType:()=>B,ZodULID:()=>Pa,ZodURL:()=>go,ZodUUID:()=>at,ZodUndefined:()=>Op,ZodUnion:()=>wo,ZodUnknown:()=>Lp,ZodVoid:()=>Mp,ZodXID:()=>Oa,ZodXor:()=>Up,_ZodString:()=>$a,_default:()=>nh,_function:()=>ew,any:()=>Pb,array:()=>vo,base64:()=>mb,base64url:()=>fb,bigint:()=>Eb,boolean:()=>Cp,catch:()=>ch,check:()=>tw,cidrv4:()=>pb,cidrv6:()=>hb,clone:()=>Se,codec:()=>Yb,coerce:()=>_h,config:()=>ne,core:()=>ft,cuid:()=>ob,cuid2:()=>ib,custom:()=>nw,date:()=>Nb,decode:()=>wp,decodeAsync:()=>kp,describe:()=>rw,discriminatedUnion:()=>zb,e164:()=>gb,email:()=>Hv,emoji:()=>nb,encode:()=>bp,encodeAsync:()=>_p,endsWith:()=>Hn,enum:()=>Za,exactOptional:()=>Qp,file:()=>Kb,flattenError:()=>Kr,float32:()=>kb,float64:()=>xb,formatError:()=>Vr,fromJSONSchema:()=>uw,function:()=>ew,getErrorMap:()=>KA,globalRegistry:()=>me,gt:()=>ot,gte:()=>Ee,guid:()=>Jv,hash:()=>_b,hex:()=>wb,hostname:()=>bb,httpUrl:()=>tb,includes:()=>Kn,instanceof:()=>iw,int:()=>xa,int32:()=>Sb,int64:()=>Tb,intersection:()=>Bp,invertCodec:()=>qb,ipv4:()=>lb,ipv6:()=>ub,iso:()=>rr,json:()=>sw,jwt:()=>yb,keyof:()=>Rb,ksuid:()=>cb,lazy:()=>fh,length:()=>hn,literal:()=>Zb,locales:()=>to,looseObject:()=>jb,looseRecord:()=>Fb,lowercase:()=>Wn,lt:()=>rt,lte:()=>Ue,mac:()=>db,map:()=>Gb,maxLength:()=>pn,maxSize:()=>Dt,meta:()=>ow,mime:()=>Jn,minLength:()=>mt,minSize:()=>it,multipleOf:()=>Rt,nan:()=>Jb,nanoid:()=>rb,nativeEnum:()=>Wb,negative:()=>ca,never:()=>Ba,nonnegative:()=>da,nonoptional:()=>ih,nonpositive:()=>la,normalize:()=>Yn,null:()=>Rp,nullable:()=>mo,nullish:()=>Vb,number:()=>Ip,object:()=>Db,optional:()=>ho,overwrite:()=>Xe,parse:()=>fp,parseAsync:()=>gp,partialRecord:()=>Ub,pipe:()=>Sa,positive:()=>sa,prefault:()=>oh,preprocess:()=>cw,prettifyError:()=>xc,promise:()=>Qb,property:()=>ua,readonly:()=>ph,record:()=>Kp,refine:()=>vh,regex:()=>Bn,regexes:()=>ze,registry:()=>Ui,safeDecode:()=>Sp,safeDecodeAsync:()=>Ep,safeEncode:()=>xp,safeEncodeAsync:()=>$p,safeParse:()=>yp,safeParseAsync:()=>vp,set:()=>Bb,setErrorMap:()=>ZA,size:()=>un,slugify:()=>er,startsWith:()=>Vn,strictObject:()=>Lb,string:()=>uo,stringFormat:()=>vb,stringbool:()=>aw,success:()=>Hb,superRefine:()=>bh,symbol:()=>Ib,templateLiteral:()=>Xb,toJSONSchema:()=>fa,toLowerCase:()=>Xn,toUpperCase:()=>Qn,transform:()=>Ka,treeifyError:()=>kc,trim:()=>qn,tuple:()=>Zp,uint32:()=>$b,uint64:()=>Ab,ulid:()=>ab,undefined:()=>Cb,union:()=>Wa,unknown:()=>mn,uppercase:()=>Zn,url:()=>eb,util:()=>I,uuid:()=>Yv,uuidv4:()=>qv,uuidv6:()=>Xv,uuidv7:()=>Qv,void:()=>Ob,xid:()=>sb,xor:()=>Mb});var kh=y(()=>{Fe();lo();va();mp();Tp();lw();Fe();Dd();Fe();ao();pw();Md();so();so();hw();ne(Li())});var Ze=y(()=>{kh();kh()});function mw(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(n0.has(t)||t0.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return mw(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function fw(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(mw(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var t0,n0,xh=y(()=>{"use strict";t0=[".localhost",".local",".internal",".test",".localdomain"],n0=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var So,$o=y(()=>{"use strict";Ze();So=l.object({date:l.string(),plays:l.number(),players:l.number().nullable()})});var Eo,Ja=y(()=>{"use strict";Ze();Eo=l.discriminatedUnion("source",[l.object({source:l.literal("manifest")}),l.object({source:l.literal("studio"),element_id:l.string().min(1),edition_id:l.string().min(1)})])});function bw(e){return e.questions?e.questions:[{id:"1",kind:"choice",prompt:e.prompt,options:e.options??[],result:e.result,points:void 0,min:void 0,max:void 0,step:void 0,tolerance:void 0}]}function Ya(e,t,r){if(e.result===void 0)return 0;let n=(e.kind==="choice"?(e.options??[]).find(i=>i.key===e.result):void 0)?.points??e.points??r;if(e.kind==="number"){if(typeof t!="number"||typeof e.result!="number")return 0;let i=Math.abs(t-e.result);return i===0?n:e.tolerance===void 0||i>=e.tolerance?0:Math.round(n*(1-i/e.tolerance))}return t===e.result?n:0}function gn(e){return`round-${e.number}`}var Sh,r0,o0,i0,a0,gw,s0,$h,yw,c0,vw,l0,d0,Ke,l2,d2,u2,gt=y(()=>{"use strict";Ze();At();$o();Ja();Sh=l.object({archetype:l.literal("hunt"),number:l.number().int().positive().default(1),prompt:l.string().default(""),board:l.array(l.string().min(1)).min(2),targets:l.array(l.string().min(1)).min(1),required:l.number().int().positive().optional(),pointsPerTarget:l.number().int().nonnegative().default(10),completionBonus:l.number().int().nonnegative().default(0),attemptsAllowed:l.number().int().positive().default(10),mistakesAllowed:l.number().int().positive().default(4),open:l.boolean().default(!0),playsPerSecond:l.number().int().positive().optional(),playsPerDay:l.number().int().positive().optional(),timerSeconds:l.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),r0=l.object({key:l.string().min(1),label:l.string().min(1),value:l.number().int().nonnegative()}),o0=l.object({id:l.string().min(1),label:l.string().default(""),entries:l.array(r0).min(1)}),i0=l.object({within:l.number().min(0).max(1),label:l.string().min(1)}),a0=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],gw=l.object({archetype:l.literal("push"),number:l.number().int().positive().default(1),prompt:l.string().default(""),target:l.number().int().positive(),targetLabel:l.string().default(""),unit:l.string().max(4).default(""),theme:l.string().default(""),slates:l.array(o0).min(1),line:l.array(l.object({slate:l.string(),key:l.string()})).optional(),tiers:l.array(i0).default(a0),floorLabel:l.string().default("Rookie"),bustLabel:l.string().default("Busted"),open:l.boolean().default(!0),playsPerSecond:l.number().int().positive().optional(),playsPerDay:l.number().int().positive().optional(),timerSeconds:l.number().int().positive().optional()}).superRefine((e,t)=>{if(e.line)if(e.line.length!==e.slates.length)t.addIssue({code:"custom",path:["line"],message:`The line has ${e.line.length} pick(s) for ${e.slates.length} slate(s). A perfect line is one pick per slate.`});else{let s=0,c=!1;for(let d of e.line){let p=e.slates.find(h=>h.id===d.slate)?.entries.find(h=>h.key===d.key);if(!p){c=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${d.key}" on slate "${d.slate}", which the round does not hold.`});break}s+=p.value}!c&&s!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${s}, not the target ${e.target}. A perfect line lands exactly.`})}let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(c=>c.key)),n=[...new Set(o.filter((s,c)=>o.indexOf(s)!==c))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,c)=>s+Math.min(...c.entries.map(d=>d.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,c)=>c===0||s.within>e.tiers[c-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),s0=l.object({key:l.string().min(1),label:l.string().min(1),members:l.array(l.string().min(1)).min(2)}),$h=l.object({archetype:l.literal("group"),number:l.number().int().positive().default(1),prompt:l.string().default(""),board:l.array(l.string().min(1)).min(4),groups:l.array(s0).min(2),pointsPerGroup:l.number().int().nonnegative().default(10),completionBonus:l.number().int().nonnegative().default(0),attemptsAllowed:l.number().int().positive().default(10),mistakesAllowed:l.number().int().positive().default(4),open:l.boolean().default(!0),playsPerSecond:l.number().int().positive().optional(),playsPerDay:l.number().int().positive().optional(),timerSeconds:l.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let c=r.get(s);c&&c!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${c} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),yw=l.object({key:l.string().min(1),label:l.string().min(1),points:l.number().int().nonnegative().optional()}),c0=l.object({id:l.string().min(1),kind:l.enum(["choice","number"]).default("choice"),prompt:l.string().default(""),options:l.array(yw).optional(),min:l.number().optional(),max:l.number().optional(),step:l.number().positive().optional(),result:l.union([l.string().min(1),l.number()]).optional(),points:l.number().int().nonnegative().optional(),tolerance:l.number().positive().optional()}).superRefine((e,t)=>{if(e.kind==="choice"){if(!e.options||e.options.length<2){t.addIssue({code:"custom",path:["options"],message:"A choice needs at least two options, or there is nothing to predict."});return}new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),typeof e.result=="string"&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),typeof e.result=="number"&&t.addIssue({code:"custom",path:["result"],message:"A choice settles to one of its option keys, not to a number."});return}e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A number question has no options: a fan gives a value."}),e.min===void 0||e.max===void 0?t.addIssue({code:"custom",path:["min"],message:"A number needs a min and a max, or a fan is given a control with no ends."}):e.max<=e.min&&t.addIssue({code:"custom",path:["max"],message:"The maximum has to be above the minimum."}),typeof e.result=="string"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),vw=l.object({archetype:l.literal("predict"),number:l.number().int().positive().default(1),prompt:l.string().default(""),options:l.array(yw).min(2).optional(),questions:l.array(c0).min(1).optional(),result:l.string().min(1).optional(),pointsForCorrect:l.number().int().nonnegative().default(10),attemptsAllowed:l.number().int().positive().default(1),open:l.boolean().default(!0),playsPerSecond:l.number().int().positive().optional(),playsPerDay:l.number().int().positive().optional(),timerSeconds:l.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.options!==void 0,o=e.questions!==void 0;if(r&&o&&t.addIssue({code:"custom",path:["questions"],message:"A round declares options or questions, not both. Two homes for one question is how they drift apart."}),!r&&!o&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),o&&e.questions){let n=e.questions.map(i=>i.id);new Set(n).size!==n.length&&t.addIssue({code:"custom",path:["questions"],message:"Two questions share an id. A play names the question it answered."})}e.options&&new Set(e.options.map(n=>n.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&e.options!==void 0&&!e.options.some(n=>n.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})});l0=l.object({archetype:l.literal("bingo"),number:l.number().int().positive().default(1),prompt:l.string().default(""),rows:l.number().int().min(2),columns:l.number().int().min(2),centreMode:l.enum(["none","free","choice"]).default("none"),centreOptions:l.array(l.string().min(1)).optional(),allowCentreDuplicate:l.boolean().default(!1),lineTypes:l.array(l.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:l.array(l.object({key:l.string().min(1),label:l.string().min(1),note:l.string().optional(),result:l.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:l.number().int().nonnegative().default(10),pointsForFullBoard:l.number().int().nonnegative().default(0),shuffleAllowance:l.number().int().nonnegative().default(3),open:l.boolean().default(!0),playsPerSecond:l.number().int().positive().optional(),playsPerDay:l.number().int().positive().optional(),locksAt:l.string().optional()}).superRefine((e,t)=>{let r=e.cardPool.map(n=>n.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let o=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<o&&t.addIssue({code:"custom",path:["cardPool"],message:`The pool has ${e.cardPool.length} card${e.cardPool.length===1?"":"s"}, and a ${e.rows}x${e.columns} board needs ${o}. Add more cards or shrink the board.`}),e.centreMode==="choice")if(!e.centreOptions||e.centreOptions.length===0)t.addIssue({code:"custom",path:["centreOptions"],message:"The centre is a player's choice, so at least one option is required."});else{let n=e.centreOptions.filter(i=>!r.includes(i));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),d0=l.discriminatedUnion("archetype",[Sh,gw,$h,vw,l0]),Ke=l.preprocess(hg,d0);l2=l.object({action:l.literal("settle"),game:l.string().min(1),roundId:l.string().min(1),result:l.string().min(1)}),d2=l.object({game:l.string().min(1),round:Ke,origin:Eo.optional(),snapshot:l.string().default(""),source:l.string().optional(),roundId:l.string().min(1).optional(),selection:l.object({mode:l.literal("rotation"),windowSeconds:l.number().int().positive(),rounds:l.array(l.object({id:l.string().min(1),round:Ke,origin:Eo.optional()})).min(1)}).optional()}),u2=l.object({roundId:l.string(),version:l.number().int().nonnegative(),changed:l.boolean(),current:l.boolean(),activity:l.array(So).optional(),monthlyPlayers:l.number().int().nonnegative().optional()})});function kw(e){let t=[];e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let r=e.operations.promotion;if(r.offers_prize&&(r.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),r.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!r.skill_based&&!r.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let o of["issuer","jwks_uri"]){let n=e.identity.jwt[o],i=fw(n);i&&t.push({path:`identity.jwt.${o}`,message:i==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":i==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var To,Eh,Th,Ah,ww,zt,Ut,_w,u0,st,p0,h0,m0,f0,g0,Ft,y0,v0,b0,w0,_0,k0,x0,S0,$0,E0,T0,A0,I0,Gt,ur,Bt=y(()=>{"use strict";Ze();xh();Mr();At();gt();To="1.0",Eh=l.enum(["missing","proposed","confirmed","verified","approved"]),Th={missing:0,proposed:1,confirmed:2,verified:3,approved:4},Ah=l.enum(["runtime","live","enterprise"]),ww="Accounts must be approved before the first deploy.",zt=l.enum(["L0","L1","L2","L3","L4","L5"]),Ut={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},_w={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},u0=l.discriminatedUnion("kind",[l.object({kind:l.literal("human_decision"),owner:l.string(),date:l.string(),note:l.string().optional()}),l.object({kind:l.literal("generated_proposal"),tool:l.string(),model:l.string().optional(),source_context:l.string().optional()}),l.object({kind:l.literal("repository_evidence"),file:l.string(),commit:l.string().optional(),package:l.string().optional()}),l.object({kind:l.literal("platform_evidence"),system:l.string(),id:l.string()}),l.object({kind:l.literal("external_evidence"),supplier:l.string(),licence:l.string().optional(),dataset_version:l.string().optional()})]),st={status:Eh.default("missing"),provenance:l.array(u0).default([])},p0=l.object({schema_version:l.string(),revision:l.number().int().nonnegative().default(0),conformance:zt.default("L0")}),h0=l.object({repository:l.string().url(),branch:l.string().default("main")}),m0=l.object({id:l.string().min(1),title:l.string().min(1),summary:l.string().optional(),source:h0.optional(),owners:l.object({ip:l.string().optional(),delivery:l.string().optional(),platform:l.string().optional()}).prefault({}),...st}),f0=l.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),g0=l.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo"]),Ft=l.preprocess(e=>typeof e=="string"?Ye(e):e,g0),y0=l.object({route:f0.optional(),archetype:Ft.optional(),component:l.string().optional(),version:l.string().optional(),variant:l.string().optional(),configuration:l.record(l.string(),l.unknown()).default({}),round:Ke.optional(),...st}),v0=l.object({surfaces:l.array(l.string()).default([]),container_label:l.string().min(1).default(Nn),screen_graph:l.string().optional(),design:l.object({figma_file:l.string().optional(),figma_version:l.string().optional(),tokens:l.string().optional(),fidelity:zt.optional()}).optional(),...st}),b0=l.object({spec_url:l.string().optional(),version:l.string().optional(),...st}),w0=l.object({family:l.string().optional(),version:l.string().optional(),configuration_schema:l.string().optional(),...st}),_0=l.object({project_template:l.string().optional(),project_id:l.string().optional(),events:l.array(l.string()).default([]),elements:l.array(l.string()).default([]),...st}),k0=l.object({required:l.boolean().default(!1),minimum_age:l.number().int().positive().max(120).optional(),method:l.enum(["self_declared","verified"]).default("self_declared"),verifier:l.string().optional()}),x0=l.object({issuer:l.string().url(),jwks_uri:l.string().url(),audience:l.string().optional()}),S0=l.object({provider:l.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:x0.optional(),require_authenticated_writes:l.boolean().default(!0),age_gate:k0.prefault({}),consent:l.object({analytics_requires_consent:l.boolean().default(!0),provider:l.string().optional()}).prefault({}),...st}),$0=l.object({type:l.enum(["monterosa","posthog","ga4","webhook"]),enabled:l.boolean().default(!0),config:l.record(l.string(),l.string()).default({})}),E0=l.object({destinations:l.array($0).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:l.array(l.string()).default([]),signal:l.object({enabled:l.boolean().default(!1),application_id:l.string().optional(),write_key:l.string().optional(),monterosa:l.object({enabled:l.boolean().default(!1),organisation_id:l.string().optional(),project_id:l.string().optional()}).prefault({})}).prefault({}),...st}),T0=l.object({hosting:l.string().optional(),space_spec:l.string().optional(),environments:l.array(l.enum(["local","playground","staging","production"])).default(["local"]),...st}),A0=l.object({offers_prize:l.boolean().default(!1),free_entry_route:l.string().optional(),skill_based:l.boolean().default(!1),terms_url:l.string().optional(),jurisdictions:l.array(l.string()).default([])}),I0=l.object({support_tier:Ah.optional(),runbook:l.string().optional(),promotion:A0.prefault({}),...st}),Gt=l.object({manifest:p0,app:m0,experience:v0.prefault({}),studio_app:b0.prefault({}),studio_surface:w0.prefault({}),backend:y0.prefault({}),interaction_cloud:_0.prefault({}),identity:S0.prefault({}),measurement:E0.prefault({}),deployment:T0.prefault({}),operations:I0.prefault({})});ur=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function De(e,t={}){let r=h=>({id:h.id,level:h.level,requirement:h.requirement,advice:h.advice,owner:h.owner,passed:h.check(e,t)}),o=Ih.filter(h=>h.checkable).map(r),n=Ih.filter(h=>!h.checkable).map(r),i="L0",a=!0;for(let h of Ch){let m=o.filter(b=>b.level===h);m.length>0&&m.every(b=>b.passed)&&a?i=h:a=!1}let s=o.filter(h=>h.level==="L0").every(h=>h.passed),c=Ut[i]+1,d=Ch[c],u=d?o.filter(h=>h.level===d&&!h.passed):[],p=e.manifest.conformance;return{computed:i,computedName:_w[i],claimed:p,overclaimed:!s||Math.min(Ut[p],Ut[xw])>Ut[i],results:o,blockers:s?u:o.filter(h=>h.level==="L0"&&!h.passed),ceiling:xw,advice:n}}function Sw(e,t){let o=De(e).results.filter(n=>!n.passed&&Ut[n.level]<=Ut[t]);return{ok:o.length===0,missing:o}}var yn,fe,Ih,Ch,C0,w2,xw,qa=y(()=>{"use strict";Bt();yn=(e,t,r)=>{let o=e[t];return Th[o?.status??"missing"]>=Th[r]},fe=e=>typeof e=="string"?e.trim().length>0:e!=null,Ih=[{level:"L0",id:"L0.app.identity",checkable:!0,advice:"Give the game a name, and a short id we can use in web addresses.",owner:"creator",requirement:"app.id and app.title are set",check:e=>fe(e.app.id)&&fe(e.app.title)},{level:"L0",id:"L0.app.status",checkable:!0,advice:"Mark the game as started.",owner:"creator",requirement:"app section is at least proposed",check:e=>yn(e,"app","proposed")},{level:"L0",id:"L0.schema.version",checkable:!0,advice:"The version of the format this game is described in. Set when the game was created.",owner:"creator",requirement:"manifest.schema_version is set",check:e=>fe(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",checkable:!0,advice:"Describe the screens in the game.",owner:"creator",requirement:"experience declares a screen graph or at least one player surface",check:e=>fe(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",checkable:!0,advice:"Mark the design as started.",owner:"creator",requirement:"experience section is at least proposed",check:e=>yn(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",checkable:!0,advice:"Choose which engine runs the game: one we manage, or one you bring.",owner:"creator",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>fe(e.backend.route)},{level:"L2",id:"L2.backend.pinned",checkable:!0,advice:"Deploy the game. We record which engine answered.",owner:"creator",requirement:"a component is serving this game's rounds",check:(e,t)=>fe(t.backendComponent)||fe(e.backend.component)&&fe(e.backend.version)},{level:"L2",id:"L2.identity.policy",checkable:!0,advice:"Say how a fan signs in. If they don't sign in, say that. Gamestage does not provide sign-in, so this names the one a fan meets.",owner:"creator",requirement:"an identity provider is named",check:e=>fe(e.identity.provider)},{level:"L2",id:"L2.measurement.destination",checkable:!0,advice:"Switch on somewhere to send the data, on this game's Integrations tab. This checks the switch is on. Whether events are arriving is a separate question.",owner:"creator",requirement:"an analytics destination is switched on",check:(e,t)=>t.destinationsEnabled===!0||e.measurement.destinations.some(r=>r.enabled)},{level:"L2",id:"L2.platform.identifiers",checkable:!0,advice:"Deploy the game. That puts it on Monterosa's platform and gives you a place to manage content.",owner:"creator",requirement:"the game exists on Interaction Cloud",check:(e,t)=>fe(t.platformProject)||fe(e.studio_app.spec_url)||fe(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",checkable:!0,advice:"Deploy the game with a URL.",owner:"creator",requirement:"the game is deployed somewhere a fan can reach",check:(e,t)=>fe(t.playgroundUrl)||fe(e.deployment.space_spec)&&e.deployment.environments.some(r=>r!=="local")},{level:"L3",id:"L3.surface.declared",checkable:!1,advice:"Say what the person running your game can change: rounds, wording, or both.",owner:"creator",requirement:"a Studio Surface family is declared for operator control",check:e=>fe(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",checkable:!1,advice:"Mark which parts you have finished: the play, the scoring, and the hosting.",owner:"creator",requirement:"experience, backend and deployment are all confirmed or better",check:e=>yn(e,"experience","confirmed")&&yn(e,"backend","confirmed")&&yn(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",checkable:!1,advice:"Link proof it works: a play-through recording, or a test result.",owner:"creator",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>yn(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",checkable:!1,advice:"Name who to call when it breaks, and link the instructions they follow.",owner:"creator",requirement:"operations declares a support tier and a runbook",check:e=>fe(e.operations.support_tier)&&fe(e.operations.runbook)},{level:"L5",id:"L5.production.approved",checkable:!1,advice:"Approve the game for prod, and move your workspace onto a paid plan. Monterosa does the second part.",owner:"monterosa",requirement:"the manifest is approved and deployed to a production environment",check:e=>yn(e,"operations","approved")&&e.deployment.environments.includes("production")}],Ch=["L0","L1","L2","L3","L4","L5"],C0=[{level:"L0",name:"Concept",means:"the game has a name and a description we hold for it"},{level:"L1",name:"Experience built",means:"there is something to play, and scoring runs on our server rather than in the browser"},{level:"L2",name:"Wired to the platform",means:"it is set up on the Monterosa platform, knows who each player is, and sends its numbers to your analytics"},{level:"L3",name:"Fans can reach it",means:"it is deployed at an address a fan can open"},{level:"L4",name:"Production ready",means:"checked with evidence, with someone to call and a page saying what to do if it breaks"},{level:"L5",name:"Operating live",means:"reviewed with you, and running in production"}],w2=new Map(C0.map(e=>[e.level,e])),xw=[...Ch].reverse().find(e=>Ih.some(t=>t.level===e&&t.checkable))??"L0"});function Uw(e){return typeof e>"u"||e===null}function P0(e){return typeof e=="object"&&e!==null}function O0(e){return Array.isArray(e)?e:Uw(e)?[]:[e]}function N0(e,t){var r,o,n,i;if(t)for(i=Object.keys(t),r=0,o=i.length;r<o;r+=1)n=i[r],e[n]=t[n];return e}function R0(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function D0(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}function Fw(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
8924
9296
 
8925
- `+e.mark.snippet),o+" "+r):o}function Eo(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=z_(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}function Cm(e,t,r,o,n){var i="",a="",s=Math.floor(n/2)-1;return o-t>s&&(i=" ... ",t=o-s+i.length),r-o>s&&(a=" ...",r=o+s-a.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+a,pos:o-t+i.length}}function Pm(e,t){return ce.repeat(" ",t-e.length)+e}function OI(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,o=[0],n=[],i,a=-1;i=r.exec(e.buffer);)n.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&a<0&&(a=o.length-2);a<0&&(a=o.length-1);var s="",l,d,u=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=Cm(e.buffer,o[a-l],n[a-l],e.position-(o[a]-o[a-l]),p),s=ce.repeat(" ",t.indent)+Pm((e.line-l+1).toString(),u)+" | "+d.str+`
8926
- `+s;for(d=Cm(e.buffer,o[a],n[a],e.position,p),s+=ce.repeat(" ",t.indent)+Pm((e.line+1).toString(),u)+" | "+d.str+`
9297
+ `+e.mark.snippet),o+" "+r):o}function Io(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Fw(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}function Ph(e,t,r,o,n){var i="",a="",s=Math.floor(n/2)-1;return o-t>s&&(i=" ... ",t=o-s+i.length),r-o>s&&(a=" ...",r=o+s-a.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+a,pos:o-t+i.length}}function Oh(e,t){return ce.repeat(" ",t-e.length)+e}function G0(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,o=[0],n=[],i,a=-1;i=r.exec(e.buffer);)n.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&a<0&&(a=o.length-2);a<0&&(a=o.length-1);var s="",c,d,u=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)d=Ph(e.buffer,o[a-c],n[a-c],e.position-(o[a]-o[a-c]),p),s=ce.repeat(" ",t.indent)+Oh((e.line-c+1).toString(),u)+" | "+d.str+`
9298
+ `+s;for(d=Ph(e.buffer,o[a],n[a],e.position,p),s+=ce.repeat(" ",t.indent)+Oh((e.line+1).toString(),u)+" | "+d.str+`
8927
9299
  `,s+=ce.repeat("-",t.indent+u+3+d.pos)+`^
8928
- `,l=1;l<=t.linesAfter&&!(a+l>=n.length);l++)d=Cm(e.buffer,o[a+l],n[a+l],e.position-(o[a]-o[a+l]),p),s+=ce.repeat(" ",t.indent)+Pm((e.line+l+1).toString(),u)+" | "+d.str+`
8929
- `;return s.replace(/\n$/,"")}function LI(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function jI(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(RI.indexOf(r)===-1)throw new Te('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=LI(t.styleAliases||null),DI.indexOf(this.kind)===-1)throw new Te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}function x_(e,t){var r=[];return e[t].forEach(function(o){var n=r.length;r.forEach(function(i,a){i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi&&(n=a)}),r[n]=o}),r}function MI(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function o(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(o);return e}function Nm(e){return this.extend(e)}function zI(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function UI(){return null}function FI(e){return e===null}function BI(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function GI(e){return e==="true"||e==="True"||e==="TRUE"}function WI(e){return Object.prototype.toString.call(e)==="[object Boolean]"}function ZI(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function KI(e){return 48<=e&&e<=55}function VI(e){return 48<=e&&e<=57}function HI(e){if(e===null)return!1;var t=e.length,r=0,o=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;o=!0}return o&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!ZI(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!KI(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!VI(e.charCodeAt(r)))return!1;o=!0}return!(!o||n==="_")}function JI(e){var t=e,r=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function YI(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ce.isNegativeZero(e)}function XI(e){return!(e===null||!qI.test(e)||e[e.length-1]==="_")}function QI(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}function t0(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ce.isNegativeZero(e))return"-0.0";return r=e.toString(10),e0.test(r)?r.replace("e",".e"):r}function n0(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ce.isNegativeZero(e))}function r0(e){return e===null?!1:q_.exec(e)!==null||X_.exec(e)!==null}function o0(e){var t,r,o,n,i,a,s,l=0,d=null,u,p,m;if(t=q_.exec(e),t===null&&(t=X_.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],o=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,o,n));if(i=+t[4],a=+t[5],s=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],p=+(t[11]||0),d=(u*60+p)*6e4,t[9]==="-"&&(d=-d)),m=new Date(Date.UTC(r,o,n,i,a,s,l)),d&&m.setTime(m.getTime()-d),m}function i0(e){return e.toISOString()}function a0(e){return e==="<<"||e===null}function s0(e){if(e===null)return!1;var t,r,o=0,n=e.length,i=Mm;for(r=0;r<n;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function c0(e){var t,r,o=e.replace(/[\r\n=]/g,""),n=o.length,i=Mm,a=0,s=[];for(t=0;t<n;t++)t%4===0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|i.indexOf(o.charAt(t));return r=n%4*6,r===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):r===18?(s.push(a>>10&255),s.push(a>>2&255)):r===12&&s.push(a>>4&255),new Uint8Array(s)}function l0(e){var t="",r=0,o,n,i=e.length,a=Mm;for(o=0;o<i;o++)o%3===0&&o&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[o];return n=i%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function d0(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function m0(e){if(e===null)return!0;var t=[],r,o,n,i,a,s=e;for(r=0,o=s.length;r<o;r+=1){if(n=s[r],a=!1,p0.call(n)!=="[object Object]")return!1;for(i in n)if(u0.call(n,i))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function h0(e){return e!==null?e:[]}function g0(e){if(e===null)return!0;var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(o=a[t],f0.call(o)!=="[object Object]"||(n=Object.keys(o),n.length!==1))return!1;i[t]=[n[0],o[n[0]]]}return!0}function y0(e){if(e===null)return[];var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1)o=a[t],n=Object.keys(o),i[t]=[n[0],o[n[0]]];return i}function b0(e){if(e===null)return!0;var t,r=e;for(t in r)if(v0.call(r,t)&&r[t]!==null)return!1;return!0}function _0(e){return e!==null?e:{}}function $_(e){return Object.prototype.toString.call(e)}function ct(e){return e===10||e===13}function yn(e){return e===9||e===32}function Re(e){return e===9||e===32||e===10||e===13}function pr(e){return e===44||e===91||e===93||e===123||e===125}function $0(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function E0(e){return e===120?2:e===117?4:e===85?8:0}function T0(e){return 48<=e&&e<=57?e-48:-1}function E_(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
8930
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function A0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function lw(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}function I0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||zm,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pw(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=NI(r),new Te(t,r)}function z(e,t){throw pw(e,t)}function Xa(e,t){e.onWarning&&e.onWarning.call(null,pw(e,t))}function Gt(e,t,r,o){var n,i,a,s;if(t<r){if(s=e.input.slice(t,r),o)for(n=0,i=s.length;n<i;n+=1)a=s.charCodeAt(n),a===9||32<=a&&a<=1114111||z(e,"expected valid JSON character");else k0.test(s)&&z(e,"the stream contains non-printable characters");e.result+=s}}function A_(e,t,r,o){var n,i,a,s;for(ce.isObject(r)||z(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,s=n.length;a<s;a+=1)i=n[a],Wt.call(t,i)||(lw(t,i,r[i]),o[i]=!0)}function mr(e,t,r,o,n,i,a,s,l){var d,u;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),d=0,u=n.length;d<u;d+=1)Array.isArray(n[d])&&z(e,"nested arrays are not supported inside keys"),typeof n=="object"&&$_(n[d])==="[object Object]"&&(n[d]="[object Object]");if(typeof n=="object"&&$_(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,u=i.length;d<u;d+=1)A_(e,t,i[d],r);else A_(e,t,i,r);else!e.json&&!Wt.call(r,n)&&Wt.call(t,n)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,z(e,"duplicated mapping key")),lw(t,n,i),delete r[n];return t}function Um(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):z(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function oe(e,t,r){for(var o=0,n=e.input.charCodeAt(e.position);n!==0;){for(;yn(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ct(n))for(Um(e),n=e.input.charCodeAt(e.position),o++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&o!==0&&e.lineIndent<r&&Xa(e,"deficient indentation"),o}function ts(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Re(r)))}function Fm(e,t){t===1?e.result+=" ":t>1&&(e.result+=ce.repeat(`
8931
- `,t-1))}function C0(e,t,r){var o,n,i,a,s,l,d,u,p=e.kind,m=e.result,h;if(h=e.input.charCodeAt(e.position),Re(h)||pr(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=e.input.charCodeAt(e.position+1),Re(n)||r&&pr(n)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,s=!1;h!==0;){if(h===58){if(n=e.input.charCodeAt(e.position+1),Re(n)||r&&pr(n))break}else if(h===35){if(o=e.input.charCodeAt(e.position-1),Re(o))break}else{if(e.position===e.lineStart&&ts(e)||r&&pr(h))break;if(ct(h))if(l=e.line,d=e.lineStart,u=e.lineIndent,oe(e,!1,-1),e.lineIndent>=t){s=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=u;break}}s&&(Gt(e,i,a,!1),Fm(e,e.line-l),i=a=e.position,s=!1),yn(h)||(a=e.position+1),h=e.input.charCodeAt(++e.position)}return Gt(e,i,a,!1),e.result?!0:(e.kind=p,e.result=m,!1)}function P0(e,t){var r,o,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Gt(e,o,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)o=e.position,e.position++,n=e.position;else return!0;else ct(r)?(Gt(e,o,n,!0),Fm(e,oe(e,!1,t)),o=n=e.position):e.position===e.lineStart&&ts(e)?z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);z(e,"unexpected end of the stream within a single quoted scalar")}function O0(e,t){var r,o,n,i,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return Gt(e,r,e.position,!0),e.position++,!0;if(s===92){if(Gt(e,r,e.position,!0),s=e.input.charCodeAt(++e.position),ct(s))oe(e,!1,t);else if(s<256&&dw[s])e.result+=uw[s],e.position++;else if((a=E0(s))>0){for(n=a,i=0;n>0;n--)s=e.input.charCodeAt(++e.position),(a=$0(s))>=0?i=(i<<4)+a:z(e,"expected hexadecimal character");e.result+=A0(i),e.position++}else z(e,"unknown escape sequence");r=o=e.position}else ct(s)?(Gt(e,r,o,!0),Fm(e,oe(e,!1,t)),r=o=e.position):e.position===e.lineStart&&ts(e)?z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}z(e,"unexpected end of the stream within a double quoted scalar")}function N0(e,t){var r=!0,o,n,i,a=e.tag,s,l=e.anchor,d,u,p,m,h,f=Object.create(null),b,x,k,w;if(w=e.input.charCodeAt(e.position),w===91)u=93,h=!1,s=[];else if(w===123)u=125,h=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),w=e.input.charCodeAt(++e.position);w!==0;){if(oe(e,!0,t),w=e.input.charCodeAt(e.position),w===u)return e.position++,e.tag=a,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=s,!0;r?w===44&&z(e,"expected the node content, but found ','"):z(e,"missed comma between flow collection entries"),x=b=k=null,p=m=!1,w===63&&(d=e.input.charCodeAt(e.position+1),Re(d)&&(p=m=!0,e.position++,oe(e,!0,t))),o=e.line,n=e.lineStart,i=e.position,hr(e,t,Ya,!1,!0),x=e.tag,b=e.result,oe(e,!0,t),w=e.input.charCodeAt(e.position),(m||e.line===o)&&w===58&&(p=!0,w=e.input.charCodeAt(++e.position),oe(e,!0,t),hr(e,t,Ya,!1,!0),k=e.result),h?mr(e,s,f,x,b,k,o,n,i):p?s.push(mr(e,null,f,x,b,k,o,n,i)):s.push(b),oe(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(r=!0,w=e.input.charCodeAt(++e.position)):r=!1}z(e,"unexpected end of the stream within a flow collection")}function R0(e,t){var r,o,n=Om,i=!1,a=!1,s=t,l=0,d=!1,u,p;if(p=e.input.charCodeAt(e.position),p===124)o=!1;else if(p===62)o=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Om===n?n=p===43?S_:w0:z(e,"repeat of a chomping mode identifier");else if((u=T0(p))>=0)u===0?z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?z(e,"repeat of an indentation width identifier"):(s=t+u-1,a=!0);else break;if(yn(p)){do p=e.input.charCodeAt(++e.position);while(yn(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!ct(p)&&p!==0)}for(;p!==0;){for(Um(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),ct(p)){l++;continue}if(e.lineIndent<s){n===S_?e.result+=ce.repeat(`
8932
- `,i?1+l:l):n===Om&&i&&(e.result+=`
8933
- `);break}for(o?yn(p)?(d=!0,e.result+=ce.repeat(`
8934
- `,i?1+l:l)):d?(d=!1,e.result+=ce.repeat(`
8935
- `,l+1)):l===0?i&&(e.result+=" "):e.result+=ce.repeat(`
8936
- `,l):e.result+=ce.repeat(`
8937
- `,i?1+l:l),i=!0,a=!0,l=0,r=e.position;!ct(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Gt(e,r,e.position,!1)}return!0}function I_(e,t){var r,o=e.tag,n=e.anchor,i=[],a,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Re(a))));){if(s=!0,e.position++,oe(e,!0,-1)&&e.lineIndent<=t){i.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,hr(e,t,aw,!1,!0),i.push(e.result),oe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)z(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=o,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function D0(e,t,r){var o,n,i,a,s,l,d=e.tag,u=e.anchor,p={},m=Object.create(null),h=null,f=null,b=null,x=!1,k=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),w=e.input.charCodeAt(e.position);w!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),i=e.line,(w===63||w===58)&&Re(o))w===63?(x&&(mr(e,p,m,h,f,null,a,s,l),h=f=b=null),k=!0,x=!0,n=!0):x?(x=!1,n=!0):z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=o;else{if(a=e.line,s=e.lineStart,l=e.position,!hr(e,r,iw,!1,!0))break;if(e.line===i){for(w=e.input.charCodeAt(e.position);yn(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),Re(w)||z(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(mr(e,p,m,h,f,null,a,s,l),h=f=b=null),k=!0,x=!1,n=!1,h=e.tag,f=e.result;else if(k)z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=u,!0}else if(k)z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=u,!0}if((e.line===i||e.lineIndent>t)&&(x&&(a=e.line,s=e.lineStart,l=e.position),hr(e,t,qa,!0,n)&&(x?f=e.result:b=e.result),x||(mr(e,p,m,h,f,b,a,s,l),h=f=b=null),oe(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&w!==0)z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return x&&mr(e,p,m,h,f,null,a,s,l),k&&(e.tag=d,e.anchor=u,e.kind="mapping",e.result=p),k}function L0(e){var t,r=!1,o=!1,n,i,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&z(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(i=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):z(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Re(a);)a===33&&(o?z(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),sw.test(n)||z(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),S0.test(i)&&z(e,"tag suffix cannot contain flow indicator characters")}i&&!cw.test(i)&&z(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{z(e,"tag name is malformed: "+i)}return r?e.tag=i:Wt.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:z(e,'undeclared tag handle "'+n+'"'),!0}function j0(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&z(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Re(r)&&!pr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function M0(e){var t,r,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;o!==0&&!Re(o)&&!pr(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Wt.call(e.anchorMap,r)||z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],oe(e,!0,-1),!0}function hr(e,t,r,o,n){var i,a,s,l=1,d=!1,u=!1,p,m,h,f,b,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=a=s=qa===r||aw===r,o&&oe(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;L0(e)||j0(e);)oe(e,!0,-1)?(d=!0,s=i,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):s=!1;if(s&&(s=d||n),(l===1||qa===r)&&(Ya===r||iw===r?b=t:b=t+1,x=e.position-e.lineStart,l===1?s&&(I_(e,x)||D0(e,x,b))||N0(e,b)?u=!0:(a&&R0(e,b)||P0(e,b)||O0(e,b)?u=!0:M0(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&z(e,"alias node should not have any properties")):C0(e,b,Ya===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=s&&I_(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,m=e.implicitTypes.length;p<m;p+=1)if(f=e.implicitTypes[p],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Wt.call(e.typeMap[e.kind||"fallback"],e.tag))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,h=e.typeMap.multi[e.kind||"fallback"],p=0,m=h.length;p<m;p+=1)if(e.tag.slice(0,h[p].tag.length)===h[p].tag){f=h[p];break}f||z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&f.kind!==e.kind&&z(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function z0(e){var t=e.position,r,o,n,i=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(oe(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(i=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Re(a);)a=e.input.charCodeAt(++e.position);for(o=e.input.slice(r,e.position),n=[],o.length<1&&z(e,"directive name must not be less than one character in length");a!==0;){for(;yn(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!ct(a));break}if(ct(a))break;for(r=e.position;a!==0&&!Re(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&Um(e),Wt.call(T_,o)?T_[o](e,o,n):Xa(e,'unknown document directive "'+o+'"')}if(oe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,oe(e,!0,-1)):i&&z(e,"directives end mark is expected"),hr(e,e.lineIndent-1,qa,!1,!0),oe(e,!0,-1),e.checkLineBreaks&&x0.test(e.input.slice(t,e.position))&&Xa(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ts(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,oe(e,!0,-1));return}if(e.position<e.length-1)z(e,"end of the stream or a document separator is expected");else return}function mw(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
8938
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new I0(e,t),o=e.indexOf("\0");for(o!==-1&&(r.position=o,z(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)z0(r);return r.documents}function U0(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var o=mw(e,r);if(typeof t!="function")return o;for(var n=0,i=o.length;n<i;n+=1)t(o[n])}function F0(e,t){var r=mw(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Te("expected a single document in the stream, but found more")}}function cC(e,t){var r,o,n,i,a,s,l;if(t===null)return{};for(r={},o=Object.keys(t),n=0,i=o.length;n<i;n+=1)a=o[n],s=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&gw.call(l.styleAliases,s)&&(s=l.styleAliases[s]),r[a]=s;return r}function lC(e){var t,r,o;if(t=e.toString(16).toUpperCase(),e<=255)r="x",o=2;else if(e<=65535)r="u",o=4;else if(e<=4294967295)r="U",o=8;else throw new Te("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ce.repeat("0",o-t.length)+t}function uC(e){this.schema=e.schema||zm,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ce.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=cC(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ao:dC,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function C_(e,t){for(var r=ce.repeat(" ",t),o=0,n=-1,i="",a,s=e.length;o<s;)n=e.indexOf(`
9300
+ `,c=1;c<=t.linesAfter&&!(a+c>=n.length);c++)d=Ph(e.buffer,o[a+c],n[a+c],e.position-(o[a]-o[a+c]),p),s+=ce.repeat(" ",t.indent)+Oh((e.line+c+1).toString(),u)+" | "+d.str+`
9301
+ `;return s.replace(/\n$/,"")}function K0(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function V0(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(W0.indexOf(r)===-1)throw new Ae('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=K0(t.styleAliases||null),Z0.indexOf(this.kind)===-1)throw new Ae('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}function $w(e,t){var r=[];return e[t].forEach(function(o){var n=r.length;r.forEach(function(i,a){i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi&&(n=a)}),r[n]=o}),r}function H0(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function o(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(o);return e}function Rh(e){return this.extend(e)}function J0(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Y0(){return null}function q0(e){return e===null}function X0(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Q0(e){return e==="true"||e==="True"||e==="TRUE"}function eI(e){return Object.prototype.toString.call(e)==="[object Boolean]"}function tI(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function nI(e){return 48<=e&&e<=55}function rI(e){return 48<=e&&e<=57}function oI(e){if(e===null)return!1;var t=e.length,r=0,o=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;o=!0}return o&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!tI(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!nI(e.charCodeAt(r)))return!1;o=!0}return o&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!rI(e.charCodeAt(r)))return!1;o=!0}return!(!o||n==="_")}function iI(e){var t=e,r=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function aI(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ce.isNegativeZero(e)}function cI(e){return!(e===null||!sI.test(e)||e[e.length-1]==="_")}function lI(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}function uI(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ce.isNegativeZero(e))return"-0.0";return r=e.toString(10),dI.test(r)?r.replace("e",".e"):r}function pI(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ce.isNegativeZero(e))}function hI(e){return e===null?!1:Qw.exec(e)!==null||e_.exec(e)!==null}function mI(e){var t,r,o,n,i,a,s,c=0,d=null,u,p,h;if(t=Qw.exec(e),t===null&&(t=e_.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],o=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,o,n));if(i=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=+t[10],p=+(t[11]||0),d=(u*60+p)*6e4,t[9]==="-"&&(d=-d)),h=new Date(Date.UTC(r,o,n,i,a,s,c)),d&&h.setTime(h.getTime()-d),h}function fI(e){return e.toISOString()}function gI(e){return e==="<<"||e===null}function yI(e){if(e===null)return!1;var t,r,o=0,n=e.length,i=zh;for(r=0;r<n;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function vI(e){var t,r,o=e.replace(/[\r\n=]/g,""),n=o.length,i=zh,a=0,s=[];for(t=0;t<n;t++)t%4===0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|i.indexOf(o.charAt(t));return r=n%4*6,r===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):r===18?(s.push(a>>10&255),s.push(a>>2&255)):r===12&&s.push(a>>4&255),new Uint8Array(s)}function bI(e){var t="",r=0,o,n,i=e.length,a=zh;for(o=0;o<i;o++)o%3===0&&o&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[o];return n=i%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function wI(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function xI(e){if(e===null)return!0;var t=[],r,o,n,i,a,s=e;for(r=0,o=s.length;r<o;r+=1){if(n=s[r],a=!1,kI.call(n)!=="[object Object]")return!1;for(i in n)if(_I.call(n,i))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function SI(e){return e!==null?e:[]}function EI(e){if(e===null)return!0;var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(o=a[t],$I.call(o)!=="[object Object]"||(n=Object.keys(o),n.length!==1))return!1;i[t]=[n[0],o[n[0]]]}return!0}function TI(e){if(e===null)return[];var t,r,o,n,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1)o=a[t],n=Object.keys(o),i[t]=[n[0],o[n[0]]];return i}function II(e){if(e===null)return!0;var t,r=e;for(t in r)if(AI.call(r,t)&&r[t]!==null)return!1;return!0}function CI(e){return e!==null?e:{}}function Tw(e){return Object.prototype.toString.call(e)}function ct(e){return e===10||e===13}function bn(e){return e===9||e===32}function Le(e){return e===9||e===32||e===10||e===13}function hr(e){return e===44||e===91||e===93||e===123||e===125}function DI(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function LI(e){return e===120?2:e===117?4:e===85?8:0}function jI(e){return 48<=e&&e<=57?e-48:-1}function Aw(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9302
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function MI(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function u_(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}function zI(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Uh,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function m_(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=B0(r),new Ae(t,r)}function z(e,t){throw m_(e,t)}function es(e,t){e.onWarning&&e.onWarning.call(null,m_(e,t))}function Wt(e,t,r,o){var n,i,a,s;if(t<r){if(s=e.input.slice(t,r),o)for(n=0,i=s.length;n<i;n+=1)a=s.charCodeAt(n),a===9||32<=a&&a<=1114111||z(e,"expected valid JSON character");else OI.test(s)&&z(e,"the stream contains non-printable characters");e.result+=s}}function Cw(e,t,r,o){var n,i,a,s;for(ce.isObject(r)||z(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,s=n.length;a<s;a+=1)i=n[a],Zt.call(t,i)||(u_(t,i,r[i]),o[i]=!0)}function mr(e,t,r,o,n,i,a,s,c){var d,u;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),d=0,u=n.length;d<u;d+=1)Array.isArray(n[d])&&z(e,"nested arrays are not supported inside keys"),typeof n=="object"&&Tw(n[d])==="[object Object]"&&(n[d]="[object Object]");if(typeof n=="object"&&Tw(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,u=i.length;d<u;d+=1)Cw(e,t,i[d],r);else Cw(e,t,i,r);else!e.json&&!Zt.call(r,n)&&Zt.call(t,n)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,z(e,"duplicated mapping key")),u_(t,n,i),delete r[n];return t}function Fh(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):z(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function oe(e,t,r){for(var o=0,n=e.input.charCodeAt(e.position);n!==0;){for(;bn(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ct(n))for(Fh(e),n=e.input.charCodeAt(e.position),o++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&o!==0&&e.lineIndent<r&&es(e,"deficient indentation"),o}function rs(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Le(r)))}function Gh(e,t){t===1?e.result+=" ":t>1&&(e.result+=ce.repeat(`
9303
+ `,t-1))}function UI(e,t,r){var o,n,i,a,s,c,d,u,p=e.kind,h=e.result,m;if(m=e.input.charCodeAt(e.position),Le(m)||hr(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(n=e.input.charCodeAt(e.position+1),Le(n)||r&&hr(n)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,s=!1;m!==0;){if(m===58){if(n=e.input.charCodeAt(e.position+1),Le(n)||r&&hr(n))break}else if(m===35){if(o=e.input.charCodeAt(e.position-1),Le(o))break}else{if(e.position===e.lineStart&&rs(e)||r&&hr(m))break;if(ct(m))if(c=e.line,d=e.lineStart,u=e.lineIndent,oe(e,!1,-1),e.lineIndent>=t){s=!0,m=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=d,e.lineIndent=u;break}}s&&(Wt(e,i,a,!1),Gh(e,e.line-c),i=a=e.position,s=!1),bn(m)||(a=e.position+1),m=e.input.charCodeAt(++e.position)}return Wt(e,i,a,!1),e.result?!0:(e.kind=p,e.result=h,!1)}function FI(e,t){var r,o,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Wt(e,o,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)o=e.position,e.position++,n=e.position;else return!0;else ct(r)?(Wt(e,o,n,!0),Gh(e,oe(e,!1,t)),o=n=e.position):e.position===e.lineStart&&rs(e)?z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);z(e,"unexpected end of the stream within a single quoted scalar")}function GI(e,t){var r,o,n,i,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return Wt(e,r,e.position,!0),e.position++,!0;if(s===92){if(Wt(e,r,e.position,!0),s=e.input.charCodeAt(++e.position),ct(s))oe(e,!1,t);else if(s<256&&p_[s])e.result+=h_[s],e.position++;else if((a=LI(s))>0){for(n=a,i=0;n>0;n--)s=e.input.charCodeAt(++e.position),(a=DI(s))>=0?i=(i<<4)+a:z(e,"expected hexadecimal character");e.result+=MI(i),e.position++}else z(e,"unknown escape sequence");r=o=e.position}else ct(s)?(Wt(e,r,o,!0),Gh(e,oe(e,!1,t)),r=o=e.position):e.position===e.lineStart&&rs(e)?z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}z(e,"unexpected end of the stream within a double quoted scalar")}function BI(e,t){var r=!0,o,n,i,a=e.tag,s,c=e.anchor,d,u,p,h,m,f=Object.create(null),b,x,k,_;if(_=e.input.charCodeAt(e.position),_===91)u=93,m=!1,s=[];else if(_===123)u=125,m=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),_=e.input.charCodeAt(++e.position);_!==0;){if(oe(e,!0,t),_=e.input.charCodeAt(e.position),_===u)return e.position++,e.tag=a,e.anchor=c,e.kind=m?"mapping":"sequence",e.result=s,!0;r?_===44&&z(e,"expected the node content, but found ','"):z(e,"missed comma between flow collection entries"),x=b=k=null,p=h=!1,_===63&&(d=e.input.charCodeAt(e.position+1),Le(d)&&(p=h=!0,e.position++,oe(e,!0,t))),o=e.line,n=e.lineStart,i=e.position,fr(e,t,Xa,!1,!0),x=e.tag,b=e.result,oe(e,!0,t),_=e.input.charCodeAt(e.position),(h||e.line===o)&&_===58&&(p=!0,_=e.input.charCodeAt(++e.position),oe(e,!0,t),fr(e,t,Xa,!1,!0),k=e.result),m?mr(e,s,f,x,b,k,o,n,i):p?s.push(mr(e,null,f,x,b,k,o,n,i)):s.push(b),oe(e,!0,t),_=e.input.charCodeAt(e.position),_===44?(r=!0,_=e.input.charCodeAt(++e.position)):r=!1}z(e,"unexpected end of the stream within a flow collection")}function WI(e,t){var r,o,n=Nh,i=!1,a=!1,s=t,c=0,d=!1,u,p;if(p=e.input.charCodeAt(e.position),p===124)o=!1;else if(p===62)o=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Nh===n?n=p===43?Ew:PI:z(e,"repeat of a chomping mode identifier");else if((u=jI(p))>=0)u===0?z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?z(e,"repeat of an indentation width identifier"):(s=t+u-1,a=!0);else break;if(bn(p)){do p=e.input.charCodeAt(++e.position);while(bn(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!ct(p)&&p!==0)}for(;p!==0;){for(Fh(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),ct(p)){c++;continue}if(e.lineIndent<s){n===Ew?e.result+=ce.repeat(`
9304
+ `,i?1+c:c):n===Nh&&i&&(e.result+=`
9305
+ `);break}for(o?bn(p)?(d=!0,e.result+=ce.repeat(`
9306
+ `,i?1+c:c)):d?(d=!1,e.result+=ce.repeat(`
9307
+ `,c+1)):c===0?i&&(e.result+=" "):e.result+=ce.repeat(`
9308
+ `,c):e.result+=ce.repeat(`
9309
+ `,i?1+c:c),i=!0,a=!0,c=0,r=e.position;!ct(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Wt(e,r,e.position,!1)}return!0}function Pw(e,t){var r,o=e.tag,n=e.anchor,i=[],a,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!Le(a))));){if(s=!0,e.position++,oe(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,fr(e,t,c_,!1,!0),i.push(e.result),oe(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)z(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=o,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function ZI(e,t,r){var o,n,i,a,s,c,d=e.tag,u=e.anchor,p={},h=Object.create(null),m=null,f=null,b=null,x=!1,k=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),_=e.input.charCodeAt(e.position);_!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),i=e.line,(_===63||_===58)&&Le(o))_===63?(x&&(mr(e,p,h,m,f,null,a,s,c),m=f=b=null),k=!0,x=!0,n=!0):x?(x=!1,n=!0):z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=o;else{if(a=e.line,s=e.lineStart,c=e.position,!fr(e,r,s_,!1,!0))break;if(e.line===i){for(_=e.input.charCodeAt(e.position);bn(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),Le(_)||z(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(mr(e,p,h,m,f,null,a,s,c),m=f=b=null),k=!0,x=!1,n=!1,m=e.tag,f=e.result;else if(k)z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=u,!0}else if(k)z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=u,!0}if((e.line===i||e.lineIndent>t)&&(x&&(a=e.line,s=e.lineStart,c=e.position),fr(e,t,Qa,!0,n)&&(x?f=e.result:b=e.result),x||(mr(e,p,h,m,f,b,a,s,c),m=f=b=null),oe(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&_!==0)z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return x&&mr(e,p,h,m,f,null,a,s,c),k&&(e.tag=d,e.anchor=u,e.kind="mapping",e.result=p),k}function KI(e){var t,r=!1,o=!1,n,i,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&z(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(i=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):z(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Le(a);)a===33&&(o?z(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),l_.test(n)||z(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),RI.test(i)&&z(e,"tag suffix cannot contain flow indicator characters")}i&&!d_.test(i)&&z(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{z(e,"tag name is malformed: "+i)}return r?e.tag=i:Zt.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:z(e,'undeclared tag handle "'+n+'"'),!0}function VI(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&z(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Le(r)&&!hr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function HI(e){var t,r,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;o!==0&&!Le(o)&&!hr(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Zt.call(e.anchorMap,r)||z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],oe(e,!0,-1),!0}function fr(e,t,r,o,n){var i,a,s,c=1,d=!1,u=!1,p,h,m,f,b,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=a=s=Qa===r||c_===r,o&&oe(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;KI(e)||VI(e);)oe(e,!0,-1)?(d=!0,s=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&(s=d||n),(c===1||Qa===r)&&(Xa===r||s_===r?b=t:b=t+1,x=e.position-e.lineStart,c===1?s&&(Pw(e,x)||ZI(e,x,b))||BI(e,b)?u=!0:(a&&WI(e,b)||FI(e,b)||GI(e,b)?u=!0:HI(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&z(e,"alias node should not have any properties")):UI(e,b,Xa===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&Pw(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,h=e.implicitTypes.length;p<h;p+=1)if(f=e.implicitTypes[p],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Zt.call(e.typeMap[e.kind||"fallback"],e.tag))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,m=e.typeMap.multi[e.kind||"fallback"],p=0,h=m.length;p<h;p+=1)if(e.tag.slice(0,m[p].tag.length)===m[p].tag){f=m[p];break}f||z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&f.kind!==e.kind&&z(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function JI(e){var t=e.position,r,o,n,i=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(oe(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(i=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Le(a);)a=e.input.charCodeAt(++e.position);for(o=e.input.slice(r,e.position),n=[],o.length<1&&z(e,"directive name must not be less than one character in length");a!==0;){for(;bn(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!ct(a));break}if(ct(a))break;for(r=e.position;a!==0&&!Le(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&Fh(e),Zt.call(Iw,o)?Iw[o](e,o,n):es(e,'unknown document directive "'+o+'"')}if(oe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,oe(e,!0,-1)):i&&z(e,"directives end mark is expected"),fr(e,e.lineIndent-1,Qa,!1,!0),oe(e,!0,-1),e.checkLineBreaks&&NI.test(e.input.slice(t,e.position))&&es(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&rs(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,oe(e,!0,-1));return}if(e.position<e.length-1)z(e,"end of the stream or a document separator is expected");else return}function f_(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
9310
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new zI(e,t),o=e.indexOf("\0");for(o!==-1&&(r.position=o,z(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)JI(r);return r.documents}function YI(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var o=f_(e,r);if(typeof t!="function")return o;for(var n=0,i=o.length;n<i;n+=1)t(o[n])}function qI(e,t){var r=f_(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Ae("expected a single document in the stream, but found more")}}function vC(e,t){var r,o,n,i,a,s,c;if(t===null)return{};for(r={},o=Object.keys(t),n=0,i=o.length;n<i;n+=1)a=o[n],s=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&v_.call(c.styleAliases,s)&&(s=c.styleAliases[s]),r[a]=s;return r}function bC(e){var t,r,o;if(t=e.toString(16).toUpperCase(),e<=255)r="x",o=2;else if(e<=65535)r="u",o=4;else if(e<=4294967295)r="U",o=8;else throw new Ae("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ce.repeat("0",o-t.length)+t}function _C(e){this.schema=e.schema||Uh,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ce.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=vC(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Po:wC,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ow(e,t){for(var r=ce.repeat(" ",t),o=0,n=-1,i="",a,s=e.length;o<s;)n=e.indexOf(`
8939
9311
  `,o),n===-1?(a=e.slice(o),o=s):(a=e.slice(o,n+1),o=n+1),a.length&&a!==`
8940
- `&&(i+=r),i+=a;return i}function Dm(e,t){return`
8941
- `+ce.repeat(" ",e.indent*t)}function pC(e,t){var r,o,n;for(r=0,o=e.implicitTypes.length;r<o;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function es(e){return e===K0||e===W0}function Io(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Bm||65536<=e&&e<=1114111}function P_(e){return Io(e)&&e!==Bm&&e!==Z0&&e!==To}function O_(e,t,r){var o=P_(e),n=o&&!es(e);return(r?o:o&&e!==yw&&e!==vw&&e!==bw&&e!==_w&&e!==ww)&&e!==Rm&&!(t===Qa&&!n)||P_(t)&&!es(t)&&e===Rm||t===Qa&&n}function mC(e){return Io(e)&&e!==Bm&&!es(e)&&e!==Q0&&e!==nC&&e!==Qa&&e!==yw&&e!==vw&&e!==bw&&e!==_w&&e!==ww&&e!==Rm&&e!==Y0&&e!==X0&&e!==V0&&e!==iC&&e!==eC&&e!==tC&&e!==q0&&e!==H0&&e!==J0&&e!==rC&&e!==oC}function hC(e){return!es(e)&&e!==Qa}function $o(e,t){var r=e.charCodeAt(t),o;return r>=55296&&r<=56319&&t+1<e.length&&(o=e.charCodeAt(t+1),o>=56320&&o<=57343)?(r-55296)*1024+o-56320+65536:r}function kw(e){var t=/^\n* /;return t.test(e)}function fC(e,t,r,o,n,i,a,s){var l,d=0,u=null,p=!1,m=!1,h=o!==-1,f=-1,b=mC($o(e,0))&&hC($o(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=$o(e,l),!Io(d))return ur;b=b&&O_(d,u,s),u=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=$o(e,l),d===To)p=!0,h&&(m=m||l-f-1>o&&e[f+1]!==" ",f=l);else if(!Io(d))return ur;b=b&&O_(d,u,s),u=d}m=m||h&&l-f-1>o&&e[f+1]!==" "}return!p&&!m?b&&!a&&!n(e)?xw:i===Ao?ur:Lm:r>9&&kw(e)?ur:a?i===Ao?ur:Lm:m?$w:Sw}function gC(e,t,r,o,n){e.dump=(function(){if(t.length===0)return e.quotingType===Ao?'""':"''";if(!e.noCompatMode&&(aC.indexOf(t)!==-1||sC.test(t)))return e.quotingType===Ao?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=o||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return pC(e,d)}switch(fC(t,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!o,n)){case xw:return t;case Lm:return"'"+t.replace(/'/g,"''")+"'";case Sw:return"|"+N_(t,e.indent)+R_(C_(t,i));case $w:return">"+N_(t,e.indent)+R_(C_(yC(t,a),i));case ur:return'"'+vC(t)+'"';default:throw new Te("impossible error: invalid scalar style")}})()}function N_(e,t){var r=kw(e)?String(t):"",o=e[e.length-1]===`
9312
+ `&&(i+=r),i+=a;return i}function Lh(e,t){return`
9313
+ `+ce.repeat(" ",e.indent*t)}function kC(e,t){var r,o,n;for(r=0,o=e.implicitTypes.length;r<o;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function ns(e){return e===nC||e===eC}function Oo(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Bh||65536<=e&&e<=1114111}function Nw(e){return Oo(e)&&e!==Bh&&e!==tC&&e!==Co}function Rw(e,t,r){var o=Nw(e),n=o&&!ns(e);return(r?o:o&&e!==b_&&e!==w_&&e!==__&&e!==k_&&e!==x_)&&e!==Dh&&!(t===ts&&!n)||Nw(t)&&!ns(t)&&e===Dh||t===ts&&n}function xC(e){return Oo(e)&&e!==Bh&&!ns(e)&&e!==lC&&e!==pC&&e!==ts&&e!==b_&&e!==w_&&e!==__&&e!==k_&&e!==x_&&e!==Dh&&e!==aC&&e!==cC&&e!==rC&&e!==fC&&e!==dC&&e!==uC&&e!==sC&&e!==oC&&e!==iC&&e!==hC&&e!==mC}function SC(e){return!ns(e)&&e!==ts}function Ao(e,t){var r=e.charCodeAt(t),o;return r>=55296&&r<=56319&&t+1<e.length&&(o=e.charCodeAt(t+1),o>=56320&&o<=57343)?(r-55296)*1024+o-56320+65536:r}function S_(e){var t=/^\n* /;return t.test(e)}function $C(e,t,r,o,n,i,a,s){var c,d=0,u=null,p=!1,h=!1,m=o!==-1,f=-1,b=xC(Ao(e,0))&&SC(Ao(e,e.length-1));if(t||a)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=Ao(e,c),!Oo(d))return pr;b=b&&Rw(d,u,s),u=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=Ao(e,c),d===Co)p=!0,m&&(h=h||c-f-1>o&&e[f+1]!==" ",f=c);else if(!Oo(d))return pr;b=b&&Rw(d,u,s),u=d}h=h||m&&c-f-1>o&&e[f+1]!==" "}return!p&&!h?b&&!a&&!n(e)?$_:i===Po?pr:jh:r>9&&S_(e)?pr:a?i===Po?pr:jh:h?T_:E_}function EC(e,t,r,o,n){e.dump=(function(){if(t.length===0)return e.quotingType===Po?'""':"''";if(!e.noCompatMode&&(gC.indexOf(t)!==-1||yC.test(t)))return e.quotingType===Po?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=o||e.flowLevel>-1&&r>=e.flowLevel;function c(d){return kC(e,d)}switch($C(t,s,e.indent,a,c,e.quotingType,e.forceQuotes&&!o,n)){case $_:return t;case jh:return"'"+t.replace(/'/g,"''")+"'";case E_:return"|"+Dw(t,e.indent)+Lw(Ow(t,i));case T_:return">"+Dw(t,e.indent)+Lw(Ow(TC(t,a),i));case pr:return'"'+AC(t)+'"';default:throw new Ae("impossible error: invalid scalar style")}})()}function Dw(e,t){var r=S_(e)?String(t):"",o=e[e.length-1]===`
8942
9314
  `,n=o&&(e[e.length-2]===`
8943
9315
  `||e===`
8944
9316
  `),i=n?"+":o?"":"-";return r+i+`
8945
- `}function R_(e){return e[e.length-1]===`
8946
- `?e.slice(0,-1):e}function yC(e,t){for(var r=/(\n+)([^\n]*)/g,o=(function(){var d=e.indexOf(`
8947
- `);return d=d!==-1?d:e.length,r.lastIndex=d,D_(e.slice(0,d),t)})(),n=e[0]===`
8948
- `||e[0]===" ",i,a;a=r.exec(e);){var s=a[1],l=a[2];i=l[0]===" ",o+=s+(!n&&!i&&l!==""?`
8949
- `:"")+D_(l,t),n=i}return o}function D_(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,o,n=0,i,a=0,s=0,l="";o=r.exec(e);)s=o.index,s-n>t&&(i=a>n?a:s,l+=`
8950
- `+e.slice(n,i),n=i+1),a=s;return l+=`
8951
- `,e.length-n>t&&a>n?l+=e.slice(n,a)+`
8952
- `+e.slice(a+1):l+=e.slice(n),l.slice(1)}function vC(e){for(var t="",r=0,o,n=0;n<e.length;r>=65536?n+=2:n++)r=$o(e,n),o=ve[r],!o&&Io(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=o||lC(r);return t}function bC(e,t,r){var o="",n=e.tag,i,a,s;for(i=0,a=r.length;i<a;i+=1)s=r[i],e.replacer&&(s=e.replacer.call(r,String(i),s)),(yt(e,t,s,!1,!1)||typeof s>"u"&&yt(e,t,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=n,e.dump="["+o+"]"}function L_(e,t,r,o){var n="",i=e.tag,a,s,l;for(a=0,s=r.length;a<s;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(yt(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&yt(e,t+1,null,!0,!0,!1,!0))&&((!o||n!=="")&&(n+=Dm(e,t)),e.dump&&To===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function _C(e,t,r){var o="",n=e.tag,i=Object.keys(r),a,s,l,d,u;for(a=0,s=i.length;a<s;a+=1)u="",o!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=i[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),yt(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),yt(e,t,d,!1,!1)&&(u+=e.dump,o+=u));e.tag=n,e.dump="{"+o+"}"}function wC(e,t,r,o){var n="",i=e.tag,a=Object.keys(r),s,l,d,u,p,m;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Te("sortKeys must be a boolean or a function");for(s=0,l=a.length;s<l;s+=1)m="",(!o||n!=="")&&(m+=Dm(e,t)),d=a[s],u=r[d],e.replacer&&(u=e.replacer.call(r,d,u)),yt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&To===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=Dm(e,t)),yt(e,t+1,u,!0,p)&&(e.dump&&To===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,n+=m));e.tag=i,e.dump=n||"{}"}function j_(e,t,r){var o,n,i,a,s,l;for(n=r?e.explicitTypes:e.implicitTypes,i=0,a=n.length;i<a;i+=1)if(s=n[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(r?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,fw.call(s.represent)==="[object Function]")o=s.represent(t,l);else if(gw.call(s.represent,l))o=s.represent[l](t,l);else throw new Te("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=o}return!0}return!1}function yt(e,t,r,o,n,i,a){e.tag=null,e.dump=r,j_(e,r,!1)||j_(e,r,!0);var s=fw.call(e.dump),l=o,d;o&&(o=e.flowLevel<0||e.flowLevel>t);var u=s==="[object Object]"||s==="[object Array]",p,m;if(u&&(p=e.duplicates.indexOf(r),m=p!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(n=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(u&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),s==="[object Object]")o&&Object.keys(e.dump).length!==0?(wC(e,t,e.dump,n),m&&(e.dump="&ref_"+p+e.dump)):(_C(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?L_(e,t-1,e.dump,n):L_(e,t,e.dump,n),m&&(e.dump="&ref_"+p+e.dump)):(bC(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&gC(e,e.dump,t,i,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Te("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function kC(e,t){var r=[],o=[],n,i;for(jm(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function jm(e,t,r){var o,n,i;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)jm(e[n],t,r);else for(o=Object.keys(e),n=0,i=o.length;n<i;n+=1)jm(e[o[n]],t,r)}function xC(e,t){t=t||{};var r=new uC(t);r.noRefs||kC(e,r);var o=e;return r.replacer&&(o=r.replacer.call({"":o},"",o)),yt(r,0,o,!0,!0)?r.dump+`
8953
- `:""}function Gm(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var EI,TI,AI,II,CI,PI,ce,Te,NI,RI,DI,ge,U_,F_,B_,G_,W_,Z_,K_,V_,qI,e0,H_,J_,Y_,q_,X_,Q_,ew,Mm,tw,u0,p0,nw,f0,rw,v0,ow,zm,Wt,Ya,iw,aw,qa,Om,w0,S_,k0,x0,S0,sw,cw,dw,uw,gn,T_,B0,G0,hw,fw,gw,Bm,W0,To,Z0,K0,V0,H0,Rm,J0,Y0,q0,X0,yw,Q0,Qa,eC,tC,nC,rC,vw,bw,oC,_w,iC,ww,ve,aC,sC,dC,Ao,xw,Lm,Sw,$w,ur,SC,$C,EC,TC,AC,IC,CC,PC,Wm,OC,NC,RC,DC,LC,jC,MC,Zm,Km=g(()=>{EI=M_,TI=wI,AI=kI,II=SI,CI=$I,PI=xI,ce={isNothing:EI,isObject:TI,toArray:AI,repeat:II,isNegativeZero:CI,extend:PI};Eo.prototype=Object.create(Error.prototype);Eo.prototype.constructor=Eo;Eo.prototype.toString=function(t){return this.name+": "+z_(this,t)};Te=Eo;NI=OI,RI=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],DI=["scalar","sequence","mapping"];ge=jI;Nm.prototype.extend=function(t){var r=[],o=[];if(t instanceof ge)o.push(t);else if(Array.isArray(t))o=o.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(o=o.concat(t.explicit));else throw new Te("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof ge))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new Te("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new Te("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(i){if(!(i instanceof ge))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(Nm.prototype);return n.implicit=(this.implicit||[]).concat(r),n.explicit=(this.explicit||[]).concat(o),n.compiledImplicit=x_(n,"implicit"),n.compiledExplicit=x_(n,"explicit"),n.compiledTypeMap=MI(n.compiledImplicit,n.compiledExplicit),n};U_=Nm,F_=new ge("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),B_=new ge("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),G_=new ge("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),W_=new U_({explicit:[F_,B_,G_]});Z_=new ge("tag:yaml.org,2002:null",{kind:"scalar",resolve:zI,construct:UI,predicate:FI,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});K_=new ge("tag:yaml.org,2002:bool",{kind:"scalar",resolve:BI,construct:GI,predicate:WI,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});V_=new ge("tag:yaml.org,2002:int",{kind:"scalar",resolve:HI,construct:JI,predicate:YI,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),qI=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");e0=/^[-+]?[0-9]+e/;H_=new ge("tag:yaml.org,2002:float",{kind:"scalar",resolve:XI,construct:QI,predicate:n0,represent:t0,defaultStyle:"lowercase"}),J_=W_.extend({implicit:[Z_,K_,V_,H_]}),Y_=J_,q_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),X_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");Q_=new ge("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r0,construct:o0,instanceOf:Date,represent:i0});ew=new ge("tag:yaml.org,2002:merge",{kind:"scalar",resolve:a0}),Mm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8954
- \r`;tw=new ge("tag:yaml.org,2002:binary",{kind:"scalar",resolve:s0,construct:c0,predicate:d0,represent:l0}),u0=Object.prototype.hasOwnProperty,p0=Object.prototype.toString;nw=new ge("tag:yaml.org,2002:omap",{kind:"sequence",resolve:m0,construct:h0}),f0=Object.prototype.toString;rw=new ge("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:g0,construct:y0}),v0=Object.prototype.hasOwnProperty;ow=new ge("tag:yaml.org,2002:set",{kind:"mapping",resolve:b0,construct:_0}),zm=Y_.extend({implicit:[Q_,ew],explicit:[tw,nw,rw,ow]}),Wt=Object.prototype.hasOwnProperty,Ya=1,iw=2,aw=3,qa=4,Om=1,w0=2,S_=3,k0=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,x0=/[\x85\u2028\u2029]/,S0=/[,\[\]\{\}]/,sw=/^(?:!|!!|![a-z\-]+!)$/i,cw=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;dw=new Array(256),uw=new Array(256);for(gn=0;gn<256;gn++)dw[gn]=E_(gn)?1:0,uw[gn]=E_(gn);T_={YAML:function(t,r,o){var n,i,a;t.version!==null&&z(t,"duplication of %YAML directive"),o.length!==1&&z(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),n===null&&z(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),i!==1&&z(t,"unacceptable YAML version of the document"),t.version=o[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Xa(t,"unsupported YAML version of the document")},TAG:function(t,r,o){var n,i;o.length!==2&&z(t,"TAG directive accepts exactly two arguments"),n=o[0],i=o[1],sw.test(n)||z(t,"ill-formed tag handle (first argument) of the TAG directive"),Wt.call(t.tagMap,n)&&z(t,'there is a previously declared suffix for "'+n+'" tag handle'),cw.test(i)||z(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{z(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}};B0=U0,G0=F0,hw={loadAll:B0,load:G0},fw=Object.prototype.toString,gw=Object.prototype.hasOwnProperty,Bm=65279,W0=9,To=10,Z0=13,K0=32,V0=33,H0=34,Rm=35,J0=37,Y0=38,q0=39,X0=42,yw=44,Q0=45,Qa=58,eC=61,tC=62,nC=63,rC=64,vw=91,bw=93,oC=96,_w=123,iC=124,ww=125,ve={};ve[0]="\\0";ve[7]="\\a";ve[8]="\\b";ve[9]="\\t";ve[10]="\\n";ve[11]="\\v";ve[12]="\\f";ve[13]="\\r";ve[27]="\\e";ve[34]='\\"';ve[92]="\\\\";ve[133]="\\N";ve[160]="\\_";ve[8232]="\\L";ve[8233]="\\P";aC=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],sC=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;dC=1,Ao=2;xw=1,Lm=2,Sw=3,$w=4,ur=5;SC=xC,$C={dump:SC};EC=ge,TC=U_,AC=W_,IC=J_,CC=Y_,PC=zm,Wm=hw.load,OC=hw.loadAll,NC=$C.dump,RC=Te,DC={binary:tw,float:H_,map:G_,null:Z_,pairs:rw,set:ow,timestamp:Q_,bool:K_,int:V_,merge:ew,omap:nw,seq:B_,str:F_},LC=Gm("safeLoad","load"),jC=Gm("safeLoadAll","loadAll"),MC=Gm("safeDump","dump"),Zm={Type:EC,Schema:TC,FAILSAFE_SCHEMA:AC,JSON_SCHEMA:IC,CORE_SCHEMA:CC,DEFAULT_SCHEMA:PC,load:Wm,loadAll:OC,dump:NC,YAMLException:RC,types:DC,safeLoad:LC,safeLoadAll:jC,safeDump:MC}});function ie(e){let t;try{t=Zm.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=Ft.safeParse(t);if(!r.success)return{ok:!1,issues:zC(r.error)};let o=__(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function zC(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function Co(e){return Zm.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function ns(e,t){return Ft.parse({manifest:{schema_version:So,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var rs=g(()=>{"use strict";Km();Bt()});var Vm=g(()=>{"use strict";rs();Bt();Ja()});var Ew=g(()=>{"use strict"});function Tw(e,t){let r=e.backend.archetype;if(!r)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:Ne(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:dr.map(o=>({section:o,status:e[o].status}))}}function Aw(e,t){let r=[];return t&&e.app.id!==t&&r.push(`This manifest is for the game "${e.app.id}", and you are editing "${t}". A manifest cannot change which game it belongs to: set app.id to "${t}", or register "${e.app.id}" as its own game.`),e.backend.archetype||r.push("This manifest declares no backend.archetype, so there is nothing to register. The control plane keys a game on its archetype and a game without one could never be deployed against."),r}var Iw=g(()=>{"use strict";Ja();rs();Bt()});var re,os,Cw=g(()=>{"use strict";re={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",rounds:"/play/v1/games/{game}/rounds",roundsMine:"/play/v1/games/{game}/rounds/mine",nextRound:"/play/v1/games/{game}/rounds/next",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},os="/play"});function is(e,t){let r=t==="won"?e.current_streak+1:t==="lost"||t==="partial"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:r,max_streak:Math.max(e.max_streak,r)}}var Pw,lt,UC,FC,BC,I2,Nw,GC,WC,C2,ZC,P2,O2,N2,Rw,KC,VC,R2,HC,JC,D2,Ow,L2,j2,Hm=g(()=>{"use strict";Ze();Bt();Va();Cw();Pw="2.0",lt=c.object({server_time:c.string(),snapshot:c.string()}),UC=c.enum(["at_commit","at_settlement"]),FC=c.enum(["shared","per_player","feed"]),BC=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),I2=lt.extend({game:c.string(),api_version:c.literal(Pw).default(Pw),archetype:Ut,marking:UC,challenge_source:FC,schedule:BC,updates:c.object({transport:c.enum(["poll","socket"]),freshness_seconds:c.number().int().positive()}),display:c.record(c.string(),c.unknown()).default({}),identity:c.object({required:c.boolean(),provider:c.string(),anonymous_play:c.boolean().default(!1)}),archive:c.boolean().default(!1),capabilities:c.array(c.string()).default([])}),Nw=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),GC=lt.extend({id:c.string(),number:c.number().int().positive().optional(),origin:xo.optional(),version:c.number().int().nonnegative(),can:Nw,opens_at:c.string().optional(),locks_at:c.string().optional(),timer_seconds:c.number().int().positive().optional(),challenge_instance_id:c.string().nullable().default(null),challenge:c.record(c.string(),c.unknown()).default({}),solution:c.record(c.string(),c.unknown()).optional()}),WC=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Nw,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1)}),C2=lt.extend({rounds:c.array(WC)}),ZC=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),P2=lt.extend({player_id:c.string(),played:c.array(ZC)}),O2=lt.extend({status:c.enum(["ready","exhausted"]),round:GC.optional()}),N2=lt.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Rw=c.object({idempotency_key:c.string().min(8),round_version:c.number().int().nonnegative(),challenge_instance_id:c.string().nullable().default(null),payload:c.record(c.string(),c.unknown())}),KC=c.enum(["accepted","rejected","duplicate","stale","busy"]),VC=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),R2=lt.extend({play_id:c.string(),outcome:KC,reason:c.string().optional(),round_version:c.number().int().nonnegative(),retry_after_seconds:c.number().int().positive().optional(),marked:c.boolean().default(!0),feedback:c.array(VC).default([]),round_state:c.lazy(()=>JC).optional()}),HC=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),JC=lt.extend({player_id:c.string(),round_id:c.string(),started_at:c.string().optional(),attempts_used:c.number().int().nonnegative().default(0),attempts_allowed:c.number().int().nonnegative().optional(),mistakes_used:c.number().int().nonnegative().default(0),mistakes_allowed:c.number().int().nonnegative().optional(),progress:c.record(c.string(),c.unknown()).default({}),score:c.number().default(0),score_revision:c.number().int().nonnegative().default(0),finished:c.boolean().default(!1),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional(),share:HC.optional()}),D2=lt.extend({player_id:c.string(),display_name:c.string().optional(),played:c.number().int().nonnegative().default(0),won:c.number().int().nonnegative().default(0),current_streak:c.number().int().nonnegative().default(0),max_streak:c.number().int().nonnegative().default(0),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});Ow=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),score:c.number()}),L2=lt.extend({round_id:c.string().optional(),order:c.enum(["high_first","low_first"]).default("high_first"),tie_break:c.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:c.array(Ow).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:Ow.optional()}),j2=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})})});function Lw(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function jw(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run \`gamestage deploy\` or refresh the round to move it on.`}function as(e){let t=Uw.safeParse(e.access);return t.success?t.data:"pending"}function Fw(e){let t=n=>typeof n=="string"&&n.trim()?n:null,r=e.decision??null,o=r?t(r.state):null;return{workspaceId:t(e.workspaceId)??"unknown",name:t(e.name),ownerEmail:t(e.ownerEmail)??"",company:t(e.company),intent:t(e.intent),signals:t(e.signals),registeredAt:t(e.registeredAt)??"",decision:o==="approved"||o==="refused"?{state:o,at:t(r.at)??t(e.registeredAt)??"",by:t(r.by)??"unknown",reason:t(r.reason)}:null}}function Bw(e){return{waiting:e.filter(t=>!t.decision).sort((t,r)=>t.registeredAt.localeCompare(r.registeredAt)),decided:e.filter(t=>t.decision).sort((t,r)=>r.decision.at.localeCompare(t.decision.at))}}function Ym(e){return lP.includes(e)}function qm(e,t){return!e.prodApproval||Ym(t.tier)?"dev":"prod"}function Ww(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function Zw(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var YC,qC,Dw,XC,QC,eP,Jm,tP,nP,Mw,zw,rP,oP,Uw,K2,V2,iP,aP,H2,J2,Y2,q2,X2,sP,Q2,Gw,ez,cP,lP,ss=g(()=>{"use strict";Ze();Bt();Dr();ko();ko();gt();YC=c.enum(["draft","live","sleeping","throttled","expired","archived"]),qC=c.enum(["scheduled","open","locked","settled"]),Dw=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),XC=c.object({id:c.string(),label:c.string(),state:qC,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),QC=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),eP=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),Jm=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),tP=c.enum(["absent","pending","ready","failed"]),nP=c.object({state:tP.default("absent"),url:c.string().nullable().default(null),regenerations:c.number().int().nonnegative().default(0),updatedAt:c.string().nullable().default(null),onProject:c.string().nullable().default(null)});Mw=c.object({section:c.string(),status:$m}),zw=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(On),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(eP).default([]),archetype:Ut,offersPrize:c.boolean().default(!1),state:YC,prodApproval:c.object({approvedAt:c.string(),approvedBy:c.string()}).nullable().default(null).optional(),archivePrefix:c.string().nullable().default(null),space:c.string().nullable().default(null).optional(),platformSpace:c.string().nullable().default(null).optional(),platformProject:c.string().nullable().default(null).optional(),platformEvent:c.string().nullable().default(null).optional(),platformElement:c.string().nullable().default(null).optional(),studioUrl:c.string().nullable().default(null).optional(),appSpec:c.object({version:c.string(),shape:c.string(),resource:c.string().nullable().default(null),specUrl:c.string().optional(),wording:c.array(c.string()).optional(),refusal:c.object({at:c.string(),reason:c.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:nP.prefault({}).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),conformance:Mt,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(Mw),meters:c.array(Dw),history:c.array(wo),rounds:c.array(XC),destinations:c.array(QC),logs:c.array(Jm),updatedAt:c.string()}),rP=c.object({login:c.string(),linkedAt:c.string()}),oP=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),Uw=c.enum(["pending","approved","refused"]),K2=c.enum(["manual","automatic"]);V2=c.enum(["approved","refused"]);iP=c.object({id:c.string(),name:c.string(),tier:Tm,ownerEmail:c.string(),access:Uw.default("pending"),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:rP.nullable().default(null),signal:oP.prefault({}),meters:c.array(Dw),games:c.array(zw)}),aP=zw.extend({logs:c.array(Jm).optional()}),H2=iP.extend({games:c.array(aP),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),J2=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),Y2=c.object({id:c.string(),name:c.string(),archetype:Ut,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:Mt,offersPrize:c.boolean().default(!1),sections:c.array(Mw).default([]),containerLabel:c.string().min(1).optional()}),q2=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),X2=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:Mt,offersPrize:c.boolean().default(!1),round:Ke.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional()}),sP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:Jm.shape.level.nullable().default(null)}),Q2=c.enum(["access_pending","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","operator_required","game_archived","art_limit_reached","art_unavailable","round_source_unreadable","round_not_seeded","delete_refused"]),Gw=c.enum(["workspace.created","workspace.approved","workspace.refused","github.linked","github.unlinked","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","round.unchanged","round.seeded","game.platform_provisioned","game.platform_provision_failed","game.app_spec_refused","art.requested","art.generated","art.failed","art.published","game.woken","game.suspended","game.throttled","game.approaching_fair_use","game.archived","game.promoted","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","destination.changed","signal.enabled","signal.disabled"]),ez=c.object({id:c.string(),at:c.string(),action:Gw,actor:c.object({kind:c.enum(["creator","operator","system"]),id:c.string(),email:c.string().nullable().default(null)}),gameId:c.string().nullable().default(null),correlationId:c.string(),detail:c.record(c.string(),c.unknown()).default({})}),cP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:Gw.nullable().default(null),actorId:c.string().nullable().default(null),gameId:c.string().nullable().default(null),from:c.string().nullable().default(null),to:c.string().nullable().default(null)}),lP=["runtime"]});var vn=g(()=>{"use strict"});function mP(e){return`slate-${e+1}`}function Hw(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,r)=>({id:mP(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var uP,pP,Vw,bn=g(()=>{"use strict";Ze();vn();uP=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),pP=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(uP).min(1)}),Vw=c.object({archetype:c.literal("push"),theme:c.string().default(""),prompt:c.string().default(""),target:c.number().int().positive(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),slates:c.array(pP).min(1)})});var mz,ls=g(()=>{"use strict";Ze();gt();bn();vn();mz=c.discriminatedUnion("archetype",[Vw,xm,Sm])});var ds=g(()=>{"use strict"});var Xm=g(()=>{"use strict";Tt();bn();ls();ds()});import{createHash as hP}from"node:crypto";function gP(e){return hP("sha256").update(e).digest("hex").slice(0,16)}function us(e){return gP(e)}var fP,Zt,_n=g(()=>{"use strict";Ze();vn();gt();fP=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative())}),Zt=c.object({corpus:c.literal("1"),measures:c.array(fP).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var yP,Yw,vP,Rz,qw,Dz,Lz,jz,Qm=g(()=>{"use strict";Ze();yP=c.enum(["push","pull"]),Yw=c.object({workspaceId:c.string().min(1),name:c.string().min(1),key:c.string().min(1),digest:c.string().regex(/^[0-9a-f]{16}$/),measures:c.array(c.string()).default([]),counts:c.record(c.string(),c.number().int().nonnegative()).default({}),bytes:c.number().int().nonnegative().default(0),origin:yP.default("push"),supplier:c.string().optional(),publishedAt:c.string().nullable().default(null),checkedAt:c.string().nullable().default(null),failing:c.boolean().default(!1),counted:c.boolean().default(!1)}),vP=c.object({gameId:c.string().min(1),gameName:c.string().default(""),pinnedDigest:c.string().nullable().default(null),stale:c.boolean().default(!1),roundIds:c.array(c.string()).default([])}),Rz=c.object({dataset:Yw,usedBy:c.array(vP).default([])}),qw=c.enum(["pushed","pulled","joined","refused","failed"]),Dz=c.object({at:c.string(),event:qw,dataset:c.string().min(1),digest:c.string().nullable().default(null),gameId:c.string().nullable().default(null),gameName:c.string().nullable().default(null),roundId:c.string().nullable().default(null),message:c.string().default(""),ok:c.boolean().default(!0)}),Lz=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(qw).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),jz=c.object({datasets:c.array(Yw).default([]),unavailable:c.string().nullable().default(null)})});var eh=g(()=>{"use strict";vn();gt()});var th=g(()=>{"use strict";bn()});var nh=g(()=>{"use strict";_n();bn();th();vn();gt();Tt();ds();ls()});function lh(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)?!0:t==="analyticsUrl"}function ps(e){return rh.filter(t=>lh(e,ch[t.key])).map(t=>t.key)}var rh,oh,Xw,ih,ah,_P,Qw,ek,wP,kP,tk,xP,sh,ch,dh=g(()=>{"use strict";rh=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:`What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:`What the result screen says when a fan finished under, e.g. "{n} away from the target". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:`The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:`The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Leave it empty to keep the game's own words.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:`The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Leave it empty and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Leave it empty and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"}],oh=rh.map(e=>e.key),Xw=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Leave it empty and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"The colour of the button a fan presses. Everything else stays as the game was built.",readBy:"The game's own page, as the --gamestage-primary custom property.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...rh,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1}],ih=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"},{key:"bingo_rows",label:"Board rows",type:"number",description:"How many rows a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_columns",label:"Board columns",type:"number",description:"How many columns a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_centre_mode",label:"Centre cell",type:"freetext",description:'One of "free" (marked for everybody, and does not use a card), "none" (an ordinary cell dealt like any other) or "choice" (the fan picks it). Leave it empty for "free".',readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_shuffle_allowance",label:"Reshuffles allowed",type:"number",description:"How many times a fan may redeal their board before locking it. Leave it empty for 3.",readBy:"The Engine, which refuses a reshuffle once this is spent.",section:"This edition"},{key:"bingo_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_points_per_line",label:"Points per line",type:"number",description:"Awarded once for each completed line. Leave it empty for 10.",readBy:"The Engine, when it scores a settled board.",section:"This edition"},{key:"bingo_points_for_full_board",label:"Points for a full board",type:"number",description:"Awarded once, on top of every line, when the whole board comes in. Leave it empty for 0.",readBy:"The Engine, when it scores a settled board.",section:"This edition"}],ah=[{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1},{key:"round_timer_seconds",label:"Time limit",type:"number",description:"How many seconds a fan gets on this round, counted from when they open it: 180 for three minutes. The Engine refuses a play that arrives after it. Leave it empty for a round with no clock.",readBy:"The Engine, which refuses a late play, and the game's own page, which counts it down.",section:"Content"}],_P=[{key:"round_theme",label:"Theme",type:"freetext",description:`What this round is about, in a word or two, e.g. "The Eighties". Shown above the game's name. Leave it empty for a round that is not one of a themed set.`,readBy:"The game's own page, above the title.",section:"This round"},{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_unit",label:"Unit",type:"freetext",description:'Put in front of every number in this round, e.g. "\xA3". Leave it empty for a round that counts something with no unit, like points.',readBy:"The game's own page, in front of the target, each pick and the total.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"},{key:"entry_note",label:"Note",type:"freetext",description:'Something worth knowing about this choice, shown to a fan who went over because of it, e.g. "Six rings, six Finals MVPs." Leave it empty and the game works out its own line.',readBy:"The game's own page, on the result when this choice took a fan over.",section:"This round"}]}]}],Qw="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",ek={key:"round_board",label:"The board",type:"collection",itemLabel:"{{board_item}}",description:"Everything a fan can pick from, in the order they should see it.",readBy:"The Engine, which marks against it, and the page, which draws it.",section:"This round",fieldset:[{key:"board_item",label:"Pick",type:"freetext",description:'One thing a fan can pick, exactly as they should read it, e.g. "Michael Jordan".',readBy:"The game's own page, and the Engine, which marks a pick by it.",section:"This round"}]},wP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},ek,{key:"round_targets",label:"The right answers",type:"freetext",description:`The picks that are right, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Larry Bird". ${Qw}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],kP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},ek,{key:"round_groups",label:"The connections",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${Qw}`,readBy:"The Engine, to mark a guess and to name a group once it is found.",section:"This round",public:!1,fieldset:[{key:"group_label",label:"What connects them",type:"freetext",description:'Shown to a fan only once they have found this group, e.g. "1996-97 Bulls".',readBy:"The game's own page, after the group is solved.",section:"This round"},{key:"group_members",label:"Which ones",type:"freetext",description:'The picks in this group, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Scottie Pippen". Every one has to be on the board, and no pick may be in two groups.',readBy:"The Engine, to mark a guess.",section:"This round"}]}],tk=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],xP=[],sh={hunt:wP,push:_P,group:kP,predict:[],bingo:xP},ch={display_name:"displayName",analytics_url:"analyticsUrl",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline",margin_over:"marginOver",margin_exact:"marginExact",margin_under:"marginUnder",result_over:"resultOver",result_exact:"resultExact",result_under:"resultUnder",share_over:"shareOver",share_exact:"shareExact",share_under:"shareUnder",result_bust_note:"resultBustNote",share_bust_note:"shareBustNote",share_dare:"shareDare",result_dare:"resultDare"}});function EP(e){let t=new Map,r=o=>{for(let n of o){let i=t.get(n.key);if(i){if(i.type!==n.type)throw new Error(`The field "${n.key}" is declared as both ${i.type} and ${n.type}. One key is one declaration; a level's own label and description travel on its field set entry, its type does not.`)}else t.set(n.key,n);r(n.fieldset??[])}};return r(e),[...t.values()]}function uh(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);i?i.properties.push(n):t.push({name:r.section,properties:[n]})}return t}function TP(e){let t=e.archetypes.map(Je);for(let i of t)if(!nk[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??oh),n=Xw.filter(i=>!oh.includes(i.key)||o.has(i.key));return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:nk[i],content_type:rk(i),derived_from:ms[i]?.derivedFrom??"data",duration:ms[i]?.duration??{mode:"instant"},label:ms[i]?.derivedFrom==="prediction"?"{{question.text}}":e.name,custom_fields:uh([...ah,...sh[Je(i)]??[]]),...ms[i]?.derivedFrom==="prediction"?{label_question:i==="bingo"?"Card":"Question",label_option:i==="bingo"?"Outcome":"Option",reveal_results:{modes:["manual"],default:"manual"},correct_option:{live_update:!0},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":EP([...n,...ih,...ah,...Object.values(sh).flat(),...tk]).map($P),"project_settings.json":{sections:uh(n)},"event_settings.json":{sections:uh(ih)}}}function ok(e){return TP({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var nk,rk,ms,SP,$P,ph=g(()=>{"use strict";dh();Tt();nk=mg,rk=e=>{let t=Je(e);return sc[t]??`gamestage-${t.replaceAll("_","-")}-element`},ms={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}}},SP=new Set(["freetext","wysiwyg","image","file"]),$P=e=>({key:e.key,type:e.type,...SP.has(e.type)?{localisable:!1}:{},...e.type==="collection"?{...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,...t.description?{description:t.description}:{}}))}:{}})});var mh=g(()=>{"use strict";Tt()});var ik=g(()=>{"use strict";Dr();ss();Xm();_n();Qm();eh();nh();ph();mh();Vm();Hm();gt()});function IP(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function ck(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let l=globalThis.location?.origin,d=new URL(`${o}${a}`,o.startsWith("/")?l:void 0);for(let[p,m]of Object.entries(s.query??{}))m!=null&&d.searchParams.set(p,String(m));let u;for(let p=1;p<=r;p++){let m=typeof e.token=="function"?await e.token():e.token,h=await t(d,{method:i,headers:{authorization:`Bearer ${m}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)});if(h.ok)return await h.json();let f=await h.json().catch(()=>({}));if(u=new Ve(h.status,f.error?.code??"unknown",f.error?.message??h.statusText,f.error?.retryable??!1),!u.retryable||p===r)break;let b=Number(h.headers.get("retry-after"));await AP(Number.isFinite(b)&&b>0?b*1e3:IP(p))}throw u??new Ve(0,"unknown","Request failed.",!1)}}function lk(e){let t=ck(e);return{setWorkspaceAccess:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o,reason:n??null}}),async listAccess(){let r=await t("GET","/v1/admin/access"),o=[...r.waiting??[],...r.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(Fw);return Bw(o)}}}function fr(e){let t=ck(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let l of r)Array.isArray(s[l])||(s[l]=[]);return s},n=a=>({...a,access:as(a),games:(a.games??[]).map(o),gamesTotal:a.gamesTotal??(a.games??[]).length,archivedTotal:a.archivedTotal??(a.games??[]).filter(s=>s.state==="archived").length}),i=a=>({...a,workspace:{...a.workspace,access:as(a.workspace??{}),games:(a.workspace?.games??[]).map(o)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(a){if(!(a instanceof Ve)||a.status!==404)throw a;return ak||(ak=!0,console.warn("[control-plane] no /v1/workspace/summary, falling back to the full workspace read. If this persists the control plane is behind the site, and every Stage screen is carrying the whole workspace again.")),n(await t("GET","/v1/workspace"))}},linkGitHub:async a=>i(await t("PUT","/v1/workspace/github",{body:{login:a}})),setPlan:async a=>i(await t("PUT","/v1/workspace/plan",{body:{tier:a}})),uploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),setPresetArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art/preset`,{body:{preset:s}}),artUploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/art/uploads`,{body:{content_type:s}}),setUploadedArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art`,{body:{url:s}}),referenceUploadTarget:(a,s)=>t("POST","/v1/reference/uploads",{body:{name:a,digest:s}}),pruneBundle:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return o(await t("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof Ve&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,l)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:l}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),promoteGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/promote`),deleteGame:a=>t("DELETE",`/v1/games/${encodeURIComponent(a)}`),deploy:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),async seedRound(a,s){try{return await t("PUT",`/v1/games/${encodeURIComponent(a)}/round`,{body:{round:s}})}catch(l){throw l instanceof Ve&&l.status===404&&!/no such game/i.test(l.message)?new Ve(404,"not_supported","This control plane cannot take a round yet. It is running a build older than this CLI, so the round has to go in through Studio until it is updated.",!1):l}},setSignal:async a=>i(await t("PUT","/v1/workspace/signal",{body:{enabled:a}})),async getEndpoints(a){try{return await t("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof Ve&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:l}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return l},async getAuditLog(a){let{records:s}=await t("GET","/v1/audit",{query:a});return s},async listDatasets(){try{let a=await t("GET","/v1/reference/datasets");return!a||!Array.isArray(a.datasets)?{datasets:[],unavailable:sk}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof Ve&&a.status===404)return{datasets:[],unavailable:sk};throw a}},async getDataset(a){try{let s=await t("GET",`/v1/reference/datasets/${encodeURIComponent(a)}`);return s?.dataset?s:void 0}catch(s){if(s instanceof Ve&&s.status===404)return;throw s}},async getDataLog(a){try{let s=await t("GET","/v1/reference/log",{query:a});return Array.isArray(s?.lines)?s.lines:[]}catch(s){if(s instanceof Ve&&s.status===404)return[];throw s}}}}var Ve,AP,ak,sk,dk=g(()=>{"use strict";ss();Ve=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},AP=e=>new Promise(t=>setTimeout(t,e)),ak=!1;sk="This control plane is running a build older than this screen, so it cannot list datasets yet."});function CP(e){if(e.timerSeconds===void 0||!Number.isInteger(e.timerSeconds)||e.timerSeconds<=0||!e.startedAt)return;let t=Date.parse(e.startedAt);if(Number.isFinite(t))return t+e.timerSeconds*1e3}function uk(e,t){let r=CP(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var pk=g(()=>{"use strict"});var mk=g(()=>{"use strict";bn()});var PP,OP,NP,d4,hh=g(()=>{"use strict";Ze();PP=c.discriminatedUnion("kind",[c.object({kind:c.literal("everyone")}),c.object({kind:c.literal("domains"),domains:c.array(c.string().min(1)).min(1)}),c.object({kind:c.literal("named")})]),OP=c.enum(["licensed","unofficial","creator"]),NP=c.enum(["ours","creator"]),d4=c.object({id:c.string().min(1),label:c.string().min(1),standing:OP,origin:NP,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),audience:PP.optional()})});var hk=g(()=>{"use strict";hh()});var fk=g(()=>{"use strict";_n()});var gk=g(()=>{"use strict";_n()});function RP(e){let t;try{t=JSON.parse(e)}catch(o){return{ok:!1,reason:"That is not JSON.",detail:o instanceof Error?o.message:void 0}}let r=Zt.safeParse(t);if(!r.success){let o=r.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:o?`${o.path.join(".")||"document"}: ${o.message}`:void 0}}return{ok:!0,summary:{digest:us(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length]))}}}async function yk(e,t){let r=RP(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}var vk=g(()=>{"use strict";_n()});var bk=g(()=>{"use strict"});var _k=g(()=>{"use strict"});function fh(e){return e.sourceIp?.trim()||"unknown"}function gh(e,t){return`${e.length}:${e}${t}`}var DP,wk,kk,xk,Sk,x4,S4,$4,$k=g(()=>{"use strict";DP=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},wk=e=>typeof process>"u"?void 0:DP(process.env?.[e]),kk=(e,t,r)=>({burst:wk(t)??e.burst,perMinute:wk(r)??e.perMinute}),xk={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},Sk={player:kk(xk.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:kk(xk.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},x4=Sk.player,S4=Sk.publicRoutes,$4=600*1e3});var Ek=g(()=>{"use strict"});var ae=g(()=>{"use strict";Dr();Tt();Bt();km();Ja();Vm();Ew();rs();Iw();Va();Hm();ko();gt();ss();ik();dk();dh();vn();eh();pk();bn();ls();th();mk();_n();hk();hh();fk();gk();vk();Qm();ds();nh();bk();ph();Xm();_k();mh();$k();Ek()});import{spawn as Tk}from"node:child_process";import{chmod as LP,mkdir as jP,readFile as MP,rm as zP,writeFile as UP}from"node:fs/promises";import{homedir as FP,platform as gr}from"node:os";import{join as Ak}from"node:path";async function Ik(){let e=await fetch(`${yh}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:vh})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function Ck(e){let t=await fetch(`${yh}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:vh,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function Pk(e){let t=gr()==="darwin"?"open":gr()==="win32"?"cmd":"xdg-open",r=gr()==="win32"?["/c","start","",e]:[e];try{Tk(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function bh(e,t){return new Promise(r=>{let o=Tk("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function _h(e){let t=JSON.stringify(e);return gr()==="darwin"&&await bh(["add-generic-password","-a",yr,"-s",yr,"-U","-w",t])!==null?"keychain":(await jP(Ok,{recursive:!0,mode:448}),await UP(hs,t,{mode:384}),await LP(hs,384),"file")}function BP(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function GP(e){if(!e.refreshToken)return null;let t=await fetch(`${yh}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:vh,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function WP(){if(gr()==="darwin"){let e=await bh(["find-generic-password","-a",yr,"-s",yr,"-w"]);if(e)try{return JSON.parse(e)}catch{}}try{return JSON.parse(await MP(hs,"utf8"))}catch{return null}}async function Nk(){gr()==="darwin"&&await bh(["delete-generic-password","-a",yr,"-s",yr]),await zP(hs,{force:!0})}async function Ue(){let e=await WP();if(!e)return null;if(!BP(e.accessToken)||!e.refreshToken)return e;let t=await GP(e);return t?(await _h(t),t):null}var yh,vh,yr,Ok,hs,Po=g(()=>{"use strict";yh="https://api.workos.com",vh=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";yr="gamestage-cli",Ok=Ak(FP(),".gamestage"),hs=Ak(Ok,"credentials.json")});function Dk(e){return`${vt}/stage/games/${encodeURIComponent(e)}?tab=overview`}function Lk(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${vt}/docs/game-formats#${e}`:`${vt}/docs`}var vt,wh=g(()=>{"use strict";vt=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function VP(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function HP(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function JP(e=be,t=process.env){if(HP(t)&&!VP(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function vr(e=be){let t=JP(e);t&&O(t)}async function Oo(){let e=await Ue();return e||O("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and validating a manifest still need no account."]),e}async function le(){let e=await Oo();return{client:fr({baseUrl:be,token:async()=>(await Ue())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function jk(){let e=await Ue();return e||O("You are not signed in.",["Run `gamestage login`. Approving a creator needs an operator's own session."]),{admin:lk({baseUrl:be,token:async()=>(await Ue())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function gs(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===kh?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${be}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${be}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${be}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function No(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:kh,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${vt}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function Mk(e){return e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function br(e){if(R(e.heading),y(` ${e.message}`),e.next.length){y();for(let t of e.next)S(t)}y()}function _e(e){let t=[],r=e.status,o=e.code;if(o===kh){let n=No({access:"pending"});j()?U({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):br(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${be}`),O(e instanceof Error?e.message:"The control plane call failed.",t)}var be,kh,dt=g(()=>{"use strict";ae();Po();de();wh();be=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";kh="access_pending"});import{open as eO,readFile as Gk}from"node:fs/promises";import{createHash as tO}from"node:crypto";import{gunzipSync as nO}from"node:zlib";function iO(e){for(let{pattern:t,what:r}of oO)if(t.test(e))return r}function $h(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||rO.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function Zk(e,t){let r;try{r=await eO(e,"r")}catch{return}try{let{size:o}=await r.stat();if(o<=t){let s=Buffer.alloc(o);return o>0&&await r.read(s,0,o,0),s}let n=Math.floor(t/2),i=Buffer.alloc(n),a=Buffer.alloc(n);return await r.read(i,0,n,0),await r.read(a,0,n,o-n),Buffer.concat([i,Buffer.from(`
8955
- `),a])}catch{return}finally{await r.close()}}async function sO(e){return(await Zk(e,Wk))?.toString("latin1")}async function jo(e){let t=await Zk(e,Wk);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await Gk(e);t=nO(s,{maxOutputLength:aO})}catch{}if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0,i=0;for(let s=0;s<r.length;s+=1)r[s]===0&&(i+=1,s%2===0?o+=1:n+=1);let a=Math.floor(r.length/2);if(a>8){if(n>a*.7&&o<a*.1)return t.toString("utf16le");if(o>a*.7&&n<a*.1)return t.swap16().toString("utf16le")}if(i<=8&&i*20<r.length)return t.toString("utf8").split("\0").join("")}function cO(e){let t=ie(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function _r(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="predict")return[];if(t.archetype==="bingo")return t.cardPool.length<2?[]:e.split(`
9317
+ `}function Lw(e){return e[e.length-1]===`
9318
+ `?e.slice(0,-1):e}function TC(e,t){for(var r=/(\n+)([^\n]*)/g,o=(function(){var d=e.indexOf(`
9319
+ `);return d=d!==-1?d:e.length,r.lastIndex=d,jw(e.slice(0,d),t)})(),n=e[0]===`
9320
+ `||e[0]===" ",i,a;a=r.exec(e);){var s=a[1],c=a[2];i=c[0]===" ",o+=s+(!n&&!i&&c!==""?`
9321
+ `:"")+jw(c,t),n=i}return o}function jw(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,o,n=0,i,a=0,s=0,c="";o=r.exec(e);)s=o.index,s-n>t&&(i=a>n?a:s,c+=`
9322
+ `+e.slice(n,i),n=i+1),a=s;return c+=`
9323
+ `,e.length-n>t&&a>n?c+=e.slice(n,a)+`
9324
+ `+e.slice(a+1):c+=e.slice(n),c.slice(1)}function AC(e){for(var t="",r=0,o,n=0;n<e.length;r>=65536?n+=2:n++)r=Ao(e,n),o=be[r],!o&&Oo(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=o||bC(r);return t}function IC(e,t,r){var o="",n=e.tag,i,a,s;for(i=0,a=r.length;i<a;i+=1)s=r[i],e.replacer&&(s=e.replacer.call(r,String(i),s)),(yt(e,t,s,!1,!1)||typeof s>"u"&&yt(e,t,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=n,e.dump="["+o+"]"}function Mw(e,t,r,o){var n="",i=e.tag,a,s,c;for(a=0,s=r.length;a<s;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(yt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&yt(e,t+1,null,!0,!0,!1,!0))&&((!o||n!=="")&&(n+=Lh(e,t)),e.dump&&Co===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function CC(e,t,r){var o="",n=e.tag,i=Object.keys(r),a,s,c,d,u;for(a=0,s=i.length;a<s;a+=1)u="",o!==""&&(u+=", "),e.condenseFlow&&(u+='"'),c=i[a],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),yt(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),yt(e,t,d,!1,!1)&&(u+=e.dump,o+=u));e.tag=n,e.dump="{"+o+"}"}function PC(e,t,r,o){var n="",i=e.tag,a=Object.keys(r),s,c,d,u,p,h;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Ae("sortKeys must be a boolean or a function");for(s=0,c=a.length;s<c;s+=1)h="",(!o||n!=="")&&(h+=Lh(e,t)),d=a[s],u=r[d],e.replacer&&(u=e.replacer.call(r,d,u)),yt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Co===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,p&&(h+=Lh(e,t)),yt(e,t+1,u,!0,p)&&(e.dump&&Co===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,n+=h));e.tag=i,e.dump=n||"{}"}function zw(e,t,r){var o,n,i,a,s,c;for(n=r?e.explicitTypes:e.implicitTypes,i=0,a=n.length;i<a;i+=1)if(s=n[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(r?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,y_.call(s.represent)==="[object Function]")o=s.represent(t,c);else if(v_.call(s.represent,c))o=s.represent[c](t,c);else throw new Ae("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=o}return!0}return!1}function yt(e,t,r,o,n,i,a){e.tag=null,e.dump=r,zw(e,r,!1)||zw(e,r,!0);var s=y_.call(e.dump),c=o,d;o&&(o=e.flowLevel<0||e.flowLevel>t);var u=s==="[object Object]"||s==="[object Array]",p,h;if(u&&(p=e.duplicates.indexOf(r),h=p!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(n=!1),h&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(u&&h&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),s==="[object Object]")o&&Object.keys(e.dump).length!==0?(PC(e,t,e.dump,n),h&&(e.dump="&ref_"+p+e.dump)):(CC(e,t,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Mw(e,t-1,e.dump,n):Mw(e,t,e.dump,n),h&&(e.dump="&ref_"+p+e.dump)):(IC(e,t,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&EC(e,e.dump,t,i,c);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ae("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function OC(e,t){var r=[],o=[],n,i;for(Mh(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function Mh(e,t,r){var o,n,i;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)Mh(e[n],t,r);else for(o=Object.keys(e),n=0,i=o.length;n<i;n+=1)Mh(e[o[n]],t,r)}function NC(e,t){t=t||{};var r=new _C(t);r.noRefs||OC(e,r);var o=e;return r.replacer&&(o=r.replacer.call({"":o},"",o)),yt(r,0,o,!0,!0)?r.dump+`
9325
+ `:""}function Wh(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var L0,j0,M0,z0,U0,F0,ce,Ae,B0,W0,Z0,ge,Gw,Bw,Ww,Zw,Kw,Vw,Hw,Jw,sI,dI,Yw,qw,Xw,Qw,e_,t_,n_,zh,r_,_I,kI,o_,$I,i_,AI,a_,Uh,Zt,Xa,s_,c_,Qa,Nh,PI,Ew,OI,NI,RI,l_,d_,p_,h_,vn,Iw,XI,QI,g_,y_,v_,Bh,eC,Co,tC,nC,rC,oC,Dh,iC,aC,sC,cC,b_,lC,ts,dC,uC,pC,hC,w_,__,mC,k_,fC,x_,be,gC,yC,wC,Po,$_,jh,E_,T_,pr,RC,DC,LC,jC,MC,zC,UC,FC,Zh,GC,BC,WC,ZC,KC,VC,HC,Kh,Vh=y(()=>{L0=Uw,j0=P0,M0=O0,z0=R0,U0=D0,F0=N0,ce={isNothing:L0,isObject:j0,toArray:M0,repeat:z0,isNegativeZero:U0,extend:F0};Io.prototype=Object.create(Error.prototype);Io.prototype.constructor=Io;Io.prototype.toString=function(t){return this.name+": "+Fw(this,t)};Ae=Io;B0=G0,W0=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Z0=["scalar","sequence","mapping"];ge=V0;Rh.prototype.extend=function(t){var r=[],o=[];if(t instanceof ge)o.push(t);else if(Array.isArray(t))o=o.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(o=o.concat(t.explicit));else throw new Ae("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof ge))throw new Ae("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new Ae("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new Ae("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(i){if(!(i instanceof ge))throw new Ae("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(Rh.prototype);return n.implicit=(this.implicit||[]).concat(r),n.explicit=(this.explicit||[]).concat(o),n.compiledImplicit=$w(n,"implicit"),n.compiledExplicit=$w(n,"explicit"),n.compiledTypeMap=H0(n.compiledImplicit,n.compiledExplicit),n};Gw=Rh,Bw=new ge("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ww=new ge("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Zw=new ge("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kw=new Gw({explicit:[Bw,Ww,Zw]});Vw=new ge("tag:yaml.org,2002:null",{kind:"scalar",resolve:J0,construct:Y0,predicate:q0,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});Hw=new ge("tag:yaml.org,2002:bool",{kind:"scalar",resolve:X0,construct:Q0,predicate:eI,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});Jw=new ge("tag:yaml.org,2002:int",{kind:"scalar",resolve:oI,construct:iI,predicate:aI,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),sI=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");dI=/^[-+]?[0-9]+e/;Yw=new ge("tag:yaml.org,2002:float",{kind:"scalar",resolve:cI,construct:lI,predicate:pI,represent:uI,defaultStyle:"lowercase"}),qw=Kw.extend({implicit:[Vw,Hw,Jw,Yw]}),Xw=qw,Qw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),e_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t_=new ge("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:hI,construct:mI,instanceOf:Date,represent:fI});n_=new ge("tag:yaml.org,2002:merge",{kind:"scalar",resolve:gI}),zh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9326
+ \r`;r_=new ge("tag:yaml.org,2002:binary",{kind:"scalar",resolve:yI,construct:vI,predicate:wI,represent:bI}),_I=Object.prototype.hasOwnProperty,kI=Object.prototype.toString;o_=new ge("tag:yaml.org,2002:omap",{kind:"sequence",resolve:xI,construct:SI}),$I=Object.prototype.toString;i_=new ge("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:EI,construct:TI}),AI=Object.prototype.hasOwnProperty;a_=new ge("tag:yaml.org,2002:set",{kind:"mapping",resolve:II,construct:CI}),Uh=Xw.extend({implicit:[t_,n_],explicit:[r_,o_,i_,a_]}),Zt=Object.prototype.hasOwnProperty,Xa=1,s_=2,c_=3,Qa=4,Nh=1,PI=2,Ew=3,OI=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,NI=/[\x85\u2028\u2029]/,RI=/[,\[\]\{\}]/,l_=/^(?:!|!!|![a-z\-]+!)$/i,d_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;p_=new Array(256),h_=new Array(256);for(vn=0;vn<256;vn++)p_[vn]=Aw(vn)?1:0,h_[vn]=Aw(vn);Iw={YAML:function(t,r,o){var n,i,a;t.version!==null&&z(t,"duplication of %YAML directive"),o.length!==1&&z(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),n===null&&z(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),i!==1&&z(t,"unacceptable YAML version of the document"),t.version=o[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&es(t,"unsupported YAML version of the document")},TAG:function(t,r,o){var n,i;o.length!==2&&z(t,"TAG directive accepts exactly two arguments"),n=o[0],i=o[1],l_.test(n)||z(t,"ill-formed tag handle (first argument) of the TAG directive"),Zt.call(t.tagMap,n)&&z(t,'there is a previously declared suffix for "'+n+'" tag handle'),d_.test(i)||z(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{z(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}};XI=YI,QI=qI,g_={loadAll:XI,load:QI},y_=Object.prototype.toString,v_=Object.prototype.hasOwnProperty,Bh=65279,eC=9,Co=10,tC=13,nC=32,rC=33,oC=34,Dh=35,iC=37,aC=38,sC=39,cC=42,b_=44,lC=45,ts=58,dC=61,uC=62,pC=63,hC=64,w_=91,__=93,mC=96,k_=123,fC=124,x_=125,be={};be[0]="\\0";be[7]="\\a";be[8]="\\b";be[9]="\\t";be[10]="\\n";be[11]="\\v";be[12]="\\f";be[13]="\\r";be[27]="\\e";be[34]='\\"';be[92]="\\\\";be[133]="\\N";be[160]="\\_";be[8232]="\\L";be[8233]="\\P";gC=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],yC=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;wC=1,Po=2;$_=1,jh=2,E_=3,T_=4,pr=5;RC=NC,DC={dump:RC};LC=ge,jC=Gw,MC=Kw,zC=qw,UC=Xw,FC=Uh,Zh=g_.load,GC=g_.loadAll,BC=DC.dump,WC=Ae,ZC={binary:r_,float:Yw,map:Zw,null:Vw,pairs:i_,set:a_,timestamp:t_,bool:Hw,int:Jw,merge:n_,omap:o_,seq:Ww,str:Bw},KC=Wh("safeLoad","load"),VC=Wh("safeLoadAll","loadAll"),HC=Wh("safeDump","dump"),Kh={Type:LC,Schema:jC,FAILSAFE_SCHEMA:MC,JSON_SCHEMA:zC,CORE_SCHEMA:UC,DEFAULT_SCHEMA:FC,load:Zh,loadAll:GC,dump:BC,YAMLException:WC,types:ZC,safeLoad:KC,safeLoadAll:VC,safeDump:HC}});function ie(e){let t;try{t=Kh.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=Gt.safeParse(t);if(!r.success)return{ok:!1,issues:JC(r.error)};let o=kw(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function JC(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function No(e){return Kh.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function os(e,t){return Gt.parse({manifest:{schema_version:To,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var is=y(()=>{"use strict";Vh();Bt()});var Hh=y(()=>{"use strict";is();Bt();qa()});var A_=y(()=>{"use strict"});function I_(e,t){let r=e.backend.archetype;if(!r)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:De(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ur.map(o=>({section:o,status:e[o].status}))}}function C_(e,t){let r=[];return t&&e.app.id!==t&&r.push(`This manifest is for the game "${e.app.id}", and you are editing "${t}". A manifest cannot change which game it belongs to: set app.id to "${t}", or register "${e.app.id}" as its own game.`),e.backend.archetype||r.push("This manifest declares no backend.archetype, so there is nothing to register. The control plane keys a game on its archetype and a game without one could never be deployed against."),r}var P_=y(()=>{"use strict";qa();is();Bt()});var re,as,O_=y(()=>{"use strict";re={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",rounds:"/play/v1/games/{game}/rounds",roundsMine:"/play/v1/games/{game}/rounds/mine",nextRound:"/play/v1/games/{game}/rounds/next",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},as="/play"});function ss(e,t){let r=t==="won"?e.current_streak+1:t==="lost"||t==="partial"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:r,max_streak:Math.max(e.max_streak,r)}}var N_,lt,YC,qC,XC,z2,D_,QC,eP,U2,tP,F2,G2,B2,L_,nP,rP,W2,oP,iP,Z2,R_,K2,V2,Jh=y(()=>{"use strict";Ze();Bt();Ja();O_();N_="2.0",lt=l.object({server_time:l.string(),snapshot:l.string()}),YC=l.enum(["at_commit","at_settlement"]),qC=l.enum(["shared","per_player","feed"]),XC=l.object({kind:l.enum(["fixed","local_midnight","feed","continuous"]),timezone:l.string().optional()}),z2=lt.extend({game:l.string(),api_version:l.literal(N_).default(N_),archetype:Ft,marking:YC,challenge_source:qC,schedule:XC,updates:l.object({transport:l.enum(["poll","socket"]),freshness_seconds:l.number().int().positive()}),display:l.record(l.string(),l.unknown()).default({}),identity:l.object({required:l.boolean(),provider:l.string(),anonymous_play:l.boolean().default(!1)}),archive:l.boolean().default(!1),capabilities:l.array(l.string()).default([])}),D_=l.object({accepting_plays:l.boolean(),results_available:l.boolean(),solution_revealed:l.boolean(),closed:l.boolean(),optimistic_play:l.boolean().default(!1)}),QC=lt.extend({id:l.string(),number:l.number().int().positive().optional(),origin:Eo.optional(),version:l.number().int().nonnegative(),can:D_,opens_at:l.string().optional(),locks_at:l.string().optional(),timer_seconds:l.number().int().positive().optional(),challenge_instance_id:l.string().nullable().default(null),challenge:l.record(l.string(),l.unknown()).default({}),solution:l.record(l.string(),l.unknown()).optional()}),eP=l.object({id:l.string(),number:l.number().int().positive().optional(),version:l.number().int().nonnegative(),can:D_,opens_at:l.string().optional(),locks_at:l.string().optional(),current:l.boolean().default(!1),theme:l.string().default("")}),U2=lt.extend({rounds:l.array(eP)}),tP=l.object({round_id:l.string(),finished:l.boolean(),score:l.number(),outcome:l.enum(["won","lost","partial","incomplete","pending"]).optional()}),F2=lt.extend({player_id:l.string(),played:l.array(tP)}),G2=lt.extend({status:l.enum(["ready","exhausted"]),round:QC.optional()}),B2=lt.extend({token:l.string(),player_id:l.string(),kind:l.literal("anonymous")}),L_=l.object({idempotency_key:l.string().min(8),round_version:l.number().int().nonnegative(),challenge_instance_id:l.string().nullable().default(null),payload:l.record(l.string(),l.unknown())}),nP=l.enum(["accepted","rejected","duplicate","stale","busy"]),rP=l.object({key:l.string(),verdict:l.enum(["correct","close","wrong","higher","lower","unknown"]),label:l.string().optional()}),W2=lt.extend({play_id:l.string(),outcome:nP,reason:l.string().optional(),round_version:l.number().int().nonnegative(),retry_after_seconds:l.number().int().positive().optional(),marked:l.boolean().default(!0),feedback:l.array(rP).default([]),round_state:l.lazy(()=>iP).optional()}),oP=l.object({title:l.string(),grid:l.array(l.string()).default([]),text:l.string().optional()}),iP=lt.extend({player_id:l.string(),round_id:l.string(),started_at:l.string().optional(),attempts_used:l.number().int().nonnegative().default(0),attempts_allowed:l.number().int().nonnegative().optional(),mistakes_used:l.number().int().nonnegative().default(0),mistakes_allowed:l.number().int().nonnegative().optional(),progress:l.record(l.string(),l.unknown()).default({}),score:l.number().default(0),score_revision:l.number().int().nonnegative().default(0),finished:l.boolean().default(!1),outcome:l.enum(["won","lost","partial","incomplete","pending"]).optional(),share:oP.optional()}),Z2=lt.extend({player_id:l.string(),display_name:l.string().optional(),played:l.number().int().nonnegative().default(0),won:l.number().int().nonnegative().default(0),current_streak:l.number().int().nonnegative().default(0),max_streak:l.number().int().nonnegative().default(0),distribution:l.record(l.string(),l.number()).default({}),constraints:l.record(l.string(),l.unknown()).default({})});R_=l.object({rank:l.number().int().positive(),player_id:l.string(),display_name:l.string().optional(),score:l.number()}),K2=lt.extend({round_id:l.string().optional(),order:l.enum(["high_first","low_first"]).default("high_first"),tie_break:l.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:l.array(R_).default([]),total:l.number().int().nonnegative().default(0),truncated:l.boolean().default(!1),me:R_.optional()}),V2=l.object({error:l.object({code:l.string(),message:l.string(),retryable:l.boolean()})})});function M_(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function z_(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function cs(e){let t=G_.safeParse(e.access);return t.success?t.data:"pending"}function B_(e){let t=n=>typeof n=="string"&&n.trim()?n:null,r=e.decision??null,o=r?t(r.state):null;return{workspaceId:t(e.workspaceId)??"unknown",name:t(e.name),ownerEmail:t(e.ownerEmail)??"",company:t(e.company),intent:t(e.intent),signals:t(e.signals),registeredAt:t(e.registeredAt)??"",decision:o==="approved"||o==="refused"?{state:o,at:t(r.at)??t(e.registeredAt)??"",by:t(r.by)??"unknown",reason:t(r.reason)}:null}}function W_(e){return{waiting:e.filter(t=>!t.decision).sort((t,r)=>t.registeredAt.localeCompare(r.registeredAt)),decided:e.filter(t=>t.decision).sort((t,r)=>r.decision.at.localeCompare(t.decision.at))}}function qh(e){return bP.includes(e)}function Xh(e,t){return!e.prodApproval||qh(t.tier)?"dev":"prod"}function K_(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function V_(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var aP,sP,j_,cP,lP,dP,Yh,uP,pP,U_,F_,hP,mP,G_,nz,rz,fP,gP,oz,iz,az,sz,cz,yP,lz,Z_,dz,vP,bP,ls=y(()=>{"use strict";Ze();Bt();Mr();$o();$o();gt();aP=l.enum(["draft","live","sleeping","throttled","expired","archived"]),sP=l.enum(["scheduled","open","locked","settled"]),j_=l.object({id:l.string(),label:l.string(),used:l.number(),limit:l.number(),unit:l.string()}),cP=l.object({id:l.string(),label:l.string(),state:sP,opensAt:l.string(),locksAt:l.string(),settledAt:l.string().nullable(),plays:l.number()}),lP=l.object({id:l.string(),name:l.string(),enabled:l.boolean(),consentRequired:l.boolean(),note:l.string()}),dP=l.object({number:l.number().int().positive(),title:l.string(),openedAt:l.string(),labels:l.array(l.string()).default([]),fromGame:l.boolean().default(!1)}),Yh=l.object({at:l.string(),level:l.enum(["info","warn","error"]),roundId:l.string().nullable(),message:l.string(),dataset:l.string().optional()}),uP=l.enum(["absent","pending","ready","failed"]),pP=l.object({state:uP.default("absent"),url:l.string().nullable().default(null),regenerations:l.number().int().nonnegative().default(0),updatedAt:l.string().nullable().default(null),onProject:l.string().nullable().default(null)});U_=l.object({section:l.string(),status:Eh}),F_=l.object({id:l.string(),name:l.string(),containerLabel:l.string().min(1).default(Nn),repository:l.string().nullable(),openIssues:l.number().int().nonnegative(),issues:l.array(dP).default([]),archetype:Ft,offersPrize:l.boolean().default(!1),state:aP,prodApproval:l.object({approvedAt:l.string(),approvedBy:l.string()}).nullable().default(null).optional(),archivePrefix:l.string().nullable().default(null),space:l.string().nullable().default(null).optional(),platformSpace:l.string().nullable().default(null).optional(),platformProject:l.string().nullable().default(null).optional(),platformEvent:l.string().nullable().default(null).optional(),platformElement:l.string().nullable().default(null).optional(),studioUrl:l.string().nullable().default(null).optional(),appSpec:l.object({version:l.string(),shape:l.string(),resource:l.string().nullable().default(null),specUrl:l.string().optional(),wording:l.array(l.string()).optional(),refusal:l.object({at:l.string(),reason:l.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:pP.prefault({}).optional(),playgroundUrl:l.string().nullable(),playerEndpoint:l.string().nullable(),manifestRevision:l.string(),manifestSource:l.string().optional(),conformance:zt,contentHash:l.string(),referenceDigest:l.string().optional(),referenceName:l.string().optional(),monthlyPlayers:l.number().int().nonnegative().optional(),sections:l.array(U_),meters:l.array(j_),history:l.array(So),rounds:l.array(cP),destinations:l.array(lP),logs:l.array(Yh),updatedAt:l.string()}),hP=l.object({login:l.string(),linkedAt:l.string()}),mP=l.object({enabled:l.boolean().default(!1),applicationId:l.string().nullable().default(null),writeKey:l.string().nullable().default(null)}),G_=l.enum(["pending","approved","refused"]),nz=l.enum(["manual","automatic"]);rz=l.enum(["approved","refused"]);fP=l.object({id:l.string(),name:l.string(),tier:Ah,ownerEmail:l.string(),access:G_.default("pending"),platformSpace:l.string().optional(),liveGameAllowance:l.number(),supplierGrants:l.array(l.string()).default([]),github:hP.nullable().default(null),signal:mP.prefault({}),meters:l.array(j_),games:l.array(F_)}),gP=F_.extend({logs:l.array(Yh).optional()}),oz=fP.extend({games:l.array(gP),gamesTotal:l.number().int().nonnegative(),archivedTotal:l.number().int().nonnegative().default(0)}),iz=l.object({player:l.string().nullable(),control:l.string().nullable(),playground:l.string().nullable()}),az=l.object({id:l.string(),name:l.string(),archetype:Ft,repository:l.string().nullable().default(null),manifestRevision:l.string(),contentHash:l.string(),conformance:zt,offersPrize:l.boolean().default(!1),sections:l.array(U_).default([]),containerLabel:l.string().min(1).optional()}),sz=l.object({uploadUrl:l.string(),publicUrl:l.string(),key:l.string(),expiresInSeconds:l.number().int().positive(),cacheControl:l.string().optional(),playerApiOrigin:l.string()}),cz=l.object({manifestRevision:l.string(),contentHash:l.string(),conformance:zt,offersPrize:l.boolean().default(!1),round:Ke.optional(),wording:l.array(l.string()).optional(),manifestSource:l.string().optional(),notes:l.string().max(500).optional()}),yP=l.object({limit:l.coerce.number().int().positive().max(1e3).default(100),since:l.string().nullable().default(null),level:Yh.shape.level.nullable().default(null)}),lz=l.enum(["access_pending","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_not_seeded","delete_refused"]),Z_=l.enum(["workspace.created","workspace.approved","workspace.refused","github.linked","github.unlinked","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","round.unchanged","round.seeded","game.platform_provisioned","game.platform_provision_failed","game.app_spec_refused","art.requested","art.generated","art.failed","art.published","game.woken","game.suspended","game.throttled","game.approaching_fair_use","game.archived","game.promoted","game.withdrawn","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","destination.changed","signal.enabled","signal.disabled"]),dz=l.object({id:l.string(),at:l.string(),action:Z_,actor:l.object({kind:l.enum(["creator","operator","system"]),id:l.string(),email:l.string().nullable().default(null)}),gameId:l.string().nullable().default(null),correlationId:l.string(),detail:l.record(l.string(),l.unknown()).default({})}),vP=l.object({limit:l.coerce.number().int().positive().max(1e3).default(100),action:Z_.nullable().default(null),actorId:l.string().nullable().default(null),gameId:l.string().nullable().default(null),from:l.string().nullable().default(null),to:l.string().nullable().default(null)}),bP=["runtime"]});var vt=y(()=>{"use strict"});function xP(e){return`slate-${e+1}`}function Y_(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,r)=>({id:xP(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var _P,kP,J_,Kt=y(()=>{"use strict";Ze();vt();_P=l.object({key:l.string().min(1),label:l.string().default(""),note:l.string().optional()}),kP=l.object({id:l.string().min(1),label:l.string().default(""),entries:l.array(_P).min(1)}),J_=l.object({archetype:l.literal("push"),theme:l.string().default(""),prompt:l.string().default(""),target:l.number().int().positive().optional(),targetLabel:l.string().default(""),unit:l.string().max(4).default(""),slates:l.array(kP).min(1)})});var xz,ds=y(()=>{"use strict";Ze();gt();Kt();vt();xz=l.discriminatedUnion("archetype",[J_,Sh,$h])});var us=y(()=>{"use strict"});var Qh=y(()=>{"use strict";At();Kt();ds();us();vt()});import{createHash as SP}from"node:crypto";function EP(e){return SP("sha256").update(e).digest("hex").slice(0,16)}function ps(e){return EP(e)}var $P,Vt,wn=y(()=>{"use strict";Ze();vt();gt();$P=l.object({key:l.string().min(1),label:l.string().default(""),values:l.record(l.string(),l.number().int().nonnegative())}),Vt=l.object({corpus:l.literal("1"),measures:l.array($P).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var TP,X_,AP,Zz,Q_,Kz,Vz,Hz,em=y(()=>{"use strict";Ze();TP=l.enum(["push","pull"]),X_=l.object({workspaceId:l.string().min(1),name:l.string().min(1),key:l.string().min(1),digest:l.string().regex(/^[0-9a-f]{16}$/),measures:l.array(l.string()).default([]),counts:l.record(l.string(),l.number().int().nonnegative()).default({}),bytes:l.number().int().nonnegative().default(0),origin:TP.default("push"),supplier:l.string().optional(),publishedAt:l.string().nullable().default(null),checkedAt:l.string().nullable().default(null),failing:l.boolean().default(!1),counted:l.boolean().default(!1)}),AP=l.object({gameId:l.string().min(1),gameName:l.string().default(""),pinnedDigest:l.string().nullable().default(null),stale:l.boolean().default(!1),roundIds:l.array(l.string()).default([])}),Zz=l.object({dataset:X_,usedBy:l.array(AP).default([])}),Q_=l.enum(["pushed","pulled","joined","refused","failed"]),Kz=l.object({at:l.string(),event:Q_,dataset:l.string().min(1),digest:l.string().nullable().default(null),gameId:l.string().nullable().default(null),gameName:l.string().nullable().default(null),roundId:l.string().nullable().default(null),message:l.string().default(""),ok:l.boolean().default(!0)}),Vz=l.object({dataset:l.string().optional(),gameId:l.string().optional(),event:l.array(Q_).optional(),since:l.string().optional(),search:l.string().optional(),before:l.string().optional(),limit:l.number().int().positive().max(500).default(100)}),Hz=l.object({datasets:l.array(X_).default([]),unavailable:l.string().nullable().default(null)})});var tm=y(()=>{"use strict";vt();gt()});var nm=y(()=>{"use strict";Kt();vt()});var rm=y(()=>{"use strict";wn();Kt();nm();vt();Kt();gt();At();us();ds()});function um(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)?!0:t==="analyticsUrl"}function hs(e){return om.filter(t=>um(e,dm[t.key])).map(t=>t.key)}var om,im,ek,am,CP,sm,PP,tk,nk,OP,NP,rk,RP,cm,lm,dm,pm=y(()=>{"use strict";om=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:`What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:`What the result screen says when a fan finished under, e.g. "{n} away from the target". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:`The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:`The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Leave it empty to keep the game's own words.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:`The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Leave it empty and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Leave it empty and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Leave it empty to keep the game's own words.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}],im=om.map(e=>e.key),ek=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Leave it empty and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"The colour of the button a fan presses. Everything else stays as the game was built.",readBy:"The game's own page, as the --gamestage-primary custom property.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...om,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1}],am=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"}],CP=[{key:"bingo_rows",label:"Board rows",type:"number",description:"How many rows a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_columns",label:"Board columns",type:"number",description:"How many columns a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_centre_mode",label:"Centre cell",type:"freetext",description:'One of "free" (marked for everybody, and does not use a card), "none" (an ordinary cell dealt like any other) or "choice" (the fan picks it). Leave it empty for "free".',readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_shuffle_allowance",label:"Reshuffles allowed",type:"number",description:"How many times a fan may redeal their board before locking it. Leave it empty for 3.",readBy:"The Engine, which refuses a reshuffle once this is spent.",section:"This edition"},{key:"bingo_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_points_per_line",label:"Points per line",type:"number",description:"Awarded once for each completed line. Leave it empty for 10.",readBy:"The Engine, when it scores a settled board.",section:"This edition"},{key:"bingo_points_for_full_board",label:"Points for a full board",type:"number",description:"Awarded once, on top of every line, when the whole board comes in. Leave it empty for 0.",readBy:"The Engine, when it scores a settled board.",section:"This edition"}],sm=[{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1},{key:"round_timer_seconds",label:"Time limit",type:"number",description:"How many seconds a fan gets on this round, counted from when they open it: 180 for three minutes. The Engine refuses a play that arrives after it. Leave it empty for a round with no clock.",readBy:"The Engine, which refuses a late play, and the game's own page, which counts it down.",section:"Content"}],PP=[{key:"round_theme",label:"Theme",type:"freetext",description:`What this round is about, in a word or two, e.g. "The Eighties". Shown above the game's name. Leave it empty for a round that is not one of a themed set.`,readBy:"The game's own page, above the title.",section:"This round"},{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_unit",label:"Unit",type:"freetext",description:'Put in front of every number in this round, e.g. "\xA3". Leave it empty for a round that counts something with no unit, like points.',readBy:"The game's own page, in front of the target, each pick and the total.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"},{key:"entry_note",label:"Note",type:"freetext",description:'Something worth knowing about this choice, shown to a fan who went over because of it, e.g. "Six rings, six Finals MVPs." Leave it empty and the game works out its own line.',readBy:"The game's own page, on the result when this choice took a fan over.",section:"This round"}]}]}],tk="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",nk={key:"round_board",label:"The board",type:"collection",itemLabel:"{{board_item}}",description:"Everything a fan can pick from, in the order they should see it.",readBy:"The Engine, which marks against it, and the page, which draws it.",section:"This round",fieldset:[{key:"board_item",label:"Pick",type:"freetext",description:'One thing a fan can pick, exactly as they should read it, e.g. "Michael Jordan".',readBy:"The game's own page, and the Engine, which marks a pick by it.",section:"This round"}]},OP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},nk,{key:"round_targets",label:"The right answers",type:"freetext",description:`The picks that are right, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Larry Bird". ${tk}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],NP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},nk,{key:"round_groups",label:"The connections",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${tk}`,readBy:"The Engine, to mark a guess and to name a group once it is found.",section:"This round",public:!1,fieldset:[{key:"group_label",label:"What connects them",type:"freetext",description:'Shown to a fan only once they have found this group, e.g. "1996-97 Bulls".',readBy:"The game's own page, after the group is solved.",section:"This round"},{key:"group_members",label:"Which ones",type:"freetext",description:'The picks in this group, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Scottie Pippen". Every one has to be on the board, and no pick may be in two groups.',readBy:"The Engine, to mark a guess.",section:"This round"}]}],rk=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],RP=[{key:"card_note",label:"What this card means",type:"freetext",description:'A sentence explaining the card, shown when a fan taps it. "Goal in the first 10" might be "A goal is scored by either team inside the first ten minutes." Leave it empty and tapping the card does nothing.',readBy:"The game's own page, on the back of the card a fan taps.",section:"This card",public:!0}],cm={hunt:OP,push:PP,group:NP,predict:[],bingo:RP},lm={hunt:[],push:[],group:[],predict:[],bingo:CP},dm={display_name:"displayName",analytics_url:"analyticsUrl",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline",margin_over:"marginOver",margin_exact:"marginExact",margin_under:"marginUnder",result_over:"resultOver",result_exact:"resultExact",result_under:"resultUnder",share_over:"shareOver",share_exact:"shareExact",share_under:"shareUnder",result_bust_note:"resultBustNote",share_bust_note:"shareBustNote",capped_today_note:"cappedTodayNote",share_dare:"shareDare",result_dare:"resultDare"}});function jP(e){let t=new Map,r=o=>{for(let n of o){let i=t.get(n.key);if(i){if(i.type!==n.type)throw new Error(`The field "${n.key}" is declared as both ${i.type} and ${n.type}. One key is one declaration; a level's own label and description travel on its field set entry, its type does not.`)}else t.set(n.key,n);r(n.fieldset??[])}};return r(e),[...t.values()]}function hm(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);i?i.properties.push(n):t.push({name:r.section,properties:[n]})}return t}function MP(e){let t=e.archetypes.map(Ye);for(let i of t)if(!ok[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??im),n=ek.filter(i=>!im.includes(i.key)||o.has(i.key));return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:ok[i],content_type:ik(i),derived_from:ms[i]?.derivedFrom??"data",duration:ms[i]?.duration??{mode:"instant"},label:ms[i]?.derivedFrom==="prediction"?"{{question.text}}":e.name,custom_fields:hm([...sm,...cm[Ye(i)]??[]]),...ms[i]?.derivedFrom==="prediction"?{label_question:i==="bingo"?"Card":"Question",label_option:i==="bingo"?"Outcome":"Option",reveal_results:{modes:["manual"],default:"manual"},correct_option:{live_update:!0},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":jP([...n,...am,...sm,...Object.values(cm).flat(),...Object.values(lm).flat(),...rk]).map(LP),"project_settings.json":{sections:hm(n)},"event_settings.json":{sections:hm([...am,...t.flatMap(i=>lm[i]??[])])}}}function ak(e){return MP({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var ok,ik,ms,DP,LP,mm=y(()=>{"use strict";pm();At();ok=mg,ik=e=>{let t=Ye(e);return cc[t]??`gamestage-${t.replaceAll("_","-")}-element`},ms={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}}},DP=new Set(["freetext","wysiwyg","image","file"]),LP=e=>({key:e.key,type:e.type,...DP.has(e.type)?{localisable:!1}:{},...e.type==="collection"?{...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,...t.description?{description:t.description}:{}}))}:{}})});var fm=y(()=>{"use strict";At()});var sk=y(()=>{"use strict";Mr();ls();Qh();wn();em();tm();rm();mm();fm();Hh();Jh();gt()});function UP(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function dk(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let c=globalThis.location?.origin,d=new URL(`${o}${a}`,o.startsWith("/")?c:void 0);for(let[p,h]of Object.entries(s.query??{}))h!=null&&d.searchParams.set(p,String(h));let u;for(let p=1;p<=r;p++){let h=typeof e.token=="function"?await e.token():e.token,m=await t(d,{method:i,headers:{authorization:`Bearer ${h}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)});if(m.ok)return await m.json();let f=await m.json().catch(()=>({}));if(u=new Ve(m.status,f.error?.code??"unknown",f.error?.message??m.statusText,f.error?.retryable??!1),!u.retryable||p===r)break;let b=Number(m.headers.get("retry-after"));await zP(Number.isFinite(b)&&b>0?b*1e3:UP(p))}throw u??new Ve(0,"unknown","Request failed.",!1)}}function uk(e){let t=dk(e);return{setWorkspaceAccess:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o,reason:n??null}}),async listAccess(){let r=await t("GET","/v1/admin/access"),o=[...r.waiting??[],...r.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(B_);return W_(o)}}}function yr(e){let t=dk(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let c of r)Array.isArray(s[c])||(s[c]=[]);return s},n=a=>({...a,access:cs(a),games:(a.games??[]).map(o),gamesTotal:a.gamesTotal??(a.games??[]).length,archivedTotal:a.archivedTotal??(a.games??[]).filter(s=>s.state==="archived").length}),i=a=>({...a,workspace:{...a.workspace,access:cs(a.workspace??{}),games:(a.workspace?.games??[]).map(o)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(a){if(!(a instanceof Ve)||a.status!==404)throw a;return ck||(ck=!0,console.warn("[control-plane] no /v1/workspace/summary, falling back to the full workspace read. If this persists the control plane is behind the site, and every Stage screen is carrying the whole workspace again.")),n(await t("GET","/v1/workspace"))}},linkGitHub:async a=>i(await t("PUT","/v1/workspace/github",{body:{login:a}})),setPlan:async a=>i(await t("PUT","/v1/workspace/plan",{body:{tier:a}})),uploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),setPresetArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art/preset`,{body:{preset:s}}),artUploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/art/uploads`,{body:{content_type:s}}),setUploadedArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art`,{body:{url:s}}),referenceUploadTarget:(a,s)=>t("POST","/v1/reference/uploads",{body:{name:a,digest:s}}),pruneBundle:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return o(await t("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof Ve&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,c)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:c}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),promoteGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/promote`),withdrawGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/withdraw`),deleteGame:a=>t("DELETE",`/v1/games/${encodeURIComponent(a)}`),deploy:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),async seedRound(a,s){try{return await t("PUT",`/v1/games/${encodeURIComponent(a)}/round`,{body:{round:s}})}catch(c){throw c instanceof Ve&&c.status===404&&!/no such game/i.test(c.message)?new Ve(404,"not_supported","This control plane cannot take a round yet. It is running a build older than this CLI, so the round has to go in through Studio until it is updated.",!1):c}},setSignal:async a=>i(await t("PUT","/v1/workspace/signal",{body:{enabled:a}})),async getEndpoints(a){try{return await t("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof Ve&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:c}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return c},async getAuditLog(a){let{records:s}=await t("GET","/v1/audit",{query:a});return s},async listDatasets(){try{let a=await t("GET","/v1/reference/datasets");return!a||!Array.isArray(a.datasets)?{datasets:[],unavailable:lk}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof Ve&&a.status===404)return{datasets:[],unavailable:lk};throw a}},async getDataset(a){try{let s=await t("GET",`/v1/reference/datasets/${encodeURIComponent(a)}`);return s?.dataset?s:void 0}catch(s){if(s instanceof Ve&&s.status===404)return;throw s}},async getDataLog(a){try{let s=await t("GET","/v1/reference/log",{query:a});return Array.isArray(s?.lines)?s.lines:[]}catch(s){if(s instanceof Ve&&s.status===404)return[];throw s}}}}var Ve,zP,ck,lk,pk=y(()=>{"use strict";ls();Ve=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},zP=e=>new Promise(t=>setTimeout(t,e)),ck=!1;lk="This control plane is running a build older than this screen, so it cannot list datasets yet."});function FP(e){if(e.timerSeconds===void 0||!Number.isInteger(e.timerSeconds)||e.timerSeconds<=0||!e.startedAt)return;let t=Date.parse(e.startedAt);if(Number.isFinite(t))return t+e.timerSeconds*1e3}function hk(e,t){let r=FP(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var mk=y(()=>{"use strict"});var fk=y(()=>{"use strict";Kt()});var GP,BP,WP,$4,gm=y(()=>{"use strict";Ze();GP=l.discriminatedUnion("kind",[l.object({kind:l.literal("everyone")}),l.object({kind:l.literal("domains"),domains:l.array(l.string().min(1)).min(1)}),l.object({kind:l.literal("named")})]),BP=l.enum(["licensed","unofficial","creator"]),WP=l.enum(["ours","creator"]),$4=l.object({id:l.string().min(1),label:l.string().min(1),standing:BP,origin:WP,tiers:l.array(l.enum(["runtime","live","enterprise"])).min(1),produces:l.array(l.string()),note:l.string().min(1),audience:GP.optional()})});var gk=y(()=>{"use strict";gm()});var yk=y(()=>{"use strict";wn()});var vk=y(()=>{"use strict";wn()});function ZP(e){let t;try{t=JSON.parse(e)}catch(o){return{ok:!1,reason:"That is not JSON.",detail:o instanceof Error?o.message:void 0}}let r=Vt.safeParse(t);if(!r.success){let o=r.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:o?`${o.path.join(".")||"document"}: ${o.message}`:void 0}}return{ok:!0,summary:{digest:ps(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length]))}}}async function bk(e,t){let r=ZP(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}var wk=y(()=>{"use strict";wn()});var _k=y(()=>{"use strict"});var kk=y(()=>{"use strict"});function ym(e){return e.sourceIp?.trim()||"unknown"}function vm(e,t){return`${e.length}:${e}${t}`}var KP,xk,Sk,$k,Ek,M4,z4,U4,Tk=y(()=>{"use strict";KP=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},xk=e=>typeof process>"u"?void 0:KP(process.env?.[e]),Sk=(e,t,r)=>({burst:xk(t)??e.burst,perMinute:xk(r)??e.perMinute}),$k={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},Ek={player:Sk($k.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Sk($k.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},M4=Ek.player,z4=Ek.publicRoutes,U4=600*1e3});var Ak=y(()=>{"use strict"});var ae=y(()=>{"use strict";Mr();At();Bt();xh();qa();Hh();A_();is();P_();Ja();Jh();$o();gt();ls();sk();pk();pm();vt();tm();mk();Kt();ds();nm();fk();wn();gk();gm();yk();vk();wk();em();us();rm();_k();mm();Qh();kk();fm();Tk();Ak()});import{spawn as Ik}from"node:child_process";import{chmod as VP,mkdir as HP,readFile as JP,rm as YP,writeFile as qP}from"node:fs/promises";import{homedir as XP,platform as vr}from"node:os";import{join as Ck}from"node:path";async function Pk(){let e=await fetch(`${bm}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:wm})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function Ok(e){let t=await fetch(`${bm}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:wm,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function Nk(e){let t=vr()==="darwin"?"open":vr()==="win32"?"cmd":"xdg-open",r=vr()==="win32"?["/c","start","",e]:[e];try{Ik(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function _m(e,t){return new Promise(r=>{let o=Ik("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function km(e){let t=JSON.stringify(e);return vr()==="darwin"&&await _m(["add-generic-password","-a",br,"-s",br,"-U","-w",t])!==null?"keychain":(await HP(Rk,{recursive:!0,mode:448}),await qP(fs,t,{mode:384}),await VP(fs,384),"file")}function QP(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function eO(e){if(!e.refreshToken)return null;let t=await fetch(`${bm}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:wm,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function tO(){if(vr()==="darwin"){let e=await _m(["find-generic-password","-a",br,"-s",br,"-w"]);if(e)try{return JSON.parse(e)}catch{}}try{return JSON.parse(await JP(fs,"utf8"))}catch{return null}}async function Dk(){vr()==="darwin"&&await _m(["delete-generic-password","-a",br,"-s",br]),await YP(fs,{force:!0})}async function ye(){let e=await tO();if(!e)return null;if(!QP(e.accessToken)||!e.refreshToken)return e;let t=await eO(e);return t?(await km(t),t):null}var bm,wm,br,Rk,fs,_n=y(()=>{"use strict";bm="https://api.workos.com",wm=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";br="gamestage-cli",Rk=Ck(XP(),".gamestage"),fs=Ck(Rk,"credentials.json")});function jk(e){return`${bt}/stage/games/${encodeURIComponent(e)}?tab=overview`}function Mk(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${bt}/docs/game-formats#${e}`:`${bt}/docs`}var bt,xm=y(()=>{"use strict";bt=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function oO(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function iO(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function aO(e=we,t=process.env){if(iO(t)&&!oO(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function wr(e=we){let t=aO(e);t&&O(t)}async function Ro(){let e=await ye();return e||O("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and validating a manifest still need no account."]),e}async function le(){let e=await Ro();return{client:yr({baseUrl:we,token:async()=>(await ye())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function zk(){let e=await ye();return e||O("You are not signed in.",["Run `gamestage login`. Approving a creator needs an operator's own session."]),{admin:uk({baseUrl:we,token:async()=>(await ye())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function ys(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===Sm?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${we}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${we}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${we}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function Do(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:Sm,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${bt}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function Uk(e){return e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function _r(e){if(N(e.heading),g(` ${e.message}`),e.next.length){g();for(let t of e.next)S(t)}g()}function _e(e){let t=[],r=e.status,o=e.code;if(o===Sm){let n=Do({access:"pending"});j()?U({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):_r(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${we}`),O(e instanceof Error?e.message:"The control plane call failed.",t)}var we,Sm,dt=y(()=>{"use strict";ae();_n();de();xm();we=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";Sm="access_pending"});import{open as uO,readFile as Zk}from"node:fs/promises";import{createHash as pO}from"node:crypto";import{gunzipSync as hO}from"node:zlib";function gO(e){for(let{pattern:t,what:r}of fO)if(t.test(e))return r}function Tm(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||mO.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function Vk(e,t){let r;try{r=await uO(e,"r")}catch{return}try{let{size:o}=await r.stat();if(o<=t){let s=Buffer.alloc(o);return o>0&&await r.read(s,0,o,0),s}let n=Math.floor(t/2),i=Buffer.alloc(n),a=Buffer.alloc(n);return await r.read(i,0,n,0),await r.read(a,0,n,o-n),Buffer.concat([i,Buffer.from(`
9327
+ `),a])}catch{return}finally{await r.close()}}async function vO(e){return(await Vk(e,Kk))?.toString("latin1")}async function zo(e){let t=await Vk(e,Kk);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await Zk(e);t=hO(s,{maxOutputLength:yO})}catch{}if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0,i=0;for(let s=0;s<r.length;s+=1)r[s]===0&&(i+=1,s%2===0?o+=1:n+=1);let a=Math.floor(r.length/2);if(a>8){if(n>a*.7&&o<a*.1)return t.toString("utf16le");if(o>a*.7&&n<a*.1)return t.swap16().toString("utf16le")}if(i<=8&&i*20<r.length)return t.toString("utf8").split("\0").join("")}function bO(e){let t=ie(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function kr(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="predict")return[];if(t.archetype==="bingo")return t.cardPool.length<2?[]:e.split(`
8956
9328
  `).some(i=>t.cardPool.every(a=>new RegExp(`["\`']${a.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(i)))?t.cardPool.map(i=>i.label):[];if(t.archetype==="group"){let n=[];for(let i of t.groups){if(new RegExp(`["\`']${i.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(e)){n.push(i.label);continue}e.split(`
8957
- `).some(l=>i.members.every(d=>new RegExp(`["\`']${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(l)))&&n.push(i.label)}return n}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`(?:${a})[^\\n]{0,120}?\\b${i.value}\\b`,"i"),l=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?(?:${a})`,"i");(s.test(e)||l.test(e))&&o.push(i.label)}return o}function wr(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}function dO(e){try{return JSON.parse(e)}catch{}try{let t=Wm(e);return typeof t=="object"?t:void 0}catch{return}}function uO(e){let t=dO(e);if(!t||typeof t!="object")return;let r,o=new Set,n=(i,a)=>{if(!(r||a>6||!i||typeof i!="object")&&!o.has(i)){if(o.add(i),Array.isArray(i)){for(let s of i)n(s,a+1);return}for(let[s,l]of Object.entries(i)){if(lO.has(s.toLowerCase())){r=s;return}n(l,a+1)}}};return n(t,0),r}function pO(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<Sh+1)return!1;for(let r of[","," ",";"]){let o=t.slice(0,500).map(u=>u.split(r)),n=o[0].length,i=o.filter(u=>u.length===n);if(n<2||i.length<o.length*.95||i.length<Sh+1)continue;let a=i.slice(1),s=Math.min(...a.map(u=>u.length)),l=!1,d=!1;for(let u=0;u<s;u+=1){let p=a.map(m=>m[u].trim());p.every(m=>m.length>0&&/^-?\d+(\.\d+)?$/.test(m))?l=!0:p.every(m=>m.length>0&&!/^-?\d+(\.\d+)?$/.test(m))&&(d=!0)}if(l&&d)return!0}try{let r=JSON.parse(e);if(r&&typeof r=="object"&&!Array.isArray(r)){let o=Object.values(r);if(o.length>=Sh&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function fO(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&hO.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:mO.has(t.slice(r+1))}function yO(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>gO.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function vO(e){if(e.relativePath!==se)return;let t;try{t=await Gk(e.path)}catch{return}if(tO("sha256").update(t).digest("hex").slice(0,16)!==$t)return{path:e.relativePath,why:"needs regenerating. Run `gamestage client`, then deploy again. If it is refused again with the same digest, the tool that wrote the file is older than the one checking it, so update Gamestage and rerun.",confidence:"certain"}}async function Kk(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),l;for(let d of e){let u=yO(d.relativePath);if(u){i.includes(u)||i.push(u);continue}let p=await vO(d);if(p){l??=p;continue}if(s.has(d.relativePath)){r.push(d);continue}let m=await Eh(d,t.round);if(!m){r.push(d);continue}if(m.confidence==="suspected"&&a.has(d.relativePath)){n.push(m),r.push(d);continue}if(m.alwaysWithheld||fO(d.relativePath)){o.push(m);continue}l??=m}return{publish:r,withheld:o,allowed:n,walkedPast:i,...l?{refuse:l}:{}}}async function Eh(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if($h(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await jo(e.path);if(o!==void 0){let i=iO(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=cO(o);if(a)return r(a.round?"is an App Manifest, which carries the round's private half":"is an App Manifest, which is ours rather than the game's","certain",!0);if(t){let s=_r(o,t);if(s.length)return r(wr(t,s),"certain")}}if(t&&o===void 0){let i=await sO(e.path);if(i!==void 0){let a=_r(i,t);if(a.length)return r(wr(t,a),"certain")}}if(o===void 0)return;let n=uO(o);if(n){let i=/^[aeiou]/i.test(n)?"an":"a";return r(`looks like it holds a round's answers: it has ${i} "${n}" key. If that is the game's own data rather than its answers, publish it with --allow ${e.relativePath}`,"suspected")}if(pO(o))return r(`looks like reference data: a long table of labels against numbers, which is what a round is scored against. If it is the game's own data, publish it with --allow ${e.relativePath}`,"suspected")}var rO,oO,Wk,aO,lO,Sh,mO,hO,gO,ys=g(()=>{"use strict";Km();ae();Et();rO=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),oO=[{pattern:/-----BEGIN [A-Z ]*PRIVATE KEY-----/,what:"a private key block"},{pattern:/-----BEGIN OPENSSH PRIVATE KEY-----/,what:"an OpenSSH private key"},{pattern:/\bAKIA[0-9A-Z]{16}\b/,what:"an AWS access key id"},{pattern:/\baws_secret_access_key\s*[=:]/i,what:"an AWS secret access key"},{pattern:/\bsk-(live|proj|ant)-[A-Za-z0-9_-]{16,}/,what:"a live API key"},{pattern:/\bsk_live_[A-Za-z0-9]{16,}/,what:"a live Stripe key"},{pattern:/\bgh[pousr]_[A-Za-z0-9]{30,}/,what:"a GitHub token"},{pattern:/\bxox[baprs]-[A-Za-z0-9-]{10,}/,what:"a Slack token"},{pattern:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,what:"a signed token"},{pattern:/\bauthorization\s*:\s*["']?\s*(bearer|basic)\s+\S{12,}/i,what:"an Authorization header with a token in it"}];Wk=8e6,aO=32e6;lO=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);Sh=20;mO=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),hO=new Set(["gz","br","zst","zz"]);gO=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function vs(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===se||o===ke)continue;let n=await jo(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var Th=g(()=>{"use strict";Et();ys()});import{lstatSync as bO,readdirSync as _O}from"node:fs";import{relative as wO,resolve as Vk,sep as kO}from"node:path";function Hk(e){let t=e.split("/").pop()??e;return xO.has(t)||t.startsWith(".env.")}function Ah(e,t={}){let r=t.symlinks??"throw",o=Vk(e),n=[],i=[];function a(s){for(let l of _O(s,{withFileTypes:!0}).sort((d,u)=>d.name.localeCompare(u.name))){let d=Vk(s,l.name),u=wO(o,d).split(kO).join("/");if(l.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${u}`);i.push(u);continue}if(l.isDirectory())a(d);else if(l.isFile()){if(Hk(u))continue;n.push({path:d,relativePath:u})}}}if(!bO(o).isDirectory())throw new Error(`${e} is not a directory.`);return a(o),{files:n,skippedLinks:i}}function Ih(e){return Ah(e,{symlinks:"throw"}).files}var xO,Ch=g(()=>{"use strict";xO=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"])});import{createHash as SO}from"node:crypto";function bs(e){return SO("sha256").update(e,"utf8").digest()[0]&127}var Jk,Ph=g(()=>{"use strict";Jk=128});import{createHmac as $O,randomBytes as EO,timingSafeEqual as TO}from"node:crypto";function Nh(e){return e.startsWith(Oh)}function Mo(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${Oh}${t||"unknown"}`}async function Yk(e){if(!e.token)return e.sessionSecret?{playerId:CO(e.anonymousId,e.sessionSecret)??Mo(void 0)}:{playerId:Mo(e.anonymousId)};let t=e.resolver??AO,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:Mo(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function Xk(e){let t=`${Oh}${EO(16).toString("base64url")}`;return{playerId:t,token:IO(t,e)}}function Qk(e,t){return $O("sha256",t).update(e).digest("base64url")}function IO(e,t){return`${e}${qk}${Qk(e,t)}`}function CO(e,t){if(!e)return;let r=e.lastIndexOf(qk);if(r<=0)return;let o=e.slice(0,r);if(!Nh(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(Qk(o,t));if(n.length===i.length)return TO(n,i)?o:void 0}var Oh,AO,qk,Rh=g(()=>{"use strict";Oh="anon:";AO={async resolve(){}};qk="."});function wn(e){return e instanceof Error?e.name:"unknown"}function Kt(e){console.error(PO,e)}function ex(e,t){console.error(OO,{violation:e,...t})}var PO,OO,_s=g(()=>{"use strict";PO="engine_error",OO="engine_integrity_violation"});function rx(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t^=t>>>16,t=Math.imul(t,2246822507)>>>0,t^=t>>>13,t=Math.imul(t,3266489909)>>>0,t^=t>>>16,t>>>0}function NO(e){let t=tx[rx(`a:${e}`)%tx.length],r=nx[rx(`n:${e}`)%nx.length];return`${t} ${r}`}function ws(e,t){return t?.trim()||NO(e)}var tx,nx,Dh=g(()=>{"use strict";tx=["Amber","Brave","Bright","Calm","Clever","Copper","Eager","Early","Fleet","Gentle","Golden","Happy","Keen","Kind","Lucky","Merry","Nimble","Noble","Quick","Quiet","Rapid","Ready","Royal","Silver","Steady","Sunny","Swift","Tidy","True","Warm","Wise","Zesty"],nx=["Badger","Beaver","Bison","Falcon","Ferret","Finch","Gibbon","Heron","Ibex","Jaguar","Kestrel","Lemur","Lynx","Marten","Meerkat","Osprey","Otter","Panda","Puffin","Quokka","Rabbit","Raven","Robin","Salmon","Sparrow","Stoat","Tapir","Teal","Vole","Walrus","Weasel","Wombat"]});function Vt(e){return uk({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function RO(e){let t=Date.parse(e);if(Number.isNaN(t))return 1;let r=Date.parse(`${e.slice(0,10)}T00:00:00.000Z`)+864e5;return Math.max(1,Math.ceil((r-t)/1e3))}function ox(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function ix(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),l=()=>({server_time:i(),snapshot:e.runtime.snapshot}),d=w=>w;function u(w,T){return!n.settle||!w.round.can.results_available||T.outcome!=="pending"?T:n.settle({secret:w.secret,state:T,limits:w.limits,now:i()})}function p(w){if(!w.fusedUntil)return 0;let T=Math.ceil((Date.parse(w.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite(T)&&T>0?T:0}async function m(w,T){let L=e.fuse?.note(t,bs(r),T);if(!L)return;let N=new Date(Date.parse(i())+L.holdSeconds*1e3).toISOString();if(L.kind==="stop")try{await o.setFuse(t,w,N)}catch(V){Kt({event:"fuse_write_failed",tenant:t,round_id:w,name:wn(V)})}try{await e.onFuse?.({...L,until:N})}catch(V){Kt({event:"fuse_notify_failed",tenant:t,round_id:w,name:wn(V)})}}function h(w){return p(w)<=0?w.round:{...w.round,can:{...w.round.can,accepting_plays:!1}}}function f(w,T){let L=w.round.number??Number.POSITIVE_INFINITY,N=T.round.number??Number.POSITIVE_INFINITY;return L!==N?L-N:w.round.id.localeCompare(T.round.id)}async function b(w,T){let L=await o.getState(t,w,r);return L?{state:L.state,version:L.version}:{state:{...n.initialState({playerId:r,roundId:w,limits:T,now:i()}),started_at:i()},version:void 0}}async function x(w,T,L,N){if(T.timerSeconds===void 0||N!==void 0)return L;try{if(await o.putStateIfVersion(t,L,void 0))return L}catch(Z){return Kt({event:"round_open_write_failed",tenant:t,round_id:w,name:wn(Z)}),L}return(await o.getState(t,w,r))?.state??L}let k=(w,T,L)=>({...l(),play_id:s(),outcome:w,reason:T,round_version:L,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...l()}},async getCurrentRound(){let w=await o.getCurrentRound(t);if(!w)throw new Error(Lh);return{...h(w),...l()}},async getRound(w){let T=await o.getRound(t,w);return T?{...h(T),...l()}:void 0},async getRoundPool(){let[w,T]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),L=T?.round.id,N=[...w].sort(f).map(V=>{let Z=h(V);return{id:Z.id,number:Z.number,version:Z.version,can:Z.can,opens_at:Z.opens_at,locks_at:Z.locks_at,current:Z.id===L}});return{...l(),rounds:N}},async getPlayedRounds(){let w=await o.listStatesForPlayer(t,r);return{...l(),player_id:r,played:w.map(T=>({round_id:T.round_id,finished:T.finished,score:T.score,outcome:T.outcome})).sort((T,L)=>T.round_id.localeCompare(L.round_id))}},async getNextRound(){let[w,T]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),L=new Set(T.filter(te=>te.finished).map(te=>te.round_id)),N=new Set(T.map(te=>te.round_id)),V=[...w].filter(te=>h(te).can.accepting_plays&&!L.has(te.round.id)).sort(f),Z=V.find(te=>!N.has(te.round.id))??V[0];return Z?{...l(),status:"ready",round:{...h(Z),...l()}}:{...l(),status:"exhausted"}},async getRoundState(w){let T=await o.getRound(t,w);if(!T)throw new Error(Lh);let L=d(T),{state:N,version:V}=await b(w,L.limits),Z=await x(w,L.limits,N,V),te=u(L,Z);return te!==Z&&te.finished&&await o.recordScore(t,w,r,te.score),{...te,...l()}},async getProfile(){let w=await o.getProfile(t,r);return{...w,display_name:ws(r,w.display_name),...l()}},async getLeaderboard(w){let L=(await o.getCurrentRound(t))?.round.id??"";return{...await o.getLeaderboard(t,L,{limit:w,viewerId:r}),...l()}},async play(w,T){let L=await o.getRound(t,w);if(!L)return k("rejected",Lh,0);let N=d(L);if(e.runtime.identity?.required&&Nh(r))return k("rejected",e.identityRefusal??"identity_required",N.round.version);if(p(N)>0)return{...k("busy","fair_use",N.round.version),retry_after_seconds:p(N)};if(N.limits.playsPerSecond!==void 0){let Ie=i().slice(0,19),F=await o.countPlay(t,w,Ie,r),Le=Math.max(1,Math.ceil(N.limits.playsPerSecond/F.buckets));if(F.inBucket>Le)return await m(w,Ie),{...k("busy","capped",N.round.version),retry_after_seconds:1}}if(N.limits.playsPerDay!==void 0){let Ie=i().slice(0,10),F=await o.countPlay(t,w,Ie,r),Le=Math.max(1,Math.ceil(N.limits.playsPerDay/F.buckets));if(F.inBucket>Le)return await m(w,Ie),{...k("busy","capped_today",N.round.version),retry_after_seconds:RO(i())}}let V=await o.getPlay(t,r,T.idempotency_key);if(V)return{...V.result,...l(),outcome:"duplicate"};let{state:Z,version:te}=await b(w,N.limits),en=n.admissible({accepting:N.round.can.accepting_plays,roundVersion:N.round.version,playedVersion:T.round_version,challengeInstanceId:N.round.challenge_instance_id??null,playedChallengeInstanceId:T.challenge_instance_id??null,state:Z,secret:N.secret,limits:N.limits,now:i()});if(!en.ok){let Ie=en.reason==="round_version"?"stale":"rejected";return k(Ie,en.reason,N.round.version)}let Q=n.mark({payload:T.payload,secret:N.secret,state:Z,limits:N.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(Q.outcome!=="accepted")return k("rejected",Q.reason??"rejected",N.round.version);let De={...l(),play_id:s(),outcome:Q.outcome,round_version:N.round.version,marked:Q.marked,feedback:Q.feedback,round_state:{...Q.next,...l()}},$n=`play:${JSON.stringify([t,r,T.idempotency_key])}`,En=[{id:$n,at:De.server_time,tenant:t,round_id:w,player_id:r,action:"play.committed",detail:{play_id:De.play_id,idempotency_key:T.idempotency_key,outcome:De.outcome,marked:De.marked,round_version:De.round_version,score_before:Z.score,score_after:Q.next.score,attempts_used:Q.next.attempts_used,attempts_allowed:Q.next.attempts_allowed,mistakes_used:Q.next.mistakes_used,mistakes_allowed:Q.next.mistakes_allowed,...n.auditDetail({secret:N.secret,before:Z,decision:Q,payload:T.payload})}}];Q.marked&&En.push({id:`score:${JSON.stringify([t,r,T.idempotency_key])}`,at:De.server_time,tenant:t,round_id:w,player_id:r,action:"score.recorded",detail:{play_id:De.play_id,score_before:Z.score,score_after:Q.next.score,marked:!0,outcome:Q.next.outcome}});let ti=Q.next.finished&&!Z.finished?is(await o.getProfile(t,r),Q.next.outcome):void 0,me=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:T.idempotency_key,date:i().slice(0,10),play:{result:De},state:Q.next,expectedVersion:te,audit:En,...Q.marked?{score:{roundId:w,score:Q.next.score}}:{},...ti?{profile:ti}:{}});if(!me.ok&&me.reason==="play_exists"){let Ie=await o.getPlay(t,r,T.idempotency_key);return Ie?{...Ie.result,...l(),outcome:"duplicate"}:(Kt({stage:"play_receipt_missing",tenant:t,round_id:w,player_id:r}),k("rejected","play_conflict",N.round.version))}return me.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),De):(await o.appendAudit({id:$n,at:De.server_time,tenant:t,round_id:w,player_id:r,action:"play.refused",detail:{play_id:De.play_id,idempotency_key:T.idempotency_key,reason:"round_version",attempt_spent:!1}}),k("stale","round_version",N.round.version))}}}var Ht,Lh,Jt=g(()=>{"use strict";Ph();Rh();_s();Dh();ae();Ht="time_expired",Lh="round_not_found"});function DO(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Vt(e)?{ok:!1,reason:Ht}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function LO(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter(k=>r.targets.includes(k)&&!i.has(k)),s=t.picks.filter(k=>!r.targets.includes(k)),l=o.attempts_used+1,d=o.mistakes_used+(s.length>0?1:0);for(let k of a)i.add(k);let u=i.size>=r.required,p=d>=n.mistakesAllowed,m=l>=n.attemptsAllowed,h=u||p||m,f=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(u?r.completionBonus:0),b={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:d,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:f,finished:h,outcome:e.markAtSettlement?"pending":u?"won":h?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:b}:{outcome:"accepted",marked:!0,feedback:t.picks.map(k=>({key:k,verdict:r.targets.includes(k)?"correct":"wrong"})),next:b}}function jO(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var jh,Mh=g(()=>{"use strict";Jt();jh={archetype:"hunt",admissible:DO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return LO({...e,attempt:{picks:t}})},initialState:jO,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}}});function zh(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function MO(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function zO(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Vt(e)?{ok:!1,reason:Ht}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function UO(e){let{secret:t,state:r,limits:o}=e,n=zh(r),i=k=>({outcome:"rejected",reason:k,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,l=a.entries.find(k=>k.key===s);if(!l)return i("not_on_slate");let d=n.total+l.value,u=d>t.target,p=[...n.picks,{slate:a.id,key:l.key,label:l.label,value:l.value}],m=r.attempts_used+1,h=m>=o.picksAllowed,f=u||h,b={...r,server_time:e.now,attempts_used:m,attempts_allowed:o.picksAllowed,progress:{total:d,picks:p,bust:u,...f?{tier:MO(t,d)}:{}},score:e.markAtSettlement?r.score:u?0:d,finished:f,outcome:e.markAtSettlement?"pending":u?"lost":f?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:b}:{outcome:"accepted",marked:!0,feedback:[{key:l.key,verdict:u?"wrong":"correct",label:String(l.value)}],next:b}}function FO(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Uh,Fh=g(()=>{"use strict";Jt();Uh={archetype:"push",admissible:zO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return UO({...e,attempt:{picks:t}})},initialState:FO,auditDetail({secret:e,before:t,decision:r}){let o=zh(t),n=zh(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}}});function WO(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Vt(e)?{ok:!1,reason:Ht}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function ZO(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(N=>!i.has(N.key)),l=s.find(N=>BO(N.members,t.picks)),d=o.attempts_used+1,u=o.mistakes_used+(l?0:1);l&&(i.add(l.key),a.push({key:l.key,label:l.label,members:[...l.members]}));let p=i.size>=r.groups.length,m=u>=n.mistakesAllowed,h=d>=n.attemptsAllowed,f=p||m||h,b=e.markAtSettlement?o.score:o.score+(l?r.pointsPerGroup:0)+(p?r.completionBonus:0),x={...o,server_time:e.now,attempts_used:d,attempts_allowed:n.attemptsAllowed,mistakes_used:u,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:b,finished:f,outcome:e.markAtSettlement?"pending":p?"won":f?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:x};let k=s.reduce((N,V)=>Math.max(N,GO(t.picks,V)),0),w=!l&&t.picks.length>1&&k===t.picks.length-1,T=l?"correct":w?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map(N=>({key:N,verdict:T,...l?{label:l.label}:{}})),next:x}}function KO(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var BO,GO,ax,sx=g(()=>{"use strict";Jt();BO=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,GO=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;ax={archetype:"group",admissible:WO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return ZO({...e,attempt:{picks:t}})},initialState:KO,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}}});function VO(e,t){if(t.answers)return t.answers;if(t.pick===void 0)return{};let r=e.questions[0];return r?{[r.id]:t.pick}:{}}function HO(e,t){return e.kind==="number"?!(typeof t!="number"||!Number.isFinite(t)||e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max):typeof t=="string"&&(e.options??[]).some(r=>r.key===t)}function JO(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:Vt(e)?{ok:!1,reason:Ht}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function YO(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=VO(r,t),a=o.attempts_used+1;if(r.questions.filter(u=>i[u.id]===void 0).length>0)return{outcome:"rejected",reason:"incomplete_prediction",marked:!1,feedback:[],next:o};let l=r.questions.find(u=>!HO(u,i[u.id]));if(l)return{outcome:"rejected",reason:l.kind==="number"?"out_of_range":"unknown_option",marked:!1,feedback:[],next:o};let d={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,answers:i},finished:a>=n.attemptsAllowed};return r.questions.some(u=>u.result===void 0)?{outcome:"accepted",marked:!1,feedback:[],next:{...d,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:qO(r,i),next:cx(r,d,i)}}function qO(e,t){return e.questions.map(r=>{let o=t[r.id],n=Ha(r,o,e.pointsForCorrect),i=r.kind==="number"?String(r.result):(r.options??[]).find(a=>a.key===r.result)?.label;return{key:r.id,verdict:n===e.pointsForCorrect||n>0&&r.kind!=="number"?"correct":n>0?"partial":"wrong",...i?{label:i}:{}}})}function cx(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=Ha(i,r[i.id],e.pointsForCorrect);o+=a,a!==Ha(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function XO(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=QO(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...cx(t,r,o),server_time:e.now}}function QO(e){let t=e.progress.answers;if(t&&typeof t=="object"&&!Array.isArray(t))return t;let r=Array.isArray(e.progress.picks)?e.progress.picks:[];return r.length>0?{1:r[0]}:{}}function eN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{answers:{}},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var lx,dx=g(()=>{"use strict";ae();Jt();lx={archetype:"predict",admissible:JO,mark(e){let t=e.payload.answers,r=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,o=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:void 0;return YO({...e,attempt:r?{answers:r}:{pick:o}})},initialState:eN,settle:XO,auditDetail({secret:e,decision:t,payload:r}){let o=r.answers;return{predicted:o&&typeof o=="object"&&!Array.isArray(o)?o:typeof r.pick=="string"&&e.questions[0]?{[e.questions[0].id]:r.pick}:null,settled_at_commit:e.questions.every(i=>i.result!==void 0),marked:t.marked,questions_asked:e.questions.length}}}});function tN(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function Bh(e){let r=e.progress?.boards;if(!(!Array.isArray(r)||r.length===0)&&r.every(o=>Array.isArray(o)&&o.every(n=>typeof n=="string")))return r}function nN(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function rN(e){let t=Bh(e),r=nN(e);if(!t||r===void 0)return;let o=t[r];if(!o)return;let n=e.progress,i=typeof n?.centre=="string"?n.centre:void 0;return{cells:o,centre:i}}function oN(e){let t=tN(e),r=[...e.cardPool],o=[],n={};for(let i=0;i<t&&r.length>0;i++){let a=Math.floor(Math.random()*r.length),s=r.splice(a,1)[0];o.push(s.key),n[s.key]=s.label}return{board:o,cards:n}}function iN(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function aN(e,t){let{rows:r,columns:o,centreMode:n}=e,i=n!=="none",a=i?Math.floor(r/2):-1,s=i?Math.floor(o/2):-1,l=(u,p)=>{if(i&&u===a&&p===s)return t.centre;let m=u*o+p,h=i&&m>a*o+s?1:0;return t.cells[m-h]},d=[];for(let u of e.lineTypes)if(u==="row")for(let p=0;p<r;p++)d.push(Array.from({length:o},(m,h)=>l(p,h)).filter(m=>!!m));else if(u==="column")for(let p=0;p<o;p++)d.push(Array.from({length:r},(m,h)=>l(h,p)).filter(m=>!!m));else if(u==="diagonal"&&r===o)d.push(Array.from({length:r},(p,m)=>l(m,m)).filter(p=>!!p)),d.push(Array.from({length:r},(p,m)=>l(m,r-1-m)).filter(p=>!!p));else if(u==="full_board"){let p=[...t.cells,...t.centre?[t.centre]:[]];d.push(p)}return d.filter(u=>u.length>0)}function sN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:ox({limits:e.limits,now:e.now})?{ok:!1,reason:"lock_deadline_passed"}:e.state.finished?{ok:!1,reason:"already_locked"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function cN(e){let{secret:t,state:r,limits:o}=e;if(Bh(r)!==void 0)return{outcome:"rejected",reason:"already_dealt",marked:!1,feedback:[],next:r};let n=Math.max(1,o.shuffleAllowance+1),i=[],a={};for(let s=0;s<n;s++){let l=oN(t);i.push(l.board),Object.assign(a,l.cards)}return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,attempts_used:o.shuffleAllowance,attempts_allowed:o.shuffleAllowance,progress:{...r.progress,boards:i,cards:a}}}}function lN(e){let{secret:t,state:r}=e,o=Bh(r);if(o===void 0)return{outcome:"rejected",reason:"no_board_dealt",marked:!1,feedback:[],next:r};let n=typeof e.board=="number"?e.board:void 0;if(n===void 0||!Number.isInteger(n)||n<0||n>=o.length)return{outcome:"rejected",reason:"unknown_board",marked:!1,feedback:[],next:r};let i={cells:o[n]},a=typeof e.centre=="string"?e.centre:void 0;if(t.centreMode==="none"){if(a!==void 0)return{outcome:"rejected",reason:"centre_not_offered",marked:!1,feedback:[],next:r}}else if(t.centreMode==="choice"){if(a===void 0||!(t.centreOptions??[]).includes(a))return{outcome:"rejected",reason:"invalid_centre",marked:!1,feedback:[],next:r};if(!t.allowCentreDuplicate&&i.cells.includes(a))return{outcome:"rejected",reason:"centre_duplicates_board",marked:!1,feedback:[],next:r}}let s=t.centreMode==="choice"?a:void 0;return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,finished:!0,outcome:"pending",progress:{...r.progress,chosen:n,...s?{centre:s}:{}}}}}function dN(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=rN(r);if(o===void 0)return r;let i=aN(t,o).filter(u=>iN(u,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(u=>t.cardStatus?.[u]==="correct"),l=a.some(u=>t.cardStatus?.[u]===void 0),d=i*t.pointsPerLine+(s?t.pointsForFullBoard:0);return{...r,server_time:e.now,score:d,outcome:l?"pending":i>0||s?"won":"lost"}}function uN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.shuffleAllowance,mistakes_used:0,mistakes_allowed:0,progress:{},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}function pN(e){return e.op==="deal"||e.op==="reshuffle"?cN({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?lN({secret:e.secret,state:e.state,centre:e.centre,board:e.board,now:e.now}):{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}}var ux,px=g(()=>{"use strict";Jt();ux={archetype:"bingo",admissible:sN,mark(e){let t=e.payload.op;return t!=="deal"&&t!=="reshuffle"&&t!=="lock"?{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}:pN({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:uN,settle:dN,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});function mN(e){return mx[Je(e)]}function hx(e){return mN(e.archetype??"hunt")}function fx(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard","rounds"]}}var mx,kn,ks=g(()=>{"use strict";ae();Mh();Fh();sx();dx();px();mx={hunt:jh,push:Uh,group:ax,predict:lx,bingo:ux},kn=Object.keys(mx)});function gx(e){let t=hx(e.round);if(t)return ix({...e,rules:t})}var yx=g(()=>{"use strict";Jt();ks();Mh();Fh();Jt()});function vx(e){let t=new Map,r=new Map,o=new Map,n=new Map,i=new Map,a=new Map,s=new Set,l=new Map,d=new Map,u=new Map,p=e.currentRoundId,m,h=e.now??Date.now;for(let f of e.rounds)t.set(f.round.id,f);for(let f of e.states??[])r.set(ue(e.tenant,f.round_id,f.player_id),{state:f,version:0});return{async getRound(f,b){let x=t.get(b);return x?structuredClone(x):void 0},async putRound(f,b,x){t.set(b.round.id,structuredClone(b)),x&&(p=b.round.id,m=void 0)},async setRotation(f,b,x){m={roundIds:[...b],windowSeconds:x}},async getCurrentRound(){let f=m?m.roundIds[Math.floor(h()/1e3/m.windowSeconds)%m.roundIds.length]:p,b=t.get(f);return b?structuredClone(b):void 0},async listRounds(){return[...t.values()].map(f=>structuredClone(f))},async listStatesForPlayer(f,b){return[...r.entries()].filter(([x,k])=>x.startsWith(`${f}#`)&&k.state.player_id===b).map(([,x])=>structuredClone(x.state))},async getState(f,b,x){let k=r.get(ue(f,b,x));return k?structuredClone(k):void 0},async putStateIfVersion(f,b,x){let k=ue(f,b.round_id,b.player_id),w=r.get(k);return x===void 0?w?!1:(r.set(k,{state:structuredClone(b),version:0}),!0):!w||w.version!==x?!1:(r.set(k,{state:structuredClone(b),version:w.version+1}),!0)},async getPlay(f,b,x){let k=o.get(ue(f,b,x));return k?structuredClone(k):void 0},async putPlayIfAbsent(f,b,x,k){let w=ue(f,b,x);return o.has(w)?!1:(o.set(w,structuredClone(k)),!0)},async getLeaderboard(f,b,x){if(e.leaderboard)return structuredClone(e.leaderboard);let k=[...n.entries()].filter(([T])=>T.startsWith(ue(f,b)+"#")).map(([T,L])=>({rank:0,player_id:T.slice(T.lastIndexOf("#")+1),display_name:ws(T.slice(T.lastIndexOf("#")+1)),score:L})).sort((T,L)=>L.score-T.score).map((T,L)=>({...T,rank:L+1})),w=x?.limit??k.length;return{server_time:"",snapshot:"",round_id:b,order:"high_first",tie_break:"earliest_play",entries:k.slice(0,w),total:k.length,truncated:!1,me:x?.viewerId?k.find(T=>T.player_id===x.viewerId):void 0}},async getProfile(f,b){let x=u.get(ue(f,b));return x?structuredClone(x):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:b,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(f,b,x,k){let w=ue(f,b,x,String(bs(k))),T=(i.get(w)??0)+1;return i.set(w,T),{inBucket:T,buckets:Jk}},async getDailyActivity(f,b){return b.map(x=>({date:x,plays:a.get(ue(f,x))??0,players:null}))},async markMonthlyPlayer(f,b,x){let k=`${ue(f,b)}#${x}`;if(s.has(k))return;s.add(k);let w=ue(f,b);l.set(w,(l.get(w)??0)+1)},async getMonthlyPlayers(f,b){return l.get(ue(f,b))??0},async setFuse(f,b,x){let k=t.get(b);k&&(k.fusedUntil=x)},async setResult(f,b,x){let k=t.get(b);if(!k)return;let T=k.secret.questions??[];if(typeof x=="string")T[0]&&(T[0].result=x);else for(let N of T){let V=x[N.id];V!==void 0&&(N.result=V)}let L=T.every(N=>N.result!==void 0);k.round.challenge={...k.round.challenge,...L?{questions:T.map(N=>({...k.round.challenge.questions?.find(V=>V.id===N.id),id:N.id,result:N.result})),...typeof x=="string"?{result:x}:{}}:{}},k.round.can={...k.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0}},async recordScore(f,b,x,k){n.set(ue(f,b,x),k)},async appendAudit(f){if(d.has(f.id))throw ex("audit_record_overwrite",{tenant:f.tenant,round_id:f.round_id,action:f.action,record_id:f.id}),new Error("audit_record_exists");d.set(f.id,structuredClone(f))},async commitPlay(f){let b=ue(f.tenant,f.playerId,f.idempotencyKey);if(o.has(b))return{ok:!1,reason:"play_exists"};let x=ue(f.tenant,f.state.round_id,f.state.player_id),k=r.get(x);if(f.expectedVersion===void 0){if(k)return{ok:!1,reason:"state_version"}}else if(!k||k.version!==f.expectedVersion)return{ok:!1,reason:"state_version"};for(let T of f.audit)if(d.has(T.id))throw new Error("audit_record_exists");o.set(b,structuredClone(f.play)),r.set(x,{state:structuredClone(f.state),version:f.expectedVersion===void 0?0:f.expectedVersion+1});for(let T of f.audit)d.set(T.id,structuredClone(T));f.score&&n.set(ue(f.tenant,f.score.roundId,f.playerId),f.score.score),f.profile&&u.set(ue(f.tenant,f.playerId),structuredClone(f.profile));let w=ue(f.tenant,f.date);return a.set(w,(a.get(w)??0)+1),{ok:!0}}}}var ue,bx=g(()=>{"use strict";Dh();Ph();_s();ue=(...e)=>e.join("#")});function hN(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:hn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function fN(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:hn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{theme:e.theme,prompt:e.prompt,target:e.target,target_label:e.targetLabel,unit:e.unit,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function gN(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:hn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function yN(e,t){let r=v_(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:hn(e),number:e.number,can:{accepting_plays:e.open&&!o,results_available:o,solution_revealed:o,closed:!e.open||o,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,questions:r.map(i=>({id:i.id,kind:i.kind,prompt:i.prompt,...i.options?{options:i.options.map(a=>({key:a.key,label:a.label}))}:{},...i.min!==void 0?{min:i.min}:{},...i.max!==void 0?{max:i.max}:{},...i.step!==void 0?{step:i.step}:{},...o&&i.result!==void 0?{result:i.result}:{}})),...e.options?{options:e.options.map(i=>({key:i.key,label:i.label}))}:{},...o&&e.result!==void 0?{result:e.result}:{}}},secret:{questions:r,pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function vN(e,t){let r=_N(e,t);return e.archetype==="bingo"?e.locksAt===void 0?r:{...r,round:{...r.round,locks_at:e.locksAt},limits:{...r.limits,locksAt:e.locksAt}}:e.timerSeconds===void 0?r:{...r,round:{...r.round,timer_seconds:e.timerSeconds},limits:{...r.limits,timerSeconds:e.timerSeconds}}}function bN(e,t){let r=e.cardPool.some(i=>i.result!==void 0),o=e.cardPool.length>0&&e.cardPool.every(i=>i.result!==void 0);return{archetype:"bingo",round:{server_time:"",snapshot:t,id:hn(e),number:e.number,can:{accepting_plays:e.open,results_available:r,solution_revealed:o,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,rows:e.rows,columns:e.columns,centre_mode:e.centreMode,...e.centreMode==="choice"?{centre_options:e.centreOptions??[]}:{},line_types:e.lineTypes,points_per_line:e.pointsPerLine,points_for_full_board:e.pointsForFullBoard}},secret:{rows:e.rows,columns:e.columns,centreMode:e.centreMode,...e.centreOptions?{centreOptions:e.centreOptions}:{},allowCentreDuplicate:e.allowCentreDuplicate,lineTypes:e.lineTypes,cardPool:e.cardPool.map(i=>({key:i.key,label:i.label})),cardStatus:Object.fromEntries(e.cardPool.filter(i=>i.result!==void 0).map(i=>[i.key,i.result])),pointsPerLine:e.pointsPerLine,pointsForFullBoard:e.pointsForFullBoard},limits:{shuffleAllowance:e.shuffleAllowance,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function _N(e,t){switch(e.archetype){case"hunt":return hN(e,t);case"push":return fN(e,t);case"group":return gN(e,t);case"predict":return yN(e,t);case"bingo":return bN(e,t)}}function xs(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(xs).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${xs(o)}`).join(",")}}`}function wN(e,t){let r=o=>{let{server_time:n,snapshot:i,...a}=o,{version:s,...l}=a;return l};return xs({round:r(e.round),secret:e.secret,limits:e.limits,archetype:e.archetype})===xs({round:r(t.round),secret:t.secret,limits:t.limits,archetype:t.archetype??"hunt"})}async function Gh(e,t,r,o,n=!0,i,a){let s=i??hn(r),l=await e.getRound(t,s),d=vN(r,o);if(d.round.id=s,a&&(d.round.origin=a),l&&wN(d,l)){let{fusedUntil:m,...h}=l;return await e.putRound(t,{...h,archetype:d.archetype},n),{roundId:s,version:l.round.version,changed:!1,current:n}}let u=l?l.round.version+1:1,p={round:{...d.round,version:u},secret:d.secret,limits:d.limits,archetype:d.archetype};return await e.putRound(t,p,n),await e.appendAudit({id:`round_${s}_v${u}`,at:new Date().toISOString(),tenant:t,round_id:s,player_id:null,action:l?"round.replaced":"round.provisioned",detail:{version:u,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:s,version:u,changed:!0,current:n}}var _x=g(()=>{"use strict";ae()});function Qe(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function kx(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:Wh,body:void 0};if(e.method==="GET"&&n===`${os}/health`)return Fe(200,{status:"ok"});let i=et.session.exec(n);if(i){if(e.method!=="POST")return ut(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),l=o?.check(gh(s,fh(e)));if(l&&!l.allowed)return wx(l.retryAfterSeconds);let d=r?.issue(s);return d?Fe(200,{server_time:"",snapshot:"",token:d.token,player_id:d.playerId,kind:"anonymous"}):ut(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",et.runtime],["currentRound",et.currentRound],["rounds",et.rounds],["roundsMine",et.roundsMine],["nextRound",et.nextRound],["plays",et.plays],["roundState",et.roundState],["profile",et.profile],["leaderboard",et.leaderboard],["round",et.round]];for(let[s,l]of a){let d=l.exec(n);if(!d)continue;let u=decodeURIComponent(d[1]),p=d[2]?decodeURIComponent(d[2]):void 0,m=o?.check(gh(u,fh(e)));if(m&&!m.allowed)return wx(m.retryAfterSeconds);let h=s==="plays";if(h?e.method!=="POST":e.method!=="GET")return ut(405,"method_not_allowed",`This route accepts ${h?"POST":"GET"}.`);let f;try{f=await t.forPlayer(u,e)}catch(b){return Kt({path:e.path,method:e.method,game:u,stage:"resolve",name:wn(b)}),ut(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!f)return ut(404,"not_found",`No game with id "${u}".`);try{switch(s){case"runtime":return Fe(200,await f.getRuntime());case"currentRound":return Fe(200,await f.getCurrentRound());case"rounds":return Fe(200,await f.getRoundPool());case"roundsMine":return Fe(200,await f.getPlayedRounds());case"nextRound":return Fe(200,await f.getNextRound());case"round":{let b=await f.getRound(p);return b?Fe(200,b):ut(404,"not_found","No such round.")}case"roundState":return Fe(200,await f.getRoundState(p));case"profile":return Fe(200,await f.getProfile());case"leaderboard":return Fe(200,await f.getLeaderboard());case"plays":{let b=Rw.safeParse(e.body);if(!b.success)return ut(422,"invalid_request",b.error.issues.map(w=>`${w.path.join(".")||"body"}: ${w.message}`).join("; "));let x=await f.play(p,b.data),k=Fe(200,x);return x.outcome==="busy"&&x.retry_after_seconds&&(k.headers["retry-after"]=String(x.retry_after_seconds)),k}}}catch(b){return b instanceof Error&&b.message==="round_not_found"?ut(404,"not_found","No such round."):(Kt({path:e.path,method:e.method,game:u,name:wn(b)}),ut(500,"internal","Something went wrong at our end.",!0))}}return kN}var Wh,Fe,ut,et,kN,wx,xx=g(()=>{"use strict";ae();_s();Wh={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},Fe=(e,t)=>({status:e,headers:{"content-type":"application/json",...Wh},body:t}),ut=(e,t,r,o=!1)=>Fe(e,{error:{code:t,message:r,retryable:o}});et={runtime:Qe(re.runtime),currentRound:Qe(re.currentRound),rounds:Qe(re.rounds),roundsMine:Qe(re.roundsMine),nextRound:Qe(re.nextRound),round:Qe(re.round),plays:Qe(re.plays),roundState:Qe(re.roundState),profile:Qe(re.profile),leaderboard:Qe(re.leaderboard),session:Qe(re.session)},kN=ut(404,"not_found","No such route on the player API."),wx=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...Wh},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function $s(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function _t(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var xn,zo,Ss,H6,kr=g(()=>{xn=new TextEncoder,zo=new TextDecoder,Ss=new TextDecoder("utf-8",{fatal:!0}),H6=2**32});function xN(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Sx(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw Es(t.name);if(t.hash&&o.hash?.name!==t.hash)throw Es(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw Es(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw Es(t.length,"algorithm.length");xN(e,r)}var Es,$x=g(()=>{Es=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function Ex(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Tx,Zh,Kh=g(()=>{Tx=(e,...t)=>Ex("Key must be ",e,...t),Zh=(e,t,...r)=>Ex(`Key for the ${e} algorithm must be `,t,...r)});var we,Be,Uo,Ts,pe,ee,Yt,Fo,xr,As,Is,Cs,Ae=g(()=>{we=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Be=class extends we{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Uo=class extends we{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Ts=class extends we{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},pe=class extends we{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},ee=class extends we{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Yt=class extends we{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},Fo=class extends we{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},xr=class extends we{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},As=class extends we{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},Is=class extends we{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},Cs=class extends we{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var Sr,Vh,Hh,Jh=g(()=>{Sr=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},Vh=e=>e?.[Symbol.toStringTag]==="KeyObject",Hh=e=>Sr(e)||Vh(e)});function Yh(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function Ps(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}var qh=g(()=>{});function Bo(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:zo.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=zo.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Ps(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function $r(e){let t=e;return typeof t=="string"&&(t=xn.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):Yh(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var Go=g(()=>{kr();qh()});function tt(e){if(!SN(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Os(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var SN,Xh,Ax,Ix,Cx,qt=g(()=>{SN=e=>typeof e=="object"&&e!==null;Xh=e=>tt(e)&&typeof e.kty=="string",Ax=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),Ix=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,Cx=e=>e.kty==="oct"&&typeof e.k=="string"});function Qh(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function ef(e,t,r){try{return Bo(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function Px(e,t,r){try{return _t(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function Ox(e,t,r){let o;try{o=JSON.parse(Ss.decode(Bo(e)))}catch{throw new t(r)}if(!tt(o))throw new t(r);return o}var tf=g(()=>{Go();kr();qt()});function TN(e,t){if(!e.kty.includes(t.kty))throw new pe(EN);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function Ns(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new pe('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=TN(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var EN,nf=g(()=>{Ae();EN='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function CN(e,t,r){return e.symmetric?AN(e,t,r):IN(e,t,r)}function Dx(e,t){return Ds||=new WeakMap,Ds.get(e)?.[t]}function Lx(e,t,r){let o=Ds.get(e);return o?o[t]=r:Ds.set(e,{[t]:r}),r}async function Ls(e,t,r){let o=CN(e,t,r);switch(o.kind){case Rx:case of:return o.key;case Rs:{if(o.key.k)return Bo(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return Nx(o.key,o.key,e)}case af:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?ON(n,e):Nx(n,n.export({format:"jwk"}),e)}}}var Er,rf,AN,IN,Rx,of,af,Rs,Ds,PN,Nx,ON,sf=g(()=>{Kh();Jh();qt();Go();nf();Er=e=>e[Symbol.toStringTag],rf=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},AN=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:Rx,key:t};if(Xh(t)){if(Cx(t)&&rf(e,t,r))return{kind:Rs,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Hh(t))throw new TypeError(Zh(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Er(t)} instances for symmetric algorithms must be of type "secret"`);return Sr(t)?{kind:of,key:t}:{kind:af,key:t}},IN=(e,t,r)=>{let{alg:o}=e;if(Xh(t))switch(r){case"decrypt":case"sign":if(Ax(t)&&rf(e,t,r))return{kind:Rs,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(Ix(t)&&rf(e,t,r))return{kind:Rs,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Hh(t))throw new TypeError(Zh(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Er(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${Er(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Er(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${Er(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Er(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return Sr(t)?{kind:of,key:t}:{kind:af,key:t}},Rx=Symbol(),of=Symbol(),af=Symbol(),Rs=Symbol();PN={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};Nx=async(e,t,r)=>{let o=Dx(e,r.alg);if(o)return o;let n=await Ns(r,{...t,alg:r.alg});return Lx(e,r.alg,n)},ON=(e,t)=>{let r=Dx(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=PN[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return Lx(e,t.alg,e.toCryptoKey(s,o,n))}});function Wo(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var cf=g(()=>{});function js(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:NN,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Ms(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:RN,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function lf(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:zs,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function df(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:zs,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function uf(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:zs,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function pf(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:jx,keyOps:Mx,cekBits:e,ivBits:96,cbc:!1}}function mf(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:jx,keyOps:Mx,cekBits:e,ivBits:128,cbc:!0}}function zx(e){return DN[e]}var NN,RN,zs,DN,jx,Mx,vB,Ux=g(()=>{Ae();cf();NN={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},RN={public:[],private:["deriveBits"]},zs={public:[],private:[]};DN=Wo({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:zs,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":js(1),"RSA-OAEP-256":js(256),"RSA-OAEP-384":js(384),"RSA-OAEP-512":js(512),"ECDH-ES":Ms(),"ECDH-ES+A128KW":Ms(128),"ECDH-ES+A192KW":Ms(192),"ECDH-ES+A256KW":Ms(256),A128KW:lf(128),A192KW:lf(192),A256KW:lf(256),A128GCMKW:df(128),A192GCMKW:df(192),A256GCMKW:df(256),"PBES2-HS256+A128KW":uf(256,128),"PBES2-HS384+A192KW":uf(384,192),"PBES2-HS512+A256KW":uf(512,256)}),jx={public:[],private:[]},Mx={encrypt:"encrypt",decrypt:"decrypt"};vB=Wo({A128GCM:pf(128),A192GCM:pf(192),A256GCM:pf(256),"A128CBC-HS256":mf(256),"A192CBC-HS384":mf(384),"A256CBC-HS512":mf(512)})});function LN(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function jN(e,t,r){Sx(t,e.subtle,r),e.minModulusLength&&LN(e.alg,t)}async function Fx(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(jN(e,t,r),t)}async function Bx(e,t,r){let o=await Fx(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function Gx(e,t,r,o){let n=await Fx(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var hf=g(()=>{$x()});function Wx(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function Zx(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function Fs(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new pe(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var Us,ff=g(()=>{Ae();Us=new Map([["b64",!0]])});function gf(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:Zo}}function Tr(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:Zo,minModulusLength:2048}}function yf(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:Zo}}function Kx(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:Zo}}function vf(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:Zo}}function Bs(e){let t=Vx[e];if(!t)throw new pe(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Gs(e){return Vx[e]}var Zo,Vx,Ko=g(()=>{Ae();cf();Zo={public:["verify"],private:["sign"]};Vx=Wo({HS256:gf(256),HS384:gf(384),HS512:gf(512),RS256:Tr("RSASSA-PKCS1-v1_5",256),RS384:Tr("RSASSA-PKCS1-v1_5",384),RS512:Tr("RSASSA-PKCS1-v1_5",512),PS256:Tr("RSA-PSS",256,32),PS384:Tr("RSA-PSS",384,48),PS512:Tr("RSA-PSS",512,64),ES256:yf("P-256",256),ES384:yf("P-384",384),ES512:yf("P-521",512),EdDSA:Kx(),Ed25519:Kx(),"ML-DSA-44":vf("ML-DSA-44"),"ML-DSA-65":vf("ML-DSA-65"),"ML-DSA-87":vf("ML-DSA-87")})});function Hx(e){return{algorithms:e&&Wx("algorithms",e.algorithms),crit:e?.crit}}async function MN(e,t,r){let o={};e.protected&&(o=Ox(e.protected,ee,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Os(o,e.header))throw new ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Fs(ee,Us,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new Ts('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new ee("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new ee("JWS Payload must be a string or an Uint8Array instance");let l=!1;typeof r=="function"&&(r=await r(o,e),l=!0);let d=Bs(s),u=$s(e.protected!==void 0?_t(e.protected):new Uint8Array,_t("."),typeof e.payload=="string"?a?t.b64p??=Px(e.payload,"payload",ee):xn.encode(e.payload):e.payload),p=ef(e.signature,"signature",ee),m=await Ls(d,r,"verify");if(!await Gx(d,m,p,u))throw new Cs;let f;return a?f=ef(e.payload,"payload",ee):typeof e.payload=="string"?f=xn.encode(e.payload):f=e.payload,{payload:f,parsedProt:o,b64:a,key:m,resolvedKey:l}}async function Jx(e,t,r){if(e instanceof Uint8Array&&(e=zo.decode(e)),typeof e!="string")throw new ee("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new ee("Invalid Compact JWS");return MN({payload:n,protected:o,signature:i},t,r)}var Yx=g(()=>{hf();Ko();Ae();kr();tf();qt();ff();sf()});function Vo(e){let t=FN.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*Xx);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*Qx);break;case"day":case"days":case"d":n=Math.round(r*bf);break;case"week":case"weeks":case"w":n=Math.round(r*zN);break;default:n=Math.round(r*UN);break}return t[1]==="-"||t[4]==="ago"?-n:n}function wt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function eS(e,t,r={}){let o;try{o=JSON.parse(Ss.decode(t))}catch{}if(!tt(o))throw new Yt("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||qx(e.typ)!==qx(n)))throw new Be('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:l,maxTokenAge:d}=r,u=[...i];d!==void 0&&u.push("iat"),l!==void 0&&u.push("aud"),s!==void 0&&u.push("sub"),a!==void 0&&u.push("iss");for(let f of new Set(u.reverse()))if(!(f in o))throw new Be(`missing required "${f}" claim`,o,f,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new Be('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new Be('unexpected "sub" claim value',o,"sub","check_failed");if(l!==void 0&&!BN(o.aud,typeof l=="string"?[l]:l))throw new Be('unexpected "aud" claim value',o,"aud","check_failed");let p;switch(typeof r.clockTolerance){case"string":p=Vo(r.clockTolerance);break;case"number":p=r.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}wt("clockTolerance option",p);let{currentDate:m}=r,h=wt("currentDate option",Xt(m||new Date));if((o.iat!==void 0||d!==void 0)&&typeof o.iat!="number")throw new Be('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new Be('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>h+p)throw new Be('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new Be('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=h-p)throw new Uo('"exp" claim timestamp check failed',o,"exp","check_failed")}if(d!==void 0){let f=h-o.iat,b=typeof d=="number"?d:Vo(d);if(f-p>b)throw new Uo('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(f<0-p)throw new Be('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Xt,Xx,Qx,bf,zN,UN,FN,qx,BN,Ws,_f=g(()=>{Ae();kr();qt();Xt=e=>Math.floor(e.getTime()/1e3),Xx=60,Qx=Xx*60,bf=Qx*24,zN=bf*7,UN=bf*365.25,FN=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;qx=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,BN=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Ws=class{#e;constructor(t){if(!tt(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return xn.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=wt("setNotBefore",t):t instanceof Date?this.#e.nbf=wt("setNotBefore",Xt(t)):this.#e.nbf=Xt(new Date)+Vo(t)}set exp(t){typeof t=="number"?this.#e.exp=wt("setExpirationTime",t):t instanceof Date?this.#e.exp=wt("setExpirationTime",Xt(t)):this.#e.exp=Xt(new Date)+Vo(t)}set iat(t){t===void 0?this.#e.iat=Xt(new Date):t instanceof Date?this.#e.iat=wt("setIssuedAt",Xt(t)):typeof t=="string"?this.#e.iat=wt("setIssuedAt",Xt(new Date)+Vo(t)):this.#e.iat=wt("setIssuedAt",t)}}});async function wf(e,t,r){let o=await Jx(e,Hx(r),t);if(!o.b64)throw new Yt("JWTs MUST NOT use unencoded payload");let i={payload:eS(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var tS=g(()=>{Yx();_f();Ae()});function Zs(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function nS(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Os(r,o))throw new ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};Zx(ee,r);let i=Fs(ee,Us,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=Bs(s),d,u;if(a){let k=e.encoded??={};k.b64??=$r(e.payload),k.raw??=_t(k.b64),d=k.b64,u=k.raw}else u=e.payload,d="";let p,m;r?(p=$r(JSON.stringify(r)),m=_t(p)):(p="",m=new Uint8Array);let h=$s(m,_t("."),u),f=await Ls(l,t,"sign"),b=await Bx(l,f,h),x={signature:$r(b),payload:d};return r&&(x.protected=p),x}var Ks=g(()=>{Go();hf();Ko();qt();Ae();kr();ff();sf()});var Vs,rS=g(()=>{Ae();Ks();tf();Vs=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return Qh(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return Qh(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new ee("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await nS({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Hs,oS=g(()=>{rS();Ks();Hs=class{#e;#t;constructor(t){this.#e=new Vs(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(Zs(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}}});var Ho,iS=g(()=>{oS();Ks();Ae();_f();Ho=class{#e;#t;constructor(t={}){this.#t=new Ws(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Hs(this.#t.data());if(o.setProtectedHeader(this.#e),Zs(this.#e))throw new Yt("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function aS(){return new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function sS(e){if(typeof e!="string")throw aS();let t=Gs(e)??zx(e);if(!t)throw aS();return t}var cS=g(()=>{Ae();Ko();Ux()});function ZN(e){Yo(e,48,"Invalid PKCS#8 structure"),Jo(e),Yo(e,2,"Expected version field");let t=Jo(e);e.pos+=t,Yo(e,48,"Expected algorithm identifier");let r=Jo(e);return{algIdStart:e.pos,algIdLength:r}}var kf,GN,xf,Jo,Yo,lS,WN,KN,VN,HN,dS,uS=g(()=>{qh();Ae();cS();kf=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},GN=e=>({data:e,pos:0}),xf=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},Jo=e=>{let t=xf(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|xf(e);return o}return t},Yo=(e,t,r)=>{if(xf(e)!==t)throw new Error(r)},lS=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},WN=e=>{Yo(e,6,"Expected algorithm OID");let t=Jo(e);return lS(e,t)};KN=e=>{let t=WN(e);if(kf(t,[43,101,110]))return"X25519";if(!kf(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Yo(e,6,"Expected curve OID");let r=Jo(e),o=lS(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(kf(o,i))return n;throw new Error("Unsupported named curve")},VN=async(e,t,r,o)=>{let n=sS(r);if(n.symmetric)throw new pe('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new pe("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},HN=(e,t)=>Ps(e.replace(t,"")),dS=(e,t,r)=>{let o=HN(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=GN(i);return ZN(a),KN(a)}),VN("pkcs8",o,t,n)}});function JN(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function YN(e){if(Vh(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:$r(e)};if(!Sr(e))throw new TypeError(Tx(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=JN(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function Sf(e){return YN(e)}var pS=g(()=>{Kh();Go();Jh()});function qN(e){let t=typeof e=="string"?Gs(e):void 0;if(!t||t.symmetric)throw new pe('Unsupported "alg" value for a JSON Web Key Set');return t}function XN(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(QN)}function QN(e){return tt(e)}async function mS(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await Ns(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Fo("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Ef(e){let t=new $f(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}var $f,hS=g(()=>{nf();Ko();Ae();qt();$f=class{#e;#t=new WeakMap;constructor(t){if(!XN(t))throw new Fo("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=qN(o),a=this.#e.keys.filter(d=>{let u=i.kty.includes(d.kty);return u&&typeof n=="string"&&(u=n===d.kid),u&&(typeof d.alg=="string"||d.kty==="AKP")&&(u=o===d.alg),u&&typeof d.use=="string"&&(u=d.use==="sig"),u&&Array.isArray(d.key_ops)&&(u=d.key_ops.includes("verify")),u&&i.crv&&(u=d.crv===i.crv),u}),{0:s,length:l}=a;if(l===0)throw new xr;if(l!==1){let d=new As,u=this.#t;throw d[Symbol.asyncIterator]=async function*(){for(let p of a)try{yield await mS(u,p,i)}catch{}},d}return mS(this.#t,s,i)}}});function eR(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function tR(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new Is:i});if(n.status!==200)throw new we("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new we("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function nR(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!tt(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,tt))}function If(e,t){let r=new Af(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var Tf,fS,Js,Af,gS=g(()=>{Ae();hS();qt();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Tf="jose/v6.2.5");fS=Symbol();Js=Symbol();Af=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),Tf&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",Tf),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[fS],r?.[Js]!==void 0&&(this.#s=r?.[Js],nR(r?.[Js],this.#c)&&(this.#i=this.#s.uat,this.#a=Ef(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof xr&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&eR()&&(this.#r=void 0),this.#r||=tR(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Ef(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}}});async function Cf(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return dS(e,t,r)}var yS=g(()=>{uS()});var Pf=g(()=>{tS();iS();gS();pS();yS()});function rR(e){let t=vS.get(e);return t||(t=If(new URL(e)),vS.set(e,t)),t}function bS(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await wf(r,rR(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${oR}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var vS,oR,_S=g(()=>{"use strict";Pf();vS=new Map;oR="id:"});import{createPublicKey as iR,generateKeyPairSync as aR}from"node:crypto";async function Of(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Ys}`,{privateKey:n,publicKey:i}=aR("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await Cf(n,"RS256"),s=await Sf(iR(i)),l="gamestage-dev",d={keys:[{...s,kid:l,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:d,resolver:bS({issuer:r,jwksUri:o}),async mint(u,p={}){let m=Math.floor(Date.now()/1e3);return new Ho({name:u}).setProtectedHeader({alg:"RS256",kid:l}).setIssuer(r).setSubject(u).setIssuedAt(m).setExpirationTime(m+(p.expiresInSeconds??3600)).sign(a)}}}var Ys,Nf=g(()=>{"use strict";Pf();_S();Ys="/.well-known/jwks.json"});import{createServer as sR}from"node:http";import{randomBytes as cR}from"node:crypto";async function dR(e){let t=vx({tenant:e.game,rounds:[],currentRoundId:""});await Gh(t,e.game,e.round,"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await Gh(t,e.game,n,`local-${o+2}`,!1,void 0,{source:"manifest"});let r=fx({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return gx({tenant:e.game,playerId:n.playerId??Mo(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function uR(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function qs(e){let t=await dR(e),r=cR(32).toString("base64"),o={issue:()=>Xk(r)},n=e.devIdentity,i=sR((a,s)=>{(async()=>{let l=new URL(a.url??"/","http://localhost");if(n&&l.pathname===Ys){let m=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(l.pathname)){let m=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}let d=a.headers[lR],u=a.headers.authorization,p=await kx({method:a.method??"GET",path:l.pathname,body:await uR(a),...(({playerId:m,refused:h})=>({playerId:m,identityRefusal:h}))(await Yk({token:u?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(d)?d[0]:d,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(p.status,p.headers),s.end(p.body===void 0?void 0:JSON.stringify(p.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}var lR,Rf=g(()=>{"use strict";yx();ks();bx();_x();xx();Rh();Nf();Nf();ks();lR="x-gamestage-player"});import{spawn as pR}from"node:child_process";import{createHash as mR,randomBytes as kS}from"node:crypto";import{constants as hR}from"node:fs";import{access as fR,mkdtemp as gR,rm as xS}from"node:fs/promises";import{request as yR}from"node:http";import{homedir as Xs,tmpdir as vR}from"node:os";import{join as qo}from"node:path";function Df(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??kS(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}async function Uf(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??_R].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await fR(s,hR.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await gR(qo(vR(),"gamestage-chrome-")),i=pR(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await kR(await wR(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:l}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await zf.create(a,l,i,n)}}catch(s){throw a?.close(),await SS(i),await xS(n,{recursive:!0,force:!0}),s}}function wR(e,t){return new Promise((r,o)=>{let n="",i=u=>{clearTimeout(d),e.stderr?.off("data",a),e.off("error",s),e.off("close",l),u()},a=u=>{n=(n+u.toString("utf8")).slice(-4e3);let p=n.match(/DevTools listening on (ws:\/\/\S+)/);p&&i(()=>r(p[1]))},s=u=>i(()=>o(u)),l=u=>i(()=>o(new Error(`Chrome exited before DevTools was ready${u===null?"":` (code ${u})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",l);let d=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function kR(e){return new Promise((t,r)=>{let o=new URL(e),n=kS(16).toString("base64"),i=mR("sha1").update(n+bR).digest("base64"),a=yR({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,l,d)=>{s.headers["sec-websocket-accept"]!==i?(l.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new Mf(l,d))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function SS(e){e.exitCode===null&&(e.kill("SIGTERM"),!await wS(e,1e3)&&(e.kill("SIGKILL"),await wS(e,1e3)))}function wS(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function Lf(e){return new Promise(t=>setTimeout(t,e))}var bR,jf,Mf,zf,_R,$S=g(()=>{"use strict";bR="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";jf=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,l=n&127,d=2;if(l===126){if(this.buffered.length<d+2)break;l=this.buffered.readUInt16BE(d),d+=2}else if(l===127){if(this.buffered.length<d+8)break;let m=this.buffered.readBigUInt64BE(d);if(m>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");l=Number(m),d+=8}let u=d;if(s&&(d+=4),this.buffered.length<d+l)break;let p=Buffer.from(this.buffered.subarray(d,d+l));if(s)for(let m=0;m<p.length;m++)p[m]^=this.buffered[u+m%4];if(this.buffered=this.buffered.subarray(d+l),a===8||a===9||a===10)r.push({opcode:a,payload:p});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:p}):(this.fragmentedOpcode=a,this.fragments=[p])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(p),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},Mf=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new jf;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(Df(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(Df(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(Df(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},zf=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,l=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(l.split(`
9329
+ `).some(c=>i.members.every(d=>new RegExp(`["\`']${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(c)))&&n.push(i.label)}return n}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`(?:${a})[^\\n]{0,120}?\\b${i.value}\\b`,"i"),c=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?(?:${a})`,"i");(s.test(e)||c.test(e))&&o.push(i.label)}return o}function xr(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}function _O(e){try{return JSON.parse(e)}catch{}try{let t=Zh(e);return typeof t=="object"?t:void 0}catch{return}}function kO(e){let t=_O(e);if(!t||typeof t!="object")return;let r,o=new Set,n=(i,a)=>{if(!(r||a>6||!i||typeof i!="object")&&!o.has(i)){if(o.add(i),Array.isArray(i)){for(let s of i)n(s,a+1);return}for(let[s,c]of Object.entries(i)){if(wO.has(s.toLowerCase())){r=s;return}n(c,a+1)}}};return n(t,0),r}function xO(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<Em+1)return!1;for(let r of[","," ",";"]){let o=t.slice(0,500).map(u=>u.split(r)),n=o[0].length,i=o.filter(u=>u.length===n);if(n<2||i.length<o.length*.95||i.length<Em+1)continue;let a=i.slice(1),s=Math.min(...a.map(u=>u.length)),c=!1,d=!1;for(let u=0;u<s;u+=1){let p=a.map(h=>h[u].trim());p.every(h=>h.length>0&&/^-?\d+(\.\d+)?$/.test(h))?c=!0:p.every(h=>h.length>0&&!/^-?\d+(\.\d+)?$/.test(h))&&(d=!0)}if(c&&d)return!0}try{let r=JSON.parse(e);if(r&&typeof r=="object"&&!Array.isArray(r)){let o=Object.values(r);if(o.length>=Em&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function EO(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&$O.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:SO.has(t.slice(r+1))}function AO(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>TO.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function IO(e){if(e.relativePath!==se)return;let t;try{t=await Zk(e.path)}catch{return}if(pO("sha256").update(t).digest("hex").slice(0,16)!==Et)return{path:e.relativePath,why:"needs regenerating. Run `gamestage client`, then deploy again. If it is refused again with the same digest, the tool that wrote the file is older than the one checking it, so update Gamestage and rerun.",confidence:"certain"}}async function Hk(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),c;for(let d of e){let u=AO(d.relativePath);if(u){i.includes(u)||i.push(u);continue}let p=await IO(d);if(p){c??=p;continue}if(s.has(d.relativePath)){r.push(d);continue}let h=await Am(d,t.round);if(!h){r.push(d);continue}if(h.confidence==="suspected"&&a.has(d.relativePath)){n.push(h),r.push(d);continue}if(h.alwaysWithheld||EO(d.relativePath)){o.push(h);continue}c??=h}return{publish:r,withheld:o,allowed:n,walkedPast:i,...c?{refuse:c}:{}}}async function Am(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(Tm(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await zo(e.path);if(o!==void 0){let i=gO(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=bO(o);if(a)return r(a.round?"is an App Manifest, which carries the round's private half":"is an App Manifest, which is ours rather than the game's","certain",!0);if(t){let s=kr(o,t);if(s.length)return r(xr(t,s),"certain")}}if(t&&o===void 0){let i=await vO(e.path);if(i!==void 0){let a=kr(i,t);if(a.length)return r(xr(t,a),"certain")}}if(o===void 0)return;let n=kO(o);if(n){let i=/^[aeiou]/i.test(n)?"an":"a";return r(`looks like it holds a round's answers: it has ${i} "${n}" key. If that is the game's own data rather than its answers, publish it with --allow ${e.relativePath}`,"suspected")}if(xO(o))return r(`looks like reference data: a long table of labels against numbers, which is what a round is scored against. If it is the game's own data, publish it with --allow ${e.relativePath}`,"suspected")}var mO,fO,Kk,yO,wO,Em,SO,$O,TO,vs=y(()=>{"use strict";Vh();ae();Tt();mO=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),fO=[{pattern:/-----BEGIN [A-Z ]*PRIVATE KEY-----/,what:"a private key block"},{pattern:/-----BEGIN OPENSSH PRIVATE KEY-----/,what:"an OpenSSH private key"},{pattern:/\bAKIA[0-9A-Z]{16}\b/,what:"an AWS access key id"},{pattern:/\baws_secret_access_key\s*[=:]/i,what:"an AWS secret access key"},{pattern:/\bsk-(live|proj|ant)-[A-Za-z0-9_-]{16,}/,what:"a live API key"},{pattern:/\bsk_live_[A-Za-z0-9]{16,}/,what:"a live Stripe key"},{pattern:/\bgh[pousr]_[A-Za-z0-9]{30,}/,what:"a GitHub token"},{pattern:/\bxox[baprs]-[A-Za-z0-9-]{10,}/,what:"a Slack token"},{pattern:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,what:"a signed token"},{pattern:/\bauthorization\s*:\s*["']?\s*(bearer|basic)\s+\S{12,}/i,what:"an Authorization header with a token in it"}];Kk=8e6,yO=32e6;wO=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);Em=20;SO=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),$O=new Set(["gz","br","zst","zz"]);TO=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function bs(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===se||o===xe)continue;let n=await zo(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var Im=y(()=>{"use strict";Tt();vs()});import{lstatSync as CO,readdirSync as PO}from"node:fs";import{relative as OO,resolve as Jk,sep as NO}from"node:path";function Yk(e){let t=e.split("/").pop()??e;return RO.has(t)||t.startsWith(".env.")}function Cm(e,t={}){let r=t.symlinks??"throw",o=Jk(e),n=[],i=[];function a(s){for(let c of PO(s,{withFileTypes:!0}).sort((d,u)=>d.name.localeCompare(u.name))){let d=Jk(s,c.name),u=OO(o,d).split(NO).join("/");if(c.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${u}`);i.push(u);continue}if(c.isDirectory())a(d);else if(c.isFile()){if(Yk(u))continue;n.push({path:d,relativePath:u})}}}if(!CO(o).isDirectory())throw new Error(`${e} is not a directory.`);return a(o),{files:n,skippedLinks:i}}function Pm(e){return Cm(e,{symlinks:"throw"}).files}var RO,Om=y(()=>{"use strict";RO=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"])});import{createHash as DO}from"node:crypto";function ws(e){return DO("sha256").update(e,"utf8").digest()[0]&127}var qk,Nm=y(()=>{"use strict";qk=128});import{createHmac as LO,randomBytes as jO,timingSafeEqual as MO}from"node:crypto";function Dm(e){return e.startsWith(Rm)}function Uo(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${Rm}${t||"unknown"}`}async function Qk(e){if(!e.token)return e.sessionSecret?{playerId:UO(e.anonymousId,e.sessionSecret)??Uo(void 0)}:{playerId:Uo(e.anonymousId)};let t=e.resolver??Xk,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:Uo(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function tx(e){let t=`${Rm}${jO(16).toString("base64url")}`;return{playerId:t,token:zO(t,e)}}function nx(e,t){return LO("sha256",t).update(e).digest("base64url")}function zO(e,t){return`${e}${ex}${nx(e,t)}`}function UO(e,t){if(!e)return;let r=e.lastIndexOf(ex);if(r<=0)return;let o=e.slice(0,r);if(!Dm(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(nx(o,t));if(n.length===i.length)return MO(n,i)?o:void 0}var Rm,Xk,ex,_s=y(()=>{"use strict";Rm="anon:";Xk={async resolve(){}};ex="."});function kn(e){return e instanceof Error?e.name:"unknown"}function Ht(e){console.error(FO,e)}function rx(e,t){console.error(GO,{violation:e,...t})}var FO,GO,ks=y(()=>{"use strict";FO="engine_error",GO="engine_integrity_violation"});function ax(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t^=t>>>16,t=Math.imul(t,2246822507)>>>0,t^=t>>>13,t=Math.imul(t,3266489909)>>>0,t^=t>>>16,t>>>0}function BO(e){let t=ox[ax(`a:${e}`)%ox.length],r=ix[ax(`n:${e}`)%ix.length];return`${t} ${r}`}function xs(e,t){return t?.trim()||BO(e)}var ox,ix,Lm=y(()=>{"use strict";ox=["Amber","Brave","Bright","Calm","Clever","Copper","Eager","Early","Fleet","Gentle","Golden","Happy","Keen","Kind","Lucky","Merry","Nimble","Noble","Quick","Quiet","Rapid","Ready","Royal","Silver","Steady","Sunny","Swift","Tidy","True","Warm","Wise","Zesty"],ix=["Badger","Beaver","Bison","Falcon","Ferret","Finch","Gibbon","Heron","Ibex","Jaguar","Kestrel","Lemur","Lynx","Marten","Meerkat","Osprey","Otter","Panda","Puffin","Quokka","Rabbit","Raven","Robin","Salmon","Sparrow","Stoat","Tapir","Teal","Vole","Walrus","Weasel","Wombat"]});function Jt(e){return hk({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function WO(e){let t=Date.parse(e);if(Number.isNaN(t))return 1;let r=Date.parse(`${e.slice(0,10)}T00:00:00.000Z`)+864e5;return Math.max(1,Math.ceil((r-t)/1e3))}function sx(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function cx(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),c=()=>({server_time:i(),snapshot:e.runtime.snapshot}),d=_=>_;function u(_,T){return!n.settle||!_.round.can.results_available||T.outcome!=="pending"?T:n.settle({secret:_.secret,state:T,limits:_.limits,now:i()})}function p(_){if(!_.fusedUntil)return 0;let T=Math.ceil((Date.parse(_.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite(T)&&T>0?T:0}async function h(_,T){let L=e.fuse?.note(t,ws(r),T);if(!L)return;let R=new Date(Date.parse(i())+L.holdSeconds*1e3).toISOString();if(L.kind==="stop")try{await o.setFuse(t,_,R)}catch(K){Ht({event:"fuse_write_failed",tenant:t,round_id:_,name:kn(K)})}try{await e.onFuse?.({...L,until:R})}catch(K){Ht({event:"fuse_notify_failed",tenant:t,round_id:_,name:kn(K)})}}function m(_){return p(_)<=0?_.round:{..._.round,can:{..._.round.can,accepting_plays:!1}}}function f(_,T){let L=_.round.number??Number.POSITIVE_INFINITY,R=T.round.number??Number.POSITIVE_INFINITY;return L!==R?L-R:_.round.id.localeCompare(T.round.id)}async function b(_,T){let L=await o.getState(t,_,r);return L?{state:L.state,version:L.version}:{state:{...n.initialState({playerId:r,roundId:_,limits:T,now:i()}),started_at:i()},version:void 0}}async function x(_,T,L,R){if(T.timerSeconds===void 0||R!==void 0)return L;try{if(await o.putStateIfVersion(t,L,void 0))return L}catch(Z){return Ht({event:"round_open_write_failed",tenant:t,round_id:_,name:kn(Z)}),L}return(await o.getState(t,_,r))?.state??L}let k=(_,T,L)=>({...c(),play_id:s(),outcome:_,reason:T,round_version:L,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...c()}},async getCurrentRound(){let _=await o.getCurrentRound(t);if(!_)throw new Error(jm);return{...m(_),...c()}},async getRound(_){let T=await o.getRound(t,_);return T?{...m(T),...c()}:void 0},async getRoundPool(){let[_,T]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),L=T?.round.id,R=[..._].sort(f).map(K=>{let Z=m(K);return{id:Z.id,number:Z.number,version:Z.version,can:Z.can,opens_at:Z.opens_at,locks_at:Z.locks_at,current:Z.id===L,theme:typeof Z.challenge?.theme=="string"?Z.challenge.theme:""}});return{...c(),rounds:R}},async getPlayedRounds(){let _=await o.listStatesForPlayer(t,r);return{...c(),player_id:r,played:_.map(T=>({round_id:T.round_id,finished:T.finished,score:T.score,outcome:T.outcome})).sort((T,L)=>T.round_id.localeCompare(L.round_id))}},async getNextRound(){let[_,T]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),L=new Set(T.filter(te=>te.finished).map(te=>te.round_id)),R=new Set(T.map(te=>te.round_id)),K=[..._].filter(te=>m(te).can.accepting_plays&&!L.has(te.round.id)).sort(f),Z=K.find(te=>!R.has(te.round.id))??K[0];return Z?{...c(),status:"ready",round:{...m(Z),...c()}}:{...c(),status:"exhausted"}},async getRoundState(_){let T=await o.getRound(t,_);if(!T)throw new Error(jm);let L=d(T),{state:R,version:K}=await b(_,L.limits),Z=await x(_,L.limits,R,K),te=u(L,Z);return te!==Z&&te.finished&&await o.recordScore(t,_,r,te.score),{...te,...c()}},async getProfile(){let _=await o.getProfile(t,r);return{..._,display_name:xs(r,_.display_name),...c()}},async getLeaderboard(_){let L=(await o.getCurrentRound(t))?.round.id??"";return{...await o.getLeaderboard(t,L,{limit:_,viewerId:r}),...c()}},async play(_,T){let L=await o.getRound(t,_);if(!L)return k("rejected",jm,0);let R=d(L);if(e.runtime.identity?.required&&Dm(r))return k("rejected",e.identityRefusal??"identity_required",R.round.version);if(p(R)>0)return{...k("busy","fair_use",R.round.version),retry_after_seconds:p(R)};if(R.limits.playsPerSecond!==void 0){let Ce=i().slice(0,19),F=await o.countPlay(t,_,Ce,r),Me=Math.max(1,Math.ceil(R.limits.playsPerSecond/F.buckets));if(F.inBucket>Me)return await h(_,Ce),{...k("busy","capped",R.round.version),retry_after_seconds:1}}if(R.limits.playsPerDay!==void 0){let Ce=i().slice(0,10),F=await o.countPlay(t,_,Ce,r),Me=Math.max(1,Math.ceil(R.limits.playsPerDay/F.buckets));if(F.inBucket>Me)return await h(_,Ce),{...k("busy","capped_today",R.round.version),retry_after_seconds:WO(i())}}let K=await o.getPlay(t,r,T.idempotency_key);if(K)return{...K.result,...c(),outcome:"duplicate"};let{state:Z,version:te}=await b(_,R.limits),nn=n.admissible({accepting:R.round.can.accepting_plays,roundVersion:R.round.version,playedVersion:T.round_version,challengeInstanceId:R.round.challenge_instance_id??null,playedChallengeInstanceId:T.challenge_instance_id??null,state:Z,secret:R.secret,limits:R.limits,now:i()});if(!nn.ok){let Ce=nn.reason==="round_version"?"stale":"rejected";return k(Ce,nn.reason,R.round.version)}let Q=n.mark({payload:T.payload,secret:R.secret,state:Z,limits:R.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(Q.outcome!=="accepted")return k("rejected",Q.reason??"rejected",R.round.version);let je={...c(),play_id:s(),outcome:Q.outcome,round_version:R.round.version,marked:Q.marked,feedback:Q.feedback,round_state:{...Q.next,...c()}},En=`play:${JSON.stringify([t,r,T.idempotency_key])}`,Tn=[{id:En,at:je.server_time,tenant:t,round_id:_,player_id:r,action:"play.committed",detail:{play_id:je.play_id,idempotency_key:T.idempotency_key,outcome:je.outcome,marked:je.marked,round_version:je.round_version,score_before:Z.score,score_after:Q.next.score,attempts_used:Q.next.attempts_used,attempts_allowed:Q.next.attempts_allowed,mistakes_used:Q.next.mistakes_used,mistakes_allowed:Q.next.mistakes_allowed,...n.auditDetail({secret:R.secret,before:Z,decision:Q,payload:T.payload})}}];Q.marked&&Tn.push({id:`score:${JSON.stringify([t,r,T.idempotency_key])}`,at:je.server_time,tenant:t,round_id:_,player_id:r,action:"score.recorded",detail:{play_id:je.play_id,score_before:Z.score,score_after:Q.next.score,marked:!0,outcome:Q.next.outcome}});let ri=Q.next.finished&&!Z.finished?ss(await o.getProfile(t,r),Q.next.outcome):void 0,he=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:T.idempotency_key,date:i().slice(0,10),play:{result:je},state:Q.next,expectedVersion:te,audit:Tn,...Q.marked?{score:{roundId:_,score:Q.next.score}}:{},...ri?{profile:ri}:{}});if(!he.ok&&he.reason==="play_exists"){let Ce=await o.getPlay(t,r,T.idempotency_key);return Ce?{...Ce.result,...c(),outcome:"duplicate"}:(Ht({stage:"play_receipt_missing",tenant:t,round_id:_,player_id:r}),k("rejected","play_conflict",R.round.version))}return he.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),je):(await o.appendAudit({id:En,at:je.server_time,tenant:t,round_id:_,player_id:r,action:"play.refused",detail:{play_id:je.play_id,idempotency_key:T.idempotency_key,reason:"round_version",attempt_spent:!1}}),k("stale","round_version",R.round.version))}}}var Yt,jm,qt=y(()=>{"use strict";Nm();_s();ks();Lm();ae();Yt="time_expired",jm="round_not_found"});function ZO(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Jt(e)?{ok:!1,reason:Yt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function KO(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter(k=>r.targets.includes(k)&&!i.has(k)),s=t.picks.filter(k=>!r.targets.includes(k)),c=o.attempts_used+1,d=o.mistakes_used+(s.length>0?1:0);for(let k of a)i.add(k);let u=i.size>=r.required,p=d>=n.mistakesAllowed,h=c>=n.attemptsAllowed,m=u||p||h,f=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(u?r.completionBonus:0),b={...o,server_time:e.now,attempts_used:c,attempts_allowed:n.attemptsAllowed,mistakes_used:d,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:f,finished:m,outcome:e.markAtSettlement?"pending":u?"won":m?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:b}:{outcome:"accepted",marked:!0,feedback:t.picks.map(k=>({key:k,verdict:r.targets.includes(k)?"correct":"wrong"})),next:b}}function VO(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Mm,zm=y(()=>{"use strict";qt();Mm={archetype:"hunt",admissible:ZO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return KO({...e,attempt:{picks:t}})},initialState:VO,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}}});function Um(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function HO(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function JO(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Jt(e)?{ok:!1,reason:Yt}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function YO(e){let{secret:t,state:r,limits:o}=e,n=Um(r),i=k=>({outcome:"rejected",reason:k,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,c=a.entries.find(k=>k.key===s);if(!c)return i("not_on_slate");let d=n.total+c.value,u=d>t.target,p=[...n.picks,{slate:a.id,key:c.key,label:c.label,value:c.value}],h=r.attempts_used+1,m=h>=o.picksAllowed,f=u||m,b={...r,server_time:e.now,attempts_used:h,attempts_allowed:o.picksAllowed,progress:{total:d,picks:p,bust:u,...f?{tier:HO(t,d)}:{}},score:e.markAtSettlement?r.score:u?t.target-d:d,finished:f,outcome:e.markAtSettlement?"pending":u?"lost":f?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:b}:{outcome:"accepted",marked:!0,feedback:[{key:c.key,verdict:u?"wrong":"correct",label:String(c.value)}],next:b}}function qO(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var Fm,Gm=y(()=>{"use strict";qt();Fm={archetype:"push",admissible:JO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return YO({...e,attempt:{picks:t}})},initialState:qO,auditDetail({secret:e,before:t,decision:r}){let o=Um(t),n=Um(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}}});function eN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Jt(e)?{ok:!1,reason:Yt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function tN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(R=>!i.has(R.key)),c=s.find(R=>XO(R.members,t.picks)),d=o.attempts_used+1,u=o.mistakes_used+(c?0:1);c&&(i.add(c.key),a.push({key:c.key,label:c.label,members:[...c.members]}));let p=i.size>=r.groups.length,h=u>=n.mistakesAllowed,m=d>=n.attemptsAllowed,f=p||h||m,b=e.markAtSettlement?o.score:o.score+(c?r.pointsPerGroup:0)+(p?r.completionBonus:0),x={...o,server_time:e.now,attempts_used:d,attempts_allowed:n.attemptsAllowed,mistakes_used:u,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:b,finished:f,outcome:e.markAtSettlement?"pending":p?"won":f?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:x};let k=s.reduce((R,K)=>Math.max(R,QO(t.picks,K)),0),_=!c&&t.picks.length>1&&k===t.picks.length-1,T=c?"correct":_?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((R,K)=>({key:R,verdict:T,...c&&K===0?{label:c.label}:{}})),next:x}}function nN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var XO,QO,lx,dx=y(()=>{"use strict";qt();XO=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,QO=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;lx={archetype:"group",admissible:eN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return tN({...e,attempt:{picks:t}})},initialState:nN,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}}});function rN(e,t){if(t.answers)return t.answers;if(t.pick===void 0)return{};let r=e.questions[0];return r?{[r.id]:t.pick}:{}}function oN(e,t){return e.kind==="number"?!(typeof t!="number"||!Number.isFinite(t)||e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max):typeof t=="string"&&(e.options??[]).some(r=>r.key===t)}function iN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:Jt(e)?{ok:!1,reason:Yt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function aN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=rN(r,t),a=o.attempts_used+1;if(r.questions.filter(u=>i[u.id]===void 0).length>0)return{outcome:"rejected",reason:"incomplete_prediction",marked:!1,feedback:[],next:o};let c=r.questions.find(u=>!oN(u,i[u.id]));if(c)return{outcome:"rejected",reason:c.kind==="number"?"out_of_range":"unknown_option",marked:!1,feedback:[],next:o};let d={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,answers:i},finished:a>=n.attemptsAllowed};return r.questions.some(u=>u.result===void 0)?{outcome:"accepted",marked:!1,feedback:[],next:{...d,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:sN(r,i),next:ux(r,d,i)}}function sN(e,t){return e.questions.map(r=>{let o=t[r.id],n=Ya(r,o,e.pointsForCorrect),i=r.kind==="number"?String(r.result):(r.options??[]).find(a=>a.key===r.result)?.label;return{key:r.id,verdict:n===e.pointsForCorrect||n>0&&r.kind!=="number"?"correct":n>0?"partial":"wrong",...i?{label:i}:{}}})}function ux(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=Ya(i,r[i.id],e.pointsForCorrect);o+=a,a!==Ya(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function cN(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=lN(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...ux(t,r,o),server_time:e.now}}function lN(e){let t=e.progress.answers;if(t&&typeof t=="object"&&!Array.isArray(t))return t;let r=Array.isArray(e.progress.picks)?e.progress.picks:[];return r.length>0?{1:r[0]}:{}}function dN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{answers:{}},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var px,hx=y(()=>{"use strict";ae();qt();px={archetype:"predict",admissible:iN,mark(e){let t=e.payload.answers,r=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,o=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:void 0;return aN({...e,attempt:r?{answers:r}:{pick:o}})},initialState:dN,settle:cN,auditDetail({secret:e,decision:t,payload:r}){let o=r.answers;return{predicted:o&&typeof o=="object"&&!Array.isArray(o)?o:typeof r.pick=="string"&&e.questions[0]?{[e.questions[0].id]:r.pick}:null,settled_at_commit:e.questions.every(i=>i.result!==void 0),marked:t.marked,questions_asked:e.questions.length}}}});function uN(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function Bm(e){let r=e.progress?.boards;if(!(!Array.isArray(r)||r.length===0)&&r.every(o=>Array.isArray(o)&&o.every(n=>typeof n=="string")))return r}function pN(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function hN(e){let t=Bm(e),r=pN(e);if(!t||r===void 0)return;let o=t[r];if(!o)return;let n=e.progress,i=typeof n?.centre=="string"?n.centre:void 0;return{cells:o,centre:i}}function mN(e){let t=uN(e),r=[...e.cardPool],o=[],n={},i={};for(let a=0;a<t&&r.length>0;a++){let s=Math.floor(Math.random()*r.length),c=r.splice(s,1)[0];o.push(c.key),n[c.key]=c.label,c.note&&(i[c.key]=c.note)}return{board:o,cards:n,notes:i}}function mx(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function fN(e,t){let{rows:r,columns:o,centreMode:n}=e,i=n!=="none",a=i?Math.floor(r/2):-1,s=i?Math.floor(o/2):-1,c=(u,p)=>{if(i&&u===a&&p===s)return t.centre;let h=u*o+p,m=i&&h>a*o+s?1:0;return t.cells[h-m]},d=[];for(let u of e.lineTypes)if(u==="row")for(let p=0;p<r;p++)d.push(Array.from({length:o},(h,m)=>c(p,m)).filter(h=>!!h));else if(u==="column")for(let p=0;p<o;p++)d.push(Array.from({length:r},(h,m)=>c(m,p)).filter(h=>!!h));else if(u==="diagonal"&&r===o)d.push(Array.from({length:r},(p,h)=>c(h,h)).filter(p=>!!p)),d.push(Array.from({length:r},(p,h)=>c(h,r-1-h)).filter(p=>!!p));else if(u==="full_board"){let p=[...t.cells,...t.centre?[t.centre]:[]];d.push(p)}return d.filter(u=>u.length>0)}function gN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:sx({limits:e.limits,now:e.now})?{ok:!1,reason:"lock_deadline_passed"}:e.state.finished?{ok:!1,reason:"already_locked"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function yN(e){let{secret:t,state:r,limits:o}=e;if(Bm(r)!==void 0)return{outcome:"rejected",reason:"already_dealt",marked:!1,feedback:[],next:r};let n=Math.max(1,o.shuffleAllowance+1),i=[],a={},s={};for(let c=0;c<n;c++){let d=mN(t);i.push(d.board),Object.assign(a,d.cards),Object.assign(s,d.notes)}return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,attempts_used:o.shuffleAllowance,attempts_allowed:o.shuffleAllowance,progress:{...r.progress,boards:i,cards:a,...Object.keys(s).length>0?{notes:s}:{}}}}}function vN(e){let{secret:t,state:r}=e,o=Bm(r);if(o===void 0)return{outcome:"rejected",reason:"no_board_dealt",marked:!1,feedback:[],next:r};let n=typeof e.board=="number"?e.board:void 0;if(n===void 0||!Number.isInteger(n)||n<0||n>=o.length)return{outcome:"rejected",reason:"unknown_board",marked:!1,feedback:[],next:r};let i={cells:o[n]},a=typeof e.centre=="string"?e.centre:void 0;if(t.centreMode==="none"){if(a!==void 0)return{outcome:"rejected",reason:"centre_not_offered",marked:!1,feedback:[],next:r}}else if(t.centreMode==="choice"){if(a===void 0||!(t.centreOptions??[]).includes(a))return{outcome:"rejected",reason:"invalid_centre",marked:!1,feedback:[],next:r};if(!t.allowCentreDuplicate&&i.cells.includes(a))return{outcome:"rejected",reason:"centre_duplicates_board",marked:!1,feedback:[],next:r}}let s=t.centreMode==="choice"?a:void 0;return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,finished:!0,outcome:"pending",progress:{...r.progress,chosen:n,...s?{centre:s}:{}}}}}function bN(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=hN(r);if(o===void 0)return r;let n=fN(t,o),i=n.filter(h=>mx(h,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(h=>t.cardStatus?.[h]==="correct"),c=a.some(h=>t.cardStatus?.[h]===void 0),d=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),u={};for(let h of a){let m=t.cardStatus?.[h];m&&(u[h]=m)}let p=n.map(h=>{let m=mx(h,t.cardStatus),f=h.filter(x=>t.cardStatus?.[x]==="correct").length,b=h.some(x=>t.cardStatus?.[x]==="incorrect");return{cards:h,complete:m,oneAway:!m&&!b&&f===h.length-1}});return{...r,server_time:e.now,score:d,progress:{...r.progress,marks:u,lines:p},outcome:c?"pending":i>0||s?"won":"lost"}}function wN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.shuffleAllowance,mistakes_used:0,mistakes_allowed:0,progress:{},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}function _N(e){return e.op==="deal"||e.op==="reshuffle"?yN({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?vN({secret:e.secret,state:e.state,centre:e.centre,board:e.board,now:e.now}):{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}}var fx,gx=y(()=>{"use strict";qt();fx={archetype:"bingo",admissible:gN,mark(e){let t=e.payload.op;return t!=="deal"&&t!=="reshuffle"&&t!=="lock"?{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}:_N({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:wN,settle:bN,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});function kN(e){return yx[Ye(e)]}function vx(e){return kN(e.archetype??"hunt")}function bx(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard","rounds"]}}var yx,xn,Ss=y(()=>{"use strict";ae();zm();Gm();dx();hx();gx();yx={hunt:Mm,push:Fm,group:lx,predict:px,bingo:fx},xn=Object.keys(yx)});function wx(e){let t=vx(e.round);if(t)return cx({...e,rules:t})}var _x=y(()=>{"use strict";qt();Ss();zm();Gm();qt()});function kx(e){let t=new Map,r=new Map,o=new Map,n=new Map,i=new Map,a=new Map,s=new Set,c=new Map,d=new Map,u=new Map,p=e.currentRoundId,h,m=e.now??Date.now;for(let f of e.rounds)t.set(f.round.id,f);for(let f of e.states??[])r.set(ue(e.tenant,f.round_id,f.player_id),{state:f,version:0});return{async getRound(f,b){let x=t.get(b);return x?structuredClone(x):void 0},async putRound(f,b,x){t.set(b.round.id,structuredClone(b)),x&&(p=b.round.id,h=void 0)},async setRotation(f,b,x){h={roundIds:[...b],windowSeconds:x}},async getCurrentRound(){let f=h?h.roundIds[Math.floor(m()/1e3/h.windowSeconds)%h.roundIds.length]:p,b=t.get(f);return b?structuredClone(b):void 0},async listRounds(){return[...t.values()].map(f=>structuredClone(f))},async listStatesForPlayer(f,b){return[...r.entries()].filter(([x,k])=>x.startsWith(`${f}#`)&&k.state.player_id===b).map(([,x])=>structuredClone(x.state))},async getState(f,b,x){let k=r.get(ue(f,b,x));return k?structuredClone(k):void 0},async putStateIfVersion(f,b,x){let k=ue(f,b.round_id,b.player_id),_=r.get(k);return x===void 0?_?!1:(r.set(k,{state:structuredClone(b),version:0}),!0):!_||_.version!==x?!1:(r.set(k,{state:structuredClone(b),version:_.version+1}),!0)},async getPlay(f,b,x){let k=o.get(ue(f,b,x));return k?structuredClone(k):void 0},async putPlayIfAbsent(f,b,x,k){let _=ue(f,b,x);return o.has(_)?!1:(o.set(_,structuredClone(k)),!0)},async getLeaderboard(f,b,x){if(e.leaderboard)return structuredClone(e.leaderboard);let k=[...n.entries()].filter(([T])=>T.startsWith(ue(f,b)+"#")).map(([T,L])=>({rank:0,player_id:T.slice(T.lastIndexOf("#")+1),display_name:xs(T.slice(T.lastIndexOf("#")+1)),score:L})).sort((T,L)=>L.score-T.score).map((T,L)=>({...T,rank:L+1})),_=x?.limit??k.length;return{server_time:"",snapshot:"",round_id:b,order:"high_first",tie_break:"earliest_play",entries:k.slice(0,_),total:k.length,truncated:!1,me:x?.viewerId?k.find(T=>T.player_id===x.viewerId):void 0}},async getProfile(f,b){let x=u.get(ue(f,b));return x?structuredClone(x):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:b,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(f,b,x,k){let _=ue(f,b,x,String(ws(k))),T=(i.get(_)??0)+1;return i.set(_,T),{inBucket:T,buckets:qk}},async getDailyActivity(f,b){return b.map(x=>({date:x,plays:a.get(ue(f,x))??0,players:null}))},async markMonthlyPlayer(f,b,x){let k=`${ue(f,b)}#${x}`;if(s.has(k))return;s.add(k);let _=ue(f,b);c.set(_,(c.get(_)??0)+1)},async getMonthlyPlayers(f,b){return c.get(ue(f,b))??0},async setFuse(f,b,x){let k=t.get(b);k&&(k.fusedUntil=x)},async setResult(f,b,x){let k=t.get(b);if(!k)return;let T=k.secret.questions??[];if(typeof x=="string")T[0]&&(T[0].result=x);else for(let R of T){let K=x[R.id];K!==void 0&&(R.result=K)}let L=T.every(R=>R.result!==void 0);k.round.challenge={...k.round.challenge,...L?{questions:T.map(R=>({...k.round.challenge.questions?.find(K=>K.id===R.id),id:R.id,result:R.result})),...typeof x=="string"?{result:x}:{}}:{}},k.round.can={...k.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0}},async recordScore(f,b,x,k){n.set(ue(f,b,x),k)},async appendAudit(f){if(d.has(f.id))throw rx("audit_record_overwrite",{tenant:f.tenant,round_id:f.round_id,action:f.action,record_id:f.id}),new Error("audit_record_exists");d.set(f.id,structuredClone(f))},async commitPlay(f){let b=ue(f.tenant,f.playerId,f.idempotencyKey);if(o.has(b))return{ok:!1,reason:"play_exists"};let x=ue(f.tenant,f.state.round_id,f.state.player_id),k=r.get(x);if(f.expectedVersion===void 0){if(k)return{ok:!1,reason:"state_version"}}else if(!k||k.version!==f.expectedVersion)return{ok:!1,reason:"state_version"};for(let T of f.audit)if(d.has(T.id))throw new Error("audit_record_exists");o.set(b,structuredClone(f.play)),r.set(x,{state:structuredClone(f.state),version:f.expectedVersion===void 0?0:f.expectedVersion+1});for(let T of f.audit)d.set(T.id,structuredClone(T));f.score&&n.set(ue(f.tenant,f.score.roundId,f.playerId),f.score.score),f.profile&&u.set(ue(f.tenant,f.playerId),structuredClone(f.profile));let _=ue(f.tenant,f.date);return a.set(_,(a.get(_)??0)+1),{ok:!0}}}}var ue,xx=y(()=>{"use strict";Lm();Nm();ks();ue=(...e)=>e.join("#")});function xN(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:gn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function SN(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:gn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{theme:e.theme,prompt:e.prompt,target:e.target,target_label:e.targetLabel,unit:e.unit,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function $N(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:gn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function EN(e,t){let r=bw(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:gn(e),number:e.number,can:{accepting_plays:e.open&&!o,results_available:o,solution_revealed:o,closed:!e.open||o,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,questions:r.map(i=>({id:i.id,kind:i.kind,prompt:i.prompt,...i.options?{options:i.options.map(a=>({key:a.key,label:a.label}))}:{},...i.min!==void 0?{min:i.min}:{},...i.max!==void 0?{max:i.max}:{},...i.step!==void 0?{step:i.step}:{},...o&&i.result!==void 0?{result:i.result}:{}})),...e.options?{options:e.options.map(i=>({key:i.key,label:i.label}))}:{},...o&&e.result!==void 0?{result:e.result}:{}}},secret:{questions:r,pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function TN(e,t){let r=IN(e,t);return e.archetype==="bingo"?e.locksAt===void 0?r:{...r,round:{...r.round,locks_at:e.locksAt},limits:{...r.limits,locksAt:e.locksAt}}:e.timerSeconds===void 0?r:{...r,round:{...r.round,timer_seconds:e.timerSeconds},limits:{...r.limits,timerSeconds:e.timerSeconds}}}function AN(e,t){let r=e.cardPool.some(i=>i.result!==void 0),o=e.cardPool.length>0&&e.cardPool.every(i=>i.result!==void 0);return{archetype:"bingo",round:{server_time:"",snapshot:t,id:gn(e),number:e.number,can:{accepting_plays:e.open,results_available:r,solution_revealed:o,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,rows:e.rows,columns:e.columns,centre_mode:e.centreMode,...e.centreMode==="choice"?{centre_options:e.centreOptions??[]}:{},line_types:e.lineTypes,points_per_line:e.pointsPerLine,points_for_full_board:e.pointsForFullBoard}},secret:{rows:e.rows,columns:e.columns,centreMode:e.centreMode,...e.centreOptions?{centreOptions:e.centreOptions}:{},allowCentreDuplicate:e.allowCentreDuplicate,lineTypes:e.lineTypes,cardPool:e.cardPool.map(i=>({key:i.key,label:i.label,...i.note?{note:i.note}:{}})),cardStatus:Object.fromEntries(e.cardPool.filter(i=>i.result!==void 0).map(i=>[i.key,i.result])),pointsPerLine:e.pointsPerLine,pointsForFullBoard:e.pointsForFullBoard},limits:{shuffleAllowance:e.shuffleAllowance,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function IN(e,t){switch(e.archetype){case"hunt":return xN(e,t);case"push":return SN(e,t);case"group":return $N(e,t);case"predict":return EN(e,t);case"bingo":return AN(e,t)}}function Sr(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Sr).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${Sr(o)}`).join(",")}}`}function Sx(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...c}=i,{version:d,...u}=c;if(!r.ignoringSettlement)return u;let{results_available:p,solution_revealed:h,...m}=u.can;return{...u,can:m}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return Sr({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===Sr({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function CN(e,t){if(e.archetype!=="bingo"||!Sx(e,t,{ignoringSettlement:!0}))return!1;let r=i=>(i??{}).cardStatus??{},o=r(t.secret),n=r(e.secret);for(let[i,a]of Object.entries(o))if(!(i in n)||Sr(n[i])!==Sr(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function Wm(e,t,r,o,n=!0,i,a){let s=i??gn(r),c=await e.getRound(t,s),d=TN(r,o);if(d.round.id=s,a&&(d.round.origin=a),c&&Sx(d,c)){let{fusedUntil:h,...m}=c;return await e.putRound(t,{...m,archetype:d.archetype},n),{roundId:s,version:c.round.version,changed:!1,current:n}}if(c&&CN(d,c)){let h=Object.keys((d.secret??{}).cardStatus??{}).length;return await e.putRound(t,{...c,round:{...d.round,version:c.round.version},secret:d.secret,limits:d.limits,archetype:d.archetype},n),await e.appendAudit({id:`round_${s}_settle_${h}`,at:new Date().toISOString(),tenant:t,round_id:s,player_id:null,action:"round.settled",detail:{version:c.round.version,resolved:h,snapshot:o}}),{roundId:s,version:c.round.version,changed:!1,current:n}}let u=c?c.round.version+1:1,p={round:{...d.round,version:u},secret:d.secret,limits:d.limits,archetype:d.archetype};return await e.putRound(t,p,n),await e.appendAudit({id:`round_${s}_v${u}`,at:new Date().toISOString(),tenant:t,round_id:s,player_id:null,action:c?"round.replaced":"round.provisioned",detail:{version:u,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:s,version:u,changed:!0,current:n}}var $x=y(()=>{"use strict";ae()});function Qe(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function Tx(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:Zm,body:void 0};if(e.method==="GET"&&n===`${as}/health`)return Ge(200,{status:"ok"});let i=et.session.exec(n);if(i){if(e.method!=="POST")return ut(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),c=o?.check(vm(s,ym(e)));if(c&&!c.allowed)return Ex(c.retryAfterSeconds);let d=r?.issue(s);return d?Ge(200,{server_time:"",snapshot:"",token:d.token,player_id:d.playerId,kind:"anonymous"}):ut(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",et.runtime],["currentRound",et.currentRound],["rounds",et.rounds],["roundsMine",et.roundsMine],["nextRound",et.nextRound],["plays",et.plays],["roundState",et.roundState],["profile",et.profile],["leaderboard",et.leaderboard],["round",et.round]];for(let[s,c]of a){let d=c.exec(n);if(!d)continue;let u=decodeURIComponent(d[1]),p=d[2]?decodeURIComponent(d[2]):void 0,h=o?.check(vm(u,ym(e)));if(h&&!h.allowed)return Ex(h.retryAfterSeconds);let m=s==="plays";if(m?e.method!=="POST":e.method!=="GET")return ut(405,"method_not_allowed",`This route accepts ${m?"POST":"GET"}.`);let f;try{f=await t.forPlayer(u,e)}catch(b){return Ht({path:e.path,method:e.method,game:u,stage:"resolve",name:kn(b)}),ut(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!f)return ut(404,"not_found",`No game with id "${u}".`);try{switch(s){case"runtime":return Ge(200,await f.getRuntime());case"currentRound":return Ge(200,await f.getCurrentRound());case"rounds":return Ge(200,await f.getRoundPool());case"roundsMine":return Ge(200,await f.getPlayedRounds());case"nextRound":return Ge(200,await f.getNextRound());case"round":{let b=await f.getRound(p);return b?Ge(200,b):ut(404,"not_found","No such round.")}case"roundState":return Ge(200,await f.getRoundState(p));case"profile":return Ge(200,await f.getProfile());case"leaderboard":return Ge(200,await f.getLeaderboard());case"plays":{let b=L_.safeParse(e.body);if(!b.success)return ut(422,"invalid_request",b.error.issues.map(_=>`${_.path.join(".")||"body"}: ${_.message}`).join("; "));let x=await f.play(p,b.data),k=Ge(200,x);return x.outcome==="busy"&&x.retry_after_seconds&&(k.headers["retry-after"]=String(x.retry_after_seconds)),k}}}catch(b){return b instanceof Error&&b.message==="round_not_found"?ut(404,"not_found","No such round."):(Ht({path:e.path,method:e.method,game:u,name:kn(b)}),ut(500,"internal","Something went wrong at our end.",!0))}}return PN}var Zm,Ge,ut,et,PN,Ex,Ax=y(()=>{"use strict";ae();ks();Zm={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},Ge=(e,t)=>({status:e,headers:{"content-type":"application/json",...Zm},body:t}),ut=(e,t,r,o=!1)=>Ge(e,{error:{code:t,message:r,retryable:o}});et={runtime:Qe(re.runtime),currentRound:Qe(re.currentRound),rounds:Qe(re.rounds),roundsMine:Qe(re.roundsMine),nextRound:Qe(re.nextRound),round:Qe(re.round),plays:Qe(re.plays),roundState:Qe(re.roundState),profile:Qe(re.profile),leaderboard:Qe(re.leaderboard),session:Qe(re.session)},PN=ut(404,"not_found","No such route on the player API."),Ex=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...Zm},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function Es(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function _t(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var Sn,Fo,$s,lG,$r=y(()=>{Sn=new TextEncoder,Fo=new TextDecoder,$s=new TextDecoder("utf-8",{fatal:!0}),lG=2**32});function ON(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Ix(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw Ts(t.name);if(t.hash&&o.hash?.name!==t.hash)throw Ts(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw Ts(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw Ts(t.length,"algorithm.length");ON(e,r)}var Ts,Cx=y(()=>{Ts=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function Px(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Ox,Km,Vm=y(()=>{Ox=(e,...t)=>Px("Key must be ",e,...t),Km=(e,t,...r)=>Px(`Key for the ${e} algorithm must be `,t,...r)});var ke,Be,Go,As,pe,ee,Xt,Bo,Er,Is,Cs,Ps,Ie=y(()=>{ke=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Be=class extends ke{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Go=class extends ke{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},As=class extends ke{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},pe=class extends ke{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},ee=class extends ke{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Xt=class extends ke{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},Bo=class extends ke{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Er=class extends ke{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},Is=class extends ke{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},Cs=class extends ke{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},Ps=class extends ke{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var Tr,Hm,Jm,Ym=y(()=>{Tr=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},Hm=e=>e?.[Symbol.toStringTag]==="KeyObject",Jm=e=>Tr(e)||Hm(e)});function qm(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function Os(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}var Xm=y(()=>{});function Wo(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:Fo.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=Fo.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Os(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function Ar(e){let t=e;return typeof t=="string"&&(t=Sn.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):qm(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var Zo=y(()=>{$r();Xm()});function tt(e){if(!NN(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ns(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var NN,Qm,Nx,Rx,Dx,Qt=y(()=>{NN=e=>typeof e=="object"&&e!==null;Qm=e=>tt(e)&&typeof e.kty=="string",Nx=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),Rx=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,Dx=e=>e.kty==="oct"&&typeof e.k=="string"});function ef(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function tf(e,t,r){try{return Wo(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function Lx(e,t,r){try{return _t(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function jx(e,t,r){let o;try{o=JSON.parse($s.decode(Wo(e)))}catch{throw new t(r)}if(!tt(o))throw new t(r);return o}var nf=y(()=>{Zo();$r();Qt()});function LN(e,t){if(!e.kty.includes(t.kty))throw new pe(DN);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function Rs(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new pe('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=LN(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var DN,rf=y(()=>{Ie();DN='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function zN(e,t,r){return e.symmetric?jN(e,t,r):MN(e,t,r)}function Ux(e,t){return Ls||=new WeakMap,Ls.get(e)?.[t]}function Fx(e,t,r){let o=Ls.get(e);return o?o[t]=r:Ls.set(e,{[t]:r}),r}async function js(e,t,r){let o=zN(e,t,r);switch(o.kind){case zx:case af:return o.key;case Ds:{if(o.key.k)return Wo(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return Mx(o.key,o.key,e)}case sf:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?FN(n,e):Mx(n,n.export({format:"jwk"}),e)}}}var Ir,of,jN,MN,zx,af,sf,Ds,Ls,UN,Mx,FN,cf=y(()=>{Vm();Ym();Qt();Zo();rf();Ir=e=>e[Symbol.toStringTag],of=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},jN=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:zx,key:t};if(Qm(t)){if(Dx(t)&&of(e,t,r))return{kind:Ds,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Jm(t))throw new TypeError(Km(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Ir(t)} instances for symmetric algorithms must be of type "secret"`);return Tr(t)?{kind:af,key:t}:{kind:sf,key:t}},MN=(e,t,r)=>{let{alg:o}=e;if(Qm(t))switch(r){case"decrypt":case"sign":if(Nx(t)&&of(e,t,r))return{kind:Ds,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(Rx(t)&&of(e,t,r))return{kind:Ds,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Jm(t))throw new TypeError(Km(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Ir(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${Ir(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Ir(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${Ir(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Ir(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return Tr(t)?{kind:af,key:t}:{kind:sf,key:t}},zx=Symbol(),af=Symbol(),sf=Symbol(),Ds=Symbol();UN={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};Mx=async(e,t,r)=>{let o=Ux(e,r.alg);if(o)return o;let n=await Rs(r,{...t,alg:r.alg});return Fx(e,r.alg,n)},FN=(e,t)=>{let r=Ux(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=UN[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return Fx(e,t.alg,e.toCryptoKey(s,o,n))}});function Ko(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var lf=y(()=>{});function Ms(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:GN,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function zs(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:BN,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function df(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:Us,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function uf(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Us,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function pf(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:Us,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function hf(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Gx,keyOps:Bx,cekBits:e,ivBits:96,cbc:!1}}function mf(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:Gx,keyOps:Bx,cekBits:e,ivBits:128,cbc:!0}}function Wx(e){return WN[e]}var GN,BN,Us,WN,Gx,Bx,NG,Zx=y(()=>{Ie();lf();GN={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},BN={public:[],private:["deriveBits"]},Us={public:[],private:[]};WN=Ko({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:Us,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":Ms(1),"RSA-OAEP-256":Ms(256),"RSA-OAEP-384":Ms(384),"RSA-OAEP-512":Ms(512),"ECDH-ES":zs(),"ECDH-ES+A128KW":zs(128),"ECDH-ES+A192KW":zs(192),"ECDH-ES+A256KW":zs(256),A128KW:df(128),A192KW:df(192),A256KW:df(256),A128GCMKW:uf(128),A192GCMKW:uf(192),A256GCMKW:uf(256),"PBES2-HS256+A128KW":pf(256,128),"PBES2-HS384+A192KW":pf(384,192),"PBES2-HS512+A256KW":pf(512,256)}),Gx={public:[],private:[]},Bx={encrypt:"encrypt",decrypt:"decrypt"};NG=Ko({A128GCM:hf(128),A192GCM:hf(192),A256GCM:hf(256),"A128CBC-HS256":mf(256),"A192CBC-HS384":mf(384),"A256CBC-HS512":mf(512)})});function ZN(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function KN(e,t,r){Ix(t,e.subtle,r),e.minModulusLength&&ZN(e.alg,t)}async function Kx(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(KN(e,t,r),t)}async function Vx(e,t,r){let o=await Kx(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function Hx(e,t,r,o){let n=await Kx(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var ff=y(()=>{Cx()});function Jx(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function Yx(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function Gs(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new pe(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var Fs,gf=y(()=>{Ie();Fs=new Map([["b64",!0]])});function yf(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:Vo}}function Cr(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:Vo,minModulusLength:2048}}function vf(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:Vo}}function qx(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:Vo}}function bf(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:Vo}}function Bs(e){let t=Xx[e];if(!t)throw new pe(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Ws(e){return Xx[e]}var Vo,Xx,Ho=y(()=>{Ie();lf();Vo={public:["verify"],private:["sign"]};Xx=Ko({HS256:yf(256),HS384:yf(384),HS512:yf(512),RS256:Cr("RSASSA-PKCS1-v1_5",256),RS384:Cr("RSASSA-PKCS1-v1_5",384),RS512:Cr("RSASSA-PKCS1-v1_5",512),PS256:Cr("RSA-PSS",256,32),PS384:Cr("RSA-PSS",384,48),PS512:Cr("RSA-PSS",512,64),ES256:vf("P-256",256),ES384:vf("P-384",384),ES512:vf("P-521",512),EdDSA:qx(),Ed25519:qx(),"ML-DSA-44":bf("ML-DSA-44"),"ML-DSA-65":bf("ML-DSA-65"),"ML-DSA-87":bf("ML-DSA-87")})});function Qx(e){return{algorithms:e&&Jx("algorithms",e.algorithms),crit:e?.crit}}async function VN(e,t,r){let o={};e.protected&&(o=jx(e.protected,ee,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Ns(o,e.header))throw new ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Gs(ee,Fs,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new As('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new ee("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new ee("JWS Payload must be a string or an Uint8Array instance");let c=!1;typeof r=="function"&&(r=await r(o,e),c=!0);let d=Bs(s),u=Es(e.protected!==void 0?_t(e.protected):new Uint8Array,_t("."),typeof e.payload=="string"?a?t.b64p??=Lx(e.payload,"payload",ee):Sn.encode(e.payload):e.payload),p=tf(e.signature,"signature",ee),h=await js(d,r,"verify");if(!await Hx(d,h,p,u))throw new Ps;let f;return a?f=tf(e.payload,"payload",ee):typeof e.payload=="string"?f=Sn.encode(e.payload):f=e.payload,{payload:f,parsedProt:o,b64:a,key:h,resolvedKey:c}}async function eS(e,t,r){if(e instanceof Uint8Array&&(e=Fo.decode(e)),typeof e!="string")throw new ee("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new ee("Invalid Compact JWS");return VN({payload:n,protected:o,signature:i},t,r)}var tS=y(()=>{ff();Ho();Ie();$r();nf();Qt();gf();cf()});function Jo(e){let t=YN.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*rS);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*oS);break;case"day":case"days":case"d":n=Math.round(r*wf);break;case"week":case"weeks":case"w":n=Math.round(r*HN);break;default:n=Math.round(r*JN);break}return t[1]==="-"||t[4]==="ago"?-n:n}function kt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function iS(e,t,r={}){let o;try{o=JSON.parse($s.decode(t))}catch{}if(!tt(o))throw new Xt("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||nS(e.typ)!==nS(n)))throw new Be('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:d}=r,u=[...i];d!==void 0&&u.push("iat"),c!==void 0&&u.push("aud"),s!==void 0&&u.push("sub"),a!==void 0&&u.push("iss");for(let f of new Set(u.reverse()))if(!(f in o))throw new Be(`missing required "${f}" claim`,o,f,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new Be('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new Be('unexpected "sub" claim value',o,"sub","check_failed");if(c!==void 0&&!qN(o.aud,typeof c=="string"?[c]:c))throw new Be('unexpected "aud" claim value',o,"aud","check_failed");let p;switch(typeof r.clockTolerance){case"string":p=Jo(r.clockTolerance);break;case"number":p=r.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}kt("clockTolerance option",p);let{currentDate:h}=r,m=kt("currentDate option",en(h||new Date));if((o.iat!==void 0||d!==void 0)&&typeof o.iat!="number")throw new Be('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new Be('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>m+p)throw new Be('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new Be('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=m-p)throw new Go('"exp" claim timestamp check failed',o,"exp","check_failed")}if(d!==void 0){let f=m-o.iat,b=typeof d=="number"?d:Jo(d);if(f-p>b)throw new Go('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(f<0-p)throw new Be('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var en,rS,oS,wf,HN,JN,YN,nS,qN,Zs,_f=y(()=>{Ie();$r();Qt();en=e=>Math.floor(e.getTime()/1e3),rS=60,oS=rS*60,wf=oS*24,HN=wf*7,JN=wf*365.25,YN=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;nS=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,qN=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Zs=class{#e;constructor(t){if(!tt(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return Sn.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=kt("setNotBefore",t):t instanceof Date?this.#e.nbf=kt("setNotBefore",en(t)):this.#e.nbf=en(new Date)+Jo(t)}set exp(t){typeof t=="number"?this.#e.exp=kt("setExpirationTime",t):t instanceof Date?this.#e.exp=kt("setExpirationTime",en(t)):this.#e.exp=en(new Date)+Jo(t)}set iat(t){t===void 0?this.#e.iat=en(new Date):t instanceof Date?this.#e.iat=kt("setIssuedAt",en(t)):typeof t=="string"?this.#e.iat=kt("setIssuedAt",en(new Date)+Jo(t)):this.#e.iat=kt("setIssuedAt",t)}}});async function kf(e,t,r){let o=await eS(e,Qx(r),t);if(!o.b64)throw new Xt("JWTs MUST NOT use unencoded payload");let i={payload:iS(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var aS=y(()=>{tS();_f();Ie()});function Ks(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function sS(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Ns(r,o))throw new ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};Yx(ee,r);let i=Gs(ee,Fs,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');let c=Bs(s),d,u;if(a){let k=e.encoded??={};k.b64??=Ar(e.payload),k.raw??=_t(k.b64),d=k.b64,u=k.raw}else u=e.payload,d="";let p,h;r?(p=Ar(JSON.stringify(r)),h=_t(p)):(p="",h=new Uint8Array);let m=Es(h,_t("."),u),f=await js(c,t,"sign"),b=await Vx(c,f,m),x={signature:Ar(b),payload:d};return r&&(x.protected=p),x}var Vs=y(()=>{Zo();ff();Ho();Qt();Ie();$r();gf();cf()});var Hs,cS=y(()=>{Ie();Vs();nf();Hs=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return ef(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return ef(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new ee("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await sS({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Js,lS=y(()=>{cS();Vs();Js=class{#e;#t;constructor(t){this.#e=new Hs(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(Ks(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}}});var Yo,dS=y(()=>{lS();Vs();Ie();_f();Yo=class{#e;#t;constructor(t={}){this.#t=new Zs(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Js(this.#t.data());if(o.setProtectedHeader(this.#e),Ks(this.#e))throw new Xt("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function uS(){return new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function pS(e){if(typeof e!="string")throw uS();let t=Ws(e)??Wx(e);if(!t)throw uS();return t}var hS=y(()=>{Ie();Ho();Zx()});function eR(e){Xo(e,48,"Invalid PKCS#8 structure"),qo(e),Xo(e,2,"Expected version field");let t=qo(e);e.pos+=t,Xo(e,48,"Expected algorithm identifier");let r=qo(e);return{algIdStart:e.pos,algIdLength:r}}var xf,XN,Sf,qo,Xo,mS,QN,tR,nR,rR,fS,gS=y(()=>{Xm();Ie();hS();xf=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},XN=e=>({data:e,pos:0}),Sf=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},qo=e=>{let t=Sf(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|Sf(e);return o}return t},Xo=(e,t,r)=>{if(Sf(e)!==t)throw new Error(r)},mS=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},QN=e=>{Xo(e,6,"Expected algorithm OID");let t=qo(e);return mS(e,t)};tR=e=>{let t=QN(e);if(xf(t,[43,101,110]))return"X25519";if(!xf(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Xo(e,6,"Expected curve OID");let r=qo(e),o=mS(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(xf(o,i))return n;throw new Error("Unsupported named curve")},nR=async(e,t,r,o)=>{let n=pS(r);if(n.symmetric)throw new pe('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new pe("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},rR=(e,t)=>Os(e.replace(t,"")),fS=(e,t,r)=>{let o=rR(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=XN(i);return eR(a),tR(a)}),nR("pkcs8",o,t,n)}});function oR(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function iR(e){if(Hm(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:Ar(e)};if(!Tr(e))throw new TypeError(Ox(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=oR(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function $f(e){return iR(e)}var yS=y(()=>{Vm();Zo();Ym()});function aR(e){let t=typeof e=="string"?Ws(e):void 0;if(!t||t.symmetric)throw new pe('Unsupported "alg" value for a JSON Web Key Set');return t}function sR(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(cR)}function cR(e){return tt(e)}async function vS(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await Rs(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Bo("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Tf(e){let t=new Ef(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}var Ef,bS=y(()=>{rf();Ho();Ie();Qt();Ef=class{#e;#t=new WeakMap;constructor(t){if(!sR(t))throw new Bo("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=aR(o),a=this.#e.keys.filter(d=>{let u=i.kty.includes(d.kty);return u&&typeof n=="string"&&(u=n===d.kid),u&&(typeof d.alg=="string"||d.kty==="AKP")&&(u=o===d.alg),u&&typeof d.use=="string"&&(u=d.use==="sig"),u&&Array.isArray(d.key_ops)&&(u=d.key_ops.includes("verify")),u&&i.crv&&(u=d.crv===i.crv),u}),{0:s,length:c}=a;if(c===0)throw new Er;if(c!==1){let d=new Is,u=this.#t;throw d[Symbol.asyncIterator]=async function*(){for(let p of a)try{yield await vS(u,p,i)}catch{}},d}return vS(this.#t,s,i)}}});function lR(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function dR(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new Cs:i});if(n.status!==200)throw new ke("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new ke("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function uR(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!tt(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,tt))}function Cf(e,t){let r=new If(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var Af,wS,Ys,If,_S=y(()=>{Ie();bS();Qt();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Af="jose/v6.2.5");wS=Symbol();Ys=Symbol();If=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),Af&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",Af),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[wS],r?.[Ys]!==void 0&&(this.#s=r?.[Ys],uR(r?.[Ys],this.#c)&&(this.#i=this.#s.uat,this.#a=Tf(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof Er&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&lR()&&(this.#r=void 0),this.#r||=dR(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Tf(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}}});async function Pf(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return fS(e,t,r)}var kS=y(()=>{gS()});var Of=y(()=>{aS();dS();_S();yS();kS()});function pR(e){let t=xS.get(e);return t||(t=Cf(new URL(e)),xS.set(e,t)),t}function SS(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await kf(r,pR(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${hR}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var xS,hR,$S=y(()=>{"use strict";Of();_s();xS=new Map;hR="id:"});import{createPublicKey as mR,generateKeyPairSync as fR}from"node:crypto";async function Nf(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${qs}`,{privateKey:n,publicKey:i}=fR("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await Pf(n,"RS256"),s=await $f(mR(i)),c="gamestage-dev",d={keys:[{...s,kid:c,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:d,resolver:SS({issuer:r,jwksUri:o}),async mint(u,p={}){let h=Math.floor(Date.now()/1e3);return new Yo({name:u}).setProtectedHeader({alg:"RS256",kid:c}).setIssuer(r).setSubject(u).setIssuedAt(h).setExpirationTime(h+(p.expiresInSeconds??3600)).sign(a)}}}var qs,Rf=y(()=>{"use strict";Of();$S();qs="/.well-known/jwks.json"});import{createServer as gR}from"node:http";import{randomBytes as yR}from"node:crypto";async function bR(e){let t=kx({tenant:e.game,rounds:[],currentRoundId:""});await Wm(t,e.game,e.round,"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await Wm(t,e.game,n,`local-${o+2}`,!1,void 0,{source:"manifest"});let r=bx({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return wx({tenant:e.game,playerId:n.playerId??Uo(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function wR(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function Xs(e){let t=await bR(e),r=yR(32).toString("base64"),o={issue:()=>tx(r)},n=e.devIdentity,i=gR((a,s)=>{(async()=>{let c=new URL(a.url??"/","http://localhost");if(n&&c.pathname===qs){let h=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(h)}),s.end(h);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(c.pathname)){let h=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(h)}),s.end(h);return}let d=a.headers[vR],u=a.headers.authorization,p=await Tx({method:a.method??"GET",path:c.pathname,body:await wR(a),...(({playerId:h,refused:m})=>({playerId:h,identityRefusal:m}))(await Qk({token:u?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(d)?d[0]:d,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(p.status,p.headers),s.end(p.body===void 0?void 0:JSON.stringify(p.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}var vR,Df=y(()=>{"use strict";_x();Ss();xx();$x();Ax();_s();Rf();Rf();Ss();vR="x-gamestage-player"});import{spawn as _R}from"node:child_process";import{createHash as kR,randomBytes as TS}from"node:crypto";import{constants as xR}from"node:fs";import{access as SR,mkdtemp as $R,rm as AS}from"node:fs/promises";import{request as ER}from"node:http";import{homedir as Qs,tmpdir as TR}from"node:os";import{join as Qo}from"node:path";function Lf(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??TS(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}async function Ff(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??IR].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await SR(s,xR.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await $R(Qo(TR(),"gamestage-chrome-")),i=_R(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await PR(await CR(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:c}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await Uf.create(a,c,i,n)}}catch(s){throw a?.close(),await IS(i),await AS(n,{recursive:!0,force:!0}),s}}function CR(e,t){return new Promise((r,o)=>{let n="",i=u=>{clearTimeout(d),e.stderr?.off("data",a),e.off("error",s),e.off("close",c),u()},a=u=>{n=(n+u.toString("utf8")).slice(-4e3);let p=n.match(/DevTools listening on (ws:\/\/\S+)/);p&&i(()=>r(p[1]))},s=u=>i(()=>o(u)),c=u=>i(()=>o(new Error(`Chrome exited before DevTools was ready${u===null?"":` (code ${u})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",c);let d=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function PR(e){return new Promise((t,r)=>{let o=new URL(e),n=TS(16).toString("base64"),i=kR("sha1").update(n+AR).digest("base64"),a=ER({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,c,d)=>{s.headers["sec-websocket-accept"]!==i?(c.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new zf(c,d))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function IS(e){e.exitCode===null&&(e.kill("SIGTERM"),!await ES(e,1e3)&&(e.kill("SIGKILL"),await ES(e,1e3)))}function ES(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function jf(e){return new Promise(t=>setTimeout(t,e))}var AR,Mf,zf,Uf,IR,CS=y(()=>{"use strict";AR="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";Mf=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,c=n&127,d=2;if(c===126){if(this.buffered.length<d+2)break;c=this.buffered.readUInt16BE(d),d+=2}else if(c===127){if(this.buffered.length<d+8)break;let h=this.buffered.readBigUInt64BE(d);if(h>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");c=Number(h),d+=8}let u=d;if(s&&(d+=4),this.buffered.length<d+c)break;let p=Buffer.from(this.buffered.subarray(d,d+c));if(s)for(let h=0;h<p.length;h++)p[h]^=this.buffered[u+h%4];if(this.buffered=this.buffered.subarray(d+c),a===8||a===9||a===10)r.push({opcode:a,payload:p});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:p}):(this.fragmentedOpcode=a,this.fragments=[p])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(p),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},zf=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new Mf;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(Lf(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(Lf(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(Lf(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},Uf=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,c=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(c.split(`
8958
9330
  `)[0].replace(/^[A-Za-z]*Error:\s*/,""))}),this.on("Network.requestWillBeSent",a=>{let s=String(a.requestId);this.requests.set(s,a.request??{}),this.inflight.add(s),this.lastNetworkActivity=Date.now()});let i=a=>{this.inflight.delete(String(a.requestId)),this.lastNetworkActivity=Date.now()};this.on("Network.loadingFinished",i),this.on("Network.loadingFailed",i)}cdp;sessionId;child;profile;pageErrors=[];requests=new Map;inflight=new Set;lastNetworkActivity=Date.now();closed=!1;static async create(t,r,o,n){let i=new e(t,r,o,n);return await Promise.all([i.send("Page.enable"),i.send("Runtime.enable"),i.send("Network.enable")]),i}async addScriptToEvaluateOnNewDocument(t){await this.send("Page.addScriptToEvaluateOnNewDocument",{source:t})}async navigate(t,r=2e4){let o=Date.now()+r,n=this.waitForEvent("Page.loadEventFired",r,"page load"),i=await this.send("Page.navigate",{url:t});if(i.errorText)throw new Error(i.errorText);await n,await this.waitForNetworkIdle(Math.max(1,o-Date.now()))}query(t){return this.evaluate(`Array.from(document.querySelectorAll(${JSON.stringify(t)}), (_, index) => index)`)}isVisible(t,r){return this.evaluate(`(() => {
8959
9331
  const element = document.querySelectorAll(${JSON.stringify(t)})[${r}];
8960
9332
  if (!element) return false;
@@ -8972,59 +9344,63 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8972
9344
  if ("disabled" in element && element.disabled) return { ok: false, error: "Element is disabled." };
8973
9345
  element.click();
8974
9346
  return { ok: true };
8975
- })()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await Lf(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}async setOffline(t){await this.send("Network.emulateNetworkConditions",{offline:t,latency:0,downloadThroughput:-1,uploadThroughput:-1})}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=d=>{i||(i=!0,clearTimeout(l),s(),d())},s=this.on("Network.responseReceived",d=>{let u=String(d.requestId),p=this.requests.get(u);p?.url?.includes(t.urlIncludes)&&p.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(u,r))}))}),l=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await SS(this.child),await xS(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=d=>{clearTimeout(l),s(),d()},s=this.on(t,()=>a(n)),l=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await Lf(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await Lf(25)}throw n}},_R=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",qo(Xs(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),qo(Xs(),"Applications/Chromium.app/Contents/MacOS/Chromium"),qo(Xs(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),qo(Xs(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"]});function Ff(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function ES(e){let t=Ff(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||SR.test(t)||xR.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function TS(e){for(let t of $R)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function ER(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
9347
+ })()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await jf(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}async setOffline(t){await this.send("Network.emulateNetworkConditions",{offline:t,latency:0,downloadThroughput:-1,uploadThroughput:-1})}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=d=>{i||(i=!0,clearTimeout(c),s(),d())},s=this.on("Network.responseReceived",d=>{let u=String(d.requestId),p=this.requests.get(u);p?.url?.includes(t.urlIncludes)&&p.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(u,r))}))}),c=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await IS(this.child),await AS(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=d=>{clearTimeout(c),s(),d()},s=this.on(t,()=>a(n)),c=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await jf(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await jf(25)}throw n}},IR=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",Qo(Qs(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),Qo(Qs(),"Applications/Chromium.app/Contents/MacOS/Chromium"),Qo(Qs(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),Qo(Qs(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"]});function Gf(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function PS(e){let t=Gf(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||NR.test(t)||OR.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function OS(e){for(let t of RR)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function DR(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
8976
9348
  `.repeat(n.split(`
8977
9349
  `).length-1)).replace(/<style[\s\S]*?<\/style>/gi,n=>`
8978
9350
  `.repeat(n.split(`
8979
9351
  `).length-1)).split(`
8980
- `).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let l=s.replace(/\s+/g," ");if(!ES(l))continue;let d=Ff(l);t.push({text:d,...TS(d),file:e.relative,line:i+1})}}),t}function TR(e){let t=[];return e.text.split(`
8981
- `).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!ES(i))continue;let a=Ff(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...TS(a),file:e.relative,line:o+1})}}),t}function Qs(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...ER(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...TR(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}var xR,SR,$R,Bf=g(()=>{"use strict";xR=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],SR=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;$R=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}]});var zS={};nt(zS,{browserCheck:()=>PR,browserChecks:()=>RS,connectionCheck:()=>jS,runVerify:()=>Kf,scanPublishSet:()=>MS,verificationResult:()=>NS});import{readFile as Gf}from"node:fs/promises";import{dirname as AS,resolve as Wf}from"node:path";function AR(e){switch(e){case"hunt":return Ke.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Ke.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Ke.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"predict":return Ke.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function IR(e,t,r){return(ok({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=ch[i.key];return a?[[i.key,a]]:[]})}function NS(e){let t=e.filter(o=>o.status==="open").length,r=e.filter(o=>o.status==="skipped").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r}:{outcome:"verified",exitCode:0,open:t,skipped:r}}function Zf(e){return CR.map(t=>({...t,status:"skipped",detail:e}))}async function RS(e,t,r){let o;try{o=await Uf()}catch(i){return Zf("Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${i instanceof Error?i.message:""}`.trim())}if(o.status==="skipped")return Zf(o.detail);let n=o.browser;try{return[await LS(n,e,t,r),await jS(n,e)]}finally{await n.close().catch(()=>{})}}async function PR(e,t,r){let o;try{o=await Uf()}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${i instanceof Error?i.message:""}`.trim()}}if(o.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:o.detail};let n=o.browser;try{return await LS(n,e,t,r)}finally{await n.close().catch(()=>{})}}async function RR(e){let t=Date.now()+OR;do{if((await e.query(Xo)).length>0)return;let r=await e.query("[data-gamestage-start]:not([disabled])");for(let o of r)if(await e.isVisible("[data-gamestage-start]:not([disabled])",o))return o;await new Promise(o=>setTimeout(o,NR))}while(Date.now()<t)}async function DS(e){for(let t=0;t<3&&!((await e.query(Xo)).length>0);t++){let r=await RR(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(Xo,5e3).catch(()=>{})}}async function LS(e,t,r,o){try{await e.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(r)};window.GAMESTAGE_GAME = ${JSON.stringify(o)};`),await e.navigate(t,2e4),await DS(e);let n=await e.query(Xo);if(n.length===0){let h=e.pageErrors[0],f=await e.query("#prompt").then(()=>e.html()).then(x=>/id="prompt"[^>]*>([^<]{0,160})/.exec(x)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${h?` The page threw: ${h}`:f?` The page says: ${f}`:""}`}}let i=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),a=0;for(let h of n)if(await e.click(Xo,h).catch(()=>{}),a+=1,(await e.query(CS)).length>0)break;let s=await e.query(IS);if(s.length===0){let h=Symbol("pending"),f=await Promise.race([i,new Promise(b=>setTimeout(()=>b(h),5e3))]);if(f===h||f===void 0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${a} of ${n.length} on the board. The page has no Submit, which is allowed because a tap can be the play, but nothing reached the Engine either, so no play was made by any route.`}}else{if((await e.query(CS)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${a} of ${n.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await e.click(IS,s[0])}let l=await i;if(!l)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let d=await l.json();if(e.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${e.pageErrors[0]}`};let u=await e.html(),p=d.round_state?.score,m=p===void 0||u.includes(String(p))||u.includes(p.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:m?"verified":"open",detail:m?`The play went to the Engine and came back ${d.outcome}.`:`The Engine committed a score of ${p} and the page does not show it.`}}catch(n){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:n instanceof Error?n.message:"The page could not be played."}}}async function jS(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await DS(e);let n=await e.html();await e.setOffline(!0);let i=await PS(e,n,3e3);return i?(await e.setOffline(!1),await PS(e,i,3e3)?{id:r,what:o,status:"verified",detail:"Taken offline the page said so, and it recovered when the network returned."}:{id:r,what:o,status:"open",detail:"The page noticed the connection going and not it coming back: it was still in its offline state three seconds after the network returned. Listen for `online` as well, take the message down, and re-read the round rather than trusting what is on the screen."}):{id:r,what:o,status:"open",detail:"The connection was taken away and the page did not change. A fan who loses their signal is shown a game that still looks playable, and every tap on it is a tap the Engine never sees. Listen for the window's `offline` event and say so on the screen."}}catch(n){return{id:r,what:o,status:"open",detail:n instanceof Error?n.message:"The page could not be taken offline and back."}}finally{await e.setOffline(!1).catch(()=>{})}}async function PS(e,t,r){let o=Date.now()+r;for(;Date.now()<o;){let n=await e.html().catch(()=>t);if(n!==t)return n;await new Promise(i=>setTimeout(i,100))}}function LR(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>DR.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function OS(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function MS(e,t){let{files:r,skippedLinks:o}=Ah(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let l=LR(s.relativePath);if(l){i.has(l)||(i.add(l),n.push({path:`${l}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if($h(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let d=await jo(s.path);if(d===void 0)continue;a+=1;let u=ie(d);if(u.ok&&u.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let p=_r(d,t);if(p.length){n.push({path:s.relativePath,why:wr(t,p),fatal:!0});continue}let m;try{let h=JSON.parse(d);h&&Array.isArray(h.sourcesContent)&&(m=h)}catch{}if(m){let h=m.sourcesContent.filter(b=>typeof b=="string").join(`
8982
- `),f=h?_r(h,t):[];if(f.length){n.push({path:s.relativePath,why:`${wr(t,f)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}OS(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)OS(s.relativePath)&&!n.some(l=>l.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function Kf(e){await Oo();let t=e.manifest??"gamestage.yaml",r;try{let F=ie(await Gf(t,"utf8"));if(!F.ok)return O(`${t} is not a valid App Manifest.`,F.issues.map(Le=>`${$.cyan(Le.path)} ${Le.message}`));r=F.manifest}catch{return O(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let o=r.backend.round??AR(r.backend.archetype),n=r.backend.round?{source:"manifest",archetype:o.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:o.archetype,detail:`The manifest carries no round, so the Engine used a representative ${o.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!kn.includes(o.archetype))return O(`No Engine here serves the ${o.archetype} archetype yet.`,[`Built so far: ${kn.join(", ")}.`]);let i=Wf(e.file??"index.html"),a;try{a=await Gf(i,"utf8")}catch{return O(`Cannot read ${e.file??"index.html"}.`)}let s=[];s.push({id:"round-is-the-games-own",what:"the round played here was this game's own",status:n.source==="manifest"?"verified":"skipped",detail:n.source==="manifest"?void 0:"This game keeps its content in Studio, which is where it belongs, so there is no round here to play and this check cannot run. That is a limit of checking locally rather than anything wrong with the game. Play the deployed game to prove its round."});let l=Wf(e.dir??AS(i)),d;try{d=await MS(l,o)}catch(F){return O(`Cannot read the publish set at ${e.dir??AS(i)}.`,[F instanceof Error?F.message:"The directory could not be walked."])}let u=d.findings.filter(F=>F.fatal),p=_r(a,o),m=p.length>0||u.length>0;s.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${d.files.length} file${d.files.length===1?"":"s"}, ${d.read} read)`,status:m?"open":"verified",detail:m?[p.length?wr(o,p):void 0,...u.map(F=>`${F.path}: ${F.why}`)].filter(Boolean).join(" "):void 0});let h=await vs(d.files),f=h.map(F=>F.text).join(`
8983
- `),b=ps(f),x=IR(r,o.archetype,b).filter(([,F])=>!lh(f,F)).map(([F])=>F);s.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(b.length?`, and it offers ${b.length} more for controls it has (${b.join(", ")})`:""),status:x.length?"open":"verified",detail:x.length?`The page does not read: ${x.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let k=Qs(h),T=d.files.some(F=>{let Le=F.relativePath.split("/").pop();return Le===se||Le===ke})||a.includes(se)||a.includes(ke),L=a.includes("createPlayerClient")||/\bstart\s*\(/.test(a);s.push({id:"client-present",what:"the client the page imports is there",status:T||!L?"verified":"open",detail:L&&!T?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let V=["@monterosa/sdk-core","@monterosa/sdk-connect-kit","@monterosa/sdk-consent-kit","@monterosa/sdk-storage-kit","@monterosa/sdk-analytics-kit","@monterosa/sdk-interact-kit","@monterosa/sdk-identify-kit","@monterosa/sdk-util"].filter(F=>f.includes(F));s.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:V.length===0?"verified":"open",detail:V.length===0?void 0:`This game imports ${V.join(", ")} directly. The Gamestage client is the only supported way to reach Interaction Cloud: it holds the connection, the consent gate and the server clock, and a second one beside it has none of them. Use what \`start()\` returns instead, and say what is missing from it if something is.`});let Z=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test(f),te=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test(f);s.push({id:"server-time",what:"a deadline comes from the server's clock",status:Z&&te?"skipped":"verified",detail:Z&&te?"This game reads the device clock somewhere and handles a round's timing somewhere, and this check reads the bundle as one string, so it cannot tell whether those are the same code. Worth your eyes: a lock or a countdown decided by the device clock is a deadline a fan can move by changing their clock. Use `game.now()`, which is the server's time through the client. `Date.now()` is fine for anything that decides nothing, like an animation or an analytics timestamp.":void 0});let en=await qs({game:r.app.id,round:o,title:r.app.title});await new Promise(F=>en.listen(0,"127.0.0.1",()=>F()));let Q=en.address(),De=Q&&typeof Q!="string"?`http://127.0.0.1:${Q.port}`:"",$n=await import("node:http").then(({createServer:F})=>F(async(Le,oc)=>{let rg=(Le.url??"/").split("?")[0],og=rg==="/"?i:Wf(i,"..",rg.slice(1));try{let P$=await Gf(og);oc.writeHead(200,{"content-type":og.endsWith(".js")?"text/javascript":"text/html"}),oc.end(P$)}catch{oc.writeHead(404).end()}}));await new Promise(F=>$n.listen(0,"127.0.0.1",()=>F()));let En=$n.address(),ti=En&&typeof En!="string"?`http://127.0.0.1:${En.port}/`:"";try{s.push(...e.noBrowser?Zf("Asked not to open a browser."):await RS(ti,De,r.app.id))}finally{en.close(),$n.close()}let me=NS(s),Ie=d.findings.filter(F=>!F.fatal);if(j()){U({ok:me.outcome==="verified",outcome:me.outcome,exitCode:me.exitCode,checks:s,open:me.open,skipped:me.skipped,round:n,copy_candidates:k,publish_set:{directory:l,files:d.files.map(F=>F.relativePath),read:d.read,warnings:Ie}}),me.exitCode!==0&&process.exit(me.exitCode);return}R(me.outcome==="verified"?"Verified":me.outcome==="failed"?"Verification failed":"Verification incomplete"),P("round used for verification",n.source),y(` ${$.dim(n.detail)}`);for(let F of s){let Le=F.status==="verified"?$.green("ok"):F.status==="open"?$.yellow("open"):$.dim("skipped");P(F.what,Le),F.detail&&y(` ${$.dim(F.detail)}`)}if(Ie.length){y(),y($.dim(" Also in the publish set, and a deploy would upload it:"));for(let F of Ie)y(` ${$.dim("\xB7")} ${$.cyan(F.path)} ${$.dim(F.why)}`)}if(k.length){y(),y($.dim(" Copy a producer may need to own:"));for(let F of k)y(` ${$.dim("\xB7")} ${$.cyan(`${F.file}:${F.line}`)} ${F.text} ${$.dim(`(${F.confidence}, ${F.level})`)}`)}y(),me.outcome==="verified"?S("The Engine decided the outcome and the page showed it. That is the migration done."):me.outcome==="failed"?S("A check remains open, so the game failed verification. Read the open check and fix its cause."):S("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),y(),me.exitCode!==0&&process.exit(me.exitCode)}var Xo,IS,CS,CR,OR,NR,DR,Vf=g(()=>{"use strict";ae();Rf();dt();Et();$S();Th();Bf();Ch();ys();de();Xo="button.pick, [data-pick]",IS="#submit, button[type=submit], .submit",CS="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",CR=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];OR=15e3,NR=250;DR=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var St=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},tn=class extends St{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Or=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new tn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ni(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as L$}from"node:events";import ac from"node:child_process";import pt from"node:path";import oi from"node:fs";import K from"node:process";import{stripVTControlCharacters as j$}from"node:util";import{stripVTControlCharacters as N$}from"node:util";var Nr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>ni(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(p,m){return r.formatItem(p,o,m,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let l=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(a=a.concat(this.formatItemList("Arguments:",l,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,m)=>{let h=p.map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList(m,h,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));a=a.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,m)=>{let h=p.map(f=>i(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));a=a.concat(this.formatItemList(m,h,r))}),a.join(`
8984
- `)}displayWidth(t){return N$(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),l=2,u=(this.helpWidth??80)-r-l-2,p;return u<this.minWidthToWrap||n.preformatted(o)?p=o:p=n.boxWrap(o,u).replace(/\n/g,`
8985
- `+" ".repeat(r+l)),a+s+" ".repeat(l)+p.replace(/\n/g,`
8986
- ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,i=[];return o.forEach(a=>{let s=a.match(n);if(s===null){i.push("");return}let l=[s.shift()],d=this.displayWidth(l[0]);s.forEach(u=>{let p=this.displayWidth(u);if(d+p<=r){l.push(u),d+=p;return}i.push(l.join(""));let m=u.trimStart();l=[m],d=this.displayWidth(m)}),i.push(l.join(""))}),i.join(`
8987
- `)}};var Tn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=R$(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new tn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?ig(this.name().replace(/^no-/,"")):ig(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ri=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function ig(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function R$(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
9352
+ `).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let c=s.replace(/\s+/g," ");if(!PS(c))continue;let d=Gf(c);t.push({text:d,...OS(d),file:e.relative,line:i+1})}}),t}function LR(e){let t=[];return e.text.split(`
9353
+ `).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!PS(i))continue;let a=Gf(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...OS(a),file:e.relative,line:o+1})}}),t}function ec(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...DR(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...LR(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}var OR,NR,RR,Bf=y(()=>{"use strict";OR=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],NR=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;RR=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}]});var WS={};nt(WS,{browserCheck:()=>UR,browserChecks:()=>zS,connectionCheck:()=>GS,runVerify:()=>Vf,scanPublishSet:()=>BS,verificationResult:()=>MS});import{readFile as Wf}from"node:fs/promises";import{dirname as NS,resolve as Zf}from"node:path";function jR(e){switch(e){case"hunt":return Ke.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Ke.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Ke.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"predict":return Ke.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function MR(e,t,r){return(ak({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=dm[i.key];return a?[[i.key,a]]:[]})}function MS(e){let t=e.filter(o=>o.status==="open").length,r=e.filter(o=>o.status==="skipped").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r}:{outcome:"verified",exitCode:0,open:t,skipped:r}}function Kf(e){return zR.map(t=>({...t,status:"skipped",detail:e}))}async function zS(e,t,r){let o;try{o=await Ff()}catch(i){return Kf("Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${i instanceof Error?i.message:""}`.trim())}if(o.status==="skipped")return Kf(o.detail);let n=o.browser;try{return[await FS(n,e,t,r),await GS(n,e)]}finally{await n.close().catch(()=>{})}}async function UR(e,t,r){let o;try{o=await Ff()}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${i instanceof Error?i.message:""}`.trim()}}if(o.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:o.detail};let n=o.browser;try{return await FS(n,e,t,r)}finally{await n.close().catch(()=>{})}}async function BR(e){let t=Date.now()+FR;do{if((await e.query(ei)).length>0)return;let r=await e.query("[data-gamestage-start]:not([disabled])");for(let o of r)if(await e.isVisible("[data-gamestage-start]:not([disabled])",o))return o;await new Promise(o=>setTimeout(o,GR))}while(Date.now()<t)}async function US(e){for(let t=0;t<3&&!((await e.query(ei)).length>0);t++){let r=await BR(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(ei,5e3).catch(()=>{})}}async function FS(e,t,r,o){try{await e.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(r)};window.GAMESTAGE_GAME = ${JSON.stringify(o)};`),await e.navigate(t,2e4),await US(e);let n=await e.query(ei);if(n.length===0){let m=e.pageErrors[0],f=await e.query("#prompt").then(()=>e.html()).then(x=>/id="prompt"[^>]*>([^<]{0,160})/.exec(x)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${m?` The page threw: ${m}`:f?` The page says: ${f}`:""}`}}let i=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),a=0;for(let m of n)if(await e.click(ei,m).catch(()=>{}),a+=1,(await e.query(DS)).length>0)break;let s=await e.query(RS);if(s.length===0){let m=Symbol("pending"),f=await Promise.race([i,new Promise(b=>setTimeout(()=>b(m),5e3))]);if(f===m||f===void 0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${a} of ${n.length} on the board. The page has no Submit, which is allowed because a tap can be the play, but nothing reached the Engine either, so no play was made by any route.`}}else{if((await e.query(DS)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${a} of ${n.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await e.click(RS,s[0])}let c=await i;if(!c)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let d=await c.json();if(e.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${e.pageErrors[0]}`};let u=await e.html(),p=d.round_state?.score,h=p===void 0||u.includes(String(p))||u.includes(p.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:h?"verified":"open",detail:h?`The play went to the Engine and came back ${d.outcome}.`:`The Engine committed a score of ${p} and the page does not show it.`}}catch(n){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:n instanceof Error?n.message:"The page could not be played."}}}async function GS(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await US(e);let n=await e.html();await e.setOffline(!0);let i=await LS(e,n,3e3);return i?(await e.setOffline(!1),await LS(e,i,3e3)?{id:r,what:o,status:"verified",detail:"Taken offline the page said so, and it recovered when the network returned."}:{id:r,what:o,status:"open",detail:"The page noticed the connection going and not it coming back: it was still in its offline state three seconds after the network returned. Listen for `online` as well, take the message down, and re-read the round rather than trusting what is on the screen."}):{id:r,what:o,status:"open",detail:"The connection was taken away and the page did not change. A fan who loses their signal is shown a game that still looks playable, and every tap on it is a tap the Engine never sees. Listen for the window's `offline` event and say so on the screen."}}catch(n){return{id:r,what:o,status:"open",detail:n instanceof Error?n.message:"The page could not be taken offline and back."}}finally{await e.setOffline(!1).catch(()=>{})}}async function LS(e,t,r){let o=Date.now()+r;for(;Date.now()<o;){let n=await e.html().catch(()=>t);if(n!==t)return n;await new Promise(i=>setTimeout(i,100))}}function ZR(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>WR.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function jS(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function BS(e,t){let{files:r,skippedLinks:o}=Cm(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let c=ZR(s.relativePath);if(c){i.has(c)||(i.add(c),n.push({path:`${c}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(Tm(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let d=await zo(s.path);if(d===void 0)continue;a+=1;let u=ie(d);if(u.ok&&u.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let p=kr(d,t);if(p.length){n.push({path:s.relativePath,why:xr(t,p),fatal:!0});continue}let h;try{let m=JSON.parse(d);m&&Array.isArray(m.sourcesContent)&&(h=m)}catch{}if(h){let m=h.sourcesContent.filter(b=>typeof b=="string").join(`
9354
+ `),f=m?kr(m,t):[];if(f.length){n.push({path:s.relativePath,why:`${xr(t,f)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}jS(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)jS(s.relativePath)&&!n.some(c=>c.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function Vf(e){await Ro();let t=e.manifest??"gamestage.yaml",r;try{let F=ie(await Wf(t,"utf8"));if(!F.ok)return O(`${t} is not a valid App Manifest.`,F.issues.map(Me=>`${$.cyan(Me.path)} ${Me.message}`));r=F.manifest}catch{return O(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let o=r.backend.round??jR(r.backend.archetype),n=r.backend.round?{source:"manifest",archetype:o.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:o.archetype,detail:`The manifest carries no round, so the Engine used a representative ${o.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!xn.includes(o.archetype))return O(`No Engine here serves the ${o.archetype} archetype yet.`,[`Built so far: ${xn.join(", ")}.`]);let i=Zf(e.file??"index.html"),a;try{a=await Wf(i,"utf8")}catch{return O(`Cannot read ${e.file??"index.html"}.`)}let s=[];s.push({id:"round-is-the-games-own",what:"the round played here was this game's own",status:n.source==="manifest"?"verified":"skipped",detail:n.source==="manifest"?void 0:"This game keeps its content in Studio, which is where it belongs, so there is no round here to play and this check cannot run. That is a limit of checking locally rather than anything wrong with the game. Play the deployed game to prove its round."});let c=Zf(e.dir??NS(i)),d;try{d=await BS(c,o)}catch(F){return O(`Cannot read the publish set at ${e.dir??NS(i)}.`,[F instanceof Error?F.message:"The directory could not be walked."])}let u=d.findings.filter(F=>F.fatal),p=kr(a,o),h=p.length>0||u.length>0;s.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${d.files.length} file${d.files.length===1?"":"s"}, ${d.read} read)`,status:h?"open":"verified",detail:h?[p.length?xr(o,p):void 0,...u.map(F=>`${F.path}: ${F.why}`)].filter(Boolean).join(" "):void 0});let m=await bs(d.files),f=m.map(F=>F.text).join(`
9355
+ `),b=hs(f),x=MR(r,o.archetype,b).filter(([,F])=>!um(f,F)).map(([F])=>F);s.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(b.length?`, and it offers ${b.length} more for controls it has (${b.join(", ")})`:""),status:x.length?"open":"verified",detail:x.length?`The page does not read: ${x.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let k=ec(m),T=d.files.some(F=>{let Me=F.relativePath.split("/").pop();return Me===se||Me===xe})||a.includes(se)||a.includes(xe),L=a.includes("createPlayerClient")||/\bstart\s*\(/.test(a);s.push({id:"client-present",what:"the client the page imports is there",status:T||!L?"verified":"open",detail:L&&!T?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let K=["@monterosa/sdk-core","@monterosa/sdk-connect-kit","@monterosa/sdk-consent-kit","@monterosa/sdk-storage-kit","@monterosa/sdk-analytics-kit","@monterosa/sdk-interact-kit","@monterosa/sdk-identify-kit","@monterosa/sdk-util"].filter(F=>f.includes(F));s.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:K.length===0?"verified":"open",detail:K.length===0?void 0:`This game imports ${K.join(", ")} directly. The Gamestage client is the only supported way to reach Interaction Cloud: it holds the connection, the consent gate and the server clock, and a second one beside it has none of them. Use what \`start()\` returns instead, and say what is missing from it if something is.`});let Z=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test(f),te=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test(f);s.push({id:"server-time",what:"a deadline comes from the server's clock",status:Z&&te?"skipped":"verified",detail:Z&&te?"This game reads the device clock somewhere and handles a round's timing somewhere, and this check reads the bundle as one string, so it cannot tell whether those are the same code. Worth your eyes: a lock or a countdown decided by the device clock is a deadline a fan can move by changing their clock. Use `game.now()`, which is the server's time through the client. `Date.now()` is fine for anything that decides nothing, like an animation or an analytics timestamp.":void 0});let nn=await Xs({game:r.app.id,round:o,title:r.app.title});await new Promise(F=>nn.listen(0,"127.0.0.1",()=>F()));let Q=nn.address(),je=Q&&typeof Q!="string"?`http://127.0.0.1:${Q.port}`:"",En=await import("node:http").then(({createServer:F})=>F(async(Me,ic)=>{let og=(Me.url??"/").split("?")[0],ig=og==="/"?i:Zf(i,"..",og.slice(1));try{let F$=await Wf(ig);ic.writeHead(200,{"content-type":ig.endsWith(".js")?"text/javascript":"text/html"}),ic.end(F$)}catch{ic.writeHead(404).end()}}));await new Promise(F=>En.listen(0,"127.0.0.1",()=>F()));let Tn=En.address(),ri=Tn&&typeof Tn!="string"?`http://127.0.0.1:${Tn.port}/`:"";try{s.push(...e.noBrowser?Kf("Asked not to open a browser."):await zS(ri,je,r.app.id))}finally{nn.close(),En.close()}let he=MS(s),Ce=d.findings.filter(F=>!F.fatal);if(j()){U({ok:he.outcome==="verified",outcome:he.outcome,exitCode:he.exitCode,checks:s,open:he.open,skipped:he.skipped,round:n,copy_candidates:k,publish_set:{directory:c,files:d.files.map(F=>F.relativePath),read:d.read,warnings:Ce}}),he.exitCode!==0&&process.exit(he.exitCode);return}N(he.outcome==="verified"?"Verified":he.outcome==="failed"?"Verification failed":"Verification incomplete"),P("round used for verification",n.source),g(` ${$.dim(n.detail)}`);for(let F of s){let Me=F.status==="verified"?$.green("ok"):F.status==="open"?$.yellow("open"):$.dim("skipped");P(F.what,Me),F.detail&&g(` ${$.dim(F.detail)}`)}if(Ce.length){g(),g($.dim(" Also in the publish set, and a deploy would upload it:"));for(let F of Ce)g(` ${$.dim("\xB7")} ${$.cyan(F.path)} ${$.dim(F.why)}`)}if(k.length){g(),g($.dim(" Copy a producer may need to own:"));for(let F of k)g(` ${$.dim("\xB7")} ${$.cyan(`${F.file}:${F.line}`)} ${F.text} ${$.dim(`(${F.confidence}, ${F.level})`)}`)}g(),he.outcome==="verified"?S("The Engine decided the outcome and the page showed it. That is the migration done."):he.outcome==="failed"?S("A check remains open, so the game failed verification. Read the open check and fix its cause."):S("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),g(),he.exitCode!==0&&process.exit(he.exitCode)}var ei,RS,DS,zR,FR,GR,WR,Hf=y(()=>{"use strict";ae();Df();dt();Tt();CS();Im();Bf();Om();vs();de();ei="button.pick, [data-pick]",RS="#submit, button[type=submit], .submit",DS="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",zR=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];FR=15e3,GR=250;WR=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var $t=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},rn=class extends $t{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Dr=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new rn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function oi(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as K$}from"node:events";import sc from"node:child_process";import pt from"node:path";import ai from"node:fs";import V from"node:process";import{stripVTControlCharacters as V$}from"node:util";import{stripVTControlCharacters as B$}from"node:util";var Lr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>oi(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(p,h){return r.formatItem(p,o,h,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let c=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,h)=>{let m=p.map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList(h,m,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(h=>i(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,h)=>{let m=p.map(f=>i(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));a=a.concat(this.formatItemList(h,m,r))}),a.join(`
9356
+ `)}displayWidth(t){return B$(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),c=2,u=(this.helpWidth??80)-r-c-2,p;return u<this.minWidthToWrap||n.preformatted(o)?p=o:p=n.boxWrap(o,u).replace(/\n/g,`
9357
+ `+" ".repeat(r+c)),a+s+" ".repeat(c)+p.replace(/\n/g,`
9358
+ ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,i=[];return o.forEach(a=>{let s=a.match(n);if(s===null){i.push("");return}let c=[s.shift()],d=this.displayWidth(c[0]);s.forEach(u=>{let p=this.displayWidth(u);if(d+p<=r){c.push(u),d+=p;return}i.push(c.join(""));let h=u.trimStart();c=[h],d=this.displayWidth(h)}),i.push(c.join(""))}),i.join(`
9359
+ `)}};var An=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=W$(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new rn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?ag(this.name().replace(/^no-/,"")):ag(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ii=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function ag(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function W$(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
8988
9360
  - a short flag is a single dash and a single character
8989
9361
  - either use a single dash and a single character (for a short flag)
8990
9362
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(a)?new Error(`${s}
8991
9363
  - too many short flags`):n.test(a)?new Error(`${s}
8992
9364
  - too many long flags`):new Error(`${s}
8993
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function D$(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function ic(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=D$(e,a),l=Math.max(e.length,a.length);(l-s)/l>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
9365
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function Z$(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function ac(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=Z$(e,a),c=Math.max(e.length,a.length);(c-s)/c>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
8994
9366
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
8995
- (Did you mean ${o[0]}?)`:""}var An=class e extends L${constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>K.stdout.write(r),writeErr:r=>K.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>K.stdout.isTTY?K.stdout.columns:void 0,getErrHelpWidth:()=>K.stderr.isTTY?K.stderr.columns:void 0,getOutHasColors:()=>sg()??(K.stdout.isTTY&&K.stdout.hasColors?.()),getErrHasColors:()=>sg()??(K.stderr.isTTY&&K.stderr.hasColors?.()),stripColor:r=>j$(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(a);return n&&(l.description(n),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,s&&l.arguments(s),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),n?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Nr,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
8996
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Or(t,r)}argument(t,r,o,n){let i=this.createArgument(t,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let o=t??"help [command]",[,n,i]=o.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(t||r)&&this._initCommandGroup(s),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
8997
- Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new St(t,r,o)),K.exit(t)}action(t){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new Tn(t,r)}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let a=`${n} ${i.message}`;this.error(a,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
8998
- - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),o=r(t).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let n=(i,a,s)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let l=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,l,a):i!==null&&t.variadic&&(i=t._collectValue(i,l)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,s)};return this.on("option:"+r,i=>{let a=`error: option '${t.flags}' argument '${i}' is invalid.`;n(i,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let a=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;n(i,a,"env")}),this}_optionEx(t,r,o,n,i){if(typeof r=="object"&&r instanceof Tn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,o);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(i).argParser(n);else if(n instanceof RegExp){let s=n;n=(l,d)=>{let u=s.exec(l);return u?u[0]:d},a.default(i).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,o,n){return this._optionEx({},t,r,o,n)}requiredOption(t,r,o,n){return this._optionEx({mandatory:!0},t,r,o,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){K.versions?.electron&&(r.from="electron");let n=K.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=K.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":K.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
8999
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(oi.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
9367
+ (Did you mean ${o[0]}?)`:""}var In=class e extends K${constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>V.stdout.write(r),writeErr:r=>V.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>V.stdout.isTTY?V.stdout.columns:void 0,getErrHelpWidth:()=>V.stderr.isTTY?V.stderr.columns:void 0,getOutHasColors:()=>cg()??(V.stdout.isTTY&&V.stdout.hasColors?.()),getErrHasColors:()=>cg()??(V.stderr.isTTY&&V.stderr.hasColors?.()),stripColor:r=>V$(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return n&&(c.description(n),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,s&&c.arguments(s),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Lr,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
9368
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Dr(t,r)}argument(t,r,o,n){let i=this.createArgument(t,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let o=t??"help [command]",[,n,i]=o.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(t||r)&&this._initCommandGroup(s),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
9369
+ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new $t(t,r,o)),V.exit(t)}action(t){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new An(t,r)}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let a=`${n} ${i.message}`;this.error(a,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
9370
+ - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),o=r(t).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let n=(i,a,s)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,a):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,s)};return this.on("option:"+r,i=>{let a=`error: option '${t.flags}' argument '${i}' is invalid.`;n(i,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let a=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;n(i,a,"env")}),this}_optionEx(t,r,o,n,i){if(typeof r=="object"&&r instanceof An)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,o);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(i).argParser(n);else if(n instanceof RegExp){let s=n;n=(c,d)=>{let u=s.exec(c);return u?u[0]:d},a.default(i).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,o,n){return this._optionEx({},t,r,o,n)}requiredOption(t,r,o,n){return this._optionEx({mandatory:!0},t,r,o,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){V.versions?.electron&&(r.from="electron");let n=V.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=V.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":V.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
9371
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(ai.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
9000
9372
  - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
9001
9373
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
9002
- - ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(u,p){let m=pt.resolve(u,p);if(oi.existsSync(m))return m;if(o.includes(pt.extname(p)))return;let h=o.find(f=>oi.existsSync(`${m}${f}`));if(h)return`${m}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=oi.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=pt.resolve(pt.dirname(u),a)}if(a){let u=n(a,i);if(!u&&!t._executableFile&&this._scriptPath){let p=pt.basename(this._scriptPath,pt.extname(this._scriptPath));p!==this._name&&(u=n(a,`${p}-${t._name}`))}i=u||i}let s=o.includes(pt.extname(i)),l;K.platform!=="win32"?s?(r.unshift(i),r=ag(K.execArgv).concat(r),l=ac.spawn(K.argv[0],r,{stdio:"inherit"})):l=ac.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=ag(K.execArgv).concat(r),l=ac.spawn(K.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{K.on(p,()=>{l.killed===!1&&l.exitCode===null&&l.kill(p)})});let d=this._exitCallback;l.on("close",u=>{u=u??1,d?d(new St(u,"commander.executeSubCommandAsync","(close)")):K.exit(u)}),l.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(i,a,t._name);else if(u.code==="EACCES")throw new Error(`'${i}' not executable`);if(!d)K.exit(1);else{let p=new St(1,"commander.executeSubCommandAsync","(error)");p.nestedError=u,d(p)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,n,"preSubcommand"),i=this._chainOrCall(i,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(o));else return n._parseCommand(r,o)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,n,i)=>{let a=n;if(n!==null&&o.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${o.name()}'.`;a=this._callParseArg(o,n,i,s)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,n)=>{let i=o.defaultValue;o.variadic?n<this.args.length?(i=this.args.slice(n),o.parseArg&&(i=i.reduce((a,s)=>t(o,s,a),o.defaultValue))):i===void 0&&(i=[]):n<this.args.length&&(i=this.args[n],o.parseArg&&(i=t(o,i,o.defaultValue))),r[n]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,n=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:i,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(i=>{o=this._chainOrCall(o,()=>i.callback(i.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let n=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(i=>{n=this._chainOrCall(n,()=>i(this,r))}),n}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(i,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(i))n(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let n=o.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let n=t.find(i=>o.conflictsWith.includes(i.attributeName()));n&&this._conflictingOption(o,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],n=r;function i(u){return u.length>1&&u[0]==="-"}let a=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(p=>p.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,s=null,l=null,d=0;for(;d<t.length||l;){let u=l??t[d++];if(l=null,u==="--"){n===o&&n.push(u),n.push(...t.slice(d));break}if(s&&(!i(u)||a(u))){this.emit(`option:${s.name()}`,u);continue}if(s=null,i(u)){let p=this._findOption(u);if(p){if(p.required){let m=t[d++];m===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,m)}else if(p.optional){let m=null;d<t.length&&(!i(t[d])||a(t[d]))&&(m=t[d++]),this.emit(`option:${p.name()}`,m)}else this.emit(`option:${p.name()}`);s=p.variadic?p:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let p=this._findOption(`-${u[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,u.slice(2)):(this.emit(`option:${p.name()}`),l=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let p=u.indexOf("="),m=this._findOption(u.slice(0,p));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,u.slice(p+1));continue}}if(n===r&&i(u)&&!(this.commands.length===0&&a(u))&&(n=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(u)){r.push(u),o.push(...t.slice(d));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...t.slice(d));break}else if(this._defaultCommandName){o.push(u,...t.slice(d));break}}if(this._passThroughOptions){n.push(u,...t.slice(d));break}n.push(u)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let n=this.options[o].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
9374
+ - ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(u,p){let h=pt.resolve(u,p);if(ai.existsSync(h))return h;if(o.includes(pt.extname(p)))return;let m=o.find(f=>ai.existsSync(`${h}${f}`));if(m)return`${h}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=ai.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=pt.resolve(pt.dirname(u),a)}if(a){let u=n(a,i);if(!u&&!t._executableFile&&this._scriptPath){let p=pt.basename(this._scriptPath,pt.extname(this._scriptPath));p!==this._name&&(u=n(a,`${p}-${t._name}`))}i=u||i}let s=o.includes(pt.extname(i)),c;V.platform!=="win32"?s?(r.unshift(i),r=sg(V.execArgv).concat(r),c=sc.spawn(V.argv[0],r,{stdio:"inherit"})):c=sc.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=sg(V.execArgv).concat(r),c=sc.spawn(V.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{V.on(p,()=>{c.killed===!1&&c.exitCode===null&&c.kill(p)})});let d=this._exitCallback;c.on("close",u=>{u=u??1,d?d(new $t(u,"commander.executeSubCommandAsync","(close)")):V.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(i,a,t._name);else if(u.code==="EACCES")throw new Error(`'${i}' not executable`);if(!d)V.exit(1);else{let p=new $t(1,"commander.executeSubCommandAsync","(error)");p.nestedError=u,d(p)}}),this.runningCommand=c}_dispatchSubcommand(t,r,o){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,n,"preSubcommand"),i=this._chainOrCall(i,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(o));else return n._parseCommand(r,o)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,n,i)=>{let a=n;if(n!==null&&o.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${o.name()}'.`;a=this._callParseArg(o,n,i,s)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,n)=>{let i=o.defaultValue;o.variadic?n<this.args.length?(i=this.args.slice(n),o.parseArg&&(i=i.reduce((a,s)=>t(o,s,a),o.defaultValue))):i===void 0&&(i=[]):n<this.args.length&&(i=this.args[n],o.parseArg&&(i=t(o,i,o.defaultValue))),r[n]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,n=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:i,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(i=>{o=this._chainOrCall(o,()=>i.callback(i.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let n=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(i=>{n=this._chainOrCall(n,()=>i(this,r))}),n}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(i,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(i))n(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let n=o.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let n=t.find(i=>o.conflictsWith.includes(i.attributeName()));n&&this._conflictingOption(o,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],n=r;function i(u){return u.length>1&&u[0]==="-"}let a=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(p=>p.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):!1,s=null,c=null,d=0;for(;d<t.length||c;){let u=c??t[d++];if(c=null,u==="--"){n===o&&n.push(u),n.push(...t.slice(d));break}if(s&&(!i(u)||a(u))){this.emit(`option:${s.name()}`,u);continue}if(s=null,i(u)){let p=this._findOption(u);if(p){if(p.required){let h=t[d++];h===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,h)}else if(p.optional){let h=null;d<t.length&&(!i(t[d])||a(t[d]))&&(h=t[d++]),this.emit(`option:${p.name()}`,h)}else this.emit(`option:${p.name()}`);s=p.variadic?p:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let p=this._findOption(`-${u[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,u.slice(2)):(this.emit(`option:${p.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let p=u.indexOf("="),h=this._findOption(u.slice(0,p));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,u.slice(p+1));continue}}if(n===r&&i(u)&&!(this.commands.length===0&&a(u))&&(n=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(u)){r.push(u),o.push(...t.slice(d));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...t.slice(d));break}else if(this._defaultCommandName){o.push(u,...t.slice(d));break}}if(this._passThroughOptions){n.push(u,...t.slice(d));break}n.push(u)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let n=this.options[o].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
9003
9375
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
9004
9376
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
9005
- `),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in K.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,K.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ri(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=a=>{let s=a.attributeName(),l=this.getOptionValue(s),d=this.options.find(p=>p.negate&&s===p.attributeName()),u=this.options.find(p=>!p.negate&&s===p.attributeName());return d&&(d.presetArg===void 0&&l===!1||d.presetArg!==void 0&&l===d.presetArg)?d:u||a},n=a=>{let s=o(a),l=s.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);n=n.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=ic(t,n)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",n=t.length,i=this.parent?` for '${this.name()}'`:"",a=t.join(", "),s=`error: too many arguments${i}. Expected ${r} argument${o} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=ic(t,n)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
9006
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>ni(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=pt.basename(t,pt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let n=r.formatHelp(this,r);return o.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,o,n,i;return r?(o=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(o=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),o(s)),hasColors:n,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),n={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation({error:o.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(K.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
9377
+ `),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in V.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,V.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ii(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=a=>{let s=a.attributeName(),c=this.getOptionValue(s),d=this.options.find(p=>p.negate&&s===p.attributeName()),u=this.options.find(p=>!p.negate&&s===p.attributeName());return d&&(d.presetArg===void 0&&c===!1||d.presetArg!==void 0&&c===d.presetArg)?d:u||a},n=a=>{let s=o(a),c=s.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);n=n.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=ac(t,n)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",n=t.length,i=this.parent?` for '${this.name()}'`:"",a=t.join(", "),s=`error: too many arguments${i}. Expected ${r} argument${o} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=ac(t,n)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
9378
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>oi(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=pt.basename(t,pt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let n=r.formatHelp(this,r);return o.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,o,n,i;return r?(o=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(o=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),o(s)),hasColors:n,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),n={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation({error:o.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(V.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
9007
9379
  Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let a;typeof r=="function"?a=r({error:i.error,command:i.command}):a=r,a&&i.write(`${a}
9008
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ag(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function sg(){if(K.env.NO_COLOR||K.env.FORCE_COLOR==="0"||K.env.FORCE_COLOR==="false")return!1;if(K.env.FORCE_COLOR||K.env.CLICOLOR_FORCE!==void 0)return!0}var ML=new An;Et();de();import{mkdir as V$,readFile as H$,writeFile as J$}from"node:fs/promises";import{dirname as Y$,join as q$,relative as X$,resolve as Q$}from"node:path";async function eE(e,t){let r;try{r=await H$(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function dg(e,t,r){let o=q$(e,t),n=await eE(o,r);try{await V$(Y$(o),{recursive:!0}),await J$(o,r,"utf8")}catch{throw O(`Cannot write ${o}.`),new Error("unreachable")}return{where:X$(process.cwd(),o)||t,state:n}}async function ug(e){let t=Q$(e.out??"."),r=await dg(t,se,He),o=await dg(t,ke,In),n=`import { start } from "./${se}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${ke}";`,a=r.state==="same"&&o.state==="same";if(j())return U({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:$t,import:n},{path:o.where,digest:Rr,import:i}],path:r.where,digest:$t,import:n});R(a?"Already current":"Wrote the Gamestage client"),P("Library",`${r.where} (${$t})`),P("Player client",`${o.where} (${Rr})`),y(),S(`Import it: ${$.cyan(n)}`),S(`The player API on its own: ${$.cyan(i)}`),(r.state==="different"||o.state==="different")&&S("An earlier copy was replaced. It is generated, so nothing of yours was in it."),y()}ae();Et();Po();import{stat as qP,writeFile as Uk}from"node:fs/promises";import{createHash as XP}from"node:crypto";var Xe="0.29.2";import{randomUUID as ZP}from"node:crypto";var KP=/-[0-9a-f]{4}$/;function fs(e){return`${e}-${ZP().replace(/-/g,"").slice(0,4)}`}function Rk(e){return KP.test(e)}dt();var bt="favicon.svg",Ro=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
9380
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function sg(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function cg(){if(V.env.NO_COLOR||V.env.FORCE_COLOR==="0"||V.env.FORCE_COLOR==="false")return!1;if(V.env.FORCE_COLOR||V.env.CLICOLOR_FORCE!==void 0)return!0}var HL=new In;Tt();de();import{mkdir as rE,readFile as oE,writeFile as iE}from"node:fs/promises";import{dirname as aE,join as sE,relative as cE,resolve as lE}from"node:path";async function dE(e,t){let r;try{r=await oE(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function ug(e,t,r){let o=sE(e,t),n=await dE(o,r);try{await rE(aE(o),{recursive:!0}),await iE(o,r,"utf8")}catch{throw O(`Cannot write ${o}.`),new Error("unreachable")}return{where:cE(process.cwd(),o)||t,state:n}}async function pg(e){let t=lE(e.out??"."),r=await ug(t,se,Je),o=await ug(t,xe,Cn),n=`import { start } from "./${se}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${xe}";`,a=r.state==="same"&&o.state==="same";if(j())return U({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Et,import:n},{path:o.where,digest:jr,import:i}],path:r.where,digest:Et,import:n});N(a?"Already current":"Wrote the Gamestage client"),P("Library",`${r.where} (${Et})`),P("Player client",`${o.where} (${jr})`),g(),S(`Import it: ${$.cyan(n)}`),S(`The player API on its own: ${$.cyan(i)}`),(r.state==="different"||o.state==="different")&&S("An earlier copy was replaced. It is generated, so nothing of yours was in it."),g()}ae();Tt();_n();import{stat as cO,writeFile as Gk}from"node:fs/promises";import{createHash as lO}from"node:crypto";var He="0.29.4";import{randomUUID as nO}from"node:crypto";var rO=/-[0-9a-f]{4}$/;function gs(e){return`${e}-${nO().replace(/-/g,"").slice(0,4)}`}function Lk(e){return rO.test(e)}dt();var wt="favicon.svg",Lo=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
9009
9381
  <rect width="32" height="32" rx="7" fill="#1b1c1f"/>
9010
9382
  <path d="m12 8 12 8-12 8Z" fill="#fff"/>
9011
9383
  </svg>
9012
- `;function xh(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function Do(e){if(xh(e))return e;let t=`<link rel="icon" href="./${bt}" type="image/svg+xml">
9013
- `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function YP(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function zk(e,t){let r=t.trim();if(!r)return e;let o=YP(r);return e.replace(/(<title[^>]*>)[\s\S]*?(<\/title>)/i,`$1${o}$2`).replace(/(<h1\b[^>]*\bid=["']game-name["'][^>]*>)[\s\S]*?(<\/h1>)/i,`$1${o}$2`)}de();async function Fk(e){try{return await qP(e),!0}catch{return!1}}var Lo={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",predict:"Call it before it happens. It settles when the result arrives.",bingo:"Each fan gets their own board from a shared pool. Fill a line before it locks.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."};async function QP(e,t,r){let o=await Ue();return o?(vr(),await fr({baseUrl:be,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${XP("sha256").update(t).digest("hex")}`,conformance:Ne(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:dr.map(i=>({section:i,status:e[i].status}))}),!0):!1}async function Bk(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return O("Give the game a name with --name.");if(!e.archetype){j()&&(U({ok:!1,status:"archetype_required",message:"Choose an archetype before scaffolding. Authority is decided first, on purpose.",archetypes:Object.entries(Lo).map(([b,x])=>({archetype:b,summary:x})),example:`gamestage create --name "${e.name??t}" --archetype hunt`}),process.exit(1)),R("Choose the game's authority first"),y($.dim(` The archetype decides what the server owns: answers, locks, scoring
9384
+ `;function $m(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function jo(e){if($m(e))return e;let t=`<link rel="icon" href="./${wt}" type="image/svg+xml">
9385
+ `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function sO(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Fk(e,t){let r=t.trim();if(!r)return e;let o=sO(r);return e.replace(/(<title[^>]*>)[\s\S]*?(<\/title>)/i,`$1${o}$2`).replace(/(<h1\b[^>]*\bid=["']game-name["'][^>]*>)[\s\S]*?(<\/h1>)/i,`$1${o}$2`)}de();async function Bk(e){try{return await cO(e),!0}catch{return!1}}var Mo={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",predict:"Call it before it happens. It settles when the result arrives.",bingo:"Each fan gets their own board from a shared pool. Fill a line before it locks.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."};async function dO(e,t,r){let o=await ye();if(!o)return!1;wr();let i=await yr({baseUrl:we,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${lO("sha256").update(t).digest("hex")}`,conformance:De(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ur.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function Wk(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return O("Give the game a name with --name.");if(!e.archetype){j()&&(U({ok:!1,status:"archetype_required",message:"Choose an archetype before scaffolding. Authority is decided first, on purpose.",archetypes:Object.entries(Mo).map(([b,x])=>({archetype:b,summary:x})),example:`gamestage create --name "${e.name??t}" --archetype hunt`}),process.exit(1)),N("Choose the game's authority first"),g($.dim(` The archetype decides what the server owns: answers, locks, scoring
9014
9386
  and settlement. Picking it before any client code is what keeps the
9015
- game trustworthy later.`)),y();for(let[b,x]of Object.entries(Lo))y(` ${$.cyan(b.padEnd(20))} ${$.dim(x)}`);y(),y(` ${$.dim("Then run:")} ${$.cyan(`gamestage create --name "${e.name??t}" --archetype <archetype>`)}`),y(),process.exit(1)}let r=Ut.safeParse(e.archetype);if(!r.success)return O(`Unknown archetype "${e.archetype}".`,[...Object.keys(Lo).map(b=>$.cyan(b)),"",`You are running gamestage ${Xe}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${$.cyan("npx gamestage@latest create ...")} run the current one`]);let o=ii[r.data];if(!o&&!j())return O(`"${r.data}" is coming soon. Nothing was registered or written.`,["There is no Engine behind it yet, so create would give you a manifest and no","game a fan could play.","","Build with one of these today:",...Object.keys(ii).map(b=>` ${$.cyan(b.padEnd(10))} ${$.dim(Lo[b])}`),"",`${$.dim("Then run:")} ${$.cyan(`gamestage create --name "${e.name??t}" --archetype hunt`)}`]);let n=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(n&&!e.force&&await Fk(n))return O(`${n} already exists, and create would replace it.`,["That file holds a game: its id, its format and whatever has been done to it.","A new one minted here would be a second game in the same directory.","",`${$.cyan(`gamestage manifest validate ${n}`)} check what you have`,`${$.cyan("gamestage start")} find the next step for this directory`,"",$.dim("There is a --force, and it replaces your page and clients as well as the"),$.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let i=fs(t),a=ns(i,e.name??i);a.app.status="confirmed",a.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],a.experience.status="proposed",a.experience.surfaces=["web-embed"],a.backend.status="confirmed",a.backend.route="managed_runtime",a.backend.archetype=r.data,a.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${r.data}`}],a.identity.status="proposed",a.identity.provider="identify";let s=Ft.parse(a),l=Co(s),d=Ne(s),u=!1,p;try{u=await QP(s,l,r.data)}catch(b){p=b instanceof Error?b.message:"The control plane did not answer."}let m=null;n&&(m=n,await Uk(m,l,"utf8"));let h=!!o&&e.write!==!1,f=[];if(h){let b=[["index.html",zk(Do(o),s.app.title)],[bt,Ro],[se,He],[ke,In]];for(let[x,k]of b){if(!e.force&&await Fk(x)){f.push(x);continue}await Uk(x,k,"utf8")}}if(j()){U({ok:!0,manifest:s,manifest_yaml:l,written_to:m,conformance:{computed:d.computed,blockers:d.blockers},registered:u,...p?{registration_failed:p}:{},scaffolded:h,files:h?["index.html",bt,se,ke].filter(b=>!f.includes(b)):[],kept:f,...o?{}:{scaffold_skipped:"no_engine",engines:Object.keys(ii)},next:"gamestage dev"});return}R(`Created ${s.app.title}`),P("Game id",s.app.id),P("Game format",r.data),h&&f.length===0?P("Files","index.html, with the Gamestage client beside it"):h&&P("Kept",`${f.join(", ")} (already here, left as they were)`),P("Authority","managed runtime (server-owned)"),P("Build stage",`${d.computed} ${d.computedName}`),m&&P("Manifest",m),y(u?" Registered in Studio as a draft.":p?` Not registered in Studio: ${p} (${be})`:" No account found, so registration was skipped."),R("What the server will own"),y(` ${$.dim(Lo[r.data])}`),R("Next"),f.includes("index.html")&&S(`${$.cyan("gamestage inspect .")} find what in your page has to move to the Engine`),S(`${$.cyan("gamestage dev")} run the game locally against the archetype`),S(`${$.cyan("gamestage manifest validate "+(m??"gamestage.yaml"))} check where it stands`),y()}ae();Et();dt();Th();Ch();ys();import{readFileSync as Jf}from"node:fs";import{readFile as Qo}from"node:fs/promises";import{createInterface as jR}from"node:readline/promises";import{extname as MR,resolve as zR}from"node:path";import{createHash as FS}from"node:crypto";de();wh();function ei(e,t){return e.refused?j()?(U({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(R("Not done"),y(` ${e.refused}`),y(),!0):!1}function Yf(e,t){if(e.state==="archived")return{stage:"dev",reason:"archived, so it serves nobody"};if(!t)return{stage:null,reason:"this control plane did not report your workspace's plan"};let r=qm(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!Ym(t);return!o&&!n?{stage:r,reason:"waiting on your approval, run `gamestage promote`, and on your workspace's plan, which only Monterosa can move"}:o?{stage:r,reason:"approved, but your workspace's plan does not carry prod yet, which only Monterosa can move"}:{stage:r,reason:"waiting on your approval, run `gamestage promote`"}}function BS(e,t=e.playgroundUrl,r){if(P("Game",`${e.name} (${e.id})`),P("State",e.state),r!==void 0){let{stage:o,reason:n}=Yf(e,r);P("Serving",o==="prod"?"prod":`dev: ${n}`)}P("Build stage",e.conformance),P("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&P("Playground",t),e.playerEndpoint&&P("Player API",e.playerEndpoint),P("Manage",Dk(e.id)),e.studioUrl&&P("Studio",e.studioUrl),P("Docs",Lk(e.archetype))}async function GS(e){let{client:t,email:r}=await le(),o=await gs(t),n=No(o);if(n.ok||O(n.message,n.next),n.access==="pending"||n.access==="refused"){if(j())return U({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});R("Your account"),P("Signed in as",r),P("Access",n.access),br(n);return}try{if(e){let d=await t.getGame(e);d||O(...qS(e));let u=await t.getWorkspaceSummary().then(h=>h.tier).catch(()=>{}),{stage:p,reason:m}=Yf(d,u);if(j())return U({ok:!0,stage:p,...m?{stageReason:m}:{},game:d});if(R(d.name),BS(d,void 0,u),u===void 0&&P("Serving",`unchecked: ${m}`),d.meters.length){y();for(let h of d.meters){let f=Math.round(Zw(h)*100);P(h.label,`${h.used} of ${h.limit}${h.unit} (${f}%)`)}}y();return}let i="workspace"in o&&o.workspace?o.workspace:await t.getWorkspace(),a=i.games.length,s=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(j())return U({ok:!0,status:n.status,access:n.access,games_total:s??null,games_shown:a,workspace:{...i,games:i.games.map(d=>{let{stage:u,reason:p}=Yf(d,i.tier);return{...d,stage:u,...p?{stageReason:p}:{}}})}});if(R(i.name),P("Signed in as",r),P("Access",n.access??"not reported by this control plane"),P("Tier",i.tier),P("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),y(),s===0){S("No games yet. `gamestage create` or `gamestage inspect .` starts one."),y();return}for(let d of i.games)P(d.name,`${d.state}${d.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(y(),S(`Showing ${a} of ${s} games.`));let l=Ww(i.meters);if(l.length){y(),R("At a cap");for(let d of l)S(`${d.label}: ${d.used} of ${d.limit}${d.unit}`)}y()}catch(i){_e(i)}}async function UR(e,t){let r;try{r=await Qo(e,"utf8")}catch{t&&O(`Cannot read ${e}.`);return}let o=ie(r);if(!o.ok){O(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function FR(e){try{let t=await vs(Ih(e));return ps(t.map(r=>r.text).join(`
9016
- `))}catch{return}}async function BR(e){try{let t=await Qo(e,"utf8");return`c${FS("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function GR(e){try{return await Qo(e,"utf8")}catch{return}}async function WR(e){try{let t=ie(await Qo(e,"utf8"));return t.ok?Ne(t.manifest).computed:"L0"}catch{return"L0"}}async function WS(e,t){t.file&&t.dir&&O("Choose either --file or --dir for a deploy, not both.");let{client:r}=await le(),o=await UR(t.manifest??"gamestage.yaml",!!t.manifest);try{let n,i={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?n=await KR(r,e,t.file,i):t.dir&&(n=await YR(r,e,t.dir,i));let a=t.manifest??"gamestage.yaml",s=t.revision??await BR(a),l=await r.deploy(e,{manifestRevision:s,contentHash:t.hash??`sha256:${s}`,conformance:t.level??await WR(a),...await GR(a).then(h=>h===void 0?{}:{manifestSource:h}),offersPrize:!!t.prize,round:o,...t.dir?{wording:await FR(t.dir)}:{}});if(ei(l,"deploy"))return;let d=o?l.game.rounds.some(h=>h.id===`round-${o.number}`):null,u=d===!1?[...l.game.logs].reverse().find(h=>h.level==="error"):void 0;if(j())return U({ok:!0,status:"deployed",roundProvisioned:d,...u?{roundError:u.message}:{},game:n?{...l.game,playgroundUrl:n}:l.game});let p=nn(l.game.containerLabel),m=nn(l.game.containerLabel,{lower:!0});if(R("Deployed"),BS(l.game,n),d&&P(p,`${o.number} is live`),y(),l.game.appSpec?.refusal&&(R("But Studio would not take the game's settings"),y(` ${l.game.appSpec.refusal.reason}`),y(),S("The game is live and playing. What is stale is what a producer sees in Studio, so they may be editing boxes that no longer match the game."),S("Deploy again once it is fixed; nothing else needs doing."),y()),await VR(n??l.game.playgroundUrl,l.game.playerEndpoint,e,t.check===!1),d===!1){R(`But there is no ${m}`),y(` ${u?.message??`The Engine did not accept the ${m}.`}`),y(),S("Anyone opening the game will find nothing on. Deploy again once it is fixed."),y();return}if(d===null){let h=l.game.rounds?.length??0;S(h?`No ${m} in the manifest, which is right: the game is playing ${h} from Studio.`:`No ${m} in the manifest and none in Studio, so the game has nothing on yet.`)}S("Share the playground URL. It sleeps when idle and wakes on a request."),y()}catch(n){_e(n)}}async function ZS(e){let{client:t}=await le();try{let r=await t.archiveGame(e);if(ei(r,"archive"))return;if(j()){U({ok:!0,status:"archived",game:r.game});return}R("Archived"),P("Game",`${r.game.name} (${r.game.id})`),y(),S("Taken off the air. Its record and files are retained outside the served bundle."),y()}catch(r){_e(r)}}async function KS(e){let{client:t}=await le();try{let r=await t.promoteGame(e);if(ei(r,"promote"))return;let o=await t.getWorkspace(),n=qm(r.game,o);if(j()){U({ok:!0,status:"promoted",stage:n,game:r.game});return}R("Approved"),P("Game",`${r.game.name} (${r.game.id})`),y(),n==="prod"?S("Live. Your workspace's plan already carries prod."):S("Approved, but still serving dev: reaching fans on prod also needs your workspace on a paid plan, which only Monterosa can do. Talk to us and this takes effect with no further action from you."),y()}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(j()){U({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}R("Not yet"),y(" This control plane does not have promotion yet."),y(),S("Your game is untouched and still serving dev."),S("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),y();return}_e(r)}}async function VS(e){let{client:t}=await le();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){y("Nothing to remove. Every archived game here was deployed at some point.");return}if(!j()){R(`${o.length} archived games that never deployed`);let a=new Map;for(let s of o)a.set(s.name,(a.get(s.name)??0)+1);for(let[s,l]of[...a].sort((d,u)=>u[1]-d[1]))S(l>1?`${s} x${l}`:s);y(),S("A live game, or one that ever deployed, is refused by the server."),y()}if(!e.yes){process.stdin.isTTY||O("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=jR({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){y("Nothing was deleted.");return}}finally{a.close()}}let n=0,i=[];for(let a of o){let s=await t.deleteGame(a.id);s.refused?i.push(`${a.name}: ${s.refused}`):n+=1}if(U({removed:n,refused:i.length}),!j()){R("Removed"),S(`${n} records gone.`);for(let a of i)S(a);y()}}catch(r){_e(r)}}async function HS(e){let{client:t}=await le();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(j()){U({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}R("Not done"),y(` ${o}`),y();return}if(j())return U({ok:!0,workspace:r});R("Plan changed"),P("Plan",r.tier),P("Live games",String(r.liveGameAllowance||"Contracted")),y()}catch(r){_e(r)}}async function qf(e,t){let{admin:r,email:o}=await jk();try{let n=await r.setWorkspaceAccess(e,t),i=Mk(n);if(j())return U({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});br(i),n.changed&&(P("Decided by",o),y())}catch(n){_e(n)}}async function JS(e){let t;try{t=await Qo(e,"utf8")}catch{return O(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=ie(t);if(!r.ok)return O(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${$.cyan(a.path)} ${a.message}`),"",`${$.cyan(`gamestage manifest validate ${e}`)} the full report`]);let o=r.manifest,n=Aw(o);if(n.length)return O(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await le();vr();try{let a=await i.registerGame(Tw(o,`sha256:${FS("sha256").update(t).digest("hex")}`));if(ei(a,"register"))return;if(j()){U({ok:!0,status:"registered",game:a.game});return}R("Registered"),P("Game",`${a.game.name} (${a.game.id})`),P("State",a.game.state),P("Conformance",a.game.conformance),y(),S(`${$.cyan(`gamestage deploy ${a.game.id} --dir .`)} publish it`),y()}catch(a){_e(a)}}async function Xf(e,t){let{client:r}=await le();try{let o=await r.setAwake(e,t);if(ei(o,t?"wake":"suspend"))return;if(j()){U({ok:!0,status:o.game.state,game:o.game});return}R(t?"Awake":"Suspended"),P("Game",`${o.game.name} (${o.game.id})`),P("State",o.game.state),y(),S(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),y()}catch(o){_e(o)}}async function YS(e,t){let{client:r}=await le();try{let o=await r.getEndpoints(e);if(o||O(...qS(e)),j())return U({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||O(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),y(n);return}R("Endpoints"),P("Player",o.player??"not deployed"),P("Control",o.control??"not deployed"),P("Playground",o.playground??"not deployed"),y()}catch(o){_e(o)}}function qS(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function XS(e,t){let{client:r}=await le();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?Lw(n):{state:"none"},a=jw(i);if(j())return U({ok:!0,lines:o,freshness:i});if(a&&(R("This game is serving a closed round"),y(),S(a),y()),o.length===0){R("No log lines"),y(),S("Nothing yet, or everything is older than the tier's retention."),y();return}for(let s of o){let l=s.roundId?` [${s.roundId}]`:"";y(`${s.at} ${s.level.padEnd(5)}${l} ${s.message}`)}}catch(o){_e(o)}}function Hf(e=cg,t=Xe){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&O("This is a development build of the CLI, so it cannot pin a client version.",["A deployed page imports the Gamestage client from a published version, and","this build is not one. Deploying anyway would point the game at",`${vt}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${$.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${$.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function US(e,t,r=vt){let o=`${r}/client/${t}/${se}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function QS(e,t,r){let o=`<script>
9387
+ game trustworthy later.`)),g();for(let[b,x]of Object.entries(Mo))g(` ${$.cyan(b.padEnd(20))} ${$.dim(x)}`);g(),g(` ${$.dim("Then run:")} ${$.cyan(`gamestage create --name "${e.name??t}" --archetype <archetype>`)}`),g(),process.exit(1)}let r=Ft.safeParse(e.archetype);if(!r.success)return O(`Unknown archetype "${e.archetype}".`,[...Object.keys(Mo).map(b=>$.cyan(b)),"",`You are running gamestage ${He}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${$.cyan("npx gamestage@latest create ...")} run the current one`]);let o=si[r.data];if(!o&&!j())return O(`"${r.data}" is coming soon. Nothing was registered or written.`,["There is no Engine behind it yet, so create would give you a manifest and no","game a fan could play.","","Build with one of these today:",...Object.keys(si).map(b=>` ${$.cyan(b.padEnd(10))} ${$.dim(Mo[b])}`),"",`${$.dim("Then run:")} ${$.cyan(`gamestage create --name "${e.name??t}" --archetype hunt`)}`]);let n=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(n&&!e.force&&await Bk(n))return O(`${n} already exists, and create would replace it.`,["That file holds a game: its id, its format and whatever has been done to it.","A new one minted here would be a second game in the same directory.","",`${$.cyan(`gamestage manifest validate ${n}`)} check what you have`,`${$.cyan("gamestage start")} find the next step for this directory`,"",$.dim("There is a --force, and it replaces your page and clients as well as the"),$.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let i=gs(t),a=os(i,e.name??i);a.app.status="confirmed",a.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],a.experience.status="proposed",a.experience.surfaces=["web-embed"],a.backend.status="confirmed",a.backend.route="managed_runtime",a.backend.archetype=r.data,a.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${r.data}`}],a.identity.status="proposed",a.identity.provider="identify";let s=Gt.parse(a),c=No(s),d=De(s),u=!1,p;try{u=await dO(s,c,r.data)}catch(b){p=b instanceof Error?b.message:"The control plane did not answer."}let h=null;n&&(h=n,await Gk(h,c,"utf8"));let m=!!o&&e.write!==!1,f=[];if(m){let b=[["index.html",Fk(jo(o),s.app.title)],[wt,Lo],[se,Je],[xe,Cn]];for(let[x,k]of b){if(!e.force&&await Bk(x)){f.push(x);continue}await Gk(x,k,"utf8")}}if(j()){U({ok:!0,manifest:s,manifest_yaml:c,written_to:h,conformance:{computed:d.computed,blockers:d.blockers},registered:u,...p?{registration_failed:p}:{},scaffolded:m,files:m?["index.html",wt,se,xe].filter(b=>!f.includes(b)):[],kept:f,...o?{}:{scaffold_skipped:"no_engine",engines:Object.keys(si)},next:"gamestage dev"});return}N(`Created ${s.app.title}`),P("Game id",s.app.id),P("Game format",r.data),m&&f.length===0?P("Files","index.html, with the Gamestage client beside it"):m&&P("Kept",`${f.join(", ")} (already here, left as they were)`),P("Authority","managed runtime (server-owned)"),P("Build stage",`${d.computed} ${d.computedName}`),h&&P("Manifest",h),g(u?" Registered in Studio as a draft.":p?` Not registered in Studio: ${p} (${we})`:" No account found, so registration was skipped."),N("What the server will own"),g(` ${$.dim(Mo[r.data])}`),N("Next"),f.includes("index.html")&&S(`${$.cyan("gamestage inspect .")} find what in your page has to move to the Engine`),S(`${$.cyan("gamestage dev")} run the game locally against the archetype`),S(`${$.cyan("gamestage manifest validate "+(h??"gamestage.yaml"))} check where it stands`),g()}ae();Tt();dt();Im();Om();vs();import{readFileSync as Yf}from"node:fs";import{readFile as ti}from"node:fs/promises";import{createInterface as KR}from"node:readline/promises";import{extname as VR,resolve as HR}from"node:path";import{createHash as KS}from"node:crypto";de();xm();function ni(e,t){return e.refused?j()?(U({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(N("Not done"),g(` ${e.refused}`),g(),!0):!1}function qf(e,t){if(e.state==="archived")return{stage:"dev",reason:"archived, so it serves nobody"};if(!t)return{stage:null,reason:"this control plane did not report your workspace's plan"};let r=Xh(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!qh(t);return!o&&!n?{stage:r,reason:"waiting on your approval, run `gamestage promote`, and on your workspace's plan, which only Monterosa can move"}:o?{stage:r,reason:"approved, but your workspace's plan does not carry prod yet, which only Monterosa can move"}:{stage:r,reason:"waiting on your approval, run `gamestage promote`"}}function VS(e,t=e.playgroundUrl,r){if(P("Game",`${e.name} (${e.id})`),P("State",e.state),r!==void 0){let{stage:o,reason:n}=qf(e,r);P("Serving",o==="prod"?"prod":`dev: ${n}`)}P("Build stage",e.conformance),P("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&P("Playground",t),e.playerEndpoint&&P("Player API",e.playerEndpoint),P("Manage",jk(e.id)),e.studioUrl&&P("Studio",e.studioUrl),P("Docs",Mk(e.archetype))}async function HS(e){let{client:t,email:r}=await le(),o=await ys(t),n=Do(o);if(n.ok||O(n.message,n.next),n.access==="pending"||n.access==="refused"){if(j())return U({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});N("Your account"),P("Signed in as",r),P("Access",n.access),_r(n);return}try{if(e){let d=await t.getGame(e);d||O(...n$(e));let u=await t.getWorkspaceSummary().then(m=>m.tier).catch(()=>{}),{stage:p,reason:h}=qf(d,u);if(j())return U({ok:!0,stage:p,...h?{stageReason:h}:{},game:d});if(N(d.name),VS(d,void 0,u),u===void 0&&P("Serving",`unchecked: ${h}`),d.meters.length){g();for(let m of d.meters){let f=Math.round(V_(m)*100);P(m.label,`${m.used} of ${m.limit}${m.unit} (${f}%)`)}}g();return}let i="workspace"in o&&o.workspace?o.workspace:await t.getWorkspace(),a=i.games.length,s=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(j())return U({ok:!0,status:n.status,access:n.access,games_total:s??null,games_shown:a,workspace:{...i,games:i.games.map(d=>{let{stage:u,reason:p}=qf(d,i.tier);return{...d,stage:u,...p?{stageReason:p}:{}}})}});if(N(i.name),P("Signed in as",r),P("Access",n.access??"not reported by this control plane"),P("Tier",i.tier),P("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),g(),s===0){S("No games yet. `gamestage create` or `gamestage inspect .` starts one."),g();return}for(let d of i.games)P(d.name,`${d.state}${d.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(g(),S(`Showing ${a} of ${s} games.`));let c=K_(i.meters);if(c.length){g(),N("At a cap");for(let d of c)S(`${d.label}: ${d.used} of ${d.limit}${d.unit}`)}g()}catch(i){_e(i)}}async function JR(e,t){let r;try{r=await ti(e,"utf8")}catch{t&&O(`Cannot read ${e}.`);return}let o=ie(r);if(!o.ok){O(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function YR(e){try{let t=await bs(Pm(e));return hs(t.map(r=>r.text).join(`
9388
+ `))}catch{return}}async function qR(e){try{let t=await ti(e,"utf8");return`c${KS("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function XR(e){try{return await ti(e,"utf8")}catch{return}}async function QR(e){try{let t=ie(await ti(e,"utf8"));return t.ok?De(t.manifest).computed:"L0"}catch{return"L0"}}async function JS(e,t){t.file&&t.dir&&O("Choose either --file or --dir for a deploy, not both.");let{client:r}=await le(),o=await JR(t.manifest??"gamestage.yaml",!!t.manifest);try{let n,i={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?n=await tD(r,e,t.file,i):t.dir&&(n=await iD(r,e,t.dir,i));let a=t.manifest??"gamestage.yaml",s=t.revision??await qR(a),c=await r.deploy(e,{manifestRevision:s,contentHash:t.hash??`sha256:${s}`,conformance:t.level??await QR(a),...await XR(a).then(m=>m===void 0?{}:{manifestSource:m}),offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await YR(t.dir)}:{}});if(ni(c,"deploy"))return;let d=o?c.game.rounds.some(m=>m.id===`round-${o.number}`):null,u=d===!1?[...c.game.logs].reverse().find(m=>m.level==="error"):void 0;if(j())return U({ok:!0,status:"deployed",roundProvisioned:d,...u?{roundError:u.message}:{},game:n?{...c.game,playgroundUrl:n}:c.game});let p=on(c.game.containerLabel),h=on(c.game.containerLabel,{lower:!0});if(N("Deployed"),VS(c.game,n),d&&P(p,`${o.number} is live`),g(),c.game.appSpec?.refusal&&(N("But Studio would not take the game's settings"),g(` ${c.game.appSpec.refusal.reason}`),g(),S("The game is live and playing. What is stale is what a producer sees in Studio, so they may be editing boxes that no longer match the game."),S("Deploy again once it is fixed; nothing else needs doing."),g()),await nD(n??c.game.playgroundUrl,c.game.playerEndpoint,e,t.check===!1),d===!1){N(`But there is no ${h}`),g(` ${u?.message??`The Engine did not accept the ${h}.`}`),g(),S("Anyone opening the game will find nothing on. Deploy again once it is fixed."),g();return}if(d===null){let m=c.game.rounds?.length??0;S(m?`No ${h} in the manifest, which is right: the game is playing ${m} from Studio.`:`No ${h} in the manifest and none in Studio, so the game has nothing on yet.`)}S("Share the playground URL. It sleeps when idle and wakes on a request."),g()}catch(n){_e(n)}}async function YS(e){let{client:t}=await le();try{let r=await t.archiveGame(e);if(ni(r,"archive"))return;if(j()){U({ok:!0,status:"archived",game:r.game});return}N("Archived"),P("Game",`${r.game.name} (${r.game.id})`),g(),S("Taken off the air. Its record and files are retained outside the served bundle."),g()}catch(r){_e(r)}}async function qS(e){let{client:t}=await le();try{let r=await t.promoteGame(e);if(ni(r,"promote"))return;let o=await t.getWorkspace(),n=Xh(r.game,o);if(j()){U({ok:!0,status:"promoted",stage:n,game:r.game});return}N("Approved"),P("Game",`${r.game.name} (${r.game.id})`),g(),n==="prod"?S("Live. Your workspace's plan already carries prod."):S("Approved, but still serving dev: reaching fans on prod also needs your workspace on a paid plan, which only Monterosa can do. Talk to us and this takes effect with no further action from you."),g()}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(j()){U({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}N("Not yet"),g(" This control plane does not have promotion yet."),g(),S("Your game is untouched and still serving dev."),S("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),g();return}_e(r)}}async function XS(e){let{client:t}=await le();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){g("Nothing to remove. Every archived game here was deployed at some point.");return}if(!j()){N(`${o.length} archived games that never deployed`);let a=new Map;for(let s of o)a.set(s.name,(a.get(s.name)??0)+1);for(let[s,c]of[...a].sort((d,u)=>u[1]-d[1]))S(c>1?`${s} x${c}`:s);g(),S("A live game, or one that ever deployed, is refused by the server."),g()}if(!e.yes){process.stdin.isTTY||O("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=KR({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){g("Nothing was deleted.");return}}finally{a.close()}}let n=0,i=[];for(let a of o){let s=await t.deleteGame(a.id);s.refused?i.push(`${a.name}: ${s.refused}`):n+=1}if(U({removed:n,refused:i.length}),!j()){N("Removed"),S(`${n} records gone.`);for(let a of i)S(a);g()}}catch(r){_e(r)}}async function QS(e){let{client:t}=await le();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(j()){U({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}N("Not done"),g(` ${o}`),g();return}if(j())return U({ok:!0,workspace:r});N("Plan changed"),P("Plan",r.tier),P("Live games",String(r.liveGameAllowance||"Contracted")),g()}catch(r){_e(r)}}async function Xf(e,t){let{admin:r,email:o}=await zk();try{let n=await r.setWorkspaceAccess(e,t),i=Uk(n);if(j())return U({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});_r(i),n.changed&&(P("Decided by",o),g())}catch(n){_e(n)}}async function e$(e){let t;try{t=await ti(e,"utf8")}catch{return O(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=ie(t);if(!r.ok)return O(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${$.cyan(a.path)} ${a.message}`),"",`${$.cyan(`gamestage manifest validate ${e}`)} the full report`]);let o=r.manifest,n=C_(o);if(n.length)return O(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await le();wr();try{let a=await i.registerGame(I_(o,`sha256:${KS("sha256").update(t).digest("hex")}`));if(ni(a,"register"))return;if(j()){U({ok:!0,status:"registered",game:a.game});return}N("Registered"),P("Game",`${a.game.name} (${a.game.id})`),P("State",a.game.state),P("Conformance",a.game.conformance),g(),S(`${$.cyan(`gamestage deploy ${a.game.id} --dir .`)} publish it`),g()}catch(a){_e(a)}}async function Qf(e,t){let{client:r}=await le();try{let o=await r.setAwake(e,t);if(ni(o,t?"wake":"suspend"))return;if(j()){U({ok:!0,status:o.game.state,game:o.game});return}N(t?"Awake":"Suspended"),P("Game",`${o.game.name} (${o.game.id})`),P("State",o.game.state),g(),S(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),g()}catch(o){_e(o)}}async function t$(e,t){let{client:r}=await le();try{let o=await r.getEndpoints(e);if(o||O(...n$(e)),j())return U({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||O(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),g(n);return}N("Endpoints"),P("Player",o.player??"not deployed"),P("Control",o.control??"not deployed"),P("Playground",o.playground??"not deployed"),g()}catch(o){_e(o)}}function n$(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function r$(e,t){let{client:r}=await le();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?M_(n):{state:"none"},a=z_(i);if(j())return U({ok:!0,lines:o,freshness:i});if(a&&(N("This game is serving a closed round"),g(),S(a),g()),o.length===0){N("No log lines"),g(),S("Nothing yet, or everything is older than the tier's retention."),g();return}for(let s of o){let c=s.roundId?` [${s.roundId}]`:"";g(`${s.at} ${s.level.padEnd(5)}${c} ${s.message}`)}}catch(o){_e(o)}}function Jf(e=lg,t=He){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&O("This is a development build of the CLI, so it cannot pin a client version.",["A deployed page imports the Gamestage client from a published version, and","this build is not one. Deploying anyway would point the game at",`${bt}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${$.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${$.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function ZS(e,t,r=bt){let o=`${r}/client/${t}/${se}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function o$(e,t,r){let o=`<script>
9017
9389
  // Written by \`gamestage deploy\`. Where this game's Engine answers.
9018
9390
  window.GAMESTAGE_API = ${JSON.stringify(t)};
9019
9391
  window.GAMESTAGE_GAME = ${JSON.stringify(r)};
9020
9392
  // This page was deployed, so it may ask which Interaction Cloud project it is.
9021
9393
  window.GAMESTAGE_IC_LOOKUP = true;
9022
9394
  </script>
9023
- `,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function Ar(e,t,r,o){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r,...o?{"cache-control":o}:{}}});n.ok||O(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function ec(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function ZR(e){switch(MR(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function KR(e,t,r,o={}){let n=zR(r),i;try{i=Jf(n)}catch{throw O(`Cannot read ${r}.`),new Error("unreachable")}let a=await Eh({path:n,relativePath:r},o.round);a&&O(`${r} ${a.why}`,["A deploy is a publishing act, and --file publishes this file as the game's","own page. Point --file at the game's HTML, or use --dir and let the gate","withhold what the page does not need."]);let s=await e.uploadTarget(t,"index.html"),l=QS(Do(i.toString("utf8")),`${s.playerApiOrigin}`,t);await Ar(s.uploadUrl,l,"text/html; charset=utf-8",s.cacheControl);let d=await e.uploadTarget(t,ke);await Ar(d.uploadUrl,In,"text/javascript; charset=utf-8",d.cacheControl);let u=await e.uploadTarget(t,se);await Ar(u.uploadUrl,He,"text/javascript; charset=utf-8",u.cacheControl);let p=await e.uploadTarget(t,bt);return await Ar(p.uploadUrl,Ro,"image/svg+xml",p.cacheControl),j()||(y(),S(`Uploaded ${r} to ${ec(s)}`),S(`Wired it to ${s.playerApiOrigin} as "${t}"`),S(`Shipped @monterosa/gamestage beside it (${$t})`),S(`Shipped the player client beside it (${Rr})`)),ec(s)}async function VR(e,t,r,o){if(o||!e||!t)return;let{browserCheck:n}=await Promise.resolve().then(()=>(Vf(),zS));HR(await n(e,t,r))}function HR(e){if(e.status==="verified"){P("Checked","the page loads and plays in a browser"),y();return}if(e.status==="skipped"){S($.dim(`Not checked in a browser: ${e.detail??""}`.trim())),y();return}R("The published page did not start"),y(` ${e.detail??""}`),y(),S("The files are published, so the game is live and broken rather than unpublished."),S(`${$.cyan("gamestage verify")} the same check, with the rest of them`),y(),process.exitCode=1}function JR(e){for(let t of e.walkedPast)S(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)S(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)S(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&O(`${e.refuse.path} ${e.refuse.why}`,["A deploy is a publishing act, so this file would sit at a public URL beside","your game. Remove it from the directory, or point --dir at a directory that","does not contain it, and deploy again."])}async function YR(e,t,r,o={}){let n;try{n=Ih(r)}catch(k){throw O(k instanceof Error?k.message:`Cannot read ${r}.`),new Error("unreachable")}let i=await Kk(n,{...o,exempt:[se,ke]});JR(i);let a=i.publish,s=a.find(k=>k.relativePath==="index.html");s||O(`Directory ${r} must contain an index.html file.`);let l=Jf(s.path,"utf8"),d=xh(l),u=a.some(k=>k.relativePath==="favicon.ico"),p=a.some(k=>k.relativePath===bt),m=!d&&!u,h=m&&!p,f=Hf();if(f!=="0.0.0-test"){let k=`${vt}/client/${f}/${se}`,w=!1;try{w=(await fetch(k,{method:"HEAD"})).ok}catch{w=!0}w||O(`The client this deploy would pin, ${f}, is not published yet.`,[`Every page uploaded here will import ${k},`,"which answers 404 today. The game would load, fetch nothing, and show a","blank screen with no error anywhere.","","Deploy the site first: it is what serves /client/<version>/.","",`${$.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let b;for(let k of a){if(k.relativePath===se||k.relativePath===ke)continue;let w;try{w=await e.uploadTarget(t,k.relativePath)}catch(Z){throw new Error(`${k.relativePath} cannot be published: ${Z instanceof Error?Z.message:String(Z)}`,{cause:Z})}k.relativePath==="index.html"&&(b=w);let T=Jf(k.path),L=/\.(m?js)$/i.test(k.relativePath),V=/\.html$/i.test(k.relativePath)?QS(US(m&&k.relativePath==="index.html"?Do(T.toString("utf8")):T.toString("utf8"),Hf()),w.playerApiOrigin,t):L?US(T.toString("utf8"),Hf()):T;await Ar(w.uploadUrl,V,ZR(k.relativePath),w.cacheControl)}if(h){let k=await e.uploadTarget(t,bt);await Ar(k.uploadUrl,Ro,"image/svg+xml",k.cacheControl)}let x=[...a.map(k=>k.relativePath),...h?[bt]:[]];try{await e.pruneBundle(t,x);for(let k of i.withheld)S(`Removed ${k.path} from the playground.`)}catch(k){let w=k instanceof Error?k.message:String(k),T=i.withheld.map(L=>L.path);R("The playground still holds files this deploy did not publish"),y(` ${w}`),y(),T.length?(S(`Could not remove ${T.join(", ")} from the playground: ${w}`),S("Anything an earlier deploy put there is still being served.")):S("Anything an earlier deploy put there is still being served."),y(),process.exitCode=1}if(!j()&&b&&(y(),S(`Uploaded ${a.length} files from ${r}`),S(`Playground: ${ec(b)}`),S(`Wired it to ${b.playerApiOrigin} as "${t}"`),h&&S("Added a replaceable starter favicon")),!b)throw new Error("The directory index was not uploaded.");return ec(b)}ae();import{readFile as uD}from"node:fs/promises";ae();var n$="player-conformance",Qf="round-current",qR="sha256:emulator-conformance";function kt(e){return structuredClone(e)}function xt(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:qR}}function XR(e){let t=e==="per-player-challenge";return{...xt(),id:Qf,number:412,version:2,can:{accepting_plays:!0,results_available:!1,solution_revealed:!1,closed:!1,optimistic_play:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function e$(e,t){let r=t==="mistakes";return{...xt(),player_id:n$,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function QR(e){let t=XR(e),r=new Map([[t.id,t]]),o=new Map([[t.id,e$(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0,optimistic_play:!1},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",e$("round-revealed",e))),{runtime:{...xt(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"predict":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...xt(),round_id:Qf,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...xt(),player_id:n$,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,nextPlay:1}}function t$(e,t){return{...xt(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function eg(e){let t=QR(e);return{async getRuntime(){return kt(t.runtime)},async getCurrentRound(){return kt(t.rounds.get(Qf))},async getRound(r){let o=t.rounds.get(r);return o?kt(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return t$(t,"round_not_found");let i=t.plays.get(o.idempotency_key);if(i)return{...kt(i),outcome:"duplicate"};if(o.round_version!==n.version)return{...xt(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return t$(t,"challenge_instance_id");let a=t.roundStates.get(r),s=t.runtime.marking==="at_settlement",l={...a,...xt(),attempts_used:a.attempts_used+1,score:a.score+(s?0:10),finished:!s,outcome:s?"pending":"won"},d={...xt(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!s,feedback:s?[]:[{key:"answer",verdict:"correct"}],round_state:kt(l)};return t.roundStates.set(r,l),t.plays.set(o.idempotency_key,d),l.finished&&!a.finished&&(t.profile=is(t.profile,l.outcome)),kt(d)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return kt(o)},async getProfile(){return kt(t.profile)},async getLeaderboard(){return kt(t.leaderboard)}}}function eD(){return e=>eg(e)}var qW=eD();ae();import{createServer as tD}from"node:http";function Sn(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var nD=Sn(re.runtime),rD=Sn(re.currentRound),oD=Sn(re.round),iD=Sn(re.plays),aD=Sn(re.roundState),sD=Sn(re.profile),cD=Sn(re.leaderboard);function Qt(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function Ir(e,t,r,o){Qt(e,t,{error:{code:r,message:o,retryable:!1}})}async function lD(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function dD(e,t,r,o){if(!e.url){Ir(t,400,"invalid_request","The request URL is missing.");return}let i=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(i)){t.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(o)}),t.end(o);return}if(nD.test(i)){Qt(t,200,await r.getRuntime());return}if(rD.test(i)){Qt(t,200,await r.getCurrentRound());return}let a=oD.exec(i);if(a){let l=await r.getRound(decodeURIComponent(a[2]));if(!l){Ir(t,404,"round_not_found","The requested round was not found.");return}Qt(t,200,l);return}let s=aD.exec(i);if(s){let l=decodeURIComponent(s[2]);try{Qt(t,200,await r.getRoundState(l))}catch{Ir(t,404,"round_not_found","The requested round was not found.")}return}if(sD.test(i)){Qt(t,200,await r.getProfile());return}if(cD.test(i)){Qt(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let a=iD.exec(i);if(a){try{let s=await lD(e);Qt(t,200,await r.play(decodeURIComponent(a[2]),s))}catch(s){Ir(t,400,"invalid_request",s instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}Ir(t,404,"not_found","The requested player API route was not found.")}function tc(e="default",t){let r=eg(e);return tD((o,n)=>{dD(o,n,r,t).catch(()=>{n.headersSent?n.destroy():Ir(n,500,"internal_error","The emulator could not answer the request.")})})}Et();Rf();dt();de();async function pD(e){let t;try{t=await uD(e,"utf8")}catch{return}let r=ie(t);if(!r.ok){O(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${$.cyan(o.path)} ${o.message}`));return}return r.manifest}async function mD(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:tc(r,He),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await pD(e.manifest??"gamestage.yaml");if(!o)return{server:tc(r,He),what:"fixture",fixtureReason:"no-manifest",game:"conformance-game"};let n=o.backend.round;if(!n){let a=o.interaction_cloud.elements.length?"studio-round":"unconfigured";return{server:tc(r,He),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&O(`The manifest declares the ${i} archetype and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),kn.includes(n.archetype)||O(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${kn.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await qs({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:He}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}async function r$(e){await Oo();let t=await mD(e),{server:r}=t,o=()=>new Promise((d,u)=>{r.close(p=>p?u(p):d())}),n=new Promise(d=>{let u=async()=>{process.off("SIGINT",u),process.off("SIGTERM",u),await o(),d()};process.once("SIGINT",u),process.once("SIGTERM",u)});await new Promise((d,u)=>{r.once("error",u),r.listen(Number(e.port),"127.0.0.1",()=>d())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,l;if(t.as&&(s=await Of(a),r.attachDevIdentity?.(s),l=await s.mint(t.as)),j())U({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,round_source:t.round?"manifest":"stand-in",...t.fixtureReason?{fixture_reason:t.fixtureReason}:{},...s&&l?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:l,required:!0}}:{}});else if(t.what==="engine"){R(t.title??t.game);let d=nn(t.containerLabel);P("Serving",`your ${nn(t.containerLabel,{lower:!0})}, through the real Engine`),P(d,`${t.round.number} (round-${t.round.number})`),P("API",a),P("Game id",t.game),y(),S(`<script src="${a}/gamestage.js"></script>`),S(`window.GAMESTAGE_API = "${a}"`),S(`window.GAMESTAGE_GAME = "${t.game}"`),l&&S(`window.GAMESTAGE_TOKEN = "${l}"`),y(),s&&l&&(P("Playing as",`${t.as} (${$.cyan(`id:${t.as}`)})`),P("Identity","required, so an anonymous play is refused here too"),P("Keys",s.jwksUri),y(),S("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),S(`This harness cannot be deployed: its issuer is a loopback URL, and ${$.cyan("gamestage manifest validate")} refuses a manifest that names one.`),y()),S(`Edit the ${nn(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),y()}else R(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),P("API",a),P("Game id",t.game),y(),S(`<script src="${a}/gamestage.js"></script>`),y(),t.fixtureReason==="studio-round"?(S("A round is configured in Studio, but `gamestage dev` cannot reach it."),S("Play the deployed game to use the Studio round. This fixture is only local wiring.")):t.fixtureReason==="unconfigured"?(S("No round is configured in Studio yet. This local run is a Gamestage stand-in, not your game."),S("Set up the first round in Studio, then play the deployed game.")):(S("There is no round here to serve, so this is the shell rather than your game."),S("`dev` reads a round from the manifest and is the one place that may: it is a local harness and deploys nothing. A game's real content lives in Studio, where a producer can change it without you.")),y();await n}Vf();ae();de();import{stat as hD}from"node:fs/promises";async function o$(){let e=[],[t]=process.versions.node.split(".").map(Number);e.push({id:"node",label:"Node.js",ok:t>=20,detail:t>=20?`v${process.versions.node}`:`v${process.versions.node} - Gamestage needs Node 20 or newer`,blocking:!0}),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${So} bundled`,blocking:!1});let r=!1;try{await hD("gamestage.yaml"),r=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:r,detail:r?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let o=e.filter(n=>!n.ok&&n.blocking);j()&&(U({ok:o.length===0,checks:e}),process.exit(o.length===0?0:1)),R("Environment");for(let n of e){let i=n.ok?$.green("ok"):n.blocking?$.red("blocked"):$.dim("--");y(` ${i.padEnd(18)} ${n.label.padEnd(16)} ${$.dim(n.detail)}`)}y(),o.length&&(y(` ${$.red("Fix the blocked items above before continuing.")}`),y(),process.exit(1)),y(` ${$.green("Ready.")}`),y()}ae();Po();import{readFile as ID,stat as CD,writeFile as PD}from"node:fs/promises";import{createHash as OD}from"node:crypto";import{basename as ND}from"node:path";dt();Bf();import{readdir as fD,readFile as nc,stat as tg}from"node:fs/promises";import{basename as gD,extname as yD,join as ng,relative as vD}from"node:path";var bD=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),_D=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);async function wD(e,t=200){let r=await tg(e),o=[];if(r.isFile())return o.push({path:e,relative:gD(e),text:await nc(e,"utf8")}),o;let n=async i=>{if(o.length>=t)return;let a=await fD(i,{withFileTypes:!0});for(let s of a){if(o.length>=t)return;if(s.name.startsWith(".")&&s.name!==".openai")continue;let l=ng(i,s.name);if(s.isDirectory()){if(bD.has(s.name))continue;await n(l)}else if(_D.has(yD(s.name)))try{o.push({path:l,relative:vD(e,l),text:await nc(l,"utf8")})}catch{}}};return await n(e),o}function kD(e,t){let r=e.text.split(`
9024
- `);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function xD(e,t){if(!(await tg(e)).isFile())try{let o=JSON.parse(await nc(ng(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=i$(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=i$(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function i$(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var SD=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],$D=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],ED=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"predict",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function TD(e){let t=e.map(s=>s.text).join(`
9025
- `),r=ED.map(s=>{let l=s.signals.filter(d=>d.pattern.test(t)).map(d=>d.because);return{archetype:s.archetype,hits:l.length,because:l}}).filter(s=>s.hits>0).sort((s,l)=>l.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function AD(e,t){let o=(await tg(e)).isFile()?null:e;if(o)try{let i=await nc(ng(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},l=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,d=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:l,build:d}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function a$(e){let t=await wD(e);if(t.length===0)throw new Error(`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let r=await AD(e,t),o=TD(t),n=[];for(let p of SD){let m=[];for(let h of t){for(let f of p.patterns){let b=kD(h,f);if(b){m.push(b);break}}if(m.length>=3)break}if(m.length>0){let h=o?p.remedies?.[o.archetype]??p.remedy:p.remedy;n.push({...h?{remedy:h}:{},id:p.id,title:p.title,detail:p.detail,evidence:m})}}let i=t.map(p=>p.text).join(`
9026
- `),a=$D.filter(p=>!p.present.test(i)).map(p=>({id:p.id,title:p.title,detail:p.detail,evidence:[]})),s=[];t.some(p=>/<(div|section|main|canvas)/i.test(p.text))&&s.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(p=>({file:p.relative}))});let d=Qs(t),u=[];return r.kind==="standalone_html"&&u.push("Where is this deployed today, and who owns that hosting?"),u.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),n.some(p=>p.id==="client-play-limit")&&u.push("Is the play limit per device or per person? That decides whether identity is required at launch."),{target:e,scanned_files:t.length,stack:r,keep:s,move_behind_authority:n,missing_integrations:a,copy_to_studio:d,unknowns:u,archetype:o,name:await xD(e,t)}}de();var RD=e=>ND(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",DD=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function LD(e,t){let r=RD(e.name??e.target),o=t&&Rk(t)?t:fs(r),n=e.name??DD(r),i=ns(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),Ft.parse(i)}async function jD(e,t){let r=await Ue();if(!r)return!1;vr();let o=e.backend.archetype;return o?(await fr({baseUrl:be,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${OD("sha256").update(t).digest("hex")}`,conformance:Ne(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:dr.map(i=>({section:i,status:e[i].status}))}),!0):!1}async function MD(e){try{let t=ie(await ID(e,"utf8"));return t.ok?t.manifest.app.id:void 0}catch{return}}async function zD(e){try{return await CD(e),!0}catch{return!1}}async function s$(e,t){let r;try{r=await a$(e)}catch(d){return O(d instanceof Error?d.message:"Inspection failed")}let o=LD(r,await MD(typeof t.write=="string"?t.write:"gamestage.yaml")),n=Ne(o),i=Co(o),a=!1,s;try{a=await jD(o,i)}catch(d){s=d instanceof Error?d.message:"The control plane did not answer."}let l=null;if(t.write){if(l=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await zD(l))return O(`${l} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${$.cyan(`gamestage manifest validate ${l}`)} check what you have`,`${$.cyan("gamestage inspect . --force")} replace it anyway`]);await PD(l,i,"utf8")}if(j()){U({ok:!0,report:r,manifest:o,conformance:{computed:n.computed,blockers:n.blockers},manifest_yaml:i,written_to:l,registered:a,...s?{registration_failed:s}:{}});return}if(R(`Inspection report ${$.dim(r.target)}`),P("Files inspected",String(r.scanned_files)),P("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),r.archetype&&P("Archetype",`${r.archetype.archetype} ${$.dim(`(${r.archetype.confidence} confidence)`)}`),r.keep.length){R("Keep as yours");for(let d of r.keep)S($.green(d.title)),y(` ${$.dim(d.detail)}`)}if(r.move_behind_authority.length){R("Must move behind an authoritative boundary");for(let d of r.move_behind_authority){S($.yellow(d.title)),y(` ${$.dim(d.detail)}`);for(let u of d.evidence.slice(0,2)){let p=u.line?`${u.file}:${u.line}`:u.file;y(` ${$.dim("\u2192")} ${$.cyan(p)}${u.excerpt?$.dim(" "+u.excerpt):""}`)}d.remedy&&(y(` ${$.dim("delete")} ${d.remedy.delete}`),y(` ${$.dim("call")} ${$.cyan(d.remedy.call)}`),d.remedy.render&&y(` ${$.dim("render")} ${d.remedy.render}`),d.remedy.move&&y(` ${$.dim("move")} ${d.remedy.move}`),y(` ${$.dim("keep")} ${d.remedy.keep}`))}}if(r.missing_integrations.length){R("Platform integrations not present yet");for(let d of r.missing_integrations)S(d.title),y(` ${$.dim(d.detail)}`)}if(r.unknowns.length){R("Needs a human answer");for(let d of r.unknowns)S(d,"?")}if(R("App Manifest"),P("Conformance",`${n.computed} ${n.computedName}`),n.blockers.length){y(),y($.dim(" To reach the next level:"));for(let d of n.blockers)y(` ${$.dim("\xB7")} ${d.requirement}`)}y(),l?y(` Written to ${$.cyan(l)}`):y($.dim(" Re-run with --write to save this manifest.")),y(a?" Registered in Studio as a draft.":s?` Not registered in Studio: ${s} (${be})`:" No account found, so registration was skipped."),y()}var c$="https://github.com",UD="https://api.github.com",rc=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function l$(){let e=await fetch(`${c$}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:rc,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function d$(e){let r=await(await fetch(`${c$}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:rc,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await FD(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function FD(e){let t=await fetch(`${UD}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}dt();de();var BD=e=>new Promise(t=>setTimeout(t,e));async function u$(){let{client:e}=await le();try{let t=await l$();j()?U({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:rc}):(R("Link GitHub"),P("Code",t.user_code),P("Open",t.verification_uri),y(),S("Enter the code on that page. This waits until you do."),y());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await BD(o*1e3);let n=await d$(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return O("You declined the request on GitHub.");if(n.status==="expired")return O("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(j())return U({ok:!0,status:"linked",github:i.github});R("Linked"),P("Account",n.login),y(),S("Your first deploy is no longer gated. Run `gamestage deploy`."),y();return}O("The code expired before it was entered.")}catch(t){_e(t)}}Po();dt();de();var GD=e=>new Promise(t=>setTimeout(t,e));function WD(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
9027
- `)}async function p$(e,t){let{client:r}=await le(),o=No(await gs(r));if(j()){U({ok:o.ok,status:o.status,access:o.access,...o.code?{code:o.code}:{},message:o.message,next:o.next,email:e.email,...t?{stored_in:t}:{},control_plane:be}),o.ok||process.exit(1);return}y(),R("Signed in"),P("Account",e.email??e.userId??"unknown"),t&&P("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),y(),S("Never written into the project, and never passed to your agent."),S("`gamestage logout` removes it."),br(o),o.ok||process.exit(1)}async function m$(){let e=await Ue();if(e){await p$(e);return}let t;try{t=await Ik()}catch(a){O("Could not reach the sign-in service.",[String(a)])}j()?WD(t):(R("Sign in to Gamestage"),y(" This also creates your account if you do not have one. Google or email."),y(" A new account is approved by a person, so this may end in a wait."),y(),P("Open",t.verification_uri_complete),P("Or enter",`${t.user_code} at ${t.verification_uri}`),y(),y(" Waiting for you to confirm in the browser..."),Pk(t.verification_uri_complete));let r=Date.now()+t.expires_in*1e3,o=t.interval*1e3,n=null;for(;Date.now()<r;){await GD(o);let a=await Ck(t.device_code);if(a.status==="ok"){n=a.session;break}if(a.status==="slow_down"){o+=5e3;continue}a.status!=="pending"&&(a.status==="expired"&&O("That code expired.",["Run `gamestage login` again."]),O("Sign-in was refused.",[a.reason]))}n||O("Timed out waiting for approval.",["Run `gamestage login` again."]);let i=await _h(n);await p$(n,i)}async function h$(){let e=await Ue();if(await Nk(),j()){U({ok:!0,status:e?"signed_out":"not_signed_in"});return}R(e?"Signed out":"Not signed in"),e&&P("Removed",e.email??"session"),y()}async function f$(){let e=await Ue();if(j()){U(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){R("Not signed in"),y(),S("Inspecting, scaffolding and local rounds need no account."),S("Run `gamestage login` when you want to deploy a playground."),y();return}R("Signed in"),P("Account",e.email??"unknown"),e.userId&&P("User",e.userId),y(),S("`gamestage status` says whether this account is approved."),y()}ae();de();import{readdir as ZD,readFile as KD,stat as VD}from"node:fs/promises";async function HD(e){let t=[];try{t=await ZD(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await VD(`${e}/${a}`),n=!0;try{let s=ie(await KD(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}async function g$(){let e=process.cwd(),t=await HD(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:Ge("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names an archetype but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${Ge("dev")}\` serves the contract fixture rather than your game, and \`${Ge("verify")}\` has nothing to verify.`},play:{command:Ge("dev"),why:"The manifest declares a round. Serve it locally, through the real Engine."},inspect:{command:Ge("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report."},create:{command:Ge("create"),why:"Nothing to inspect. Start a new game from a concept."}};if(j()){U({ok:!0,cwd:e,version:Xe,detected:t,route:r,next:o[r],docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:ai(),authentication:`Not required for inspect, create, validate or local development. First needed at \`${Ge("deploy")}\`.`});return}if(R(`Gamestage ${Xe}`),y($.dim(" Take an agent-built game to production, on the platform behind the")),y($.dim(" world's biggest fan experiences.")),R("Where you are"),t.has_manifest&&t.has_round===!1)y(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)y(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)y(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let n=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);y(` Found ${n.join(" and ")}. This looks like a game to inspect.`)}else y(" Nothing here yet. This looks like a fresh start.");R("Do this next"),y(` ${$.cyan(o[r].command)}`),y(` ${$.dim(o[r].why)}`),R("Good to know"),y($.dim(" Inspect, create and validate run anonymously. `dev` and `verify`\n need you signed in, because they run your round through a real\n Engine. `gamestage login` creates the account if you do not have\n one yet; deploy needs that account approved too.")),y()}var Cr=class extends Error{};function y$(e){let t=e.what.trim();if(!t)throw new Cr("Say what you were trying to build.");if(t.length>2e3)throw new Cr(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function v$(e){return JSON.stringify(e,null,2)}de();var JD=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function b$(e,t,r){let o;try{o=y$({what:e,closest:t.closest,cliVersion:r})}catch(a){throw a instanceof Cr&&O(a.message),a}if(!t.send){if(j()){U({sent:!1,would_send:o});return}R("This is everything that would be sent"),y(),y(v$(o)),y(),S("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),S(`Send it with ${Ge('suggest "..." --send')}.`);return}let n;try{n=await fetch(JD,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){O("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||O(`Gamestage refused that suggestion (${n.status}).`,[i.error?.message??"It said nothing more."]),j()){U({sent:!0,reference:i.reference??null});return}R("Sent"),i.reference&&S(`Reference ${i.reference}. Quote it if you follow up.`),S("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var Pr=class extends Error{};function _$(e){let t=e.what.trim();if(!t)throw new Pr("Say what went wrong.");if(t.length>2e3)throw new Pr(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function w$(e){return JSON.stringify(e,null,2)}de();var YD=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function k$(e,t,r){let o;try{o=_$({what:e,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(a){throw a instanceof Pr&&O(a.message),a}if(!t.send){if(j()){U({sent:!1,would_send:o});return}R("This is everything that would be sent"),y(),y(w$(o)),y(),S("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),S(`Send it with ${Ge('issue "..." --send')}.`);return}let n;try{n=await fetch(YD,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){O("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||O(`Gamestage refused that report (${n.status}).`,[i.error?.message??"It said nothing more."]),j()){U({sent:!0,reference:i.reference??null});return}R("Reported"),i.reference&&S(`Reference ${i.reference}. Quote it if you follow up.`),S("It is in the backlog now. Somebody at Monterosa reads these.")}ae();dt();de();import{readFile as qD}from"node:fs/promises";import{resolve as XD}from"node:path";async function x$(e){let t=XD(e),r;try{r=await qD(t,"utf8")}catch{O(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){O(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=Zt.safeParse(o);if(!n.success){let i=n.error.issues[0];O(`${e} is not valid reference data.`,[i?`${i.path.join(".")||"document"}: ${i.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:r,measures:n.data.measures.map(i=>i.key)}}function QD(e){let t=Zt.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var eL={copy:"immutable copy",pointer:"reference data"};async function tL(e,t,r){let o=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});o.ok||O(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function S$(e,t){let{client:r}=await le(),{body:o}=await x$(t),n=us(o),i=await r.referenceUploadTarget(e,n),a=await yk(o,async(d,u)=>{await tL(d==="copy"?i.copy:i.pointer,u,eL[d])});a.ok||O(`${t} is not valid reference data.`,[a.detail??"No detail."]);let{measures:s,counts:l}=a.summary;if(j())return U({ok:!0,name:e,digest:n,measures:s,counts:l,key:i.pointer.key});R("Pushed"),S(`${e} is now the reference data for this workspace`);for(let d of s)S(`${d}: ${l[d].toLocaleString("en-GB")} values`);S(`Digest ${n}, kept so a round can say what it was scored on`),y(),S("A round provisioned from now on uses this. One already in play keeps"),S("the numbers it opened with, which is deliberate.")}async function $$(e,t){let{body:r,measures:o}=await x$(e),n=QD(r),i=Zt.parse(JSON.parse(r)),a={};for(let s of i.measures){let l=t.filter(d=>typeof s.values[d]!="number");l.length&&(a[s.key]=l)}if(j())return U({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});R("Reference data");for(let s of o)S(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){y(),S("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(y(),!Object.keys(a).length){S(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,l]of Object.entries(a))S(`${s} has no value for ${l.map(d=>`"${d}"`).join(", ")}`);O("A round using those keys would be refused rather than scoring them as nothing.")}ae();dt();de();import{readFile as nL}from"node:fs/promises";import{resolve as rL}from"node:path";import{createInterface as oL}from"node:readline/promises";async function iL(e){let t;try{t=await nL(rL(e),"utf8")}catch{O(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=ie(t);r.ok||O(`${e} is not a valid App Manifest.`,r.issues.map(n=>`${n.path} ${n.message}`));let o=r.ok?r.manifest.backend.round:void 0;return o||O(`${e} has no round in it.`,["There is nothing to push. A round lives under `backend.round` while a game is","still being built locally; once it is in Studio it lives there instead."]),o.archetype==="predict"&&O("A prediction's question and options are authored in Studio itself.",["They are the platform's own question and options rather than fields of ours,","which is what lets a producer reveal the answer once the world decides. There","is nothing here to write, and nothing to write it with."]),o}function aL(e){if(R("What goes into Studio"),S(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){S(`Target: ${e.target.toLocaleString()} ${e.targetLabel}`.trim());for(let t of e.slates)S(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);y(),y("No point values go with it. They stay in your reference data, where only"),y("the Engine reads them.")}else{if(S(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")S(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)S(`${t.label}: ${t.members.join(", ")}`);y(),y("The answer goes with it, into a field Studio withholds from a fan's browser."),y("Only a producer signed into Studio can read it.")}y()}async function sL(e,t){if(t)return!0;process.stdin.isTTY||O("Refusing to overwrite Studio without being asked.",[`Nothing has changed on ${e}.`,"Re-run with `--yes` if you mean to replace whatever a producer has typed."]);let r=oL({input:process.stdin,output:process.stdout});try{return(await r.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{r.close()}}async function E$(e,t){let r=t.manifest??"gamestage.yaml",o=await iL(r),n=o.archetype==="push"?Hw(o):o;if(j()||aL(n),!await sL(e,!!t.yes)){y("Nothing was written.");return}try{let{client:i}=await le(),a=await i.seedRound(e,n);a.refused&&O("The round was not written into Studio.",[a.refused]);let s=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:{count:n.board.length,noun:"picks on the board"};U({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),j()||(R("Written"),S(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),S("A producer can change every word of it without another deploy."),S("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),y())}catch(i){_e(i)}}ae();de();import{readFile as cL}from"node:fs/promises";async function T$(e,t){let r;try{r=await cL(e,"utf8")}catch{return O(`Cannot read ${e}`)}let o=ie(r);if(!o.ok)return j()&&(U({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),O(`${e} is not a valid App Manifest`,o.issues.map(d=>`${$.cyan(d.path)} ${d.message}`));let n=o.manifest,i=Ne(n),a=null;if(t.level){let d=Mt.safeParse(t.level.toUpperCase());if(!d.success)return O(`Unknown level "${t.level}". Use L0 through L5.`);a=d.data}let s=a?k_(n,a):null,l=!i.overclaimed&&(s?.ok??!0);if(j()&&(U({ok:l,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results}),process.exit(l?0:1)),R(`${n.app.title} ${$.dim(n.app.id)}`),P("Schema",n.manifest.schema_version),P("Revision",String(n.manifest.revision)),P("Conformance",i.overclaimed?`${$.red(i.claimed)} claimed, ${$.bold(i.computed)} evidenced`:`${$.green(i.computed)} ${i.computedName}`),i.overclaimed){R("Overclaimed"),y($.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let d of i.blockers)S($.red(d.requirement))}if(a&&s&&!s.ok){R(`Not yet ${a}`);for(let d of s.missing)S(`${$.yellow(d.id)} ${d.requirement}`)}if(l&&(y(),y(` ${$.green("Valid")}${a?` at ${a}`:""}.`),i.blockers.length)){y(),y($.dim(" Next level needs:"));for(let d of i.blockers)y(` ${$.dim("\xB7")} ${d.requirement}`)}y(),process.exit(l?0:1)}de();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var J=new An;J.name("gamestage").description("Take an agent-built game prototype to a production fan game.\nInspect, create and validate need no account. `dev` and `verify` need\nyou signed in; publishing a game needs that account approved too.").version(Xe).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{lg(!!e.opts().json)});J.command("start").description("read the current directory and point at the right next step").action(g$);J.command("doctor").description("check the local environment").action(o$);J.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(s$);J.command("create").option("--name <name>","game name").option("--archetype <archetype>","authority model for the game").option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).description("start a new game, choosing its authority before scaffolding").action(Bk);J.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done (requires sign-in)").action(e=>Kf({...e,noBrowser:e.browser===!1}));J.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(ug);var A$=J.command("manifest").description("work with the App Manifest");A$.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(JS);A$.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(T$);J.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(GS);J.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--no-check","skip loading the published page in a browser afterwards").option("--allow <path...>","publish a file the deploy gate suspects; it never clears a certain finding").description("publish a snapshot to a playground, and the round it puts on").action(WS);var I$=J.command("reference").description("the private data a round is scored against");I$.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").action(S$);I$.command("check").argument("<file>","the JSON file holding it").argument("[keys...]","the keys a round uses, to check they are all present").description("what a round would fail on, before a producer finds out").action($$);var lL=J.command("round").description("the round a fan plays, and getting it into Studio");lL.command("push").argument("<game>","game id").option("--manifest <path>","manifest the round is read from","gamestage.yaml").option("--yes","do not ask before replacing what a producer has typed",!1).description("write your round into Studio, where a producer owns it from then on").action(E$);J.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(ZS);J.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(KS);J.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(VS);J.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(HS);J.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>Xf(e,!1));J.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>Xf(e,!0));J.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(YS);J.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(XS);J.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(r$);J.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("<what>","what you were trying to build").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>b$(e,t,Xe));J.command("issue").description("report something that went wrong (no account needed)").argument("<what>","what went wrong").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>k$(e,t,Xe));J.command("login").description("sign in, or create an account (needed before dev, verify or deploy)").action(m$);var dL=J.command("link").description("connect an account Gamestage needs (requires sign-in)");dL.command("github").description("link your GitHub account, which a first deploy requires").action(u$);var C$=J.command("admin").description("approve or refuse a creator's account (operators only)");C$.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>qf(e,"approved"));C$.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>qf(e,"refused"));J.command("logout").description("forget the stored session").action(h$);J.command("whoami").description("show who the CLI is signed in as").action(f$);J.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
9395
+ `,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function Pr(e,t,r,o){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r,...o?{"cache-control":o}:{}}});n.ok||O(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function tc(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function eD(e){switch(VR(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function tD(e,t,r,o={}){let n=HR(r),i;try{i=Yf(n)}catch{throw O(`Cannot read ${r}.`),new Error("unreachable")}let a=await Am({path:n,relativePath:r},o.round);a&&O(`${r} ${a.why}`,["A deploy is a publishing act, and --file publishes this file as the game's","own page. Point --file at the game's HTML, or use --dir and let the gate","withhold what the page does not need."]);let s=await e.uploadTarget(t,"index.html"),c=o$(jo(i.toString("utf8")),`${s.playerApiOrigin}`,t);await Pr(s.uploadUrl,c,"text/html; charset=utf-8",s.cacheControl);let d=await e.uploadTarget(t,xe);await Pr(d.uploadUrl,Cn,"text/javascript; charset=utf-8",d.cacheControl);let u=await e.uploadTarget(t,se);await Pr(u.uploadUrl,Je,"text/javascript; charset=utf-8",u.cacheControl);let p=await e.uploadTarget(t,wt);return await Pr(p.uploadUrl,Lo,"image/svg+xml",p.cacheControl),j()||(g(),S(`Uploaded ${r} to ${tc(s)}`),S(`Wired it to ${s.playerApiOrigin} as "${t}"`),S(`Shipped @monterosa/gamestage beside it (${Et})`),S(`Shipped the player client beside it (${jr})`)),tc(s)}async function nD(e,t,r,o){if(o||!e||!t)return;let{browserCheck:n}=await Promise.resolve().then(()=>(Hf(),WS));rD(await n(e,t,r))}function rD(e){if(e.status==="verified"){P("Checked","the page loads and plays in a browser"),g();return}if(e.status==="skipped"){S($.dim(`Not checked in a browser: ${e.detail??""}`.trim())),g();return}N("The published page did not start"),g(` ${e.detail??""}`),g(),S("The files are published, so the game is live and broken rather than unpublished."),S(`${$.cyan("gamestage verify")} the same check, with the rest of them`),g(),process.exitCode=1}function oD(e){for(let t of e.walkedPast)S(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)S(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)S(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&O(`${e.refuse.path} ${e.refuse.why}`,["A deploy is a publishing act, so this file would sit at a public URL beside","your game. Remove it from the directory, or point --dir at a directory that","does not contain it, and deploy again."])}async function iD(e,t,r,o={}){let n;try{n=Pm(r)}catch(k){throw O(k instanceof Error?k.message:`Cannot read ${r}.`),new Error("unreachable")}let i=await Hk(n,{...o,exempt:[se,xe]});oD(i);let a=i.publish,s=a.find(k=>k.relativePath==="index.html");s||O(`Directory ${r} must contain an index.html file.`);let c=Yf(s.path,"utf8"),d=$m(c),u=a.some(k=>k.relativePath==="favicon.ico"),p=a.some(k=>k.relativePath===wt),h=!d&&!u,m=h&&!p,f=Jf();if(f!=="0.0.0-test"){let k=`${bt}/client/${f}/${se}`,_=!1;try{_=(await fetch(k,{method:"HEAD"})).ok}catch{_=!0}_||O(`The client this deploy would pin, ${f}, is not published yet.`,[`Every page uploaded here will import ${k},`,"which answers 404 today. The game would load, fetch nothing, and show a","blank screen with no error anywhere.","","Deploy the site first: it is what serves /client/<version>/.","",`${$.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let b;for(let k of a){if(k.relativePath===se||k.relativePath===xe)continue;let _;try{_=await e.uploadTarget(t,k.relativePath)}catch(Z){throw new Error(`${k.relativePath} cannot be published: ${Z instanceof Error?Z.message:String(Z)}`,{cause:Z})}k.relativePath==="index.html"&&(b=_);let T=Yf(k.path),L=/\.(m?js)$/i.test(k.relativePath),K=/\.html$/i.test(k.relativePath)?o$(ZS(h&&k.relativePath==="index.html"?jo(T.toString("utf8")):T.toString("utf8"),Jf()),_.playerApiOrigin,t):L?ZS(T.toString("utf8"),Jf()):T;await Pr(_.uploadUrl,K,eD(k.relativePath),_.cacheControl)}if(m){let k=await e.uploadTarget(t,wt);await Pr(k.uploadUrl,Lo,"image/svg+xml",k.cacheControl)}let x=[...a.map(k=>k.relativePath),...m?[wt]:[]];try{await e.pruneBundle(t,x);for(let k of i.withheld)S(`Removed ${k.path} from the playground.`)}catch(k){let _=k instanceof Error?k.message:String(k),T=i.withheld.map(L=>L.path);N("The playground still holds files this deploy did not publish"),g(` ${_}`),g(),T.length?(S(`Could not remove ${T.join(", ")} from the playground: ${_}`),S("Anything an earlier deploy put there is still being served.")):S("Anything an earlier deploy put there is still being served."),g(),process.exitCode=1}if(!j()&&b&&(g(),S(`Uploaded ${a.length} files from ${r}`),S(`Playground: ${tc(b)}`),S(`Wired it to ${b.playerApiOrigin} as "${t}"`),m&&S("Added a replaceable starter favicon")),!b)throw new Error("The directory index was not uploaded.");return tc(b)}_n();ae();import{readFile as wD}from"node:fs/promises";ae();var s$="player-conformance",eg="round-current",aD="sha256:emulator-conformance";function xt(e){return structuredClone(e)}function St(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:aD}}function sD(e){let t=e==="per-player-challenge";return{...St(),id:eg,number:412,version:2,can:{accepting_plays:!0,results_available:!1,solution_revealed:!1,closed:!1,optimistic_play:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function i$(e,t){let r=t==="mistakes";return{...St(),player_id:s$,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function cD(e){let t=sD(e),r=new Map([[t.id,t]]),o=new Map([[t.id,i$(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0,optimistic_play:!1},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",i$("round-revealed",e))),{runtime:{...St(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"predict":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...St(),round_id:eg,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...St(),player_id:s$,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,nextPlay:1}}function a$(e,t){return{...St(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function tg(e){let t=cD(e);return{async getRuntime(){return xt(t.runtime)},async getCurrentRound(){return xt(t.rounds.get(eg))},async getRound(r){let o=t.rounds.get(r);return o?xt(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return a$(t,"round_not_found");let i=t.plays.get(o.idempotency_key);if(i)return{...xt(i),outcome:"duplicate"};if(o.round_version!==n.version)return{...St(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return a$(t,"challenge_instance_id");let a=t.roundStates.get(r),s=t.runtime.marking==="at_settlement",c={...a,...St(),attempts_used:a.attempts_used+1,score:a.score+(s?0:10),finished:!s,outcome:s?"pending":"won"},d={...St(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!s,feedback:s?[]:[{key:"answer",verdict:"correct"}],round_state:xt(c)};return t.roundStates.set(r,c),t.plays.set(o.idempotency_key,d),c.finished&&!a.finished&&(t.profile=ss(t.profile,c.outcome)),xt(d)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return xt(o)},async getProfile(){return xt(t.profile)},async getLeaderboard(){return xt(t.leaderboard)}}}function lD(){return e=>tg(e)}var hZ=lD();ae();import{createServer as dD}from"node:http";function $n(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var uD=$n(re.runtime),pD=$n(re.currentRound),hD=$n(re.round),mD=$n(re.plays),fD=$n(re.roundState),gD=$n(re.profile),yD=$n(re.leaderboard);function tn(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function Or(e,t,r,o){tn(e,t,{error:{code:r,message:o,retryable:!1}})}async function vD(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function bD(e,t,r,o){if(!e.url){Or(t,400,"invalid_request","The request URL is missing.");return}let i=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(i)){t.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(o)}),t.end(o);return}if(uD.test(i)){tn(t,200,await r.getRuntime());return}if(pD.test(i)){tn(t,200,await r.getCurrentRound());return}let a=hD.exec(i);if(a){let c=await r.getRound(decodeURIComponent(a[2]));if(!c){Or(t,404,"round_not_found","The requested round was not found.");return}tn(t,200,c);return}let s=fD.exec(i);if(s){let c=decodeURIComponent(s[2]);try{tn(t,200,await r.getRoundState(c))}catch{Or(t,404,"round_not_found","The requested round was not found.")}return}if(gD.test(i)){tn(t,200,await r.getProfile());return}if(yD.test(i)){tn(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let a=mD.exec(i);if(a){try{let s=await vD(e);tn(t,200,await r.play(decodeURIComponent(a[2]),s))}catch(s){Or(t,400,"invalid_request",s instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}Or(t,404,"not_found","The requested player API route was not found.")}function nc(e="default",t){let r=tg(e);return dD((o,n)=>{bD(o,n,r,t).catch(()=>{n.headersSent?n.destroy():Or(n,500,"internal_error","The emulator could not answer the request.")})})}Tt();Df();dt();de();async function _D(e){let t;try{t=await wD(e,"utf8")}catch{return}let r=ie(t);if(!r.ok){O(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${$.cyan(o.path)} ${o.message}`));return}return r.manifest}async function kD(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:nc(r,Je),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await _D(e.manifest??"gamestage.yaml");if(!o)return{server:nc(r,Je),what:"fixture",fixtureReason:"no-manifest",game:"conformance-game"};let n=o.backend.round;if(!n){let a=o.interaction_cloud.elements.length?"studio-round":"unconfigured";return{server:nc(r,Je),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&O(`The manifest declares the ${i} archetype and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),xn.includes(n.archetype)||O(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${xn.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Xs({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:Je}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}async function c$(e){await Ro();let t=await kD(e),{server:r}=t,o=()=>new Promise((d,u)=>{r.close(p=>p?u(p):d())}),n=new Promise(d=>{let u=async()=>{process.off("SIGINT",u),process.off("SIGTERM",u),await o(),d()};process.once("SIGINT",u),process.once("SIGTERM",u)});await new Promise((d,u)=>{r.once("error",u),r.listen(Number(e.port),"127.0.0.1",()=>d())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,c;if(t.as&&(s=await Nf(a),r.attachDevIdentity?.(s),c=await s.mint(t.as)),j())U({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,round_source:t.round?"manifest":"stand-in",...t.fixtureReason?{fixture_reason:t.fixtureReason}:{},...s&&c?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:c,required:!0}}:{}});else if(t.what==="engine"){N(t.title??t.game);let d=on(t.containerLabel);P("Serving",`your ${on(t.containerLabel,{lower:!0})}, through the real Engine`),P(d,`${t.round.number} (round-${t.round.number})`),P("API",a),P("Game id",t.game);{let u=await ye().catch(()=>null);u?.email&&P("Signed in",u.email)}g(),S(`<script src="${a}/gamestage.js"></script>`),S(`window.GAMESTAGE_API = "${a}"`),S(`window.GAMESTAGE_GAME = "${t.game}"`),c&&S(`window.GAMESTAGE_TOKEN = "${c}"`),g(),s&&c&&(P("Playing as",`${t.as} (${$.cyan(`id:${t.as}`)})`),P("Identity","required, so an anonymous play is refused here too"),P("Keys",s.jwksUri),g(),S("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),S(`This harness cannot be deployed: its issuer is a loopback URL, and ${$.cyan("gamestage manifest validate")} refuses a manifest that names one.`),g()),S(`Edit the ${on(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),g()}else N(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),P("API",a),P("Game id",t.game),g(),S(`<script src="${a}/gamestage.js"></script>`),g(),t.fixtureReason==="studio-round"?(S("A round is configured in Studio, but `gamestage dev` cannot reach it."),S("Play the deployed game to use the Studio round. This fixture is only local wiring.")):t.fixtureReason==="unconfigured"?(S("No round is configured in Studio yet. This local run is a Gamestage stand-in, not your game."),S("Set up the first round in Studio, then play the deployed game.")):(S("There is no round here to serve, so this is the shell rather than your game."),S("`dev` reads a round from the manifest and is the one place that may: it is a local harness and deploys nothing. A game's real content lives in Studio, where a producer can change it without you.")),g();await n}Hf();ae();de();import{stat as xD}from"node:fs/promises";async function l$(){let e=[],[t]=process.versions.node.split(".").map(Number);e.push({id:"node",label:"Node.js",ok:t>=20,detail:t>=20?`v${process.versions.node}`:`v${process.versions.node} - Gamestage needs Node 20 or newer`,blocking:!0}),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${To} bundled`,blocking:!1});let r=!1;try{await xD("gamestage.yaml"),r=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:r,detail:r?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let o=e.filter(n=>!n.ok&&n.blocking);j()&&(U({ok:o.length===0,checks:e}),process.exit(o.length===0?0:1)),N("Environment");for(let n of e){let i=n.ok?$.green("ok"):n.blocking?$.red("blocked"):$.dim("--");g(` ${i.padEnd(18)} ${n.label.padEnd(16)} ${$.dim(n.detail)}`)}g(),o.length&&(g(` ${$.red("Fix the blocked items above before continuing.")}`),g(),process.exit(1)),g(` ${$.green("Ready.")}`),g()}ae();_n();import{readFile as MD,stat as zD,writeFile as UD}from"node:fs/promises";import{createHash as FD}from"node:crypto";import{basename as GD}from"node:path";dt();Bf();import{readdir as SD,readFile as rc,stat as ng}from"node:fs/promises";import{basename as $D,extname as ED,join as rg,relative as TD}from"node:path";var AD=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),ID=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);async function CD(e,t=200){let r=await ng(e),o=[];if(r.isFile())return o.push({path:e,relative:$D(e),text:await rc(e,"utf8")}),o;let n=async i=>{if(o.length>=t)return;let a=await SD(i,{withFileTypes:!0});for(let s of a){if(o.length>=t)return;if(s.name.startsWith(".")&&s.name!==".openai")continue;let c=rg(i,s.name);if(s.isDirectory()){if(AD.has(s.name))continue;await n(c)}else if(ID.has(ED(s.name)))try{o.push({path:c,relative:TD(e,c),text:await rc(c,"utf8")})}catch{}}};return await n(e),o}function PD(e,t){let r=e.text.split(`
9396
+ `);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function OD(e,t){if(!(await ng(e)).isFile())try{let o=JSON.parse(await rc(rg(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=d$(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=d$(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function d$(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var ND=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],RD=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],DD=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"predict",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function LD(e){let t=e.map(s=>s.text).join(`
9397
+ `),r=DD.map(s=>{let c=s.signals.filter(d=>d.pattern.test(t)).map(d=>d.because);return{archetype:s.archetype,hits:c.length,because:c}}).filter(s=>s.hits>0).sort((s,c)=>c.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function jD(e,t){let o=(await ng(e)).isFile()?null:e;if(o)try{let i=await rc(rg(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},c=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,d=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:c,build:d}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function u$(e){let t=await CD(e);if(t.length===0)throw new Error(`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let r=await jD(e,t),o=LD(t),n=[];for(let p of ND){let h=[];for(let m of t){for(let f of p.patterns){let b=PD(m,f);if(b){h.push(b);break}}if(h.length>=3)break}if(h.length>0){let m=o?p.remedies?.[o.archetype]??p.remedy:p.remedy;n.push({...m?{remedy:m}:{},id:p.id,title:p.title,detail:p.detail,evidence:h})}}let i=t.map(p=>p.text).join(`
9398
+ `),a=RD.filter(p=>!p.present.test(i)).map(p=>({id:p.id,title:p.title,detail:p.detail,evidence:[]})),s=[];t.some(p=>/<(div|section|main|canvas)/i.test(p.text))&&s.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(p=>({file:p.relative}))});let d=ec(t),u=[];return r.kind==="standalone_html"&&u.push("Where is this deployed today, and who owns that hosting?"),u.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),n.some(p=>p.id==="client-play-limit")&&u.push("Is the play limit per device or per person? That decides whether identity is required at launch."),{target:e,scanned_files:t.length,stack:r,keep:s,move_behind_authority:n,missing_integrations:a,copy_to_studio:d,unknowns:u,archetype:o,name:await OD(e,t)}}de();var BD=e=>GD(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",WD=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function ZD(e,t){let r=BD(e.name??e.target),o=t&&Lk(t)?t:gs(r),n=e.name??WD(r),i=os(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),Gt.parse(i)}async function KD(e,t){let r=await ye();if(!r)return!1;wr();let o=e.backend.archetype;if(!o)return!1;let i=await yr({baseUrl:we,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${FD("sha256").update(t).digest("hex")}`,conformance:De(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ur.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function VD(e){try{let t=ie(await MD(e,"utf8"));return t.ok?t.manifest.app.id:void 0}catch{return}}async function HD(e){try{return await zD(e),!0}catch{return!1}}async function p$(e,t){let r;try{r=await u$(e)}catch(d){return O(d instanceof Error?d.message:"Inspection failed")}let o=ZD(r,await VD(typeof t.write=="string"?t.write:"gamestage.yaml")),n=De(o),i=No(o),a=!1,s;try{a=await KD(o,i)}catch(d){s=d instanceof Error?d.message:"The control plane did not answer."}let c=null;if(t.write){if(c=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await HD(c))return O(`${c} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${$.cyan(`gamestage manifest validate ${c}`)} check what you have`,`${$.cyan("gamestage inspect . --force")} replace it anyway`]);await UD(c,i,"utf8")}if(j()){U({ok:!0,report:r,manifest:o,conformance:{computed:n.computed,blockers:n.blockers},manifest_yaml:i,written_to:c,registered:a,...s?{registration_failed:s}:{}});return}if(N(`Inspection report ${$.dim(r.target)}`),P("Files inspected",String(r.scanned_files)),P("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),r.archetype&&P("Archetype",`${r.archetype.archetype} ${$.dim(`(${r.archetype.confidence} confidence)`)}`),r.keep.length){N("Keep as yours");for(let d of r.keep)S($.green(d.title)),g(` ${$.dim(d.detail)}`)}if(r.move_behind_authority.length){N("Must move behind an authoritative boundary");for(let d of r.move_behind_authority){S($.yellow(d.title)),g(` ${$.dim(d.detail)}`);for(let u of d.evidence.slice(0,2)){let p=u.line?`${u.file}:${u.line}`:u.file;g(` ${$.dim("\u2192")} ${$.cyan(p)}${u.excerpt?$.dim(" "+u.excerpt):""}`)}d.remedy&&(g(` ${$.dim("delete")} ${d.remedy.delete}`),g(` ${$.dim("call")} ${$.cyan(d.remedy.call)}`),d.remedy.render&&g(` ${$.dim("render")} ${d.remedy.render}`),d.remedy.move&&g(` ${$.dim("move")} ${d.remedy.move}`),g(` ${$.dim("keep")} ${d.remedy.keep}`))}}if(r.missing_integrations.length){N("Platform integrations not present yet");for(let d of r.missing_integrations)S(d.title),g(` ${$.dim(d.detail)}`)}if(r.unknowns.length){N("Needs a human answer");for(let d of r.unknowns)S(d,"?")}if(N("App Manifest"),P("Conformance",`${n.computed} ${n.computedName}`),n.blockers.length){g(),g($.dim(" To reach the next level:"));for(let d of n.blockers)g(` ${$.dim("\xB7")} ${d.requirement}`)}g(),c?g(` Written to ${$.cyan(c)}`):g($.dim(" Re-run with --write to save this manifest.")),g(a?" Registered in Studio as a draft.":s?` Not registered in Studio: ${s} (${we})`:" No account found, so registration was skipped."),g()}var h$="https://github.com",JD="https://api.github.com",oc=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function m$(){let e=await fetch(`${h$}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:oc,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function f$(e){let r=await(await fetch(`${h$}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:oc,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await YD(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function YD(e){let t=await fetch(`${JD}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}dt();de();var qD=e=>new Promise(t=>setTimeout(t,e));async function g$(){let{client:e}=await le();try{let t=await m$();j()?U({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:oc}):(N("Link GitHub"),P("Code",t.user_code),P("Open",t.verification_uri),g(),S("Enter the code on that page. This waits until you do."),g());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await qD(o*1e3);let n=await f$(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return O("You declined the request on GitHub.");if(n.status==="expired")return O("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(j())return U({ok:!0,status:"linked",github:i.github});N("Linked"),P("Account",n.login),g(),S("Your first deploy is no longer gated. Run `gamestage deploy`."),g();return}O("The code expired before it was entered.")}catch(t){_e(t)}}_n();dt();de();var XD=e=>new Promise(t=>setTimeout(t,e));function QD(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
9399
+ `)}async function y$(e,t,r){let{client:o}=await le(),n=Do(await ys(o)),i;if(r&&(i=await o.getWorkspace().then(a=>a.id).catch(()=>{})),j()){U({ok:n.ok,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:e.email,...t?{stored_in:t}:{},control_plane:we}),n.ok||process.exit(1);return}g(),N("Signed in"),P("Account",e.email??e.userId??"unknown"),t&&P("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),g(),S("Never written into the project, and never passed to your agent."),S("`gamestage logout` removes it."),r&&i&&i!==r?(g(),N("Not the workspace you asked for"),P("You asked for",r),P("You are in",i),g(),S("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):r&&i&&P("Workspace",i),_r(n),n.ok||process.exit(1)}async function v$(e){let t=await ye();if(t){await y$(t,void 0,e);return}let r;try{r=await Pk()}catch(s){O("Could not reach the sign-in service.",[String(s)])}j()?QD(r):(N("Sign in to Gamestage"),g(" This also creates your account if you do not have one. Google or email."),g(" A new account is approved by a person, so this may end in a wait."),g(),P("Open",r.verification_uri_complete),P("Or enter",`${r.user_code} at ${r.verification_uri}`),g(),g(" Waiting for you to confirm in the browser..."),Nk(r.verification_uri_complete));let o=Date.now()+r.expires_in*1e3,n=r.interval*1e3,i=null;for(;Date.now()<o;){await XD(n);let s=await Ok(r.device_code);if(s.status==="ok"){i=s.session;break}if(s.status==="slow_down"){n+=5e3;continue}s.status!=="pending"&&(s.status==="expired"&&O("That code expired.",["Run `gamestage login` again."]),O("Sign-in was refused.",[s.reason]))}i||O("Timed out waiting for approval.",["Run `gamestage login` again."]);let a=await km(i);await y$(i,a,e)}async function b$(){let e=await ye();if(await Dk(),j()){U({ok:!0,status:e?"signed_out":"not_signed_in"});return}N(e?"Signed out":"Not signed in"),e&&P("Removed",e.email??"session"),g()}async function w$(){let e=await ye();if(j()){U(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){N("Not signed in"),g(),S("Inspecting, scaffolding and local rounds need no account."),S("Run `gamestage login` when you want to deploy a playground."),g();return}N("Signed in"),P("Account",e.email??"unknown"),e.userId&&P("User",e.userId),g(),S("`gamestage status` says whether this account is approved."),g()}ae();_n();de();import{readdir as eL,readFile as tL,stat as nL}from"node:fs/promises";async function rL(e){let t=[];try{t=await eL(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await nL(`${e}/${a}`),n=!0;try{let s=ie(await tL(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}async function _$(){let e=process.cwd(),t=await rL(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:Pe("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names an archetype but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${Pe("dev")}\` serves the contract fixture rather than your game, and \`${Pe("verify")}\` has nothing to verify.`},play:{command:Pe("dev"),why:"The manifest declares a round. Serve it locally, through the real Engine."},inspect:{command:Pe("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report."},create:{command:Pe("create"),why:"Nothing to inspect. Start a new game from a concept."}};if(j()){U({ok:!0,cwd:e,version:He,detected:t,route:r,next:o[r],docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:ci(),authentication:`Not required for inspect, create, validate or local development. First needed at \`${Pe("deploy")}\`.`});return}N(`Gamestage ${He}`),g($.dim(" Take an agent-built game to production, on the platform behind the")),g($.dim(" world's biggest fan experiences."));let n=await ye().catch(()=>null);if(N("Who you are"),n?.email?(P("Signed in",n.email),g($.dim(` ${Pe("status")} names your workspace and whether it is approved.`))):(g(` Not signed in. ${$.cyan(Pe("login"))} binds this machine to your account.`),g($.dim(" Inspect, create and validate work without it."))),N("Where you are"),t.has_manifest&&t.has_round===!1)g(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)g(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)g(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let i=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);g(` Found ${i.join(" and ")}. This looks like a game to inspect.`)}else g(" Nothing here yet. This looks like a fresh start.");N("Do this next"),g(` ${$.cyan(o[r].command)}`),g(` ${$.dim(o[r].why)}`),N("Good to know"),g($.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
9400
+ need you signed in, because they run your round through a real
9401
+ Engine. \`gamestage login\` creates the account if you do not have
9402
+ one yet. ${ww}`)),g()}var Nr=class extends Error{};function k$(e){let t=e.what.trim();if(!t)throw new Nr("Say what you were trying to build.");if(t.length>2e3)throw new Nr(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function x$(e){return JSON.stringify(e,null,2)}de();var oL=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function S$(e,t,r){let o;try{o=k$({what:e,closest:t.closest,cliVersion:r})}catch(a){throw a instanceof Nr&&O(a.message),a}if(!t.send){if(j()){U({sent:!1,would_send:o});return}N("This is everything that would be sent"),g(),g(x$(o)),g(),S("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),S(`Send it with ${Pe('suggest "..." --send')}.`);return}let n;try{n=await fetch(oL,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){O("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||O(`Gamestage refused that suggestion (${n.status}).`,[i.error?.message??"It said nothing more."]),j()){U({sent:!0,reference:i.reference??null});return}N("Sent"),i.reference&&S(`Reference ${i.reference}. Quote it if you follow up.`),S("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var Rr=class extends Error{};function $$(e){let t=e.what.trim();if(!t)throw new Rr("Say what went wrong.");if(t.length>2e3)throw new Rr(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function E$(e){return JSON.stringify(e,null,2)}de();var iL=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function T$(e,t,r){let o;try{o=$$({what:e,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(a){throw a instanceof Rr&&O(a.message),a}if(!t.send){if(j()){U({sent:!1,would_send:o});return}N("This is everything that would be sent"),g(),g(E$(o)),g(),S("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),S(`Send it with ${Pe('issue "..." --send')}.`);return}let n;try{n=await fetch(iL,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(a){O("Could not reach Gamestage to send that.",[a instanceof Error?a.message:String(a)])}let i=await n.json().catch(()=>({}));if(n.ok||O(`Gamestage refused that report (${n.status}).`,[i.error?.message??"It said nothing more."]),j()){U({sent:!0,reference:i.reference??null});return}N("Reported"),i.reference&&S(`Reference ${i.reference}. Quote it if you follow up.`),S("It is in the backlog now. Somebody at Monterosa reads these.")}ae();dt();de();import{readFile as aL}from"node:fs/promises";import{resolve as sL}from"node:path";async function A$(e){let t=sL(e),r;try{r=await aL(t,"utf8")}catch{O(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){O(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=Vt.safeParse(o);if(!n.success){let i=n.error.issues[0];O(`${e} is not valid reference data.`,[i?`${i.path.join(".")||"document"}: ${i.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:r,measures:n.data.measures.map(i=>i.key)}}function cL(e){let t=Vt.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var lL={copy:"immutable copy",pointer:"reference data"};async function dL(e,t,r){let o=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});o.ok||O(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function I$(e,t){let{client:r}=await le(),{body:o}=await A$(t),n=ps(o),i=await r.referenceUploadTarget(e,n),a=await bk(o,async(d,u)=>{await dL(d==="copy"?i.copy:i.pointer,u,lL[d])});a.ok||O(`${t} is not valid reference data.`,[a.detail??"No detail."]);let{measures:s,counts:c}=a.summary;if(j())return U({ok:!0,name:e,digest:n,measures:s,counts:c,key:i.pointer.key});N("Pushed"),S(`${e} is now the reference data for this workspace`);for(let d of s)S(`${d}: ${c[d].toLocaleString("en-GB")} values`);S(`Digest ${n}, kept so a round can say what it was scored on`),g(),S("A round provisioned from now on uses this. One already in play keeps"),S("the numbers it opened with, which is deliberate.")}async function C$(e,t){let{body:r,measures:o}=await A$(e),n=cL(r),i=Vt.parse(JSON.parse(r)),a={};for(let s of i.measures){let c=t.filter(d=>typeof s.values[d]!="number");c.length&&(a[s.key]=c)}if(j())return U({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});N("Reference data");for(let s of o)S(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){g(),S("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(g(),!Object.keys(a).length){S(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,c]of Object.entries(a))S(`${s} has no value for ${c.map(d=>`"${d}"`).join(", ")}`);O("A round using those keys would be refused rather than scoring them as nothing.")}ae();dt();de();import{readFile as uL}from"node:fs/promises";import{resolve as pL}from"node:path";import{createInterface as hL}from"node:readline/promises";async function mL(e){let t;try{t=await uL(pL(e),"utf8")}catch{O(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=ie(t);r.ok||O(`${e} is not a valid App Manifest.`,r.issues.map(n=>`${n.path} ${n.message}`));let o=r.ok?r.manifest.backend.round:void 0;return o||O(`${e} has no round in it.`,["There is nothing to push. A round lives under `backend.round` while a game is","still being built locally; once it is in Studio it lives there instead."]),o.archetype==="predict"&&O("A prediction's question and options are authored in Studio itself.",["They are the platform's own question and options rather than fields of ours,","which is what lets a producer reveal the answer once the world decides. There","is nothing here to write, and nothing to write it with."]),o}function fL(e){if(N("What goes into Studio"),S(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){S(e.target===void 0?"Target: left blank, so the round is built backwards from a perfect line at provisioning":`Target: ${e.target.toLocaleString()} ${e.targetLabel}`.trim());for(let t of e.slates)S(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);g(),g("No point values go with it. They stay in your reference data, where only"),g("the Engine reads them.")}else{if(S(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")S(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)S(`${t.label}: ${t.members.join(", ")}`);g(),g("The answer goes with it, into a field Studio withholds from a fan's browser."),g("Only a producer signed into Studio can read it.")}g()}async function gL(e,t){if(t)return!0;process.stdin.isTTY||O("Refusing to overwrite Studio without being asked.",[`Nothing has changed on ${e}.`,"Re-run with `--yes` if you mean to replace whatever a producer has typed."]);let r=hL({input:process.stdin,output:process.stdout});try{return(await r.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{r.close()}}async function P$(e,t){let r=t.manifest??"gamestage.yaml",o=await mL(r),n=o.archetype==="push"?Y_(o):o;if(j()||fL(n),!await gL(e,!!t.yes)){g("Nothing was written.");return}try{let{client:i}=await le(),a=await i.seedRound(e,n);a.refused&&O("The round was not written into Studio.",[a.refused]);let s=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:{count:n.board.length,noun:"picks on the board"};U({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),j()||(N("Written"),S(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),S("A producer can change every word of it without another deploy."),S("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),g())}catch(i){_e(i)}}ae();de();import{readFile as yL}from"node:fs/promises";async function O$(e,t){let r;try{r=await yL(e,"utf8")}catch{return O(`Cannot read ${e}`)}let o=ie(r);if(!o.ok)return j()&&(U({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),O(`${e} is not a valid App Manifest`,o.issues.map(d=>`${$.cyan(d.path)} ${d.message}`));let n=o.manifest,i=De(n),a=null;if(t.level){let d=zt.safeParse(t.level.toUpperCase());if(!d.success)return O(`Unknown level "${t.level}". Use L0 through L5.`);a=d.data}let s=a?Sw(n,a):null,c=!i.overclaimed&&(s?.ok??!0);if(j()&&(U({ok:c,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results}),process.exit(c?0:1)),N(`${n.app.title} ${$.dim(n.app.id)}`),P("Schema",n.manifest.schema_version),P("Revision",String(n.manifest.revision)),P("Conformance",i.overclaimed?`${$.red(i.claimed)} claimed, ${$.bold(i.computed)} evidenced`:`${$.green(i.computed)} ${i.computedName}`),i.overclaimed){N("Overclaimed"),g($.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let d of i.blockers)S($.red(d.requirement))}if(a&&s&&!s.ok){N(`Not yet ${a}`);for(let d of s.missing)S(`${$.yellow(d.id)} ${d.requirement}`)}if(c&&(g(),g(` ${$.green("Valid")}${a?` at ${a}`:""}.`),i.blockers.length)){g(),g($.dim(" Next level needs:"));for(let d of i.blockers)g(` ${$.dim("\xB7")} ${d.requirement}`)}g(),process.exit(c?0:1)}var N$={start:"none",doctor:"none",inspect:"none",create:"none",client:"none",suggest:"none",issue:"none","manifest validate":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session",status:"approved",deploy:"approved",archive:"approved",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",logs:"approved","manifest register":"approved","reference push":"approved","round push":"approved","link github":"approved"};function R$(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function D$(e,t){return e.commands.filter(r=>!r._hidden).map(r=>vL(r,t))}function vL(e,t){let r=t?`${t} ${e.name()}`:e.name(),o=!!e._actionHandler;return{name:e.name(),aliases:e.aliases(),summary:e.description(),arguments:e.registeredArguments.map(n=>({name:n.name(),required:n.required,description:n.description,...n.defaultValue===void 0?{}:{default:n.defaultValue}})),options:R$(e),...o?{account:N$[r]??"none"}:{},commands:D$(e,r)}}function L$(e,t){return{name:e.name(),version:t,summary:e.description(),options:R$(e),commands:D$(e,"")}}function j$(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}de();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var J=new In;J.name("gamestage").description("Take an agent-built game prototype to a production fan game.\nInspect, create and validate need no account. `dev` and `verify` need\nyou signed in; publishing a game needs that account approved too.").version(He).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{dg(!!e.opts().json)});J.command("start").description("read the current directory and point at the right next step").action(_$);J.command("doctor").description("check the local environment").action(l$);J.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(p$);J.command("create").option("--name <name>","game name").option("--archetype <archetype>","authority model for the game").option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).description("start a new game, choosing its authority before scaffolding").action(Wk);J.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done (requires sign-in)").action(e=>Vf({...e,noBrowser:e.browser===!1}));J.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(pg);var M$=J.command("manifest").description("work with the App Manifest");M$.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(e$);M$.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(O$);J.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(HS);J.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--no-check","skip loading the published page in a browser afterwards").option("--allow <path...>","publish a file the deploy gate suspects; it never clears a certain finding").description("publish a snapshot to a playground, and the round it puts on").action(JS);var z$=J.command("reference").description("the private data a round is scored against");z$.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").action(I$);z$.command("check").argument("<file>","the JSON file holding it").argument("[keys...]","the keys a round uses, to check they are all present").description("what a round would fail on, before a producer finds out").action(C$);var bL=J.command("round").description("the round a fan plays, and getting it into Studio");bL.command("push").argument("<game>","game id").option("--manifest <path>","manifest the round is read from","gamestage.yaml").option("--yes","do not ask before replacing what a producer has typed",!1).description("write your round into Studio, where a producer owns it from then on").action(P$);J.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(YS);J.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(qS);J.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(XS);J.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(QS);J.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>Qf(e,!1));J.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>Qf(e,!0));J.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(t$);J.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(r$);J.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(c$);J.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("<what>","what you were trying to build").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>S$(e,t,He));J.command("issue").description("report something that went wrong (no account needed)").argument("<what>","what went wrong").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>T$(e,t,He));J.command("login").description("sign in, or create an account (needed before dev, verify or deploy)").option("--workspace <id>","the workspace you expect to land in, from the welcome screen").action(e=>v$(e.workspace));var wL=J.command("link").description("connect an account Gamestage needs (requires sign-in)");wL.command("github").description("link your GitHub account, which a first deploy requires").action(g$);var U$=J.command("admin").description("approve or refuse a creator's account (operators only)");U$.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>Xf(e,"approved"));U$.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>Xf(e,"refused"));J.command("logout").description("forget the stored session").action(b$);J.command("whoami").description("show who the CLI is signed in as").action(w$);j$(process.argv)&&(process.stdout.write(`${JSON.stringify(L$(J,He),null,2)}
9403
+ `),process.exit(0));J.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
9028
9404
  `),process.exit(1)});
9029
9405
  /*! Bundled license information:
9030
9406