"use strict";Object.defineProperty(exports, "__esModule", {value: true});






var _chunkCH2PLO6Fcjs = require('./chunk-CH2PLO6F.cjs');


var _chunkPRSIGZUJcjs = require('./chunk-PRSIGZUJ.cjs');


var _chunk4BTJNCI2cjs = require('./chunk-4BTJNCI2.cjs');


var _chunkAW6FYBWAcjs = require('./chunk-AW6FYBWA.cjs');


var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');


var _chunkGH54P25Bcjs = require('./chunk-GH54P25B.cjs');


var _chunkCDFVRIETcjs = require('./chunk-CDFVRIET.cjs');


var _chunkL3U3VIEJcjs = require('./chunk-L3U3VIEJ.cjs');




var _chunkZ6EUSUADcjs = require('./chunk-Z6EUSUAD.cjs');

// src/utils/toReactNodes/toReactNodes.tsx
var _core = require('@lightsparkdev/core');
var _react = require('react');
var _jsxruntime = require('@emotion/react/jsx-runtime');
function toReactNodes(toReactNodesArg) {
  const toReactNodesArray = _core.ensureArray.call(void 0, toReactNodesArg);
  const reactNodes = toReactNodesArray.map((node, i) => {
    if (!node) {
      return null;
    } else if (typeof node === "string" || _chunkCH2PLO6Fcjs.isTextNode.call(void 0, node)) {
      const text = typeof node === "string" ? node : node.text;
      let content = text;
      if (_chunkCH2PLO6Fcjs.isTextNode.call(void 0, node) && node.typography) {
        const _a = node.typography, { type: typographyType } = _a, typographyProps = _chunkZ6EUSUADcjs.__objRest.call(void 0, _a, ["type"]);
        content = _chunkCDFVRIETcjs.renderTypography.call(void 0, typographyType, _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, typographyProps), {
          children: text
        }));
      } else {
        content = _chunkL3U3VIEJcjs.stringToNodes.call(void 0, text);
      }
      return (
        /* text property is a sufficient key for both strings and text nodes due to minimal impl */
        /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: content }, `text-${i}-${text.substr(0, 20)}`)
      );
    } else if (_chunkCH2PLO6Fcjs.isLinkNode.call(void 0, node)) {
      return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGH54P25Bcjs.Link, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, node.link), `link-${i}-${node.link.id}`);
    } else if (_chunkCH2PLO6Fcjs.isNextLinkNode.call(void 0, node)) {
      return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
        _chunkPRSIGZUJcjs.NextLink,
        _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, node.nextLink),
        `next-link-${i}-${node.nextLink.id}`
      );
    } else if (_chunkCH2PLO6Fcjs.isIconNode.call(void 0, node)) {
      return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
        _chunkWF7Z2VITcjs.Icon,
        _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, node.icon), {
          width: node.icon.width || 12
        }),
        `icon-${i}-${node.icon.id}`
      );
    } else if (_chunkCH2PLO6Fcjs.isCurrencyAmountNode.call(void 0, node)) {
      return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
        _chunkAW6FYBWAcjs.CurrencyAmount,
        _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, node.currencyAmount),
        `currency-amount-${i}-${node.currencyAmount.id}`
      );
    } else if (_chunkCH2PLO6Fcjs.isClipboardTextFieldNode.call(void 0, node)) {
      return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
        _chunk4BTJNCI2cjs.ClipboardTextField,
        _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, node.clipboardTextField),
        `clipboard-text-field-${i}-${node.clipboardTextField.id}`
      );
    }
    return null;
  });
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: reactNodes });
}



exports.toReactNodes = toReactNodes;
