Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/shared/ErrorListItem",["module","exports","require","@frontend-taglib-clay$clayui/alert","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/layout","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../utils/testIds"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=f(a("@frontend-taglib-clay$clayui/alert")),r=s(a("@frontend-taglib-clay$clayui/button")),l=f(a("@frontend-taglib-clay$clayui/layout")),i=f(a("liferay!frontend-js-react-web$classnames")),o=s(a("liferay!frontend-js-react-web$react")),u=a("../utils/testIds");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(a,r,l):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}function f(e){return e&&e.__esModule?e:{default:e}}const e={advanced_configuration:Liferay.Language.get("advanced-configuration"),aggregation_configuration:Liferay.Language.get("aggregation-configuration"),highlight_configuration:Liferay.Language.get("highlight-configuration"),parameter_configuration:Liferay.Language.get("parameter-configuration"),query_configuration:Liferay.Language.get("query-configuration"),sort_configuration:Liferay.Language.get("sort-configuration"),sxpElementTemplateJSON:Liferay.Language.get("element-template"),uiConfigurationJSON:Liferay.Language.get("ui-configuration")},d=["className","sxpElementId","localizedMessage","msg","throwable","severity"],y={ERROR:"danger",INFO:"info",WARN:"warning"};const m=e=>JSON.stringify(e,null,2);var g=function({error:t,onFocusSXPElement:a}){const[c,s]=(0,o.useState)(!0),f=()=>{s(!c)},g=()=>Object.keys(t).some((e=>t[e]&&!d.includes(e)));return o.default.createElement(n.default,{className:(0,i.default)("error-list-item",{collapsible:g()}),"data-testid":u.TEST_IDS.ERROR_LIST_ITEM,displayType:y[t.severity]||"danger"},o.default.createElement("span",{className:"message",onClick:f},o.default.createElement("span",{className:"title"},t.localizedMessage||Liferay.Language.get("error")),t.msg&&o.default.createElement("span",{className:"description"},(()=>{const a=function(t){const a=Object.keys(e).find((e=>null==t?void 0:t.includes(e)));return a?e[a]:""}(t.rootProperty);return a?"".concat(t.msg," (").concat(a,")"):t.msg})())),!!t.sxpElementId&&o.default.createElement("div",{className:"scroll-button"},o.default.createElement(r.default,{alert:!0,onClick:()=>{a(t.sxpElementId)},small:!0},Liferay.Language.get("view-element"))),g()&&o.default.createElement(r.ClayButtonWithIcon,{"aria-label":c?Liferay.Language.get("expand"):Liferay.Language.get("collapse"),borderless:!0,className:"collapse-button text-danger",displayType:"unstyled",onClick:f,small:!0,symbol:c?"angle-right":"angle-down"}),!c&&g()&&o.default.createElement(n.default.Footer,null,Object.keys(t).map((e=>t[e]&&!d.includes(e)&&o.default.createElement(l.default.Row,{justify:"start",key:e},o.default.createElement(l.default.Col,{className:"property",size:3},e),o.default.createElement(l.default.Col,{size:9},o.default.createElement("code",null,"object"==typeof t[e]?m(t[e]):t[e])))))))};t.default=g}}));
//# sourceMappingURL=ErrorListItem.js.map