/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.lens_bundle_jsonpfunction=window.lens_bundle_jsonpfunction||[]).push([[6],{538:function(e,i,l){switch(window.__kbnThemeTag__){case"v8dark":return l(539);case"v8light":return l(541)}},539:function(e,i,l){var t=l(62),d=l(540);"string"==typeof(d=d.__esModule?d.default:d)&&(d=[[e.i,d,""]]);t(d,{insert:"head",singleton:!1}),e.exports=d.locals||{}},540:function(e,i,l){(i=l(63)(!1)).push([e.i,".unifiedFieldList__fieldListGrouped{flex-grow:1;margin-left:-16px;-webkit-mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);overflow:auto;position:relative;scrollbar-color:#98a2b380 #0000;scrollbar-width:thin}.unifiedFieldList__fieldListGrouped::-webkit-scrollbar{height:16px;width:16px}.unifiedFieldList__fieldListGrouped::-webkit-scrollbar-thumb{background-clip:content-box;background-color:#98a2b380;border:6px solid #0000;border-radius:16px}.unifiedFieldList__fieldListGrouped::-webkit-scrollbar-corner,.unifiedFieldList__fieldListGrouped::-webkit-scrollbar-track{background-color:#0000}.unifiedFieldList__fieldListGrouped__container{left:16px;padding-top:8px;position:absolute;right:4px;top:0}",""]),e.exports=i},541:function(e,i,l){var t=l(62),d=l(542);"string"==typeof(d=d.__esModule?d.default:d)&&(d=[[e.i,d,""]]);t(d,{insert:"head",singleton:!1}),e.exports=d.locals||{}},542:function(e,i,l){(i=l(63)(!1)).push([e.i,".unifiedFieldList__fieldListGrouped{flex-grow:1;margin-left:-16px;-webkit-mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);overflow:auto;position:relative;scrollbar-color:#69707d80 #0000;scrollbar-width:thin}.unifiedFieldList__fieldListGrouped::-webkit-scrollbar{height:16px;width:16px}.unifiedFieldList__fieldListGrouped::-webkit-scrollbar-thumb{background-clip:content-box;background-color:#69707d80;border:6px solid #0000;border-radius:16px}.unifiedFieldList__fieldListGrouped::-webkit-scrollbar-corner,.unifiedFieldList__fieldListGrouped::-webkit-scrollbar-track{background-color:#0000}.unifiedFieldList__fieldListGrouped__container{left:16px;padding-top:8px;position:absolute;right:4px;top:0}",""]),e.exports=i},543:function(e,i,l){switch(window.__kbnThemeTag__){case"v8dark":return l(544);case"v8light":return l(546)}},544:function(e,i,l){var t=l(62),d=l(545);"string"==typeof(d=d.__esModule?d.default:d)&&(d=[[e.i,d,""]]);t(d,{insert:"head",singleton:!1}),e.exports=d.locals||{}},545:function(e,i,l){(i=l(63)(!1)).push([e.i,".unifiedFieldList__fieldsAccordion__titleTooltip{margin-right:4px}.unifiedFieldList__fieldsAccordion__fieldItems{padding:4px}",""]),e.exports=i},546:function(e,i,l){var t=l(62),d=l(547);"string"==typeof(d=d.__esModule?d.default:d)&&(d=[[e.i,d,""]]);t(d,{insert:"head",singleton:!1}),e.exports=d.locals||{}},547:function(e,i,l){(i=l(63)(!1)).push([e.i,".unifiedFieldList__fieldsAccordion__titleTooltip{margin-right:4px}.unifiedFieldList__fieldsAccordion__fieldItems{padding:4px}",""]),e.exports=i},584:function(e,i,l){"use strict";l.r(i),l.d(i,"LOCAL_STORAGE_KEY_SECTIONS",(function(){return j}));var t=l(25),d=l(7),s=l.n(d),n=l(166),a=l.n(n),o=l(0),r=l(6),u=l(2);const c=o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noDataLabel",{defaultMessage:"There are no fields."}),f=({fieldsExistInIndex:e,defaultNoFieldsMessage:i=c,isAffectedByFieldFilter:l=!1,isAffectedByTimerange:t=!1,isAffectedByGlobalFilter:d=!1,"data-test-subj":n="noFieldsCallout"})=>e?Object(u.jsx)(r.EuiCallOut,{size:"s",color:"warning",title:l?o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noFilteredFieldsLabel",{defaultMessage:"No fields match the selected filters."}):i,"data-test-subj":`${n}-noFieldsMatch`},(t||l||d)&&Object(u.jsx)(s.a.Fragment,null,Object(u.jsx)("strong",null,o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noFields.tryText",{defaultMessage:"Try:"})),Object(u.jsx)("ul",null,t&&Object(u.jsx)("li",null,o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noFields.extendTimeBullet",{defaultMessage:"Extending the time range"})),l&&Object(u.jsx)("li",null,o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noFields.fieldTypeFilterBullet",{defaultMessage:"Using different field filters"})),d&&Object(u.jsx)("li",null,o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noFields.globalFiltersBullet",{defaultMessage:"Changing the global filters"}))))):Object(u.jsx)(r.EuiCallOut,{size:"s",color:"warning",title:o.i18n.translate("unifiedFieldList.fieldList.noFieldsCallout.noFieldsLabel",{defaultMessage:"No fields exist in this data view."}),"data-test-subj":`${n}-noFieldsExist`});var p=l(28),g=l.n(p);function b({initialIsOpen:e,onToggle:i,id:l,label:t,helpTooltip:s,hasLoaded:n,fieldsCount:a,hideDetails:c,isFiltered:f,groupIndex:p,groupName:b,fieldSearchHighlight:F,paginatedFields:x,renderFieldItem:m,renderCallout:j,showExistenceFetchError:L,showExistenceFetchTimeout:_}){const v=Object(d.useMemo)((()=>{const e=g()({unifiedFieldList__fieldsAccordion__titleTooltip:!!s});return Object(u.jsx)(r.EuiText,{size:"xs"},Object(u.jsx)("strong",{className:e},t),!!s&&Object(u.jsx)(r.EuiIconTip,{"aria-label":s,type:"questionInCircle",color:"subdued",size:"s",position:"right",content:s,iconProps:{className:"eui-alignTop"}}))}),[t,s]),O=Object(d.useMemo)((()=>L?Object(u.jsx)(r.EuiIconTip,{"aria-label":o.i18n.translate("unifiedFieldList.fieldsAccordion.existenceErrorAriaLabel",{defaultMessage:"Existence fetch failed"}),type:"warning",color:"warning",content:o.i18n.translate("unifiedFieldList.fieldsAccordion.existenceErrorLabel",{defaultMessage:"Field information can't be loaded"}),iconProps:{"data-test-subj":`${l}-fetchWarning`}}):_?Object(u.jsx)(r.EuiIconTip,{"aria-label":o.i18n.translate("unifiedFieldList.fieldsAccordion.existenceTimeoutAriaLabel",{defaultMessage:"Existence fetch timed out"}),type:"clock",color:"warning",content:o.i18n.translate("unifiedFieldList.fieldsAccordion.existenceTimeoutLabel",{defaultMessage:"Field information took too long"})}):n?Object(u.jsx)(r.EuiNotificationBadge,{size:"m",color:f?"accent":"subdued","data-test-subj":`${l}-count`},a):Object(u.jsx)(r.EuiLoadingSpinner,{size:"m","data-test-subj":`${l}-countLoading`})),[L,_,n,f,l,a]);return Object(u.jsx)(r.EuiAccordion,{initialIsOpen:e,onToggle:i,"data-test-subj":l,id:l,buttonContent:v,extraAction:O},Object(u.jsx)(r.EuiSpacer,{size:"s"}),n&&(a?Object(u.jsx)("ul",{className:"unifiedFieldList__fieldsAccordion__fieldItems"},x&&x.map(((e,i)=>Object(u.jsx)(d.Fragment,{key:h(e)},m({field:e,itemIndex:i,groupIndex:p,groupName:b,hideDetails:c,fieldSearchHighlight:F}))))):j()))}l(543);const F=s.a.memo(b),h=e=>`${e.name}-${e.displayName}-${e.type}`;var x=l(132);l(538);const m=50,j="unifiedFieldList.initiallyOpenSections";function L(e,i){return Object.entries(e).filter((([e])=>i[e])).reduce(((e,[,{fields:i}])=>e+i.length),0)}function _({fieldGroups:e,fieldsExistenceStatus:i,fieldsExistInIndex:l,renderFieldItem:n,scrollToTopResetCounter:c,screenReaderDescriptionId:p,localStorageKeyPrefix:g,"data-test-subj":b="fieldListGrouped"}){var _,v,w,E,y,M,T,k,S,I,A,G,C,N;const B=i&&i!==x.a.unknown,[$,R]=Object(t.partition)(Object.entries(e),(([,{showInAccordion:e}])=>e)),[z,D]=Object(d.useState)(m),[H,P]=Object(d.useState)(void 0),[U,K]=a()(`${g?g+".":""}${j}`,{}),[q,W]=Object(d.useState)((()=>Object.fromEntries($.map((([e,{isInitiallyOpen:i}])=>{const l=g?null==U?void 0:U[e]:null;return[e,"boolean"==typeof l?l:i]})))));Object(d.useEffect)((()=>{H&&c&&(H.scrollTop=0,D(m))}),[c,H]);const Y=Object(d.useCallback)((()=>{H&&H.scrollTop+H.clientHeight>.9*H.scrollHeight&&D(Math.max(m,Math.min(z+.5*m,L(e,q))))}),[H,z,D,e,q]),J=Object(d.useMemo)((()=>{let e=z;return Object.fromEntries($.map((([i,l])=>{if(!q[i]||e<=0)return[i,[]];const t=l.fields.slice(0,e);return e-=t.length,[i,t]})))}),[z,$,q]),Q=Boolean(null===(_=R[0])||void 0===_||null===(v=_[1])||void 0===v||null===(w=v.fields)||void 0===w?void 0:w.length);return Object(u.jsx)("div",{className:"unifiedFieldList__fieldListGrouped","data-test-subj":`${b}FieldGroups`,ref:e=>{e&&!e.dataset.dynamicScroll&&(e.dataset.dynamicScroll="true",P(e))},onScroll:Object(t.throttle)(Y,100)},Object(u.jsx)("div",{className:"unifiedFieldList__fieldListGrouped__container"},Boolean(p)&&Object(u.jsx)(r.EuiScreenReaderOnly,null,Object(u.jsx)("div",{"aria-live":"polite",id:p,"data-test-subj":`${b}__ariaDescription`},B?[O(e.SelectedFields)&&o.i18n.translate("unifiedFieldList.fieldListGrouped.fieldSearchForSelectedFieldsLiveRegion",{defaultMessage:"{selectedFields} selected {selectedFields, plural, one {field} other {fields}}.",values:{selectedFields:(null===(E=e.SelectedFields)||void 0===E||null===(y=E.fields)||void 0===y?void 0:y.length)||0}}),O(e.PopularFields)&&o.i18n.translate("unifiedFieldList.fieldListGrouped.fieldSearchForPopularFieldsLiveRegion",{defaultMessage:"{popularFields} popular {popularFields, plural, one {field} other {fields}}.",values:{popularFields:(null===(M=e.PopularFields)||void 0===M||null===(T=M.fields)||void 0===T?void 0:T.length)||0}}),(null===(k=e.AvailableFields)||void 0===k?void 0:k.fields)&&o.i18n.translate("unifiedFieldList.fieldListGrouped.fieldSearchForAvailableFieldsLiveRegion",{defaultMessage:"{availableFields} available {availableFields, plural, one {field} other {fields}}.",values:{availableFields:e.AvailableFields.fields.length}}),O(e.UnmappedFields)&&o.i18n.translate("unifiedFieldList.fieldListGrouped.fieldSearchForUnmappedFieldsLiveRegion",{defaultMessage:"{unmappedFields} unmapped {unmappedFields, plural, one {field} other {fields}}.",values:{unmappedFields:(null===(S=e.UnmappedFields)||void 0===S||null===(I=S.fields)||void 0===I?void 0:I.length)||0}}),O(e.EmptyFields)&&o.i18n.translate("unifiedFieldList.fieldListGrouped.fieldSearchForEmptyFieldsLiveRegion",{defaultMessage:"{emptyFields} empty {emptyFields, plural, one {field} other {fields}}.",values:{emptyFields:(null===(A=e.EmptyFields)||void 0===A||null===(G=A.fields)||void 0===G?void 0:G.length)||0}}),O(e.MetaFields)&&o.i18n.translate("unifiedFieldList.fieldListGrouped.fieldSearchForMetaFieldsLiveRegion",{defaultMessage:"{metaFields} meta {metaFields, plural, one {field} other {fields}}.",values:{metaFields:(null===(C=e.MetaFields)||void 0===C||null===(N=C.fields)||void 0===N?void 0:N.length)||0}})].filter(Boolean).join(" "):"")),Q&&Object(u.jsx)(s.a.Fragment,null,Object(u.jsx)("ul",null,R.flatMap((([e,{fields:i,fieldSearchHighlight:l}])=>i.map(((i,t)=>Object(u.jsx)(d.Fragment,{key:h(i)},n({field:i,itemIndex:t,groupIndex:0,groupName:e,hideDetails:!0,fieldSearchHighlight:l}))))))),Object(u.jsx)(r.EuiSpacer,{size:"s"})),$.map((([t,s],a)=>Boolean(s.hideIfEmpty)&&!s.fields.length?null:Object(u.jsx)(d.Fragment,{key:t},Object(u.jsx)(F,{id:`${b}${t}`,initialIsOpen:Boolean(q[t]),label:s.title,helpTooltip:s.helpText,hideDetails:s.hideDetails,hasLoaded:B,fieldsCount:s.fields.length,isFiltered:s.fieldCount!==s.fields.length,fieldSearchHighlight:s.fieldSearchHighlight,paginatedFields:J[t],groupIndex:a+1,groupName:t,onToggle:i=>{W((e=>({...e,[t]:i})));const l=L(e,{...q,[t]:i});D(Math.max(m,Math.min(Math.ceil(1.5*z),l))),g&&K({...U,[t]:i})},showExistenceFetchError:i===x.a.failed,showExistenceFetchTimeout:i===x.a.failed,renderCallout:()=>Object(u.jsx)(f,{isAffectedByGlobalFilter:s.isAffectedByGlobalFilter,isAffectedByTimerange:s.isAffectedByTimeFilter,isAffectedByFieldFilter:s.fieldCount!==s.fields.length,fieldsExistInIndex:!!l,defaultNoFieldsMessage:s.defaultNoFieldsMessage,"data-test-subj":`${b}${t}NoFieldsCallout`}),renderFieldItem:n}),Object(u.jsx)(r.EuiSpacer,{size:"m"}))))))}const v=s.a.memo(_);function O(e){var i;return!!e&&((null===(i=e.fields)||void 0===i?void 0:i.length)>0||!e.hideIfEmpty)}i.default=v}}]);