{"version":3,"file":"ValidComponentChildren-CU7BHnvo.js","sources":["../../Client/node_modules/react-bootstrap/es/utils/ValidComponentChildren.js"],"sourcesContent":["// TODO: This module should be ElementChildren, and should use named exports.\nimport React from 'react';\n/**\n * Iterates through children that are typically specified as `props.children`,\n * but only maps over children that are \"valid components\".\n *\n * The mapFunction provided index will be normalised to the components mapped,\n * so an invalid component would not increase the index.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func.\n * @param {*} context Context for func.\n * @return {object} Object containing the ordered map of results.\n */\n\nfunction map(children, func, context) {\n var index = 0;\n return React.Children.map(children, function (child) {\n if (!React.isValidElement(child)) {\n return child;\n }\n\n return func.call(context, child, index++);\n });\n}\n/**\n * Iterates through children that are \"valid components\".\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child with the index reflecting the position relative to \"valid components\".\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func.\n * @param {*} context Context for context.\n */\n\n\nfunction forEach(children, func, context) {\n var index = 0;\n React.Children.forEach(children, function (child) {\n if (!React.isValidElement(child)) {\n return;\n }\n\n func.call(context, child, index++);\n });\n}\n/**\n * Count the number of \"valid components\" in the Children container.\n *\n * @param {?*} children Children tree container.\n * @returns {number}\n */\n\n\nfunction count(children) {\n var result = 0;\n React.Children.forEach(children, function (child) {\n if (!React.isValidElement(child)) {\n return;\n }\n\n ++result;\n });\n return result;\n}\n/**\n * Finds children that are typically specified as `props.children`,\n * but only iterates over children that are \"valid components\".\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child with the index reflecting the position relative to \"valid components\".\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func.\n * @param {*} context Context for func.\n * @returns {array} of children that meet the func return statement\n */\n\n\nfunction filter(children, func, context) {\n var index = 0;\n var result = [];\n React.Children.forEach(children, function (child) {\n if (!React.isValidElement(child)) {\n return;\n }\n\n if (func.call(context, child, index++)) {\n result.push(child);\n }\n });\n return result;\n}\n\nfunction find(children, func, context) {\n var index = 0;\n var result;\n React.Children.forEach(children, function (child) {\n if (result) {\n return;\n }\n\n if (!React.isValidElement(child)) {\n return;\n }\n\n if (func.call(context, child, index++)) {\n result = child;\n }\n });\n return result;\n}\n\nfunction every(children, func, context) {\n var index = 0;\n var result = true;\n React.Children.forEach(children, function (child) {\n if (!result) {\n return;\n }\n\n if (!React.isValidElement(child)) {\n return;\n }\n\n if (!func.call(context, child, index++)) {\n result = false;\n }\n });\n return result;\n}\n\nfunction some(children, func, context) {\n var index = 0;\n var result = false;\n React.Children.forEach(children, function (child) {\n if (result) {\n return;\n }\n\n if (!React.isValidElement(child)) {\n return;\n }\n\n if (func.call(context, child, index++)) {\n result = true;\n }\n });\n return result;\n}\n\nfunction toArray(children) {\n var result = [];\n React.Children.forEach(children, function (child) {\n if (!React.isValidElement(child)) {\n return;\n }\n\n result.push(child);\n });\n return result;\n}\n\nexport default {\n map: map,\n forEach: forEach,\n count: count,\n find: find,\n filter: filter,\n every: every,\n some: some,\n toArray: toArray\n};"],"names":["map","children","func","context","index","React","child","forEach","count","result","filter","find","every","some","toArray","ValidChildren"],"mappings":"wCAeA,SAASA,EAAIC,EAAUC,EAAMC,EAAS,CACpC,IAAIC,EAAQ,EACZ,OAAOC,EAAM,SAAS,IAAIJ,EAAU,SAAUK,EAAO,CACnD,OAAKD,EAAM,eAAeC,CAAK,EAIxBJ,EAAK,KAAKC,EAASG,EAAOF,GAAO,EAH/BE,CAIb,CAAG,CACH,CAaA,SAASC,EAAQN,EAAUC,EAAMC,EAAS,CACxC,IAAIC,EAAQ,EACZC,EAAM,SAAS,QAAQJ,EAAU,SAAUK,EAAO,CAC3CD,EAAM,eAAeC,CAAK,GAI/BJ,EAAK,KAAKC,EAASG,EAAOF,GAAO,CACrC,CAAG,CACH,CASA,SAASI,EAAMP,EAAU,CACvB,IAAIQ,EAAS,EACb,OAAAJ,EAAM,SAAS,QAAQJ,EAAU,SAAUK,EAAO,CAC3CD,EAAM,eAAeC,CAAK,GAI/B,EAAEG,CACN,CAAG,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