@builder.io/sdk-react 0.12.7 → 0.12.8

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-bcb725be.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-c063befa.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
@@ -1,16 +1,17 @@
1
- import { _ as t, c as a, h as r, f as i, b as n, g, e as o, d as c, i as d, a as f, r as h, s as l, t as p } from "./server-entry-0457c4c8.js";
1
+ import { _ as t, c as a, f as r, d as i, e as n, h as o, g, j as c, i as d, a as f, r as h, s as l, b as E, t as p } from "./server-entry-d816840a.js";
2
2
  export {
3
3
  t as _processContentResult,
4
4
  a as createRegisterComponentMessage,
5
5
  r as fetchBuilderProps,
6
6
  i as fetchEntries,
7
7
  n as fetchOneEntry,
8
- g as getAllContent,
9
- o as getBuilderSearchParams,
8
+ o as getAllContent,
9
+ g as getBuilderSearchParams,
10
10
  c as getContent,
11
11
  d as isEditing,
12
12
  f as isPreviewing,
13
13
  h as register,
14
14
  l as setEditorSettings,
15
+ E as subscribeToEditor,
15
16
  p as track
16
17
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react",
3
3
  "description": "Builder.io SDK for React",
4
- "version": "0.12.7",
4
+ "version": "0.12.8",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react",
6
6
  "type": "module",
7
7
  "repository": {
@@ -6,7 +6,7 @@ export declare const getVariants: (content: Nullable<BuilderContent>) => {
6
6
  data?: {
7
7
  [key: string]: any;
8
8
  title?: string;
9
- blocks?: import("../../types/builder-block.js").BuilderBlock[];
9
+ blocks?: import("../../server-index.js").BuilderBlock[];
10
10
  inputs?: import("../../types/input.js").Input[];
11
11
  state?: {
12
12
  [key: string]: any;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.12.7";
1
+ export declare const SDK_VERSION = "0.12.8";
@@ -0,0 +1,35 @@
1
+ import type { ContentProps } from '../components/content/content.types.js';
2
+ import type { BuilderAnimation } from '../types/builder-block.js';
3
+ import type { BuilderContent } from '../types/builder-content.js';
4
+ type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
5
+ callbacks: {
6
+ contentUpdate: (updatedContent: BuilderContent) => void;
7
+ animation: (updatedContent: BuilderAnimation) => void;
8
+ configureSdk: (updatedContent: any) => void;
9
+ };
10
+ };
11
+ export declare const createEditorListener: ({ model, trustedHosts, callbacks }: ContentListener) => (event: MessageEvent<any>) => void;
12
+ type SubscribeToEditor = (
13
+ /**
14
+ * The Builder `model` to subscribe to
15
+ */
16
+ model: string,
17
+ /**
18
+ * The callback function to call when the content is updated.
19
+ */
20
+ callback: (updatedContent: BuilderContent) => void,
21
+ /**
22
+ * Extra options for the listener.
23
+ */
24
+ options?: {
25
+ /**
26
+ * List of hosts to allow editing content from.
27
+ */
28
+ trustedHosts?: string[] | undefined;
29
+ }) => () => void;
30
+ /**
31
+ * Subscribes to the Builder editor and listens to `content` updates of a certain `model`.
32
+ * Sends the updated `content` to the `callback` function.
33
+ */
34
+ export declare const subscribeToEditor: SubscribeToEditor;
35
+ export {};
@@ -1,4 +1,7 @@
1
1
  export * from './index-helpers/top-of-file.js';
2
+ /**
3
+ * Component Prop types
4
+ */
2
5
  export type { ButtonProps } from './blocks/button/button.types.js';
3
6
  export type { ColumnProps } from './blocks/columns/columns.types.js';
4
7
  export type { FragmentProps } from './blocks/fragment/fragment.types.js';
@@ -9,6 +12,16 @@ export type { TextProps } from './blocks/text/text.types.js';
9
12
  export type { VideoProps } from './blocks/video/video.types.js';
10
13
  export type { BlocksProps } from './components/blocks/blocks.types.js';
11
14
  export type { ContentVariantsPrps as ContentProps } from './components/content-variants/content-variants.types.js';
15
+ /**
16
+ * General Builder types
17
+ */
18
+ export type { RegisteredComponent } from './context/types.js';
19
+ export type { BuilderBlock } from './types/builder-block.js';
20
+ export type { BuilderContent } from './types/builder-content.js';
21
+ export type { ComponentInfo } from './types/components.js';
22
+ /**
23
+ * Helper functions
24
+ */
12
25
  export { isEditing } from './functions/is-editing.js';
13
26
  export { isPreviewing } from './functions/is-previewing.js';
14
27
  export { createRegisterComponentMessage } from './functions/register-component.js';
@@ -16,9 +29,11 @@ export { register } from './functions/register.js';
16
29
  export type { InsertMenuConfig, InsertMenuItem } from './functions/register.js';
17
30
  export { setEditorSettings } from './functions/set-editor-settings.js';
18
31
  export type { Settings } from './functions/set-editor-settings.js';
19
- export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
20
32
  export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
21
33
  export { track } from './functions/track/index.js';
22
- export type { RegisteredComponent } from './context/types.js';
23
- export type { ComponentInfo } from './types/components.js';
34
+ export { subscribeToEditor } from './helpers/subscribe-to-editor.js';
35
+ /**
36
+ * Content fetching
37
+ */
24
38
  export { fetchBuilderProps } from './functions/fetch-builder-props.js';
39
+ export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
@@ -1,551 +0,0 @@
1
- const b = "react", h = "[Builder.io]: ", l = {
2
- log: (...t) => console.log(h, ...t),
3
- error: (...t) => console.error(h, ...t),
4
- warn: (...t) => console.warn(h, ...t),
5
- debug: (...t) => console.debug(h, ...t)
6
- };
7
- function a() {
8
- return typeof window != "undefined" && typeof document != "undefined";
9
- }
10
- function Y() {
11
- return a() && window.self !== window.top;
12
- }
13
- function B() {
14
- return Y() && window.location.search.indexOf("builder.frameEditing=") !== -1;
15
- }
16
- const Q = () => {
17
- if (a()) {
18
- const t = new URL(location.href);
19
- return t.pathname === "" && (t.pathname = "/"), t;
20
- } else
21
- return console.warn("Cannot get location for tracking in non-browser environment"), null;
22
- }, Z = () => typeof navigator == "object" && navigator.userAgent || "", tt = () => {
23
- const t = Z(), e = {
24
- Android() {
25
- return t.match(/Android/i);
26
- },
27
- BlackBerry() {
28
- return t.match(/BlackBerry/i);
29
- },
30
- iOS() {
31
- return t.match(/iPhone|iPod/i);
32
- },
33
- Opera() {
34
- return t.match(/Opera Mini/i);
35
- },
36
- Windows() {
37
- return t.match(/IEMobile/i) || t.match(/WPDesktop/i);
38
- },
39
- any() {
40
- return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || b === "reactNative";
41
- }
42
- }, n = t.match(/Tablet|iPad/i), r = Q();
43
- return {
44
- urlPath: r == null ? void 0 : r.pathname,
45
- host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
46
- device: n ? "tablet" : e.any() ? "mobile" : "desktop"
47
- };
48
- }, d = (t) => t != null, L = (t) => JSON.parse(JSON.stringify(t)), et = (t) => {
49
- if (t === "localhost" || t === "127.0.0.1")
50
- return t;
51
- const e = t.split(".");
52
- return e.length > 2 ? e.slice(1).join(".") : t;
53
- }, N = ({
54
- name: t,
55
- canTrack: e
56
- }) => {
57
- var n;
58
- try {
59
- return e ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${t}=`))) == null ? void 0 : n.split("=")[1] : void 0;
60
- } catch (r) {
61
- l.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
62
- return;
63
- }
64
- }, $ = async (t) => N(t), nt = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(d).join("; "), rt = [["secure", ""], ["SameSite", "None"]], ot = ({
65
- name: t,
66
- value: e,
67
- expires: n
68
- }) => {
69
- const o = (a() ? location.protocol === "https:" : !0) ? rt : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], c = [[t, e], ...s, ["path", "/"], ["domain", et(window.location.hostname)], ...o];
70
- return nt(c);
71
- }, j = async ({
72
- name: t,
73
- value: e,
74
- expires: n,
75
- canTrack: r
76
- }) => {
77
- try {
78
- if (!r)
79
- return;
80
- const o = ot({
81
- name: t,
82
- value: e,
83
- expires: n
84
- });
85
- document.cookie = o;
86
- } catch (o) {
87
- l.warn("[COOKIE] SET error: ", (o == null ? void 0 : o.message) || o);
88
- }
89
- }, st = "builder.tests", v = (t) => `${st}.${t}`, it = ({
90
- contentId: t
91
- }) => $({
92
- name: v(t),
93
- canTrack: !0
94
- }), at = ({
95
- contentId: t
96
- }) => N({
97
- name: v(t),
98
- canTrack: !0
99
- }), ct = ({
100
- contentId: t,
101
- value: e
102
- }) => j({
103
- name: v(t),
104
- value: e,
105
- canTrack: !0
106
- }), F = (t) => d(t.id) && d(t.variations) && Object.keys(t.variations).length > 0, ut = ({
107
- id: t,
108
- variations: e
109
- }) => {
110
- var o;
111
- let n = 0;
112
- const r = Math.random();
113
- for (const s in e) {
114
- const c = (o = e[s]) == null ? void 0 : o.testRatio;
115
- if (n += c, r < n)
116
- return s;
117
- }
118
- return t;
119
- }, U = (t) => {
120
- const e = ut(t);
121
- return ct({
122
- contentId: t.id,
123
- value: e
124
- }).catch((n) => {
125
- l.error("could not store A/B test variation: ", n);
126
- }), e;
127
- }, K = ({
128
- item: t,
129
- testGroupId: e
130
- }) => {
131
- const n = t.variations[e];
132
- return e === t.id || // handle edge-case where `testGroupId` points to non-existing variation
133
- !n ? {
134
- testVariationId: t.id,
135
- testVariationName: "Default"
136
- } : {
137
- data: n.data,
138
- testVariationId: n.id,
139
- testVariationName: n.name || (n.id === t.id ? "Default" : "")
140
- };
141
- }, jt = ({
142
- item: t,
143
- canTrack: e
144
- }) => {
145
- if (!e)
146
- return t;
147
- if (!t)
148
- return;
149
- if (!F(t))
150
- return t;
151
- const n = at({
152
- contentId: t.id
153
- }) || U({
154
- variations: t.variations,
155
- id: t.id
156
- }), r = K({
157
- item: t,
158
- testGroupId: n
159
- });
160
- return {
161
- ...t,
162
- ...r
163
- };
164
- }, lt = async ({
165
- item: t,
166
- canTrack: e
167
- }) => {
168
- if (!e || !F(t))
169
- return t;
170
- const r = await it({
171
- contentId: t.id
172
- }) || U({
173
- variations: t.variations,
174
- id: t.id
175
- }), o = K({
176
- item: t,
177
- testGroupId: r
178
- });
179
- return {
180
- ...t,
181
- ...o
182
- };
183
- }, dt = (t) => d(t) ? t : !0, Ft = [], Ut = (t) => ({
184
- type: "builder.registerComponent",
185
- data: gt(t)
186
- }), ft = (t) => {
187
- const e = t.toString().trim();
188
- return `return (${!e.startsWith("function") && !e.startsWith("(") ? "function " : ""}${e}).apply(this, arguments)`;
189
- }, ht = (t) => typeof t == "function" ? ft(t) : L(t), gt = ({
190
- inputs: t,
191
- ...e
192
- }) => ({
193
- ...L(e),
194
- inputs: t == null ? void 0 : t.map((n) => Object.entries(n).reduce((r, [o, s]) => ({
195
- ...r,
196
- [o]: ht(s)
197
- }), {}))
198
- });
199
- function pt() {
200
- return typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : globalThis;
201
- }
202
- function yt() {
203
- const t = pt().fetch;
204
- if (typeof t == "undefined")
205
- throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
206
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
207
- return t;
208
- }
209
- const mt = yt();
210
- function g(t, e = null, n = ".") {
211
- return Object.keys(t).reduce((r, o) => {
212
- const s = t[o], c = [e, o].filter(Boolean).join(n);
213
- return [typeof s == "object", s !== null, !(Array.isArray(s) && s.length === 0)].every(Boolean) ? {
214
- ...r,
215
- ...g(s, c, n)
216
- } : {
217
- ...r,
218
- [c]: s
219
- };
220
- }, {});
221
- }
222
- const St = "v3", A = "builder.", wt = "options.", bt = (t) => {
223
- const e = {};
224
- return t.forEach((n, r) => {
225
- e[r] = n;
226
- }), e;
227
- }, M = (t) => {
228
- if (!t)
229
- return {};
230
- const e = D(t), n = {};
231
- return Object.keys(e).forEach((r) => {
232
- if (r.startsWith(A)) {
233
- const o = r.replace(A, "").replace(wt, "");
234
- n[o] = e[r];
235
- }
236
- }), n;
237
- }, vt = () => {
238
- if (!a())
239
- return {};
240
- const t = new URLSearchParams(window.location.search);
241
- return M(t);
242
- }, D = (t) => t instanceof URLSearchParams ? bt(t) : t, T = (t) => typeof t == "number" && !isNaN(t) && t >= 0, I = (t) => {
243
- let {
244
- noTraverse: e = !1
245
- } = t;
246
- const {
247
- limit: n = 30,
248
- userAttributes: r,
249
- query: o,
250
- model: s,
251
- apiKey: c,
252
- includeRefs: p = !0,
253
- enrich: O,
254
- locale: k,
255
- apiVersion: y = St,
256
- fields: C,
257
- omit: q,
258
- offset: m,
259
- cacheSeconds: S,
260
- staleCacheSeconds: w,
261
- sort: E,
262
- includeUnpublished: P
263
- } = t;
264
- if (!c)
265
- throw new Error("Missing API key");
266
- if (!["v2", "v3"].includes(y))
267
- throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${y}'`);
268
- (t.limit === void 0 || t.limit > 1) && !("noTraverse" in t) && (e = !0);
269
- const i = new URL(`https://cdn.builder.io/api/${y}/content/${s}?apiKey=${c}&limit=${n}&noTraverse=${e}&includeRefs=${p}${k ? `&locale=${k}` : ""}${O ? `&enrich=${O}` : ""}`);
270
- if (i.searchParams.set("omit", q || "meta.componentsUsed"), C && i.searchParams.set("fields", C), Number.isFinite(m) && m > -1 && i.searchParams.set("offset", String(Math.floor(m))), typeof P == "boolean" && i.searchParams.set("includeUnpublished", String(P)), S && T(S) && i.searchParams.set("cacheSeconds", String(S)), w && T(w) && i.searchParams.set("staleCacheSeconds", String(w)), E) {
271
- const u = g({
272
- sort: E
273
- });
274
- for (const f in u)
275
- i.searchParams.set(f, JSON.stringify(u[f]));
276
- }
277
- const H = {
278
- ...vt(),
279
- ...D(t.options || {})
280
- }, x = g(H);
281
- for (const u in x)
282
- i.searchParams.set(u, String(x[u]));
283
- if (r && i.searchParams.set("userAttributes", JSON.stringify(r)), o) {
284
- const u = g({
285
- query: o
286
- });
287
- for (const f in u)
288
- i.searchParams.set(f, JSON.stringify(u[f]));
289
- }
290
- return i;
291
- }, It = (t) => "results" in t;
292
- async function _(t) {
293
- const e = await G({
294
- ...t,
295
- limit: 1
296
- });
297
- return e && e[0] || null;
298
- }
299
- const Kt = _, Ot = async (t) => {
300
- const e = I(t);
301
- return await (await mt(e.href)).json();
302
- }, kt = async (t, e, n = I(t)) => {
303
- const r = dt(t.canTrack);
304
- if (n.search.includes("preview="), !r || !(a() || b === "reactNative"))
305
- return e.results;
306
- try {
307
- const o = [];
308
- for (const s of e.results)
309
- o.push(await lt({
310
- item: s,
311
- canTrack: r
312
- }));
313
- e.results = o;
314
- } catch (o) {
315
- l.error("Could not process A/B tests. ", o);
316
- }
317
- return e.results;
318
- };
319
- async function G(t) {
320
- try {
321
- const e = I(t), n = await Ot(t);
322
- return It(n) ? kt(t, n) : (l.error("Error fetching data. ", {
323
- url: e,
324
- content: n,
325
- options: t
326
- }), null);
327
- } catch (e) {
328
- return l.error("Error fetching data. ", e), null;
329
- }
330
- }
331
- const Mt = G;
332
- function Dt() {
333
- return !a() || B() ? !1 : location.search.indexOf("builder.preview=") !== -1;
334
- }
335
- function Ct() {
336
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
337
- const e = Math.random() * 16 | 0;
338
- return (t == "x" ? e : e & 3 | 8).toString(16);
339
- });
340
- }
341
- function W() {
342
- return Ct().replace(/-/g, "");
343
- }
344
- const J = "builderSessionId", Et = async ({
345
- canTrack: t
346
- }) => {
347
- if (!t)
348
- return;
349
- const e = await $({
350
- name: J,
351
- canTrack: t
352
- });
353
- if (d(e))
354
- return e;
355
- {
356
- const n = Pt();
357
- return xt({
358
- id: n,
359
- canTrack: t
360
- }), n;
361
- }
362
- }, Pt = () => W(), xt = ({
363
- id: t,
364
- canTrack: e
365
- }) => j({
366
- name: J,
367
- value: t,
368
- canTrack: e
369
- }), z = () => a() && typeof localStorage != "undefined" ? localStorage : void 0, At = ({
370
- key: t,
371
- canTrack: e
372
- }) => {
373
- var n;
374
- try {
375
- return e ? (n = z()) == null ? void 0 : n.getItem(t) : void 0;
376
- } catch (r) {
377
- console.debug("[LocalStorage] GET error: ", r);
378
- return;
379
- }
380
- }, Tt = ({
381
- key: t,
382
- canTrack: e,
383
- value: n
384
- }) => {
385
- var r;
386
- try {
387
- e && ((r = z()) == null || r.setItem(t, n));
388
- } catch (o) {
389
- console.debug("[LocalStorage] SET error: ", o);
390
- }
391
- }, X = "builderVisitorId", Rt = ({
392
- canTrack: t
393
- }) => {
394
- if (!t)
395
- return;
396
- const e = At({
397
- key: X,
398
- canTrack: t
399
- });
400
- if (d(e))
401
- return e;
402
- {
403
- const n = Vt();
404
- return Bt({
405
- id: n,
406
- canTrack: t
407
- }), n;
408
- }
409
- }, Vt = () => W(), Bt = ({
410
- id: t,
411
- canTrack: e
412
- }) => Tt({
413
- key: X,
414
- value: t,
415
- canTrack: e
416
- }), Lt = async ({
417
- canTrack: t
418
- }) => {
419
- if (!t)
420
- return {
421
- visitorId: void 0,
422
- sessionId: void 0
423
- };
424
- const e = await Et({
425
- canTrack: t
426
- }), n = Rt({
427
- canTrack: t
428
- });
429
- return {
430
- sessionId: e,
431
- visitorId: n
432
- };
433
- }, Nt = async ({
434
- type: t,
435
- canTrack: e,
436
- apiKey: n,
437
- metadata: r,
438
- ...o
439
- }) => ({
440
- type: t,
441
- data: {
442
- ...o,
443
- metadata: {
444
- url: location.href,
445
- ...r
446
- },
447
- ...await Lt({
448
- canTrack: e
449
- }),
450
- userAttributes: tt(),
451
- ownerId: n
452
- }
453
- });
454
- async function $t(t) {
455
- if (!t.apiKey) {
456
- l.error("Missing API key for track call. Please provide your API key.");
457
- return;
458
- }
459
- if (t.canTrack && !B() && (a() || b === "reactNative"))
460
- return fetch("https://cdn.builder.io/api/v1/track", {
461
- method: "POST",
462
- body: JSON.stringify({
463
- events: [await Nt(t)]
464
- }),
465
- headers: {
466
- "content-type": "application/json"
467
- },
468
- mode: "cors"
469
- }).catch((e) => {
470
- console.error("Failed to track: ", e);
471
- });
472
- }
473
- const _t = (t) => $t({
474
- ...t,
475
- canTrack: !0
476
- }), R = {};
477
- function Gt(t, e) {
478
- let n = R[t];
479
- if (n || (n = R[t] = []), n.push(e), a()) {
480
- const r = {
481
- type: "builder.register",
482
- data: {
483
- type: t,
484
- info: e
485
- }
486
- };
487
- try {
488
- parent.postMessage(r, "*"), parent !== window && window.postMessage(r, "*");
489
- } catch (o) {
490
- console.debug("Could not postmessage", o);
491
- }
492
- }
493
- }
494
- const V = {};
495
- function Wt(t) {
496
- if (a()) {
497
- Object.assign(V, t);
498
- const e = {
499
- type: "builder.settingsChange",
500
- data: V
501
- };
502
- parent.postMessage(e, "*");
503
- }
504
- }
505
- const Jt = async (t) => {
506
- var r, o, s;
507
- const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((o = t.userAttributes) == null ? void 0 : o.urlPath), n = {
508
- ...t,
509
- apiKey: t.apiKey,
510
- model: t.model || "page",
511
- userAttributes: {
512
- ...t.userAttributes,
513
- ...e ? {
514
- urlPath: e
515
- } : {}
516
- },
517
- options: M(t.searchParams || ((s = t.url) == null ? void 0 : s.searchParams) || t.options)
518
- };
519
- return {
520
- apiKey: n.apiKey,
521
- model: n.model,
522
- content: await _(n)
523
- };
524
- };
525
- export {
526
- b as T,
527
- kt as _,
528
- Dt as a,
529
- _ as b,
530
- Ut as c,
531
- Kt as d,
532
- M as e,
533
- G as f,
534
- Mt as g,
535
- Jt as h,
536
- B as i,
537
- a as j,
538
- tt as k,
539
- d as l,
540
- l as m,
541
- L as n,
542
- dt as o,
543
- $t as p,
544
- mt as q,
545
- Gt as r,
546
- Wt as s,
547
- _t as t,
548
- Ft as u,
549
- gt as v,
550
- jt as w
551
- };