{"version":3,"file":"schema.js","names":[],"sources":["esm/model/schema.js"],"sourcesContent":["function portArity(port) {\n  return port.arity ?? (port.direction === \"out\" ? \"many\" : \"one\");\n}\nfunction createGraphSchema(spec) {\n  return {\n    id: spec.id,\n    nodes: spec.nodes,\n    edges: spec.edges,\n    rules: spec.rules ?? [],\n    dropRules: spec.dropRules ?? []\n  };\n}\nconst registry = /* @__PURE__ */ new Map();\nfunction registerGraphSchema(schema) {\n  registry.set(schema.id, schema);\n}\nfunction getGraphSchema(id) {\n  return registry.get(id);\n}\nfunction clearGraphSchemas() {\n  registry.clear();\n}\nfunction nodeKindSpec(schema, kind) {\n  return schema.nodes[kind];\n}\nfunction resolvePorts(schema, node) {\n  const spec = nodeKindSpec(schema, node.kind);\n  if (!spec) return [];\n  return typeof spec.ports === \"function\" ? spec.ports(node.data) : spec.ports;\n}\nexport {\n  clearGraphSchemas,\n  createGraphSchema,\n  getGraphSchema,\n  nodeKindSpec,\n  portArity,\n  registerGraphSchema,\n  resolvePorts\n};\n//# sourceMappingURL=schema.js.map\n"],"mappings":";AAAA,SAAS,UAAU,MAAM;CACvB,OAAO,KAAK,UAAU,KAAK,cAAc,QAAQ,SAAS;AAC5D;AACA,SAAS,kBAAkB,MAAM;CAC/B,OAAO;EACL,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,OAAO,KAAK;EACZ,OAAO,KAAK,SAAS,CAAC;EACtB,WAAW,KAAK,aAAa,CAAC;CAChC;AACF;AACA,MAAM,2BAA2B,IAAI,IAAI;AACzC,SAAS,oBAAoB,QAAQ;CACnC,SAAS,IAAI,OAAO,IAAI,MAAM;AAChC;AACA,SAAS,eAAe,IAAI;CAC1B,OAAO,SAAS,IAAI,EAAE;AACxB;AACA,SAAS,oBAAoB;CAC3B,SAAS,MAAM;AACjB;AACA,SAAS,aAAa,QAAQ,MAAM;CAClC,OAAO,OAAO,MAAM;AACtB;AACA,SAAS,aAAa,QAAQ,MAAM;CAClC,MAAM,OAAO,aAAa,QAAQ,KAAK,IAAI;CAC3C,IAAI,CAAC,MAAM,OAAO,CAAC;CACnB,OAAO,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,KAAK,IAAI,IAAI,KAAK;AACzE"}