@gentiq/core 1.0.0-alpha.9 → 1.0.0-beta.2

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,48 +1,46 @@
1
- import { addMonths as t, getCalendarSystem as o, toLocalInput as a, weekStart as p } from "./calendars.es.js";
2
- import { createGentiqRuntime as c } from "./client/api.es.js";
3
- import { createLocalStorageAuthAdapter as x, resolveAuthAdapter as f } from "./client/auth.es.js";
4
- import { createHttpClient as g } from "./client/http.es.js";
5
- import { exchangeLoginCodeOnce as u } from "./client/loginCode.es.js";
6
- import { rejectAttachment as s } from "./composer/attachmentLimits.es.js";
7
- import { composerScope as h } from "./composer/composerDrafts.es.js";
8
- import { normalizeReference as A, normalizeWhitespace as R, sourceTextSignature as T, truncateReferenceText as C } from "./composer/references.es.js";
9
- import { createVoiceRecorder as w, isVoiceRecordingSupported as k } from "./composer/voiceRecorder.es.js";
10
- import { getCalendar as v, getDateLocale as y, getNumberLocale as z } from "./datetime.es.js";
1
+ import { createGentiqRuntime as o } from "./client/api.es.js";
2
+ import { createLocalStorageAuthAdapter as a, resolveAuthAdapter as p } from "./client/auth.es.js";
3
+ import { BRANDING_URL_PREFIX as c, isValidIconUrl as m, resolveBrandingUrl as x } from "./client/brandingUrl.es.js";
4
+ import { createHttpClient as i } from "./client/http.es.js";
5
+ import { exchangeLoginCodeOnce as g } from "./client/loginCode.es.js";
6
+ import { composerScope as s } from "./composer/composerDrafts.es.js";
7
+ import { normalizeReference as h, normalizeWhitespace as R, sourceTextSignature as S, truncateReferenceText as L } from "./composer/references.es.js";
8
+ import { createVoiceRecorder as T, isVoiceRecordingSupported as B } from "./composer/voiceRecorder.es.js";
9
+ import { getDateLocale as U, getNumberLocale as b } from "./datetime.es.js";
11
10
  import { debugLog as D } from "./debugLog.es.js";
12
- import { warnOnceInDevelopment as O } from "./devWarning.es.js";
13
- import { getLanguageBadge as V } from "./languages.es.js";
14
- import { messageFeedback as F } from "./protocol/messages.es.js";
15
- import { isStoredPart as H, isStoredToolPart as M } from "./protocol/storedMessages.es.js";
16
- import { newThreadState as W, storedThreadState as E } from "./thread/threadReducer.es.js";
17
- import { uniqueBy as K } from "./uniqueBy.es.js";
11
+ import { warnOnceInDevelopment as P } from "./devWarning.es.js";
12
+ import { getLanguageBadge as q } from "./languages.es.js";
13
+ import { messageFeedback as z } from "./protocol/messages.es.js";
14
+ import { isStoredPart as F, isStoredToolPart as G } from "./protocol/storedMessages.es.js";
15
+ import { shareUnchanged as _ } from "./thread/shareUnchanged.es.js";
16
+ import { newThreadState as y, storedThreadState as E } from "./thread/threadReducer.es.js";
17
+ import { uniqueBy as W } from "./uniqueBy.es.js";
18
18
  export {
19
- t as addMonths,
20
- h as composerScope,
21
- c as createGentiqRuntime,
22
- g as createHttpClient,
23
- x as createLocalStorageAuthAdapter,
24
- w as createVoiceRecorder,
19
+ c as BRANDING_URL_PREFIX,
20
+ s as composerScope,
21
+ o as createGentiqRuntime,
22
+ i as createHttpClient,
23
+ a as createLocalStorageAuthAdapter,
24
+ T as createVoiceRecorder,
25
25
  D as debugLog,
26
- u as exchangeLoginCodeOnce,
27
- v as getCalendar,
28
- o as getCalendarSystem,
29
- y as getDateLocale,
30
- V as getLanguageBadge,
31
- z as getNumberLocale,
32
- H as isStoredPart,
33
- M as isStoredToolPart,
34
- k as isVoiceRecordingSupported,
35
- F as messageFeedback,
36
- W as newThreadState,
37
- A as normalizeReference,
26
+ g as exchangeLoginCodeOnce,
27
+ U as getDateLocale,
28
+ q as getLanguageBadge,
29
+ b as getNumberLocale,
30
+ F as isStoredPart,
31
+ G as isStoredToolPart,
32
+ m as isValidIconUrl,
33
+ B as isVoiceRecordingSupported,
34
+ z as messageFeedback,
35
+ y as newThreadState,
36
+ h as normalizeReference,
38
37
  R as normalizeWhitespace,
39
- s as rejectAttachment,
40
- f as resolveAuthAdapter,
41
- T as sourceTextSignature,
38
+ p as resolveAuthAdapter,
39
+ x as resolveBrandingUrl,
40
+ _ as shareUnchanged,
41
+ S as sourceTextSignature,
42
42
  E as storedThreadState,
43
- a as toLocalInput,
44
- C as truncateReferenceText,
45
- K as uniqueBy,
46
- O as warnOnceInDevelopment,
47
- p as weekStart
43
+ L as truncateReferenceText,
44
+ W as uniqueBy,
45
+ P as warnOnceInDevelopment
48
46
  };
@@ -1,5 +1,5 @@
1
- import { isToolUIPart as o } from "ai";
2
- function l(t, a) {
1
+ import { isToolUIPart as n } from "ai";
2
+ function u(t, a) {
3
3
  return {
4
4
  type: "file",
5
5
  mediaType: t.media_type,
@@ -9,35 +9,35 @@ function l(t, a) {
9
9
  };
10
10
  }
11
11
  function d(t, a) {
12
- return o(t) && t.state === "approval-requested" && (a === void 0 || t.approval.id === a);
12
+ return n(t) && t.state === "approval-requested" && (a === void 0 || t.approval.id === a);
13
13
  }
14
14
  function s(t, { id: a, approved: e, reason: i }) {
15
15
  return {
16
16
  ...t,
17
17
  parts: t.parts.map(
18
- (n) => o(n) && n.state === "approval-requested" && n.approval.id === a ? {
19
- ...n,
18
+ (o) => n(o) && o.state === "approval-requested" && o.approval.id === a ? {
19
+ ...o,
20
20
  state: "approval-responded",
21
- approval: { ...n.approval, id: a, approved: e, ...i ? { reason: i } : {} }
22
- } : n
21
+ approval: { ...o.approval, id: a, approved: e, ...i ? { reason: i } : {} }
22
+ } : o
23
23
  )
24
24
  };
25
25
  }
26
26
  function r(t, a) {
27
- return o(t) && t.state === "input-available" && (a === void 0 || t.toolCallId === a);
27
+ return n(t) && t.state === "input-available" && (a === void 0 || t.toolCallId === a);
28
28
  }
29
29
  function p(t) {
30
30
  return d(t) || r(t);
31
31
  }
32
- function f(t, { toolCallId: a, output: e }) {
32
+ function c(t, { toolCallId: a, output: e }) {
33
33
  return {
34
34
  ...t,
35
35
  parts: t.parts.map(
36
- (i) => o(i) && i.state === "input-available" && i.toolCallId === a ? { ...i, state: "output-available", output: e } : i
36
+ (i) => n(i) && i.state === "input-available" && i.toolCallId === a ? { ...i, state: "output-available", output: e } : i
37
37
  )
38
38
  };
39
39
  }
40
- function c(t) {
40
+ function f(t) {
41
41
  const { metadata: a } = t;
42
42
  if (typeof a != "object" || a === null || !("feedback" in a))
43
43
  return;
@@ -57,17 +57,18 @@ const b = [
57
57
  "data-progress-update",
58
58
  "data-message-id",
59
59
  "data-chat-finished",
60
- "data-title"
60
+ "data-title",
61
+ "tool-load_connector_tools"
61
62
  ];
62
63
  export {
63
64
  b as HIDDEN_PART_TYPES,
64
- l as attachmentFilePart,
65
+ u as attachmentFilePart,
65
66
  d as isAwaitingApproval,
66
67
  r as isAwaitingOutput,
67
68
  p as isAwaitingUser,
68
- c as messageFeedback,
69
+ f as messageFeedback,
69
70
  m as resolveMessageId,
70
71
  s as withApprovalResponse,
71
72
  v as withFeedback,
72
- f as withToolOutput
73
+ c as withToolOutput
73
74
  };
@@ -0,0 +1,104 @@
1
+ import { weekStart as m } from "./calendars.es.js";
2
+ import { createDateFormatter as f } from "./datetime.es.js";
3
+ function T() {
4
+ try {
5
+ const n = Intl.DateTimeFormat().resolvedOptions().timeZone;
6
+ return n && n.trim() ? n : "UTC";
7
+ } catch {
8
+ return "UTC";
9
+ }
10
+ }
11
+ function d(n) {
12
+ const t = /* @__PURE__ */ new Set();
13
+ for (const r of n) {
14
+ const e = Math.floor(r);
15
+ e === 7 ? t.add(0) : e >= 0 && e <= 6 && t.add(e);
16
+ }
17
+ return Array.from(t).sort((r, e) => r - e);
18
+ }
19
+ function D(n) {
20
+ const t = Math.max(0, Math.min(59, Math.floor(n.minute))), r = Math.max(0, Math.min(23, Math.floor(n.hour)));
21
+ if (n.frequency === "daily") return `${t} ${r} * * *`;
22
+ const e = d(n.daysOfWeek);
23
+ return e.length === 0 ? `${t} ${r} * * 1` : e.length === 7 ? `${t} ${r} * * *` : `${t} ${r} * * ${e.join(",")}`;
24
+ }
25
+ function l(n) {
26
+ const t = /* @__PURE__ */ new Set();
27
+ for (const r of n.split(",")) {
28
+ const e = r.trim();
29
+ if (/^[0-7]$/.test(e)) {
30
+ t.add(Number(e) === 7 ? 0 : Number(e));
31
+ continue;
32
+ }
33
+ const o = /^([0-7])-([0-7])$/.exec(e);
34
+ if (!o) return null;
35
+ const c = Number(o[1]), u = Number(o[2]);
36
+ if (c > u) return null;
37
+ for (let s = c; s <= u; s += 1)
38
+ t.add(s === 7 ? 0 : s);
39
+ }
40
+ return t.size > 0 ? Array.from(t).sort((r, e) => r - e) : null;
41
+ }
42
+ function y(n) {
43
+ if (!n) return null;
44
+ const t = n.trim().split(/\s+/);
45
+ if (t.length !== 5) return null;
46
+ const [r, e, o, c, u] = t;
47
+ if (o !== "*" || c !== "*" || !/^\d+$/.test(r) || !/^\d+$/.test(e)) return null;
48
+ const s = Number(r), i = Number(e);
49
+ if (s < 0 || s > 59 || i < 0 || i > 23) return null;
50
+ if (u === "*") return { frequency: "daily", hour: i, minute: s };
51
+ const a = l(u);
52
+ return a ? a.length === 7 ? { frequency: "daily", hour: i, minute: s } : { frequency: "weekly", hour: i, minute: s, daysOfWeek: a } : null;
53
+ }
54
+ function h(n, t, r) {
55
+ const e = new Date(Date.UTC(2026, 0, 1, n, t));
56
+ return f(r, {
57
+ hour: "2-digit",
58
+ minute: "2-digit",
59
+ timeZone: "UTC"
60
+ }).format(e);
61
+ }
62
+ function $(n, t, r) {
63
+ const e = m(r), o = [...n].sort((s, i) => (s - e + 7) % 7 - (i - e + 7) % 7), c = f(r, { weekday: "short", timeZone: "UTC" });
64
+ return o.map((s) => {
65
+ try {
66
+ return c.format(new Date(Date.UTC(2024, 0, 7 + s)));
67
+ } catch {
68
+ return t(`schedules:days.${s}`);
69
+ }
70
+ }).join(", ");
71
+ }
72
+ function p(n, t, r) {
73
+ if (n.kind === "once") {
74
+ if (!n.run_at) return t("schedules:cadence.once");
75
+ const o = f(r, {
76
+ dateStyle: "medium",
77
+ timeStyle: "short",
78
+ timeZone: n.timezone || "UTC"
79
+ }).format(new Date(n.run_at));
80
+ return t("schedules:cadence.once_at", { datetime: o });
81
+ }
82
+ if (n.kind === "interval") {
83
+ const o = n.interval_minutes ?? 60;
84
+ return o % 60 === 0 ? t("schedules:cadence.every_hours", { hours: o / 60 }) : t("schedules:cadence.every_minutes", { minutes: o });
85
+ }
86
+ const e = y(n.cron);
87
+ if (e) {
88
+ const o = h(e.hour, e.minute, r);
89
+ return e.frequency === "daily" ? t("schedules:cadence.daily", { time: o }) : e.daysOfWeek.length === 1 ? t("schedules:cadence.weekly", {
90
+ day: t(`schedules:days.${e.daysOfWeek[0]}`),
91
+ time: o
92
+ }) : t("schedules:cadence.weekly", {
93
+ day: $(e.daysOfWeek, t, r),
94
+ time: o
95
+ });
96
+ }
97
+ return n.cron ? t("schedules:cadence.custom", { cron: n.cron }) : t("schedules:cadence.custom_empty");
98
+ }
99
+ export {
100
+ y as cronToPreset,
101
+ p as describeSchedule,
102
+ T as detectLocalTimezone,
103
+ D as presetToCron
104
+ };
@@ -1,7 +1,7 @@
1
- import { createAttachmentCache as k } from "../attachments/attachmentCache.es.js";
1
+ import { createAttachmentCache as y } from "../attachments/attachmentCache.es.js";
2
2
  import { isTurnActive as T } from "./threadReducer.es.js";
3
3
  import { createThreadController as w } from "./threadController.es.js";
4
- const x = 3e4, C = 8, g = [];
4
+ const x = 3e4, C = 8, S = [];
5
5
  function N({
6
6
  http: A,
7
7
  resolveAttachment: D,
@@ -9,70 +9,70 @@ function N({
9
9
  getRunOptions: M,
10
10
  now: u = Date.now
11
11
  }) {
12
- const _ = k(D), c = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
13
- let o, a = g;
14
- const m = (e) => d.forEach((t) => t(e)), f = /* @__PURE__ */ new Set(), h = () => f.forEach((e) => e());
15
- function b() {
12
+ const _ = y(D), c = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
13
+ let o, a = S;
14
+ const m = (e) => f.forEach((t) => t(e)), h = /* @__PURE__ */ new Set(), d = () => h.forEach((e) => e());
15
+ function v() {
16
16
  const e = [...c].filter(([, t]) => T(t.controller.getState())).map(([t]) => t).sort();
17
- e.length === a.length && e.every((t, n) => t === a[n]) || (a = e.length === 0 ? g : e, l.forEach((t) => t()));
17
+ e.length === a.length && e.every((t, r) => t === a[r]) || (a = e.length === 0 ? S : e, l.forEach((t) => t()));
18
18
  }
19
- function v(e, t) {
20
- const n = {
19
+ function E(e, t) {
20
+ const r = {
21
21
  controller: t,
22
22
  idleSince: u(),
23
- unsubscribe: t.subscribe(b)
23
+ unsubscribe: t.subscribe(v)
24
24
  };
25
- return c.set(e, n), h(), b(), n;
25
+ return c.set(e, r), d(), v(), r;
26
26
  }
27
- function E(e) {
27
+ function b(e) {
28
28
  const t = w({
29
29
  http: A,
30
30
  attachments: _,
31
31
  threadId: e,
32
32
  throttleMs: L,
33
33
  getRunOptions: M,
34
- onStart: (n, r) => {
35
- o === t && (o = void 0), v(n, t), m({ type: "thread-started", threadId: n, message: r });
34
+ onStart: (r, n) => {
35
+ o === t && (o = void 0), E(r, t), m({ type: "thread-started", threadId: r, message: n });
36
36
  },
37
- onTurnEnd: (n) => {
38
- const r = c.get(n.threadId);
39
- r && (r.idleSince = u()), m({ type: "turn-ended", ...n }), S();
37
+ onTurnEnd: (r) => {
38
+ const n = c.get(r.threadId);
39
+ n && (n.idleSince = u()), m({ type: "turn-ended", ...r }), g();
40
40
  }
41
41
  });
42
42
  return t;
43
43
  }
44
- function y(e) {
45
- return (i.get(e.controller) ?? 0) === 0 && !T(e.controller.getState());
44
+ function k(e) {
45
+ return (s.get(e.controller) ?? 0) === 0 && !T(e.controller.getState());
46
46
  }
47
47
  function p(e, t) {
48
- c.delete(e), t.unsubscribe(), t.controller.dispose(), h();
48
+ c.delete(e), t.unsubscribe(), t.controller.dispose(), d();
49
49
  }
50
- function S() {
51
- const e = [...c].filter(([, r]) => y(r)), t = u() - x, n = e.filter(([r, s]) => s.idleSince > t ? !0 : (p(r, s), !1));
52
- n.sort(([, r], [, s]) => r.idleSince - s.idleSince).slice(0, Math.max(0, n.length - C)).forEach(([r, s]) => p(r, s));
50
+ function g() {
51
+ const e = [...c].filter(([, n]) => k(n)), t = u() - x, r = e.filter(([n, i]) => i.idleSince > t ? !0 : (p(n, i), !1));
52
+ r.sort(([, n], [, i]) => n.idleSince - i.idleSince).slice(0, Math.max(0, r.length - C)).forEach(([n, i]) => p(n, i));
53
53
  }
54
54
  return {
55
55
  thread(e) {
56
56
  if (e === null)
57
- return o || (o = E(null), h()), o;
58
- const t = c.get(e)?.controller ?? v(e, E(e)).controller;
59
- return S(), t;
57
+ return o || (o = b(null), d()), o;
58
+ const t = c.get(e)?.controller ?? E(e, b(e)).controller;
59
+ return g(), t;
60
60
  },
61
61
  peek: (e) => e === null ? o : c.get(e)?.controller,
62
62
  hold(e) {
63
- i.set(e, (i.get(e) ?? 0) + 1);
63
+ s.set(e, (s.get(e) ?? 0) + 1);
64
64
  let t = !1;
65
65
  return () => {
66
66
  if (t) return;
67
67
  t = !0;
68
- const n = (i.get(e) ?? 1) - 1;
69
- if (n > 0) {
70
- i.set(e, n);
68
+ const r = (s.get(e) ?? 1) - 1;
69
+ if (r > 0) {
70
+ s.set(e, r);
71
71
  return;
72
72
  }
73
- i.delete(e);
74
- const r = [...c.values()].find((s) => s.controller === e);
75
- r && (r.idleSince = u()), S();
73
+ s.delete(e);
74
+ const n = [...c.values()].find((i) => i.controller === e);
75
+ n && (n.idleSince = u()), g();
76
76
  };
77
77
  },
78
78
  getActiveThreadIds: () => a,
@@ -82,18 +82,22 @@ function N({
82
82
  };
83
83
  },
84
84
  subscribeThreads(e) {
85
- return f.add(e), () => {
86
- f.delete(e);
85
+ return h.add(e), () => {
86
+ h.delete(e);
87
87
  };
88
88
  },
89
89
  onEvent(e) {
90
- return d.add(e), () => {
91
- d.delete(e);
90
+ return f.add(e), () => {
91
+ f.delete(e);
92
92
  };
93
93
  },
94
+ reset() {
95
+ for (const [e, t] of c) p(e, t);
96
+ o?.dispose(), o = void 0, s.clear(), a = S, l.forEach((e) => e()), d();
97
+ },
94
98
  dispose() {
95
99
  for (const [e, t] of c) p(e, t);
96
- o?.dispose(), o = void 0, i.clear(), d.clear(), a = g, l.forEach((e) => e()), l.clear(), h(), f.clear();
100
+ o?.dispose(), o = void 0, s.clear(), f.clear(), a = S, l.forEach((e) => e()), l.clear(), d(), h.clear();
97
101
  }
98
102
  };
99
103
  }
@@ -1,48 +1,53 @@
1
- import { DefaultChatTransport as m } from "ai";
2
- import { errorFromResponse as d } from "../client/http.es.js";
3
- import { answersRequestBody as q, chatRequestBody as l } from "../protocol/chatRequest.es.js";
4
- import { startTrace as w, logRequestFailed as y, markReported as R, logRequestRefused as C, monitorChatResponse as T } from "./chatDiagnostics.es.js";
5
- function x(n, r, {
1
+ import { DefaultChatTransport as d } from "ai";
2
+ import { errorFromResponse as l } from "../client/http.es.js";
3
+ import { answersRequestBody as q, chatRequestBody as w } from "../protocol/chatRequest.es.js";
4
+ import { startTrace as y, logRequestFailed as g, markReported as R, logRequestRefused as C, monitorChatResponse as T } from "./chatDiagnostics.es.js";
5
+ function B(n, r, {
6
6
  lastRequest: c,
7
7
  toolOutputs: h = [],
8
8
  runOptions: u,
9
- resume: p
9
+ resume: p,
10
+ abortSignal: i
10
11
  }) {
11
- return new m({
12
+ return new d({
12
13
  api: "/chat",
13
14
  // The server holds the thread's history, so only the message being sent goes, or, when the
14
15
  // last message is an answer, the user's answers to the tool calls it waits on.
15
- prepareSendMessagesRequest: ({ messages: a }) => {
16
- const s = a.at(-1);
16
+ prepareSendMessagesRequest: ({ messages: s }) => {
17
+ const o = s.at(-1);
17
18
  return {
18
- body: s?.role === "assistant" ? q(r, s, { toolOutputs: h, options: u }) : l(r, a, u)
19
+ body: o?.role === "assistant" ? q(r, o, { toolOutputs: h, options: u }) : w(r, s, u)
19
20
  };
20
21
  },
21
22
  prepareReconnectToStreamRequest: () => ({
22
- api: p ? g(r, p.turnId, p.after) : "/chat"
23
+ api: p ? S(r, p.turnId, p.after) : "/chat"
23
24
  }),
24
25
  // The transport passes one of the paths above.
25
- fetch: async (a, s) => {
26
- const i = typeof a == "string" ? a : "/chat", f = new Headers(s?.headers), o = w(r);
27
- c.trace = o, f.set("X-Request-ID", o.requestId);
26
+ fetch: async (s, o) => {
27
+ const m = typeof s == "string" ? s : "/chat", f = new Headers(o?.headers), a = y(r);
28
+ c.trace = a, f.set("X-Request-ID", a.requestId);
28
29
  let t;
29
30
  try {
30
- t = await n.fetch(i, { ...s, headers: f });
31
+ t = await n.fetch(m, {
32
+ ...o,
33
+ signal: i ?? o?.signal,
34
+ headers: f
35
+ });
31
36
  } catch (e) {
32
- throw y(o, e), e instanceof Error ? R(e) : e;
37
+ throw g(a, e), e instanceof Error ? R(e) : e;
33
38
  }
34
39
  if (!t.ok) {
35
- o.status = t.status;
40
+ a.status = t.status;
36
41
  const e = await t.text().catch(() => "");
37
- throw C(o, t, e), R(d(t, e));
42
+ throw C(a, t, e), R(l(t, e));
38
43
  }
39
- return T(o, t);
44
+ return T(a, t);
40
45
  }
41
46
  });
42
47
  }
43
- function g(n, r, c) {
48
+ function S(n, r, c) {
44
49
  return `/chat/threads/${encodeURIComponent(n)}/turns/${encodeURIComponent(r)}/stream?after=${c}`;
45
50
  }
46
51
  export {
47
- x as createChatTransport
52
+ B as createChatTransport
48
53
  };
@@ -2,28 +2,28 @@ function l(t, r) {
2
2
  if (Object.is(t, r)) return r;
3
3
  if (Array.isArray(r)) {
4
4
  if (!Array.isArray(t)) return r;
5
- let n = t.length === r.length;
6
- const f = r.map((a, e) => {
7
- const c = l(t[e], a);
8
- return c !== t[e] && (n = !1), c;
5
+ let e = t.length === r.length;
6
+ const c = r.map((a, n) => {
7
+ const f = l(t[n], a);
8
+ return f !== t[n] && (e = !1), f;
9
9
  });
10
- return n ? t : f;
10
+ return e ? t : c;
11
11
  }
12
12
  if (y(r)) {
13
13
  if (!y(t)) return r;
14
- const n = Object.keys(r);
15
- let f = n.length === Object.keys(t).length;
14
+ const e = Object.keys(r);
15
+ let c = e.length === Object.keys(t).length;
16
16
  const a = {};
17
- for (const e of n) {
18
- const c = l(t[e], r[e]);
19
- a[e] = c, (c !== t[e] || !(e in t)) && (f = !1);
17
+ for (const n of e) {
18
+ const f = l(t[n], r[n]);
19
+ a[n] = f, (f !== t[n] || !(n in t)) && (c = !1);
20
20
  }
21
- return f ? t : a;
21
+ return c ? t : a;
22
22
  }
23
23
  return r;
24
24
  }
25
25
  function y(t) {
26
- if (typeof t != "object" || t === null) return !1;
26
+ if (typeof t != "object" || t === null || "$$typeof" in t) return !1;
27
27
  const r = Object.getPrototypeOf(t);
28
28
  return r === Object.prototype || r === null;
29
29
  }