{"version":3,"file":"demoControlBody.js","names":[],"sources":["jsx/react-flow/demoControlBody.js"],"sourcesContent":["import { createGraphSchema, defaultRules } from \"../model/index\";\nimport { builtinEdgeKinds } from \"../edges/edgeKinds\";\nimport { demoControlSchemaId, demoSchemaShape } from \"./fixtures\";\nimport { Handle, Position } from \"./xy\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction DemoControlBody({\n  ports,\n  measure,\n  title\n}) {\n  return /* @__PURE__ */ jsxs(\n    \"div\",\n    {\n      style: {\n        width: measure?.width ?? 190,\n        minHeight: measure?.minHeight ?? 72,\n        boxSizing: \"border-box\",\n        border: \"1px solid currentColor\",\n        borderRadius: 8,\n        padding: 8,\n        font: \"inherit\",\n        opacity: 0.9\n      },\n      children: [\n        /* @__PURE__ */ jsx(\"div\", { style: { fontWeight: 600 }, children: title }),\n        ports.map((port, index) => /* @__PURE__ */ jsx(\n          Handle,\n          {\n            id: port.id,\n            type: port.direction === \"out\" ? \"source\" : \"target\",\n            position: port.side === \"right\" ? Position.Right : Position.Left,\n            style: { top: 24 + index * 20, width: 8, height: 8, borderRadius: \"50%\" }\n          },\n          port.id\n        ))\n      ]\n    }\n  );\n}\nfunction demoControlSchema() {\n  const shape = demoSchemaShape();\n  const body = (title) => (props) => /* @__PURE__ */ jsx(DemoControlBody, { ...props, title });\n  return createGraphSchema({\n    id: demoControlSchemaId,\n    nodes: {\n      source: { ...shape.nodes.source, render: body(\"Source\") },\n      transform: { ...shape.nodes.transform, render: body(\"Transform\") },\n      sink: { ...shape.nodes.sink, render: body(\"Sink\") }\n    },\n    edges: builtinEdgeKinds,\n    rules: defaultRules\n  });\n}\nexport {\n  DemoControlBody,\n  demoControlSchema\n};\n//# sourceMappingURL=demoControlBody.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,gBAAgB,EACvB,OACA,SACA,SACC;CACD,OAAuB,qBACrB,OACA;EACE,OAAO;GACL,OAAO,SAAS,SAAS;GACzB,WAAW,SAAS,aAAa;GACjC,WAAW;GACX,QAAQ;GACR,cAAc;GACd,SAAS;GACT,MAAM;GACN,SAAS;EACX;EACA,UAAU,CACQ,oBAAI,OAAO;GAAE,OAAO,EAAE,YAAY,IAAI;GAAG,UAAU;EAAM,CAAC,GAC1E,MAAM,KAAK,MAAM,UAA0B,oBACzC,QACA;GACE,IAAI,KAAK;GACT,MAAM,KAAK,cAAc,QAAQ,WAAW;GAC5C,UAAU,KAAK,SAAS,UAAU,SAAS,QAAQ,SAAS;GAC5D,OAAO;IAAE,KAAK,KAAK,QAAQ;IAAI,OAAO;IAAG,QAAQ;IAAG,cAAc;GAAM;EAC1E,GACA,KAAK,EACP,CAAC,CACH;CACF,CACF;AACF;AACA,SAAS,oBAAoB;CAC3B,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,QAAQ,WAAW,UAA0B,oBAAI,iBAAiB;EAAE,GAAG;EAAO;CAAM,CAAC;CAC3F,OAAO,kBAAkB;EACvB,IAAI;EACJ,OAAO;GACL,QAAQ;IAAE,GAAG,MAAM,MAAM;IAAQ,QAAQ,KAAK,QAAQ;GAAE;GACxD,WAAW;IAAE,GAAG,MAAM,MAAM;IAAW,QAAQ,KAAK,WAAW;GAAE;GACjE,MAAM;IAAE,GAAG,MAAM,MAAM;IAAM,QAAQ,KAAK,MAAM;GAAE;EACpD;EACA,OAAO;EACP,OAAO;CACT,CAAC;AACH"}