Home
last modified time | relevance | path

Searched refs:colIndex (Results 1 – 19 of 19) sorted by relevance

/plugin/prosemirror/parser/
DTableRowNode.php27 for ($colIndex = 1; $colIndex <= $numColsInTable; $colIndex += $colSpan) {
28 if (!empty($rowSpans[$colIndex])) {
30 --$rowSpans[$colIndex];
41 $rowSpans[$colIndex + $colSpanIndex] = $rowSpan - 1;
/plugin/tablelayout/script/
Dtablelayout_functions.js169 var colIndex = 0;
171 colIndex += this.colSpan;
176 if ($rowCells.length === colIndex) {
179 $rowCells.eq(colIndex).before($cell.clone(true, true));
Dscript.js84 var colIndex = $this.closest('td,th').prevAll('td,th').length;
85 … var sortedRows = window.tablelayout.sortTable($rowsToBeSorted.detach(), colIndex, sortDirection);
/plugin/fckg/fckeditor/editor/plugins/dragresizetable/
Dfckplugin.js166 colIndex = FCKDragTableHandler._GetResizeBarPosition() ;
169 colIndex-- ;
172 colArray[colIndex].width += deltaX ;
173 colArray[colIndex + 1].width -= deltaX ;
/plugin/wysiwyg/fckeditor/editor/plugins/dragresizetable/
Dfckplugin.js164 colIndex = FCKDragTableHandler._GetResizeBarPosition() ;
167 colIndex-- ;
170 colArray[colIndex].width += deltaX ;
171 colArray[colIndex + 1].width -= deltaX ;
/plugin/searchtablejs/TableFilter_EN/
Dtablefilter.js803 var colIndex = t.tf_colOperation["col"];
809 && (typeof colIndex).toLowerCase()=="object"
818 for(var k=0; k<colIndex.length; k++)//this retrieves col values
820 colvalues.push( getColValues(id,colIndex[k],true) );
/plugin/searchtablejs/
Dtablefilter.js803 var colIndex = t.tf_colOperation["col"];
809 && (typeof colIndex).toLowerCase()=="object"
818 for(var k=0; k<colIndex.length; k++)//this retrieves col values
820 colvalues.push( getColValues(id,colIndex[k],true) );
/plugin/mdimport/
H A DMarkdownToDokuWiki.php269 foreach ($row as $colIndex => $cell) {
/plugin/datatables/assets/pdfmake/
Dpdfmake.js72427 for (var colIndex = 0; colIndex < row.length; colIndex++) {
72428 var cell = row[colIndex];
72437 setBorder(rowIndex + rowOffset, colIndex, 0, cell.border[0]);
72442 setBorder(rowIndex + rowOffset, colIndex + colSpan - 1, 2, cell.border[2]);
72449 setBorder(rowIndex, colIndex + colOffset, 1, cell.border[1]);
72454 setBorder(rowIndex + rowSpan - 1, colIndex + colOffset, 3, cell.border[3]);
72462 function setBorder(rowIndex, colIndex, borderIndex, borderValue) {
72463 var cell = body[rowIndex][colIndex];
72745 var colIndex = xs[i].index;
72748 if (colIndex < body[rowIndex].length) {
[all …]
/plugin/davcal/fullcalendar-3.10.5/
H A Dfullcalendar.js13166 var colIndex = colCoordCache.getHorizontalIndex(leftOffset);
13168 if (colIndex != null && slatIndex != null) {
13177 col: colIndex,
13180 left: colCoordCache.getLeftOffset(colIndex),
13181 right: colCoordCache.getRightOffset(colIndex),
/plugin/yuriigantt/3rd/dhtmlxgantt/sources/
Ddhtmlxgantt.js8053 var upper, lower, colIndex;
8057 colIndex = Math.floor(gantt.columnIndexByDate(date));
8059 if (!scale.trace_x[colIndex]) {
8060 colIndex -= 1;// end of time scale
8062 colIndex = 0;
8065 lower = new Date(scale.trace_x[colIndex]);
8068 colIndex = Math.floor(gantt.columnIndexByDate(date));
8071 if (scale.trace_x[colIndex]) {
8072 upper = gantt.date[unit + "_start"](scale.trace_x[colIndex]);// end of time scale
/plugin/edittable/lib/
Dhandsontable.full.js47202 for (var colIndex = 0; colIndex < colCount; colIndex++) {
47203 var cellData = instance.getDataAtCell(rowIndex, colIndex);
47204 var cellProperties = instance.getCellMeta(rowIndex, colIndex);
47212 col: colIndex,
47220 cellCallback(instance, rowIndex, colIndex, cellData, testResult);
/plugin/zwidoku/files/
H A Djs.js1colIndex=0;colIndex<colCount;colIndex++){var cellData=instance.getDataAtCell(rowIndex,colIndex);va…
/plugin/xlsx2dw/packages/exceljs/
Dexceljs.js3817 value: function getColumn(colIndex) {
3818 var column = this.table.columns[colIndex];
3819 return new Column(this, column, colIndex);
3823 value: function addColumn(column, values, colIndex) {
3828 if (colIndex === undefined) {
3834 this.table.columns.splice(colIndex, 0, column);
3836 row.splice(colIndex, 0, values[i]);
3842 value: function removeColumns(colIndex) {
3846 this.table.columns.splice(colIndex, count);
3848 row.splice(colIndex, count);
/plugin/amcharts/assets/amcharts/plugins/export/libs/pdfmake/
Dpdfmake.js16927 var colIndex = xs[i].index;
16928 var fillColor= this.tableNode.table.body[rowIndex][colIndex].fillColor;
16930 var wBorder = this.layout.vLineWidth(colIndex, this.tableNode);
Dpdfmake.min.js.map1colIndex","wBorder","xf","yf","hLineWhenBroken","headerRepeatable","PDFDocument","PDFObject","PDFP…
/plugin/bpmnio/vendor/dmn-js/dist/
H A Ddmn-modeler.production.min.js265 `,mk={width:135,height:46},gk={width:100,height:63};function Lx(n,e,t){return Q("path",{d:n,strokeWidth:2,transform:`translate(${e.x}, ${e.y})`,...t})}var Dm=5;function Ja(n,e){this._styles=e,n.registerProvider(this)}Ja.$inject=["outline","styles"];Ja.prototype.getOutline=function(n){let e=this._styles.cls("djs-outline",["no-fill"]);var t;return O(n,"dmn:InputData")?(t=Q("rect"),j(t,T({x:-Dm,y:-Dm,rx:27,width:n.width+Dm*2,height:n.height+Dm*2},e))):O(n,"dmn:BusinessKnowledgeModel")&&yk(n,"dmn:BusinessKnowledgeModel")?t=Lx(dk,{x:-6,y:-6},e):O(n,"dmn:KnowledgeSource")&&yk(n,"dmn:KnowledgeSource")&&(t=Lx(pk,{x:-6,y:-1.5},e)),t};Ja.prototype.updateOutline=function(n){return!!Ge(n,["dmn:InputData","dmn:BusinessKnowledgeModel","dmn:KnowledgeSource"])};function yk(n,e){var t;return e==="dmn:BusinessKnowledgeModel"?t=mk:e==="dmn:KnowledgeSource"&&(t=gk),n.width===t.width&&n.height===t.height}var vk={__depends__:[Tm],__init__:["outlineProvider"],outlineProvider:["type",Ja]};var bk=".djs-palette-toggle",_k=".entry",XF=bk+", "+_k,Bx="djs-palette-",YF="shown",Nx="open",xk="two-column",ZF=1e3;function nt(n,e){this._eventBus=n,this._canvas=e;var t=this;n.on("tool-manager.update",function(i){var r=i.tool;t.updateToolHighlight(r)}),n.on("i18n.changed",function(){t._update()}),n.on("diagram.init",function(){t._diagramInitialized=!0,t._rebuild()})}nt.$inject=["eventBus","canvas"];nt.prototype.registerProvider=function(n,e){e||(e=n,n=ZF),this._eventBus.on("palette.getProviders",n,function(t){t.providers.push(e)}),this._rebuild()};nt.prototype.getEntries=function(){var n=this._getProviders();return n.reduce(e3,{})};nt.prototype._rebuild=function(){if(this._diagramInitialized){var n=this._getProviders();n.length&&(this._container||this._init(),this._update())}};nt.prototype._init=function(){var n=this,e=this._eventBus,t=this._getParentContainer(),i=this._container=te(nt.HTML_MARKUP);t.appendChild(i),ee(t).add(Bx+YF),_t.bind(i,XF,"click",function(r){var o=r.delegateTarget;if(hr(o,bk))return n.toggle();n.trigger("click",r)}),q.bind(i,"mousedown",function(r){r.stopPropagation()}),_t.bind(i,_k,"dragstart",function(r){n.trigger("dragstart",r)}),e.on("canvas.resized",this._layoutChanged,this),e.fire("palette.create",{container:i})};nt.prototype._getProviders=function(n){var e=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};nt.prototype._toggleState=function(n){n=n||{};var e=this._getParentContainer(),t=this._container,i=this._eventBus,r,o=ee(t),s=ee(e);"twoColumn"in n?r=n.twoColumn:r=this._needsCollapse(e.clientHeight,this._entries||{}),o.toggle(xk,r),s.toggle(Bx+xk,r),"open"in n&&(o.toggle(Nx,n.open),s.toggle(Bx+Nx,n.open)),i.fire("palette.changed",{twoColumn:r,open:this.isOpen()})};nt.prototype._update=function(){var n=X(".djs-palette-entries",this._container),e=this._entries=this.getEntries();no(n),k(e,function(t,i){var r=t.group||"default",o=X("[data-group="+Sa(r)+"]",n);o||(o=te('<div class="group"></div>'),et(o,"data-group",r),n.appendChild(o));var s=t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=te(s);if(o.appendChild(a),!t.separator&&(et(a,"data-action",i),t.title&&et(a,"title",t.title),t.className&&JF(a,t.className),t.imageUrl)){var l=te("<img>");et(l,"src",t.imageUrl),a.appendChild(l)}}),this.open()};nt.prototype.trigger=function(n,e,t){var i,r,o=e.delegateTarget||e.target;return o?(i=et(o,"data-action"),r=e.originalEvent||e,this.triggerEntry(i,n,r,t)):e.preventDefault()};nt.prototype.triggerEntry=function(n,e,t,i){var r=this._entries,o,s;if(o=r[n],!!o&&(s=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:t})!==!1)){if(ge(s)){if(e==="click")return s(t,i)}else if(s[e])return s[e](t,i);t.preventDefault()}};nt.prototype._layoutChanged=function(){this._toggleState({})};nt.prototype._needsCollapse=function(n,e){var t=50,i=Object.keys(e).length*46;return n<i+t};nt.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})};nt.prototype.open=function(){this._toggleState({open:!0})};nt.prototype.toggle=function(){this.isOpen()?this.close():this.open()};nt.prototype.isActiveTool=function(n){return n&&this._activeTool===n};nt.prototype.updateToolHighlight=function(n){var e,t;this._toolsContainer||(e=X(".djs-palette-entries",this._container),this._toolsContainer=X("[data-group=tools]",e)),t=this._toolsContainer,k(t.children,function(i){var r=i.getAttribute("data-action");if(r){var o=ee(i);r=r.replace("-tool",""),o.contains("entry")&&r===n?o.add("highlighted-entry"):o.remove("highlighted-entry")}})};nt.prototype.isOpen=function(){return ee(this._container).has(Nx)};nt.prototype._getParentContainer=function(){return this._canvas.getContainer()};nt.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function JF(n,e){var t=ee(n),i=F(e)?e:e.split(/\s+/g);i.forEach(function(r){t.add(r)})}function e3(n,e){var t=e.getPaletteEntries();return ge(t)?t(n):(k(t,function(i,r){n[r]=i}),n)}var wk={__init__:["palette"],palette:["type",nt]};var t3=250;function Pr(n){this._eventBus=n,this._tools=[],this._active=null}Pr.$inject=["eventBus"];Pr.prototype.registerTool=function(n,e){var t=this._tools;if(!e)throw new Error(`A tool has to be registered with it's "events"`);t.push(n),this.bindEvents(n,e)};Pr.prototype.isActive=function(n){return n&&this._active===n};Pr.prototype.length=function(n){return this._tools.length};Pr.prototype.setActive=function(n){var e=this._eventBus;this._active!==n&&(this._active=n,e.fire("tool-manager.update",{tool:n}))};Pr.prototype.bindEvents=function(n,e){var t=this._eventBus,i=[];t.on(e.tool+".init",function(r){var o=r.context;if(!o.reactivate&&this.isActive(n)){this.setActive(null);return}this.setActive(n)},this),k(e,function(r){i.push(r+".ended"),i.push(r+".canceled")}),t.on(i,t3,function(r){this._active&&(n3(r)||this.setActive(null))},this)};function n3(n){var e=n.originalEvent&&n.originalEvent.target;return e&&De(e,'.group[data-group="tools"]')}var Im={__depends__:[gn],__init__:["toolManager"],toolManager:["type",Pr]};function Hf(n){var e=this;this._lastMoveEvent=null;function t(i){e._lastMoveEvent=i}n.on("canvas.init",function(i){var r=e._svg=i.svg;r.addEventListener("mousemove",t)}),n.on("canvas.destroy",function(){e._lastMouseEvent=null,e._svg.removeEventListener("mousemove",t)})}Hf.$inject=["eventBus"];Hf.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||i3(0,0)};function i3(n,e){var t=document.createEvent("MouseEvent"),i=n,r=e,o=n,s=e;return t.initMouseEvent&&t.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,s,!1,!1,!1,!1,0,null),t}var Lm={__init__:["mouse"],mouse:["type",Hf]};var Sk="crosshair",Ck="selected",r3="djs-dragging-active-lasso";function Ui(n,e,t,i,r,o,s){this._selection=r,this._dragging=t,this._mouse=s;var a=this,l={create:function(f){var h=e.getActiveLayer(),d=f.frame=Q("rect");j(d,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),K(h,d),c(!0),this.update(f)},update:function(f){var h=f.frame,d=f.bbox;h&&d&&j(h,{x:d.x,y:d.y,width:d.width,height:d.height});var p=f.marked,m=f.lastMarked;if(p&&m){for(let g of m)p.has(g)||e.removeMarker(g,Ck);for(let g of p)m.has(g)||e.addMarker(g,Ck)}},remove:function(f){this.update(f),f.frame&&Fe(f.frame),c(!1)}};function c(f){ne(e.getContainer()).toggle(r3,f)}function u(f){var h=i.getAll();return new Set(Wu(wv(h,f)))}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),n.on("lasso.selection.end",function(f){var h=f.originalEvent.target;!f.hover&&!(h instanceof SVGElement)||n.once("lasso.selection.ended",function(){a.activateLasso(f.originalEvent,!0)})}),n.on("lasso.end",0,function(f){var h=f.context;a._select(Array.from(h.marked))}),n.on("lasso.start",function(f){var h=f.context;h.bbox=Ek(f),h.add=df(f),h.lastMarked=new Set(r.get()),h.add?h.marked=h.lastMarked:h.marked=new Set,h.initialMarked=h.marked,l.create(h)}),n.on("lasso.move",function(f){var h=f.context,d=h.bbox=Ek(f),p=u(d),m=h.initialMarked.union(p);h.lastMarked=h.marked,h.marked=m,l.update(h)}),n.on("lasso.cleanup",function(f){var h=f.context;h.lastMarked=h.marked,h.marked=new Set(r.get()),l.remove(f.context)}),n.on("element.mousedown",1500,function(f){if(df(f))return a.activateLasso(f.originalEvent),!0})}Ui.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"];Ui.prototype.activateLasso=function(n,e){this._dragging.init(n,"lasso",{autoActivate:e,cursor:Sk,data:{context:{}},keepSelection:!0})};Ui.prototype.activateSelection=function(n,e){this._dragging.init(n,"lasso.selection",{trapClick:!1,autoActivate:e,cursor:Sk,data:{context:{}},keepSelection:!0})};Ui.prototype._select=function(n){this._selection.select(n)};Ui.prototype.select=function(n,e,t=[]){var i=Wu(wv(n,e));this._select([...t,...i])};Ui.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var n=this._mouse.getLastMoveEvent();this.activateSelection(n,!!n)};Ui.prototype.isActive=function(){var n=this._dragging.context();return n&&/^lasso/.test(n.prefix)};function Ek(n){var e={x:n.x-n.dx,y:n.y-n.dy},t={x:n.x,y:n.y},i;return e.x<=t.x&&e.y<t.y||e.x<t.x&&e.y<=t.y?i={x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:e.x>=t.x&&e.y<t.y||e.x>t.x&&e.y<=t.y?i={x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x<=t.x&&e.y>t.y||e.x<t.x&&e.y>=t.y?i={x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:e.x>=t.x&&e.y>t.y||e.x>t.x&&e.y>=t.y?i={x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:i={x:t.x,y:t.y,width:0,height:0},i}var Ok={__depends__:[Im,Lm],__init__:["lassoTool"],lassoTool:["type",Ui]};var $x=1500,Rk="grab";function Eo(n,e,t,i,r,o){this._dragging=t,this._mouse=o;var s=this,a=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),n.on("element.mousedown",$x,function(l){if(hf(l))return s.activateMove(l.originalEvent,!0),!1}),a&&a.addListener($x,function(l){if(!(!kk(l.keyEvent)||s.isActive())){var c=s._mouse.getLastMoveEvent();s.activateMove(c,!!c)}},"keyboard.keydown"),a&&a.addListener($x,function(l){!kk(l.keyEvent)||!s.isActive()||s.toggle()},"keyboard.keyup"),n.on("hand.end",function(l){var c=l.originalEvent.target;if(!l.hover&&!(c instanceof SVGElement))return!1;n.once("hand.ended",function(){s.activateMove(l.originalEvent,{reactivate:!0})})}),n.on("hand.move.move",function(l){var c=e.viewbox().scale;e.scroll({dx:l.dx*c,dy:l.dy*c})}),n.on("hand.move.end",function(l){var c=l.context,u=c.reactivate;return!hf(l)&&u&&n.once("hand.move.ended",function(f){s.activateHand(f.originalEvent,!0,!0)}),!1})}Eo.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];Eo.prototype.activateMove=function(n,e,t){typeof e=="object"&&(t=e,e=!1),this._dragging.init(n,"hand.move",{autoActivate:e,cursor:Rk,data:{context:t||{}}})};Eo.prototype.activateHand=function(n,e,t){this._dragging.init(n,"hand",{trapClick:!1,autoActivate:e,cursor:Rk,data:{context:{reactivate:t}}})};Eo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var n=this._mouse.getLastMoveEvent();this.activateHand(n,!!n)};Eo.prototype.isActive=function(){var n=this._dragging.context();return n?/^(hand|hand\.move)$/.test(n.prefix):!1};function kk(n){return Ve("Space",n)}var Tk={__depends__:[Im,Lm],__init__:["handTool"],handTool:["type",Eo]};function zf(n,e,t,i,r,o){this._palette=n,this._create=e,this._elementFactory=t,this._handTool=i,this._lassoTool=r,this._translate=o,n.registerProvider(this)}zf.$inject=["palette","create","elementFactory","handTool","lassoTool","translate"];zf.prototype.getPaletteEntries=function(n){var e={},t=this._create,i=this._elementFactory,r=this._handTool,o=this._lassoTool,s=this._translate;function a(l,c,u,f,h){function d(p){var m=i.createShape(T({type:l},h));t.start(p,m)}return{group:c,className:u,title:f,action:{dragstart:d,click:d}}}return T(e,{"hand-tool":{group:"tools",className:"dmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){r.activateHand(l)}}},"lasso-tool":{group:"tools",className:"dmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){o.activateSelection(l)}}},"tool-separator":{group:"tools",separator:!0},"create.decision":a("dmn:Decision","drd","dmn-icon-decision",s("Create decision")),"create.input-data":a("dmn:InputData","drd","dmn-icon-input-data",s("Create input data")),"create.knowledge-source":a("dmn:KnowledgeSource","drd","dmn-icon-knowledge-source",s("Create knowledge source")),"create.business-knowledge-model":a("dmn:BusinessKnowledgeModel","drd","dmn-icon-business-knowledge",s("Create knowledge model"))}),e};var Ak={__depends__:[qe,wk,Zp,Ok,Tk],__init__:["paletteProvider"],paletteProvider:["type",zf]};var Nm=Math.max,$m=Math.min,o3=20;function Mk(n,e,t){var i=t.x,r=t.y,o={x:n.x,y:n.y,width:n.width,height:n.height};return e.indexOf("n")!==-1?(o.y=n.y+r,o.height=n.height-r):e.indexOf("s")!==-1&&(o.height=n.height+r),e.indexOf("e")!==-1?o.width=n.width+i:e.indexOf("w")!==-1&&(o.x=n.x+i,o.width=n.width-i),o}function Bm(n,e,t){var i=e[n],r=t.min&&t.min[n],o=t.max&&t.max[n];return se(r)&&(i=(/top|left/.test(n)?$m:Nm)(i,r)),se(o)&&(i=(/top|left/.test(n)?Nm:$m)(i,o)),i}function Pk(n,e){if(!e)return n;var t=G(n);return Ov({top:Bm("top",t,e),right:Bm("right",t,e),bottom:Bm("bottom",t,e),left:Bm("left",t,e)})}function Dk(n,e,t,i){var r=G(e),o={top:/n/.test(n)?r.bottom-t.height:r.top,left:/w/.test(n)?r.right-t.width:r.left,bottom:/s/.test(n)?r.top+t.height:r.bottom,right:/e/.test(n)?r.left+t.width:r.right},s=i?G(i):o,a={top:$m(o.top,s.top),left:$m(o.left,s.left),bottom:Nm(o.bottom,s.bottom),right:Nm(o.right,s.right)};return Ov(a)}function Wf(n,e){return typeof n!="undefined"?n:o3}function s3(n,e){var t,i,r,o;return typeof e=="object"?(t=Wf(e.left),i=Wf(e.right),r=Wf(e.top),o=Wf(e.bottom)):t=i=r=o=Wf(e),{x:n.x-t,y:n.y-r,width:n.width+t+i,height:n.height+r+o}}function a3(n){return!(n.waypoints||n.type==="label")}function Ik(n,e){var t;if(n.length===void 0?t=Ee(n.children,a3):t=n,t.length)return s3(Tt(t),e)}var Lk=10;function ks(n,e,t,i){this._dragging=i,this._rules=e;var r=this;function o(l,c){var u=l.shape,f=l.direction,h=l.resizeConstraints,d;l.delta=c,d=Mk(u,f,c),l.newBounds=Pk(d,h),l.canExecute=r.canResize(l)}function s(l){var c=l.resizeConstraints,u=l.minBounds;c===void 0&&(u===void 0&&(u=r.computeMinResizeBox(l)),l.resizeConstraints={min:G(u)})}function a(l){var c=l.shape,u=l.canExecute,f=l.newBounds;if(u){if(f=F1(f),!l3(c,f))return;t.resizeShape(c,f)}}n.on("resize.start",function(l){s(l.context)}),n.on("resize.move",function(l){var c={x:l.dx,y:l.dy};o(l.context,c)}),n.on("resize.end",function(l){a(l.context)})}ks.prototype.canResize=function(n){var e=this._rules,t=hn(n,["newBounds","shape","delta","direction"]);return e.allowed("shape.resize",t)};ks.prototype.activate=function(n,e,t){var i=this._dragging,r,o;if(typeof t=="string"&&(t={direction:t}),r=T({shape:e},t),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(n,jx(e,o),"resize",{autoActivate:!0,cursor:c3(o),data:{shape:e,context:r}})};ks.prototype.computeMinResizeBox=function(n){var e=n.shape,t=n.direction,i,r;return i=n.minDimensions||{width:Lk,height:Lk},r=Ik(e,n.childrenBoxPadding),Dk(t,e,i,r)};ks.$inject=["eventBus","rules","modeling","dragging"];function l3(n,e){return n.x!==e.x||n.y!==e.y||n.width!==e.width||n.height!==e.height}function jx(n,e){var t=le(n),i=G(n),r={x:t.x,y:t.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function c3(n){var e="resize-";return n==="n"||n==="s"?e+"ns":n==="e"||n==="w"?e+"ew":n==="nw"||n==="se"?e+"nwse":e+"nesw"}var Bk="djs-resizing",Nk="resize-not-ok",u3=500;function jm(n,e,t){function i(o){var s=o.shape,a=o.newBounds,l=o.frame;l||(l=o.frame=t.addFrame(s,e.getActiveLayer()),e.addMarker(s,Bk)),a.width>5&&j(l,{x:a.x,width:a.width}),a.height>5&&j(l,{y:a.y,height:a.height}),o.canExecute?ne(l).remove(Nk):ne(l).add(Nk)}function r(o){var s=o.shape,a=o.frame;a&&Fe(o.frame),e.removeMarker(s,Bk)}n.on("resize.move",u3,function(o){i(o.context)}),n.on("resize.cleanup",function(o){r(o.context)})}jm.$inject=["eventBus","canvas","previewSupport"];var Fm=-6,qm=8,Vm=20,Uf="djs-resizer",f3=["n","w","s","e","nw","ne","se","sw"];function Qi(n,e,t,i){this._resize=i,this._canvas=e;var r=this;n.on("selection.changed",function(o){var s=o.newSelection;r.removeResizers(),s.length===1&&k(s,at(r.addResizer,r))}),n.on("shape.changed",function(o){var s=o.element;t.isSelected(s)&&(r.removeResizers(),r.addResizer(s))})}Qi.prototype.makeDraggable=function(n,e,t){var i=this._resize;function r(o){Sn(o)&&i.activate(o,n,t)}q.bind(e,"mousedown",r),q.bind(e,"touchstart",r)};Qi.prototype._createResizer=function(n,e,t,i){var r=this._getResizersParent(),o=h3(i),s=Q("g");ne(s).add(Uf),ne(s).add(Uf+"-"+n.id),ne(s).add(Uf+"-"+i),K(r,s);var a=Q("rect");j(a,{x:-qm/2+o.x,y:-qm/2+o.y,width:qm,height:qm}),ne(a).add(Uf+"-visual"),K(s,a);var l=Q("rect");return j(l,{x:-Vm/2+o.x,y:-Vm/2+o.y,width:Vm,height:Vm}),ne(l).add(Uf+"-hit"),K(s,l),iC(s,e,t),s};Qi.prototype.createResizer=function(n,e){var t=jx(n,e),i=this._createResizer(n,t.x,t.y,e);this.makeDraggable(n,i,e)};Qi.prototype.addResizer=function(n){var e=this;Xe(n)||k(f3,function(t){e._resize.canResize({shape:n,direction:t})&&e.createResizer(n,t)})};Qi.prototype.removeResizers=function(){var n=this._getResizersParent();ss(n)};Qi.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};Qi.$inject=["eventBus","canvas","selection","resize"];function h3(n){var e={x:0,y:0};return n.indexOf("e")!==-1?e.x=-Fm:n.indexOf("w")!==-1&&(e.x=Fm),n.indexOf("s")!==-1?e.y=-Fm:n.indexOf("n")!==-1&&(e.y=Fm),e}var $k={__depends__:[yn,gn,ka],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ks],resizePreview:["type",jm],resizeHandles:["type",Qi]};var d3="reconnectStart",p3="reconnectEnd",m3=2e3;function Hm(n){n.on(["bendpoint.move.move","bendpoint.move.end"],m3,function(e){var t=e.context,i=t.allowed,r=t.hover,o=t.source,s=t.target,a=t.type;if(t.hints||(t.hints={}),delete t.hints.connectionStart,delete t.hints.connectionEnd,!(i&&i.type!=="dmn:InformationRequirement")&&!(!r||!Ge(r,["dmn:Decision","dmn:InputData"]))&&o!==s){var l=a===d3||a===p3,c=vt(o,s);l&&r===o?(g3(e,c),t.hints.connectionEnd=Fk(s,c)):l&&r===s&&(t.hints.connectionStart=jk(o,c),y3(e,c))}})}Hm.$inject=["eventBus"];function jk(n,e){var t=G(n),i=le(n);return e.includes("bottom")?i.y=t.top:e.includes("top")?i.y=t.bottom:e.includes("right")?i.x=t.left:i.x=t.right,i}function Fk(n,e){var t=G(n),i=le(n);return e.includes("bottom")?i.y=t.bottom:e.includes("top")?i.y=t.top:e.includes("right")?i.x=t.right:i.x=t.left,i}function g3(n,e){var t=n.context,i=t.source,r=jk(i,e),o=n.x-r.x,s=n.y-r.y;n.x-=o,n.y-=s,n.dx-=o,n.dy-=s}function y3(n,e){var t=n.context,i=t.target,r=Fk(i,e),o=0,s=0;e.includes("top")||e.includes("bottom")?s=n.y-r.y:o=n.x-r.x,n.x-=o,n.y-=s,n.dx-=o,n.dy-=s}var v3=250;function zm(n){n.on(["connect.hover","connect.move","connect.end"],v3,function(e){var t=e.context,i=t.canExecute,r=t.hover,o=t.source,s=t.target;if(i&&i.type==="dmn:InformationRequirement"){var a=vt(o,s);t.connectionStart=le(o),r===o?t.connectionEnd=le(s):t.connectionEnd={x:e.x,y:e.y},a.includes("bottom")?(t.connectionStart.y=G(o).top,t.connectionEnd.y=G(s).bottom):a.includes("top")?(t.connectionStart.y=G(o).bottom,t.connectionEnd.y=G(s).top):a.includes("right")?(t.connectionStart.x=G(o).left,t.connectionEnd.x=G(s).right):(t.connectionStart.x=G(o).right,t.connectionEnd.x=G(s).left)}else delete t.connectionStart,delete t.connectionEnd})}zm.$inject=["eventBus"];function vi(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}vi.prototype.getSnapOrigin=function(n){return this._snapOrigins[n]};vi.prototype.setSnapOrigin=function(n,e){this._snapOrigins[n]=e,this._snapLocations.indexOf(n)===-1&&this._snapLocations.push(n)};vi.prototype.addDefaultSnap=function(n,e){var t=this._defaultSnaps[n];t||(t=this._defaultSnaps[n]=[]),t.push(e)};vi.prototype.getSnapLocations=function(){return this._snapLocations};vi.prototype.setSnapLocations=function(n){this._snapLocations=n};vi.prototype.pointsForTarget=function(n){var e=n.id||n,t=this._targets[e];return t||(t=this._targets[e]=new Wm,t.initDefaults(this._defaultSnaps)),t};function Wm(){this._snapValues={}}Wm.prototype.add=function(n,e){var t=this._snapValues[n];t||(t=this._snapValues[n]={x:[],y:[]}),t.x.indexOf(e.x)===-1&&t.x.push(e.x),t.y.indexOf(e.y)===-1&&t.y.push(e.y)};Wm.prototype.snap=function(n,e,t,i){var r=this._snapValues[e];return r&&ZE(n[t],r[t],i)};Wm.prototype.initDefaults=function(n){var e=this;k(n||{},function(t,i){k(t,function(r){e.add(i,r)})})};var x3=1250;function Rs(n,e,t){var i=this;this._elementRegistry=n,e.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),e.on(["create.move","create.end","shape.move.move","shape.move.end"],x3,function(r){var o=r.context,s=o.shape,a=o.snapContext,l=o.target;if(!(r.originalEvent&&Mt(r.originalEvent))&&!(wr(r)||!l)){var c=a.pointsForTarget(l);c.initialized||(c=i.addSnapTargetPoints(c,s,l),c.initialized=!0),t.snap(r,c)}}),e.on(["create.cleanup","shape.move.cleanup"],function(){t.hide()})}Rs.$inject=["elementRegistry","eventBus","snapping"];Rs.prototype.initSnap=function(n){var e=this._elementRegistry,t=n.context,i=t.shape,r=t.snapContext;r||(r=t.snapContext=new vi);var o;e.get(i.id)?o=ms(i,n):o={x:n.x+ms(i).x,y:n.y+ms(i).y};var s={x:o.x-i.width/2,y:o.y-i.height/2},a={x:o.x+i.width/2,y:o.y+i.height/2};return r.setSnapOrigin("mid",{x:o.x-n.x,y:o.y-n.y}),Bi(i)||(r.setSnapOrigin("top-left",{x:s.x-n.x,y:s.y-n.y}),r.setSnapOrigin("bottom-right",{x:a.x-n.x,y:a.y-n.y})),r};Rs.prototype.addSnapTargetPoints=function(n,e,t){var i=this.getSnapTargets(e,t);return k(i,function(r){if(Bi(r)){Bi(e)&&n.add("mid",ms(r));return}if(Xe(r)){if(r.waypoints.length<3)return;var o=r.waypoints.slice(1,-1);k(o,function(s){n.add("mid",s)});return}n.add("mid",ms(r))}),!se(e.x)||!se(e.y)||this._elementRegistry.get(e.id)&&n.add("mid",ms(e)),n};Rs.prototype.getSnapTargets=function(n,e){return zp(e).filter(function(t){return!b3(t)})};function b3(n){return!!n.hidden}var _3=1250;function Ts(n,e){var t=this;n.on(["resize.start"],function(i){t.initSnap(i)}),n.on(["resize.move","resize.end"],_3,function(i){var r=i.context,o=r.shape,s=o.parent,a=r.direction,l=r.snapContext;if(!(i.originalEvent&&Mt(i.originalEvent))&&!wr(i)){var c=l.pointsForTarget(s);c.initialized||(c=t.addSnapTargetPoints(c,o,s,a),c.initialized=!0),E3(a)&&vn(i,"x",i.x),S3(a)&&vn(i,"y",i.y),e.snap(i,c)}}),n.on(["resize.cleanup"],function(){e.hide()})}Ts.prototype.initSnap=function(n){var e=n.context,t=e.shape,i=e.direction,r=e.snapContext;r||(r=e.snapContext=new vi);var o=qk(t,i);return r.setSnapOrigin("corner",{x:o.x-n.x,y:o.y-n.y}),r};Ts.prototype.addSnapTargetPoints=function(n,e,t,i){var r=this.getSnapTargets(e,t);return k(r,function(o){n.add("corner",eS(o)),n.add("corner",JE(o))}),n.add("corner",qk(e,i)),n};Ts.$inject=["eventBus","snapping"];Ts.prototype.getSnapTargets=function(n,e){return zp(e).filter(function(t){return!w3(t,n)&&!Xe(t)&&!C3(t)&&!Bi(t)})};function qk(n,e){var t=le(n),i=G(n),r={x:t.x,y:t.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function w3(n,e){return n.host===e}function C3(n){return!!n.hidden}function E3(n){return n==="n"||n==="s"}function S3(n){return n==="e"||n==="w"}var O3=7,k3=1e3;function Ki(n){this._canvas=n,this._asyncHide=Mi(at(this.hide,this),k3)}Ki.$inject=["canvas"];Ki.prototype.snap=function(n,e){var t=n.context,i=t.snapContext,r=i.getSnapLocations(),o={x:wr(n,"x"),y:wr(n,"y")};k(r,function(s){var a=i.getSnapOrigin(s),l={x:n.x+a.x,y:n.y+a.y};if(k(["x","y"],function(c){var u;o[c]||(u=e.snap(l,s,c,O3),u!==void 0&&(o[c]={value:u,originValue:u-a[c]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),k(["x","y"],function(s){var a=o[s];Pe(a)&&vn(n,s,a.originValue)})};Ki.prototype._createLine=function(n){var e=this._canvas.getLayer("snap"),t=Q("path");return j(t,{d:"M0,0 L0,0"}),ne(t).add("djs-snap-line"),K(e,t),{update:function(i){se(i)?n==="horizontal"?j(t,{d:"M-100000,"+i+" L+100000,"+i,display:""}):j(t,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):j(t,{display:"none"})}}};Ki.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};Ki.prototype.showSnapLine=function(n,e){var t=this.getSnapLine(n);t&&t.update(e),this._asyncHide()};Ki.prototype.getSnapLine=function(n){return this._snapLines||this._createSnapLines(),this._snapLines[n]};Ki.prototype.hide=function(){k(this._snapLines,function(n){n.update()})};var Vk={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Rs],resizeSnapping:["type",Ts],snapping:["type",Ki]};var Hk={__depends__:[Vk],__init__:["bendpointSnapping","connectSnapping"],bendpointSnapping:["type",Hm],connectSnapping:["type",zm]};function So(n){br.call(this,n)}fe(So,br);So.prototype._modelingModules=[CE,ME,LE,nS,oO,sO,lO,fO,pO,mO,xO,_O,wO,kO,PO,sk,hk,vk,Ak,$k,Hk];So.prototype._modules=[].concat(So.prototype._modules,So.prototype._modelingModules);function Fx(n){let e={variables:[],rootElement:V3(n)};for(let t=n;t;t=t.$parent)R3(t,e);return e.variables}function R3(n,e){el(n,"dmn:Decision")?T3(n,e):el(n,"dmn:BusinessKnowledgeModel")?A3(n,e):el(n,"dmn:Expression")&&j3(n,e)}function T3(n,e){for(let t of n.get("informationRequirement"))M3(t,e);for(let t of n.get("knowledgeRequirement"))Wk(t,e)}function A3(n,e){for(let t of n.get("knowledgeRequirement"))Wk(t,e)}function M3(n,e){let t=n.get("requiredInput");t&&P3(t,e);let i=n.get("requiredDecision");i&&D3(i,e)}function P3(n,e){let t=qx(n,e.rootElement);if(!t)return;let i=t.get("name");i&&e.variables.push({name:i,origin:t})}function D3(n,e){let t=qx(n,e.rootElement);if(!t)return;let i=t.get("name");if(!i)return;let r={name:i,origin:t},o=t.get("decisionLogic");o&&I3(o,r,e),e.variables.push(r)}function I3(n,e,t){if(el(n,"dmn:DecisionTable")){let i=n.get("output");L3(i,e,t)}}function L3(n,e,t){if(n.length===1){let r={...zk(n[0]),name:e.name};Object.assign(e,r);return}let i=n.map(zk);e.entries=i.filter(r=>!!r.name)}function zk(n){let e={name:n.name};return n.typeRef&&(e.detail=n.typeRef),e}function Wk(n,e){let t=n.get("requiredKnowledge");t&&B3(t,e)}function B3(n,e){let t=qx(n,e.rootElement);t&&el(t,"dmn:BusinessKnowledgeModel")&&N3(t,e)}function N3(n,e){let t=n.get("name");if(!t)return;let i={name:t,origin:n},r=n.get("encapsulatedLogic");r&&$3(r,i),e.variables.push(i)}function $3(n,e,t){let r=n.get("formalParameter").map((o,s)=>{let a={name:o.get("name")||`param ${s+1}`,type:o.get("typeRef")};return a.type||delete a.type,a});Object.assign(e,{type:"function",params:r})}function j3(n,e){el(n,"dmn:FunctionDefinition")&&F3(n,e)}function F3(n,e){let t=n.get("formalParameter");for(let i of t)q3(i,e)}function q3(n,e){let t=n.get("name");if(!t)return;let i={name:t,origin:n};n.get("typeRef")&&(i.detail=n.get("typeRef")),e.variables.push(i)}function V3(n){let e=n;for(;e.$parent;)e=e.$parent;return e}function qx(n,e){let t=n.get("href");if(!t||!t.startsWith("#"))return;let i=t.slice(1);return e.get("drgElement").find(o=>o.get("id")===i)}function el(n,e){return n.$instanceOf(e)}var Qf=class{constructor(e){e.registerProvider(this)}getVariables(e,t){return e.concat(Fx(t))}};Qf.$inject=["variableResolver"];var Um=class{constructor(){this._providers=[]}registerProvider(e){this._providers.push(e)}getVariables(e){return this._providers.reduce((t,i)=>i.getVariables(t,e),[])}};var tl={__init__:["dmnVariableProvider"],dmnVariableProvider:["type",Qf],variableResolver:["type",Um]};var Oo=class{constructor(e){T(this,e),Dr(this,"businessObject",{writable:!0})}},Vx=class extends Oo{constructor(e){super(e),Dr(this,"rows",{enumerable:!0,value:this.rows||[]}),Dr(this,"cols",{enumerable:!0,value:this.cols||[]})}},pt=class extends Oo{constructor(e){super(e),Dr(this,"root",{writable:!0}),Dr(this,"cells",{enumerable:!0,value:this.cells||[]})}},mt=class extends Oo{constructor(e){super(e),Dr(this,"root",{writable:!0}),Dr(this,"cells",{enumerable:!0,value:this.cells||[]})}},ko=class extends Oo{constructor(e){super(e),Dr(this,"row",{writable:!0}),Dr(this,"col",{writable:!0})}},H3={root:Vx,row:pt,col:mt,cell:ko};function Uk(n,e){let t=H3[n];if(!t)throw new Error("unknown type "+n);return new t(e)}function Dr(n,e,t){Object.defineProperty(n,e,t)}var As=class{constructor(){this._uid=12}create(e,t={}){return t.id||(t.id=e+"_"+this._uid++),Uk(e,t)}createRoot(e){return this.create("root",e)}createRow(e){return this.create("row",e)}createCol(e){return this.create("col",e)}createCell(e){return this.create("cell",e)}};var nl=class{constructor(e){this._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}add(e,t){let{id:i}=e;this._elements[i]=e}remove(e){let t=e.id||e;delete this._elements[t]}get(e){return this._elements[e]}getAll(){return Hx(this._elements)}forEach(e){Hx(this._elements).forEach(t=>e(t))}filter(e){return Hx(this._elements).filter(t=>e(t))}clear(){this._elements={}}updateId(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}_validateId(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}};nl.$inject=["eventBus"];function Hx(n){return Object.keys(n).map(function(e){return n[e]})}var il=class{constructor(e){this._listeners={},e.on("elements.changed",({elements:t})=>{this.elementsChanged(t)}),e.on("root.remove",t=>{let i=t.root.id;this._listeners[i]&&e.once("root.add",r=>{let o=r.root.id;this.updateId(i,o)})}),e.on("element.updateId",({element:t,newId:i})=>{this.updateId(t.id,i)})}elementsChanged(e){let t={},i=e.length;for(let r=0;r<i;r++){let{id:o}=e[r];if(t[o])return;t[o]=!0;let s=this._listeners[o]&&this._listeners[o].length;if(s)for(let a=0;a<s;a++)this._listeners[o][a]&&this._listeners[o][a]()}}onElementsChanged(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}offElementsChanged(e,t){if(this._listeners[e])if(t){let i=this._listeners[e].indexOf(t);i!==-1&&this._listeners[e].splice(i,1)}else this._listeners[e].length=0}updateId(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}};il.$inject=["eventBus"];var z3=1e3,Kf=class{constructor(){this._listeners={}}getComponent(e,t){let i=this._listeners[e];if(!i)return;let r;for(let o=0;o<i.length&&(r=i[o].callback(t),!r);o++);return r}getComponents(e,t){let i=this._listeners[e],r=[];if(!i)return r;for(let o=0;o<i.length;o++){let s=i[o].callback(t);s&&r.push(s)}return r.length,r}onGetComponent(e,t,i){if(ge(t)&&(i=t,t=z3),!se(t))throw new Error("priority must be a number");let r=this._getListeners(e),o,s,a={priority:t,callback:i};for(s=0;o=r[s];s++)if(o.priority<t){r.splice(s,0,a);return}r.push(a)}offGetComponent(e,t){let i=this._getListeners(e),r,o,s;if(t)for(s=i.length-1;r=i[s];s--)o=r.callback,o===t&&i.splice(s,1);else i.length=0}_getListeners(e){let t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}};var Gf=class extends L{constructor(e){super(e);let t=this._injector=e.injector;this._sheet=t.get("sheet"),this._changeSupport=t.get("changeSupport"),this._components=t.get("components"),this._eventBus=t.get("eventBus");let i=t.get("throttle");this.onElementsChanged=this.onElementsChanged.bind(this),this.onScroll=i(this.onScroll.bind(this))}onElementsChanged(){this.forceUpdate()}onScroll(){this._eventBus.fire("sheet.scroll")}getChildContext(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}componentWillMount(){let{id:e}=this._sheet.getRoot();this._changeSupport.onElementsChanged(e,this.onElementsChanged)}componentWillUnmount(){let{id:e}=this._sheet.getRoot();this._changeSupport.offElementsChanged(e,this.onElementsChanged)}render(){let{rows:e,cols:t}=this._sheet.getRoot(),i=this._components.getComponents("table.before"),r=this._components.getComponents("table.after"),o=this._components.getComponent("table.head"),s=this._components.getComponent("table.body"),a=this._components.getComponent("table.foot");return y(1,"div","tjs-container",[i&&i.map((l,c)=>P(2,l,null,c)),y(1,"div","tjs-table-container",y(1,"table","tjs-table",[o&&P(2,o,{rows:e,cols:t}),s&&P(2,s,{rows:e,cols:t}),a&&P(2,a,{rows:e,cols:t})],0),2,{onScroll:this.onScroll}),r&&r.map((l,c)=>P(2,l,null,c))],0)}};var rl=class{constructor(e,t,i,r,o){let{container:s}=i;this._container=s,r.on("root.added",()=>{xa(P(2,Gf,{injector:o}),s)}),r.on("root.remove",()=>{xa(null,s)})}getContainer(){return this._container}};rl.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var Qm={__init__:["changeSupport","components","renderer"],changeSupport:["type",il],components:["type",Kf],renderer:["type",rl]};var ol=class{constructor(e,t){this._elementRegistry=e,this._eventBus=t,this._root=null,t.on("table.clear",()=>{this.setRoot(null)})}setRoot(e){if(this._root){let t=this._root;this._eventBus.fire("root.remove",{root:t}),this._root=null,this._eventBus.fire("root.removed",{root:t})}e&&this._eventBus.fire("root.add",{root:e}),this._root=e,e&&this._eventBus.fire("root.added",{root:e})}getRoot(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}addRow(e,t){let i=this.getRoot();if(i.cols.length!=e.cells.length)throw new Error("number of cells is not equal to number of cols");return typeof t=="undefined"&&(t=i.rows.length),Km(t,i.rows,e),e.root=i,this._elementRegistry.add(e),e.cells.forEach((r,o)=>{this._elementRegistry.add(r),r.row=e,r.col=i.cols[o],Km(t,i.cols[o].cells,r)}),this._eventBus.fire("row.add",{row:e}),e}removeRow(e){let t=this.getRoot();typeof e=="string"&&(e=this._elementRegistry.get(e));let i=t.rows.indexOf(e);i!==-1&&(Gm(i,t.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((r,o)=>{this._elementRegistry.remove(r),r.col=void 0,Gm(i,t.cols[o].cells)}),this._eventBus.fire("row.remove",{row:e}))}addCol(e,t){let i=this.getRoot();if(this._elementRegistry.add(e),i.rows.length!=e.cells.length)throw new Error("number of cells is not equal to number of rows");return typeof t=="undefined"&&(t=i.cols.length),Km(t,i.cols,e),e.root=i,e.cells.forEach((r,o)=>{this._elementRegistry.add(r),r.col=e,r.row=i.rows[o],Km(t,i.rows[o].cells,r)}),this._eventBus.fire("col.add",{col:e}),e}removeCol(e){let t=this.getRoot();typeof e=="string"&&(e=this._elementRegistry.get(e));let i=t.cols.indexOf(e);i!==-1&&(Gm(i,t.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((r,o)=>{this._elementRegistry.remove(r),r.row=void 0,Gm(i,t.rows[o].cells)}),this._eventBus.fire("col.remove",{col:e}))}resized(){this._eventBus.fire("sheet.resized")}};ol.$inject=["elementRegistry","eventBus"];function Km(n,e,t){return e.splice(n,0,t)}function Gm(n,e){return e.splice(n,1)}function Xm(n=!0){let e=typeof n=="number"?n:n?300:0;return e?t=>Nw(t,e):t=>t}Xm.$inject=["config.throttle"];var Qk={__depends__:[Qm],__init__:["elementFactory","sheet"],elementFactory:["type",As],elementRegistry:["type",nl],eventBus:["type",ut],sheet:["type",ol],throttle:["factory",Xm]};var Xf=class{constructor(e={}){let{injector:t}=e;if(!t){let{modules:i,config:r}=this._init(e);t=W3(r,i)}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}_init(e){let{modules:t,...i}=e;return{modules:t,config:i}}destroy(){let e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}clear(){let e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}};function W3(n,e){let t=[{config:["value",n]},Qk].concat(e||[]),i=new os(t);return i.init(),i}var Kk=Xf;function Ym(n){if(!n)return"<null>";let e=n.id?` id="${n.id}"`:"";return`<${n.$type}${e} />`}function zx(n,e){function t(l,c,u){var f=l.gfx;if(f)throw new Error(`already rendered ${Ym(l)}`);return n.element(l,c,u)}function i(l){return n.table(l)}function r(l){l.id||(l.id="decision");let c=l.decisionLogic;if(c){if(!c.output)throw new Error(`missing output for ${Ym(c)}`);let u=i(c);c.input&&o(c.input,u,c),o(c.output,u,c),s(c.rule,u,c)}else throw new Error(`no table for ${Ym(l)}`)}function o(l,c,u){k(l,function(f){t(f,c,u)})}function s(l,c,u){k(l,function(f){t(f,c,u),a(f.inputEntry,f),a(f.outputEntry,f)})}function a(l,c,u){k(l,function(f){t(f,c,u)})}return{handleDecision:r}}function Gk(n,e,t){let i=n.get("tableImporter"),r=n.get("eventBus"),o=n.get("sheet"),s=n.get("modeling",!1),a,l=[];function c(u){let f={create(d,p,m,g){return i.create(d,p,m,g)},table(d){return i.add(d)},element(d,p,m){return i.add(d,p,m)},error(d,p){l.push({message:d,context:p})}};new zx(f,{canAddMissingEntries:s}).handleDecision(u)}r.fire("import.render.start",{decision:e});try{c(e)}catch(u){a=u}r.fire("import.render.complete",{error:a,warnings:l}),r.fire("elements.changed",{elements:[o.getRoot()]}),t(a,l)}function U3(){return{elements:[],index:{}}}function Xk(n,e){let{elements:t,index:i}=n;return i[e]?n:{elements:[...t,e],index:{...i,[e]:!0}}}function Q3(n,e){return n.elements.join(e)}function Ro(...n){let e=U3();return n.forEach(function(t){let i=typeof t;i==="string"&&t.length>0?e=Xk(e,t):i==="object"&&t!==null&&Object.keys(t).forEach(function(r){t[r]&&(e=Xk(e,r))})}),Q3(e," ")}function Ce(n){let e=n.constructor;return Zm(e,n)}function Zm(n,e){let t=n.$inject;if(!t)return;let{injector:i}=e.context,r=[...t,function(...o){for(let s in o){let a=t[s],l=o[s];e[a]=l}}];i.invoke(r)}function Wx(n,...e){return function(...t){let i;return e.forEach(function(r){if(i=r.call(n,...t),typeof i!="undefined")return!1}),i}.bind(n)}function Ut(n,e){Object.keys(e).forEach(function(t){if(t==="$inject"||t==="__init")return;let i=e[t];t==="constructor"&&i.call(n,n.props,n.context);let r=n[t];if(typeof r!="undefined"){if(typeof r!="function")throw new Error(`failed to mixin <${t}>: cannot combine with non-fn component value`);n[t]=Wx(n,r,i)}else n[t]=i.bind(n)}),"$inject"in e&&Zm(e,n),"__init"in e&&e.__init.call(n,n.props,n.context)}var Yk={getSelectionClasses(){let{selected:n,selectedSecondary:e,focussed:t}=this.state;return Ro({selected:n,"selected-secondary":e,focussed:t})},selectionChanged(n){this.setState(n)},componentWillUpdate(n){n.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate(n){n.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount(){this.updateSelectionSubscription(!0)},componentWillUnmount(){this.updateSelectionSubscription(!1)},updateSelectionSubscription(n){let{elementId:e}=this.props;e&&e&&this.eventBus[n?"on":"off"](`selection.${e}.changed`,this.selectionChanged)}},Yf=Yk;Yk.$inject=["eventBus"];var Zf=class extends L{constructor(e,t){super(e,t),Ut(this,Yf),Ce(this)}getRenderProps(...e){let{className:t,elementId:i,coords:r,...o}=this.props,s={className:Ro(...e,this.getSelectionClasses(),t)};return i&&(s["data-element-id"]=i),r&&(s["data-coords"]=r),{...s,...o}}};var Rn=class extends Zf{constructor(e,t){super(e,t),this.state={}}render(){let{children:e}=this.props,t=this.getRenderProps("cell");return En(y(1,"td",null,e,0,{...t}))}};var Zk={slotFill(n,e){let{type:t,context:i,...r}=n,o=this.components.getComponent(t,i)||e;return o?En(P(2,o,{...i,...r})):null},slotFills(n){let{type:e,context:t,...i}=n;return this.components.getComponents(e,t).map(o=>En(P(2,o,{...t,...i})))}},xi=Zk;Zk.$inject=["components"];var Jk=400,To=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});Ut(this,xi),Ce(this)}componentDidMount(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}componentWillUnmount(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}getRoot(){return this.sheet.getRoot()}render(){let r=(this.getRoot().businessObject.get("annotationsWidth")||Jk)+"px";return y(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:Jk}}),this.translate("Annotations")],0,{style:{width:r}})}};To.$inject=["changeSupport","sheet","translate"];function Ux(n){let{row:e}=n,{id:t,description:i}=e.businessObject;return P(2,Rn,{className:"annotation",elementId:t,children:i||"-"})}function Jm(n){n.onGetComponent("cell",({cellType:e})=>{if(e==="after-label-cells")return To;if(e==="after-rule-cells")return Ux})}Jm.$inject=["components"];var eR={__init__:["annotationsProvider"],annotationsProvider:["type",Jm]};function Jf(n,e){return T({id:n.id,type:n.$type,businessObject:n},e)}var sl=class{constructor(e,t,i){this._elementFactory=e,this._eventBus=t,this._sheet=i}add(e){let t;if(O(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(Jf(e)),this._sheet.setRoot(t);else if(O(e,"dmn:InputClause"))t=this._elementFactory.createCol(Jf(e)),this._sheet.addCol(t);else if(O(e,"dmn:OutputClause"))t=this._elementFactory.createCol(Jf(e)),this._sheet.addCol(t);else if(O(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);let i=[...e.inputEntry,...e.outputEntry].map(r=>this._elementFactory.createCell(Jf(r)));t=this._elementFactory.createRow(T(Jf(e),{cells:i})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}};sl.$inject=["elementFactory","eventBus","sheet"];var tR={__depends__:[qe],tableImporter:["type",sl]};var nR={__depends__:[tR,Qm]};var eh=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});Ut(this,xi),this._sheet=i.injector.get("sheet"),this._changeSupport=i.changeSupport}componentWillMount(){let t=this._sheet.getRoot();this._changeSupport.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){let t=this._sheet.getRoot();this._changeSupport.offElementsChanged(t.id,this.onElementsChanged)}render(){let t=this._sheet.getRoot();if(!O(t,"dmn:DMNElement"))return null;let i=Ke(t),r=i.input,o=i.output;return y(1,"thead",null,y(1,"tr",null,[y(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),r&&r.map((s,a)=>{let l=s.width||"192px";return this.slotFill({type:"cell",context:{cellType:"input-header",input:s,index:a,inputsLength:r.length,width:l},key:s.id},K3)}),o.map((s,a)=>this.slotFill({type:"cell",context:{cellType:"output-header",output:s,index:a,outputsLength:o.length},key:s.id},G3)),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}};function K3(n,e){let{input:t,className:i,index:r}=n,{label:o,inputExpression:s,inputValues:a}=t,l=e.injector.get("translate"),c=(i||"")+" input-cell";return y(1,"th",c,[y(1,"div","clause",l(r===0?"When":"And"),0),o?y(1,"div","input-label",o,0,{title:l("Input label: ")+o}):y(1,"div","input-expression",s.text,0,{title:l("Input expression: ")+s.text}),y(1,"div","input-variable",a&&a.text||s.typeRef,0,{title:a&&a.text?l("Input values"):l("Input type")})],0,{"data-col-id":t.id},t.id)}function G3(n,e){let{output:t,className:i,index:r}=n,{label:o,name:s,outputValues:a,typeRef:l}=t,c=e.injector.get("translate"),u=(i||"")+" output-cell";return y(1,"th",u,[y(1,"div","clause",c(r===0?"Then":"And"),0),o?y(1,"div","output-label",o,0,{title:c("Output label")}):y(1,"div","output-name",s,0,{title:c("Output name")}),y(1,"div","output-variable",a&&a.text||l,0,{title:a&&a.text?c("Output values"):c("Output type")})],0,null,t.id)}function eg(n){n.onGetComponent("table.head",()=>eh)}eg.$inject=["components"];var iR={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",eg]};var al=class extends L{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),Ce(this)}render(){let e=this.sheet.getRoot();if(!O(e,"dmn:DMNElement"))return null;let{name:t}=e.businessObject.$parent,i=this.components.getComponent("hit-policy")||X3;return y(1,"div","decision-table-properties",[y(1,"div","decision-table-name",t,0,{title:this._translate("Decision name: ")+t}),y(1,"div","decision-table-header-separator"),P(2,i)],4)}};al.$inject=["sheet","components"];function X3(){return null}var Y3=500,ll=class{constructor(e){e.onGetComponent("table.before",Y3,()=>al)}};ll.$inject=["components"];var rR={__init__:["decisionTableProperties"],decisionTableProperties:["type",ll]};var th=class extends L{render(){let{row:e,rowIndex:t}=this.props,{components:i}=this.context,r=i.getComponents("cell-inner",{cellType:"rule-index",row:e,rowIndex:t});return y(1,"td","rule-index",[r&&r.map(o=>P(2,o,{row:e,rowIndex:t})),t+1],0,{"data-element-id":e.id,"data-row-id":e.id})}};var cl=class{constructor(e){e.onGetComponent("cell",({cellType:t})=>{if(t==="before-rule-cells")return th})}};cl.$inject=["components"];var oR={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",cl]};var Z3=[{label:"FEEL",value:"feel"}],ul=class{constructor(e){this._injector=e;let t=e.get("config.expressionLanguages")||{};this._config={options:Z3,defaults:{editor:"feel"}},t.options&&(this._config.options=t.options);let i=this._getLegacyDefaults();T(this._config.defaults,i,t.defaults)}getDefault(e){let{defaults:t}=this._config,i=t[e]||t.editor;return this._getLanguageByValue(i)||this.getAll()[0]}getLabel(e){let t=this._getLanguageByValue(e);return t?t.label:e}getAll(){return this._config.options}_getLegacyDefaults(){let e={},t=this._injector,i=t.get("config.defaultInputExpressionLanguage"),r=t.get("config.defaultOutputExpressionLanguage");return i&&(e.inputCell=i),r&&(e.outputCell=r),e}_getLanguageByValue(e){return ye(this.getAll(),t=>e===t.value)}};ul.$inject=["injector"];var Qt={__init__:["expressionLanguages"],expressionLanguages:["type",ul]};var fl=class{constructor(e){this._feelLanguageContext=e}getConfig(){return this._feelLanguageContext}};fl.$inject=["config.feelLanguageContext"];var Yn={__init__:["feelLanguageContext"],feelLanguageContext:["type",fl]};var nh=class extends L{render({rows:e,cols:t}){let{components:i}=this.context;return y(1,"tbody",null,e.map((r,o)=>{let s=i.getComponent("row",{rowType:"rule"});return s&&P(2,s,{row:r,rowIndex:o,cols:t},r.id)}),0)}};var ih=class extends L{constructor(e,t){super(e,t),Ut(this,xi)}render(){let{row:e,rowIndex:t,cols:i}=this.props,{cells:r}=e;return y(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:e,rowIndex:t}}),r.map((o,s)=>this.slotFill({type:"cell",context:{cellType:"rule",cell:o,rowIndex:t,colIndex:s},key:o.id,row:e,col:i[s]})),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:e,rowIndex:t}})],0)}};var rh=class extends L{render(){let{cell:e,row:t,col:i}=this.props;return O(e,"dmn:UnaryTests")?P(2,Rn,{className:"input-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":i.id,children:e.businessObject.text}):P(2,Rn,{className:"output-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":i.id,children:e.businessObject.text})}};var hl=class{constructor(e){e.onGetComponent("table.body",()=>nh),e.onGetComponent("row",({rowType:t})=>{if(t==="rule")return ih}),e.onGetComponent("cell",({cellType:t})=>{if(t==="rule")return rh})}};hl.$inject=["components"];var tg={__depends__:[Qt,Yn],__init__:["decisionRules"],decisionRules:["type",hl]};var oh=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}];var dl=class extends L{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),Ce(this)}getRoot(){return this.sheet.getRoot()}render(){let e=this.getRoot(),t=e.businessObject,{aggregation:i,hitPolicy:r}=t,o=ye(oh,s=>J3(s.value,{aggregation:i,hitPolicy:r}));return y(1,"div","hit-policy header",[y(1,"label","dms-label",this._translate("Hit policy:"),0),y(1,"span","hit-policy-value",this._translate(o.label),0)],4,{title:this._translate(o.explanation)})}};dl.$inject=["sheet"];function J3(n,e){return n.hitPolicy===e.hitPolicy&&n.aggregation===e.aggregation}function ng(n){n.onGetComponent("hit-policy",()=>dl)}ng.$inject=["components"];var sR={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",ng]};var sh=class extends L{constructor(t,i){super(t,i);M(this,"onClick",()=>{this._eventBus.fire("showDrd")});let{injector:r}=i;this._translate=r.get("translate"),this._eventBus=r.get("eventBus")}render(){return y(1,"div","view-drd",y(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,t=>this.node=t)}};var pl=class{constructor(e,t,i,r){this._injector=i,this._sheet=r,e.onGetComponent("table.before",()=>{if(this.canViewDrd())return sh}),t.on("showDrd",()=>{let o=i.get("_parent",!1),s=r.getRoot(),a=aR(s);if(!a)return;let l=o.getView(a);o.open(l)})}canViewDrd(){let e=this._injector.get("_parent",!1);if(!e)return!1;let t=this._sheet.getRoot(),i=aR(t);return!!e.getView(i)}};pl.$inject=["components","eventBus","injector","sheet"];function aR(n){let{businessObject:e}=n;return e?e.$parent.$parent:void 0}var lR={__init__:["viewDrd"],viewDrd:["type",pl]};var ml=class{constructor(e){e.onGetComponent("table.before",()=>co)}};ml.$inject=["components"];var cR={__init__:["poweredBy"],poweredBy:["type",ml]};var Ao=class n extends Kk{constructor(e={}){let t=n._createContainer();super(T(e,{renderer:{container:t}})),this._container=t}open(e){var t=this;return new Promise((i,r)=>{var o;try{return t._decision&&t.clear(),t._decision=e,Gk(t,e,function(s,a){s?(s.warnings=a||[],r(s)):i({warnings:a||[]})})}catch(s){o=s}o?(o.warnings=o.warnings||[],r(o)):i({warnings:[]})})}_init(e){let{modules:t,additionalModules:i,...r}=e,o=t||this.getModules(),s=i||[],a=[{decisionTable:["value",this]}];return{modules:[cR,...o,...s,...a],config:r}}on(e,t,i,r){return this.get("eventBus").on(e,t,i,r)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}attachTo(e){if(!e)throw new Error("parentNode required");this.detach();let t=this._container;e.appendChild(t),this._emit("attach",{})}detach(){let e=this._container;e.parentNode&&(this._emit("detach",{}),Qe(e))}destroy(){super.destroy(),this.detach()}getModules(){return n._getModules()}static _getModules(){return[eR,nR,qe,iR,rR,oR,tg,sR,lR]}static _createContainer(){return te('<div class="dmn-decision-table-container"></div>')}};var gl=class extends L{constructor(t,i){super(t,i);M(this,"handleClick",t=>{t.stopPropagation(),this.addRule(t.target.dataset.colIndex)});Ce(this),this.addRule=this.addRule.bind(this)}componentWillMount(){this._eventBus=this.context.injector.get("eventBus")}addRule(t){this._eventBus.fire("addRule",{colIndex:t})}render(){let{cols:t}=this.props,i=[y(1,"td","add-rule-add",y(1,"button","dmn-icon-plus action-icon",null,1,{title:this.translate("Add rule")}),2)],{businessObject:r}=this.sheet.getRoot();(!r.input||!r.input.length)&&i.push(y(1,"td","input-cell",Z("-"),2));for(let o=0;o<t.length+1;o++){let s="add-rule",a=t[o]&&t[o].businessObject,l="";a?(a.$instanceOf("dmn:InputClause")&&(s+=" input-cell",l="-"),a.$instanceOf("dmn:OutputClause")&&(s+=" output-cell")):s+=" annotation",i.push(y(1,"td",s,l,0,{"data-col-index":o}))}return y(1,"tfoot","actionable add-rule",y(1,"tr",null,i,0),2,{onClick:this.handleClick})}};gl.$inject=["sheet","translate"];var yl=class{constructor(e,t,i,r){e.onGetComponent("table.foot",()=>gl),i.on("addRule",(o,s)=>{let a=t.trigger("addRule"),l=s.colIndex;a.cells[l]?r.select(a.cells[l]):r.select(a.cells[0])})}};yl.$inject=["components","editorActions","eventBus","selection"];var vl=class{constructor(e,t,i){this._elementRegistry=e,this._eventBus=t,this._renderer=i,this._selection=void 0,t.on("diagram.clear",()=>{this._selection=void 0})}select(e){Ie(e)&&(e=this._elementRegistry.get(e));let t=this._selection;t!==e&&(this._selection=e,this._eventBus.fire("selection.changed",{oldSelection:t,selection:e}))}deselect(){let e=this._selection;this._selection=void 0,this._eventBus.fire("selection.changed",{oldSelection:e,selection:this._selection})}get(){return this._selection}hasSelection(){return!!this._selection}};vl.$inject=["elementRegistry","eventBus","renderer"];var xl=class{constructor(e,t,i,r){this._elementRegistry=e,this._renderer=i,this._selection=r,t.on(["cell.click","cell.contextmenu"],({id:o})=>{let s=e.get(o);s&&r.select(s)}),t.on("row.remove",({row:o})=>{let s=r.get();s&&o===s.row&&r.deselect()}),t.on("col.remove",({col:o})=>{let s=r.get();s&&o===s.col&&r.deselect()})}};xl.$inject=["elementRegistry","eventBus","renderer","selection"];var Mo={__init__:["selection","selectionBehavior"],selection:["type",vl],selectionBehavior:["type",xl]};function e5(n,e,t){return(e=t5(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function t5(n){var e=n5(n,"string");return typeof e=="symbol"?e:e+""}function n5(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var uR=["click","dblclick","contextmenu","mousedown","mouseup","mouseenter","mouseleave","mouseout","mouseover","mousemove","focusin","focusout","drag","dragstart","dragend","dragover","dragenter","dragleave","drop"],bl=class{constructor(e,t){e5(this,"_handleEvent",i=>{let{target:r,type:o}=i,s=i5(r);if(!s)return;let a=s.getAttribute("data-element-id");if(a){let l=this._eventBus.createEvent({id:a,event:i,node:s,target:s});this._eventBus.fire(`cell.${o}`,l),l.defaultPrevented&&i.preventDefault(),l.cancelBubble&&i.stopPropagation()}}),this._eventBus=t,this._container=e.container,t.on("table.init",()=>{this._addEventListeners(uR)}),t.on("table.destroy",()=>{this._removeEventListeners(uR)})}_addEventListeners(e){let t=this._container;e.forEach(i=>{t.addEventListener(i,this._handleEvent)})}_removeEventListeners(e){let t=this._container;e.forEach(i=>{t.removeEventListener(i,this._handleEvent)})}};bl.$inject=["config.renderer","eventBus"];function i5(n){return De(n,"[data-element-id]",!0)}var _l={__init__:["interactionEvents"],interactionEvents:["type",bl]};var Jx=Pw(hR());function r5(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Kx,dR;function o5(){if(dR)return Kx;dR=1,Kx=n;function n(e,t){return e^t}return Kx}var Gx,pR;function s5(){if(pR)return Gx;pR=1;var n=/\b(Array|Date|Object|Math|JSON)\b/g;Gx=function(o,s){var a=i(e(o));return s&&typeof s=="string"&&(s=r(s)),s?t(o,a,s):a};function e(o){return o.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(n,"").match(/[a-zA-Z_]\w*/g)||[]}function t(o,s,a){var l=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return o.replace(l,function(c){return c[c.length-1]=="("||~s.indexOf(c)?a(c):c})}function i(o){for(var s=[],a=0;a<o.length;a++)~s.indexOf(o[a])||s.push(o[a]);return s}function r(o){return function(s){return o+s}}return Gx}var Xx,mR;function a5(){if(mR)return Xx;mR=1;var n=o5(),e=s5();Xx=t;function t(r,o){if(!(this instanceof t))return new t(r,o);if(this.node=this.start=this.peeked=r,this.root=o,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],r&&this.higher(r))throw new Error("root must be a parent or ancestor to node")}t.prototype.reset=function(r){return this.node=r||this.start,this},t.prototype.revisit=function(r){return this._revisit=r==null?!0:r,this},t.prototype.opening=function(){return this.node.nodeType==1&&(this.closingTag=!1),this},t.prototype.atOpening=function(){return!this.closingTag},t.prototype.closing=function(){return this.node.nodeType==1&&(this.closingTag=!0),this},t.prototype.atClosing=function(){return this.closingTag},t.prototype.next=i("nextSibling","firstChild"),t.prototype.previous=t.prototype.prev=i("previousSibling","lastChild");function i(r,o){var s=r=="nextSibling";return function(l,c,u){l=this.compile(l),c=c&&c>0?c:1;for(var f=this.node,h=this.closingTag,d=this._revisit;f;){if(n(s,h)&&f[o])f=f[o],h=!s;else if(f.nodeType==1&&!f[o]&&n(s,h)){if(h=s,!d)continue}else if(f[r])f=f[r],h=!s;else if(f=f.parentNode,h=s,!d)continue;if(!f||this.higher(f,this.root))break;if(l(f)&&this.selects(f,u)&&this.rejects(f,u)){if(--c)continue;return u||(this.node=f),this.closingTag=h,f}}return null}}return t.prototype.select=function(r){return r=this.compile(r),this._selects.push(r),this},t.prototype.selects=function(r,o){var s=this._selects,a=s.length;if(!a)return!0;for(var l=0;l<a;l++)if(s[l].call(this,r,o))return!0;return!1},t.prototype.reject=function(r){return r=this.compile(r),this._rejects.push(r),this},t.prototype.rejects=function(r,o){var s=this._rejects,a=s.length;if(!a)return!0;for(var l=0;l<a;l++)if(s[l].call(this,r,o))return!1;return!0},t.prototype.higher=function(r){var o=this.root;if(!o)return!1;for(r=r.parentNode;r&&r!=o;)r=r.parentNode;return r!=o},t.prototype.compile=function(r){switch(typeof r){case"number":return function(o){return r==o.nodeType};case"string":return new Function("node","Object.freeze(node); return "+e(r,"node."));case"function":return r;default:return function(){return!0}}},t.prototype.peak=t.prototype.peek=function(r,o){return arguments.length==1&&(o=r,r=!0),o=o==null?1:o,o?o>0?this.next(r,o,!0):this.prev(r,Math.abs(o),!0):this.node},t.prototype.use=function(r){return r(this),this},Xx}var l5=a5(),gR=r5(l5),Zn=window.getSelection();function Zx(n){Zn==null||Zn.removeAllRanges(),Zn==null||Zn.addRange(n)}function yR(){return Zn}function c5(n){if(!(Zn!=null&&Zn.rangeCount))return null;var e=Zn.focusNode;return ig(e)&&(e=e.parentNode),n==e||n.contains(e)}function rg(n,e){var t=u5(n,e);Zx(t)}function wl(n){if(!c5(n))return null;var e=Zn.getRangeAt(0),t=e.startContainer,i=e.endContainer,r=e.startOffset,o=e.endOffset,s=gR(n.firstChild,n),a=s.node,l,c=!1,u,f=0;function h(p,m){return arguments.length===1&&(m=p),p.parentNode===i&&m==i.childNodes[o]}function d(p,m){return arguments.length===1&&(m=p),p.parentNode===t&&m==t.childNodes[r]}for(;a&&(d(a)&&!c&&(u=f),!(h(a)||Yx(a)&&i===a));){if(c||(Yx(a)||l&&l.nextSibling==a&&(vR(a)||xR(a)))&&f++,ig(a)){if(t===a&&(u=f+r),i===a){f+=o;break}f+=a.textContent.length}if((ig(a)||c)&&(d(a,a.nextSibling)&&(u=f),h(a,a.nextSibling)))break;l=a,a=s.next(),c=s.closingTag}return{start:typeof u=="undefined"?f:u,end:f}}function u5(n,e){for(var t=e.start,i=e.end,r=document.createRange(),o=gR(n.firstChild,n),s=o.node,a=!1,l=0,c;s;){if(l===t&&(a?r.setStartAfter(s):r.setStartBefore(s)),l===i)return a?r.setEndAfter(s):r.setEndBefore(s),r;if(a||(Yx(s)||s.previousSibling&&(vR(s)||xR(s)))&&l++,ig(s)){if(c=s.textContent.length,l<=t&&l+c>t&&r.setStart(s,t-l),l+c>i)return r.setEnd(s,i-l),r;l+=c}s=o.next(),a=o.closingTag}return l<=t&&(n.lastChild?r.setStartAfter(n.lastChild):r.setStart(n,0)),n.lastChild?r.setEndAfter(n.lastChild):r.setEnd(n,0),r}function ig(n){return n.nodeType===3}function Yx(n){return n.nodeType===1&&n.nodeName==="BR"}function vR(n){return n.nodeType===1&&n.nodeName==="DIV"}function xR(n){return n.nodeType===1&&n.nodeName==="P"}var f5="[contenteditable]",h5="[data-element-id]";function ah(n){return n.getAttribute("data-element-id")}function bR(n){let e=n.getAttribute("data-coords");if(!e)return null;let[t,i]=e.split(":");return{row:t,col:i}}function _R(n,e){let t=`${n.row}:${n.col}`;return X(`[data-coords="${(0,Jx.default)(t)}"]`,e)}function Gi(n,e){return X(`[data-element-id="${(0,Jx.default)(n)}"]`,e)}function wR(n){return De(n,".no-deselect",!0)}function lh(n){return De(n,h5,!0)}function e0(n){let e=f5;return hr(n,e)?n:X(e,n)}function CR(n){let e=e0(n);if(!e||!document.body.contains(e)||document.activeElement===e)return;e.focus();let t=wl(e);(!t||t.end===0)&&window.getSelection().setPosition(e.firstChild,e.firstChild.length)}var t0=500,d5={above:!0,below:!0,right:!0,left:!0};function og(n,e,t,i,r){let{container:o}=n,s=null;function a(h,d){e.fire("selection."+h+".changed",d),e.fire("cellSelection.changed",{elementId:h,selection:d})}function l(h){let d=h.target;if(wR(d))return;let p=lh(d),m=p&&ah(p),g=!h.defaultPrevented;f(m,g)}function c(h){let d=ah(h.target),p=!h.defaultPrevented;return h.stopPropagation(),f(d,p)}function u(h){let d=ah(h.target);a(d,{focussed:!1})}function f(h,d=!0){s!==h&&a(s,{selected:!1,focussed:!1}),s=h,h&&a(h,{selected:!0,focussed:d}),h?i.select(h):i.deselect()}e.on("cell.click",t0,l),e.on("cell.focusin",t0,c),e.on("cell.focusout",t0,u),e.on("cellSelection.changed",function(h){let{elementId:d,selection:p}=h,m=Gi(d,o);p.focussed&&m&&CR(m)}),e.on("selection.changed",function(h){let{selection:d,oldSelection:p}=h;var m=d&&d.id,g=p&&p.id;m&&m!==s?f(d.id):g&&g===s&&f()}),this.isCellSelected=function(){return!!s},this.getCellSelection=function(){return s},this.selectCell=function(h){if(!s)return;if(!(h in d5))throw new Error("direction must be any of { above, below, left, right }");var d=Gi(s,o);let p=bR(d);if(!p)return!1;let m=p5(p,h),g=_R(m,o);if(!g)return!1;let b=ah(g);return b&&f(b,{focussed:!0,selected:!0}),!0},e.on("contextMenu.close",function(){if(s)return f(s)})}og.$inject=["config.renderer","eventBus","sheet","selection","elementRegistry"];function p5(n,e){let{row:t,col:i}=n;if(e==="above"||e==="below"){let r=parseInt(t,10);if(isNaN(r))return n;let o=e==="above"?r-1:r+1;return{col:i,row:o}}if(e==="left"||e==="right"){let r=parseInt(i,10);if(isNaN(r))return n;let o=e==="left"?r-1:r+1;return{row:t,col:o}}throw new Error("invalid direction <"+e+">")}var Po={__depends__:[_l,Mo],__init__:["cellSelection"],cellSelection:["type",og]};function Ms(){}Ms.prototype.get=function(){return this._data};Ms.prototype.set=function(n){this._data=n};Ms.prototype.clear=function(){var n=this._data;return delete this._data,n};Ms.prototype.isEmpty=function(){return!this._data};var sg={clipboard:["type",Ms]};var n0=2e3,Cl=class extends Vi{constructor(e,t){super(e),this._sheet=t}init(){this.addRule("col.move",n0,({col:e,index:t})=>{let{businessObject:i}=this._sheet.getRoot(),{input:r}=i;return ie(e)?t<r.length:t>=r.length}),this.addRule("col.remove",n0,({col:e})=>{let{cols:t}=this._sheet.getRoot();return Te(e)?t.filter(i=>Te(i)).length>1:!0}),this.addRule("paste",n0,({data:e,target:t})=>{if(!e||!t)return!1;let{root:i}=e;return t instanceof pt?this.canPasteRows(i):t instanceof mt?this.canPasteCols(i,t):!1})}canPasteRows(e){let{cols:t}=this._sheet.getRoot();return kt(e,i=>i.type!=="row"||i.cells.length!==t.length?!1:kt(i.cells,(r,o)=>ie(t[o])?r.businessObject.$type==="dmn:UnaryTests":r.businessObject.$type==="dmn:LiteralExpression"))}canPasteCols(e,t){let{rows:i}=this._sheet.getRoot();return kt(e,r=>r.type!=="col"||r.cells.length!==i.length?!1:ie(t)?r.businessObject.$type==="dmn:InputClause":r.businessObject.$type==="dmn:OutputClause")}};Cl.$inject=["eventBus","sheet"];var ER={__depends__:[yn]};var El={__depends__:[ER],__init__:["decisionTableModelingRules"],decisionTableModelingRules:["type",Cl]};var Sl=class{constructor(e,t,i){this._clipboard=e,this._modeling=t,this._sheet=i}execute(e){let{data:t}=e;return e.oldData=this._clipboard.get(),this._clipboard.set(t),this._sheet.getRoot()}postExecute(e){let{elements:t}=e;t.forEach(i=>{i instanceof pt?this._modeling.removeRow(i):i instanceof mt&&this._modeling.removeCol(i)})}revert(e){let{oldData:t}=e;return this._clipboard.set(t),this._sheet.getRoot()}};Sl.$inject=["clipboard","modeling","sheet"];var m5=[x5,b5],g5=[S5,E5];function ag(n,e,t){return t=t||m5,e=e||{},F(n)?y5(n,e,t):SR(n,e,t)}function y5(n,e,t){return st(n,(i,r)=>{var o=i.descriptorCache,s=i.root;let{root:a,descriptorCache:l}=SR(r,o,t);return{root:[...s,a],descriptorCache:{...o,...l}}},{root:[],descriptorCache:e})}function SR(n,e,t){var i=n.id,r={id:i},o=e.elements||{},s=o[i];if(s)return{root:s,descriptorCache:e};let a=v5(n,r,t,{...e,elements:o});return{root:a.root,descriptorCache:{...a.descriptorCache,elements:{...a.descriptorCache.elements,[i]:a.root}}}}function v5(n,e,t,i){function r(o,s){return ag(o,s,t)}return st(t,function(o,s){return s(n,o.root,o.descriptorCache,r)},{root:e,descriptorCache:i})}function x5(n,e,t,i){var r=t,o={...e,type:_5(n)};if(n instanceof pt||n instanceof mt){let s=i(n.cells,r);o.cells=s.root,r=s.descriptorCache}return{root:o,descriptorCache:r}}function b5(n,e,t){var i=n.businessObject;if(!i)return{root:e,descriptorCache:t};var r=i0(i,t);return{root:{...e,businessObject:r.root},descriptorCache:r.descriptorCache}}function _5(n){if(n instanceof pt)return"row";if(n instanceof mt)return"col";if(n instanceof ko)return"cell";throw new Error("cannot deduce element type: #"+n.id)}function i0(n,e){var t,i,r=n.id;if(r&&(t=e.boCache||{},i=t[r],i))return{root:i,descriptorCache:e};var o={$type:n.$type};return r&&(o.id=r,t={...t,[r]:o},e={...e,boCache:t}),n.$descriptor.properties.forEach(function(s){var a=n[s.name];if(a){if(F(a)&&(a=a.map(l=>{var c=i0(l,e);return e=c.descriptorCache,c.root})),a.$type){let l=i0(a,e);e=l.descriptorCache,a=l.root}o[s.name]=a}}),{root:o,descriptorCache:e}}function o0(n,e,t){return t=t||g5,e=e||{},F(n.root)?w5(n,e,t):OR(n,e,t)}function w5(n,e,t){let i=n.root,r=n.descriptorCache;return st(i,(o,s)=>{var a=o.reviveCache,l=o.root;let{root:c,reviveCache:u}=OR({root:s,descriptorCache:r},a,t);return{root:[...l,c],reviveCache:u}},{root:[],reviveCache:e})}function OR(n,e,t){var i=n.root,r=i.id,o=e.elements||{},s=o[r];if(s)return{root:s,reviveCache:e};var a={id:r};let l=C5(n,a,t,{...e,elements:o});return{root:l.root,reviveCache:{...l.reviveCache,elements:{...l.reviveCache.elements,[r]:l.root}}}}function C5(n,e,t,i){function r(o,s){return o0(o,s,t)}return st(t,function(o,s){return s(n,o.root,o.reviveCache,r)},{root:e,reviveCache:i})}function E5(n,e,t,i){var r=n.root,o=n.descriptorCache,s={...e};if(e.businessObject&&e.businessObject.id&&(s.id=e.businessObject.id),r.type==="row"||r.type==="col"){let c=i({root:r.cells,descriptorCache:o},t);s.cells=c.root,t=c.reviveCache}var a=O5(r),l=new a(s);return l instanceof pt?l.cells.forEach(c=>{c.row=l}):l instanceof mt&&l.cells.forEach(c=>{c.col=l}),{root:l,reviveCache:t}}function S5(n,e,t){var i=n.root.businessObject;if(!i)return{root:e,reviveCache:t};var r=r0({root:i,descriptorCache:n.descriptorCache},t);return{root:{...e,businessObject:r.root},reviveCache:r.reviveCache}}function O5(n){switch(n.type){case"row":return pt;case"cell":return ko;case"col":return mt;default:throw new Error("unknown element type: #"+n.type)}}function r0(n,e){var t=n.root,i=t.id;let r,o;if(i&&(r=e.boCache||{},o=r[i],o))return{root:o,reviveCache:e};var s={};di(t).forEach(c=>{let u,f;t[c].$type?(f=r0({root:t[c]},e),u=f.root,e=f.reviveCache,r=e.boCache||{}):F(t[c])?u=t[c].map(h=>(f=r0({root:h},e),e=f.reviveCache,r=e.boCache||{},f.root)):u=t[c],s[c]=u});let a=s.$type;delete s.$type,(!e._keepIds||e._model.ids.assigned(s.id))&&delete s.id;var l=e._dmnFactory.create(a,s);return k(s,c=>{c.$type&&(c.$parent=l),F(c)&&c.forEach(u=>u.$parent=l)}),i&&(r={...r,[i]:l},e={...e,boCache:r}),{root:l,reviveCache:e}}var Ol=class{constructor(e,t,i,r,o,s,a,l){this._clipboard=e,this._dmnFactory=t,this._elementFactory=i,this._elementRegistry=r,this._eventBus=o,this._model=s,this._modeling=a,this._sheet=l}postExecute(e){let{element:t,after:i}=e,r=this._clipboard.get();if(!r)throw new Error("missing clipboard data");let o=this._sheet.getRoot(),s=o0(r.elements,{_dmnFactory:this._dmnFactory,_keepIds:r.keepIds,_model:this._model}).root;if(t instanceof pt){let a=o.rows.indexOf(t);if(a===-1)return;s.forEach(l=>{i&&a++,this._modeling.addRow(l,a)})}else if(t instanceof mt){let a=o.cols.indexOf(t);if(a===-1)return;s.forEach(l=>{i&&a++,this._modeling.addCol(l,a)})}return e.oldElements=this._clipboard.get(),this._sheet.getRoot()}revert(e){}};Ol.$inject=["clipboard","dmnFactory","elementFactory","elementRegistry","eventBus","moddle","modeling","sheet"];var kl=class{constructor(e,t,i,r,o,s){this._clipboard=e,this._commandStack=t,this._eventBus=i,this._modeling=r,this._sheet=o,this._rules=s,t.registerHandler("cut",Sl),t.registerHandler("paste",Ol)}copy(e){F(e)||(e=[e]);let t={elements:ag(e)};this._eventBus.fire("copyCutPaste.copy",{data:t}),this._clipboard.set(t)}cut(e){F(e)||(e=[e]);let t={elements:ag(e),keepIds:!0},i={elements:e,data:t};this._eventBus.fire("copyCutPaste.cut",{data:t}),this._commandStack.execute("cut",i)}pasteBefore(e){return this._paste(e,{before:!0})}pasteAfter(e){return this._paste(e,{after:!0})}_paste(e,t){let i=this._clipboard.get();return i?this._rules.allowed("paste",{data:i.elements,target:e})?(this._commandStack.execute("paste",{element:e,...t}),this._clipboard.clear(),!0):!1:void 0}pasteAt(e){}};kl.$inject=["clipboard","commandStack","eventBus","modeling","sheet","rules"];var lg={__depends__:[sg,El],__init__:["copyCutPaste"],copyCutPaste:["type",kl]};var Rl=class{constructor(e,t,i,r,o,s){let a={addRule(){return i.addRow({type:"dmn:DecisionRule"})},addRuleAbove(l){let c=l&&l.rule;if(!c&&!r.hasSelection())return;c=c||r.get().row;let u=s.getRoot(),f=u.rows.indexOf(c);if(f!==-1)return i.addRow({type:"dmn:DecisionRule"},f)},addRuleBelow(l){let c=l&&l.rule;if(!c&&!r.hasSelection())return;c=c||r.get().row;let u=s.getRoot(),f=u.rows.indexOf(c);if(f!==-1)return i.addRow({type:"dmn:DecisionRule"},f+1)},removeRule(l){let c=l&&l.rule;!c&&!r.hasSelection()||(c=c||r.get().row,i.removeRow(c))},addInput(){let l=s.getRoot(),c=l.businessObject,{input:u}=c;return i.addCol({type:"dmn:InputClause"},u?u.length:0)},addInputLeft(l){let c=l&&l.input;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:InputClause"},f)},addInputRight(l){let c=l&&l.input;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:InputClause"},f+1)},removeInput(l){let c=l&&l.input;!c&&!r.hasSelection()||(c=c||r.get().col,i.removeCol(c))},addOutput(){let l=s.getRoot(),c=l.businessObject,u=c.get("input"),f=c.get("output");return i.addCol({type:"dmn:OutputClause"},u.length+f.length)},addOutputLeft(l){let c=l&&l.output;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:OutputClause"},f)},addOutputRight(l){let c=l&&l.output;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:OutputClause"},f+1)},removeOutput(l){let c=l&&l.output;!c&&!r.hasSelection()||(c=c||r.get().col,i.removeCol(c))},addClause(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.addInput({input:l});if(O(l,"dmn:OutputClause"))return a.addOutput({output:l})},addClauseLeft(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.addInputLeft({input:l});if(O(l,"dmn:OutputClause"))return a.addOutputLeft({output:l})},addClauseRight(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.addInputRight({input:l});if(O(l,"dmn:OutputClause"))return a.addOutputRight({output:l})},removeClause(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.removeInput({input:l});if(O(l,"dmn:OutputClause"))return a.removeOutput({output:l})},selectCellAbove(){return o.selectCell("above")},selectCellBelow(){return o.selectCell("below")},copy({element:l}){e.copy(l)},cut({element:l}){e.cut(l)},pasteBefore({element:l}){return e.pasteBefore(l)},pasteAfter({element:l}){return e.pasteAfter(l)}};t.register(a)}};Rl.$inject=["copyCutPaste","editorActions","modeling","selection","cellSelection","sheet"];var kR="is not a registered action",k5="is already registered",Tl=class{constructor(e,t,i,r){this._actions={undo(){e.undo()},redo(){e.redo()},select({cell:o}){r.select(o)},deselect(){r.deselect()},addRow({attrs:o,index:s}){i.addRow(o,s)},removeRow({row:o}){i.removeRow(o)},moveRow({row:o,index:s}){i.moveRow(o,s)},addCol({attrs:o,index:s}){i.addCol(o,s)},removeCol({col:o}){i.removeCol(o)},moveCol({col:o,index:s}){i.moveCol(o,s)}}}trigger(e,t){if(!this._actions[e])throw s0(e,kR);return this._actions[e](t)}register(e,t){if(typeof e=="string")return this._registerAction(e,t);k(e,(i,r)=>{this._registerAction(r,i)},this)}_registerAction(e,t){if(this.isRegistered(e))throw s0(e,k5);this._actions[e]=t}unregister(e){if(!this.isRegistered(e))throw s0(e,kR);this._actions[e]=void 0}isRegistered(e){return!!this._actions[e]}};Tl.$inject=["commandStack","eventBus","modeling","selection"];function s0(n,e){return new Error(n+" "+e)}var cg={__depends__:[Mo],__init__:["editorActions"],editorActions:["type",Tl]};var Jn={__depends__:[Po,lg,cg,Mo],__init__:["decisionTableEditorActions"],decisionTableEditorActions:["type",Rl]};var RR={__depends__:[Jn],__init__:["addRule"],addRule:["type",yl]};var PR=Pw(AR());function MR(n,e,t){var i=n.start,r=i,o=e.substring(i);t.lastIndexOf(o)===t.length-o.length&&(e=e.substring(0,e.length-o.length),t=t.substring(0,t.length-o.length));var s=A5(e,t);return s&&(s.type==="remove"?r=s.newStart:r=s.newEnd),M5(r)}function A5(n,e){var t,i,r,o=0,s,a,l=0;for(e.length>n.length?(i=e,s=n):(i=n,s=e);o<i.length;)r=i.charAt(o),a=s.charAt(l),r!==a?(t||(t={l_start:o,s_start:l}),o++):(t&&!t.complete&&(t.l_end=o,t.s_end=l,t.complete=!0),l++,o++);if(t&&!t.complete&&(t.complete=!0,t.s_end=s.length,t.l_end=i.length),!!t)return e.length>n.length?{newStart:t.l_start,newEnd:t.l_end,type:"add"}:{newStart:t.s_start,newEnd:t.s_end,type:e.length<n.length?"remove":"replace"}}function M5(n,e){return{start:n,end:e===void 0?n:e}}var Tn=class extends L{constructor(t,i){super(t,i);M(this,"onFocus",t=>{var i=this.props.onFocus;this.setState({focussed:!0}),typeof i=="function"&&i(t)});M(this,"onBlur",t=>{let{onBlur:i,onChange:r,value:o}=this.props;if(this.setState({focussed:!1}),typeof r=="function"&&this.node){let s=ug(this.node);s!==o&&r(s)}typeof i=="function"&&i(t)});M(this,"onkeydown",t=>{if(t.which===13){if(t.preventDefault(),this.props.ctrlForNewline&&!I5(t)||this.props.singleLine)return;t.stopPropagation(),D5(),this.onInput(t)}});M(this,"onInput",t=>{var i=this.props.onInput;if(typeof i=="function"){var r=ug(this.node);i(r)}});M(this,"onPaste",t=>{if(this.props.singleLine){let i=(t.clipboardData||window.clipboardData).getData("text");document.execCommand("insertText",!1,i.replace(/\n/g," ")),t.preventDefault()}});this.state={}}componentWillUpdate(t,i){var r=this.node,o=i.focussed&&wl(r);this.selected=o&&{range:o,text:ug(r)}}componentDidUpdate(){var t=this.selected;if(!t)return;let i=t.range,r=t.text,o=this.node,s=ug(o),a=s!==r?MR(i,r,s):i;rg(o,a)}getClassName(){let{className:t,placeholder:i,value:r}=this.props;return[t||"","content-editable",!r&&i?"placeholder":""].join(" ")}render(t){var{label:i,value:r,placeholder:o}=t;return r=(0,PR.default)(r).replace(/\r?\n/g,"<br/>")+"<br/>",y(1,"div",this.getClassName(),null,1,{"aria-label":i,role:"textbox","aria-multiline":!this.props.singleLine,tabIndex:"0",contentEditable:"true",spellCheck:"false","data-placeholder":o||"",onInput:this.onInput,onkeypress:this.onkeypress,onPaste:this.onPaste,onFocus:this.onFocus,onBlur:this.onBlur,onkeydown:this.onkeydown,dangerouslySetInnerHTML:{__html:r}},null,s=>this.node=s)}};function P5(){return document.createElement("br")}function ug(n){return n.innerText.replace(/\n$/,"")}function D5(){var n=yR(),e=n.getRangeAt(0);if(e){var t=e.cloneRange(),i=P5();t.deleteContents(),t.insertNode(i),t.setStartAfter(i),t.setEndAfter(i),Zx(t)}}function I5(n){return n.metaKey||n.ctrlKey}var an=class extends L{constructor(t,i){super(t,i);M(this,"onFocus",t=>{this.setState({focussed:!0});var{onFocus:i}=this.props;typeof i=="function"&&i(t)});M(this,"onBlur",t=>{this.setState({focussed:!1});let{invalid:i}=this.state;i&&this.setState({changing:!1,invalid:!1});let{onBlur:r}=this.props;typeof r=="function"&&r(t)});this.state={changing:!1,focussed:!1};let{injector:r}=i,o=r.get("debounceInput");this.inputChanged=o(s=>{let{onChange:a}=this.props;typeof a=="function"&&a(s);let l=this.state.changing;this.setState({changing:l===s?!1:l})}),this.onInput=s=>{var a=this.props.validate||function(){},l=a(s);this.setState({changing:s,invalid:l}),l||this.inputChanged(s)}}getClassName(){var{className:t,value:i}=this.props,{changing:r,focussed:o,invalid:s}=this.state;return t+=" editable",o&&(t+=" focussed"),s&&(t+=" invalid"),!i&&!r&&(t+=" empty"),t}getDisplayValue(){var{value:t,placeholder:i}=this.props,{focussed:r,changing:o}=this.state;return typeof o=="string"&&(t=o),t||(t=r?"":i||""),t}getEditor(t={}){return P(2,Tn,{className:t.className,ctrlForNewline:this.props.ctrlForNewline,label:this.props.label,onFocus:this.onFocus,onBlur:this.onBlur,onInput:this.onInput,value:this.getDisplayValue()})}};var Al=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});M(this,"setAnnotationValue",t=>{let{row:i}=this.props;this.modeling.editAnnotation(i.businessObject,t)});Ce(this)}componentWillMount(){let{row:t}=this.props;this.changeSupport.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){let{row:t}=this.props;this.changeSupport.offElementsChanged(t.id,this.onElementsChanged)}render(){let{row:t,rowIndex:i}=this.props,{description:r,id:o}=t.businessObject;return P(2,Rn,{className:"annotation",onChange:this.setAnnotationValue,coords:`${i}:annotation`,value:r,elementId:o,"data-row-id":t.id,children:P(2,a0,{label:this.translate("Annotation"),ctrlForNewline:!0,className:"annotation-editor",onChange:this.setAnnotationValue,value:r})})}};Al.$inject=["changeSupport","modeling","translate"];var a0=class extends an{render(){return y(1,"div",this.getClassName(),this.getEditor(),0)}};function fg(n){n.onGetComponent("cell",({cellType:e})=>{if(e==="after-label-cells")return To;if(e==="after-rule-cells")return Al})}fg.$inject=["components"];var L5=300;function hg(n){return function(t){if(n!==!1){var i=se(n)?n:L5;return Mi(t,i)}else return t}}hg.$inject=["config.debounceInput"];var Kt={debounceInput:["factory",hg]};var DR={__depends__:[Kt],__init__:["annotationsProvider"],annotationsProvider:["type",fg]};function Ps(n,e,t){return(e=B5(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function B5(n){var e=N5(n,"string");return typeof e=="symbol"?e:e+""}function N5(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $5={position:"absolute"},Ml=class extends L{constructor(e,t){super(e,t),Ps(this,"open",({position:i,context:r})=>{this.close(),this.setState({isOpen:!0,position:i||{x:0,y:0},context:r||{}})}),Ps(this,"close",()=>{this.state.isOpen&&this.setState({context:void 0,isOpen:!1,position:{x:0,y:0}})}),Ps(this,"triggerClose",()=>{this.eventBus.fire("contextMenu.close")}),this.state={isOpen:!1,position:{x:0,y:0}},Ce(this)}componentDidMount(){this.eventBus.on("contextMenu.open",this.open),this.eventBus.on("contextMenu.close",this.close)}componentWillUnmount(){this.eventBus.off("contextMenu.open",this.open),this.eventBus.off("contextMenu.close",this.close)}render(){let{isOpen:e,context:t,position:i}=this.state;if(!e)return null;let r=this.components.getComponents("context-menu",t);return r.length?P(2,dg,{className:"context-menu no-deselect",context:t,position:i,offset:t.offset||{x:0,y:0},autoFocus:t.autoFocus!==!1,autoClose:t.autoClose!==!1,components:r,onClose:this.triggerClose}):null}};Ml.$inject=["eventBus","components"];var dg=class extends L{constructor(e,t){super(e,t),Ps(this,"onGlobalMouseDown",i=>{this.checkClose(i.target)}),Ps(this,"onGlobalKey",i=>{var r=i.which;(r===13||r===27)&&(i.stopPropagation(),i.preventDefault(),this.close())}),Ps(this,"onFocusChanged",i=>{this.checkClose(i.target)}),Ps(this,"setNode",i=>{this.node=i;let{autoFocus:r}=this.props;i&&(this.updatePosition(),r&&F5(i))}),Ce(this)}close(){let{onClose:e}=this.props;ge(e)&&e()}checkClose(e){let{autoClose:t}=this.props;if(t){var i=this.node;i&&i!==e&&(i.contains(e)||this.close())}}componentDidMount(){document.addEventListener("focusin",this.onFocusChanged),document.addEventListener("keydown",this.onGlobalKey),document.addEventListener("mousedown",this.onGlobalMouseDown)}componentWillUnmount(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("keydown",this.onGlobalKey),document.removeEventListener("mousedown",this.onGlobalMouseDown)}updatePosition(){let{position:e,offset:t}=this.props,{node:i}=this,r=i.getBoundingClientRect();e.width||(e.width=0),e.height||(e.height=0);let o=this.renderer.getContainer(),s=o.getBoundingClientRect();s.width>s.height?(this.node.classList.add("horizontal"),this.node.classList.remove("vertical")):(this.node.classList.add("vertical"),this.node.classList.remove("horizontal"));let{scrollLeft:a,scrollTop:l}=q5(i),c={},u;e.align&&(u=e.align.split("-"));let f,h;(u&&u[1]||(e.x+e.width/2>s.width/2?"left":"right"))==="left"?(f=e.x-s.left-r.width+t.x+a,i.classList.remove("right"),i.classList.add("left")):(f=-s.left+e.x+e.width-t.x+a,i.classList.remove("left"),i.classList.add("right")),f=u?f:IR(f,0+a,s.width-r.width+a),c.left=f+"px",(u&&u[0]||(e.y+e.height/2>s.height/2?"top":"bottom"))==="top"?(h=e.y-s.top-r.height+t.y+l,i.classList.remove("bottom"),i.classList.add("top")):(h=-s.top+e.y-t.y+l,i.classList.remove("top"),i.classList.add("bottom")),h=u?h:IR(h,0+l,s.height-r.height+l),c.top=h+"px",c.overflowY="auto",c.maxHeight=s.height-h+l+"px",T(this.node.style,$5,c)}render(){let{context:e,components:t,className:i}=this.props;return y(1,"div",i,t.map((r,o)=>P(2,r,{context:e},o)),0,{onContextMenu:r=>r.preventDefault()},null,this.setNode)}};dg.$inject=["renderer"];function IR(n,e,t){return Math.max(e,Math.min(t,n))}var j5=`
1939 "></span>`),document.body.appendChild(this._dragImage),t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(this._dragImage,0,0),e instanceof pt?jW(e,i):e instanceof mt&&FW(e,i),this._dragAndDrop.startDrag(e,t)}};Rc.$inject=["components","elementRegistry","eventBus","dragAndDrop","renderer","rules","sheet","translate"];function $W(n,e,t){let i=e.get(n.dataset.colId);if(!i)return-1;let{cols:r}=t.getRoot();return r.indexOf(i)}function p2(n,e,t){let i=n.dataset.rowId;if(!i)return;let r=pn(`[data-row-id=${i}]`,e);k(r,o=>{Tc(o)&&(ee(o).add("dragover"),ee(o).add(t))})}function m2(n,e,t){let i=n.dataset.colId;if(!i)return;let r=pn(`[data-col-id=${i}]`,e);k(r,o=>{Tc(o)&&(ee(o).add("dragover"),ee(o).add(t))})}function tw(n){let e=pn(".dragover",n);k(e,t=>{Tc(t)&&(ee(t).remove("dragover"),ee(t).remove("top"),ee(t).remove("right"),ee(t).remove("bottom"),ee(t).remove("left"))})}function jW(n,e){let t=pn(`[data-row-id=${n.id}]`,e);k(t,i=>{Tc(i)&&ee(i).add("dragged")})}function FW(n,e){let t=pn(`[data-col-id=${n.id}]`,e);k(t,i=>{Tc(i)&&ee(i).add("dragged")})}function qW(n){let e=pn(".dragged",n);k(e,t=>{Tc(t)&&ee(t).remove("dragged")})}function g2(n,e){let t=e.getBoundingClientRect();return n.clientX<t.left+t.width/2?iw:BW}function y2(n,e){let t=e.getBoundingClientRect();return n.clientY<t.top+t.height/2?nw:NW}function VW(n,e,t,i){return i.indexOf(n)>i.indexOf(e)&&(e=WW(e,i)),t===nw?zW(e,i):e}function HW(n,e,t,i){return i.indexOf(n)>i.indexOf(e)&&(e=QW(e,i)),t===iw?UW(e,i):e}function zW(n,e){let t=e.indexOf(n);return e[Math.max(0,t-1)]}function WW(n,e){let t=e.indexOf(n);return e[Math.min(e.length-1,t+1)]}function UW(n,e){let t=e.indexOf(n);if(Te(n)){let i=e.filter(o=>Te(o))[0],r=e.indexOf(i);return e[Math.max(r,t-1)]}return e[Math.max(0,t-1)]}function QW(n,e){let t=e.indexOf(n);if(ie(n)){let i=e.filter(s=>ie(s)),r=i[i.length-1],o=e.indexOf(r);return e[Math.min(o,t+1)]}return e[Math.min(e.length-1,t+1)]}function Tc(n){return n&&(n.nodeType===1||n.nodeType==11)}var v2={__depends__:[d2,El],__init__:["dmnDragAndDrop"],dmnDragAndDrop:["type",Rc]};var nd=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});M(this,"changeDescription",t=>{this._modeling.updateProperties(this._element,{description:t})});this._elementRegistry=i.injector.get("elementRegistry"),this._modeling=i.injector.get("modeling"),this._changeSupport=this.context.changeSupport;let{id:r}=this.props.context;this._element=this._elementRegistry.get(r)}componentWillMount(){this._element&&this._changeSupport.onElementsChanged(this._element.id,this.onElementsChanged)}componentDidMount(){let{autoFocus:t}=this.props.context;t&&this.node&&KW(this.node).focus()}componentWillUnmount(){if(this._element){this._changeSupport.offElementsChanged(this._element.id,this.onElementsChanged);let{businessObject:t}=this._element,{description:i}=t;Ie(i)&&!i.length&&this.changeDescription(null)}}render(){if(!this._element)return;let{businessObject:t}=this._element,{description:i}=t;if(Ie(i))return y(1,"div","context-menu-container description-editor",P(2,rw,{className:"dms-input",onChange:this.changeDescription,value:i}),2,null,null,r=>this.node=r)}},rw=class extends an{render(){return y(1,"div",this.getClassName(),this.getEditor(),0)}};function KW(n){return X(".content-editable",n)}var GW=500,XW=750,x2=26,Ac=class{constructor(e,t,i,r,o,s,a){M(this,"addDescription",e=>{this._modeling.updateProperties(e,{description:""});let t=this._renderer.getContainer(),r=Gi(e.id,t).getBoundingClientRect(),o=b2(t,r);this._contextMenu.open(o,{contextMenuType:"cell-description",id:e.id,autoFocus:!0,offset:{x:4,y:4}})});M(this,"removeDescription",e=>{this._modeling.updateProperties(e,{description:null}),this._contextMenu.close()});this._contextMenu=t,this._modeling=o,this._renderer=s,this._translate=a,r.on("cell.click",XW,l=>{if(l.defaultPrevented)return;let{target:c,id:u}=l,f=i.get(u);if(!Ge(f,["dmn:UnaryTests","dmn:LiteralExpression"]))return;_2(f)||l.preventDefault();let d=s.getContainer(),p=c.getBoundingClientRect(),m=b2(d,p);t.open(m,{contextMenuType:"cell-description",autoFocus:!1,id:u,offset:{x:4,y:4}})}),e.onGetComponent("context-menu",(l={})=>{if(l.contextMenuType&&l.contextMenuType==="cell-description"){let c=i.get(l.id),u=_2(c);if(Ie(u))return nd}}),e.onGetComponent("context-menu-cell-additional",GW,(l={})=>{if(l.contextMenuType&&l.contextMenuType==="context-menu"){let{id:c}=l;if(!c)return;let u=i.get(c);if(!u)return;let{businessObject:f}=u,{description:h}=f,d=Ie(h),p=d?"remove-description":"add-description",m=d?()=>this.removeDescription(u):()=>this.addDescription(u);return y(1,"div",`context-menu-group-entry ${p}`,Ie(h)?this._translate("Remove cell description"):this._translate("Add cell description"),0,{onClick:m})}})}};Ac.$inject=["components","contextMenu","elementRegistry","eventBus","modeling","renderer","translate"];function b2(n,e){let{top:t,left:i,width:r,height:o}=e;return{x:i+n.parentNode.scrollLeft-x2,y:t+n.parentNode.scrollTop,width:r+2*x2,height:o}}function _2(n){return n&&n.businessObject&&n.businessObject.description}var w2={__depends__:[Gt,_l],__init__:["description"],description:["type",Ac]};var Mc=class{constructor(e,t,i,r,o,s){this._modeling=i,this._translate=o,this._expressionLanguages=r,e.onGetComponent("context-menu-cell-additional",(a={})=>{if(a.contextMenuType&&a.contextMenuType==="context-menu"){let{event:l,id:c}=a;if(!c)return;let u=t.get(c);if(!u||!this._shouldDisplayContextMenuEntry(u))return;let f=h=>{s.open({x:(l||h).pageX,y:(l||h).pageY},{contextMenuType:"expression-language",id:c})};return y(1,"div","context-menu-group-entry",this._translate("Change cell expression language"),0,{onClick:f})}}),e.onGetComponent("context-menu",(a={})=>{if(a.contextMenuType&&a.contextMenuType==="expression-language"){let{id:l}=a;if(!l)return;let c=t.get(l);if(!c)return;let u=this._getElementExpressionLanguage(c),f=r.getAll(),h="context-menu-group-entry context-menu-entry-set-expression-language",d=this._translate("Expression language");return()=>y(1,"div","context-menu-flex",y(1,"div","context-menu-group",y(1,"div",h,[y(1,"div",null,d,0),P(2,pe,{label:d,className:"expression-language",onChange:p=>this.onChange(c,p),options:f,value:u})],4),2),2)}}),e.onGetComponent("context-menu",(a={})=>{if(a.contextMenuType==="input-edit")return()=>{let{inputExpression:l}=a.input;if(!this._shouldDisplayContextMenuEntry(l))return;let c=this._getElementExpressionLanguage(l),u=r.getAll(),f=this._translate("Expression language");return y(1,"div","context-menu-container ref-language",y(1,"div","dms-form-control",[y(1,"label","dms-label",f,0),P(2,pe,{label:f,className:"ref-language",value:c||"",onChange:h=>this.onChange(l,h),options:u})],4),2)}})}onChange(e,t){this._modeling.editExpressionLanguage(e,t)}_shouldDisplayContextMenuEntry(e){return this._expressionLanguages.getAll().length>1?!0:this._getElementExpressionLanguage(e)!==this._getDefaultElementExpressionLanguage(e)}_getElementExpressionLanguage(e){return Ke(e).expressionLanguage||this._getDefaultElementExpressionLanguage(e)}_getDefaultElementExpressionLanguage(e){return this._expressionLanguages.getDefault(ie(e.col)?"inputCell":"outputCell").value}};Mc.$inject=["components","elementRegistry","modeling","expressionLanguages","translate","contextMenu"];var C2={__depends__:[Qt],__init__:["expressionLanguage"],expressionLanguage:["type",Mc]};var Pc=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});M(this,"setDecisionTableName",t=>{this.modeling.editDecisionTableName(t)});Ce(this)}componentWillMount(){this.setupChangeListeners({bind:this.getBusinessObject().id})}componentWillUnmount(){this.setupChangeListeners({unbind:this.getBusinessObject().id})}setupChangeListeners({bind:t,unbind:i}){typeof i=="string"&&this.changeSupport.offElementsChanged(i,this.onElementsChanged),typeof t=="string"&&this.changeSupport.onElementsChanged(t,this.onElementsChanged)}getBusinessObject(){return this.sheet.getRoot().businessObject.$parent}render(){let t=this.getBusinessObject(),{name:i}=t,r=this.components.getComponent("hit-policy")||YW;return y(1,"div","decision-table-properties",[P(2,ow,{label:this.translate("Decision name"),className:"decision-table-name",value:i,ctrlForNewline:!0,onBlur:ZW,onChange:this.setDecisionTableName,elementId:"__decisionProperties_name",coords:"0:__decisionProperties"}),y(1,"div","decision-table-header-separator"),P(2,r)],4)}};Pc.$inject=["sheet","modeling","changeSupport","components","translate"];var ow=class extends an{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),Ut(this,Yf)}render(){let e=this.props.value,t=Ro(this.getSelectionClasses(),this.getClassName());return y(1,"div",t,this.getEditor(),0,{"data-element-id":this.props.elementId,"data-coords":this.props.coords,title:this._translate("Decision name: ")+e})}};function YW(){return null}function ZW(n){n.target.scroll(0,0)}var JW=500,Dc=class{constructor(e){e.onGetComponent("table.before",JW,()=>Pc)}};Dc.$inject=["components"];var E2={__depends__:[Kt],__init__:["decisionTableProperties"],decisionTableProperties:["type",Dc]};var Ic=class extends L{constructor(t,i){super(t,i);M(this,"onChange",({aggregation:t,hitPolicy:i})=>{this.modeling.editHitPolicy(i,t)});M(this,"onElementsChanged",()=>{this.forceUpdate()});this._translate=i.injector.get("translate"),Ce(this)}componentDidMount(){this.changeSupport.onElementsChanged(this.getRoot().id,this.onElementsChanged)}componentWillUnmount(){this.changeSupport.offElementsChanged(this.getRoot().id,this.onElementsChanged)}getRoot(){return this.sheet.getRoot()}render(){let t=this.getRoot(),i=t.businessObject,{aggregation:r,hitPolicy:o}=i,s=ye(oh,a=>e8(a.value,{aggregation:r,hitPolicy:o}));return y(1,"div","hit-policy",[y(1,"label","dms-label",this._translate("Hit policy:"),0),P(2,pe,{className:"hit-policy-edit-policy-select",label:this._translate("Hit policy"),onChange:this.onChange,options:oh.map(a=>({...a,label:this._translate(a.label)})),value:s.value,"data-hit-policy":"true",noInput:!0})],4,{title:this._translate(s.explanation)})}};Ic.$inject=["changeSupport","sheet","modeling"];function e8(n,e){return n.hitPolicy===e.hitPolicy&&n.aggregation===e.aggregation}function $y(n){n.onGetComponent("hit-policy",()=>Ic)}$y.$inject=["components"];var S2={__depends__:[Gt],__init__:["hitPolicyProvider"],hitPolicyProvider:["type",$y]};var Lc=class extends ae{constructor(e,t){super(e),this.executed(["row.add","row.remove","col.add","col.remove"],O2(i=>{var r=i.context,o=r.row||r.col;this.updateRoot(o,r.oldRoot)})),this.reverted(["row.add","row.remove","col.add","col.remove"],O2(i=>{var r=i.context,o=r.row||r.col;this.updateRoot(o,r.newRoot)}))}updateRoot(e,t){var i=e.root,r=e.businessObject;if(O(e,"dmn:DecisionRule")){if(t){let s=t.businessObject.get("rule"),a=s.indexOf(r);s.splice(a,1),r.$parent=null}if(i){let o=i.businessObject,s=i.rows.indexOf(e);o.get("rule").splice(s,0,r),r.$parent=o,e.cells.forEach((a,l)=>{this.wireCell(a,e,l)})}}if(O(e,"dmn:InputClause")||O(e,"dmn:OutputClause")){let o,s;if(t){let a=t.businessObject,l=a.get("input"),c=a.get("output");if(O(e,"dmn:InputClause")&&(o=l,s=l.indexOf(r)),O(e,"dmn:OutputClause")&&(o=c,s=c.indexOf(r)),s===-1)throw new Error("inconsistent model: clause not in table");o.splice(s,1),r.$parent=null,e.cells.forEach((u,f)=>{this.unwireCell(u,t.rows[f])})}if(i){let a=i.businessObject,l=a.get("input"),c=a.get("output"),u=i.cols.indexOf(e),f,h;O(e,"dmn:InputClause")&&(h=l,f=u),O(e,"dmn:OutputClause")&&(h=c,f=u-l.length),h.splice(f,0,r),r.$parent=a,e.cells.forEach((d,p)=>{this.wireCell(d,i.rows[p],u)})}}}unwireCell(e,t){var i=e.businessObject;let r=t.businessObject,o=r.get("inputEntry"),s=r.get("outputEntry"),a,l;if(O(e,"dmn:UnaryTests")&&(a=o),O(e,"dmn:LiteralExpression")&&(a=s),l=a.indexOf(i),l===-1)throw new Error("cell not in row");a.splice(l,1),i.$parent=null}wireCell(e,t,i){var r=e.businessObject;let o=t.businessObject,s=o.get("inputEntry"),a=o.get("outputEntry"),l,c;r.$parent!==o&&(O(e,"dmn:UnaryTests")&&(l=s,c=i),O(e,"dmn:LiteralExpression")&&(l=a,c=i-s.length),l.splice(c,0,r),r.$parent=o)}};Lc.$inject=["eventBus","sheet"];function O2(n){return function(e){var t=e.context,i=t.row||t.col;O(i,"dmn:DMNElement")&&n(e)}}var Bc=class{constructor(e){this._model=e}create(e,t={}){var i=this._model.create(e,t||{});return O(i,"dmn:InputClause")&&(t.inputExpression?i.inputExpression=t.inputExpression:(i.inputExpression=this.create("dmn:LiteralExpression",{typeRef:"string"}),i.inputExpression.$parent=i)),O(i,"dmn:OutputClause")&&(i.typeRef=t.typeRef||"string"),(O(i,"dmn:UnaryTests")||O(i,"dmn:LiteralExpression"))&&(i.text=t.text||""),this._ensureId(i),i}_needsId(e){return O(e,"dmn:DMNElement")}_ensureId(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))}};Bc.$inject=["moddle"];var Nc=class extends As{constructor(e){super(),this._dmnFactory=e}create(e,t){let i=this._dmnFactory,{businessObject:r,type:o,...s}=t;if(!r){if(!o){if(e==="root")o="dmn:DecisionTable";else if(e==="cell"){let{col:a}=s;O(a,"dmn:OutputClause")&&(o="dmn:LiteralExpression"),O(a,"dmn:InputClause")&&(o="dmn:UnaryTests")}if(!o)throw new Error("cannot guess <type>")}r=i.create(o)}return super.create(e,{businessObject:r,id:r.id,...s})}};Nc.$inject=["dmnFactory"];var $c=class{constructor(e,t){this._sheet=e,this._elementFactory=t}execute(e){let t=this._sheet,i=this._elementFactory,r=t.getRoot(),{row:o,index:s}=e;return typeof s=="undefined"&&(s=e.index=r.rows.length),e.newRoot=r,o.cells.length||r.cols.forEach((a,l)=>{let c=i.create("cell",{row:o,col:a});o.cells[l]=c}),t.addRow(o,s),t.getRoot()}revert(e){let{row:t}=e,i=this._sheet;return i.removeRow(t),i.getRoot()}};$c.$inject=["sheet","elementFactory"];var jc=class{constructor(e){this._sheet=e}execute(e){let t=this._sheet,i=t.getRoot(),{row:r}=e,o=e.oldIndex=i.rows.indexOf(r);if(e.oldRoot=r.root,o===-1)throw new Error(`row#${r.id} not in sheet`);return t.removeRow(r),t.getRoot()}revert(e){let{row:t,oldIndex:i}=e,r=this._sheet;return r.addRow(t,i),r.getRoot()}};jc.$inject=["sheet"];var Fc=class{constructor(e){this._modeling=e}preExecute(e){let{row:t}=e;this._modeling.removeRow(t)}postExecute(e){let{row:t,index:i}=e;this._modeling.addRow(t,i)}};Fc.$inject=["modeling"];var qc=class{constructor(e,t){this._sheet=e,this._elementFactory=t}execute(e){let t=this._sheet,i=this._elementFactory,r=t.getRoot(),{col:o,index:s}=e;return typeof s=="undefined"&&(s=e.index=r.cols.length),e.newRoot=r,o.cells.length||r.rows.forEach((a,l)=>{let c=i.create("cell",{row:a,col:o});o.cells[l]=c}),t.addCol(o,s),t.getRoot()}revert(e){let{col:t}=e,i=this._sheet;return i.removeCol(t),i.getRoot()}};qc.$inject=["sheet","elementFactory"];var Vc=class{constructor(e,t){this._sheet=e,this._elementFactory=t}execute(e){let t=this._sheet,{col:i}=e,r=e.oldRoot=i.root;if((e.oldIndex=r.cols.indexOf(i))===-1)throw new Error(`col#${i.id} not in sheet`);return t.removeCol(i),t.getRoot()}revert(e){let{col:t,oldIndex:i}=e,r=this._sheet;return r.addCol(t,i),r.getRoot()}};Vc.$inject=["sheet","elementFactory"];var Hc=class{constructor(e){this._modeling=e}preExecute(e){let{col:t}=e;this._modeling.removeCol(t)}postExecute(e){let{col:t,index:i}=e;this._modeling.addCol(t,i)}};Hc.$inject=["modeling"];var id=class{execute(e){let{cell:t}=e;return t}revert(e){let{cell:t}=e;return t}};var zc=class n{constructor(e,t,i){this._eventBus=e,this._elementFactory=t,this._commandStack=i,e.on("table.init",()=>{t8(this.getHandlers(),i)})}getHandlers(){return n._getHandlers()}static _getHandlers(){return{"row.add":$c,"row.remove":jc,"row.move":Fc,"col.add":qc,"col.remove":Vc,"col.move":Hc,"cell.edit":id}}_create(e,t){return t instanceof Oo?t:this._elementFactory.create(e,t)}addRow(e,t){let i=this._create("row",e),r={row:i,index:t};return this._commandStack.execute("row.add",r),i}removeRow(e){this._commandStack.execute("row.remove",{row:e})}moveRow(e,t){let i={row:e,index:t};this._commandStack.execute("row.move",i)}addCol(e,t){let i=this._create("col",e),r={col:i,index:t};return this._commandStack.execute("col.add",r),i}removeCol(e){this._commandStack.execute("col.remove",{col:e})}moveCol(e,t){let i={col:e,index:t};this._commandStack.execute("col.move",i)}editCell(e,t){let i={cell:e,...t};this._commandStack.execute("cell.edit",i)}};zc.$inject=["eventBus","elementFactory","commandStack"];function t8(n,e){k(n,function(t,i){e.registerHandler(i,t)})}var Wc=class{constructor(e,t,i){this._dmnFactory=e,this._moddle=t,this._modeling=i}execute(e){let{element:t,allowedValues:i}=e;return O(t,"dmn:InputClause")?(t.inputValues?e.oldAllowedValues=t.inputValues.text:jy(i)||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),jy(i)?t.inputValues&&delete t.inputValues:t.inputValues.text=i.join(",")):(t.outputValues&&t?e.oldAllowedValues=t.outputValues.text:jy(i)||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),jy(i)?t.outputValues&&delete t.outputValues:t.outputValues.text=i.join(",")),t}revert(e){let{element:t,oldAllowedValues:i}=e;return O(t,"dmn:InputClause")?i?(t.inputValues||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.inputValues.text=i):delete t.inputValues:i?(t.outputValues||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.outputValues.text=i):delete t.outputValues,t}};Wc.$inject=["dmnFactory","moddle","modeling"];function jy(n){return n===null}var sw="id",sr=class{constructor(e,t){this._elementRegistry=e,this._moddle=t}execute(e){let{element:t,properties:i}=e,r=Ke(t),{changed:o,oldProperties:s}=this.updateProperties(r,i);return e.oldProperties=s,[...o,t]}revert(e){let{element:t,oldProperties:i}=e;var r=Ke(t),{changed:o}=this.updateProperties(r,i);return[...o,t]}updateProperties(e,t){let i=this._moddle.ids;return st(t,(r,o,s)=>{let a=e.get(s);if(k2(o)){if(!R2(a)&&!k2(a))throw new Error(`non-existing property <${s}>: cannot update values`);let{changed:l,oldProperties:c}=this.updateProperties(a,o);return{changed:[...r.changed,...l,a],oldProperties:{...r.oldProperties,[s]:c}}}return s===sw&&n8(e,o)&&(i.unclaim(e[sw]),this._elementRegistry.updateId(e,o),i.claim(o,e)),e.set(s,o),{changed:r.changed,oldProperties:{...r.oldProperties,[s]:a}}},{changed:[],oldProperties:{}})}};sr.$inject=["elementRegistry","moddle"];function n8(n,e){return n[sw]!==e}function k2(n){return Me(n)&&Pe(n)&&!R2(n)}function R2(n){return!!(n!=null&&n.$type)}var Uc=class{constructor(e){this._moddle=e}execute(e){let t=this._moddle.ids,i=e.id,r=e.element;e.claiming?t.claim(i,r):t.unclaim(i)}revert(e){let t=this._moddle.ids,i=e.id,r=e.element;e.claiming?t.unclaim(i):t.claim(i,r)}};Uc.$inject=["moddle"];var Qc=class n extends zc{constructor(e,t,i,r){super(e,t,i),this._eventBus=e,this._elementFactory=t,this._commandStack=i,this._sheet=r}getHandlers(){return n._getHandlers()}static _getHandlers(){return T({},super._getHandlers(),{editAllowedValues:Wc,"element.updateProperties":sr,"id.updateClaim":Uc})}editDecisionTableName(e){let o={element:this._sheet.getRoot().businessObject.$parent,properties:{name:e}};this._commandStack.execute("element.updateProperties",o)}editDecisionTableId(e){let o={element:this._sheet.getRoot().businessObject.$parent,properties:{id:e}};this._commandStack.execute("element.updateProperties",o)}editHitPolicy(e,t){let o={element:this._sheet.getRoot().businessObject,properties:{hitPolicy:e,aggregation:t}};this._commandStack.execute("element.updateProperties",o)}updateProperties(e,t){let i={element:e,properties:t};this._commandStack.execute("element.updateProperties",i)}editInputExpression(e,t){let i={element:e,properties:t};this._commandStack.execute("element.updateProperties",i)}editOutputName(e,t){let i={element:e,properties:{name:t}};this._commandStack.execute("element.updateProperties",i)}editInputExpressionTypeRef(e,t){let i={element:e,properties:{typeRef:t}};this._commandStack.execute("element.updateProperties",i)}editOutputTypeRef(e,t){let i={element:e,properties:{typeRef:t}};this._commandStack.execute("element.updateProperties",i)}editCell(e,t){let i={element:e,properties:{text:t}};this._commandStack.execute("element.updateProperties",i)}editAnnotation(e,t){let i={element:e,properties:{description:t}};this._commandStack.execute("element.updateProperties",i)}editAllowedValues(e,t){let i={element:e,allowedValues:t};this._commandStack.execute("editAllowedValues",i)}editExpressionLanguage(e,t){let i={element:e,properties:{expressionLanguage:t}};this._commandStack.execute("element.updateProperties",i)}claimId(e,t){let i={id:e,element:t,claiming:!0};this._commandStack.execute("id.updateClaim",i)}unclaimId(e,t){let i={id:e,element:t};this._commandStack.execute("id.updateClaim",i)}};Qc.$inject=["eventBus","elementFactory","commandStack","sheet"];var Kc=class extends ae{constructor(e,t,i){super(e),this._ids=t.ids,this._modeling=i,this.preExecute(["row.add","col.add"],r=>{let o=r.context,s=o.row||o.col;this.claimId(s.businessObject),s.cells&&s.cells.forEach(a=>this.claimId(a.businessObject))})}claimId(e){e.id&&!this._ids.assigned(e.id)&&this._modeling.claimId(e.id,e),e.$descriptor.properties.forEach(t=>{let i=e[t.name];i&&(F(i)&&i.forEach(r=>this.claimId(r)),i.$type&&this.claimId(i))})}};Kc.$inject=["eventBus","moddle","modeling"];var Gc=class extends ae{constructor(e,t){super(e),this._modeling=t,this.preExecute(["row.remove","col.remove"],i=>{let r=i.context,o=r.row||r.col;this.unclaimId(o.businessObject),o.cells&&o.cells.forEach(s=>this.unclaimId(s.businessObject))})}unclaimId(e){e.id&&this._modeling.unclaimId(e.id,e),e.$descriptor.properties.forEach(t=>{let i=e[t.name];i&&(F(i)&&i.forEach(r=>this.unclaimId(r)),i.$type&&this.unclaimId(i))})}};Gc.$inject=["eventBus","modeling"];var T2={__init__:["idClaimBehavior","idUnclaimBehavior"],idClaimBehavior:["type",Kc],idUnclaimBehavior:["type",Gc]};var A2={__init__:["dmnUpdater","idChangeBehavior","nameChangeBehavior","modeling"],__depends__:[T2,xs],dmnUpdater:["type",Lc],dmnFactory:["type",Bc],elementFactory:["type",Nc],idChangeBehavior:["type",Gn],nameChangeBehavior:["type",qi],modeling:["type",Qc]};var rd=class extends L{constructor(e,t){super(e,t),this.changeCellValue=this.changeCellValue.bind(this),this.onElementsChanged=this.onElementsChanged.bind(this)}onElementsChanged(){this.forceUpdate()}componentWillMount(){let{injector:e}=this.context,{cell:t}=this.props,i=this._changeSupport=this.context.changeSupport;this._modeling=e.get("modeling"),i.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){let{cell:e}=this.props;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}changeCellValue(e){let{cell:t}=this.props;this._modeling.editCell(t.businessObject,e)}render(){let{cell:e,rowIndex:t,row:i,col:r,colIndex:o}=this.props,s=O(e,"dmn:UnaryTests"),a=e.businessObject;return P(2,Rn,{className:s?"input-cell":"output-cell",elementId:e.id,coords:`${t}:${o}`,"data-row-id":i.id,"data-col-id":r.id,children:P(2,lw,{placeholder:s?"-":"",onChange:this.changeCellValue,value:a.text,businessObject:a})})}},aw=class extends L{constructor(e,t){super(e,t),this.state={focussed:!1},this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}onFocus(){this.setState({focussed:!0})}onBlur(){this.setState({focussed:!1})}render(){let{focussed:e}=this.state;return y(1,"div",`feel-editor${e?" focussed":""}`,[e&&En(P(2,Ri,{...this.props,autoFocus:!0,onBlur:this.onBlur})),En(P(2,Tn,{...this.props,onInput:()=>{},onFocus:this.onFocus}))],0,{onClick:this.onFocus})}},lw=class extends L{constructor(e,t){super(e,t),this._expressionLanguages=t.injector.get("expressionLanguages"),this._translate=t.injector.get("translate"),this._variableResolver=t.injector.get("variableResolver",!1)}isDefaultExpressionLanguage(e){let{expressionLanguage:t}=e,i=this.getDefaultExpressionLanguage().value;return!t||t===i}getDescription(e){return e.description}getExpressionLanguageLabel(e){let{expressionLanguage:t}=e,i=this.getDefaultExpressionLanguage();return this._expressionLanguages.getLabel(t)||i.label}isScript(){let{businessObject:e}=this.props,t=this.getDefaultExpressionLanguage();return this._isInputCell()?e.text.indexOf(`
214 `,pk={width:135,height:46},mk={width:100,height:63};function Dx(n,e,t){return Q("path",{d:n,strokeWidth:2,transform:`translate(${e.x}, ${e.y})`,...t})}var Dm=5;function Ya(n,e){thi global() property
[all...]
H A Ddmn-viewer.production.min.js16 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+a+o+"</svg>";t({svg:c})})});Ve.prototype.getModules=function(){return this._modules};Ve.prototype.destroy=function(){kn.prototype.destroy.call(this),$e(this._container)};Ve.prototype.on=function(n,e,t,i){return this.get("eventBus").on(n,e,t,i)};Ve.prototype.off=function(n,e){this.get("eventBus").off(n,e)};Ve.prototype._init=function(n,e){var{additionalModules:t,canvas:i,...r}=e,s=e.modules||this.getModules(),o=[{drd:["value",this]}],a=[...o,...s,...t||[]],l={...r,canvas:{...i,container:n},modules:a};kn.call(this,l),e&&e.container&&this.attachTo(e.container)};Ve.prototype._emit=function(n,e){return this.get("eventBus").fire(n,e)};Ve.prototype._createContainer=function(){return le('<div class="dmn-drd-container"></div>')};Ve.prototype.open=function(n){var e=this;return new Promise((t,i)=>{var r;try{return e._definitions&&e.clear(),e._definitions=n,tm(e,n,function(s,o){s?(s.warnings=o||[],i(s)):t({warnings:o||[]})})}catch(s){r=s}r?(r.warnings=r.warnings||[],i(r)):t({warnings:[]})})};Ve.prototype.attachTo=function(n){if(!n)throw new Error("parentNode required");this.detach();var e=this._container;n.appendChild(e),this._emit("attach",{}),this.get("canvas").resized()};Ve.prototype.detach=function(){var n=this._container,e=n.parentNode;e&&(this._emit("detach",{}),e.removeChild(n))};Ve.prototype._modules=[Nm,rt,Hm,za,Ym,Gm];var fr=class{constructor(e){D(this,e),En(this,"businessObject",{writable:!0})}},Ou=class extends fr{constructor(e){super(e),En(this,"rows",{enumerable:!0,value:this.rows||[]}),En(this,"cols",{enumerable:!0,value:this.cols||[]})}},ku=class extends fr{constructor(e){super(e),En(this,"root",{writable:!0}),En(this,"cells",{enumerable:!0,value:this.cells||[]})}},Cu=class extends fr{constructor(e){super(e),En(this,"root",{writable:!0}),En(this,"cells",{enumerable:!0,value:this.cells||[]})}},Su=class extends fr{constructor(e){super(e),En(this,"row",{writable:!0}),En(this,"col",{writable:!0})}},vk={root:Ou,row:ku,col:Cu,cell:Su};function Jm(n,e){let t=vk[n];if(!t)throw new Error("unknown type "+n);return new t(e)}function En(n,e,t){Object.defineProperty(n,e,t)}var zs=class{constructor(){this._uid=12}create(e,t={}){return t.id||(t.id=e+"_"+this._uid++),Jm(e,t)}createRoot(e){return this.create("root",e)}createRow(e){return this.create("row",e)}createCol(e){return this.create("col",e)}createCell(e){return this.create("cell",e)}};var hr=class{constructor(e){this._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}add(e,t){let{id:i}=e;this._elements[i]=e}remove(e){let t=e.id||e;delete this._elements[t]}get(e){return this._elements[e]}getAll(){return Eu(this._elements)}forEach(e){Eu(this._elements).forEach(t=>e(t))}filter(e){return Eu(this._elements).filter(t=>e(t))}clear(){this._elements={}}updateId(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}_validateId(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}};hr.$inject=["eventBus"];function Eu(n){return Object.keys(n).map(function(e){return n[e]})}var dr=class{constructor(e){this._listeners={},e.on("elements.changed",({elements:t})=>{this.elementsChanged(t)}),e.on("root.remove",t=>{let i=t.root.id;this._listeners[i]&&e.once("root.add",r=>{let s=r.root.id;this.updateId(i,s)})}),e.on("element.updateId",({element:t,newId:i})=>{this.updateId(t.id,i)})}elementsChanged(e){let t={},i=e.length;for(let r=0;r<i;r++){let{id:s}=e[r];if(t[s])return;t[s]=!0;let o=this._listeners[s]&&this._listeners[s].length;if(o)for(let a=0;a<o;a++)this._listeners[s][a]&&this._listeners[s][a]()}}onElementsChanged(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}offElementsChanged(e,t){if(this._listeners[e])if(t){let i=this._listeners[e].indexOf(t);i!==-1&&this._listeners[e].splice(i,1)}else this._listeners[e].length=0}updateId(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}};dr.$inject=["eventBus"];var xk=1e3,Ws=class{constructor(){this._listeners={}}getComponent(e,t){let i=this._listeners[e];if(!i)return;let r;for(let s=0;s<i.length&&(r=i[s].callback(t),!r);s++);return r}getComponents(e,t){let i=this._listeners[e],r=[];if(!i)return r;for(let s=0;s<i.length;s++){let o=i[s].callback(t);o&&r.push(o)}return r.length,r}onGetComponent(e,t,i){if(Ie(t)&&(i=t,t=xk),!Ce(t))throw new Error("priority must be a number");let r=this._getListeners(e),s,o,a={priority:t,callback:i};for(o=0;s=r[o];o++)if(s.priority<t){r.splice(o,0,a);return}r.push(a)}offGetComponent(e,t){let i=this._getListeners(e),r,s,o;if(t)for(o=i.length-1;r=i[o];o--)s=r.callback,s===t&&i.splice(o,1);else i.length=0}_getListeners(e){let t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}};var Hs=class extends z{constructor(e){super(e);let t=this._injector=e.injector;this._sheet=t.get("sheet"),this._changeSupport=t.get("changeSupport"),this._components=t.get("components"),this._eventBus=t.get("eventBus");let i=t.get("throttle");this.onElementsChanged=this.onElementsChanged.bind(this),this.onScroll=i(this.onScroll.bind(this))}onElementsChanged(){this.forceUpdate()}onScroll(){this._eventBus.fire("sheet.scroll")}getChildContext(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}componentWillMount(){let{id:e}=this._sheet.getRoot();this._changeSupport.onElementsChanged(e,this.onElementsChanged)}componentWillUnmount(){let{id:e}=this._sheet.getRoot();this._changeSupport.offElementsChanged(e,this.onElementsChanged)}render(){let{rows:e,cols:t}=this._sheet.getRoot(),i=this._components.getComponents("table.before"),r=this._components.getComponents("table.after"),s=this._components.getComponent("table.head"),o=this._components.getComponent("table.body"),a=this._components.getComponent("table.foot");return E(1,"div","tjs-container",[i&&i.map((l,c)=>F(2,l,null,c)),E(1,"div","tjs-table-container",E(1,"table","tjs-table",[s&&F(2,s,{rows:e,cols:t}),o&&F(2,o,{rows:e,cols:t}),a&&F(2,a,{rows:e,cols:t})],0),2,{onScroll:this.onScroll}),r&&r.map((l,c)=>F(2,l,null,c))],0)}};var pr=class{constructor(e,t,i,r,s){let{container:o}=i;this._container=o,r.on("root.added",()=>{or(F(2,Hs,{injector:s}),o)}),r.on("root.remove",()=>{or(null,o)})}getContainer(){return this._container}};pr.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var Ha={__init__:["changeSupport","components","renderer"],changeSupport:["type",dr],components:["type",Ws],renderer:["type",pr]};var mr=class{constructor(e,t){this._elementRegistry=e,this._eventBus=t,this._root=null,t.on("table.clear",()=>{this.setRoot(null)})}setRoot(e){if(this._root){let t=this._root;this._eventBus.fire("root.remove",{root:t}),this._root=null,this._eventBus.fire("root.removed",{root:t})}e&&this._eventBus.fire("root.add",{root:e}),this._root=e,e&&this._eventBus.fire("root.added",{root:e})}getRoot(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}addRow(e,t){let i=this.getRoot();if(i.cols.length!=e.cells.length)throw new Error("number of cells is not equal to number of cols");return typeof t=="undefined"&&(t=i.rows.length),Xa(t,i.rows,e),e.root=i,this._elementRegistry.add(e),e.cells.forEach((r,s)=>{this._elementRegistry.add(r),r.row=e,r.col=i.cols[s],Xa(t,i.cols[s].cells,r)}),this._eventBus.fire("row.add",{row:e}),e}removeRow(e){let t=this.getRoot();typeof e=="string"&&(e=this._elementRegistry.get(e));let i=t.rows.indexOf(e);i!==-1&&(Ua(i,t.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((r,s)=>{this._elementRegistry.remove(r),r.col=void 0,Ua(i,t.cols[s].cells)}),this._eventBus.fire("row.remove",{row:e}))}addCol(e,t){let i=this.getRoot();if(this._elementRegistry.add(e),i.rows.length!=e.cells.length)throw new Error("number of cells is not equal to number of rows");return typeof t=="undefined"&&(t=i.cols.length),Xa(t,i.cols,e),e.root=i,e.cells.forEach((r,s)=>{this._elementRegistry.add(r),r.col=e,r.row=i.rows[s],Xa(t,i.rows[s].cells,r)}),this._eventBus.fire("col.add",{col:e}),e}removeCol(e){let t=this.getRoot();typeof e=="string"&&(e=this._elementRegistry.get(e));let i=t.cols.indexOf(e);i!==-1&&(Ua(i,t.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((r,s)=>{this._elementRegistry.remove(r),r.row=void 0,Ua(i,t.rows[s].cells)}),this._eventBus.fire("col.remove",{col:e}))}resized(){this._eventBus.fire("sheet.resized")}};mr.$inject=["elementRegistry","eventBus"];function Xa(n,e,t){return e.splice(n,0,t)}function Ua(n,e){return e.splice(n,1)}function Ya(n=!0){let e=typeof n=="number"?n:n?300:0;return e?t=>Wd(t,e):t=>t}Ya.$inject=["config.throttle"];var Zm={__depends__:[Ha],__init__:["elementFactory","sheet"],elementFactory:["type",zs],elementRegistry:["type",hr],eventBus:["type",ye],sheet:["type",mr],throttle:["factory",Ya]};var Xs=class{constructor(e={}){let{injector:t}=e;if(!t){let{modules:i,config:r}=this._init(e);t=bk(r,i)}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}_init(e){let{modules:t,...i}=e;return{modules:t,config:i}}destroy(){let e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}clear(){let e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}};function bk(n,e){let t=[{config:["value",n]},Zm].concat(e||[]),i=new xi(t);return i.init(),i}var eg=Xs;function Ka(n){if(!n)return"<null>";let e=n.id?` id="${n.id}"`:"";return`<${n.$type}${e} />`}function Au(n,e){function t(l,c,u){var f=l.gfx;if(f)throw new Error(`already rendered ${Ka(l)}`);return n.element(l,c,u)}function i(l){return n.table(l)}function r(l){l.id||(l.id="decision");let c=l.decisionLogic;if(c){if(!c.output)throw new Error(`missing output for ${Ka(c)}`);let u=i(c);c.input&&s(c.input,u,c),s(c.output,u,c),o(c.rule,u,c)}else throw new Error(`no table for ${Ka(l)}`)}function s(l,c,u){B(l,function(f){t(f,c,u)})}function o(l,c,u){B(l,function(f){t(f,c,u),a(f.inputEntry,f),a(f.outputEntry,f)})}function a(l,c,u){B(l,function(f){t(f,c,u)})}return{handleDecision:r}}function tg(n,e,t){let i=n.get("tableImporter"),r=n.get("eventBus"),s=n.get("sheet"),o=n.get("modeling",!1),a,l=[];function c(u){let f={create(d,p,m,y){return i.create(d,p,m,y)},table(d){return i.add(d)},element(d,p,m){return i.add(d,p,m)},error(d,p){l.push({message:d,context:p})}};new Au(f,{canAddMissingEntries:o}).handleDecision(u)}r.fire("import.render.start",{decision:e});try{c(e)}catch(u){a=u}r.fire("import.render.complete",{error:a,warnings:l}),r.fire("elements.changed",{elements:[s.getRoot()]}),t(a,l)}function wk(){return{elements:[],index:{}}}function ng(n,e){let{elements:t,index:i}=n;return i[e]?n:{elements:[...t,e],index:{...i,[e]:!0}}}function Ok(n,e){return n.elements.join(e)}function gr(...n){let e=wk();return n.forEach(function(t){let i=typeof t;i==="string"&&t.length>0?e=ng(e,t):i==="object"&&t!==null&&Object.keys(t).forEach(function(r){t[r]&&(e=ng(e,r))})}),Ok(e," ")}function zt(n){let e=n.constructor;return Ga(e,n)}function Ga(n,e){let t=n.$inject;if(!t)return;let{injector:i}=e.context,r=[...t,function(...s){for(let o in s){let a=t[o],l=s[o];e[a]=l}}];i.invoke(r)}function _u(n,...e){return function(...t){let i;return e.forEach(function(r){if(i=r.call(n,...t),typeof i!="undefined")return!1}),i}.bind(n)}function cn(n,e){Object.keys(e).forEach(function(t){if(t==="$inject"||t==="__init")return;let i=e[t];t==="constructor"&&i.call(n,n.props,n.context);let r=n[t];if(typeof r!="undefined"){if(typeof r!="function")throw new Error(`failed to mixin <${t}>: cannot combine with non-fn component value`);n[t]=_u(n,r,i)}else n[t]=i.bind(n)}),"$inject"in e&&Ga(e,n),"__init"in e&&e.__init.call(n,n.props,n.context)}var ig={getSelectionClasses(){let{selected:n,selectedSecondary:e,focussed:t}=this.state;return gr({selected:n,"selected-secondary":e,focussed:t})},selectionChanged(n){this.setState(n)},componentWillUpdate(n){n.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate(n){n.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount(){this.updateSelectionSubscription(!0)},componentWillUnmount(){this.updateSelectionSubscription(!1)},updateSelectionSubscription(n){let{elementId:e}=this.props;e&&e&&this.eventBus[n?"on":"off"](`selection.${e}.changed`,this.selectionChanged)}},Tu=ig;ig.$inject=["eventBus"];var Us=class extends z{constructor(e,t){super(e,t),cn(this,Tu),zt(this)}getRenderProps(...e){let{className:t,elementId:i,coords:r,...s}=this.props,o={className:gr(...e,this.getSelectionClasses(),t)};return i&&(o["data-element-id"]=i),r&&(o["data-coords"]=r),{...o,...s}}};var An=class extends Us{constructor(e,t){super(e,t),this.state={}}render(){let{children:e}=this.props,t=this.getRenderProps("cell");return on(E(1,"td",null,e,0,{...t}))}};var rg={slotFill(n,e){let{type:t,context:i,...r}=n,s=this.components.getComponent(t,i)||e;return s?on(F(2,s,{...i,...r})):null},slotFills(n){let{type:e,context:t,...i}=n;return this.components.getComponents(e,t).map(s=>on(F(2,s,{...t,...i})))}},Ci=rg;rg.$inject=["components"];var sg=400,yr=class extends z{constructor(t,i){super(t,i);$(this,"onElementsChanged",()=>{this.forceUpdate()});cn(this,Ci),zt(this)}componentDidMount(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}componentWillUnmount(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}getRoot(){return this.sheet.getRoot()}render(){let r=(this.getRoot().businessObject.get("annotationsWidth")||sg)+"px";return E(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:sg}}),this.translate("Annotations")],0,{style:{width:r}})}};yr.$inject=["changeSupport","sheet","translate"];function Mu(n){let{row:e}=n,{id:t,description:i}=e.businessObject;return F(2,An,{className:"annotation",elementId:t,children:i||"-"})}function Ja(n){n.onGetComponent("cell",({cellType:e})=>{if(e==="after-label-cells")return yr;if(e==="after-rule-cells")return Mu})}Ja.$inject=["components"];var og={__init__:["annotationsProvider"],annotationsProvider:["type",Ja]};function Ys(n,e){return D({id:n.id,type:n.$type,businessObject:n},e)}var vr=class{constructor(e,t,i){this._elementFactory=e,this._eventBus=t,this._sheet=i}add(e){let t;if(Q(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(Ys(e)),this._sheet.setRoot(t);else if(Q(e,"dmn:InputClause"))t=this._elementFactory.createCol(Ys(e)),this._sheet.addCol(t);else if(Q(e,"dmn:OutputClause"))t=this._elementFactory.createCol(Ys(e)),this._sheet.addCol(t);else if(Q(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);let i=[...e.inputEntry,...e.outputEntry].map(r=>this._elementFactory.createCell(Ys(r)));t=this._elementFactory.createRow(D(Ys(e),{cells:i})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}};vr.$inject=["elementFactory","eventBus","sheet"];var ag={__depends__:[rt],tableImporter:["type",vr]};var lg={__depends__:[ag,Ha]};var Ks=class extends z{constructor(t,i){super(t,i);$(this,"onElementsChanged",()=>{this.forceUpdate()});cn(this,Ci),this._sheet=i.injector.get("sheet"),this._changeSupport=i.changeSupport}componentWillMount(){let t=this._sheet.getRoot();this._changeSupport.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){let t=this._sheet.getRoot();this._changeSupport.offElementsChanged(t.id,this.onElementsChanged)}render(){let t=this._sheet.getRoot();if(!Q(t,"dmn:DMNElement"))return null;let i=Ot(t),r=i.input,s=i.output;return E(1,"thead",null,E(1,"tr",null,[E(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),r&&r.map((o,a)=>{let l=o.width||"192px";return this.slotFill({type:"cell",context:{cellType:"input-header",input:o,index:a,inputsLength:r.length,width:l},key:o.id},kk)}),s.map((o,a)=>this.slotFill({type:"cell",context:{cellType:"output-header",output:o,index:a,outputsLength:s.length},key:o.id},Ck)),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}};function kk(n,e){let{input:t,className:i,index:r}=n,{label:s,inputExpression:o,inputValues:a}=t,l=e.injector.get("translate"),c=(i||"")+" input-cell";return E(1,"th",c,[E(1,"div","clause",l(r===0?"When":"And"),0),s?E(1,"div","input-label",s,0,{title:l("Input label: ")+s}):E(1,"div","input-expression",o.text,0,{title:l("Input expression: ")+o.text}),E(1,"div","input-variable",a&&a.text||o.typeRef,0,{title:a&&a.text?l("Input values"):l("Input type")})],0,{"data-col-id":t.id},t.id)}function Ck(n,e){let{output:t,className:i,index:r}=n,{label:s,name:o,outputValues:a,typeRef:l}=t,c=e.injector.get("translate"),u=(i||"")+" output-cell";return E(1,"th",u,[E(1,"div","clause",c(r===0?"Then":"And"),0),s?E(1,"div","output-label",s,0,{title:c("Output label")}):E(1,"div","output-name",o,0,{title:c("Output name")}),E(1,"div","output-variable",a&&a.text||l,0,{title:a&&a.text?c("Output values"):c("Output type")})],0,null,t.id)}function Za(n){n.onGetComponent("table.head",()=>Ks)}Za.$inject=["components"];var cg={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",Za]};var xr=class extends z{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),zt(this)}render(){let e=this.sheet.getRoot();if(!Q(e,"dmn:DMNElement"))return null;let{name:t}=e.businessObject.$parent,i=this.components.getComponent("hit-policy")||Sk;return E(1,"div","decision-table-properties",[E(1,"div","decision-table-name",t,0,{title:this._translate("Decision name: ")+t}),E(1,"div","decision-table-header-separator"),F(2,i)],4)}};xr.$inject=["sheet","components"];function Sk(){return null}var Ek=500,br=class{constructor(e){e.onGetComponent("table.before",Ek,()=>xr)}};br.$inject=["components"];var ug={__init__:["decisionTableProperties"],decisionTableProperties:["type",br]};var Gs=class extends z{render(){let{row:e,rowIndex:t}=this.props,{components:i}=this.context,r=i.getComponents("cell-inner",{cellType:"rule-index",row:e,rowIndex:t});return E(1,"td","rule-index",[r&&r.map(s=>F(2,s,{row:e,rowIndex:t})),t+1],0,{"data-element-id":e.id,"data-row-id":e.id})}};var wr=class{constructor(e){e.onGetComponent("cell",({cellType:t})=>{if(t==="before-rule-cells")return Gs})}};wr.$inject=["components"];var fg={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",wr]};var Ak=[{label:"FEEL",value:"feel"}],Or=class{constructor(e){this._injector=e;let t=e.get("config.expressionLanguages")||{};this._config={options:Ak,defaults:{editor:"feel"}},t.options&&(this._config.options=t.options);let i=this._getLegacyDefaults();D(this._config.defaults,i,t.defaults)}getDefault(e){let{defaults:t}=this._config,i=t[e]||t.editor;return this._getLanguageByValue(i)||this.getAll()[0]}getLabel(e){let t=this._getLanguageByValue(e);return t?t.label:e}getAll(){return this._config.options}_getLegacyDefaults(){let e={},t=this._injector,i=t.get("config.defaultInputExpressionLanguage"),r=t.get("config.defaultOutputExpressionLanguage");return i&&(e.inputCell=i),r&&(e.outputCell=r),e}_getLanguageByValue(e){return we(this.getAll(),t=>e===t.value)}};Or.$inject=["injector"];var Ru={__init__:["expressionLanguages"],expressionLanguages:["type",Or]};var kr=class{constructor(e){this._feelLanguageContext=e}getConfig(){return this._feelLanguageContext}};kr.$inject=["config.feelLanguageContext"];var Pu={__init__:["feelLanguageContext"],feelLanguageContext:["type",kr]};var Js=class extends z{render({rows:e,cols:t}){let{components:i}=this.context;return E(1,"tbody",null,e.map((r,s)=>{let o=i.getComponent("row",{rowType:"rule"});return o&&F(2,o,{row:r,rowIndex:s,cols:t},r.id)}),0)}};var Zs=class extends z{constructor(e,t){super(e,t),cn(this,Ci)}render(){let{row:e,rowIndex:t,cols:i}=this.props,{cells:r}=e;return E(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:e,rowIndex:t}}),r.map((s,o)=>this.slotFill({type:"cell",context:{cellType:"rule",cell:s,rowIndex:t,colIndex:o},key:s.id,row:e,col:i[o]})),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:e,rowIndex:t}})],0)}};var eo=class extends z{render(){let{cell:e,row:t,col:i}=this.props;return Q(e,"dmn:UnaryTests")?F(2,An,{className:"input-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":i.id,children:e.businessObject.text}):F(2,An,{className:"output-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":i.id,children:e.businessObject.text})}};var Cr=class{constructor(e){e.onGetComponent("table.body",()=>Js),e.onGetComponent("row",({rowType:t})=>{if(t==="rule")return Zs}),e.onGetComponent("cell",({cellType:t})=>{if(t==="rule")return eo})}};Cr.$inject=["components"];var hg={__depends__:[Ru,Pu],__init__:["decisionRules"],decisionRules:["type",Cr]};var dg=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}];var Sr=class extends z{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),zt(this)}getRoot(){return this.sheet.getRoot()}render(){let e=this.getRoot(),t=e.businessObject,{aggregation:i,hitPolicy:r}=t,s=we(dg,o=>_k(o.value,{aggregation:i,hitPolicy:r}));return E(1,"div","hit-policy header",[E(1,"label","dms-label",this._translate("Hit policy:"),0),E(1,"span","hit-policy-value",this._translate(s.label),0)],4,{title:this._translate(s.explanation)})}};Sr.$inject=["sheet"];function _k(n,e){return n.hitPolicy===e.hitPolicy&&n.aggregation===e.aggregation}function el(n){n.onGetComponent("hit-policy",()=>Sr)}el.$inject=["components"];var pg={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",el]};var to=class extends z{constructor(t,i){super(t,i);$(this,"onClick",()=>{this._eventBus.fire("showDrd")});let{injector:r}=i;this._translate=r.get("translate"),this._eventBus=r.get("eventBus")}render(){return E(1,"div","view-drd",E(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,t=>this.node=t)}};var Er=class{constructor(e,t,i,r){this._injector=i,this._sheet=r,e.onGetComponent("table.before",()=>{if(this.canViewDrd())return to}),t.on("showDrd",()=>{let s=i.get("_parent",!1),o=r.getRoot(),a=mg(o);if(!a)return;let l=s.getView(a);s.open(l)})}canViewDrd(){let e=this._injector.get("_parent",!1);if(!e)return!1;let t=this._sheet.getRoot(),i=mg(t);return!!e.getView(i)}};Er.$inject=["components","eventBus","injector","sheet"];function mg(n){let{businessObject:e}=n;return e?e.$parent.$parent:void 0}var gg={__init__:["viewDrd"],viewDrd:["type",Er]};var Ar=class{constructor(e){e.onGetComponent("table.before",()=>Kn)}};Ar.$inject=["components"];var yg={__init__:["poweredBy"],poweredBy:["type",Ar]};var no=class n extends eg{constructor(e={}){let t=n._createContainer();super(D(e,{renderer:{container:t}})),this._container=t}open(e){var t=this;return new Promise((i,r)=>{var s;try{return t._decision&&t.clear(),t._decision=e,tg(t,e,function(o,a){o?(o.warnings=a||[],r(o)):i({warnings:a||[]})})}catch(o){s=o}s?(s.warnings=s.warnings||[],r(s)):i({warnings:[]})})}_init(e){let{modules:t,additionalModules:i,...r}=e,s=t||this.getModules(),o=i||[],a=[{decisionTable:["value",this]}];return{modules:[yg,...s,...o,...a],config:r}}on(e,t,i,r){return this.get("eventBus").on(e,t,i,r)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}attachTo(e){if(!e)throw new Error("parentNode required");this.detach();let t=this._container;e.appendChild(t),this._emit("attach",{})}detach(){let e=this._container;e.parentNode&&(this._emit("detach",{}),$e(e))}destroy(){super.destroy(),this.detach()}getModules(){return n._getModules()}static _getModules(){return[og,lg,rt,cg,ug,fg,hg,pg,gg]}static _createContainer(){return le('<div class="dmn-decision-table-container"></div>')}};var _r=class{constructor(e){this._listeners={},e.on("elements.changed",({elements:t})=>{this.elementsChanged(t)}),e.on("element.updateId",({element:t,newId:i})=>{this.updateId(t.id,i)})}elementsChanged(e){let t={},i=e.length;for(let r=0;r<i;r++){let{id:s}=e[r];if(t[s])return;t[s]=!0;let o=this._listeners[s]&&this._listeners[s].length;if(o)for(let a=0;a<o;a++)this._listeners[s][a]&&this._listeners[s][a]()}}onElementsChanged(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}offElementsChanged(e,t){if(this._listeners[e])if(t){let i=this._listeners[e].indexOf(t);i!==-1&&this._listeners[e].splice(i,1)}else this._listeners[e].length=0}updateId(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}};_r.$inject=["eventBus"];var Tk=1e3,io=class{constructor(){this._listeners={}}getComponent(e,t){let i=this._listeners[e];if(!i)return;let r;for(let s=0;s<i.length&&(r=i[s].callback(t),!r);s++);return r}getComponents(e,t){let i=this._listeners[e];if(!i)return;let r=[];for(let s=0;s<i.length;s++){let o=i[s].callback(t);o&&r.push(o)}if(r.length)return r}onGetComponent(e,t,i){if(Ie(t)&&(i=t,t=Tk),!Ce(t))throw new Error("priority must be a number");let r=this._getListeners(e),s,o,a={priority:t,callback:i};for(o=0;s=r[o];o++)if(s.priority<t){r.splice(o,0,a);return}r.push(a)}offGetComponent(e,t){let i=this._getListeners(e),r,s,o;if(t)for(o=i.length-1;r=i[o];o--)s=r.callback,s===t&&i.splice(o,1);else i.length=0}_getListeners(e){let t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}};var ro=class extends z{constructor(e){super(e);let t=this._injector=e.injector;this._changeSupport=t.get("changeSupport"),this._components=t.get("components"),this._renderer=t.get("renderer")}getChildContext(){return{changeSupport:this._changeSupport,components:this._components,renderer:this._renderer,injector:this._injector}}render(){let e=this._components.getComponents("viewer");return E(1,"div","viewer-container",e&&e.map((t,i)=>F(2,t,null,i)),0)}};var Tr=class{constructor(e,t,i,r,s){let{container:o}=i;this._container=o,r.on("renderer.mount",()=>{or(F(2,ro,{injector:s}),o)}),r.on("renderer.unmount",()=>{or(null,o)})}getContainer(){return this._container}};Tr.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var vg={__init__:["changeSupport","components","renderer"],changeSupport:["type",_r],components:["type",io],eventBus:["type",ye],renderer:["type",Tr]};var Si=class{constructor(e={}){let{injector:t}=e;if(!t){let{modules:i,config:r}=this._init(e);t=Mk(r,i)}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("viewer.init")}_init(e){let{modules:t,...i}=e;return{modules:t,config:i}}destroy(){this.get("eventBus").fire("viewer.destroy")}clear(){this.get("eventBus").fire("viewer.clear")}};function Mk(n,e){let t=[{config:["value",n]},vg].concat(e||[]),i=new xi(t);return i.init(),i}var Mr=class{constructor(e,t){this._eventBus=t,this._viewer=e}getDecision(){return this._viewer.getDecision()}updateId(e,t){var i=this.getDecision();if(e!==i)throw new Error("element !== decision");this._eventBus.fire("element.updateId",{element:e,newId:t}),e.id=t}};Mr.$inject=["viewer","eventBus"];var xg={__init__:["elementRegistry"],elementRegistry:["type",Mr]};var so=class extends z{constructor(e,t){super(e,t),this._viewer=t.injector.get("viewer")}render(){let{name:e}=this._viewer.getDecision();return E(1,"div","decision-properties",E(1,"h3","decision-name",e,0),2)}};var Rk=1500,Rr=class{constructor(e){e.onGetComponent("viewer",Rk,()=>so)}};Rr.$inject=["components"];var bg={__init__:["decisionProperties"],decisionProperties:["type",Rr]};var oo=class extends z{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._viewer=t.injector.get("viewer")}render(){let{decisionLogic:e,variable:t}=this._viewer.getDecision();return E(1,"div","literal-expression-properties",E(1,"table",null,[E(1,"tr",null,[E(1,"td",null,this._translate("Variable name:"),0),E(1,"td",null,E(1,"span",null,t.name||"-",0),2)],4),E(1,"tr",null,[E(1,"td",null,this._translate("Variable type:"),0),E(1,"td",null,E(1,"span",null,this._translate(t.typeRef||"")||"-",0),2)],4),E(1,"tr",null,[E(1,"td",null,this._translate("Expression language:"),0),E(1,"td",null,E(1,"span",null,e.expressionLanguage||"-",0),2)],4)],4),2)}};var Pk=500,Pr=class{constructor(e){e.onGetComponent("viewer",Pk,()=>oo)}};Pr.$inject=["components"];var wg={__depends__:[],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",Pr]};var Dk=2e3,Dr=class{constructor(e){e.onGetComponent("viewer",Dk,()=>Kn)}};Dr.$inject=["components"];var Og={__init__:["poweredBy"],poweredBy:["type",Dr]};var ao=class extends z{constructor(e,t){super(e,t),this._viewer=t.injector.get("viewer")}render(){let{text:e}=this._viewer.getDecision().decisionLogic;return E(1,"div","textarea",E(1,"div","content",e,0),2)}};var Br=class{constructor(e){e.onGetComponent("viewer",()=>ao)}};Br.$inject=["components"];var kg={__init__:["textarea"],textarea:["type",Br]};var Ir=class extends z{constructor(t,i){super(t,i);$(this,"onClick",()=>{this._eventBus.fire("showDrd")});let{injector:r}=i;this._translate=r.get("translate"),this._eventBus=r.get("eventBus")}render(){return E(1,"div","view-drd",E(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,t=>this.node=t)}};Ir.$inject=["translate"];var Bk=2e3,$r=class{constructor(e,t,i,r){this._injector=r,this._viewer=t,e.onGetComponent("viewer",Bk,()=>{if(this.canViewDrd())return Ir}),i.on("showDrd",()=>{let s=r.get("_parent",!1),o=this.getDefinitions(),a=s.getView(o);s.open(a)})}canViewDrd(){let e=this._injector.get("_parent",!1);if(!e)return;let t=this.getDefinitions();return!!e.getView(t)}getDefinitions(){return Ik(this._viewer.getDecision())}};$r.$inject=["components","viewer","eventBus","injector"];function Ik(n){return n.$parent}var Cg={__init__:["viewDrd"],viewDrd:["type",$r]};var lo=class n extends Si{constructor(e={}){let t=n._createContainer();super(D(e,{renderer:{container:t}})),this._container=t}open(e){var t=this;return new Promise(function(i,r){var s;try{t._decision&&(t.clear(),t.get("eventBus").fire("renderer.unmount")),t._decision=e,t.get("eventBus").fire("import",e),t.get("eventBus").fire("renderer.mount")}catch(o){s=o}s?(s.warnings=s.warnings||[],r(s)):i({warnings:[]})})}_init(e){let{modules:t,additionalModules:i,...r}=e,s=t||this.getModules(),o=i||[],a=[{viewer:["value",this]}];return{modules:[...s,...o,...a],config:r}}on(e,t,i,r){return this.get("eventBus").on(e,t,i,r)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}getDecision(){return this._decision}attachTo(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}detach(){let e=this._container;e.parentNode&&(this._emit("detach",{}),$e(e))}destroy(){super.destroy(),this.detach()}getModules(){return n._getModules()}static _getModules(){return[xg,rt,bg,wg,Og,kg,Cg]}static _createContainer(){return le('<div class="dmn-literal-expression-container"></div>')}};var co=class{constructor(e){e.onGetComponent("viewer",()=>$k),e.onGetComponent("viewer",()=>Lk),e.onGetComponent("viewer",()=>Nk)}};$(co,"$inject",["components"]);function $k(n,{injector:e}){let i=e.get("components").getComponents("header");return E(1,"div","dmn-boxed-expression-section dmn-boxed-expression-header",i&&i.map((r,s)=>F(2,r,null,s)),0)}function Lk(n,{injector:e}){let i=e.get("components").getComponents("body");return E(1,"div","dmn-boxed-expression-section dmn-boxed-expression-body",i&&i.map((r,s)=>F(2,r,null,s)),0)}function Nk(n,{injector:e}){let i=e.get("components").getComponents("footer");return E(1,"div","dmn-boxed-expression-section dmn-boxed-expression-footer",i&&i.map((r,s)=>F(2,r,null,s)),0)}var uo=class{constructor(e){e.onGetComponent("viewer",()=>{let t=e.getComponents("table.before")||[];return()=>E(1,"div",null,t.map((i,r)=>F(2,i,null,r)),0)})}};$(uo,"$inject",["components"]);var Sg={__init__:["viewRenderer","tableJsSupport"],viewRenderer:["type",co],tableJsSupport:["type",uo]};var qk=2e3,Lr=class{constructor(e){e.onGetComponent("viewer",qk,()=>Kn)}};Lr.$inject=["components"];var Eg={__init__:["poweredBy"],poweredBy:["type",Lr]};var fo=class{constructor(e){e.onGetComponent("expression",({expression:t})=>{if(Q(t,"dmn:LiteralExpression"))return Fk})}};$(fo,"$inject",["components"]);function Fk({expression:n},e){let i=e.injector.get("literalExpression").getText(n);return E(1,"div","textarea",E(1,"div","content",i,0),2)}var Ei=class{getText(e){return e.get("text")}};var Ag={__init__:["literalExpressionComponent"],literalExpressionComponent:["type",fo],literalExpression:["type",Ei]};var ho=class{getParameters(e){return e.get("formalParameter")}getBody(e){return e.get("body")}getKind(e){return e.get("kind")||"FEEL"}};var po=class{constructor(e){e.onGetComponent("expression",({expression:t})=>{if(Q(t,"dmn:FunctionDefinition"))return jk})}};$(po,"$inject",["components"]);function jk({expression:n},e){let t=e.injector.get("functionDefinition"),i=t.getKind(n),r=t.getParameters(n),s=t.getBody(n);return E(1,"div","function-definition",[F(2,Qk,{kind:i}),F(2,zk,{parameters:r}),F(2,Hk,{expression:s})],4)}var Vk={FEEL:"F",Java:"J",PMML:"P"};function Qk({kind:n},e){let t=e.injector.get("translate");return E(1,"div","function-definition-kind",Vk[n],0,{title:t("Function kind: {kind}",{kind:n})})}function zk({parameters:n}){return E(1,"div","function-definition-parameters",E(1,"div",null,[xe("("),n.reduce((e,t)=>e.concat(F(2,Wk,{parameter:t}),", "),[]).slice(0,-1),xe(")")],0),2)}function Wk({parameter:n}){let{name:e,typeRef:t}=n,i=e||"<unnamed>";return E(1,"span",null,t?`${i}: ${t}`:i,0)}function Hk({expression:n},e){let t=e.components.getComponent("expression",{expression:n});return E(1,"div","function-definition-body",F(2,t,{expression:n}),2)}var _g={__init__:["functionDefinitionComponent"],functionDefinition:["type",ho],functionDefinitionComponent:["type",po]};var Nr=class extends z{constructor(t,i){super(t,i);$(this,"onClick",()=>{this._eventBus.fire("showDrd")});let{injector:r}=i;this._translate=r.get("translate"),this._eventBus=r.get("eventBus")}render(){return E(1,"div","view-drd",E(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,t=>this.node=t)}};Nr.$inject=["translate"];var Xk=2e3,qr=class{constructor(e,t,i){this._injector=i,e.onGetComponent("viewer",Xk,()=>{if(this.canViewDrd())return Nr}),t.on("showDrd",()=>{let r=i.get("_parent",!1),s=r.getDefinitions(),o=r.getView(s);r.open(o)})}canViewDrd(){let e=this._injector.get("_parent",!1);if(!e)return;let t=e.getDefinitions();return!!e.getView(t)}};qr.$inject=["components","eventBus","injector"];var Tg={__init__:["viewDrd"],viewDrd:["type",qr]};function Du(n,e){let t=e.injector.get("viewer"),{name:i}=t.getRootElement();return E(1,"div","element-properties",E(1,"h2","element-name",i,0),2)}var Fr=class{constructor(e){e.onGetComponent("header",()=>Du)}};Fr.$inject=["components"];var Mg={__init__:["elementProperties"],elementProperties:["type",Fr]};var Uk=100,jr=class{constructor(e){e.onGetComponent("body",()=>Yk),e.onGetComponent("expression",Uk,()=>Gk)}};$(jr,"$inject",["components"]);function Yk(n,{injector:e}){let t=e.get("components"),r=e.get("viewer").getRootElement(),s=Kk(r),o=t.getComponent("expression",{expression:s});return F(2,o,{expression:s})}function Kk(n){if(Q(n,"dmn:Decision"))return n.get("decisionLogic");if(Q(n,"dmn:BusinessKnowledgeModel"))return n.get("encapsulatedLogic")}function Gk({expression:n}){return E(1,"div",null,E(1,"span",null,[xe("Expression of type "),n.$type,xe(" is not supported.")],0,{style:"color:red;"}),2)}var Rg={__init__:["elementLogic"],elementLogic:["type",jr]};var Ai=class{constructor(e){this._viewer=e}getName(){let e=this.getVariable(),t=this._getElement();return(e?e.get("name"):null)||t.get("name")}getType(){let e=this.getVariable();return e?e.get("typeRef"):"Any"}_getElement(){return this._viewer.getRootElement()}getVariable(){return this._getElement().get("variable")}};$(Ai,"$inject",["viewer"]);var Vr=class{constructor(e){e.onGetComponent("footer",()=>Jk)}};$(Vr,"$inject",["components"]);function Jk(n,e){let t=e.injector.get("elementVariable"),i=e.injector.get("translate"),r=t.getName(),s=t.getType();return E(1,"div","element-variable",[E(1,"h2",null,xe("Result"),2),E(1,"div","element-variable-name",[E(1,"span","element-variable-name-label",i("Variable name"),0),E(1,"span",null,r,0)],4),E(1,"div","element-variable-type",[E(1,"span","element-variable-type-label",i("Variable type"),0),E(1,"span",null,s,0)],4)],4)}var Pg={__init__:["elementVariableComponent"],elementVariable:["type",Ai],elementVariableComponent:["type",Vr]};var Qr=class n extends Si{constructor(e={}){let t=n._createContainer();super(D(e,{renderer:{container:t}})),this._container=t}open(e){let t=this.get("eventBus");return new Promise((i,r)=>{let s;try{this.getRootElement()&&(this.clear(),t.fire("renderer.unmount")),this._setRootElement(e),t.fire("import",e),t.fire("renderer.mount")}catch(o){s=o}s?(s.warnings=s.warnings||[],r(s)):i({warnings:[]})})}_init(e){let{modules:t,additionalModules:i,...r}=e,s=t||this.getModules(),o=i||[],a=[{viewer:["value",this]}];return{modules:[...s,...o,...a],config:r}}on(e,t,i,r){return this.get("eventBus").on(e,t,i,r)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}getRootElement(){return this._root}_setRootElement(e){this._root=e}attachTo(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}detach(){let e=this._container;e.parentNode&&(this._emit("detach",{}),$e(e))}destroy(){super.destroy(),this.detach()}getModules(){return[Sg,rt,Eg,Tg,Mg,Rg,_g,Ag,Pg]}static _createContainer(){return le('<div class="dmn-boxed-expression-container"></div>')}};function Bu(n){let e={variables:[],rootElement:dC(n)};for(let t=n;t;t=t.$parent)Zk(t,e);return e.variables}function Zk(n,e){zr(n,"dmn:Decision")?eC(n,e):zr(n,"dmn:BusinessKnowledgeModel")?tC(n,e):zr(n,"dmn:Expression")&&uC(n,e)}function eC(n,e){for(let t of n.get("informationRequirement"))nC(t,e);for(let t of n.get("knowledgeRequirement"))Bg(t,e)}function tC(n,e){for(let t of n.get("knowledgeRequirement"))Bg(t,e)}function nC(n,e){let t=n.get("requiredInput");t&&iC(t,e);let i=n.get("requiredDecision");i&&rC(i,e)}function iC(n,e){let t=Iu(n,e.rootElement);if(!t)return;let i=t.get("name");i&&e.variables.push({name:i,origin:t})}function rC(n,e){let t=Iu(n,e.rootElement);if(!t)return;let i=t.get("name");if(!i)return;let r={name:i,origin:t},s=t.get("decisionLogic");s&&sC(s,r,e),e.variables.push(r)}function sC(n,e,t){if(zr(n,"dmn:DecisionTable")){let i=n.get("output");oC(i,e,t)}}function oC(n,e,t){if(n.length===1){let r={...Dg(n[0]),name:e.name};Object.assign(e,r);return}let i=n.map(Dg);e.entries=i.filter(r=>!!r.name)}function Dg(n){let e={name:n.name};return n.typeRef&&(e.detail=n.typeRef),e}function Bg(n,e){let t=n.get("requiredKnowledge");t&&aC(t,e)}function aC(n,e){let t=Iu(n,e.rootElement);t&&zr(t,"dmn:BusinessKnowledgeModel")&&lC(t,e)}function lC(n,e){let t=n.get("name");if(!t)return;let i={name:t,origin:n},r=n.get("encapsulatedLogic");r&&cC(r,i),e.variables.push(i)}function cC(n,e,t){let r=n.get("formalParameter").map((s,o)=>{let a={name:s.get("name")||`param ${o+1}`,type:s.get("typeRef")};return a.type||delete a.type,a});Object.assign(e,{type:"function",params:r})}function uC(n,e){zr(n,"dmn:FunctionDefinition")&&fC(n,e)}function fC(n,e){let t=n.get("formalParameter");for(let i of t)hC(i,e)}function hC(n,e){let t=n.get("name");if(!t)return;let i={name:t,origin:n};n.get("typeRef")&&(i.detail=n.get("typeRef")),e.variables.push(i)}function dC(n){let e=n;for(;e.$parent;)e=e.$parent;return e}function Iu(n,e){let t=n.get("href");if(!t||!t.startsWith("#"))return;let i=t.slice(1);return e.get("drgElement").find(s=>s.get("id")===i)}function zr(n,e){return n.$instanceOf(e)}var tl=class{constructor(e){e.registerProvider(this)}getVariables(e,t){return e.concat(Bu(t))}};tl.$inject=["variableResolver"];var pC=["string","boolean","number","date","time","dateTime","dayTimeDuration","yearMonthDuration","Any"],mo=class{constructor(e){this._dataTypes=e||pC}getAll(){return this._dataTypes}};mo.$inject=["config.dataTypes"];var mC=1e3;function st(n){this._eventBus=n}st.$inject=["eventBus"];function gC(n,e){return function(t){return n.call(e||null,t.context,t.command,t)}}st.prototype.on=function(n,e,t,i,r,s){if((Ie(e)||Ce(e))&&(s=r,r=i,i=t,t=e,e=null),Ie(t)&&(s=r,r=i,i=t,t=mC),dt(r)&&(s=r,r=!1),!Ie(i))throw new Error("handlerFn must be a function");_e(n)||(n=[n]);var o=this._eventBus;B(n,function(a){var l=["commandStack",a,e].filter(function(c){return c}).join(".");o.on(l,t,r?gC(i,s):i,s)})};st.prototype.canExecute=_n("canExecute");st.prototype.preExecute=_n("preExecute");st.prototype.preExecuted=_n("preExecuted");st.prototype.execute=_n("execute");st.prototype.executed=_n("executed");st.prototype.postExecute=_n("postExecute");st.prototype.postExecuted=_n("postExecuted");st.prototype.revert=_n("revert");st.prototype.reverted=_n("reverted");function _n(n){return function(t,i,r,s,o){(Ie(t)||Ce(t))&&(o=s,s=r,r=i,i=t,t=null),this.on(t,n,i,r,s,o)}}var Ig="id",go=class extends st{constructor(e){super(e),this.executed("element.updateProperties",this.updateIds.bind(this))}updateIds({context:e}){let{element:t,oldProperties:i,properties:r}=e,s=Ot(t);if(this.shouldSkipUpdate(s,i,r))return;let o=vC(s);o.get("drgElement").forEach(c=>{xC(c,i.id,r.id)}),o.get("artifact").forEach(c=>{bC(c,i.id,r.id)})}shouldSkipUpdate(e,t,i){return!yC(t,i)||!Q(e,"dmn:DRGElement")&&!Q(e,"dmn:TextAnnotation")}};go.$inject=["eventBus"];function yC(n,e){return Ig in n&&Ig in e}function vC(n){let e=n;for(;!Q(e,"dmn:Definitions");)e=e.$parent;return e}function xC(n,e,t){B({authorityRequirement:()=>{n.authorityRequirement.forEach(r=>{let{requiredAuthority:s,requiredDecision:o,requiredInput:a}=r;s&&s.href===`#${e}`&&(s.href=`#${t}`),o&&o.href===`#${e}`&&(o.href=`#${t}`),a&&a.href===`#${e}`&&(a.href=`#${t}`)})},informationRequirement:()=>{n.informationRequirement.forEach(r=>{let{requiredDecision:s,requiredInput:o}=r;s&&s.href===`#${e}`&&(s.href=`#${t}`),o&&o.href===`#${e}`&&(o.href=`#${t}`)})},knowledgeRequirement:()=>{n.knowledgeRequirement.forEach(r=>{let{requiredKnowledge:s}=r;s&&s.href===`#${e}`&&(s.href=`#${t}`)})}},(r,s)=>{n[s]&&r()})}function bC(n,e,t){B({sourceRef:()=>{let{sourceRef:r}=n;r.href===`#${e}`&&(r.href=`#${t}`)},targetRef:()=>{let{targetRef:r}=n;r.href===`#${e}`&&(r.href=`#${t}`)}},(r,s)=>{n[s]&&r()})}var $u="id",Wr=class{constructor(e,t){this._elementRegistry=e,this._moddle=t}execute(e){let{element:t,properties:i}=e,r=Ot(t),{changed:s,oldProperties:o}=this.updateProperties(r,i);return e.oldProperties=o,[...s,t]}revert(e){let{element:t,oldProperties:i}=e;var r=Ot(t),{changed:s}=this.updateProperties(r,i);return[...s,t]}updateProperties(e,t){let i=this._moddle.ids;return wt(t,(r,s,o)=>{let a=e.get(o);if($g(s)){if(!Lg(a)&&!$g(a))throw new Error(`non-existing property <${o}>: cannot update values`);let{changed:l,oldProperties:c}=this.updateProperties(a,s);return{changed:[...r.changed,...l,a],oldProperties:{...r.oldProperties,[o]:c}}}return o===$u&&wC(e,s)&&(i.unclaim(e[$u]),this._elementRegistry.updateId(e,s),i.claim(s,e)),e.set(o,s),{changed:r.changed,oldProperties:{...r.oldProperties,[o]:a}}},{changed:[],oldProperties:{}})}};Wr.$inject=["elementRegistry","moddle"];function wC(n,e){return n[$u]!==e}function $g(n){return ht(n)&&dt(n)&&!Lg(n)}function Lg(n){return!!(n!=null&&n.$type)}var yo=class{constructor(e,t,i){this._commandStack=e,this._viewer=t,this._eventBus=i,OC(this._getHandlers(),e)}_getHandlers(){return{"element.updateProperties":Wr}}updateProperties(e,t){let i={element:e,properties:t};this._commandStack.execute("element.updateProperties",i)}};yo.$inject=["commandStack","viewer","eventBus"];function OC(n,e){B(n,function(t,i){e.registerHandler(i,t)})}var Kg=Pb(qg());function SC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Lu,Fg;function EC(){if(Fg)return Lu;Fg=1,Lu=n;function n(e,t){return e^t}return Lu}var Nu,jg;function AC(){if(jg)return Nu;jg=1;var n=/\b(Array|Date|Object|Math|JSON)\b/g;Nu=function(s,o){var a=i(e(s));return o&&typeof o=="string"&&(o=r(o)),o?t(s,a,o):a};function e(s){return s.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(n,"").match(/[a-zA-Z_]\w*/g)||[]}function t(s,o,a){var l=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return s.replace(l,function(c){return c[c.length-1]=="("||~o.indexOf(c)?a(c):c})}function i(s){for(var o=[],a=0;a<s.length;a++)~o.indexOf(s[a])||o.push(s[a]);return o}function r(s){return function(o){return s+o}}return Nu}var qu,Vg;function _C(){if(Vg)return qu;Vg=1;var n=EC(),e=AC();qu=t;function t(r,s){if(!(this instanceof t))return new t(r,s);if(this.node=this.start=this.peeked=r,this.root=s,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],r&&this.higher(r))throw new Error("root must be a parent or ancestor to node")}t.prototype.reset=function(r){return this.node=r||this.start,this},t.prototype.revisit=function(r){return this._revisit=r==null?!0:r,this},t.prototype.opening=function(){return this.node.nodeType==1&&(this.closingTag=!1),this},t.prototype.atOpening=function(){return!this.closingTag},t.prototype.closing=function(){return this.node.nodeType==1&&(this.closingTag=!0),this},t.prototype.atClosing=function(){return this.closingTag},t.prototype.next=i("nextSibling","firstChild"),t.prototype.previous=t.prototype.prev=i("previousSibling","lastChild");function i(r,s){var o=r=="nextSibling";return function(l,c,u){l=this.compile(l),c=c&&c>0?c:1;for(var f=this.node,h=this.closingTag,d=this._revisit;f;){if(n(o,h)&&f[s])f=f[s],h=!o;else if(f.nodeType==1&&!f[s]&&n(o,h)){if(h=o,!d)continue}else if(f[r])f=f[r],h=!o;else if(f=f.parentNode,h=o,!d)continue;if(!f||this.higher(f,this.root))break;if(l(f)&&this.selects(f,u)&&this.rejects(f,u)){if(--c)continue;return u||(this.node=f),this.closingTag=h,f}}return null}}return t.prototype.select=function(r){return r=this.compile(r),this._selects.push(r),this},t.prototype.selects=function(r,s){var o=this._selects,a=o.length;if(!a)return!0;for(var l=0;l<a;l++)if(o[l].call(this,r,s))return!0;return!1},t.prototype.reject=function(r){return r=this.compile(r),this._rejects.push(r),this},t.prototype.rejects=function(r,s){var o=this._rejects,a=o.length;if(!a)return!0;for(var l=0;l<a;l++)if(o[l].call(this,r,s))return!1;return!0},t.prototype.higher=function(r){var s=this.root;if(!s)return!1;for(r=r.parentNode;r&&r!=s;)r=r.parentNode;return r!=s},t.prototype.compile=function(r){switch(typeof r){case"number":return function(s){return r==s.nodeType};case"string":return new Function("node","Object.freeze(node); return "+e(r,"node."));case"function":return r;default:return function(){return!0}}},t.prototype.peak=t.prototype.peek=function(r,s){return arguments.length==1&&(s=r,r=!0),s=s==null?1:s,s?s>0?this.next(r,s,!0):this.prev(r,Math.abs(s),!0):this.node},t.prototype.use=function(r){return r(this),this},qu}var TC=_C(),Qg=SC(TC),St=window.getSelection();function ju(n){St==null||St.removeAllRanges(),St==null||St.addRange(n)}function zg(){return St}function MC(n){if(!(St!=null&&St.rangeCount))return null;var e=St.focusNode;return nl(e)&&(e=e.parentNode),n==e||n.contains(e)}function Wg(n,e){var t=RC(n,e);ju(t)}function Hg(n){if(!MC(n))return null;var e=St.getRangeAt(0),t=e.startContainer,i=e.endContainer,r=e.startOffset,s=e.endOffset,o=Qg(n.firstChild,n),a=o.node,l,c=!1,u,f=0;function h(p,m){return arguments.length===1&&(m=p),p.parentNode===i&&m==i.childNodes[s]}function d(p,m){return arguments.length===1&&(m=p),p.parentNode===t&&m==t.childNodes[r]}for(;a&&(d(a)&&!c&&(u=f),!(h(a)||Fu(a)&&i===a));){if(c||(Fu(a)||l&&l.nextSibling==a&&(Xg(a)||Ug(a)))&&f++,nl(a)){if(t===a&&(u=f+r),i===a){f+=s;break}f+=a.textContent.length}if((nl(a)||c)&&(d(a,a.nextSibling)&&(u=f),h(a,a.nextSibling)))break;l=a,a=o.next(),c=o.closingTag}return{start:typeof u=="undefined"?f:u,end:f}}function RC(n,e){for(var t=e.start,i=e.end,r=document.createRange(),s=Qg(n.firstChild,n),o=s.node,a=!1,l=0,c;o;){if(l===t&&(a?r.setStartAfter(o):r.setStartBefore(o)),l===i)return a?r.setEndAfter(o):r.setEndBefore(o),r;if(a||(Fu(o)||o.previousSibling&&(Xg(o)||Ug(o)))&&l++,nl(o)){if(c=o.textContent.length,l<=t&&l+c>t&&r.setStart(o,t-l),l+c>i)return r.setEnd(o,i-l),r;l+=c}o=s.next(),a=s.closingTag}return l<=t&&(n.lastChild?r.setStartAfter(n.lastChild):r.setStart(n,0)),n.lastChild?r.setEndAfter(n.lastChild):r.setEnd(n,0),r}function nl(n){return n.nodeType===3}function Fu(n){return n.nodeType===1&&n.nodeName==="BR"}function Xg(n){return n.nodeType===1&&n.nodeName==="DIV"}function Ug(n){return n.nodeType===1&&n.nodeName==="P"}function Yg(n,e,t){var i=n.start,r=i,s=e.substring(i);t.lastIndexOf(s)===t.length-s.length&&(e=e.substring(0,e.length-s.length),t=t.substring(0,t.length-s.length));var o=PC(e,t);return o&&(o.type==="remove"?r=o.newStart:r=o.newEnd),DC(r)}function PC(n,e){var t,i,r,s=0,o,a,l=0;for(e.length>n.length?(i=e,o=n):(i=n,o=e);s<i.length;)r=i.charAt(s),a=o.charAt(l),r!==a?(t||(t={l_start:s,s_start:l}),s++):(t&&!t.complete&&(t.l_end=s,t.s_end=l,t.complete=!0),l++,s++);if(t&&!t.complete&&(t.complete=!0,t.s_end=o.length,t.l_end=i.length),!!t)return e.length>n.length?{newStart:t.l_start,newEnd:t.l_end,type:"add"}:{newStart:t.s_start,newEnd:t.s_end,type:e.length<n.length?"remove":"replace"}}function DC(n,e){return{start:n,end:e===void 0?n:e}}var vo=class extends z{constructor(t,i){super(t,i);$(this,"onFocus",t=>{var i=this.props.onFocus;this.setState({focussed:!0}),typeof i=="function"&&i(t)});$(this,"onBlur",t=>{let{onBlur:i,onChange:r,value:s}=this.props;if(this.setState({focussed:!1}),typeof r=="function"&&this.node){let o=il(this.node);o!==s&&r(o)}typeof i=="function"&&i(t)});$(this,"onkeydown",t=>{if(t.which===13){if(t.preventDefault(),this.props.ctrlForNewline&&!$C(t)||this.props.singleLine)return;t.stopPropagation(),IC(),this.onInput(t)}});$(this,"onInput",t=>{var i=this.props.onInput;if(typeof i=="function"){var r=il(this.node);i(r)}});$(this,"onPaste",t=>{if(this.props.singleLine){let i=(t.clipboardData||window.clipboardData).getData("text");document.execCommand("insertText",!1,i.replace(/\n/g," ")),t.preventDefault()}});this.state={}}componentWillUpdate(t,i){var r=this.node,s=i.focussed&&Hg(r);this.selected=s&&{range:s,text:il(r)}}componentDidUpdate(){var t=this.selected;if(!t)return;let i=t.range,r=t.text,s=this.node,o=il(s),a=o!==r?Yg(i,r,o):i;Wg(s,a)}getClassName(){let{className:t,placeholder:i,value:r}=this.props;return[t||"","content-editable",!r&&i?"placeholder":""].join(" ")}render(t){var{label:i,value:r,placeholder:s}=t;return r=(0,Kg.default)(r).replace(/\r?\n/g,"<br/>")+"<br/>",E(1,"div",this.getClassName(),null,1,{"aria-label":i,role:"textbox","aria-multiline":!this.props.singleLine,tabIndex:"0",contentEditable:"true",spellCheck:"false","data-placeholder":s||"",onInput:this.onInput,onkeypress:this.onkeypress,onPaste:this.onPaste,onFocus:this.onFocus,onBlur:this.onBlur,onkeydown:this.onkeydown,dangerouslySetInnerHTML:{__html:r}},null,o=>this.node=o)}};function BC(){return document.createElement("br")}function il(n){return n.innerText.replace(/\n$/,"")}function IC(){var n=zg(),e=n.getRangeAt(0);if(e){var t=e.cloneRange(),i=BC();t.deleteContents(),t.insertNode(i),t.setStartAfter(i),t.setEndAfter(i),ju(t)}}function $C(n){return n.metaKey||n.ctrlKey}var xo=class extends z{constructor(t,i){super(t,i);$(this,"onFocus",t=>{this.setState({focussed:!0});var{onFocus:i}=this.props;typeof i=="function"&&i(t)});$(this,"onBlur",t=>{this.setState({focussed:!1});let{invalid:i}=this.state;i&&this.setState({changing:!1,invalid:!1});let{onBlur:r}=this.props;typeof r=="function"&&r(t)});this.state={changing:!1,focussed:!1};let{injector:r}=i,s=r.get("debounceInput");this.inputChanged=s(o=>{let{onChange:a}=this.props;typeof a=="function"&&a(o);let l=this.state.changing;this.setState({changing:l===o?!1:l})}),this.onInput=o=>{var a=this.props.validate||function(){},l=a(o);this.setState({changing:o,invalid:l}),l||this.inputChanged(o)}}getClassName(){var{className:t,value:i}=this.props,{changing:r,focussed:s,invalid:o}=this.state;return t+=" editable",s&&(t+=" focussed"),o&&(t+=" invalid"),!i&&!r&&(t+=" empty"),t}getDisplayValue(){var{value:t,placeholder:i}=this.props,{focussed:r,changing:s}=this.state;return typeof s=="string"&&(t=s),t||(t=r?"":i||""),t}getEditor(t={}){return F(2,vo,{className:t.className,ctrlForNewline:this.props.ctrlForNewline,label:this.props.label,onFocus:this.onFocus,onBlur:this.onBlur,onInput:this.onInput,value:this.getDisplayValue()})}};var Qu=[],ey=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?ey:Qu).push(t=t+n[e])})();function LC(n){if(n<768)return!1;for(let e=0,t=Qu.length;;){let i=e+t>>1;if(n<Qu[i])t=i;else if(n>=ey[i])e=i+1;else return!0;if(e==t)return!1}}function Gg(n){return n>=127462&&n<=127487}var Jg=8205;function ty(n,e,t=!0,i=!0){return(t?ny:NC)(n,e,i)}function ny(n,e,t){if(e==n.length)return e;e&&iy(n.charCodeAt(e))&&ry(n.charCodeAt(e-1))&&e--;let i=Vu(n,e);for(e+=Zg(i);e<n.length;){let r=Vu(n,e);if(i==Jg||r==Jg||t&&LC(r))e+=Zg(r),i=r;else if(Gg(r)){let s=0,o=e-2;for(;o>=0&&Gg(Vu(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function NC(n,e,t){for(;e>0;){let i=ny(n,e-2,t);if(i<e)return i;e--}return 0}function Vu(n,e){let t=n.charCodeAt(e);if(!ry(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return iy(i)?(t-55296<<10)+(i-56320)+65536:t}function iy(n){return n>=56320&&n<57344}function ry(n){return n>=55296&&n<56320}function Zg(n){return n<65536?1:2}var J=class n{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Kr(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Xr.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Kr(this,e,t);let i=[];return this.decompose(e,t,i,0),Xr.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Mi(this),s=new Mi(e);for(let o=t,a=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new Mi(this,e)}iterRange(e,t=this.length){return new ll(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new cl(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?n.empty:e.length<=32?new mt(e):Xr.from(mt.split(e,[]))}},mt=class n extends J{constructor(e,t=qC(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((t?i:a)>=e)return new Wu(r,a,i,o);r=a+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new n(sy(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),a=al(s.text,o.text.slice(),0,s.length);if(a.length<=32)i.push(new n(a,o.length+s.length));else{let l=a.length>>1;i.push(new n(a.slice(0,l)),new n(a.slice(l)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof n))return super.replace(e,t,i);[e,t]=Kr(this,e,t);let r=al(this.text,al(i.text,sy(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new n(r,s):Xr.from(n.split(r,[]),s)}sliceString(e,t=this.length,i=` property
/plugin/yuriigantt/3rd/dhtmlxgantt/
Ddhtmlxgantt.js.map1colIndex","steps","correctTaskWorkTime","work_time","correct_work_time","getClosestWorkTime","cale…