"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.revision=exports.version=exports.setPublicPath=exports.init=exports.hydrate=exports.setSecurityDetailsVariants=exports.setParameterValue=exports.setSecurityDetails=void 0;const jsx_runtime_1=require("react/jsx-runtime");require("core-js/es/array/find-index"),require("core-js/es/array/find"),require("core-js/es/array/includes"),require("core-js/es/map"),require("core-js/es/number/is-integer"),require("core-js/es/object/assign"),require("core-js/es/object/entries"),require("core-js/es/object/is"),require("core-js/es/object/values"),require("core-js/es/promise"),require("core-js/es/string/ends-with"),require("core-js/es/string/starts-with"),require("core-js/es/symbol"),require("unfetch/polyfill/index"),require("url-polyfill");const path_1=require("path"),react_1=require("react"),client_1=require("react-dom/client"),theme_1=require("@redocly/theme"),utils_1=require("./utils"),components_1=require("./components");var utils_2=require("./utils");Object.defineProperty(exports,"setSecurityDetails",{enumerable:!0,get:function(){return utils_2.setSecurityDetails}}),Object.defineProperty(exports,"setParameterValue",{enumerable:!0,get:function(){return utils_2.setParameterValue}}),Object.defineProperty(exports,"setSecurityDetailsVariants",{enumerable:!0,get:function(){return utils_2.setSecurityDetailsVariants}});const url=(0,utils_1.getJsUrl)(),__dirname=url?(0,path_1.dirname)(url)+"/":"";function attributesMap(e){const t={},r=e.attributes;for(let e=0;e<r.length;e++){const i=r[e];t[i.name]=i.value}return t}function parseOptionsFromElement(e){const t=attributesMap(e),r={};for(const e in t){r[e.replace(/-(.)/g,((e,t)=>t.toUpperCase()))]=t[e]}return r}function hydrate(e,t=document.querySelector("redoc")){(0,client_1.hydrateRoot)(t,(0,jsx_runtime_1.jsx)(components_1.RedoclyOpenAPIDocs,{store:e}))}function init(e,t={},r=(0,utils_1.querySelector)("redoc")){if(null===r)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');let i,s;"string"==typeof e?i=e:"object"==typeof e&&(s=e);(0,client_1.createRoot)(r).render((0,react_1.createElement)(components_1.RedoclyOpenAPIDocsStandalone,{definition:s,definitionUrl:i,options:Object.assign(Object.assign({},t),parseOptionsFromElement(r))},["Loading..."]))}function setPublicPath(e){__webpack_public_path__=e}function autoInit(){const e=(0,utils_1.querySelector)("redoc");if(!e)return;const t=e.getAttribute("spec-url");t&&init(t,{},e)}exports.hydrate=hydrate,exports.init=init,exports.setPublicPath=setPublicPath,exports.version=__REDOCLY_API_REFERENCE_VERSION__,exports.revision=__REDOCLY_API_REFERENCE_REVISION__,theme_1.IS_BROWSER&&setPublicPath(__dirname),autoInit();
//# sourceMappingURL=standalone.js.map