@hpcc-js/layout 2.45.0 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +5 -5
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/api")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/api"],e):e((t=t||self)["@hpcc-js/layout"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/api"])}(this,function(t,e,i,o){"use strict";var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n=function(){return(n=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var l in e=arguments[i])Object.prototype.hasOwnProperty.call(e,l)&&(t[l]=e[l]);return t}).apply(this,arguments)};function s(t,e,i,o){return new(i||(i=Promise))(function(l,r){function n(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?l(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,s)}a((o=o.apply(t,e||[])).next())})}function a(t,e){var i,o,l,r,n={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,o&&(l=2&r[0]?o.return:r[0]?o.throw||((l=o.return)&&l.call(o),0):o.next)&&!(l=l.call(o,r[1])).done)return l;switch(o=0,l&&(r=[2&r[0],l.value]),r[0]){case 0:case 1:l=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,o=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if(!(l=(l=n.trys).length>0&&l[l.length-1])&&(6===r[0]||2===r[0])){n=0;continue}if(3===r[0]&&(!l||r[1]>l[0]&&r[1]<l[3])){n.label=r[1];break}if(6===r[0]&&n.label<l[1]){n.label=l[1],l=r;break}if(l&&n.label<l[2]){n.label=l[2],n.ops.push(r);break}l[2]&&n.ops.pop(),n.trys.pop();continue}r=e.call(t,n)}catch(t){r=[6,t],o=0}finally{i=l=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function h(t,e,i){if(i||2===arguments.length)for(var o,l=0,r=e.length;l<r;l++)!o&&l in e||(o||(o=Array.prototype.slice.call(e,0,l)),o[l]=e[l]);return t.concat(o||e)}function d(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=t:l.appendChild(document.createTextNode(t))}}d(".layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{position:relative;overflow:hidden;pointer-events:all}");var p=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return r(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=0,l=0,r=this.clientWidth(),n=this.clientHeight();switch(this.units()){case"pixels":o=this.widgetX(),l=this.widgetY(),r=""===this.widgetWidth()?r-o:Number(this.widgetWidth()),n=""===this.widgetHeight()?n-l:Number(this.widgetHeight());break;case"percent":o=this.widgetX()*r/100,l=this.widgetY()*n/100,r=""===this.widgetWidth()?r-o:Number(this.widgetWidth())*r/100,n=""===this.widgetHeight()?n-l:Number(this.widgetHeight())*n/100}i.style("opacity",this.opacity());var s=i.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(s).style("left",o+"px").style("top",l+"px").style("width",r+"px").style("bottom",n+"px").each(function(t){t.resize({width:r,height:n})}),s.exit().each(function(t){t.target(null)}).remove()},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e}(e.HTMLWidget);p.prototype._class+=" layout_AbsoluteSurface",p.prototype.publish("units","percent","set","Units",["pixels","percent"]),p.prototype.publish("widgetX",0,"number","Widget XPos"),p.prototype.publish("widgetY",0,"number","Widget YPos"),p.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),p.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),p.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),p.prototype.publish("opacity",1,"number","Opacity");d(".layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0;overflow:hidden}.layout_Accordion.open>ul{display:block}.layout_Accordion>.collapsible-icon,.layout_Accordion>.collapsible-title{cursor:pointer;box-sizing:border-box}.layout_Accordion>.collapsible-title{display:block;width:100%;font-size:13px;color:#fff;padding:4px 8px;height:26px;-webkit-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);-moz-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2)}.layout_Accordion li{background-color:#fff}.layout_Accordion>.collapsible-title,.layout_Accordion>ul{background-color:#333}.layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion>ul{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ddd}.layout_Accordion>span,.layout_Accordion>ul{padding-left:0}.layout_Accordion .layout_Accordion>span,.layout_Accordion .layout_Accordion>ul{padding-left:12px}.layout_Accordion>.collapsible-title:before{padding:4px 8px;position:absolute;left:0;top:0}.layout_Accordion>.collapsible-icon{position:absolute;top:0;right:0;width:24px;height:24px;color:#fff}");var c=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._isClosed=!1,e}return r(i,t),i.prototype.pushListItem=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var o=this.content();return t._protected=i,e?o.unshift(t):o.push(t),this.content(o),this},i.prototype.clearListItems=function(){var t=[];for(var e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this},i.prototype.collapseClick=function(t){t.classed("closed")?(this._isClosed=!1,t.classed("open",!0),t.classed("closed",!1)):(this._isClosed=!0,t.classed("open",!1),t.classed("closed",!0))},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var l=this;this._isClosed=this.defaultCollapsed(),o.classed(this._isClosed?"closed":"open",!0),this.titleSpan=o.append("span").classed("collapsible-title",!0),this.iconDiv=o.append("div").classed("collapsible-icon",!0),this.ul=o.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){l.collapseClick(o),l.render()}),this.titleSpan.on("click",function(){l.collapseClick(o),l.render()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this.titleSpan.text(o.title().length>0?o.title()+"":"Accordion ["+o._id+"]");var l=this.ul.selectAll("#"+o._id+" > ul > li").data(this.content(),function(t){return t._id});l.enter().append(function(t){var e=document.createElement("li");if(null!==t._target)return t._target;var i=t.size();if(0===i.width||0===i.height){var l=o.size();t.size({width:l.width,height:l.width})}return t.target(e),e}),l.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);c.prototype._class+=" layout_Accordion",c.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),c.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),c.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),c.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),c.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),c.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),c.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});d('.layout_Surface{box-sizing:border-box;margin:0;border:1px solid #e5e5e5;overflow:hidden;height:100%;width:100%}.layout_Surface.shadow2{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}.layout_Surface>h3{margin:0;padding:2px;background-color:#e5e5e5}.layout_Surface .html-button-container{position:absolute;right:0;top:3px}.layout_Surface>div{padding:8px}.layout_Surface .html-button-container .surface-button{margin-right:5px}.layout_Surface .html-button-container .surface-button i{opacity:.8}.layout_Surface .html-button-container .surface-button:hover{opacity:1}.layout_Surface .html-button-container .surface-button:active{opacity:.5}div[draggable=true].hideDragCellContent.content-icon:before{content:"\\f080";font-family:FontAwesome;position:absolute;top:calc(50% - 74px);left:calc(50% - 56px);font-size:100px}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:"\\f201"}div[draggable=true].hideDragCellContent.content-icon-Pie:before{top:calc(50% - 72px);left:calc(50% - 45px);content:"\\f200"}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:"\\f1fe"}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:"\\f0e4"}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:"\\f0ce"}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:"\\f11c"}div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before{content:"\\f247"}div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before{content:"\\f278"}');var u=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return r(i,t),i.prototype.widgetSize=function(t,e){var i=this.clientWidth(),o=this.clientHeight();return this.title()&&(o-=this.calcHeight(t)),o-=this.calcFrameHeight(e),{width:i-=this.calcFrameWidth(e),height:o}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var l=this;o.classed("shadow2",this.surfaceShadow()).style("border-width",this.surfaceBorderWidth_exists()?this.surfaceBorderWidth()+"px":null).style("border-color",this.surfaceBorderColor()).style("border-radius",this.surfaceBorderRadius_exists()?this.surfaceBorderRadius()+"px":null).style("background-color",this.surfaceBackgroundColor());var r=o.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);r.enter().insert("h3","div").attr("class","surfaceTitle").merge(r).text(function(t){return t}).style("text-align",this.surfaceTitleAlignment()).style("color",this.surfaceTitleFontColor()).style("font-size",this.surfaceTitleFontSize_exists()?this.surfaceTitleFontSize()+"px":null).style("font-family",this.surfaceTitleFontFamily()).style("font-weight",this.surfaceTitleFontBold()?"bold":"normal").style("background-color",this.surfaceTitleBackgroundColor()).style("padding",this.surfaceTitlePadding_exists()?this.surfaceTitlePadding()+"px":null).style("title",this.altText_exists()?this.altText():null),r.exit().remove();var n=o.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());n.enter().append("button").classed("surface-button",!0).each(function(t,i){var o=l._surfaceButtons[i]=e.select(this).attr("class","surface-button"+(t.class?" "+t.class:"")).attr("id",t.id).style("padding",t.padding).style("width",t.width).style("height",t.height).style("cursor","pointer");"FontAwesome"===t.font?o.style("background","transparent").style("border","none").on("click",function(t){l.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):o.text(function(){return t.label}).on("click",function(t){l.click(t)})}),n.exit().each(function(t,i){var o=e.select(this);delete l._surfaceButtons[i],o.remove()});var s=o.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(l.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(s).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){var i=l.widgetSize(o.select("h3"),e.select(this));i.width<0&&(i.width=0),i.height<0&&(i.height=0),t.resize({width:i.width,height:i.height})}),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},i.prototype.click=function(t){console.log("Clicked: "+t.id)},i}(e.HTMLWidget);u.prototype._class+=" layout_Surface",u.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),u.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),u.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),u.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),u.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),u.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),u.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),u.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),u.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),u.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});d(".layout_Cell .update-indicator{box-sizing:border-box;position:absolute;top:0;left:0;padding:0;z-index:1000;border-width:0;border-style:solid;pointer-events:none}");var g=function(t){function i(){var e=t.call(this)||this;return e._indicateTheseIds=[],e}return r(i,t),i.prototype.indicateTheseIds=function(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;i.classed("layout_Surface",!0).on("mouseenter",function(){o.onMouseEnter()}).on("mouseleave",function(){o.onMouseLeave()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i)},i.prototype.onMouseEnter=function(){for(var t=this.indicateTheseIds(),i=this.indicatorOpacity(),o=this.indicatorBorderColor(),l=this.indicatorGlowColor(),r=0;r<t.length;r++){var n=e.select("#"+t[r]),s=n.datum();n&&s&&n.append("div").attr("class","update-indicator").style("width",s.width()+"px").style("height",s.height()+"px").style("opacity",i).style("border-color",o).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+l).style("-moz-box-shadow","inset 0px 0px 30px 0px "+l).style("box-shadow","inset 0px 0px 30px 0px "+l)}},i.prototype.onMouseLeave=function(){for(var t=this.indicateTheseIds(),i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()},i}(u);g.prototype._class+=" layout_Cell",g.prototype.publish("gridRow",0,"number","Grid Row Position",null,{tags:["Private"]}),g.prototype.publish("gridCol",0,"number","Grid Column Position",null,{tags:["Private"]}),g.prototype.publish("gridRowSpan",1,"number","Grid Row Span",null,{tags:["Private"]}),g.prototype.publish("gridColSpan",1,"number","Grid Column Span",null,{tags:["Private"]}),g.prototype.publish("indicatorGlowColor","#EEEE11","html-color","Glow color of update-indicator",null,{tags:["Basic"]}),g.prototype.publish("indicatorBorderColor","#F48A00","html-color","Border color of update-indicator",null,{tags:["Basic"]}),g.prototype.publish("indicatorOpacity",.8,"number","Opacity of update-indicator",null,{tags:["Basic"]});d(".layout_Border{width:100%;height:100%}.layout_Border>.border-content{width:100%;height:100%;position:relative}.layout_Border>.borderHandle{width:6px;height:6px;background-color:#444;opacity:.3;position:absolute;visibility:hidden}.layout_Border.design-mode>.borderHandle{visibility:visible}.layout_Border>.borderHandle:hover{background-color:#666}.layout_Border>.borderHandle.borderHandleDisabled{display:none}.layout_Border>.borderHandle_bottom,.layout_Border>.borderHandle_top{cursor:ns-resize}.layout_Border>.borderHandle_left,.layout_Border>.borderHandle_right{cursor:ew-resize}.layout_Border .cell{border-radius:5px;border:1px solid #e5e5e5;display:inline-block;overflow:hidden}.layout_Border .cell h2{margin:0;padding-top:4px;-webkit-margin:0;text-align:center}.layout_Border .layout_BorderCell.over{border:2px dashed #000}.layout_Border .dragItem{z-index:-1;opacity:.33}.layout_Border .notDragItem{z-index:-1;opacity:1}.layout_Border div[draggable=true]{opacity:.75;cursor:default}.layout_Border div[draggable=true] .dragHandle{opacity:1}.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_n,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_ne,.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_se,.layout_Border div[draggable=true] .dragHandle_sw{background-color:#333}.layout_Border div[draggable=true] .dragHandle_nw{cursor:nw-resize}.layout_Border div[draggable=true] .dragHandle_n{cursor:n-resize}.layout_Border div[draggable=true] .dragHandle_ne{cursor:ne-resize}.layout_Border div[draggable=true] .dragHandle_e{cursor:e-resize}.layout_Border div[draggable=true] .dragHandle_se{cursor:se-resize}.layout_Border div[draggable=true] .dragHandle_s{cursor:s-resize}.layout_Border div[draggable=true] .dragHandle_sw{cursor:sw-resize}.layout_Border div[draggable=true] .dragHandle_w{cursor:w-resize}.layout_Border div[draggable=false]>div>.dragHandle{display:none}.layout_Border .grid-drop-target{position:fixed;box-sizing:border-box;border:2px dashed #7f8c8d;border-radius:0;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39.2%,.1) 0,hsla(0,0%,39.2%,.1) 8px)}.layout_Border .grid-drop-target.drop-target-over{border:2px dashed #179bd7;background:repeating-linear-gradient(-45deg,transparent,transparent 6px,rgba(17,155,215,.1) 0,rgba(17,155,215,.1) 12px)}");var f=function(t){function i(){var i=t.call(this)||this;return i.lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100),i._tag="div",i._colCount=0,i._rowCount=0,i._colSize=0,i._rowSize=0,i._shrinkWrapBoxes={},i.content([]),i.sectionTypes([]),i}return r(i,t),i.prototype.watchWidget=function(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){var e=this;this._watch[t.id()]=t.monitor(function(t,i,o){o!==i&&e.lazyPostUpdate()})}},i.prototype.applyLayoutType=function(){var t=this.borderLayoutObject();this.content().forEach(function(e,i){e._fixedLeft=t[this.sectionTypes()[i]].left,e._fixedTop=t[this.sectionTypes()[i]].top,e._fixedWidth=t[this.sectionTypes()[i]].width,e._fixedHeight=t[this.sectionTypes()[i]].height,e._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[i])},this)},i.prototype.cellSpecificDragHandles=function(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}},i.prototype.borderLayoutObject=function(t){var e,i,o,l,r,n,s,a,h={},d=this,p=this.target().getBoundingClientRect(),c={};c.top=p.top,c.left=p.left,c.bottom=p.bottom,c.right=p.right,this.target()instanceof SVGElement?(c.width=parseFloat(this.target().getAttribute("width")),c.height=parseFloat(this.target().getAttribute("height"))):(c.width=p.width,c.height=p.height),-1!==this.sectionTypes().indexOf("top")&&(e=this.topSize(),i=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(e=this._shrinkWrapBoxes.top.height+this.gutter(),i=0)),-1!==this.sectionTypes().indexOf("bottom")&&(o=this.bottomSize(),l=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(o=this._shrinkWrapBoxes.bottom.height+this.gutter(),l=0)),-1!==this.sectionTypes().indexOf("left")&&(r=this.leftSize(),n=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(r=this._shrinkWrapBoxes.left.width+this.gutter(),n=0)),-1!==this.sectionTypes().indexOf("right")&&(s=this.rightSize(),a=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(s=this._shrinkWrapBoxes.right.width+this.gutter(),a=0));var u=_({width:{px:0,"%":100},height:{px:e,"%":i},top:{px:0,"%":0},left:{px:0,"%":0}}),g=_({width:{px:0,"%":100},height:{px:o,"%":l},top:{px:0,"%":100},left:{px:0,"%":0}});g.top-=g.height;var f=_({width:{px:r,"%":n},height:{px:-u.height-g.height,"%":100},top:{px:u.height,"%":0},left:{px:0,"%":0}}),y=_({width:{px:s,"%":a},height:{px:-u.height-g.height,"%":100},top:{px:u.height,"%":0},left:{px:0,"%":100}});y.left-=y.width;var b=_({width:{px:-y.width-f.width,"%":100},height:{px:-u.height-g.height,"%":100},top:{px:u.height,"%":0},left:{px:f.width,"%":0}});return h.top=u,h.bottom=g,h.right=y,h.left=f,h.center=b,h;function _(t){return t.width.px=void 0!==t.width.px?t.width.px:0,t.width["%"]=void 0!==t.width["%"]?t.width["%"]:0,t.height.px=void 0!==t.height.px?t.height.px:0,t.height["%"]=void 0!==t.height["%"]?t.height["%"]:0,{width:t.width.px+t.width["%"]/100*d.width(),height:t.height.px+t.height["%"]/100*d.height(),top:t.top.px+t.top["%"]/100*d.height()+d.gutter()/2,left:t.left.px+t.left["%"]/100*d.width()+d.gutter()/2}}},i.prototype.clearContent=function(t){if(t){var i=this.sectionTypes().indexOf(t);i>=0&&(this._watch&&this.content()[i]&&delete this._watch[this.content()[i].id()],this.content()[i].target(null),e.select("#"+this.id()+" > div.borderHandle_"+t).classed("borderHandleDisabled",!0),this.content().splice(i,1),this.sectionTypes().splice(i,1))}else this.content().forEach(function(t){return t.target(null),!1}),e.select("#"+this.id()+" > div.borderHandle").classed("borderHandleDisabled",!0),delete this._watch,this.content([]),this.sectionTypes([])},i.prototype.hasContent=function(t,e,i){return this.sectionTypes().indexOf(t)>=0},i.prototype.setContent=function(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){var o=(new g).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(o),this.sectionTypes().push(t)}return this},i.prototype.getCell=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null},i.prototype.getContent=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null},i.prototype.setLayoutOffsets=function(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2},i.prototype.dragStart=function(t){var i=e.d3Event();i.sourceEvent.stopPropagation();this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));var o=e.select("#"+this.id()+" > div.borderHandle_"+t);this._handleTop=parseFloat(o.style("top").split("px")[0]),this._handleLeft=parseFloat(o.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY},i.prototype.dragTick=function(t){var i=this,o=e.d3Event(),l=this._dragPrevX-o.sourceEvent.clientX,r=this._dragPrevY-o.sourceEvent.clientY;switch(t){case"top":case"bottom":n(t,r);break;case"right":case"left":n(t,l)}function n(t,o){if(0!==o){var l=e.selectAll("#"+i.id()+" > div.borderHandle"),r=e.select("#"+i.id()+" > div.borderHandle_"+t);r.classed("borderHandle_top")?(r.style("top",i._handleTop-o+"px"),i._cellSizes.topHeight=i._handleTop-o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):r.classed("borderHandle_right")?(r.style("left",i._handleLeft-o+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+o):r.classed("borderHandle_bottom")?(r.style("top",i._handleTop-o+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):r.classed("borderHandle_left")&&(r.style("left",i._handleLeft-o+"px"),i._cellSizes.leftWidth=i._handleLeft-o),l.each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",i._cellSizes.width-i._cellSizes.rightWidth+"px"),t.style("top",i._cellSizes.topHeight+3+"px"),t.style("height",i._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.height-i._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",i._cellSizes.leftWidth+"px"),t.style("height",i._cellSizes.leftHeight+"px"),t.style("top",i._cellSizes.topHeight+3+"px"))})}}},i.prototype.dragEnd=function(t){if(t){var i=e.d3Event(),o=this._dragPrevX-i.sourceEvent.clientX,l=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==l&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-l:this.topSize()-l));break;case"right":0!==o&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+o:this.rightSize()+o));break;case"bottom":0!==l&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+l:this.bottomSize()+l));break;case"left":0!==o&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-o:this.leftSize()-o))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()},i.prototype.size=function(t){var i=e.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this.contentDiv&&this.contentDiv.style("width",this._size.width+"px").style("height",this._size.height+"px"),i},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var l=this;o.style("position","relative"),this.contentDiv=o.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"],o.selectAll("div.borderHandle").data(this._borderHandles).enter().append("div").classed("borderHandle",!0).each(function(t){e.select(this).classed("borderHandle_"+t,!0).classed("borderHandleDisabled",null===l.getContent(t))})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._sectionTypeArr=this.sectionTypes();var l=this;o.classed("design-mode",this.designMode()),this.setLayoutOffsets();var r=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),n=r.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+l._sectionTypeArr[i],!0),t.target(this),e.select("#"+l.id()+" > div.borderHandle_"+l._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(r);n.each(function(t,e){var i=l.sectionTypes()[e];void 0!==l[i+"ShrinkWrap"]&&l[i+"ShrinkWrap"]()?(t.render(),l._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete l._shrinkWrapBoxes[i]});var s=e.drag().on("start",function(t,e){l.dragStart.call(l,t,e)}).on("drag",function(t,e){l.dragTick.call(l,t,e)}).on("end",function(t,e){l.dragEnd.call(l,t,e)});this.designMode()?o.selectAll("#"+this.id()+" > div.borderHandle").call(s):o.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);var a=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=a[this.sectionTypes()[e]].left,t._fixedTop=a[this.sectionTypes()[e]].top,t._fixedWidth=a[this.sectionTypes()[e]].width,t._fixedHeight=a[this.sectionTypes()[e]].height,t._dragHandles=[]},this),n.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-l.gutter()+"px"}).style("height",function(t){return t._fixedHeight-l.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",l.designMode()).selectAll(".dragHandle").attr("draggable",l.designMode()),t.surfacePadding(l.surfacePadding()).resize()}),r.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),o.selectAll("#"+this.id()+" > div.borderHandle").each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",l._cellSizes.width+"px"),t.style("top",l._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",l._cellSizes.width-l._cellSizes.rightWidth+"px"),t.style("top",l._cellSizes.topHeight+3+"px"),t.style("height",l._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",l._cellSizes.width+"px"),t.style("top",l._cellSizes.height-l._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",l._cellSizes.leftWidth+"px"),t.style("height",l._cellSizes.leftHeight+"px"),t.style("top",l._cellSizes.topHeight+3+"px"))})},i.prototype.getCellSizes=function(){var t=this;t._cellSizes={};var i=this.element().node().getBoundingClientRect();t._cellSizes.width=i.width,t._cellSizes.height=i.height,this.element().selectAll("#"+this.id()+" > div > div.border-cell").each(function(){var i=e.select(this);if("function"==typeof i.node){var o=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=o.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=o.width,t._cellSizes.leftHeight=o.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=o.width,t._cellSizes.rightHeight=o.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=o.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})},i.prototype.postUpdate=function(t,e){var i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){var e=t.widget().getBBox(!1,!0),o=t.widget().getBBox(!0,!0);e.width===o.width&&e.height===o.height||i.lazyRender()}})},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);f.prototype._class+=" layout_Border",f.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),f.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),f.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),f.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),f.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),f.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),f.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),f.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),f.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});d(".layout_Border2{display:flex;flex-direction:column}.layout_Border2>.body{margin:0;padding:0;display:flex;flex-flow:row}.layout_Border2>.body>.center{flex:1}.layout_Border2>.footer,.layout_Border2>.header{display:block}");var y=function(){function t(t){this._overlay=!1,this._overflowX="visible",this._overflowY="visible",this._div=t}return t.prototype.overlay=function(t){return arguments.length?(this._overlay=t,this):this._overlay},t.prototype.overflowX=function(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX},t.prototype.overflowY=function(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY},t.prototype.element=function(){return this._div},t.prototype.node=function(){return this._div.node()},t.prototype.widget=function(t){return arguments.length?(this._widget!==t&&(this._widget&&this._widget.target(null),this._widget=t,this._widget&&this._widget.target(this._div.node())),this):this._widget},t.prototype.resize=function(t){return this._widget&&(this._div.style("width",t.width+"px").style("height",t.height+"px"),this._widget.resize(t)),this},t.prototype.render=function(t,i,o){return s(this,void 0,void 0,function(){var l,r,n=this;return a(this,function(s){return l=this.overflowX(),this.overlay()||"visible"!==l||(l=null),r=this.overflowY(),this.overlay()||"visible"!==r||(r=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",l).style("overflow-y",r),this._widget?[2,this._widget.renderPromise().then(function(l){if(t&&n._widget.visible()){var r=n._widget.getBBox();return r.width+=8,void 0!==i&&r.height>i&&(r.width+=e.Platform.getScrollbarWidth()),void 0!==o&&r.width>o&&(r.height+=e.Platform.getScrollbarWidth()),n.overlay()?r.height=0:r.height+=4,r}return t?{x:0,y:0,width:0,height:0}:void 0})]:[2,Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)]})})},t}(),b=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return r(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=i.append("header");this._bodyElement=i.append("div").attr("class","body");var l=this._bodyElement.append("div").attr("class","center"),r=this._bodyElement.append("div").attr("class","lhs"),n=this._bodyElement.append("div").attr("class","rhs"),s=i.append("div").attr("class","footer");this._topWA=new y(o),this._centerWA=new y(l),this._leftWA=new y(r),this._rightWA=new y(n),this._bottomWA=new y(s)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topWA.element().style("display",this.showTop()?null:"none"),this._rightWA.element().style("display",this.showRight()?null:"none"),this._bottomWA.element().style("display",this.showBottom()?null:"none"),this._leftWA.element().style("display",this.showLeft()?null:"none"),this.topOverflowX()!==this._topWA.overflowX()&&this._topWA.overflowX(this.topOverflowX()),this.rightOverflowX()!==this._rightWA.overflowX()&&this._rightWA.overflowX(this.rightOverflowX()),this.bottomOverflowX()!==this._bottomWA.overflowX()&&this._bottomWA.overflowX(this.bottomOverflowX()),this.leftOverflowX()!==this._leftWA.overflowX()&&this._leftWA.overflowX(this.leftOverflowX()),this.topOverflowY()!==this._topWA.overflowY()&&this._topWA.overflowY(this.topOverflowY()),this.rightOverflowY()!==this._rightWA.overflowY()&&this._rightWA.overflowY(this.rightOverflowY()),this.bottomOverflowY()!==this._bottomWA.overflowY()&&this._bottomWA.overflowY(this.bottomOverflowY()),this.leftOverflowY()!==this._leftWA.overflowY()&&this._leftWA.overflowY(this.leftOverflowY()),this.element().style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.targetNull=function(t){t&&t.target(null)},e.prototype.exit=function(e,i){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),t.prototype.exit.call(this,e,i)},e.prototype.swap=function(t,e){var i=this[t](),o=this[e]();return this.targetNull(i),this.targetNull(o),this["_"+t+"WA"].widget(null),this["_"+e+"WA"].widget(null),this[t](o),this[e](i),this},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){i._topWA?i._topWA.widget(i.top()).overlay(i.topOverlay()).render(!0).then(function(t){return s(i,void 0,void 0,function(){var i,o,l,r,n,s,h,d,p,c,u,g=this;return a(this,function(a){switch(a.label){case 0:return[4,this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width())];case 1:return i=a.sent(),o=this.height()-(t.height+i.height),[4,this._leftWA.widget(this.left()).render(!0,o)];case 2:return l=a.sent(),[4,this._rightWA.widget(this.right()).render(!0,o)];case 3:return r=a.sent(),this.bottomHeight_exists()&&(i.height=this.bottomHeight()),n=this.width()-(l.width+r.width),s=this.height()-(t.height+i.height),h=this.centerOverflowX(),d=this.centerOverflowY(),p=-1!==["auto","scroll"].indexOf(h),c=-1!==["auto","scroll"].indexOf(d),(p||c)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bodyElement.style("height",s+"px"),u=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:t.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:l.width,height:s}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:r.width,height:s}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()],Promise.all(u).then(function(t){e&&e(g)}),[2]}})})}):e&&e(i)})},e}(e.HTMLWidget);b.prototype._class+=" layout_Border2",b.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),b.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),b.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),b.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),b.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),b.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),b.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),b.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),b.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),b.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),b.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});d(".layout_Carousel>div{position:relative;overflow:hidden}.layout_Carousel>div>.carouselItem{position:absolute}");var _=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._prevActive=0,e}return r(i,t),i.prototype.activeWidget=function(){return this.widgets()[this.active()]},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._root=i.append("div").attr("id",this.id()+"_root")},i.prototype.update=function(i,o){var l=this;t.prototype.update.call(this,i,o);var r=this.active(),n=this.width();this._root.style("width",n+"px").style("height",this.height()+"px");var s=this._root.selectAll("#"+this.id()+"_root > .carouselItem").data(this.widgets(),function(t){return t.id()}),a=s.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(s).style("left",function(t,e){return(e-l._prevActive)*n+"px"}).style("width",n+"px");this._prevActive!==r&&(a.style("display",function(t,e){return e===l._prevActive||e===r?null:"none"}).transition().duration(this.transitionDuration()).style("left",function(t,e){return(e-r)*n+"px"}).on("end",function(t,i){e.select(this).style("display",function(){return i===r?null:"none"})}),this._prevActive=r),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widgets().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){if(!i.visible()||i.isDOMHidden())e&&e(t);else{var o=i.activeWidget();o&&o.resize(i.size()).render(function(i){e&&e(t)})}})},i}(e.HTMLWidget);_.prototype._class+=" layout_Carousel",_.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),_.prototype.publish("active",0,"number","Active widget"),_.prototype.publish("transitionDuration",500,"number","Transition duration");var v=Math.PI,w=2*v,m=w-1e-6;function x(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function C(){return new x}function S(t){return function(){return t}}x.prototype=C.prototype={constructor:x,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,o){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+o)},bezierCurveTo:function(t,e,i,o,l,r){this._+="C"+ +t+","+ +e+","+ +i+","+ +o+","+(this._x1=+l)+","+(this._y1=+r)},arcTo:function(t,e,i,o,l){t=+t,e=+e,i=+i,o=+o,l=+l;var r=this._x1,n=this._y1,s=i-t,a=o-e,h=r-t,d=n-e,p=h*h+d*d;if(l<0)throw new Error("negative radius: "+l);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>1e-6)if(Math.abs(d*s-a*h)>1e-6&&l){var c=i-r,u=o-n,g=s*s+a*a,f=c*c+u*u,y=Math.sqrt(g),b=Math.sqrt(p),_=l*Math.tan((v-Math.acos((g+p-f)/(2*y*b)))/2),w=_/b,m=_/y;Math.abs(w-1)>1e-6&&(this._+="L"+(t+w*h)+","+(e+w*d)),this._+="A"+l+","+l+",0,0,"+ +(d*c>h*u)+","+(this._x1=t+m*s)+","+(this._y1=e+m*a)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,i,o,l,r){t=+t,e=+e,r=!!r;var n=(i=+i)*Math.cos(o),s=i*Math.sin(o),a=t+n,h=e+s,d=1^r,p=r?o-l:l-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+a+","+h:(Math.abs(this._x1-a)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+a+","+h),i&&(p<0&&(p=p%w+w),p>m?this._+="A"+i+","+i+",0,1,"+d+","+(t-n)+","+(e-s)+"A"+i+","+i+",0,1,"+d+","+(this._x1=a)+","+(this._y1=h):p>1e-6&&(this._+="A"+i+","+i+",0,"+ +(p>=v)+","+d+","+(this._x1=t+i*Math.cos(l))+","+(this._y1=e+i*Math.sin(l))))},rect:function(t,e,i,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +o+"h"+-i+"Z"},toString:function(){return this._}};var T=Math.PI,B=2*T,z={draw:function(t,e){var i=Math.sqrt(e/T);t.moveTo(i,0),t.arc(0,0,i,0,B)}},P={draw:function(t,e){var i=Math.sqrt(e/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},A=Math.sqrt(1/3),W=2*A,H={draw:function(t,e){var i=Math.sqrt(e/W),o=i*A;t.moveTo(0,-i),t.lineTo(o,0),t.lineTo(0,i),t.lineTo(-o,0),t.closePath()}},I=Math.sin(T/10)/Math.sin(7*T/10),k=Math.sin(B/10)*I,M=-Math.cos(B/10)*I,F={draw:function(t,e){var i=Math.sqrt(.8908130915292852*e),o=k*i,l=M*i;t.moveTo(0,-i),t.lineTo(o,l);for(var r=1;r<5;++r){var n=B*r/5,s=Math.cos(n),a=Math.sin(n);t.lineTo(a*i,-s*i),t.lineTo(s*o-a*l,a*o+s*l)}t.closePath()}},O={draw:function(t,e){var i=Math.sqrt(e),o=-i/2;t.rect(o,o,i,i)}},D=Math.sqrt(3),L={draw:function(t,e){var i=-Math.sqrt(e/(3*D));t.moveTo(0,2*i),t.lineTo(-D*i,-i),t.lineTo(D*i,-i),t.closePath()}},R=-.5,G=Math.sqrt(3)/2,E=1/Math.sqrt(12),Y=3*(E/2+1),X={draw:function(t,e){var i=Math.sqrt(e/Y),o=i/2,l=i*E,r=o,n=i*E+i,s=-r,a=n;t.moveTo(o,l),t.lineTo(r,n),t.lineTo(s,a),t.lineTo(R*o-G*l,G*o+R*l),t.lineTo(R*r-G*n,G*r+R*n),t.lineTo(R*s-G*a,G*s+R*a),t.lineTo(R*o+G*l,R*l-G*o),t.lineTo(R*r+G*n,R*n-G*r),t.lineTo(R*s+G*a,R*a-G*s),t.closePath()}};function V(){var t=S(z),e=S(64),i=null;function o(){var o;if(i||(i=o=C()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),o)return i=null,o+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:S(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:S(+t),o):e},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o}var N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j=function(t){return t},U=function(t){for(var e=[],i=0,o=t.length;i<o;i++)e[i]=t[o-i-1];return e},q=function(t,i){t.each(function(){for(var t,o=e.select(this),l=o.text().split(/\s+/).reverse(),r=[],n=(o.attr("y"),parseFloat(o.attr("dy"))||0),s=o.text(null).append("tspan").attr("x",0).attr("dy",n+"em");t=l.pop();)r.push(t),s.text(r.join(" ")),s.node().getComputedTextLength()>i&&r.length>1&&(r.pop(),s.text(r.join(" ")),r=[t],s=o.append("tspan").attr("x",0).attr("dy",1.2+n+"em").text(t))})},K={d3_drawShapes:function(t,e,i,o,l,r){"rect"===t?e.attr("height",i).attr("width",o):"circle"===t?e.attr("r",l):"line"===t?e.attr("x1",0).attr("x2",o).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",r)},d3_addText:function(t,e,i,o,l){e.append("text").attr("class",o+"label");var r=t.selectAll("g."+o+"cell text."+o+"label").data(i).text(j);return l&&t.selectAll("g."+o+"cell text."+o+"label").call(q,l),r},d3_calcType:function(t,e,i,o,l,r){var n=t.invertExtent?function(t,e,i){var o=t.range().map(function(o){var l=t.invertExtent(o);return e(l[0])+" "+i+" "+e(l[1])});return{data:t.range(),labels:o,feature:j}}(t,l,r):t.ticks?function(t,e,i){var o=[];if(e.length>1)o=e;else for(var l=t.domain(),r=(l[l.length-1]-l[0])/(e-1),n=0;n<e;n++)o.push(l[0]+n*r);var s=o.map(i);return{data:o,labels:s,feature:function(e){return t(e)}}}(t,i,l):function(t){return{data:t.domain(),labels:t.domain(),feature:function(e){return t(e)}}}(t),s=t.range&&t.range()||t.domain();return n.labels=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],o=arguments[3];if("object"===(void 0===e?"undefined":N(e))){if(0===e.length)return t;for(var l=e.length;l<t.length;l++)e.push(t[l]);return e}if("function"==typeof e){for(var r=[],n=t.length,s=0;s<n;s++)r.push(e({i:s,genLength:n,generatedLabels:t,domain:i,range:o}));return r}return t}(n.labels,o,t.domain(),s),e&&(n.labels=U(n.labels),n.data=U(n.data)),n},d3_filterCells:function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),o=i.map(function(t){return t.data}),l=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==o.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==l.indexOf(t)}),t},d3_placement:function(t,e,i,o,l,r){e.attr("transform",i),o.attr("transform",l),"horizontal"===t&&o.style("text-anchor",r)},d3_addEvents:function(t,e){t.on("mouseover.legend",function(t){!function(t,e,i){t.call("cellover",i,e)}(e,t,this)}).on("mouseout.legend",function(t){!function(t,e,i){t.call("cellout",i,e)}(e,t,this)}).on("click.legend",function(t){!function(t,e,i){t.call("cellclick",i,e)}(e,t,this)})},d3_title:function(t,e,i,o){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),o&&t.selectAll("text."+i+"legendTitle").call(q,o);var l=t.select("."+i+"legendCells"),r=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],n=-l.nodes().map(function(t){return t.getBBox().x})[0];l.attr("transform","translate("+n+","+r+")")}},d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};var J=function(t){function i(i){var o=t.call(this)||this;o._disabled=[],o._symbolTypeMap={circle:z,cross:P,diamond:H,square:O,star:F,triangle:L,wye:X},o._owner=i,o._drawStartPos="origin";var l=o;return o._legendOrdinal=function(){var t=e.scaleLinear(),i="rect",o=15,l=15,r=10,n=2,s=[5],a=void 0,h=[],d="",p=!1,c="",u=K.d3_defaultLocale,g=K.d3_defaultFormatSpecifier,f=10,y="middle",b=K.d3_defaultDelimiter,_=void 0,v="vertical",w=!1,m=void 0,x=void 0,C=e.dispatch("cellover","cellout","cellclick");function S(S){var T=K.d3_calcType(t,w,s,h,u.format(g),b);S.selectAll("g").data([t]).enter().append("g").attr("class",d+"legendCells"),a&&K.d3_filterCells(T,a);var B=S.select("."+d+"legendCells").selectAll("."+d+"cell").data(T.data),z=B.enter().append("g").attr("class",d+"cell");z.append(i).attr("class",d+"swatch");var P=S.selectAll("g."+d+"cell "+i+"."+d+"swatch").data(T.data);K.d3_addEvents(z,C),B.exit().transition().style("opacity",0).remove(),P.exit().transition().style("opacity",0).remove(),P=P.merge(P),K.d3_drawShapes(i,P,l,o,r,m);var A=K.d3_addText(S,z,T.labels,d,_);B=z.merge(B);var W=A.nodes().map(function(t){return t.getBBox()}),H=P.nodes().map(function(t){return t.getBBox()});p?P.attr("class",function(t){return d+"swatch "+T.feature(t)}):"line"==i?P.style("stroke",T.feature):P.style("fill",T.feature);var I,k=void 0,M=void 0,F="start"==y?0:"middle"==y?.5:1;"vertical"===v?(I=W.map(function(t,e){return Math.max(t.height,H[e].height)}),k=function(t,i){return"translate(0, "+(e.sum(I.slice(0,i))+i*n)+")"},M=function(t,e){return"translate( "+(H[e].width+H[e].x+f)+", "+(H[e].y+H[e].height/2+5)+")"}):"horizontal"===v&&(k=function(t,e){return"translate("+e*(H[e].width+n)+",0)"},M=function(t,e){return"translate("+(H[e].width*F+H[e].x)+",\n "+(H[e].height+H[e].y+f+8)+")"}),K.d3_placement(v,B,k,A,M,y),K.d3_title(S,c,d,x),B.transition().style("opacity",1)}return S.scale=function(e){return arguments.length?(t=e,S):t},S.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(s=t),S):s},S.cellFilter=function(t){return arguments.length?(a=t,S):a},S.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,m=e),S):i},S.shapeWidth=function(t){return arguments.length?(o=+t,S):o},S.shapeHeight=function(t){return arguments.length?(l=+t,S):l},S.shapeRadius=function(t){return arguments.length?(r=+t,S):r},S.shapePadding=function(t){return arguments.length?(n=+t,S):n},S.labels=function(t){return arguments.length?(h=t,S):h},S.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),S):y},S.locale=function(t){return arguments.length?(u=e.formatLocale(t),S):u},S.labelFormat=function(t){return arguments.length?(g=e.formatSpecifier(t),S):S.locale().format(g)},S.labelOffset=function(t){return arguments.length?(f=+t,S):f},S.labelDelimiter=function(t){return arguments.length?(b=t,S):b},S.labelWrap=function(t){return arguments.length?(_=t,S):_},S.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(p=t),S):p},S.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(v=t),S):v},S.ascending=function(t){return arguments.length?(w=!!t,S):w},S.classPrefix=function(t){return arguments.length?(d=t,S):d},S.title=function(t){return arguments.length?(c=t,S):c},S.titleWidth=function(t){return arguments.length?(x=t,S):x},S.textWrap=function(t){return arguments.length?(textWrap=t,S):textWrap},S.on=function(){var t=C.on.apply(C,arguments);return t===C?S:t},S}().shape("path",V().type(z).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){l.onClick(t,this)}).on("cellover",function(t){l.onOver(t,o)}).on("cellout",function(t){l.onOut(t,o)}),o}return r(i,t),i.prototype.isDisabled=function(t){return void 0!==t&&("string"==typeof t?0===t.indexOf("__")||this._disabled.indexOf(t)>=0:t instanceof e.Database.Field?0===t.id().indexOf("__")||this._disabled.indexOf(t.id())>=0:this._disabled.indexOf(t)>=0)},i.prototype.filteredFields=function(){var t=this;switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(function(e){return!t.isDisabled(e)})}return this.fields()},i.prototype.filteredColumns=function(){var t=this;switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(function(e){return!t.isDisabled(e)})}return this.columns()},i.prototype.filteredData=function(){var t=this;switch(this.dataFamily()){case"2D":return this.data().filter(function(e){return!t.isDisabled(e[0])});case"ND":var e={},i=!1;return this.columns().forEach(function(o,l){var r=t.isDisabled(o);e[l]=r,r&&(i=!0)}),i?this.data().map(function(t){return t.filter(function(t,i){return!e[i]})}):this.data()}return this.data()},i.prototype.isRainbow=function(){var t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()},i.prototype.targetWidget=function(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){var e=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(t,i,o,l){switch(t){case"chart":case"columns":case"data":case"paletteID":e.lazyRender()}})}return this},i.prototype.getWidget=function(){if(this._targetWidget)switch(this._targetWidget.classID()){case"composite_MultiChart":return this._targetWidget.chart()}return this._targetWidget},i.prototype.getPalette=function(){var t=this.getWidget();if(t&&t._palette)switch(t._palette.type()){case"ordinal":return e.Palette.ordinal(t._palette.id());case"rainbow":return e.Palette.rainbow(t._palette.id())}return e.Palette.ordinal("default")},i.prototype.getPaletteType=function(){return this.getPalette().type()},i.prototype.fillColorFunc=function(){var t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),function(e,i,o){return t.fillColor(e,i,o)};var i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return function(t,e,o){return i(e)}},i.prototype.fillColor=function(t,e,i){return this.fillColorFunc()(t,e,i)},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._g=i.append("g").attr("class","legendOrdinal")},i.prototype.calcMetaData=function(){var t=[],i=0,o=0,l=this.columns().length;if(this._targetWidget){var r=this.columns();switch(this.getPaletteType()){case"ordinal":var n=this.fillColorFunc(),s=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){s=this.data()[e].slice(1,l).reduce(function(t,e){return t+e},0);var r=this.isDisabled(t[0]);r||(i+=s);var a=t[0]+(!r&&this.showSeriesTotal()?" ("+s+")":""),h=this.textSize(a);return o<h.width&&(o=h.width),[n(t,t[0],!1),t[0],a]},this);break;case"ND":t=this.columns().filter(function(t){return 0!==t.indexOf("__")}).filter(function(t,e){return e>0}).map(function(t,e){s=this.data().reduce(function(t,i){return t+i[e+1]},0);var l=this.isDisabled(r[e+1]),a=t+(!l&&this.showSeriesTotal()?" ("+s+")":"");l||(i+=s);var h=this.textSize(a);return o<h.width&&(o=h.width),[n(void 0,t,!1),t,a]},this);break;default:t=this.columns().map(function(t){return[n(void 0,t,!1),t]},this)}break;case"rainbow":var a=this.getPalette(),h=e.format(this.rainbowFormat()),d=this.getWidget(),p=this.rainbowBins(),c=d._dataMinWeight,u=d._dataMaxWeight,g=(u-c)/(p-1);t.push([a(c,c,u),h(c)]);for(var f=1;f<p-1;++f){var y=g*f;Math.floor(y)>parseInt(t[0][1])&&(y=Math.floor(y)),t.push([a(y,c,u),h(y)])}t.push([a(u,c,u),h(u)])}}return{dataArr:t,total:i,maxLabelWidth:o}},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var l=this.calcMetaData(),r=l.dataArr,n=l.maxLabelWidth,s=l.total,a=this.shapeRadius(),h=this.radiusToSymbolSize(a),d=this.itemPadding();"horizontal"===this.orientation()&&(d+=n-2*a);var p=e.scaleOrdinal().domain(r.map(function(t){return t[1]})).range(r.map(function(t){return t[0]}));this._legendOrdinal.shape("path",V().type(this._symbolTypeMap[this.symbolType()]).size(h)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(d).scale(p).labels(function(t){return r[t.i][2]}),this._g.call(this._legendOrdinal),this.updateDisabled(o,r);var c=this._g.select(".legendCells").node().getBBox(),u=Math.abs(c.x),g=Math.abs(c.y)+1;if("horizontal"===this.orientation())"start"===this.labelAlign()?u+=1:"end"===this.labelAlign()&&(u-=1),this.width()>c.width&&(u+=(this.width()-c.width)/2);else if("vertical"===this.orientation()){if(u+=1,this._containerSize.height>c.height)g+=(this.height()-c.height)/2}this._g.attr("transform","translate("+u+", "+g+")"),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());var f=this._g.selectAll(".legendTotal").data(r.length&&this.showLegendTotal()?[s]:[]),y="Total: "+s,b=-u,_=c.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),f.enter().append("text").classed("legendTotal",!0).merge(f).attr("transform","translate("+b+", "+_+")").text(y),f.exit().remove()},i.prototype.updateDisabled=function(t,e){var i=this;t.style("cursor","pointer").selectAll("path.swatch").filter(function(t,i){return i<e.length}).style("stroke",function(t,i){return e[i][0]}).style("fill",function(t,o){return i._disabled.indexOf(t)<0?e[o][0]:"white"})},i.prototype.postUpdate=function(e,i){var o;this._boundingBox&&(o=this._boundingBox.width,this._boundingBox.width=this._size.width),t.prototype.postUpdate.call(this,e,i),void 0!==o&&(this._boundingBox.width=o),this._parentRelativeDiv.style("overflow","hidden")},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.radiusToSymbolSize=function(t){var e=Math.pow(t,2)*Math.PI;switch(this.symbolType()){case"star":return.45*e;case"triangle":return.65*e;case"cross":case"diamond":case"wye":return.75*e;case"circle":return e;case"square":return 1.3*e}},i.prototype.onClick=function(t,e){switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":var i=this._disabled.indexOf(t);i<0?this._disabled.push(t):this._disabled.splice(i,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}}},i.prototype.onOver=function(t,e){if(o.instanceOfIHighlight(this._owner))switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}}},i.prototype.onOut=function(t,e){if(o.instanceOfIHighlight(this._owner))switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}}},i.prototype.onDblClick=function(t,e){console.log("Legend onDblClick method"),console.log("rowData: "+t),console.log("rowIdx: "+e)},i.prototype.onMouseOver=function(t,e){console.log("Legend onMouseOver method"),console.log("rowData: "+t),console.log("rowIdx: "+e)},i.prototype.resize=function(e){var i;if(this.fitToContent()){this._containerSize=e;var o=this.getBBox();e.width>o.width&&(o.width=e.width),e.height>o.height&&(o.height=e.height),i=t.prototype.resize.apply(this,[n({},o)])}else i=t.prototype.resize.apply(this,arguments);return i},i}(e.SVGWidget);J.prototype._class+=" layout_Legend",J.prototype.publish("title","","string","Title"),J.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),J.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),J.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),J.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),J.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:function(t){return!t.isRainbow()}}),J.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:function(t){return!t.isRainbow()}}),J.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),J.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),J.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),J.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),J.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),J.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:function(t){return"vertical"===t.orientation()}});d(".layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-y:scroll;overflow-x:hidden}.layout_Modal-annotations,.layout_Modal-title{position:absolute}.layout_Modal-closeButton{cursor:pointer}.layout_Modal-closeButton:hover{opacity:.7}.layout_Modal-closeButton:active{opacity:.5}.layout_Modal-fade{position:fixed;background-color:#000;opacity:.5;z-index:10000}.layout_Modal-content{position:fixed;background-color:#fff;z-index:10100}.layout_Modal-fade-hidden{display:none}.layout_Modal-fadeClickable{cursor:pointer}");var Z=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return r(e,t),e.prototype.closeModal=function(){this.visible(!1)},e.prototype.getRelativeTarget=function(){var t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()))?t:!t&&(t=this.locateAncestor("layout_Grid"))&&t.element?t.element().node():document.body},e.prototype.setModalSize=function(){null!==this.fixedHeight()&&null!==this.fixedWidth()?this._modal.style("height",this.fixedHeight()).style("width",this.fixedWidth()).style("min-height",null).style("min-width",null).style("max-height",null).style("max-width",null):(this.minHeight()||this.minWidth())&&this._modal.style("min-height",this.minHeight()).style("min-width",this.minWidth()).style("max-height",this.maxHeight()).style("max-width",this.maxWidth());var t=this._modal.node().getBoundingClientRect(),e=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style("height",t.height-e.height+"px").style("width",t.width),t},e.prototype.setFadePosition=function(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")},e.prototype.setModalPosition=function(t){var e=this.setModalSize();if(null!==this.fixedTop()&&null!==this.fixedLeft())this._modal.style("top","calc("+this.fixedTop()+" + "+t.top+"px)").style("left","calc("+this.fixedLeft()+" + "+t.left+"px)");else if(null!==this.fixedHeight()&&null!==this.fixedWidth())this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px");else if(this.minHeight()||this.minWidth()){var i=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-i.height/2+"px").style("left",t.left+t.width/2-i.width/2+"px")}},e.prototype.resize=function(e){return t.prototype.resize.call(this),this._modal&&this.setModalSize(),this},e.prototype.resizeBodySync=function(t,e){var i=this._modalHeader.node().getBoundingClientRect();return this._modal.style("width",t+"px").style("height",e+i.height+"px").style("min-width",t+"px").style("min-height",e+i.height+"px"),this._modalHeader.style("width",t+"px"),this._modalBody.style("width",t+"px").style("height",e+"px"),this.minWidth(t+"px").minHeight(e+i.height+"px").resize({height:e+i.height,width:t})},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._fade=i.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());var l=2*this.titleFontSize();this._modal=i.append("div").classed("layout_Modal-content",!0),this._modalHeader=this._modal.append("div").classed("layout_Modal-header",!0).style("color",this.titleFontColor()).style("font-size",this.titleFontSize()+"px").style("height",l+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height","calc( 100% - "+l+"px )").style("overflow-x",this.overflowX()).style("overflow-y",this.overflowY()),this._modalHeader.append("div").classed("layout_Modal-title",!0).style("line-height",this.titleFontSize()+"px").style("top",this.titleFontSize()/2+"px").style("left",this.titleFontSize()/2+"px").text(this.formattedTitle()),this._modalHeaderAnnotations=this._modalHeader.append("div").classed("layout_Modal-annotations",!0),this._modalHeaderCloseButton=this._modalHeaderAnnotations.append("div").classed("layout_Modal-closeButton",!0).html('<i class="fa fa-close"></i>'),this._modalHeaderAnnotations.style("line-height",this.titleFontSize()+"px").style("right",this.titleFontSize()/2+"px").style("top",this.titleFontSize()/2+"px"),this._modalHeaderCloseButton.on("click",function(){o.closeModal()}),this._fade.on("click",function(t){o.enableClickFadeToClose()&&o.closeModal()})},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();var o=this._relativeTarget.getBoundingClientRect();this.setFadePosition(o),this.setModalPosition(o),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()},e.prototype.exit=function(e,i){this._widget&&this._widget.target(null),t.prototype.exit.call(this,e,i)},e.prototype.formattedTitle=function(){var t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()},e}(e.HTMLWidget);Z.prototype._class+=" layout_Modal",Z.prototype.publish("title",null,"string","title"),Z.prototype.publish("widget",null,"widget","widget"),Z.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),Z.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),Z.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),Z.prototype.publish("show",!0,"boolean","show"),Z.prototype.publish("showFade",!0,"boolean","showFade"),Z.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),Z.prototype.publish("minWidth","400px","string","minWidth"),Z.prototype.publish("minHeight","400px","string","minHeight"),Z.prototype.publish("maxWidth","800px","string","maxWidth"),Z.prototype.publish("maxHeight","800px","string","maxHeight"),Z.prototype.publish("fixedWidth",null,"string","fixedWidth"),Z.prototype.publish("fixedHeight",null,"string","fixedHeight"),Z.prototype.publish("fixedTop",null,"string","fixedTop"),Z.prototype.publish("fixedLeft",null,"string","fixedLeft"),Z.prototype.publish("overflowX","hidden","string","overflowX"),Z.prototype.publish("overflowY","scroll","string","overflowY");d(".layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}");var Q=function(t){function o(){var o=t.call(this)||this;return o._legend=new J(o).enableOverflow(!0),o._progressBar=new e.ProgressBar,o._autoScale=!1,o._resolutions={tiny:{width:100,height:100},small:{width:300,height:300}},o._modal=new Z,o._toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",function(){return""!==o.description()}).on("click",function(){if(o._toggleInfo.selected()){o._modal.title(o.title()).widget((new e.Text).text(o.description())).show(!0).render();var t=o._modal._close;o._modal._close=function(){o._toggleInfo.selected(!1).render(),o._modal._close=t}}}).on("mouseMove",function(){}).on("mouseOut",function(){}),o._toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",function(){o.dataVisible(o._toggleData.selected()),o.render()}),o._buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",function(){o.downloadCSV()}),o._buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",function(){o.downloadPNG()}),o._toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",function(){var t=o._toggleLegend.selected();"bottom"===o.legendPosition()?o.showBottom(t):"right"===o.legendPosition()&&o.showRight(t),o.legendVisible(t),o.render()}),o._spacer=new e.Spacer,o._titleBar=(new e.TitleBar).buttons([o._toggleData,o._buttonDownload,o._buttonDownloadImage,o._spacer,o._toggleLegend]),o._carousel=new _,o._table=new i.Table,o._hideLegendToggleList=["dgrid_Table"],o._tag="div",o}return r(o,t),o.prototype.fields=function(e){return arguments.length?(t.prototype.fields.call(this,e),this._legend.fields(e),this.refreshFields(),this):t.prototype.fields.call(this)},o.prototype.refreshFields=function(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this},o.prototype.columns=function(e,i){return arguments.length?(t.prototype.columns.call(this,e,i),this._legend.columns(e,i),this.refreshColumns(),this):t.prototype.columns.call(this)},o.prototype.refreshColumns=function(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this},o.prototype.data=function(e){return arguments.length?(t.prototype.data.call(this,e),this._legend.data(e),this.refreshData(),this):t.prototype.data.call(this)},o.prototype.refreshData=function(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this},o.prototype.highlight=function(t){return arguments.length?(this._highlight=t,this):this._highlight},o.prototype.startProgress=function(){this._progressBar.start()},o.prototype.finishProgress=function(){this._progressBar.finish()},o.prototype.buttons=function(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()},o.prototype.downloadCSV=function(){var t=this.downloadTitle()?this.downloadTitle():this.title()?this.title():"data",i=this.downloadTimestampSuffix()?"_"+e.Utility.timestamp():"";return e.Utility.downloadString("CSV",this._widget.export("CSV"),t+i),this},o.prototype.downloadPNG=function(){var t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this},o.prototype.highlightColumn=function(t){if(t){var i="series-"+this.cssTag(t);this._centerWA.element().selectAll(".series").each(function(){var t=e.select(this),o=t.classed(i);t.classed("highlight",o).classed("lowlight",!o)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this},o.prototype.getResponsiveMode=function(){return this.enableAutoscaling()?this._autoScale?this.size().width<=this._resolutions.tiny.width||this.size().height<=this._resolutions.tiny.height?"tiny":this.size().width<=this._resolutions.small.width||this.size().height<=this._resolutions.small.height?"small":"regular":"regular":"none"},o.prototype.setOrigSize=function(){this._orig_size=JSON.parse(JSON.stringify(this.size()))},o.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._modal.target(this.target()).relativeTargetId(this.id()),this.top(this._titleBar),this.center(this._carousel),this._legend.targetWidget(this._widget).orientation("vertical").title("").visible(!1),this._progressBar.enter(e,i),this.setOrigSize()},o.prototype.preUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")},o.prototype.preUpdateSmall=function(t){var e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);var o=this._scale===e;this.size({width:o?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:o?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),t.select("div.title-icon").style("position","static"),t.selectAll("lhs").style("display","none"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.style("transform","scale("+this._scale+")")},o.prototype.preUpdateRegular=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.select("div.title-icon").style("position","static"),t.style("transform","translate(0px,0px) scale(1)")},o.prototype.update=function(e,i){t.prototype.update.call(this,e,i)},o.prototype.preUpdate=function(i,o){switch(t.prototype.preUpdate.call(this,i,o),this._prevLegendPosition!==this.legendPosition()&&(null!==this._legend.target()&&this._legend.target(null),void 0!==this._prevLegendPosition?this.swap(this._prevLegendPosition,this.legendPosition()):this[this.legendPosition()](this._legend),"right"===this.legendPosition()?(this.rightOverflowX("hidden"),this.rightOverflowY("auto"),this.bottomOverflowX("visible"),this.bottomOverflowY("visible")):(this.rightOverflowX("visible"),this.rightOverflowY("visible"),this.bottomOverflowX("auto"),this.bottomOverflowY("hidden")),this._prevLegendPosition=this.legendPosition()),this._prevdataVisible!==this.dataVisible()&&(this._prevdataVisible=this.dataVisible(),this._toggleData.selected(this._prevdataVisible),this._carousel.active(this._prevdataVisible?1:0)),this._prevlegendVisible!==this.legendVisible()&&(this._prevlegendVisible=this.legendVisible(),this._toggleLegend.selected(this._prevlegendVisible),this._legend.visible(this._prevlegendVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(o);break;case"small":this.preUpdateSmall(o);break;case"regular":this.preUpdateRegular(o)}var l="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(l._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily())switch(this._prevChartDataFamily=this._legend.dataFamily(),this._prevChartDataFamily){case"any":this._toggleLegend.selected(!1),this._legend.visible(!1)}if(o.style("box-shadow",this.highlight()?"inset 0px 0px 0px "+this.highlightSize()+"px "+this.highlightColor():"none"),-1!==this._hideLegendToggleList.indexOf(l.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==l){this._prevChart=l;var r=l?l._titleBar||l._iconBar:void 0;if(r&&r instanceof e.IconBar){this._prevButtons=this._prevButtons||h([],this.buttons());var n=h(h(h([],r.buttons()),[new e.Spacer]),this._prevButtons);r.buttons([]).render(),this.buttons(n)}else this._prevButtons&&this.buttons(this._prevButtons)}var s=[];this.dataButtonVisible()||s.push(this._toggleData),this.downloadButtonVisible()||s.push(this._buttonDownload),this.downloadImageButtonVisible()||s.push(this._buttonDownloadImage),this.legendButtonVisible()||s.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(s).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())},o.prototype.postUpdate=function(e,i){switch(t.prototype.postUpdate.call(this,e,i),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(i);break;case"small":this.postUpdateSmall(i);break;case"regular":this.postUpdateRegular(i)}},o.prototype.postUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none"),t.selectAll("div.data-count").style("visibility","visible").style("font-size",this.titleIconFontSize()/3+"px").style("line-height",this.titleIconFontSize()/3+"px").style("left",this.titleIconFontSize()+"px").text(this.data().length),t.style("transform","translate(0px,0px) scale(1)");var e=t.selectAll("div.title-icon"),i=e.node(),o=t.node().parentElement.getBoundingClientRect();if(i){var l=e.node().getBoundingClientRect(),r=o.height/2;e.style("position","absolute").style("left","calc(50% - "+l.width/2+"px)").style("top",r-l.height/2+"px"),t.selectAll("div.data-count").style("position","absolute").style("left","calc(50% + "+l.width/2+"px)").style("top",r-l.height/2+"px")}},o.prototype.postUpdateSmall=function(t){t.selectAll("lhs").style("display","none"),t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden");var e=t.node().getBoundingClientRect(),i=t.node().parentElement.getBoundingClientRect();t.style("transform","translate("+(i.x-e.x)+"px, "+(i.y-e.y)+"px) scale("+this._scale+")")},o.prototype.postUpdateRegular=function(t){t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden")},o.prototype.exit=function(e,i){this._progressBar.exit(e,i),this.right(null),this._legend.target(null),this.center(null),this._carousel.target(null),this.top(null),this._titleBar.target(null),this._modal.target(null),delete this._prevChart,delete this._prevButtons,delete this._prevChartDataFamily,delete this._prevPos,delete this._prevdataVisible,delete this._prevlegendVisible,t.prototype.exit.call(this,e,i)},o.prototype.click=function(t,e,i){},o.prototype.dblclick=function(t,e,i){},o.prototype.vertex_click=function(t,e,i,o){o&&o.vertex},o.prototype.vertex_dblclick=function(t,e,i,o){o&&o.vertex},o.prototype.edge_click=function(t,e,i,o){o&&o.edge},o.prototype.edge_dblclick=function(t,e,i,o){o&&o.edge},o}(b);Q.prototype._class+=" layout_ChartPanel",Q.prototype.publishReset(),Q.prototype.publishProxy("title","_titleBar"),Q.prototype.publish("titleVisible",!0,"boolean"),Q.prototype.publish("titleOverlay",!1,"boolean"),Q.prototype.publishProxy("titleIcon","_titleBar"),Q.prototype.publishProxy("titleIconFont","_titleBar"),Q.prototype.publishProxy("titleFont","_titleBar"),Q.prototype.publishProxy("titleIconFontSize","_titleBar"),Q.prototype.publishProxy("titleFontSize","_titleBar"),Q.prototype.publishProxy("description","_titleBar"),Q.prototype.publishProxy("descriptionFont","_titleBar"),Q.prototype.publishProxy("descriptionFontSize","_titleBar"),Q.prototype.publish("dataVisible",!1,"boolean","Show data table"),Q.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),Q.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),Q.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),Q.prototype.publish("downloadTitle","","string","File name when downloaded"),Q.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),Q.prototype.publish("legendVisible",!1,"boolean","Show legend"),Q.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),Q.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),Q.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),Q.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),Q.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),Q.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),Q.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),Q.prototype.publishProxy("legend_symbolType","_legend","symbolType"),Q.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),Q.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),Q.prototype.publish("enableAutoscaling",!1,"boolean"),Q.prototype.publish("highlightSize",4,"number"),Q.prototype.publish("highlightColor","#e67e22","html-color"),Q.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),Q.prototype.publishProxy("progress_decay","_progressBar","decay"),Q.prototype.publishProxy("progress_size","_progressBar","size"),Q.prototype.publishProxy("progress_color","_progressBar","color"),Q.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),Q.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),Q.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),Q.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),Q.prototype.widget=function(t){if(!arguments.length)return this._widget;this._carousel.widgets([t,this._table]),this._widget=t,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());var e=this,i=this._widget;return i.click=function(){e.click.apply(e,arguments)},i.dblclick=function(){e.dblclick.apply(e,arguments)},i.vertex_click=function(){e.vertex_click.apply(e,arguments)},i.vertex_dblclick=function(){e.vertex_dblclick.apply(e,arguments)},i.edge_click=function(){e.edge_click.apply(e,arguments)},i.edge_dblclick=function(){e.edge_dblclick.apply(e,arguments)},this};d(".layout_FlexGrid{display:flex}.FlexGrid-list-item{overflow:hidden;border-style:solid;flex-grow:1}");var $=function(t){function i(){return t.call(this)||this}return r(i,t),i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),e.select(i.parentNode).style("height","100%").style("width","100%")},i.prototype.update=function(e,i){var o=this;t.prototype.update.call(this,e,i);var l=this,r=[];this.updateFlexParent(i);var n=i.selectAll(".FlexGrid-list-item").data(this.widgets(),function(t){return t.id()});n.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(n).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",function(t,e){var i=o.widgetsFlexBasis()[e];return void 0!==i?i:o.flexBasis()}).style("flex-grow",function(t,e){var i=o.widgetsFlexGrow()[e];return void 0!==i?i:o.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){var t=this.getBoundingClientRect();r.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:r[e][0]-2*l.borderWidth(),height:r[e][1]-2*l.borderWidth()})}),n.exit().remove()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.updateFlexParent=function(t){var e=this;t.style("height","100%").style("flex-direction","horizontal"===this.orientation()?"row":"column").style("flex-wrap",this.flexWrap()).style("align-items",this.alignItems()).style("align-content",this.alignContent()).style("overflow-x",function(){return e.forceXScroll()||"horizontal"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"}).style("overflow-y",function(){return e.forceYScroll()||"vertical"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"})},i}(e.HTMLWidget);$.prototype._class+=" layout_FlexGrid",$.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),$.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),$.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),$.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),$.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:function(t){return"nowrap"!==t.flexWrap()}}),$.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),$.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),$.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),$.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),$.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),$.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),$.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),$.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),$.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),$.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),$.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var tt=function(t,e,i){return t(i={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&i.path)}},i.exports),i.exports}(function(t,e){t.exports=function(){var t=function(t,e){for(var i in this._options=e,this.defaults)this._options.hasOwnProperty(i)||(this._options[i]=this.defaults[i]);this.items=t,this._adjustSizeOfItems(),this.generateGrid()};t.cloneItems=function(t,e){var i,o;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(o in e[i]||(e[i]={}),t[i])e[i][o]=t[i][o];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:function(){var t,e,i,o=this.grid.length,l="\n #|",r="\n --";for(e=0;e<o;e++)l+=" "+this._padNumber(e," "),r+="---";for(l+=r,e=0;e<this._options.lanes;e++)for(l+="\n"+this._padNumber(e," ")+"|",i=0;i<o;i++)l+=" ",t=this.grid[i][e],l+=t?this._padNumber(this.items.indexOf(t),"0"):"--";return l+="\n"},generateGrid:function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},resizeGrid:function(t){var e=0;this._options.lanes=t,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var i=0;i<this.items.length;i++){var o=this.items[i],l=this._getItemPosition(o);this._updateItemPosition(o,this.findPositionForItem(o,{x:e,y:0})),e=Math.max(e,l.x)}this._pullItemsToLeft()},findPositionForItem:function(t,e,i){var o,l,r;for(o=e.x;o<this.grid.length;o++)if(void 0!==i){if(r=[o,i],this._itemFitsAtPosition(t,r))return r}else for(l=e.y;l<this._options.lanes;l++)if(r=[o,l],this._itemFitsAtPosition(t,r))return r;var n=this.grid.length,s=0;return void 0!==i&&this._itemFitsAtPosition(t,[n,i])&&(s=i),[n,s]},moveItemToPosition:function(t,e){var i=this._getItemPosition({x:e[0],y:e[1],w:t.w,h:t.h});this._updateItemPosition(t,[i.x,i.y]),this._resolveCollisions(t)},resizeItem:function(t,e){var i=e.w||t.w,o=e.h||t.h;this._updateItemSize(t,i,o),this._resolveCollisions(t),this._pullItemsToLeft()},getChangedItems:function(t,e){for(var i=[],o=0;o<t.length;o++){var l=this._getItemByAttribute(e,t[o][e]);l.x===t[o].x&&l.y===t[o].y&&l.w===t[o].w&&l.h===t[o].h||i.push(l)}return i},_sortItemsByPosition:function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return i.x!=o.x?i.x-o.x:i.y!=o.y?i.y-o.y:0}.bind(this))},_adjustSizeOfItems:function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];void 0===e.autoSize&&(e.autoSize=0===e.w||0===e.h),e.autoSize&&("horizontal"===this._options.direction?e.h=this._options.lanes:e.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(t,e){var i,o,l=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+l.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+l.w;i++){var r=this.grid[i];if(r)for(o=e[1];o<e[1]+l.h;o++)if(r[o]&&r[o]!==t)return!1}return!0},_updateItemPosition:function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},_updateItemSize:function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},_markItemPositionToGrid:function(t){var e,i,o=this._getItemPosition(t);for(this._ensureColumns(o.x+o.w),e=o.x;e<o.x+o.w;e++)for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]=t},_deleteItemPositionFromGrid:function(t){var e,i,o=this._getItemPosition(t);for(e=o.x;e<o.x+o.w;e++)if(this.grid[e])for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},_ensureColumns:function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},_getItemsCollidingWithItem:function(t){for(var e=[],i=0;i<this.items.length;i++)t!=this.items[i]&&this._itemsAreColliding(t,this.items[i])&&e.push(i);return e},_itemsAreColliding:function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return!(o.x>=i.x+i.w||o.x+o.w<=i.x||o.y>=i.y+i.h||o.y+o.h<=i.y)},_resolveCollisions:function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var o,l,r,n,s=new t([],this._options);t.cloneItems(this.items,s.items),s.generateGrid();for(var a=0;a<i.length;a++){var h=s.items[i[a]],d=this._getItemPosition(h),p=this._getItemPosition(e);if(o=[p.x-d.w,d.y],l=[p.x+p.w,d.y],r=[d.x,p.y-d.h],n=[d.x,p.y+p.h],s._itemFitsAtPosition(h,o))s._updateItemPosition(h,o);else if(s._itemFitsAtPosition(h,r))s._updateItemPosition(h,r);else if(s._itemFitsAtPosition(h,n))s._updateItemPosition(h,n);else{if(!s._itemFitsAtPosition(h,l))return!1;s._updateItemPosition(h,l)}}return t.cloneItems(s.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(t){if(this._sortItemsByPosition(),this._resetGrid(),t){var e=this._getItemPosition(t);this._updateItemPosition(t,[e.x,e.y])}for(var i=0;i<this.items.length;i++){var o=this.items[i],l=this._getItemPosition(o);if(!t||o!=t){var r=this._findLeftMostPositionForItem(o),n=this.findPositionForItem(o,{x:r,y:0},l.y);this._updateItemPosition(o,n)}}},_findLeftMostPositionForItem:function(t){for(var e=0,i=this._getItemPosition(t),o=0;o<this.grid.length;o++)for(var l=i.y;l<i.y+i.h;l++){var r=this.grid[o][l];if(r){var n=this._getItemPosition(r);this.items.indexOf(r)<this.items.indexOf(t)&&(e=n.x+n.w)}}return e},_getItemByAttribute:function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},_padNumber:function(t,e){return t>=10?t:e+t},_getItemPosition:function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},_setItemPosition:function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])}};var e=function(t){for(var e=0;e<t;e++)this.push(null)};return e.prototype=[],t}()}),et=Object.freeze(Object.assign(Object.create(null),tt,{default:tt,__moduleExports:tt}));d('.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{position:absolute;border-style:solid;border-width:1px;background:#f5f5f5}.layout_Grid>.lane{position:absolute;border-style:none;opacity:.25;border-radius:0;pointer-events:none}.layout_Grid>.ddCell.draggable{border-style:solid;border-width:1px;background-color:#f8f8ff;border-radius:0;cursor:move}.layout_Grid>.ddCell.draggable>.resizeHandle{bottom:0;right:0;width:8px;height:8px;border-style:none;position:absolute;cursor:nwse-resize}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{bottom:2px;right:2px;width:4px;height:4px;border-color:#a9a9a9;border-style:solid;border-width:0 2px 2px 0;background-color:none;position:absolute}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39.2%,.1) 0,hsla(0,0%,39.2%,.1) 8px)}.layout_Grid>.dragging,.layout_Grid>.resizing{border:1px solid grey;border-radius:0;position:absolute}.layout_Grid>.resizing{background-color:orange;opacity:.3;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,orange 0,orange 8px)}.layout_Grid>.ddCell.draggable .common_Widget.selected{border:1px solid red;background-color:grey;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,rgba(100,0,0,.1) 0,rgba(100,0,0,.1) 8px)}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}');var it=et&&tt||et,ot=function(t){function i(){var i=t.call(this)||this;return i._tag="div",i._selectionBag=new e.Utility.Selection(i),i.content([]),i}return r(i,t),i.prototype.getDimensions=function(){var t={width:0,height:0};return this.content().forEach(function(e){t.width<e.gridCol()+e.gridColSpan()&&(t.width=e.gridCol()+e.gridColSpan()),t.height<e.gridRow()+e.gridRowSpan()&&(t.height=e.gridRow()+e.gridRowSpan())},this),t},i.prototype.clearContent=function(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;for(var i=e;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))},i.prototype.setContent=function(t,e,i,o,l,r){if(l=l||1,r=r||1,o=o||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){var n=(new g).gridRow(t).gridCol(e).widget(i).title(o).gridRowSpan(l).gridColSpan(r);this.content().push(n)}return this},i.prototype.sortedContent=function(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})},i.prototype.getCell=function(t,e){var i=null;return this.content().some(function(o){return t>=o.gridRow()&&t<o.gridRow()+o.gridRowSpan()&&e>=o.gridCol()&&e<o.gridCol()+o.gridColSpan()&&(i=o,!0)}),i},i.prototype.getWidgetCell=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e},i.prototype.getContent=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e},i.prototype.cellToGridItem=function(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}},i.prototype.gridItemToCell=function(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)},i.prototype.resetItemsPos=function(){this.origItems.forEach(function(t){var e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)},i.prototype.initGridList=function(){this.itemsMap={},this.items=this.content().map(function(t){var e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new it(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})},i.prototype.killGridList=function(){this.gridList=null,delete this.items,delete this.itemsMap},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),this._scrollBarWidth=e.Platform.getScrollbarWidth();var l=this;this._d3Drag=e.drag().subject(function(t){var e=l.cellToGridItem(t);return{x:e.x*l.cellWidth,y:e.y*l.cellHeight}}).on("start",function(t){if(l.designMode()){e.d3Event().sourceEvent.stopPropagation(),l.initGridList();var i=l.itemsMap[t.id()];l.dragItem=o.append("div").attr("class","dragging").style("transform",function(){return"translate("+i.x*l.cellWidth+"px, "+i.y*l.cellHeight+"px)"}).style("width",function(){return i.w*l.cellWidth-l.gutter()+"px"}).style("height",function(){return i.h*l.cellHeight-l.gutter()+"px"}),l.selectionBagClick(t)}}).on("drag",function(t){if(l.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=l.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+o.w*l.cellWidth>l.snappingColumns()*l.cellWidth&&(i.x=l.snappingColumns()*l.cellWidth-o.w*l.cellWidth),i.y<0&&(i.y=0),i.y+o.h*l.cellWidth>l.snappingRows()*l.cellWidth&&(i.y=l.snappingRows()*l.cellWidth-o.h*l.cellWidth);var r=[Math.max(0,Math.floor((i.x+l.cellWidth/2)/l.cellWidth)),Math.max(0,Math.floor((i.y+l.cellHeight/2)/l.cellHeight))];o.x===r[0]&&o.y===r[1]||("none"!==l.snapping()?(l.resetItemsPos(),l.gridList.moveItemToPosition(o,r)):(o.x=r[0],o.y=r[1]),t.gridCol()===o.x&&t.gridRow()===o.y||(l.items.forEach(l.gridItemToCell),l.updateGrid(!1,100))),l.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return o.w*l.cellWidth+"px"}).style("height",function(){return o.h*l.cellHeight+"px"})}}).on("end",function(){l.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),l.dragItem.remove(),l.dragItem=null,l.killGridList())}),this._d3DragResize=e.drag().subject(function(t){var e=l.cellToGridItem(t);return{x:(e.x+e.w-1)*l.cellWidth,y:(e.y+e.h-1)*l.cellHeight}}).on("start",function(t){if(l.designMode()){e.d3Event().sourceEvent.stopPropagation(),l.initGridList();var i=l.itemsMap[t.id()];l.dragItem=o.append("div").attr("class","resizing").style("transform",function(){return"translate("+i.x*l.cellWidth+"px, "+i.y*l.cellHeight+"px)"}).style("width",function(){return i.w*l.cellWidth-l.gutter()+"px"}).style("height",function(){return i.h*l.cellHeight-l.gutter()+"px"}),l.dragItemPos={x:i.x,y:i.y}}}).on("drag",function(t){if(l.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=l.itemsMap[t.id()],r=[Math.max(0,Math.round(i.x/l.cellWidth)),Math.max(0,Math.round(i.y/l.cellHeight))],n={w:Math.max(1,r[0]-o.x+1),h:Math.max(1,r[1]-o.y+1)};o.w===n.w&&o.h===n.h||("none"!==l.snapping()?(l.resetItemsPos(),l.gridList.resizeItem(o,n)):(o.w=n.w,o.h=n.h),t.gridColSpan()===o.w&&t.gridRowSpan()===o.h||(l.items.forEach(l.gridItemToCell),l.updateGrid(o.id,100))),l.dragItem.style("width",function(){return(1-o.x)*l.cellWidth+i.x-l.gutter()+"px"}).style("height",function(){return(1-o.y)*l.cellHeight+i.y-l.gutter()+"px"})}}).on("end",function(){l.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),l.dragItem.remove(),l.dragItem=null,l.killGridList())})},i.prototype.updateGrid=function(t,e,i){void 0===e&&(e=0),e=e||0;var o=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*o.cellWidth+o.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*o.cellHeight+o.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*o.cellWidth-o.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*o.cellHeight-o.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(o.surfaceShadow()).surfacePadding_default(o.surfacePadding()).surfaceBorderWidth_default(o.surfaceBorderWidth()).surfaceBackgroundColor_default(o.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);var l=this.getDimensions(),r=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=r/l.width,this.cellHeight="all"===this.fitTo()?this.height()/l.height:this.cellWidth,this.designMode()){var n=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),s=Math.floor(n);this.cellWidth=s,this.cellHeight=this.cellWidth}var a=this,h=o.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=h.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,o){!a._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===o||a.gridList||(a.initGridList(),"none"!==a.snapping()&&a.gridList.resizeGrid("horizontal"===a.snapping()?a.snappingRows():a.snappingColumns()),a.items.forEach(a.gridItemToCell),a.updateGrid(t.id(),100),a.killGridList())}),e.select(this).append("div").attr("class","resizeHandle").call(a._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(h),this.divItems.each(function(t){var i=e.select(this);a.designMode()?i.call(a._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),h.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();var d=o.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);d.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){a.selectionBagClear()}).merge(d).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),d.exit().each(function(){a.selectionBagClear()}).remove();var p=o.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);p.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),p.style("display",this.showLanes()?null:"none").style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px").style("background-image","linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)").style("background-size",this.cellWidth+"px "+this.cellHeight+"px"),p.exit().remove()},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype._createSelectionObject=function(t){return{_id:t._id,element:function(){return t._element},widget:t}},i.prototype.selection=function(t){return arguments.length?(this._selectionBag.set(t.map(function(t){return this._createSelectionObject(t)},this)),this):this._selectionBag.get().map(function(t){return t._id})},i.prototype.selectionBagClear=function(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())},i.prototype.selectionBagClick=function(t){if(null!==t){var i=this._createSelectionObject(t);if(e.d3Event().sourceEvent.ctrlKey)this._selectionBag.isSelected(i)?(this._selectionBag.remove(i),this.postSelectionChange()):(this._selectionBag.append(i),this.postSelectionChange());else{var o=this._selectionBag.get();1===o.length&&o[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}},i.prototype.postSelectionChange=function(){},i.prototype.applyLayout=function(t){this.divItems.each(function(e,i){if(t[i]){var o=t[i],l=o[0],r=o[1],n=o[2],s=o[3];e.gridCol(l).gridRow(r).gridColSpan(n).gridRowSpan(s)}}),this.updateGrid(!0)},i.prototype.vizActivation=function(t){},i}(e.HTMLWidget);ot.prototype._class+=" layout_Grid",ot.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),ot.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:function(t){return!t.designMode()}}),ot.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),ot.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),ot.prototype.publish("snappingColumns",12,"number","Snapping Columns"),ot.prototype.publish("snappingRows",16,"number","Snapping Rows"),ot.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),ot.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),ot.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),ot.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),ot.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),ot.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});var lt=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("horizontal"),e.flexWrap_default("nowrap"),e}return r(e,t),e}($);lt.prototype._class+=" layout_HorizontalList";d(".layout_Layered{pointer-events:none}.layout_Layered>.container>.content{position:absolute}.layout_Layered>.container>.content>div>.common_Widget,.layout_Layered>.container>.content>div>svg>.common_Widget{pointer-events:all}");var rt=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._widgetPlacements=[],e._widgetRatios=[],e}return r(i,t),i.prototype.addLayer=function(t,i,o,l){void 0===i&&(i="default"),void 0===o&&(o=1),void 0===l&&(l=1);var r=this.widgets();return r.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(r),this._widgetPlacements.push(i),this._widgetRatios.push([o,l]),this},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._contentContainer=i.append("div").attr("class","container")},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;i.style("padding",this.surfacePadding()+"px");var l=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});l.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(l).each(function(t,e){var i={width:o.clientWidth(),height:o.clientHeight()},l=o.widgetSize(e,i),r=o.widgetPosition(e,i,l);console.log("widgetPosition",r),this.style.top=r.y+"px",this.style.left=r.x+"px",t.resize(l).render()}),l.exit().each(function(t,e){t.target(null)}).remove(),l.order()},i.prototype.widgetSize=function(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}},i.prototype.widgetPosition=function(t,e,i){switch(this._widgetPlacements[t]){default:return{x:0,y:0};case"top":return{x:e.width/2-i.width/2,y:0};case"bottom":return{x:e.width/2-i.width/2,y:e.height-i.height};case"left":return{x:0,y:e.height/2-i.height/2};case"right":return{x:e.width-i.width,y:e.height/2-i.height/2};case"center":return{x:e.width/2-i.width/2,y:e.height/2-i.height/2}}},i}(e.HTMLWidget);rt.prototype._class+=" layout_Layered",rt.prototype.publish("surfacePadding",0,"number","Padding"),rt.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});var nt=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return r(e,t),e.prototype.updateState=function(t){t=t||!this.popupState(),this.popupState(t).render()},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this.widget().target(e),this._originalPosition=this.position()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("visibility",this.popupState()?null:"hidden").style("opacity",this.popupState()?null:0).style("width",this.shrinkWrap()?this.widget().width()+"px":this._size.width+"px").style("height",this.shrinkWrap()?this.widget().height()+"px":this._size.height+"px"),0===this.widget().size().height&&this.widget().resize(this.size())},e.prototype.postUpdate=function(e,i){var o,l;switch(this.centerPopup()){case"container":this._placeholderElement&&(o=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,l=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":o=window.innerWidth/2-this.widget().width()/2,l=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:o=0,l=0,this.position(this._originalPosition)}this.pos({x:o,y:l}),t.prototype.postUpdate.call(this,e,i),i.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e.prototype.click=function(t){console.log("Clicked: "+t.id)},e}(e.HTMLWidget);nt.prototype._class+=" layout_Popup",nt.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),nt.prototype.publish("shrinkWrap",!1,"boolean","The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)",null,{}),nt.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),nt.prototype.publish("top",null,"number","Top position property of popup",null,{}),nt.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),nt.prototype.publish("left",null,"number","Left position property of popup",null,{}),nt.prototype.publish("right",null,"number","Right position property of popup",null,{}),nt.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),nt.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});d(".layout_Tabbed .tab-button{position:relative;top:1px;display:inline-block;border-left:1px solid #ddd;border-top:1px solid #ddd;border-right:1px solid #ddd;background-color:transparent;margin-right:4px;padding:2px 2px 4px;background-color:#ccc}.layout_Tabbed .tab-button.active{background-color:#fff;z-index:999}.layout_Tabbed .on_bottom .tab-button{border-bottom:1px solid #ddd;border-top:none;top:-1px}");var st=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e}return r(i,t),i.prototype.clearTabs=function(){return this.labels([]),this.widgets([]),this},i.prototype.addTab=function(t,i,o,l){var r=t.size();0===r.width&&0===r.height&&t.size({width:"100%",height:"100%"});var n=this.labels(),s=this.widgets();o&&this.activeTabIdx(this.widgets().length),n.push(i);var a=(new u).widget(t||(new e.Text).text("No widget defined for tab"));return s.push(a),this.labels(n),this.widgets(s),l&&l(a),this},i.prototype.widgetSize=function(t){var e=this.clientWidth(),i=this.clientHeight(),o=this._tabContainer.node().getBoundingClientRect();return void 0!==o.height&&(i-=o.height),{width:e,height:i}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._tabContainer=i.append("div"),this._contentContainer=i.append("div")},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var l=this;o.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);var r=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});r.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){l.click(l.widgets()[e].widget(),t,e),l.activeTabIdx(e).render()}).merge(r).classed("active",function(t,e){return l.activeTabIdx()===e}).text(function(t){return t}),r.exit().remove();var n=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});switch(n.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(n).classed("active",function(t,e){return l.activeTabIdx()===e}).style("display",function(t,e){return l.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(l.activeTabIdx()===i),l.activeTabIdx()===i){var o=l.widgetSize(e.select(this));t.surfaceBorderWidth(l.showTabs()?null:0).surfacePadding(l.showTabs()?null:0).resize(o)}}),n.exit().each(function(t,e){t.target(null)}).remove(),this.tabLocation()){case"bottom":this._tabContainer.attr("class","on_bottom").style("top",this._contentContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute"),this._contentContainer.style("top",this.surfacePadding_exists()?this.surfacePadding()+"px":null).style("position","absolute");break;default:this._tabContainer.attr("class","on_top").style("top",null).style("position","relative"),this._contentContainer.style("top",this._tabContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute")}},i.prototype.click=function(t,e,i){},i}(e.HTMLWidget);st.prototype._class+=" layout_Tabbed",st.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),st.prototype.publish("surfacePadding",4,"number","Padding"),st.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),st.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),st.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),st.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});function at(){e.HTMLWidget.call(this),this._tag="div"}d(".layout_Toolbar{height:100%;background-color:#ddd;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-title{display:inline-block;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);margin-left:4px;font-weight:700;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-child{position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);float:right;margin-left:4px;margin-right:4px;line-height:16px}"),at.prototype=Object.create(e.HTMLWidget.prototype),at.prototype.constructor=at,at.prototype._class+=" layout_Toolbar",at.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),at.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),at.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),at.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),at.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]}),at.prototype.enter=function(t,i){e.HTMLWidget.prototype.enter.apply(this,arguments)},at.prototype.update=function(t,i){e.HTMLWidget.prototype.update.apply(this,arguments);var o=this;i.attr("title",o.title()).style("background-color",this.backgroundColor());var l=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);l.enter().append("div").classed("toolbar-title",!0).append("span"),l.selectAll("div.toolbar-title > span").style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("color",this.fontColor_exists()?this.fontColor():null).style("font-family",this.fontFamily_exists()?this.fontFamily():null).style("font-weight",this.fontBold_exists()?this.fontBold()?"bold":"normal":null).style("background-color",this.backgroundColor_exists()?this.backgroundColor():null).text(o.title()),l.exit().remove();var r=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});r.enter().insert("div","div.toolbar-title").each(function(t,i){var l=o.widgetClasses()[i]?o.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(l,!0),t.target(this)}),r.exit().each(function(t){t.target(null)}).remove(),r.order()},at.prototype.render=function(t){var i=this;e.HTMLWidget.prototype.render.call(this,function(e){var o=i.element().node().getBoundingClientRect(),l=o.left+o.width;i.element().selectAll("div.toolbar-child").each(function(t,e){var i=this.getBoundingClientRect();l>i.left&&(l=i.left)}),i.element().select(".toolbar-title").style("width",l-o.left-4+"px"),t&&t(e)})},at.prototype.exit=function(t,i){e.HTMLWidget.prototype.exit.apply(this,arguments),this.widgets().forEach(function(t){t.target(null)})};var ht=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("vertical"),e.flexWrap_default("nowrap"),e}return r(e,t),e}($);ht.prototype._class+=" layout_VerticalList",t.AbsoluteSurface=p,t.Accordion=c,t.BUILD_VERSION="2.100.0",t.Border=f,t.Border2=b,t.Carousel=_,t.Cell=g,t.ChartPanel=Q,t.FlexGrid=$,t.Grid=ot,t.HorizontalList=lt,t.Layered=rt,t.Legend=J,t.Modal=Z,t.PKG_NAME="@hpcc-js/layout",t.PKG_VERSION="2.45.0",t.Popup=nt,t.Surface=u,t.Tabbed=st,t.Toolbar=at,t.VerticalList=ht,t.WidgetDiv=y,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/api")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/api"],e):e((t=t||self)["@hpcc-js/layout"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/api"])}(this,function(t,e,i,o){"use strict";var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n=function(){return(n=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var l in e=arguments[i])Object.prototype.hasOwnProperty.call(e,l)&&(t[l]=e[l]);return t}).apply(this,arguments)};function s(t,e,i,o){return new(i||(i=Promise))(function(l,r){function n(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?l(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,s)}a((o=o.apply(t,e||[])).next())})}function a(t,e){var i,o,l,r,n={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,o&&(l=2&r[0]?o.return:r[0]?o.throw||((l=o.return)&&l.call(o),0):o.next)&&!(l=l.call(o,r[1])).done)return l;switch(o=0,l&&(r=[2&r[0],l.value]),r[0]){case 0:case 1:l=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,o=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if(!(l=(l=n.trys).length>0&&l[l.length-1])&&(6===r[0]||2===r[0])){n=0;continue}if(3===r[0]&&(!l||r[1]>l[0]&&r[1]<l[3])){n.label=r[1];break}if(6===r[0]&&n.label<l[1]){n.label=l[1],l=r;break}if(l&&n.label<l[2]){n.label=l[2],n.ops.push(r);break}l[2]&&n.ops.pop(),n.trys.pop();continue}r=e.call(t,n)}catch(t){r=[6,t],o=0}finally{i=l=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function h(t,e,i){if(i||2===arguments.length)for(var o,l=0,r=e.length;l<r;l++)!o&&l in e||(o||(o=Array.prototype.slice.call(e,0,l)),o[l]=e[l]);return t.concat(o||e)}function d(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=t:l.appendChild(document.createTextNode(t))}}d(".layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{position:relative;overflow:hidden;pointer-events:all}");var p=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return r(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=0,l=0,r=this.clientWidth(),n=this.clientHeight();switch(this.units()){case"pixels":o=this.widgetX(),l=this.widgetY(),r=""===this.widgetWidth()?r-o:Number(this.widgetWidth()),n=""===this.widgetHeight()?n-l:Number(this.widgetHeight());break;case"percent":o=this.widgetX()*r/100,l=this.widgetY()*n/100,r=""===this.widgetWidth()?r-o:Number(this.widgetWidth())*r/100,n=""===this.widgetHeight()?n-l:Number(this.widgetHeight())*n/100}i.style("opacity",this.opacity());var s=i.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(s).style("left",o+"px").style("top",l+"px").style("width",r+"px").style("bottom",n+"px").each(function(t){t.resize({width:r,height:n})}),s.exit().each(function(t){t.target(null)}).remove()},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e}(e.HTMLWidget);p.prototype._class+=" layout_AbsoluteSurface",p.prototype.publish("units","percent","set","Units",["pixels","percent"]),p.prototype.publish("widgetX",0,"number","Widget XPos"),p.prototype.publish("widgetY",0,"number","Widget YPos"),p.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),p.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),p.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),p.prototype.publish("opacity",1,"number","Opacity");d(".layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0;overflow:hidden}.layout_Accordion.open>ul{display:block}.layout_Accordion>.collapsible-icon,.layout_Accordion>.collapsible-title{cursor:pointer;box-sizing:border-box}.layout_Accordion>.collapsible-title{display:block;width:100%;font-size:13px;color:#fff;padding:4px 8px;height:26px;-webkit-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);-moz-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2)}.layout_Accordion li{background-color:#fff}.layout_Accordion>.collapsible-title,.layout_Accordion>ul{background-color:#333}.layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion>ul{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ddd}.layout_Accordion>span,.layout_Accordion>ul{padding-left:0}.layout_Accordion .layout_Accordion>span,.layout_Accordion .layout_Accordion>ul{padding-left:12px}.layout_Accordion>.collapsible-title:before{padding:4px 8px;position:absolute;left:0;top:0}.layout_Accordion>.collapsible-icon{position:absolute;top:0;right:0;width:24px;height:24px;color:#fff}");var c=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._isClosed=!1,e}return r(i,t),i.prototype.pushListItem=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var o=this.content();return t._protected=i,e?o.unshift(t):o.push(t),this.content(o),this},i.prototype.clearListItems=function(){var t=[];for(var e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this},i.prototype.collapseClick=function(t){t.classed("closed")?(this._isClosed=!1,t.classed("open",!0),t.classed("closed",!1)):(this._isClosed=!0,t.classed("open",!1),t.classed("closed",!0))},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var l=this;this._isClosed=this.defaultCollapsed(),o.classed(this._isClosed?"closed":"open",!0),this.titleSpan=o.append("span").classed("collapsible-title",!0),this.iconDiv=o.append("div").classed("collapsible-icon",!0),this.ul=o.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){l.collapseClick(o),l.render()}),this.titleSpan.on("click",function(){l.collapseClick(o),l.render()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this.titleSpan.text(o.title().length>0?o.title()+"":"Accordion ["+o._id+"]");var l=this.ul.selectAll("#"+o._id+" > ul > li").data(this.content(),function(t){return t._id});l.enter().append(function(t){var e=document.createElement("li");if(null!==t._target)return t._target;var i=t.size();if(0===i.width||0===i.height){var l=o.size();t.size({width:l.width,height:l.width})}return t.target(e),e}),l.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);c.prototype._class+=" layout_Accordion",c.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),c.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),c.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),c.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),c.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),c.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),c.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});d('.layout_Surface{box-sizing:border-box;margin:0;border:1px solid #e5e5e5;overflow:hidden;height:100%;width:100%}.layout_Surface.shadow2{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}.layout_Surface>h3{margin:0;padding:2px;background-color:#e5e5e5}.layout_Surface .html-button-container{position:absolute;right:0;top:3px}.layout_Surface>div{padding:8px}.layout_Surface .html-button-container .surface-button{margin-right:5px}.layout_Surface .html-button-container .surface-button i{opacity:.8}.layout_Surface .html-button-container .surface-button:hover{opacity:1}.layout_Surface .html-button-container .surface-button:active{opacity:.5}div[draggable=true].hideDragCellContent.content-icon:before{content:"\\f080";font-family:FontAwesome;position:absolute;top:calc(50% - 74px);left:calc(50% - 56px);font-size:100px}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:"\\f201"}div[draggable=true].hideDragCellContent.content-icon-Pie:before{top:calc(50% - 72px);left:calc(50% - 45px);content:"\\f200"}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:"\\f1fe"}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:"\\f0e4"}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:"\\f0ce"}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:"\\f11c"}div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before{content:"\\f247"}div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before{content:"\\f278"}');var u=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return r(i,t),i.prototype.widgetSize=function(t,e){var i=this.clientWidth(),o=this.clientHeight();return this.title()&&(o-=this.calcHeight(t)),o-=this.calcFrameHeight(e),{width:i-=this.calcFrameWidth(e),height:o}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var l=this;o.classed("shadow2",this.surfaceShadow()).style("border-width",this.surfaceBorderWidth_exists()?this.surfaceBorderWidth()+"px":null).style("border-color",this.surfaceBorderColor()).style("border-radius",this.surfaceBorderRadius_exists()?this.surfaceBorderRadius()+"px":null).style("background-color",this.surfaceBackgroundColor());var r=o.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);r.enter().insert("h3","div").attr("class","surfaceTitle").merge(r).text(function(t){return t}).style("text-align",this.surfaceTitleAlignment()).style("color",this.surfaceTitleFontColor()).style("font-size",this.surfaceTitleFontSize_exists()?this.surfaceTitleFontSize()+"px":null).style("font-family",this.surfaceTitleFontFamily()).style("font-weight",this.surfaceTitleFontBold()?"bold":"normal").style("background-color",this.surfaceTitleBackgroundColor()).style("padding",this.surfaceTitlePadding_exists()?this.surfaceTitlePadding()+"px":null).style("title",this.altText_exists()?this.altText():null),r.exit().remove();var n=o.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());n.enter().append("button").classed("surface-button",!0).each(function(t,i){var o=l._surfaceButtons[i]=e.select(this).attr("class","surface-button"+(t.class?" "+t.class:"")).attr("id",t.id).style("padding",t.padding).style("width",t.width).style("height",t.height).style("cursor","pointer");"FontAwesome"===t.font?o.style("background","transparent").style("border","none").on("click",function(t){l.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):o.text(function(){return t.label}).on("click",function(t){l.click(t)})}),n.exit().each(function(t,i){var o=e.select(this);delete l._surfaceButtons[i],o.remove()});var s=o.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(l.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(s).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){var i=l.widgetSize(o.select("h3"),e.select(this));i.width<0&&(i.width=0),i.height<0&&(i.height=0),t.resize({width:i.width,height:i.height})}),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},i.prototype.click=function(t){console.log("Clicked: "+t.id)},i}(e.HTMLWidget);u.prototype._class+=" layout_Surface",u.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),u.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),u.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:function(t){return!t.title()}}),u.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),u.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),u.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),u.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),u.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),u.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),u.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),u.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});d(".layout_Cell .update-indicator{box-sizing:border-box;position:absolute;top:0;left:0;padding:0;z-index:1000;border-width:0;border-style:solid;pointer-events:none}");var g=function(t){function i(){var e=t.call(this)||this;return e._indicateTheseIds=[],e}return r(i,t),i.prototype.indicateTheseIds=function(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;i.classed("layout_Surface",!0).on("mouseenter",function(){o.onMouseEnter()}).on("mouseleave",function(){o.onMouseLeave()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i)},i.prototype.onMouseEnter=function(){for(var t=this.indicateTheseIds(),i=this.indicatorOpacity(),o=this.indicatorBorderColor(),l=this.indicatorGlowColor(),r=0;r<t.length;r++){var n=e.select("#"+t[r]),s=n.datum();n&&s&&n.append("div").attr("class","update-indicator").style("width",s.width()+"px").style("height",s.height()+"px").style("opacity",i).style("border-color",o).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+l).style("-moz-box-shadow","inset 0px 0px 30px 0px "+l).style("box-shadow","inset 0px 0px 30px 0px "+l)}},i.prototype.onMouseLeave=function(){for(var t=this.indicateTheseIds(),i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()},i}(u);g.prototype._class+=" layout_Cell",g.prototype.publish("gridRow",0,"number","Grid Row Position",null,{tags:["Private"]}),g.prototype.publish("gridCol",0,"number","Grid Column Position",null,{tags:["Private"]}),g.prototype.publish("gridRowSpan",1,"number","Grid Row Span",null,{tags:["Private"]}),g.prototype.publish("gridColSpan",1,"number","Grid Column Span",null,{tags:["Private"]}),g.prototype.publish("indicatorGlowColor","#EEEE11","html-color","Glow color of update-indicator",null,{tags:["Basic"]}),g.prototype.publish("indicatorBorderColor","#F48A00","html-color","Border color of update-indicator",null,{tags:["Basic"]}),g.prototype.publish("indicatorOpacity",.8,"number","Opacity of update-indicator",null,{tags:["Basic"]});d(".layout_Border{width:100%;height:100%}.layout_Border>.border-content{width:100%;height:100%;position:relative}.layout_Border>.borderHandle{width:6px;height:6px;background-color:#444;opacity:.3;position:absolute;visibility:hidden}.layout_Border.design-mode>.borderHandle{visibility:visible}.layout_Border>.borderHandle:hover{background-color:#666}.layout_Border>.borderHandle.borderHandleDisabled{display:none}.layout_Border>.borderHandle_bottom,.layout_Border>.borderHandle_top{cursor:ns-resize}.layout_Border>.borderHandle_left,.layout_Border>.borderHandle_right{cursor:ew-resize}.layout_Border .cell{border-radius:5px;border:1px solid #e5e5e5;display:inline-block;overflow:hidden}.layout_Border .cell h2{margin:0;padding-top:4px;-webkit-margin:0;text-align:center}.layout_Border .layout_BorderCell.over{border:2px dashed #000}.layout_Border .dragItem{z-index:-1;opacity:.33}.layout_Border .notDragItem{z-index:-1;opacity:1}.layout_Border div[draggable=true]{opacity:.75;cursor:default}.layout_Border div[draggable=true] .dragHandle{opacity:1}.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_n,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_ne,.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_se,.layout_Border div[draggable=true] .dragHandle_sw{background-color:#333}.layout_Border div[draggable=true] .dragHandle_nw{cursor:nw-resize}.layout_Border div[draggable=true] .dragHandle_n{cursor:n-resize}.layout_Border div[draggable=true] .dragHandle_ne{cursor:ne-resize}.layout_Border div[draggable=true] .dragHandle_e{cursor:e-resize}.layout_Border div[draggable=true] .dragHandle_se{cursor:se-resize}.layout_Border div[draggable=true] .dragHandle_s{cursor:s-resize}.layout_Border div[draggable=true] .dragHandle_sw{cursor:sw-resize}.layout_Border div[draggable=true] .dragHandle_w{cursor:w-resize}.layout_Border div[draggable=false]>div>.dragHandle{display:none}.layout_Border .grid-drop-target{position:fixed;box-sizing:border-box;border:2px dashed #7f8c8d;border-radius:0;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39.2%,.1) 0,hsla(0,0%,39.2%,.1) 8px)}.layout_Border .grid-drop-target.drop-target-over{border:2px dashed #179bd7;background:repeating-linear-gradient(-45deg,transparent,transparent 6px,rgba(17,155,215,.1) 0,rgba(17,155,215,.1) 12px)}");var f=function(t){function i(){var i=t.call(this)||this;return i.lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100),i._tag="div",i._colCount=0,i._rowCount=0,i._colSize=0,i._rowSize=0,i._shrinkWrapBoxes={},i.content([]),i.sectionTypes([]),i}return r(i,t),i.prototype.watchWidget=function(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){var e=this;this._watch[t.id()]=t.monitor(function(t,i,o){o!==i&&e.lazyPostUpdate()})}},i.prototype.applyLayoutType=function(){var t=this.borderLayoutObject();this.content().forEach(function(e,i){e._fixedLeft=t[this.sectionTypes()[i]].left,e._fixedTop=t[this.sectionTypes()[i]].top,e._fixedWidth=t[this.sectionTypes()[i]].width,e._fixedHeight=t[this.sectionTypes()[i]].height,e._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[i])},this)},i.prototype.cellSpecificDragHandles=function(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}},i.prototype.borderLayoutObject=function(t){var e,i,o,l,r,n,s,a,h={},d=this,p=this.target().getBoundingClientRect(),c={};c.top=p.top,c.left=p.left,c.bottom=p.bottom,c.right=p.right,this.target()instanceof SVGElement?(c.width=parseFloat(this.target().getAttribute("width")),c.height=parseFloat(this.target().getAttribute("height"))):(c.width=p.width,c.height=p.height),-1!==this.sectionTypes().indexOf("top")&&(e=this.topSize(),i=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(e=this._shrinkWrapBoxes.top.height+this.gutter(),i=0)),-1!==this.sectionTypes().indexOf("bottom")&&(o=this.bottomSize(),l=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(o=this._shrinkWrapBoxes.bottom.height+this.gutter(),l=0)),-1!==this.sectionTypes().indexOf("left")&&(r=this.leftSize(),n=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(r=this._shrinkWrapBoxes.left.width+this.gutter(),n=0)),-1!==this.sectionTypes().indexOf("right")&&(s=this.rightSize(),a=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(s=this._shrinkWrapBoxes.right.width+this.gutter(),a=0));var u=_({width:{px:0,"%":100},height:{px:e,"%":i},top:{px:0,"%":0},left:{px:0,"%":0}}),g=_({width:{px:0,"%":100},height:{px:o,"%":l},top:{px:0,"%":100},left:{px:0,"%":0}});g.top-=g.height;var f=_({width:{px:r,"%":n},height:{px:-u.height-g.height,"%":100},top:{px:u.height,"%":0},left:{px:0,"%":0}}),y=_({width:{px:s,"%":a},height:{px:-u.height-g.height,"%":100},top:{px:u.height,"%":0},left:{px:0,"%":100}});y.left-=y.width;var b=_({width:{px:-y.width-f.width,"%":100},height:{px:-u.height-g.height,"%":100},top:{px:u.height,"%":0},left:{px:f.width,"%":0}});return h.top=u,h.bottom=g,h.right=y,h.left=f,h.center=b,h;function _(t){return t.width.px=void 0!==t.width.px?t.width.px:0,t.width["%"]=void 0!==t.width["%"]?t.width["%"]:0,t.height.px=void 0!==t.height.px?t.height.px:0,t.height["%"]=void 0!==t.height["%"]?t.height["%"]:0,{width:t.width.px+t.width["%"]/100*d.width(),height:t.height.px+t.height["%"]/100*d.height(),top:t.top.px+t.top["%"]/100*d.height()+d.gutter()/2,left:t.left.px+t.left["%"]/100*d.width()+d.gutter()/2}}},i.prototype.clearContent=function(t){if(t){var i=this.sectionTypes().indexOf(t);i>=0&&(this._watch&&this.content()[i]&&delete this._watch[this.content()[i].id()],this.content()[i].target(null),e.select("#"+this.id()+" > div.borderHandle_"+t).classed("borderHandleDisabled",!0),this.content().splice(i,1),this.sectionTypes().splice(i,1))}else this.content().forEach(function(t){return t.target(null),!1}),e.select("#"+this.id()+" > div.borderHandle").classed("borderHandleDisabled",!0),delete this._watch,this.content([]),this.sectionTypes([])},i.prototype.hasContent=function(t,e,i){return this.sectionTypes().indexOf(t)>=0},i.prototype.setContent=function(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){var o=(new g).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(o),this.sectionTypes().push(t)}return this},i.prototype.getCell=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null},i.prototype.getContent=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null},i.prototype.setLayoutOffsets=function(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2},i.prototype.dragStart=function(t){var i=e.d3Event();i.sourceEvent.stopPropagation();this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));var o=e.select("#"+this.id()+" > div.borderHandle_"+t);this._handleTop=parseFloat(o.style("top").split("px")[0]),this._handleLeft=parseFloat(o.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY},i.prototype.dragTick=function(t){var i=this,o=e.d3Event(),l=this._dragPrevX-o.sourceEvent.clientX,r=this._dragPrevY-o.sourceEvent.clientY;switch(t){case"top":case"bottom":n(t,r);break;case"right":case"left":n(t,l)}function n(t,o){if(0!==o){var l=e.selectAll("#"+i.id()+" > div.borderHandle"),r=e.select("#"+i.id()+" > div.borderHandle_"+t);r.classed("borderHandle_top")?(r.style("top",i._handleTop-o+"px"),i._cellSizes.topHeight=i._handleTop-o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):r.classed("borderHandle_right")?(r.style("left",i._handleLeft-o+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+o):r.classed("borderHandle_bottom")?(r.style("top",i._handleTop-o+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):r.classed("borderHandle_left")&&(r.style("left",i._handleLeft-o+"px"),i._cellSizes.leftWidth=i._handleLeft-o),l.each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",i._cellSizes.width-i._cellSizes.rightWidth+"px"),t.style("top",i._cellSizes.topHeight+3+"px"),t.style("height",i._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.height-i._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",i._cellSizes.leftWidth+"px"),t.style("height",i._cellSizes.leftHeight+"px"),t.style("top",i._cellSizes.topHeight+3+"px"))})}}},i.prototype.dragEnd=function(t){if(t){var i=e.d3Event(),o=this._dragPrevX-i.sourceEvent.clientX,l=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==l&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-l:this.topSize()-l));break;case"right":0!==o&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+o:this.rightSize()+o));break;case"bottom":0!==l&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+l:this.bottomSize()+l));break;case"left":0!==o&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-o:this.leftSize()-o))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()},i.prototype.size=function(t){var i=e.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this.contentDiv&&this.contentDiv.style("width",this._size.width+"px").style("height",this._size.height+"px"),i},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var l=this;o.style("position","relative"),this.contentDiv=o.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"],o.selectAll("div.borderHandle").data(this._borderHandles).enter().append("div").classed("borderHandle",!0).each(function(t){e.select(this).classed("borderHandle_"+t,!0).classed("borderHandleDisabled",null===l.getContent(t))})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._sectionTypeArr=this.sectionTypes();var l=this;o.classed("design-mode",this.designMode()),this.setLayoutOffsets();var r=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),n=r.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+l._sectionTypeArr[i],!0),t.target(this),e.select("#"+l.id()+" > div.borderHandle_"+l._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(r);n.each(function(t,e){var i=l.sectionTypes()[e];void 0!==l[i+"ShrinkWrap"]&&l[i+"ShrinkWrap"]()?(t.render(),l._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete l._shrinkWrapBoxes[i]});var s=e.drag().on("start",function(t,e){l.dragStart.call(l,t,e)}).on("drag",function(t,e){l.dragTick.call(l,t,e)}).on("end",function(t,e){l.dragEnd.call(l,t,e)});this.designMode()?o.selectAll("#"+this.id()+" > div.borderHandle").call(s):o.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);var a=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=a[this.sectionTypes()[e]].left,t._fixedTop=a[this.sectionTypes()[e]].top,t._fixedWidth=a[this.sectionTypes()[e]].width,t._fixedHeight=a[this.sectionTypes()[e]].height,t._dragHandles=[]},this),n.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-l.gutter()+"px"}).style("height",function(t){return t._fixedHeight-l.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",l.designMode()).selectAll(".dragHandle").attr("draggable",l.designMode()),t.surfacePadding(l.surfacePadding()).resize()}),r.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),o.selectAll("#"+this.id()+" > div.borderHandle").each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",l._cellSizes.width+"px"),t.style("top",l._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",l._cellSizes.width-l._cellSizes.rightWidth+"px"),t.style("top",l._cellSizes.topHeight+3+"px"),t.style("height",l._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",l._cellSizes.width+"px"),t.style("top",l._cellSizes.height-l._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",l._cellSizes.leftWidth+"px"),t.style("height",l._cellSizes.leftHeight+"px"),t.style("top",l._cellSizes.topHeight+3+"px"))})},i.prototype.getCellSizes=function(){var t=this;t._cellSizes={};var i=this.element().node().getBoundingClientRect();t._cellSizes.width=i.width,t._cellSizes.height=i.height,this.element().selectAll("#"+this.id()+" > div > div.border-cell").each(function(){var i=e.select(this);if("function"==typeof i.node){var o=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=o.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=o.width,t._cellSizes.leftHeight=o.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=o.width,t._cellSizes.rightHeight=o.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=o.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})},i.prototype.postUpdate=function(t,e){var i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){var e=t.widget().getBBox(!1,!0),o=t.widget().getBBox(!0,!0);e.width===o.width&&e.height===o.height||i.lazyRender()}})},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);f.prototype._class+=" layout_Border",f.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),f.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),f.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),f.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),f.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),f.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),f.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),f.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),f.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),f.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),f.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});d(".layout_Border2{display:flex;flex-direction:column}.layout_Border2>.body{margin:0;padding:0;display:flex;flex-flow:row}.layout_Border2>.body>.center{flex:1}.layout_Border2>.footer,.layout_Border2>.header{display:block}");var y=function(){function t(t){this._overlay=!1,this._overflowX="visible",this._overflowY="visible",this._div=t}return t.prototype.overlay=function(t){return arguments.length?(this._overlay=t,this):this._overlay},t.prototype.overflowX=function(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX},t.prototype.overflowY=function(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY},t.prototype.element=function(){return this._div},t.prototype.node=function(){return this._div.node()},t.prototype.widget=function(t){return arguments.length?(this._widget!==t&&(this._widget&&this._widget.target(null),this._widget=t,this._widget&&this._widget.target(this._div.node())),this):this._widget},t.prototype.resize=function(t){return this._widget&&(this._div.style("width",t.width+"px").style("height",t.height+"px"),this._widget.resize(t)),this},t.prototype.render=function(t,i,o){return s(this,void 0,void 0,function(){var l,r,n=this;return a(this,function(s){return l=this.overflowX(),this.overlay()||"visible"!==l||(l=null),r=this.overflowY(),this.overlay()||"visible"!==r||(r=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",l).style("overflow-y",r),this._widget?[2,this._widget.renderPromise().then(function(l){if(t&&n._widget.visible()){var r=n._widget.getBBox();return r.width+=8,void 0!==i&&r.height>i&&(r.width+=e.Platform.getScrollbarWidth()),void 0!==o&&r.width>o&&(r.height+=e.Platform.getScrollbarWidth()),n.overlay()?r.height=0:r.height+=4,r}return t?{x:0,y:0,width:0,height:0}:void 0})]:[2,Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)]})})},t}(),b=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return r(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=i.append("header");this._bodyElement=i.append("div").attr("class","body");var l=this._bodyElement.append("div").attr("class","center"),r=this._bodyElement.append("div").attr("class","lhs"),n=this._bodyElement.append("div").attr("class","rhs"),s=i.append("div").attr("class","footer");this._topWA=new y(o),this._centerWA=new y(l),this._leftWA=new y(r),this._rightWA=new y(n),this._bottomWA=new y(s)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topWA.element().style("display",this.showTop()?null:"none"),this._rightWA.element().style("display",this.showRight()?null:"none"),this._bottomWA.element().style("display",this.showBottom()?null:"none"),this._leftWA.element().style("display",this.showLeft()?null:"none"),this.topOverflowX()!==this._topWA.overflowX()&&this._topWA.overflowX(this.topOverflowX()),this.rightOverflowX()!==this._rightWA.overflowX()&&this._rightWA.overflowX(this.rightOverflowX()),this.bottomOverflowX()!==this._bottomWA.overflowX()&&this._bottomWA.overflowX(this.bottomOverflowX()),this.leftOverflowX()!==this._leftWA.overflowX()&&this._leftWA.overflowX(this.leftOverflowX()),this.topOverflowY()!==this._topWA.overflowY()&&this._topWA.overflowY(this.topOverflowY()),this.rightOverflowY()!==this._rightWA.overflowY()&&this._rightWA.overflowY(this.rightOverflowY()),this.bottomOverflowY()!==this._bottomWA.overflowY()&&this._bottomWA.overflowY(this.bottomOverflowY()),this.leftOverflowY()!==this._leftWA.overflowY()&&this._leftWA.overflowY(this.leftOverflowY()),this.element().style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.targetNull=function(t){t&&t.target(null)},e.prototype.exit=function(e,i){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),t.prototype.exit.call(this,e,i)},e.prototype.swap=function(t,e){var i=this[t](),o=this[e]();return this.targetNull(i),this.targetNull(o),this["_"+t+"WA"].widget(null),this["_"+e+"WA"].widget(null),this[t](o),this[e](i),this},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){i._topWA?i._topWA.widget(i.top()).overlay(i.topOverlay()).render(!0).then(function(t){return s(i,void 0,void 0,function(){var i,o,l,r,n,s,h,d,p,c,u,g=this;return a(this,function(a){switch(a.label){case 0:return[4,this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width())];case 1:return i=a.sent(),o=this.height()-(t.height+i.height),[4,this._leftWA.widget(this.left()).render(!0,o)];case 2:return l=a.sent(),[4,this._rightWA.widget(this.right()).render(!0,o)];case 3:return r=a.sent(),this.bottomHeight_exists()&&(i.height=this.bottomHeight()),n=this.width()-(l.width+r.width),s=this.height()-(t.height+i.height),h=this.centerOverflowX(),d=this.centerOverflowY(),p=-1!==["auto","scroll"].indexOf(h),c=-1!==["auto","scroll"].indexOf(d),(p||c)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bodyElement.style("height",s+"px"),u=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:t.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:l.width,height:s}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:r.width,height:s}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()],Promise.all(u).then(function(t){e&&e(g)}),[2]}})})}):e&&e(i)})},e}(e.HTMLWidget);b.prototype._class+=" layout_Border2",b.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),b.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),b.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),b.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),b.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),b.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),b.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),b.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),b.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),b.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),b.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),b.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});d(".layout_Carousel>div{position:relative;overflow:hidden}.layout_Carousel>div>.carouselItem{position:absolute}");var _=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._prevActive=0,e}return r(i,t),i.prototype.activeWidget=function(){return this.widgets()[this.active()]},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._root=i.append("div").attr("id",this.id()+"_root")},i.prototype.update=function(i,o){var l=this;t.prototype.update.call(this,i,o);var r=this.active(),n=this.width();this._root.style("width",n+"px").style("height",this.height()+"px");var s=this._root.selectAll("#"+this.id()+"_root > .carouselItem").data(this.widgets(),function(t){return t.id()}),a=s.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(s).style("left",function(t,e){return(e-l._prevActive)*n+"px"}).style("width",n+"px");this._prevActive!==r&&(a.style("display",function(t,e){return e===l._prevActive||e===r?null:"none"}).transition().duration(this.transitionDuration()).style("left",function(t,e){return(e-r)*n+"px"}).on("end",function(t,i){e.select(this).style("display",function(){return i===r?null:"none"})}),this._prevActive=r),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widgets().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){if(!i.visible()||i.isDOMHidden())e&&e(t);else{var o=i.activeWidget();o&&o.resize(i.size()).render(function(i){e&&e(t)})}})},i}(e.HTMLWidget);_.prototype._class+=" layout_Carousel",_.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),_.prototype.publish("active",0,"number","Active widget"),_.prototype.publish("transitionDuration",500,"number","Transition duration");var v=Math.PI,w=2*v,m=w-1e-6;function x(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function C(){return new x}function S(t){return function(){return t}}x.prototype=C.prototype={constructor:x,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,o){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+o)},bezierCurveTo:function(t,e,i,o,l,r){this._+="C"+ +t+","+ +e+","+ +i+","+ +o+","+(this._x1=+l)+","+(this._y1=+r)},arcTo:function(t,e,i,o,l){t=+t,e=+e,i=+i,o=+o,l=+l;var r=this._x1,n=this._y1,s=i-t,a=o-e,h=r-t,d=n-e,p=h*h+d*d;if(l<0)throw new Error("negative radius: "+l);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>1e-6)if(Math.abs(d*s-a*h)>1e-6&&l){var c=i-r,u=o-n,g=s*s+a*a,f=c*c+u*u,y=Math.sqrt(g),b=Math.sqrt(p),_=l*Math.tan((v-Math.acos((g+p-f)/(2*y*b)))/2),w=_/b,m=_/y;Math.abs(w-1)>1e-6&&(this._+="L"+(t+w*h)+","+(e+w*d)),this._+="A"+l+","+l+",0,0,"+ +(d*c>h*u)+","+(this._x1=t+m*s)+","+(this._y1=e+m*a)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,i,o,l,r){t=+t,e=+e,r=!!r;var n=(i=+i)*Math.cos(o),s=i*Math.sin(o),a=t+n,h=e+s,d=1^r,p=r?o-l:l-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+a+","+h:(Math.abs(this._x1-a)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+a+","+h),i&&(p<0&&(p=p%w+w),p>m?this._+="A"+i+","+i+",0,1,"+d+","+(t-n)+","+(e-s)+"A"+i+","+i+",0,1,"+d+","+(this._x1=a)+","+(this._y1=h):p>1e-6&&(this._+="A"+i+","+i+",0,"+ +(p>=v)+","+d+","+(this._x1=t+i*Math.cos(l))+","+(this._y1=e+i*Math.sin(l))))},rect:function(t,e,i,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +o+"h"+-i+"Z"},toString:function(){return this._}};var T=Math.PI,B=2*T,z={draw:function(t,e){var i=Math.sqrt(e/T);t.moveTo(i,0),t.arc(0,0,i,0,B)}},P={draw:function(t,e){var i=Math.sqrt(e/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},A=Math.sqrt(1/3),W=2*A,H={draw:function(t,e){var i=Math.sqrt(e/W),o=i*A;t.moveTo(0,-i),t.lineTo(o,0),t.lineTo(0,i),t.lineTo(-o,0),t.closePath()}},I=Math.sin(T/10)/Math.sin(7*T/10),k=Math.sin(B/10)*I,M=-Math.cos(B/10)*I,F={draw:function(t,e){var i=Math.sqrt(.8908130915292852*e),o=k*i,l=M*i;t.moveTo(0,-i),t.lineTo(o,l);for(var r=1;r<5;++r){var n=B*r/5,s=Math.cos(n),a=Math.sin(n);t.lineTo(a*i,-s*i),t.lineTo(s*o-a*l,a*o+s*l)}t.closePath()}},O={draw:function(t,e){var i=Math.sqrt(e),o=-i/2;t.rect(o,o,i,i)}},D=Math.sqrt(3),L={draw:function(t,e){var i=-Math.sqrt(e/(3*D));t.moveTo(0,2*i),t.lineTo(-D*i,-i),t.lineTo(D*i,-i),t.closePath()}},R=-.5,G=Math.sqrt(3)/2,E=1/Math.sqrt(12),Y=3*(E/2+1),X={draw:function(t,e){var i=Math.sqrt(e/Y),o=i/2,l=i*E,r=o,n=i*E+i,s=-r,a=n;t.moveTo(o,l),t.lineTo(r,n),t.lineTo(s,a),t.lineTo(R*o-G*l,G*o+R*l),t.lineTo(R*r-G*n,G*r+R*n),t.lineTo(R*s-G*a,G*s+R*a),t.lineTo(R*o+G*l,R*l-G*o),t.lineTo(R*r+G*n,R*n-G*r),t.lineTo(R*s+G*a,R*a-G*s),t.closePath()}};function V(){var t=S(z),e=S(64),i=null;function o(){var o;if(i||(i=o=C()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),o)return i=null,o+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:S(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:S(+t),o):e},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o}var N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j=function(t){return t},U=function(t){for(var e=[],i=0,o=t.length;i<o;i++)e[i]=t[o-i-1];return e},q=function(t,i){t.each(function(){for(var t,o=e.select(this),l=o.text().split(/\s+/).reverse(),r=[],n=(o.attr("y"),parseFloat(o.attr("dy"))||0),s=o.text(null).append("tspan").attr("x",0).attr("dy",n+"em");t=l.pop();)r.push(t),s.text(r.join(" ")),s.node().getComputedTextLength()>i&&r.length>1&&(r.pop(),s.text(r.join(" ")),r=[t],s=o.append("tspan").attr("x",0).attr("dy",1.2+n+"em").text(t))})},K={d3_drawShapes:function(t,e,i,o,l,r){"rect"===t?e.attr("height",i).attr("width",o):"circle"===t?e.attr("r",l):"line"===t?e.attr("x1",0).attr("x2",o).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",r)},d3_addText:function(t,e,i,o,l){e.append("text").attr("class",o+"label");var r=t.selectAll("g."+o+"cell text."+o+"label").data(i).text(j);return l&&t.selectAll("g."+o+"cell text."+o+"label").call(q,l),r},d3_calcType:function(t,e,i,o,l,r){var n=t.invertExtent?function(t,e,i){var o=t.range().map(function(o){var l=t.invertExtent(o);return e(l[0])+" "+i+" "+e(l[1])});return{data:t.range(),labels:o,feature:j}}(t,l,r):t.ticks?function(t,e,i){var o=[];if(e.length>1)o=e;else for(var l=t.domain(),r=(l[l.length-1]-l[0])/(e-1),n=0;n<e;n++)o.push(l[0]+n*r);var s=o.map(i);return{data:o,labels:s,feature:function(e){return t(e)}}}(t,i,l):function(t){return{data:t.domain(),labels:t.domain(),feature:function(e){return t(e)}}}(t),s=t.range&&t.range()||t.domain();return n.labels=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],o=arguments[3];if("object"===(void 0===e?"undefined":N(e))){if(0===e.length)return t;for(var l=e.length;l<t.length;l++)e.push(t[l]);return e}if("function"==typeof e){for(var r=[],n=t.length,s=0;s<n;s++)r.push(e({i:s,genLength:n,generatedLabels:t,domain:i,range:o}));return r}return t}(n.labels,o,t.domain(),s),e&&(n.labels=U(n.labels),n.data=U(n.data)),n},d3_filterCells:function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),o=i.map(function(t){return t.data}),l=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==o.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==l.indexOf(t)}),t},d3_placement:function(t,e,i,o,l,r){e.attr("transform",i),o.attr("transform",l),"horizontal"===t&&o.style("text-anchor",r)},d3_addEvents:function(t,e){t.on("mouseover.legend",function(t){!function(t,e,i){t.call("cellover",i,e)}(e,t,this)}).on("mouseout.legend",function(t){!function(t,e,i){t.call("cellout",i,e)}(e,t,this)}).on("click.legend",function(t){!function(t,e,i){t.call("cellclick",i,e)}(e,t,this)})},d3_title:function(t,e,i,o){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),o&&t.selectAll("text."+i+"legendTitle").call(q,o);var l=t.select("."+i+"legendCells"),r=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],n=-l.nodes().map(function(t){return t.getBBox().x})[0];l.attr("transform","translate("+n+","+r+")")}},d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};var J=function(t){function i(i){var o=t.call(this)||this;o._disabled=[],o._symbolTypeMap={circle:z,cross:P,diamond:H,square:O,star:F,triangle:L,wye:X},o._owner=i,o._drawStartPos="origin";var l=o;return o._legendOrdinal=function(){var t=e.scaleLinear(),i="rect",o=15,l=15,r=10,n=2,s=[5],a=void 0,h=[],d="",p=!1,c="",u=K.d3_defaultLocale,g=K.d3_defaultFormatSpecifier,f=10,y="middle",b=K.d3_defaultDelimiter,_=void 0,v="vertical",w=!1,m=void 0,x=void 0,C=e.dispatch("cellover","cellout","cellclick");function S(S){var T=K.d3_calcType(t,w,s,h,u.format(g),b);S.selectAll("g").data([t]).enter().append("g").attr("class",d+"legendCells"),a&&K.d3_filterCells(T,a);var B=S.select("."+d+"legendCells").selectAll("."+d+"cell").data(T.data),z=B.enter().append("g").attr("class",d+"cell");z.append(i).attr("class",d+"swatch");var P=S.selectAll("g."+d+"cell "+i+"."+d+"swatch").data(T.data);K.d3_addEvents(z,C),B.exit().transition().style("opacity",0).remove(),P.exit().transition().style("opacity",0).remove(),P=P.merge(P),K.d3_drawShapes(i,P,l,o,r,m);var A=K.d3_addText(S,z,T.labels,d,_);B=z.merge(B);var W=A.nodes().map(function(t){return t.getBBox()}),H=P.nodes().map(function(t){return t.getBBox()});p?P.attr("class",function(t){return d+"swatch "+T.feature(t)}):"line"==i?P.style("stroke",T.feature):P.style("fill",T.feature);var I,k=void 0,M=void 0,F="start"==y?0:"middle"==y?.5:1;"vertical"===v?(I=W.map(function(t,e){return Math.max(t.height,H[e].height)}),k=function(t,i){return"translate(0, "+(e.sum(I.slice(0,i))+i*n)+")"},M=function(t,e){return"translate( "+(H[e].width+H[e].x+f)+", "+(H[e].y+H[e].height/2+5)+")"}):"horizontal"===v&&(k=function(t,e){return"translate("+e*(H[e].width+n)+",0)"},M=function(t,e){return"translate("+(H[e].width*F+H[e].x)+",\n "+(H[e].height+H[e].y+f+8)+")"}),K.d3_placement(v,B,k,A,M,y),K.d3_title(S,c,d,x),B.transition().style("opacity",1)}return S.scale=function(e){return arguments.length?(t=e,S):t},S.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(s=t),S):s},S.cellFilter=function(t){return arguments.length?(a=t,S):a},S.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,m=e),S):i},S.shapeWidth=function(t){return arguments.length?(o=+t,S):o},S.shapeHeight=function(t){return arguments.length?(l=+t,S):l},S.shapeRadius=function(t){return arguments.length?(r=+t,S):r},S.shapePadding=function(t){return arguments.length?(n=+t,S):n},S.labels=function(t){return arguments.length?(h=t,S):h},S.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),S):y},S.locale=function(t){return arguments.length?(u=e.formatLocale(t),S):u},S.labelFormat=function(t){return arguments.length?(g=e.formatSpecifier(t),S):S.locale().format(g)},S.labelOffset=function(t){return arguments.length?(f=+t,S):f},S.labelDelimiter=function(t){return arguments.length?(b=t,S):b},S.labelWrap=function(t){return arguments.length?(_=t,S):_},S.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(p=t),S):p},S.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(v=t),S):v},S.ascending=function(t){return arguments.length?(w=!!t,S):w},S.classPrefix=function(t){return arguments.length?(d=t,S):d},S.title=function(t){return arguments.length?(c=t,S):c},S.titleWidth=function(t){return arguments.length?(x=t,S):x},S.textWrap=function(t){return arguments.length?(textWrap=t,S):textWrap},S.on=function(){var t=C.on.apply(C,arguments);return t===C?S:t},S}().shape("path",V().type(z).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){l.onClick(t,this)}).on("cellover",function(t){l.onOver(t,o)}).on("cellout",function(t){l.onOut(t,o)}),o}return r(i,t),i.prototype.isDisabled=function(t){return void 0!==t&&("string"==typeof t?0===t.indexOf("__")||this._disabled.indexOf(t)>=0:t instanceof e.Database.Field?0===t.id().indexOf("__")||this._disabled.indexOf(t.id())>=0:this._disabled.indexOf(t)>=0)},i.prototype.filteredFields=function(){var t=this;switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(function(e){return!t.isDisabled(e)})}return this.fields()},i.prototype.filteredColumns=function(){var t=this;switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(function(e){return!t.isDisabled(e)})}return this.columns()},i.prototype.filteredData=function(){var t=this;switch(this.dataFamily()){case"2D":return this.data().filter(function(e){return!t.isDisabled(e[0])});case"ND":var e={},i=!1;return this.columns().forEach(function(o,l){var r=t.isDisabled(o);e[l]=r,r&&(i=!0)}),i?this.data().map(function(t){return t.filter(function(t,i){return!e[i]})}):this.data()}return this.data()},i.prototype.isRainbow=function(){var t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()},i.prototype.targetWidget=function(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){var e=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(t,i,o,l){switch(t){case"chart":case"columns":case"data":case"paletteID":e.lazyRender()}})}return this},i.prototype.getWidget=function(){if(this._targetWidget)switch(this._targetWidget.classID()){case"composite_MultiChart":return this._targetWidget.chart()}return this._targetWidget},i.prototype.getPalette=function(){var t=this.getWidget();if(t&&t._palette)switch(t._palette.type()){case"ordinal":return e.Palette.ordinal(t._palette.id());case"rainbow":return e.Palette.rainbow(t._palette.id())}return e.Palette.ordinal("default")},i.prototype.getPaletteType=function(){return this.getPalette().type()},i.prototype.fillColorFunc=function(){var t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),function(e,i,o){return t.fillColor(e,i,o)};var i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return function(t,e,o){return i(e)}},i.prototype.fillColor=function(t,e,i){return this.fillColorFunc()(t,e,i)},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._g=i.append("g").attr("class","legendOrdinal")},i.prototype.calcMetaData=function(){var t=[],i=0,o=0,l=this.columns().length;if(this._targetWidget){var r=this.columns();switch(this.getPaletteType()){case"ordinal":var n=this.fillColorFunc(),s=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){s=this.data()[e].slice(1,l).reduce(function(t,e){return t+e},0);var r=this.isDisabled(t[0]);r||(i+=s);var a=t[0]+(!r&&this.showSeriesTotal()?" ("+s+")":""),h=this.textSize(a);return o<h.width&&(o=h.width),[n(t,t[0],!1),t[0],a]},this);break;case"ND":t=this.columns().filter(function(t){return 0!==t.indexOf("__")}).filter(function(t,e){return e>0}).map(function(t,e){s=this.data().reduce(function(t,i){return t+i[e+1]},0);var l=this.isDisabled(r[e+1]),a=t+(!l&&this.showSeriesTotal()?" ("+s+")":"");l||(i+=s);var h=this.textSize(a);return o<h.width&&(o=h.width),[n(void 0,t,!1),t,a]},this);break;default:t=this.columns().map(function(t){return[n(void 0,t,!1),t]},this)}break;case"rainbow":var a=this.getPalette(),h=e.format(this.rainbowFormat()),d=this.getWidget(),p=this.rainbowBins(),c=d._dataMinWeight,u=d._dataMaxWeight,g=(u-c)/(p-1);t.push([a(c,c,u),h(c)]);for(var f=1;f<p-1;++f){var y=g*f;Math.floor(y)>parseInt(t[0][1])&&(y=Math.floor(y)),t.push([a(y,c,u),h(y)])}t.push([a(u,c,u),h(u)])}}return{dataArr:t,total:i,maxLabelWidth:o}},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var l=this.calcMetaData(),r=l.dataArr,n=l.maxLabelWidth,s=l.total,a=this.shapeRadius(),h=this.radiusToSymbolSize(a),d=this.itemPadding();"horizontal"===this.orientation()&&(d+=n-2*a);var p=e.scaleOrdinal().domain(r.map(function(t){return t[1]})).range(r.map(function(t){return t[0]}));this._legendOrdinal.shape("path",V().type(this._symbolTypeMap[this.symbolType()]).size(h)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(d).scale(p).labels(function(t){return r[t.i][2]}),this._g.call(this._legendOrdinal),this.updateDisabled(o,r);var c=this._g.select(".legendCells").node().getBBox(),u=Math.abs(c.x),g=Math.abs(c.y)+1;if("horizontal"===this.orientation())"start"===this.labelAlign()?u+=1:"end"===this.labelAlign()&&(u-=1),this.width()>c.width&&(u+=(this.width()-c.width)/2);else if("vertical"===this.orientation()){if(u+=1,this._containerSize.height>c.height)g+=(this.height()-c.height)/2}this._g.attr("transform","translate("+u+", "+g+")"),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());var f=this._g.selectAll(".legendTotal").data(r.length&&this.showLegendTotal()?[s]:[]),y="Total: "+s,b=-u,_=c.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),f.enter().append("text").classed("legendTotal",!0).merge(f).attr("transform","translate("+b+", "+_+")").text(y),f.exit().remove()},i.prototype.updateDisabled=function(t,e){var i=this;t.style("cursor","pointer").selectAll("path.swatch").filter(function(t,i){return i<e.length}).style("stroke",function(t,i){return e[i][0]}).style("fill",function(t,o){return i._disabled.indexOf(t)<0?e[o][0]:"white"})},i.prototype.postUpdate=function(e,i){var o;this._boundingBox&&(o=this._boundingBox.width,this._boundingBox.width=this._size.width),t.prototype.postUpdate.call(this,e,i),void 0!==o&&(this._boundingBox.width=o),this._parentRelativeDiv.style("overflow","hidden")},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.radiusToSymbolSize=function(t){var e=Math.pow(t,2)*Math.PI;switch(this.symbolType()){case"star":return.45*e;case"triangle":return.65*e;case"cross":case"diamond":case"wye":return.75*e;case"circle":return e;case"square":return 1.3*e}},i.prototype.onClick=function(t,e){switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":var i=this._disabled.indexOf(t);i<0?this._disabled.push(t):this._disabled.splice(i,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}}},i.prototype.onOver=function(t,e){if(o.instanceOfIHighlight(this._owner))switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}}},i.prototype.onOut=function(t,e){if(o.instanceOfIHighlight(this._owner))switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}}},i.prototype.onDblClick=function(t,e){console.log("Legend onDblClick method"),console.log("rowData: "+t),console.log("rowIdx: "+e)},i.prototype.onMouseOver=function(t,e){console.log("Legend onMouseOver method"),console.log("rowData: "+t),console.log("rowIdx: "+e)},i.prototype.resize=function(e){var i;if(this.fitToContent()){this._containerSize=e;var o=this.getBBox();e.width>o.width&&(o.width=e.width),e.height>o.height&&(o.height=e.height),i=t.prototype.resize.apply(this,[n({},o)])}else i=t.prototype.resize.apply(this,arguments);return i},i}(e.SVGWidget);J.prototype._class+=" layout_Legend",J.prototype.publish("title","","string","Title"),J.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),J.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),J.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),J.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),J.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:function(t){return!t.isRainbow()}}),J.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:function(t){return!t.isRainbow()}}),J.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),J.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),J.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),J.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),J.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),J.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:function(t){return"vertical"===t.orientation()}});d(".layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-y:scroll;overflow-x:hidden}.layout_Modal-annotations,.layout_Modal-title{position:absolute}.layout_Modal-closeButton{cursor:pointer}.layout_Modal-closeButton:hover{opacity:.7}.layout_Modal-closeButton:active{opacity:.5}.layout_Modal-fade{position:fixed;background-color:#000;opacity:.5;z-index:10000}.layout_Modal-content{position:fixed;background-color:#fff;z-index:10100}.layout_Modal-fade-hidden{display:none}.layout_Modal-fadeClickable{cursor:pointer}");var Z=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return r(e,t),e.prototype.closeModal=function(){this.visible(!1)},e.prototype.getRelativeTarget=function(){var t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()))?t:!t&&(t=this.locateAncestor("layout_Grid"))&&t.element?t.element().node():document.body},e.prototype.setModalSize=function(){null!==this.fixedHeight()&&null!==this.fixedWidth()?this._modal.style("height",this.fixedHeight()).style("width",this.fixedWidth()).style("min-height",null).style("min-width",null).style("max-height",null).style("max-width",null):(this.minHeight()||this.minWidth())&&this._modal.style("min-height",this.minHeight()).style("min-width",this.minWidth()).style("max-height",this.maxHeight()).style("max-width",this.maxWidth());var t=this._modal.node().getBoundingClientRect(),e=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style("height",t.height-e.height+"px").style("width",t.width),t},e.prototype.setFadePosition=function(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")},e.prototype.setModalPosition=function(t){var e=this.setModalSize();if(null!==this.fixedTop()&&null!==this.fixedLeft())this._modal.style("top","calc("+this.fixedTop()+" + "+t.top+"px)").style("left","calc("+this.fixedLeft()+" + "+t.left+"px)");else if(null!==this.fixedHeight()&&null!==this.fixedWidth())this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px");else if(this.minHeight()||this.minWidth()){var i=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-i.height/2+"px").style("left",t.left+t.width/2-i.width/2+"px")}},e.prototype.resize=function(e){return t.prototype.resize.call(this),this._modal&&this.setModalSize(),this},e.prototype.resizeBodySync=function(t,e){var i=this._modalHeader.node().getBoundingClientRect();return this._modal.style("width",t+"px").style("height",e+i.height+"px").style("min-width",t+"px").style("min-height",e+i.height+"px"),this._modalHeader.style("width",t+"px"),this._modalBody.style("width",t+"px").style("height",e+"px"),this.minWidth(t+"px").minHeight(e+i.height+"px").resize({height:e+i.height,width:t})},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._fade=i.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());var l=2*this.titleFontSize();this._modal=i.append("div").classed("layout_Modal-content",!0),this._modalHeader=this._modal.append("div").classed("layout_Modal-header",!0).style("color",this.titleFontColor()).style("font-size",this.titleFontSize()+"px").style("height",l+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height","calc( 100% - "+l+"px )").style("overflow-x",this.overflowX()).style("overflow-y",this.overflowY()),this._modalHeader.append("div").classed("layout_Modal-title",!0).style("line-height",this.titleFontSize()+"px").style("top",this.titleFontSize()/2+"px").style("left",this.titleFontSize()/2+"px").text(this.formattedTitle()),this._modalHeaderAnnotations=this._modalHeader.append("div").classed("layout_Modal-annotations",!0),this._modalHeaderCloseButton=this._modalHeaderAnnotations.append("div").classed("layout_Modal-closeButton",!0).html('<i class="fa fa-close"></i>'),this._modalHeaderAnnotations.style("line-height",this.titleFontSize()+"px").style("right",this.titleFontSize()/2+"px").style("top",this.titleFontSize()/2+"px"),this._modalHeaderCloseButton.on("click",function(){o.closeModal()}),this._fade.on("click",function(t){o.enableClickFadeToClose()&&o.closeModal()})},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();var o=this._relativeTarget.getBoundingClientRect();this.setFadePosition(o),this.setModalPosition(o),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()},e.prototype.exit=function(e,i){this._widget&&this._widget.target(null),t.prototype.exit.call(this,e,i)},e.prototype.formattedTitle=function(){var t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()},e}(e.HTMLWidget);Z.prototype._class+=" layout_Modal",Z.prototype.publish("title",null,"string","title"),Z.prototype.publish("widget",null,"widget","widget"),Z.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),Z.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),Z.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),Z.prototype.publish("show",!0,"boolean","show"),Z.prototype.publish("showFade",!0,"boolean","showFade"),Z.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),Z.prototype.publish("minWidth","400px","string","minWidth"),Z.prototype.publish("minHeight","400px","string","minHeight"),Z.prototype.publish("maxWidth","800px","string","maxWidth"),Z.prototype.publish("maxHeight","800px","string","maxHeight"),Z.prototype.publish("fixedWidth",null,"string","fixedWidth"),Z.prototype.publish("fixedHeight",null,"string","fixedHeight"),Z.prototype.publish("fixedTop",null,"string","fixedTop"),Z.prototype.publish("fixedLeft",null,"string","fixedLeft"),Z.prototype.publish("overflowX","hidden","string","overflowX"),Z.prototype.publish("overflowY","scroll","string","overflowY");d(".layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}");var Q=function(t){function o(){var o=t.call(this)||this;return o._legend=new J(o).enableOverflow(!0),o._progressBar=new e.ProgressBar,o._autoScale=!1,o._resolutions={tiny:{width:100,height:100},small:{width:300,height:300}},o._modal=new Z,o._toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",function(){return""!==o.description()}).on("click",function(){if(o._toggleInfo.selected()){o._modal.title(o.title()).widget((new e.Text).text(o.description())).show(!0).render();var t=o._modal._close;o._modal._close=function(){o._toggleInfo.selected(!1).render(),o._modal._close=t}}}).on("mouseMove",function(){}).on("mouseOut",function(){}),o._toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",function(){o.dataVisible(o._toggleData.selected()),o.render()}),o._buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",function(){o.downloadCSV()}),o._buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",function(){o.downloadPNG()}),o._toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",function(){var t=o._toggleLegend.selected();"bottom"===o.legendPosition()?o.showBottom(t):"right"===o.legendPosition()&&o.showRight(t),o.legendVisible(t),o.render()}),o._spacer=new e.Spacer,o._titleBar=(new e.TitleBar).buttons([o._toggleData,o._buttonDownload,o._buttonDownloadImage,o._spacer,o._toggleLegend]),o._carousel=new _,o._table=new i.Table,o._hideLegendToggleList=["dgrid_Table"],o._tag="div",o}return r(o,t),o.prototype.fields=function(e){return arguments.length?(t.prototype.fields.call(this,e),this._legend.fields(e),this.refreshFields(),this):t.prototype.fields.call(this)},o.prototype.refreshFields=function(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this},o.prototype.columns=function(e,i){return arguments.length?(t.prototype.columns.call(this,e,i),this._legend.columns(e,i),this.refreshColumns(),this):t.prototype.columns.call(this)},o.prototype.refreshColumns=function(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this},o.prototype.data=function(e){return arguments.length?(t.prototype.data.call(this,e),this._legend.data(e),this.refreshData(),this):t.prototype.data.call(this)},o.prototype.refreshData=function(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this},o.prototype.highlight=function(t){return arguments.length?(this._highlight=t,this):this._highlight},o.prototype.startProgress=function(){this._progressBar.start()},o.prototype.finishProgress=function(){this._progressBar.finish()},o.prototype.buttons=function(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()},o.prototype.downloadCSV=function(){var t=this.downloadTitle()?this.downloadTitle():this.title()?this.title():"data",i=this.downloadTimestampSuffix()?"_"+e.Utility.timestamp():"";return e.Utility.downloadString("CSV",this._widget.export("CSV"),t+i),this},o.prototype.downloadPNG=function(){var t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this},o.prototype.highlightColumn=function(t){if(t){var i="series-"+this.cssTag(t);this._centerWA.element().selectAll(".series").each(function(){var t=e.select(this),o=t.classed(i);t.classed("highlight",o).classed("lowlight",!o)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this},o.prototype.getResponsiveMode=function(){return this.enableAutoscaling()?this._autoScale?this.size().width<=this._resolutions.tiny.width||this.size().height<=this._resolutions.tiny.height?"tiny":this.size().width<=this._resolutions.small.width||this.size().height<=this._resolutions.small.height?"small":"regular":"regular":"none"},o.prototype.setOrigSize=function(){this._orig_size=JSON.parse(JSON.stringify(this.size()))},o.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._modal.target(this.target()).relativeTargetId(this.id()),this.top(this._titleBar),this.center(this._carousel),this._legend.targetWidget(this._widget).orientation("vertical").title("").visible(!1),this._progressBar.enter(e,i),this.setOrigSize()},o.prototype.preUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")},o.prototype.preUpdateSmall=function(t){var e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);var o=this._scale===e;this.size({width:o?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:o?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),t.select("div.title-icon").style("position","static"),t.selectAll("lhs").style("display","none"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.style("transform","scale("+this._scale+")")},o.prototype.preUpdateRegular=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.select("div.title-icon").style("position","static"),t.style("transform","translate(0px,0px) scale(1)")},o.prototype.update=function(e,i){t.prototype.update.call(this,e,i)},o.prototype.preUpdate=function(i,o){switch(t.prototype.preUpdate.call(this,i,o),this._prevLegendPosition!==this.legendPosition()&&(null!==this._legend.target()&&this._legend.target(null),void 0!==this._prevLegendPosition?this.swap(this._prevLegendPosition,this.legendPosition()):this[this.legendPosition()](this._legend),"right"===this.legendPosition()?(this.rightOverflowX("hidden"),this.rightOverflowY("auto"),this.bottomOverflowX("visible"),this.bottomOverflowY("visible")):(this.rightOverflowX("visible"),this.rightOverflowY("visible"),this.bottomOverflowX("auto"),this.bottomOverflowY("hidden")),this._prevLegendPosition=this.legendPosition()),this._prevdataVisible!==this.dataVisible()&&(this._prevdataVisible=this.dataVisible(),this._toggleData.selected(this._prevdataVisible),this._carousel.active(this._prevdataVisible?1:0)),this._prevlegendVisible!==this.legendVisible()&&(this._prevlegendVisible=this.legendVisible(),this._toggleLegend.selected(this._prevlegendVisible),this._legend.visible(this._prevlegendVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(o);break;case"small":this.preUpdateSmall(o);break;case"regular":this.preUpdateRegular(o)}var l="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(l._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily())switch(this._prevChartDataFamily=this._legend.dataFamily(),this._prevChartDataFamily){case"any":this._toggleLegend.selected(!1),this._legend.visible(!1)}if(o.style("box-shadow",this.highlight()?"inset 0px 0px 0px "+this.highlightSize()+"px "+this.highlightColor():"none"),-1!==this._hideLegendToggleList.indexOf(l.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==l){this._prevChart=l;var r=l?l._titleBar||l._iconBar:void 0;if(r&&r instanceof e.IconBar){this._prevButtons=this._prevButtons||h([],this.buttons());var n=h(h(h([],r.buttons()),[new e.Spacer]),this._prevButtons);r.buttons([]).render(),this.buttons(n)}else this._prevButtons&&this.buttons(this._prevButtons)}var s=[];this.dataButtonVisible()||s.push(this._toggleData),this.downloadButtonVisible()||s.push(this._buttonDownload),this.downloadImageButtonVisible()||s.push(this._buttonDownloadImage),this.legendButtonVisible()||s.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(s).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())},o.prototype.postUpdate=function(e,i){switch(t.prototype.postUpdate.call(this,e,i),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(i);break;case"small":this.postUpdateSmall(i);break;case"regular":this.postUpdateRegular(i)}},o.prototype.postUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none"),t.selectAll("div.data-count").style("visibility","visible").style("font-size",this.titleIconFontSize()/3+"px").style("line-height",this.titleIconFontSize()/3+"px").style("left",this.titleIconFontSize()+"px").text(this.data().length),t.style("transform","translate(0px,0px) scale(1)");var e=t.selectAll("div.title-icon"),i=e.node(),o=t.node().parentElement.getBoundingClientRect();if(i){var l=e.node().getBoundingClientRect(),r=o.height/2;e.style("position","absolute").style("left","calc(50% - "+l.width/2+"px)").style("top",r-l.height/2+"px"),t.selectAll("div.data-count").style("position","absolute").style("left","calc(50% + "+l.width/2+"px)").style("top",r-l.height/2+"px")}},o.prototype.postUpdateSmall=function(t){t.selectAll("lhs").style("display","none"),t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden");var e=t.node().getBoundingClientRect(),i=t.node().parentElement.getBoundingClientRect();t.style("transform","translate("+(i.x-e.x)+"px, "+(i.y-e.y)+"px) scale("+this._scale+")")},o.prototype.postUpdateRegular=function(t){t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden")},o.prototype.exit=function(e,i){this._progressBar.exit(e,i),this.right(null),this._legend.target(null),this.center(null),this._carousel.target(null),this.top(null),this._titleBar.target(null),this._modal.target(null),delete this._prevChart,delete this._prevButtons,delete this._prevChartDataFamily,delete this._prevPos,delete this._prevdataVisible,delete this._prevlegendVisible,t.prototype.exit.call(this,e,i)},o.prototype.click=function(t,e,i){},o.prototype.dblclick=function(t,e,i){},o.prototype.vertex_click=function(t,e,i,o){o&&o.vertex},o.prototype.vertex_dblclick=function(t,e,i,o){o&&o.vertex},o.prototype.edge_click=function(t,e,i,o){o&&o.edge},o.prototype.edge_dblclick=function(t,e,i,o){o&&o.edge},o}(b);Q.prototype._class+=" layout_ChartPanel",Q.prototype.publishReset(),Q.prototype.publishProxy("title","_titleBar"),Q.prototype.publish("titleVisible",!0,"boolean"),Q.prototype.publish("titleOverlay",!1,"boolean"),Q.prototype.publishProxy("titleIcon","_titleBar"),Q.prototype.publishProxy("titleIconFont","_titleBar"),Q.prototype.publishProxy("titleFont","_titleBar"),Q.prototype.publishProxy("titleIconFontSize","_titleBar"),Q.prototype.publishProxy("titleFontSize","_titleBar"),Q.prototype.publishProxy("description","_titleBar"),Q.prototype.publishProxy("descriptionFont","_titleBar"),Q.prototype.publishProxy("descriptionFontSize","_titleBar"),Q.prototype.publish("dataVisible",!1,"boolean","Show data table"),Q.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),Q.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),Q.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),Q.prototype.publish("downloadTitle","","string","File name when downloaded"),Q.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),Q.prototype.publish("legendVisible",!1,"boolean","Show legend"),Q.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),Q.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),Q.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),Q.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),Q.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),Q.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),Q.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),Q.prototype.publishProxy("legend_symbolType","_legend","symbolType"),Q.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),Q.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),Q.prototype.publish("enableAutoscaling",!1,"boolean"),Q.prototype.publish("highlightSize",4,"number"),Q.prototype.publish("highlightColor","#e67e22","html-color"),Q.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),Q.prototype.publishProxy("progress_decay","_progressBar","decay"),Q.prototype.publishProxy("progress_size","_progressBar","size"),Q.prototype.publishProxy("progress_color","_progressBar","color"),Q.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),Q.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),Q.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),Q.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),Q.prototype.widget=function(t){if(!arguments.length)return this._widget;this._carousel.widgets([t,this._table]),this._widget=t,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());var e=this,i=this._widget;return i.click=function(){e.click.apply(e,arguments)},i.dblclick=function(){e.dblclick.apply(e,arguments)},i.vertex_click=function(){e.vertex_click.apply(e,arguments)},i.vertex_dblclick=function(){e.vertex_dblclick.apply(e,arguments)},i.edge_click=function(){e.edge_click.apply(e,arguments)},i.edge_dblclick=function(){e.edge_dblclick.apply(e,arguments)},this};d(".layout_FlexGrid{display:flex}.FlexGrid-list-item{overflow:hidden;border-style:solid;flex-grow:1}");var $=function(t){function i(){return t.call(this)||this}return r(i,t),i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),e.select(i.parentNode).style("height","100%").style("width","100%")},i.prototype.update=function(e,i){var o=this;t.prototype.update.call(this,e,i);var l=this,r=[];this.updateFlexParent(i);var n=i.selectAll(".FlexGrid-list-item").data(this.widgets(),function(t){return t.id()});n.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(n).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",function(t,e){var i=o.widgetsFlexBasis()[e];return void 0!==i?i:o.flexBasis()}).style("flex-grow",function(t,e){var i=o.widgetsFlexGrow()[e];return void 0!==i?i:o.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){var t=this.getBoundingClientRect();r.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:r[e][0]-2*l.borderWidth(),height:r[e][1]-2*l.borderWidth()})}),n.exit().remove()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.updateFlexParent=function(t){var e=this;t.style("height","100%").style("flex-direction","horizontal"===this.orientation()?"row":"column").style("flex-wrap",this.flexWrap()).style("align-items",this.alignItems()).style("align-content",this.alignContent()).style("overflow-x",function(){return e.forceXScroll()||"horizontal"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"}).style("overflow-y",function(){return e.forceYScroll()||"vertical"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"})},i}(e.HTMLWidget);$.prototype._class+=" layout_FlexGrid",$.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),$.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),$.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),$.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),$.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:function(t){return"nowrap"!==t.flexWrap()}}),$.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),$.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),$.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),$.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),$.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),$.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),$.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),$.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),$.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),$.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),$.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var tt=function(t,e,i){return t(i={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&i.path)}},i.exports),i.exports}(function(t,e){t.exports=function(){var t=function(t,e){for(var i in this._options=e,this.defaults)this._options.hasOwnProperty(i)||(this._options[i]=this.defaults[i]);this.items=t,this._adjustSizeOfItems(),this.generateGrid()};t.cloneItems=function(t,e){var i,o;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(o in e[i]||(e[i]={}),t[i])e[i][o]=t[i][o];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:function(){var t,e,i,o=this.grid.length,l="\n #|",r="\n --";for(e=0;e<o;e++)l+=" "+this._padNumber(e," "),r+="---";for(l+=r,e=0;e<this._options.lanes;e++)for(l+="\n"+this._padNumber(e," ")+"|",i=0;i<o;i++)l+=" ",t=this.grid[i][e],l+=t?this._padNumber(this.items.indexOf(t),"0"):"--";return l+="\n"},generateGrid:function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},resizeGrid:function(t){var e=0;this._options.lanes=t,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var i=0;i<this.items.length;i++){var o=this.items[i],l=this._getItemPosition(o);this._updateItemPosition(o,this.findPositionForItem(o,{x:e,y:0})),e=Math.max(e,l.x)}this._pullItemsToLeft()},findPositionForItem:function(t,e,i){var o,l,r;for(o=e.x;o<this.grid.length;o++)if(void 0!==i){if(r=[o,i],this._itemFitsAtPosition(t,r))return r}else for(l=e.y;l<this._options.lanes;l++)if(r=[o,l],this._itemFitsAtPosition(t,r))return r;var n=this.grid.length,s=0;return void 0!==i&&this._itemFitsAtPosition(t,[n,i])&&(s=i),[n,s]},moveItemToPosition:function(t,e){var i=this._getItemPosition({x:e[0],y:e[1],w:t.w,h:t.h});this._updateItemPosition(t,[i.x,i.y]),this._resolveCollisions(t)},resizeItem:function(t,e){var i=e.w||t.w,o=e.h||t.h;this._updateItemSize(t,i,o),this._resolveCollisions(t),this._pullItemsToLeft()},getChangedItems:function(t,e){for(var i=[],o=0;o<t.length;o++){var l=this._getItemByAttribute(e,t[o][e]);l.x===t[o].x&&l.y===t[o].y&&l.w===t[o].w&&l.h===t[o].h||i.push(l)}return i},_sortItemsByPosition:function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return i.x!=o.x?i.x-o.x:i.y!=o.y?i.y-o.y:0}.bind(this))},_adjustSizeOfItems:function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];void 0===e.autoSize&&(e.autoSize=0===e.w||0===e.h),e.autoSize&&("horizontal"===this._options.direction?e.h=this._options.lanes:e.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(t,e){var i,o,l=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+l.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+l.w;i++){var r=this.grid[i];if(r)for(o=e[1];o<e[1]+l.h;o++)if(r[o]&&r[o]!==t)return!1}return!0},_updateItemPosition:function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},_updateItemSize:function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},_markItemPositionToGrid:function(t){var e,i,o=this._getItemPosition(t);for(this._ensureColumns(o.x+o.w),e=o.x;e<o.x+o.w;e++)for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]=t},_deleteItemPositionFromGrid:function(t){var e,i,o=this._getItemPosition(t);for(e=o.x;e<o.x+o.w;e++)if(this.grid[e])for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},_ensureColumns:function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},_getItemsCollidingWithItem:function(t){for(var e=[],i=0;i<this.items.length;i++)t!=this.items[i]&&this._itemsAreColliding(t,this.items[i])&&e.push(i);return e},_itemsAreColliding:function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return!(o.x>=i.x+i.w||o.x+o.w<=i.x||o.y>=i.y+i.h||o.y+o.h<=i.y)},_resolveCollisions:function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var o,l,r,n,s=new t([],this._options);t.cloneItems(this.items,s.items),s.generateGrid();for(var a=0;a<i.length;a++){var h=s.items[i[a]],d=this._getItemPosition(h),p=this._getItemPosition(e);if(o=[p.x-d.w,d.y],l=[p.x+p.w,d.y],r=[d.x,p.y-d.h],n=[d.x,p.y+p.h],s._itemFitsAtPosition(h,o))s._updateItemPosition(h,o);else if(s._itemFitsAtPosition(h,r))s._updateItemPosition(h,r);else if(s._itemFitsAtPosition(h,n))s._updateItemPosition(h,n);else{if(!s._itemFitsAtPosition(h,l))return!1;s._updateItemPosition(h,l)}}return t.cloneItems(s.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(t){if(this._sortItemsByPosition(),this._resetGrid(),t){var e=this._getItemPosition(t);this._updateItemPosition(t,[e.x,e.y])}for(var i=0;i<this.items.length;i++){var o=this.items[i],l=this._getItemPosition(o);if(!t||o!=t){var r=this._findLeftMostPositionForItem(o),n=this.findPositionForItem(o,{x:r,y:0},l.y);this._updateItemPosition(o,n)}}},_findLeftMostPositionForItem:function(t){for(var e=0,i=this._getItemPosition(t),o=0;o<this.grid.length;o++)for(var l=i.y;l<i.y+i.h;l++){var r=this.grid[o][l];if(r){var n=this._getItemPosition(r);this.items.indexOf(r)<this.items.indexOf(t)&&(e=n.x+n.w)}}return e},_getItemByAttribute:function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},_padNumber:function(t,e){return t>=10?t:e+t},_getItemPosition:function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},_setItemPosition:function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])}};var e=function(t){for(var e=0;e<t;e++)this.push(null)};return e.prototype=[],t}()}),et=Object.freeze(Object.assign(Object.create(null),tt,{default:tt,__moduleExports:tt}));d('.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{position:absolute;border-style:solid;border-width:1px;background:#f5f5f5}.layout_Grid>.lane{position:absolute;border-style:none;opacity:.25;border-radius:0;pointer-events:none}.layout_Grid>.ddCell.draggable{border-style:solid;border-width:1px;background-color:#f8f8ff;border-radius:0;cursor:move}.layout_Grid>.ddCell.draggable>.resizeHandle{bottom:0;right:0;width:8px;height:8px;border-style:none;position:absolute;cursor:nwse-resize}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{bottom:2px;right:2px;width:4px;height:4px;border-color:#a9a9a9;border-style:solid;border-width:0 2px 2px 0;background-color:none;position:absolute}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39.2%,.1) 0,hsla(0,0%,39.2%,.1) 8px)}.layout_Grid>.dragging,.layout_Grid>.resizing{border:1px solid grey;border-radius:0;position:absolute}.layout_Grid>.resizing{background-color:orange;opacity:.3;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,orange 0,orange 8px)}.layout_Grid>.ddCell.draggable .common_Widget.selected{border:1px solid red;background-color:grey;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,rgba(100,0,0,.1) 0,rgba(100,0,0,.1) 8px)}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}');var it=et&&tt||et,ot=function(t){function i(){var i=t.call(this)||this;return i._tag="div",i._selectionBag=new e.Utility.Selection(i),i.content([]),i}return r(i,t),i.prototype.getDimensions=function(){var t={width:0,height:0};return this.content().forEach(function(e){t.width<e.gridCol()+e.gridColSpan()&&(t.width=e.gridCol()+e.gridColSpan()),t.height<e.gridRow()+e.gridRowSpan()&&(t.height=e.gridRow()+e.gridRowSpan())},this),t},i.prototype.clearContent=function(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;for(var i=e;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))},i.prototype.setContent=function(t,e,i,o,l,r){if(l=l||1,r=r||1,o=o||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){var n=(new g).gridRow(t).gridCol(e).widget(i).title(o).gridRowSpan(l).gridColSpan(r);this.content().push(n)}return this},i.prototype.sortedContent=function(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})},i.prototype.getCell=function(t,e){var i=null;return this.content().some(function(o){return t>=o.gridRow()&&t<o.gridRow()+o.gridRowSpan()&&e>=o.gridCol()&&e<o.gridCol()+o.gridColSpan()&&(i=o,!0)}),i},i.prototype.getWidgetCell=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e},i.prototype.getContent=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e},i.prototype.cellToGridItem=function(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}},i.prototype.gridItemToCell=function(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)},i.prototype.resetItemsPos=function(){this.origItems.forEach(function(t){var e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)},i.prototype.initGridList=function(){this.itemsMap={},this.items=this.content().map(function(t){var e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new it(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})},i.prototype.killGridList=function(){this.gridList=null,delete this.items,delete this.itemsMap},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),this._scrollBarWidth=e.Platform.getScrollbarWidth();var l=this;this._d3Drag=e.drag().subject(function(t){var e=l.cellToGridItem(t);return{x:e.x*l.cellWidth,y:e.y*l.cellHeight}}).on("start",function(t){if(l.designMode()){e.d3Event().sourceEvent.stopPropagation(),l.initGridList();var i=l.itemsMap[t.id()];l.dragItem=o.append("div").attr("class","dragging").style("transform",function(){return"translate("+i.x*l.cellWidth+"px, "+i.y*l.cellHeight+"px)"}).style("width",function(){return i.w*l.cellWidth-l.gutter()+"px"}).style("height",function(){return i.h*l.cellHeight-l.gutter()+"px"}),l.selectionBagClick(t)}}).on("drag",function(t){if(l.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=l.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+o.w*l.cellWidth>l.snappingColumns()*l.cellWidth&&(i.x=l.snappingColumns()*l.cellWidth-o.w*l.cellWidth),i.y<0&&(i.y=0),i.y+o.h*l.cellWidth>l.snappingRows()*l.cellWidth&&(i.y=l.snappingRows()*l.cellWidth-o.h*l.cellWidth);var r=[Math.max(0,Math.floor((i.x+l.cellWidth/2)/l.cellWidth)),Math.max(0,Math.floor((i.y+l.cellHeight/2)/l.cellHeight))];o.x===r[0]&&o.y===r[1]||("none"!==l.snapping()?(l.resetItemsPos(),l.gridList.moveItemToPosition(o,r)):(o.x=r[0],o.y=r[1]),t.gridCol()===o.x&&t.gridRow()===o.y||(l.items.forEach(l.gridItemToCell),l.updateGrid(!1,100))),l.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return o.w*l.cellWidth+"px"}).style("height",function(){return o.h*l.cellHeight+"px"})}}).on("end",function(){l.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),l.dragItem.remove(),l.dragItem=null,l.killGridList())}),this._d3DragResize=e.drag().subject(function(t){var e=l.cellToGridItem(t);return{x:(e.x+e.w-1)*l.cellWidth,y:(e.y+e.h-1)*l.cellHeight}}).on("start",function(t){if(l.designMode()){e.d3Event().sourceEvent.stopPropagation(),l.initGridList();var i=l.itemsMap[t.id()];l.dragItem=o.append("div").attr("class","resizing").style("transform",function(){return"translate("+i.x*l.cellWidth+"px, "+i.y*l.cellHeight+"px)"}).style("width",function(){return i.w*l.cellWidth-l.gutter()+"px"}).style("height",function(){return i.h*l.cellHeight-l.gutter()+"px"}),l.dragItemPos={x:i.x,y:i.y}}}).on("drag",function(t){if(l.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=l.itemsMap[t.id()],r=[Math.max(0,Math.round(i.x/l.cellWidth)),Math.max(0,Math.round(i.y/l.cellHeight))],n={w:Math.max(1,r[0]-o.x+1),h:Math.max(1,r[1]-o.y+1)};o.w===n.w&&o.h===n.h||("none"!==l.snapping()?(l.resetItemsPos(),l.gridList.resizeItem(o,n)):(o.w=n.w,o.h=n.h),t.gridColSpan()===o.w&&t.gridRowSpan()===o.h||(l.items.forEach(l.gridItemToCell),l.updateGrid(o.id,100))),l.dragItem.style("width",function(){return(1-o.x)*l.cellWidth+i.x-l.gutter()+"px"}).style("height",function(){return(1-o.y)*l.cellHeight+i.y-l.gutter()+"px"})}}).on("end",function(){l.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),l.dragItem.remove(),l.dragItem=null,l.killGridList())})},i.prototype.updateGrid=function(t,e,i){void 0===e&&(e=0),e=e||0;var o=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*o.cellWidth+o.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*o.cellHeight+o.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*o.cellWidth-o.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*o.cellHeight-o.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(o.surfaceShadow()).surfacePadding_default(o.surfacePadding()).surfaceBorderWidth_default(o.surfaceBorderWidth()).surfaceBackgroundColor_default(o.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);var l=this.getDimensions(),r=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=r/l.width,this.cellHeight="all"===this.fitTo()?this.height()/l.height:this.cellWidth,this.designMode()){var n=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),s=Math.floor(n);this.cellWidth=s,this.cellHeight=this.cellWidth}var a=this,h=o.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=h.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,o){!a._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===o||a.gridList||(a.initGridList(),"none"!==a.snapping()&&a.gridList.resizeGrid("horizontal"===a.snapping()?a.snappingRows():a.snappingColumns()),a.items.forEach(a.gridItemToCell),a.updateGrid(t.id(),100),a.killGridList())}),e.select(this).append("div").attr("class","resizeHandle").call(a._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(h),this.divItems.each(function(t){var i=e.select(this);a.designMode()?i.call(a._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),h.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();var d=o.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);d.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){a.selectionBagClear()}).merge(d).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),d.exit().each(function(){a.selectionBagClear()}).remove();var p=o.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);p.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),p.style("display",this.showLanes()?null:"none").style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px").style("background-image","linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)").style("background-size",this.cellWidth+"px "+this.cellHeight+"px"),p.exit().remove()},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype._createSelectionObject=function(t){return{_id:t._id,element:function(){return t._element},widget:t}},i.prototype.selection=function(t){return arguments.length?(this._selectionBag.set(t.map(function(t){return this._createSelectionObject(t)},this)),this):this._selectionBag.get().map(function(t){return t._id})},i.prototype.selectionBagClear=function(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())},i.prototype.selectionBagClick=function(t){if(null!==t){var i=this._createSelectionObject(t);if(e.d3Event().sourceEvent.ctrlKey)this._selectionBag.isSelected(i)?(this._selectionBag.remove(i),this.postSelectionChange()):(this._selectionBag.append(i),this.postSelectionChange());else{var o=this._selectionBag.get();1===o.length&&o[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}},i.prototype.postSelectionChange=function(){},i.prototype.applyLayout=function(t){this.divItems.each(function(e,i){if(t[i]){var o=t[i],l=o[0],r=o[1],n=o[2],s=o[3];e.gridCol(l).gridRow(r).gridColSpan(n).gridRowSpan(s)}}),this.updateGrid(!0)},i.prototype.vizActivation=function(t){},i}(e.HTMLWidget);ot.prototype._class+=" layout_Grid",ot.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),ot.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:function(t){return!t.designMode()}}),ot.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),ot.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),ot.prototype.publish("snappingColumns",12,"number","Snapping Columns"),ot.prototype.publish("snappingRows",16,"number","Snapping Rows"),ot.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),ot.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),ot.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),ot.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),ot.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),ot.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});var lt=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("horizontal"),e.flexWrap_default("nowrap"),e}return r(e,t),e}($);lt.prototype._class+=" layout_HorizontalList";d(".layout_Layered{pointer-events:none}.layout_Layered>.container>.content{position:absolute}.layout_Layered>.container>.content>div>.common_Widget,.layout_Layered>.container>.content>div>svg>.common_Widget{pointer-events:all}");var rt=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._widgetPlacements=[],e._widgetRatios=[],e}return r(i,t),i.prototype.addLayer=function(t,i,o,l){void 0===i&&(i="default"),void 0===o&&(o=1),void 0===l&&(l=1);var r=this.widgets();return r.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(r),this._widgetPlacements.push(i),this._widgetRatios.push([o,l]),this},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._contentContainer=i.append("div").attr("class","container")},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;i.style("padding",this.surfacePadding()+"px");var l=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});l.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(l).each(function(t,e){var i={width:o.clientWidth(),height:o.clientHeight()},l=o.widgetSize(e,i),r=o.widgetPosition(e,i,l);console.log("widgetPosition",r),this.style.top=r.y+"px",this.style.left=r.x+"px",t.resize(l).render()}),l.exit().each(function(t,e){t.target(null)}).remove(),l.order()},i.prototype.widgetSize=function(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}},i.prototype.widgetPosition=function(t,e,i){switch(this._widgetPlacements[t]){default:return{x:0,y:0};case"top":return{x:e.width/2-i.width/2,y:0};case"bottom":return{x:e.width/2-i.width/2,y:e.height-i.height};case"left":return{x:0,y:e.height/2-i.height/2};case"right":return{x:e.width-i.width,y:e.height/2-i.height/2};case"center":return{x:e.width/2-i.width/2,y:e.height/2-i.height/2}}},i}(e.HTMLWidget);rt.prototype._class+=" layout_Layered",rt.prototype.publish("surfacePadding",0,"number","Padding"),rt.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});var nt=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return r(e,t),e.prototype.updateState=function(t){t=t||!this.popupState(),this.popupState(t).render()},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this.widget().target(e),this._originalPosition=this.position()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("visibility",this.popupState()?null:"hidden").style("opacity",this.popupState()?null:0).style("width",this.shrinkWrap()?this.widget().width()+"px":this._size.width+"px").style("height",this.shrinkWrap()?this.widget().height()+"px":this._size.height+"px"),0===this.widget().size().height&&this.widget().resize(this.size())},e.prototype.postUpdate=function(e,i){var o,l;switch(this.centerPopup()){case"container":this._placeholderElement&&(o=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,l=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":o=window.innerWidth/2-this.widget().width()/2,l=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:o=0,l=0,this.position(this._originalPosition)}this.pos({x:o,y:l}),t.prototype.postUpdate.call(this,e,i),i.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e.prototype.click=function(t){console.log("Clicked: "+t.id)},e}(e.HTMLWidget);nt.prototype._class+=" layout_Popup",nt.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),nt.prototype.publish("shrinkWrap",!1,"boolean","The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)",null,{}),nt.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),nt.prototype.publish("top",null,"number","Top position property of popup",null,{}),nt.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),nt.prototype.publish("left",null,"number","Left position property of popup",null,{}),nt.prototype.publish("right",null,"number","Right position property of popup",null,{}),nt.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),nt.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});d(".layout_Tabbed .tab-button{position:relative;top:1px;display:inline-block;border-left:1px solid #ddd;border-top:1px solid #ddd;border-right:1px solid #ddd;background-color:transparent;margin-right:4px;padding:2px 2px 4px;background-color:#ccc}.layout_Tabbed .tab-button.active{background-color:#fff;z-index:999}.layout_Tabbed .on_bottom .tab-button{border-bottom:1px solid #ddd;border-top:none;top:-1px}");var st=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e}return r(i,t),i.prototype.clearTabs=function(){return this.labels([]),this.widgets([]),this},i.prototype.addTab=function(t,i,o,l){var r=t.size();0===r.width&&0===r.height&&t.size({width:"100%",height:"100%"});var n=this.labels(),s=this.widgets();o&&this.activeTabIdx(this.widgets().length),n.push(i);var a=(new u).widget(t||(new e.Text).text("No widget defined for tab"));return s.push(a),this.labels(n),this.widgets(s),l&&l(a),this},i.prototype.widgetSize=function(t){var e=this.clientWidth(),i=this.clientHeight(),o=this._tabContainer.node().getBoundingClientRect();return void 0!==o.height&&(i-=o.height),{width:e,height:i}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._tabContainer=i.append("div"),this._contentContainer=i.append("div")},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var l=this;o.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);var r=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});r.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){l.click(l.widgets()[e].widget(),t,e),l.activeTabIdx(e).render()}).merge(r).classed("active",function(t,e){return l.activeTabIdx()===e}).text(function(t){return t}),r.exit().remove();var n=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});switch(n.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(n).classed("active",function(t,e){return l.activeTabIdx()===e}).style("display",function(t,e){return l.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(l.activeTabIdx()===i),l.activeTabIdx()===i){var o=l.widgetSize(e.select(this));t.surfaceBorderWidth(l.showTabs()?null:0).surfacePadding(l.showTabs()?null:0).resize(o)}}),n.exit().each(function(t,e){t.target(null)}).remove(),this.tabLocation()){case"bottom":this._tabContainer.attr("class","on_bottom").style("top",this._contentContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute"),this._contentContainer.style("top",this.surfacePadding_exists()?this.surfacePadding()+"px":null).style("position","absolute");break;default:this._tabContainer.attr("class","on_top").style("top",null).style("position","relative"),this._contentContainer.style("top",this._tabContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute")}},i.prototype.click=function(t,e,i){},i}(e.HTMLWidget);st.prototype._class+=" layout_Tabbed",st.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),st.prototype.publish("surfacePadding",4,"number","Padding"),st.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),st.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),st.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),st.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});function at(){e.HTMLWidget.call(this),this._tag="div"}d(".layout_Toolbar{height:100%;background-color:#ddd;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-title{display:inline-block;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);margin-left:4px;font-weight:700;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-child{position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);float:right;margin-left:4px;margin-right:4px;line-height:16px}"),at.prototype=Object.create(e.HTMLWidget.prototype),at.prototype.constructor=at,at.prototype._class+=" layout_Toolbar",at.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),at.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),at.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),at.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),at.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),at.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]}),at.prototype.enter=function(t,i){e.HTMLWidget.prototype.enter.apply(this,arguments)},at.prototype.update=function(t,i){e.HTMLWidget.prototype.update.apply(this,arguments);var o=this;i.attr("title",o.title()).style("background-color",this.backgroundColor());var l=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);l.enter().append("div").classed("toolbar-title",!0).append("span"),l.selectAll("div.toolbar-title > span").style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("color",this.fontColor_exists()?this.fontColor():null).style("font-family",this.fontFamily_exists()?this.fontFamily():null).style("font-weight",this.fontBold_exists()?this.fontBold()?"bold":"normal":null).style("background-color",this.backgroundColor_exists()?this.backgroundColor():null).text(o.title()),l.exit().remove();var r=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});r.enter().insert("div","div.toolbar-title").each(function(t,i){var l=o.widgetClasses()[i]?o.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(l,!0),t.target(this)}),r.exit().each(function(t){t.target(null)}).remove(),r.order()},at.prototype.render=function(t){var i=this;e.HTMLWidget.prototype.render.call(this,function(e){var o=i.element().node().getBoundingClientRect(),l=o.left+o.width;i.element().selectAll("div.toolbar-child").each(function(t,e){var i=this.getBoundingClientRect();l>i.left&&(l=i.left)}),i.element().select(".toolbar-title").style("width",l-o.left-4+"px"),t&&t(e)})},at.prototype.exit=function(t,i){e.HTMLWidget.prototype.exit.apply(this,arguments),this.widgets().forEach(function(t){t.target(null)})};var ht=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("vertical"),e.flexWrap_default("nowrap"),e}return r(e,t),e}($);ht.prototype._class+=" layout_VerticalList",t.AbsoluteSurface=p,t.Accordion=c,t.BUILD_VERSION="2.101.0",t.Border=f,t.Border2=b,t.Carousel=_,t.Cell=g,t.ChartPanel=Q,t.FlexGrid=$,t.Grid=ot,t.HorizontalList=lt,t.Layered=rt,t.Legend=J,t.Modal=Z,t.PKG_NAME="@hpcc-js/layout",t.PKG_VERSION="2.46.0",t.Popup=nt,t.Surface=u,t.Tabbed=st,t.Toolbar=at,t.VerticalList=ht,t.WidgetDiv=y,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|