"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmbeddedReplay=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),jotai_1=require("jotai"),replay_1=require("@redocly/replay"),utils_1=require("./utils"),store_1=require("../../jotai/store"),operation_1=require("../../jotai/operation"),app_1=require("../../jotai/app");function EmbeddedReplayComponent({operation:e,corsProxyUrl:r,fullOpenApi:t}){const{routingBasePath:o,mockServer:a}=(0,jotai_1.useAtomValue)(store_1.globalOptionsAtom),i=(0,jotai_1.useAtomValue)((0,operation_1.operationStore)(e.pointer)),n=(0,jotai_1.useAtomValue)(app_1.appStore),p=(0,jotai_1.useAtomValue)(app_1.environmentsAtom),[s,l]=(0,react_1.useState)(!1);return(0,react_1.useEffect)((()=>{l(!0)}),[]),(0,jsx_runtime_1.jsx)(CompactWrapper,{children:s?(0,jsx_runtime_1.jsx)(react_1.Suspense,{fallback:(0,jsx_runtime_1.jsx)(LoadingWrapper,{children:"Loading..."}),children:(0,jsx_runtime_1.jsx)(replay_1.EmbeddedReplay,{value:(0,utils_1.convertOperationToReplayValue)(e,t,i,n),environment:n.environment,predefinedEnvValues:p,corsProxyUrl:r,operationUrl:o+e.href,mockServer:a})}):(0,jsx_runtime_1.jsx)(LoadingWrapper,{children:"Loading..."})})}exports.EmbeddedReplay=(0,react_1.memo)(EmbeddedReplayComponent);const LoadingWrapper=styled_components_1.default.div`
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
`,CompactWrapper=styled_components_1.default.div`
  border: 1px solid var(--border-color-primary);
  border-radius: var(--border-radius-lg);
  padding: 0;
`;
//# sourceMappingURL=EmbeddedReplay.js.map