@automattic/agenttic-client
Version:
A TypeScript client library for A2A (Agent2Agent) protocol communication
974 lines (968 loc) • 33 kB
JavaScript
import Te from "react";
const gr = () => ({
selectedBlockClientId: "qwu2",
currentPageContent: [
{
name: "core/post-content",
type: "content",
clientId: "kgrq",
innerBlocks: [
{
clientId: "hac1",
name: "core/group",
isValid: !0,
originalContent: '<div class="wp-block-group alignfull is-style-section-default" id="intro-section" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)"></div>',
validationIssues: [],
attributes: {
tagName: "div",
metadata: {
name: "Introduction",
patternCategory: "intro",
remotePatternId: 14040,
reason: "Creates a strong first impression by highlighting Mama's Bread's reputation and inviting customers to discover more. Features key imagery. "
},
align: "full",
className: "is-style-section-default",
style: {
spacing: {
margin: {
top: "0",
bottom: "0"
},
padding: {
top: "var:preset|spacing|40",
bottom: "var:preset|spacing|40"
}
}
},
layout: {
type: "constrained",
justifyContent: "center"
},
anchor: "intro-section"
},
innerBlocks: [
{
clientId: "XfP9",
name: "core/group",
isValid: !0,
originalContent: `<div class="wp-block-group alignwide">
</div>`,
validationIssues: [],
attributes: {
tagName: "div",
metadata: {
name: "Container"
},
align: "wide",
style: {
spacing: {
blockGap: "var:preset|spacing|40"
}
},
layout: {
type: "constrained"
}
},
innerBlocks: [
{
clientId: "bo18",
name: "core/columns",
isValid: !0,
originalContent: `<div class="wp-block-columns alignwide are-vertically-aligned-top">
</div>`,
validationIssues: [],
attributes: {
verticalAlignment: "top",
isStackedOnMobile: !0,
align: "wide",
style: {
spacing: {
blockGap: {
top: "var:preset|spacing|30"
}
}
}
},
innerBlocks: [
{
clientId: "B0cB",
name: "core/column",
isValid: !0,
originalContent: '<div class="wp-block-column is-vertically-aligned-top"></div>',
validationIssues: [],
attributes: {
verticalAlignment: "top",
width: "",
layout: {
type: "constrained",
justifyContent: "left",
contentSize: "480px"
}
},
innerBlocks: [
{
clientId: "2Vj9",
name: "core/heading",
isValid: !0,
originalContent: `<h2 class="wp-block-heading">Welcome to Oakland's Favorite Bakery</h2>`,
validationIssues: [],
attributes: {
content: "Welcome to Oakland's Favorite Bakery",
level: 2
},
innerBlocks: []
}
]
},
{
clientId: "KHCI",
name: "core/column",
isValid: !0,
originalContent: `<div class="wp-block-column is-vertically-aligned-top" style="flex-basis:40%">
</div>`,
validationIssues: [],
attributes: {
verticalAlignment: "top",
width: "40%"
},
innerBlocks: [
{
clientId: "qwu2",
name: "core/paragraph",
isValid: !0,
originalContent: "<p>Discover why Mama's Bread is celebrated for its fresh, artisanal bread crafted with passion and tradition. Join us and taste the difference.</p>",
validationIssues: [],
attributes: {
content: "Discover why Mama's Bread is celebrated for its fresh, artisanal bread crafted with passion and tradition. Join us and taste the difference.",
dropCap: !1
},
innerBlocks: []
},
{
clientId: "o-IA",
name: "core/buttons",
isValid: !0,
originalContent: '<div class="wp-block-buttons"></div>',
validationIssues: [],
attributes: {},
innerBlocks: [
{
clientId: "wsbN",
name: "core/button",
isValid: !0,
originalContent: '<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="menu">Menu</a></div>',
validationIssues: [],
attributes: {
tagName: "a",
type: "button",
url: "menu",
text: "Menu"
},
innerBlocks: []
}
]
}
]
}
]
},
{
clientId: "K9PG",
name: "core/image",
isValid: !0,
originalContent: '<figure class="wp-block-image alignwide size-full aspect-16/9"><img src="http://localhost:8888/wp-content/uploads/2025/05/image-pexels-1055271.jpg" alt="bakery" class="wp-image-145"/></figure>',
validationIssues: [],
attributes: {
url: "http://localhost:8888/wp-content/uploads/2025/05/image-pexels-1055271.jpg",
alt: "bakery",
caption: "",
id: 145,
sizeSlug: "full",
linkDestination: "none",
align: "wide",
className: "aspect-16/9"
},
innerBlocks: []
}
]
}
]
}
]
}
]
}), mr = (h) => ({
abilities: [
{
name: "demo/get-user-info",
label: "Get User Info",
description: "Retrieves information about the current user including name, email, and preferences",
category: "user",
input_schema: {
type: "object",
properties: {
includePreferences: {
type: "boolean",
description: "Whether to include user preferences"
}
}
},
output_schema: {
type: "object",
properties: {
name: { type: "string" },
email: { type: "string" },
preferences: {
type: "object"
}
}
},
meta: {
annotations: {
instructions: "Use this ability when the user asks about their account information or profile",
readonly: !0,
destructive: !1,
idempotent: !0
}
},
callback: async (_) => ({
name: "Demo User",
email: "demo@example.com",
preferences: _.includePreferences ? { theme: "dark", language: "en" } : void 0
})
}
],
getAvailableTools: async () => [
{
id: "display_graph",
name: "Sales Graph Display",
description: "Displays a sales graph for products with interactive visualization. Use when users ask to see sales data, product performance, or graphical representations of sales metrics. Just make up random data",
input_schema: {
type: "object",
properties: {
title: {
type: "string",
description: 'The title for the graph (e.g., "Top 5 Products by Sales")'
},
timeframe: {
type: "string",
description: 'Optional timeframe description (e.g., "Last 30 days", "Q3 2024")'
},
data: {
type: "array",
description: "Array of sales data for products",
items: {
type: "object",
properties: {
product: {
type: "string",
description: "Product name"
},
sales: {
type: "number",
description: "Number of sales/units sold"
}
},
required: ["product", "sales"]
}
}
},
required: ["title", "data"]
}
}
],
executeTool: async (_, c, w, f) => {
switch (console.log(`Executing tool: ${_}`, {
args: c,
messageId: w,
toolCallId: f
}), _) {
case "display_graph":
if (!c.title || !c.data)
return {
result: "Error: Title and data are required for graph display",
returnToAgent: !0
};
const { MockSalesGraph: E } = await Promise.resolve().then(() => pr);
return h({
id: crypto.randomUUID(),
role: "agent",
content: [
{
type: "component",
component: E,
componentProps: {
title: c.title,
data: c.data,
timeframe: c.timeframe
}
}
],
timestamp: Date.now(),
archived: !1,
showIcon: !0
}), {
result: `Graph displayed: ${c.title} with ${c.data.length} data points`,
returnToAgent: !1
};
}
}
});
var H = { exports: {} }, F = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ke;
function cr() {
if (ke) return F;
ke = 1;
var h = Te, y = Symbol.for("react.element"), _ = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, w = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
function E(C, d, P) {
var m, R = {}, T = null, V = null;
P !== void 0 && (T = "" + P), d.key !== void 0 && (T = "" + d.key), d.ref !== void 0 && (V = d.ref);
for (m in d) c.call(d, m) && !f.hasOwnProperty(m) && (R[m] = d[m]);
if (C && C.defaultProps) for (m in d = C.defaultProps, d) R[m] === void 0 && (R[m] = d[m]);
return { $$typeof: y, type: C, key: T, ref: V, props: R, _owner: w.current };
}
return F.Fragment = _, F.jsx = E, F.jsxs = E, F;
}
var $ = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ce;
function fr() {
return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
var h = Te, y = Symbol.for("react.element"), _ = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), C = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), Q = Symbol.iterator, Se = "@@iterator";
function Oe(e) {
if (e === null || typeof e != "object")
return null;
var r = Q && e[Q] || e[Se];
return typeof r == "function" ? r : null;
}
var j = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function p(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
t[n - 1] = arguments[n];
Pe("error", e, t);
}
}
function Pe(e, r, t) {
{
var n = j.ReactDebugCurrentFrame, o = n.getStackAddendum();
o !== "" && (r += "%s", t = t.concat([o]));
var s = t.map(function(i) {
return String(i);
});
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
}
}
var je = !1, xe = !1, Ie = !1, De = !1, Ae = !1, Z;
Z = Symbol.for("react.module.reference");
function Fe(e) {
return !!(typeof e == "string" || typeof e == "function" || e === c || e === f || Ae || e === w || e === P || e === m || De || e === V || je || xe || Ie || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === R || e.$$typeof === E || e.$$typeof === C || e.$$typeof === d || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === Z || e.getModuleId !== void 0));
}
function $e(e, r, t) {
var n = e.displayName;
if (n)
return n;
var o = r.displayName || r.name || "";
return o !== "" ? t + "(" + o + ")" : t;
}
function ee(e) {
return e.displayName || "Context";
}
function k(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case c:
return "Fragment";
case _:
return "Portal";
case f:
return "Profiler";
case w:
return "StrictMode";
case P:
return "Suspense";
case m:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case C:
var r = e;
return ee(r) + ".Consumer";
case E:
var t = e;
return ee(t._context) + ".Provider";
case d:
return $e(e, e.render, "ForwardRef");
case R:
var n = e.displayName || null;
return n !== null ? n : k(e.type) || "Memo";
case T: {
var o = e, s = o._payload, i = o._init;
try {
return k(i(s));
} catch {
return null;
}
}
}
return null;
}
var S = Object.assign, D = 0, re, te, ne, ae, ie, oe, se;
function le() {
}
le.__reactDisabledLog = !0;
function Be() {
{
if (D === 0) {
re = console.log, te = console.info, ne = console.warn, ae = console.error, ie = console.group, oe = console.groupCollapsed, se = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: le,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
D++;
}
}
function Ve() {
{
if (D--, D === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: S({}, e, {
value: re
}),
info: S({}, e, {
value: te
}),
warn: S({}, e, {
value: ne
}),
error: S({}, e, {
value: ae
}),
group: S({}, e, {
value: ie
}),
groupCollapsed: S({}, e, {
value: oe
}),
groupEnd: S({}, e, {
value: se
})
});
}
D < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var L = j.ReactCurrentDispatcher, N;
function M(e, r, t) {
{
if (N === void 0)
try {
throw Error();
} catch (o) {
var n = o.stack.trim().match(/\n( *(at )?)/);
N = n && n[1] || "";
}
return `
` + N + e;
}
}
var G = !1, W;
{
var Me = typeof WeakMap == "function" ? WeakMap : Map;
W = new Me();
}
function ue(e, r) {
if (!e || G)
return "";
{
var t = W.get(e);
if (t !== void 0)
return t;
}
var n;
G = !0;
var o = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var s;
s = L.current, L.current = null, Be();
try {
if (r) {
var i = function() {
throw Error();
};
if (Object.defineProperty(i.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(i, []);
} catch (g) {
n = g;
}
Reflect.construct(e, [], i);
} else {
try {
i.call();
} catch (g) {
n = g;
}
e.call(i.prototype);
}
} else {
try {
throw Error();
} catch (g) {
n = g;
}
e();
}
} catch (g) {
if (g && n && typeof g.stack == "string") {
for (var a = g.stack.split(`
`), v = n.stack.split(`
`), l = a.length - 1, u = v.length - 1; l >= 1 && u >= 0 && a[l] !== v[u]; )
u--;
for (; l >= 1 && u >= 0; l--, u--)
if (a[l] !== v[u]) {
if (l !== 1 || u !== 1)
do
if (l--, u--, u < 0 || a[l] !== v[u]) {
var b = `
` + a[l].replace(" at new ", " at ");
return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && W.set(e, b), b;
}
while (l >= 1 && u >= 0);
break;
}
}
} finally {
G = !1, L.current = s, Ve(), Error.prepareStackTrace = o;
}
var I = e ? e.displayName || e.name : "", O = I ? M(I) : "";
return typeof e == "function" && W.set(e, O), O;
}
function We(e, r, t) {
return ue(e, !1);
}
function Ye(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function Y(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return ue(e, Ye(e));
if (typeof e == "string")
return M(e);
switch (e) {
case P:
return M("Suspense");
case m:
return M("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case d:
return We(e.render);
case R:
return Y(e.type, r, t);
case T: {
var n = e, o = n._payload, s = n._init;
try {
return Y(s(o), r, t);
} catch {
}
}
}
return "";
}
var A = Object.prototype.hasOwnProperty, ce = {}, fe = j.ReactDebugCurrentFrame;
function U(e) {
if (e) {
var r = e._owner, t = Y(e.type, e._source, r ? r.type : null);
fe.setExtraStackFrame(t);
} else
fe.setExtraStackFrame(null);
}
function Ue(e, r, t, n, o) {
{
var s = Function.call.bind(A);
for (var i in e)
if (s(e, i)) {
var a = void 0;
try {
if (typeof e[i] != "function") {
var v = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw v.name = "Invariant Violation", v;
}
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (l) {
a = l;
}
a && !(a instanceof Error) && (U(o), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), U(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, U(o), p("Failed %s type: %s", t, a.message), U(null));
}
}
}
var Le = Array.isArray;
function q(e) {
return Le(e);
}
function Ne(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function Ge(e) {
try {
return de(e), !1;
} catch {
return !0;
}
}
function de(e) {
return "" + e;
}
function pe(e) {
if (Ge(e))
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), de(e);
}
var ve = j.ReactCurrentOwner, qe = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, ge, me;
function Je(e) {
if (A.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function ze(e) {
if (A.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Ke(e, r) {
typeof e.ref == "string" && ve.current;
}
function Xe(e, r) {
{
var t = function() {
ge || (ge = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
t.isReactWarning = !0, Object.defineProperty(e, "key", {
get: t,
configurable: !0
});
}
}
function He(e, r) {
{
var t = function() {
me || (me = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: t,
configurable: !0
});
}
}
var Qe = function(e, r, t, n, o, s, i) {
var a = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: y,
// Built-in properties that belong on the element
type: e,
key: r,
ref: t,
props: i,
// Record the component responsible for creating this element.
_owner: s
};
return a._store = {}, Object.defineProperty(a._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(a, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: n
}), Object.defineProperty(a, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: o
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
};
function Ze(e, r, t, n, o) {
{
var s, i = {}, a = null, v = null;
t !== void 0 && (pe(t), a = "" + t), ze(r) && (pe(r.key), a = "" + r.key), Je(r) && (v = r.ref, Ke(r, o));
for (s in r)
A.call(r, s) && !qe.hasOwnProperty(s) && (i[s] = r[s]);
if (e && e.defaultProps) {
var l = e.defaultProps;
for (s in l)
i[s] === void 0 && (i[s] = l[s]);
}
if (a || v) {
var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
a && Xe(i, u), v && He(i, u);
}
return Qe(e, a, v, o, n, ve.current, i);
}
}
var J = j.ReactCurrentOwner, be = j.ReactDebugCurrentFrame;
function x(e) {
if (e) {
var r = e._owner, t = Y(e.type, e._source, r ? r.type : null);
be.setExtraStackFrame(t);
} else
be.setExtraStackFrame(null);
}
var z;
z = !1;
function K(e) {
return typeof e == "object" && e !== null && e.$$typeof === y;
}
function ye() {
{
if (J.current) {
var e = k(J.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function er(e) {
return "";
}
var he = {};
function rr(e) {
{
var r = ye();
if (!r) {
var t = typeof e == "string" ? e : e.displayName || e.name;
t && (r = `
Check the top-level render call using <` + t + ">.");
}
return r;
}
}
function _e(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var t = rr(r);
if (he[t])
return;
he[t] = !0;
var n = "";
e && e._owner && e._owner !== J.current && (n = " It was passed a child from " + k(e._owner.type) + "."), x(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), x(null);
}
}
function Ee(e, r) {
{
if (typeof e != "object")
return;
if (q(e))
for (var t = 0; t < e.length; t++) {
var n = e[t];
K(n) && _e(n, r);
}
else if (K(e))
e._store && (e._store.validated = !0);
else if (e) {
var o = Oe(e);
if (typeof o == "function" && o !== e.entries)
for (var s = o.call(e), i; !(i = s.next()).done; )
K(i.value) && _e(i.value, r);
}
}
}
function tr(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var t;
if (typeof r == "function")
t = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === R))
t = r.propTypes;
else
return;
if (t) {
var n = k(r);
Ue(t, e.props, "prop", n, e);
} else if (r.PropTypes !== void 0 && !z) {
z = !0;
var o = k(r);
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function nr(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var n = r[t];
if (n !== "children" && n !== "key") {
x(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), x(null);
break;
}
}
e.ref !== null && (x(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), x(null));
}
}
var Re = {};
function we(e, r, t, n, o, s) {
{
var i = Fe(e);
if (!i) {
var a = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var v = er();
v ? a += v : a += ye();
var l;
e === null ? l = "null" : q(e) ? l = "array" : e !== void 0 && e.$$typeof === y ? (l = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
}
var u = Ze(e, r, t, o, s);
if (u == null)
return u;
if (i) {
var b = r.children;
if (b !== void 0)
if (n)
if (q(b)) {
for (var I = 0; I < b.length; I++)
Ee(b[I], e);
Object.freeze && Object.freeze(b);
} else
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Ee(b, e);
}
if (A.call(r, "key")) {
var O = k(e), g = Object.keys(r).filter(function(ur) {
return ur !== "key";
}), X = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Re[O + X]) {
var lr = g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}";
p(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, X, O, lr, O), Re[O + X] = !0;
}
}
return e === c ? nr(u) : tr(u), u;
}
}
function ar(e, r, t) {
return we(e, r, t, !0);
}
function ir(e, r, t) {
return we(e, r, t, !1);
}
var or = ir, sr = ar;
$.Fragment = c, $.jsx = or, $.jsxs = sr;
}()), $;
}
process.env.NODE_ENV === "production" ? H.exports = cr() : H.exports = fr();
var B = H.exports;
const dr = ({
title: h,
data: y,
timeframe: _
}) => {
y.map((f) => ({
label: f.product,
value: f.sales
}));
const c = y.reduce((f, E) => f + E.sales, 0), w = Math.round(c / y.length);
return /* @__PURE__ */ B.jsxs("div", { style: { padding: "20px", background: "#f5f5f5", borderRadius: "8px" }, children: [
/* @__PURE__ */ B.jsx("h3", { children: h }),
/* @__PURE__ */ B.jsxs("p", { children: [
"Total: $",
c.toLocaleString(),
" | Avg: $",
w.toLocaleString()
] }),
/* @__PURE__ */ B.jsx("ul", { style: { listStyle: "none", padding: 0 }, children: y.map((f) => /* @__PURE__ */ B.jsxs("li", { children: [
f.product,
": $",
f.sales.toLocaleString()
] }, f.product)) })
] });
}, pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
MockSalesGraph: dr
}, Symbol.toStringTag, { value: "Module" }));
export {
dr as MockSalesGraph,
gr as getClientContext,
mr as getClientTools
};