function __cfHardenFn(fn: Function) {
Object.freeze(fn);
const prototype = fn.prototype;
if (prototype && typeof prototype === "object") {
Object.freeze(prototype);
}
return fn;
}
import { __cfHelpers } from "commonfabric";
import { pattern, UI } from "commonfabric";
const define = undefined;
const runtimeDeps = undefined;
const __cfAmdHooks = undefined;
interface Reaction {
emoji: string;
userNames: string[];
}
interface Message {
id: string;
reactions?: Reaction[];
}
interface Input {
messages: Message[];
}
const __cfPattern_1 = __cfHelpers.pattern(__cf_pattern_input => {
const reaction = __cf_pattern_input.key("element");
const msg = __cf_pattern_input.key("params", "msg");
return ();
}, {
type: "object",
properties: {
element: {
$ref: "#/$defs/Reaction"
},
params: {
type: "object",
properties: {
msg: {
type: "object",
properties: {
id: {
type: "string"
}
},
required: ["id"]
}
},
required: ["msg"]
}
},
required: ["element", "params"],
$defs: {
Reaction: {
type: "object",
properties: {
emoji: {
type: "string"
},
userNames: {
type: "array",
items: {
type: "string"
}
}
},
required: ["emoji", "userNames"]
}
}
} as const satisfies __cfHelpers.JSONSchema, {
anyOf: [{
$ref: "https://commonfabric.org/schemas/vnode.json"
}, {
$ref: "#/$defs/UIRenderable"
}, {
type: "object",
properties: {}
}],
$defs: {
UIRenderable: {
type: "object",
properties: {
$UI: {
$ref: "https://commonfabric.org/schemas/vnode.json"
}
},
required: ["$UI"]
}
}
} as const satisfies __cfHelpers.JSONSchema);
const __cfPattern_2 = __cfHelpers.pattern(__cf_pattern_input => {
const reaction = __cf_pattern_input.key("element");
const msg = __cf_pattern_input.key("params", "msg");
return (
{msg.key("id")}:{reaction.key("userNames", "length")}
);
}, {
type: "object",
properties: {
element: {
type: "object",
properties: {
userNames: {
type: "array",
items: {
type: "unknown"
}
}
},
required: ["userNames"]
},
params: {
type: "object",
properties: {
msg: {
type: "object",
properties: {
id: {
type: "string"
}
},
required: ["id"]
}
},
required: ["msg"]
}
},
required: ["element", "params"]
} as const satisfies __cfHelpers.JSONSchema, {
anyOf: [{
$ref: "https://commonfabric.org/schemas/vnode.json"
}, {
$ref: "#/$defs/UIRenderable"
}, {
type: "object",
properties: {}
}],
$defs: {
UIRenderable: {
type: "object",
properties: {
$UI: {
$ref: "https://commonfabric.org/schemas/vnode.json"
}
},
required: ["$UI"]
}
}
} as const satisfies __cfHelpers.JSONSchema);
const __cfPattern_3 = __cfHelpers.pattern(__cf_pattern_input => {
const msg = __cf_pattern_input.key("element");
return (