Liferay.Loader.define("@liferay/search-experiences-web@3.0.30/sxp_blueprint_admin/js/edit_sxp_blueprint/query_builder_tab/index",["module","exports","require","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/nav","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utils/sessionStorage","../../utils/types/sidebarTypes","./QuerySXPElements","./QuerySettings"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/layout")),n=r("@frontend-taglib-clay$clayui/nav"),l=(r("liferay!frontend-js-react-web$prop-types"),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),i=r("../../utils/sessionStorage"),u=r("../../utils/types/sidebarTypes"),s=_interopRequireDefault(r("./QuerySXPElements")),o=_interopRequireDefault(r("./QuerySettings"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e={QUERY_SETTINGS:"querySettings",QUERY_SXP_ELEMENTS:"querySXPElements"};function QueryBuilderTab({applyIndexerClauses:t,clauseContributorsList:r=[],elementInstances:E,entityJSON:d,errors:c=[],frameworkConfig:S={},isSubmitting:f,indexFields:y,isIndexCompany:_,onApplyIndexerClausesChange:p,onBlur:b,onChange:T,onDeleteSXPElement:g,onFetchSearchableTypes:C,onFrameworkConfigChange:m,searchableTypes:R=[],setFieldTouched:P,setFieldValue:I,openSidebar:h,setOpenSidebar:N,touched:D=[]}){const[L,X]=(0,l.useState)(e.QUERY_SXP_ELEMENTS);(0,l.useEffect)((()=>{L!==e.QUERY_SXP_ELEMENTS||h||"open"!==sessionStorage.getItem(i.SESSION_IDS.ADD_SXP_ELEMENT_SIDEBAR)||N(u.SIDEBAR_TYPES.ADD_SXP_ELEMENT)}),[L,h,N]);const _handleChangeSidebarVisibility=e=>(t=h!==e)=>{t?N(e):h===e&&N("")},_handleClickVerticalNav=t=>()=>{X(t),(t===e.QUERY_SXP_ELEMENTS&&h===u.SIDEBAR_TYPES.CLAUSE_CONTRIBUTORS||t===e.QUERY_SXP_ELEMENTS&&h===u.SIDEBAR_TYPES.INDEXER_CLAUSES||t===e.QUERY_SETTINGS&&h===u.SIDEBAR_TYPES.ADD_SXP_ELEMENT)&&N("")};return l.default.createElement(a.default.ContainerFluid,{className:"builder query-builder-tab",size:"xl"},l.default.createElement("div",{className:"builder-content-shift"},l.default.createElement(a.default.Row,null,l.default.createElement(a.default.Col,{md:3,sm:12},l.default.createElement(n.ClayVerticalNav,{items:[{active:L===e.QUERY_SXP_ELEMENTS,label:Liferay.Language.get("query-elements"),onClick:_handleClickVerticalNav(e.QUERY_SXP_ELEMENTS)},{active:L===e.QUERY_SETTINGS,label:Liferay.Language.get("query-settings"),onClick:_handleClickVerticalNav(e.QUERY_SETTINGS)}]})),l.default.createElement(a.default.Col,{md:9,sm:12},l.default.createElement("div",{className:"vertical-nav-content-wrapper"},L===e.QUERY_SXP_ELEMENTS&&l.default.createElement(s.default,{elementInstances:E,entityJSON:d,errors:c,indexFields:y,isIndexCompany:_,isSubmitting:f,onBlur:b,onChange:T,onChangeAddSXPElementVisibility:_handleChangeSidebarVisibility(u.SIDEBAR_TYPES.ADD_SXP_ELEMENT),onDeleteSXPElement:g,searchableTypes:R,setFieldTouched:P,setFieldValue:I,touched:D}),L===e.QUERY_SETTINGS&&l.default.createElement(o.default,{applyIndexerClauses:t,clauseContributorsList:r,frameworkConfig:S,onApplyIndexerClausesChange:p,onChangeClauseContributorsVisibility:_handleChangeSidebarVisibility(u.SIDEBAR_TYPES.CLAUSE_CONTRIBUTORS),onChangeIndexerClausesVisibility:_handleChangeSidebarVisibility(u.SIDEBAR_TYPES.INDEXER_CLAUSES),onFetchSearchableTypes:C,onFrameworkConfigChange:m,searchableTypes:R}))))))}var E=l.default.memo(QueryBuilderTab);t.default=E}}));
//# sourceMappingURL=index.js.map