{
  "version": 3,
  "sources": ["../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js", "../src/indexSierraSwap.tsx"],
  "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", "//Copyright Open Trade Technology Ltd. 2023-2026. All rights reserved.\n\nimport { rememberChainConfigurationName } from '@react/redux/chainSelection'\nimport './index.css'\n\nconst link = document.createElement('link')\nlink.href =\n  'https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'\nlink.rel = 'stylesheet'\ndocument.head.appendChild(link)\n\nimport { Box, CircularProgress, ThemeProvider } from '@mui/material'\nimport CssBaseLine from '@mui/material/CssBaseline'\nimport { ChainUnreachable } from '@react/components/ChainUnreachable'\nimport { APP_BOOT_FAILED } from '@shared/notice/copy/appState'\nimport { getLytChainChoices, LytChainChoiceScreen } from '@react/lyt/lytChainChoice'\nimport { logOT } from '@shared/core/loggingShared'\nimport React, { useEffect, useMemo, useRef, useState } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { theme } from './lyt/LytTheme'\n\n// IMPORTANT: this entry must NOT statically import the redux store, chainSlice\n// or the AppKit wallet setup. Those modules run getInitialChainState /\n// createAppKit at module-load time, and they must only run AFTER the chain\n// choice string has been persisted to localStorage. They are pulled in lazily\n// via import('./SierraSwapApp') below.\ntype SierraSwapAppModule = typeof import('./SierraSwapApp')\ntype SierraStore = Awaited<ReturnType<SierraSwapAppModule['initializeSierraStore']>>\ntype SierraAppComponent = SierraSwapAppModule['SierraApp']\n\nconst root = createRoot(document.getElementById('root') as HTMLElement)\n\nfunction LoadingScreen() {\n  return (\n    <Box sx={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n      <CircularProgress />\n    </Box>\n  )\n}\n\nfunction SierraSwapBootstrap() {\n  const [SierraApp, setSierraApp] = useState<SierraAppComponent | null>(null)\n  const [store, setStore] = useState<SierraStore | null>(null)\n  const chainChoices = useMemo(() => getLytChainChoices(), [])\n  const [showChainChoice, setShowChainChoice] = useState(chainChoices.length > 1)\n  const hasStartedRef = useRef(false)\n  const [bootFailed, setBootFailed] = useState(false)\n\n  const start = async (chainConfigurationName?: string) => {\n    if (hasStartedRef.current) return\n    hasStartedRef.current = true\n    setShowChainChoice(false)\n    if (chainConfigurationName) {\n      try {\n        rememberChainConfigurationName(chainConfigurationName)\n      } catch {\n        // ignore\n      }\n    }\n    try {\n      const module = await import('./SierraSwapApp')\n      const initializedStore = await module.initializeSierraStore(chainConfigurationName)\n      setSierraApp(() => module.SierraApp)\n      setStore(initializedStore)\n    } catch (error) {\n      logOT.error('SierraSwapBootstrap the chain would not connect', error)\n      setBootFailed(true)\n    }\n  }\n\n  useEffect(() => {\n    if (chainChoices.length <= 1) {\n      start(chainChoices[0]?.chainConfigurationName)\n    }\n  }, [])\n\n  let content\n  if (SierraApp && store) {\n    content = <SierraApp store={store} />\n  } else if (bootFailed) {\n    // A reload is the retry: the boot reached no store state to retry from.\n    content = (\n      <ChainUnreachable\n        detail={APP_BOOT_FAILED}\n        onRetry={() => {\n          window.location.reload()\n        }}\n      />\n    )\n  } else if (showChainChoice) {\n    content = (\n      <LytChainChoiceScreen\n        choices={chainChoices}\n        onChoose={(choice) => {\n          void start(choice.chainConfigurationName)\n        }}\n      />\n    )\n  } else {\n    content = <LoadingScreen />\n  }\n\n  return (\n    <React.StrictMode>\n      <div\n        className=\"app-container\"\n        style={{\n          height: '100%',\n          minHeight: '100vh',\n          backgroundColor: theme.palette.background.canvas,\n          display: 'flex',\n          flexDirection: 'column',\n        }}\n      >\n        <ThemeProvider theme={theme}>\n          <CssBaseLine />\n          {content}\n        </ThemeProvider>\n      </div>\n    </React.StrictMode>\n  )\n}\n\nroot.render(<SierraSwapBootstrap />)\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,QAAI,IAAI;AACR,QAAI,OAAuC;AACzC,cAAQ,aAAa,EAAE;AACvB,cAAQ,cAAc,EAAE;AAAA,IAC1B,OAAO;AACD,UAAI,EAAE;AACV,cAAQ,aAAa,SAAS,GAAG,GAAG;AAClC,UAAE,wBAAwB;AAC1B,YAAI;AACF,iBAAO,EAAE,WAAW,GAAG,CAAC;AAAA,QAC1B,UAAE;AACA,YAAE,wBAAwB;AAAA,QAC5B;AAAA,MACF;AACA,cAAQ,cAAc,SAAS,GAAG,GAAG,GAAG;AACtC,UAAE,wBAAwB;AAC1B,YAAI;AACF,iBAAO,EAAE,YAAY,GAAG,GAAG,CAAC;AAAA,QAC9B,UAAE;AACA,YAAE,wBAAwB;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AAjBM;AAAA;AAAA;;;ACPN;AAAA;AAiBA,mBAA4D;AAC5D,oBAA2B;AAiBrB;AA9BN,IAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,KAAK,OACH;AACF,KAAK,MAAM;AACX,SAAS,KAAK,YAAY,IAAI;AAqB9B,IAAM,WAAO,0BAAW,SAAS,eAAe,MAAM,CAAgB;AAEtE,SAAS,gBAAgB;AACvB,SACE,4CAAC,eAAI,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,YAAY,UAAU,gBAAgB,SAAS,GACl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