@hpcc-js/layout 3.4.1 → 3.4.2

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.
@@ -1,3 +1,3 @@
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="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/layout"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/api"])}(this,function(t,e,i,s){"use strict";var o=Object.defineProperty,l=(t,e)=>o(t,"name",{value:e,configurable:!0});function n(t,e){for(var i=0;i<e.length;i++){const s=e[i];if("string"!=typeof s&&!Array.isArray(s))for(const e in s)if("default"!==e&&!(e in t)){const i=Object.getOwnPropertyDescriptor(s,e);i&&Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:l(()=>s[e],"get")})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}l(n,"_mergeNamespaces");const r=class _AbsoluteSurface extends e.HTMLWidget{constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e);let i=0,s=0,o=this.clientWidth(),l=this.clientHeight();switch(this.units()){case"pixels":i=this.widgetX(),s=this.widgetY(),o=""===this.widgetWidth()?o-i:Number(this.widgetWidth()),l=""===this.widgetHeight()?l-s:Number(this.widgetHeight());break;case"percent":i=this.widgetX()*o/100,s=this.widgetY()*l/100,o=""===this.widgetWidth()?o-i:Number(this.widgetWidth())*o/100,l=""===this.widgetHeight()?l-s:Number(this.widgetHeight())*l/100}e.style("opacity",this.opacity());const n=e.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});n.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(n).style("left",i+"px").style("top",s+"px").style("width",o+"px").style("bottom",l+"px").each(function(t){t.resize({width:o,height:l})}),n.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}};l(r,"AbsoluteSurface");let h=r;h.prototype._class+=" layout_AbsoluteSurface",h.prototype.publish("units","percent","set","Units",["pixels","percent"]),h.prototype.publish("widgetX",0,"number","Widget XPos"),h.prototype.publish("widgetY",0,"number","Widget YPos"),h.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),h.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),h.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),h.prototype.publish("opacity",1,"number","Opacity");const a=class _Accordion extends e.HTMLWidget{_isClosed;titleSpan;iconDiv;ul;icon;constructor(){super(),this._tag="div",this._isClosed=!1}pushListItem(t,e=!1,i=!1){const s=this.content();return t._protected=i,e?s.unshift(t):s.push(t),this.content(s),this}clearListItems(){const t=[];for(const e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this}collapseClick(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))}enter(t,i){super.enter(t,i);const s=this;this._isClosed=this.defaultCollapsed(),i.classed(this._isClosed?"closed":"open",!0),this.titleSpan=i.append("span").classed("collapsible-title",!0),this.iconDiv=i.append("div").classed("collapsible-icon",!0),this.ul=i.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){s.collapseClick(i),s.render()}),this.titleSpan.on("click",function(){s.collapseClick(i),s.render()})}update(t,e){super.update(t,e);const i=this;this.titleSpan.text(i.title().length>0?i.title()+"":"Accordion ["+i._id+"]");const s=this.ul.selectAll("#"+i._id+" > ul > li").data(this.content(),function(t){return t._id});s.enter().append(function(t){const e=document.createElement("li");if(null!==t._target)return t._target;{const s=t.size();if(0===s.width||0===s.height){const e=i.size();t.size({width:e.width,height:e.width})}t.target(e)}return e}),s.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()}exit(t,e){super.exit(t,e)}};l(a,"Accordion");let d=a;d.prototype._class+=" layout_Accordion",d.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),d.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),d.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),d.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),d.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),d.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),d.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});const p=class _Surface extends e.HTMLWidget{_surfaceButtons;constructor(){super(),this._tag="div",this._surfaceButtons=[]}widgetSize(t,e){let i=this.clientWidth(),s=this.clientHeight();return this.title()&&(s-=this.calcHeight(t)),s-=this.calcFrameHeight(e),i-=this.calcFrameWidth(e),{width:i,height:s}}enter(t,e){super.enter(t,e)}update(t,i){super.update(t,i);const s=this;i.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());const o=i.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);o.enter().insert("h3","div").attr("class","surfaceTitle").merge(o).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),o.exit().remove();const l=i.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());l.enter().append("button").classed("surface-button",!0).each(function(t,i){const o=s._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){s.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):o.text(function(){return t.label}).on("click",function(t){s.click(t)})}),l.exit().each(function(t,i){const o=e.select(this);delete s._surfaceButtons[i],o.remove()});const n=i.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});n.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(s.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(n).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){const o=s.widgetSize(i.select("h3"),e.select(this));o.width<0&&(o.width=0),o.height<0&&(o.height=0),t.resize({width:o.width,height:o.height})}),n.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}click(t){}};l(p,"Surface");let c=p;c.prototype._class+=" layout_Surface",c.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),c.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),c.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),c.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),c.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),c.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),c.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),c.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),c.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),c.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});const u=class _Cell extends c{_indicateTheseIds;constructor(){super(),this._indicateTheseIds=[]}indicateTheseIds(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds}enter(t,e){super.enter(t,e);const i=this;e.classed("layout_Surface",!0).on("mouseenter",function(){i.onMouseEnter()}).on("mouseleave",function(){i.onMouseLeave()})}update(t,e){super.update(t,e)}onMouseEnter(){const t=this.indicateTheseIds(),i=this.indicatorOpacity(),s=this.indicatorBorderColor(),o=this.indicatorGlowColor();for(let l=0;l<t.length;l++){const n=e.select("#"+t[l]),r=n.datum();n&&r&&n.append("div").attr("class","update-indicator").style("width",r.width()+"px").style("height",r.height()+"px").style("opacity",i).style("border-color",s).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+o).style("-moz-box-shadow","inset 0px 0px 30px 0px "+o).style("box-shadow","inset 0px 0px 30px 0px "+o)}}onMouseLeave(){const t=this.indicateTheseIds();for(let i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()}};l(u,"Cell");let g=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"]});const f=class _Border extends e.HTMLWidget{_colCount;_rowCount;_colSize;_rowSize;_shrinkWrapBoxes;_watch;_offsetX;_offsetY;_dragCell;_dragCellSize;_dragCellStartSize;_handleTop;_handleLeft;_dragPrevX;_dragPrevY;_cellSizes;contentDiv;_scrollBarWidth;_borderHandles;_sectionTypeArr;constructor(){super(),this._tag="div",this._colCount=0,this._rowCount=0,this._colSize=0,this._rowSize=0,this._shrinkWrapBoxes={},this.content([]),this.sectionTypes([])}watchWidget(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){const e=this;this._watch[t.id()]=t.monitor(function(t,i,s){s!==i&&e.lazyPostUpdate()})}}lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100);applyLayoutType(){const 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)}cellSpecificDragHandles(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}}borderLayoutObject(t){const e={},i=this;let s,o,l,n,r,h,a,d;const p=this.target().getBoundingClientRect();p.top,p.left,p.bottom,p.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute("width")),parseFloat(this.target().getAttribute("height"))):(p.width,p.height),-1!==this.sectionTypes().indexOf("top")&&(s=this.topSize(),o=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(s=this._shrinkWrapBoxes.top.height+this.gutter(),o=0)),-1!==this.sectionTypes().indexOf("bottom")&&(l=this.bottomSize(),n=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(l=this._shrinkWrapBoxes.bottom.height+this.gutter(),n=0)),-1!==this.sectionTypes().indexOf("left")&&(r=this.leftSize(),h=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(r=this._shrinkWrapBoxes.left.width+this.gutter(),h=0)),-1!==this.sectionTypes().indexOf("right")&&(a=this.rightSize(),d=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(a=this._shrinkWrapBoxes.right.width+this.gutter(),d=0));const c=y({width:{px:0,"%":100},height:{px:s,"%":o},top:{px:0,"%":0},left:{px:0,"%":0}}),u=y({width:{px:0,"%":100},height:{px:l,"%":n},top:{px:0,"%":100},left:{px:0,"%":0}});u.top-=u.height;const g=y({width:{px:r,"%":h},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":0}}),f=y({width:{px:a,"%":d},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":100}});f.left-=f.width;const _=y({width:{px:-f.width-g.width,"%":100},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:g.width,"%":0}});return e.top=c,e.bottom=u,e.right=f,e.left=g,e.center=_,e;function y(t){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;return{width:t.width.px+t.width["%"]/100*i.width(),height:t.height.px+t.height["%"]/100*i.height(),top:t.top.px+t.top["%"]/100*i.height()+i.gutter()/2,left:t.left.px+t.left["%"]/100*i.width()+i.gutter()/2}}}clearContent(t){if(t){const 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([])}hasContent(t,e,i){return this.sectionTypes().indexOf(t)>=0}setContent(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){const s=(new g).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(s),this.sectionTypes().push(t)}return this}getCell(t){const e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null}getContent(t){const e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null}setLayoutOffsets(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2}dragStart(t){const i=e.d3Event();i.sourceEvent.stopPropagation();const s=this;this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));const o=e.select("#"+s.id()+" > div.borderHandle_"+t);s._handleTop=parseFloat(o.style("top").split("px")[0]),s._handleLeft=parseFloat(o.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}dragTick(t){const i=this,s=e.d3Event(),o=this._dragPrevX-s.sourceEvent.clientX,n=this._dragPrevY-s.sourceEvent.clientY;switch(t){case"top":case"bottom":r(t,n);break;case"right":case"left":r(t,o)}function r(t,s){if(0===s)return;const o=e.selectAll("#"+i.id()+" > div.borderHandle"),l=e.select("#"+i.id()+" > div.borderHandle_"+t);l.classed("borderHandle_top")?(l.style("top",i._handleTop-s+"px"),i._cellSizes.topHeight=i._handleTop-s,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_right")?(l.style("left",i._handleLeft-s+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+s):l.classed("borderHandle_bottom")?(l.style("top",i._handleTop-s+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+s,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_left")&&(l.style("left",i._handleLeft-s+"px"),i._cellSizes.leftWidth=i._handleLeft-s),o.each(function(){const 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"))})}l(r,"_moveHandles")}dragEnd(t){if(t){const i=e.d3Event(),s=this._dragPrevX-i.sourceEvent.clientX,o=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==o&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-o:this.topSize()-o));break;case"right":0!==s&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+s:this.rightSize()+s));break;case"bottom":0!==o&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+o:this.bottomSize()+o));break;case"left":0!==s&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-s:this.leftSize()-s))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()}size(t){const 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}enter(t,i){super.enter(t,i);const s=this;i.style("position","relative"),this.contentDiv=i.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"];i.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===s.getContent(t))})}update(t,i){super.update(t,i),this._sectionTypeArr=this.sectionTypes();const s=this;i.classed("design-mode",this.designMode()),this.setLayoutOffsets();const o=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),l=o.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+s._sectionTypeArr[i],!0),t.target(this),e.select("#"+s.id()+" > div.borderHandle_"+s._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(o);l.each(function(t,e){const i=s.sectionTypes()[e];void 0!==s[i+"ShrinkWrap"]&&s[i+"ShrinkWrap"]()?(t.render(),s._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete s._shrinkWrapBoxes[i]});const n=e.drag().on("start",function(t,e){s.dragStart.call(s,t,e)}).on("drag",function(t,e){s.dragTick.call(s,t,e)}).on("end",function(t,e){s.dragEnd.call(s,t,e)});this.designMode()?i.selectAll("#"+this.id()+" > div.borderHandle").call(n):i.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);const r=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=r[this.sectionTypes()[e]].left,t._fixedTop=r[this.sectionTypes()[e]].top,t._fixedWidth=r[this.sectionTypes()[e]].width,t._fixedHeight=r[this.sectionTypes()[e]].height,t._dragHandles=[]},this),l.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-s.gutter()+"px"}).style("height",function(t){return t._fixedHeight-s.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",s.designMode()).selectAll(".dragHandle").attr("draggable",s.designMode()),t.surfacePadding(s.surfacePadding()).resize()}),o.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),i.selectAll("#"+this.id()+" > div.borderHandle").each(function(){const t=e.select(this);t.classed("borderHandle_top")?(t.style("width",s._cellSizes.width+"px"),t.style("top",s._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",s._cellSizes.width-s._cellSizes.rightWidth+"px"),t.style("top",s._cellSizes.topHeight+3+"px"),t.style("height",s._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",s._cellSizes.width+"px"),t.style("top",s._cellSizes.height-s._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",s._cellSizes.leftWidth+"px"),t.style("height",s._cellSizes.leftHeight+"px"),t.style("top",s._cellSizes.topHeight+3+"px"))})}getCellSizes(){const t=this;t._cellSizes={};const 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(){const i=e.select(this);if("function"==typeof i.node){const e=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=e.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=e.width,t._cellSizes.leftHeight=e.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=e.width,t._cellSizes.rightHeight=e.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=e.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})}postUpdate(t,e){const i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){const e=t.widget().getBBox(!1,!0),s=t.widget().getBBox(!0,!0);e.width===s.width&&e.height===s.height||i.lazyRender()}})}exit(t,e){this.content().forEach(t=>t.target(null)),super.exit(t,e)}};l(f,"Border");let _=f;_.prototype._class+=" layout_Border",_.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),_.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),_.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),_.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),_.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),_.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),_.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),_.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),_.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});const y=class _WidgetDiv{_div;_overlay=!1;_overflowX="visible";_overflowY="visible";_widget;constructor(t){this._div=t}overlay(t){return arguments.length?(this._overlay=t,this):this._overlay}overflowX(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX}overflowY(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY}element(){return this._div}node(){return this._div.node()}widget(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}resize(t){return this._widget&&(this._div.style("width",`${t.width}px`).style("height",`${t.height}px`),this._widget.resize(t)),this}async render(t,i,s){let o=this.overflowX();this.overlay()||"visible"!==o||(o=null);let l=this.overflowY();return this.overlay()||"visible"!==l||(l=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",o).style("overflow-y",l),this._widget?this._widget.renderPromise().then(o=>{if(t&&this._widget.visible()){const t=this._widget.getBBox();return t.width+=8,void 0!==i&&t.height>i&&(t.width+=e.Platform.getScrollbarWidth()),void 0!==s&&t.width>s&&(t.height+=e.Platform.getScrollbarWidth()),this.overlay()?t.height=0:t.height+=4,t}return t?{x:0,y:0,width:0,height:0}:void 0}):Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)}};l(y,"WidgetDiv");let b=y;const w=class _Border2 extends e.HTMLWidget{_bodyElement;_topWA;_leftWA;_centerWA;_rightWA;_bottomWA;_topPrevOverflow;_leftPrevOverflow;_rightPrevOverflow;_bottomPrevOverflow;constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e);const i=e.append("header");this._bodyElement=e.append("div").attr("class","body");const s=this._bodyElement.append("div").attr("class","center"),o=this._bodyElement.append("div").attr("class","lhs"),l=this._bodyElement.append("div").attr("class","rhs"),n=e.append("div").attr("class","footer");this._topWA=new b(i),this._centerWA=new b(s),this._leftWA=new b(o),this._rightWA=new b(l),this._bottomWA=new b(n)}update(t,e){super.update(t,e),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`)}targetNull(t){t&&t.target(null)}exit(t,e){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),super.exit(t,e)}swap(t,e){const i=this[t](),s=this[e]();return this.targetNull(i),this.targetNull(s),this[`_${t}WA`].widget(null),this[`_${e}WA`].widget(null),this[t](s),this[e](i),this}render(t){return super.render(e=>{this._topWA?this._topWA.widget(this.top()).overlay(this.topOverlay()).render(!0).then(async e=>{const i=await this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width()),s=this.height()-(e.height+i.height),o=await this._leftWA.widget(this.left()).render(!0,s),l=await this._rightWA.widget(this.right()).render(!0,s);this.bottomHeight_exists()&&(i.height=this.bottomHeight());const n=this.width()-(o.width+l.width),r=this.height()-(e.height+i.height),h=this.centerOverflowX(),a=this.centerOverflowY(),d=-1!==["auto","scroll"].indexOf(h),p=-1!==["auto","scroll"].indexOf(a);(d||p)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:r}).render(),this._bodyElement.style("height",`${r}px`);const c=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:e.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:o.width,height:r}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:l.width,height:r}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:r}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()];Promise.all(c).then(e=>{t&&t(this)})}):t&&t(this)})}};l(w,"Border2");let m=w;m.prototype._class+=" layout_Border2",m.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),m.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),m.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),m.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),m.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),m.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),m.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),m.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),m.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),m.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),m.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});const v=class _Carousel extends e.HTMLWidget{_prevActive=0;_root;activeWidget(){return this.widgets()[this.active()]}enter(t,e){super.enter(t,e),this._root=e.append("div").attr("id",`${this.id()}_root`)}update(t,i){super.update(t,i);const s=this.active(),o=this.width();this._root.style("width",`${o}px`).style("height",`${this.height()}px`);const l=this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(),t=>t.id()),n=l.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(l).style("left",(t,e)=>(e-this._prevActive)*o+"px").style("width",`${o}px`);this._prevActive!==s&&(n.style("display",(t,e)=>e===this._prevActive||e===s?null:"none").transition().duration(this.transitionDuration()).style("left",(t,e)=>(e-s)*o+"px").on("end",function(t,i){e.select(this).style("display",()=>i===s?null:"none")}),this._prevActive=s),l.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widgets().forEach(t=>t.target(null)),super.exit(t,e)}render(t){return super.render(e=>{if(!this.visible()||this.isDOMHidden())t&&t(e);else{const i=this.activeWidget();i&&i.resize(this.size()).render(i=>{t&&t(e)})}})}};l(v,"Carousel");let x=v;x.prototype._class+=" layout_Carousel",x.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),x.prototype.publish("active",0,"number","Active widget"),x.prototype.publish("transitionDuration",500,"number","Transition duration");var S=Math.PI,C=2*S,T=1e-6,P=C-T;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function W(){return new z}function B(t){return l(function(){return t},"constant")}l(z,"Path"),l(W,"path"),z.prototype=W.prototype={constructor:z,moveTo:l(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:l(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:l(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:l(function(t,e,i,s){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+s)},"quadraticCurveTo"),bezierCurveTo:l(function(t,e,i,s,o,l){this._+="C"+ +t+","+ +e+","+ +i+","+ +s+","+(this._x1=+o)+","+(this._y1=+l)},"bezierCurveTo"),arcTo:l(function(t,e,i,s,o){t=+t,e=+e,i=+i,s=+s,o=+o;var l=this._x1,n=this._y1,r=i-t,h=s-e,a=l-t,d=n-e,p=a*a+d*d;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>T)if(Math.abs(d*r-h*a)>T&&o){var c=i-l,u=s-n,g=r*r+h*h,f=c*c+u*u,_=Math.sqrt(g),y=Math.sqrt(p),b=o*Math.tan((S-Math.acos((g+p-f)/(2*_*y)))/2),w=b/y,m=b/_;Math.abs(w-1)>T&&(this._+="L"+(t+w*a)+","+(e+w*d)),this._+="A"+o+","+o+",0,0,"+ +(d*c>a*u)+","+(this._x1=t+m*r)+","+(this._y1=e+m*h)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},"arcTo"),arc:l(function(t,e,i,s,o,l){t=+t,e=+e,l=!!l;var n=(i=+i)*Math.cos(s),r=i*Math.sin(s),h=t+n,a=e+r,d=1^l,p=l?s-o:o-s;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+h+","+a:(Math.abs(this._x1-h)>T||Math.abs(this._y1-a)>T)&&(this._+="L"+h+","+a),i&&(p<0&&(p=p%C+C),p>P?this._+="A"+i+","+i+",0,1,"+d+","+(t-n)+","+(e-r)+"A"+i+","+i+",0,1,"+d+","+(this._x1=h)+","+(this._y1=a):p>T&&(this._+="A"+i+","+i+",0,"+ +(p>=S)+","+d+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:l(function(t,e,i,s){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +s+"h"+-i+"Z"},"rect"),toString:l(function(){return this._},"toString")},l(B,"constant");var I=Math.PI,A=2*I;const H={draw:l(function(t,e){var i=Math.sqrt(e/I);t.moveTo(i,0),t.arc(0,0,i,0,A)},"draw")},M={draw:l(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()},"draw")};var F=Math.sqrt(1/3),k=2*F;const O={draw:l(function(t,e){var i=Math.sqrt(e/k),s=i*F;t.moveTo(0,-i),t.lineTo(s,0),t.lineTo(0,i),t.lineTo(-s,0),t.closePath()},"draw")};var L=Math.sin(I/10)/Math.sin(7*I/10),D=Math.sin(A/10)*L,R=-Math.cos(A/10)*L;const E={draw:l(function(t,e){var i=Math.sqrt(.8908130915292852*e),s=D*i,o=R*i;t.moveTo(0,-i),t.lineTo(s,o);for(var l=1;l<5;++l){var n=A*l/5,r=Math.cos(n),h=Math.sin(n);t.lineTo(h*i,-r*i),t.lineTo(r*s-h*o,h*s+r*o)}t.closePath()},"draw")},G={draw:l(function(t,e){var i=Math.sqrt(e),s=-i/2;t.rect(s,s,i,i)},"draw")};var X=Math.sqrt(3);const Y={draw:l(function(t,e){var i=-Math.sqrt(e/(3*X));t.moveTo(0,2*i),t.lineTo(-X*i,-i),t.lineTo(X*i,-i),t.closePath()},"draw")};var V=-.5,N=Math.sqrt(3)/2,j=1/Math.sqrt(12),$=3*(j/2+1);const U={draw:l(function(t,e){var i=Math.sqrt(e/$),s=i/2,o=i*j,l=s,n=i*j+i,r=-l,h=n;t.moveTo(s,o),t.lineTo(l,n),t.lineTo(r,h),t.lineTo(V*s-N*o,N*s+V*o),t.lineTo(V*l-N*n,N*l+V*n),t.lineTo(V*r-N*h,N*r+V*h),t.lineTo(V*s+N*o,V*o-N*s),t.lineTo(V*l+N*n,V*n-N*l),t.lineTo(V*r+N*h,V*h-N*r),t.closePath()},"draw")};function q(){var t=B(H),e=B(64),i=null;function s(){var s;if(i||(i=s=W()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),s)return i=null,s+""||null}return l(s,"symbol"),s.type=function(e){return arguments.length?(t="function"==typeof e?e:B(e),s):t},s.size=function(t){return arguments.length?(e="function"==typeof t?t:B(+t),s):e},s.context=function(t){return arguments.length?(i=null==t?null:t,s):i},s}l(q,"d3Symbol");var K="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=l(function(t){return t},"d3_identity"),Z=l(function(t){for(var e=[],i=0,s=t.length;i<s;i++)e[i]=t[s-i-1];return e},"d3_reverse"),Q=l(function(t,i){t.each(function(){var t,s=e.select(this),o=s.text().split(/\s+/).reverse(),l=[];s.attr("y");for(var n=parseFloat(s.attr("dy"))||0,r=s.text(null).append("tspan").attr("x",0).attr("dy",n+"em");t=o.pop();)l.push(t),r.text(l.join(" ")),r.node().getComputedTextLength()>i&&l.length>1&&(l.pop(),r.text(l.join(" ")),l=[t],r=s.append("tspan").attr("x",0).attr("dy",1.2+n+"em").text(t))})},"d3_textWrapping"),tt=l(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],s=arguments[3],o=arguments[4];if("object"===(void 0===e?"undefined":K(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 n=[],r=t.length,h=0;h<r;h++)n.push(e({i:h,genLength:r,generatedLabels:t,domain:i,range:s,labelDelimiter:o}));return n}return t},"d3_mergeLabels"),et=l(function(t,e,i){var s=[];if(e.length>1)s=e;else for(var o=t.domain(),n=(o[o.length-1]-o[0])/(e-1),r=0;r<e;r++)s.push(o[0]+r*n);var h=s.map(i);return{data:s,labels:h,feature:l(function(e){return t(e)},"feature")}},"d3_linearLegend"),it=l(function(t,e,i){var s=t.range().map(function(s){var o=t.invertExtent(s);return e(o[0])+" "+i+" "+e(o[1])});return{data:t.range(),labels:s,feature:J}},"d3_quantLegend"),st=l(function(t){return{data:t.domain(),labels:t.domain(),feature:l(function(e){return t(e)},"feature")}},"d3_ordinalLegend"),ot=l(function(t,e,i){t.call("cellover",i,e)},"d3_cellOver"),lt=l(function(t,e,i){t.call("cellout",i,e)},"d3_cellOut"),nt=l(function(t,e,i){t.call("cellclick",i,e)},"d3_cellClick"),rt={d3_drawShapes:l(function(t,e,i,s,o,l){"rect"===t?e.attr("height",i).attr("width",s):"circle"===t?e.attr("r",o):"line"===t?e.attr("x1",0).attr("x2",s).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",l)},"d3_drawShapes"),d3_addText:l(function(t,e,i,s,o){e.append("text").attr("class",s+"label");var l=t.selectAll("g."+s+"cell text."+s+"label").data(i).text(J);return o&&t.selectAll("g."+s+"cell text."+s+"label").call(Q,o),l},"d3_addText"),d3_calcType:l(function(t,e,i,s,o,l){var n=t.invertExtent?it(t,o,l):t.ticks?et(t,i,o):st(t),r=t.range&&t.range()||t.domain();return n.labels=tt(n.labels,s,t.domain(),r,l),e&&(n.labels=Z(n.labels),n.data=Z(n.data)),n},"d3_calcType"),d3_filterCells:l(function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),s=i.map(function(t){return t.data}),o=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==s.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==o.indexOf(t)}),t},"d3_filterCells"),d3_placement:l(function(t,e,i,s,o,l){e.attr("transform",i),s.attr("transform",o),"horizontal"===t&&s.style("text-anchor",l)},"d3_placement"),d3_addEvents:l(function(t,e){t.on("mouseover.legend",function(t){ot(e,t,this)}).on("mouseout.legend",function(t){lt(e,t,this)}).on("click.legend",function(t){nt(e,t,this)})},"d3_addEvents"),d3_title:l(function(t,e,i,s){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),s&&t.selectAll("text."+i+"legendTitle").call(Q,s);var o=t.select("."+i+"legendCells"),l=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],n=-o.nodes().map(function(t){return t.getBBox().x})[0];o.attr("transform","translate("+n+","+l+")")}},"d3_title"),d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};function ht(){var t=e.scaleLinear(),i="rect",s=15,o=15,n=10,r=2,h=[5],a=void 0,d=[],p="",c=!1,u="",g=rt.d3_defaultLocale,f=rt.d3_defaultFormatSpecifier,_=10,y="middle",b=rt.d3_defaultDelimiter,w=void 0,m="vertical",v=!1,x=void 0,S=void 0,C=e.dispatch("cellover","cellout","cellclick");function T(T){var P=rt.d3_calcType(t,v,h,d,g.format(f),b);T.selectAll("g").data([t]).enter().append("g").attr("class",p+"legendCells"),a&&rt.d3_filterCells(P,a);var z=T.select("."+p+"legendCells").selectAll("."+p+"cell").data(P.data),W=z.enter().append("g").attr("class",p+"cell");W.append(i).attr("class",p+"swatch");var B=T.selectAll("g."+p+"cell "+i+"."+p+"swatch").data(P.data);rt.d3_addEvents(W,C),z.exit().transition().style("opacity",0).remove(),B.exit().transition().style("opacity",0).remove(),B=B.merge(B),rt.d3_drawShapes(i,B,o,s,n,x);var I=rt.d3_addText(T,W,P.labels,p,w);z=W.merge(z);var A=I.nodes().map(function(t){return t.getBBox()}),H=B.nodes().map(function(t){return t.getBBox()});c?B.attr("class",function(t){return p+"swatch "+P.feature(t)}):"line"==i?B.style("stroke",P.feature):B.style("fill",P.feature);var M,F=void 0,k=void 0,O="start"==y?0:"middle"==y?.5:1;"vertical"===m?(M=A.map(function(t,e){return Math.max(t.height,H[e].height)}),F=l(function(t,i){return"translate(0, "+(e.sum(M.slice(0,i))+i*r)+")"},"cellTrans"),k=l(function(t,e){return"translate( "+(H[e].width+H[e].x+_)+", "+(H[e].y+H[e].height/2+5)+")"},"textTrans")):"horizontal"===m&&(F=l(function(t,e){return"translate("+e*(H[e].width+r)+",0)"},"cellTrans"),k=l(function(t,e){return"translate("+(H[e].width*O+H[e].x)+",\n "+(H[e].height+H[e].y+_+8)+")"},"textTrans")),rt.d3_placement(m,z,F,I,k,y),rt.d3_title(T,u,p,S),z.transition().style("opacity",1)}return l(T,"legend"),T.scale=function(e){return arguments.length?(t=e,T):t},T.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(h=t),T):h},T.cellFilter=function(t){return arguments.length?(a=t,T):a},T.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,x=e),T):i},T.shapeWidth=function(t){return arguments.length?(s=+t,T):s},T.shapeHeight=function(t){return arguments.length?(o=+t,T):o},T.shapeRadius=function(t){return arguments.length?(n=+t,T):n},T.shapePadding=function(t){return arguments.length?(r=+t,T):r},T.labels=function(t){return arguments.length?(d=t,T):d},T.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),T):y},T.locale=function(t){return arguments.length?(g=e.formatLocale(t),T):g},T.labelFormat=function(t){return arguments.length?(f=e.formatSpecifier(t),T):T.locale().format(f)},T.labelOffset=function(t){return arguments.length?(_=+t,T):_},T.labelDelimiter=function(t){return arguments.length?(b=t,T):b},T.labelWrap=function(t){return arguments.length?(w=t,T):w},T.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(c=t),T):c},T.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(m=t),T):m},T.ascending=function(t){return arguments.length?(v=!!t,T):v},T.classPrefix=function(t){return arguments.length?(p=t,T):p},T.title=function(t){return arguments.length?(u=t,T):u},T.titleWidth=function(t){return arguments.length?(S=t,T):S},T.textWrap=function(t){return arguments.length?(textWrap=t,T):textWrap},T.on=function(){var t=C.on.apply(C,arguments);return t===C?T:t},T}l(ht,"color");const at=class _Legend extends e.SVGWidget{_owner;_targetWidget;_targetWidgetMonitor;_legendOrdinal;_disabled=[];_symbolTypeMap={circle:H,cross:M,diamond:O,square:G,star:E,triangle:Y,wye:U};constructor(t){super(),this._owner=t,this._drawStartPos="origin";const e=this;this._legendOrdinal=ht().shape("path",q().type(H).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){e.onClick(t,this)}).on("cellover",t=>{e.onOver(t,this)}).on("cellout",t=>{e.onOut(t,this)})}isDisabled(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)}filteredFields(){switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(t=>!this.isDisabled(t))}return this.fields()}filteredColumns(){switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(t=>!this.isDisabled(t))}return this.columns()}filteredData(){switch(this.dataFamily()){case"2D":return this.data().filter(t=>!this.isDisabled(t[0]));case"ND":const t={};let e=!1;return this.columns().forEach((i,s)=>{const o=this.isDisabled(i);t[s]=o,o&&(e=!0)}),e?this.data().map(e=>e.filter((e,i)=>!t[i])):this.data()}return this.data()}isRainbow(){const t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()}targetWidget(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){const t=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(e,i,s,o){switch(e){case"chart":case"columns":case"data":case"paletteID":t.lazyRender()}})}return this}getWidget(){return this._targetWidget&&"composite_MultiChart"===this._targetWidget.classID()?this._targetWidget.chart():this._targetWidget}getPalette(){const 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")}getPaletteType(){return this.getPalette().type()}fillColorFunc(){const t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),(e,i,s)=>t.fillColor(e,i,s);const i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return(t,e,s)=>i(e)}fillColor(t,e,i){return this.fillColorFunc()(t,e,i)}_g;enter(t,e){super.enter(t,e),this._g=e.append("g").attr("class","legendOrdinal")}calcMetaData(){let t=[],i=0,s=0;const o=this.columns().length;if(this._targetWidget){const l=this.columns();switch(this.getPaletteType()){case"ordinal":const n=this.fillColorFunc();let r=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){r=this.data()[e].slice(1,o).reduce((t,e)=>t+e,0);const l=this.isDisabled(t[0]);l||(i+=r);const h=t[0]+(!l&&this.showSeriesTotal()?` (${r})`:""),a=this.textSize(h);return s<a.width&&(s=a.width),[n(t,t[0],!1),t[0],h]},this);break;case"ND":t=this.columns().filter(t=>0!==t.indexOf("__")).filter(function(t,e){return e>0}).map(function(t,e){r=this.data().reduce((t,i)=>t+i[e+1],0);const o=this.isDisabled(l[e+1]),h=t+(!o&&this.showSeriesTotal()?` (${r})`:"");o||(i+=r);const a=this.textSize(h);return s<a.width&&(s=a.width),[n(void 0,t,!1),t,h]},this);break;default:t=this.columns().map(function(t){return[n(void 0,t,!1),t]},this)}break;case"rainbow":const h=this.getPalette(),a=e.format(this.rainbowFormat()),d=this.getWidget(),p=this.rainbowBins(),c=d._dataMinWeight,u=d._dataMaxWeight,g=(u-c)/(p-1);t.push([h(c,c,u),a(c)]);for(let e=1;e<p-1;++e){let i=g*e;Math.floor(i)>parseInt(t[0][1])&&(i=Math.floor(i)),t.push([h(i,c,u),a(i)])}t.push([h(u,c,u),a(u)])}}return{dataArr:t,total:i,maxLabelWidth:s}}update(t,i){super.update(t,i);const{dataArr:s,maxLabelWidth:o,total:l}=this.calcMetaData(),n=this.shapeRadius(),r=this.radiusToSymbolSize(n);let h=this.itemPadding();"horizontal"===this.orientation()&&(h+=o-2*n);const a=e.scaleOrdinal().domain(s.map(t=>t[1])).range(s.map(t=>t[0]));this._legendOrdinal.shape("path",q().type(this._symbolTypeMap[this.symbolType()]).size(r)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(h).scale(a).labels(t=>s[t.i][2]),this._g.call(this._legendOrdinal),this.updateDisabled(i,s);const d=this._g.select(".legendCells").node().getBBox();let p=Math.abs(d.x),c=Math.abs(d.y)+1;if("horizontal"===this.orientation()){if("start"===this.labelAlign()?p+=1:"end"===this.labelAlign()&&(p-=1),this.width()>d.width){p+=(this.width()-d.width)/2}}else if("vertical"===this.orientation()&&(p+=1,this._containerSize.height>d.height)){c+=(this.height()-d.height)/2}this._g.attr("transform",`translate(${p}, ${c})`),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());const u=this._g.selectAll(".legendTotal").data(s.length&&this.showLegendTotal()?[l]:[]),g=`Total: ${l}`,f=-p,_=d.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),u.enter().append("text").classed("legendTotal",!0).merge(u).attr("transform",`translate(${f}, ${_})`).text(g),u.exit().remove()}updateDisabled(t,e){t.style("cursor","pointer").selectAll("path.swatch").filter((t,i)=>i<e.length).style("stroke",(t,i)=>e[i][0]).style("fill",(t,i)=>this._disabled.indexOf(t)<0?e[i][0]:"white")}postUpdate(t,e){let i;this._boundingBox&&(i=this._boundingBox.width,this._boundingBox.width=this._size.width),super.postUpdate(t,e),void 0!==i&&(this._boundingBox.width=i),this._parentRelativeDiv.style("overflow","hidden")}exit(t,e){super.exit(t,e)}radiusToSymbolSize(t){const 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}}onClick(t,e){if("ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":const e=this._disabled.indexOf(t);e<0?this._disabled.push(t):this._disabled.splice(e,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}}onOver(t,e){if(s.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}}onOut(t,e){if(s.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}}onDblClick(t,e){}onMouseOver(t,e){}_containerSize;resize(t){let e;if(this.fitToContent()){this._containerSize=t;const i=this.getBBox();t.width>i.width&&(i.width=t.width),t.height>i.height&&(i.height=t.height),e=super.resize.apply(this,[{...i}])}else e=super.resize.apply(this,arguments);return e}};l(at,"Legend");let dt=at;dt.prototype._class+=" layout_Legend",dt.prototype.publish("title","","string","Title"),dt.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),dt.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),dt.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),dt.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),dt.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:l(t=>!t.isRainbow(),"disable")}),dt.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:l(t=>!t.isRainbow(),"disable")}),dt.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),dt.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),dt.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),dt.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),dt.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),dt.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:l(t=>"vertical"===t.orientation(),"disable")});const pt=class _Modal extends e.HTMLWidget{_widget;_relativeTarget;_fade;_modal;_modalHeader;_modalBody;_modalHeaderAnnotations;_modalHeaderCloseButton;_close;constructor(){super(),this._tag="div"}closeModal(){this.visible(!1)}getRelativeTarget(){let t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()),t)?t:!t&&(t=this.locateAncestor("layout_Grid"),t&&t.element)?t.element().node():document.body}setModalSize(){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());const 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}setFadePosition(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")}setModalPosition(t){const 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()){const e=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px")}}resize(t){return super.resize(),this._modal&&this.setModalSize(),this}resizeBodySync(t,e){const 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})}enter(t,e){super.enter(t,e),this._fade=e.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());const i=2*this.titleFontSize();this._modal=e.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",i+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height",`calc( 100% - ${i}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",()=>{this.closeModal()}),this._fade.on("click",t=>{this.enableClickFadeToClose()&&this.closeModal()})}update(t,e){super.update(t,e),e.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();const i=this._relativeTarget.getBoundingClientRect();this.setFadePosition(i),this.setModalPosition(i),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()}exit(t,e){this._widget&&this._widget.target(null),super.exit(t,e)}formattedTitle(){const t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()}};l(pt,"Modal");let ct=pt;ct.prototype._class+=" layout_Modal",ct.prototype.publish("title",null,"string","title"),ct.prototype.publish("widget",null,"widget","widget"),ct.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),ct.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),ct.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),ct.prototype.publish("show",!0,"boolean","show"),ct.prototype.publish("showFade",!0,"boolean","showFade"),ct.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),ct.prototype.publish("minWidth","400px","string","minWidth"),ct.prototype.publish("minHeight","400px","string","minHeight"),ct.prototype.publish("maxWidth","800px","string","maxWidth"),ct.prototype.publish("maxHeight","800px","string","maxHeight"),ct.prototype.publish("fixedWidth",null,"string","fixedWidth"),ct.prototype.publish("fixedHeight",null,"string","fixedHeight"),ct.prototype.publish("fixedTop",null,"string","fixedTop"),ct.prototype.publish("fixedLeft",null,"string","fixedLeft"),ct.prototype.publish("overflowX","hidden","string","overflowX"),ct.prototype.publish("overflowY","scroll","string","overflowY");const ut=class _ChartPanel extends m{_legend=new dt(this).enableOverflow(!0);_progressBar=new e.ProgressBar;_autoScale=!1;_resolutions={tiny:{width:100,height:100},small:{width:300,height:300}};_modal=new ct;_highlight;_scale;_orig_size;_toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",()=>""!==this.description()).on("click",()=>{if(this._toggleInfo.selected()){this._modal.title(this.title()).widget((new e.Text).text(this.description())).show(!0).render();const t=this._modal._close;this._modal._close=()=>{this._toggleInfo.selected(!1).render(),this._modal._close=t}}}).on("mouseMove",()=>{}).on("mouseOut",()=>{});_toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",()=>{this.dataVisible(this._toggleData.selected()),this.render()});_buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",()=>{this.downloadCSV()});_buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",()=>{this.downloadPNG()});_toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",()=>{const t=this._toggleLegend.selected();"bottom"===this.legendPosition()?this.showBottom(t):"right"===this.legendPosition()&&this.showRight(t),this.legendVisible(t),this.render()});_spacer=new e.Spacer;_titleBar=(new e.TitleBar).buttons([this._toggleData,this._buttonDownload,this._buttonDownloadImage,this._spacer,this._toggleLegend]);_carousel=new x;_table=new i.Table;_widget;_hideLegendToggleList=["dgrid_Table"];constructor(){super(),this._tag="div"}fields(t){return arguments.length?(super.fields(t),this._legend.fields(t),this.refreshFields(),this):super.fields()}refreshFields(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this}columns(t,e){return arguments.length?(super.columns(t,e),this._legend.columns(t,e),this.refreshColumns(),this):super.columns()}refreshColumns(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this}data(t){return arguments.length?(super.data(t),this._legend.data(t),this.refreshData(),this):super.data()}refreshData(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this}highlight(t){return arguments.length?(this._highlight=t,this):this._highlight}startProgress(){this._progressBar.start()}finishProgress(){this._progressBar.finish()}buttons(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()}downloadCSV(){const 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}downloadPNG(){const t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this}highlightColumn(t){if(t){const i=`series-${this.cssTag(t)}`;this._centerWA.element().selectAll(".series").each(function(){const t=e.select(this),s=t.classed(i);t.classed("highlight",s).classed("lowlight",!s)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this}getResponsiveMode(){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"}setOrigSize(){this._orig_size=JSON.parse(JSON.stringify(this.size()))}enter(t,e){super.enter(t,e),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(t,e),this.setOrigSize()}preUpdateTiny(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")}preUpdateSmall(t){const e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);const s=this._scale===e;this.size({width:s?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:s?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})`)}preUpdateRegular(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)")}_prevdataVisible;_prevlegendVisible;_prevLegendPosition;_prevChartDataFamily;_prevChart;_prevButtons;update(t,e){super.update(t,e)}preUpdate(t,i){switch(super.preUpdate(t,i),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._legend.visible(this._prevlegendVisible&&!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._prevdataVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(i);break;case"small":this.preUpdateSmall(i);break;case"regular":this.preUpdateRegular(i)}const s="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(s._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily()&&(this._prevChartDataFamily=this._legend.dataFamily(),"any"===this._prevChartDataFamily))this._toggleLegend.selected(!1),this._legend.visible(!1);if(i.style("box-shadow",this.highlight()?`inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}`:"none"),-1!==this._hideLegendToggleList.indexOf(s.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==s){this._prevChart=s;const t=s?s._titleBar||s._iconBar:void 0;if(t&&t instanceof e.IconBar){this._prevButtons=this._prevButtons||[...this.buttons()];const i=[...t.buttons(),new e.Spacer,...this._prevButtons];t.buttons([]).render(),this.buttons(i)}else this._prevButtons&&this.buttons(this._prevButtons)}const o=[];this.dataButtonVisible()||o.push(this._toggleData),this.downloadButtonVisible()||o.push(this._buttonDownload),this.downloadImageButtonVisible()||o.push(this._buttonDownloadImage),this.legendButtonVisible()||o.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(o).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())}postUpdate(t,e){switch(super.postUpdate(t,e),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(e);break;case"small":this.postUpdateSmall(e);break;case"regular":this.postUpdateRegular(e)}}postUpdateTiny(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)");const e=t.selectAll("div.title-icon"),i=e.node(),s=t.node().parentElement.getBoundingClientRect();if(i){const i=e.node().getBoundingClientRect(),o=s.height/2;e.style("position","absolute").style("left",`calc(50% - ${i.width/2}px)`).style("top",o-i.height/2+"px"),t.selectAll("div.data-count").style("position","absolute").style("left",`calc(50% + ${i.width/2}px)`).style("top",o-i.height/2+"px")}}postUpdateSmall(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");const 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})`)}postUpdateRegular(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")}exit(t,e){this._progressBar.exit(t,e),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,super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}vertex_click(t,e,i,s){s&&s.vertex}vertex_dblclick(t,e,i,s){s&&s.vertex}edge_click(t,e,i,s){s&&s.edge}edge_dblclick(t,e,i,s){s&&s.edge}};l(ut,"ChartPanel");let gt=ut;gt.prototype._class+=" layout_ChartPanel",gt.prototype.publishReset(),gt.prototype.publishProxy("title","_titleBar"),gt.prototype.publish("titleVisible",!0,"boolean"),gt.prototype.publish("titleOverlay",!1,"boolean"),gt.prototype.publishProxy("titleIcon","_titleBar"),gt.prototype.publishProxy("titleIconFont","_titleBar"),gt.prototype.publishProxy("titleFont","_titleBar"),gt.prototype.publishProxy("titleIconFontSize","_titleBar"),gt.prototype.publishProxy("titleFontSize","_titleBar"),gt.prototype.publishProxy("description","_titleBar"),gt.prototype.publishProxy("descriptionFont","_titleBar"),gt.prototype.publishProxy("descriptionFontSize","_titleBar"),gt.prototype.publish("dataVisible",!1,"boolean","Show data table"),gt.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),gt.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),gt.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),gt.prototype.publish("downloadTitle","","string","File name when downloaded"),gt.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),gt.prototype.publish("legendVisible",!1,"boolean","Show legend"),gt.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),gt.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),gt.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),gt.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),gt.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),gt.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),gt.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),gt.prototype.publishProxy("legend_symbolType","_legend","symbolType"),gt.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),gt.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),gt.prototype.publish("enableAutoscaling",!1,"boolean"),gt.prototype.publish("highlightSize",4,"number"),gt.prototype.publish("highlightColor","#e67e22","html-color"),gt.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),gt.prototype.publishProxy("progress_decay","_progressBar","decay"),gt.prototype.publishProxy("progress_size","_progressBar","size"),gt.prototype.publishProxy("progress_color","_progressBar","color"),gt.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),gt.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),gt.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),gt.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),gt.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());const 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};const ft=class _FlexGrid extends e.HTMLWidget{constructor(){super()}enter(t,i){super.enter(t,i),e.select(t.parentNode).style("height","100%").style("width","100%")}update(t,e){super.update(t,e);const i=this,s=[];this.updateFlexParent(e);const o=e.selectAll(".FlexGrid-list-item").data(this.widgets(),t=>t.id());o.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(o).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",(t,e)=>{const i=this.widgetsFlexBasis()[e];return void 0!==i?i:this.flexBasis()}).style("flex-grow",(t,e)=>{const i=this.widgetsFlexGrow()[e];return void 0!==i?i:this.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){const t=this.getBoundingClientRect();s.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:s[e][0]-2*i.borderWidth(),height:s[e][1]-2*i.borderWidth()})}),o.exit().remove()}exit(t,e){super.exit(t,e)}updateFlexParent(t){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",()=>this.forceXScroll()||"horizontal"===this.orientation()&&"nowrap"===this.flexWrap()&&!this.disableScroll()?"scroll":"hidden").style("overflow-y",()=>this.forceYScroll()||"vertical"===this.orientation()&&"nowrap"===this.flexWrap()&&!this.disableScroll()?"scroll":"hidden")}};l(ft,"FlexGrid");let _t=ft;function yt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}_t.prototype._class+=" layout_FlexGrid",_t.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),_t.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),_t.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),_t.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),_t.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:l(t=>"nowrap"!==t.flexWrap(),"disable")}),_t.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),_t.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),_t.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),_t.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),_t.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),_t.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),_t.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),_t.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),_t.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),_t.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),_t.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items"),l(yt,"getDefaultExportFromCjs");var bt,wt={exports:{}};function mt(){return bt||(bt=1,wt.exports=function(){var t=l(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()},"GridList");t.cloneItems=function(t,e){var i,s;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(s in e[i]||(e[i]={}),t[i])e[i][s]=t[i][s];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:l(function(){var t,e,i,s=this.grid.length,o="\n #|",l="\n --";for(e=0;e<s;e++)o+=" "+this._padNumber(e," "),l+="---";for(o+=l,e=0;e<this._options.lanes;e++)for(o+="\n"+this._padNumber(e," ")+"|",i=0;i<s;i++)o+=" ",o+=(t=this.grid[i][e])?this._padNumber(this.items.indexOf(t),"0"):"--";return o+="\n"},"toString"),generateGrid:l(function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},"generateGrid"),resizeGrid:l(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 s=this.items[i],o=this._getItemPosition(s);this._updateItemPosition(s,this.findPositionForItem(s,{x:e,y:0})),e=Math.max(e,o.x)}this._pullItemsToLeft()},"resizeGrid"),findPositionForItem:l(function(t,e,i){var s,o,l;for(s=e.x;s<this.grid.length;s++)if(void 0!==i){if(l=[s,i],this._itemFitsAtPosition(t,l))return l}else for(o=e.y;o<this._options.lanes;o++)if(l=[s,o],this._itemFitsAtPosition(t,l))return l;var n=this.grid.length,r=0;return void 0!==i&&this._itemFitsAtPosition(t,[n,i])&&(r=i),[n,r]},"findPositionForItem"),moveItemToPosition:l(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)},"moveItemToPosition"),resizeItem:l(function(t,e){var i=e.w||t.w,s=e.h||t.h;this._updateItemSize(t,i,s),this._resolveCollisions(t),this._pullItemsToLeft()},"resizeItem"),getChangedItems:l(function(t,e){for(var i=[],s=0;s<t.length;s++){var o=this._getItemByAttribute(e,t[s][e]);o.x===t[s].x&&o.y===t[s].y&&o.w===t[s].w&&o.h===t[s].h||i.push(o)}return i},"getChangedItems"),_sortItemsByPosition:l(function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),s=this._getItemPosition(e);return i.x!=s.x?i.x-s.x:i.y!=s.y?i.y-s.y:0}.bind(this))},"_sortItemsByPosition"),_adjustSizeOfItems:l(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)}},"_adjustSizeOfItems"),_resetGrid:l(function(){this.grid=[]},"_resetGrid"),_itemFitsAtPosition:l(function(t,e){var i,s,o=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+o.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+o.w;i++){var l=this.grid[i];if(l)for(s=e[1];s<e[1]+o.h;s++)if(l[s]&&l[s]!==t)return!1}return!0},"_itemFitsAtPosition"),_updateItemPosition:l(function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},"_updateItemPosition"),_updateItemSize:l(function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},"_updateItemSize"),_markItemPositionToGrid:l(function(t){var e,i,s=this._getItemPosition(t);for(this._ensureColumns(s.x+s.w),e=s.x;e<s.x+s.w;e++)for(i=s.y;i<s.y+s.h;i++)this.grid[e][i]=t},"_markItemPositionToGrid"),_deleteItemPositionFromGrid:l(function(t){var e,i,s=this._getItemPosition(t);for(e=s.x;e<s.x+s.w;e++)if(this.grid[e])for(i=s.y;i<s.y+s.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},"_deleteItemPositionFromGrid"),_ensureColumns:l(function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},"_ensureColumns"),_getItemsCollidingWithItem:l(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},"_getItemsCollidingWithItem"),_itemsAreColliding:l(function(t,e){var i=this._getItemPosition(t),s=this._getItemPosition(e);return!(s.x>=i.x+i.w||s.x+s.w<=i.x||s.y>=i.y+i.h||s.y+s.h<=i.y)},"_itemsAreColliding"),_resolveCollisions:l(function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},"_resolveCollisions"),_tryToResolveCollisionsLocally:l(function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var s,o,l,n,r=new t([],this._options);t.cloneItems(this.items,r.items),r.generateGrid();for(var h=0;h<i.length;h++){var a=r.items[i[h]],d=this._getItemPosition(a),p=this._getItemPosition(e);if(s=[p.x-d.w,d.y],o=[p.x+p.w,d.y],l=[d.x,p.y-d.h],n=[d.x,p.y+p.h],r._itemFitsAtPosition(a,s))r._updateItemPosition(a,s);else if(r._itemFitsAtPosition(a,l))r._updateItemPosition(a,l);else if(r._itemFitsAtPosition(a,n))r._updateItemPosition(a,n);else{if(!r._itemFitsAtPosition(a,o))return!1;r._updateItemPosition(a,o)}}return t.cloneItems(r.items,this.items),this.generateGrid(),!0},"_tryToResolveCollisionsLocally"),_pullItemsToLeft:l(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 s=this.items[i],o=this._getItemPosition(s);if(!t||s!=t){var l=this._findLeftMostPositionForItem(s),n=this.findPositionForItem(s,{x:l,y:0},o.y);this._updateItemPosition(s,n)}}},"_pullItemsToLeft"),_findLeftMostPositionForItem:l(function(t){for(var e=0,i=this._getItemPosition(t),s=0;s<this.grid.length;s++)for(var o=i.y;o<i.y+i.h;o++){var l=this.grid[s][o];if(l){var n=this._getItemPosition(l);this.items.indexOf(l)<this.items.indexOf(t)&&(e=n.x+n.w)}}return e},"_findLeftMostPositionForItem"),_getItemByAttribute:l(function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},"_getItemByAttribute"),_padNumber:l(function(t,e){return t>=10?t:e+t},"_padNumber"),_getItemPosition:l(function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},"_getItemPosition"),_setItemPosition:l(function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])},"_setItemPosition")};var e=l(function(t){for(var e=0;e<t;e++)this.push(null)},"GridCol");return e.prototype=[],t}()),wt.exports}l(mt,"requireGridList");var vt=mt();const xt=yt(vt),St=n({__proto__:null,default:xt},[vt]),Ct=St&&xt||St,Tt=class _Grid extends e.HTMLWidget{divItems;gridList;items;itemsMap;origItems;cellWidth;cellHeight;dragItem;dragItemPos;_d3Drag;_d3DragResize;_selectionBag;_scrollBarWidth;constructor(){super(),this._tag="div",this._selectionBag=new e.Utility.Selection(this),this.content([])}getDimensions(){const 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}clearContent(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;let i=e;for(;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))}setContent(t,e,i,s,o,l){if(o=o||1,l=l||1,s=s||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){const n=(new g).gridRow(t).gridCol(e).widget(i).title(s).gridRowSpan(o).gridColSpan(l);this.content().push(n)}return this}sortedContent(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})}getCell(t,e){let i=null;return this.content().some(function(s){return t>=s.gridRow()&&t<s.gridRow()+s.gridRowSpan()&&e>=s.gridCol()&&e<s.gridCol()+s.gridColSpan()&&(i=s,!0)}),i}getWidgetCell(t){let e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e}getContent(t){let e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e}cellToGridItem(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}}gridItemToCell(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)}resetItemsPos(){this.origItems.forEach(function(t){const e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)}initGridList(){this.itemsMap={},this.items=this.content().map(function(t){const e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new Ct(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})}killGridList(){this.gridList=null,delete this.items,delete this.itemsMap}enter(t,i){super.enter(t,i),this._scrollBarWidth=e.Platform.getScrollbarWidth();const s=this;this._d3Drag=e.drag().subject(function(t){const e=s.cellToGridItem(t);return{x:e.x*s.cellWidth,y:e.y*s.cellHeight}}).on("start",function(t){if(!s.designMode())return;e.d3Event().sourceEvent.stopPropagation(),s.initGridList();const o=s.itemsMap[t.id()];s.dragItem=i.append("div").attr("class","dragging").style("transform",function(){return"translate("+o.x*s.cellWidth+"px, "+o.y*s.cellHeight+"px)"}).style("width",function(){return o.w*s.cellWidth-s.gutter()+"px"}).style("height",function(){return o.h*s.cellHeight-s.gutter()+"px"}),s.selectionBagClick(t)}).on("drag",function(t){if(!s.designMode())return;const i=e.d3Event();i.sourceEvent.stopPropagation();const o=s.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+o.w*s.cellWidth>s.snappingColumns()*s.cellWidth&&(i.x=s.snappingColumns()*s.cellWidth-o.w*s.cellWidth),i.y<0&&(i.y=0),i.y+o.h*s.cellWidth>s.snappingRows()*s.cellWidth&&(i.y=s.snappingRows()*s.cellWidth-o.h*s.cellWidth);const l=[Math.max(0,Math.floor((i.x+s.cellWidth/2)/s.cellWidth)),Math.max(0,Math.floor((i.y+s.cellHeight/2)/s.cellHeight))];o.x===l[0]&&o.y===l[1]||("none"!==s.snapping()?(s.resetItemsPos(),s.gridList.moveItemToPosition(o,l)):(o.x=l[0],o.y=l[1]),t.gridCol()===o.x&&t.gridRow()===o.y||(s.items.forEach(s.gridItemToCell),s.updateGrid(!1,100))),s.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return o.w*s.cellWidth+"px"}).style("height",function(){return o.h*s.cellHeight+"px"})}).on("end",function(){s.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),s.dragItem.remove(),s.dragItem=null,s.killGridList())}),this._d3DragResize=e.drag().subject(function(t){const e=s.cellToGridItem(t);return{x:(e.x+e.w-1)*s.cellWidth,y:(e.y+e.h-1)*s.cellHeight}}).on("start",function(t){if(!s.designMode())return;e.d3Event().sourceEvent.stopPropagation(),s.initGridList();const o=s.itemsMap[t.id()];s.dragItem=i.append("div").attr("class","resizing").style("transform",function(){return"translate("+o.x*s.cellWidth+"px, "+o.y*s.cellHeight+"px)"}).style("width",function(){return o.w*s.cellWidth-s.gutter()+"px"}).style("height",function(){return o.h*s.cellHeight-s.gutter()+"px"}),s.dragItemPos={x:o.x,y:o.y}}).on("drag",function(t){if(!s.designMode())return;const i=e.d3Event();i.sourceEvent.stopPropagation();const o=s.itemsMap[t.id()],l=[Math.max(0,Math.round(i.x/s.cellWidth)),Math.max(0,Math.round(i.y/s.cellHeight))],n={w:Math.max(1,l[0]-o.x+1),h:Math.max(1,l[1]-o.y+1)};o.w===n.w&&o.h===n.h||("none"!==s.snapping()?(s.resetItemsPos(),s.gridList.resizeItem(o,n)):(o.w=n.w,o.h=n.h),t.gridColSpan()===o.w&&t.gridRowSpan()===o.h||(s.items.forEach(s.gridItemToCell),s.updateGrid(o.id,100))),s.dragItem.style("width",function(){return(1-o.x)*s.cellWidth+i.x-s.gutter()+"px"}).style("height",function(){return(1-o.y)*s.cellHeight+i.y-s.gutter()+"px"})}).on("end",function(){s.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),s.dragItem.remove(),s.dragItem=null,s.killGridList())})}updateGrid(t,e=0,i=!1){e=e||0;const s=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*s.cellWidth+s.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*s.cellHeight+s.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*s.cellWidth-s.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*s.cellHeight-s.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(s.surfaceShadow()).surfacePadding_default(s.surfacePadding()).surfaceBorderWidth_default(s.surfaceBorderWidth()).surfaceBackgroundColor_default(s.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})}update(t,i){super.update(t,i),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);const s=this.getDimensions(),o=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=o/s.width,this.cellHeight="all"===this.fitTo()?this.height()/s.height:this.cellWidth,this.designMode()){const t=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),e=Math.floor(t);this.cellWidth=e,this.cellHeight=this.cellWidth}const l=this,n=i.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=n.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,s){!l._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===s||l.gridList||(l.initGridList(),"none"!==l.snapping()&&l.gridList.resizeGrid("horizontal"===l.snapping()?l.snappingRows():l.snappingColumns()),l.items.forEach(l.gridItemToCell),l.updateGrid(t.id(),100),l.killGridList())});e.select(this).append("div").attr("class","resizeHandle").call(l._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(n),this.divItems.each(function(t){const i=e.select(this);l.designMode()?i.call(l._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),n.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();const r=i.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);r.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){l.selectionBagClear()}).merge(r).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),r.exit().each(function(){l.selectionBagClear()}).remove();const h=i.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);h.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),h.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"),h.exit().remove()}exit(t,e){this.content().forEach(t=>t.target(null)),super.exit(t,e)}_createSelectionObject(t){return{_id:t._id,element:l(()=>t._element,"element"),widget:t}}selection(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})}selectionBagClear(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())}selectionBagClick(t){if(null!==t){const 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{const t=this._selectionBag.get();1===t.length&&t[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}}postSelectionChange(){}applyLayout(t){this.divItems.each((e,i)=>{if(t[i]){const[s,o,l,n]=t[i];e.gridCol(s).gridRow(o).gridColSpan(l).gridRowSpan(n)}}),this.updateGrid(!0)}vizActivation(t){}};l(Tt,"Grid");let Pt=Tt;Pt.prototype._class+=" layout_Grid",Pt.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),Pt.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:l(t=>!t.designMode(),"disable")}),Pt.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),Pt.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),Pt.prototype.publish("snappingColumns",12,"number","Snapping Columns"),Pt.prototype.publish("snappingRows",16,"number","Snapping Rows"),Pt.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),Pt.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),Pt.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),Pt.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),Pt.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),Pt.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});const zt=class _HorizontalList extends _t{constructor(){super(),this.orientation_default("horizontal"),this.flexWrap_default("nowrap")}};l(zt,"HorizontalList");let Wt=zt;Wt.prototype._class+=" layout_HorizontalList";const Bt=class _Layered extends e.HTMLWidget{_contentContainer;_widgetPlacements;_widgetRatios;constructor(){super(),this._tag="div",this._widgetPlacements=[],this._widgetRatios=[]}addLayer(t,i="default",s=1,o=1){const l=this.widgets();return l.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(l),this._widgetPlacements.push(i),this._widgetRatios.push([s,o]),this}enter(t,e){super.enter(t,e),this._contentContainer=e.append("div").attr("class","container")}update(t,e){super.update(t,e);const i=this;e.style("padding",this.surfacePadding()+"px");const s=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});s.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(s).each(function(t,e){const s={width:i.clientWidth(),height:i.clientHeight()},o=i.widgetSize(e,s),l=i.widgetPosition(e,s,o);this.style.top=l.y+"px",this.style.left=l.x+"px",t.resize(o).render()}),s.exit().each(function(t,e){t.target(null)}).remove(),s.order()}widgetSize(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}}widgetPosition(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}}}};l(Bt,"Layered");let It=Bt;It.prototype._class+=" layout_Layered",It.prototype.publish("surfacePadding",0,"number","Padding"),It.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});const At=class _Popup extends e.HTMLWidget{_surfaceButtons;_originalPosition;constructor(){super(),this._tag="div",this._surfaceButtons=[]}updateState(t){t=t||!this.popupState(),this.popupState(t).render()}enter(t,e){super.enter(t,e),this.widget().target(t),this._originalPosition=this.position()}update(t,e){super.update(t,e),e.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())}postUpdate(t,e){let i,s;switch(this.centerPopup()){case"container":this._placeholderElement&&(i=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,s=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":i=window.innerWidth/2-this.widget().width()/2,s=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:i=0,s=0,this.position(this._originalPosition)}this.pos({x:i,y:s}),super.postUpdate(t,e),e.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}click(t){}};l(At,"Popup");let Ht=At;Ht.prototype._class+=" layout_Popup",Ht.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),Ht.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,{}),Ht.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),Ht.prototype.publish("top",null,"number","Top position property of popup",null,{}),Ht.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),Ht.prototype.publish("left",null,"number","Left position property of popup",null,{}),Ht.prototype.publish("right",null,"number","Right position property of popup",null,{}),Ht.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),Ht.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});const Mt=class _Tabbed extends e.HTMLWidget{_tabContainer;_contentContainer;constructor(){super(),this._tag="div"}clearTabs(){return this.labels([]),this.widgets([]),this}addTab(t,i,s,o){const l=t.size();0===l.width&&0===l.height&&t.size({width:"100%",height:"100%"});const n=this.labels(),r=this.widgets();s&&this.activeTabIdx(this.widgets().length),n.push(i);const h=(new c).widget(t||(new e.Text).text("No widget defined for tab"));return r.push(h),this.labels(n),this.widgets(r),o&&o(h),this}widgetSize(t){const e=this.clientWidth();let i=this.clientHeight();const s=this._tabContainer.node().getBoundingClientRect();return void 0!==s.height&&(i-=s.height),{width:e,height:i}}enter(t,e){super.enter(t,e),this._tabContainer=e.append("div"),this._contentContainer=e.append("div")}update(t,i){super.update(t,i);const s=this;i.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);const o=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});o.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){s.click(s.widgets()[e].widget(),t,e),s.activeTabIdx(e).render()}).merge(o).classed("active",function(t,e){return s.activeTabIdx()===e}).text(function(t){return t}),o.exit().remove();const l=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});if(l.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(l).classed("active",function(t,e){return s.activeTabIdx()===e}).style("display",function(t,e){return s.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(s.activeTabIdx()===i),s.activeTabIdx()===i){const i=s.widgetSize(e.select(this));t.surfaceBorderWidth(s.showTabs()?null:0).surfacePadding(s.showTabs()?null:0).resize(i)}}),l.exit().each(function(t,e){t.target(null)}).remove(),"bottom"===this.tabLocation())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");else 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")}click(t,e,i){}};l(Mt,"Tabbed");let Ft=Mt;Ft.prototype._class+=" layout_Tabbed",Ft.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),Ft.prototype.publish("surfacePadding",4,"number","Padding"),Ft.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),Ft.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),Ft.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),Ft.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});const kt=class _Toolbar extends e.HTMLWidget{constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e)}update(t,i){super.update(t,i);const s=this;i.attr("title",s.title()).style("background-color",this.backgroundColor());const o=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);o.enter().append("div").classed("toolbar-title",!0).append("span"),o.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(s.title()),o.exit().remove();const l=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});l.enter().insert("div","div.toolbar-title").each(function(t,i){const o=s.widgetClasses()[i]?s.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(o,!0),t.target(this)}),l.exit().each(function(t){t.target(null)}).remove(),l.order()}render(t){const e=this;return super.render(function(i){const s=e.element().node().getBoundingClientRect();let o=s.left+s.width;e.element().selectAll("div.toolbar-child").each(function(t,e){const i=this.getBoundingClientRect();o>i.left&&(o=i.left)}),e.element().select(".toolbar-title").style("width",o-s.left-4+"px"),t&&t(i)})}exit(t,e){this.widgets().forEach(function(t){t.target(null)}),super.exit(t,e)}};l(kt,"Toolbar");let Ot=kt;Ot.prototype._class+=" layout_Toolbar",Ot.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),Ot.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),Ot.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),Ot.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),Ot.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]});const Lt=class _VerticalList extends _t{constructor(){super(),this.orientation_default("vertical"),this.flexWrap_default("nowrap")}};l(Lt,"VerticalList");let Dt=Lt;Dt.prototype._class+=" layout_VerticalList",t.AbsoluteSurface=h,t.Accordion=d,t.BUILD_VERSION="3.15.1",t.Border=_,t.Border2=m,t.Carousel=x,t.Cell=g,t.ChartPanel=gt,t.FlexGrid=_t,t.Grid=Pt,t.HorizontalList=Wt,t.Layered=It,t.Legend=dt,t.Modal=ct,t.PKG_NAME="@hpcc-js/layout",t.PKG_VERSION="3.4.1",t.Popup=Ht,t.Surface=c,t.Tabbed=Ft,t.Toolbar=Ot,t.VerticalList=Dt,t.WidgetDiv=b,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
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="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/layout"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/api"])}(this,function(t,e,i,s){"use strict";var o=Object.defineProperty,l=(t,e)=>o(t,"name",{value:e,configurable:!0});function n(t,e){for(var i=0;i<e.length;i++){const s=e[i];if("string"!=typeof s&&!Array.isArray(s))for(const e in s)if("default"!==e&&!(e in t)){const i=Object.getOwnPropertyDescriptor(s,e);i&&Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:l(()=>s[e],"get")})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}l(n,"_mergeNamespaces");const r=class _AbsoluteSurface extends e.HTMLWidget{constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e);let i=0,s=0,o=this.clientWidth(),l=this.clientHeight();switch(this.units()){case"pixels":i=this.widgetX(),s=this.widgetY(),o=""===this.widgetWidth()?o-i:Number(this.widgetWidth()),l=""===this.widgetHeight()?l-s:Number(this.widgetHeight());break;case"percent":i=this.widgetX()*o/100,s=this.widgetY()*l/100,o=""===this.widgetWidth()?o-i:Number(this.widgetWidth())*o/100,l=""===this.widgetHeight()?l-s:Number(this.widgetHeight())*l/100}e.style("opacity",this.opacity());const n=e.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});n.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(n).style("left",i+"px").style("top",s+"px").style("width",o+"px").style("bottom",l+"px").each(function(t){t.resize({width:o,height:l})}),n.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}};l(r,"AbsoluteSurface");let h=r;h.prototype._class+=" layout_AbsoluteSurface",h.prototype.publish("units","percent","set","Units",["pixels","percent"]),h.prototype.publish("widgetX",0,"number","Widget XPos"),h.prototype.publish("widgetY",0,"number","Widget YPos"),h.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),h.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),h.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),h.prototype.publish("opacity",1,"number","Opacity");const a=class _Accordion extends e.HTMLWidget{_isClosed;titleSpan;iconDiv;ul;icon;constructor(){super(),this._tag="div",this._isClosed=!1}pushListItem(t,e=!1,i=!1){const s=this.content();return t._protected=i,e?s.unshift(t):s.push(t),this.content(s),this}clearListItems(){const t=[];for(const e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this}collapseClick(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))}enter(t,i){super.enter(t,i);const s=this;this._isClosed=this.defaultCollapsed(),i.classed(this._isClosed?"closed":"open",!0),this.titleSpan=i.append("span").classed("collapsible-title",!0),this.iconDiv=i.append("div").classed("collapsible-icon",!0),this.ul=i.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){s.collapseClick(i),s.render()}),this.titleSpan.on("click",function(){s.collapseClick(i),s.render()})}update(t,e){super.update(t,e);const i=this;this.titleSpan.text(i.title().length>0?i.title()+"":"Accordion ["+i._id+"]");const s=this.ul.selectAll("#"+i._id+" > ul > li").data(this.content(),function(t){return t._id});s.enter().append(function(t){const e=document.createElement("li");if(null!==t._target)return t._target;{const s=t.size();if(0===s.width||0===s.height){const e=i.size();t.size({width:e.width,height:e.width})}t.target(e)}return e}),s.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()}exit(t,e){super.exit(t,e)}};l(a,"Accordion");let d=a;d.prototype._class+=" layout_Accordion",d.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),d.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),d.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),d.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),d.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),d.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),d.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});const p=class _Surface extends e.HTMLWidget{_surfaceButtons;constructor(){super(),this._tag="div",this._surfaceButtons=[]}widgetSize(t,e){let i=this.clientWidth(),s=this.clientHeight();return this.title()&&(s-=this.calcHeight(t)),s-=this.calcFrameHeight(e),i-=this.calcFrameWidth(e),{width:i,height:s}}enter(t,e){super.enter(t,e)}update(t,i){super.update(t,i);const s=this;i.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());const o=i.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);o.enter().insert("h3","div").attr("class","surfaceTitle").merge(o).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),o.exit().remove();const l=i.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());l.enter().append("button").classed("surface-button",!0).each(function(t,i){const o=s._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){s.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):o.text(function(){return t.label}).on("click",function(t){s.click(t)})}),l.exit().each(function(t,i){const o=e.select(this);delete s._surfaceButtons[i],o.remove()});const n=i.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});n.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(s.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(n).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){const o=s.widgetSize(i.select("h3"),e.select(this));o.width<0&&(o.width=0),o.height<0&&(o.height=0),t.resize({width:o.width,height:o.height})}),n.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}click(t){}};l(p,"Surface");let c=p;c.prototype._class+=" layout_Surface",c.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),c.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),c.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:l(t=>!t.title(),"disable")}),c.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),c.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),c.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),c.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),c.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),c.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),c.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),c.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});const u=class _Cell extends c{_indicateTheseIds;constructor(){super(),this._indicateTheseIds=[]}indicateTheseIds(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds}enter(t,e){super.enter(t,e);const i=this;e.classed("layout_Surface",!0).on("mouseenter",function(){i.onMouseEnter()}).on("mouseleave",function(){i.onMouseLeave()})}update(t,e){super.update(t,e)}onMouseEnter(){const t=this.indicateTheseIds(),i=this.indicatorOpacity(),s=this.indicatorBorderColor(),o=this.indicatorGlowColor();for(let l=0;l<t.length;l++){const n=e.select("#"+t[l]),r=n.datum();n&&r&&n.append("div").attr("class","update-indicator").style("width",r.width()+"px").style("height",r.height()+"px").style("opacity",i).style("border-color",s).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+o).style("-moz-box-shadow","inset 0px 0px 30px 0px "+o).style("box-shadow","inset 0px 0px 30px 0px "+o)}}onMouseLeave(){const t=this.indicateTheseIds();for(let i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()}};l(u,"Cell");let g=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"]});const f=class _Border extends e.HTMLWidget{_colCount;_rowCount;_colSize;_rowSize;_shrinkWrapBoxes;_watch;_offsetX;_offsetY;_dragCell;_dragCellSize;_dragCellStartSize;_handleTop;_handleLeft;_dragPrevX;_dragPrevY;_cellSizes;contentDiv;_scrollBarWidth;_borderHandles;_sectionTypeArr;constructor(){super(),this._tag="div",this._colCount=0,this._rowCount=0,this._colSize=0,this._rowSize=0,this._shrinkWrapBoxes={},this.content([]),this.sectionTypes([])}watchWidget(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){const e=this;this._watch[t.id()]=t.monitor(function(t,i,s){s!==i&&e.lazyPostUpdate()})}}lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100);applyLayoutType(){const 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)}cellSpecificDragHandles(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}}borderLayoutObject(t){const e={},i=this;let s,o,l,n,r,h,a,d;const p=this.target().getBoundingClientRect();p.top,p.left,p.bottom,p.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute("width")),parseFloat(this.target().getAttribute("height"))):(p.width,p.height),-1!==this.sectionTypes().indexOf("top")&&(s=this.topSize(),o=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(s=this._shrinkWrapBoxes.top.height+this.gutter(),o=0)),-1!==this.sectionTypes().indexOf("bottom")&&(l=this.bottomSize(),n=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(l=this._shrinkWrapBoxes.bottom.height+this.gutter(),n=0)),-1!==this.sectionTypes().indexOf("left")&&(r=this.leftSize(),h=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(r=this._shrinkWrapBoxes.left.width+this.gutter(),h=0)),-1!==this.sectionTypes().indexOf("right")&&(a=this.rightSize(),d=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(a=this._shrinkWrapBoxes.right.width+this.gutter(),d=0));const c=y({width:{px:0,"%":100},height:{px:s,"%":o},top:{px:0,"%":0},left:{px:0,"%":0}}),u=y({width:{px:0,"%":100},height:{px:l,"%":n},top:{px:0,"%":100},left:{px:0,"%":0}});u.top-=u.height;const g=y({width:{px:r,"%":h},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":0}}),f=y({width:{px:a,"%":d},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":100}});f.left-=f.width;const _=y({width:{px:-f.width-g.width,"%":100},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:g.width,"%":0}});return e.top=c,e.bottom=u,e.right=f,e.left=g,e.center=_,e;function y(t){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;return{width:t.width.px+t.width["%"]/100*i.width(),height:t.height.px+t.height["%"]/100*i.height(),top:t.top.px+t.top["%"]/100*i.height()+i.gutter()/2,left:t.left.px+t.left["%"]/100*i.width()+i.gutter()/2}}}clearContent(t){if(t){const 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([])}hasContent(t,e,i){return this.sectionTypes().indexOf(t)>=0}setContent(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){const s=(new g).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(s),this.sectionTypes().push(t)}return this}getCell(t){const e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null}getContent(t){const e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null}setLayoutOffsets(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2}dragStart(t){const i=e.d3Event();i.sourceEvent.stopPropagation();const s=this;this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));const o=e.select("#"+s.id()+" > div.borderHandle_"+t);s._handleTop=parseFloat(o.style("top").split("px")[0]),s._handleLeft=parseFloat(o.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}dragTick(t){const i=this,s=e.d3Event(),o=this._dragPrevX-s.sourceEvent.clientX,n=this._dragPrevY-s.sourceEvent.clientY;switch(t){case"top":case"bottom":r(t,n);break;case"right":case"left":r(t,o)}function r(t,s){if(0===s)return;const o=e.selectAll("#"+i.id()+" > div.borderHandle"),l=e.select("#"+i.id()+" > div.borderHandle_"+t);l.classed("borderHandle_top")?(l.style("top",i._handleTop-s+"px"),i._cellSizes.topHeight=i._handleTop-s,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_right")?(l.style("left",i._handleLeft-s+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+s):l.classed("borderHandle_bottom")?(l.style("top",i._handleTop-s+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+s,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_left")&&(l.style("left",i._handleLeft-s+"px"),i._cellSizes.leftWidth=i._handleLeft-s),o.each(function(){const 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"))})}l(r,"_moveHandles")}dragEnd(t){if(t){const i=e.d3Event(),s=this._dragPrevX-i.sourceEvent.clientX,o=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==o&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-o:this.topSize()-o));break;case"right":0!==s&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+s:this.rightSize()+s));break;case"bottom":0!==o&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+o:this.bottomSize()+o));break;case"left":0!==s&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-s:this.leftSize()-s))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()}size(t){const 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}enter(t,i){super.enter(t,i);const s=this;i.style("position","relative"),this.contentDiv=i.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"];i.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===s.getContent(t))})}update(t,i){super.update(t,i),this._sectionTypeArr=this.sectionTypes();const s=this;i.classed("design-mode",this.designMode()),this.setLayoutOffsets();const o=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),l=o.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+s._sectionTypeArr[i],!0),t.target(this),e.select("#"+s.id()+" > div.borderHandle_"+s._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(o);l.each(function(t,e){const i=s.sectionTypes()[e];void 0!==s[i+"ShrinkWrap"]&&s[i+"ShrinkWrap"]()?(t.render(),s._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete s._shrinkWrapBoxes[i]});const n=e.drag().on("start",function(t,e){s.dragStart.call(s,t,e)}).on("drag",function(t,e){s.dragTick.call(s,t,e)}).on("end",function(t,e){s.dragEnd.call(s,t,e)});this.designMode()?i.selectAll("#"+this.id()+" > div.borderHandle").call(n):i.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);const r=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=r[this.sectionTypes()[e]].left,t._fixedTop=r[this.sectionTypes()[e]].top,t._fixedWidth=r[this.sectionTypes()[e]].width,t._fixedHeight=r[this.sectionTypes()[e]].height,t._dragHandles=[]},this),l.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-s.gutter()+"px"}).style("height",function(t){return t._fixedHeight-s.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",s.designMode()).selectAll(".dragHandle").attr("draggable",s.designMode()),t.surfacePadding(s.surfacePadding()).resize()}),o.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),i.selectAll("#"+this.id()+" > div.borderHandle").each(function(){const t=e.select(this);t.classed("borderHandle_top")?(t.style("width",s._cellSizes.width+"px"),t.style("top",s._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",s._cellSizes.width-s._cellSizes.rightWidth+"px"),t.style("top",s._cellSizes.topHeight+3+"px"),t.style("height",s._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",s._cellSizes.width+"px"),t.style("top",s._cellSizes.height-s._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",s._cellSizes.leftWidth+"px"),t.style("height",s._cellSizes.leftHeight+"px"),t.style("top",s._cellSizes.topHeight+3+"px"))})}getCellSizes(){const t=this;t._cellSizes={};const 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(){const i=e.select(this);if("function"==typeof i.node){const e=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=e.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=e.width,t._cellSizes.leftHeight=e.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=e.width,t._cellSizes.rightHeight=e.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=e.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})}postUpdate(t,e){const i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){const e=t.widget().getBBox(!1,!0),s=t.widget().getBBox(!0,!0);e.width===s.width&&e.height===s.height||i.lazyRender()}})}exit(t,e){this.content().forEach(t=>t.target(null)),super.exit(t,e)}};l(f,"Border");let _=f;_.prototype._class+=" layout_Border",_.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),_.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),_.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),_.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),_.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),_.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),_.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),_.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),_.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),_.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),_.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});const y=class _WidgetDiv{_div;_overlay=!1;_overflowX="visible";_overflowY="visible";_widget;constructor(t){this._div=t}overlay(t){return arguments.length?(this._overlay=t,this):this._overlay}overflowX(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX}overflowY(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY}element(){return this._div}node(){return this._div.node()}widget(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}resize(t){return this._widget&&(this._div.style("width",`${t.width}px`).style("height",`${t.height}px`),this._widget.resize(t)),this}async render(t,i,s){let o=this.overflowX();this.overlay()||"visible"!==o||(o=null);let l=this.overflowY();return this.overlay()||"visible"!==l||(l=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",o).style("overflow-y",l),this._widget?this._widget.renderPromise().then(o=>{if(t&&this._widget.visible()){const t=this._widget.getBBox();return t.width+=8,void 0!==i&&t.height>i&&(t.width+=e.Platform.getScrollbarWidth()),void 0!==s&&t.width>s&&(t.height+=e.Platform.getScrollbarWidth()),this.overlay()?t.height=0:t.height+=4,t}return t?{x:0,y:0,width:0,height:0}:void 0}):Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)}};l(y,"WidgetDiv");let b=y;const w=class _Border2 extends e.HTMLWidget{_bodyElement;_topWA;_leftWA;_centerWA;_rightWA;_bottomWA;_topPrevOverflow;_leftPrevOverflow;_rightPrevOverflow;_bottomPrevOverflow;constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e);const i=e.append("header");this._bodyElement=e.append("div").attr("class","body");const s=this._bodyElement.append("div").attr("class","center"),o=this._bodyElement.append("div").attr("class","lhs"),l=this._bodyElement.append("div").attr("class","rhs"),n=e.append("div").attr("class","footer");this._topWA=new b(i),this._centerWA=new b(s),this._leftWA=new b(o),this._rightWA=new b(l),this._bottomWA=new b(n)}update(t,e){super.update(t,e),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`)}targetNull(t){t&&t.target(null)}exit(t,e){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),super.exit(t,e)}swap(t,e){const i=this[t](),s=this[e]();return this.targetNull(i),this.targetNull(s),this[`_${t}WA`].widget(null),this[`_${e}WA`].widget(null),this[t](s),this[e](i),this}render(t){return super.render(e=>{this._topWA?this._topWA.widget(this.top()).overlay(this.topOverlay()).render(!0).then(async e=>{const i=await this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width()),s=this.height()-(e.height+i.height),o=await this._leftWA.widget(this.left()).render(!0,s),l=await this._rightWA.widget(this.right()).render(!0,s);this.bottomHeight_exists()&&(i.height=this.bottomHeight());const n=this.width()-(o.width+l.width),r=this.height()-(e.height+i.height),h=this.centerOverflowX(),a=this.centerOverflowY(),d=-1!==["auto","scroll"].indexOf(h),p=-1!==["auto","scroll"].indexOf(a);(d||p)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:r}).render(),this._bodyElement.style("height",`${r}px`);const c=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:e.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:o.width,height:r}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:l.width,height:r}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:r}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()];Promise.all(c).then(e=>{t&&t(this)})}):t&&t(this)})}};l(w,"Border2");let m=w;m.prototype._class+=" layout_Border2",m.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),m.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),m.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),m.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),m.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),m.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),m.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),m.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),m.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),m.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),m.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),m.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});const v=class _Carousel extends e.HTMLWidget{_prevActive=0;_root;activeWidget(){return this.widgets()[this.active()]}enter(t,e){super.enter(t,e),this._root=e.append("div").attr("id",`${this.id()}_root`)}update(t,i){super.update(t,i);const s=this.active(),o=this.width();this._root.style("width",`${o}px`).style("height",`${this.height()}px`);const l=this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(),t=>t.id()),n=l.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(l).style("left",(t,e)=>(e-this._prevActive)*o+"px").style("width",`${o}px`);this._prevActive!==s&&(n.style("display",(t,e)=>e===this._prevActive||e===s?null:"none").transition().duration(this.transitionDuration()).style("left",(t,e)=>(e-s)*o+"px").on("end",function(t,i){e.select(this).style("display",()=>i===s?null:"none")}),this._prevActive=s),l.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widgets().forEach(t=>t.target(null)),super.exit(t,e)}render(t){return super.render(e=>{if(!this.visible()||this.isDOMHidden())t&&t(e);else{const i=this.activeWidget();i&&i.resize(this.size()).render(i=>{t&&t(e)})}})}};l(v,"Carousel");let x=v;x.prototype._class+=" layout_Carousel",x.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),x.prototype.publish("active",0,"number","Active widget"),x.prototype.publish("transitionDuration",500,"number","Transition duration");var S=Math.PI,C=2*S,T=1e-6,P=C-T;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function W(){return new z}function B(t){return l(function(){return t},"constant")}l(z,"Path"),l(W,"path"),z.prototype=W.prototype={constructor:z,moveTo:l(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:l(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:l(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:l(function(t,e,i,s){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+s)},"quadraticCurveTo"),bezierCurveTo:l(function(t,e,i,s,o,l){this._+="C"+ +t+","+ +e+","+ +i+","+ +s+","+(this._x1=+o)+","+(this._y1=+l)},"bezierCurveTo"),arcTo:l(function(t,e,i,s,o){t=+t,e=+e,i=+i,s=+s,o=+o;var l=this._x1,n=this._y1,r=i-t,h=s-e,a=l-t,d=n-e,p=a*a+d*d;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>T)if(Math.abs(d*r-h*a)>T&&o){var c=i-l,u=s-n,g=r*r+h*h,f=c*c+u*u,_=Math.sqrt(g),y=Math.sqrt(p),b=o*Math.tan((S-Math.acos((g+p-f)/(2*_*y)))/2),w=b/y,m=b/_;Math.abs(w-1)>T&&(this._+="L"+(t+w*a)+","+(e+w*d)),this._+="A"+o+","+o+",0,0,"+ +(d*c>a*u)+","+(this._x1=t+m*r)+","+(this._y1=e+m*h)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},"arcTo"),arc:l(function(t,e,i,s,o,l){t=+t,e=+e,l=!!l;var n=(i=+i)*Math.cos(s),r=i*Math.sin(s),h=t+n,a=e+r,d=1^l,p=l?s-o:o-s;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+h+","+a:(Math.abs(this._x1-h)>T||Math.abs(this._y1-a)>T)&&(this._+="L"+h+","+a),i&&(p<0&&(p=p%C+C),p>P?this._+="A"+i+","+i+",0,1,"+d+","+(t-n)+","+(e-r)+"A"+i+","+i+",0,1,"+d+","+(this._x1=h)+","+(this._y1=a):p>T&&(this._+="A"+i+","+i+",0,"+ +(p>=S)+","+d+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:l(function(t,e,i,s){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +s+"h"+-i+"Z"},"rect"),toString:l(function(){return this._},"toString")},l(B,"constant");var I=Math.PI,A=2*I;const H={draw:l(function(t,e){var i=Math.sqrt(e/I);t.moveTo(i,0),t.arc(0,0,i,0,A)},"draw")},M={draw:l(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()},"draw")};var F=Math.sqrt(1/3),k=2*F;const O={draw:l(function(t,e){var i=Math.sqrt(e/k),s=i*F;t.moveTo(0,-i),t.lineTo(s,0),t.lineTo(0,i),t.lineTo(-s,0),t.closePath()},"draw")};var L=Math.sin(I/10)/Math.sin(7*I/10),D=Math.sin(A/10)*L,R=-Math.cos(A/10)*L;const E={draw:l(function(t,e){var i=Math.sqrt(.8908130915292852*e),s=D*i,o=R*i;t.moveTo(0,-i),t.lineTo(s,o);for(var l=1;l<5;++l){var n=A*l/5,r=Math.cos(n),h=Math.sin(n);t.lineTo(h*i,-r*i),t.lineTo(r*s-h*o,h*s+r*o)}t.closePath()},"draw")},G={draw:l(function(t,e){var i=Math.sqrt(e),s=-i/2;t.rect(s,s,i,i)},"draw")};var X=Math.sqrt(3);const Y={draw:l(function(t,e){var i=-Math.sqrt(e/(3*X));t.moveTo(0,2*i),t.lineTo(-X*i,-i),t.lineTo(X*i,-i),t.closePath()},"draw")};var V=-.5,N=Math.sqrt(3)/2,j=1/Math.sqrt(12),$=3*(j/2+1);const U={draw:l(function(t,e){var i=Math.sqrt(e/$),s=i/2,o=i*j,l=s,n=i*j+i,r=-l,h=n;t.moveTo(s,o),t.lineTo(l,n),t.lineTo(r,h),t.lineTo(V*s-N*o,N*s+V*o),t.lineTo(V*l-N*n,N*l+V*n),t.lineTo(V*r-N*h,N*r+V*h),t.lineTo(V*s+N*o,V*o-N*s),t.lineTo(V*l+N*n,V*n-N*l),t.lineTo(V*r+N*h,V*h-N*r),t.closePath()},"draw")};function q(){var t=B(H),e=B(64),i=null;function s(){var s;if(i||(i=s=W()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),s)return i=null,s+""||null}return l(s,"symbol"),s.type=function(e){return arguments.length?(t="function"==typeof e?e:B(e),s):t},s.size=function(t){return arguments.length?(e="function"==typeof t?t:B(+t),s):e},s.context=function(t){return arguments.length?(i=null==t?null:t,s):i},s}l(q,"d3Symbol");var K="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=l(function(t){return t},"d3_identity"),Z=l(function(t){for(var e=[],i=0,s=t.length;i<s;i++)e[i]=t[s-i-1];return e},"d3_reverse"),Q=l(function(t,i){t.each(function(){var t,s=e.select(this),o=s.text().split(/\s+/).reverse(),l=[];s.attr("y");for(var n=parseFloat(s.attr("dy"))||0,r=s.text(null).append("tspan").attr("x",0).attr("dy",n+"em");t=o.pop();)l.push(t),r.text(l.join(" ")),r.node().getComputedTextLength()>i&&l.length>1&&(l.pop(),r.text(l.join(" ")),l=[t],r=s.append("tspan").attr("x",0).attr("dy",1.2+n+"em").text(t))})},"d3_textWrapping"),tt=l(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],s=arguments[3],o=arguments[4];if("object"===(void 0===e?"undefined":K(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 n=[],r=t.length,h=0;h<r;h++)n.push(e({i:h,genLength:r,generatedLabels:t,domain:i,range:s,labelDelimiter:o}));return n}return t},"d3_mergeLabels"),et=l(function(t,e,i){var s=[];if(e.length>1)s=e;else for(var o=t.domain(),n=(o[o.length-1]-o[0])/(e-1),r=0;r<e;r++)s.push(o[0]+r*n);var h=s.map(i);return{data:s,labels:h,feature:l(function(e){return t(e)},"feature")}},"d3_linearLegend"),it=l(function(t,e,i){var s=t.range().map(function(s){var o=t.invertExtent(s);return e(o[0])+" "+i+" "+e(o[1])});return{data:t.range(),labels:s,feature:J}},"d3_quantLegend"),st=l(function(t){return{data:t.domain(),labels:t.domain(),feature:l(function(e){return t(e)},"feature")}},"d3_ordinalLegend"),ot=l(function(t,e,i){t.call("cellover",i,e)},"d3_cellOver"),lt=l(function(t,e,i){t.call("cellout",i,e)},"d3_cellOut"),nt=l(function(t,e,i){t.call("cellclick",i,e)},"d3_cellClick"),rt={d3_drawShapes:l(function(t,e,i,s,o,l){"rect"===t?e.attr("height",i).attr("width",s):"circle"===t?e.attr("r",o):"line"===t?e.attr("x1",0).attr("x2",s).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",l)},"d3_drawShapes"),d3_addText:l(function(t,e,i,s,o){e.append("text").attr("class",s+"label");var l=t.selectAll("g."+s+"cell text."+s+"label").data(i).text(J);return o&&t.selectAll("g."+s+"cell text."+s+"label").call(Q,o),l},"d3_addText"),d3_calcType:l(function(t,e,i,s,o,l){var n=t.invertExtent?it(t,o,l):t.ticks?et(t,i,o):st(t),r=t.range&&t.range()||t.domain();return n.labels=tt(n.labels,s,t.domain(),r,l),e&&(n.labels=Z(n.labels),n.data=Z(n.data)),n},"d3_calcType"),d3_filterCells:l(function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),s=i.map(function(t){return t.data}),o=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==s.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==o.indexOf(t)}),t},"d3_filterCells"),d3_placement:l(function(t,e,i,s,o,l){e.attr("transform",i),s.attr("transform",o),"horizontal"===t&&s.style("text-anchor",l)},"d3_placement"),d3_addEvents:l(function(t,e){t.on("mouseover.legend",function(t){ot(e,t,this)}).on("mouseout.legend",function(t){lt(e,t,this)}).on("click.legend",function(t){nt(e,t,this)})},"d3_addEvents"),d3_title:l(function(t,e,i,s){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),s&&t.selectAll("text."+i+"legendTitle").call(Q,s);var o=t.select("."+i+"legendCells"),l=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],n=-o.nodes().map(function(t){return t.getBBox().x})[0];o.attr("transform","translate("+n+","+l+")")}},"d3_title"),d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};function ht(){var t=e.scaleLinear(),i="rect",s=15,o=15,n=10,r=2,h=[5],a=void 0,d=[],p="",c=!1,u="",g=rt.d3_defaultLocale,f=rt.d3_defaultFormatSpecifier,_=10,y="middle",b=rt.d3_defaultDelimiter,w=void 0,m="vertical",v=!1,x=void 0,S=void 0,C=e.dispatch("cellover","cellout","cellclick");function T(T){var P=rt.d3_calcType(t,v,h,d,g.format(f),b);T.selectAll("g").data([t]).enter().append("g").attr("class",p+"legendCells"),a&&rt.d3_filterCells(P,a);var z=T.select("."+p+"legendCells").selectAll("."+p+"cell").data(P.data),W=z.enter().append("g").attr("class",p+"cell");W.append(i).attr("class",p+"swatch");var B=T.selectAll("g."+p+"cell "+i+"."+p+"swatch").data(P.data);rt.d3_addEvents(W,C),z.exit().transition().style("opacity",0).remove(),B.exit().transition().style("opacity",0).remove(),B=B.merge(B),rt.d3_drawShapes(i,B,o,s,n,x);var I=rt.d3_addText(T,W,P.labels,p,w);z=W.merge(z);var A=I.nodes().map(function(t){return t.getBBox()}),H=B.nodes().map(function(t){return t.getBBox()});c?B.attr("class",function(t){return p+"swatch "+P.feature(t)}):"line"==i?B.style("stroke",P.feature):B.style("fill",P.feature);var M,F=void 0,k=void 0,O="start"==y?0:"middle"==y?.5:1;"vertical"===m?(M=A.map(function(t,e){return Math.max(t.height,H[e].height)}),F=l(function(t,i){return"translate(0, "+(e.sum(M.slice(0,i))+i*r)+")"},"cellTrans"),k=l(function(t,e){return"translate( "+(H[e].width+H[e].x+_)+", "+(H[e].y+H[e].height/2+5)+")"},"textTrans")):"horizontal"===m&&(F=l(function(t,e){return"translate("+e*(H[e].width+r)+",0)"},"cellTrans"),k=l(function(t,e){return"translate("+(H[e].width*O+H[e].x)+",\n "+(H[e].height+H[e].y+_+8)+")"},"textTrans")),rt.d3_placement(m,z,F,I,k,y),rt.d3_title(T,u,p,S),z.transition().style("opacity",1)}return l(T,"legend"),T.scale=function(e){return arguments.length?(t=e,T):t},T.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(h=t),T):h},T.cellFilter=function(t){return arguments.length?(a=t,T):a},T.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,x=e),T):i},T.shapeWidth=function(t){return arguments.length?(s=+t,T):s},T.shapeHeight=function(t){return arguments.length?(o=+t,T):o},T.shapeRadius=function(t){return arguments.length?(n=+t,T):n},T.shapePadding=function(t){return arguments.length?(r=+t,T):r},T.labels=function(t){return arguments.length?(d=t,T):d},T.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),T):y},T.locale=function(t){return arguments.length?(g=e.formatLocale(t),T):g},T.labelFormat=function(t){return arguments.length?(f=e.formatSpecifier(t),T):T.locale().format(f)},T.labelOffset=function(t){return arguments.length?(_=+t,T):_},T.labelDelimiter=function(t){return arguments.length?(b=t,T):b},T.labelWrap=function(t){return arguments.length?(w=t,T):w},T.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(c=t),T):c},T.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(m=t),T):m},T.ascending=function(t){return arguments.length?(v=!!t,T):v},T.classPrefix=function(t){return arguments.length?(p=t,T):p},T.title=function(t){return arguments.length?(u=t,T):u},T.titleWidth=function(t){return arguments.length?(S=t,T):S},T.textWrap=function(t){return arguments.length?(textWrap=t,T):textWrap},T.on=function(){var t=C.on.apply(C,arguments);return t===C?T:t},T}l(ht,"color");const at=class _Legend extends e.SVGWidget{_owner;_targetWidget;_targetWidgetMonitor;_legendOrdinal;_disabled=[];_symbolTypeMap={circle:H,cross:M,diamond:O,square:G,star:E,triangle:Y,wye:U};constructor(t){super(),this._owner=t,this._drawStartPos="origin";const e=this;this._legendOrdinal=ht().shape("path",q().type(H).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){e.onClick(t,this)}).on("cellover",t=>{e.onOver(t,this)}).on("cellout",t=>{e.onOut(t,this)})}isDisabled(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)}filteredFields(){switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(t=>!this.isDisabled(t))}return this.fields()}filteredColumns(){switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(t=>!this.isDisabled(t))}return this.columns()}filteredData(){switch(this.dataFamily()){case"2D":return this.data().filter(t=>!this.isDisabled(t[0]));case"ND":const t={};let e=!1;return this.columns().forEach((i,s)=>{const o=this.isDisabled(i);t[s]=o,o&&(e=!0)}),e?this.data().map(e=>e.filter((e,i)=>!t[i])):this.data()}return this.data()}isRainbow(){const t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()}targetWidget(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){const t=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(e,i,s,o){switch(e){case"chart":case"columns":case"data":case"paletteID":t.lazyRender()}})}return this}getWidget(){return this._targetWidget&&"composite_MultiChart"===this._targetWidget.classID()?this._targetWidget.chart():this._targetWidget}getPalette(){const 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")}getPaletteType(){return this.getPalette().type()}fillColorFunc(){const t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),(e,i,s)=>t.fillColor(e,i,s);const i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return(t,e,s)=>i(e)}fillColor(t,e,i){return this.fillColorFunc()(t,e,i)}_g;enter(t,e){super.enter(t,e),this._g=e.append("g").attr("class","legendOrdinal")}calcMetaData(){let t=[],i=0,s=0;const o=this.columns().length;if(this._targetWidget){const l=this.columns();switch(this.getPaletteType()){case"ordinal":const n=this.fillColorFunc();let r=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){r=this.data()[e].slice(1,o).reduce((t,e)=>t+e,0);const l=this.isDisabled(t[0]);l||(i+=r);const h=t[0]+(!l&&this.showSeriesTotal()?` (${r})`:""),a=this.textSize(h);return s<a.width&&(s=a.width),[n(t,t[0],!1),t[0],h]},this);break;case"ND":t=this.columns().filter(t=>0!==t.indexOf("__")).filter(function(t,e){return e>0}).map(function(t,e){r=this.data().reduce((t,i)=>t+i[e+1],0);const o=this.isDisabled(l[e+1]),h=t+(!o&&this.showSeriesTotal()?` (${r})`:"");o||(i+=r);const a=this.textSize(h);return s<a.width&&(s=a.width),[n(void 0,t,!1),t,h]},this);break;default:t=this.columns().map(function(t){return[n(void 0,t,!1),t]},this)}break;case"rainbow":const h=this.getPalette(),a=e.format(this.rainbowFormat()),d=this.getWidget(),p=this.rainbowBins(),c=d._dataMinWeight,u=d._dataMaxWeight,g=(u-c)/(p-1);t.push([h(c,c,u),a(c)]);for(let e=1;e<p-1;++e){let i=g*e;Math.floor(i)>parseInt(t[0][1])&&(i=Math.floor(i)),t.push([h(i,c,u),a(i)])}t.push([h(u,c,u),a(u)])}}return{dataArr:t,total:i,maxLabelWidth:s}}update(t,i){super.update(t,i);const{dataArr:s,maxLabelWidth:o,total:l}=this.calcMetaData(),n=this.shapeRadius(),r=this.radiusToSymbolSize(n);let h=this.itemPadding();"horizontal"===this.orientation()&&(h+=o-2*n);const a=e.scaleOrdinal().domain(s.map(t=>t[1])).range(s.map(t=>t[0]));this._legendOrdinal.shape("path",q().type(this._symbolTypeMap[this.symbolType()]).size(r)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(h).scale(a).labels(t=>s[t.i][2]),this._g.call(this._legendOrdinal),this.updateDisabled(i,s);const d=this._g.select(".legendCells").node().getBBox();let p=Math.abs(d.x),c=Math.abs(d.y)+1;if("horizontal"===this.orientation()){if("start"===this.labelAlign()?p+=1:"end"===this.labelAlign()&&(p-=1),this.width()>d.width){p+=(this.width()-d.width)/2}}else if("vertical"===this.orientation()&&(p+=1,this._containerSize.height>d.height)){c+=(this.height()-d.height)/2}this._g.attr("transform",`translate(${p}, ${c})`),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());const u=this._g.selectAll(".legendTotal").data(s.length&&this.showLegendTotal()?[l]:[]),g=`Total: ${l}`,f=-p,_=d.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),u.enter().append("text").classed("legendTotal",!0).merge(u).attr("transform",`translate(${f}, ${_})`).text(g),u.exit().remove()}updateDisabled(t,e){t.style("cursor","pointer").selectAll("path.swatch").filter((t,i)=>i<e.length).style("stroke",(t,i)=>e[i][0]).style("fill",(t,i)=>this._disabled.indexOf(t)<0?e[i][0]:"white")}postUpdate(t,e){let i;this._boundingBox&&(i=this._boundingBox.width,this._boundingBox.width=this._size.width),super.postUpdate(t,e),void 0!==i&&(this._boundingBox.width=i),this._parentRelativeDiv.style("overflow","hidden")}exit(t,e){super.exit(t,e)}radiusToSymbolSize(t){const 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}}onClick(t,e){if("ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":const e=this._disabled.indexOf(t);e<0?this._disabled.push(t):this._disabled.splice(e,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}}onOver(t,e){if(s.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}}onOut(t,e){if(s.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}}onDblClick(t,e){}onMouseOver(t,e){}_containerSize;resize(t){let e;if(this.fitToContent()){this._containerSize=t;const i=this.getBBox();t.width>i.width&&(i.width=t.width),t.height>i.height&&(i.height=t.height),e=super.resize.apply(this,[{...i}])}else e=super.resize.apply(this,arguments);return e}};l(at,"Legend");let dt=at;dt.prototype._class+=" layout_Legend",dt.prototype.publish("title","","string","Title"),dt.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),dt.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),dt.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),dt.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),dt.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:l(t=>!t.isRainbow(),"disable")}),dt.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:l(t=>!t.isRainbow(),"disable")}),dt.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),dt.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),dt.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),dt.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),dt.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),dt.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:l(t=>"vertical"===t.orientation(),"disable")});const pt=class _Modal extends e.HTMLWidget{_widget;_relativeTarget;_fade;_modal;_modalHeader;_modalBody;_modalHeaderAnnotations;_modalHeaderCloseButton;_close;constructor(){super(),this._tag="div"}closeModal(){this.visible(!1)}getRelativeTarget(){let t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()),t)?t:!t&&(t=this.locateAncestor("layout_Grid"),t&&t.element)?t.element().node():document.body}setModalSize(){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());const 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}setFadePosition(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")}setModalPosition(t){const 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()){const e=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px")}}resize(t){return super.resize(),this._modal&&this.setModalSize(),this}resizeBodySync(t,e){const 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})}enter(t,e){super.enter(t,e),this._fade=e.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());const i=2*this.titleFontSize();this._modal=e.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",i+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height",`calc( 100% - ${i}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",()=>{this.closeModal()}),this._fade.on("click",t=>{this.enableClickFadeToClose()&&this.closeModal()})}update(t,e){super.update(t,e),e.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();const i=this._relativeTarget.getBoundingClientRect();this.setFadePosition(i),this.setModalPosition(i),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()}exit(t,e){this._widget&&this._widget.target(null),super.exit(t,e)}formattedTitle(){const t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()}};l(pt,"Modal");let ct=pt;ct.prototype._class+=" layout_Modal",ct.prototype.publish("title",null,"string","title"),ct.prototype.publish("widget",null,"widget","widget"),ct.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),ct.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),ct.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),ct.prototype.publish("show",!0,"boolean","show"),ct.prototype.publish("showFade",!0,"boolean","showFade"),ct.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),ct.prototype.publish("minWidth","400px","string","minWidth"),ct.prototype.publish("minHeight","400px","string","minHeight"),ct.prototype.publish("maxWidth","800px","string","maxWidth"),ct.prototype.publish("maxHeight","800px","string","maxHeight"),ct.prototype.publish("fixedWidth",null,"string","fixedWidth"),ct.prototype.publish("fixedHeight",null,"string","fixedHeight"),ct.prototype.publish("fixedTop",null,"string","fixedTop"),ct.prototype.publish("fixedLeft",null,"string","fixedLeft"),ct.prototype.publish("overflowX","hidden","string","overflowX"),ct.prototype.publish("overflowY","scroll","string","overflowY");const ut=class _ChartPanel extends m{_legend=new dt(this).enableOverflow(!0);_progressBar=new e.ProgressBar;_autoScale=!1;_resolutions={tiny:{width:100,height:100},small:{width:300,height:300}};_modal=new ct;_highlight;_scale;_orig_size;_toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",()=>""!==this.description()).on("click",()=>{if(this._toggleInfo.selected()){this._modal.title(this.title()).widget((new e.Text).text(this.description())).show(!0).render();const t=this._modal._close;this._modal._close=()=>{this._toggleInfo.selected(!1).render(),this._modal._close=t}}}).on("mouseMove",()=>{}).on("mouseOut",()=>{});_toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",()=>{this.dataVisible(this._toggleData.selected()),this.render()});_buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",()=>{this.downloadCSV()});_buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",()=>{this.downloadPNG()});_toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",()=>{const t=this._toggleLegend.selected();"bottom"===this.legendPosition()?this.showBottom(t):"right"===this.legendPosition()&&this.showRight(t),this.legendVisible(t),this.render()});_spacer=new e.Spacer;_titleBar=(new e.TitleBar).buttons([this._toggleData,this._buttonDownload,this._buttonDownloadImage,this._spacer,this._toggleLegend]);_carousel=new x;_table=new i.Table;_widget;_hideLegendToggleList=["dgrid_Table"];constructor(){super(),this._tag="div"}fields(t){return arguments.length?(super.fields(t),this._legend.fields(t),this.refreshFields(),this):super.fields()}refreshFields(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this}columns(t,e){return arguments.length?(super.columns(t,e),this._legend.columns(t,e),this.refreshColumns(),this):super.columns()}refreshColumns(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this}data(t){return arguments.length?(super.data(t),this._legend.data(t),this.refreshData(),this):super.data()}refreshData(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this}highlight(t){return arguments.length?(this._highlight=t,this):this._highlight}startProgress(){this._progressBar.start()}finishProgress(){this._progressBar.finish()}buttons(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()}downloadCSV(){const 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}downloadPNG(){const t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this}highlightColumn(t){if(t){const i=`series-${this.cssTag(t)}`;this._centerWA.element().selectAll(".series").each(function(){const t=e.select(this),s=t.classed(i);t.classed("highlight",s).classed("lowlight",!s)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this}getResponsiveMode(){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"}setOrigSize(){this._orig_size=JSON.parse(JSON.stringify(this.size()))}enter(t,e){super.enter(t,e),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(t,e),this.setOrigSize()}preUpdateTiny(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")}preUpdateSmall(t){const e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);const s=this._scale===e;this.size({width:s?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:s?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})`)}preUpdateRegular(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)")}_prevdataVisible;_prevlegendVisible;_prevLegendPosition;_prevChartDataFamily;_prevChart;_prevButtons;update(t,e){super.update(t,e)}preUpdate(t,i){switch(super.preUpdate(t,i),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._legend.visible(this._prevlegendVisible&&!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._prevdataVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(i);break;case"small":this.preUpdateSmall(i);break;case"regular":this.preUpdateRegular(i)}const s="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(s._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily()&&(this._prevChartDataFamily=this._legend.dataFamily(),"any"===this._prevChartDataFamily))this._toggleLegend.selected(!1),this._legend.visible(!1);if(i.style("box-shadow",this.highlight()?`inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}`:"none"),-1!==this._hideLegendToggleList.indexOf(s.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==s){this._prevChart=s;const t=s?s._titleBar||s._iconBar:void 0;if(t&&t instanceof e.IconBar){this._prevButtons=this._prevButtons||[...this.buttons()];const i=[...t.buttons(),new e.Spacer,...this._prevButtons];t.buttons([]).render(),this.buttons(i)}else this._prevButtons&&this.buttons(this._prevButtons)}const o=[];this.dataButtonVisible()||o.push(this._toggleData),this.downloadButtonVisible()||o.push(this._buttonDownload),this.downloadImageButtonVisible()||o.push(this._buttonDownloadImage),this.legendButtonVisible()||o.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(o).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())}postUpdate(t,e){switch(super.postUpdate(t,e),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(e);break;case"small":this.postUpdateSmall(e);break;case"regular":this.postUpdateRegular(e)}}postUpdateTiny(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)");const e=t.selectAll("div.title-icon"),i=e.node(),s=t.node().parentElement.getBoundingClientRect();if(i){const i=e.node().getBoundingClientRect(),o=s.height/2;e.style("position","absolute").style("left",`calc(50% - ${i.width/2}px)`).style("top",o-i.height/2+"px"),t.selectAll("div.data-count").style("position","absolute").style("left",`calc(50% + ${i.width/2}px)`).style("top",o-i.height/2+"px")}}postUpdateSmall(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");const 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})`)}postUpdateRegular(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")}exit(t,e){this._progressBar.exit(t,e),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,super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}vertex_click(t,e,i,s){s&&s.vertex}vertex_dblclick(t,e,i,s){s&&s.vertex}edge_click(t,e,i,s){s&&s.edge}edge_dblclick(t,e,i,s){s&&s.edge}};l(ut,"ChartPanel");let gt=ut;gt.prototype._class+=" layout_ChartPanel",gt.prototype.publishReset(),gt.prototype.publishProxy("title","_titleBar"),gt.prototype.publish("titleVisible",!0,"boolean"),gt.prototype.publish("titleOverlay",!1,"boolean"),gt.prototype.publishProxy("titleIcon","_titleBar"),gt.prototype.publishProxy("titleIconFont","_titleBar"),gt.prototype.publishProxy("titleFont","_titleBar"),gt.prototype.publishProxy("titleIconFontSize","_titleBar"),gt.prototype.publishProxy("titleFontSize","_titleBar"),gt.prototype.publishProxy("description","_titleBar"),gt.prototype.publishProxy("descriptionFont","_titleBar"),gt.prototype.publishProxy("descriptionFontSize","_titleBar"),gt.prototype.publish("dataVisible",!1,"boolean","Show data table"),gt.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),gt.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),gt.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),gt.prototype.publish("downloadTitle","","string","File name when downloaded"),gt.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),gt.prototype.publish("legendVisible",!1,"boolean","Show legend"),gt.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),gt.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),gt.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),gt.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),gt.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),gt.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),gt.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),gt.prototype.publishProxy("legend_symbolType","_legend","symbolType"),gt.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),gt.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),gt.prototype.publish("enableAutoscaling",!1,"boolean"),gt.prototype.publish("highlightSize",4,"number"),gt.prototype.publish("highlightColor","#e67e22","html-color"),gt.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),gt.prototype.publishProxy("progress_decay","_progressBar","decay"),gt.prototype.publishProxy("progress_size","_progressBar","size"),gt.prototype.publishProxy("progress_color","_progressBar","color"),gt.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),gt.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),gt.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),gt.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),gt.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());const 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};const ft=class _FlexGrid extends e.HTMLWidget{constructor(){super()}enter(t,i){super.enter(t,i),e.select(t.parentNode).style("height","100%").style("width","100%")}update(t,e){super.update(t,e);const i=this,s=[];this.updateFlexParent(e);const o=e.selectAll(".FlexGrid-list-item").data(this.widgets(),t=>t.id());o.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(o).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",(t,e)=>{const i=this.widgetsFlexBasis()[e];return void 0!==i?i:this.flexBasis()}).style("flex-grow",(t,e)=>{const i=this.widgetsFlexGrow()[e];return void 0!==i?i:this.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){const t=this.getBoundingClientRect();s.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:s[e][0]-2*i.borderWidth(),height:s[e][1]-2*i.borderWidth()})}),o.exit().remove()}exit(t,e){super.exit(t,e)}updateFlexParent(t){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",()=>this.forceXScroll()||"horizontal"===this.orientation()&&"nowrap"===this.flexWrap()&&!this.disableScroll()?"scroll":"hidden").style("overflow-y",()=>this.forceYScroll()||"vertical"===this.orientation()&&"nowrap"===this.flexWrap()&&!this.disableScroll()?"scroll":"hidden")}};l(ft,"FlexGrid");let _t=ft;function yt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}_t.prototype._class+=" layout_FlexGrid",_t.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),_t.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),_t.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),_t.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),_t.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:l(t=>"nowrap"!==t.flexWrap(),"disable")}),_t.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),_t.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),_t.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),_t.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),_t.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),_t.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),_t.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),_t.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),_t.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),_t.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),_t.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items"),l(yt,"getDefaultExportFromCjs");var bt,wt={exports:{}};function mt(){return bt||(bt=1,wt.exports=function(){var t=l(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()},"GridList");t.cloneItems=function(t,e){var i,s;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(s in e[i]||(e[i]={}),t[i])e[i][s]=t[i][s];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:l(function(){var t,e,i,s=this.grid.length,o="\n #|",l="\n --";for(e=0;e<s;e++)o+=" "+this._padNumber(e," "),l+="---";for(o+=l,e=0;e<this._options.lanes;e++)for(o+="\n"+this._padNumber(e," ")+"|",i=0;i<s;i++)o+=" ",o+=(t=this.grid[i][e])?this._padNumber(this.items.indexOf(t),"0"):"--";return o+="\n"},"toString"),generateGrid:l(function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},"generateGrid"),resizeGrid:l(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 s=this.items[i],o=this._getItemPosition(s);this._updateItemPosition(s,this.findPositionForItem(s,{x:e,y:0})),e=Math.max(e,o.x)}this._pullItemsToLeft()},"resizeGrid"),findPositionForItem:l(function(t,e,i){var s,o,l;for(s=e.x;s<this.grid.length;s++)if(void 0!==i){if(l=[s,i],this._itemFitsAtPosition(t,l))return l}else for(o=e.y;o<this._options.lanes;o++)if(l=[s,o],this._itemFitsAtPosition(t,l))return l;var n=this.grid.length,r=0;return void 0!==i&&this._itemFitsAtPosition(t,[n,i])&&(r=i),[n,r]},"findPositionForItem"),moveItemToPosition:l(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)},"moveItemToPosition"),resizeItem:l(function(t,e){var i=e.w||t.w,s=e.h||t.h;this._updateItemSize(t,i,s),this._resolveCollisions(t),this._pullItemsToLeft()},"resizeItem"),getChangedItems:l(function(t,e){for(var i=[],s=0;s<t.length;s++){var o=this._getItemByAttribute(e,t[s][e]);o.x===t[s].x&&o.y===t[s].y&&o.w===t[s].w&&o.h===t[s].h||i.push(o)}return i},"getChangedItems"),_sortItemsByPosition:l(function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),s=this._getItemPosition(e);return i.x!=s.x?i.x-s.x:i.y!=s.y?i.y-s.y:0}.bind(this))},"_sortItemsByPosition"),_adjustSizeOfItems:l(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)}},"_adjustSizeOfItems"),_resetGrid:l(function(){this.grid=[]},"_resetGrid"),_itemFitsAtPosition:l(function(t,e){var i,s,o=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+o.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+o.w;i++){var l=this.grid[i];if(l)for(s=e[1];s<e[1]+o.h;s++)if(l[s]&&l[s]!==t)return!1}return!0},"_itemFitsAtPosition"),_updateItemPosition:l(function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},"_updateItemPosition"),_updateItemSize:l(function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},"_updateItemSize"),_markItemPositionToGrid:l(function(t){var e,i,s=this._getItemPosition(t);for(this._ensureColumns(s.x+s.w),e=s.x;e<s.x+s.w;e++)for(i=s.y;i<s.y+s.h;i++)this.grid[e][i]=t},"_markItemPositionToGrid"),_deleteItemPositionFromGrid:l(function(t){var e,i,s=this._getItemPosition(t);for(e=s.x;e<s.x+s.w;e++)if(this.grid[e])for(i=s.y;i<s.y+s.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},"_deleteItemPositionFromGrid"),_ensureColumns:l(function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},"_ensureColumns"),_getItemsCollidingWithItem:l(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},"_getItemsCollidingWithItem"),_itemsAreColliding:l(function(t,e){var i=this._getItemPosition(t),s=this._getItemPosition(e);return!(s.x>=i.x+i.w||s.x+s.w<=i.x||s.y>=i.y+i.h||s.y+s.h<=i.y)},"_itemsAreColliding"),_resolveCollisions:l(function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},"_resolveCollisions"),_tryToResolveCollisionsLocally:l(function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var s,o,l,n,r=new t([],this._options);t.cloneItems(this.items,r.items),r.generateGrid();for(var h=0;h<i.length;h++){var a=r.items[i[h]],d=this._getItemPosition(a),p=this._getItemPosition(e);if(s=[p.x-d.w,d.y],o=[p.x+p.w,d.y],l=[d.x,p.y-d.h],n=[d.x,p.y+p.h],r._itemFitsAtPosition(a,s))r._updateItemPosition(a,s);else if(r._itemFitsAtPosition(a,l))r._updateItemPosition(a,l);else if(r._itemFitsAtPosition(a,n))r._updateItemPosition(a,n);else{if(!r._itemFitsAtPosition(a,o))return!1;r._updateItemPosition(a,o)}}return t.cloneItems(r.items,this.items),this.generateGrid(),!0},"_tryToResolveCollisionsLocally"),_pullItemsToLeft:l(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 s=this.items[i],o=this._getItemPosition(s);if(!t||s!=t){var l=this._findLeftMostPositionForItem(s),n=this.findPositionForItem(s,{x:l,y:0},o.y);this._updateItemPosition(s,n)}}},"_pullItemsToLeft"),_findLeftMostPositionForItem:l(function(t){for(var e=0,i=this._getItemPosition(t),s=0;s<this.grid.length;s++)for(var o=i.y;o<i.y+i.h;o++){var l=this.grid[s][o];if(l){var n=this._getItemPosition(l);this.items.indexOf(l)<this.items.indexOf(t)&&(e=n.x+n.w)}}return e},"_findLeftMostPositionForItem"),_getItemByAttribute:l(function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},"_getItemByAttribute"),_padNumber:l(function(t,e){return t>=10?t:e+t},"_padNumber"),_getItemPosition:l(function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},"_getItemPosition"),_setItemPosition:l(function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])},"_setItemPosition")};var e=l(function(t){for(var e=0;e<t;e++)this.push(null)},"GridCol");return e.prototype=[],t}()),wt.exports}l(mt,"requireGridList");var vt=mt();const xt=yt(vt),St=n({__proto__:null,default:xt},[vt]),Ct=St&&xt||St,Tt=class _Grid extends e.HTMLWidget{divItems;gridList;items;itemsMap;origItems;cellWidth;cellHeight;dragItem;dragItemPos;_d3Drag;_d3DragResize;_selectionBag;_scrollBarWidth;constructor(){super(),this._tag="div",this._selectionBag=new e.Utility.Selection(this),this.content([])}getDimensions(){const 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}clearContent(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;let i=e;for(;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))}setContent(t,e,i,s,o,l){if(o=o||1,l=l||1,s=s||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){const n=(new g).gridRow(t).gridCol(e).widget(i).title(s).gridRowSpan(o).gridColSpan(l);this.content().push(n)}return this}sortedContent(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})}getCell(t,e){let i=null;return this.content().some(function(s){return t>=s.gridRow()&&t<s.gridRow()+s.gridRowSpan()&&e>=s.gridCol()&&e<s.gridCol()+s.gridColSpan()&&(i=s,!0)}),i}getWidgetCell(t){let e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e}getContent(t){let e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e}cellToGridItem(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}}gridItemToCell(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)}resetItemsPos(){this.origItems.forEach(function(t){const e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)}initGridList(){this.itemsMap={},this.items=this.content().map(function(t){const e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new Ct(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})}killGridList(){this.gridList=null,delete this.items,delete this.itemsMap}enter(t,i){super.enter(t,i),this._scrollBarWidth=e.Platform.getScrollbarWidth();const s=this;this._d3Drag=e.drag().subject(function(t){const e=s.cellToGridItem(t);return{x:e.x*s.cellWidth,y:e.y*s.cellHeight}}).on("start",function(t){if(!s.designMode())return;e.d3Event().sourceEvent.stopPropagation(),s.initGridList();const o=s.itemsMap[t.id()];s.dragItem=i.append("div").attr("class","dragging").style("transform",function(){return"translate("+o.x*s.cellWidth+"px, "+o.y*s.cellHeight+"px)"}).style("width",function(){return o.w*s.cellWidth-s.gutter()+"px"}).style("height",function(){return o.h*s.cellHeight-s.gutter()+"px"}),s.selectionBagClick(t)}).on("drag",function(t){if(!s.designMode())return;const i=e.d3Event();i.sourceEvent.stopPropagation();const o=s.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+o.w*s.cellWidth>s.snappingColumns()*s.cellWidth&&(i.x=s.snappingColumns()*s.cellWidth-o.w*s.cellWidth),i.y<0&&(i.y=0),i.y+o.h*s.cellWidth>s.snappingRows()*s.cellWidth&&(i.y=s.snappingRows()*s.cellWidth-o.h*s.cellWidth);const l=[Math.max(0,Math.floor((i.x+s.cellWidth/2)/s.cellWidth)),Math.max(0,Math.floor((i.y+s.cellHeight/2)/s.cellHeight))];o.x===l[0]&&o.y===l[1]||("none"!==s.snapping()?(s.resetItemsPos(),s.gridList.moveItemToPosition(o,l)):(o.x=l[0],o.y=l[1]),t.gridCol()===o.x&&t.gridRow()===o.y||(s.items.forEach(s.gridItemToCell),s.updateGrid(!1,100))),s.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return o.w*s.cellWidth+"px"}).style("height",function(){return o.h*s.cellHeight+"px"})}).on("end",function(){s.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),s.dragItem.remove(),s.dragItem=null,s.killGridList())}),this._d3DragResize=e.drag().subject(function(t){const e=s.cellToGridItem(t);return{x:(e.x+e.w-1)*s.cellWidth,y:(e.y+e.h-1)*s.cellHeight}}).on("start",function(t){if(!s.designMode())return;e.d3Event().sourceEvent.stopPropagation(),s.initGridList();const o=s.itemsMap[t.id()];s.dragItem=i.append("div").attr("class","resizing").style("transform",function(){return"translate("+o.x*s.cellWidth+"px, "+o.y*s.cellHeight+"px)"}).style("width",function(){return o.w*s.cellWidth-s.gutter()+"px"}).style("height",function(){return o.h*s.cellHeight-s.gutter()+"px"}),s.dragItemPos={x:o.x,y:o.y}}).on("drag",function(t){if(!s.designMode())return;const i=e.d3Event();i.sourceEvent.stopPropagation();const o=s.itemsMap[t.id()],l=[Math.max(0,Math.round(i.x/s.cellWidth)),Math.max(0,Math.round(i.y/s.cellHeight))],n={w:Math.max(1,l[0]-o.x+1),h:Math.max(1,l[1]-o.y+1)};o.w===n.w&&o.h===n.h||("none"!==s.snapping()?(s.resetItemsPos(),s.gridList.resizeItem(o,n)):(o.w=n.w,o.h=n.h),t.gridColSpan()===o.w&&t.gridRowSpan()===o.h||(s.items.forEach(s.gridItemToCell),s.updateGrid(o.id,100))),s.dragItem.style("width",function(){return(1-o.x)*s.cellWidth+i.x-s.gutter()+"px"}).style("height",function(){return(1-o.y)*s.cellHeight+i.y-s.gutter()+"px"})}).on("end",function(){s.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),s.dragItem.remove(),s.dragItem=null,s.killGridList())})}updateGrid(t,e=0,i=!1){e=e||0;const s=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*s.cellWidth+s.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*s.cellHeight+s.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*s.cellWidth-s.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*s.cellHeight-s.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(s.surfaceShadow()).surfacePadding_default(s.surfacePadding()).surfaceBorderWidth_default(s.surfaceBorderWidth()).surfaceBackgroundColor_default(s.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})}update(t,i){super.update(t,i),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);const s=this.getDimensions(),o=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=o/s.width,this.cellHeight="all"===this.fitTo()?this.height()/s.height:this.cellWidth,this.designMode()){const t=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),e=Math.floor(t);this.cellWidth=e,this.cellHeight=this.cellWidth}const l=this,n=i.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=n.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,s){!l._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===s||l.gridList||(l.initGridList(),"none"!==l.snapping()&&l.gridList.resizeGrid("horizontal"===l.snapping()?l.snappingRows():l.snappingColumns()),l.items.forEach(l.gridItemToCell),l.updateGrid(t.id(),100),l.killGridList())});e.select(this).append("div").attr("class","resizeHandle").call(l._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(n),this.divItems.each(function(t){const i=e.select(this);l.designMode()?i.call(l._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),n.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();const r=i.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);r.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){l.selectionBagClear()}).merge(r).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),r.exit().each(function(){l.selectionBagClear()}).remove();const h=i.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);h.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),h.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"),h.exit().remove()}exit(t,e){this.content().forEach(t=>t.target(null)),super.exit(t,e)}_createSelectionObject(t){return{_id:t._id,element:l(()=>t._element,"element"),widget:t}}selection(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})}selectionBagClear(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())}selectionBagClick(t){if(null!==t){const 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{const t=this._selectionBag.get();1===t.length&&t[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}}postSelectionChange(){}applyLayout(t){this.divItems.each((e,i)=>{if(t[i]){const[s,o,l,n]=t[i];e.gridCol(s).gridRow(o).gridColSpan(l).gridRowSpan(n)}}),this.updateGrid(!0)}vizActivation(t){}};l(Tt,"Grid");let Pt=Tt;Pt.prototype._class+=" layout_Grid",Pt.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),Pt.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:l(t=>!t.designMode(),"disable")}),Pt.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),Pt.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),Pt.prototype.publish("snappingColumns",12,"number","Snapping Columns"),Pt.prototype.publish("snappingRows",16,"number","Snapping Rows"),Pt.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),Pt.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),Pt.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),Pt.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),Pt.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),Pt.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});const zt=class _HorizontalList extends _t{constructor(){super(),this.orientation_default("horizontal"),this.flexWrap_default("nowrap")}};l(zt,"HorizontalList");let Wt=zt;Wt.prototype._class+=" layout_HorizontalList";const Bt=class _Layered extends e.HTMLWidget{_contentContainer;_widgetPlacements;_widgetRatios;constructor(){super(),this._tag="div",this._widgetPlacements=[],this._widgetRatios=[]}addLayer(t,i="default",s=1,o=1){const l=this.widgets();return l.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(l),this._widgetPlacements.push(i),this._widgetRatios.push([s,o]),this}enter(t,e){super.enter(t,e),this._contentContainer=e.append("div").attr("class","container")}update(t,e){super.update(t,e);const i=this;e.style("padding",this.surfacePadding()+"px");const s=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});s.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(s).each(function(t,e){const s={width:i.clientWidth(),height:i.clientHeight()},o=i.widgetSize(e,s),l=i.widgetPosition(e,s,o);this.style.top=l.y+"px",this.style.left=l.x+"px",t.resize(o).render()}),s.exit().each(function(t,e){t.target(null)}).remove(),s.order()}widgetSize(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}}widgetPosition(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}}}};l(Bt,"Layered");let It=Bt;It.prototype._class+=" layout_Layered",It.prototype.publish("surfacePadding",0,"number","Padding"),It.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});const At=class _Popup extends e.HTMLWidget{_surfaceButtons;_originalPosition;constructor(){super(),this._tag="div",this._surfaceButtons=[]}updateState(t){t=t||!this.popupState(),this.popupState(t).render()}enter(t,e){super.enter(t,e),this.widget().target(t),this._originalPosition=this.position()}update(t,e){super.update(t,e),e.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())}postUpdate(t,e){let i,s;switch(this.centerPopup()){case"container":this._placeholderElement&&(i=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,s=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":i=window.innerWidth/2-this.widget().width()/2,s=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:i=0,s=0,this.position(this._originalPosition)}this.pos({x:i,y:s}),super.postUpdate(t,e),e.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}click(t){}};l(At,"Popup");let Ht=At;Ht.prototype._class+=" layout_Popup",Ht.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),Ht.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,{}),Ht.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),Ht.prototype.publish("top",null,"number","Top position property of popup",null,{}),Ht.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),Ht.prototype.publish("left",null,"number","Left position property of popup",null,{}),Ht.prototype.publish("right",null,"number","Right position property of popup",null,{}),Ht.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),Ht.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});const Mt=class _Tabbed extends e.HTMLWidget{_tabContainer;_contentContainer;constructor(){super(),this._tag="div"}clearTabs(){return this.labels([]),this.widgets([]),this}addTab(t,i,s,o){const l=t.size();0===l.width&&0===l.height&&t.size({width:"100%",height:"100%"});const n=this.labels(),r=this.widgets();s&&this.activeTabIdx(this.widgets().length),n.push(i);const h=(new c).widget(t||(new e.Text).text("No widget defined for tab"));return r.push(h),this.labels(n),this.widgets(r),o&&o(h),this}widgetSize(t){const e=this.clientWidth();let i=this.clientHeight();const s=this._tabContainer.node().getBoundingClientRect();return void 0!==s.height&&(i-=s.height),{width:e,height:i}}enter(t,e){super.enter(t,e),this._tabContainer=e.append("div"),this._contentContainer=e.append("div")}update(t,i){super.update(t,i);const s=this;i.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);const o=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});o.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){s.click(s.widgets()[e].widget(),t,e),s.activeTabIdx(e).render()}).merge(o).classed("active",function(t,e){return s.activeTabIdx()===e}).text(function(t){return t}),o.exit().remove();const l=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});if(l.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(l).classed("active",function(t,e){return s.activeTabIdx()===e}).style("display",function(t,e){return s.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(s.activeTabIdx()===i),s.activeTabIdx()===i){const i=s.widgetSize(e.select(this));t.surfaceBorderWidth(s.showTabs()?null:0).surfacePadding(s.showTabs()?null:0).resize(i)}}),l.exit().each(function(t,e){t.target(null)}).remove(),"bottom"===this.tabLocation())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");else 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")}click(t,e,i){}};l(Mt,"Tabbed");let Ft=Mt;Ft.prototype._class+=" layout_Tabbed",Ft.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),Ft.prototype.publish("surfacePadding",4,"number","Padding"),Ft.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),Ft.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),Ft.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),Ft.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});const kt=class _Toolbar extends e.HTMLWidget{constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e)}update(t,i){super.update(t,i);const s=this;i.attr("title",s.title()).style("background-color",this.backgroundColor());const o=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);o.enter().append("div").classed("toolbar-title",!0).append("span"),o.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(s.title()),o.exit().remove();const l=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});l.enter().insert("div","div.toolbar-title").each(function(t,i){const o=s.widgetClasses()[i]?s.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(o,!0),t.target(this)}),l.exit().each(function(t){t.target(null)}).remove(),l.order()}render(t){const e=this;return super.render(function(i){const s=e.element().node().getBoundingClientRect();let o=s.left+s.width;e.element().selectAll("div.toolbar-child").each(function(t,e){const i=this.getBoundingClientRect();o>i.left&&(o=i.left)}),e.element().select(".toolbar-title").style("width",o-s.left-4+"px"),t&&t(i)})}exit(t,e){this.widgets().forEach(function(t){t.target(null)}),super.exit(t,e)}};l(kt,"Toolbar");let Ot=kt;Ot.prototype._class+=" layout_Toolbar",Ot.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),Ot.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),Ot.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),Ot.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),Ot.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),Ot.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]});const Lt=class _VerticalList extends _t{constructor(){super(),this.orientation_default("vertical"),this.flexWrap_default("nowrap")}};l(Lt,"VerticalList");let Dt=Lt;Dt.prototype._class+=" layout_VerticalList",t.AbsoluteSurface=h,t.Accordion=d,t.BUILD_VERSION="3.16.0",t.Border=_,t.Border2=m,t.Carousel=x,t.Cell=g,t.ChartPanel=gt,t.FlexGrid=_t,t.Grid=Pt,t.HorizontalList=Wt,t.Layered=It,t.Legend=dt,t.Modal=ct,t.PKG_NAME="@hpcc-js/layout",t.PKG_VERSION="3.4.2",t.Popup=Ht,t.Surface=c,t.Tabbed=Ft,t.Toolbar=Ot,t.VerticalList=Dt,t.WidgetDiv=b,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.umd.cjs.map
3
3
  !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{position:relative;overflow:hidden;pointer-events:all}.layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0px;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%}.layout_Accordion>.collapsible-title{font-size:13px;color:#fff;padding:4px 8px;height:26px;-webkit-box-shadow:inset 0px -1px 1px 0px rgba(0,0,0,.2);-moz-box-shadow:inset 0px -1px 1px 0px rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px #0003}.layout_Accordion li{background-color:#fff}.layout_Accordion>ul,.layout_Accordion>.collapsible-title{background-color:#333}.layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion>.collapsible-title{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#ddd}.layout_Accordion>ul,.layout_Accordion>span{padding-left:0}.layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion>span{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}.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 #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.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:"";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:""}div[draggable=true].hideDragCellContent.content-icon-Pie:before{top:calc(50% - 72px);left:calc(50% - 45px);content:""}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before,div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before{content:""}div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before{content:""}.layout_Cell .update-indicator{box-sizing:border-box;position:absolute;top:0;left:0;padding:0;z-index:1000;border-width:0px;border-style:solid;pointer-events:none}.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_top,.layout_Border>.borderHandle_bottom{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:0px;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_n,.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_ne,.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,#0000,#0000 4px,#6464641a 4px 8px)}.layout_Border .grid-drop-target.drop-target-over{border:2px dashed #179BD7;background:repeating-linear-gradient(-45deg,#0000,#0000 6px,#119bd71a 6px 12px)}.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>.header{display:block}.layout_Border2>.footer{display:block}.layout_Carousel>div{position:relative;overflow:hidden}.layout_Carousel>div>.carouselItem{position:absolute}.layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-y:scroll;overflow-x:hidden}.layout_Modal-title,.layout_Modal-annotations{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}.layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}.layout_FlexGrid{display:flex}.FlexGrid-list-item{overflow:hidden;border-style:solid;flex-grow:1}.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-style:solid;border-left-width:0px;border-top-width:0px;border-right-width:2px;border-bottom-width:2px;border-color:#a9a9a9;background-color:none;position:absolute}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{border-style:solid;border-width:1px;border-color:gray;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px 8px)}.layout_Grid>.resizing{border-style:solid;border-width:1px;border-color:gray;background-color:orange;border-radius:0;position:absolute;opacity:.3;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,orange 4px 8px)}.layout_Grid>.ddCell.draggable .common_Widget.selected{border-style:solid;border-width:1px;border-color:red;background-color:gray;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6400001a 4px 8px)}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}.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}.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}.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}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();