{"version":3,"file":"fixtures.js","names":[],"sources":["jsx/react-flow/fixtures.js"],"sourcesContent":["import { createGraphSchema, defaultRules } from \"../model/index\";\nimport { builtinEdgeKinds } from \"../edges/edgeKinds\";\nconst out = (id, label) => ({\n  id,\n  side: \"right\",\n  direction: \"out\",\n  label\n});\nconst into = (id, label) => ({\n  id,\n  side: \"left\",\n  direction: \"in\",\n  label\n});\nconst noRender = (() => null);\nconst demoGraphSchemaId = \"node-graph-demo\";\nconst demoControlSchemaId = `${demoGraphSchemaId}-control`;\nfunction demoSchemaShape() {\n  return {\n    id: demoGraphSchemaId,\n    nodes: {\n      source: {\n        kind: \"source\",\n        ports: [out(\"rows\", \"rows\")],\n        defaultData: { table: \"orders\" },\n        measure: { width: 190, minHeight: 72 }\n      },\n      transform: {\n        kind: \"transform\",\n        ports: [into(\"in\", \"rows\"), out(\"ok\", \"ok\"), out(\"err\", \"error\")],\n        defaultData: { expression: \"row => row\" },\n        measure: { width: 190, minHeight: 72 },\n        intent: \"accent\"\n      },\n      sink: {\n        kind: \"sink\",\n        ports: [into(\"in\", \"rows\")],\n        defaultData: { target: \"warehouse\" },\n        // 240 on purpose: it is not a value the default 172/190/216 table can\n        // produce at any size stop, so a `measure` that fails to reach the\n        // painted node is visible rather than coincidentally right.\n        measure: { width: 240, minHeight: 72 },\n        intent: \"success\"\n      }\n    }\n  };\n}\nfunction demoSchema() {\n  const shape = demoSchemaShape();\n  return createGraphSchema({\n    id: shape.id,\n    nodes: {\n      source: { ...shape.nodes.source, render: noRender },\n      transform: { ...shape.nodes.transform, render: noRender },\n      sink: { ...shape.nodes.sink, render: noRender }\n    },\n    edges: builtinEdgeKinds,\n    rules: defaultRules\n  });\n}\nfunction demoDocument() {\n  return {\n    version: 1,\n    nodes: [\n      { id: \"a\", kind: \"source\", position: { x: 0, y: 0 }, data: { table: \"orders\" } },\n      {\n        id: \"b\",\n        kind: \"transform\",\n        position: { x: 260, y: 0 },\n        data: { expression: \"row => row\" }\n      },\n      { id: \"c\", kind: \"sink\", position: { x: 520, y: 0 }, data: { target: \"warehouse\" } }\n    ],\n    edges: [\n      {\n        id: \"a->b\",\n        kind: \"flow\",\n        source: { node: \"a\", port: \"rows\" },\n        target: { node: \"b\", port: \"in\" },\n        data: {}\n      }\n    ]\n  };\n}\nfunction demoDocumentLarge(count = 12) {\n  const kinds = [\"source\", \"transform\", \"sink\"];\n  const nodes = Array.from({ length: count }, (_, index) => {\n    const kind = kinds[index % kinds.length];\n    const data = kind === \"source\" ? { table: `orders_${index}` } : kind === \"transform\" ? { expression: `row => row.${index}` } : { target: `warehouse_${index}` };\n    return {\n      id: `n${index}`,\n      kind,\n      position: { x: index % 4 * 280, y: Math.floor(index / 4) * 200 },\n      data\n    };\n  });\n  const edgeKinds = [\"flow\", \"data\", \"error\", \"conditional\"];\n  const edges = [];\n  for (let index = 0; index + 1 < count; index += 1) {\n    const from = nodes[index];\n    const to = nodes[index + 1];\n    const sourcePort = from.kind === \"source\" ? \"rows\" : from.kind === \"transform\" ? \"ok\" : null;\n    if (!sourcePort) continue;\n    edges.push({\n      id: `${from.id}->${to.id}`,\n      kind: edgeKinds[edges.length % edgeKinds.length],\n      source: { node: from.id, port: sourcePort },\n      target: { node: to.id, port: \"in\" },\n      data: {}\n    });\n  }\n  return { version: 1, nodes, edges };\n}\nexport {\n  demoControlSchemaId,\n  demoDocument,\n  demoDocumentLarge,\n  demoGraphSchemaId,\n  demoSchema,\n  demoSchemaShape\n};\n//# sourceMappingURL=fixtures.js.map\n"],"mappings":";;;;AAEA,MAAM,OAAO,IAAI,WAAW;CAC1B;CACA,MAAM;CACN,WAAW;CACX;AACF;AACA,MAAM,QAAQ,IAAI,WAAW;CAC3B;CACA,MAAM;CACN,WAAW;CACX;AACF;AACA,MAAM,kBAAkB;AACxB,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB,GAAG,kBAAkB;AACjD,SAAS,kBAAkB;CACzB,OAAO;EACL,IAAI;EACJ,OAAO;GACL,QAAQ;IACN,MAA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