{"version":3,"file":"helpers-DWUKeagk.js","sources":["../../../node_modules/react-dom/client.js","../../../app/javascript/entrypoints/helpers.jsx"],"sourcesContent":["'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","import React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nexport function mountReactApp(name, Component) {\n let root = null;\n document.addEventListener('turbo:load', () => {\n const mountNode = document.getElementById(name);\n if (!mountNode) {\n return\n }\n const propsJSON = mountNode.getAttribute('data-react-props');\n const props = JSON.parse(propsJSON);\n root = createRoot(mountNode);\n root.render();\n })\n document.addEventListener('turbo:before-render', () => {\n if (!root) return;\n root.unmount();\n })\n}\n"],"names":["m","require$$0","createRoot","mountReactApp","name","Component","root","mountNode","propsJSON","props","jsx"],"mappings":"qDAEIA,EAAIC,EAENC,EAAqBF,EAAE,WACDA,EAAE,YCFV,SAAAG,EAAcC,EAAMC,EAAW,CAC7C,IAAIC,EAAO,KACF,SAAA,iBAAiB,aAAc,IAAM,CACtC,MAAAC,EAAY,SAAS,eAAeH,CAAI,EAC9C,GAAI,CAACG,EACH,OAEI,MAAAC,EAAYD,EAAU,aAAa,kBAAkB,EACrDE,EAAQ,KAAK,MAAMD,CAAS,EAClCF,EAAOJ,EAAWK,CAAS,EAC3BD,EAAK,OAAOI,MAACL,EAAW,CAAA,GAAGI,CAAO,CAAA,CAAE,CAAA,CACrC,EACQ,SAAA,iBAAiB,sBAAuB,IAAM,CAChDH,GACLA,EAAK,QAAQ,CAAA,CACd,CACH","x_google_ignoreList":[0]}