"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1281],{81281:(e,t,a)=>{a.d(t,{Component:()=>g});var i=a(43748),n=a(74592),s=a(15656),l=a(26243),r=a(75178),o=a(73232),d=a(83919),c=a.n(d),u=a(6484),h=a(69182);function m(e){var t;return null!==(t=i.jupyterHighlightStyle.style([e]))&&void 0!==t?t:""}class g extends o.Component{constructor(){super(...arguments),this.state={filter:"",value:""},this.timer=0,this.handleChange=e=>{const{value:t}=e.target;this.setState({value:t}),window.clearTimeout(this.timer),this.timer=window.setTimeout((()=>{this.setState({filter:t})}),300)}}componentDidMount(){h.StyleModule.mount(document,i.jupyterHighlightStyle.module)}render(){const e=(this.props.translator||n.nullTranslator).load("jupyterlab"),{data:t,metadata:a,forwardedRef:i}=this.props,r=a&&a.root?a.root:"root",d=this.state.filter?b(t,this.state.filter,[r]):[r];return o.createElement("div",{className:"container",ref:i},o.createElement(s.InputGroup,{className:"filter",type:"text",placeholder:e.__("Find…"),onChange:this.handleChange,value:this.state.value,rightIcon:"ui-components:search"}),o.createElement(u.JSONTree,{data:t,collectionLimit:100,theme:{extend:p,valueLabel:m(l.tags.variableName),valueText:m(l.tags.string),nestedNodeItemString:m(l.tags.comment)},invertTheme:!1,keyPath:[r],getItemString:(e,t,a,i)=>Array.isArray(t)?o.createElement("span",null,a," ",i):0===Object.keys(t).length?o.createElement("span",null,a):null,labelRenderer:([e,t])=>o.createElement("span",{className:m(l.tags.keyword)},o.createElement(c(),{searchWords:[this.state.filter],textToHighlight:`${e}`,highlightClassName:"jp-mod-selected"})),valueRenderer:e=>{let t=m(l.tags.string);return"number"==typeof e&&(t=m(l.tags.number)),"true"!==e&&"false"!==e||(t=m(l.tags.keyword)),o.createElement("span",{className:t},o.createElement(c(),{searchWords:[this.state.filter],textToHighlight:`${e}`,highlightClassName:"jp-mod-selected"}))},shouldExpandNodeInitially:(e,t,i)=>!(!a||!a.expanded)||d.join(",").includes(e.join(","))}))}}const p={scheme:"jupyter",base00:"invalid",base01:"invalid",base02:"invalid",base03:"invalid",base04:"invalid",base05:"invalid",base06:"invalid",base07:"invalid",base08:"invalid",base09:"invalid",base0A:"invalid",base0B:"invalid",base0C:"invalid",base0D:"invalid",base0E:"invalid",base0F:"invalid",author:"invalid"};function v(e,t){return JSON.stringify(e).includes(t)}function b(e,t,a=["root"]){return r.JSONExt.isArray(e)?e.reduce(((e,i,n)=>i&&"object"==typeof i&&v(i,t)?[...e,[n,...a].join(","),...b(i,t,[n,...a])]:e),[]):r.JSONExt.isObject(e)?Object.keys(e).reduce(((i,n)=>{const s=e[n];return s&&"object"==typeof s&&(n.includes(t)||v(s,t))?[...i,[n,...a].join(","),...b(s,t,[n,...a])]:i}),[]):[]}}}]);
//# sourceMappingURL=1281.js.map