(window["alertingDashboards_bundle_jsonpfunction"]=window["alertingDashboards_bundle_jsonpfunction"]||[]).push([[21],{2842:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireWildcard(__webpack_require__(0));var _query_editor_extension=__webpack_require__(776);const _excluded=["configMap","componentContainer","bannerContainer","bottomPanelContainer","queryControlsContainer"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}const QueryEditorExtensions=_react.default.memo(props=>{const{configMap:configMap,componentContainer:componentContainer,bannerContainer:bannerContainer,bottomPanelContainer:bottomPanelContainer,queryControlsContainer:queryControlsContainer}=props,dependencies=_objectWithoutProperties(props,_excluded);const sortedConfigs=(0,_react.useMemo)(()=>{if(!configMap||Object.keys(configMap).length===0)return[];return Object.values(configMap).sort((a,b)=>a.order-b.order)},[configMap]);return _react.default.createElement(_react.default.Fragment,null,sortedConfigs.map(config=>{const extensionComponentId=`osdQueryEditorExtensionComponent-${config.id}`;const extensionQueryControlsId=`osdQueryEditorExtensionQueryControls-${config.id}`;let extensionComponentContainer=document.getElementById(extensionComponentId);if(!extensionComponentContainer){extensionComponentContainer=document.createElement("div");extensionComponentContainer.className=`osdQueryEditorExtensionComponent osdQueryEditorExtensionComponent__${config.id}`;extensionComponentContainer.id=extensionComponentId;componentContainer.appendChild(extensionComponentContainer)}let extensionQueryControlsContainer=document.getElementById(extensionQueryControlsId);if(!extensionQueryControlsContainer){extensionQueryControlsContainer=document.createElement("div");extensionQueryControlsContainer.className=`osdQueryEditorExtensionQueryControls osdQueryEditorExtensionQueryControls__${config.id}`;extensionQueryControlsContainer.id=extensionQueryControlsId;queryControlsContainer.appendChild(extensionQueryControlsContainer)}return _react.default.createElement(_query_editor_extension.QueryEditorExtension,{key:config.id,config:config,dependencies:dependencies,componentContainer:extensionComponentContainer,bannerContainer:bannerContainer,bottomPanelContainer:bottomPanelContainer,queryControlsContainer:extensionQueryControlsContainer})}))});var _default=exports.default=QueryEditorExtensions;module.exports=exports.default}}]);