/** * 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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var _extends=Object.assign||function(t){for(var e=1;ed&&(n=d-a.width());var l=r+a.height(),h=this.getMaximumHeight();h&&l>h&&(r=h-a.height()),e={style:{left:Math.max(this.getMinimumLeft(),n)+"px",top:Math.max(this.getMinimumTop(),r)+"px"},insertBefore:o,parentId:this.model.id,id:t.node._layout.model.id},t.dropPosition.height&&(e.style.height=t.dropPosition.height+"px"),t.dropPosition.width&&(e.style.width=t.dropPosition.width+"px")}return e},getMaximumWidth:function(){var t=this.getPhysicalPageSize();return t?t.width:1/0},getMaximumHeight:function(){var t=this.getPhysicalPageSize();return t?t.height:1/0},getMinimumTop:function(){var t=parseInt(this.$el.css("padding-top"),10);return isNaN(t)?0:t},getMinimumLeft:function(){var t=parseInt(this.$el.css("padding-left"),10);return isNaN(t)?0:t},_addWidget:function(t,e){var i=this,o=this.dashboardApi.getFeature("Transaction"),n=o.startTransaction(),r=t.model,a={containerId:t.parentId,type:"widget."+r.type,spec:r,properties:t.layoutProperties.style};return this.dashboardApi.getCanvas().addContent(a,n).then((function(t){return o.endTransaction(n),i.layoutController.whenWidgetRenderComplete(t.getId()).done((function(t){var o=i.layoutController.interactionController.selectionHandler;o.deselectAll(),o.selectNode(t.domNode,{isTouch:e})}))}))},_getModelToAddFromDragObject:function(t){return this.dashboardApi.getFeature("CanvasDnD").onDrop(t)},_processWidgetSpecForPin:function(t,e){if("boardFragment"===t.contentType){var i={layout:t.content.layout,widgets:t.content.widgets,dataSources:t.content.dataSources,properties:t.content.properties,sourceName:t.sourceName};t.content.drillThrough&&(i.drillThrough=t.content.drillThrough),t.content.episodes&&(i.episodes=t.content.episodes);var o={model:i,parentId:t.parentId},n=this.model.boardModel.addFragment(o,"layoutBaseView_onPinDrop",null);n&&n.value&&n.value.parameter&&n.value.parameter.model.layout&&n.value.parameter.model.layout.id&&this.layoutController.whenWidgetRenderComplete(n.value.parameter.model.layout.id).done(function(t){var i=this.layoutController.interactionController.selectionHandler;i.deselectAll(),i.selectNode(t.domNode,{isTouch:e})}.bind(this))}else this._addWidget(t,e);this.dashboardApi.getFeature("Colors").clearLocalPaletteCache()},getPhysicalPageSize:function(t,e){var i=t||this.model.getLayoutPositioning(!0);return"absolute"===i?this.model.boardModel.layout.get("pageSize"):"relative"===i?this._getRelativePhysicalPageSize(e):{width:this.domNode.offsetWidth,height:this.domNode.offsetHeight}},_getRelativePhysicalPageSize:function(t){var o=void 0,n={};if(this.$el.is(":visible"))n={width:this.$el.width(),height:this.$el.height()};else{if(!(o=i(t?e.getLayoutContentContainer(this.layoutController.topLayoutModel.id,t,this.dashboardApi):this.layoutController.getLayoutContentContainer())).length)return{width:this.domNode.offsetWidth,height:this.domNode.offsetHeight};if("relative"===o[0]._layout.model.getLayoutPositioning(!0))n={width:o.width(),height:o.height()};else{var r=o.parent(),a=this.model.boardModel.layout.get("pageSize");n={width:r.width(),height:r.width()*(a.height/a.width)}}}return n},moveToFitBoundaries:function(t,e,i){i.top+i.height>t&&(i.top=t-i.height),i.left+i.width>e&&(i.left=e-i.width)},updateModel:function(t,e){var i=this,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.forEach((function(t){var n=i.dashboardApi.getCanvas().getContent(t.id),r=Object.assign({},e,{validatePropertyValue:!1});Object.keys(t.style).forEach((function(e){n.setPropertyValue(e,t.style[e],r)})),r.validatePropertyValue=o,Object.keys(t.style).forEach((function(e){n.setPropertyValue(e,t.style[e],r)}))}))}})})),define("dashboard-core/js/dashboard/util/PxPercentUtil",[],(function(){var t=function(){function t(){_classCallCheck(this,t)}return t.changePixelPropertiesToPercent=function(t,i,o){var n=new e(o);this._convertUnits(t,i,n)},t.changePercentPropertiesToPixel=function(t,e){var o=new i;this._convertUnits(t,e,o)},t._convertUnits=function(t,e,i){if(!t||!e)throw new Error("Invalid options specified.");this._convertProperty(t,"top",e.height,i),this._convertProperty(t,"left",e.width,i),this._convertProperty(t,"height",e.height,i),this._convertProperty(t,"width",e.width,i),this._convertProperty(t,"bottom",e.height,i,!1),this._convertProperty(t,"right",e.width,i,!1)},t._convertProperty=function(t,e,i,o){var n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];t&&t[e]&&(t[e]=o.convertValue(t[e],i,n))},t}(),e=function(){function t(e){_classCallCheck(this,t),this.decimalPlaces=e}return t.prototype.convertValue=function(t,e,i){var o=t;if(t&&t.indexOf&&-1!==t.indexOf("px")){var n=100*parseFloat(t)/e;i&&(n=100-n),o=this.decimalPlaces?String(Number(n.toFixed(this.decimalPlaces)))+"%":n+"%"}return o},t}(),i=function(){function t(){_classCallCheck(this,t)}return t.prototype.convertValue=function(t,e,i){var o=t;if(t&&t.indexOf&&-1!==t.indexOf("%")){var n=parseFloat(t);o=i&&0===n?e:Math.round(e*n/100),o+="px"}return o},t}();return t})),define("dashboard-core/js/dashboard/layout/authoring/views/Absolute",["./LayoutBaseView","jquery","underscore","../../../../lib/@waca/core-client/js/core-client/utils/Deferred","../../LayoutHelper","../../../util/PxPercentUtil","../../../glass/util/InstrumentationUtil"],(function(t,e,i,o,n,r,a){var s=null;return s=t.extend({init:function(t){s.inherited("init",this,arguments),this.layoutController.topLayoutModel&&(this.layoutController.topLayoutModel.on("change:showGrid",this.renderGrid,this),this.layoutController.topLayoutModel.on("change:fitPage",this.renderGrid,this),this.layoutController.topLayoutModel.on("change:pageSize",this.onPageSize,this)),this.services=t.services,this._templateHelper=t.templateHelper,this.whenIsReadyDfd=new o,this.specializeConsumeView(["setPreferredLocation"]),this._initialize()},createDropZone:function(){var t=this;this._dropTarget=this._dndManager.addDropTarget(this.domNode,{accepts:this.accepts.bind(this),onDrop:this.onDrop.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragEnd:this.onDragEnd.bind(this),onDragMove:this.onDragMove.bind(this),priority:-100,info:function(e,i){return t._getCoordsRelativeToTarget(e,i)},type:"dropOnCanvas"}),this._dropHandler=this._dndManager.registerDropHandler({accepts:function(t,e){return t.type.match(/content\..*/)&&"dropOnCanvas"===e.type},onDrop:function(e,i){t.onContentDrop(e,i)}})},_getCoordsRelativeToTarget:function(t,i){var o=e(t).offset();return{top:Math.round(i.pageY-o.top+t.scrollTop),left:Math.round(i.pageX-o.left+t.scrollLeft)}},onContentDrop:function(t,e){var i=JSON.parse(JSON.stringify(t.data)),o=i.spec.style||{};if(e&&e.info){var r={width:o.width,height:o.height,top:e.info.top,left:e.info.left};return this._stylePxToInt(r),this._setStyleWithinBounds(r),n.styleIntToPx(r),o.width=r.width,o.height=r.height,o.left=r.left,o.top=r.top,i.spec.style=o,this.dashboardApi.getFeature("Canvas").addContent(i)}this.clearDragState()},onShow:function(){s.inherited("onShow",this,arguments),this.renderGrid()},whenIsReady:function(){return this.whenIsReadyDfd.promise},destroy:function(){this._dropTarget&&(this._dropTarget.remove(),this._dropTarget=null),this._dropHandler&&(this._dropHandler.deregister(),this._dropHandler=null),this._dndManager=null,e.glassdnd&&e.glassdnd.cancelDroppable&&e.glassdnd.cancelDroppable(this.$el),this.$el.find(".absoluteLayoutGrid").remove(),this.layoutController.topLayoutModel.off("change:showGrid",this.renderGrid,this),this.layoutController.topLayoutModel.off("change:pageSize",this.onPageSize,this),s.inherited("destroy",this,arguments)},removeChild:function(){s.inherited("removeChild",this,arguments)},_initialize:function(){this._dndManager=this.dashboardApi.getFeature("DashboardDnd.internal"),this.whenIsReadyDfd.resolve(),this.createDropZone()},_getDragPositionRelativeToTarget:function(t,i){var o=e(i).offset();return{top:Math.round(t.position.y-o.top+i.scrollTop),left:Math.round(t.position.x-o.left+i.scrollLeft)}},_getDragBoxForNewDrop:function(t,e){var i=this._getDragObjectDimensions(t),o=this._getDragPositionRelativeToTarget(t,e),n={top:o.top,left:o.left,ids:[]};return n.right=n.left+parseInt(i.width,10),n.bottom=n.top+parseInt(i.height,10),n.center_x=(n.left+n.right)/2,n.center_y=(n.top+n.bottom)/2,n},_getDragObjectDimensions:function(t){var i=t.data.layoutProperties&&t.data.layoutProperties.style||{},o=e(t.avatar);return 0===o.length&&(o=e(".avatar")),{width:i.width||o.width()||"10px",height:i.height||o.height()||"10px"}},_getDragBox:function(t){var i=t.reduce((function(t,i){var o,n,r,a,s=e(i.node);return i.dropPosition?(o=i.dropPosition.y,n=i.dropPosition.x,r=o+s.outerHeight(),a=n+s.outerWidth()):(o=1/0,n=1/0,r=0,a=0),t.top=Math.min(t.top,o),t.left=Math.min(t.left,n),t.bottom=Math.max(t.bottom,r),t.right=Math.max(t.right,a),t.ids.push(i.node.id),t}),{top:1/0,left:1/0,bottom:0,right:0,ids:[]});return i.center_x=(i.left+i.right)/2,i.center_y=(i.top+i.bottom)/2,i},accepts:function(t){return this.dashboardApi.getFeature("CanvasDnD").accepts(t,{fromCanvas:!0})},onDragMove:function(t,e){this.$el.addClass("layoutDragInProgress");var i=t.data&&t.data.nodeInfoList;i&&i.length?t.dragBox=this._getDragBox(i):t.dragBox=this._getDragBoxForNewDrop(t,e),this.adjustScrollPosition(t)},_moveDrop:function(t){for(var e,o,n=[],r=0,a=t.data.nodeInfoList.length;re?(t.width=Math.floor(.5*e),t.height=Math.floor(3*t.width/4)):(t.height=Math.floor(.5*i),t.width=Math.floor(4*t.height/3))),this.moveToFitBoundaries(i,e,t))},_stylePxToInt:function(t){for(var e in t)if(t.hasOwnProperty(e)){var i=t[e];i&&(t[e]=parseInt(i,10))}},findSpaceAdjacentToBottomBorder:function(t,e,o){var n=i.filter(o,(function(i){return i!==t&&t.top+t.heighti.top&&i.left<=t.left+t.width+e.width+5&&i.left+i.width>=t.left-e.width}));return 0===n.length?{top:t.top+t.height+5,left:t.left}:this.findSpaceBetweenRectangles(t,n,e)},findSpaceBetweenRectangles:function(t,i,o){var n=o.width+5;i.sort((function(t,e){return t.left-e.left}));var r=t.top+t.height+5,a=i[0];if(a.left>t.left&&a.left>=n&&a.left-n>t.left-n)return{top:r,left:Math.min(t.left,a.left-n)};for(var s,d,l=e(this.getWidgetContainerNode()).width(),h=0;hd.left+d.width)i[h+1]=s;else{var u=d?d.left:l;if(s.left+s.width+n<=u&&t.left+t.width+n>s.left+s.width+n)return{top:r,left:s.left+s.width+5}}return null},getChildrenRectList:function(){var t=[];t.push({top:0,left:0,height:this.getMinimumTop()-5,width:Math.round(e(this.getWidgetContainerNode()).width())}),t.push({top:0,left:0,height:Math.round(e(this.getWidgetContainerNode()).height()),width:this.getMinimumLeft()-5});var i,o,n=e(this.getWidgetContainerNode()).children().not(".relativeLayoutGrid, .absoluteLayoutGrid, .pagetemplateIndicator, .pagetemplateDropZone, .sizeDashboardIndicatorContainer");for(i=0,o=n.length;i0?"right":"left"]=!0),e.top!==this.previousDragBox.top&&(o.direction[e.top-this.previousDragBox.top>0?"bottom":"top"]=!0)),this.previousDragBox=e,o},getScrollAreaNode:function(){for(var t=this.$el.parents(".page"),e=this.$el,i=0;e&&e.length&&"auto"!==e.css("overflow");)e=t.eq(i),i++;return 0===e.length&&(e=this.$el),e},scrollToDragBox:function(t,e){t.bottom>e.scrollTop+e.h&&e.direction.bottom?e.$node.scrollTop(e.scrollTop+16):e.scrollTop>t.top-2&&e.direction.top&&e.$node.scrollTop(e.scrollTop-16),t.right>e.scrollLeft+e.w&&e.direction.right?e.$node.scrollLeft(e.scrollLeft+16):e.scrollLeft>t.left-2&&e.direction.left&&e.$node.scrollLeft(e.scrollLeft-16)},renderGrid:function(){var t=this.model.getValueFromSelfOrParent("showGrid"),e=void 0!==t&&t,i=this.model.getValueFromSelfOrParent("layoutPositioning");e&&"absolute"===i?this.$el.hasClass("gridCapable")&&(this.$el.find(".absoluteLayoutGrid").remove(),this.$el.prepend("
")):this.$el.find(".absoluteLayoutGrid").remove()},onResize:function(){s.inherited("onResize",this,arguments),this.renderGrid()},onPageSize:function(){this.renderGrid()}})})),define("dashboard-core/js/dashboard/layout/authoring/views/PageCollectionView",["./LayoutBaseView","jquery","../../../../lib/@waca/dashboard-common/dist/ui/AuthoringToolbar","../../../../lib/@waca/core-client/js/core-client/utils/EventHelper"],(function(t,e,i){var o=null;return o=t.extend({init:function(t){o.inherited("init",this,arguments),this.toolbar=t.toolbar?t.toolbar:new i({placement:"bottom",container:e("body")}),this._getViewId=this.consumeView._getViewId.bind(this.consumeView),this.htmlTemplate=t.services.getSvcSync("htmlTemplates")},destroy:function(){o.inherited("destroy",this,arguments)}})})),define("dashboard-core/js/app/ui/dnd/DnDHelper",[],(function(){return{_id:null,handleWidgetDrop:function(t,e,i){if(t)if("new"===i.data.operation){var o=this._prepareWidgetContent(e,i);t.addContent(o)}else if("move"===i.data.operation){var n=this._getContentIdList(i);t.moveContent(e,n)}},_prepareWidgetContent:function(t,e){var i=e.data.layoutProperties.style||{};return{containerId:t,layout:_extends({},i),spec:_extends({style:i},e.widgetSpec.model)}},_getContentIdList:function(t){return(t.data&&t.data.nodeInfoList).map((function(t){if(t&&t.node&&t.node._layout)return t.node._layout.model&&t.node._layout.model.id}))}}})),define("dashboard-core/js/app/ui/dialogs/GenericViewDialog",["../../../lib/@waca/core-client/js/core-client/ui/dialogs/BaseDialog"],(function(t){var e=null;return e=t.extend({_buttons:["ok","cancel"],_okCallback:null,_cancelCallback:null,init:function(t){this.title=t.title,this.view=new t.viewClass(t.viewOptions),this._okCallback=t.okCallback,this._cancelCallback=t.cancelCallback,e.inherited("init",this,arguments)},destroy:function(){this.view&&this.view.remove(),e.inherited("destroy",this,arguments)},renderContent:function(t){return this.view.render(),t.append(this.view.$el),t},renderTitle:function(t){return t.text(this.title),t},ok:function(){if(e.inherited("ok",this,arguments),this._okCallback)return this._okCallback()},cancel:function(){if(e.inherited("cancel",this,arguments),this._cancelCallback)return this._cancelCallback()},open:function(){e.inherited("open",this,arguments),this.view.onOpen&&this.view.onOpen()}})})),define("dashboard-core/js/dashboard/layout/authoring/views/Tab",["./PageCollectionView","jquery","../../../../lib/@waca/core-client/js/core-client/utils/BidiUtil","../../../../app/nls/StringResources","../../../../lib/@waca/core-client/js/core-client/utils/dom-utils","../../../../lib/@waca/core-client/js/core-client/utils/Deferred","../../../../app/ui/dnd/DnDHelper","../../../../app/ui/dialogs/GenericViewDialog","../../../views/LayoutPickerView","../../../../lib/@waca/core-client/js/core-client/utils/EventHelper"],(function(t,e,i,o,n,r,a,s,d){var l=null;return l=t.extend({init:function(t){var e=this;l.inherited("init",this,arguments),t=t||{},this._getLabelId=this.consumeView._getLabelId.bind(this.consumeView),this.specializeConsumeView(["showView","renderContent","_attachView","onAddClick","onReorder","_handleKeydown","showToolbar","deleteView","updateViewLabel","editViewTitle"]),this.services=t.services,this.config=t.config,this.layoutsPath=t.layoutsPath,this.templateListing=t.templateListing,this.whenIsReadyDfd=new r,this.backgroundChangeHandle=this.model.on("change:css",(function(){return e.consumeView.tabWidget.updateTheme()})),this.dashboardApi=t.dashboardApi,this._attachedHandles={},this._icons=this.dashboardApi.getFeature("Icons")},renderContent:function(){var t=this;return this.overridden.renderContent().then((function(){t.consumeView.tabWidget.setState({addable:!0,deleteable:t.allowTabDeletion(),draggable:!0}),t.model.items&&t.model.items.length&&t.model.items.forEach((function(e){return t._attachView(e)})),t._initializeDnd()}))},whenIsReady:function(){return this.whenIsReadyDfd.promise},destroy:function(){this._tabStripDropZone&&this._tabStripDropZone.remove(),this._tabDropHandler&&(this._tabDropHandler.deregister(),this._tabDropHandler=null),this.backgroundChangeHandle&&this.backgroundChangeHandle.remove(),this.toolbar&&this.toolbar.remove&&this.toolbar.remove(),this.toolbar=null,this.model.items.forEach(this._detachView.bind(this)),this.consumeView.updateState({addable:!1,deleteable:!1,draggable:!1}),l.inherited("destroy",this,arguments)},_initializeDnd:function(){this._dndManager=this.dashboardApi.getFeature("DashboardDnd.internal"),this.setupGlobalDropZone(),this.whenIsReadyDfd.resolve()},_attachView:function(t){var e=this;this.services.getSvcSync("TranslationService").registerView({view:this,model:t}),this._attachedHandles[t.id]=t.on("change:title",this.onTabLabelChange.bind(this,t),this),this._attachedHandles[t.id]=t.on("change:tabTextColor",(function(t){return e.consumeView.tabWidget.updateTheme(t)})),this._attachedHandles[t.id]=t.on("change:tabSelectedLineColor",(function(t){return e.consumeView.tabWidget.updateTheme(t)})),this._attachedHandles[t.id]=t.on("change:tabBackgroundColor",(function(t){return e.consumeView.tabWidget.updateTheme(t)})),this._attachedHandles[t.id]=t.on("change:tabIconColor",(function(t){return e.consumeView.tabWidget.updateTheme(t)})),this._attachedHandles[t.id]=t.on("change:tabIcon",(function(i){return e.onTabIconChange(t,i)}))},_detachView:function(t){this._attachedHandles[t.id]&&(this._attachedHandles[t.id].remove(),delete this._attachedHandles[t.id])},addTranslationIcon:function(t){var e=t&&t[0].propertyParentModel;return this.model.get("hideTab")?0:this.consumeView.tabWidget.updateTranslationIcon(e,!0)},removeTranslationIcon:function(t){var e=t&&t[0].propertyParentModel;return this.consumeView.tabWidget.updateTranslationIcon(e,!1)},_handleKeydown:function(t,e,i){var o=e.keyCode;if(this._shouldShowToolbar(e,o))return this.showToolbar(t,i),e.preventDefault(),!1;this.overridden._handleKeydown(t,e,i)},_shouldShowToolbar:function(t,e){return t.shiftKey&&121===e},moveViewBefore:function(t,e){t.id!==e&&t.getNextSiblingId()!==e&&t.updateModel({updateArray:[{id:t.id,parentId:t.getParent().id,insertBefore:e}]})},showView:function(t){this.isToolbarShown&&this.hideToolbar(),this.overridden.showView(t)},showToolbar:function(t,i){if(this.isToolbarShown)this.hideToolbar();else{this.isToolbarShown=!0,this.toolbar.clearItems();var o=this._toolbarItems(t);this.toolbar.addItems(o),this.toolbar.setSelectionContext(e(i)),this.toolbar.show()}},hideToolbar:function(){return this.isToolbarShown=!1,this.toolbar.hide()},_toolbarItems:function(t){var e=[];return e.push({icon:this._icons.getIcon("edit").id,label:o.get("toolbarActionEditTitle"),name:"rename",type:"Button",action:this.editViewTitle.bind(this,t)}),e.push({icon:this._icons.getIcon("dashboard-duplicate").id,label:o.get("duplicate"),name:"duplicate",type:"Button",action:this.duplicateTab.bind(this,t.id)}),"disabled"!==this.config.changeTabTemplate&&e.push({icon:this._icons.getIcon("template").id,label:o.get("changeTemplate"),name:"changeTemplate",type:"Button",disabled:"NoTemplate"===t.templateName,action:this.selectTemplate.bind(this,t.id)}),e},add:function(t,i){for(var o=this,n=t.model,r=this.consumeView.tabWidget.state.tabs,a=void 0,s=!0,d=0;d1},_getDefaultViewLabel:function(){for(var t=this.model.items.length,e=1;e0&&this.model.items[0].templateName||"NoTemplate";r.selectLayout(h),n.open()},_setDefaultLayoutPositioning:function(){var t=this.model.getValueFromSelfOrParent("layoutPositioning")||"relative",e=this.model.findDescendantsWithType("genericPage"),i=Array.isArray(e),o=0;for(e=i?e:e[Symbol.iterator]();;){var n;if(i){if(o>=e.length)break;n=e[o++]}else{if((o=e.next()).done)break;n=o.value}n.layoutPositioning=t}},editViewTitle:function(t){var e=this;this.hideToolbar().then((function(){e.consumeView.tabWidget.editTabLabel(!0,t)}))},_addBoardLayout:function(t){(t=t||{type:"absolute"}).title=this._getDefaultViewLabel(),t.localizedProps=["title"];var e={spec:t,containerId:this.model.id};this.consumeView.canvas.addContent(e)},_updateTemplateDropZones:function(t,e){this.model.boardModel.updateLayoutDropZones({id:t,model:e})},removeChild:function(t){var i=this;if(t){t.model.off("change:title");var o=t.model,n=this.consumeView.tabWidget.state.tabs,r=!1,a=[],s=void 0;if(n.forEach((function(t,e){i.consumeView._getModelIdFromPanel(t.props.id)===o.id?(r=!0,s=e):a.push(t)})),r){var d={tabs:a};if(this.consumeView._getViewId(o)===this.consumeView._currentViewId){var h=Math.max(s-1,0);d.selectedTab=this.consumeView._getPanelId(this.model.items[h].id)}this.consumeView.tabWidget.setState(d)}var u="#"+t.domNode.parentNode.id;e(u).remove(),l.inherited("removeChild",this,arguments),!0!==this.consumeView.tabWidget.state.deleteable||this.allowTabDeletion()||this.consumeView.tabWidget.setState({deleteable:!1})}},_invokeLifeCycleHandlers:function(t,e){return this.services.getSvc(".LifeCycleManager").then((function(i){return i.invokeLifeCycleHandlers(t,e)}))}})})),define("dashboard-core/js/dashboard/layout/authoring/views/Group",["./Absolute","../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","jquery"],(function(t,e,i){var o=null;return o=t.extend({init:function(){o.inherited("init",this,arguments),this.specializeConsumeView(["onResize","onResizeStep","onSelect","onDeselect","getWidgetPositionUpdate","getMinimumTop","getMinimumLeft","getMaximumHeight","getMaximumWidth"])},createDropZone:function(){},getFirstNonGroupAncestorView:function(){var t=i(this.domNode).parents(".pagegroup");return(t.length>0?t[t.length-1]:this.domNode)._layout.parentLayout},onSelect:function(){for(var t,e=this.model.items,i=0;i
'+n.get("dropZoneLabel")+"
"),this.centerDrop.hide(),this.$el.append(this.centerDrop));var e=this.centerDrop.find(".dropIcon");this._dndManager.addDropTarget(e[0],{accepts:this.accepts.bind(this),onDrop:this.onCentreDrop.bind(this),onDragEnter:this.onCentreDragEnter.bind(this),onDragLeave:this.onCentreDragLeave.bind(this),priority:-100}),this._dndManager.addDropTarget(this.domNode,{accepts:function(){return!1},onDragEnter:this.onDragZoneEnter.bind(this),onDragLeave:this.onDragZoneLeave.bind(this),onDrop:this.onDropZoneDrop.bind(this),receiveEventsWhenNotAccepting:!0,priority:-99}),this._setupGlassDroppables(e),this.whenIsReadyDfd.resolve()},whenIsReady:function(){return this.whenIsReadyDfd.promise},_setupGlassDroppables:function(t){if(this.$el.glassDroppableV2){var e=this;t.glassDroppableV2({onDrop:this._onPinDrop.bind(this),onEnter:this.onGlassCentreDragEnter.bind(this),onLeave:this.onCentreDragLeave.bind(this),allowOnDropPropagation:!1}),this.$el.glassDroppableV2({onEnter:function(){this.id===e.$el[0].id&&e.onDragZoneEnter()},onLeave:function(){this.id===e.$el[0].id&&e.onDragZoneLeave()},onDrop:function(){return e.onDropZoneDrop(),!0},allowOnDropPropagation:!0})}},_showCenterDrop:function(t,e){var i=null;if(e){var o=t.nodeInfoList[0].node._layout;o&&(i=o.model.id)}(!this.hasMaximizedWidget()||i&&this.isWidgetMaximized(i))&&this.centerDrop.show()},onDragZoneEnter:function(t){this.inDropZone=!0;var e=t&&t.data||{},i=!e.nodeInfoList,o=e.nodeInfoList&&1===e.nodeInfoList.length;if(i||o){this._showCenterDrop(e,o);var n=this._dndManager.getDropTargetFromNode(this.centerDrop.find(".dropIcon")[0]);this._dndManager.reassessDropTarget(n)}},onDragZoneLeave:function(){this.centerDrop.hasClass("active")||this.centerDrop.hide(),this.inDropZone=!1},onDropZoneDrop:function(){this.deactivateAndhideCenterDropZone(),this.inDropZone=!1},deactivateAndhideCenterDropZone:function(){this.centerDrop&&(this.centerDrop.removeClass("active"),this.centerDrop.hide())},destroy:function(){this._dndManager&&(this._dndManager.removeDropTarget(this.centerDrop.find(".dropIcon")[0]),this._dndManager.removeDropTarget(this.domNode),this._dndManager=null),this.centerDrop.remove(),this.centerDrop=null,this.$el.parent().find(".pagetemplateDropZone")<=1&&this.$el.parent().removeClass("templateDropZoneContainer"),t.glassdnd&&t.glassdnd.cancelDroppable&&t.glassdnd.cancelDroppable(this.$el),d.inherited("destroy",this,arguments)},accepts:function(t){return this.dashboardApi.getFeature("CanvasDnD").accepts(t,{fromTemplate:!0})},onCentreDragEnter:function(){this.centerDrop.addClass("active")},onGlassCentreDragEnter:function(){this.centerDrop.show(),this.centerDrop.addClass("active")},onCentreDragLeave:function(){this.centerDrop.removeClass("active"),this.inDropZone||this.centerDrop.hide()},onCentreDrop:function(t){var e=this,i=Promise.resolve();return"move"===t.data.operation?i=Promise.resolve(this._moveDrop(t)):"pin"===t.type&&"new"===t.data.operation?i=Promise.resolve(this._onPinDrop(t)):"new"!==t.data.operation&&"MODEL_ITEM"!==t.type&&"GRID_HEADER_ITEM"!==t.type||(i=this._newDrop(t)),i.then((function(){return e.deactivateAndhideCenterDropZone()}))},_moveDrop:function(t){for(var e,i,o=[],n=0;n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'}})})),define("dashboard-core/js/dashboard/layout/authoring/views/TemplateContainer",["jquery","./Absolute"],(function(t,e){var i=null;return i=e.extend({init:function(){i.inherited("init",this,arguments),this.scrollPosition={top:this.domNode.scrollTop,left:this.domNode.scrollLeft},this.$el.on("scroll."+this.id,this._onScroll.bind(this))},destroy:function(){i.inherited("destroy",this,arguments),this.$el.off("scroll."+this.id)},createDropZone:function(){},_onScroll:function(){var t=this.domNode.scrollTop,e=this.domNode.scrollLeft;this._dndManager.scrollChildrenCandidateDropTargets(this.domNode,this.scrollPosition.top-t,this.scrollPosition.left-e),this.scrollPosition.top=t,this.scrollPosition.left=e},_getTemplateLayoutView:function(){var e=null;if(this.model.items&&this.model.items.length>0){var i=this.model.items[0];e=t("#"+this.layoutController.modelIdToNodeId(i.id),this.layoutController.$el)[0]._layout}return e},_addWidget:function(t,e){var i=this._getTemplateLayoutView();if(i){t.parentId=i.model.id;var o=parseInt(t.layoutProperties.style.top,10),n=parseInt(t.layoutProperties.style.left,10),r=i.$el.position(),a=o-r.top-this.domNode.scrollTop,s=n-r.left-this.domNode.scrollLeft;t.layoutProperties.style.top=Math.round(Math.max(a,i.getMinimumTop()))+"px",t.layoutProperties.style.left=Math.round(Math.max(s,i.getMinimumLeft()))+"px",i.authorHelper._addWidget(t,e)}},setPreferredLocation:function(t){var e=this._getTemplateLayoutView();e&&e.setPreferredLocation&&e.setPreferredLocation(t)}})})),define("dashboard-core/js/dashboard/layout/authoring/views/TemplateIndicator",["./Absolute","../../../../lib/@waca/core-client/js/core-client/utils/Deferred"],(function(t,e){var i=null;return i=t.extend({init:function(t){i.inherited("init",this,arguments),this.services=t.services,this.specializeConsumeView(["setPreferredLocation"]),this.$el.parent().addClass("templateDropZoneContainer"),this.whenIsReadyDfd=new e,this.whenIsReadyDfd.resolve()},_initialize:function(){},destroy:function(){this.$el.parent().removeClass("templateDropZoneContainer"),i.inherited("destroy",this,arguments)},setPreferredLocation:function(t){var e=this.model.getParent().id;i.inherited("setPreferredLocation",this,arguments),t.parentId=e},getWidgetContainerNode:function(){return this.domNode.parentNode}})})),define("dashboard-core/js/dashboard/layout/authoring/TemplateHelper",["jquery"],(function(t){return function(){function e(t){if(_classCallCheck(this,e),this._model=t.model,this._layoutController=t.layoutController,this._model.on("insert:item",this._onNewItem,this),this._model.on("remove:item",this._onRemoveItem,this),this._model.items)for(var i=0;i0&&(i[0]._layout.setPreferredLocation(t),e=!0),e},e.prototype._setChildMonitors=function(t,e){var i="off"===e?"off":"on";t[i]("change:style",this._onChildModelStyleChange,this),t[i]("change:parent",this._onChildModelUpdateParent,this)},e.prototype._onNewItem=function(t){var e=this._model.findModel(t.value.parameter.model.id);this._setChildMonitors(e),this._updateDropZonesState(e,t.data)},e.prototype._onRemoveItem=function(t){for(var e=this._layoutController.getLayoutView(t.modelId).$el.children(".pagetemplateDropZone"),i=t.value.parameter,o=0;o100&&(i=100-o),i},_updateInputProperty:function(t,e){this.ignoreOnChange=!0,t.setValue(e),t.onChangeValueHold=e,this.ignoreOnChange=!1},getUnitsFromValue:function(t){return t.replace(/[\d.-]/g,"")},getValueString:function(t,e){return String(Number(t.toFixed("px"===e?0:2)))+" "+e},changeProperty:function(t,e){if(t.ignoreOnChange)t.ignoreOnChange=!1;else{var i=parseFloat(this.getValue());if(isNaN(i))t._updateInputProperty(this,this.onChangeValueHold);else{i=t._processChange.apply(t,[e,i,this.units]);var o=t.getValueString(i,this.units);t._updateInputProperty(this,o)}}},wrapChangeProperty:function(){var t=this;return function(){var e=[t].concat(Array.prototype.slice.call(arguments));t.changeProperty.apply(this,e)}},_getValuesForProperties:function(t){var e=this;if(t.forEach((function(t){t.value=t.getProp(e.propertyNodes[0])})),this.propertyNodes.length>1)for(var i=function(i){return t.forEach((function(t){t.break||t.getProp(e.propertyNodes[i])!==t.value&&(t.value="",t.break=!0)})),"break"},o=1;o\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t
\n\n'})),define("text!dashboard-core/js/dashboard/layout/authoring/interaction/LayoutIndicator.html",[],(function(){return'
\n\t
\n\t\t\n\t
\n
\n'})),define("dashboard-core/js/dashboard/layout/authoring/interaction/LayoutIndicator",["doT","../../../../lib/@waca/core-client/js/core-client/ui/core/View","../../../../lib/@waca/core-client/js/core-client/utils/Deferred","jquery","text!./LayoutIndicator.html"],(function(t,e,i,o,n){var r=null;return r=e.extend({OFFSET:30,init:function(t){r.inherited("init",this,arguments),this.$node=t.node},render:function(){var e=t.template(n)();this.$el=o(e),this.$node.prepend(this.$el),this.$node.is("body")?this.containerSize={width:o(window).width(),height:o(window).height()}:this.containerSize={width:this.$node.width(),height:this.$node.height()},this.$content=o(this.$el.find(".layoutDashboardIndicatorText")[0])},updatePosition:function(t){var e,i,o=0,n=0,r=this.$node.scrollLeft(),a=this.$node.scrollTop(),s=t.left+r,d=t.top+a;e=this.containerSize.width-this.$el.width()-50,i=this.containerSize.height-this.$el.height(),e-t.left<0&&(o=e-t.left),i-t.top<0&&(n=i-t.top);var l=s+this.OFFSET+o;l=l>r?l+"px":r+"px";var h=d+this.OFFSET+n;h=h>a?h+"px":a+"px",this.$el.css({top:h,left:l})},updateContent:function(t){this.$content.text(t)},remove:function(){this.$el.remove()},show:function(){this.$el.show()},hide:function(){this.$el.hide()}})})),define("dashboard-core/js/dashboard/layout/authoring/interaction/LayoutGuidelines",["jquery","underscore","../../../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(t,e,i){return i.extend({THRESHOLD:5,setup:function(i,o,n){this._aGuidelines=[],this.snapGuidelines=n,this.domNode=i;var r=t(this.domNode);e.each(r.children(".widget,.pagegroup,.pagetemplateDropZone"),function(e){if(!(o&&o.dragBox&&o.dragBox.ids.indexOf(e.id)>-1)){var n,r,a=t(e),s=a.position(),d=a.is(".pagetemplateDropZone");n=a.outerHeight(),r=a.outerWidth();var l=Math.round(s.left+i.scrollLeft+0),h=Math.round(l+r),u=Math.round(s.top+i.scrollTop+0),c=Math.round(u+n);this._addGuideline("x",l,u,c,d?"left":null),this._addGuideline("x",h,u,c,d?"right":null),this._addGuideline("x",(l+h)/2,u,c),this._addGuideline("y",u,l,h,d?"top":null),this._addGuideline("y",c,l,h,d?"bottom":null),this._addGuideline("y",(u+c)/2,l,h)}}.bind(this)),this._addGuideline("x",i.scrollWidth/2),this._addGuideline("y",i.scrollHeight/2)},_addGuideline:function(e,i,o,n,r){var a=t(this.domNode),s=this.domNode.scrollHeight-10+"px",d=this.domNode.scrollWidth-10+"px",l="x"===e?{left:i+"px",height:s}:{top:i+"px",width:d},h=t('
'),u=t('
');if(void 0!==o&&h.css("x"===e?"top":"left",o-5+"px"),void 0!==n){var c={bottom:"auto",right:"auto"};c["x"===e?"top":"left"]=n-5+"px",u.css(c)}var p=t('
').css(l).append(h).append(u),g={};r&&(g.restricted=r),g[e]=i,g["axis_"+e]=p,this._aGuidelines.push(g),a.append(p)},calculateSnapPoint:function(t,e){var i=null,o={};this._aGuidelines&&this.snapGuidelines&&this._aGuidelines.forEach(function(n){!isNaN(Math.abs(t-n[e]))&&Math.abs(t-n[e])Math.abs(t-n[e]))&&(i=t-n[e],o=n):n[e]&&Math.abs(t-n[e])this.gridSize-.5&&(e=0),{distance:e}}return{distance:null}}})})),define("dashboard-core/js/dashboard/layout/authoring/interaction/GuidelineManager",["jquery","underscore","../../../../lib/@waca/core-client/js/core-client/ui/core/Class","./LayoutGuidelines","./GridGuidelines"],(function(t,e,i,o,n){return i.extend({LayoutGuidelines:{},init:function(t){this.layoutController=t.layoutController,this.layoutGuidelines=new o},getReady:function(t,e,i){this.domNode=t,this.snapContributions=[];var o=this.layoutController.boardModel.layout.findModel(t.id);o||(o=this.layoutController.boardModel.layout);var r=o.getValueFromSelfOrParent("snapObjects");r=void 0===r||r,this.gridGuidelines=new n({page:t,controller:this.layoutController}),i||(this.layoutGuidelines.setup(t,e,r),this.snapContributions.push(this.layoutGuidelines)),this.snapContributions.push(this.gridGuidelines)},finish:function(){t(this.domNode).children(".guideline").remove(),this.domNode=null},getSnapCoordinates:function(t){var e={top:null,right:null,bottom:null,left:null},i=[],o=[],n=[],r=[];return this.snapContributions&&this.snapContributions.forEach(function(e){i.push(e.calculateSnapPoint(t.right,"x")),o.push(e.calculateSnapPoint(t.left,"x")),n.push(e.calculateSnapPoint(t.top,"y")),r.push(e.calculateSnapPoint(t.bottom,"y"))}.bind(this)),e.right=this._calculateClosestSnapPoint(i,"x"),e.left=this._calculateClosestSnapPoint(o,"x"),e.top=this._calculateClosestSnapPoint(n,"y"),e.bottom=this._calculateClosestSnapPoint(r,"y"),e},_calculateClosestSnapPoint:function(t){var e=null;return t.forEach(function(t){t.distance&&e?e.distance>Math.abs(t.distance)&&(e=t):t.distance&&!e&&(e=t)}.bind(this)),e&&e.distance?(e.show&&e.show(),e.distance):e},hideAll:function(){t(this.domNode).children(".guideline").hide()}})})),define("dashboard-core/js/dashboard/layout/authoring/interaction/Move",["./BaseStylePropertyAction","../../../../lib/@waca/core-client/js/core-client/utils/Deferred","jquery","doT","../EventHelper","../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","../../../../lib/@waca/core-client/js/core-client/ui/KeyCodes","../../../../app/util/ScreenReaderUtil","../../../../app/nls/StringResources","text!./MoveEdges.html","./LayoutIndicator","./GuidelineManager","../../../util/PxPercentUtil","../../../../lib/@waca/core-client/js/core-client/i18n/Formatter","../../../../lib/@waca/dashboard-common/dist/utils/EventChainLocal","underscore","bspopover"],(function(t,e,i,o,n,r,a,s,d,l,h,u,c,p,g,f){var v=null;return v=t.extend({_savedSelectedNodes:null,init:function(t){var i=this;v.inherited("init",this,arguments),this.controller=t,this.isDragging=!1,this._isTouch=!1,this.dropInfo={},this._guidelineManager=new u({layoutController:t.layoutController}),this._ScreenReader=new s,this.whenIsReadyDfd=new e,this._createAvatarContainer(),this._layoutIndicator=new h({node:this._$avatarContainer}),this._initialize(),this._updateLayoutIndicatorContent=f.throttle((function(t,e,o,n,r){var a=o.node;if(a&&a._layout&&a._layout.layoutController){var s=r.dropTargetNode,d=a._layout.layoutController.getLayoutContentContainerForDropTarget(s),l=i._convertCoordinates(e,t.clientX-e.offsetx-n.x,t.clientY-e.offsety-n.y,d),h=i._formatPosition(a,l,d);i._layoutIndicator.updateContent("x: "+h.left+" y: "+h.top)}}),250)},_createAvatarContainer:function(){this._$avatarContainer=i("body").children(".avatarContainer.avatarContainerNotDragging"),0===this._$avatarContainer.length&&(this._$avatarContainer=i('
'),i("body").append(this._$avatarContainer))},getAvatarContainer:function(){return this._$avatarContainer},whenIsReady:function(){return this.whenIsReadyDfd.promise},_initialize:function(){this._dndManager=this.controller.dashboardApi.getFeature("DashboardDnd.internal"),this.whenIsReadyDfd.resolve()},destroy:function(){this._dndManager&&(this._dndManager.resetDragging(),this._dndManager=null),this.resetDraggingState(),this._ScreenReader.destroy(),this._iKeyPressTimer&&clearTimeout(this._iKeyPressTimer),this._$avatarContainer.empty()},setupStartEventHandlers:function(){for(var t,e=this.dragStartMouseEvent.bind(this),i=this.initiateDragging.bind(this),o=this.onDragStart.bind(this),r=0;r0&&this.initiateDragging(e),t.length>0?this.controller.$el.on("keydown.interactionMoveKey",this.arrowKeyPress.bind(this)):this.controller.$el.off("keydown.interactionMoveKey"),this.addMoveHandle(t)},addMoveHandle:function(t){var e=this.controller.dashboardApi.getFeature("Icons").getIcon("move"),n=o.template(l)({moveIcon:e.id});i(t).append(n).find(".moveHandle").attr("title",d.get("moveHandle"))},saveNodeInfo:function(){for(var t=0,e=this.dropInfo.nodeInfoList.length;t0;return!(t.shiftKey||e.hasClass("inlineText")||e.parents().hasClass("widgetFocus")||n.getProperty("preventMoveAction")||o)&&r}return!1},_calculateInitDeltasForArrowKeyPress:function(t){var e=0,i=0,o="",n=!1;switch(t.keyCode){case a.LEFT_ARROW:i=-1,o=d.get("srWidgetMoveLeft");break;case a.UP_ARROW:e=-1,o=d.get("srWidgetMoveUp");break;case a.RIGHT_ARROW:i=1,o=d.get("srWidgetMoveRight"),n=!0;break;case a.DOWN_ARROW:e=1,o=d.get("srWidgetMoveDown"),n=!0}return{iDeltaTop:e,iDeltaLeft:i,farEdge:n,sMessage:o}},_calculatePositionUpdateForNodeWhenArrowKeyPress:function(t,e,o){var n=e.iDeltaTop,r=e.iDeltaLeft,a=e.farEdge,s={left:parseInt(i(t).css("left")),top:parseInt(i(t).css("top"))},d=0,l=0,h={top:s.top,left:s.left,right:s.left+t.clientWidth,bottom:s.top+t.clientHeight},u=o.node._layout.layoutController.getLayoutContentContainer();this._guidelineManager.getReady(u,h,!0);var c=this._getNewCoordinates(h),p=this.getRevisedOffsets(c);return this._guidelineManager.gridGuidelines&&this._guidelineManager.gridGuidelines.snapGrid?(a&&(p.x=this._guidelineManager.gridGuidelines.gridSize-p.x,p.y=this._guidelineManager.gridGuidelines.gridSize-p.y),p.x<=1&&(p.x=0),p.y<=1&&(p.y=0),p.x=null===p.x||0===p.x?this._guidelineManager.gridGuidelines.gridSize:p.x,p.y=null===p.y||0===p.y?this._guidelineManager.gridGuidelines.gridSize:p.y,d=r*p.x,l=n*p.y):(d=r,l=n),o.dropPosition={x:s.left+d,y:s.top+l,before:o.oldValues.nextSibling},o.node._layout.parentLayout.getWidgetPositionUpdate(o)},_updateModelAfterArrowKeyPress:function(t,e){clearTimeout(this._iKeyPressTimer),this._iKeyPressTimer=setTimeout(function(){this.emit("move:end",{currentSelection:this.selectedNodes}),this.updateModel(t),this.refreshProperties(),this._ScreenReader.callOut(e)}.bind(this),500)},_moveNodesForArrowKeyPress:function(t){for(var e=[],i=[],o=this._calculateInitDeltasForArrowKeyPress(t),n=0,r=this.dropInfo.nodeInfoList.length;n0&&(this._showingLayoutIndicator=!1,setTimeout((function(){o._layoutIndicator.render(),o._layoutIndicator.show(),o._showingLayoutIndicator=!0}),150))}var v=this._preMoveNode(this.dropInfo.dragBoxSize,e,t,this.dropInfo.nodeInfoList[0]);for(a=0,s=this.dropInfo.nodeInfoList.length;ai.bottom&&(i.bottom=n.position.bottom),n.position.right>i.right&&(i.right=n.position.right)}return i.width=i.right-i.left,i.height=i.bottom-i.top,i},_preMoveNode:function(t,e,o,n){var r={x:0,y:0};if(e.dropTargetNode&&n.node._layout){e.dropTargetNodeOffset=i(e.dropTargetNode).offset();var a=this._convertCoordinates(t,o.clientX-t.offsetx,o.clientY-t.offsety,e.dropTargetNode,e.dropTargetNodeOffset),s=this._getNewCoordinates(a);r=this.getRevisedOffsets(s)}return this._showingLayoutIndicator&&n.node._layout&&(this._layoutIndicator.updatePosition({top:o.clientY,left:o.clientX}),this._updateLayoutIndicatorContent(o,t,n,r,e)),r},prepareDropInfo:function(){},prepareNodeForMove:function(t){return t},postNodeForMove:function(){},getSelectedDomNodes:function(){var t,e,i,o=[];for(t=0,e=this.dropInfo.nodeInfoList.length;t-1;)t.oldValues.nextSibling=t.oldValues.nextSibling.nextSibling},moveByProperty:function(t,e,i){var o=e,n="left"===t?"width":"height",r=this._getParentDim(n,this.propertyNodes),a=this._getWidgetOffset(n,this.propertyNodes);if(a+=this._getWidgetSize(n,this.propertyNodes),"px"===i){var s="left"===t?this.propertyNodes[0]._layout.parentLayout.getMinimumLeft:this.propertyNodes[0]._layout.parentLayout.getMinimumTop;o=Math.max(s(),o),o=Math.min(r-a,o)}else o=this._sanitizePercentSizeOnPage(o,n);var d=o+i,l=[];return this.propertyNodes.forEach((function(e){var i={};i[t]=d,l.push({style:i,id:e._layout.model.id})})),this.updateModel(l),o},_processChange:function(t,e,i){return this.moveByProperty("left"===t?"left":"top",e,i)},getProperties:function(){v.inherited("getProperties",this,arguments);var t=this.getUnitsFromValue(this.propertyNodes[0]._layout.model.style.left),e=[{units:t,getProp:function(t){return t._layout.model.style.left}},{units:t,getProp:function(t){return t._layout.model.style.top}}];this._getValuesForProperties(e);var i=[{type:"SectionLabel",label:d.get("propPositionLabel"),tabName:d.get("tabName_general"),sectionName:d.get("sectionName_layout"),sectionOpened:!0,order:20},{type:"Split",name:"moveWidgetSplit",id:"moveWidgetSplit",tabName:d.get("tabName_general"),sectionName:d.get("sectionName_layout"),order:21,items:[{align:"left",items:[{type:"InputLabel",label:d.get("propPositionXAxis"),name:"left",id:"left",tabName:d.get("tabName_general"),sectionName:d.get("sectionName_layout"),readOnly:!1,value:e[0].value,onChangeValueHold:e[0].value,multiline:!0,handleReturnKey:!0,units:t,onChange:this.wrapChangeProperty()}]},{align:"right",items:[{type:"InputLabel",label:d.get("propPositionYAxis"),name:"top",id:"top",tabName:d.get("tabName_general"),sectionName:d.get("sectionName_layout"),readOnly:!1,value:e[1].value,onChangeValueHold:e[1].value,multiline:!0,handleReturnKey:!0,units:t,onChange:this.wrapChangeProperty()}]}]}];return this.showStyleProperties(this.propertyNodes[0])?i:[]}})})),define("dashboard-core/js/dashboard/layout/authoring/interaction/MoveWidgets",["./Move","../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","jquery","../../../../lib/@waca/core-client/js/core-client/utils/BrowserUtils"],(function(t,e,i,o){var n=t.extend({init:function(){n.inherited("init",this,arguments),this.isIE=o.isIE()},getDragDataType:function(){return"widget"},handleDrop:function(t){t.isDropped||this.restoreOriginalPosition(),t.dragObject&&i(t.dragObject.data.nodeInfoList[0].node).parent().css("overflow","visible")},restoreOriginalPosition:function(){for(var t,e=this.dropInfo.nodeInfoList,i=0,o=e.length;i12}});return n})),define("dashboard-core/js/dashboard/layout/authoring/interaction/MoveGroupContent",["./Move","jquery"],(function(t,e){var i=null;return i=t.extend({init:function(){i.inherited("init",this,arguments)},getDragDataType:function(){return"groupContent"},handleDrop:function(){for(var t,i,o=[],n=0,r=this.dropInfo.nodeInfoList.length;n\n\t
\n
\n
\n\t
\n
\n
\n\t
\n
\n
\n\t
\n
\n
\n\t
\n
\n
\n\t
\n\t\t{{?it.isMobile}}\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t\t{{?}}\n\t
\n
\n
\n\t
\n\t\t{{?it.isMobile}}\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t\t{{?}}\n\t
\n
\n
\n\t
\n
\n
\n
\n
\n
\n{{?it.rotateHandle}}\n
\n\t
\n
\n
\n\t
\n
\n
\n\t
\n
\n
\n\t
\n
\n{{?}}\n'})),define("text!dashboard-core/js/dashboard/layout/authoring/interaction/SizeIndicator.html",[],(function(){return'
\n\t
\n\t\t

\n\t\t\n\t\t

\n\t
\n
\n'})),define("dashboard-core/js/dashboard/layout/authoring/interaction/SizeIndicator",["doT","../../../../lib/@waca/core-client/js/core-client/ui/core/View","../../../../lib/@waca/core-client/js/core-client/utils/Deferred","jquery","text!./SizeIndicator.html"],(function(t,e,i,o,n){var r=null;return r=e.extend({OFFSET:25,init:function(t){r.inherited("init",this,arguments),this.$node=t.node},render:function(){var e=t.template(n)();this.$el=o(e),this.$node.prepend(this.$el),this.$content=o(this.$el.find(".sizeDashboardIndicatorText")[0])},updatePosition:function(t,e,i){var o,n;o=t.top+this.$node.scrollTop()-e.top,n=t.left+this.$node.scrollLeft()-e.left,o-this.OFFSET>=0?i?(this.$el.addClass("vertical"),this.$el.css({top:o,left:n+t.width+this.OFFSET})):this.$el.css({top:o-this.OFFSET,left:n}):i?n>=0?(this.$el.addClass("vertical"),this.$el.css({top:o,left:n+t.width+this.OFFSET})):this.$el.hide():this.$el.css({top:o+t.height+this.OFFSET/2,left:n})},updateContent:function(t,e){this.$content.text(e),this.$el.width(t)},remove:function(){this.$el.remove()},show:function(){this.$el.show()},hide:function(){this.$el.hide()}})})),define("dashboard-core/js/dashboard/layout/authoring/interaction/Resize",["./BaseStylePropertyAction","jquery","../EventHelper","../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","./GuidelineManager","underscore","text!./ResizeEdges.html","../../../../app/util/ScreenReaderUtil","../../../../app/nls/StringResources","doT","../../../../lib/@waca/core-client/js/core-client/utils/BrowserUtils","../../../../lib/@waca/core-client/js/core-client/i18n/Formatter","./LayoutIndicator","./SizeIndicator","../../../util/PxPercentUtil","bspopover"],(function(t,e,i,o,n,r,a,s,d,l,h,u,c,p,g){var f={"dashboard-core/js/dashboard/widgets/staticwidget/TextWidget":{minWidth:100,minHeight:40},default:{minWidth:25,minHeight:25}},v=t.extend({sizeIndicators:[],containerOffset:0,init:function(t){this.controller=t,v.inherited("init",this,arguments),this.dashboardApi=t.dashboardApi,this._isTouch=!1,this.resizingEvents=[],this._guidelineManager=new n({layoutController:t.layoutController}),this._ScreenReader=new s,this._observerUpdateDelay=null,this._observer=new window.MutationObserver(this.rotationMutationObserver.bind(this)),this._focusModeDisabled=t.config&&t.config.focusModeDisabled},destroy:function(){this._ScreenReader.destroy(),v.inherited("destroy",this,arguments)},addPositionIndicator:function(){this._layoutIndicator.render()},updatePositionIndicator:function(t,e){var i;this._layoutIndicator.updatePosition(t),i=d.get("widthUnit")+": "+e.width+" "+d.get("heightUnit")+": "+e.height,this._layoutIndicator.updateContent(i)},updatePositionIndicatorRotate:function(t,e){e<0&&(e+=360);var i;this._layoutIndicator.updatePosition(t),i=u.formatNumber(String(e.toFixed(1)))+"Ëš",this._layoutIndicator.updateContent(i)},removePositionIndicator:function(){this._layoutIndicator.remove()},newSelection:function(t){this.resizeStopEvent(),this.selectedNodes&&(this.removeResizeBorders(this.selectedNodes),this._destroyResizeIndicators(),this._layoutIndicator&&this._layoutIndicator.remove()),this.selectedNodes=t,t.length>0?this.controller.$el.on("keydown.interactionResizeKey",this.resizeRotateKeyPress.bind(this)):this.controller.$el.off("keydown.interactionResizeKey"),this.addResizeBorders(t),this.addResizeIndicators(t)},_iKeyPressTimer:null,resizeRotateKeyPress:function(t){var e=this;if(t.shiftKey&&(!t.target||"inlineText"!==t.target.className)){var i=this._getNodesForResize();if(!t.altKey||(i=i.filter((function(t){return!e.preventRotate(t)}))).length){var n,r,a,s=0,l=0,h=0,u="",c="";switch(t.keyCode){case 37:s=-1,h=-1,u=d.get("srWidgetResizeSmallerH"),c=d.get("srWidgetRotateCCW");break;case 38:l=-1,h=-1,u=d.get("srWidgetResizeSmallerV"),c=d.get("srWidgetRotateCCW");break;case 39:s=1,h=1,u=d.get("srWidgetResizeBiggerH"),c=d.get("srWidgetRotateCW");break;case 40:l=1,h=1,u=d.get("srWidgetResizeBiggerV"),c=d.get("srWidgetRotateCW");break;default:return}this.emit("resize:start",{currentSelection:this.selectedNodes});var p={},g=[],v="";return i.forEach((function(i){var y=0,m=0;if(t.altKey)a=Math.round(o.getAngleDegree(i)+h),p={rotateAngle:a},o.setRotateTransform(i,a),v=c;else{t.ctrlKey&&(l=s=s||l,u=d.get(s>0?"srWidgetResizeBigger":"srWidgetResizeSmaller"));var b=e._getParentGenericPage(i.id),_={top:i.offsetTop,left:i.offsetLeft,right:i.offsetLeft+i.clientWidth,bottom:i.offsetTop+i.clientHeight};e._guidelineManager.getReady(b.domNode,_,!0);var w=e._guidelineManager.getSnapCoordinates(_),C={};e._guidelineManager.gridGuidelines.snapGrid?(C.x=e._guidelineManager.gridGuidelines.gridSize-w.right,C.y=e._guidelineManager.gridGuidelines.gridSize-w.bottom,C.x<.5&&(C.x=0),C.y<.5&&(C.y=0),C.x=null===C.x||0===C.x?e._guidelineManager.gridGuidelines.gridSize:C.x,C.y=null===C.y||0===C.y?e._guidelineManager.gridGuidelines.gridSize:C.y,y=s*C.x,m=l*C.y):(y=s,m=l);var I=o.widgetSize(i);if(n=I.width+y,r=I.height+m,n=1){var a=this._getParentGenericPage(i.id);this._layoutIndicator=new c({node:a.$el}),this.addPositionIndicator(),this._layoutIndicator.hide()}e(i).addClass("nodeResizing"),this.saveOldValues(i)}this.lastBox=this._getDragBox(n),this.emit("resize:start",{currentSelection:this.selectedNodes})},redrawResizeBorders:function(t){(t=t||{}).nodes&&(this.removeResizeBorders(t.nodes),this.addResizeBorders(t.nodes))},_findScrollableParent:function(t){var i=null;if(t){var o=e(t.domNode).css("overflow");i="auto"===o||"scroll"===o?t.domNode:this._findScrollableParent(t.parentLayout)}return i},_getScrollInfo:function(){var t=null,i=this._findScrollableParent(this._getParentLayout());if(i){var o=e(i),n=o.height(),r=o.width(),a=o.offset();t={left:a.left,top:a.top,position:o.position(),h:n,w:r,scrollTop:o.scrollTop(),scrollLeft:o.scrollLeft(),$node:o}}return t},_getNodesForResize:function(){return this.nResizeEdge&&this.nResizeEdge.parentNode&&this.nResizeEdge.parentNode._isTopResizeParent?[this.nResizeEdge.parentNode]:this.selectedNodes.filter((function(t){return!t._isTopResizeParent}))},_getParentGenericPage:function(t){var e=this.controller.layout.findTopLevelParentItem(t),i="genericPage"===e.type?[e]:e.findDescendantsWithType("genericPage");return i.length?this.controller.layoutController.getLayoutView(i[0].id):null},saveOldValues:function(t){var i=o.position(t),n=o.widgetSize(t);if(t._oldValues={height:n.height,width:n.width,top:i.top,left:i.left,rotateAngle:o.getAngleDegree(t)},e(t).is(".pagegroup"))for(var r=o.getContentWithoutDecoration(t),a=0,s=r.length;a=o&&(i<=0&&(i=3,t.clientY=e.top+this.lastBox.bottom-1),t.clientY+=i),i},adjustXOrdinate:function(t,e){var i=this.lastClientX-t.clientX;this.lastClientX=t.clientX;var o=e.left+e.w;t.clientX>o&&(i<=0&&(i=3,t.clientX=e.left+this.lastBox.right),t.clientX+=i)},_canResize:function(t){return this.lastClientX!==t.clientX||this.lastClientY!==t.clientY},resizeMoveEvent:function(t){if(this._canResize(t)){var i=this._getScrollInfo();i&&(this.adjustYOrdinate(t,i),this.adjustXOrdinate(t,i)),this.applyResize(t);for(var o,n=this._getNodesForResize(),r=0,a=n.length;r-1&&t.shiftKey||n&&i.is(".bottomRight")?this.scale(t,o):i.is(".rotateEdge")||n&&i.is(".bottomLeft")?this.rotate(t):this.resizeFromEdge(t)}},_getDragBox:function(t){return t.reduce((function(t,e){var i=e.getBoundingClientRect();return t.top=Math.min(t.top,i.top),t.left=Math.min(t.left,i.left),t.bottom=Math.max(t.bottom,i.bottom),t.right=Math.max(t.right,i.right),t.ids.push(e.id),t}),{top:1/0,left:1/0,bottom:0,right:0,ids:[]})},resizeFromEdge:function(t){var e=this.nResizeEdge.parentNode,i=o.position(e),n=o.getRotatedCoordinates(e,this.resizePointCenter.left,this.resizePointCenter.top),r=o.getRotatedCoordinates(e,t.clientX,t.clientY);this.resizeSelection(n,r,i,t)},_getParentLayout:function(){return this.nResizeEdge&&this.nResizeEdge.parentNode&&this.nResizeEdge.parentNode._layout&&this.nResizeEdge.parentNode._layout.parentLayout?this.nResizeEdge.parentNode._layout.parentLayout:null},resizeSelection:function(t,e,i,o){var n=this.nResizeEdge.getAttribute("edge"),r=null,a=null,s=this._getParentLayout();if(s&&s.domNode!==this._guidelineManager.domNode){var d=this._getNodesForResize().map((function(t){return t.id}));this._guidelineManager.getReady(s.domNode,{dragBox:{ids:d}})}this._guidelineManager.hideAll();var l={top:i.top+e.y,left:i.left+e.x,bottom:i.top+e.y,right:i.left+e.x},h=this._guidelineManager.getSnapCoordinates(l);-1!==n.indexOf("b")?r=e.y-t.y-h.bottom:-1!==n.indexOf("t")&&(r=t.y-(i.top+e.y-h.top-i.top)),-1!==n.indexOf("r")?a=e.x-t.x-h.right:-1!==n.indexOf("l")&&(a=t.x-(i.left+e.x-h.left-i.left)),this.addHeightWidth(r,a,n,o)},getOppositeCornerCoords:function(t){var i={t:".br",tl:".br",r:".bl",tr:".bl",b:".tl",br:".tl",l:".tr",bl:".tr"}[this.nResizeEdge.getAttribute("edge")];i&&(i=e(t).children(i)[0]);var n=i?i.getBoundingClientRect():o.getCenter(t);return o.getRotatedCoordinates(t.parentNode,n.left,n.top)},addHeightWidth:function(t,e,i,o){var n=this._getNodesForResize(),r=this.checkHeight(n,t,i),a=this.checkWidth(n,e,i);n.length>1?this._layoutIndicator.hide():this._layoutIndicator.show();for(var s=0,d=n.length;sa&&(e=a-s)}if(e<0){t.sort((function(t,e){return t._oldValues.height-e._oldValues.height}));var d=t[0],l=f.default.minHeight;d._layout&&d._layout.widgetRegistry&&(l=f[d._layout.widgetRegistry.widget]?f[d._layout.widgetRegistry.widget].minHeight:f.default.minHeight),e=-1*Math.min(Math.abs(e),d._oldValues.height-l)}}return e},checkWidth:function(t,e,i){if(e){var o,n;if(-1!==i.indexOf("l")){t.sort((function(t,e){return t.offsetLeft-e.offsetLeft})),o=t[0];var r=(n=this._getParentView(o)).getMinimumLeft?n.getMinimumLeft():0;e=Math.min(o._oldValues.left-r,e)}if(-1!==i.indexOf("r")){t.sort((function(t,e){return t.offsetLeft+t._oldValues.width-e.offsetLeft+e._oldValues.width})),o=t[0];var a=(n=this._getParentView(o)).getMaximumWidth?n.getMaximumWidth():1/0,s=o.offsetLeft+o._oldValues.width;s+e>=a&&(e=a-s)}if(e<0){t.sort((function(t,e){return t._oldValues.width-e._oldValues.width}));var d=t[0],l=f.default.minWidth;d._layout&&d._layout.widgetRegistry&&(l=f[d._layout.widgetRegistry.widget]?f[d._layout.widgetRegistry.widget].minWidth:f.default.minWidth),e=-1*Math.min(Math.abs(e),d._oldValues.width-l)}}return e},addHeightWidthToNode:function(t,e,i,o){var n={},r=null;isNaN(i)||(r=t._oldValues.width+i);var a=null;if(isNaN(e)||(a=t._oldValues.height+e),a||r){var s=this.getOppositeCornerCoords(t);this.updateSizeValue(t,"height",a),this.updateSizeValue(t,"width",r),n=this._formatHeightWidth(t),this.updatePositionIndicator({left:o.clientX-this.containerNodeOffset.left,top:o.clientY-this.containerNodeOffset.top},n);var d=this.getOppositeCornerCoords(t);this._reAlignNode(t,s,d),this._showResizeIndicators(t,n)}t._layout&&t._layout.onResizeStep&&t._layout.onResizeStep()},_formatHeightWidth:function(t){var e={};if(t.id){var i=this._getParentGenericPage(t.id);if("relative"===t._layout.model.getValueFromSelfOrParent("layoutPositioning")){var o={height:t.getBoundingClientRect().height+"px",width:t.getBoundingClientRect().width+"px"},n={width:i.$el.width(),height:i.$el.height()};g.changePixelPropertiesToPercent(o,n,1),e.height=u.formatNumber(o.height.replace(/%/g,""))+" %",e.width=u.formatNumber(o.width.replace(/%/g,""))+" %"}else e.height=u.formatNumber(String(Number(Math.round(t.getBoundingClientRect().height))))+" "+d.get("pixelUnit"),e.width=u.formatNumber(String(Number(Math.round(t.getBoundingClientRect().width))))+" "+d.get("pixelUnit")}return e},updateSizeValue:function(t,e,i){i&&(t.style[e]=i+"px")},_reAlignNode:function(t,i,n){if(e(t).is(".pageabsolute>*, .pagegroup>*, .pagetemplateDropZone>*, .pagescalingAbsolute>*, .pagegenericPage>*")){var r=o.position(t);n.y!==i.y&&(t.style.top=r.top-n.y+i.y+"px"),n.x!==i.x&&(t.style.left=r.left-n.x+i.x+"px")}},scale:function(t,e){var i=this.nResizeEdge.parentNode,n=o.position(i),r=o.getRotatedCoordinates(i,this.resizePointCenter.left,this.resizePointCenter.top),a=o.getRotatedCoordinates(i,t.clientX,t.clientY),s=this._getParentLayout();if(s&&s.domNode!==this._guidelineManager.domNode){var d=this._getNodesForResize().map((function(t){return t.id}));this._guidelineManager.getReady(s.domNode,{dragBox:{ids:d}})}this._guidelineManager.hideAll();var l={top:n.top+a.y,left:n.left+a.x,bottom:n.top+a.y,right:n.left+a.x},h=this._guidelineManager.getSnapCoordinates(l),u=a.y-r.y-h.top;-1!==e.indexOf("t")&&(u*=-1);var c=a.x-r.x-h.left;-1!==e.indexOf("l")&&(c*=-1),this.applyScale(u,c,e,t)},applyScale:function(t,e,i,o){var n=this._getNodesForResize();t&&(t=this.checkHeight(n,t,i)),e&&(e=this.checkWidth(n,e,i));for(var r=void 0,a=0,s=n.length;ap&&(h=(l+e)/l)}else{var g=d*(h=(l+e)/l),f=u.getMaximumHeight?u.getMaximumHeight():1/0;r.offsetTop+g>f&&(h=(d+t)/d)}if(h>0){var v=this.getOppositeCornerCoords(r);r.style.height=Math.round(d*h)+"px",r.style.width=Math.round(l*h)+"px";var y=this.getOppositeCornerCoords(r);this._reAlignNode(r,v,y),r._layout&&r._layout.onResizeStep&&r._layout.onResizeStep()}this._layoutIndicator.show();var m={height:Math.round(d*h),width:Math.round(l*h)};m=this._formatHeightWidth(r,m),this.updatePositionIndicator({left:o.clientX-this.containerNodeOffset.left,top:o.clientY-this.containerNodeOffset.top},m),this._showResizeIndicators(r,m)}},rotate:function(t){var e=this.nResizeEdge.parentNode,i=o.getCenter(e),n=o.getRotatedCoordinates(e.parentNode,i.left,i.top),r=o.getRotatedCoordinates(e.parentNode,t.clientX,t.clientY),a=o.getRotatedCoordinates(e.parentNode,this.resizePointCenter.left,this.resizePointCenter.top),s=t.shiftKey;this.rotateUsingCoords(n,r,a,s,t)},move:function(){},rotateUsingCoords:function(t,e,i,n,r){for(var a=this.nResizeEdge.parentNode,s=this._getNodesForResize(),d=0,l=s.length;d1?this._layoutIndicator.hide():(this._layoutIndicator.show(),this.updatePositionIndicatorRotate({left:r.clientX-this.containerNodeOffset.left,top:r.clientY-this.containerNodeOffset.top},f)),o.setRotateTransform(a,f)}},rotationMutationObserver:function(t){var e,i=!1;for(e=0;e1){var i=e[0].name;this.applyAlignment(i)}},getWidgetBoxes:function(t){var i=o.position(t),n=o.widgetSize(t),r={boundingBox:e(t).position(),widgetBox:{top:i.top,left:i.left,width:n.width,height:n.height}},a=t.getBoundingClientRect();return r.boundingBox.width=a.width,r.boundingBox.height=a.height,r},applyAlignment:function(t){var e={left:this.getLeftAlignmentStyle,center:this.getCenterAlignmentStyle,right:this.getRightAlignmentStyle,top:this.getTopAlignmentStyle,middle:this.getMiddleAlignmentStyle,bottom:this.getBottomAlignmentStyle},i=[],o=this.getWidgetBoxes(this.selectedNodes[0]);i.push(o);for(var n={top:o.boundingBox.top,left:o.boundingBox.left,bottom:o.boundingBox.top+o.boundingBox.height,right:o.boundingBox.left+o.boundingBox.width},r=1;r0)return e[0]._layout.model.getParent()},r.prototype.getItems=function(t){var e=this.getParentModel(t);return e&&e.items.filter((function(t){return"templateDropZone"!==t.type&&"templateIndicator"!==t.type}))},r.prototype._isAvailable=function(t){var e=this.getNodes(t),o=this.getItems(t);return e.length&&o.length>1&&this.dashboard.getMode()===this.dashboard.MODES.EDIT&&void 0===i.find(e,(function(t){return-1===o.indexOf(t._layout.model)}))},r.prototype._isDisabled=function(){return this._dashboardState.getUiState().focus},r.prototype.getContentActionList=function(t){return this._isAvailable(t)?[{name:"orderToFront",label:e.get("toolbarActionOrderToFront"),icon:this._icons.getIcon("bring-to-front").id,type:"Button",disabled:this._isDisabled.bind(this),actions:{apply:this.orderContent.bind(this,t,this.getItems(t).length-this.getNodes(t).length)}},{name:"orderToBack",label:e.get("toolbarActionOrderToBack"),icon:this._icons.getIcon("send-to-back").id,type:"Button",disabled:this._isDisabled.bind(this),actions:{apply:this.orderContent.bind(this,t,0)}}]:[]},r.prototype.orderContent=function(t,e){var o=this.getItems(t),n=this.getNodes(t),r=i.map(n,(function(t){return t._layout.model})),a=this.getParentModel(t),s=[],d=[],l=[],h=void 0,u=void 0,c=void 0,p=void 0;for(u=0,c=0,p=!1;u1&&void 0!==arguments[1]?arguments[1]:["status","assetId"];return this._pick(t,e)},i.prototype._pick=function(t,e){var i={};return e.forEach((function(e){t.hasOwnProperty(e)&&(i[e]=t[e])})),i},i}()})),define("dashboard-core/js/features/dashboard/actions/groupAction/GroupAction",["../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","../../../../app/nls/StringResources","jquery","../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../../../../lib/@waca/dashboard-common/dist/api/ContentActionsProviderAPI","../../../../dashboard/util/PxPercentUtil","../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils"],(function(t,e,i,o,n,r,a){return function(){function s(t){var e=t.features;_classCallCheck(this,s),e&&(this.dashboard=e.API,e.ContentActions.registerProvider("group",this.getAPI()),this.deleteAction=e.deleteAction,this._icons=e.Icons),this._handlers=[]}return s.prototype.getAPI=function(){return this._api||(this._api=o.createAPI(this,[n])),this._api},s.prototype.getLifeCycleHandlers=function(){return[{name:"post:dashboard.initialize",action:this.postDashboardInitialize.bind(this)},{name:"dashboard.layout.interactions.ready",action:this.onDashboardLayoutInteractionsReady.bind(this)}]},s.prototype.postDashboardInitialize=function(){return this.dashboard&&(this.controller=this.dashboard.getFeature("InteractionController.internal"),this.selectionHandler=this.controller.selectionHandler,this.onDashboardLayoutInteractionsReady()),Promise.resolve()},s.prototype.onDashboardLayoutInteractionsReady=function(){if(this.selectionHandler){this.deRegisterEvents(),this._handlers.push(this.selectionHandler.on("selection:before",this.beforeSelection,this)),this.deleteAction.setOnBeforeDeleteCallback(this.onBeforeDelete.bind(this));var t=this.controller.getInteraction("resize");t&&this._handlers.push(t.on("resize:done",this.recalculateGroupRect,this));var e=this.controller.getInteraction("moveGroupContent");e&&this._handlers.push(e.on("moveGroupContent:done",this.recalculateGroupRect,this))}},s.prototype.deRegisterEvents=function(){this._handlers&&this._handlers.forEach((function(t){t.remove&&t.remove()})),this._handlers=[]},s.prototype.destroy=function(){this.deRegisterEvents(),this.dashboard=null,this.controller=null,this.selectionHandler=null,this.events=null,this._handlers=null},s.prototype.getNodes=function(e){return t.getNodes(this.controller,e)},s.prototype.isGroupEnabled=function(t){var e=!1,i=this.getNodes(t);if(i.length>0){var o=null;e=!i.some((function(t){if(o&&o!==t.parentNode)return!0;o=t.parentNode}))}return this.dashboard.getMode()===this.dashboard.MODES.EDIT&&e&&i.length>1&&!this._getTopGroup(i[0])},s.prototype.isUnGroupEnabled=function(t){var e=this,o=!1,n=this.getNodes(t);return n.length>0&&(o=!n.some((function(t){return!i(t).hasClass("pagegroup")&&!e._getTopGroup(t)}))),this.dashboard.getMode()===this.dashboard.MODES.EDIT&&o},s.prototype.getContentActionList=function(t){var i=[];return this.isGroupEnabled(t)&&i.push({name:"group",label:e.get("toolbarActionGroup"),icon:this._icons.getIcon("dashboard-group").id,type:"Button",actions:{apply:this.groupContent.bind(this,t)}}),this.isUnGroupEnabled(t)&&i.push({name:"ungroup",label:e.get("toolbarActionUngroup"),icon:this._icons.getIcon("dashboard-ungroup").id,type:"Button",actions:{apply:this.ungroupContent.bind(this,t)}}),i},s.prototype._getTopGroup=function(t){var e=null,o=i(t).parents(".pagegroup");return o.length>0&&(e=o[o.length-1]),e},s.prototype.beforeSelection=function(t){var e=t.newSelection,i=t.currentSelection,o=this._getTopGroup(e),n=i.length;n>0&&this.handleMultipleSelection(i,o,t)||o&&(1===n&&i[0]===o&&"mousedown"!==t.eventType?this.selectionHandler.deselectAll():t.newSelection=o)},s.prototype.handleMultipleSelection=function(t,e,i){var o=this._getTopGroup(t[0]);return!!o&&(o!==e&&(this.selectionHandler.deselectAll(),this.selectionHandler.selectNode(o),e&&(i.newSelection=e)),!0)},s.prototype.groupContent=function(e,i){var o=this,n=this.getNodes(e);if(!(n.length<=0)){for(var a=[],s=0,d=n.length;s=0;s--)d=l[s],this.selectionHandler.selectNode(d,{isTouch:!!e&&"touchstart"===e.type});return l},s.prototype._calculateNewStyleForEachNode=function(e,i,o){var n=i._layout.parentLayout,r=t.getAngleDegree(e),a=e.getBoundingClientRect(),s=t.getRotatedCoordinates(n.domNode,a.left,a.top),d=window.getComputedStyle(e),l=o+r,h=t.widgetSize(e);return{height:h.height+"px",width:h.width+"px",top:s.y-t.getStyleIntValue(d.marginTop)+"px",left:s.x-t.getStyleIntValue(d.marginLeft)+"px",rotateAngle:l}},s.prototype._ungroupGroupNode=function(e,i){for(var o,n,r=[],a=t.getContentWithoutDecoration(e),s={},d=0,l=a.length;d0){var l=n?e:a[s-1],h=t.radianToDegree(t.getAbsoluteAngleRadian(e,l)),u=this._calculateNewStyleForEachNode(o,l,h),c=d.getContent(o._layout.id),p=d.getContent(l._layout.id);d.moveContent(p.getContainer().getId(),[o._layout.id],r),Object.keys(u).forEach((function(t){c.setPropertyValue(t,u[t],r)}))}},s.prototype._ungroupMultipleNodes=function(t,e,o){for(var n=[],r=0;r0&&(s.outBoundIds=r);var d=this.controller.boardModel.duplicateSelection(s);this.controller.selectionHandler.deselectAll();var l=[];return d.forEach((function(t){return l.push(t.then((function(t){return i.controller.layoutController.selectLayouts([t],e)})).catch((function(t){console.log(t)})))})),l},a.prototype._checkLayoutBoundLimits=function(t,e){var i={right:!0,bottom:!0},o=t._layout.parentLayout.getMaximumHeight(),n=t._layout.parentLayout.getMaximumWidth();if(isFinite(o)&&isFinite(n)){var r=e.clientHeight,a=e.clientWidth;if(isFinite(r)&&isFinite(a)){var s=t._layout.model,d=s.style;if(d){var l=parseFloat(s.incrementStyleValue(d.top))/100*r,h=parseFloat(s.incrementStyleValue(d.left))/100*a,u=parseFloat(d.height)/100*r,c=parseFloat(d.width)/100*a;l+u>o&&(i.bottom=!1),h+c>n&&(i.right=!1)}}}return i},a}()})),define("dashboard-core/js/features/dashboard/actions/alignAction/AlignAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.applyAction=function(){},t}()})),define("dashboard-core/js/features/dashboard/actions/alignAction/impl/AlignAction",["../../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../AlignAPI","../../../../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","../../../../../app/nls/StringResources","jquery","../../../../../lib/@waca/dashboard-common/dist/api/ContentActionsProviderAPI"],(function(t,e,i,o,n,r){return function(){function a(t){var e=t.features;_classCallCheck(this,a),e&&(this.dashboard=e.API,e.ContentActions.registerProvider("align",this.getAPI()),this._icons=e.Icons)}return a.prototype.getAPI=function(){return this.api||(this.api=t.createAPI(this,[e,r])),this.api},a.prototype.getLifeCycleHandlers=function(){return[{name:"post:dashboard.initialize",action:this.postDashboardInitialize.bind(this)}]},a.prototype.postDashboardInitialize=function(){return this.dashboard&&(this.controller=this.dashboard.getFeature("InteractionController.internal")),Promise.resolve()},a.prototype.destroy=function(){this.dashboard=null,this.controller=null},a.prototype.getNodes=function(t){return i.getNodes(this.controller,t)},a.prototype._isEnabled=function(t){return t.length>1&&this.dashboard.getMode()===this.dashboard.MODES.EDIT},a.prototype.getContentActionList=function(t){return this._isEnabled(t)?[{name:"align",label:o.get("toolbarActionAlign"),icon:this._icons.getIcon("align-horizontally").id,type:"NextView",viewModule:"dashboard-core/js/features/dashboard/actions/alignAction/impl/AlignDialog",viewOptions:{height:290,width:110,actions:{apply:this.applyAlignment.bind(this,t)}}}]:[]},a.prototype.applyAction=function(t){if(t&&t.length&&t[0].name){var e=t[0].name,i=t[0].layoutIds;this.applyAlignment(i,e)}},a.prototype.getWidgetBoxes=function(t){var e=i.position(t),o=i.widgetSize(t),r={boundingBox:n(t).position(),widgetBox:{top:e.top,left:e.left,width:o.width,height:o.height}},a=t.getBoundingClientRect();return r.boundingBox.width=a.width,r.boundingBox.height=a.height,r},a.prototype.applyAlignment=function(t,e){var i=this,o={left:this.getLeftAlignmentStyle,center:this.getCenterAlignmentStyle,right:this.getRightAlignmentStyle,top:this.getTopAlignmentStyle,middle:this.getMiddleAlignmentStyle,bottom:this.getBottomAlignmentStyle},n=[],r=this.getNodes(t),a=this.getWidgetBoxes(r[0]);n.push(a);for(var s={top:a.boundingBox.top,left:a.boundingBox.left,bottom:a.boundingBox.top+a.boundingBox.height,right:a.boundingBox.left+a.boundingBox.width},d=1;d0){for(var e=this.dashboard.getCanvas().getContent(t[0]);e&&"page"!==e.getType();)e=e.getContainer();if(e)return e.getId()}return!1},o.prototype._getCountGroupsAffected=function(t){var e=this,o=0,n=this.eventGroups.getGroupIdsOnPage(this._getPageId(t));return n.length>0&&t.length>0&&(o=i.filter(n,(function(o){var n=e.eventGroups.getContentIdList(o);return n.length===i.intersection(n,t).length})).length),o},o.prototype.getNumberOfGroups=function(t){var e=this._getPageId(t);return e?this.eventGroups.getGroupIdsOnPage(e).length:0},o}()})),define("dashboard-core/js/features/dashboard/actions/eventGroups/DisconnectEventGroupAction",["./EventGroupActions","../../../../app/nls/StringResources","underscore"],(function(t,e,i){return function(t){function o(e){var i=e.features;_classCallCheck(this,o);var n=_possibleConstructorReturn(this,t.call(this,{features:i}));return i&&(i.ContentActions.registerProvider("disconnectFilterGroup",n.getAPI()),n._icons=i.Icons),n}return _inherits(o,t),o.prototype.getContentActionList=function(t){return this._isAvailable(t)?[{name:"disconnectFilterGroup",label:e.get("toolbarActionDisconnectFilterGroup"),icon:this._icons.getIcon("unlink").id,type:"Button",order:1,actions:{apply:this.execute.bind(this,t)},disabled:this.isDisabled.bind(this,t),update:!0}]:[]},o.prototype.execute=function(t){this.eventGroups.removeFromGroup(t,i.uniqueId("_disconnectFromGroup_"))},o.prototype.isDisabled=function(t){var e=this;if(this._isStaticWidget(t))return!0;if(!(this.eventGroups.getGroupIdsOnPage(this._getPageId(t)).length>0))return!0;var o=this._getCountGroupsAffected(t);return this.getNumberOfGroups(t)+t.length-o>5||0===i.filter(t,(function(t){var i=e.eventGroups.getGroupId(t);return e.eventGroups.getContentIdList(i).length>1})).length},o}(t)})),define("dashboard-core/js/features/dashboard/actions/eventGroups/LinkEventGroupAction",["./EventGroupActions","../../../../app/nls/StringResources"],(function(t,e){return function(t){function i(e){var o=e.features;_classCallCheck(this,i);var n=_possibleConstructorReturn(this,t.call(this,{features:o}));return o&&(o.ContentActions.registerProvider("linkFilterGroup",n.getAPI()),n._icons=o.Icons),n}return _inherits(i,t),i.prototype.getContentActionList=function(t){return this._isAvailable(t)?[{name:"linkFilterGroup",label:e.get("toolbarActionLinkFilterGroup"),icon:this._icons.getIcon("link").id,type:"NextView",order:2,disabled:this.isDisabled.bind(this,t),viewModule:"dashboard-core/js/app/ui/dialogs/FilterGroupsDialog",viewOptions:{height:140,width:180,labels:!1,idList:t,controller:this},update:!0}]:[]},i.prototype.isDisabled=function(t){return!!this._isStaticWidget(t)||this.getNumberOfGroups(t)<2},i.prototype.getGroups=function(t){if(this._isStaticWidget(t))return[];var e=this._getPageId(t),i=this.eventGroups.getGroupIdsOnPage(e),o=this._getDistinctGroupIdsInSelection(t);return 1===o.length?i=i.filter((function(t){return t!==o[0]})):i},i}(t)})),define("dashboard-core/js/features/dashboard/actions/eventGroups/CreateEventGroupAction",["./EventGroupActions","../../../../app/nls/StringResources","underscore"],(function(t,e,i){return function(t){function o(e){var i=e.features;_classCallCheck(this,o);var n=_possibleConstructorReturn(this,t.call(this,{features:i}));return i&&(i.ContentActions.registerProvider("createFilterGroup",n.getAPI()),n._icons=i.Icons),n}return _inherits(o,t),o.prototype.getContentActionList=function(t){return this._isAvailable(t)?[{name:"createFilterGroup",label:e.get("toolbarActionCreateFilterGroup"),icon:this._icons.getIcon("new-link").id,actions:{apply:this.execute.bind(this,t)},disabled:this.isDisabled.bind(this,t),type:"Button",order:3,update:!0}]:[]},o.prototype.execute=function(t){this.eventGroups.createGroup(t,i.uniqueId("_createGroup_"))},o.prototype.isDisabled=function(t){if(this._isStaticWidget(t))return!0;var e=this._getDistinctGroupIdsInSelection(t),i=this.eventGroups.getContentIdList(e[0]).length;if(1===e.length&&t.length===i)return!0;var o=this._getCountGroupsAffected(t);return this.getNumberOfGroups(t)-o+1>5},o}(t)})),define("dashboard-core/js/features/dashboard/actions/api/ContentActionsAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.registerProvider=function(){},t.prototype.getContentActionList=function(){},t}()})),define("dashboard-core/js/features/dashboard/actions/ContentActions",["../../../lib/@waca/dashboard-common/dist/core/APIFactory","./api/ContentActionsAPI"],(function(t,e){return function(){function i(){_classCallCheck(this,i),this.api=t.createAPI(this,[e]),this.providers={}}return i.prototype.registerProvider=function(t,e){this.providers[t]=e},i.prototype.getContentActionList=function(t){var e=[];return Object.values(this.providers).forEach((function(i){if(i.getContentActionList&&"function"==typeof i.getContentActionList){var o=null;try{o=i.getContentActionList(t)}catch(t){console.log(t)}o&&e.push.apply(e,o)}})),e},i.prototype.getAPI=function(){return this.api},i}()})),define("dashboard-core/js/features/dashboard/dnD/api/CanvasDnDAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.registerProvider=function(){},t.prototype.accepts=function(){},t.prototype.onDrop=function(){},t}()})),define("dashboard-core/js/features/dashboard/dnD/api/impl/CanvasDnD",["../CanvasDnDAPI","../../../../../lib/@waca/dashboard-common/dist/core/APIFactory"],(function(t,e){var i=["pin","widget"];return function(){function o(){_classCallCheck(this,o),this._api=e.createAPI(this,[t]),this.providers=[]}return o.prototype.destroy=function(){this.api=null,this.providers=[]},o.prototype.getAPI=function(){return this._api},o.prototype.registerProvider=function(t){var e=this.providers.find((function(e){return e.getImplType()===t.getImplType()}));null==e&&this.providers.push(t)},o.prototype.accepts=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],i=this._getSupportedTypes(e);if(-1!==i.indexOf(t.type))return!0;var o=this.providers.find((function(i){return i.accepts(t,e)}));return!!o},o.prototype.onDrop=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.data&&"new"===t.data.operation)return Promise.resolve(t.data.model);var e=Promise.resolve();return this.providers.forEach((function(i){e=e.then((function(e){return e||i.onDrop(t)}))})),e},o.prototype._getSupportedTypes=function(t){if(t&&t.fromMultipurposeWidget)return[];var e=[].concat(i);return t&&t.fromCanvas&&e.push("groupContent"),e},o}()})),define("dashboard-core/js/features/dashboard/eventGroups/api/EventGroupsAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.groupExists=function(){},t.prototype.getGroupId=function(){},t.prototype.getGroupIdsOnPage=function(){},t.prototype.getContentIdList=function(){},t.prototype.addToGroup=function(){},t.prototype.createGroup=function(){},t.prototype.removeFromGroup=function(){},t}()})),define("dashboard-core/js/features/dashboard/eventGroups/EventGroups",["underscore","../../../lib/@waca/dashboard-common/dist/core/APIFactory","../../../lib/@waca/dashboard-common/dist/api/ContentActionsProviderAPI","../../../api/DashboardAPI","./api/EventGroupsAPI","../../../lib/@waca/dashboard-common/dist/utils/ContentUtil","../../../app/nls/StringResources"],(function(t,e,i,o,n,r,a){return function(){function o(t){var r=t.features;_classCallCheck(this,o),this.dashboard=r.API,this._dashboardState=r.DashboardState,this._api=e.createAPI(this,[n,i]),r.ContentActions.registerProvider("EventGroups",this.getAPI()),this._icons=r.Icons}return o.prototype.getAPI=function(){return this._api},o.prototype.initialize=function(){var t=this;return this.dashboard.getCanvasWhenReady().then((function(e){t.dashboard&&(t.canvas=e,t.canvas.on("move:content",t.onMoveContent,t))})),Promise.resolve()},o.prototype.onMoveContent=function(e){var i=this,o=r.getPageContent(this.canvas.getContent(e.info.containerId)).getId(),n=this.createDefaultGroupId(o),a=this._getBoardModel().eventGroups,s=t.pluck(a.getGroupsOnPage(o),"id");e.info.contentIdList.forEach((function(t){var o=[],r=i.canvas.getContent(t).findContent("type:widget");r.length?r.forEach((function(t){var e=t.getId(),i=a.findGroup(e);s.length&&i?-1!==s.findIndex((function(t){return t!==i.id}))&&o.push(e):o.push(e)})):o.push(t),i.addToGroup(n,o,e.transactionToken)}))},o.prototype.destroy=function(){this.canvas&&this.canvas.off("move:content",this.onMoveContent,this),this.dashboard=null,this._dashboardState=null,this._api=null},o.prototype.groupExists=function(t){return!!this._getBoardModel().eventGroups.get(t)},o.prototype.getGroupId=function(t){var e=this._getBoardModel().eventGroups.findGroup(t);return e?e.getId():null},o.prototype.getGroupIdsOnPage=function(t){var e=this._getBoardModel().eventGroups.getGroupsOnPage(t),i=[];return e&&e.length&&e.forEach((function(t){i.push(t.id)})),i},o.prototype.getContentIdList=function(t){var e=this._getBoardModel().eventGroups.get(t);if(e&&e.widgetIds)return JSON.parse(JSON.stringify(e.widgetIds))},o.prototype.addToGroup=function(t,e,i){var o=this._getBoardModel().eventGroups,n=this.dashboard.getFeature("Transaction"),r=n.startTransaction(i),a={payloadData:{undoRedoTransactionId:r.transactionId,transactionToken:r}};this.groupExists(t)?o.addToGroup(t,e,a):(a.targetPageId=t.slice(0,t.indexOf(":")),o.createGroup(e,a)),n.endTransaction(r)},o.prototype.createGroup=function(t,e){var i=this._getBoardModel().eventGroups,o=this.dashboard.getFeature("Transaction"),n=o.startTransaction(e),r={payloadData:{undoRedoTransactionId:n.transactionId,transactionToken:n}},a=i.createGroup(t,r);return o.endTransaction(n),a},o.prototype.removeFromGroup=function(t,e){var i=this._getBoardModel().eventGroups,o=this.dashboard.getFeature("Transaction"),n=o.startTransaction(e),r={payloadData:{undoRedoTransactionId:n.transactionId,transactionToken:n}},a=i.disconnectFromGroup(t,r);return o.endTransaction(n),a},o.prototype._getBoardModel=function(){return this.dashboard.getFeature("internal").getBoardModel()},o.prototype.createDefaultGroupId=function(t){return this._getBoardModel().eventGroups.createDefaultGroupId(t)},o.prototype.getContentActionList=function(t){var e=this,i=this._dashboardState.getUiState();return t.length>0||!1===i.authoring?[]:[{name:"EventGroups",type:"ToggleButton",baseClass:"toolbar",order:1,checked:i.eventGroups,disabled:i.focus,label:a.get("eventGroupButtonLabel"),icon:this._icons.getIcon("connect").id,action:function(){return e._dashboardState.setEventGroups(!0)},offAction:function(){return e._dashboardState.setEventGroups(!1)}}]},o}()})),define("dashboard-core/js/features/dashboard/convertToTemplate/api/ConvertToTemplateAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.convertToTemplate=function(){},t}()})),define("text!dashboard-core/js/dashboard/schema/templateSchemaMappings.json",[],(function(){return'{\n "copyright": "Licensed Materials - Property of IBM. IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2019. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.",\n "version": "versionSchema.json",\n "name": "nameSchema.json",\n "layout": "layoutSchema.json",\n "theme": "themeSchema.json",\n "specVersion": "versionSchema.json",\n "eventGroups": "eventGroupsSchema.json",\n\t "properties": "propertiesSchema.json"\n}\n'})),define("dashboard-core/js/features/dashboard/convertToTemplate/ConvertToTemplate",["./api/ConvertToTemplateAPI","@waca/dashboard-common/js/core/APIFactory","text!../../../../../dashboard/schema/schemaDefs.json","text!../../../../../dashboard/schema/templateSchemaMappings.json","text!../../../../../dashboard/schema/nameSchema.json","text!../../../../../dashboard/schema/layoutSchema.json","text!../../../../../dashboard/schema/themeSchema.json","text!../../../../../dashboard/schema/versionSchema.json","text!../../../../../dashboard/schema/eventGroupsSchema.json","text!../../../../../dashboard/schema/propertiesSchema.json","text!../../../../../dashboard/schema/widgetsTemplateSchema.json"],(function(t,e,i,o,n,r,a,s,d,l,h){return function(){function u(t){var e=t.features;_classCallCheck(this,u),this.dashboard=e.API,this._featureChecker=this.dashboard.getGlassCoreSvc(".FeatureChecker")}return u.prototype.getAPI=function(){return!this._featureChecker.checkValue("dashboard","dashboardTemplates","disabled")||this._api||(this._api={convertToTemplate:function(){return Promise.resolve()}}),this._api||(this._api=e.createAPI(this,[t])),this._api},u.prototype.convertToTemplate=function(t){var e=this;return t&&Object.keys(t).length?this._getAjv().then((function(i){var o=e._getSchemaMappings(),n={},r=Object.keys(t),a=Array.isArray(r),s=0;for(r=a?r:r[Symbol.iterator]();;){var d;if(a){if(s>=r.length)break;d=r[s++]}else{if((s=r.next()).done)break;d=s.value}var l=d,h=o[l];if(h){var u=t[l],c=i.getSchema(h);c&&(c(u),"layout"!==l||Array.isArray(u)||e._lockVisualizationType(u.items),n[l]=u)}}return n})):Promise.resolve(null)},u.prototype._lockVisualizationType=function(t){for(var e=0;e1?i-1:0),n=1;n0)&&(o.hasCapability(n._dashboardApi,"canAuthorDashboard")&&r.authoring)}})},n.prototype.destroy=function(){this._dashboardApi=null,this._api=null},n}()})),define("dashboard-core/js/features/dashboard/properties/PropertiesPaneDOMAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.render=function(){},t.prototype.getPropertiesView=function(){},t.prototype.getProviderId=function(){},t.prototype.getRenderNode=function(){},t.prototype.close=function(){},t}()})),define("dashboard-core/js/features/dashboard/properties/PropertiesPaneDOM",["../../../lib/@waca/dashboard-common/dist/core/APIFactory","underscore","./PropertiesPaneDOMAPI"],(function(t,e,i){return function(){function e(t){var i=t.features;_classCallCheck(this,e),this._dashboard=i.API,this._properties=i.PropertiesPane,this._slideout=i.InAppSlideoutDOM,this._api=null}return e.prototype.getAPI=function(){return this._api},e.prototype.getProviderId=function(){return this._properties.getProviderId()},e.prototype.initialize=function(){this._api=t.createAPI(this,[i]),this._slideout.registerView(this._properties.getProviderId(),this._api)},e.prototype.getPropertiesView=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._renderNode=t.parentNode;var e=void 0,i=this._dashboard.getFeature("propertiesManager");if(t.isChild)e=i.updateChildPropertiesView(t);else{var o=this._getSelectedContentIds(),n=void 0;o&&o.length>0&&(n=o[0]),e=i.getPropertiesView(n)}return e},e.prototype._getSelectedContentIds=function(){return this._dashboard.getCanvas().getSelectedContentList().map((function(t){return t.getId()}))},e.prototype.getRenderNode=function(){return this._renderNode},e.prototype.render=function(t){var e=this._dashboard.getFeature("propertiesManager").getMostRecentChildOptions(t);return this.getPropertiesView(e).then((function(t){return e&&e.childPanelId&&(t.$el.get(0).dataset.childPanelId=e.childPanelId),t.$el.get(0)}))},e.prototype.close=function(){var t=this._dashboard.getFeature("propertiesManager");t&&t.closeAllChild(),this._renderNode=null},e.prototype.destroy=function(){this.close(),this._api=null,this._dashboard=null,this._properties=null,this._slideout=null},e}()})),define("dashboard-core/js/features/dashboard/inAppSlideout/InAppSlideoutStateAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.registerContribution=function(){},t.prototype.removeContribution=function(){},t.prototype.getContributions=function(){},t.prototype.getContribution=function(){},t.prototype.getCurrent=function(){},t.prototype.getUiState=function(){},t.prototype.onStateChange=function(){},t.prototype.isOpen=function(){},t.prototype.open=function(){},t.prototype.close=function(){},t}()})),define("dashboard-core/js/features/dashboard/inAppSlideout/InAppSlideoutState",["../../../lib/@waca/dashboard-common/dist/core/APIFactory","./InAppSlideoutStateAPI"],(function(t,e){function i(t){return JSON.parse(JSON.stringify(t))}return function(){function o(t){var e=t.features;_classCallCheck(this,o),this._dashboardApi=e.API,this._dashboardState=e.DashboardState,this._contentActions=e.ContentActions,this._contributions={items:[]},this._stateListeners=[],this._previousDashboardState=i(this._dashboardState.getUiState()),this._dashboardStateIgnoreList=["dirty"]}return o.prototype.getAPI=function(){return this._api},o.prototype.initialize=function(){this._api=t.createAPI(this,[e]),this._dashboardState.onUiStateChange(this._onUiStateChange.bind(this)),this._updateContributionSelections()},o.prototype.getUiState=function(){return this._dashboardState.getUiState().sidePanel},o.prototype._filterCaredDashboardState=function(t){var e=this;return JSON.stringify(t,(function(t,i){return-1!==e._dashboardStateIgnoreList.indexOf(t)?void 0:i}))},o.prototype._onUiStateChange=function(t){this._filterCaredDashboardState(t)!==this._filterCaredDashboardState(this._previousDashboardState)&&(this._updateContributionSelections(t.sidePanel),this._stateListeners.forEach((function(e){return e(t)}))),this._previousDashboardState=i(t)},o.prototype._updateContributionSelections=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getUiState();this._contributions.items.forEach((function(e){var i=e.contribution,o=e.id;i.selected=t.current===o}))},o.prototype.registerContribution=function(t,e){if(this.getContribution(t))throw new Error('Contribution with id "'+t+'" is already registered');e=this._populateContentContribution(t,e),this._registerContentContribution(t,e),this._contributions.items.push({id:t,contribution:e}),this._updateContributionSelections()},o.prototype._populateContentContribution=function(t,e){var i=this,o=function(){var e=i.getUiState();if(e.current===t){var o=!e.isOpen;i._dashboardState.setSidePanelOpen(o),o||i._dashboardState.setSidePanelCurrentView(null)}else i._dashboardState.setSidePanelCurrentView(t),e.isOpen||i.open()};return _extends({},e,{checked:this.getUiState().isOpen,action:o,offAction:o,selected:!1})},o.prototype._registerContentContribution=function(t,e){this._contentActions.registerProvider(t,{getContentActionList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=[];return e.isEnabled(t)&&i.push(e),i}})},o.prototype.onStateChange=function(t){var e=this,i=this._stateListeners.push(t)-1;return function(){e._stateListeners.splice(i,1)}},o.prototype.removeContribution=function(t){var e=this._contributions.items.findIndex((function(e){return e.id===t}));if(-1===e)throw new Error('Contribution with id "'+t+'" does not exist');this._contributions.items.splice(e,1)},o.prototype.getContribution=function(t){return this._contributions.items.find((function(e){return e.id===t}))},o.prototype.getContributions=function(){return this._contributions.items},o.prototype.getCurrent=function(){var t=this.getUiState().current;return this.getContribution(t)},o.prototype.isOpen=function(){return this._dashboardState.getUiState().sidePanel.isOpen},o.prototype.open=function(){this._dashboardState.setSidePanelOpen(!0)},o.prototype.close=function(){this._dashboardState.setSidePanelOpen(!1),this._dashboardState.setSidePanelCurrentView(null)},o.prototype.destroy=function(){this._dashboardApi=null,this._api=null},o}()})),define("dashboard-core/js/features/dashboard/inAppSlideout/InAppSlideoutDOMAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.render=function(){},t.prototype.registerView=function(){},t.prototype.removeView=function(){},t.prototype.getViews=function(){},t.prototype.getView=function(){},t.prototype.onDomStateChange=function(){},t}()})),define("dashboard-core/js/features/dashboard/inAppSlideout/InAppSlideoutContainer",["react","ca-ui-toolkit","prop-types","jquery"],(function(t,e,i,o){var n=e.Container,r=e.Slideout,a=function(t,e){return t.dataset.contributionId===e},s=function(e){function i(o){_classCallCheck(this,i);var n=_possibleConstructorReturn(this,e.call(this,o));return n.contentRef=t.createRef(),n}return _inherits(i,e),i.prototype.componentDidMount=function(){this._updateInAppSlideout()},i.prototype.componentWillUnmount=function(){this._onComponentMountedChange(!1)},i.prototype.componentDidUpdate=function(){this._updateInAppSlideout()},i.prototype._getContainerNode=function(){var t=this.props.contribution.getProviderId(),e=this.contentRef.current;if(e){var i=function(t,e){return Array.from(t.childNodes).find((function(t){return a(t,e)}))}(e,t);return i||(i=function(t){var e=document.createElement("div");return e.dataset.contributionId=t,e.setAttribute("class","slideout__contributions__item"),e.style.overflow="auto",e}(t),e.appendChild(i)),i}},i.prototype._clearContainerNode=function(){var t=this._getContainerNode();t&&(t.innerHTML="")},i.prototype._updateInAppSlideout=function(){var t=this,e=this.props,i=e.contribution,o=e.options;if(i){var n=i.getProviderId();!function(t,e){Array.from(t.childNodes).forEach((function(t){t.style.display=a(t,e)?"":"none"}))}(this.contentRef.current,n);var r=this._getContainerNode();r&&i.render(_extends({},o,{parentNode:r})).then((function(e){if(e){var i=e.dataset.childPanelId;o.isChild||i?t._updateChildView(e,o):t._updateParentView(e),t._onComponentMountedChange(!0)}}))}},i.prototype._updateChildView=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.props.active;if(i){var n=this._getContainerNode(),r=n.firstElementChild;r&&(n.childNodes.length>1?e.refreshChild&&(o(r).remove(),r=n.firstElementChild):r.style.display="none",n.insertBefore(t,r),n.childNodes[0].focus())}},i.prototype._updateParentView=function(t){if(this.props.active){this._clearContainerNode();var e=this._getContainerNode();e&&(e.insertBefore(t,e.firstElementChild),e.childNodes[0].focus())}},i.prototype._onComponentMountedChange=function(t){var e=this.props,i=e.onDomStateChange,o=e.contribution;o&&o.getProviderId&&i&&i({type:t?"mounted":"unmounted",current:o.getProviderId()})},i.prototype.render=function(){var e=this.props.active;return t.createElement(n,{relative:!0,height:"100%",width:"100%"},t.createElement(r,{animationOnRender:!0,toDirection:"",active:e,width:"100%",style:{borderLeft:"1px solid #eaeaea",borderTop:"1px solid #eaeaea"}},t.createElement("div",{ref:this.contentRef,className:"slideout__contributions"})))},i}(t.Component);return s.propTypes={active:i.bool,contribution:i.object.isRequired,options:i.object,onDomStateChange:i.func},s.defaultProps={active:!1,options:{},onDomStateChange:function(){}},s})),define("dashboard-core/js/features/dashboard/inAppSlideout/InAppSlideoutDOM",["react","react-dom","../../../lib/@waca/dashboard-common/dist/core/APIFactory","./InAppSlideoutDOMAPI","./InAppSlideoutContainer","jquery"],(function(t,e,i,o,n,r){return function(){function a(t){_classCallCheck(this,a),this._slideout=t.features.InAppSlideoutState,this._api=null,this._root=null,this._currentView=null,this._views=[],this._domListeners=[],this._features=t.features}return a.prototype.getAPI=function(){return this._api},a.prototype.initialize=function(){this._api=i.createAPI(this,[o]),this._slideout.onStateChange(this._onSlideoutStateChange.bind(this))},a.prototype._onSlideoutStateChange=function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.sidePanel;if(this._shouldRenderSlideout(i))this.render();else if(!o.isOpen&&o.current&&this._root){var n=this.getView(o.current),r=n.instance;r.close&&r.close();var a={width:"0px"};return this._doAnimation(a,(function(){t._unmountContribution(),t._root&&e.unmountComponentAtNode(t._root),t._dashboardFrameRight&&t._root&&t._dashboardFrameRight.removeChild(t._root),t._root=null,t._triggerResizeEvent()}))}},a.prototype._doAnimation=function(t,e){return r(this._root).animate(t,"fast",e)},a.prototype._unmountContribution=function(){this._currentView&&this._currentView.unmount&&(this._currentView.unmount&&this._currentView.unmount(),this._currentView.close&&this._currentView.close()),this._currentView=null},a.prototype._triggerResizeEvent=function(){var t=document.createEvent("HTMLEvents");t.initEvent("resize",!1,!0),window.dispatchEvent(t)},a.prototype.registerView=function(t,e){if(this.getView(t))throw new Error('View with id "'+t+'" is already registered');this._views.push({id:t,instance:e})},a.prototype.removeView=function(t){var e=this._views.findIndex((function(e){return e.id===t}));if(-1===e)throw new Error('View with id "'+t+'" does not exist');this._views.splice(e,1)},a.prototype.getView=function(t){return this._views.find((function(e){return e.id===t}))},a.prototype.getViews=function(){return this._views},a.prototype._setupRenderNode=function(){var t=this;if((!this._root||!this._dashboardFrameRight)&&(this._dashboardFrameRight=r(".dashboardFrameRight:visible")[0],this._dashboardFrameRight)){this._root=document.createElement("div"),this._root.setAttribute("class","dashboardAuthoringToolsPane"),this._root.setAttribute("style","width: 0px;"),this._dashboardFrameRight.appendChild(this._root);var e=this._features.DashboardSettings.get("panelWidth"),i={width:e||"320px"};this._doAnimation(i,(function(){t._triggerResizeEvent()}))}},a.prototype.render=function(i){var o=this;return this._setupRenderNode(),new Promise((function(r,a){try{var s=o._slideout.getCurrent().id,d=o.getView(s).instance;d?(o._currentView=d,e.render(t.createElement(n,{active:o._slideout.isOpen(),contribution:d,options:i,onDomStateChange:o._onUiDomStateChange.bind(o)}),o._root,(function(){return r()}))):r()}catch(t){a(t)}}))},a.prototype.destroy=function(){this._root&&e.unmountComponentAtNode(this._root),this._dashboardFrameRight&&this._root&&this._dashboardFrameRight.removeChild(this._root),this._root=null,this._api=null,this._currentView=null,this._domListeners.length=0},a.prototype.onDomStateChange=function(t){var e=this,i=this._domListeners.push(t)-1;return function(){e._domListeners.splice(i,1)}},a.prototype._onUiDomStateChange=function(t){this._domListeners&&this._domListeners.forEach((function(e){return e(t)}))},a.prototype._shouldRenderSlideout=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!this._currentView||this._currentView.getProviderId()!==t.sidePanel.current;return t.sidePanel.isOpen&&(e||t.dirty||t.selectionProperties)},a}()})),define("text!dashboard-core/js/dashboard/views/templates/DataGridView.html",[],(function(){return'
\n
\n'})),define("dashboard-core/js/dashboard/views/datatray/DataGridView",["jquery","doT","underscore","../../../lib/@waca/core-client/js/core-client/ui/core/View","text!../templates/DataGridView.html","../../../app/nls/StringResources","react-dom","../../../lib/@waca/core-client/js/core-client/utils/ClassFactory"],(function(t,e,i,o,n,r,a,s){var d=o.extend({init:function(t){d.inherited("init",this,arguments),this.glassContext=t.services.biGlass.glassContext,this.dashboardApi=t.dashboardApi,this.eventRouter=t.eventRouter,this.services=t.services,this.logger=this.dashboardApi.getGlassCoreSvc(".Logger"),this.dataSourceCollection=this.dashboardApi.getFeature("dataSources.deprecated").getSourcesCollection(),this._registerEvents(),this.gridState={selectedTabId:null,tabs:null},this._loadExtensions(t.appSettings),this._resetReady(),this.renderRequests=[]},_loadExtensions:function(t){var e=this;if(!this._loadExtensionsPromise){var i=[this.dashboardApi,t||{},this.eventRouter],o=this.dashboardApi.findGlassCollection("com.ibm.bi.dashboard.dataTray-extensions");this._loadExtensionsPromise=Promise.resolve(o).then((function(t){var o=[];return e.componentControllers=[],t.forEach((function(t){o.push(s.loadModule(t.class))})),Promise.all(o).then((function(t){t.forEach((function(t){e.componentControllers.push(new(Function.prototype.bind.apply(t,[null].concat(i))))}))}))}))}return this._loadExtensionsPromise},_resetReady:function(){var t=this;this._isReady=!1,this.viewReady=new Promise((function(e){t._readyView=function(){return t._isReady=!0,t._clearRenderQueue().then(e).finally(t._renderReactTabs.bind(t))}}))},_registerEvents:function(){this.registeredEvents=[this.eventRouter.on("dataSourcePanel:dataSourceSelected",this._eventHandler,this),this.eventRouter.on("tab:tabChanged",this._eventHandler,this),this.dashboardApi.getCanvas().on("change:selections",this._eventHandler,this),this.eventRouter.on("dataInVis:selected",this._eventHandler,this),this.dashboardApi.on("widget:rerendered",this._eventHandler,this),this.dashboardApi.on("shapingmodel:changed",this._eventHandler,this),this.dataSourceCollection.on("remove",this._eventHandler,this),this.on("splitterPanel:show",this._eventHandler,this),this.on("splitterPanel:hide",this._eventHandler,this)]},_eventHandler:function(t,e){return"splitterPanel:hide"===e?this._onSplitterHide():("splitterPanel:show"===e&&this._onSplitterShow(),!this.renderRequests.length&&this._isReady?(this.renderRequests.push({event:t,eventName:e}),this._clearRenderQueue().finally(this._renderReactTabs.bind(this))):(this.renderRequests.push({event:t,eventName:e}),Promise.resolve()))},_clearRenderQueue:function(){var t=this;if(!this.renderRequests.length)return Promise.resolve();var e=this.renderRequests[0];return this.renderDataTray(e.event,e.eventName).finally((function(){return t.renderRequests.shift(),t._clearRenderQueue()}))},renderDataTray:function(t,e){var o=this,n=[];return this.componentControllers.forEach((function(i){n.push(i.getTabContrib(t,e,o.gridState.selectedTabId))})),Promise.all(n).then((function(t){if(o.gridState.tabs=i.flatten(i.without(t,null)),!o.gridState.tabs.length)return o.gridState.selectedTabId=null,o._unmountComponents(),Promise.resolve();var e=i.findWhere(o.gridState.tabs,{isSelectedOnTrayRender:!0})||o.gridState.tabs[0];return e.select(o.gridState.selectedTabId,o.gridContainer).finally((function(){return o.gridState.selectedTabId=e.id}))}))},_onSplitterShow:function(){this._readyView()},_onSplitterHide:function(){this._unmountComponents(),this._resetReady()},_unmountComponents:function(){this._tabsContainer&&this.gridContainer&&(this._unmountReactComponents(),t(this._tabsContainer).empty(),t(this.gridContainer).empty())},_unmountReactComponents:function(){this._tabsContainer&&a.unmountComponentAtNode(this._tabsContainer),this.gridContainer&&a.unmountComponentAtNode(this.gridContainer)},getSplitterOpts:function(){var t=this,e=this.dashboardApi.getFeature("Icons");return this.services.getSvc(".StringResources").then((function(i){return{handleClass:"gridHandle",handleIcon:e.getIcon("table").id,hideInConsume:!0,handleOpenTitle:i.get("dataTrayHandleOpenLabel"),handleCloseTitle:i.get("dataTrayHandleCloseLabel"),view:t,initialSize:250}}))},remove:function(){return this._unmountComponents(),this.registeredEvents.length&&(this.registeredEvents.forEach((function(t){t&&t.remove&&t.remove()})),this.registeredEvents=[]),this.gridState.tabs=null,this.gridState.selectedTabId=null,d.inherited("remove",this,arguments)},render:function(){var t=this;return this._loadExtensionsPromise.then((function(){t.dotTemplate=e.template(n);var i=t.dotTemplate();return t.$el.html(i).addClass("dashboardGrid"),t.gridContainer=t.$el.find(".dataGridView")[0],t._tabsContainer=t.$el.find(".gridTabs")[0],t._readyView(),t.viewReady})).catch((function(e){t.logger.log(e)}))},getHighlightedTabId:function(){return this.gridState.selectedTabId},_renderReactTabs:function(){var t=this;if(!this.gridState.tabs||0===this.gridState.tabs.length)return Promise.resolve();var e={tabData:this.gridState.tabs,onTabChange:this.onTabChange.bind(this),selectedTab:this.gridState.selectedTabId};return new Promise((function(i,o){try{require(["ca-modeller/shaping"],(function(o){t._shapingHelper||(t._shapingHelper=new o.Shaping(t.glassContext,{featureConfig:{calculationAction:!0,customGroupCreateAction:!0,customGroupReplaceAction:!0}})),t._shapingHelper.render(o.GridTabs,e,t._tabsContainer),i()}),o)}catch(t){o(t)}}))},onTabChange:function(t){var e=i.findWhere(this.gridState.tabs,{id:t});e.select(this.gridState.selectedTabId,this.gridContainer),this.gridState.selectedTabId=e.id,this._renderReactTabs()}});return d})),define("dashboard-core/js/features/content/textEditor/TextEditorAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.getCustomColorList=function(){},t.prototype.registerProvider=function(){},t}()})),define("dashboard-core/js/features/content/textEditor/impl/TextEditor",["../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../TextEditorAPI"],(function(t,e){return function(){function i(t){_classCallCheck(this,i),this._customColor=t.features["Dashboard.CustomColor"],this.titles=[]}return i.prototype.initialize=function(){this._customColor.registerProvider(this)},i.prototype.destroy=function(){this._customColor&&this._customColor.deregisterProvider(this)},i.prototype.getCustomColorList=function(){return this.titles.reduce((function(t,e){return t.concat(e.textEditor.getCustomColorList())}),[])},i.prototype.getAPI=function(){return t.createAPI(this,[e])},i.prototype.registerProvider=function(t){this.titles.push(t)},i}()})),define("dashboard-core/js/authorBundle",(function(){}));