import{telemetry as s}from"./app/telemetry/index.js";s.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as p}from"react-dom/client";import{RouterProvider as m,createBrowserRouter as d}from"react-router-dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{StyleSheetManager as u}from"styled-components";import{getLocaleFromPathname as E,withoutPathPrefix as R,withPathPrefix as e}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../constants/api";import{DEFAULT_LOCALE_PLACEHOLDER as O}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as _}from"./constants/common.js";import{shouldForwardProp as D}from"../utils/should-forward-prop.js";import"./polyfills";import{PACKAGE_NAME as P,PRODUCT_NAME as h}from"../config/product-gates";import{App as g,routes as A}from"./App";import{Loader as v,useRefresh as x,globalData as t}from"./runtime/loader";import{initL10n as N}from"./app/l10n/initL10n";function T(){return x(),o.createElement(f,{context:{}},o.createElement(u,{shouldForwardProp:D},o.createElement(g,null)))}function b(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
%c Version: ${process.env.REDOCLY_PORTAL_VERSION} %c
`,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):process.env.REDOCLY_PORTAL_VERSION&&console.log(`
%c Redocly ${h} %c ${process.env.REDOCLY_PORTAL_VERSION} %c

%chttps://redocly.com
`,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await v.load(window.location.pathname,void 0,window.location.search),b();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=E(R(location.pathname),i,n);await N(r,a);const c=d([{Component:T,path:e("/*"),children:A}]);p(document.getElementById("app_root"),o.createElement(m,{future:{v7_startTransition:!1},router:c}))}C();
