text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[41],{1408:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;"value"in a&&(a.writable=true);Object.defineProperty(e,a.key,a)}}return function(t,r,a){r&&e(t.prototype,r);a&&e(t,a);return t}}();var n=r(6);var l=r(2034);var u=r(570);var o=r(61);var i=r(1679);var c=O(i);var f=r(27);var s=O(f);var d=r(2033);var p=O(d);var h=r(1);var v=O(h);var m=r(73);var y=O(m);var b=r(2032);var g=O(b);var _=r(1522);var w=O(_);var P=r(1521);var E=O(P);function O(e){return e&&e.__esModule?e:{default:e}}function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function T(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var R=function e(t){return s.default.context+"/api/?url="+s.default.context+"/json"+(0,n.map)(t.split("/"),function(e){return encodeURIComponent(e)}).join("/")+"?_api"};var N=function(e){T(t,e);function t(e){j(this,t);var r=S(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.handlePathSelect=r.handlePathSelect.bind(r);r.handleSearchFilter=r.handleSearchFilter.bind(r);r.resize=r.resize.bind(r);var a=e.router.params[0];var n=a?R("/"+a):"";r.state={collapsed:true,filteredTree:[],filter:"",initialTree:[],iframeSource:n,containerHeight:(0,c.default)()};return r}a(t,[{key:"componentDidMount",value:function e(){var t=this;(0,l.getPathsTree)().then(function(e){var r=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.map)(t,function(t){t.objectPath=""+r+t.id;t.children&&(t.children=e(t.children,t.objectPath));return t})};e.length&&""===t.state.iframeSource&&t.routeToPath(e[0].path);var a=r(e);t.setState({initialTree:a,filteredTree:a})});window.addEventListener("resize",(0,n.debounce)(this.resize,100))}},{key:"componentWillUnmount",value:function e(){window.removeEventListener("resize",this.resize)}},{key:"handleSearchFilter",value:function e(t){var r=t.target.value;this.setState({collapsed:(0,n.isEmpty)(r),filter:r,filteredTree:(0,n.isEmpty)(r)?this.state.initialTree:(0,p.default)(this.state.initialTree,r)})}},{key:"handlePathSelect",value:function e(t){this.routeToPath(t)}},{key:"resize",value:function e(){this.setState({containerHeight:(0,c.default)()})}},{key:"routeToPath",value:function e(t){y.default.routeTo(y.default.configuration.routes.apiExplorer,{args:[t.slice(1)],trigger:true})}},{key:"render",value:function e(){var t=this.props.router.params[0];var r=(0,n.map)(t.split("/"),function(e,t,r){return"/"+r.slice(0,r.length-t).join("/")});var a=v.default.createElement("div",{className:"input-group"},v.default.createElement(u.FormControl,{onChange:this.handleSearchFilter,placeholder:(0,o.t)("common.form.search"),type:"text"}),v.default.createElement("span",{className:"input-group-addon"},v.default.createElement("i",{className:"fa fa-search"})));return v.default.createElement(u.Grid,{fluid:true},v.default.createElement(u.Row,null,v.default.createElement(u.Col,{md:3},v.default.createElement(u.Panel,{className:"am-iframe-overflow-scroll row",style:{height:this.state.containerHeight+"px"}},v.default.createElement(u.Panel.Heading,null,a),v.default.createElement(u.Panel.Body,null,v.default.createElement("nav",{className:"sidenav"},v.default.createElement(g.default,{activePaths:r,collapsed:this.state.collapsed,data:this.state.filteredTree,filter:this.state.filter,onNodeSelect:this.handlePathSelect}))))),v.default.createElement(u.Col,{md:9},v.default.createElement("iframe",{className:"am-iframe-overflow-scroll am-iframe-full-width",src:this.state.iframeSource,style:{height:this.state.containerHeight+"px"},title:(0,o.t)("console.api.explorer.iFrameTitle")}))))}}]);return t}(h.Component);N.propTypes={router:E.default};t.default=(0,w.default)(N)},1521:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=r(1);var n=o(a);var l=r(0);var u=o(l);function o(e){return e&&e.__esModule?e:{default:e}}var i=u.default.shape({params:u.default.array.isRequired});t.default=i},1522:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=function(e){var t=function t(r){var a=i.default.currentRoute;var l=i.default.extractParameters(a,f.default.getCurrentFragment());var o=i.default.applyDefaultParameters(a,l);var c={params:n.default.map(o,function(e){if(!e)return"";return decodeURIComponent(e)})};return u.default.createElement(e,n.default.extend({},r,{router:c}))};t.displayName="withRouter("+d(e)+")";t.WrappedComponent=e;return t};var a=r(6);var n=s(a);var l=r(1);var u=s(l);var o=r(73);var i=s(o);var c=r(63);var f=s(c);function s(e){return e&&e.__esModule?e:{default:e}}function d(e){return e.displayName||e.name||"Component"}},1642:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=r(6);var n=r(0);var l=i(n);var u=r(1);var o=i(u);function i(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var r=function e(t){return t%2===1};var n=e.split(new RegExp("("+t+")","gi"));return(0,a.map)(n,function(e,t){return r(t)?o.default.createElement("strong",null,e):e})}var f=function e(t){var r=t.children,a=t.match;return a?o.default.createElement("span",null,c(r,a)):o.default.createElement("span",null,r)};f.propTypes={children:l.default.string.isRequired,match:l.default.string};t.default=f},1679:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=function e(){var t=76;var r=81;return window.innerHeight-t-r};t.default=a},2030:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;"value"in a&&(a.writable=true);Object.defineProperty(e,a.key,a)}}return function(t,r,a){r&&e(t.prototype,r);a&&e(t,a);return t}}();var n=r(0);var l=f(n);var u=r(1);var o=f(u);var i=r(1642);var c=f(i);function f(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){p(t,e);function t(e){s(this,t);var r=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.handleOnNodeSelect=r.handleOnNodeSelect.bind(r);r.state={collapsed:!e.highlighted&&e.collapsed};return r}a(t,[{key:"handleOnNodeSelect",value:function e(){this.setState({collapsed:!this.state.collapsed});this.props.node.path&&this.props.onSelect(this.props.node.path)}},{key:"render",value:function e(){return o.default.createElement("li",{className:this.props.highlighted?"active":""},o.default.createElement("a",{className:"am-tree-node",onClick:this.handleOnNodeSelect,onKeyPress:this.handleOnNodeSelect,role:"button",tabIndex:"0"},o.default.createElement("i",{className:"fa "+(this.state.collapsed?"fa-plus-square-o":"fa-minus-square-o")}),o.default.createElement(c.default,{match:this.props.filter},this.props.node.id)),o.default.createElement("div",{className:this.state.collapsed?"am-tree-node-children-hidden":"am-tree-node-children"},this.props.children))}}]);return t}(u.Component);h.propTypes={children:l.default.element.isRequired,collapsed:l.default.bool,filter:l.default.string,highlighted:l.default.bool.isRequired,node:l.default.objectOf({id:l.default.string.isRequired,children:l.default.array,path:l.default.string}).isRequired,onSelect:l.default.func.isRequired};t.default=h},2031:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;"value"in a&&(a.writable=true);Object.defineProperty(e,a.key,a)}}return function(t,r,a){r&&e(t.prototype,r);a&&e(t,a);return t}}();var n=r(0);var l=f(n);var u=r(1);var o=f(u);var i=r(1642);var c=f(i);function f(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){p(t,e);function t(e){s(this,t);var r=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.handleLeafSelect=r.handleLeafSelect.bind(r);return r}a(t,[{key:"handleLeafSelect",value:function e(){this.props.onSelect(this.props.node.path)}},{key:"render",value:function e(){return o.default.createElement("li",{className:this.props.highlighted?"active":""},o.default.createElement("a",{className:"am-tree-node-leaf",onClick:this.handleLeafSelect,onKeyPress:this.handleLeafSelect,role:"button",tabIndex:"0"},o.default.createElement(c.default,{match:this.props.filter},this.props.node.id)))}}]);return t}(u.Component);h.propTypes={filter:l.default.string,highlighted:l.default.bool.isRequired,node:l.default.objectOf({id:l.default.string.isRequired,path:l.default.string}).isRequired,onSelect:l.default.func.isRequired};t.default=h},2032:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=r(6);var n=r(0);var l=d(n);var u=r(1);var o=d(u);var i=r(2031);var c=d(i);var f=r(2030);var s=d(f);function d(e){return e&&e.__esModule?e:{default:e}}var p=function e(t){var r=t.activePaths,n=t.collapsed,l=t.data,u=t.filter,i=t.onNodeSelect;var f=function e(t,r){var l=(0,a.includes)(r,t.objectPath);if(t.children){var f=(0,a.map)(t.children,function(t){return e(t,r)});return o.default.createElement(s.default,{collapsed:n,filter:u,highlighted:l,node:t,onSelect:i},f)}return o.default.createElement(c.default,{filter:u,highlighted:l,node:t,onSelect:i})};return o.default.createElement("ol",{className:"am-tree list-unstyled"},l.map(function(e){return f(e,r)}))};p.propTypes={activePaths:l.default.arrayOf(l.default.string).isRequired,collapsed:l.default.bool,data:l.default.arrayOf(l.default.objectOf({id:l.default.string.isRequired,children:l.default.array,objectPath:l.default.string.isRequired,path:l.default.string})).isRequired,filter:l.default.string,onNodeSelect:l.default.func.isRequired};t.default=p},2033:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=r(6);var n=l(a);function l(e){return e&&e.__esModule?e:{default:e}}var u=function e(t,r){return n.default.filter(t,function(t){if(t.path&&n.default.includes(t.path.toLowerCase(),r.toLowerCase()))return true;if(t.children){t.children=e(t.children,r);return!n.default.isEmpty(t.children)}})};var o=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return u(n.default.cloneDeep(t),r)};t.default=o},2034:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPathsTree=s;var a=r(169);var n=c(a);var l=r(27);var u=c(l);var o=r(168);var i=c(o);function c(e){return e&&e.__esModule?e:{default:e}}var f=new n.default(""+u.default.host+u.default.context+"/json");function s(){return f.serviceCall({url:(0,i.default)("/api",{realm:false}),headers:{"Accept-API-Version":"protocol=1.0,resource=1.0"}})}}}]);
  //# sourceMappingURL=41.5c2560b8eb.js.map