12345678910 |
- /**
- * IBM Confidential OCO Source Materials IBM Business Platform: Dashboards
- * (C) Copyright IBM Corp. 2016, 2020
- *
- * The source code for this program is not published or otherwise divested of
- * its trade secrets, irrespective of what has been deposited with the U.S.
- * Copyright Office
- */
- function _inherits(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:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _possibleConstructorReturn(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 _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};define("text!dashboard-analytics/visualizationPanel/templates/LoadingIndicator.html",[],(function(){return'<div class="loadingIndicatorContainer">\n <div class="loading_indicator"></div>\n</div>'})),define("dashboard-analytics/visualizationPanel/components/VisualizationContentContainer",["react","react-dom","prop-types","ca-ui-toolkit"],(function(e,t,n,i){var s=e.Component,o=i.Container,a=i.FlexLayout,r=i.FlexItem,l=i.VSpacer,c=i.SVGIcon,u=i.Label,p=function(t){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,t.apply(this,arguments))}return _inherits(n,t),n.prototype.componentDidMount=function(){this.props.handlers.componentDidMountCallback(this.props.containerClass,this.props.itemClass)},n.prototype.componentWillUnmount=function(){this.props.handlers.componentWillUnmountCallback(this.props.containerClass,this.props.itemClass)},n.prototype.render=function(){var t=this,n=this.props,i=n.containerClass,s=n.items,c=[];return s.forEach((function(e){c.push(t.renderVisualizationItem(e))})),e.createElement(o,{className:i},e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(r,null,e.createElement(l,{size:2})),e.createElement(r,null,e.createElement(a,{fullHeight:!0,direction:"row",wrap:"wrap"},c))))},n.prototype.renderVisualizationItem=function(t){return e.createElement(r,{role:"group",className:"prop-item","data-name":t.name},e.createElement(a,{fullHeight:!0,direction:"column",alignItems:"center",tabIndex:0,className:"prop-icon",role:"button",title:t.label,"aria-label":t.label},e.createElement(r,null,e.createElement(c,{iconId:t.icon,height:30,width:30,className:"svgIcon"})),e.createElement(r,null,e.createElement(u,{className:"prop-icon-label",label:t.label}))))},n}(s);return p.propTypes={items:n.array.isRequired,containerClass:n.string.isRequired,itemClass:n.string.isRequired,handlers:n.shape({componentDidMountCallback:n.func.isRequired,componentWillUnmountCallback:n.func.isRequired}).isRequired},p})),define("dashboard-analytics/visualizationPanel/components/contextMenu/ContextMenuWrapper",["react","react-dom","prop-types","ca-ui-toolkit"],(function(e,t,n,i){var s=e.Component,o=i.ContextMenu,a=function(t){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,t.apply(this,arguments))}return _inherits(n,t),n.prototype.render=function(){var t=this.props,n=t.theme,i=t.placement,s=void 0===i?"bottomRight":i,a=t.align,r=void 0===a?"left":a,l=t.domNodeToAttachTo,c=void 0===l?document.body:l,u=t.triggerNode,p=t.contextMenuItems,d=t.onClose,m=t.onChange;if(p&&p.length)return e.createElement(o,{theme:n,placement:s,align:r,triggerNode:u,domNodeToAttachTo:c,onClose:d,onChange:m},this._renderMenuItems(p))},n.prototype._renderMenuItems=function(e){var t=this;if(e)return e.map((function(e,n){return t._renderMenuSection(e,n)}))},n.prototype._renderMenuSection=function(t,n){if(Array.isArray(t.items)){var i=t.name,s=void 0===i?"menu":i,a=t.label,r=t.items;return e.createElement(o.List,{key:n,content:r,name:s,label:a,clickSelection:!0})}return e.createElement(o.Separator,{key:n})},n}(s);return a.propTypes={contextMenuItems:n.array,placement:n.string,align:n.string,triggerNode:n.object,style:n.object,domNodeToAttachTo:n.object,theme:n.bool,onClose:n.func,onChange:n.func},a})),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("dashboard-analytics/lib/@waca/dashboard-common/dist/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/overflow-menu--horizontal_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var n=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}("undefined"!=typeof self?self:this,(function(e){return webpackJsonPBaGraphics([789],{"3865314c5959606874d4":function(t,n){t.exports=e},"3e093e5642cd68f65e20":function(e,t,n){"use strict";var i=n("9689a9c94ae38b47fa2c"),s=n.n(i),o=n("9ce58a7deea14f49ef01"),a=n.n(o),r=new s.a({id:"overflow-menu--horizontal_16_v7",use:"overflow-menu--horizontal_16_v7-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="overflow-menu--horizontal_16_v7"><circle cx="3" cy="8" r="1" /><circle cx="8" cy="8" r="1" /><circle cx="13" cy="8" r="1" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});a.a.add(r),t.a=r},"7b8e9c951999a27dfd31":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("3865314c5959606874d4"),s=(n.n(i),n("3e093e5642cd68f65e20"));t.default=s.a}},["7b8e9c951999a27dfd31"])})),define("dashboard-analytics/visualizationPanel/components/VisualItem",["react","prop-types","ca-ui-toolkit","jquery","./contextMenu/ContextMenuWrapper","../../widgets/livewidget/nls/StringResources","../../visualizations/vipr/VIPRBundleHelper","../../lib/@waca/dashboard-common/dist/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/overflow-menu--horizontal_16"],(function(e,t,n,i,s,o,a,r){var l=e.Component,c=n.FlexLayout,u=n.FlexItem,p=n.VSpacer,d=n.HSpacer,m=n.SVGIcon,h=n.Label,f=n.Dialog,g=function(t){function n(i){_classCallCheck(this,n);var s=_possibleConstructorReturn(this,t.call(this,i));s.target=void 0,s._iconRef=null,s._rootRef=e.createRef(),s.state={item:s.props.item,isContextMenuOpen:!1,openDeleteDialog:!1};var o=s.state.item;return s._renderContext={icon:o.icon,description:o.label,isDisabled:!1},s}return _inherits(n,t),n.prototype.componentDidMount=function(){this._renderContext.isDisabled||this._attachCallbacksAndImages()},n.prototype._attachCallbacksAndImages=function(){var e=this._findChildVisCustomVisNode();e&&this.props.handlers.componentDidMountCallback("vis-custom-container","prop-item:not(.is-disabled)",e);this._appendIconNode()},n.prototype.componentWillUnmount=function(){this._renderContext.isDisabled||this._detachCallbacksAndImages()},n.prototype._detachCallbacksAndImages=function(){var e=this._findChildVisCustomVisNode();e&&this.props.handlers.componentWillUnmountCallback("vis-custom-container","prop-item:not(.is-disabled)",e);this._iconRef=null},n.prototype.render=function(){var t=this.state.item,n="vis-custom-vis"+(this._renderContext.isDisabled?" no-sdk":"");return e.createElement(u,{className:this._getVisualItemCssClasses(),role:"group"},e.createElement("div",{ref:this._rootRef},e.createElement(c,{fullHeight:!0,direction:"column",alignItems:"flext-start"},e.createElement(u,{className:n,"data-name":t.name},this._renderItem()),e.createElement(u,null,e.createElement(p,{size:1})),e.createElement(u,null,this._renderVisLabel()),e.createElement(u,null,e.createElement(p,{size:3}))),this.renderDeleteDialog()))},n.prototype._getVisualItemCssClasses=function(){return"vis-custom-visual-item"},n.prototype._renderItem=function(){var t=this.state.item,n=void 0;return n=this._canRenderMenuOption()?this._isSchematic(t)&&t.numSVGs>1?this._renderSchematicCountWithOptions():this._renderMenuOption():e.createElement(p,{size:1.5}),e.createElement(c,{fullHeight:!0,direction:"column",alignItems:"flext-start"},e.createElement(u,null,e.createElement(p,{size:.5})),e.createElement(u,{className:"vis-options"},n),e.createElement(u,null,e.createElement(p,{size:.5})),e.createElement(u,null,this._renderContent()))},n.prototype._renderContent=function(){var t=this.state.item,n="prop-item"+(this._renderContext.isDisabled?" is-disabled":"");return e.createElement(c,{fullHeight:!0,direction:"column",alignItems:"flext-start"},e.createElement(u,{role:"group",className:n,"data-name":t.name},this._renderVisIcon()))},n.prototype._canRenderMenuOption=function(){return this.props.customVisAction.canManage()},n.prototype._isSchematic=function(e){var t=this.props.handlers;return t.isSchematicType(e)&&!t.isSchematicTypePreview(e)},n.prototype._renderMenuOption=function(){var t=this.props.menuIcon,n=this.state.item;return e.createElement(c,{fullHeight:!0,direction:"row-reverse",className:"vis-custom-menu-overflow"},e.createElement(u,null,e.createElement(d,{size:1})),e.createElement(u,{"data-name":n.name,className:"vis-custom-menu-overflow-anchor",title:o.get("extVisMore")},e.createElement(m,{size:"small",className:"svgIcon",verticalAlign:"initial",tabIndex:0,iconId:t.default.id,onKeyUp:this._renderContextMenu.bind(this),onClick:this._handleOnClick.bind(this)}),this._renderContextMenu()))},n.prototype._renderSchematicCountWithOptions=function(){var t=this.state.item,n=this._canRenderMenuOption(),i=n?"50%":"100%";return e.createElement(c,{fullHeight:!0,direction:"row",justifyContent:"space-between"},e.createElement(u,{width:i,grow:!0,shrink:!0},e.createElement(c,{fullHeight:!0,direction:"row",justifyContent:"flex-start"},e.createElement(u,null,e.createElement(d,{size:.5})),e.createElement(u,null,e.createElement("div",{className:"vis-svg-count-container",title:t.numSVGs,"aria-label":t.numSVGs},e.createElement(h,{className:"vis-svg-count-content",label:t.numSVGs}))))),n&&e.createElement(u,{grow:!0,shrink:!0},this._renderMenuOption()))},n.prototype._renderVisIcon=function(){var t=this.state.item;return e.createElement(c,{fullHeight:!0,direction:"column",alignItems:"center",tabIndex:0,className:"prop-icon",role:"button",title:t.label,"aria-label":t.label},e.createElement(u,null,a.isValidIconFileExt(t.icon)?this._renderIconRef():this._renderIcon()))},n.prototype._renderIcon=function(){var t="svgIcon"+(this._renderContext.isDisabled?" is-disabled":"");return e.createElement(m,{iconId:this._renderContext.icon,height:30,width:30,className:t})},n.prototype._renderIconRef=function(){return this._iconRef=e.createRef(),e.createElement("div",{ref:this._iconRef})},n.prototype._appendIconNode=function(){if(this._iconRef&&this._iconRef.current){var e=this.state.item.placeholderIcon,t=i('<img src="'+e+'"></img>');t.addClass("is-small"),t.addClass("ba-common-svgIcon"),t.css({height:"30px",width:"30px","vertical-align":"bottom"}),this._iconRef.current.appendChild(t[0])}},n.prototype._renderVisLabel=function(){var t="vis-custom-vis-label"+(this._renderContext.isDisabled?" no-sdk":"");return e.createElement(c,{fullHeight:!0,direction:"column",alignItems:"center",title:this._renderContext.description,"aria-label":this._renderContext.description},e.createElement(u,null,e.createElement(h,{className:t,label:this._renderContext.description})))},n.prototype._renderContextMenu=function(){var e=this.state.item;if(this.state.isContextMenuOpen&&this.target&&(!this.targetName||this.targetName===e.name))return this._getContextMenuContent()},n.prototype._getContextMenuContent=function(){return e.createElement(s,{theme:!0,placement:"bottomRight",align:"left",triggerNode:this.target,domNodeToAttachTo:document.body,onClose:this.onClose.bind(this),onChange:this.onChange.bind(this),contextMenuItems:this._getContextMenuItems()})},n.prototype.onClose=function(){this.target&&i(this.target).removeClass("open-context-menu"),this.target=void 0,this.targetName=void 0,this.setState({isContextMenuOpen:!1})},n.prototype.onChange=function(e,t){if("delete"===t)this.setState({openDeleteDialog:!0});else if("update"===t){var n=this.props.customVisAction,i=this.state.item;n.openSelectBundleFileDialog&&n.openSelectBundleFileDialog(i)}this.onClose()},n.prototype.renderDeleteDialog=function(){var t=this;return e.createElement("div",null,this.state.openDeleteDialog&&e.createElement(f,_extends({},{size:"small",width:"20px",minWidth:"450px",maxWidth:"500px",clickaway:!1,theme:"ba-theme-default",startingFocusIndex:1},{onClose:function(){t.setState({openDeleteDialog:!1})}}),e.createElement(f.Header,null,o.get("extVisDeleteDialogTitle")),e.createElement(f.Body,null,o.get("extVisDeleteDialogBody")),e.createElement(f.Footer,null,e.createElement(f.Button,{primary:!0,label:o.get("extVisCustomDelete"),onClick:function(){t.deleteCustomVisualization()}}),e.createElement(f.Button,{label:o.get("dlg_cancel"),onClick:function(){t.setState({openDeleteDialog:!1})}}))))},n.prototype.deleteCustomVisualization=function(){this.setState({openDeleteDialog:!1}),(0,this.props.onContextMenuChange)(this.state.item,"delete")},n.prototype._getContextMenuItems=function(){return[{items:[{id:"update",value:"update",label:o.get("extVisCustomUpdate")}]},{},{items:[{id:"delete",value:"delete",label:o.get("extVisCustomDelete")}]}]},n.prototype._handleOnClick=function(e){if(this.state.isContextMenuOpen)this.target&&i(this.target).removeClass("open-context-menu"),this.target=void 0,this.targetName=void 0,this.setState({isContextMenuOpen:!1});else{var t=i(e.target);(t=t.closest(".vis-custom-menu-overflow-anchor")).addClass("open-context-menu"),this.target=t[0],this.targetName=t.data("name"),this.setState({isContextMenuOpen:!0})}},n.prototype._findChildVisCustomVisNode=function(){return this._rootRef.current?i(this._rootRef.current).find(".prop-item"):null},n}(l);return g.propTypes={item:t.object.isRequired,iconsFeature:t.object.isRequired,handlers:t.shape({componentDidMountCallback:t.func.isRequired,componentWillUnmountCallback:t.func.isRequired,isSchematicType:t.func.isRequired,isSchematicTypePreview:t.func.isRequired}).isRequired,openSelectBundleFileDialog:t.func.isRequired,onContextMenuChange:t.func,customVisAction:t.object.isRequired,menuIcon:t.object},g.defaultProps={onContextMenuChange:function(){},openSelectBundleFileDialog:function(){},menuIcon:r},g})),define("dashboard-analytics/visualizationPanel/components/custom/PreviewVisualItem",["react","prop-types","ca-ui-toolkit","../VisualItem","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/dashboard-common/dist/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/information_16"],(function(e,t,n,i,s,o){var a=n.FlexLayout,r=n.FlexItem,l=n.VSpacer,c=n.HSpacer,u=n.Flyout,p=n.Label,d=function(t){function n(e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,t.call(this,e));return i.state.sdkIsRunning=!1,i._initRenderContext(i.state.sdkIsRunning),i}return _inherits(n,t),n.prototype._initRenderContext=function(e){var t=this.state.item,n=this.props,i=n.handlers,o=n.iconsFeature,a=i.isSchematicType(t),r=void 0;r=a?o.getIcon("svgFile").id:o.getIcon("codeFile").id,this._renderContext={icon:r,description:a?t.label:s.get("customVisTestVisualization"),isDisabled:!a&&!e}},n.prototype._isSDKActive=function(){return this.props.handlers.isSDKActive()},n.prototype.componentDidMount=function(){var e=this;return t.prototype.componentDidMount.call(this),this._isSDKActive().then((function(t){t&&(e._initRenderContext(!0),e.setState({sdkIsRunning:!0}),e._attachCallbacksAndImages())})).catch((function(){}))},n.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this)},n.prototype._getVisualItemCssClasses=function(){return t.prototype._getVisualItemCssClasses.call(this)+" vis-custom-preview"},n.prototype._canRenderMenuOption=function(){return!!this._renderContext.isDisabled},n.prototype._getContextMenuContent=function(){return e.createElement(u,{theme:!0,placement:"bottomRight",showX:!0,triggerNode:this.target,domNodeToAttachTo:document.body,onClose:this.onClose.bind(this),className:"vis-preview-indicator-menu"},e.createElement(a,{fullHeight:!0,direction:"row",justifyContent:"flex-start"},e.createElement(r,null,e.createElement(c,{size:2})),e.createElement(r,null,e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(r,null,e.createElement(l,{size:2})),e.createElement(r,null,e.createElement(p,{label:s.get("extVisNoSDKConnection"),className:"vis-preview-indicator-menu-title"})),e.createElement(r,null,e.createElement(l,{size:2})),e.createElement(r,null,e.createElement(p,{label:s.get("extVisNoSDKPreviewMsg"),className:"vis-preview-indicator-menu-msg"})),e.createElement(r,null,e.createElement(l,{size:2})))),e.createElement(r,null,e.createElement(c,{size:2}))))},n}(i);return d.propTypes={item:t.object.isRequired,handlers:t.shape({componentDidMountCallback:t.func.isRequired,componentWillUnmountCallback:t.func.isRequired,isSchematicType:t.func.isRequired,isSDKActive:t.func.isRequired}).isRequired,menuIcon:t.object},d.defaultProps={menuIcon:o},d})),define("dashboard-analytics/visualizationPanel/components/custom/CustomPreviewWidgetsComponent",["react","ca-ui-toolkit","prop-types","./PreviewVisualItem","../../../widgets/livewidget/nls/StringResources"],(function(e,t,n,i,s){var o=e.Component,a=t.FlexLayout,r=t.FlexItem,l=t.VSpacer,c=t.HSpacer,u=t.Label,p=t.Separator,d=function(t){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,t.apply(this,arguments))}return _inherits(n,t),n.prototype.render=function(){var t=this,n=this.props.previewItems,i=n.length,o=[],d=e.createElement(r,null,e.createElement(c,{size:1.5}));return n.forEach((function(e,n){o.push(t._renderPreviewItem(e)),n<i-1&&o.push(d)})),e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(r,null,e.createElement(l,{size:2})),e.createElement(r,null,e.createElement(u,{className:"vis-custom-preview-widget-label",label:s.get("extVisCustomPreviewWidgets")})),e.createElement(r,null,e.createElement(l,null)),e.createElement(r,{height:"150px"},e.createElement(a,{fullHeight:!0,direction:"row",justifyContent:"flex-start"},o)),e.createElement(r,null,e.createElement(p,{className:"vis-custom-separator",hMargin:0,orientation:"horizontal"})),e.createElement(r,null,e.createElement(l,{size:2.5})))},n.prototype._renderPreviewItem=function(t){var n=this.props,s=n.handlers,o=n.dashboardApi.getFeature("Icons");return e.createElement(r,{grow:1,shrink:1,className:"vis-custom-preview-item"},e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(r,null,e.createElement(i,{item:t,handlers:s,iconsFeature:o})),e.createElement(r,null,e.createElement(l,{size:3}))))},n}(o);return d.propTypes={previewItems:n.array.isRequired,dashboardApi:n.object.isRequired,handlers:n.shape({componentDidMountCallback:n.func.isRequired,componentWillUnmountCallback:n.func.isRequired,isSDKActive:n.func.isRequired}).isRequired},d})),define("dashboard-analytics/visualizationPanel/components/custom/CustomVisualItems",["react","prop-types","ca-ui-toolkit","../VisualizationContentContainer","../VisualItem"],(function(e,t,n,i,s){var o=n.FlexLayout,a=n.FlexItem,r=function(t){function n(e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,t.call(this,e));return i.target=void 0,i.targetName=void 0,i.state={isContextMenuOpen:!1,items:i.props.items},i}return _inherits(n,t),n.prototype.componentWillReceiveProps=function(e){this.setState({items:e.items})},n.prototype.render=function(){var t=this,n=this.state.items,i=this.props.containerClass,s=[];return n.forEach((function(e){s.push(t.renderVisualizationItem(e))})),e.createElement(o,{className:i,fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(a,null,e.createElement(o,{fullHeight:!0,direction:"row",wrap:"wrap"},s)))},n.prototype.renderVisualizationItem=function(t){var n=this.props,i=n.onContextMenuChange,o=n.handlers;return e.createElement(s,{item:t,handlers:o,onContextMenuChange:i,openSelectBundleFileDialog:this.props.handlers.openSelectBundleFileDialog,customVisAction:this.props.customVisAction})},n}(i);return r.propTypes={items:t.array,isRefreshing:t.bool,containerClass:t.string.isRequired,itemClass:t.string.isRequired,handlers:t.shape({openSelectBundleFileDialog:t.func.isRequired}).isRequired,customVisAction:t.object.isRequired},r.defaultProps={items:[],onContextMenuChange:function(){}},r})),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("dashboard-analytics/lib/@waca/dashboard-common/dist/lib/@ba-ui-toolkit/ba-graphics/dist/illustrations-js/nothing-here_128",["@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"],t);else{var n=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"]);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}("undefined"!=typeof self?self:this,(function(e){return webpackJsonPBaGraphics([60],{"3865314c5959606874d4":function(t,n){t.exports=e},"9612edcdbcc934e7f1ff":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("3865314c5959606874d4"),s=(n.n(i),n("dd3d8884a737f47c10b1"));t.default=s.a},dd3d8884a737f47c10b1:function(e,t,n){"use strict";var i=n("9689a9c94ae38b47fa2c"),s=n.n(i),o=n("9ce58a7deea14f49ef01"),a=n.n(o),r=new s.a({id:"nothing-here_128_v7",use:"nothing-here_128_v7-usage",viewBox:"0 0 200 200",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" id="nothing-here_128_v7"><circle class="ba-graphics-neutral-white4" cx="100" cy="100" r="100" /><path class="ba-graphics-white" d="M14.97 170.08h135.66" /><path class="ba-graphics-gray60" d="M150.63 172.08H15a2 2 0 110-4h135.63a2 2 0 010 4z" /><path class="ba-graphics-white" d="M2 170.08h4.97" /><path class="ba-graphics-gray60" d="M7 172.08H2a2 2 0 010-4h5a2 2 0 010 4z" /><path class="ba-graphics-white" d="M179.03 170.08H198" /><path class="ba-graphics-gray60" d="M198 172.08h-19a2 2 0 010-4h19a2 2 0 010 4z" /><path class="ba-graphics-white" d="M158.63 170.08h12.4" /><path class="ba-graphics-gray60" d="M171 172.08h-12.4a2 2 0 010-4H171a2 2 0 010 4z" /><path class="ba-graphics-white" d="M30.17 46.52h139.57a6.21 6.21 0 016.26 6.21v96.79a4 4 0 01-4 4H28a4 4 0 01-4-4V52.73a6.21 6.21 0 016.17-6.21z" /><path class="ba-graphics-gray60" d="M169.74 50.34a2.39 2.39 0 012.39 2.39v96.79a.18.18 0 01-.18.18H28a.18.18 0 01-.18-.18V52.73a2.4 2.4 0 012.4-2.39h139.52m0-3.82H30.17A6.22 6.22 0 0024 52.73v96.79a4 4 0 004 4h144a4 4 0 004-4V52.73a6.21 6.21 0 00-6.21-6.21z" /><path class="ba-graphics-gray1" d="M176 67.28v-16.8a4 4 0 00-4-4H28a4 4 0 00-4 4v16.8z" /><path class="ba-graphics-gray60" d="M172 50.3a.18.18 0 01.18.18v13H27.77v-13a.18.18 0 01.23-.18h144m0-3.82H28a4 4 0 00-4 4v16.8h152v-16.8a4 4 0 00-4-4z" /><circle class="ba-graphics-gray60" cx="34.07" cy="56.82" r="2" /><circle class="ba-graphics-gray60" cx="41.21" cy="56.82" r="2" /><circle class="ba-graphics-gray60" cx="48.34" cy="56.82" r="2" /><circle class="ba-graphics-gray60" cx="104.65" cy="20.58" r="2" /><circle class="ba-graphics-gray60" cx="141.96" cy="31.17" r="2" /><path class="ba-graphics-gray60" d="M61.33 27.91a4 4 0 004-4 1 1 0 112 0 4 4 0 004 4 1 1 0 010 2 4 4 0 00-4 4 1 1 0 01-2 0 4 4 0 00-4-4 1 1 0 010-2z" /><path class="ba-graphics-white" d="M88.66 128.74h19.08" /><path class="ba-graphics-gray60" d="M107.74 130.74H88.65a2 2 0 010-4h19.09a2 2 0 010 4z" /><circle class="ba-graphics-gray60" cx="75.32" cy="117.69" r="3.47" /><circle class="ba-graphics-gray60" cx="121" cy="117.69" r="3.47" /></symbol>'});a.a.add(r),t.a=r}},["9612edcdbcc934e7f1ff"])})),define("dashboard-analytics/visualizationPanel/components/custom/NoCustomVisuals",["react","prop-types","ca-ui-toolkit","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/dashboard-common/dist/lib/@ba-ui-toolkit/ba-graphics/dist/illustrations-js/nothing-here_128"],(function(e,t,n,i,s){var o=e.Component,a=n.FlexLayout,r=n.FlexItem,l=n.VSpacer,c=n.SVGIcon,u=n.Label,p=n.Button,d=function(t){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,t.apply(this,arguments))}return _inherits(n,t),n.prototype.render=function(){var t=this.props.customVisAction,n=t.openSelectBundleFileDialog.bind(t),o=void 0,d=void 0;return t.canManage()?(o=i.get("extVisNoCustomVisualsAdminMsg"),d=i.get("extVisAddCustomVisual")):o=i.get("extVisNoCustomVisualsMsg"),e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"space-between",alignItems:"center"},e.createElement(r,null,e.createElement(l,{size:3})),e.createElement(r,null,e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"center",alignItems:"center",className:"vis-no-custom-visuals"},e.createElement(a,{fullHeight:!0,direction:"column",justifyContent:"center",alignItems:"center"},e.createElement(r,null,e.createElement(c,{size:"xxlarge",className:"svgIcon",iconId:s.default.id})),e.createElement(r,null,e.createElement(l,{size:3})),e.createElement(r,null,e.createElement(u,{className:"vis-no-custom-visuals-label",label:i.get("extVisNoCustomVisuals")})),e.createElement(r,null,e.createElement(l,{size:2})),e.createElement(r,null,e.createElement(u,{className:"vis-no-custom-visuals-msg",label:o})),t.canManage()&&e.createElement("div",null,e.createElement(r,null,e.createElement(l,{size:4})),e.createElement(r,null,e.createElement(p,{set:"primary",label:d,title:d,onClick:function(){return n()}})))))),e.createElement(r,null,e.createElement(l,{size:3})))},n}(o);return d.propTypes={handlers:t.shape({openSelectBundleFileDialog:t.func.isRequired}).isRequired,customVisAction:t.object.isRequired},d})),define("dashboard-analytics/visualizationPanel/components/util/CustomUtil",["../../../visualizations/vipr/VIPRBundleHelper","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/core-client/js/core-client/ui/ProgressToast"],(function(e,t,n){var i=function(e,t){e.getGlassCoreSvc(".Logger").error(t)},s=function(e){var t=JSON.parse(e.message);return t&&t.Description?t.Description:""};return function(){function o(){_classCallCheck(this,o)}return o.deleteCustomVis=function(n,o,a){try{var r=n.getFeature("VisDefinitions").getById(o);if(!r)throw new Error("Cannot update bundle: "+o);var l=r.getProperty("assetId");return e.deleteCustomBundleVisulization({id:o,assetId:l,dashboardApi:n}).then(a).then((function(e){return n.showToast(t.get("extVisDeleteConfirmation"),{type:"success"}),e})).catch((function(e){n.showToast(t.get("extVisDeleteError",{msg:s(e)}),{type:"error"}),i(n,e)}))}catch(e){i(n,e)}},o.addCustomVis=function(n,a,r){if(0===n.target.files.length)return r();if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return console.log("The File APIs are not fully supported in this browser."),r();var l=o.getProgressToast(n.target.files[0].name),c=o.getDataFromFileEvent(n);return e.loadCustomBundleVisualization({data:c,dashboardApi:a}).then((function(){return r(!1).then((function(e){return l.setComplete(100,{duration:0,completeMsg:t.get("extVisAdd"),isComplete:!0}),l.remove(),e}))})).catch((function(e){l.fail(t.get("extVisAddError",{msg:s(e)})),i(a,e)}))},o.updateCustomVis=function(n,a,r){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(0===n.target.files.length)return r();if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return console.log("The File APIs are not fully supported in this browser."),r();var c=o.getProgressToast(l.label);try{var u=a.getFeature("VisDefinitions").getById(l.name);if(!u)throw new Error("Cannot update bundle: "+l.name);var p=u.getId(),d=o.getDataFromFileEvent(n);return e.updateCustomBundleVisualization({data:d,dashboardApi:a,bundleId:p,assetId:u.getProperty("assetId")}).then((function(){return r(!1).then((function(e){return c.setComplete(100,{duration:0,completeMsg:t.get("extVisUpdate"),isComplete:!0}),c.remove(),e}))})).catch((function(e){c.fail(t.get("extVisUpdateError",{msg:s(e)})),i(a,e)}))}catch(e){i(a,e)}},o.getDataFromFileEvent=function(e){var t=e.target.files[0],n=new FormData;return n.append(t.name,t),n},o.getProgressToast=function(e){var i=new n({noCancelBtn:!0}),s=t.get("extVisUpdateProgress",{name:e});return i.show(s),i.indefinite(s),i},o}()})),define("dashboard-analytics/visualizationPanel/components/custom/CustomVisualsContentComponent",["react","prop-types","./CustomVisualItems","./NoCustomVisuals","../util/CustomUtil"],(function(e,t,n,i,s){var o=e.Component,a=function(t){function o(e){_classCallCheck(this,o);var n=_possibleConstructorReturn(this,t.call(this,e));return n.props.customVisAction.setCustomVisualsContentComponent(n),n.state={items:n.props.items,isRefreshing:n.props.isRefreshing},n}return _inherits(o,t),o.prototype.componentWillReceiveProps=function(e){this.setState({items:e.items,isRefreshing:e.isRefreshing})},o.prototype.render=function(){var t=this.state,s=t.items,o=t.isRefreshing,a=this.props,r=a.handlers,l=a.customVisAction,c=s.length>0;return o?null:c?e.createElement(n,{items:s,containerClass:"vis-custom-vis-content",itemClass:"prop-item",onContextMenuChange:this.onContextMenuChange.bind(this),handlers:r,customVisAction:l}):e.createElement(i,{handlers:r,customVisAction:l})},o.prototype.onContextMenuChange=function(e,t){var n=this;if("delete"===t){var i=this.props.dashboardApi,o=this.props.handlers.refreshCustomVisDefinitions;return s.deleteCustomVis(i,e.name,o).then((function(e){n.props.customVisAction.setItems(e)}))}},o}(o);return a.propTypes={items:t.array.isRequired,handlers:t.shape({refreshCustomVisDefinitions:t.func.isRequired}).isRequired,isRefreshing:t.bool,dashboardApi:t.object.isRequired,customVisAction:t.object.isRequired},a.defaultProps={isRefreshing:!1},a})),define("dashboard-analytics/visualizationPanel/components/custom/CustomVisualsComponentHeader",["react","ca-ui-toolkit","prop-types"],(function(e,t,n){var i=e.Component,s=t.SVGIcon,o=function(t){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,t.apply(this,arguments))}return _inherits(n,t),n.prototype.componentDidMount=function(){var e=this.props.customVisAction,t=this.props.handlers.refreshCustomVisDefinitions;e.createUploadFileNode(t)},n.prototype.componentWillUnmount=function(){this.props.customVisAction.removeUploadFileNode()},n.prototype.render=function(){var t=this.props.customVisAction,n=t.openSelectBundleFileDialog.bind(t),i=t.dashboardApi.getFeature("Icons").getIcon("addNew");return e.createElement(s,{size:"small",className:"svgIcon",verticalAlign:"sub",iconId:i.id,onClick:function(){return n()}})},n}(i);return o.propTypes={handlers:n.shape({refreshCustomVisDefinitions:n.func.isRequired}).isRequired,customVisAction:n.object.isRequired},o})),define("dashboard-analytics/visualizationPanel/components/custom/CustomVisualsComponent",["react","ca-ui-toolkit","prop-types","./CustomVisualsContentComponent","./CustomVisualsComponentHeader","../../../widgets/livewidget/nls/StringResources"],(function(e,t,n,i,s,o){var a=e.Component,r=t.Label,l=t.VSpacer,c=t.FlexLayout,u=t.FlexItem,p=function(t){function n(e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,t.call(this,e));return i.state={items:i.props.items,isRefreshing:i.props.isRefreshing},i}return _inherits(n,t),n.prototype.componentWillReceiveProps=function(e){this.setState({items:e.items,isRefreshing:e.isRefreshing})},n.prototype.render=function(){var t=this.props.customVisAction,n=this.state,a=n.items,p=n.isRefreshing,d=this.props,m=d.handlers,h=d.dashboardApi;return e.createElement(c,{fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(u,{grow:5,className:"vis-custom-visuals-container"},e.createElement(c,{fullHeight:!0,direction:"column",justifyContent:"flex-start"},e.createElement(u,null,e.createElement(c,{direction:"row",justifyContent:"space-between"},e.createElement(u,{alignSelf:"flex-start"},e.createElement(r,{className:"vis-custom-vis-visuals-label",label:o.get("extVisCustomVisuals")})),t.canManage()&&e.createElement(u,{alignSelf:"flex-end",title:o.get("extVisAddCustomVisual")},e.createElement(s,{customVisAction:t,handlers:m})))),e.createElement(u,null,e.createElement(l,{size:2})),e.createElement(u,{basis:"0%",grow:1,shrink:1},e.createElement(i,{items:a,handlers:m,isRefreshing:p,customVisAction:t,dashboardApi:h})),e.createElement(u,null,e.createElement(l,{size:2})))))},n}(a);return p.propTypes={items:n.array.isRequired,handlers:n.shape({componentDidMountCallback:n.func.isRequired,componentWillUnmountCallback:n.func.isRequired,refreshCustomVisDefinitions:n.func.isRequired}).isRequired,isRefreshing:n.bool,dashboardApi:n.object.isRequired,customVisAction:n.object.isRequired},p.defaultProps={isRefreshing:!1},p})),define("dashboard-analytics/visualizationPanel/components/custom/CustomPanelContainer",["react","prop-types","ca-ui-toolkit","./CustomPreviewWidgetsComponent","./CustomVisualsComponent"],(function(e,t,n,i,s){var o=e.Component,a=n.Container,r=n.FlexLayout,l=n.FlexItem,c=n.VSpacer,u=function(t){function n(e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,t.call(this,e));return i.state={previewItems:i.props.custom.preview.previewItems,items:i.props.custom.visuals.items,isRefreshing:i.props.isRefreshing},i}return _inherits(n,t),n.prototype.componentWillReceiveProps=function(e){this.setState({previewItems:e.custom.preview.previewItems,items:e.custom.visuals.items,isRefreshing:e.isRefreshing})},n.prototype.render=function(){var t=this.props.customVisAction,n=this.state,o=n.previewItems,u=n.items,p=n.isRefreshing,d=t.canDevelop(),m="vis-custom-container"+(d?"":" no-preview");return e.createElement(a,{className:m},e.createElement(r,{fullHeight:!0,direction:"column"},d&&e.createElement(l,{className:"vis-custom-preview-container"},e.createElement(i,{previewItems:o,handlers:this.props.handlers,dashboardApi:this.props.dashboardApi})),t.canManageOnly()&&e.createElement(l,null,e.createElement(c,{size:2})),e.createElement(l,{basis:"0%",grow:1,shrink:1},e.createElement(s,{items:u,handlers:this.props.handlers,dashboardApi:this.props.dashboardApi,customVisAction:this.props.customVisAction,isRefreshing:p}))))},n}(o);return u.propTypes={custom:t.shape({preview:t.shape({previewItems:t.array}).isRequired,visuals:t.shape({items:t.array.isRequired}).isRequired}).isRequired,handlers:t.object.isRequired,isRefreshing:t.bool,dashboardApi:t.object.isRequired,customVisAction:t.object.isRequired},u.defaultProps={isRefreshing:!1},u})),define("dashboard-analytics/visualizationPanel/components/util/CustomVisAction",["jquery","./CustomUtil"],(function(e,t){return function(){function n(e){_classCallCheck(this,n),this.dashboardApi=e.dashboardApi,this.refreshCustomVis=e.refreshCustomVis,this.enabled=!0===this.dashboardApi.getConfiguration("enableCustomVisualizations"),this._loadUserCapabilities()}return n.prototype.openSelectBundleFileDialog=function(e){this.item=e,this.$uploadFileButton.click()},n.prototype.bundleFileSelected=function(e,n){var i=this;return(this.item?t.updateCustomVis:t.addCustomVis)(e,this.dashboardApi,n,this.item).then((function(e){e&&i.setItems(e)}))},n.prototype.setItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.customVisualsContentComponent.setState({items:[]}),this.customVisualsContentComponent.setState({items:e})},n.prototype.shouldRefreshCustomPanel=function(){return this.canDevelop()||this.canManage()},n.prototype.createUploadFileNode=function(t){var n=this;this.removeUploadFileNode(),this.$uploadFileButton=e('<input type="file" id="custom-vis-uploadfiles" style="display: none;" accept="application/zip,application/x-zip-compressed,multipart/x-zip,application/x-compressed" onclick="this.value=null;">'),e("body").append(this.$uploadFileButton),this.$uploadFileButton.on("change",(function(e){n.bundleFileSelected(e,t)})),this.$uploadFileButton.on("onClick",(function(){n.$uploadFileButton.value=null}))},n.prototype.removeUploadFileNode=function(){this.$uploadFileButton&&this.$uploadFileButton.length>0&&(this.$uploadFileButton.remove(),this.$uploadFileButton=null)},n.prototype.setCustomVisualsContentComponent=function(e){this.customVisualsContentComponent=e},n.prototype.destroy=function(){this.removeUploadFileNode(),this.customVisualsContentComponent=null,this.dashboardApi=null,this.refreshCustomVis=null},n.prototype.canDevelop=function(){return this.capabilities.canDevelop},n.prototype.canManage=function(){return this.capabilities.canManage},n.prototype.canManageOnly=function(){return this.capabilities.canManageOnly},n.prototype.canUseOnly=function(){return this.capabilities.canUseOnly},n.prototype.isEnabled=function(){return this.enabled},n.prototype._loadUserCapabilities=function(){var e=this.dashboardApi.getGlassCoreSvc(".UserProfile").capabilities,t=-1!==e.indexOf("canDevelopVisualizations")||this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","canDevelopVisualizations","enabled"),n=-1!==e.indexOf("canManageVisualizations")||this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","canManageVisualizations","enabled");this.capabilities={canDevelop:t,canManage:n,canManageOnly:!t&&n,canUseOnly:!t&&!n}},n}()})),define("dashboard-analytics/visualizationPanel/VisualizationPanelView",["../lib/@waca/core-client/js/core-client/ui/core/View","../lib/@waca/core-client/js/core-client/ui/KeyCodes","../widgets/livewidget/nls/StringResources","../visualizations/vipr/VIPRConfig","../visualizations/vipr/extendedVis/SchematicVis","../util/VidaSdkUtil","text!./templates/LoadingIndicator.html","underscore","jquery","doT","react","react-dom","prop-types","ca-ui-toolkit","./components/VisualizationContentContainer","./components/custom/CustomPanelContainer","./components/util/CustomVisAction","hammerjs","jquery.hammer"],(function(e,t,n,i,s,o,a,r,l,c,u,p,d,m,h,f,g){var b=u.Component,v=m.Container,C=m.ProgressIndicator,y=m.Tabs,_=m.TabPanel,E=m.VSpacer,V=m.Label,w=m.FlexLayout,x=m.FlexItem,I=function(e){function t(){_classCallCheck(this,t);for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];var o=_possibleConstructorReturn(this,e.call.apply(e,[this].concat(i)));return o.state={selectedTab:o.props.selectedTab,isRefreshing:!1,deleteable:!1,editable:!1,addable:!1,align:"center",tabs:o.props},o}return _inherits(t,e),t.prototype.render=function(){var e=this._renderTabPanels(),t=1===e.length?"vis-panel-tabs hide-tabs":"vis-panel-tabs";return u.createElement(v,{className:"vis-panel-container"},u.createElement(E,{size:2}),u.createElement(V,{className:"vis-panel-banner",label:n.get("visualizationSlideoutTitle")}),u.createElement(E,{size:2}),u.createElement(y,{className:t,selected:this.state.selectedTab,onChange:this.onChange.bind(this)},e))},t.prototype._renderTabPanels=function(){var e=[];return e.push(u.createElement(_,{id:"System",label:n.get("extVisSystem")},u.createElement(h,{containerClass:"vis-system-container",itemClass:"prop-item",items:this.props.tabs.system.items,handlers:this.props.tabs.handlers}))),this.props.customVisAction.isEnabled()&&e.push(u.createElement(_,{id:"Custom",label:n.get("extVisCustom")},this._renderCustomPanelContainer())),e},t.prototype.onChange=function(e){var t=this,n=this.props.customVisAction,i=n.shouldRefreshCustomPanel()&&"Custom"===e;if(this.setState({selectedTab:e,isRefreshing:i}),i)return n.refreshCustomVis(!0).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.setState({tabs:e,isRefreshing:!1})}))},t.prototype._renderProgressIndicator=function(){return u.createElement(w,{fullHeight:!0,direction:"column",justifyContent:"center",width:"100%",height:"100%"},u.createElement(x,{alignSelf:"center"},u.createElement(C,null)))},t.prototype._renderCustomPanelContainer=function(){var e=this.props,t=e.dashboardApi,n=e.customVisAction,i=e.tabs,s=this.state.isRefreshing;return u.createElement(f,{custom:i.custom,handlers:i.handlers,dashboardApi:t,customVisAction:n,isRefreshing:s})},t}(b);I.propTypes={tabs:d.object.isRequired,dashboardApi:d.object.isRequired,selectedTab:d.string.isRequired,customVisAction:d.object.isRequired},I.defaultProps={selectedTab:"System",isRefreshing:!1};var R=function(e){return r.chain(e).map((function(e){return"."+e})).value().join(" ")};return function(e){function d(){_classCallCheck(this,d);for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var s=_possibleConstructorReturn(this,e.call.apply(e,[this].concat(n))),o=n[0];return o.getEntries?(s.getEntries=o.getEntries,s.selectedTab=o.selectedTab||"System",s.dashboardApi=o.dashboardApi,s.dndManager=s.dashboardApi.getFeature("DashboardDnd.internal"),s.loadingIndicatorTemplate=c.template(a||""),s.customVisAction=new g({dashboardApi:s.dashboardApi,refreshCustomVis:s._refreshCustomVisDefinitions.bind(s)}),s._createViewStates(),s):_possibleConstructorReturn(s,Promise.reject("Invalid getEntries api provided"))}return _inherits(d,e),d.prototype.init=function(){var t;this.events={"clicktap .vis-panel-container .prop-item:not(.is-disabled)":"_onItemClick","mousedown .vis-panel-container .prop-item:not(.is-disabled)":"_onItemMouseDownStartDrag","keydown .vis-panel-container .prop-item:not(.is-disabled)":"_onItemKeyDown"};for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];(t=e.prototype.init).call.apply(t,[this].concat(i))},d.prototype.remove=function(){var t;this._dropZone&&(this._dropZone.remove(),this._dropZone=null),this.dndManager=null,this.customVisAction.destroy(),this.customVisAction=null,p.unmountComponentAtNode(this.$el[0]);for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];(t=e.prototype.remove).call.apply(t,[this].concat(i))},d.prototype.render=function(){var e=this;return this._showLoadingIndicator(),this.getEntries().then((function(t){return e.items=t.items,e.options=t.options,e._separateVisBaseOnFunctionality(t.items)})).then((function(){e.viewState.handlers={componentDidMountCallback:e._componentDidMountCallback.bind(e),componentWillUnmountCallback:e._componentWillUnmountCallback.bind(e),refreshCustomVisDefinitions:e._refreshCustomVisDefinitions.bind(e),isSchematicType:e.isSchematicType.bind(e),isSDKActive:e._isSDKActive.bind(e),isSchematicTypePreview:e.isSchematicTypePreview.bind(e)},p.render(u.createElement(I,{tabs:e.viewState,dashboardApi:e.dashboardApi,selectedTab:e.selectedTab,customVisAction:e.customVisAction}),e.$el[0])})).finally((function(){e._hideLoadingIndicator(),e._dropZone=e.dndManager.addDropTarget(e.$el[0],{accepts:e._accepts.bind(e)})}))},d.prototype._createViewStates=function(){this.viewState={system:{items:[]},custom:{preview:{previewItems:[]},visuals:{items:[]}}}},d.prototype._showLoadingIndicator=function(){this.$el.append(this.loadingIndicatorTemplate({})),this.loadingIndicatorContainer=this.$el.find(".loadingIndicatorContainer"),this.loadingIndicator=this.loadingIndicatorContainer.find(".loading_indicator"),p.render(u.createElement(C,null),this.loadingIndicator.get(0))},d.prototype._hideLoadingIndicator=function(){this.loadingIndicatorContainer&&(this.loadingIndicatorContainer.remove(),this.loadingIndicatorContainer=null,p.unmountComponentAtNode(this.loadingIndicator.get(0)))},d.prototype._accepts=function(){return!0},d.prototype._componentDidMountCallback=function(e,t,n){var i=this;if(n instanceof l)n.hammer(),n.on("hold",this._onItemHoldAndStartDrag.bind(this));else{var s=R([e,t]),o=this.$el.find(s);r.each(o,(function(e){var t=l(e);t.hammer(),t.on("hold",i._onItemHoldAndStartDrag.bind(i))}))}},d.prototype._componentWillUnmountCallback=function(e,t,n){var i=this;if(n instanceof l)n.off("hold",this._onItemHoldAndStartDrag.bind(this));else{var s=R([e,t]),o=this.$el.find(s);r.each(o,(function(e){l(e).off("hold",i._onItemHoldAndStartDrag.bind(i))}))}},d.prototype._refreshCustomVisDefinitions=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.getEntries)return Promise.reject("Invalid getEntries api provided");var n=this.dashboardApi.getFeature("VisDefinitions");return this._refreshPromise||(this._refreshPromise=n.refresh().then(this.getEntries.bind(this)).then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.items||[];return e.items=n,e._separateVisBaseOnFunctionality(n)})).then((function(){return e._refreshPromise=null,t?e.viewState:e.viewState.custom.visuals.items})).catch((function(t){throw e._refreshPromise=null,t}))),this._refreshPromise},d.prototype._isSDKActive=function(){var e=this;return this._sdkPromise||(this._sdkPromise=o.isSDKActive(this.dashboardApi).then((function(t){if(t)return e._refreshPromise?e._refreshPromise.then(e._refreshCustomVisDefinitions.bind(e,!0)):e._refreshCustomVisDefinitions(!0);throw new Error("SDK is not active")})).then((function(){return e._sdkPromise=null,!0})).catch((function(){return e._sdkPromise=null,!1}))),this._sdkPromise},d.prototype._separateVisBaseOnFunctionality=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=[],o=[],a=this.viewState.system.items=[],l=[],c=void 0,u=void 0,p=this.dashboardApi.getFeature("Icons").getIcon("customVisual");return t.forEach((function(e){var t=i.getConfig(e.name),n=t&&t.isCustomVis,s=t&&t.isSchematic;"visualizationPreview"===e.name?c=e:"com.ibm.vis.schematicsPreview"===e.name?u=e:n?(e.icon||(e.icon=p.id),e.isCustomVis=n,o.push(e)):s?(e.isSchematic=s,l.push({item:e,bundle:t})):a.push(e)})),c?s.push(c):s.push({name:"visualizationPreview",label:n.get("customVisTestVisualization")}),u&&s.push(u),this._getSchematicSVGContext(l).then((function(){e.viewState.custom.preview.previewItems=s;var t=l.map((function(e){return e.item}));e.viewState.custom.visuals.items=r.sortBy([].concat(o,t),(function(e){return e.label}))}))},d.prototype._getSchematicSVGContext=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return t.forEach((function(t){var i={method:"get",type:"meta",library:t.bundle.id};n.push(t.bundle.schematicVis.getSchematicContent(i,e.dashboardApi))})),Promise.all(n).then((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.forEach((function(n,i){var o=t[i],a=(JSON.parse(n)||{}).content||[];if(o.item.numSVGs=a.length,o.bundle.icon)o.item.placeholderIcon=o.bundle.placeholderIcon+s.cleanseFilename(o.bundle.icon);else{var r=e.dashboardApi.getFeature("Icons").getIcon("schematicVisual");o.item.icon=r.id}}))}))},d.prototype._getEntry=function(e){var t=l(e.target).closest(".prop-item").data("name");return this.items.find((function(e){return e.name===t})).content},d.prototype._onItemKeyDown=function(e){e.keyCode!==t.ENTER&&e.keyCode!==t.SPACE||this._onItemClick(e)},d.prototype._onItemClick=function(e){var t=e.currentTarget;if(!0!==l.data(t,"_clickEventReceived")&&(l.data(t,"_clickEventReceived",!0),setTimeout((function(){l.data(t,"_clickEventReceived",!1)}),500),this.options.onItemClick)){var n=this._getEntry(e);this.options.onItemClick(n,e),e&&e.gesture&&e.gesture.preventDefault()}},d.prototype._onStartDrag=function(e){if(this.options.onItemStartDrag){e.preventDefault&&e.preventDefault();var t=this._getEntry(e);this.options.onItemStartDrag(t,e)}},d.prototype._onItemHoldAndStartDrag=function(e){e.showAvatarImmediately=!0,this._onStartDrag(e)},d.prototype._onItemMouseDownStartDrag=function(e){this._onStartDrag(e)},d.prototype.isSchematicType=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"com.ibm.vis.schematicsPreview"===e.name||e.isSchematic},d.prototype.isSchematicTypePreview=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"com.ibm.vis.schematicsPreview"===e.name},d}(e)})),define("dashboard-analytics/visualizationPanel/layers",["./VisualizationPanelView"],(function(){})),define("dashboard-analytics/visualizationPanelBundle",(function(){}));
|