@opentabs-dev/opentabs-plugin-priceline 0.0.89 → 0.0.90

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.
@@ -6,596 +6,6 @@
6
6
  __defProp(target, name, { get: all[name], enumerable: true });
7
7
  };
8
8
 
9
- // node_modules/@opentabs-dev/shared/dist/error.js
10
- var toErrorMessage = (err2) => err2 instanceof Error ? err2.message : String(err2);
11
-
12
- // node_modules/@opentabs-dev/plugin-sdk/dist/errors.js
13
- var ToolError = class _ToolError extends Error {
14
- code;
15
- /** Whether this error is retryable (defaults to false). */
16
- retryable;
17
- /** Suggested delay before retrying, in milliseconds. */
18
- retryAfterMs;
19
- /** Error category for structured error classification. */
20
- category;
21
- constructor(message, code, opts) {
22
- super(message);
23
- this.code = code;
24
- this.name = "ToolError";
25
- this.retryable = opts?.retryable ?? false;
26
- this.retryAfterMs = opts?.retryAfterMs;
27
- this.category = opts?.category;
28
- }
29
- /** Authentication or authorization error (not retryable). Accepts an optional domain-specific code. */
30
- static auth(message, code) {
31
- return new _ToolError(message, code ?? "AUTH_ERROR", { category: "auth", retryable: false });
32
- }
33
- /** Resource not found (not retryable). Accepts an optional domain-specific code. */
34
- static notFound(message, code) {
35
- return new _ToolError(message, code ?? "NOT_FOUND", { category: "not_found", retryable: false });
36
- }
37
- /** Rate limited (retryable). Accepts an optional retry delay in milliseconds and an optional domain-specific code. */
38
- static rateLimited(message, retryAfterMs, code) {
39
- return new _ToolError(message, code ?? "RATE_LIMITED", { category: "rate_limit", retryable: true, retryAfterMs });
40
- }
41
- /** Input validation error (not retryable). Accepts an optional domain-specific code. */
42
- static validation(message, code) {
43
- return new _ToolError(message, code ?? "VALIDATION_ERROR", { category: "validation", retryable: false });
44
- }
45
- /** Operation timed out (retryable). Accepts an optional domain-specific code. */
46
- static timeout(message, code) {
47
- return new _ToolError(message, code ?? "TIMEOUT", { category: "timeout", retryable: true });
48
- }
49
- /** Internal/unexpected error (not retryable). Accepts an optional domain-specific code. */
50
- static internal(message, code) {
51
- return new _ToolError(message, code ?? "INTERNAL_ERROR", { category: "internal", retryable: false });
52
- }
53
- };
54
-
55
- // node_modules/@opentabs-dev/plugin-sdk/dist/fetch.js
56
- var MAX_ERROR_BODY_LENGTH = 512;
57
- var httpStatusToToolError = (response, message) => {
58
- const status = response.status;
59
- if (status === 401 || status === 403) {
60
- return ToolError.auth(message);
61
- }
62
- if (status === 404) {
63
- return ToolError.notFound(message);
64
- }
65
- if (status === 429) {
66
- const retryAfter = response.headers.get("Retry-After");
67
- const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
68
- return ToolError.rateLimited(message, retryAfterMs);
69
- }
70
- if (status === 400 || status === 422) {
71
- return ToolError.validation(message);
72
- }
73
- if (status === 408) {
74
- return ToolError.timeout(message);
75
- }
76
- if (status >= 500) {
77
- const TRANSIENT_5XX = /* @__PURE__ */ new Set([500, 502, 503, 504]);
78
- const retryable = TRANSIENT_5XX.has(status);
79
- const retryAfter = status === 503 ? response.headers.get("Retry-After") : null;
80
- const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
81
- return new ToolError(message, "http_error", { category: "internal", retryable, retryAfterMs });
82
- }
83
- if (status >= 400 && status < 500) {
84
- return new ToolError(message, "http_error", { retryable: false });
85
- }
86
- return new ToolError(message, "http_error", { category: "internal" });
87
- };
88
- var parseRetryAfterMs = (value) => {
89
- const seconds = Number(value);
90
- if (!Number.isNaN(seconds) && seconds >= 0) {
91
- return seconds * 1e3;
92
- }
93
- const date5 = Date.parse(value);
94
- if (!Number.isNaN(date5)) {
95
- const ms = date5 - Date.now();
96
- return ms > 0 ? ms : void 0;
97
- }
98
- return void 0;
99
- };
100
- var buildQueryString = (params) => {
101
- const searchParams = new URLSearchParams();
102
- for (const [key, value] of Object.entries(params)) {
103
- if (value === void 0)
104
- continue;
105
- if (Array.isArray(value)) {
106
- for (const item of value) {
107
- searchParams.append(key, String(item));
108
- }
109
- } else {
110
- searchParams.append(key, String(value));
111
- }
112
- }
113
- return searchParams.toString();
114
- };
115
- var fetchFromPage = async (url2, init) => {
116
- const { timeout = 3e4, signal, ...rest2 } = init ?? {};
117
- const timeoutSignal = AbortSignal.timeout(timeout);
118
- const combinedSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
119
- let response;
120
- try {
121
- response = await fetch(url2, {
122
- credentials: "include",
123
- ...rest2,
124
- signal: combinedSignal
125
- });
126
- } catch (error51) {
127
- if (error51 instanceof DOMException && error51.name === "TimeoutError") {
128
- throw ToolError.timeout(`fetchFromPage: request timed out after ${timeout}ms for ${url2}`);
129
- }
130
- if (combinedSignal.aborted) {
131
- throw new ToolError(`fetchFromPage: request aborted for ${url2}`, "aborted");
132
- }
133
- throw new ToolError(`fetchFromPage: network error for ${url2}: ${toErrorMessage(error51)}`, "network_error", {
134
- category: "internal",
135
- retryable: true
136
- });
137
- }
138
- if (!response.ok) {
139
- const rawText = await response.text().catch(() => response.statusText);
140
- const errorText = rawText.length > MAX_ERROR_BODY_LENGTH ? `${rawText.slice(0, MAX_ERROR_BODY_LENGTH)}\u2026` : rawText;
141
- const msg = `fetchFromPage: HTTP ${response.status} for ${url2}: ${errorText}`;
142
- throw httpStatusToToolError(response, msg);
143
- }
144
- return response;
145
- };
146
- var fetchJSONImpl = async (url2, init, schema) => {
147
- const response = await fetchFromPage(url2, init);
148
- let data;
149
- if (response.status === 204 || response.headers.get("content-length") === "0") {
150
- if (!schema) {
151
- return void 0;
152
- }
153
- throw ToolError.validation(`fetchJSON: expected JSON response from ${url2} but received HTTP ${response.status} with no body to validate`);
154
- } else {
155
- try {
156
- data = await response.json();
157
- } catch {
158
- throw ToolError.validation(`fetchJSON: failed to parse JSON response from ${url2}`);
159
- }
160
- }
161
- if (schema) {
162
- const result = schema.safeParse(data);
163
- if (!result.success) {
164
- throw ToolError.validation(`fetchJSON: response from ${url2} failed schema validation: ${result.error.message}`);
165
- }
166
- return result.data;
167
- }
168
- return data;
169
- };
170
- var fetchJSON = fetchJSONImpl;
171
-
172
- // node_modules/@opentabs-dev/plugin-sdk/dist/timing.js
173
- var waitUntil = (predicate, opts) => {
174
- const interval = opts?.interval ?? 200;
175
- const timeout = opts?.timeout ?? 1e4;
176
- const signal = opts?.signal;
177
- const abortReason = () => signal?.reason instanceof Error ? signal.reason : new Error("waitUntil: aborted");
178
- if (signal?.aborted)
179
- return Promise.reject(abortReason());
180
- return new Promise((resolve, reject) => {
181
- let settled = false;
182
- let poller;
183
- let lastPredicateError;
184
- const isSettled = () => settled;
185
- const cleanup = () => {
186
- settled = true;
187
- clearTimeout(timer);
188
- clearTimeout(poller);
189
- signal?.removeEventListener("abort", onAbort);
190
- };
191
- const onAbort = () => {
192
- if (isSettled())
193
- return;
194
- cleanup();
195
- reject(abortReason());
196
- };
197
- signal?.addEventListener("abort", onAbort, { once: true });
198
- const timer = setTimeout(() => {
199
- if (isSettled())
200
- return;
201
- cleanup();
202
- const errorContext = lastPredicateError instanceof Error ? `: predicate last threw \u2014 ${lastPredicateError.message}` : "";
203
- reject(new Error(`waitUntil: timed out after ${timeout}ms waiting for predicate to return true${errorContext}`));
204
- }, timeout);
205
- const check2 = async () => {
206
- if (isSettled())
207
- return;
208
- try {
209
- const result = await predicate();
210
- if (result) {
211
- cleanup();
212
- resolve();
213
- return;
214
- }
215
- } catch (err2) {
216
- lastPredicateError = err2;
217
- }
218
- if (!isSettled()) {
219
- poller = setTimeout(() => void check2(), interval);
220
- }
221
- };
222
- void check2();
223
- });
224
- };
225
-
226
- // node_modules/@opentabs-dev/plugin-sdk/dist/log.js
227
- var MAX_DATA_LENGTH = 10;
228
- var MAX_STRING_LENGTH = 4096;
229
- var MAX_SERIALIZED_SIZE = 64 * 1024;
230
- var safeSerializeArg = (value) => {
231
- try {
232
- if (value === null || value === void 0)
233
- return value;
234
- const type = typeof value;
235
- if (type === "boolean" || type === "number")
236
- return value;
237
- if (type === "string") {
238
- return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
239
- }
240
- if (type === "function")
241
- return `[Function: ${value.name || "anonymous"}]`;
242
- if (type === "symbol")
243
- return `[Symbol: ${value.description ?? ""}]`;
244
- if (type === "bigint")
245
- return `[BigInt: ${value.toString()}]`;
246
- if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
247
- try {
248
- const node = value;
249
- let classStr = "";
250
- if (typeof node.className === "string") {
251
- classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
252
- } else if (node.className !== null && typeof node.className === "object") {
253
- const baseVal = node.className.baseVal;
254
- if (typeof baseVal === "string") {
255
- classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
256
- }
257
- }
258
- return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
259
- } catch {
260
- }
261
- }
262
- if (value instanceof Error) {
263
- return { name: value.name, message: value.message, stack: value.stack };
264
- }
265
- if (value instanceof WeakRef)
266
- return "[WeakRef]";
267
- if (value instanceof WeakMap)
268
- return "[WeakMap]";
269
- if (value instanceof WeakSet)
270
- return "[WeakSet]";
271
- if (value instanceof ArrayBuffer)
272
- return "[ArrayBuffer]";
273
- if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
274
- return "[SharedArrayBuffer]";
275
- try {
276
- const seen = /* @__PURE__ */ new WeakSet();
277
- const json2 = JSON.stringify(value, (_key, v) => {
278
- if (typeof v === "object" && v !== null) {
279
- if (seen.has(v))
280
- return "[Circular]";
281
- seen.add(v);
282
- }
283
- if (typeof v === "function")
284
- return `[Function: ${v.name || "anonymous"}]`;
285
- if (typeof v === "bigint")
286
- return `[BigInt: ${v.toString()}]`;
287
- if (typeof v === "symbol")
288
- return `[Symbol: ${v.description ?? ""}]`;
289
- if (v instanceof WeakRef)
290
- return "[WeakRef]";
291
- if (v instanceof WeakMap)
292
- return "[WeakMap]";
293
- if (v instanceof WeakSet)
294
- return "[WeakSet]";
295
- if (v instanceof ArrayBuffer)
296
- return "[ArrayBuffer]";
297
- if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
298
- return "[SharedArrayBuffer]";
299
- return v;
300
- });
301
- if (json2.length > MAX_SERIALIZED_SIZE) {
302
- return `[Object truncated: ${json2.length} chars]`;
303
- }
304
- return JSON.parse(json2);
305
- } catch {
306
- return `[Unserializable: ${typeof value}]`;
307
- }
308
- } catch {
309
- return `[Unserializable: ${typeof value}]`;
310
- }
311
- };
312
- var safeSerialize = (args) => {
313
- const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
314
- return capped.map(safeSerializeArg);
315
- };
316
- var CONSOLE_METHODS = {
317
- debug: "debug",
318
- info: "info",
319
- warning: "warn",
320
- error: "error"
321
- };
322
- var defaultTransport = (entry) => {
323
- const method = CONSOLE_METHODS[entry.level];
324
- console[method](`[sdk.log] ${entry.message}`, ...entry.data);
325
- };
326
- var activeTransport = defaultTransport;
327
- var _setLogTransport = (transport) => {
328
- const previous = activeTransport;
329
- activeTransport = transport;
330
- return () => {
331
- if (activeTransport === transport)
332
- activeTransport = previous;
333
- };
334
- };
335
- var makeLogMethod = (level) => (message, ...args) => {
336
- const entry = {
337
- level,
338
- message,
339
- data: safeSerialize(args),
340
- ts: (/* @__PURE__ */ new Date()).toISOString()
341
- };
342
- activeTransport(entry);
343
- };
344
- var log = Object.freeze({
345
- debug: makeLogMethod("debug"),
346
- info: makeLogMethod("info"),
347
- warn: makeLogMethod("warning"),
348
- error: makeLogMethod("error")
349
- });
350
- var ot = globalThis.__openTabs ?? {};
351
- globalThis.__openTabs = ot;
352
- ot._setLogTransport = _setLogTransport;
353
- ot.log = log;
354
-
355
- // node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
356
- var withIframeFallback = (fn) => {
357
- try {
358
- const iframe = document.createElement("iframe");
359
- iframe.style.display = "none";
360
- document.body.appendChild(iframe);
361
- try {
362
- const iframeStorage = iframe.contentWindow?.localStorage;
363
- return iframeStorage ? fn(iframeStorage) : null;
364
- } finally {
365
- document.body.removeChild(iframe);
366
- }
367
- } catch {
368
- return null;
369
- }
370
- };
371
- var getWindowLocalStorage = () => window.localStorage;
372
- var getLocalStorage = (key) => {
373
- let storage;
374
- try {
375
- storage = getWindowLocalStorage();
376
- } catch {
377
- return null;
378
- }
379
- if (storage) {
380
- try {
381
- return storage.getItem(key);
382
- } catch {
383
- return null;
384
- }
385
- }
386
- return withIframeFallback((s) => s.getItem(key));
387
- };
388
- var getCookie = (name) => {
389
- try {
390
- const prefix = `${name}=`;
391
- const entries = document.cookie.split("; ");
392
- for (const entry of entries) {
393
- if (entry.startsWith(prefix)) {
394
- try {
395
- return decodeURIComponent(entry.slice(prefix.length));
396
- } catch {
397
- return entry.slice(prefix.length);
398
- }
399
- }
400
- }
401
- return null;
402
- } catch {
403
- return null;
404
- }
405
- };
406
- var getAuthCache = (namespace) => {
407
- try {
408
- const ns = globalThis.__openTabs;
409
- const cache = ns?.tokenCache;
410
- return cache?.[namespace] ?? null;
411
- } catch {
412
- return null;
413
- }
414
- };
415
- var setAuthCache = (namespace, value) => {
416
- try {
417
- const g = globalThis;
418
- if (!g.__openTabs)
419
- g.__openTabs = {};
420
- const ns = g.__openTabs;
421
- if (!ns.tokenCache)
422
- ns.tokenCache = {};
423
- ns.tokenCache[namespace] = value;
424
- } catch {
425
- }
426
- };
427
- var clearAuthCache = (namespace) => {
428
- try {
429
- const ns = globalThis.__openTabs;
430
- const cache = ns?.tokenCache;
431
- if (cache)
432
- cache[namespace] = void 0;
433
- } catch {
434
- }
435
- };
436
-
437
- // node_modules/@opentabs-dev/plugin-sdk/dist/index.js
438
- var defineTool = (config2) => config2;
439
- var OpenTabsPlugin = class {
440
- /**
441
- * Chrome match patterns for URLs that should NOT match this plugin.
442
- * Tabs matching both urlPatterns and excludePatterns are excluded.
443
- * Useful when a broad urlPattern overlaps with another plugin's domain.
444
- * @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
445
- */
446
- excludePatterns;
447
- /**
448
- * URL to open when no matching tab exists and the user triggers an
449
- * 'open tab' action from the side panel. Should be a concrete URL
450
- * (e.g., 'https://github.com'), not a match pattern.
451
- */
452
- homepage;
453
- /** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
454
- configSchema;
455
- };
456
-
457
- // src/priceline-api.ts
458
- var GRAPH_BASE = "https://www.priceline.com/pws/v0/pcln-graph/?gqlOp=";
459
- var FLY_GRAPH_URL = "https://www.priceline.com/pws/v0/fly/graph/query";
460
- var REST_BASE = "https://www.priceline.com/pws/v0";
461
- var AC_BASE = "https://www.priceline.com/svcs/ac/index";
462
- var decodeJwtPayload = (jwt2) => {
463
- try {
464
- const parts = jwt2.split(".");
465
- const encoded = parts[1];
466
- if (parts.length !== 3 || !encoded) return null;
467
- const payload = atob(encoded.replace(/-/g, "+").replace(/_/g, "/"));
468
- return JSON.parse(payload);
469
- } catch {
470
- return null;
471
- }
472
- };
473
- var getAuth = () => {
474
- const cached2 = getAuthCache("priceline");
475
- if (cached2) return cached2;
476
- const oktaRaw = getLocalStorage("okta-token-storage");
477
- if (!oktaRaw) return null;
478
- let okta;
479
- try {
480
- okta = JSON.parse(oktaRaw);
481
- } catch {
482
- return null;
483
- }
484
- const accessTokenObj = okta.accessToken;
485
- const accessToken = accessTokenObj?.accessToken;
486
- if (!accessToken) return null;
487
- const claims = decodeJwtPayload(accessToken);
488
- if (!claims) return null;
489
- const authToken = claims["com.priceline.token.dmc.value"];
490
- const email3 = claims.sub;
491
- if (!authToken || !email3) return null;
492
- const cguid = getCookie("PL_CINFO")?.split("~")[0] ?? "";
493
- const auth = { accessToken, authToken, email: email3, cguid };
494
- setAuthCache("priceline", auth);
495
- return auth;
496
- };
497
- var isAuthenticated = () => getAuth() !== null;
498
- var waitForAuth = async () => {
499
- try {
500
- await waitUntil(() => isAuthenticated(), {
501
- interval: 500,
502
- timeout: 5e3
503
- });
504
- return true;
505
- } catch {
506
- return false;
507
- }
508
- };
509
- var requireAuth = () => {
510
- const auth = getAuth();
511
- if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to Priceline.");
512
- return auth;
513
- };
514
- var getEmail = () => requireAuth().email;
515
- var getCguid = () => requireAuth().cguid;
516
- var getAuthToken = () => requireAuth().authToken;
517
- var graphql = async (operationName, variables, queryOrPersistedHash) => {
518
- const auth = requireAuth();
519
- const url2 = `${GRAPH_BASE}${operationName}`;
520
- const reqBody = {
521
- operationName,
522
- variables
523
- };
524
- const isPersistedHash = typeof queryOrPersistedHash === "string" && /^[a-f0-9]{64}$/.test(queryOrPersistedHash);
525
- if (queryOrPersistedHash && isPersistedHash) {
526
- reqBody.extensions = {
527
- persistedQuery: { version: 1, sha256Hash: queryOrPersistedHash }
528
- };
529
- } else if (queryOrPersistedHash) {
530
- reqBody.query = queryOrPersistedHash;
531
- }
532
- const headers = {
533
- "Content-Type": "application/json",
534
- Authorization: `Bearer ${auth.accessToken}`,
535
- authToken: auth.authToken,
536
- "apollographql-client-name": "relax",
537
- "apollographql-client-version": "master-1.1.1403-v3"
538
- };
539
- const init = {
540
- method: "POST",
541
- headers,
542
- body: JSON.stringify(reqBody)
543
- };
544
- const resp = await fetchJSON(url2, init) ?? {};
545
- const errors = resp.errors ?? [];
546
- const data = resp.data;
547
- if (errors.length > 0 && !data) {
548
- const firstError = errors[0] ?? {};
549
- const code = firstError.extensions?.code ?? "";
550
- const message = firstError.message ?? "Unknown GraphQL error";
551
- if (code === "PERSISTED_QUERY_NOT_FOUND" || message.includes("persisted_query_not_found")) {
552
- throw ToolError.internal(
553
- `Persisted query hash expired for ${operationName} \u2014 Priceline may have deployed a new client version.`
554
- );
555
- }
556
- if (code === "UNAUTHENTICATED" || message.includes("not authorized")) {
557
- clearAuthCache("priceline");
558
- throw ToolError.auth(`Auth error: ${message}`);
559
- }
560
- throw ToolError.internal(`GraphQL error (${operationName}): ${message}`);
561
- }
562
- return data ?? resp;
563
- };
564
- var rest = async (endpoint, query) => {
565
- const qs = query ? buildQueryString(query) : "";
566
- const url2 = qs ? `${REST_BASE}${endpoint}?${qs}` : `${REST_BASE}${endpoint}`;
567
- const data = await fetchJSON(url2);
568
- if (data === void 0) throw ToolError.internal(`Empty response from ${endpoint}`);
569
- return data;
570
- };
571
- var autocomplete = async (product, query) => {
572
- const encoded = encodeURIComponent(query);
573
- const url2 = `${AC_BASE}/${product}/${encoded}/0/9/0/0`;
574
- const data = await fetchJSON(url2);
575
- return data?.searchItems ?? [];
576
- };
577
- var flyGraphql = async (operationName, variables, query) => {
578
- const headers = {
579
- "Content-Type": "application/json",
580
- "apollographql-client-name": "m-fly-search",
581
- "apollographql-client-version": "main-0.0.19"
582
- };
583
- const resp = await fetchJSON(FLY_GRAPH_URL, {
584
- method: "POST",
585
- headers,
586
- body: JSON.stringify({ operationName, variables, query })
587
- }) ?? {};
588
- const errors = resp.errors ?? [];
589
- if (errors.length > 0 && !resp.data) {
590
- const first = errors[0] ?? {};
591
- const code = first.extensions?.code ?? "";
592
- const message = first.message ?? "Unknown GraphQL error";
593
- if (code === "UNAUTHENTICATED") throw ToolError.auth(`Auth error: ${message}`);
594
- throw ToolError.internal(`GraphQL error (${operationName}): ${message}`);
595
- }
596
- return resp.data ?? {};
597
- };
598
-
599
9
  // node_modules/zod/v4/classic/external.js
600
10
  var external_exports = {};
601
11
  __export(external_exports, {
@@ -14530,585 +13940,1175 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14530
13940
  function refine(fn, _params = {}) {
14531
13941
  return _refine(ZodCustom, fn, _params);
14532
13942
  }
14533
- function superRefine(fn, params) {
14534
- return _superRefine(fn, params);
13943
+ function superRefine(fn, params) {
13944
+ return _superRefine(fn, params);
13945
+ }
13946
+ var describe2 = describe;
13947
+ var meta2 = meta;
13948
+ function _instanceof(cls, params = {}) {
13949
+ const inst = new ZodCustom({
13950
+ type: "custom",
13951
+ check: "custom",
13952
+ fn: (data) => data instanceof cls,
13953
+ abort: true,
13954
+ ...util_exports.normalizeParams(params)
13955
+ });
13956
+ inst._zod.bag.Class = cls;
13957
+ inst._zod.check = (payload) => {
13958
+ if (!(payload.value instanceof cls)) {
13959
+ payload.issues.push({
13960
+ code: "invalid_type",
13961
+ expected: cls.name,
13962
+ input: payload.value,
13963
+ inst,
13964
+ path: [...inst._zod.def.path ?? []]
13965
+ });
13966
+ }
13967
+ };
13968
+ return inst;
13969
+ }
13970
+ var stringbool = (...args) => _stringbool({
13971
+ Codec: ZodCodec,
13972
+ Boolean: ZodBoolean,
13973
+ String: ZodString
13974
+ }, ...args);
13975
+ function json(params) {
13976
+ const jsonSchema = lazy(() => {
13977
+ return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
13978
+ });
13979
+ return jsonSchema;
13980
+ }
13981
+ function preprocess(fn, schema) {
13982
+ return new ZodPreprocess({
13983
+ type: "pipe",
13984
+ in: transform(fn),
13985
+ out: schema
13986
+ });
13987
+ }
13988
+
13989
+ // node_modules/zod/v4/classic/compat.js
13990
+ var ZodIssueCode = {
13991
+ invalid_type: "invalid_type",
13992
+ too_big: "too_big",
13993
+ too_small: "too_small",
13994
+ invalid_format: "invalid_format",
13995
+ not_multiple_of: "not_multiple_of",
13996
+ unrecognized_keys: "unrecognized_keys",
13997
+ invalid_union: "invalid_union",
13998
+ invalid_key: "invalid_key",
13999
+ invalid_element: "invalid_element",
14000
+ invalid_value: "invalid_value",
14001
+ custom: "custom"
14002
+ };
14003
+ function setErrorMap(map2) {
14004
+ config({
14005
+ customError: map2
14006
+ });
14007
+ }
14008
+ function getErrorMap() {
14009
+ return config().customError;
14010
+ }
14011
+ var ZodFirstPartyTypeKind;
14012
+ /* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
14013
+ })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
14014
+
14015
+ // node_modules/zod/v4/classic/from-json-schema.js
14016
+ var z = {
14017
+ ...schemas_exports2,
14018
+ ...checks_exports2,
14019
+ iso: iso_exports
14020
+ };
14021
+ var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
14022
+ // Schema identification
14023
+ "$schema",
14024
+ "$ref",
14025
+ "$defs",
14026
+ "definitions",
14027
+ // Core schema keywords
14028
+ "$id",
14029
+ "id",
14030
+ "$comment",
14031
+ "$anchor",
14032
+ "$vocabulary",
14033
+ "$dynamicRef",
14034
+ "$dynamicAnchor",
14035
+ // Type
14036
+ "type",
14037
+ "enum",
14038
+ "const",
14039
+ // Composition
14040
+ "anyOf",
14041
+ "oneOf",
14042
+ "allOf",
14043
+ "not",
14044
+ // Object
14045
+ "properties",
14046
+ "required",
14047
+ "additionalProperties",
14048
+ "patternProperties",
14049
+ "propertyNames",
14050
+ "minProperties",
14051
+ "maxProperties",
14052
+ // Array
14053
+ "items",
14054
+ "prefixItems",
14055
+ "additionalItems",
14056
+ "minItems",
14057
+ "maxItems",
14058
+ "uniqueItems",
14059
+ "contains",
14060
+ "minContains",
14061
+ "maxContains",
14062
+ // String
14063
+ "minLength",
14064
+ "maxLength",
14065
+ "pattern",
14066
+ "format",
14067
+ // Number
14068
+ "minimum",
14069
+ "maximum",
14070
+ "exclusiveMinimum",
14071
+ "exclusiveMaximum",
14072
+ "multipleOf",
14073
+ // Already handled metadata
14074
+ "description",
14075
+ "default",
14076
+ // Content
14077
+ "contentEncoding",
14078
+ "contentMediaType",
14079
+ "contentSchema",
14080
+ // Unsupported (error-throwing)
14081
+ "unevaluatedItems",
14082
+ "unevaluatedProperties",
14083
+ "if",
14084
+ "then",
14085
+ "else",
14086
+ "dependentSchemas",
14087
+ "dependentRequired",
14088
+ // OpenAPI
14089
+ "nullable",
14090
+ "readOnly"
14091
+ ]);
14092
+ function detectVersion(schema, defaultTarget) {
14093
+ const $schema = schema.$schema;
14094
+ if ($schema === "https://json-schema.org/draft/2020-12/schema") {
14095
+ return "draft-2020-12";
14096
+ }
14097
+ if ($schema === "http://json-schema.org/draft-07/schema#") {
14098
+ return "draft-7";
14099
+ }
14100
+ if ($schema === "http://json-schema.org/draft-04/schema#") {
14101
+ return "draft-4";
14102
+ }
14103
+ return defaultTarget ?? "draft-2020-12";
14104
+ }
14105
+ function resolveRef(ref, ctx) {
14106
+ if (!ref.startsWith("#")) {
14107
+ throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
14108
+ }
14109
+ const path = ref.slice(1).split("/").filter(Boolean);
14110
+ if (path.length === 0) {
14111
+ return ctx.rootSchema;
14112
+ }
14113
+ const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
14114
+ if (path[0] === defsKey) {
14115
+ const key = path[1];
14116
+ if (!key || !ctx.defs[key]) {
14117
+ throw new Error(`Reference not found: ${ref}`);
14118
+ }
14119
+ return ctx.defs[key];
14120
+ }
14121
+ throw new Error(`Reference not found: ${ref}`);
14535
14122
  }
14536
- var describe2 = describe;
14537
- var meta2 = meta;
14538
- function _instanceof(cls, params = {}) {
14539
- const inst = new ZodCustom({
14540
- type: "custom",
14541
- check: "custom",
14542
- fn: (data) => data instanceof cls,
14543
- abort: true,
14544
- ...util_exports.normalizeParams(params)
14545
- });
14546
- inst._zod.bag.Class = cls;
14547
- inst._zod.check = (payload) => {
14548
- if (!(payload.value instanceof cls)) {
14549
- payload.issues.push({
14550
- code: "invalid_type",
14551
- expected: cls.name,
14552
- input: payload.value,
14553
- inst,
14554
- path: [...inst._zod.def.path ?? []]
14123
+ function convertBaseSchema(schema, ctx) {
14124
+ if (schema.not !== void 0) {
14125
+ if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
14126
+ return z.never();
14127
+ }
14128
+ throw new Error("not is not supported in Zod (except { not: {} } for never)");
14129
+ }
14130
+ if (schema.unevaluatedItems !== void 0) {
14131
+ throw new Error("unevaluatedItems is not supported");
14132
+ }
14133
+ if (schema.unevaluatedProperties !== void 0) {
14134
+ throw new Error("unevaluatedProperties is not supported");
14135
+ }
14136
+ if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
14137
+ throw new Error("Conditional schemas (if/then/else) are not supported");
14138
+ }
14139
+ if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
14140
+ throw new Error("dependentSchemas and dependentRequired are not supported");
14141
+ }
14142
+ if (schema.$ref) {
14143
+ const refPath = schema.$ref;
14144
+ if (ctx.refs.has(refPath)) {
14145
+ return ctx.refs.get(refPath);
14146
+ }
14147
+ if (ctx.processing.has(refPath)) {
14148
+ return z.lazy(() => {
14149
+ if (!ctx.refs.has(refPath)) {
14150
+ throw new Error(`Circular reference not resolved: ${refPath}`);
14151
+ }
14152
+ return ctx.refs.get(refPath);
14555
14153
  });
14556
14154
  }
14557
- };
14558
- return inst;
14155
+ ctx.processing.add(refPath);
14156
+ const resolved = resolveRef(refPath, ctx);
14157
+ const zodSchema2 = convertSchema(resolved, ctx);
14158
+ ctx.refs.set(refPath, zodSchema2);
14159
+ ctx.processing.delete(refPath);
14160
+ return zodSchema2;
14161
+ }
14162
+ if (schema.enum !== void 0) {
14163
+ const enumValues = schema.enum;
14164
+ if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
14165
+ return z.null();
14166
+ }
14167
+ if (enumValues.length === 0) {
14168
+ return z.never();
14169
+ }
14170
+ if (enumValues.length === 1) {
14171
+ return z.literal(enumValues[0]);
14172
+ }
14173
+ if (enumValues.every((v) => typeof v === "string")) {
14174
+ return z.enum(enumValues);
14175
+ }
14176
+ const literalSchemas = enumValues.map((v) => z.literal(v));
14177
+ if (literalSchemas.length < 2) {
14178
+ return literalSchemas[0];
14179
+ }
14180
+ return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
14181
+ }
14182
+ if (schema.const !== void 0) {
14183
+ return z.literal(schema.const);
14184
+ }
14185
+ const type = schema.type;
14186
+ if (Array.isArray(type)) {
14187
+ const typeSchemas = type.map((t) => {
14188
+ const typeSchema = { ...schema, type: t };
14189
+ return convertBaseSchema(typeSchema, ctx);
14190
+ });
14191
+ if (typeSchemas.length === 0) {
14192
+ return z.never();
14193
+ }
14194
+ if (typeSchemas.length === 1) {
14195
+ return typeSchemas[0];
14196
+ }
14197
+ return z.union(typeSchemas);
14198
+ }
14199
+ if (!type) {
14200
+ return z.any();
14201
+ }
14202
+ let zodSchema;
14203
+ switch (type) {
14204
+ case "string": {
14205
+ let stringSchema = z.string();
14206
+ if (schema.format) {
14207
+ const format = schema.format;
14208
+ if (format === "email") {
14209
+ stringSchema = stringSchema.check(z.email());
14210
+ } else if (format === "uri" || format === "uri-reference") {
14211
+ stringSchema = stringSchema.check(z.url());
14212
+ } else if (format === "uuid" || format === "guid") {
14213
+ stringSchema = stringSchema.check(z.uuid());
14214
+ } else if (format === "date-time") {
14215
+ stringSchema = stringSchema.check(z.iso.datetime());
14216
+ } else if (format === "date") {
14217
+ stringSchema = stringSchema.check(z.iso.date());
14218
+ } else if (format === "time") {
14219
+ stringSchema = stringSchema.check(z.iso.time());
14220
+ } else if (format === "duration") {
14221
+ stringSchema = stringSchema.check(z.iso.duration());
14222
+ } else if (format === "ipv4") {
14223
+ stringSchema = stringSchema.check(z.ipv4());
14224
+ } else if (format === "ipv6") {
14225
+ stringSchema = stringSchema.check(z.ipv6());
14226
+ } else if (format === "mac") {
14227
+ stringSchema = stringSchema.check(z.mac());
14228
+ } else if (format === "cidr") {
14229
+ stringSchema = stringSchema.check(z.cidrv4());
14230
+ } else if (format === "cidr-v6") {
14231
+ stringSchema = stringSchema.check(z.cidrv6());
14232
+ } else if (format === "base64") {
14233
+ stringSchema = stringSchema.check(z.base64());
14234
+ } else if (format === "base64url") {
14235
+ stringSchema = stringSchema.check(z.base64url());
14236
+ } else if (format === "e164") {
14237
+ stringSchema = stringSchema.check(z.e164());
14238
+ } else if (format === "jwt") {
14239
+ stringSchema = stringSchema.check(z.jwt());
14240
+ } else if (format === "emoji") {
14241
+ stringSchema = stringSchema.check(z.emoji());
14242
+ } else if (format === "nanoid") {
14243
+ stringSchema = stringSchema.check(z.nanoid());
14244
+ } else if (format === "cuid") {
14245
+ stringSchema = stringSchema.check(z.cuid());
14246
+ } else if (format === "cuid2") {
14247
+ stringSchema = stringSchema.check(z.cuid2());
14248
+ } else if (format === "ulid") {
14249
+ stringSchema = stringSchema.check(z.ulid());
14250
+ } else if (format === "xid") {
14251
+ stringSchema = stringSchema.check(z.xid());
14252
+ } else if (format === "ksuid") {
14253
+ stringSchema = stringSchema.check(z.ksuid());
14254
+ }
14255
+ }
14256
+ if (typeof schema.minLength === "number") {
14257
+ stringSchema = stringSchema.min(schema.minLength);
14258
+ }
14259
+ if (typeof schema.maxLength === "number") {
14260
+ stringSchema = stringSchema.max(schema.maxLength);
14261
+ }
14262
+ if (schema.pattern) {
14263
+ stringSchema = stringSchema.regex(new RegExp(schema.pattern));
14264
+ }
14265
+ zodSchema = stringSchema;
14266
+ break;
14267
+ }
14268
+ case "number":
14269
+ case "integer": {
14270
+ let numberSchema = type === "integer" ? z.number().int() : z.number();
14271
+ if (typeof schema.minimum === "number") {
14272
+ numberSchema = numberSchema.min(schema.minimum);
14273
+ }
14274
+ if (typeof schema.maximum === "number") {
14275
+ numberSchema = numberSchema.max(schema.maximum);
14276
+ }
14277
+ if (typeof schema.exclusiveMinimum === "number") {
14278
+ numberSchema = numberSchema.gt(schema.exclusiveMinimum);
14279
+ } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
14280
+ numberSchema = numberSchema.gt(schema.minimum);
14281
+ }
14282
+ if (typeof schema.exclusiveMaximum === "number") {
14283
+ numberSchema = numberSchema.lt(schema.exclusiveMaximum);
14284
+ } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
14285
+ numberSchema = numberSchema.lt(schema.maximum);
14286
+ }
14287
+ if (typeof schema.multipleOf === "number") {
14288
+ numberSchema = numberSchema.multipleOf(schema.multipleOf);
14289
+ }
14290
+ zodSchema = numberSchema;
14291
+ break;
14292
+ }
14293
+ case "boolean": {
14294
+ zodSchema = z.boolean();
14295
+ break;
14296
+ }
14297
+ case "null": {
14298
+ zodSchema = z.null();
14299
+ break;
14300
+ }
14301
+ case "object": {
14302
+ const shape = {};
14303
+ const properties = schema.properties || {};
14304
+ const requiredSet = new Set(schema.required || []);
14305
+ for (const [key, propSchema] of Object.entries(properties)) {
14306
+ const propZodSchema = convertSchema(propSchema, ctx);
14307
+ shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
14308
+ }
14309
+ if (schema.propertyNames) {
14310
+ const keySchema = convertSchema(schema.propertyNames, ctx);
14311
+ const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
14312
+ if (Object.keys(shape).length === 0) {
14313
+ zodSchema = z.record(keySchema, valueSchema);
14314
+ break;
14315
+ }
14316
+ const objectSchema2 = z.object(shape).passthrough();
14317
+ const recordSchema = z.looseRecord(keySchema, valueSchema);
14318
+ zodSchema = z.intersection(objectSchema2, recordSchema);
14319
+ break;
14320
+ }
14321
+ if (schema.patternProperties) {
14322
+ const patternProps = schema.patternProperties;
14323
+ const patternKeys = Object.keys(patternProps);
14324
+ const looseRecords = [];
14325
+ for (const pattern of patternKeys) {
14326
+ const patternValue = convertSchema(patternProps[pattern], ctx);
14327
+ const keySchema = z.string().regex(new RegExp(pattern));
14328
+ looseRecords.push(z.looseRecord(keySchema, patternValue));
14329
+ }
14330
+ const schemasToIntersect = [];
14331
+ if (Object.keys(shape).length > 0) {
14332
+ schemasToIntersect.push(z.object(shape).passthrough());
14333
+ }
14334
+ schemasToIntersect.push(...looseRecords);
14335
+ if (schemasToIntersect.length === 0) {
14336
+ zodSchema = z.object({}).passthrough();
14337
+ } else if (schemasToIntersect.length === 1) {
14338
+ zodSchema = schemasToIntersect[0];
14339
+ } else {
14340
+ let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
14341
+ for (let i = 2; i < schemasToIntersect.length; i++) {
14342
+ result = z.intersection(result, schemasToIntersect[i]);
14343
+ }
14344
+ zodSchema = result;
14345
+ }
14346
+ break;
14347
+ }
14348
+ const objectSchema = z.object(shape);
14349
+ if (schema.additionalProperties === false) {
14350
+ zodSchema = objectSchema.strict();
14351
+ } else if (typeof schema.additionalProperties === "object") {
14352
+ zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
14353
+ } else {
14354
+ zodSchema = objectSchema.passthrough();
14355
+ }
14356
+ break;
14357
+ }
14358
+ case "array": {
14359
+ const prefixItems = schema.prefixItems;
14360
+ const items = schema.items;
14361
+ if (prefixItems && Array.isArray(prefixItems)) {
14362
+ const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
14363
+ const rest2 = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
14364
+ if (rest2) {
14365
+ zodSchema = z.tuple(tupleItems).rest(rest2);
14366
+ } else {
14367
+ zodSchema = z.tuple(tupleItems);
14368
+ }
14369
+ if (typeof schema.minItems === "number") {
14370
+ zodSchema = zodSchema.check(z.minLength(schema.minItems));
14371
+ }
14372
+ if (typeof schema.maxItems === "number") {
14373
+ zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14374
+ }
14375
+ } else if (Array.isArray(items)) {
14376
+ const tupleItems = items.map((item) => convertSchema(item, ctx));
14377
+ const rest2 = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
14378
+ if (rest2) {
14379
+ zodSchema = z.tuple(tupleItems).rest(rest2);
14380
+ } else {
14381
+ zodSchema = z.tuple(tupleItems);
14382
+ }
14383
+ if (typeof schema.minItems === "number") {
14384
+ zodSchema = zodSchema.check(z.minLength(schema.minItems));
14385
+ }
14386
+ if (typeof schema.maxItems === "number") {
14387
+ zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14388
+ }
14389
+ } else if (items !== void 0) {
14390
+ const element = convertSchema(items, ctx);
14391
+ let arraySchema = z.array(element);
14392
+ if (typeof schema.minItems === "number") {
14393
+ arraySchema = arraySchema.min(schema.minItems);
14394
+ }
14395
+ if (typeof schema.maxItems === "number") {
14396
+ arraySchema = arraySchema.max(schema.maxItems);
14397
+ }
14398
+ zodSchema = arraySchema;
14399
+ } else {
14400
+ zodSchema = z.array(z.any());
14401
+ }
14402
+ break;
14403
+ }
14404
+ default:
14405
+ throw new Error(`Unsupported type: ${type}`);
14406
+ }
14407
+ return zodSchema;
14559
14408
  }
14560
- var stringbool = (...args) => _stringbool({
14561
- Codec: ZodCodec,
14562
- Boolean: ZodBoolean,
14563
- String: ZodString
14564
- }, ...args);
14565
- function json(params) {
14566
- const jsonSchema = lazy(() => {
14567
- return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
14568
- });
14569
- return jsonSchema;
14409
+ function convertSchema(schema, ctx) {
14410
+ if (typeof schema === "boolean") {
14411
+ return schema ? z.any() : z.never();
14412
+ }
14413
+ let baseSchema = convertBaseSchema(schema, ctx);
14414
+ const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
14415
+ if (schema.anyOf && Array.isArray(schema.anyOf)) {
14416
+ const options = schema.anyOf.map((s) => convertSchema(s, ctx));
14417
+ const anyOfUnion = z.union(options);
14418
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
14419
+ }
14420
+ if (schema.oneOf && Array.isArray(schema.oneOf)) {
14421
+ const options = schema.oneOf.map((s) => convertSchema(s, ctx));
14422
+ const oneOfUnion = z.xor(options);
14423
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
14424
+ }
14425
+ if (schema.allOf && Array.isArray(schema.allOf)) {
14426
+ if (schema.allOf.length === 0) {
14427
+ baseSchema = hasExplicitType ? baseSchema : z.any();
14428
+ } else {
14429
+ let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
14430
+ const startIdx = hasExplicitType ? 0 : 1;
14431
+ for (let i = startIdx; i < schema.allOf.length; i++) {
14432
+ result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
14433
+ }
14434
+ baseSchema = result;
14435
+ }
14436
+ }
14437
+ if (schema.nullable === true && ctx.version === "openapi-3.0") {
14438
+ baseSchema = z.nullable(baseSchema);
14439
+ }
14440
+ if (schema.readOnly === true) {
14441
+ baseSchema = z.readonly(baseSchema);
14442
+ }
14443
+ if (schema.default !== void 0) {
14444
+ baseSchema = baseSchema.default(schema.default);
14445
+ }
14446
+ const extraMeta = {};
14447
+ const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
14448
+ for (const key of coreMetadataKeys) {
14449
+ if (key in schema) {
14450
+ extraMeta[key] = schema[key];
14451
+ }
14452
+ }
14453
+ const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
14454
+ for (const key of contentMetadataKeys) {
14455
+ if (key in schema) {
14456
+ extraMeta[key] = schema[key];
14457
+ }
14458
+ }
14459
+ for (const key of Object.keys(schema)) {
14460
+ if (!RECOGNIZED_KEYS.has(key)) {
14461
+ extraMeta[key] = schema[key];
14462
+ }
14463
+ }
14464
+ if (Object.keys(extraMeta).length > 0) {
14465
+ ctx.registry.add(baseSchema, extraMeta);
14466
+ }
14467
+ if (schema.description) {
14468
+ baseSchema = baseSchema.describe(schema.description);
14469
+ }
14470
+ return baseSchema;
14570
14471
  }
14571
- function preprocess(fn, schema) {
14572
- return new ZodPreprocess({
14573
- type: "pipe",
14574
- in: transform(fn),
14575
- out: schema
14576
- });
14472
+ function fromJSONSchema(schema, params) {
14473
+ if (typeof schema === "boolean") {
14474
+ return schema ? z.any() : z.never();
14475
+ }
14476
+ let normalized;
14477
+ try {
14478
+ normalized = JSON.parse(JSON.stringify(schema));
14479
+ } catch {
14480
+ throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
14481
+ }
14482
+ const version2 = detectVersion(normalized, params?.defaultTarget);
14483
+ const defs = normalized.$defs || normalized.definitions || {};
14484
+ const ctx = {
14485
+ version: version2,
14486
+ defs,
14487
+ refs: /* @__PURE__ */ new Map(),
14488
+ processing: /* @__PURE__ */ new Set(),
14489
+ rootSchema: normalized,
14490
+ registry: params?.registry ?? globalRegistry
14491
+ };
14492
+ return convertSchema(normalized, ctx);
14577
14493
  }
14578
14494
 
14579
- // node_modules/zod/v4/classic/compat.js
14580
- var ZodIssueCode = {
14581
- invalid_type: "invalid_type",
14582
- too_big: "too_big",
14583
- too_small: "too_small",
14584
- invalid_format: "invalid_format",
14585
- not_multiple_of: "not_multiple_of",
14586
- unrecognized_keys: "unrecognized_keys",
14587
- invalid_union: "invalid_union",
14588
- invalid_key: "invalid_key",
14589
- invalid_element: "invalid_element",
14590
- invalid_value: "invalid_value",
14591
- custom: "custom"
14592
- };
14593
- function setErrorMap(map2) {
14594
- config({
14595
- customError: map2
14596
- });
14495
+ // node_modules/zod/v4/classic/coerce.js
14496
+ var coerce_exports = {};
14497
+ __export(coerce_exports, {
14498
+ bigint: () => bigint3,
14499
+ boolean: () => boolean3,
14500
+ date: () => date4,
14501
+ number: () => number3,
14502
+ string: () => string3
14503
+ });
14504
+ function string3(params) {
14505
+ return _coercedString(ZodString, params);
14597
14506
  }
14598
- function getErrorMap() {
14599
- return config().customError;
14507
+ function number3(params) {
14508
+ return _coercedNumber(ZodNumber, params);
14509
+ }
14510
+ function boolean3(params) {
14511
+ return _coercedBoolean(ZodBoolean, params);
14512
+ }
14513
+ function bigint3(params) {
14514
+ return _coercedBigint(ZodBigInt, params);
14515
+ }
14516
+ function date4(params) {
14517
+ return _coercedDate(ZodDate, params);
14600
14518
  }
14601
- var ZodFirstPartyTypeKind;
14602
- /* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
14603
- })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
14604
14519
 
14605
- // node_modules/zod/v4/classic/from-json-schema.js
14606
- var z = {
14607
- ...schemas_exports2,
14608
- ...checks_exports2,
14609
- iso: iso_exports
14610
- };
14611
- var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
14612
- // Schema identification
14613
- "$schema",
14614
- "$ref",
14615
- "$defs",
14616
- "definitions",
14617
- // Core schema keywords
14618
- "$id",
14619
- "id",
14620
- "$comment",
14621
- "$anchor",
14622
- "$vocabulary",
14623
- "$dynamicRef",
14624
- "$dynamicAnchor",
14625
- // Type
14626
- "type",
14627
- "enum",
14628
- "const",
14629
- // Composition
14630
- "anyOf",
14631
- "oneOf",
14632
- "allOf",
14633
- "not",
14634
- // Object
14635
- "properties",
14636
- "required",
14637
- "additionalProperties",
14638
- "patternProperties",
14639
- "propertyNames",
14640
- "minProperties",
14641
- "maxProperties",
14642
- // Array
14643
- "items",
14644
- "prefixItems",
14645
- "additionalItems",
14646
- "minItems",
14647
- "maxItems",
14648
- "uniqueItems",
14649
- "contains",
14650
- "minContains",
14651
- "maxContains",
14652
- // String
14653
- "minLength",
14654
- "maxLength",
14655
- "pattern",
14656
- "format",
14657
- // Number
14658
- "minimum",
14659
- "maximum",
14660
- "exclusiveMinimum",
14661
- "exclusiveMaximum",
14662
- "multipleOf",
14663
- // Already handled metadata
14664
- "description",
14665
- "default",
14666
- // Content
14667
- "contentEncoding",
14668
- "contentMediaType",
14669
- "contentSchema",
14670
- // Unsupported (error-throwing)
14671
- "unevaluatedItems",
14672
- "unevaluatedProperties",
14673
- "if",
14674
- "then",
14675
- "else",
14676
- "dependentSchemas",
14677
- "dependentRequired",
14678
- // OpenAPI
14679
- "nullable",
14680
- "readOnly"
14681
- ]);
14682
- function detectVersion(schema, defaultTarget) {
14683
- const $schema = schema.$schema;
14684
- if ($schema === "https://json-schema.org/draft/2020-12/schema") {
14685
- return "draft-2020-12";
14520
+ // node_modules/zod/v4/classic/external.js
14521
+ config(en_default());
14522
+
14523
+ // node_modules/@opentabs-dev/shared/dist/error.js
14524
+ var toErrorMessage = (err2) => err2 instanceof Error ? err2.message : String(err2);
14525
+
14526
+ // node_modules/@opentabs-dev/plugin-sdk/dist/errors.js
14527
+ var ToolError = class _ToolError extends Error {
14528
+ code;
14529
+ /** Whether this error is retryable (defaults to false). */
14530
+ retryable;
14531
+ /** Suggested delay before retrying, in milliseconds. */
14532
+ retryAfterMs;
14533
+ /** Error category for structured error classification. */
14534
+ category;
14535
+ constructor(message, code, opts) {
14536
+ super(message);
14537
+ this.code = code;
14538
+ this.name = "ToolError";
14539
+ this.retryable = opts?.retryable ?? false;
14540
+ this.retryAfterMs = opts?.retryAfterMs;
14541
+ this.category = opts?.category;
14686
14542
  }
14687
- if ($schema === "http://json-schema.org/draft-07/schema#") {
14688
- return "draft-7";
14543
+ /** Authentication or authorization error (not retryable). Accepts an optional domain-specific code. */
14544
+ static auth(message, code) {
14545
+ return new _ToolError(message, code ?? "AUTH_ERROR", { category: "auth", retryable: false });
14689
14546
  }
14690
- if ($schema === "http://json-schema.org/draft-04/schema#") {
14691
- return "draft-4";
14547
+ /** Resource not found (not retryable). Accepts an optional domain-specific code. */
14548
+ static notFound(message, code) {
14549
+ return new _ToolError(message, code ?? "NOT_FOUND", { category: "not_found", retryable: false });
14692
14550
  }
14693
- return defaultTarget ?? "draft-2020-12";
14694
- }
14695
- function resolveRef(ref, ctx) {
14696
- if (!ref.startsWith("#")) {
14697
- throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
14551
+ /** Rate limited (retryable). Accepts an optional retry delay in milliseconds and an optional domain-specific code. */
14552
+ static rateLimited(message, retryAfterMs, code) {
14553
+ return new _ToolError(message, code ?? "RATE_LIMITED", { category: "rate_limit", retryable: true, retryAfterMs });
14698
14554
  }
14699
- const path = ref.slice(1).split("/").filter(Boolean);
14700
- if (path.length === 0) {
14701
- return ctx.rootSchema;
14555
+ /** Input validation error (not retryable). Accepts an optional domain-specific code. */
14556
+ static validation(message, code) {
14557
+ return new _ToolError(message, code ?? "VALIDATION_ERROR", { category: "validation", retryable: false });
14702
14558
  }
14703
- const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
14704
- if (path[0] === defsKey) {
14705
- const key = path[1];
14706
- if (!key || !ctx.defs[key]) {
14707
- throw new Error(`Reference not found: ${ref}`);
14708
- }
14709
- return ctx.defs[key];
14559
+ /** Operation timed out (retryable). Accepts an optional domain-specific code. */
14560
+ static timeout(message, code) {
14561
+ return new _ToolError(message, code ?? "TIMEOUT", { category: "timeout", retryable: true });
14710
14562
  }
14711
- throw new Error(`Reference not found: ${ref}`);
14712
- }
14713
- function convertBaseSchema(schema, ctx) {
14714
- if (schema.not !== void 0) {
14715
- if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
14716
- return z.never();
14717
- }
14718
- throw new Error("not is not supported in Zod (except { not: {} } for never)");
14563
+ /** Internal/unexpected error (not retryable). Accepts an optional domain-specific code. */
14564
+ static internal(message, code) {
14565
+ return new _ToolError(message, code ?? "INTERNAL_ERROR", { category: "internal", retryable: false });
14719
14566
  }
14720
- if (schema.unevaluatedItems !== void 0) {
14721
- throw new Error("unevaluatedItems is not supported");
14567
+ };
14568
+
14569
+ // node_modules/@opentabs-dev/plugin-sdk/dist/fetch.js
14570
+ var MAX_ERROR_BODY_LENGTH = 512;
14571
+ var httpStatusToToolError = (response, message) => {
14572
+ const status = response.status;
14573
+ if (status === 401 || status === 403) {
14574
+ return ToolError.auth(message);
14722
14575
  }
14723
- if (schema.unevaluatedProperties !== void 0) {
14724
- throw new Error("unevaluatedProperties is not supported");
14576
+ if (status === 404) {
14577
+ return ToolError.notFound(message);
14725
14578
  }
14726
- if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
14727
- throw new Error("Conditional schemas (if/then/else) are not supported");
14579
+ if (status === 429) {
14580
+ const retryAfter = response.headers.get("Retry-After");
14581
+ const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
14582
+ return ToolError.rateLimited(message, retryAfterMs);
14728
14583
  }
14729
- if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
14730
- throw new Error("dependentSchemas and dependentRequired are not supported");
14584
+ if (status === 400 || status === 422) {
14585
+ return ToolError.validation(message);
14731
14586
  }
14732
- if (schema.$ref) {
14733
- const refPath = schema.$ref;
14734
- if (ctx.refs.has(refPath)) {
14735
- return ctx.refs.get(refPath);
14736
- }
14737
- if (ctx.processing.has(refPath)) {
14738
- return z.lazy(() => {
14739
- if (!ctx.refs.has(refPath)) {
14740
- throw new Error(`Circular reference not resolved: ${refPath}`);
14741
- }
14742
- return ctx.refs.get(refPath);
14743
- });
14744
- }
14745
- ctx.processing.add(refPath);
14746
- const resolved = resolveRef(refPath, ctx);
14747
- const zodSchema2 = convertSchema(resolved, ctx);
14748
- ctx.refs.set(refPath, zodSchema2);
14749
- ctx.processing.delete(refPath);
14750
- return zodSchema2;
14587
+ if (status === 408) {
14588
+ return ToolError.timeout(message);
14751
14589
  }
14752
- if (schema.enum !== void 0) {
14753
- const enumValues = schema.enum;
14754
- if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
14755
- return z.null();
14756
- }
14757
- if (enumValues.length === 0) {
14758
- return z.never();
14759
- }
14760
- if (enumValues.length === 1) {
14761
- return z.literal(enumValues[0]);
14762
- }
14763
- if (enumValues.every((v) => typeof v === "string")) {
14764
- return z.enum(enumValues);
14765
- }
14766
- const literalSchemas = enumValues.map((v) => z.literal(v));
14767
- if (literalSchemas.length < 2) {
14768
- return literalSchemas[0];
14590
+ if (status >= 500) {
14591
+ const TRANSIENT_5XX = /* @__PURE__ */ new Set([500, 502, 503, 504]);
14592
+ const retryable = TRANSIENT_5XX.has(status);
14593
+ const retryAfter = status === 503 ? response.headers.get("Retry-After") : null;
14594
+ const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
14595
+ return new ToolError(message, "http_error", { category: "internal", retryable, retryAfterMs });
14596
+ }
14597
+ if (status >= 400 && status < 500) {
14598
+ return new ToolError(message, "http_error", { retryable: false });
14599
+ }
14600
+ return new ToolError(message, "http_error", { category: "internal" });
14601
+ };
14602
+ var parseRetryAfterMs = (value) => {
14603
+ const seconds = Number(value);
14604
+ if (!Number.isNaN(seconds) && seconds >= 0) {
14605
+ return seconds * 1e3;
14606
+ }
14607
+ const date5 = Date.parse(value);
14608
+ if (!Number.isNaN(date5)) {
14609
+ const ms = date5 - Date.now();
14610
+ return ms > 0 ? ms : void 0;
14611
+ }
14612
+ return void 0;
14613
+ };
14614
+ var buildQueryString = (params) => {
14615
+ const searchParams = new URLSearchParams();
14616
+ for (const [key, value] of Object.entries(params)) {
14617
+ if (value === void 0)
14618
+ continue;
14619
+ if (Array.isArray(value)) {
14620
+ for (const item of value) {
14621
+ searchParams.append(key, String(item));
14622
+ }
14623
+ } else {
14624
+ searchParams.append(key, String(value));
14769
14625
  }
14770
- return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
14771
- }
14772
- if (schema.const !== void 0) {
14773
- return z.literal(schema.const);
14774
14626
  }
14775
- const type = schema.type;
14776
- if (Array.isArray(type)) {
14777
- const typeSchemas = type.map((t) => {
14778
- const typeSchema = { ...schema, type: t };
14779
- return convertBaseSchema(typeSchema, ctx);
14627
+ return searchParams.toString();
14628
+ };
14629
+ var fetchFromPage = async (url2, init) => {
14630
+ const { timeout = 3e4, signal, ...rest2 } = init ?? {};
14631
+ const timeoutSignal = AbortSignal.timeout(timeout);
14632
+ const combinedSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
14633
+ let response;
14634
+ try {
14635
+ response = await fetch(url2, {
14636
+ credentials: "include",
14637
+ ...rest2,
14638
+ signal: combinedSignal
14780
14639
  });
14781
- if (typeSchemas.length === 0) {
14782
- return z.never();
14640
+ } catch (error51) {
14641
+ if (error51 instanceof DOMException && error51.name === "TimeoutError") {
14642
+ throw ToolError.timeout(`fetchFromPage: request timed out after ${timeout}ms for ${url2}`);
14783
14643
  }
14784
- if (typeSchemas.length === 1) {
14785
- return typeSchemas[0];
14644
+ if (combinedSignal.aborted) {
14645
+ throw new ToolError(`fetchFromPage: request aborted for ${url2}`, "aborted");
14786
14646
  }
14787
- return z.union(typeSchemas);
14647
+ throw new ToolError(`fetchFromPage: network error for ${url2}: ${toErrorMessage(error51)}`, "network_error", {
14648
+ category: "internal",
14649
+ retryable: true
14650
+ });
14788
14651
  }
14789
- if (!type) {
14790
- return z.any();
14652
+ if (!response.ok) {
14653
+ const rawText = await response.text().catch(() => response.statusText);
14654
+ const errorText = rawText.length > MAX_ERROR_BODY_LENGTH ? `${rawText.slice(0, MAX_ERROR_BODY_LENGTH)}\u2026` : rawText;
14655
+ const msg = `fetchFromPage: HTTP ${response.status} for ${url2}: ${errorText}`;
14656
+ throw httpStatusToToolError(response, msg);
14791
14657
  }
14792
- let zodSchema;
14793
- switch (type) {
14794
- case "string": {
14795
- let stringSchema = z.string();
14796
- if (schema.format) {
14797
- const format = schema.format;
14798
- if (format === "email") {
14799
- stringSchema = stringSchema.check(z.email());
14800
- } else if (format === "uri" || format === "uri-reference") {
14801
- stringSchema = stringSchema.check(z.url());
14802
- } else if (format === "uuid" || format === "guid") {
14803
- stringSchema = stringSchema.check(z.uuid());
14804
- } else if (format === "date-time") {
14805
- stringSchema = stringSchema.check(z.iso.datetime());
14806
- } else if (format === "date") {
14807
- stringSchema = stringSchema.check(z.iso.date());
14808
- } else if (format === "time") {
14809
- stringSchema = stringSchema.check(z.iso.time());
14810
- } else if (format === "duration") {
14811
- stringSchema = stringSchema.check(z.iso.duration());
14812
- } else if (format === "ipv4") {
14813
- stringSchema = stringSchema.check(z.ipv4());
14814
- } else if (format === "ipv6") {
14815
- stringSchema = stringSchema.check(z.ipv6());
14816
- } else if (format === "mac") {
14817
- stringSchema = stringSchema.check(z.mac());
14818
- } else if (format === "cidr") {
14819
- stringSchema = stringSchema.check(z.cidrv4());
14820
- } else if (format === "cidr-v6") {
14821
- stringSchema = stringSchema.check(z.cidrv6());
14822
- } else if (format === "base64") {
14823
- stringSchema = stringSchema.check(z.base64());
14824
- } else if (format === "base64url") {
14825
- stringSchema = stringSchema.check(z.base64url());
14826
- } else if (format === "e164") {
14827
- stringSchema = stringSchema.check(z.e164());
14828
- } else if (format === "jwt") {
14829
- stringSchema = stringSchema.check(z.jwt());
14830
- } else if (format === "emoji") {
14831
- stringSchema = stringSchema.check(z.emoji());
14832
- } else if (format === "nanoid") {
14833
- stringSchema = stringSchema.check(z.nanoid());
14834
- } else if (format === "cuid") {
14835
- stringSchema = stringSchema.check(z.cuid());
14836
- } else if (format === "cuid2") {
14837
- stringSchema = stringSchema.check(z.cuid2());
14838
- } else if (format === "ulid") {
14839
- stringSchema = stringSchema.check(z.ulid());
14840
- } else if (format === "xid") {
14841
- stringSchema = stringSchema.check(z.xid());
14842
- } else if (format === "ksuid") {
14843
- stringSchema = stringSchema.check(z.ksuid());
14844
- }
14845
- }
14846
- if (typeof schema.minLength === "number") {
14847
- stringSchema = stringSchema.min(schema.minLength);
14848
- }
14849
- if (typeof schema.maxLength === "number") {
14850
- stringSchema = stringSchema.max(schema.maxLength);
14851
- }
14852
- if (schema.pattern) {
14853
- stringSchema = stringSchema.regex(new RegExp(schema.pattern));
14854
- }
14855
- zodSchema = stringSchema;
14856
- break;
14857
- }
14858
- case "number":
14859
- case "integer": {
14860
- let numberSchema = type === "integer" ? z.number().int() : z.number();
14861
- if (typeof schema.minimum === "number") {
14862
- numberSchema = numberSchema.min(schema.minimum);
14863
- }
14864
- if (typeof schema.maximum === "number") {
14865
- numberSchema = numberSchema.max(schema.maximum);
14866
- }
14867
- if (typeof schema.exclusiveMinimum === "number") {
14868
- numberSchema = numberSchema.gt(schema.exclusiveMinimum);
14869
- } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
14870
- numberSchema = numberSchema.gt(schema.minimum);
14871
- }
14872
- if (typeof schema.exclusiveMaximum === "number") {
14873
- numberSchema = numberSchema.lt(schema.exclusiveMaximum);
14874
- } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
14875
- numberSchema = numberSchema.lt(schema.maximum);
14876
- }
14877
- if (typeof schema.multipleOf === "number") {
14878
- numberSchema = numberSchema.multipleOf(schema.multipleOf);
14879
- }
14880
- zodSchema = numberSchema;
14881
- break;
14658
+ return response;
14659
+ };
14660
+ var fetchJSONImpl = async (url2, init, schema) => {
14661
+ const response = await fetchFromPage(url2, init);
14662
+ let data;
14663
+ if (response.status === 204 || response.headers.get("content-length") === "0") {
14664
+ if (!schema) {
14665
+ return void 0;
14882
14666
  }
14883
- case "boolean": {
14884
- zodSchema = z.boolean();
14885
- break;
14667
+ throw ToolError.validation(`fetchJSON: expected JSON response from ${url2} but received HTTP ${response.status} with no body to validate`);
14668
+ } else {
14669
+ try {
14670
+ data = await response.json();
14671
+ } catch {
14672
+ throw ToolError.validation(`fetchJSON: failed to parse JSON response from ${url2}`);
14886
14673
  }
14887
- case "null": {
14888
- zodSchema = z.null();
14889
- break;
14674
+ }
14675
+ if (schema) {
14676
+ const result = schema.safeParse(data);
14677
+ if (!result.success) {
14678
+ throw ToolError.validation(`fetchJSON: response from ${url2} failed schema validation: ${result.error.message}`);
14890
14679
  }
14891
- case "object": {
14892
- const shape = {};
14893
- const properties = schema.properties || {};
14894
- const requiredSet = new Set(schema.required || []);
14895
- for (const [key, propSchema] of Object.entries(properties)) {
14896
- const propZodSchema = convertSchema(propSchema, ctx);
14897
- shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
14898
- }
14899
- if (schema.propertyNames) {
14900
- const keySchema = convertSchema(schema.propertyNames, ctx);
14901
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
14902
- if (Object.keys(shape).length === 0) {
14903
- zodSchema = z.record(keySchema, valueSchema);
14904
- break;
14905
- }
14906
- const objectSchema2 = z.object(shape).passthrough();
14907
- const recordSchema = z.looseRecord(keySchema, valueSchema);
14908
- zodSchema = z.intersection(objectSchema2, recordSchema);
14909
- break;
14910
- }
14911
- if (schema.patternProperties) {
14912
- const patternProps = schema.patternProperties;
14913
- const patternKeys = Object.keys(patternProps);
14914
- const looseRecords = [];
14915
- for (const pattern of patternKeys) {
14916
- const patternValue = convertSchema(patternProps[pattern], ctx);
14917
- const keySchema = z.string().regex(new RegExp(pattern));
14918
- looseRecords.push(z.looseRecord(keySchema, patternValue));
14919
- }
14920
- const schemasToIntersect = [];
14921
- if (Object.keys(shape).length > 0) {
14922
- schemasToIntersect.push(z.object(shape).passthrough());
14923
- }
14924
- schemasToIntersect.push(...looseRecords);
14925
- if (schemasToIntersect.length === 0) {
14926
- zodSchema = z.object({}).passthrough();
14927
- } else if (schemasToIntersect.length === 1) {
14928
- zodSchema = schemasToIntersect[0];
14929
- } else {
14930
- let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
14931
- for (let i = 2; i < schemasToIntersect.length; i++) {
14932
- result = z.intersection(result, schemasToIntersect[i]);
14933
- }
14934
- zodSchema = result;
14680
+ return result.data;
14681
+ }
14682
+ return data;
14683
+ };
14684
+ var fetchJSON = fetchJSONImpl;
14685
+
14686
+ // node_modules/@opentabs-dev/plugin-sdk/dist/timing.js
14687
+ var waitUntil = (predicate, opts) => {
14688
+ const interval = opts?.interval ?? 200;
14689
+ const timeout = opts?.timeout ?? 1e4;
14690
+ const signal = opts?.signal;
14691
+ const abortReason = () => signal?.reason instanceof Error ? signal.reason : new Error("waitUntil: aborted");
14692
+ if (signal?.aborted)
14693
+ return Promise.reject(abortReason());
14694
+ return new Promise((resolve, reject) => {
14695
+ let settled = false;
14696
+ let poller;
14697
+ let lastPredicateError;
14698
+ const isSettled = () => settled;
14699
+ const cleanup = () => {
14700
+ settled = true;
14701
+ clearTimeout(timer);
14702
+ clearTimeout(poller);
14703
+ signal?.removeEventListener("abort", onAbort);
14704
+ };
14705
+ const onAbort = () => {
14706
+ if (isSettled())
14707
+ return;
14708
+ cleanup();
14709
+ reject(abortReason());
14710
+ };
14711
+ signal?.addEventListener("abort", onAbort, { once: true });
14712
+ const timer = setTimeout(() => {
14713
+ if (isSettled())
14714
+ return;
14715
+ cleanup();
14716
+ const errorContext = lastPredicateError instanceof Error ? `: predicate last threw \u2014 ${lastPredicateError.message}` : "";
14717
+ reject(new Error(`waitUntil: timed out after ${timeout}ms waiting for predicate to return true${errorContext}`));
14718
+ }, timeout);
14719
+ const check2 = async () => {
14720
+ if (isSettled())
14721
+ return;
14722
+ try {
14723
+ const result = await predicate();
14724
+ if (result) {
14725
+ cleanup();
14726
+ resolve();
14727
+ return;
14935
14728
  }
14936
- break;
14729
+ } catch (err2) {
14730
+ lastPredicateError = err2;
14937
14731
  }
14938
- const objectSchema = z.object(shape);
14939
- if (schema.additionalProperties === false) {
14940
- zodSchema = objectSchema.strict();
14941
- } else if (typeof schema.additionalProperties === "object") {
14942
- zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
14943
- } else {
14944
- zodSchema = objectSchema.passthrough();
14732
+ if (!isSettled()) {
14733
+ poller = setTimeout(() => void check2(), interval);
14945
14734
  }
14946
- break;
14735
+ };
14736
+ void check2();
14737
+ });
14738
+ };
14739
+
14740
+ // node_modules/@opentabs-dev/plugin-sdk/dist/log.js
14741
+ var MAX_DATA_LENGTH = 10;
14742
+ var MAX_STRING_LENGTH = 4096;
14743
+ var MAX_SERIALIZED_SIZE = 64 * 1024;
14744
+ var safeSerializeArg = (value) => {
14745
+ try {
14746
+ if (value === null || value === void 0)
14747
+ return value;
14748
+ const type = typeof value;
14749
+ if (type === "boolean" || type === "number")
14750
+ return value;
14751
+ if (type === "string") {
14752
+ return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
14947
14753
  }
14948
- case "array": {
14949
- const prefixItems = schema.prefixItems;
14950
- const items = schema.items;
14951
- if (prefixItems && Array.isArray(prefixItems)) {
14952
- const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
14953
- const rest2 = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
14954
- if (rest2) {
14955
- zodSchema = z.tuple(tupleItems).rest(rest2);
14956
- } else {
14957
- zodSchema = z.tuple(tupleItems);
14958
- }
14959
- if (typeof schema.minItems === "number") {
14960
- zodSchema = zodSchema.check(z.minLength(schema.minItems));
14961
- }
14962
- if (typeof schema.maxItems === "number") {
14963
- zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14964
- }
14965
- } else if (Array.isArray(items)) {
14966
- const tupleItems = items.map((item) => convertSchema(item, ctx));
14967
- const rest2 = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
14968
- if (rest2) {
14969
- zodSchema = z.tuple(tupleItems).rest(rest2);
14970
- } else {
14971
- zodSchema = z.tuple(tupleItems);
14972
- }
14973
- if (typeof schema.minItems === "number") {
14974
- zodSchema = zodSchema.check(z.minLength(schema.minItems));
14975
- }
14976
- if (typeof schema.maxItems === "number") {
14977
- zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14978
- }
14979
- } else if (items !== void 0) {
14980
- const element = convertSchema(items, ctx);
14981
- let arraySchema = z.array(element);
14982
- if (typeof schema.minItems === "number") {
14983
- arraySchema = arraySchema.min(schema.minItems);
14984
- }
14985
- if (typeof schema.maxItems === "number") {
14986
- arraySchema = arraySchema.max(schema.maxItems);
14754
+ if (type === "function")
14755
+ return `[Function: ${value.name || "anonymous"}]`;
14756
+ if (type === "symbol")
14757
+ return `[Symbol: ${value.description ?? ""}]`;
14758
+ if (type === "bigint")
14759
+ return `[BigInt: ${value.toString()}]`;
14760
+ if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
14761
+ try {
14762
+ const node = value;
14763
+ let classStr = "";
14764
+ if (typeof node.className === "string") {
14765
+ classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
14766
+ } else if (node.className !== null && typeof node.className === "object") {
14767
+ const baseVal = node.className.baseVal;
14768
+ if (typeof baseVal === "string") {
14769
+ classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
14770
+ }
14987
14771
  }
14988
- zodSchema = arraySchema;
14989
- } else {
14990
- zodSchema = z.array(z.any());
14772
+ return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
14773
+ } catch {
14991
14774
  }
14992
- break;
14993
14775
  }
14994
- default:
14995
- throw new Error(`Unsupported type: ${type}`);
14996
- }
14997
- return zodSchema;
14998
- }
14999
- function convertSchema(schema, ctx) {
15000
- if (typeof schema === "boolean") {
15001
- return schema ? z.any() : z.never();
15002
- }
15003
- let baseSchema = convertBaseSchema(schema, ctx);
15004
- const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
15005
- if (schema.anyOf && Array.isArray(schema.anyOf)) {
15006
- const options = schema.anyOf.map((s) => convertSchema(s, ctx));
15007
- const anyOfUnion = z.union(options);
15008
- baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
15009
- }
15010
- if (schema.oneOf && Array.isArray(schema.oneOf)) {
15011
- const options = schema.oneOf.map((s) => convertSchema(s, ctx));
15012
- const oneOfUnion = z.xor(options);
15013
- baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
15014
- }
15015
- if (schema.allOf && Array.isArray(schema.allOf)) {
15016
- if (schema.allOf.length === 0) {
15017
- baseSchema = hasExplicitType ? baseSchema : z.any();
15018
- } else {
15019
- let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
15020
- const startIdx = hasExplicitType ? 0 : 1;
15021
- for (let i = startIdx; i < schema.allOf.length; i++) {
15022
- result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
14776
+ if (value instanceof Error) {
14777
+ return { name: value.name, message: value.message, stack: value.stack };
14778
+ }
14779
+ if (value instanceof WeakRef)
14780
+ return "[WeakRef]";
14781
+ if (value instanceof WeakMap)
14782
+ return "[WeakMap]";
14783
+ if (value instanceof WeakSet)
14784
+ return "[WeakSet]";
14785
+ if (value instanceof ArrayBuffer)
14786
+ return "[ArrayBuffer]";
14787
+ if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
14788
+ return "[SharedArrayBuffer]";
14789
+ try {
14790
+ const seen = /* @__PURE__ */ new WeakSet();
14791
+ const json2 = JSON.stringify(value, (_key, v) => {
14792
+ if (typeof v === "object" && v !== null) {
14793
+ if (seen.has(v))
14794
+ return "[Circular]";
14795
+ seen.add(v);
14796
+ }
14797
+ if (typeof v === "function")
14798
+ return `[Function: ${v.name || "anonymous"}]`;
14799
+ if (typeof v === "bigint")
14800
+ return `[BigInt: ${v.toString()}]`;
14801
+ if (typeof v === "symbol")
14802
+ return `[Symbol: ${v.description ?? ""}]`;
14803
+ if (v instanceof WeakRef)
14804
+ return "[WeakRef]";
14805
+ if (v instanceof WeakMap)
14806
+ return "[WeakMap]";
14807
+ if (v instanceof WeakSet)
14808
+ return "[WeakSet]";
14809
+ if (v instanceof ArrayBuffer)
14810
+ return "[ArrayBuffer]";
14811
+ if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
14812
+ return "[SharedArrayBuffer]";
14813
+ return v;
14814
+ });
14815
+ if (json2.length > MAX_SERIALIZED_SIZE) {
14816
+ return `[Object truncated: ${json2.length} chars]`;
15023
14817
  }
15024
- baseSchema = result;
14818
+ return JSON.parse(json2);
14819
+ } catch {
14820
+ return `[Unserializable: ${typeof value}]`;
15025
14821
  }
14822
+ } catch {
14823
+ return `[Unserializable: ${typeof value}]`;
15026
14824
  }
15027
- if (schema.nullable === true && ctx.version === "openapi-3.0") {
15028
- baseSchema = z.nullable(baseSchema);
14825
+ };
14826
+ var safeSerialize = (args) => {
14827
+ const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
14828
+ return capped.map(safeSerializeArg);
14829
+ };
14830
+ var CONSOLE_METHODS = {
14831
+ debug: "debug",
14832
+ info: "info",
14833
+ warning: "warn",
14834
+ error: "error"
14835
+ };
14836
+ var defaultTransport = (entry) => {
14837
+ const method = CONSOLE_METHODS[entry.level];
14838
+ console[method](`[sdk.log] ${entry.message}`, ...entry.data);
14839
+ };
14840
+ var activeTransport = defaultTransport;
14841
+ var _setLogTransport = (transport) => {
14842
+ const previous = activeTransport;
14843
+ activeTransport = transport;
14844
+ return () => {
14845
+ if (activeTransport === transport)
14846
+ activeTransport = previous;
14847
+ };
14848
+ };
14849
+ var makeLogMethod = (level) => (message, ...args) => {
14850
+ const entry = {
14851
+ level,
14852
+ message,
14853
+ data: safeSerialize(args),
14854
+ ts: (/* @__PURE__ */ new Date()).toISOString()
14855
+ };
14856
+ activeTransport(entry);
14857
+ };
14858
+ var log = Object.freeze({
14859
+ debug: makeLogMethod("debug"),
14860
+ info: makeLogMethod("info"),
14861
+ warn: makeLogMethod("warning"),
14862
+ error: makeLogMethod("error")
14863
+ });
14864
+ var ot = globalThis.__openTabs ?? {};
14865
+ globalThis.__openTabs = ot;
14866
+ ot._setLogTransport = _setLogTransport;
14867
+ ot.log = log;
14868
+
14869
+ // node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
14870
+ var withIframeFallback = (fn) => {
14871
+ try {
14872
+ const iframe = document.createElement("iframe");
14873
+ iframe.style.display = "none";
14874
+ document.body.appendChild(iframe);
14875
+ try {
14876
+ const iframeStorage = iframe.contentWindow?.localStorage;
14877
+ return iframeStorage ? fn(iframeStorage) : null;
14878
+ } finally {
14879
+ document.body.removeChild(iframe);
14880
+ }
14881
+ } catch {
14882
+ return null;
15029
14883
  }
15030
- if (schema.readOnly === true) {
15031
- baseSchema = z.readonly(baseSchema);
14884
+ };
14885
+ var getWindowLocalStorage = () => window.localStorage;
14886
+ var getLocalStorage = (key) => {
14887
+ let storage;
14888
+ try {
14889
+ storage = getWindowLocalStorage();
14890
+ } catch {
14891
+ return null;
15032
14892
  }
15033
- if (schema.default !== void 0) {
15034
- baseSchema = baseSchema.default(schema.default);
14893
+ if (storage) {
14894
+ try {
14895
+ return storage.getItem(key);
14896
+ } catch {
14897
+ return null;
14898
+ }
15035
14899
  }
15036
- const extraMeta = {};
15037
- const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
15038
- for (const key of coreMetadataKeys) {
15039
- if (key in schema) {
15040
- extraMeta[key] = schema[key];
14900
+ return withIframeFallback((s) => s.getItem(key));
14901
+ };
14902
+ var getCookie = (name) => {
14903
+ try {
14904
+ const prefix = `${name}=`;
14905
+ const entries = document.cookie.split("; ");
14906
+ for (const entry of entries) {
14907
+ if (entry.startsWith(prefix)) {
14908
+ try {
14909
+ return decodeURIComponent(entry.slice(prefix.length));
14910
+ } catch {
14911
+ return entry.slice(prefix.length);
14912
+ }
14913
+ }
15041
14914
  }
14915
+ return null;
14916
+ } catch {
14917
+ return null;
15042
14918
  }
15043
- const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
15044
- for (const key of contentMetadataKeys) {
15045
- if (key in schema) {
15046
- extraMeta[key] = schema[key];
15047
- }
14919
+ };
14920
+ var getAuthCache = (namespace) => {
14921
+ try {
14922
+ const ns = globalThis.__openTabs;
14923
+ const cache = ns?.tokenCache;
14924
+ return cache?.[namespace] ?? null;
14925
+ } catch {
14926
+ return null;
15048
14927
  }
15049
- for (const key of Object.keys(schema)) {
15050
- if (!RECOGNIZED_KEYS.has(key)) {
15051
- extraMeta[key] = schema[key];
15052
- }
14928
+ };
14929
+ var setAuthCache = (namespace, value) => {
14930
+ try {
14931
+ const g = globalThis;
14932
+ if (!g.__openTabs)
14933
+ g.__openTabs = {};
14934
+ const ns = g.__openTabs;
14935
+ if (!ns.tokenCache)
14936
+ ns.tokenCache = {};
14937
+ ns.tokenCache[namespace] = value;
14938
+ } catch {
15053
14939
  }
15054
- if (Object.keys(extraMeta).length > 0) {
15055
- ctx.registry.add(baseSchema, extraMeta);
14940
+ };
14941
+ var clearAuthCache = (namespace) => {
14942
+ try {
14943
+ const ns = globalThis.__openTabs;
14944
+ const cache = ns?.tokenCache;
14945
+ if (cache)
14946
+ cache[namespace] = void 0;
14947
+ } catch {
15056
14948
  }
15057
- if (schema.description) {
15058
- baseSchema = baseSchema.describe(schema.description);
14949
+ };
14950
+
14951
+ // node_modules/@opentabs-dev/plugin-sdk/dist/index.js
14952
+ var defineTool = (config2) => config2;
14953
+ var OpenTabsPlugin = class {
14954
+ /**
14955
+ * Chrome match patterns for URLs that should NOT match this plugin.
14956
+ * Tabs matching both urlPatterns and excludePatterns are excluded.
14957
+ * Useful when a broad urlPattern overlaps with another plugin's domain.
14958
+ * @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
14959
+ */
14960
+ excludePatterns;
14961
+ /**
14962
+ * URL to open when no matching tab exists and the user triggers an
14963
+ * 'open tab' action from the side panel. Should be a concrete URL
14964
+ * (e.g., 'https://github.com'), not a match pattern.
14965
+ */
14966
+ homepage;
14967
+ /** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
14968
+ configSchema;
14969
+ };
14970
+
14971
+ // src/priceline-api.ts
14972
+ var GRAPH_BASE = "https://www.priceline.com/pws/v0/pcln-graph/?gqlOp=";
14973
+ var FLY_GRAPH_URL = "https://www.priceline.com/pws/v0/fly/graph/query";
14974
+ var REST_BASE = "https://www.priceline.com/pws/v0";
14975
+ var AC_BASE = "https://www.priceline.com/svcs/ac/index";
14976
+ var decodeJwtPayload = (jwt2) => {
14977
+ try {
14978
+ const parts = jwt2.split(".");
14979
+ const encoded = parts[1];
14980
+ if (parts.length !== 3 || !encoded) return null;
14981
+ const payload = atob(encoded.replace(/-/g, "+").replace(/_/g, "/"));
14982
+ return JSON.parse(payload);
14983
+ } catch {
14984
+ return null;
15059
14985
  }
15060
- return baseSchema;
15061
- }
15062
- function fromJSONSchema(schema, params) {
15063
- if (typeof schema === "boolean") {
15064
- return schema ? z.any() : z.never();
14986
+ };
14987
+ var getAuth = () => {
14988
+ const cached2 = getAuthCache("priceline");
14989
+ if (cached2) return cached2;
14990
+ const oktaRaw = getLocalStorage("okta-token-storage");
14991
+ if (!oktaRaw) return null;
14992
+ let okta;
14993
+ try {
14994
+ okta = JSON.parse(oktaRaw);
14995
+ } catch {
14996
+ return null;
15065
14997
  }
15066
- let normalized;
14998
+ const accessTokenObj = okta.accessToken;
14999
+ const accessToken = accessTokenObj?.accessToken;
15000
+ if (!accessToken) return null;
15001
+ const claims = decodeJwtPayload(accessToken);
15002
+ if (!claims) return null;
15003
+ const authToken = claims["com.priceline.token.dmc.value"];
15004
+ const email3 = claims.sub;
15005
+ if (!authToken || !email3) return null;
15006
+ const cguid = getCookie("PL_CINFO")?.split("~")[0] ?? "";
15007
+ const auth = { accessToken, authToken, email: email3, cguid };
15008
+ setAuthCache("priceline", auth);
15009
+ return auth;
15010
+ };
15011
+ var isAuthenticated = () => getAuth() !== null;
15012
+ var waitForAuth = async () => {
15067
15013
  try {
15068
- normalized = JSON.parse(JSON.stringify(schema));
15014
+ await waitUntil(() => isAuthenticated(), {
15015
+ interval: 500,
15016
+ timeout: 5e3
15017
+ });
15018
+ return true;
15069
15019
  } catch {
15070
- throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
15020
+ return false;
15071
15021
  }
15072
- const version2 = detectVersion(normalized, params?.defaultTarget);
15073
- const defs = normalized.$defs || normalized.definitions || {};
15074
- const ctx = {
15075
- version: version2,
15076
- defs,
15077
- refs: /* @__PURE__ */ new Map(),
15078
- processing: /* @__PURE__ */ new Set(),
15079
- rootSchema: normalized,
15080
- registry: params?.registry ?? globalRegistry
15022
+ };
15023
+ var requireAuth = () => {
15024
+ const auth = getAuth();
15025
+ if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to Priceline.");
15026
+ return auth;
15027
+ };
15028
+ var getEmail = () => requireAuth().email;
15029
+ var getCguid = () => requireAuth().cguid;
15030
+ var getAuthToken = () => requireAuth().authToken;
15031
+ var graphql = async (operationName, variables, queryOrPersistedHash) => {
15032
+ const auth = requireAuth();
15033
+ const url2 = `${GRAPH_BASE}${operationName}`;
15034
+ const reqBody = {
15035
+ operationName,
15036
+ variables
15081
15037
  };
15082
- return convertSchema(normalized, ctx);
15083
- }
15084
-
15085
- // node_modules/zod/v4/classic/coerce.js
15086
- var coerce_exports = {};
15087
- __export(coerce_exports, {
15088
- bigint: () => bigint3,
15089
- boolean: () => boolean3,
15090
- date: () => date4,
15091
- number: () => number3,
15092
- string: () => string3
15093
- });
15094
- function string3(params) {
15095
- return _coercedString(ZodString, params);
15096
- }
15097
- function number3(params) {
15098
- return _coercedNumber(ZodNumber, params);
15099
- }
15100
- function boolean3(params) {
15101
- return _coercedBoolean(ZodBoolean, params);
15102
- }
15103
- function bigint3(params) {
15104
- return _coercedBigint(ZodBigInt, params);
15105
- }
15106
- function date4(params) {
15107
- return _coercedDate(ZodDate, params);
15108
- }
15109
-
15110
- // node_modules/zod/v4/classic/external.js
15111
- config(en_default());
15038
+ const isPersistedHash = typeof queryOrPersistedHash === "string" && /^[a-f0-9]{64}$/.test(queryOrPersistedHash);
15039
+ if (queryOrPersistedHash && isPersistedHash) {
15040
+ reqBody.extensions = {
15041
+ persistedQuery: { version: 1, sha256Hash: queryOrPersistedHash }
15042
+ };
15043
+ } else if (queryOrPersistedHash) {
15044
+ reqBody.query = queryOrPersistedHash;
15045
+ }
15046
+ const headers = {
15047
+ "Content-Type": "application/json",
15048
+ Authorization: `Bearer ${auth.accessToken}`,
15049
+ authToken: auth.authToken,
15050
+ "apollographql-client-name": "relax",
15051
+ "apollographql-client-version": "master-1.1.1403-v3"
15052
+ };
15053
+ const init = {
15054
+ method: "POST",
15055
+ headers,
15056
+ body: JSON.stringify(reqBody)
15057
+ };
15058
+ const resp = await fetchJSON(url2, init) ?? {};
15059
+ const errors = resp.errors ?? [];
15060
+ const data = resp.data;
15061
+ if (errors.length > 0 && !data) {
15062
+ const firstError = errors[0] ?? {};
15063
+ const code = firstError.extensions?.code ?? "";
15064
+ const message = firstError.message ?? "Unknown GraphQL error";
15065
+ if (code === "PERSISTED_QUERY_NOT_FOUND" || message.includes("persisted_query_not_found")) {
15066
+ throw ToolError.internal(
15067
+ `Persisted query hash expired for ${operationName} \u2014 Priceline may have deployed a new client version.`
15068
+ );
15069
+ }
15070
+ if (code === "UNAUTHENTICATED" || message.includes("not authorized")) {
15071
+ clearAuthCache("priceline");
15072
+ throw ToolError.auth(`Auth error: ${message}`);
15073
+ }
15074
+ throw ToolError.internal(`GraphQL error (${operationName}): ${message}`);
15075
+ }
15076
+ return data ?? resp;
15077
+ };
15078
+ var rest = async (endpoint, query) => {
15079
+ const qs = query ? buildQueryString(query) : "";
15080
+ const url2 = qs ? `${REST_BASE}${endpoint}?${qs}` : `${REST_BASE}${endpoint}`;
15081
+ const data = await fetchJSON(url2);
15082
+ if (data === void 0) throw ToolError.internal(`Empty response from ${endpoint}`);
15083
+ return data;
15084
+ };
15085
+ var autocomplete = async (product, query) => {
15086
+ const encoded = encodeURIComponent(query);
15087
+ const url2 = `${AC_BASE}/${product}/${encoded}/0/9/0/0`;
15088
+ const data = await fetchJSON(url2);
15089
+ return data?.searchItems ?? [];
15090
+ };
15091
+ var flyGraphql = async (operationName, variables, query) => {
15092
+ const headers = {
15093
+ "Content-Type": "application/json",
15094
+ "apollographql-client-name": "m-fly-search",
15095
+ "apollographql-client-version": "main-0.0.19"
15096
+ };
15097
+ const resp = await fetchJSON(FLY_GRAPH_URL, {
15098
+ method: "POST",
15099
+ headers,
15100
+ body: JSON.stringify({ operationName, variables, query })
15101
+ }) ?? {};
15102
+ const errors = resp.errors ?? [];
15103
+ if (errors.length > 0 && !resp.data) {
15104
+ const first = errors[0] ?? {};
15105
+ const code = first.extensions?.code ?? "";
15106
+ const message = first.message ?? "Unknown GraphQL error";
15107
+ if (code === "UNAUTHENTICATED") throw ToolError.auth(`Auth error: ${message}`);
15108
+ throw ToolError.internal(`GraphQL error (${operationName}): ${message}`);
15109
+ }
15110
+ return resp.data ?? {};
15111
+ };
15112
15112
 
15113
15113
  // src/tools/schemas.ts
15114
15114
  var searchItemSchema = external_exports.object({
@@ -16111,7 +16111,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16111
16111
  };
16112
16112
  var src_default = new PricelinePlugin();
16113
16113
 
16114
- // dist/_adapter_entry_0f553501-9743-4824-83b4-a62e3bb12a7e.ts
16114
+ // dist/_adapter_entry_8492852b-6607-44e6-bffb-ec418e7a44d7.ts
16115
+ external_exports.config({ jitless: true });
16115
16116
  if (!globalThis.__openTabs) {
16116
16117
  globalThis.__openTabs = {};
16117
16118
  } else {
@@ -16329,5 +16330,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16329
16330
  };
16330
16331
  delete src_default.onDeactivate;
16331
16332
  }
16332
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["priceline"]){var a=o.adapters["priceline"];a.__adapterHash="5343a876f5338f532c6c060e990732da2756114d5b4c933ae10d1b6f9b5ba8d0";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"priceline",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
16333
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["priceline"]){var a=o.adapters["priceline"];a.__adapterHash="0cae7b378f7ac8dba19cccc5259ad4481eef8411cde1f911dee721ded3f23439";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"priceline",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
16333
16334
  //# sourceMappingURL=adapter.iife.js.map